From 7a674cec2b4a3e8267b334219e2fb5a926b1e5a6 Mon Sep 17 00:00:00 2001 From: WP Git Updater Bot Date: Thu, 1 Apr 2021 13:39:07 +0000 Subject: [PATCH] chore(plugins): Update stackable-ultimate-gutenberg-blocks from 2.13.2 to 2.14.1 --- .../dist/admin_welcome.js | 6 +- .../dist/dummy-block-registration.js | 37 +- .../dist/editor_blocks.css | 2 +- .../dist/editor_blocks.js | 4 +- .../dist/editor_vendor.js | 43 +- .../dist/frontend_blocks.css | 2 +- .../dist/frontend_blocks.js | 2 +- .../block-design-library-preview.a8d74f0.jpg | Bin 0 -> 26856 bytes .../freemius/assets/css/admin/common.css | 2 +- .../freemius/assets/css/admin/connect.css | 2 +- .../freemius/includes/class-freemius.php | 50690 ++++++++-------- .../freemius/includes/class-fs-logger.php | 4 +- .../includes/entities/class-fs-site.php | 17 + .../includes/entities/class-fs-user.php | 17 - .../freemius/languages/freemius-cs_CZ.mo | Bin 59930 -> 60931 bytes .../freemius/languages/freemius-da_DK.mo | Bin 58864 -> 59840 bytes .../freemius/languages/freemius-en.mo | Bin 58177 -> 59161 bytes .../freemius/languages/freemius-es_ES.mo | Bin 61970 -> 62945 bytes .../freemius/languages/freemius-fr_FR.mo | Bin 62562 -> 63519 bytes .../freemius/languages/freemius-he_IL.mo | Bin 61224 -> 62213 bytes .../freemius/languages/freemius-hu_HU.mo | Bin 59307 -> 60199 bytes .../freemius/languages/freemius-it_IT.mo | Bin 60682 -> 61645 bytes .../freemius/languages/freemius-ja.mo | Bin 66410 -> 67335 bytes .../freemius/languages/freemius-nl_NL.mo | Bin 60674 -> 61628 bytes .../freemius/languages/freemius-ru_RU.mo | Bin 74731 -> 75599 bytes .../freemius/languages/freemius-ta.mo | Bin 92468 -> 93241 bytes .../freemius/languages/freemius-zh_CN.mo | Bin 55922 -> 56773 bytes .../freemius/languages/freemius.pot | 658 +- .../freemius/start.php | 6 +- .../freemius/templates/account.php | 8 +- .../freemius/templates/connect.php | 2064 +- .../templates/forms/license-activation.php | 4 +- .../plugin.php | 4 +- .../readme.txt | 36 +- .../src/fonts.php | 4 +- .../src/global-settings.php | 6 +- .../src/init.php | 2 + 37 files changed, 26889 insertions(+), 26731 deletions(-) create mode 100644 plugins/stackable-ultimate-gutenberg-blocks/dist/images/block-design-library-preview.a8d74f0.jpg diff --git a/plugins/stackable-ultimate-gutenberg-blocks/dist/admin_welcome.js b/plugins/stackable-ultimate-gutenberg-blocks/dist/admin_welcome.js index 4676743e..1c4c10b2 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/dist/admin_welcome.js +++ b/plugins/stackable-ultimate-gutenberg-blocks/dist/admin_welcome.js @@ -1,4 +1,4 @@ -var admin_welcome=function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},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=134)}([function(e,t){e.exports=wp.i18n},function(e,t){e.exports=stackable},function(e,t,n){"use strict";e.exports=n(104)},function(e,t){e.exports=wp.element},function(e,t){e.exports=wp.components},function(e,t){e.exports=lodash},function(e,t,n){var a; +var admin_welcome=function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},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=134)}([function(e,t){e.exports=wp.i18n},function(e,t){e.exports=stackable},function(e,t,n){"use strict";e.exports=n(104)},function(e,t){e.exports=wp.element},function(e,t){e.exports=lodash},function(e,t){e.exports=wp.components},function(e,t,n){var a; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see @@ -14,7 +14,7 @@ var admin_welcome=function(e){var t={};function n(a){if(t[a])return t[a].exports object-assign (c) Sindre Sorhus @license MIT -*/var a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(e){a[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,s=l(e),u=1;u0)},t.eventHasFiles=function(e){var t=!1;if(e.dataTransfer){var n=e.dataTransfer.types;for(var a in n)if("Files"===n[a]){t=!0;break}}return t},t.propTypes={className:l.default.string,targetClassName:l.default.string,draggingOverFrameClassName:l.default.string,draggingOverTargetClassName:l.default.string,onDragOver:l.default.func,onDragLeave:l.default.func,onDrop:l.default.func,dropEffect:l.default.oneOf(["copy","move","link","none"]),frame:function(e,t,n){var a=e[t];return null==a?new Error("Warning: Required prop `"+t+"` was not specified in `"+n+"`"):a===document||a instanceof HTMLElement?void 0:new Error("Warning: Prop `"+t+"` must be one of the following: document, HTMLElement!")},onFrameDragEnter:l.default.func,onFrameDragLeave:l.default.func,onFrameDrop:l.default.func},t.defaultProps={dropEffect:"copy",frame:"undefined"==typeof window?void 0:window.document,className:"file-drop",targetClassName:"file-drop-target",draggingOverFrameClassName:"file-drop-dragging-over-frame",draggingOverTargetClassName:"file-drop-dragging-over-target"},t}(o.default.PureComponent);t.FileDrop=s},function(e,t){e.exports="dist/images/components-button-controls-basic.b11a0a1.png"},function(e,t){e.exports="dist/images/components-button-controls-ghost.693bd0a.png"},function(e,t){e.exports="dist/images/components-button-controls-link.5941222.png"},function(e,t){e.exports="dist/images/components-button-controls-plain.9a9337a.png"},function(e,t){e.exports="dist/images/components-icon-controls-plain.08b10ae.png"},function(e,t){e.exports="dist/images/components-icon-controls-shaped.f4f347f.png"},function(e,t){e.exports="dist/images/components-icon-controls-outlined.ecba760.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1.b25dc1c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2.251f715.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3.a91efa1.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1.4c4319a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2.c441aac.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3.2409bb5.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4.9b307d9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1.ec684b9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2.4601b46.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3.4ef0451.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-grid.c178b51.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-grid.9c461c0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-grid.3921dc3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-grid.fe6e028.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-grid.5c04307.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-grid.111efd7.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-grid.ef73de3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-grid.146feaa.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-grid.5d65a3e.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-grid.906e9b0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-uneven.7045e09.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-uneven.a4f271c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-uneven.1983521.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-uneven.929b1cf.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-uneven.a346601.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-uneven.84b5000.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-uneven.42a4995.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-uneven.430f93a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-uneven.f1a848f.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-uneven.8099e5e.png"},,,,,,,,,,,,function(e,t,n){"use strict"; +*/var a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(e){a[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,s=l(e),u=1;u0)},t.eventHasFiles=function(e){var t=!1;if(e.dataTransfer){var n=e.dataTransfer.types;for(var a in n)if("Files"===n[a]){t=!0;break}}return t},t.propTypes={className:l.default.string,targetClassName:l.default.string,draggingOverFrameClassName:l.default.string,draggingOverTargetClassName:l.default.string,onDragOver:l.default.func,onDragLeave:l.default.func,onDrop:l.default.func,dropEffect:l.default.oneOf(["copy","move","link","none"]),frame:function(e,t,n){var a=e[t];return null==a?new Error("Warning: Required prop `"+t+"` was not specified in `"+n+"`"):a===document||a instanceof HTMLElement?void 0:new Error("Warning: Prop `"+t+"` must be one of the following: document, HTMLElement!")},onFrameDragEnter:l.default.func,onFrameDragLeave:l.default.func,onFrameDrop:l.default.func},t.defaultProps={dropEffect:"copy",frame:"undefined"==typeof window?void 0:window.document,className:"file-drop",targetClassName:"file-drop-target",draggingOverFrameClassName:"file-drop-dragging-over-frame",draggingOverTargetClassName:"file-drop-dragging-over-target"},t}(o.default.PureComponent);t.FileDrop=s},function(e,t){e.exports="dist/images/components-button-controls-basic.b11a0a1.png"},function(e,t){e.exports="dist/images/components-button-controls-ghost.693bd0a.png"},function(e,t){e.exports="dist/images/components-button-controls-link.5941222.png"},function(e,t){e.exports="dist/images/components-button-controls-plain.9a9337a.png"},function(e,t){e.exports="dist/images/components-icon-controls-plain.08b10ae.png"},function(e,t){e.exports="dist/images/components-icon-controls-shaped.f4f347f.png"},function(e,t){e.exports="dist/images/components-icon-controls-outlined.ecba760.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1.b25dc1c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2.251f715.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3.a91efa1.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1.4c4319a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2.c441aac.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3.2409bb5.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4.9b307d9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1.ec684b9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2.4601b46.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3.4ef0451.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-grid.c178b51.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-grid.9c461c0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-grid.3921dc3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-grid.fe6e028.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-grid.5c04307.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-grid.111efd7.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-grid.ef73de3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-grid.146feaa.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-grid.5d65a3e.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-grid.906e9b0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-uneven.7045e09.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-uneven.a4f271c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-uneven.1983521.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-uneven.929b1cf.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-uneven.a346601.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-uneven.84b5000.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-uneven.42a4995.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-uneven.430f93a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-uneven.f1a848f.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-uneven.8099e5e.png"},,,,,,,,,,,,function(e,t,n){"use strict"; /** @license React v16.12.0 * react.production.min.js * @@ -38,4 +38,4 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var a,r,i,l,o;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,u=null,c=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(c,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},a=function(e){null!==s?setTimeout(a,0,e):(s=e,setTimeout(c,0))},r=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},l=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,d=window.Date,g=window.setTimeout,m=window.clearTimeout;if("undefined"!=typeof console){var b=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var h=d.now();t.unstable_now=function(){return d.now()-h}}var v=!1,y=null,w=-1,O=5,k=0;l=function(){return t.unstable_now()>=k},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125j(l,n))void 0!==s&&0>j(s,l)?(e[a]=s,e[o]=n,a=o):(e[a]=l,e[i]=n,a=i);else{if(!(void 0!==s&&0>j(s,n)))break e;e[a]=s,e[o]=n,a=o}}}return t}return null}function j(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var P=[],T=[],B=1,M=null,N=3,I=!1,A=!1,D=!1;function R(e){for(var t=x(T);null!==t;){if(null===t.callback)E(T);else{if(!(t.startTime<=e))break;E(T),t.sortIndex=t.expirationTime,S(P,t)}t=x(T)}}function z(e){if(D=!1,R(e),!A)if(null!==x(P))A=!0,a(L);else{var t=x(T);null!==t&&r(z,t.startTime-e)}}function L(e,n){A=!1,D&&(D=!1,i()),I=!0;var a=N;try{for(R(n),M=x(P);null!==M&&(!(M.expirationTime>n)||e&&!l());){var o=M.callback;if(null!==o){M.callback=null,N=M.priorityLevel;var s=o(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?M.callback=s:M===x(P)&&E(P),R(n)}else E(P);M=x(P)}if(null!==M)var u=!0;else{var c=x(T);null!==c&&r(z,c.startTime-n),u=!1}return u}finally{M=null,N=a,I=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=o;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=N;N=e;try{return t()}finally{N=n}},t.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var n=N;N=t;try{return e()}finally{N=n}},t.unstable_scheduleCallback=function(e,n,l){var o=t.unstable_now();if("object"==typeof l&&null!==l){var s=l.delay;s="number"==typeof s&&0o?(e.sortIndex=s,S(T,e),null===x(P)&&e===x(T)&&(D?i():D=!0,r(z,s-o))):(e.sortIndex=l,S(P,e),A||I||(A=!0,a(L))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=N;return function(){var n=N;N=t;try{return e.apply(this,arguments)}finally{N=n}}},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=x(P);return n!==M&&null!==M&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[n(t)];return 0===r?r:r||a};return wp.element.createElement(P,h({design:a("Design",e.designDefault),size:a("Size","normal"),text:a("Text",""),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),icon:a("Icon"),iconPosition:a("IconPosition"),onChange:function(e){return t(v({},n("Text"),e))},url:a("Url"),newTab:a("NewTab"),noFollow:a("NoFollow"),onChangeUrl:function(e){return t(v({},n("Url"),e))},onChangeNewTab:function(e){return t(v({},n("NewTab"),e))},onChangeNoFollow:function(e){return t(v({},n("NoFollow"),e))},onChangeIcon:function(e){return t(v({},n("Icon"),e))},isSelected:e.isSelected},e))};y.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(y.Content=function(e){var t=function(t){return Object(b.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[t(n)];return 0===r?r:r||a};return wp.element.createElement(P.Content,h({design:n("Design",e.designDefault),size:n("Size","normal"),text:n("Text"),icon:n("Icon"),newTab:n("NewTab"),url:n("Url"),noFollow:n("NoFollow"),hoverEffect:n("HoverEffect"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow"),iconPosition:n("IconPosition")},e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};function w(){return(w=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=function(t){return Object(b.camelCase)(Object(s.sprintf)(e,t))},i=ge(n,r,""),l=a.importantSize,o=void 0!==l&&l,u=a.important,c=void 0===u||u,f=a.inherit,p=void 0===f||f,d=a.inheritMax,g=void 0===d?50:d,m=a.inheritMin,h={},v=i("FontSize"),y=i("TabletFontSize"),w=i("MobileFontSize");if("tablet"!==t&&"mobile"!==t)h={fontFamily:""!==i("FontFamily")?I(i("FontFamily")):void 0,fontSize:""!==v?de("".concat(v).concat(i("FontSizeUnit")||"px"),o):void 0,fontWeight:""!==i("FontWeight")?i("FontWeight"):void 0,textTransform:""!==i("TextTransform")?i("TextTransform"):void 0,letterSpacing:""!==i("LetterSpacing")?"".concat(i("LetterSpacing"),"px"):void 0,lineHeight:""!==i("LineHeight")?"".concat(i("LineHeight")).concat(i("LineHeightUnit")||"em"):void 0};else if("tablet"===t){if(h={lineHeight:""!==i("TabletLineHeight")?"".concat(i("TabletLineHeight")).concat(i("TabletLineHeightUnit")||"em"):void 0},p){var O=me(v,{min:m,max:g});O&&(h.fontSize="".concat(O).concat(i("FontSizeUnit")||"px"))}y&&(h.fontSize=i("TabletFontSize","%s".concat(i("TabletFontSizeUnit")||"px")))}else{if(h={lineHeight:""!==i("MobileLineHeight")?"".concat(i("MobileLineHeight")).concat(i("MobileLineHeightUnit")||"em"):void 0},p){var k=me(v,{min:m,max:g});k&&(h.fontSize="".concat(k).concat(i("FontSizeUnit")||"px"));var C=me(y,{min:m,max:g});C?h.fontSize="".concat(C).concat(i("TabletFontSizeUnit")||"px"):(k||y)&&(h.fontSize=void 0)}w&&(h.fontSize=i("MobileFontSize","%s".concat(i("MobileFontSizeUnit")||"px")))}return c?pe(h):h},R=n(7);function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F={},U=function(){F=function(e){for(var t=1;t'.concat(e.map(function(e){return"<".concat(e,">")}).join(),""),!document||!document.body)return{};document.body.appendChild(t);var n={};return e.forEach(function(e){var a=window.getComputedStyle(t.querySelector(e)).getPropertyValue("font-size");n[e]=Math.round(parseFloat(a))}),document.body.removeChild(t),n}(["h1","h2","h3","h4","h5","h6","p"]))};Object(R.addFilter)("stackable.global-settings.typography.editor-styles","stackable/default-font-sizes",function(e,t,n,a){return e[".ugb-default-font-size .wp-block ".concat(t)]=D("%s","desktop",a,{important:!0}),F={},e});var H=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(F).length&&!t||U(),F[e]||F.p||21};Object(r.a)(function(){U()});var V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){return Object(b.camelCase)(Object(s.sprintf)(e,t))},a=ge(t,n);return"gradient"===a("BackgroundColorType")||a("BackgroundMediaUrl")||a("TabletBackgroundMediaUrl")||a("MobileBackgroundMediaUrl")};var G=n(13),W=n.n(G);var q=n(2),K=n.n(q);function $(){return($=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return{width:e.media_details?e.media_details.width:"",height:e.media_details?e.media_details.height:"",source_url:e.source_url||""}},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?e.media_details&&e.media_details.sizes&&e.media_details.sizes[t]||ie(e):null};window._stackableCachedImageData={};var oe=function(e,t){var n=t("core").getMedia,a=e?n(e):null;return a&&void 0!==a.id&&(window._stackableCachedImageData[a.id]=a),a},se=function(e){return window._stackableCachedImageData[e]||null};n(28),n(22);function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ce(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return Object.keys(e).reduce(function(n,a){return ce({},n,fe({},a,de(e[a],t)))},{})},de=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""!==e&&void 0!==e&&t&&!String(e).match(/!important/i)?"".concat(e," !important"):e},ge=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return function(a){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n,l=null!==t?t:function(e){return Object(b.lowerFirst)(e)},o=void 0===e[l(a)]?"":e[l(a)];return""!==o?r?Object(s.sprintf)(r.replace(/%$/,"%%"),o):o:i}},me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.min,a=void 0===n?Number.NEGATIVE_INFINITY:n,r=t.max,i=void 0===r?Number.POSITIVE_INFINITY:r;if(""!==e){var l=Object(b.clamp)(e,parseFloat(a),parseFloat(i));if(!isNaN(l))return parseFloat(l)!==parseFloat(e)?l:void 0}};var be={facebook:{label:Object(s.__)("Facebook",o.i18n),icon:''},twitter:{label:Object(s.__)("Twitter",o.i18n),icon:''},instagram:{label:Object(s.__)("Instagram",o.i18n),icon:''},pinterest:{label:Object(s.__)("Pinterest",o.i18n),icon:''},linkedin:{label:Object(s.__)("LinkedIn",o.i18n),icon:''},youtube:{label:Object(s.__)("YouTube",o.i18n),icon:''},email:{label:Object(s.__)("Email",o.i18n),icon:''}},he=n(16);function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ye(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,a=Object(re.select)("core/block-editor"),r=a.getBlockName,i=a.getSelectedBlockClientId,l=a.getBlockAttributes,o=a.hasMultiSelection,s=a.getMultiSelectedBlockClientIds,u=Object(re.dispatch)("core/block-editor"),c=u.updateBlockAttributes,f=Object(re.select)("core/blocks"),p=f.getBlockType;if(n||!o()){var d=n||i();if(d){var g=l(d),m=r(d).replace(/^\w+\//g,""),h=p(r(d)).attributes,v=Object.keys(h).reduce(function(e,t){return ye({},e,we({},t,h[t]?h[t].default:""))},{}),y=Object(R.applyFilters)("stackable.".concat(m,".design.filtered-block-attributes"),ye({},v,{},t),g),w=Object(R.applyFilters)("stackable.".concat(m,".design.no-text-attributes"),y,g);A(w),c(d,Object(b.omit)(w,["uniqueClass"]))}}else s().forEach(function(n){e(t,n)})};function _e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Se=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Object(i.useState)(function(){try{var n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return t}}),a=_e(n,2),r=a[0],l=a[1],o=function(t){try{var n=t instanceof Function?t(r):t;l(n),window.localStorage.setItem(e,JSON.stringify(n))}catch(e){}};return[r,o]},xe=function(){return void 0!==he.registerBlockCollection};var Ee=function(e,t){var n=je(e,t);return n?n.html[0]:""},je=function(e,t){return window.FontAwesome?window.FontAwesome.icon({prefix:e,iconName:t}):null},Pe=n(17),Te=n.n(Pe);n(29);var Be=function(e){return e.match(/(mp4|webm|ogg)$/i)},Me="desktop",Ne=function(){return Me},Ie=!1,Ae=function(){return Ie};function De(){return(De=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[n(t)];return 0===r?r:r||a},r=Object.keys(be).reduce(function(e,r){var i;return ze({},e,(Le(i={},"".concat(r,"Url"),a("".concat(r,"Url"))),Le(i,"onChange".concat(Object(b.upperFirst)(r),"Url"),function(e){return t(Le({},n("".concat(r,"Url")),e))}),i))},{});return wp.element.createElement($e,De({design:a("Design",e.designDefault),size:a("Size","normal"),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),useSocialColors:a("UseSocialColors"),newTab:a("NewTab"),onChangeNewTab:function(e){return t(Le({},n("NewTab"),e))},isSelected:e.isSelected},r,e))};Fe.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(Fe.Content=function(e){var t=function(t){return Object(b.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[t(n)];return 0===r?r:r||a},a=Object.keys(be).reduce(function(e,t){return ze({},e,Le({},"".concat(t,"Url"),n("".concat(t,"Url"))))},{});return wp.element.createElement($e.Content,De({design:n("Design",e.designDefault),size:n("Size","normal"),newTab:n("NewTab"),hoverEffect:n("HoverEffect"),useSocialColors:n("UseSocialColors"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow")},a,e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function He(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}var ct=Object(i.createElement)(function(e){var t=e.className,n=e.isPressed,a=function(e){for(var t=1;t * > *",".ugb-block-content > *",".ugb-content-wrapper",".ugb-top-separator",".ugb-bottom-separator",".ugb-inner-block",".ugb-main-block"],Zt=function(e){return function(e){for(var t=1;t0&&void 0!==a[0]&&a[0],fn&&!t){e.next=9;break}return e.next=4,Te()({path:"/wp/v2/stk_design_library".concat(t?"/reset":""),method:"GET"});case 4:return n=e.sent,e.next=7,n;case 7:fn=e.sent,t&&(pn={},dn=[]);case 9:return e.abrupt("return",fn);case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),bn=function(){var e=cn(regeneratorRuntime.mark(function e(t){var n,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=gn(t),pn[n]){e.next=8;break}return e.next=4,Te()({path:"/wp/v2/stk_block_designs/".concat(n),method:"GET"});case 4:return a=e.sent,e.next=7,a;case 7:pn[n]=e.sent;case 8:return e.abrupt("return",pn[n]);case 9:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),hn=function(){var e=cn(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(dn[t]){e.next=7;break}return e.next=3,Te()({path:"/wp/v2/stk_design/".concat(t),method:"GET"});case 3:return n=e.sent,e.next=6,n;case 6:dn[t]=e.sent;case 7:return e.abrupt("return",dn[t]);case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),vn=function(){var e=cn(regeneratorRuntime.mark(function e(){var t,n,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]&&a[0],e.next=3,Te()({path:"/wp/v2/stk_design_library_dev_mode/",method:"POST",data:{devmode:t}});case 3:return n=e.sent,e.next=6,n;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();Object(r.a)(function(){});var yn=function(){var e=cn(regeneratorRuntime.mark(function e(t){var n,a,r,i,l,o,s,u,c,f,p,d,g,m,b,h,v,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.type,a=void 0===n?"":n,r=t.block,i=void 0===r?"":r,l=t.mood,o=void 0===l?"":l,s=t.plan,u=void 0===s?"":s,c=t.colors,f=void 0===c?[]:c,p=t.categories,d=void 0===p?[]:p,g=t.search,m=void 0===g?"":g,b=t.reset,h=void 0!==b&&b,e.t0=Object,e.next=4,mn(h);case 4:return e.t1=e.sent,v=e.t0.values.call(e.t0,e.t1),a&&(v=v.filter(function(e){return e.type===a})),i&&(y=-1===i.indexOf("ugb/")?"ugb/".concat(i):i,v=v.filter(function(e){return e.block===y})),o&&(v=v.filter(function(e){return e.mood===o})),u&&(v=v.filter(function(e){return e.plan===u})),f&&f.length&&(v=v.filter(function(e){return e.colors.some(function(e){return f.includes(e)})})),d&&d.length&&(v=v.filter(function(e){return e.categories.some(function(e){return d.includes(e)})})),m&&m.toLowerCase().replace(/\s+/," ").trim().split(" ").forEach(function(e){v=v.filter(function(t){return["label","plan","block","tags","categories","colors"].some(function(n){return-1!==t[n].toString().toLowerCase().indexOf(e)})})}),e.abrupt("return",v);case 14:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),wn=function(){var e=cn(regeneratorRuntime.mark(function e(t){var n,a,r,i,l,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mn();case 2:if(n=e.sent,a=n[t],r=a.type,i=a.block,l=a.template,"block"!==r||!i){e.next=12;break}return e.next=8,bn(i);case 8:return o=e.sent,e.abrupt("return",o[t]);case 12:if(!l){e.next=16;break}return e.next=15,hn(t);case 15:return e.abrupt("return",e.sent);case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),On=function(){var e=cn(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Object,e.next=3,mn();case 3:return e.t1=e.sent,t=e.t0.values.call(e.t0,e.t1),e.abrupt("return",t.reduce(function(e,t){var n=t.block,a=t.type;return e.includes(n)||"block"!==a||e.push(n),e},[]));case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),kn=n(35),Cn=n.n(kn);function _n(){return(_n=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var xn=function(e){var t=e.image,n=e.label,a=e.className,r=Sn(e,["image","label","className"]),i=t?t.match(/https?:/i)?t:o.srcUrl?"".concat(o.srcUrl,"/").concat(t):t:"",u="free"!==r.plan,c=u&&!o.isPro&&o.showProNotice;if(u&&!o.isPro&&!o.showProNotice)return null;var f=p()(["ugb-design-layout-selector__item",a],{"is-premium":r.plan&&!o.isPro&&"free"!==r.plan,"is-locked":c}),d=c?"div":"button";return wp.element.createElement(d,_n({className:f},r),wp.element.createElement("div",{className:"ugb-design-layout-selector__wrapper"},c&&wp.element.createElement(l.Icon,{className:"ugb-design-layout-selector__lock",icon:"lock"}),c&&wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=design-library-learn-more&utm_campaign=learnmore&utm_medium=gutenberg",className:"ugb-design-layout-selector__item-premium-button ugb-shadow-4 button button-secondary",target:"_premium",title:Object(s.__)("Learn More",o.i18n)},Object(s.__)("Learn More",o.i18n)),wp.element.createElement("img",{className:"ugb-design-layout-selector__image",src:i,alt:n})),wp.element.createElement("div",{className:"ugb-design-layout-selector__label"},n))};xn.defaultProps={name:"",label:"",className:""};var En=xn;function jn(){return(jn=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var da=function(e){var t=e.imageSizes,n=e.value,a=e.className,r=pa(e,["imageSizes","value","className"]),i=function(e){return Object(b.map)(e,function(e){var t=e.name;return{value:e.slug,label:t}})}(t);return Object(b.isEmpty)(i)?null:wp.element.createElement(l.SelectControl,fa({},r,{value:n||"large",options:i,className:p()(a,["ugb--help-tip-image-size"])}))};da.defaultProps={className:"",label:Object(s.__)("Image Size"),value:"large",imageSizes:[],onChange:function(){}};var ga=Object(gt.compose)([Object(re.withSelect)(function(e){return{imageSizes:e("core/block-editor").getSettings().imageSizes}})])(da),ma=function(e){var t=e.label,n=e.setAttributes,a=e.enablePaddingTop,r=e.enablePaddingRight,l=e.enablePaddingBottom,o=e.enablePaddingLeft,s=e.attributes,u=s.columnPaddingTop,c=void 0===u?"":u,f=s.columnPaddingBottom,p=void 0===f?"":f,d=s.columnPaddingRight,g=void 0===d?"":d,m=s.columnPaddingLeft,b=void 0===m?"":m,h=s.columnPaddingUnit,v=void 0===h?"px":h,y=s.tabletColumnPaddingTop,w=void 0===y?"":y,O=s.tabletColumnPaddingBottom,k=void 0===O?"":O,C=s.tabletColumnPaddingRight,_=void 0===C?"":C,S=s.tabletColumnPaddingLeft,x=void 0===S?"":S,E=s.tabletColumnPaddingUnit,j=void 0===E?"px":E,P=s.mobileColumnPaddingTop,T=void 0===P?"":P,B=s.mobileColumnPaddingBottom,M=void 0===B?"":B,N=s.mobileColumnPaddingRight,I=void 0===N?"":N,A=s.mobileColumnPaddingLeft,D=void 0===A?"":A,R=s.mobileColumnPaddingUnit,z=void 0===R?"px":R;return wp.element.createElement(i.Fragment,null,wp.element.createElement(Du,{label:t,className:"ugb--help-tip-advanced-column-paddings",defaultLocked:!0,min:[0,0,0],max:[500,30,100],step:1,valueDesktop:{top:c,right:g,bottom:p,left:b},valueDesktopUnit:v,onChangeDesktop:function(e){n({columnPaddingTop:e.top,columnPaddingRight:e.right,columnPaddingBottom:e.bottom,columnPaddingLeft:e.left})},onChangeDesktopUnit:function(e){return n({columnPaddingUnit:e})},valueTablet:{top:w,right:k,bottom:_,left:x},valueTabletUnit:j,onChangeTablet:function(e){n({tabletColumnPaddingTop:e.top,tabletColumnPaddingBottom:e.right,tabletColumnPaddingRight:e.bottom,tabletColumnPaddingLeft:e.left})},onChangeTabletUnit:function(e){return n({tabletColumnPaddingUnit:e})},valueMobile:{top:T,right:M,bottom:I,left:D},valueMobileUnit:z,onChangeMobile:function(e){n({mobileColumnPaddingTop:e.top,mobileColumnPaddingBottom:e.right,mobileColumnPaddingRight:e.bottom,mobileColumnPaddingLeft:e.left})},onChangeMobileUnit:function(e){return n({mobileColumnPaddingUnit:e})},enableTop:a,enableRight:r,enableBottom:l,enableLeft:o}))};ma.defaultProps={setAttributes:function(){},label:Object(s.__)("Column Paddings",o.i18n),attributes:{},enablePaddingTop:!0,enablePaddingRight:!0,enablePaddingBottom:!0,enablePaddingLeft:!0};function ba(){return(ba=Object.assign||function(e){for(var t=1;t1&&this.props.screens.map(function(t,n){return n>0&&!e.state.isScreenPickerOpen&&!e.state.isMouseOver?null:wp.element.createElement("div",{key:n},wp.element.createElement(l.Button,{className:e.state.screen===t?"is-active":"",onClick:function(){return e.onChangeScreen(t)},icon:Ta[t],showTooltip:!1,label:Ba[t],"data-screen":t,onMouseEnter:function(){return e.setState({isMouseOver:t})},onMouseLeave:function(){return e.setState({isMouseOver:!1})}}),e.state.isMouseOver===t&&wp.element.createElement(l.Popover,{focusOnMount:!1,position:"bottom center",className:"components-tooltip","aria-hidden":"true"},Ba[t]))}))}}])&&xa(n.prototype,a),r&&xa(n,r),t}();Ma.defaultProps={screens:["desktop"],onChangeScreen:function(){}};var Na=Object(gt.withInstanceId)(Ma),Ia=function(e){return wp.element.createElement("div",{className:"ugb-base-control-multi-label"},wp.element.createElement("div",{className:"ugb-base-control-multi-label__label components-base-control__label"},e.label),wp.element.createElement(Na,{screens:e.screens,onChangeScreen:e.onChangeScreen}),wp.element.createElement("div",{className:"ugb-base-control-multi-label__units"},e.units.length>1&&e.units.map(function(t,n){return wp.element.createElement("button",{key:n,className:e.unit===t?"is-active":"",onClick:function(){return e.onChangeUnit(t)}},t)}),e.afterButton))};Ia.defaultProps={label:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],onChangeScreen:function(){},afterButton:null};var Aa=Ia;function Da(){return(Da=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var La=!!l.__experimentalNumberControl,Fa=function(e){var t=e.allowReset,n=e.withInputField,a=e.isShiftStepEnabled,r=za(e,["allowReset","withInputField","isShiftStepEnabled"]),u=Ra(Object(i.useState)(""===e.value||isNaN(e.value)?"":e.value),2),c=u[0],f=u[1],d=function(t){if(f(t),!isNaN(t)){var n=parseFloat(t);if(!isNaN(n))return void e.onChange(Object(b.clamp)(n,e.min,e.max))}e.onChange(e.resetFallbackValue)},g=p()(["ugb-range-control",e.className],{"ugb-range-control--blank":""===c}),m=""===c,h=e.initialPosition||e.placeholder||"",v=function(e,t,n){var a=(e-t)/(n-t)*100;return"".concat(Object(b.clamp)(a,0,100),"%")}((m?h:c)||e.sliderMin||e.min||0,e.sliderMin||e.min||0,e.sliderMax||e.max||100);return wp.element.createElement("div",{className:g,style:{"--ugb-advanced-range-control--width":v}},wp.element.createElement(l.RangeControl,Da({},r,{initialPosition:"",onChange:d,withInputField:!1,allowReset:!1,max:null!==e.sliderMax?e.sliderMax:e.max,min:null!==e.sliderMin?e.sliderMin:e.min})),n&&La&&wp.element.createElement(l.__experimentalNumberControl,{disabled:e.disabled,isShiftStepEnabled:a,max:e.max,min:e.min,onChange:d,onBlur:function(){if(!isNaN(c)){var t=parseFloat(c);if(!isNaN(t))return void f(Object(b.clamp)(t,e.min,e.max))}f(e.resetFallbackValue)},shiftStep:e.shiftStep,step:e.step,value:c,placeholder:null!==e.placeholder?e.placeholder:h}),t&&wp.element.createElement(l.Button,{className:"components-range-control__reset",disabled:e.disabled,isSecondary:!0,isSmall:!0,onClick:function(){f(e.resetFallbackValue),e.onChange(e.resetFallbackValue)}},Object(s.__)("Reset",o.i18n)))};Fa.defaultProps={className:"",allowReset:!1,withInputField:!0,isShiftStepEnabled:!0,max:1/0,min:-1/0,sliderMax:null,sliderMin:null,shiftStep:10,step:1,resetFallbackValue:"",placeholder:null,initialPosition:0,onChange:function(){}};var Ua=Fa;function Ha(e){return(Ha="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 Va(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Ga(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wa=function(e){var t=function(e){for(var t=1;t0});return a.length?a[0].options[0].label:e},ir=function(e){return e.value},lr=function(e){return wp.element.createElement("div",{className:"ugb--autosuggest-group"},e.title)},or=function(e){return e.options},sr=function(){return!0},ur=function(e){function t(){var e,n,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(e=!(a=Za(t).apply(this,arguments))||"object"!==nr(a)&&"function"!=typeof a?er(n):a).state={value:e.props.value,label:e.props.value?rr(e.props.value,e.props.options):e.props.value,suggestions:[],isEmpty:!1},e.onSuggestionsFetchRequested=e.onSuggestionsFetchRequested.bind(er(e)),e.onSuggestionsClearRequested=e.onSuggestionsClearRequested.bind(er(e)),e.onChange=e.onChange.bind(er(e)),e.onFocus=e.onFocus.bind(er(e)),e.autosuggestDiv=Object(i.createRef)(),e}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tr(e,t)}(t,i["Component"]),n=t,(a=[{key:"onChange",value:function(e,t){var n=t.newValue;this.props.onChange(n),this.setState({value:n,label:rr(n,this.props.options)})}},{key:"onFocus",value:function(){var e=this;this.props.highlightValueOnFocus&&setTimeout(function(){var t=e.autosuggestDiv.current.querySelector('[data-value="'.concat(e.state.value,'"]'));t&&t.scrollIntoView()},0)}},{key:"onSuggestionsFetchRequested",value:function(e){var t=e.value,n=e.reason;if("input-focused"!==n&&"suggestion-selected"!==n){var a=function(e,t){var n=e.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!n)return t;var a=new RegExp(n,"i");return ar(t)?t.map(function(e){return{title:e.title,options:e.options.filter(function(e){return a.test(e.label)||a.test(e.value)})}}).filter(function(e){return e.options.length>0}):t.filter(function(e){return a.test(e.label)||a.test(e.value)})}(t,this.props.options);this.setState({suggestions:a,isEmpty:""!==t.trim()&&0===a.length})}else this.setState({suggestions:this.props.options,isEmpty:!1})}},{key:"onSuggestionsClearRequested",value:function(){this.setState({suggestions:[]})}},{key:"render",value:function(){var e=this,t=this.state,n=t.label,a=t.suggestions,r={placeholder:"",value:n,onChange:this.onChange,onFocus:this.onFocus,type:"search"};return wp.element.createElement(l.BaseControl,{help:this.props.help,className:p()("ugb-advanced-autosuggest-control",this.props.className)},wp.element.createElement(Aa,{label:this.props.label,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-advanced-autosuggest-control__select",ref:this.autosuggestDiv},wp.element.createElement(Xa.a,{multiSection:ar(this.props.options),suggestions:a,focusInputOnSuggestionClick:!1,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:ir,renderSuggestion:function(t){return wp.element.createElement("div",{className:"ugb-autosuggest-option","data-value":t.value,id:"ugb-autosuggest-option--".concat(t.id||Object(b.kebabCase)(t.value))},e.props.renderOption?e.props.renderOption(t):t.label)},renderSectionTitle:lr,getSectionSuggestions:or,shouldRenderSuggestions:sr,inputProps:r}),this.state.isEmpty&&wp.element.createElement("div",{className:"ugb--autosuggest-empty"},this.props.noMatchesLabel),this.props.children))}}])&&Ja(n.prototype,a),r&&Ja(n,r),t}();ur.defaultProps={onChange:function(){},help:"",className:"",screens:["desktop"],options:[],value:"",noMatchesLabel:Object(s.__)("No matches found",o.i18n),renderOption:null,highlightValueOnFocus:!1};var cr=ur;function fr(){return(fr=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?1:Math.round(parseFloat(e)/parseFloat(t)*10)/10};return"string"==typeof t&&(t=[t,n(t)]),wp.element.createElement(qa,Fr({},e,{placeholder:t,onChangeUnit:function(t){""!==e.value&&("em"===t||"rem"===t?e.onChange(n(e.value)):"px"===t&&e.onChange(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?21:Math.round(parseFloat(e)*t)}(e.value))),e.onChangeUnit(t)}}))};Ur.defaultProps={label:Object(s.__)("Font Size",o.i18n),value:"",onChange:function(){},unit:"px",onChangeUnit:function(){},min:[0,0],max:[150,7],step:[1,.05],units:["px","em"],placeholder:""};var Hr=Ur;function Vr(){return(Vr=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(pi)}}]),e}();function pi(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function di(e,t){return Object.keys(e).reduce(function(n,a){return-1===t.indexOf(a)&&(n[a]=e[a]),n},{})}var gi={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},mi=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function bi(e,t){Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function hi(e,t){e.style["".concat(mi,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function vi(e,t){e.style["".concat(mi,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function yi(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function wi(e,t,n){return Math.max(e,Math.min(n,t))}function Oi(e){return"px"===e.substr(-2)?parseFloat(e):0}function ki(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function Ci(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function _i(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function Si(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var a={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?a:Si(e.parentNode,t,a)}}function xi(e){var t=e.lockOffset,n=e.width,a=e.height,r=t,i=t,l="px";if("string"==typeof t){var o=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);ui()(null!==o,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),r=parseFloat(t),i=parseFloat(t),l=o[1]}return ui()(isFinite(r)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===l&&(r=r*n/100,i=i*a/100),{x:r,y:i}}function Ei(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find(function(e){return n.test(t[e])})}(e)?e:Ei(e.parentNode):null}var ji=27,Pi=32,Ti=37,Bi=38,Mi=39,Ni=40,Ii={Anchor:"A",Button:"BUTTON",Canvas:"CANVAS",Input:"INPUT",Option:"OPTION",Textarea:"TEXTAREA",Select:"SELECT"};function Ai(e){return null!=e.sortableHandle}var Di=function(){function e(t,n){Xr(this,e),this.container=t,this.onScrollCallback=n}return Zr(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,a=e.minTranslate,r=e.maxTranslate,i=e.width,l=e.height,o={x:0,y:0},s={x:1,y:1},u=10,c=10,f=this.container,p=f.scrollTop,d=f.scrollLeft,g=f.scrollHeight,m=f.scrollWidth,b=0===p,h=g-p-f.clientHeight==0,v=0===d,y=m-d-f.clientWidth==0;n.y>=r.y-l/2&&!h?(o.y=1,s.y=c*Math.abs((r.y-l/2-n.y)/l)):n.x>=r.x-i/2&&!y?(o.x=1,s.x=u*Math.abs((r.x-i/2-n.x)/i)):n.y<=a.y+l/2&&!b?(o.y=-1,s.y=c*Math.abs((n.y-l/2-a.y)/l)):n.x<=a.x+i/2&&!v&&(o.x=-1,s.x=u*Math.abs((n.x-i/2-a.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===o.x&&0===o.y||(this.interval=setInterval(function(){t.isAutoScrolling=!0;var e={left:s.x*o.x,top:s.y*o.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)},5))}}]),e}();var Ri={axis:Ot.a.oneOf(["x","y","xy"]),contentWindow:Ot.a.any,disableAutoscroll:Ot.a.bool,distance:Ot.a.number,getContainer:Ot.a.func,getHelperDimensions:Ot.a.func,helperClass:Ot.a.string,helperContainer:Ot.a.oneOfType([Ot.a.func,"undefined"==typeof HTMLElement?Ot.a.any:Ot.a.instanceOf(HTMLElement)]),hideSortableGhost:Ot.a.bool,keyboardSortingTransitionDuration:Ot.a.number,lockAxis:Ot.a.string,lockOffset:Ot.a.oneOfType([Ot.a.number,Ot.a.string,Ot.a.arrayOf(Ot.a.oneOfType([Ot.a.number,Ot.a.string]))]),lockToContainerEdges:Ot.a.bool,onSortEnd:Ot.a.func,onSortMove:Ot.a.func,onSortOver:Ot.a.func,onSortStart:Ot.a.func,pressDelay:Ot.a.number,pressThreshold:Ot.a.number,keyCodes:Ot.a.shape({lift:Ot.a.arrayOf(Ot.a.number),drop:Ot.a.arrayOf(Ot.a.number),cancel:Ot.a.arrayOf(Ot.a.number),up:Ot.a.arrayOf(Ot.a.number),down:Ot.a.arrayOf(Ot.a.number)}),shouldCancelStart:Ot.a.func,transitionDuration:Ot.a.number,updateBeforeSortStart:Ot.a.func,useDragHandle:Ot.a.bool,useWindowAsScrollContainer:Ot.a.bool},zi={lift:[Pi],drop:[Pi],cancel:[ji],up:[Bi,Ti],down:[Ni,Mi]},Li={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:zi,shouldCancelStart:function(e){return-1!==[Ii.Input,Ii.Textarea,Ii.Select,Ii.Option,Ii.Button].indexOf(e.target.tagName)||!!yi(e.target,function(e){return"true"===e.contentEditable})},transitionDuration:300,useWindowAsScrollContainer:!1},Fi=Object.keys(Ri);var Ui={index:Ot.a.number.isRequired,collection:Ot.a.oneOfType([Ot.a.number,Ot.a.string]),disabled:Ot.a.bool},Hi=Object.keys(Ui);function Vi(){return(Vi=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Wi=function(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return Xr(this,n),Yr(ni(ni(t=ai(this,ri(n).call(this,e)))),"state",{}),Yr(ni(ni(t)),"handleStart",function(e){var n=t.props,a=n.distance,r=n.shouldCancelStart;if(2!==e.button&&!r(e)){t.touched=!0,t.position=_i(e);var i=yi(e.target,function(e){return null!=e.sortableInfo});if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var l=t.props.useDragHandle,o=i.sortableInfo,s=o.index,u=o.collection;if(o.disabled)return;if(l&&!yi(e.target,Ai))return;t.manager.active={collection:u,index:s},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||e.target.tagName!==Ii.Anchor||e.preventDefault(),a||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}}}),Yr(ni(ni(t)),"nodeIsChild",function(e){return e.sortableInfo.manager===t.manager}),Yr(ni(ni(t)),"handleMove",function(e){var n=t.props,a=n.distance,r=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=_i(e),l={x:t.position.x-i.x,y:t.position.y-i.y},o=Math.abs(l.x)+Math.abs(l.y);t.delta=l,a||r&&!(o>=r)?a&&o>=a&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}}),Yr(ni(ni(t)),"handleEnd",function(){t.touched=!1,t.cancel()}),Yr(ni(ni(t)),"cancel",function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)}),Yr(ni(ni(t)),"handlePress",function(e){try{var n=t.manager.getActive(),a=function(){if(n){var a=function(){var n,a,r,u,m,b,h=p.sortableInfo.index,v=(n=p,{bottom:Oi((a=window.getComputedStyle(n)).marginBottom),left:Oi(a.marginLeft),right:Oi(a.marginRight),top:Oi(a.marginTop)}),y=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:Oi(t.gridColumnGap),y:Oi(t.gridRowGap)}:{x:0,y:0}}(t.container),w=t.scrollContainer.getBoundingClientRect(),O=l({index:h,node:p,collection:d});if(t.node=p,t.margin=v,t.gridGap=y,t.width=O.width,t.height=O.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=w,t.index=h,t.newIndex=h,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=Si(p,t.container),t.initialOffset=_i(g?Qr({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((u="input, textarea, select, canvas, [contenteditable]",m=(r=p).querySelectorAll(u),ci((b=r.cloneNode(!0)).querySelectorAll(u)).forEach(function(e,t){"file"!==e.type&&(e.value=m[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===Ii.Canvas&&m[t].width>0&&m[t].height>0&&e.getContext("2d").drawImage(m[t],0,0)}),b)),bi(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-v.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-v.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),s&&(t.sortableGhost=p,bi(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var k=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,C=k.top,_=k.left,S=k.width,x=C+k.height,E=_+S;t.axis.x&&(t.minTranslate.x=_-t.boundingClientRect.left,t.maxTranslate.x=E-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=C-t.boundingClientRect.top,t.maxTranslate.y=x-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:w.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:w.left+w.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:w.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:w.top+w.height)-t.boundingClientRect.top-t.height/2);o&&o.split(" ").forEach(function(e){return t.helper.classList.add(e)}),t.listenerNode=e.touches?p:t.contentWindow,g?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(gi.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),gi.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)})),t.setState({sorting:!0,sortingIndex:h}),c&&c({node:p,index:h,collection:d,isKeySorting:g,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),g&&t.keyMove(0)},r=t.props,i=r.axis,l=r.getHelperDimensions,o=r.helperClass,s=r.hideSortableGhost,u=r.updateBeforeSortStart,c=r.onSortStart,f=r.useWindowAsScrollContainer,p=n.node,d=n.collection,g=t.manager.isKeySorting,m=function(){if("function"==typeof u){t._awaitingUpdateBeforeSortStart=!0;var n=function(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}(function(){var t=p.sortableInfo.index;return Promise.resolve(u({collection:d,index:t,node:p,isKeySorting:g},e)).then(function(){})},function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n});if(n&&n.then)return n.then(function(){})}}();return m&&m.then?m.then(a):a()}}();return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}),Yr(ni(ni(t)),"handleSortMove",function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)}),Yr(ni(ni(t)),"handleSortEnd",function(e){var n=t.props,a=n.hideSortableGhost,r=n.onSortEnd,i=t.manager,l=i.active.collection,o=i.isKeySorting,s=t.manager.getOrderedRefs();t.listenerNode&&(o?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(gi.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),gi.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)}))),t.helper.parentNode.removeChild(t.helper),a&&t.sortableGhost&&bi(t.sortableGhost,{opacity:"",visibility:""});for(var u=0,c=s.length;ua)){t.prevIndex=i,t.newIndex=r;var l=function(e,t,n){return et?e-1:e>n&&eb?b/2:this.height/2,width:this.width>m?m/2:this.width/2},v=u&&g>this.index&&g<=c,y=u&&g=c,w={x:0,y:0},O=l[f].edgeOffset;O||(O=Si(d,this.container),l[f].edgeOffset=O,u&&(l[f].boundingClientRect=Ci(d,r)));var k=f0&&l[f-1];k&&!k.edgeOffset&&(k.edgeOffset=Si(k.node,this.container),u&&(k.boundingClientRect=Ci(k.node,r))),g!==this.index?(t&&vi(d,t),this.axis.x?this.axis.y?y||gthis.containerBoundingRect.width-h.width&&k&&(w.x=k.edgeOffset.left-O.left,w.y=k.edgeOffset.top-O.top),null===this.newIndex&&(this.newIndex=g)):(v||g>this.index&&(o+i.left+h.width>=O.left&&s+i.top+h.height>=O.top||s+i.top+h.height>=O.top+b))&&(w.x=-(this.width+this.marginOffset.x),O.left+w.xthis.index&&o+i.left+h.width>=O.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=g):(y||gthis.index&&s+i.top+h.height>=O.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=g):(y||g1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return Xr(this,n),ai(this,ri(n).apply(this,arguments))}return li(n,q["Component"]),Zr(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,a=e.index,r=Object(oi.findDOMNode)(this);r.sortableInfo={collection:t,disabled:n,index:a,manager:this.context.manager},this.node=r,this.ref={node:r},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return ui()(a.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=a.withRef?"wrappedInstance":null;return Object(q.createElement)(e,Kr({ref:t},di(this.props,Hi)))}}]),n}(),Yr(t,"displayName",ki("sortableElement",e)),Yr(t,"contextTypes",{manager:Ot.a.object.isRequired}),Yr(t,"propTypes",Ui),Yr(t,"defaultProps",{collection:0}),n}(function(e){var t=e.value,n=(e.key,e.index,Gi(e,["value","key","index"]));return wp.element.createElement("div",Vi({className:"ugb-sort-control__item"},n),t)}),Ki=!1,$i=function e(t){for(var n=t.values?t.values.splice(0,t.num):Object(b.range)(t.num).map(function(e){return e+1});n.length=4?0:this.state.slide+1;this.setState({slide:e})}},{key:"prev",value:function(){var e=this.state.slide<=0?4:this.state.slide-1;this.setState({slide:e})}},{key:"render",value:function(){var e=this.props.tag;return wp.element.createElement(e,null,wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=".concat(this.props.buttonUtmSource,"&utm_campaign=learnmore&utm_medium=gutenberg"),target:"_premium",onClick:this.open,className:this.props.buttonClassName},this.props.button),this.state.isOpen&&wp.element.createElement(l.Modal,{className:"ugb-pro-modal",onRequestClose:this.close},wp.element.createElement("img",{src:"https://da4bu55kgdxvv.cloudfront.net/premium-popup.jpg",alt:Object(s.__)("Premium features",o.i18n)}),wp.element.createElement("div",{className:"ugb-pro-modal__footer"},wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=editor-modal-popup&utm_campaign=upgrade&utm_medium=gutenberg",className:"button button-secondary",target:"_premium",title:Object(s.__)("Upgrade to Premium",o.i18n)},wp.element.createElement(Pl,null),Object(s.__)("Upgrade to Premium",o.i18n)),wp.element.createElement("a",{href:"https://demo.wpstackable.com?utm_source=editor-modal-popup&utm_campaign=trydemo&utm_medium=gutenberg",target:"_premium",title:Object(s.__)("Try Premium Demo",o.i18n)},Object(s.__)("Try Premium Demo",o.i18n)))))}}])&&Bl(n.prototype,a),r&&Bl(n,r),t}();Al.defaultProps={button:Object(s.__)("Learn More",o.i18n),buttonClassName:"button button-secondary",tag:"div",buttonUtmSource:"editor-learn-more"};var Dl=Al;function Rl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var zl=function(e){var t=e.designId,n=e.image,a=e.label,r=e.onClick,o=e.plan,s=e.isPro,u=Rl(Object(i.useState)(!1),2),c=u[0],f=u[1],d=Rl(Object(i.useState)(!1),2),g=d[0],m=d[1],b=p()(["ugb-design-library-item"],function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({"ugb--is-busy":c},"ugb--is-".concat(o),!s&&"free"!==o));return wp.element.createElement("div",{className:b,onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)}},c&&wp.element.createElement("span",{className:"ugb-design-library-item__spinner","data-testid":"spinner"},wp.element.createElement(l.Spinner,null)),!s&&"free"!==o&&wp.element.createElement("span",{className:"ugb-design-library-item__premium","data-testid":"premium-tag"},o),wp.element.createElement("button",{className:"ugb-design-library-item__image",onClick:function(){(s||"free"===o)&&(f(!0),wn(t).then(function(e){f(!1),r(e)}))}},!s&&"free"!==o&&wp.element.createElement(l.Dashicon,{icon:"lock"}),wp.element.createElement("img",{src:n,alt:a,loading:"lazy"})),wp.element.createElement("footer",null,(s||"free"===o)&&wp.element.createElement("span",null,a),!s&&"free"!==o&&!g&&wp.element.createElement("span",null,a),!s&&"free"!==o&&g&&wp.element.createElement(Dl,{buttonClassName:"ugb-design-library-item__premium-link",button:wp.element.createElement(i.Fragment,null,e.premiumLabel)})))};zl.defaultProps={designId:"",image:"",label:"",onClick:function(){},plan:"free",isPro:o.isPro,premiumLabel:Object(s.__)("Go Premium",o.i18n)};var Ll=zl;var Fl=function(e){var t=e.designs,n=e.isBusy,a=e.onSelect,r=p()(["ugb-design-library-items"],function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},"ugb-design-library-items--columns-".concat(e.columns),!n&&e.columns));return wp.element.createElement("div",{className:r},(t||[]).map(function(e,t){return wp.element.createElement(Ll,{key:t,type:e.type,block:e.block,template:e.template,plan:e.plan,designId:e.id,image:e.image,label:e.label,onClick:function(e){a(e)}})}),n&&wp.element.createElement("div",{className:"ugb-design-library-search__spinner","data-testid":"spinner"},wp.element.createElement(l.Spinner,null)),!n&&!(t||[]).length&&wp.element.createElement("p",{className:"components-base-control__help","data-testid":"nothing-found-note"},Object(s.__)("No designs found",o.i18n)))};Fl.defaultProps={designs:[],columns:1,onSelect:function(){},isBusy:!1};var Ul=Fl;n(133);function Hl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Vl(e){for(var t=1;t0&&void 0!==i[0]?i[0]:"icon",n=i.length>1&&void 0!==i[1]?i[1]:o.fontAwesomeSearchProIcons,a='{ search(version: "latest", first: 50, query: "'.concat((t||"info").replace(/["'\\]/g,""),'") {\n\t\t\tid\n\t\t\tmembership {\n\t\t\t\tfree\n\t\t\t\t').concat(n?"pro":"","\n\t\t\t}\n\t\t} }"),e.next=5,fetch("https://api.fontawesome.com",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:a})}).then(function(e){return e.json()});case 5:return r=e.sent,e.abrupt("return",r.data.search.reduce(function(e,t){return Jo(t,n).forEach(function(t){e.push(t)}),e},[]));case 7:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function l(e){Qo(i,a,r,l,o,"next",e)}function o(e){Qo(i,a,r,l,o,"throw",e)}l(void 0)})});return function(){return t.apply(this,arguments)}}(),Jo=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[].concat(Yo(e.membership.free),Yo(t?e.membership.pro.filter(function(t){return!e.membership.free.includes(t)}):[]));return n.map(function(t){return{className:"fa".concat(t[0]," fa-").concat(e.id),prefix:"fa".concat(t[0]),iconName:e.id}})},Zo=n(55);function es(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ts=null,ns=null,as=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ugb-custom-icon";return e.match(/(]*class=["'])/)?e.replace(/(]*class=["'])/,"$1".concat(t," ")):e.match(/()([\s\S]*)/g,"$1"),n=0;n<2;n++)t=t.replace(/\s*([\s\S]*?)<\/g>\s*/gm,"$1");return t},is=function(e){var t=es(Object(i.useState)(""),2),n=t[0],a=t[1],r=es(Object(i.useState)([]),2),u=r[0],c=r[1],f=es(Object(i.useState)(!1),2),d=f[0],g=f[1],m=es(Object(i.useState)(!1),2),b=m[0],h=m[1],v=e.returnSVGValue;Object(i.useEffect)(function(){var e=!0;return clearTimeout(ts),ts=setTimeout(function(){e&&(g(!0),Xo(n).then(function(t){e&&c(t)}).finally(function(){e&&g(!1)}))},500),function(){e=!1,clearTimeout(ts)}},[n]),Object(i.useEffect)(function(){ns||(ns=wp.data.select("core/block-editor").getSettings().mediaUpload),b?wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:null}):wp.data.select("core/block-editor").getSettings().mediaUpload!==ns&&wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:ns})},[b]);var y=p()(["ugb-icon-popover__label-container"],{"ugb-icon--has-settings":o.isPro,"ugb-icon--has-upload":v,"ugb-icon--has-reset":e.allowReset});return wp.element.createElement(l.Popover,{className:"ugb-icon-popover",onClose:e.onClose,onClickOutside:e.onClickOutside,position:e.position,anchorRef:e.anchorRef},wp.element.createElement(l.PanelBody,null,wp.element.createElement(Zo.FileDrop,{onFrameDragEnter:function(){return h(!0)},onFrameDragLeave:function(){return h(!1)},onFrameDrop:function(){return h(!1)},onDrop:function(t){if(v&&t.length)if("image/svg+xml"===t[0].type){var n=new FileReader;n.onload=function(t){h(!1);var n=rs(as(t.target.result));e.onChange(n),e.onClose()},n.readAsText(t[0])}else h(!1);else h(!1)}},wp.element.createElement("div",{className:y},wp.element.createElement(l.TextControl,{className:"ugb-icon-popover__input",value:n,onChange:a,placeholder:Object(s.__)("Type to search icon",o.i18n)}),o.isPro&&wp.element.createElement(l.Button,{className:"ugb-icon-popover__settings-button",icon:"admin-generic",href:o.settingsUrl+"#icon-settings",target:"_settings",iconSize:"16",label:Object(s.__)("Icon Settings",o.i18n),showTooltip:!0,isSmall:!0,isSecondary:!0}),v&&wp.element.createElement(l.Button,{onClick:function(t){t.preventDefault();var n=document.createElement("input");n.accept="image/svg+xml",n.type="file",n.onchange=function(t){var n=t.target.files;if(n.length){var a=new FileReader;a.onload=function(t){h(!1);var n=rs(as(t.target.result));e.onChange(n),e.onClose()},a.readAsText(n[0])}else h(!1)},n.click()},isSmall:!0,isPrimary:!0,className:"components-range-control__upload"},Object(s.__)("Upload SVG",o.i18n)),e.allowReset&&wp.element.createElement(l.Button,{onClick:function(){e.onChange(""),e.onClose()},isSmall:!0,isSecondary:!0,className:"components-range-control__reset"},Object(s.__)("Clear icon",o.i18n))),wp.element.createElement("div",{className:"ugb-icon-popover__iconlist"},d&&wp.element.createElement(l.Spinner,null),!d&&u.map(function(t,n){var a=t.prefix,r=t.iconName,i="".concat(a,"-").concat(r);return wp.element.createElement("button",{key:n,className:"components-button ugb-prefix--".concat(a," ugb-icon--").concat(r),onClick:function(){e.returnSVGValue?e.onChange(rs(Ee(a,r))):e.onChange(i,a,r),e.onClose()}},wp.element.createElement(Sv,{prefix:a,iconName:r}))}),!d&&!u.length&&wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("No matches found",o.i18n))),v&&b&&wp.element.createElement("div",{className:"ugb-icon-popover__drop-indicator"},wp.element.createElement($o,{height:"40",width:"40"}),Object(s.__)("Drop your SVG here",o.i18n)))))};is.defaultProps={onChange:function(){},onClose:function(){},onClickOutside:function(){},returnSVGValue:!0,allowReset:!0,anchorRef:void 0,position:"center"};var ls=is,os=function(e){return wp.element.createElement(zd,{attrNameTemplate:"%sContentAlign",setAttributes:e.setAttributes,blockAttributes:e.blockAttributes},wp.element.createElement(bg,{label:e.label,className:p()([e.className,"ugb--help-tip-alignment-all"])}))};os.defaultProps={className:"",setAttributes:function(){},blockAttributes:{},label:Object(s.__)("Align",o.i18n)};var ss=function(){return wp.element.createElement("hr",{className:"ugb-control-separator"})};function us(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var cs=function(e){var t=e.color||"transparent";if(Array.isArray(t)){var n=us(t,2),a=n[0],r=n[1];t="linear-gradient(90deg, ".concat(a||"transparent",", ").concat(r||"transparent",")")}var u=p()(["components-circular-option-picker__option-wrapper","ugb-button-icon-popover-control-color-preview"],{"ugb-button-icon-popover-control-color-preview--transparent":!t||"transparent"===t});return wp.element.createElement(i.Fragment,null,wp.element.createElement("div",{className:u},wp.element.createElement(l.Button,{className:"components-circular-option-picker__option",label:Object(s.__)("Selected color",o.i18n),style:{background:t},onClick:e.onClick,ref:e._ref}),e.children))};cs.defaultProps={color:"",onClick:function(){},_ref:null};var fs=cs;function ps(){return(ps=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"full",n=se(e)||oe(e,re.select);return n?n.media_details.sizes[t]?n.media_details.sizes[t].source_url:n.source_url:""}(e.id,t||"full"))},className:"ugb--help-tip-image-size"}),e.onChangeBackgroundPosition&&wp.element.createElement($a,{label:Object(s.__)("Background Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.backgroundPosition,onChange:e.onChangeBackgroundPosition,className:"ugb--help-tip-background-image-position"}),e.onChangeBackgroundRepeat&&wp.element.createElement($a,{label:Object(s.__)("Background Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.backgroundRepeat,onChange:e.onChangeBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"}),e.onChangeBackgroundSize&&wp.element.createElement($a,{label:Object(s.__)("Background Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.backgroundSize,onChange:e.onChangeBackgroundSize,className:"ugb--help-tip-background-image-size"}),e.onChangeBackgroundSize&&"custom"===e.backgroundSize&&wp.element.createElement(qa,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%"],min:[0,0],max:[1e3,100],unit:e.backgroundCustomSizeUnit,onChangeUnit:e.onChangeBackgroundCustomSizeUnit,value:e.backgroundCustomSize,onChange:e.onChangeBackgroundCustomSize,allowReset:!0}))};Is.defaultProps={id:"",url:"",onChangeImage:function(e){e.url,e.id},size:"",onChangeSize:function(){},backgroundPosition:"",onChangeBackgroundPosition:function(){},backgroundRepeat:"",onChangeBackgroundRepeat:function(){},backgroundSize:"",onChangeBackgroundSize:function(){},backgroundCustomSizeUnit:"",onChangeBackgroundCustomSizeUnit:function(){},backgroundCustomSize:"",onChangeBackgroundCustomSize:function(){}};var As=Object(gt.compose)(Object(re.withSelect)(function(e,t){var n=e("core").getMedia;return oe(t.id,e),{imageData:t.id?n(t.id):null}}))(Is);function Ds(){return(Ds=Object.assign||function(e){for(var t=1;t0)&&wp.element.createElement(l.ToggleControl,{label:Object(s.__)("Fixed Background",o.i18n),checked:e.fixedBackground,onChange:e.onChangeFixedBackground,className:"ugb--help-tip-background-fixed"}),e.hasAdvancedBackground&&e.onChangeBackgroundMedia&&(e.backgroundMediaURL||e.tabletBackgroundMediaURL||e.mobileBackgroundMediaURL)&&wp.element.createElement(js,{label:Object(s.__)("Adv. Background Image Settings",o.i18n),onReset:e.onResetAdvancedBackground,allowReset:e.backgroundPosition||e.tabletBackgroundPosition||e.mobileBackgroundPosition||e.backgroundRepeat||e.tabletBackgroundRepeat||e.mobileBackgroundRepeat||e.backgroundSize||e.tabletBackgroundSize||e.mobileBackgroundSize||e.backgroundImageBlendMode},wp.element.createElement(Wd,null,wp.element.createElement($a,{label:Object(s.__)("Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.backgroundPosition,onChange:e.onChangeBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(Wd,{screen:"tablet"},wp.element.createElement($a,{label:Object(s.__)("Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.tabletBackgroundPosition,onChange:e.onChangeTabletBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(Wd,{screen:"mobile"},wp.element.createElement($a,{label:Object(s.__)("Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.mobileBackgroundPosition,onChange:e.onChangeMobileBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(Wd,null,wp.element.createElement($a,{label:Object(s.__)("Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.backgroundRepeat,onChange:e.onChangeBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(Wd,{screen:"tablet"},wp.element.createElement($a,{label:Object(s.__)("Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.tabletBackgroundRepeat,onChange:e.onChangeTabletBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(Wd,{screen:"mobile"},wp.element.createElement($a,{label:Object(s.__)("Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.mobileBackgroundRepeat,onChange:e.onChangeMobileBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(Wd,null,wp.element.createElement($a,{label:Object(s.__)("Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.backgroundSize,onChange:e.onChangeBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(Wd,{screen:"tablet"},wp.element.createElement($a,{label:Object(s.__)("Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.tabletBackgroundSize,onChange:e.onChangeTabletBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(Wd,{screen:"mobile"},wp.element.createElement($a,{label:Object(s.__)("Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.mobileBackgroundSize,onChange:e.onChangeMobileBackgroundSize,className:"ugb--help-tip-background-image-size"})),"custom"===e.backgroundSize&&wp.element.createElement(Wd,null,wp.element.createElement(qa,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.backgroundCustomSizeUnit,onChangeUnit:e.onChangeBackgroundCustomSizeUnit,value:e.backgroundCustomSize,onChange:e.onChangeBackgroundCustomSize,allowReset:!0})),"custom"===e.tabletBackgroundSize&&wp.element.createElement(Wd,{screen:"tablet"},wp.element.createElement(qa,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.tabletBackgroundCustomSizeUnit,onChangeUnit:e.onChangeTabletBackgroundCustomSizeUnit,value:e.tabletBackgroundCustomSize,onChange:e.onChangeTabletBackgroundCustomSize,allowReset:!0})),"custom"===e.mobileBackgroundSize&&wp.element.createElement(Wd,{screen:"mobile"},wp.element.createElement(qa,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.mobileBackgroundCustomSizeUnit,onChangeUnit:e.onChangeMobileBackgroundCustomSizeUnit,value:e.mobileBackgroundCustomSize,onChange:e.onChangeMobileBackgroundCustomSize,allowReset:!0})),e.onChangeBackgroundImageBlendMode&&wp.element.createElement(Fn,{label:Object(s.__)("Image Blend Mode",o.i18n),value:e.backgroundImageBlendMode,onChange:e.onChangeBackgroundImageBlendMode})))};qs.defaultProps={backgroundColorType:"",backgroundColor:"",backgroundColorOpacity:"",backgroundColor2:"",backgroundMediaID:"",backgroundMediaURL:"",tabletBackgroundMediaID:"",tabletBackgroundMediaURL:"",mobileBackgroundMediaID:"",mobileBackgroundMediaURL:"",backgroundTintStrength:"",fixedBackground:"",onChangeBackgroundColorType:function(){},onChangeBackgroundColor:function(){},onChangeBackgroundColorOpacity:function(){},onChangeBackgroundColor2:function(){},onChangeBackgroundMedia:function(e){e.url,e.id},onChangeTabletBackgroundMedia:function(e){e.url,e.id},onChangeMobileBackgroundMedia:function(e){e.url,e.id},onChangeBackgroundTintStrength:function(){},onChangeFixedBackground:function(){},labelBackgroundColorType:Object(s.__)("Background Color Type",o.i18n),labelBackgroundColor:Object(s.__)("Background Color",o.i18n),hasAdvancedGradient:!0,backgroundGradientDirection:"",backgroundGradientBlendMode:"",backgroundGradientLocation1:0,backgroundGradientLocation2:100,onResetAdvancedGradient:function(){},onChangeBackgroundGradientDirection:function(){},onChangeBackgroundGradientBlendMode:function(){},onChangeBackgroundGradientLocation1:function(){},onChangeBackgroundGradientLocation2:function(){},hasAdvancedBackground:!0,backgroundMediaAllowVideo:!0,backgroundPosition:"",tabletBackgroundPosition:"",mobileBackgroundPosition:"",backgroundRepeat:"",tabletBackgroundRepeat:"",mobileBackgroundRepeat:"",backgroundSize:"",tabletBackgroundSize:"",mobileBackgroundSize:"",backgroundCustomSize:"",tabletBackgroundCustomSize:"",mobileBackgroundCustomSize:"",backgroundCustomSizeUnit:"%",tabletBackgroundCustomSizeUnit:"%",mobileBackgroundCustomSizeUnit:"%",backgroundImageBlendMode:"",onResetAdvancedBackground:function(){},onChangeBackgroundPosition:function(){},onChangeTabletBackgroundPosition:function(){},onChangeMobileBackgroundPosition:function(){},onChangeBackgroundRepeat:function(){},onChangeTabletBackgroundRepeat:function(){},onChangeMobileBackgroundRepeat:function(){},onChangeBackgroundSize:function(){},onChangeTabletBackgroundSize:function(){},onChangeMobileBackgroundSize:function(){},onChangeBackgroundCustomSize:function(){},onChangeTabletBackgroundCustomSize:function(){},onChangeMobileBackgroundCustomSize:function(){},onChangeBackgroundCustomSizeUnit:function(){},onChangeTabletBackgroundCustomSizeUnit:function(){},onChangeMobileBackgroundCustomSizeUnit:function(){},onChangeBackgroundImageBlendMode:function(){}};var Ks=qs;function $s(){return($s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[n(t)];return 0===r?r:r||a};return wp.element.createElement(Ks,$s({backgroundColorType:e.blockAttributes[n("BackgroundColorType")]||"",backgroundColor:e.blockAttributes[n("BackgroundColor")]||"",backgroundColorOpacity:e.blockAttributes[n("BackgroundColorOpacity")],backgroundColor2:e.blockAttributes[n("BackgroundColor2")]||"",backgroundMediaID:e.blockAttributes[n("BackgroundMediaID")]||"",backgroundMediaURL:e.blockAttributes[n("BackgroundMediaURL")]||"",tabletBackgroundMediaID:e.blockAttributes[n("TabletBackgroundMediaID")]||"",tabletBackgroundMediaURL:e.blockAttributes[n("TabletBackgroundMediaURL")]||"",mobileBackgroundMediaID:e.blockAttributes[n("MobileBackgroundMediaID")]||"",mobileBackgroundMediaURL:e.blockAttributes[n("MobileBackgroundMediaURL")]||"",backgroundTintStrength:e.blockAttributes[n("BackgroundTintStrength")],fixedBackground:e.blockAttributes[n("FixedBackground")]||"",onChangeBackgroundColorType:function(e){return t(Ys({},n("BackgroundColorType"),e))},onChangeBackgroundColor:function(e){return t(Ys({},n("BackgroundColor"),e))},onChangeBackgroundColorOpacity:function(e){return t(Ys({},n("BackgroundColorOpacity"),e))},onChangeBackgroundColor2:function(e){return t(Ys({},n("BackgroundColor2"),e))},onChangeBackgroundMedia:function(e){var a,r=e.url,i=e.id;t((Ys(a={},n("BackgroundMediaURL"),r),Ys(a,n("BackgroundMediaID"),i),a))},onChangeTabletBackgroundMedia:function(e){var a,r=e.url,i=e.id;t((Ys(a={},n("TabletBackgroundMediaURL"),r),Ys(a,n("TabletBackgroundMediaID"),i),a))},onChangeMobileBackgroundMedia:function(e){var a,r=e.url,i=e.id;t((Ys(a={},n("MobileBackgroundMediaURL"),r),Ys(a,n("MobileBackgroundMediaID"),i),a))},onChangeBackgroundTintStrength:function(e,a){var r;t((Ys(r={},n("BackgroundTintStrength"),e),Ys(r,n("BackgroundColor"),a),r))},onChangeFixedBackground:function(e){return t(Ys({},n("FixedBackground"),e))},backgroundGradientDirection:a("BackgroundGradientDirection",90),backgroundGradientBlendMode:a("BackgroundGradientBlendMode"),backgroundGradientLocation1:a("BackgroundGradientLocation1",0),backgroundGradientLocation2:a("BackgroundGradientLocation2",100),onChangeBackgroundGradientDirection:function(e){return t(Ys({},n("BackgroundGradientDirection"),e))},onChangeBackgroundGradientBlendMode:function(e){return t(Ys({},n("BackgroundGradientBlendMode"),e))},onChangeBackgroundGradientLocation1:function(e){return t(Ys({},n("BackgroundGradientLocation1"),e))},onChangeBackgroundGradientLocation2:function(e){return t(Ys({},n("BackgroundGradientLocation2"),e))},onResetAdvancedGradient:function(){var e;t((Ys(e={},n("BackgroundGradientDirection"),""),Ys(e,n("BackgroundGradientBlendMode"),""),Ys(e,n("BackgroundGradientLocation1"),""),Ys(e,n("BackgroundGradientLocation2"),""),e))},backgroundPosition:e.blockAttributes[n("BackgroundPosition")]||"",tabletBackgroundPosition:e.blockAttributes[n("TabletBackgroundPosition")]||"",mobileBackgroundPosition:e.blockAttributes[n("MobileBackgroundPosition")]||"",backgroundRepeat:e.blockAttributes[n("BackgroundRepeat")]||"",tabletBackgroundRepeat:e.blockAttributes[n("TabletBackgroundRepeat")]||"",mobileBackgroundRepeat:e.blockAttributes[n("MobileBackgroundRepeat")]||"",backgroundSize:e.blockAttributes[n("BackgroundSize")]||"",tabletBackgroundSize:e.blockAttributes[n("TabletBackgroundSize")]||"",mobileBackgroundSize:e.blockAttributes[n("MobileBackgroundSize")]||"",backgroundCustomSize:e.blockAttributes[n("BackgroundCustomSize")]||"",tabletBackgroundCustomSize:e.blockAttributes[n("TabletBackgroundCustomSize")]||"",mobileBackgroundCustomSize:e.blockAttributes[n("MobileBackgroundCustomSize")]||"",backgroundCustomSizeUnit:e.blockAttributes[n("BackgroundCustomSizeUnit")]||"%",tabletBackgroundCustomSizeUnit:e.blockAttributes[n("TabletBackgroundCustomSizeUnit")]||"%",mobileBackgroundCustomSizeUnit:e.blockAttributes[n("MobileBackgroundCustomSizeUnit")]||"%",backgroundImageBlendMode:e.blockAttributes[n("BackgroundImageBlendMode")]||"",onChangeBackgroundPosition:function(e){return t(Ys({},n("BackgroundPosition"),e))},onChangeTabletBackgroundPosition:function(e){return t(Ys({},n("TabletBackgroundPosition"),e))},onChangeMobileBackgroundPosition:function(e){return t(Ys({},n("MobileBackgroundPosition"),e))},onChangeBackgroundRepeat:function(e){return t(Ys({},n("BackgroundRepeat"),e))},onChangeTabletBackgroundRepeat:function(e){return t(Ys({},n("TabletBackgroundRepeat"),e))},onChangeMobileBackgroundRepeat:function(e){return t(Ys({},n("MobileBackgroundRepeat"),e))},onChangeBackgroundSize:function(e){return t(Ys({},n("BackgroundSize"),e))},onChangeTabletBackgroundSize:function(e){return t(Ys({},n("TabletBackgroundSize"),e))},onChangeMobileBackgroundSize:function(e){return t(Ys({},n("MobileBackgroundSize"),e))},onChangeBackgroundCustomSize:function(e){return t(Ys({},n("BackgroundCustomSize"),e))},onChangeTabletBackgroundCustomSize:function(e){return t(Ys({},n("TabletBackgroundCustomSize"),e))},onChangeMobileBackgroundCustomSize:function(e){return t(Ys({},n("MobileBackgroundCustomSize"),e))},onChangeBackgroundCustomSizeUnit:function(e){return t(Ys({},n("BackgroundCustomSizeUnit"),e))},onChangeTabletBackgroundCustomSizeUnit:function(e){return t(Ys({},n("TabletBackgroundCustomSizeUnit"),e))},onChangeMobileBackgroundCustomSizeUnit:function(e){return t(Ys({},n("MobileBackgroundCustomSizeUnit"),e))},onChangeBackgroundImageBlendMode:function(e){return t(Ys({},n("BackgroundImageBlendMode"),e))},onResetAdvancedBackground:function(){var e;t((Ys(e={},n("BackgroundPosition"),""),Ys(e,n("TabletBackgroundPosition"),""),Ys(e,n("MobileBackgroundPosition"),""),Ys(e,n("BackgroundRepeat"),""),Ys(e,n("TabletBackgroundRepeat"),""),Ys(e,n("MobileBackgroundRepeat"),""),Ys(e,n("BackgroundSize"),""),Ys(e,n("TabletBackgroundSize"),""),Ys(e,n("MobileBackgroundSize"),""),Ys(e,n("BackgroundCustomSize"),""),Ys(e,n("TabletBackgroundCustomSize"),""),Ys(e,n("MobileBackgroundCustomSize"),""),Ys(e,n("BackgroundCustomSizeUnit"),"%"),Ys(e,n("TabletBackgroundCustomSizeUnit"),"%"),Ys(e,n("MobileBackgroundCustomSizeUnit"),"%"),Ys(e,n("BackgroundImageBlendMode"),""),e))}},e))};Qs.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{}};var Xs=n(56),Js=n.n(Xs),Zs=n(57),eu=n.n(Zs),tu=n(58),nu=n.n(tu),au=n(59),ru=n.n(au);function iu(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t$/g)?t:t.match(//g)||[t])[0]:t},Vu=function(e){var t=Lu({},e,{value:"string"==typeof e.value?Hu(e.value):e.value}),n=p()(["ugb-icon-inner-svg",e.className],Fu({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(Sv,Ru({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var r=p()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],Fu({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:r},a)}return e.showBackgroundShape&&(a=Uu(a,e.backgroundShape)),a=Object(R.applyFilters)("stackable.component.svg-icon",a,t)};Vu.defaultProps={className:"",value:"",design:"",colorType:"",showBackgroundShape:!1,backgroundShape:"",shadow:"",gradientColor1:"",gradientColor2:"",gradientDirection:0},(Vu.Content=function(e){var t=Lu({},e,{value:"string"==typeof e.value?Hu(e.value):e.value}),n=p()(["ugb-icon-inner-svg",e.className],Fu({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(Sv.Content,Ru({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var r=p()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],Fu({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:r},a)}return e.showBackgroundShape&&(a=Uu(a,e.backgroundShape)),a=Object(R.applyFilters)("stackable.component.svg-icon",a,t)}).defaultProps=Lu({},Vu.defaultProps);var Gu=Vu;function Wu(){return(Wu=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Qu=Object(gt.withInstanceId)(function(e){var t=Yu(Object(i.useState)(!1),2),n=t[0],a=t[1],r=Yu(Object(i.useState)(!1),2),o=r[0],s=r[1],u=e.instanceId,c=e.isOpen,f=e.onChange,p=$u(e,["instanceId","isOpen","onChange"]);return Object(i.useEffect)(function(){e.onToggle(n)},[n]),wp.element.createElement("div",{className:"ugb-svg-icon-placeholder ugb-svg-icon-placeholder-".concat(u)},wp.element.createElement(l.Button,{className:"ugb-svg-icon-placeholder__button",onClick:function(){o?(a(!1),s(!1)):a(!0)}},wp.element.createElement(Ku,p)),(null!==c&&c||null===c&&n)&&wp.element.createElement(ls,{onClickOutside:function(e){e.target&&e.target.closest(".ugb-svg-icon-placeholder-".concat(u))?s(!0):(a(!1),s(!1))},onClose:function(){return a(!1)},onChange:f}))});Qu.defaultProps={isOpen:null,className:"",value:"",onChange:function(){},onToggle:function(){}};var Xu=Qu;function Ju(){return(Ju=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeTop",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(kc({},this.getEnabledValues(),{top:n}))}},{key:"onChangeRight",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(kc({},this.getEnabledValues(),{right:n}))}},{key:"onChangeBottom",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(kc({},this.getEnabledValues(),{bottom:n}))}},{key:"onChangeLeft",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(kc({},this.getEnabledValues(),{left:n}))}},{key:"render",value:function(){var e=this.props.instanceId,t="ugb-four-number-control-".concat(e,"__item-");return wp.element.createElement(l.BaseControl,{help:this.props.help,className:p()("ugb-four-number-control",this.props.className)},wp.element.createElement(Aa,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-four-number-control__wrapper"},wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-top")},wp.element.createElement("input",{id:"".concat(t,"-top"),type:"number",onChange:this.onChangeTop,"aria-label":Object(s.__)("Top",o.i18n),value:this.props.top,placeholder:this.props.enableTop?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableTop}),wp.element.createElement("span",null,Object(s.__)("Top",o.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-right")},wp.element.createElement("input",{id:"".concat(t,"-right"),type:"number",onChange:this.onChangeRight,"aria-label":this.props.label,value:this.props.right,placeholder:this.props.enableRight?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableRight}),wp.element.createElement("span",null,Object(s.__)("Right",o.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-bottom")},wp.element.createElement("input",{id:"".concat(t,"-bottom"),type:"number",onChange:this.onChangeBottom,"aria-label":this.props.label,value:this.props.bottom,placeholder:this.props.enableBottom?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableBottom}),wp.element.createElement("span",null,Object(s.__)("Bottom",o.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-left")},wp.element.createElement("input",{id:"".concat(t,"-left"),type:"number",onChange:this.onChangeLeft,"aria-label":this.props.label,value:this.props.left,placeholder:this.props.enableLeft?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableLeft}),wp.element.createElement("span",null,Object(s.__)("Left",o.i18n))),wp.element.createElement(l.Button,{className:this.state.locked?"ugb--is-locked":"",onClick:this.onToggleLock,icon:wp.element.createElement(l.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})})))}}])&&Sc(n.prototype,a),r&&Sc(n,r),t}();Pc.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0};Object(gt.withInstanceId)(Pc);function Tc(){return(Tc=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeAll",value:function(e){var t=e||0===e?e:"";this.props.onChange(this.filterOnlyEnabled({top:t,right:t,bottom:t,left:t}))}},{key:"onChangeTop",value:function(e){this.props.onChange(Qc({},this.getEnabledValues(),{top:e||0===e?e:""}))}},{key:"onChangeRight",value:function(e){this.props.onChange(Qc({},this.getEnabledValues(),{right:e||0===e?e:""}))}},{key:"onChangeBottom",value:function(e){this.props.onChange(Qc({},this.getEnabledValues(),{bottom:e||0===e?e:""}))}},{key:"onChangeLeft",value:function(e){this.props.onChange(Qc({},this.getEnabledValues(),{left:e||0===e?e:""}))}},{key:"render",value:function(){var e=this.props,t=e.instanceId,n=e.units,a=e.unit,r="ugb-four-range-control-".concat(t,"__item-"),u={min:this.props.min,max:this.props.max,step:this.props.step,placeholder:this.props.placeholder,initialPosition:this.props.initialPosition,sliderMin:this.props.sliderMin,sliderMax:this.props.sliderMax},c=n.indexOf(a)<0?0:n.indexOf(a);Array.isArray(this.props.min)&&(u.min=this.props.min[c]),Array.isArray(this.props.max)&&(u.max=this.props.max[c]),Array.isArray(this.props.sliderMin)&&(u.sliderMin=this.props.sliderMin[c]),Array.isArray(this.props.sliderMax)&&(u.sliderMax=this.props.sliderMax[c]),Array.isArray(this.props.step)&&(u.step=this.props.step[c]),Array.isArray(this.props.placeholder)&&(u.placeholder=this.props.placeholder[c]),Array.isArray(this.props.initialPosition)&&(u.initialPosition=this.props.initialPosition[c]);var f=p()(["ugb-four-range-control__lock"],{"ugb--is-locked":this.state.locked}),d=wp.element.createElement(l.Button,{className:f,onClick:this.onToggleLock,icon:wp.element.createElement(l.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})});return wp.element.createElement(l.BaseControl,{help:this.props.help,className:p()("ugb-four-range-control",this.props.className,{"ugb--locked":this.state.locked})},wp.element.createElement(Aa,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens,afterButton:d}),this.state.locked&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(qa,Kc({id:"".concat(r,"-all"),value:this.firstValue(),onChange:this.onChangeAll,allowReset:!0},u))),!this.state.locked&&wp.element.createElement(i.Fragment,null,this.props.enableTop&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Top",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Wc,null))),wp.element.createElement(qa,Kc({id:"".concat(r,"-top"),value:this.props.top,onChange:this.onChangeTop,allowReset:!0},u,{placeholder:this.props.placeholderTop||u.placeholder}))),this.props.enableRight&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Right",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Uc,null))),wp.element.createElement(qa,Kc({id:"".concat(r,"-right"),value:this.props.right,onChange:this.onChangeRight,allowReset:!0},u,{placeholder:this.props.placeholderRight||u.placeholder}))),this.props.enableBottom&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Bottom",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Nc,null))),wp.element.createElement(qa,Kc({id:"".concat(r,"-bottom"),value:this.props.bottom,onChange:this.onChangeBottom,allowReset:!0},u,{placeholder:this.props.placeholderBottom||u.placeholder}))),this.props.enableLeft&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Left",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Rc,null))),wp.element.createElement(qa,Kc({id:"".concat(r,"-left"),value:this.props.left,onChange:this.onChangeLeft,allowReset:!0},u,{placeholder:this.props.placeholderLeft||u.placeholder})))))}}])&&Jc(n.prototype,a),r&&Jc(n,r),t}();nf.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0,min:0,max:50,sliderMin:null,sliderMax:null,step:1,placeholder:"",placeholderTop:"",placeholderRight:"",placeholderBottom:"",placeholderLeft:"",initialPosition:""};var af=nf,rf=n(63),lf=n.n(rf),of=n(64),sf=n.n(of),uf=n(65),cf=n.n(uf),ff=n(66),pf=n.n(ff),df=n(67),gf=n.n(df),mf=n(68),bf=n.n(mf),hf=n(69),vf=n.n(hf),yf=n(70),wf=n.n(yf),Of=n(71),kf=n.n(Of),Cf=n(72),_f=n.n(Cf),Sf=n(73),xf=n.n(Sf),Ef=n(74),jf=n.n(Ef),Pf=n(75),Tf=n.n(Pf),Bf=n(76),Mf=n.n(Bf),Nf=n(77),If=n.n(Nf),Af=n(78),Df=n.n(Af),Rf=n(79),zf=n.n(Rf),Lf=n(80),Ff=n.n(Lf),Uf=n(81),Hf=n.n(Uf),Vf=n(82),Gf=n.n(Vf),Wf=n(83),qf=n.n(Wf),Kf=n(84),$f=n.n(Kf),Yf=n(85),Qf=n.n(Yf),Xf=n(86),Jf=n.n(Xf),Zf=n(87),ep=n.n(Zf),tp=n(88),np=n.n(tp),ap=n(89),rp=n.n(ap),ip=n(90),lp=n.n(ip),op=n(91),sp=n.n(op),up=n(92),cp=n.n(up);function fp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function pp(){return(pp=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,a=t.emitMouse,r=t.emitTouch;return jp({},e,{onMouseDown:xp(e.onMouseDown,a),onTouchStart:xp(e.onTouchStart,r)})}),n}return kp(t,q["Component"]),mp(t,[{key:"render",value:function(){var e=this.getRailProps,t=this.props,n=t.getEventData,a=t.activeHandleID,r=(0,t.children)({getEventData:n,activeHandleID:a,getRailProps:e});return r&&K.a.Children.only(r)}}]),t}();Pp.propTypes={};var Tp=Pp,Bp=function(e){function t(){return dp(this,t),vp(this,yp(t).apply(this,arguments))}return kp(t,q["Component"]),mp(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.values,a=e.scale,r=e.count,i=t({getEventData:e.getEventData,activeHandleID:e.activeHandleID,ticks:(n||a.getTicks(r)).map(function(e){return{id:"$$-".concat(e),value:e,percent:a.getValue(e)}})});return i&&K.a.Children.only(i)}}]),t}();Bp.propTypes={},Bp.defaultProps={count:10};var Mp=Bp;function Np(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Ip(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,a=t.emitMouse,r=t.emitTouch;return Ip({},e,{onMouseDown:xp(e.onMouseDown,a),onTouchStart:xp(e.onTouchStart,r)})}),n}return kp(t,q["Component"]),mp(t,[{key:"render",value:function(){for(var e=this.getTrackProps,t=this.props,n=t.children,a=t.left,r=t.right,i=t.scale,l=t.handles,o=t.getEventData,s=t.activeHandleID,u=i.getDomain(),c=[],f=0;f1&&void 0!==arguments[1]?arguments[1]:{},a=n.props,r=a.emitKeyboard,i=a.emitMouse,l=a.emitTouch;return zp({},t,{onKeyDown:xp(t.onKeyDown,function(t){return r(t,e)}),onMouseDown:xp(t.onMouseDown,n.autofocus,function(t){return i(t,e)}),onTouchStart:xp(t.onTouchStart,function(t){return l(t,e)})})}),n}return kp(t,q["Component"]),mp(t,[{key:"render",value:function(){var e=this.getHandleProps,t=this.props,n=t.activeHandleID,a=(0,t.children)({handles:t.handles,activeHandleID:n,getHandleProps:e});return a&&K.a.Children.only(a)}}]),t}();Lp.propTypes={};var Fp=Lp;function Up(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);tn.val?e?-1:1:n.val>t.val?e?1:-1:0}}function Gp(e,t,n,a){var r=e.findIndex(function(e){return e.key===t});if(-1!==r){var i=e[r],l=i.key;return i.val===n?e:[].concat(Up(e.slice(0,r)),[{key:l,val:n}],Up(e.slice(r+1))).sort(Vp(a))}return e}function Wp(e,t){if(!e)return[0,0];var n=e.getBoundingClientRect();return[t?n.top:n.left,t?n.bottom:n.right]}function qp(e){var t=e.type,n=void 0===t?"":t,a=e.touches;return!a||a.length>1||"touchend"===n.toLowerCase()&&a.length>0}function Kp(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function $p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,r=0;return{handles:e.map(function(e){var t=n.getValue(e);return e!==t&&(r+=1,Sp()(!a,"".concat(Hp," Invalid value encountered. Changing ").concat(e," to ").concat(t,"."))),t}).map(function(e,t){return{key:"$$-".concat(t),val:e}}).sort(Vp(t)),changes:r}}var Yp=function(e,t){return et?1:e>=t?0:NaN};var Qp,Xp;1===(Qp=Yp).length&&(Xp=Qp,Qp=function(e,t){return Yp(Xp(e),t)});var Jp=Array.prototype,Zp=(Jp.slice,Jp.map,Math.sqrt(50)),ed=Math.sqrt(10),td=Math.sqrt(2),nd=function(e,t,n){var a,r,i,l,o=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((a=t=0?(i>=Zp?10:i>=ed?5:i>=td?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(i>=Zp?10:i>=ed?5:i>=td?2:1)}(e,t,n))||!isFinite(l))return[];if(l>0)for(e=Math.ceil(e/l),t=Math.floor(t/l),i=new Array(r=Math.ceil(t-e+1));++ol?o:l)}),this.step=1,this.domain=[0,1],this.range=[0,1]},ld="undefined"!=typeof window&&"undefined"!=typeof document,od=function(){},sd=function(e,t,n,a){var r=a?e-t:e+t;return a?Math.max(n[0],r):Math.min(n[1],r)},ud=function(e,t,n,a){var r=a?e+t:e-t;return a?Math.min(n[1],r):Math.max(n[0],r)},cd=function(e){function t(){var e,n;dp(this,t);for(var a=arguments.length,r=new Array(a),i=0;i0)}if(-1===l)return t;for(var f=o?a:-a,p=0;pb,"".concat(Hp," Max must be greater than min (even if reversed). Max is ").concat(h,". Min is ").concat(b,"."));var v=$p(i||t.values,o,p,c),y=v.handles;(v.changes||void 0===i||i===t.values)&&(s(y.map(function(e){return e.val})),u(y.map(function(e){return e.val}))),g.step=r,g.values=i,g.domain=l,g.handles=y,g.reversed=o}else if(n=i,a=t.values,!(n===a||n.length===a.length&&n.reduce(function(e){return function(t,n,a){return t&&e[a]===n}}(a),!0))){var w=$p(i,o,p,c),O=w.handles;w.changes&&(s(O.map(function(e){return e.val})),u(O.map(function(e){return e.val}))),g.values=i,g.handles=O}return Object.keys(g).length?g:null}}]),t}();cd.propTypes={},cd.defaultProps={mode:1,step:.1,domain:[0,100],component:"div",rootProps:{},rootStyle:{},vertical:!1,reversed:!1,onChange:od,onUpdate:od,onSlideStart:od,onSlideEnd:od,disabled:!1,flatten:!1,warnOnChanges:!1};var fd=cd;fd.Rail=Tp,fd.Ticks=Mp,fd.Tracks=Dp,fd.Handles=Fp;function pd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function dd(){return(dd=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"right";if("left"===t)for(var n=e.length-1;n>=1;n--)if(e[n]<10){var a=10-e[n];e[n]=10,e[n-1]-=a}for(var r=0;r=1;l--)if(e[l]<10){var o=10-e[l];e[l]=10,e[l-1]-=o}return e};function yd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function wd(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);te[r]?"right":"left",!0)}),[a,n]}(a,r),2);i[0];(function(e,t,n){var a=Cd(e),r=vd(a,n);return _d(r)})(r,0,i[1]).forEach(function(e,n){t[n].val=e})}return t},step:1,onUpdate:function(t){return e.onChange(Cd(t))},domain:kd,values:_d(e.value)},wp.element.createElement(Tp,null,function(e){var t=e.getRailProps;return wp.element.createElement(bd,{getRailProps:t})}),wp.element.createElement(Fp,null,function(e){var t=e.handles,n=e.getHandleProps;return wp.element.createElement("div",{className:"slider-handles"},t.map(function(e){return wp.element.createElement(hd,{key:e.id,handle:e,domain:kd,getHandleProps:n})}))}))};Sd.defaultProps={onChange:function(){},value:[]};var xd=Sd;function Ed(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"";return Object(b.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=ge(e.blockAttributes,t,""),a=e.screens;return wp.element.createElement(i.Fragment,null,a.includes("desktop")&&wp.element.createElement(Wd,{screens:a},i.Children.toArray(e.children).map(function(a){return Object(i.cloneElement)(a,{value:n(),onChange:function(n){e.onChange?e.onChange(t(),n,""):e.setAttributes(Dd({},t(),n))}})})),a.includes("tablet")&&wp.element.createElement(Wd,{screens:a,screen:"tablet"},i.Children.toArray(e.children).map(function(a){return Object(i.cloneElement)(a,{value:n("Tablet"),placeholder:n("Tablet")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Tablet"),n,"Tablet"):e.setAttributes(Dd({},t("Tablet"),n))}})})),a.includes("mobile")&&wp.element.createElement(Wd,{screens:a,screen:"mobile"},i.Children.toArray(e.children).map(function(a){return Object(i.cloneElement)(a,{value:n("Mobile"),placeholder:n("Mobile")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Mobile"),n,"Mobile"):e.setAttributes(Dd({},t("Mobile"),n))}})})))};Rd.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},onChange:null,placeholder:"",screens:["desktop","tablet","mobile"]};var zd=Rd;function Ld(e){return(Ld="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 Fd(e,t){for(var n=0;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var yg={Edit:function(e){var t=e.blockProps,n=e.render,a=e.mainClass,r=e.blockTag,i=vg(e,["blockProps","render","mainClass","blockTag"]),l=t.blockName,o=t.attributes,s=o.anchor,u=void 0===s?"":s,c=o.design,f=o.blockTag,d=void 0===f?"div":f,g=p()([e.className],Object(R.applyFilters)("stackable.".concat(l,".main-block.classes"),{"ugb-main-block":a},t)),m=p()(["ugb-inner-block"],Object(R.applyFilters)("stackable.".concat(l,".main-block.inner-classes"),{},t)),b=""!==u?u:void 0,h=d||r||"div";return wp.element.createElement(h,hg({},i,{id:b,className:g}),t.styles,Object(R.applyFilters)("stackable.".concat(l,".edit.output.outer"),null,c,t),n&&wp.element.createElement("div",{className:m},Object(R.applyFilters)("stackable.".concat(l,".edit.output.before"),null,c,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(R.applyFilters)("stackable.".concat(l,".edit.output.after"),null,c,t)))}};yg.Edit.defaultProps={styles:null,mainClass:!0},yg.Save=function(e){var t=e.blockProps,n=e.render,a=e.mainClass,r=e.blockTag,i=vg(e,["blockProps","render","mainClass","blockTag"]),l=t.blockName,o=t.attributes,s=o.anchor,u=void 0===s?"":s,c=o.design,f=o.blockTag,d=void 0===f?"div":f,g=p()([e.className],Object(R.applyFilters)("stackable.".concat(l,".main-block.classes"),{"ugb-main-block":a},t)),m=p()(["ugb-inner-block"],Object(R.applyFilters)("stackable.".concat(l,".main-block.inner-classes"),{},t)),b=""!==u?u:void 0,h=d||r||"div";return wp.element.createElement(h,hg({},i,{id:b,className:g}),t.styles,Object(R.applyFilters)("stackable.".concat(l,".save.output.outer"),null,c,t),n&&wp.element.createElement("div",{className:m},Object(R.applyFilters)("stackable.".concat(l,".save.output.before"),null,c,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(R.applyFilters)("stackable.".concat(l,".save.output.after"),null,c,t)))},yg.Save.defaultProps={styles:null,mainClass:!0};var wg=n(24);function Og(e){return(Og="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 kg(e,t){for(var n=0;n0?r(n[0]):void 0),o=i(n),s=1===o.length&&o[0]&&"ugb/container"===o[0].name;return{isGroupable:l&&o.length&&!s,isUngroupable:s&&!!o[0].innerBlocks.length,blocksSelection:o,groupingBlockName:"ugb/container"}}),Object(re.withDispatch)(function(e,t){var n=t.clientIds,a=t.onToggle,r=void 0===a?b.noop:a,i=t.blocksSelection,l=void 0===i?[]:i,o=e("core/block-editor").replaceBlocks;return{onConvertToGroup:function(){if(l.length){var e=l.map(function(e){return Object(he.cloneBlock)(e)}),t=Object(he.createBlock)("ugb/container",{},e);o(n,t),r()}},onConvertFromGroup:function(){if(l.length){var e=l[0].innerBlocks;e.length&&(o(n,e),r())}}}})])(function(e){var t=e.onConvertToGroup,n=e.onConvertFromGroup,a=e.isGroupable,r=void 0!==a&&a,l=e.isUngroupable,u=void 0!==l&&l;return Object(re.select)("core/block-editor").getSelectedBlockClientIds?wp.element.createElement(i.Fragment,null,r&&wp.element.createElement(Vh.PluginBlockSettingsMenuItem,{icon:Gh,label:Object(s.__)("Group into Container",o.i18n),onClick:t}),u&&wp.element.createElement(Vh.PluginBlockSettingsMenuItem,{icon:Wh,label:Object(s.__)("Ungroup from Container",o.i18n),onClick:n})):null}),Kh=(Object(re.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientIds;return t?{clientIds:t()}:{}})(qh),Object(gt.withState)({openPopover:!1,changed:!1})(function(e){var t=e.blockName,n=e.openPopover,a=e.changed,r=e.setState,o=e.getJSONBlockAttributes,s=e.setJSONBlockAttributes;return wp.element.createElement(i.Fragment,null,wp.element.createElement(Vh.PluginBlockSettingsMenuItem,{icon:"editor-code",label:"Get / Set Block Attributes",onClick:function(){r({openPopover:!0,changed:!1}),setTimeout(function(){return document.querySelector(".ugb-modal-get-block-attributes-button textarea").select()},100)}}),n&&wp.element.createElement(l.Modal,{title:"".concat(Object(b.startCase)(t)," Block Attributes"),focusOnMount:!0,className:"ugb-modal-get-block-attributes-button",onRequestClose:function(){if(a){var e=document.querySelector(".ugb-modal-get-block-attributes-button textarea").value;s(e)}r({openPopover:!1})}},wp.element.createElement("p",null,'Copy or modify the attributes of the block directly. Use only double quotes "'),wp.element.createElement("textarea",{onChange:function(){return r({changed:!0})}},o())))})),$h=Object(gt.compose)([Object(re.withSelect)(function(e,t){var n=t.clientId,a=e("core/block-editor").getBlockName;return{blockName:n&&a(n)?a(n).replace(/^\w+\//g,""):"",getJSONBlockAttributes:function(){var t=e("core/block-editor").getBlockName,a=e("core/blocks").getBlockType;if(!n)return{};var r=e("core/block-editor").getBlockAttributes(n),i=t(n).replace(/^\w+\//g,""),l=a(t(n)).attributes,o=Object.keys(r).reduce(function(e,t){return r[t]!==(l[t]?l[t].default:"")&&(e[t]=r[t]),e},{});return o.uniqueClass=void 0,JSON.stringify(Object(R.applyFilters)("stackable.".concat(i,".design.filtered-block-attributes"),o),null,4)}}}),Object(re.withDispatch)(function(e,t){var n=t.clientId;return{setJSONBlockAttributes:function(e){if(n)try{var t=JSON.parse(e);Ce(t,n)}catch(e){console.error(e)}}}})])(Kh);Object(re.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientId;return t?{clientId:t()}:{}})($h);function Yh(){return(Yh=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Xh=function(e){var t=e.blockTag,n=e.className,a=e.backgroundAttrName,r=e.blockProps,l=e.showBackground,o=e.showVideoBackground,u=Qh(e,["blockTag","className","backgroundAttrName","blockProps","showBackground","showVideoBackground"]),c=p()([n],{"ugb--has-background-overlay":l&&V(a,r.attributes)});return wp.element.createElement(t,Yh({className:c},u),e.children,l&&o&&function(e,t){var n=ge(t.attributes,function(t){return Object(b.camelCase)(Object(s.sprintf)(e,t))},""),a=n("BackgroundMediaUrl"),r=n("TabletBackgroundMediaUrl"),l=n("MobileBackgroundMediaUrl"),o=p()(["ugb-video-background"],{"ugb--video-hide-tablet":r,"ugb--video-hide-mobile":l}),u=p()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-mobile":l}),c=p()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-tablet":!0});return wp.element.createElement(i.Fragment,null,Be(a)&&wp.element.createElement("video",{className:o,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:a}),Be(r)&&wp.element.createElement("video",{className:u,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:r}),Be(l)&&wp.element.createElement("video",{className:c,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:l}))}(a,r))};Xh.defaultProps={className:"",backgroundAttrName:"%s",blockProps:{},showBackground:!0,showVideoBackground:!0,blockTag:"div"};var Jh=function(e){return wp.element.createElement(l.Modal,{title:Object(s.__)("Stackable Welcome Guide",o.i18n),className:"ugb-modal-welcome-video",overlayClassName:"ugb-modal-welcome-video__overlay",shouldCloseOnClickOutside:!1,onRequestClose:e.onRequestClose},wp.element.createElement("p",null,Object(s.__)("Hello there 👋 I see you might be new to Stackable, we've made a short 3-minute video so you can make the most out of our unique blocks.",o.i18n)),wp.element.createElement("iframe",{title:Object(s.__)("Video Tutorial",o.i18n),width:"800",height:"413",src:"https://www.youtube.com/embed/UW0Rg96aATA",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),wp.element.createElement("p",null,wp.element.createElement(l.Button,{className:"button-primary",onClick:e.onRequestClose,"data-testid":"button-close"},Object(s.__)("Close it, I'm good",o.i18n))))};Jh.defaultProps={onRequestClose:function(){}};function Zh(){return(Zh=Object.assign||function(e){for(var t=1;t=k},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125j(l,n))void 0!==s&&0>j(s,l)?(e[a]=s,e[o]=n,a=o):(e[a]=l,e[i]=n,a=i);else{if(!(void 0!==s&&0>j(s,n)))break e;e[a]=s,e[o]=n,a=o}}}return t}return null}function j(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var P=[],T=[],B=1,M=null,N=3,I=!1,A=!1,D=!1;function R(e){for(var t=x(T);null!==t;){if(null===t.callback)E(T);else{if(!(t.startTime<=e))break;E(T),t.sortIndex=t.expirationTime,S(P,t)}t=x(T)}}function z(e){if(D=!1,R(e),!A)if(null!==x(P))A=!0,a(L);else{var t=x(T);null!==t&&r(z,t.startTime-e)}}function L(e,n){A=!1,D&&(D=!1,i()),I=!0;var a=N;try{for(R(n),M=x(P);null!==M&&(!(M.expirationTime>n)||e&&!l());){var o=M.callback;if(null!==o){M.callback=null,N=M.priorityLevel;var s=o(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?M.callback=s:M===x(P)&&E(P),R(n)}else E(P);M=x(P)}if(null!==M)var u=!0;else{var c=x(T);null!==c&&r(z,c.startTime-n),u=!1}return u}finally{M=null,N=a,I=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=o;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=N;N=e;try{return t()}finally{N=n}},t.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var n=N;N=t;try{return e()}finally{N=n}},t.unstable_scheduleCallback=function(e,n,l){var o=t.unstable_now();if("object"==typeof l&&null!==l){var s=l.delay;s="number"==typeof s&&0o?(e.sortIndex=s,S(T,e),null===x(P)&&e===x(T)&&(D?i():D=!0,r(z,s-o))):(e.sortIndex=l,S(P,e),A||I||(A=!0,a(L))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=N;return function(){var n=N;N=t;try{return e.apply(this,arguments)}finally{N=n}}},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=x(P);return n!==M&&null!==M&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[n(t)];return 0===r?r:r||a};return wp.element.createElement(P,h({design:a("Design",e.designDefault),size:a("Size","normal"),text:a("Text",""),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),icon:a("Icon"),iconPosition:a("IconPosition"),onChange:function(e){return t(v({},n("Text"),e))},url:a("Url"),newTab:a("NewTab"),noFollow:a("NoFollow"),onChangeUrl:function(e){return t(v({},n("Url"),e))},onChangeNewTab:function(e){return t(v({},n("NewTab"),e))},onChangeNoFollow:function(e){return t(v({},n("NoFollow"),e))},onChangeIcon:function(e){return t(v({},n("Icon"),e))},isSelected:e.isSelected},e))};y.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(y.Content=function(e){var t=function(t){return Object(b.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[t(n)];return 0===r?r:r||a};return wp.element.createElement(P.Content,h({design:n("Design",e.designDefault),size:n("Size","normal"),text:n("Text"),icon:n("Icon"),newTab:n("NewTab"),url:n("Url"),noFollow:n("NoFollow"),hoverEffect:n("HoverEffect"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow"),iconPosition:n("IconPosition")},e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};function w(){return(w=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=function(t){return Object(b.camelCase)(Object(s.sprintf)(e,t))},i=ge(n,r,""),l=a.importantSize,o=void 0!==l&&l,u=a.important,c=void 0===u||u,f=a.inherit,p=void 0===f||f,d=a.inheritMax,g=void 0===d?50:d,m=a.inheritMin,h={},v=i("FontSize"),y=i("TabletFontSize"),w=i("MobileFontSize");if("tablet"!==t&&"mobile"!==t)h={fontFamily:""!==i("FontFamily")?I(i("FontFamily")):void 0,fontSize:""!==v?de("".concat(v).concat(i("FontSizeUnit")||"px"),o):void 0,fontWeight:""!==i("FontWeight")?i("FontWeight"):void 0,textTransform:""!==i("TextTransform")?i("TextTransform"):void 0,letterSpacing:""!==i("LetterSpacing")?"".concat(i("LetterSpacing"),"px"):void 0,lineHeight:""!==i("LineHeight")?"".concat(i("LineHeight")).concat(i("LineHeightUnit")||"em"):void 0};else if("tablet"===t){if(h={lineHeight:""!==i("TabletLineHeight")?"".concat(i("TabletLineHeight")).concat(i("TabletLineHeightUnit")||"em"):void 0},p){var O=me(v,{min:m,max:g});O&&(h.fontSize="".concat(O).concat(i("FontSizeUnit")||"px"))}y&&(h.fontSize=i("TabletFontSize","%s".concat(i("TabletFontSizeUnit")||"px")))}else{if(h={lineHeight:""!==i("MobileLineHeight")?"".concat(i("MobileLineHeight")).concat(i("MobileLineHeightUnit")||"em"):void 0},p){var k=me(v,{min:m,max:g});k&&(h.fontSize="".concat(k).concat(i("FontSizeUnit")||"px"));var C=me(y,{min:m,max:g});C?h.fontSize="".concat(C).concat(i("TabletFontSizeUnit")||"px"):(k||y)&&(h.fontSize=void 0)}w&&(h.fontSize=i("MobileFontSize","%s".concat(i("MobileFontSizeUnit")||"px")))}return c?pe(h):h},R=n(7);function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F={},U=function(){F=function(e){for(var t=1;t'.concat(e.map(function(e){return"<".concat(e,">")}).join(),""),!document||!document.body)return{};document.body.appendChild(t);var n={};return e.forEach(function(e){var a=window.getComputedStyle(t.querySelector(e)).getPropertyValue("font-size");n[e]=Math.round(parseFloat(a))}),document.body.removeChild(t),n}(["h1","h2","h3","h4","h5","h6","p"]))};Object(R.addFilter)("stackable.global-settings.typography.editor-styles","stackable/default-font-sizes",function(e,t,n,a){return e[".ugb-default-font-size .wp-block ".concat(t)]=D("%s","desktop",a,{important:!0}),F={},e});var H=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(F).length&&!t||U(),F[e]||F.p||21};Object(r.a)(function(){U()});var V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){return Object(b.camelCase)(Object(s.sprintf)(e,t))},a=ge(t,n);return"gradient"===a("BackgroundColorType")||a("BackgroundMediaUrl")||a("TabletBackgroundMediaUrl")||a("MobileBackgroundMediaUrl")};var G=n(13),W=n.n(G);var q=n(2),K=n.n(q);function $(){return($=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return{width:e.media_details?e.media_details.width:"",height:e.media_details?e.media_details.height:"",source_url:e.source_url||""}},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?e.media_details&&e.media_details.sizes&&e.media_details.sizes[t]||ie(e):null};window._stackableCachedImageData={};var oe=function(e,t){var n=t("core").getMedia,a=e?n(e):null;return a&&void 0!==a.id&&(window._stackableCachedImageData[a.id]=a),a},se=function(e){return window._stackableCachedImageData[e]||null};n(28),n(22);function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ce(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return Object.keys(e).reduce(function(n,a){return ce({},n,fe({},a,de(e[a],t)))},{})},de=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""!==e&&void 0!==e&&t&&!String(e).match(/!important/i)?"".concat(e," !important"):e},ge=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return function(a){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n,l=null!==t?t:function(e){return Object(b.lowerFirst)(e)},o=void 0===e[l(a)]?"":e[l(a)];return""!==o?r?Object(s.sprintf)(r.replace(/%$/,"%%"),o):o:i}},me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.min,a=void 0===n?Number.NEGATIVE_INFINITY:n,r=t.max,i=void 0===r?Number.POSITIVE_INFINITY:r;if(""!==e){var l=Object(b.clamp)(e,parseFloat(a),parseFloat(i));if(!isNaN(l))return parseFloat(l)!==parseFloat(e)?l:void 0}};var be={facebook:{label:Object(s.__)("Facebook",o.i18n),icon:''},twitter:{label:Object(s.__)("Twitter",o.i18n),icon:''},instagram:{label:Object(s.__)("Instagram",o.i18n),icon:''},pinterest:{label:Object(s.__)("Pinterest",o.i18n),icon:''},linkedin:{label:Object(s.__)("LinkedIn",o.i18n),icon:''},youtube:{label:Object(s.__)("YouTube",o.i18n),icon:''},email:{label:Object(s.__)("Email",o.i18n),icon:''}},he=n(16);function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ye(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,a=Object(re.select)("core/block-editor"),r=a.getBlockName,i=a.getSelectedBlockClientId,l=a.getBlockAttributes,o=a.hasMultiSelection,s=a.getMultiSelectedBlockClientIds,u=Object(re.dispatch)("core/block-editor"),c=u.updateBlockAttributes,f=Object(re.select)("core/blocks"),p=f.getBlockType;if(n||!o()){var d=n||i();if(d){var g=l(d),m=r(d).replace(/^\w+\//g,""),h=p(r(d)).attributes,v=Object.keys(h).reduce(function(e,t){return ye({},e,we({},t,h[t]?h[t].default:""))},{}),y=Object(R.applyFilters)("stackable.".concat(m,".design.filtered-block-attributes"),ye({},v,{},t),g),w=Object(R.applyFilters)("stackable.".concat(m,".design.no-text-attributes"),y,g);A(w),c(d,Object(b.omit)(w,["uniqueClass"]))}}else s().forEach(function(n){e(t,n)})};function _e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Se=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Object(i.useState)(function(){try{var n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return t}}),a=_e(n,2),r=a[0],l=a[1],o=function(t){try{var n=t instanceof Function?t(r):t;l(n),window.localStorage.setItem(e,JSON.stringify(n))}catch(e){}};return[r,o]},xe=function(){return void 0!==he.registerBlockCollection};var Ee=function(e,t){var n=je(e,t);return n?n.html[0]:""},je=function(e,t){return window.FontAwesome?window.FontAwesome.icon({prefix:e,iconName:t}):null},Pe=n(17),Te=n.n(Pe);n(29);var Be=function(e){return e.match(/(mp4|webm|ogg)$/i)},Me="desktop",Ne=function(){return Me},Ie=!1,Ae=function(){return Ie};function De(){return(De=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[n(t)];return 0===r?r:r||a},r=Object.keys(be).reduce(function(e,r){var i;return ze({},e,(Le(i={},"".concat(r,"Url"),a("".concat(r,"Url"))),Le(i,"onChange".concat(Object(b.upperFirst)(r),"Url"),function(e){return t(Le({},n("".concat(r,"Url")),e))}),i))},{});return wp.element.createElement($e,De({design:a("Design",e.designDefault),size:a("Size","normal"),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),useSocialColors:a("UseSocialColors"),newTab:a("NewTab"),onChangeNewTab:function(e){return t(Le({},n("NewTab"),e))},isSelected:e.isSelected},r,e))};Fe.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(Fe.Content=function(e){var t=function(t){return Object(b.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[t(n)];return 0===r?r:r||a},a=Object.keys(be).reduce(function(e,t){return ze({},e,Le({},"".concat(t,"Url"),n("".concat(t,"Url"))))},{});return wp.element.createElement($e.Content,De({design:n("Design",e.designDefault),size:n("Size","normal"),newTab:n("NewTab"),hoverEffect:n("HoverEffect"),useSocialColors:n("UseSocialColors"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow")},a,e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function He(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ft(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}var pt=Object(i.createElement)(function(e){var t=e.className,n=e.isPressed,a=function(e){for(var t=1;t1&&(this.props.attributes.uniqueClass=a):this.props.attributes.uniqueClass=a}},{key:"render",value:function(){return wp.element.createElement(e,this.props)}}])&&zt(a.prototype,r),l&&zt(a,l),n}(),Ht(t,"defaultProps",{attributes:{},clientId:"",setAttributes:function(){}}),n},"withUniqueClass");Object(R.addFilter)("stackable.user-design-library.save.ignore","stackable/unique-class",function(e){return[].concat(Rt(e),["uniqueClass"])}),Object(R.addFilter)("stackable.block.attributes","stackable/unique-class",function(e){return function(e){for(var t=1;t * > *",".ugb-block-content > *",".ugb-content-wrapper",".ugb-top-separator",".ugb-bottom-separator",".ugb-inner-block",".ugb-main-block"],tn=function(e){return function(e){for(var t=1;t0&&void 0!==a[0]&&a[0],dn&&!t){e.next=9;break}return e.next=4,Te()({path:"/wp/v2/stk_design_library".concat(t?"/reset":""),method:"GET"});case 4:return n=e.sent,e.next=7,n;case 7:dn=e.sent,t&&(gn={},mn=[]);case 9:return e.abrupt("return",dn);case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),vn=function(){var e=pn(regeneratorRuntime.mark(function e(t){var n,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=bn(t),gn[n]){e.next=8;break}return e.next=4,Te()({path:"/wp/v2/stk_block_designs/".concat(n),method:"GET"});case 4:return a=e.sent,e.next=7,a;case 7:gn[n]=e.sent;case 8:return e.abrupt("return",gn[n]);case 9:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),yn=function(){var e=pn(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(mn[t]){e.next=7;break}return e.next=3,Te()({path:"/wp/v2/stk_design/".concat(t),method:"GET"});case 3:return n=e.sent,e.next=6,n;case 6:mn[t]=e.sent;case 7:return e.abrupt("return",mn[t]);case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),wn=function(){var e=pn(regeneratorRuntime.mark(function e(){var t,n,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]&&a[0],e.next=3,Te()({path:"/wp/v2/stk_design_library_dev_mode/",method:"POST",data:{devmode:t}});case 3:return n=e.sent,e.next=6,n;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();Object(r.a)(function(){});var On=function(){var e=pn(regeneratorRuntime.mark(function e(t){var n,a,r,i,l,o,s,u,c,f,p,d,g,m,b,h,v,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.type,a=void 0===n?"":n,r=t.block,i=void 0===r?"":r,l=t.mood,o=void 0===l?"":l,s=t.plan,u=void 0===s?"":s,c=t.colors,f=void 0===c?[]:c,p=t.categories,d=void 0===p?[]:p,g=t.search,m=void 0===g?"":g,b=t.reset,h=void 0!==b&&b,e.t0=Object,e.next=4,hn(h);case 4:return e.t1=e.sent,v=e.t0.values.call(e.t0,e.t1),a&&(v=v.filter(function(e){return e.type===a})),i&&(y=-1===i.indexOf("ugb/")?"ugb/".concat(i):i,v=v.filter(function(e){return e.block===y})),o&&(v=v.filter(function(e){return e.mood===o})),u&&(v=v.filter(function(e){return e.plan===u})),f&&f.length&&(v=v.filter(function(e){return e.colors.some(function(e){return f.includes(e)})})),d&&d.length&&(v=v.filter(function(e){return e.categories.some(function(e){return d.includes(e)})})),m&&m.toLowerCase().replace(/\s+/," ").trim().split(" ").forEach(function(e){v=v.filter(function(t){return["label","plan","block","tags","categories","colors"].some(function(n){return-1!==t[n].toString().toLowerCase().indexOf(e)})})}),e.abrupt("return",v);case 14:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),kn=function(){var e=pn(regeneratorRuntime.mark(function e(t){var n,a,r,i,l,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hn();case 2:if(n=e.sent,a=n[t],r=a.type,i=a.block,l=a.template,"block"!==r||!i){e.next=12;break}return e.next=8,vn(i);case 8:return o=e.sent,e.abrupt("return",o[t]);case 12:if(!l){e.next=16;break}return e.next=15,yn(t);case 15:return e.abrupt("return",e.sent);case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Cn=function(){var e=pn(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Object,e.next=3,hn();case 3:return e.t1=e.sent,t=e.t0.values.call(e.t0,e.t1),e.abrupt("return",t.reduce(function(e,t){var n=t.block,a=t.type;return e.includes(n)||"block"!==a||e.push(n),e},[]));case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),_n=n(35),Sn=n.n(_n);function xn(){return(xn=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var jn=function(e){var t=e.image,n=e.label,a=e.className,r=En(e,["image","label","className"]),i=t?t.match(/https?:/i)?t:o.srcUrl?"".concat(o.srcUrl,"/").concat(t):t:"",u="free"!==r.plan,c=u&&!o.isPro&&o.showProNotice;if(u&&!o.isPro&&!o.showProNotice)return null;var f=p()(["ugb-design-layout-selector__item",a],{"is-premium":r.plan&&!o.isPro&&"free"!==r.plan,"is-locked":c}),d=c?"div":"button";return wp.element.createElement(d,xn({className:f},r),wp.element.createElement("div",{className:"ugb-design-layout-selector__wrapper"},c&&wp.element.createElement(l.Icon,{className:"ugb-design-layout-selector__lock",icon:"lock"}),c&&wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=design-library-learn-more&utm_campaign=learnmore&utm_medium=gutenberg",className:"ugb-design-layout-selector__item-premium-button ugb-shadow-4 button button-secondary",target:"_premium",title:Object(s.__)("Learn More",o.i18n)},Object(s.__)("Learn More",o.i18n)),wp.element.createElement("img",{className:"ugb-design-layout-selector__image",src:i,alt:n})),wp.element.createElement("div",{className:"ugb-design-layout-selector__label"},n))};jn.defaultProps={name:"",label:"",className:""};var Pn=jn;function Tn(){return(Tn=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ma=function(e){var t=e.imageSizes,n=e.value,a=e.className,r=ga(e,["imageSizes","value","className"]),i=function(e){return Object(b.map)(e,function(e){var t=e.name;return{value:e.slug,label:t}})}(t);return Object(b.isEmpty)(i)?null:wp.element.createElement(l.SelectControl,da({},r,{value:n||"large",options:i,className:p()(a,["ugb--help-tip-image-size"])}))};ma.defaultProps={className:"",label:Object(s.__)("Image Size"),value:"large",imageSizes:[],onChange:function(){}};var ba=Object(bt.compose)([Object(re.withSelect)(function(e){return{imageSizes:e("core/block-editor").getSettings().imageSizes}})])(ma),ha=function(e){var t=e.label,n=e.setAttributes,a=e.enablePaddingTop,r=e.enablePaddingRight,l=e.enablePaddingBottom,o=e.enablePaddingLeft,s=e.attributes,u=s.columnPaddingTop,c=void 0===u?"":u,f=s.columnPaddingBottom,p=void 0===f?"":f,d=s.columnPaddingRight,g=void 0===d?"":d,m=s.columnPaddingLeft,b=void 0===m?"":m,h=s.columnPaddingUnit,v=void 0===h?"px":h,y=s.tabletColumnPaddingTop,w=void 0===y?"":y,O=s.tabletColumnPaddingBottom,k=void 0===O?"":O,C=s.tabletColumnPaddingRight,_=void 0===C?"":C,S=s.tabletColumnPaddingLeft,x=void 0===S?"":S,E=s.tabletColumnPaddingUnit,j=void 0===E?"px":E,P=s.mobileColumnPaddingTop,T=void 0===P?"":P,B=s.mobileColumnPaddingBottom,M=void 0===B?"":B,N=s.mobileColumnPaddingRight,I=void 0===N?"":N,A=s.mobileColumnPaddingLeft,D=void 0===A?"":A,R=s.mobileColumnPaddingUnit,z=void 0===R?"px":R;return wp.element.createElement(i.Fragment,null,wp.element.createElement(zu,{label:t,className:"ugb--help-tip-advanced-column-paddings",defaultLocked:!0,min:[0,0,0],max:[500,30,100],step:1,valueDesktop:{top:c,right:g,bottom:p,left:b},valueDesktopUnit:v,onChangeDesktop:function(e){n({columnPaddingTop:e.top,columnPaddingRight:e.right,columnPaddingBottom:e.bottom,columnPaddingLeft:e.left})},onChangeDesktopUnit:function(e){return n({columnPaddingUnit:e})},valueTablet:{top:w,right:k,bottom:_,left:x},valueTabletUnit:j,onChangeTablet:function(e){n({tabletColumnPaddingTop:e.top,tabletColumnPaddingBottom:e.right,tabletColumnPaddingRight:e.bottom,tabletColumnPaddingLeft:e.left})},onChangeTabletUnit:function(e){return n({tabletColumnPaddingUnit:e})},valueMobile:{top:T,right:M,bottom:I,left:D},valueMobileUnit:z,onChangeMobile:function(e){n({mobileColumnPaddingTop:e.top,mobileColumnPaddingBottom:e.right,mobileColumnPaddingRight:e.bottom,mobileColumnPaddingLeft:e.left})},onChangeMobileUnit:function(e){return n({mobileColumnPaddingUnit:e})},enableTop:a,enableRight:r,enableBottom:l,enableLeft:o}))};ha.defaultProps={setAttributes:function(){},label:Object(s.__)("Column Paddings",o.i18n),attributes:{},enablePaddingTop:!0,enablePaddingRight:!0,enablePaddingBottom:!0,enablePaddingLeft:!0};function va(){return(va=Object.assign||function(e){for(var t=1;t1&&this.props.screens.map(function(t,n){return n>0&&!e.state.isScreenPickerOpen&&!e.state.isMouseOver?null:wp.element.createElement("div",{key:n},wp.element.createElement(st,{className:e.state.screen===t?"is-active":"",onClick:function(){return e.onChangeScreen(t)},icon:Ma[t],showTooltip:!1,label:Na[t],"data-screen":t,onMouseEnter:function(){return e.setState({isMouseOver:t})},onMouseLeave:function(){return e.setState({isMouseOver:!1})}}),e.state.isMouseOver===t&&wp.element.createElement(l.Popover,{focusOnMount:!1,position:"bottom center",className:"components-tooltip","aria-hidden":"true"},Na[t]))}))}}])&&ja(n.prototype,a),r&&ja(n,r),t}();Ia.defaultProps={screens:["desktop"],onChangeScreen:function(){}};var Aa=Object(bt.withInstanceId)(Ia),Da=function(e){return wp.element.createElement("div",{className:"ugb-base-control-multi-label"},wp.element.createElement("div",{className:"ugb-base-control-multi-label__label components-base-control__label"},e.label),wp.element.createElement(Aa,{screens:e.screens,onChangeScreen:e.onChangeScreen}),wp.element.createElement("div",{className:"ugb-base-control-multi-label__units"},e.units.length>1&&e.units.map(function(t,n){return wp.element.createElement("button",{key:n,className:e.unit===t?"is-active":"",onClick:function(){return e.onChangeUnit(t)}},t)}),e.afterButton))};Da.defaultProps={label:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],onChangeScreen:function(){},afterButton:null};var Ra=Da;function za(){return(za=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ua=!!l.__experimentalNumberControl,Ha=function(e){var t=e.allowReset,n=e.withInputField,a=e.isShiftStepEnabled,r=Fa(e,["allowReset","withInputField","isShiftStepEnabled"]),u=La(Object(i.useState)(""===e.value||isNaN(e.value)?"":e.value),2),c=u[0],f=u[1],d=function(t){if(f(t),!isNaN(t)){var n=parseFloat(t);if(!isNaN(n))return void e.onChange(Object(b.clamp)(n,e.min,e.max))}e.onChange(e.resetFallbackValue)},g=p()(["ugb-range-control",e.className],{"ugb-range-control--blank":""===c}),m=""===c,h=e.initialPosition||e.placeholder||"",v=function(e,t,n){var a=(e-t)/(n-t)*100;return"".concat(Object(b.clamp)(a,0,100),"%")}((m?h:c)||e.sliderMin||e.min||0,e.sliderMin||e.min||0,e.sliderMax||e.max||100);return wp.element.createElement("div",{className:g,style:{"--ugb-advanced-range-control--width":v}},wp.element.createElement(l.RangeControl,za({},r,{initialPosition:"",onChange:d,withInputField:!1,allowReset:!1,max:null!==e.sliderMax?e.sliderMax:e.max,min:null!==e.sliderMin?e.sliderMin:e.min})),n&&Ua&&wp.element.createElement(l.__experimentalNumberControl,{disabled:e.disabled,isShiftStepEnabled:a,max:e.max,min:e.min,onChange:d,onBlur:function(){if(!isNaN(c)){var t=parseFloat(c);if(!isNaN(t))return void f(Object(b.clamp)(t,e.min,e.max))}f(e.resetFallbackValue)},shiftStep:e.shiftStep,step:e.step,value:c,placeholder:null!==e.placeholder?e.placeholder:h}),t&&wp.element.createElement(st,{className:"components-range-control__reset",disabled:e.disabled,isSecondary:!0,isSmall:!0,onClick:function(){f(e.resetFallbackValue),e.onChange(e.resetFallbackValue)}},Object(s.__)("Reset",o.i18n)))};Ha.defaultProps={className:"",allowReset:!1,withInputField:!0,isShiftStepEnabled:!0,max:1/0,min:-1/0,sliderMax:null,sliderMin:null,shiftStep:10,step:1,resetFallbackValue:"",placeholder:null,initialPosition:0,onChange:function(){}};var Va=Ha;function Ga(e){return(Ga="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 Wa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function qa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ka=function(e){var t=function(e){for(var t=1;t0});return a.length?a[0].options[0].label:e},or=function(e){return e.value},sr=function(e){return wp.element.createElement("div",{className:"ugb--autosuggest-group"},e.title)},ur=function(e){return e.options},cr=function(){return!0},fr=function(e){function t(){var e,n,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(e=!(a=tr(t).apply(this,arguments))||"object"!==rr(a)&&"function"!=typeof a?nr(n):a).state={value:e.props.value,label:e.props.value?lr(e.props.value,e.props.options):e.props.value,suggestions:[],isEmpty:!1},e.onSuggestionsFetchRequested=e.onSuggestionsFetchRequested.bind(nr(e)),e.onSuggestionsClearRequested=e.onSuggestionsClearRequested.bind(nr(e)),e.onChange=e.onChange.bind(nr(e)),e.onFocus=e.onFocus.bind(nr(e)),e.autosuggestDiv=Object(i.createRef)(),e}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ar(e,t)}(t,i["Component"]),n=t,(a=[{key:"onChange",value:function(e,t){var n=t.newValue;this.props.onChange(n),this.setState({value:n,label:lr(n,this.props.options)})}},{key:"onFocus",value:function(){var e=this;this.props.highlightValueOnFocus&&setTimeout(function(){var t=e.autosuggestDiv.current.querySelector('[data-value="'.concat(e.state.value,'"]'));t&&t.scrollIntoView()},0)}},{key:"onSuggestionsFetchRequested",value:function(e){var t=e.value,n=e.reason;if("input-focused"!==n&&"suggestion-selected"!==n){var a=function(e,t){var n=e.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!n)return t;var a=new RegExp(n,"i");return ir(t)?t.map(function(e){return{title:e.title,options:e.options.filter(function(e){return a.test(e.label)||a.test(e.value)})}}).filter(function(e){return e.options.length>0}):t.filter(function(e){return a.test(e.label)||a.test(e.value)})}(t,this.props.options);this.setState({suggestions:a,isEmpty:""!==t.trim()&&0===a.length})}else this.setState({suggestions:this.props.options,isEmpty:!1})}},{key:"onSuggestionsClearRequested",value:function(){this.setState({suggestions:[]})}},{key:"render",value:function(){var e=this,t=this.state,n=t.label,a=t.suggestions,r={placeholder:"",value:n,onChange:this.onChange,onFocus:this.onFocus,type:"search"};return wp.element.createElement(l.BaseControl,{help:this.props.help,className:p()("ugb-advanced-autosuggest-control",this.props.className)},wp.element.createElement(Ra,{label:this.props.label,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-advanced-autosuggest-control__select",ref:this.autosuggestDiv},wp.element.createElement(Za.a,{multiSection:ir(this.props.options),suggestions:a,focusInputOnSuggestionClick:!1,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:or,renderSuggestion:function(t){return wp.element.createElement("div",{className:"ugb-autosuggest-option","data-value":t.value,id:"ugb-autosuggest-option--".concat(t.id||Object(b.kebabCase)(t.value))},e.props.renderOption?e.props.renderOption(t):t.label)},renderSectionTitle:sr,getSectionSuggestions:ur,shouldRenderSuggestions:cr,inputProps:r}),this.state.isEmpty&&wp.element.createElement("div",{className:"ugb--autosuggest-empty"},this.props.noMatchesLabel),this.props.children))}}])&&er(n.prototype,a),r&&er(n,r),t}();fr.defaultProps={onChange:function(){},help:"",className:"",screens:["desktop"],options:[],value:"",noMatchesLabel:Object(s.__)("No matches found",o.i18n),renderOption:null,highlightValueOnFocus:!1};var pr=fr;function dr(){return(dr=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?1:Math.round(parseFloat(e)/parseFloat(t)*10)/10};return"string"==typeof t&&(t=[t,n(t)]),wp.element.createElement($a,Hr({},e,{placeholder:t,onChangeUnit:function(t){""!==e.value&&("em"===t||"rem"===t?e.onChange(n(e.value)):"px"===t&&e.onChange(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?21:Math.round(parseFloat(e)*t)}(e.value))),e.onChangeUnit(t)}}))};Vr.defaultProps={label:Object(s.__)("Font Size",o.i18n),value:"",onChange:function(){},unit:"px",onChangeUnit:function(){},min:[0,0],max:[150,7],step:[1,.05],units:["px","em"],placeholder:""};var Gr=Vr;function Wr(){return(Wr=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(gi)}}]),e}();function gi(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function mi(e,t){return Object.keys(e).reduce(function(n,a){return-1===t.indexOf(a)&&(n[a]=e[a]),n},{})}var bi={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},hi=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function vi(e,t){Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function yi(e,t){e.style["".concat(hi,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function wi(e,t){e.style["".concat(hi,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function Oi(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function ki(e,t,n){return Math.max(e,Math.min(n,t))}function Ci(e){return"px"===e.substr(-2)?parseFloat(e):0}function _i(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function Si(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function xi(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function Ei(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var a={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?a:Ei(e.parentNode,t,a)}}function ji(e){var t=e.lockOffset,n=e.width,a=e.height,r=t,i=t,l="px";if("string"==typeof t){var o=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);fi()(null!==o,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),r=parseFloat(t),i=parseFloat(t),l=o[1]}return fi()(isFinite(r)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===l&&(r=r*n/100,i=i*a/100),{x:r,y:i}}function Pi(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find(function(e){return n.test(t[e])})}(e)?e:Pi(e.parentNode):null}var Ti=27,Bi=32,Mi=37,Ni=38,Ii=39,Ai=40,Di={Anchor:"A",Button:"BUTTON",Canvas:"CANVAS",Input:"INPUT",Option:"OPTION",Textarea:"TEXTAREA",Select:"SELECT"};function Ri(e){return null!=e.sortableHandle}var zi=function(){function e(t,n){Zr(this,e),this.container=t,this.onScrollCallback=n}return ti(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,a=e.minTranslate,r=e.maxTranslate,i=e.width,l=e.height,o={x:0,y:0},s={x:1,y:1},u=10,c=10,f=this.container,p=f.scrollTop,d=f.scrollLeft,g=f.scrollHeight,m=f.scrollWidth,b=0===p,h=g-p-f.clientHeight==0,v=0===d,y=m-d-f.clientWidth==0;n.y>=r.y-l/2&&!h?(o.y=1,s.y=c*Math.abs((r.y-l/2-n.y)/l)):n.x>=r.x-i/2&&!y?(o.x=1,s.x=u*Math.abs((r.x-i/2-n.x)/i)):n.y<=a.y+l/2&&!b?(o.y=-1,s.y=c*Math.abs((n.y-l/2-a.y)/l)):n.x<=a.x+i/2&&!v&&(o.x=-1,s.x=u*Math.abs((n.x-i/2-a.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===o.x&&0===o.y||(this.interval=setInterval(function(){t.isAutoScrolling=!0;var e={left:s.x*o.x,top:s.y*o.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)},5))}}]),e}();var Li={axis:Ct.a.oneOf(["x","y","xy"]),contentWindow:Ct.a.any,disableAutoscroll:Ct.a.bool,distance:Ct.a.number,getContainer:Ct.a.func,getHelperDimensions:Ct.a.func,helperClass:Ct.a.string,helperContainer:Ct.a.oneOfType([Ct.a.func,"undefined"==typeof HTMLElement?Ct.a.any:Ct.a.instanceOf(HTMLElement)]),hideSortableGhost:Ct.a.bool,keyboardSortingTransitionDuration:Ct.a.number,lockAxis:Ct.a.string,lockOffset:Ct.a.oneOfType([Ct.a.number,Ct.a.string,Ct.a.arrayOf(Ct.a.oneOfType([Ct.a.number,Ct.a.string]))]),lockToContainerEdges:Ct.a.bool,onSortEnd:Ct.a.func,onSortMove:Ct.a.func,onSortOver:Ct.a.func,onSortStart:Ct.a.func,pressDelay:Ct.a.number,pressThreshold:Ct.a.number,keyCodes:Ct.a.shape({lift:Ct.a.arrayOf(Ct.a.number),drop:Ct.a.arrayOf(Ct.a.number),cancel:Ct.a.arrayOf(Ct.a.number),up:Ct.a.arrayOf(Ct.a.number),down:Ct.a.arrayOf(Ct.a.number)}),shouldCancelStart:Ct.a.func,transitionDuration:Ct.a.number,updateBeforeSortStart:Ct.a.func,useDragHandle:Ct.a.bool,useWindowAsScrollContainer:Ct.a.bool},Fi={lift:[Bi],drop:[Bi],cancel:[Ti],up:[Ni,Mi],down:[Ai,Ii]},Ui={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:Fi,shouldCancelStart:function(e){return-1!==[Di.Input,Di.Textarea,Di.Select,Di.Option,Di.Button].indexOf(e.target.tagName)||!!Oi(e.target,function(e){return"true"===e.contentEditable})},transitionDuration:300,useWindowAsScrollContainer:!1},Hi=Object.keys(Li);var Vi={index:Ct.a.number.isRequired,collection:Ct.a.oneOfType([Ct.a.number,Ct.a.string]),disabled:Ct.a.bool},Gi=Object.keys(Vi);function Wi(){return(Wi=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ki=function(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return Zr(this,n),Xr(ri(ri(t=ii(this,li(n).call(this,e)))),"state",{}),Xr(ri(ri(t)),"handleStart",function(e){var n=t.props,a=n.distance,r=n.shouldCancelStart;if(2!==e.button&&!r(e)){t.touched=!0,t.position=xi(e);var i=Oi(e.target,function(e){return null!=e.sortableInfo});if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var l=t.props.useDragHandle,o=i.sortableInfo,s=o.index,u=o.collection;if(o.disabled)return;if(l&&!Oi(e.target,Ri))return;t.manager.active={collection:u,index:s},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||e.target.tagName!==Di.Anchor||e.preventDefault(),a||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}}}),Xr(ri(ri(t)),"nodeIsChild",function(e){return e.sortableInfo.manager===t.manager}),Xr(ri(ri(t)),"handleMove",function(e){var n=t.props,a=n.distance,r=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=xi(e),l={x:t.position.x-i.x,y:t.position.y-i.y},o=Math.abs(l.x)+Math.abs(l.y);t.delta=l,a||r&&!(o>=r)?a&&o>=a&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}}),Xr(ri(ri(t)),"handleEnd",function(){t.touched=!1,t.cancel()}),Xr(ri(ri(t)),"cancel",function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)}),Xr(ri(ri(t)),"handlePress",function(e){try{var n=t.manager.getActive(),a=function(){if(n){var a=function(){var n,a,r,u,m,b,h=p.sortableInfo.index,v=(n=p,{bottom:Ci((a=window.getComputedStyle(n)).marginBottom),left:Ci(a.marginLeft),right:Ci(a.marginRight),top:Ci(a.marginTop)}),y=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:Ci(t.gridColumnGap),y:Ci(t.gridRowGap)}:{x:0,y:0}}(t.container),w=t.scrollContainer.getBoundingClientRect(),O=l({index:h,node:p,collection:d});if(t.node=p,t.margin=v,t.gridGap=y,t.width=O.width,t.height=O.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=w,t.index=h,t.newIndex=h,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=Ei(p,t.container),t.initialOffset=xi(g?Jr({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((u="input, textarea, select, canvas, [contenteditable]",m=(r=p).querySelectorAll(u),pi((b=r.cloneNode(!0)).querySelectorAll(u)).forEach(function(e,t){"file"!==e.type&&(e.value=m[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===Di.Canvas&&m[t].width>0&&m[t].height>0&&e.getContext("2d").drawImage(m[t],0,0)}),b)),vi(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-v.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-v.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),s&&(t.sortableGhost=p,vi(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var k=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,C=k.top,_=k.left,S=k.width,x=C+k.height,E=_+S;t.axis.x&&(t.minTranslate.x=_-t.boundingClientRect.left,t.maxTranslate.x=E-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=C-t.boundingClientRect.top,t.maxTranslate.y=x-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:w.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:w.left+w.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:w.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:w.top+w.height)-t.boundingClientRect.top-t.height/2);o&&o.split(" ").forEach(function(e){return t.helper.classList.add(e)}),t.listenerNode=e.touches?p:t.contentWindow,g?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(bi.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),bi.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)})),t.setState({sorting:!0,sortingIndex:h}),c&&c({node:p,index:h,collection:d,isKeySorting:g,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),g&&t.keyMove(0)},r=t.props,i=r.axis,l=r.getHelperDimensions,o=r.helperClass,s=r.hideSortableGhost,u=r.updateBeforeSortStart,c=r.onSortStart,f=r.useWindowAsScrollContainer,p=n.node,d=n.collection,g=t.manager.isKeySorting,m=function(){if("function"==typeof u){t._awaitingUpdateBeforeSortStart=!0;var n=function(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}(function(){var t=p.sortableInfo.index;return Promise.resolve(u({collection:d,index:t,node:p,isKeySorting:g},e)).then(function(){})},function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n});if(n&&n.then)return n.then(function(){})}}();return m&&m.then?m.then(a):a()}}();return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}),Xr(ri(ri(t)),"handleSortMove",function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)}),Xr(ri(ri(t)),"handleSortEnd",function(e){var n=t.props,a=n.hideSortableGhost,r=n.onSortEnd,i=t.manager,l=i.active.collection,o=i.isKeySorting,s=t.manager.getOrderedRefs();t.listenerNode&&(o?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(bi.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),bi.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)}))),t.helper.parentNode.removeChild(t.helper),a&&t.sortableGhost&&vi(t.sortableGhost,{opacity:"",visibility:""});for(var u=0,c=s.length;ua)){t.prevIndex=i,t.newIndex=r;var l=function(e,t,n){return et?e-1:e>n&&eb?b/2:this.height/2,width:this.width>m?m/2:this.width/2},v=u&&g>this.index&&g<=c,y=u&&g=c,w={x:0,y:0},O=l[f].edgeOffset;O||(O=Ei(d,this.container),l[f].edgeOffset=O,u&&(l[f].boundingClientRect=Si(d,r)));var k=f0&&l[f-1];k&&!k.edgeOffset&&(k.edgeOffset=Ei(k.node,this.container),u&&(k.boundingClientRect=Si(k.node,r))),g!==this.index?(t&&wi(d,t),this.axis.x?this.axis.y?y||gthis.containerBoundingRect.width-h.width&&k&&(w.x=k.edgeOffset.left-O.left,w.y=k.edgeOffset.top-O.top),null===this.newIndex&&(this.newIndex=g)):(v||g>this.index&&(o+i.left+h.width>=O.left&&s+i.top+h.height>=O.top||s+i.top+h.height>=O.top+b))&&(w.x=-(this.width+this.marginOffset.x),O.left+w.xthis.index&&o+i.left+h.width>=O.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=g):(y||gthis.index&&s+i.top+h.height>=O.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=g):(y||g1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return Zr(this,n),ii(this,li(n).apply(this,arguments))}return si(n,q["Component"]),ti(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,a=e.index,r=Object(ui.findDOMNode)(this);r.sortableInfo={collection:t,disabled:n,index:a,manager:this.context.manager},this.node=r,this.ref={node:r},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return fi()(a.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=a.withRef?"wrappedInstance":null;return Object(q.createElement)(e,Yr({ref:t},mi(this.props,Gi)))}}]),n}(),Xr(t,"displayName",_i("sortableElement",e)),Xr(t,"contextTypes",{manager:Ct.a.object.isRequired}),Xr(t,"propTypes",Vi),Xr(t,"defaultProps",{collection:0}),n}(function(e){var t=e.value,n=(e.key,e.index,qi(e,["value","key","index"]));return wp.element.createElement("div",Wi({className:"ugb-sort-control__item"},n),t)}),Yi=!1,Qi=function e(t){for(var n=t.values?t.values.splice(0,t.num):Object(b.range)(t.num).map(function(e){return e+1});n.length=4?0:this.state.slide+1;this.setState({slide:e})}},{key:"prev",value:function(){var e=this.state.slide<=0?4:this.state.slide-1;this.setState({slide:e})}},{key:"render",value:function(){var e=this.props.tag;return wp.element.createElement(e,null,wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=".concat(this.props.buttonUtmSource,"&utm_campaign=learnmore&utm_medium=gutenberg"),target:"_premium",onClick:this.open,className:this.props.buttonClassName},this.props.button),this.state.isOpen&&wp.element.createElement(l.Modal,{className:"ugb-pro-modal",onRequestClose:this.close},wp.element.createElement("img",{src:"https://da4bu55kgdxvv.cloudfront.net/premium-popup.jpg",alt:Object(s.__)("Premium features",o.i18n)}),wp.element.createElement("div",{className:"ugb-pro-modal__footer"},wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=editor-modal-popup&utm_campaign=upgrade&utm_medium=gutenberg",className:"button button-secondary",target:"_premium",title:Object(s.__)("Upgrade to Premium",o.i18n)},wp.element.createElement(Bl,null),Object(s.__)("Upgrade to Premium",o.i18n)),wp.element.createElement("a",{href:"https://demo.wpstackable.com?utm_source=editor-modal-popup&utm_campaign=trydemo&utm_medium=gutenberg",target:"_premium",title:Object(s.__)("Try Premium Demo",o.i18n)},Object(s.__)("Try Premium Demo",o.i18n)))))}}])&&Nl(n.prototype,a),r&&Nl(n,r),t}();Rl.defaultProps={button:Object(s.__)("Learn More",o.i18n),buttonClassName:"button button-secondary",tag:"div",buttonUtmSource:"editor-learn-more"};var zl=Rl;function Ll(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Fl=function(e){var t=e.designId,n=e.image,a=e.label,r=e.onClick,o=e.plan,s=e.isPro,u=Ll(Object(i.useState)(!1),2),c=u[0],f=u[1],d=Ll(Object(i.useState)(!1),2),g=d[0],m=d[1],b=p()(["ugb-design-library-item"],function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({"ugb--is-busy":c},"ugb--is-".concat(o),!s&&"free"!==o));return wp.element.createElement("div",{className:b,onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)}},c&&wp.element.createElement("span",{className:"ugb-design-library-item__spinner","data-testid":"spinner"},wp.element.createElement(l.Spinner,null)),!s&&"free"!==o&&wp.element.createElement("span",{className:"ugb-design-library-item__premium","data-testid":"premium-tag"},o),wp.element.createElement("button",{className:"ugb-design-library-item__image",onClick:function(){(s||"free"===o)&&(f(!0),kn(t).then(function(e){f(!1),r(e)}))}},!s&&"free"!==o&&wp.element.createElement(l.Dashicon,{icon:"lock"}),wp.element.createElement("img",{src:n,alt:a,loading:"lazy"})),wp.element.createElement("footer",null,(s||"free"===o)&&wp.element.createElement("span",null,a),!s&&"free"!==o&&!g&&wp.element.createElement("span",null,a),!s&&"free"!==o&&g&&wp.element.createElement(zl,{buttonClassName:"ugb-design-library-item__premium-link",button:wp.element.createElement(i.Fragment,null,e.premiumLabel)})))};Fl.defaultProps={designId:"",image:"",label:"",onClick:function(){},plan:"free",isPro:o.isPro,premiumLabel:Object(s.__)("Go Premium",o.i18n)};var Ul=Fl;var Hl=function(e){var t=e.designs,n=e.isBusy,a=e.onSelect,r=p()(["ugb-design-library-items"],function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},"ugb-design-library-items--columns-".concat(e.columns),!n&&e.columns));return wp.element.createElement("div",{className:r},(t||[]).map(function(e,t){return wp.element.createElement(Ul,{key:t,type:e.type,block:e.block,template:e.template,plan:e.plan,designId:e.id,image:e.image,label:e.label,onClick:function(e){a(e)}})}),n&&wp.element.createElement("div",{className:"ugb-design-library-search__spinner","data-testid":"spinner"},wp.element.createElement(l.Spinner,null)),!n&&!(t||[]).length&&wp.element.createElement("p",{className:"components-base-control__help","data-testid":"nothing-found-note"},Object(s.__)("No designs found",o.i18n)))};Hl.defaultProps={designs:[],columns:1,onSelect:function(){},isBusy:!1};var Vl=Hl;n(133);function Gl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Wl(e){for(var t=1;t0&&void 0!==i[0]?i[0]:"icon",n=i.length>1&&void 0!==i[1]?i[1]:o.fontAwesomeSearchProIcons,a='{ search(version: "latest", first: 50, query: "'.concat((t||"info").replace(/["'\\]/g,""),'") {\n\t\t\tid\n\t\t\tmembership {\n\t\t\t\tfree\n\t\t\t\t').concat(n?"pro":"","\n\t\t\t}\n\t\t} }"),e.next=5,fetch("https://api.fontawesome.com",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:a})}).then(function(e){return e.json()});case 5:return r=e.sent,e.abrupt("return",r.data.search.reduce(function(e,t){return es(t,n).forEach(function(t){e.push(t)}),e},[]));case 7:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function l(e){Jo(i,a,r,l,o,"next",e)}function o(e){Jo(i,a,r,l,o,"throw",e)}l(void 0)})});return function(){return t.apply(this,arguments)}}(),es=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[].concat(Xo(e.membership.free),Xo(t?e.membership.pro.filter(function(t){return!e.membership.free.includes(t)}):[]));return n.map(function(t){return{className:"fa".concat(t[0]," fa-").concat(e.id),prefix:"fa".concat(t[0]),iconName:e.id}})},ts=n(55);function ns(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var as=null,rs=null,is=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ugb-custom-icon";return e.match(/(]*class=["'])/)?e.replace(/(]*class=["'])/,"$1".concat(t," ")):e.match(/()([\s\S]*)/g,"$1"),n=0;n<2;n++)t=t.replace(/\s*([\s\S]*?)<\/g>\s*/gm,"$1");return t},os=function(e){var t=ns(Object(i.useState)(""),2),n=t[0],a=t[1],r=ns(Object(i.useState)([]),2),u=r[0],c=r[1],f=ns(Object(i.useState)(!1),2),d=f[0],g=f[1],m=ns(Object(i.useState)(!1),2),b=m[0],h=m[1],v=e.returnSVGValue;Object(i.useEffect)(function(){var e=!0;return clearTimeout(as),as=setTimeout(function(){e&&(g(!0),Zo(n).then(function(t){e&&c(t)}).finally(function(){e&&g(!1)}))},500),function(){e=!1,clearTimeout(as)}},[n]),Object(i.useEffect)(function(){rs||(rs=wp.data.select("core/block-editor").getSettings().mediaUpload),b?wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:null}):wp.data.select("core/block-editor").getSettings().mediaUpload!==rs&&wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:rs})},[b]);var y=p()(["ugb-icon-popover__label-container"],{"ugb-icon--has-settings":o.isPro,"ugb-icon--has-upload":v,"ugb-icon--has-reset":e.allowReset});return wp.element.createElement(l.Popover,{className:"ugb-icon-popover",onClose:e.onClose,onClickOutside:e.onClickOutside,position:e.position,anchorRef:e.anchorRef},wp.element.createElement(l.PanelBody,null,wp.element.createElement(ts.FileDrop,{onFrameDragEnter:function(){return h(!0)},onFrameDragLeave:function(){return h(!1)},onFrameDrop:function(){return h(!1)},onDrop:function(t){if(v&&t.length)if("image/svg+xml"===t[0].type){var n=new FileReader;n.onload=function(t){h(!1);var n=ls(is(t.target.result));e.onChange(n),e.onClose()},n.readAsText(t[0])}else h(!1);else h(!1)}},wp.element.createElement("div",{className:y},wp.element.createElement(l.TextControl,{className:"ugb-icon-popover__input",value:n,onChange:a,placeholder:Object(s.__)("Type to search icon",o.i18n)}),o.isPro&&wp.element.createElement(st,{className:"ugb-icon-popover__settings-button",icon:"admin-generic",href:o.settingsUrl+"#icon-settings",target:"_settings",iconSize:"16",label:Object(s.__)("Icon Settings",o.i18n),showTooltip:!0,isSmall:!0,isSecondary:!0}),v&&wp.element.createElement(st,{onClick:function(t){t.preventDefault();var n=document.createElement("input");n.accept="image/svg+xml",n.type="file",n.onchange=function(t){var n=t.target.files;if(n.length){var a=new FileReader;a.onload=function(t){h(!1);var n=ls(is(t.target.result));e.onChange(n),e.onClose()},a.readAsText(n[0])}else h(!1)},n.click()},isSmall:!0,isPrimary:!0,className:"components-range-control__upload"},Object(s.__)("Upload SVG",o.i18n)),e.allowReset&&wp.element.createElement(st,{onClick:function(){e.onChange(""),e.onClose()},isSmall:!0,isSecondary:!0,className:"components-range-control__reset"},Object(s.__)("Clear icon",o.i18n))),wp.element.createElement("div",{className:"ugb-icon-popover__iconlist"},d&&wp.element.createElement(l.Spinner,null),!d&&u.map(function(t,n){var a=t.prefix,r=t.iconName,i="".concat(a,"-").concat(r);return wp.element.createElement("button",{key:n,className:"components-button ugb-prefix--".concat(a," ugb-icon--").concat(r),onClick:function(){e.returnSVGValue?e.onChange(ls(Ee(a,r))):e.onChange(i,a,r),e.onClose()}},wp.element.createElement(Tv,{prefix:a,iconName:r}))}),!d&&!u.length&&wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("No matches found",o.i18n))),v&&b&&wp.element.createElement("div",{className:"ugb-icon-popover__drop-indicator"},wp.element.createElement(Qo,{height:"40",width:"40"}),Object(s.__)("Drop your SVG here",o.i18n)))))};os.defaultProps={onChange:function(){},onClose:function(){},onClickOutside:function(){},returnSVGValue:!0,allowReset:!0,anchorRef:void 0,position:"center"};var ss=os,us=function(e){return wp.element.createElement(Fd,{attrNameTemplate:"%sContentAlign",setAttributes:e.setAttributes,blockAttributes:e.blockAttributes},wp.element.createElement(Og,{label:e.label,className:p()([e.className,"ugb--help-tip-alignment-all"])}))};us.defaultProps={className:"",setAttributes:function(){},blockAttributes:{},label:Object(s.__)("Align",o.i18n)};var cs=function(){return wp.element.createElement("hr",{className:"ugb-control-separator"})};function fs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ps=function(e){var t=e.color||"transparent";if(Array.isArray(t)){var n=fs(t,2),a=n[0],r=n[1];t="linear-gradient(90deg, ".concat(a||"transparent",", ").concat(r||"transparent",")")}var l=p()(["components-circular-option-picker__option-wrapper","ugb-button-icon-popover-control-color-preview"],{"ugb-button-icon-popover-control-color-preview--transparent":!t||"transparent"===t});return wp.element.createElement(i.Fragment,null,wp.element.createElement("div",{className:l},wp.element.createElement(st,{className:"components-circular-option-picker__option",label:Object(s.__)("Selected color",o.i18n),style:{background:t},onClick:e.onClick,ref:e._ref}),e.children))};ps.defaultProps={color:"",onClick:function(){},_ref:null};var ds=ps;function gs(){return(gs=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"full",n=se(e)||oe(e,re.select);return n?n.media_details.sizes[t]?n.media_details.sizes[t].source_url:n.source_url:""}(e.id,t||"full"))},className:"ugb--help-tip-image-size"}),e.onChangeBackgroundPosition&&wp.element.createElement(Qa,{label:Object(s.__)("Background Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.backgroundPosition,onChange:e.onChangeBackgroundPosition,className:"ugb--help-tip-background-image-position"}),e.onChangeBackgroundRepeat&&wp.element.createElement(Qa,{label:Object(s.__)("Background Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.backgroundRepeat,onChange:e.onChangeBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"}),e.onChangeBackgroundSize&&wp.element.createElement(Qa,{label:Object(s.__)("Background Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.backgroundSize,onChange:e.onChangeBackgroundSize,className:"ugb--help-tip-background-image-size"}),e.onChangeBackgroundSize&&"custom"===e.backgroundSize&&wp.element.createElement($a,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%"],min:[0,0],max:[1e3,100],unit:e.backgroundCustomSizeUnit,onChangeUnit:e.onChangeBackgroundCustomSizeUnit,value:e.backgroundCustomSize,onChange:e.onChangeBackgroundCustomSize,allowReset:!0}))};Ds.defaultProps={id:"",url:"",onChangeImage:function(e){e.url,e.id},size:"",onChangeSize:function(){},backgroundPosition:"",onChangeBackgroundPosition:function(){},backgroundRepeat:"",onChangeBackgroundRepeat:function(){},backgroundSize:"",onChangeBackgroundSize:function(){},backgroundCustomSizeUnit:"",onChangeBackgroundCustomSizeUnit:function(){},backgroundCustomSize:"",onChangeBackgroundCustomSize:function(){}};var Rs=Object(bt.compose)(Object(re.withSelect)(function(e,t){var n=e("core").getMedia;return oe(t.id,e),{imageData:t.id?n(t.id):null}}))(Ds);function zs(){return(zs=Object.assign||function(e){for(var t=1;t0)&&wp.element.createElement(l.ToggleControl,{label:Object(s.__)("Fixed Background",o.i18n),checked:e.fixedBackground,onChange:e.onChangeFixedBackground,className:"ugb--help-tip-background-fixed"}),e.hasAdvancedBackground&&e.onChangeBackgroundMedia&&(e.backgroundMediaURL||e.tabletBackgroundMediaURL||e.mobileBackgroundMediaURL)&&wp.element.createElement(Ts,{label:Object(s.__)("Adv. Background Image Settings",o.i18n),onReset:e.onResetAdvancedBackground,allowReset:e.backgroundPosition||e.tabletBackgroundPosition||e.mobileBackgroundPosition||e.backgroundRepeat||e.tabletBackgroundRepeat||e.mobileBackgroundRepeat||e.backgroundSize||e.tabletBackgroundSize||e.mobileBackgroundSize||e.backgroundImageBlendMode},wp.element.createElement(Kd,null,wp.element.createElement(Qa,{label:Object(s.__)("Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.backgroundPosition,onChange:e.onChangeBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(Kd,{screen:"tablet"},wp.element.createElement(Qa,{label:Object(s.__)("Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.tabletBackgroundPosition,onChange:e.onChangeTabletBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(Kd,{screen:"mobile"},wp.element.createElement(Qa,{label:Object(s.__)("Image Position",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Top Left",o.i18n),value:"top left"},{label:Object(s.__)("Top Center",o.i18n),value:"top center"},{label:Object(s.__)("Top Right",o.i18n),value:"top right"},{label:Object(s.__)("Center Left",o.i18n),value:"center left"},{label:Object(s.__)("Center Center",o.i18n),value:"center center"},{label:Object(s.__)("Center Right",o.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",o.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",o.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",o.i18n),value:"bottom right"}],value:e.mobileBackgroundPosition,onChange:e.onChangeMobileBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(Kd,null,wp.element.createElement(Qa,{label:Object(s.__)("Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.backgroundRepeat,onChange:e.onChangeBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(Kd,{screen:"tablet"},wp.element.createElement(Qa,{label:Object(s.__)("Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.tabletBackgroundRepeat,onChange:e.onChangeTabletBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(Kd,{screen:"mobile"},wp.element.createElement(Qa,{label:Object(s.__)("Image Repeat",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("No-Repeat",o.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",o.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",o.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",o.i18n),value:"repeat-y"}],value:e.mobileBackgroundRepeat,onChange:e.onChangeMobileBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(Kd,null,wp.element.createElement(Qa,{label:Object(s.__)("Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.backgroundSize,onChange:e.onChangeBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(Kd,{screen:"tablet"},wp.element.createElement(Qa,{label:Object(s.__)("Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.tabletBackgroundSize,onChange:e.onChangeTabletBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(Kd,{screen:"mobile"},wp.element.createElement(Qa,{label:Object(s.__)("Image Size",o.i18n),options:[{label:Object(s.__)("Default",o.i18n),value:""},{label:Object(s.__)("Auto",o.i18n),value:"auto"},{label:Object(s.__)("Cover",o.i18n),value:"cover"},{label:Object(s.__)("Contain",o.i18n),value:"contain"},{label:Object(s.__)("Custom",o.i18n),value:"custom"}],value:e.mobileBackgroundSize,onChange:e.onChangeMobileBackgroundSize,className:"ugb--help-tip-background-image-size"})),"custom"===e.backgroundSize&&wp.element.createElement(Kd,null,wp.element.createElement($a,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.backgroundCustomSizeUnit,onChangeUnit:e.onChangeBackgroundCustomSizeUnit,value:e.backgroundCustomSize,onChange:e.onChangeBackgroundCustomSize,allowReset:!0})),"custom"===e.tabletBackgroundSize&&wp.element.createElement(Kd,{screen:"tablet"},wp.element.createElement($a,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.tabletBackgroundCustomSizeUnit,onChangeUnit:e.onChangeTabletBackgroundCustomSizeUnit,value:e.tabletBackgroundCustomSize,onChange:e.onChangeTabletBackgroundCustomSize,allowReset:!0})),"custom"===e.mobileBackgroundSize&&wp.element.createElement(Kd,{screen:"mobile"},wp.element.createElement($a,{label:Object(s.__)("Custom Size",o.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.mobileBackgroundCustomSizeUnit,onChangeUnit:e.onChangeMobileBackgroundCustomSizeUnit,value:e.mobileBackgroundCustomSize,onChange:e.onChangeMobileBackgroundCustomSize,allowReset:!0})),e.onChangeBackgroundImageBlendMode&&wp.element.createElement(Hn,{label:Object(s.__)("Image Blend Mode",o.i18n),value:e.backgroundImageBlendMode,onChange:e.onChangeBackgroundImageBlendMode})))};$s.defaultProps={backgroundColorType:"",backgroundColor:"",backgroundColorOpacity:"",backgroundColor2:"",backgroundMediaID:"",backgroundMediaURL:"",tabletBackgroundMediaID:"",tabletBackgroundMediaURL:"",mobileBackgroundMediaID:"",mobileBackgroundMediaURL:"",backgroundTintStrength:"",fixedBackground:"",onChangeBackgroundColorType:function(){},onChangeBackgroundColor:function(){},onChangeBackgroundColorOpacity:function(){},onChangeBackgroundColor2:function(){},onChangeBackgroundMedia:function(e){e.url,e.id},onChangeTabletBackgroundMedia:function(e){e.url,e.id},onChangeMobileBackgroundMedia:function(e){e.url,e.id},onChangeBackgroundTintStrength:function(){},onChangeFixedBackground:function(){},labelBackgroundColorType:Object(s.__)("Background Color Type",o.i18n),labelBackgroundColor:Object(s.__)("Background Color",o.i18n),hasAdvancedGradient:!0,backgroundGradientDirection:"",backgroundGradientBlendMode:"",backgroundGradientLocation1:0,backgroundGradientLocation2:100,onResetAdvancedGradient:function(){},onChangeBackgroundGradientDirection:function(){},onChangeBackgroundGradientBlendMode:function(){},onChangeBackgroundGradientLocation1:function(){},onChangeBackgroundGradientLocation2:function(){},hasAdvancedBackground:!0,backgroundMediaAllowVideo:!0,backgroundPosition:"",tabletBackgroundPosition:"",mobileBackgroundPosition:"",backgroundRepeat:"",tabletBackgroundRepeat:"",mobileBackgroundRepeat:"",backgroundSize:"",tabletBackgroundSize:"",mobileBackgroundSize:"",backgroundCustomSize:"",tabletBackgroundCustomSize:"",mobileBackgroundCustomSize:"",backgroundCustomSizeUnit:"%",tabletBackgroundCustomSizeUnit:"%",mobileBackgroundCustomSizeUnit:"%",backgroundImageBlendMode:"",onResetAdvancedBackground:function(){},onChangeBackgroundPosition:function(){},onChangeTabletBackgroundPosition:function(){},onChangeMobileBackgroundPosition:function(){},onChangeBackgroundRepeat:function(){},onChangeTabletBackgroundRepeat:function(){},onChangeMobileBackgroundRepeat:function(){},onChangeBackgroundSize:function(){},onChangeTabletBackgroundSize:function(){},onChangeMobileBackgroundSize:function(){},onChangeBackgroundCustomSize:function(){},onChangeTabletBackgroundCustomSize:function(){},onChangeMobileBackgroundCustomSize:function(){},onChangeBackgroundCustomSizeUnit:function(){},onChangeTabletBackgroundCustomSizeUnit:function(){},onChangeMobileBackgroundCustomSizeUnit:function(){},onChangeBackgroundImageBlendMode:function(){}};var Ys=$s;function Qs(){return(Qs=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",r=e.blockAttributes[n(t)];return 0===r?r:r||a};return wp.element.createElement(Ys,Qs({backgroundColorType:e.blockAttributes[n("BackgroundColorType")]||"",backgroundColor:e.blockAttributes[n("BackgroundColor")]||"",backgroundColorOpacity:e.blockAttributes[n("BackgroundColorOpacity")],backgroundColor2:e.blockAttributes[n("BackgroundColor2")]||"",backgroundMediaID:e.blockAttributes[n("BackgroundMediaID")]||"",backgroundMediaURL:e.blockAttributes[n("BackgroundMediaURL")]||"",tabletBackgroundMediaID:e.blockAttributes[n("TabletBackgroundMediaID")]||"",tabletBackgroundMediaURL:e.blockAttributes[n("TabletBackgroundMediaURL")]||"",mobileBackgroundMediaID:e.blockAttributes[n("MobileBackgroundMediaID")]||"",mobileBackgroundMediaURL:e.blockAttributes[n("MobileBackgroundMediaURL")]||"",backgroundTintStrength:e.blockAttributes[n("BackgroundTintStrength")],fixedBackground:e.blockAttributes[n("FixedBackground")]||"",onChangeBackgroundColorType:function(e){return t(Xs({},n("BackgroundColorType"),e))},onChangeBackgroundColor:function(e){return t(Xs({},n("BackgroundColor"),e))},onChangeBackgroundColorOpacity:function(e){return t(Xs({},n("BackgroundColorOpacity"),e))},onChangeBackgroundColor2:function(e){return t(Xs({},n("BackgroundColor2"),e))},onChangeBackgroundMedia:function(e){var a,r=e.url,i=e.id;t((Xs(a={},n("BackgroundMediaURL"),r),Xs(a,n("BackgroundMediaID"),i),a))},onChangeTabletBackgroundMedia:function(e){var a,r=e.url,i=e.id;t((Xs(a={},n("TabletBackgroundMediaURL"),r),Xs(a,n("TabletBackgroundMediaID"),i),a))},onChangeMobileBackgroundMedia:function(e){var a,r=e.url,i=e.id;t((Xs(a={},n("MobileBackgroundMediaURL"),r),Xs(a,n("MobileBackgroundMediaID"),i),a))},onChangeBackgroundTintStrength:function(e,a){var r;t((Xs(r={},n("BackgroundTintStrength"),e),Xs(r,n("BackgroundColor"),a),r))},onChangeFixedBackground:function(e){return t(Xs({},n("FixedBackground"),e))},backgroundGradientDirection:a("BackgroundGradientDirection",90),backgroundGradientBlendMode:a("BackgroundGradientBlendMode"),backgroundGradientLocation1:a("BackgroundGradientLocation1",0),backgroundGradientLocation2:a("BackgroundGradientLocation2",100),onChangeBackgroundGradientDirection:function(e){return t(Xs({},n("BackgroundGradientDirection"),e))},onChangeBackgroundGradientBlendMode:function(e){return t(Xs({},n("BackgroundGradientBlendMode"),e))},onChangeBackgroundGradientLocation1:function(e){return t(Xs({},n("BackgroundGradientLocation1"),e))},onChangeBackgroundGradientLocation2:function(e){return t(Xs({},n("BackgroundGradientLocation2"),e))},onResetAdvancedGradient:function(){var e;t((Xs(e={},n("BackgroundGradientDirection"),""),Xs(e,n("BackgroundGradientBlendMode"),""),Xs(e,n("BackgroundGradientLocation1"),""),Xs(e,n("BackgroundGradientLocation2"),""),e))},backgroundPosition:e.blockAttributes[n("BackgroundPosition")]||"",tabletBackgroundPosition:e.blockAttributes[n("TabletBackgroundPosition")]||"",mobileBackgroundPosition:e.blockAttributes[n("MobileBackgroundPosition")]||"",backgroundRepeat:e.blockAttributes[n("BackgroundRepeat")]||"",tabletBackgroundRepeat:e.blockAttributes[n("TabletBackgroundRepeat")]||"",mobileBackgroundRepeat:e.blockAttributes[n("MobileBackgroundRepeat")]||"",backgroundSize:e.blockAttributes[n("BackgroundSize")]||"",tabletBackgroundSize:e.blockAttributes[n("TabletBackgroundSize")]||"",mobileBackgroundSize:e.blockAttributes[n("MobileBackgroundSize")]||"",backgroundCustomSize:e.blockAttributes[n("BackgroundCustomSize")]||"",tabletBackgroundCustomSize:e.blockAttributes[n("TabletBackgroundCustomSize")]||"",mobileBackgroundCustomSize:e.blockAttributes[n("MobileBackgroundCustomSize")]||"",backgroundCustomSizeUnit:e.blockAttributes[n("BackgroundCustomSizeUnit")]||"%",tabletBackgroundCustomSizeUnit:e.blockAttributes[n("TabletBackgroundCustomSizeUnit")]||"%",mobileBackgroundCustomSizeUnit:e.blockAttributes[n("MobileBackgroundCustomSizeUnit")]||"%",backgroundImageBlendMode:e.blockAttributes[n("BackgroundImageBlendMode")]||"",onChangeBackgroundPosition:function(e){return t(Xs({},n("BackgroundPosition"),e))},onChangeTabletBackgroundPosition:function(e){return t(Xs({},n("TabletBackgroundPosition"),e))},onChangeMobileBackgroundPosition:function(e){return t(Xs({},n("MobileBackgroundPosition"),e))},onChangeBackgroundRepeat:function(e){return t(Xs({},n("BackgroundRepeat"),e))},onChangeTabletBackgroundRepeat:function(e){return t(Xs({},n("TabletBackgroundRepeat"),e))},onChangeMobileBackgroundRepeat:function(e){return t(Xs({},n("MobileBackgroundRepeat"),e))},onChangeBackgroundSize:function(e){return t(Xs({},n("BackgroundSize"),e))},onChangeTabletBackgroundSize:function(e){return t(Xs({},n("TabletBackgroundSize"),e))},onChangeMobileBackgroundSize:function(e){return t(Xs({},n("MobileBackgroundSize"),e))},onChangeBackgroundCustomSize:function(e){return t(Xs({},n("BackgroundCustomSize"),e))},onChangeTabletBackgroundCustomSize:function(e){return t(Xs({},n("TabletBackgroundCustomSize"),e))},onChangeMobileBackgroundCustomSize:function(e){return t(Xs({},n("MobileBackgroundCustomSize"),e))},onChangeBackgroundCustomSizeUnit:function(e){return t(Xs({},n("BackgroundCustomSizeUnit"),e))},onChangeTabletBackgroundCustomSizeUnit:function(e){return t(Xs({},n("TabletBackgroundCustomSizeUnit"),e))},onChangeMobileBackgroundCustomSizeUnit:function(e){return t(Xs({},n("MobileBackgroundCustomSizeUnit"),e))},onChangeBackgroundImageBlendMode:function(e){return t(Xs({},n("BackgroundImageBlendMode"),e))},onResetAdvancedBackground:function(){var e;t((Xs(e={},n("BackgroundPosition"),""),Xs(e,n("TabletBackgroundPosition"),""),Xs(e,n("MobileBackgroundPosition"),""),Xs(e,n("BackgroundRepeat"),""),Xs(e,n("TabletBackgroundRepeat"),""),Xs(e,n("MobileBackgroundRepeat"),""),Xs(e,n("BackgroundSize"),""),Xs(e,n("TabletBackgroundSize"),""),Xs(e,n("MobileBackgroundSize"),""),Xs(e,n("BackgroundCustomSize"),""),Xs(e,n("TabletBackgroundCustomSize"),""),Xs(e,n("MobileBackgroundCustomSize"),""),Xs(e,n("BackgroundCustomSizeUnit"),"%"),Xs(e,n("TabletBackgroundCustomSizeUnit"),"%"),Xs(e,n("MobileBackgroundCustomSizeUnit"),"%"),Xs(e,n("BackgroundImageBlendMode"),""),e))}},e))};Js.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{}};var Zs=n(56),eu=n.n(Zs),tu=n(57),nu=n.n(tu),au=n(58),ru=n.n(au),iu=n(59),lu=n.n(iu);function ou(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t$/g)?t:t.match(//g)||[t])[0]:t},Wu=function(e){var t=Uu({},e,{value:"string"==typeof e.value?Gu(e.value):e.value}),n=p()(["ugb-icon-inner-svg",e.className],Hu({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(Tv,Lu({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var r=p()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],Hu({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:r},a)}return e.showBackgroundShape&&(a=Vu(a,e.backgroundShape)),a=Object(R.applyFilters)("stackable.component.svg-icon",a,t)};Wu.defaultProps={className:"",value:"",design:"",colorType:"",showBackgroundShape:!1,backgroundShape:"",shadow:"",gradientColor1:"",gradientColor2:"",gradientDirection:0},(Wu.Content=function(e){var t=Uu({},e,{value:"string"==typeof e.value?Gu(e.value):e.value}),n=p()(["ugb-icon-inner-svg",e.className],Hu({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(Tv.Content,Lu({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var r=p()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],Hu({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:r},a)}return e.showBackgroundShape&&(a=Vu(a,e.backgroundShape)),a=Object(R.applyFilters)("stackable.component.svg-icon",a,t)}).defaultProps=Uu({},Wu.defaultProps);var qu=Wu;function Ku(){return(Ku=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Ju=Object(bt.withInstanceId)(function(e){var t=Xu(Object(i.useState)(!1),2),n=t[0],a=t[1],r=Xu(Object(i.useState)(!1),2),l=r[0],o=r[1],s=e.instanceId,u=e.isOpen,c=e.onChange,f=Qu(e,["instanceId","isOpen","onChange"]);return Object(i.useEffect)(function(){e.onToggle(n)},[n]),wp.element.createElement("div",{className:"ugb-svg-icon-placeholder ugb-svg-icon-placeholder-".concat(s)},wp.element.createElement(st,{className:"ugb-svg-icon-placeholder__button",onClick:function(){l?(a(!1),o(!1)):a(!0)}},wp.element.createElement(Yu,f)),(null!==u&&u||null===u&&n)&&wp.element.createElement(ss,{onClickOutside:function(e){e.target&&e.target.closest(".ugb-svg-icon-placeholder-".concat(s))?o(!0):(a(!1),o(!1))},onClose:function(){return a(!1)},onChange:c}))});Ju.defaultProps={isOpen:null,className:"",value:"",onChange:function(){},onToggle:function(){}};var Zu=Ju;function ec(){return(ec=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeTop",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(_c({},this.getEnabledValues(),{top:n}))}},{key:"onChangeRight",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(_c({},this.getEnabledValues(),{right:n}))}},{key:"onChangeBottom",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(_c({},this.getEnabledValues(),{bottom:n}))}},{key:"onChangeLeft",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(_c({},this.getEnabledValues(),{left:n}))}},{key:"render",value:function(){var e=this.props.instanceId,t="ugb-four-number-control-".concat(e,"__item-");return wp.element.createElement(l.BaseControl,{help:this.props.help,className:p()("ugb-four-number-control",this.props.className)},wp.element.createElement(Ra,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-four-number-control__wrapper"},wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-top")},wp.element.createElement("input",{id:"".concat(t,"-top"),type:"number",onChange:this.onChangeTop,"aria-label":Object(s.__)("Top",o.i18n),value:this.props.top,placeholder:this.props.enableTop?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableTop}),wp.element.createElement("span",null,Object(s.__)("Top",o.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-right")},wp.element.createElement("input",{id:"".concat(t,"-right"),type:"number",onChange:this.onChangeRight,"aria-label":this.props.label,value:this.props.right,placeholder:this.props.enableRight?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableRight}),wp.element.createElement("span",null,Object(s.__)("Right",o.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-bottom")},wp.element.createElement("input",{id:"".concat(t,"-bottom"),type:"number",onChange:this.onChangeBottom,"aria-label":this.props.label,value:this.props.bottom,placeholder:this.props.enableBottom?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableBottom}),wp.element.createElement("span",null,Object(s.__)("Bottom",o.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-left")},wp.element.createElement("input",{id:"".concat(t,"-left"),type:"number",onChange:this.onChangeLeft,"aria-label":this.props.label,value:this.props.left,placeholder:this.props.enableLeft?"":Object(s.__)("auto",o.i18n),disabled:!this.props.enableLeft}),wp.element.createElement("span",null,Object(s.__)("Left",o.i18n))),wp.element.createElement(st,{className:this.state.locked?"ugb--is-locked":"",onClick:this.onToggleLock,icon:wp.element.createElement(l.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})})))}}])&&Ec(n.prototype,a),r&&Ec(n,r),t}();Bc.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0};Object(bt.withInstanceId)(Bc);function Mc(){return(Mc=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeAll",value:function(e){var t=e||0===e?e:"";this.props.onChange(this.filterOnlyEnabled({top:t,right:t,bottom:t,left:t}))}},{key:"onChangeTop",value:function(e){this.props.onChange(Jc({},this.getEnabledValues(),{top:e||0===e?e:""}))}},{key:"onChangeRight",value:function(e){this.props.onChange(Jc({},this.getEnabledValues(),{right:e||0===e?e:""}))}},{key:"onChangeBottom",value:function(e){this.props.onChange(Jc({},this.getEnabledValues(),{bottom:e||0===e?e:""}))}},{key:"onChangeLeft",value:function(e){this.props.onChange(Jc({},this.getEnabledValues(),{left:e||0===e?e:""}))}},{key:"render",value:function(){var e=this.props,t=e.instanceId,n=e.units,a=e.unit,r="ugb-four-range-control-".concat(t,"__item-"),u={min:this.props.min,max:this.props.max,step:this.props.step,placeholder:this.props.placeholder,initialPosition:this.props.initialPosition,sliderMin:this.props.sliderMin,sliderMax:this.props.sliderMax},c=n.indexOf(a)<0?0:n.indexOf(a);Array.isArray(this.props.min)&&(u.min=this.props.min[c]),Array.isArray(this.props.max)&&(u.max=this.props.max[c]),Array.isArray(this.props.sliderMin)&&(u.sliderMin=this.props.sliderMin[c]),Array.isArray(this.props.sliderMax)&&(u.sliderMax=this.props.sliderMax[c]),Array.isArray(this.props.step)&&(u.step=this.props.step[c]),Array.isArray(this.props.placeholder)&&(u.placeholder=this.props.placeholder[c]),Array.isArray(this.props.initialPosition)&&(u.initialPosition=this.props.initialPosition[c]);var f=p()(["ugb-four-range-control__lock"],{"ugb--is-locked":this.state.locked}),d=wp.element.createElement(st,{className:f,onClick:this.onToggleLock,icon:wp.element.createElement(l.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})});return wp.element.createElement(l.BaseControl,{help:this.props.help,className:p()("ugb-four-range-control",this.props.className,{"ugb--locked":this.state.locked})},wp.element.createElement(Ra,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens,afterButton:d}),this.state.locked&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement($a,Yc({id:"".concat(r,"-all"),value:this.firstValue(),onChange:this.onChangeAll,allowReset:!0},u))),!this.state.locked&&wp.element.createElement(i.Fragment,null,this.props.enableTop&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Top",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Kc,null))),wp.element.createElement($a,Yc({id:"".concat(r,"-top"),value:this.props.top,onChange:this.onChangeTop,allowReset:!0},u,{placeholder:this.props.placeholderTop||u.placeholder}))),this.props.enableRight&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Right",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Vc,null))),wp.element.createElement($a,Yc({id:"".concat(r,"-right"),value:this.props.right,onChange:this.onChangeRight,allowReset:!0},u,{placeholder:this.props.placeholderRight||u.placeholder}))),this.props.enableBottom&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Bottom",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Ac,null))),wp.element.createElement($a,Yc({id:"".concat(r,"-bottom"),value:this.props.bottom,onChange:this.onChangeBottom,allowReset:!0},u,{placeholder:this.props.placeholderBottom||u.placeholder}))),this.props.enableLeft&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(l.Tooltip,{text:Object(s.__)("Left",o.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(Lc,null))),wp.element.createElement($a,Yc({id:"".concat(r,"-left"),value:this.props.left,onChange:this.onChangeLeft,allowReset:!0},u,{placeholder:this.props.placeholderLeft||u.placeholder})))))}}])&&ef(n.prototype,a),r&&ef(n,r),t}();rf.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0,min:0,max:50,sliderMin:null,sliderMax:null,step:1,placeholder:"",placeholderTop:"",placeholderRight:"",placeholderBottom:"",placeholderLeft:"",initialPosition:""};var lf=rf,of=n(63),sf=n.n(of),uf=n(64),cf=n.n(uf),ff=n(65),pf=n.n(ff),df=n(66),gf=n.n(df),mf=n(67),bf=n.n(mf),hf=n(68),vf=n.n(hf),yf=n(69),wf=n.n(yf),Of=n(70),kf=n.n(Of),Cf=n(71),_f=n.n(Cf),Sf=n(72),xf=n.n(Sf),Ef=n(73),jf=n.n(Ef),Pf=n(74),Tf=n.n(Pf),Bf=n(75),Mf=n.n(Bf),Nf=n(76),If=n.n(Nf),Af=n(77),Df=n.n(Af),Rf=n(78),zf=n.n(Rf),Lf=n(79),Ff=n.n(Lf),Uf=n(80),Hf=n.n(Uf),Vf=n(81),Gf=n.n(Vf),Wf=n(82),qf=n.n(Wf),Kf=n(83),$f=n.n(Kf),Yf=n(84),Qf=n.n(Yf),Xf=n(85),Jf=n.n(Xf),Zf=n(86),ep=n.n(Zf),tp=n(87),np=n.n(tp),ap=n(88),rp=n.n(ap),ip=n(89),lp=n.n(ip),op=n(90),sp=n.n(op),up=n(91),cp=n.n(up),fp=n(92),pp=n.n(fp);function dp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function gp(){return(gp=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,a=t.emitMouse,r=t.emitTouch;return Tp({},e,{onMouseDown:jp(e.onMouseDown,a),onTouchStart:jp(e.onTouchStart,r)})}),n}return _p(t,q["Component"]),hp(t,[{key:"render",value:function(){var e=this.getRailProps,t=this.props,n=t.getEventData,a=t.activeHandleID,r=(0,t.children)({getEventData:n,activeHandleID:a,getRailProps:e});return r&&K.a.Children.only(r)}}]),t}();Bp.propTypes={};var Mp=Bp,Np=function(e){function t(){return mp(this,t),Op(this,kp(t).apply(this,arguments))}return _p(t,q["Component"]),hp(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.values,a=e.scale,r=e.count,i=t({getEventData:e.getEventData,activeHandleID:e.activeHandleID,ticks:(n||a.getTicks(r)).map(function(e){return{id:"$$-".concat(e),value:e,percent:a.getValue(e)}})});return i&&K.a.Children.only(i)}}]),t}();Np.propTypes={},Np.defaultProps={count:10};var Ip=Np;function Ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Dp(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,a=t.emitMouse,r=t.emitTouch;return Dp({},e,{onMouseDown:jp(e.onMouseDown,a),onTouchStart:jp(e.onTouchStart,r)})}),n}return _p(t,q["Component"]),hp(t,[{key:"render",value:function(){for(var e=this.getTrackProps,t=this.props,n=t.children,a=t.left,r=t.right,i=t.scale,l=t.handles,o=t.getEventData,s=t.activeHandleID,u=i.getDomain(),c=[],f=0;f1&&void 0!==arguments[1]?arguments[1]:{},a=n.props,r=a.emitKeyboard,i=a.emitMouse,l=a.emitTouch;return Fp({},t,{onKeyDown:jp(t.onKeyDown,function(t){return r(t,e)}),onMouseDown:jp(t.onMouseDown,n.autofocus,function(t){return i(t,e)}),onTouchStart:jp(t.onTouchStart,function(t){return l(t,e)})})}),n}return _p(t,q["Component"]),hp(t,[{key:"render",value:function(){var e=this.getHandleProps,t=this.props,n=t.activeHandleID,a=(0,t.children)({handles:t.handles,activeHandleID:n,getHandleProps:e});return a&&K.a.Children.only(a)}}]),t}();Up.propTypes={};var Hp=Up;function Vp(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);tn.val?e?-1:1:n.val>t.val?e?1:-1:0}}function qp(e,t,n,a){var r=e.findIndex(function(e){return e.key===t});if(-1!==r){var i=e[r],l=i.key;return i.val===n?e:[].concat(Vp(e.slice(0,r)),[{key:l,val:n}],Vp(e.slice(r+1))).sort(Wp(a))}return e}function Kp(e,t){if(!e)return[0,0];var n=e.getBoundingClientRect();return[t?n.top:n.left,t?n.bottom:n.right]}function $p(e){var t=e.type,n=void 0===t?"":t,a=e.touches;return!a||a.length>1||"touchend"===n.toLowerCase()&&a.length>0}function Yp(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function Qp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,r=0;return{handles:e.map(function(e){var t=n.getValue(e);return e!==t&&(r+=1,Ep()(!a,"".concat(Gp," Invalid value encountered. Changing ").concat(e," to ").concat(t,"."))),t}).map(function(e,t){return{key:"$$-".concat(t),val:e}}).sort(Wp(t)),changes:r}}var Xp=function(e,t){return et?1:e>=t?0:NaN};var Jp,Zp;1===(Jp=Xp).length&&(Zp=Jp,Jp=function(e,t){return Xp(Zp(e),t)});var ed=Array.prototype,td=(ed.slice,ed.map,Math.sqrt(50)),nd=Math.sqrt(10),ad=Math.sqrt(2),rd=function(e,t,n){var a,r,i,l,o=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((a=t=0?(i>=td?10:i>=nd?5:i>=ad?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(i>=td?10:i>=nd?5:i>=ad?2:1)}(e,t,n))||!isFinite(l))return[];if(l>0)for(e=Math.ceil(e/l),t=Math.floor(t/l),i=new Array(r=Math.ceil(t-e+1));++ol?o:l)}),this.step=1,this.domain=[0,1],this.range=[0,1]},sd="undefined"!=typeof window&&"undefined"!=typeof document,ud=function(){},cd=function(e,t,n,a){var r=a?e-t:e+t;return a?Math.max(n[0],r):Math.min(n[1],r)},fd=function(e,t,n,a){var r=a?e+t:e-t;return a?Math.min(n[1],r):Math.max(n[0],r)},pd=function(e){function t(){var e,n;mp(this,t);for(var a=arguments.length,r=new Array(a),i=0;i0)}if(-1===l)return t;for(var f=o?a:-a,p=0;pb,"".concat(Gp," Max must be greater than min (even if reversed). Max is ").concat(h,". Min is ").concat(b,"."));var v=Qp(i||t.values,o,p,c),y=v.handles;(v.changes||void 0===i||i===t.values)&&(s(y.map(function(e){return e.val})),u(y.map(function(e){return e.val}))),g.step=r,g.values=i,g.domain=l,g.handles=y,g.reversed=o}else if(n=i,a=t.values,!(n===a||n.length===a.length&&n.reduce(function(e){return function(t,n,a){return t&&e[a]===n}}(a),!0))){var w=Qp(i,o,p,c),O=w.handles;w.changes&&(s(O.map(function(e){return e.val})),u(O.map(function(e){return e.val}))),g.values=i,g.handles=O}return Object.keys(g).length?g:null}}]),t}();pd.propTypes={},pd.defaultProps={mode:1,step:.1,domain:[0,100],component:"div",rootProps:{},rootStyle:{},vertical:!1,reversed:!1,onChange:ud,onUpdate:ud,onSlideStart:ud,onSlideEnd:ud,disabled:!1,flatten:!1,warnOnChanges:!1};var dd=pd;dd.Rail=Mp,dd.Ticks=Ip,dd.Tracks=zp,dd.Handles=Hp;function gd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function md(){return(md=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"right";if("left"===t)for(var n=e.length-1;n>=1;n--)if(e[n]<10){var a=10-e[n];e[n]=10,e[n-1]-=a}for(var r=0;r=1;l--)if(e[l]<10){var o=10-e[l];e[l]=10,e[l-1]-=o}return e};function Od(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function kd(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);te[r]?"right":"left",!0)}),[a,n]}(a,r),2);i[0];(function(e,t,n){var a=Sd(e),r=wd(a,n);return xd(r)})(r,0,i[1]).forEach(function(e,n){t[n].val=e})}return t},step:1,onUpdate:function(t){return e.onChange(Sd(t))},domain:_d,values:xd(e.value)},wp.element.createElement(Mp,null,function(e){var t=e.getRailProps;return wp.element.createElement(vd,{getRailProps:t})}),wp.element.createElement(Hp,null,function(e){var t=e.handles,n=e.getHandleProps;return wp.element.createElement("div",{className:"slider-handles"},t.map(function(e){return wp.element.createElement(yd,{key:e.id,handle:e,domain:_d,getHandleProps:n})}))}))};Ed.defaultProps={onChange:function(){},value:[]};var jd=Ed;function Pd(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"";return Object(b.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=ge(e.blockAttributes,t,""),a=e.screens;return wp.element.createElement(i.Fragment,null,a.includes("desktop")&&wp.element.createElement(Kd,{screens:a},i.Children.toArray(e.children).map(function(a){return Object(i.cloneElement)(a,{value:n(),onChange:function(n){e.onChange?e.onChange(t(),n,""):e.setAttributes(zd({},t(),n))}})})),a.includes("tablet")&&wp.element.createElement(Kd,{screens:a,screen:"tablet"},i.Children.toArray(e.children).map(function(a){return Object(i.cloneElement)(a,{value:n("Tablet"),placeholder:n("Tablet")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Tablet"),n,"Tablet"):e.setAttributes(zd({},t("Tablet"),n))}})})),a.includes("mobile")&&wp.element.createElement(Kd,{screens:a,screen:"mobile"},i.Children.toArray(e.children).map(function(a){return Object(i.cloneElement)(a,{value:n("Mobile"),placeholder:n("Mobile")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Mobile"),n,"Mobile"):e.setAttributes(zd({},t("Mobile"),n))}})})))};Ld.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},onChange:null,placeholder:"",screens:["desktop","tablet","mobile"]};var Fd=Ld;function Ud(e){return(Ud="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 Hd(e,t){for(var n=0;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _g={Edit:function(e){var t=e.blockProps,n=e.render,a=e.mainClass,r=e.blockTag,i=Cg(e,["blockProps","render","mainClass","blockTag"]),l=t.blockName,o=t.attributes,s=o.anchor,u=void 0===s?"":s,c=o.design,f=o.blockTag,d=void 0===f?"div":f,g=p()([e.className],Object(R.applyFilters)("stackable.".concat(l,".main-block.classes"),{"ugb-main-block":a},t)),m=p()(["ugb-inner-block"],Object(R.applyFilters)("stackable.".concat(l,".main-block.inner-classes"),{},t)),b=""!==u?u:void 0,h=d||r||"div";return wp.element.createElement(h,kg({},i,{id:b,className:g}),t.styles,Object(R.applyFilters)("stackable.".concat(l,".edit.output.outer"),null,c,t),n&&wp.element.createElement("div",{className:m},Object(R.applyFilters)("stackable.".concat(l,".edit.output.before"),null,c,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(R.applyFilters)("stackable.".concat(l,".edit.output.after"),null,c,t)))}};_g.Edit.defaultProps={styles:null,mainClass:!0},_g.Save=function(e){var t=e.blockProps,n=e.render,a=e.mainClass,r=e.blockTag,i=Cg(e,["blockProps","render","mainClass","blockTag"]),l=t.blockName,o=t.attributes,s=o.anchor,u=void 0===s?"":s,c=o.design,f=o.blockTag,d=void 0===f?"div":f,g=p()([e.className],Object(R.applyFilters)("stackable.".concat(l,".main-block.classes"),{"ugb-main-block":a},t)),m=p()(["ugb-inner-block"],Object(R.applyFilters)("stackable.".concat(l,".main-block.inner-classes"),{},t)),b=""!==u?u:void 0,h=d||r||"div";return wp.element.createElement(h,kg({},i,{id:b,className:g}),t.styles,Object(R.applyFilters)("stackable.".concat(l,".save.output.outer"),null,c,t),n&&wp.element.createElement("div",{className:m},Object(R.applyFilters)("stackable.".concat(l,".save.output.before"),null,c,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(R.applyFilters)("stackable.".concat(l,".save.output.after"),null,c,t)))},_g.Save.defaultProps={styles:null,mainClass:!0};var Sg=n(24);function xg(e){return(xg="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 Eg(e,t){for(var n=0;n0?r(n[0]):void 0),o=i(n),s=1===o.length&&o[0]&&"ugb/container"===o[0].name;return{isGroupable:l&&o.length&&!s,isUngroupable:s&&!!o[0].innerBlocks.length,blocksSelection:o,groupingBlockName:"ugb/container"}}),Object(re.withDispatch)(function(e,t){var n=t.clientIds,a=t.onToggle,r=void 0===a?b.noop:a,i=t.blocksSelection,l=void 0===i?[]:i,o=e("core/block-editor").replaceBlocks;return{onConvertToGroup:function(){if(l.length){var e=l.map(function(e){return Object(he.cloneBlock)(e)}),t=Object(he.createBlock)("ugb/container",{},e);o(n,t),r()}},onConvertFromGroup:function(){if(l.length){var e=l[0].innerBlocks;e.length&&(o(n,e),r())}}}})])(function(e){var t=e.onConvertToGroup,n=e.onConvertFromGroup,a=e.isGroupable,r=void 0!==a&&a,l=e.isUngroupable,u=void 0!==l&&l;return Object(re.select)("core/block-editor").getSelectedBlockClientIds?wp.element.createElement(i.Fragment,null,r&&wp.element.createElement($h.PluginBlockSettingsMenuItem,{icon:Yh,label:Object(s.__)("Group into Container",o.i18n),onClick:t}),u&&wp.element.createElement($h.PluginBlockSettingsMenuItem,{icon:Qh,label:Object(s.__)("Ungroup from Container",o.i18n),onClick:n})):null}),Jh=(Object(re.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientIds;return t?{clientIds:t()}:{}})(Xh),Object(bt.withState)({openPopover:!1,changed:!1})(function(e){var t=e.blockName,n=e.openPopover,a=e.changed,r=e.setState,o=e.getJSONBlockAttributes,s=e.setJSONBlockAttributes;return wp.element.createElement(i.Fragment,null,wp.element.createElement($h.PluginBlockSettingsMenuItem,{icon:"editor-code",label:"Get / Set Block Attributes",onClick:function(){r({openPopover:!0,changed:!1}),setTimeout(function(){return document.querySelector(".ugb-modal-get-block-attributes-button textarea").select()},100)}}),n&&wp.element.createElement(l.Modal,{title:"".concat(Object(b.startCase)(t)," Block Attributes"),focusOnMount:!0,className:"ugb-modal-get-block-attributes-button",onRequestClose:function(){if(a){var e=document.querySelector(".ugb-modal-get-block-attributes-button textarea").value;s(e)}r({openPopover:!1})}},wp.element.createElement("p",null,'Copy or modify the attributes of the block directly. Use only double quotes "'),wp.element.createElement("textarea",{onChange:function(){return r({changed:!0})}},o())))})),Zh=Object(bt.compose)([Object(re.withSelect)(function(e,t){var n=t.clientId,a=e("core/block-editor").getBlockName;return{blockName:n&&a(n)?a(n).replace(/^\w+\//g,""):"",getJSONBlockAttributes:function(){var t=e("core/block-editor").getBlockName,a=e("core/blocks").getBlockType;if(!n)return{};var r=e("core/block-editor").getBlockAttributes(n),i=t(n).replace(/^\w+\//g,""),l=a(t(n)).attributes,o=Object.keys(r).reduce(function(e,t){return r[t]!==(l[t]?l[t].default:"")&&(e[t]=r[t]),e},{});return o.uniqueClass=void 0,JSON.stringify(Object(R.applyFilters)("stackable.".concat(i,".design.filtered-block-attributes"),o),null,4)}}}),Object(re.withDispatch)(function(e,t){var n=t.clientId;return{setJSONBlockAttributes:function(e){if(n)try{var t=JSON.parse(e);Ce(t,n)}catch(e){console.error(e)}}}})])(Jh);Object(re.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientId;return t?{clientId:t()}:{}})(Zh);function ev(){return(ev=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nv=function(e){var t=e.blockTag,n=e.className,a=e.backgroundAttrName,r=e.blockProps,l=e.showBackground,o=e.showVideoBackground,u=tv(e,["blockTag","className","backgroundAttrName","blockProps","showBackground","showVideoBackground"]),c=p()([n],{"ugb--has-background-overlay":l&&V(a,r.attributes)});return wp.element.createElement(t,ev({className:c},u),e.children,l&&o&&function(e,t){var n=ge(t.attributes,function(t){return Object(b.camelCase)(Object(s.sprintf)(e,t))},""),a=n("BackgroundMediaUrl"),r=n("TabletBackgroundMediaUrl"),l=n("MobileBackgroundMediaUrl"),o=p()(["ugb-video-background"],{"ugb--video-hide-tablet":r,"ugb--video-hide-mobile":l}),u=p()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-mobile":l}),c=p()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-tablet":!0});return wp.element.createElement(i.Fragment,null,Be(a)&&wp.element.createElement("video",{className:o,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:a}),Be(r)&&wp.element.createElement("video",{className:u,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:r}),Be(l)&&wp.element.createElement("video",{className:c,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:l}))}(a,r))};nv.defaultProps={className:"",backgroundAttrName:"%s",blockProps:{},showBackground:!0,showVideoBackground:!0,blockTag:"div"};var av=function(e){return wp.element.createElement(l.Modal,{title:Object(s.__)("Stackable Welcome Guide",o.i18n),className:"ugb-modal-welcome-video",overlayClassName:"ugb-modal-welcome-video__overlay",shouldCloseOnClickOutside:!1,onRequestClose:e.onRequestClose},wp.element.createElement("p",null,Object(s.__)("Hello there 👋 I see you might be new to Stackable, we've made a short 3-minute video so you can make the most out of our unique blocks.",o.i18n)),wp.element.createElement("iframe",{title:Object(s.__)("Video Tutorial",o.i18n),width:"800",height:"413",src:"https://www.youtube.com/embed/UW0Rg96aATA",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),wp.element.createElement("p",null,wp.element.createElement(st,{className:"button-primary",onClick:e.onRequestClose,"data-testid":"button-close"},Object(s.__)("Close it, I'm good",o.i18n))))};av.defaultProps={onRequestClose:function(){}};function rv(){return(rv=Object.assign||function(e){for(var t=1;t*>.ugb-main-block{margin-top:35px;margin-bottom:35px;padding:0 35px}[data-type^="ugb/"]>.wp-block[data-align=full]{margin-left:-10px;margin-right:-10px}.ugb--has-panel-tabs .ugb-panel-tabs~.editorskit-panel{display:none}.components-toolbar__control.ugb--is-premium{position:relative}.components-toolbar__control.ugb--is-premium:after{position:absolute;z-index:1;background:none;line-height:18px;padding:0 6px;border-radius:2px;left:0;right:0;text-transform:uppercase;background-size:100%;background-repeat:no-repeat;font-family:dashicons;content:"\f160";color:#888;font-size:20px;opacity:0}.components-toolbar__control.ugb--is-premium *,.components-toolbar__control.ugb--is-premium:after{transition:all .2s ease-in-out}.components-toolbar__control.ugb--is-premium:disabled{opacity:1}.components-toolbar__control.ugb--is-premium:disabled *{opacity:.3}.components-toolbar__control.ugb--is-premium:hover *{opacity:0}.components-toolbar__control.ugb--is-premium:hover:after{opacity:1}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-base-control__label,body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-toggle-control__label{cursor:help;border-bottom:1px solid transparent}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-base-control__label:hover,body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-toggle-control__label:hover{border-color:#8c33da;color:#8c33da;border-bottom-style:solid!important}body.ugb--help-tips-enabled .components-base-control[class*=ugb--help-tip-]:hover .components-base-control__label,body.ugb--help-tips-enabled .components-base-control[class*=ugb--help-tip-]:hover .components-toggle-control__label{border-color:#a683c5;border-bottom-style:dashed}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle{cursor:pointer}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle:after{content:"\f223";margin-left:10px;font-family:dashicons;font-size:20px;line-height:16px;text-shadow:0 0 1px #000;color:#fafafa}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle:hover{color:#8c33da!important}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle:hover:after{cursor:help;color:#b266f4;text-shadow:none}.ugb-help-tooltip-video{margin-left:-30px!important}.ugb-help-tooltip-video .components-popover__content{min-width:220px!important;width:220px!important}.ugb-help-tooltip-video .components-panel__body{padding:0 16px 16px}.ugb-help-tooltip-video video{width:100%;height:auto;position:relative;z-index:2;margin:0 -16px 8px;min-width:calc(100% + 32px);min-height:163.5px}.ugb-help-tooltip-video .ugb-help-tooltip-video__link{margin-top:5px;text-align:right;cursor:pointer}.ugb-help-tooltip-video .ugb-help-tooltip-video__link svg{vertical-align:bottom}.ugb-help-tooltip-video .components-spinner{position:absolute;left:calc(50% - 9px);text-align:center;top:82px;margin:0;z-index:1}.ugb-help-tooltip-video .ugb-help-tooltip-video__remove{background:none!important;border:none;position:absolute;top:10px;right:4px;cursor:pointer;z-index:9!important}.ugb-help-tooltip-video .ugb-help-tooltip-video__remove svg{max-width:none;stroke:rgba(0,0,0,.3);stroke-width:1px;fill:#fff}.ugb-help-tooltip-video .ugb-help-tooltip-video__remove:hover{color:#444}.ugb-help-tooltip-video h4{margin:0 0 8px;font-size:1em}.ugb-help-tooltip__checkbox{font-size:11px;margin:20px 0 -10px;color:#777;font-style:italic}.ugb-help-tooltip__checkbox .components-checkbox-control__input-container{margin-right:8px}[data-type="ugb/accordion"] .ugb-accordion__heading{outline:none}[data-type="ugb/accordion"] .ugb-accordion__heading svg{transform:rotate(180deg)!important}[data-type="ugb/accordion"] .ugb-accordion__heading>:first-child{flex:1}[data-type="ugb/accordion"] .ugb-accordion:not(.ugb-accordion--open) .ugb-accordion__content{display:none}[data-type="ugb/accordion"] .ugb-accordion:not(.ugb-accordion--open) .ugb-accordion__heading svg{transform:rotate(0deg)!important}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .ugb-accordion__content-inner{padding-top:0}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__content{overflow:visible}#editor .ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__content .ugb-accordion__content-inner{padding-bottom:0}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading{z-index:0}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__item.ugb--has-background-overlay .ugb-video-background,#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__item.ugb--has-background-overlay:before{z-index:-1!important}.ugb-accordion__heading>div:empty{display:none}.ugb-blockquote{margin-left:0;margin-right:0}.ugb-blockquote__inspector__icon{flex-wrap:wrap}.ugb-blog-post__inspector-spinner>*{margin:0 auto 16px;display:block;float:none}.ugb-blog-posts__item:after{pointer-events:none}[data-type][data-align=full] .ugb-cta.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background,[data-type][data-align=full] .ugb-cta.ugb-main-block:not(.ugb--has-block-background){padding:0}[data-type][data-align=full] .ugb-cta.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background .ugb-cta__item,[data-type][data-align=full] .ugb-cta.ugb-main-block:not(.ugb--has-block-background) .ugb-cta__item{border-radius:0}.ugb-column>.ugb-inner-block>.ugb-block-content>.ugb-column__item{overflow:visible!important}[data-type="ugb/column"]>.block-editor-block-list__block-edit{height:100%}[data-type="ugb/column"]>.block-editor-block-list__block-edit>[data-block]{display:flex;flex-direction:column}.wp-block[data-type="ugb/column"],.wp-block[data-type="ugb/column"] .wp-block{max-width:none}[data-type="ugb/column"],[data-type="ugb/column"]>.ugb-column{height:100%}[data-type="ugb/column"]{transition:none!important}.ugb-column__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-block]:first-child{margin-top:0!important}.ugb-column__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.block-list-appender:not(:first-child){margin-bottom:-28px!important}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:first-child{grid-area:one}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(2){grid-area:two}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(3){grid-area:three}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(4){grid-area:four}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(5){grid-area:five}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(6){grid-area:six}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(7){grid-area:seven}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(8){grid-area:eight}.ugb-columns:not(.ugb-columns--design-plain):not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-columns:auto;grid-auto-flow:row}.ugb-columns .ugb-columns__item{align-items:stretch}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>div{margin-left:0;margin-right:0}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two";grid-template-columns:1fr 1fr;grid-template-rows:auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three three";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four" "five five";grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six" "seven seven seven";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three four" "five six seven eight";grid-template-columns:1fr 1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:first-child{grid-area:one}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(2){grid-area:two}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(3){grid-area:three}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(4){grid-area:four}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(5){grid-area:five}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(6){grid-area:six}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(7){grid-area:seven}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(8){grid-area:eight}.ugb-columns:not(.ugb-columns--design-plain):not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-auto-columns:auto;grid-auto-flow:row}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{display:flex!important;justify-content:stretch;align-items:stretch;height:100%}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{height:100%}.ugb-columns__item>.block-editor-inner-blocks{width:100%}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>div{margin-left:0;margin-right:0}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two";grid-template-columns:1fr 1fr;grid-template-rows:auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two" "three three";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two" "three four";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two" "three four" "five five";grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two three" "four five six";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two three" "four five six" "seven seven seven";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two three four" "five six seven eight";grid-template-columns:1fr 1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.block-editor-block-list__block{display:flex;flex-direction:column}[data-type="ugb/columns"].has-child-selected [data-type="ugb/column"]:not(.has-child-selected):before,[data-type="ugb/columns"].is-selected [data-type="ugb/column"]:not(.has-child-selected):before{border:1px dashed rgba(123,134,162,.3)}[data-type="ugb/column"]:before{top:0!important;bottom:0!important;left:0!important;right:0!important}[data-type="ugb/columns"]:not(.is-selected):before{border:1px dashed rgba(243,73,87,.6)!important}[data-type="ugb/column"]{transition:all .3s ease-in-out!important}[data-type="ugb/column"][style*="transform: tra"]{transition:none!important}.ugb-columns--highlight-1>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:first-child,.ugb-columns--highlight-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(2),.ugb-columns--highlight-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(3),.ugb-columns--highlight-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(4),.ugb-columns--highlight-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(5),.ugb-columns--highlight-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(6),.ugb-columns--highlight-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(7),.ugb-columns--highlight-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(8){transform:translateY(-20px)!important}[data-align=full] .ugb-container:not(.ugb-container--design-plain):not(.ugb--has-block-background){padding-left:0!important;padding-right:0!important}[data-align=full] .ugb-container:not(.ugb-container--design-plain):not(.ugb--has-block-background)>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{border-radius:0!important}[data-type="ugb/container"][data-align=center]{text-align:inherit}.ugb-container .block-editor-block-list__block{max-width:none!important}[data-align=full] .ugb-countup{border-radius:0!important;margin-top:0;margin-bottom:0}.ugb-design-library-block .components-placeholder__label svg{margin-right:8px}.ugb-design-library-block button.components-button{height:auto;font-weight:600;text-transform:uppercase;font-size:13px;padding:11px 20px;background:#fff}.ugb-insert-library-button svg{width:20px;height:20px}.ugb-insert-library-button{margin-left:10px;margin-right:10px}.ugb-expand__label{font-size:12px;text-transform:uppercase;font-weight:600;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;color:#8e979e;padding:2em 0 0;border:none;box-shadow:none;white-space:nowrap;display:block}.ugb-expand__label:first-child{padding-top:0}.ugb-expand .ugb-expand__less-text p,.ugb-expand .ugb-expand__more-text p{font-size:inherit!important;color:inherit!important}.ugb-expand .ugb-block-content>a{display:inline-block}.ugb-feature.ugb-feature--design-basic .ugb-feature__image.ugb-image-upload-placeholder.ugb-image-upload-has-placeholder,.ugb-feature.ugb-feature--design-plain .ugb-feature__image.ugb-image-upload-placeholder.ugb-image-upload-has-placeholder{height:250px}.ugb-feature-grid .ugb-image-upload-placeholder.ugb-image-upload-has-placeholder{height:100px;width:100px;margin:0 auto;border-radius:100%}[data-type][data-align=full] .ugb-header.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background,[data-type][data-align=full] .ugb-header.ugb-main-block:not(.ugb--has-block-background){padding:0}[data-type][data-align=full] .ugb-header.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background .ugb-header__item,[data-type][data-align=full] .ugb-header.ugb-main-block:not(.ugb--has-block-background) .ugb-header__item{border-radius:0}.editor-styles-wrapper .ugb-heading .ugb-heading__subtitle,.editor-styles-wrapper .ugb-heading .ugb-heading__top-line{margin-bottom:16px}.editor-styles-wrapper .ugb-heading .ugb-heading__title{margin-bottom:8px}.ugb-icon-list ul{list-style:none!important}.ugb-icon-list ul li:before{cursor:pointer}.ugb-icon-list.ugb-icon-list li:last-child{margin-bottom:0!important}.ugb-icon-list__center-align li,.ugb-icon-list__right-align li{width:-webkit-fit-content!important;width:fit-content!important;width:-moz-fit-content!important;margin-left:auto!important}.ugb-icon-list__center-align li{margin-right:auto!important}.ugb-icon-list__left-align li{width:-webkit-fit-content!important;width:fit-content!important;width:-moz-fit-content!important;margin-right:auto!important}.ugb-image-box__image:hover{opacity:1!important}.ugb-image-box__arrow{pointer-events:all!important}[data-type="ugb/notification"] .ugb-notification.ugb-notification--dismissible{display:flex!important}[data-type="ugb/notification"] .ugb-notification__item>:last-child,[data-type="ugb/notification"] .ugb-notification__item>:last-child [role=textbox]{margin-bottom:0}[data-type="ugb/notification"] .ugb-svg-icon-placeholder__button{display:block;width:100%}.ugb-number-box .ugb-number-box__number[data-is-placeholder-visible=true]{transition:none;height:2.5em;width:2.5em;left:calc(50% - 1.25em)}.ugb-number-box .ugb-number-box__item>:not(.ugb-number-box__content){z-index:3!important}.ugb-number-box .ugb-number-box__item>.ugb-number-box__content{z-index:4!important}.ugb-pricing-box__price-line>:first-child{align-self:flex-start}.ugb-pricing-box__price-line>:last-child{align-self:flex-end}[data-type="ugb/separator"]{z-index:30!important}[data-type="ugb/separator"]~.wp-block.is-selected{z-index:31}[data-type="ugb/separator"][data-align=full] .ugb-separator .ugb-separator__svg-inner{overflow:hidden}[data-type="ugb/separator"][data-align=full] .ugb-separator .ugb-separator__svg-wrapper{overflow:visible}.ugb-team-member-setting__social,.ugb-team-member-setting__social .components-base-control__field{margin-bottom:8px!important}.ugb-team-member__image .ugb-image-upload-has-placeholder{border-radius:100%;height:0;padding-bottom:100%}.ugb-team-member__image .ugb-image-upload-has-placeholder svg{top:50%;position:absolute;transform:translateY(-50%)}.ugb-testimonial__image .ugb-image-upload-has-placeholder{border-radius:100%;height:0;padding-bottom:100%}.ugb-testimonial__image .ugb-image-upload-has-placeholder svg{top:50%;position:absolute;transform:translateY(-50%)}#editor [data-type="ugb/video-popup"][data-align=full] .ugb-video-popup.ugb-main-block--inner-full.ugb--has-block-background .ugb-video-popup__wrapper,#editor [data-type="ugb/video-popup"][data-align=full] .ugb-video-popup:not(.ugb--has-block-background) .ugb-video-popup__wrapper{border-radius:0;margin-left:-35px;margin-right:-35px;width:calc(100% + 70px)}.ugb-admin-setting{margin-bottom:16px}.ugb-admin-setting__label-wrapper{display:flex;align-items:center}.ugb-admin-setting__label{width:200px;display:inline-block;font-weight:700;color:#666;padding-right:15px;box-sizing:border-box}.ugb-admin-setting--small .ugb-admin-setting__label{width:130px}.ugb-admin-setting__field{flex:1}body .ugb-admin-setting .ugb-admin-setting__label-wrapper+.ugb-admin-setting__help{margin-left:200px;margin-bottom:24px!important;margin-top:8px!important}input.ugb-admin-text-setting{padding:.5em 1em;box-shadow:0 5px 30px -10px rgba(18,63,82,.1);border:1px solid rgba(0,0,0,.1);margin:0}input.ugb-admin-text-setting[type=text]{width:calc(100% - 300px)}.ugb-admin-toggle-setting__button{outline:0;display:block;height:26px;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:1.5em auto 1em!important;padding:0!important;border:0!important;border-radius:26px;transition:all .4s ease;display:inline-block;background:#e4f5e4;outline:none;outline-offset:3px}.ugb-admin-toggle-setting__button:focus{outline:1px dashed #888}.ugb-admin-toggle-setting__button:after,.ugb-admin-toggle-setting__button:before{position:relative;display:block;content:"";width:26px;height:100%}.ugb-admin-toggle-setting__button:after{left:calc(100% - 26px);background:#3ca540;border-radius:50%;transition:all .2s ease;position:absolute;top:0;box-shadow:0 3px 10px -5px #000}.ugb-admin-toggle-setting__button:before{display:none}.ugb-admin-toggle-setting__button span{position:relative;display:flex;justify-content:center;align-items:center;z-index:2;color:rgba(0,0,0,.4);font-size:11px;line-height:26px;transition:padding .2s ease;padding:0 35px 0 15px}.ugb-admin-toggle-setting__button span:first-child{color:#7b7b7b}.ugb-admin-toggle-setting__button span:nth-child(2){color:#209e25}.ugb-admin-toggle-setting__button span:first-child{display:none}.ugb-admin-toggle-setting__button span:nth-child(2){display:block}.ugb-admin-toggle-setting__button[aria-checked=false]{background:#f0f0f0}.ugb-admin-toggle-setting__button[aria-checked=false]:after{left:0;background:#7b7b7b}.ugb-admin-toggle-setting__button[aria-checked=false] span{padding:0 15px 0 35px}.ugb-admin-toggle-setting__button[aria-checked=false] span:first-child{display:block}.ugb-admin-toggle-setting__button[aria-checked=false] span:nth-child(2){display:none}.ugb-advanced-autosuggest-control{margin-bottom:16px}.ugb-advanced-autosuggest-control__select>*{position:relative}.ugb-advanced-autosuggest-control__select input{width:100%}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-container{position:absolute;top:100%;max-height:272px;overflow-y:auto;z-index:2;background:#fff;width:100%;margin-top:5px;border-radius:6px}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-container:not(:empty){box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2),0 5px 30px -10px rgba(18,63,82,.3)}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-list,.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-list li{margin:0}.ugb-advanced-autosuggest-control__select .react-autosuggest__section-container:not(.react-autosuggest__section-container--first){border-top:1px solid #ddd}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestion{background:#fff;padding:8px 16px;cursor:pointer}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestion--highlighted{background:#f1f1f1}.ugb--autosuggest-empty{font-style:italic;font-size:.9em;color:#999}.ugb--autosuggest-group{background:#fff;padding:14px 16px 8px;font-weight:700;color:#aaa}.ugb-advanced-range-control{width:100%}.ugb-range-control.ugb-range-control--blank .components-range-control__track{width:var(--ugb-advanced-range-control--width)!important}.ugb-range-control.ugb-range-control--blank [class*=ThumbWrapper]{left:var(--ugb-advanced-range-control--width)!important}.ugb-range-control{display:flex}.ugb-range-control .components-range-control{flex:1}.ugb-range-control .components-input-control__container{position:relative;border-radius:2px;padding-top:0;box-sizing:border-box;display:inline-block;font-size:13px;margin-top:0;width:64px;margin-left:16px}.ugb-range-control .components-range-control__reset{height:30px;min-height:30px;margin-left:8px}.ugb-range-control .components-base-control,.ugb-range-control .components-base-control__field{margin-bottom:0}.ugb-range-control .components-number-control{width:unset}.ugb-advanced-toolbar-control .components-button-group{width:100%}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--full-width{display:flex;flex-wrap:nowrap}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--full-width>button,.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--full-width>button>svg{width:100%!important}.ugb-advanced-toolbar-control .components-button-group svg{height:20px!important;width:auto}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline{flex-wrap:wrap}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline>button{margin-top:-1px!important;margin-left:-1px!important}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline>button,.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline>button>svg{width:auto!important}.ugb-advanced-toolbar-control__text-button{align-self:center;width:100%}body.branch-5-4 .ugb-advanced-toolbar-control .components-button-group{border:1px solid #e2e4e7}.ugb-base-control-multi-label{display:grid;grid-template-columns:auto 1fr auto;margin-bottom:5px;align-items:center}.ugb-base-control-multi-label .ugb-base-control-multi-label__label{margin-bottom:0}.ugb-base-control-multi-label__units{top:0;right:0;display:flex}.ugb-base-control-multi-label__units button{border:0;font-size:10px;margin:0;font-weight:400;outline:none;color:#aaa;padding:0 4px;background:transparent;cursor:pointer;text-transform:uppercase}.ugb-base-control-multi-label__units button:hover{color:#333}.ugb-base-control-multi-label__units button.is-active{color:#333;text-decoration:underline}.ugb-base-control-multi-label__units .components-button{text-transform:none}.ugb-modal-get-block-attributes-button textarea{width:50vw;height:60vh;font-family:monospace}.ugb-border-controls__border-type-toolbar button[value=dashed],.ugb-border-controls__border-type-toolbar button[value=dotted],.ugb-border-controls__border-type-toolbar button[value=solid]{position:relative}.ugb-border-controls__border-type-toolbar button[value=dashed]:before,.ugb-border-controls__border-type-toolbar button[value=dotted]:before,.ugb-border-controls__border-type-toolbar button[value=solid]:before{position:absolute;content:"";top:calc(50% - 1px);left:16px;right:16px;border-top:2px solid}.ugb-border-controls__border-type-toolbar button[value=dashed] span,.ugb-border-controls__border-type-toolbar button[value=dotted] span,.ugb-border-controls__border-type-toolbar button[value=solid] span{visibility:hidden}.ugb-border-controls__border-type-toolbar button[value=dashed]:before{border-top-style:dashed}.ugb-border-controls__border-type-toolbar button[value=dotted]:before{top:calc(50% - 2px);border-top:4px dotted}.ugb-border-controls__border-preview{margin-right:12px;width:22px;border-right:0!important;border-bottom:0!important;border-left:0!important}.ugb-button.ugb-button--icon-only .ugb-svg-icon-placeholder__button{display:block}.ugb-button.ugb-button--has-icon .ugb-svg-icon-placeholder__button{height:auto}.ugb-button svg{transition:initial!important}.ugb-button.ugb-button--has-icon .ugb-icon-inner-svg svg.ugb-custom-icon{fill:initial}.ugb-button-icon-control .components-popover__content{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2),0 5px 30px -10px rgba(18,63,82,.3)}.ugb-button-icon-control .components-base-control__field{display:flex;justify-content:space-between;align-items:center}.ugb-button-icon-control button{display:flex}.components-popover.ugb-button-icon-control__popover{z-index:100000}.components-popover.ugb-button-icon-control__popover .components-popover__content{width:290px}.ugb-button-icon-control__popover .components-panel__body-title{padding:15px!important;background:transparent!important}.ugb-button-icon-control__wrapper{display:flex;align-items:center}.ugb-button-icon-control__wrapper .ugb-button-icon-control__reset{padding:6px;margin:0 6px}.ugb-button-icon-control__wrapper .ugb-button-icon-control__reset svg{width:14px;height:14px}.ugb-button-icon-control__wrapper .ugb-button-icon-control__edit{padding:0 6px}.ugb-button-icon-control__wrapper .ugb-button-icon-control__edit svg{width:18px;height:18px;margin:0}.ugb-button-icon-control .components-toggle-control,.ugb-button-icon-control .components-toggle-control .components-base-control__field,.ugb-button-icon-control .components-toggle-control .components-toggle-control__label{margin-bottom:0!important}.ugb-button-icon-control__text-title{margin:0 0 1em!important}.ugb-button-icon-popover-control-color-preview,.ugb-button-icon-popover-control-image-preview{margin:0 12px 0 0;height:20px;width:20px}.ugb-button-icon-popover-control-color-preview .components-circular-option-picker__option,.ugb-button-icon-popover-control-image-preview .components-circular-option-picker__option{color:transparent!important}.ugb-button-icon-popover-control-color-preview .components-circular-option-picker__option{padding:0}.ugb-button-icon-popover-control-color-preview .components-circular-option-picker__option:focus:after{width:24px;height:24px}.ugb-button-icon-popover-control-color-preview.ugb-button-icon-popover-control-color-preview--transparent:before{background-size:63px!important;opacity:.5}.ugb-button-icon-popover-control-image-preview:before{background:transparent!important}.ugb-button-icon-popover-control-image-preview .components-circular-option-picker__option{padding:0;background-size:cover}.ugb-button-icon-popover-control-image-preview .components-circular-option-picker__option:after{display:none}.ugb-button-icon-popover-control-image-preview svg{height:100%;width:100%;fill:#d1d1d1}.ugb-code-textarea+.CodeMirror{height:500px;margin-left:-16px;margin-right:-16px;border-top:1px solid #ddd;border-bottom:1px solid #ddd;margin-bottom:16px}.ugb-columns-width-control__range{display:flex;align-items:center;margin-bottom:8px}.ugb-columns-width-control__range .ugb-columns-width-control__icon{height:20px;width:20px;flex-shrink:0;font-size:14px;margin-right:10px;font-weight:700;display:block;text-align:center}.ugb-columns-width-control__range .components-base-control.components-range-control,.ugb-columns-width-control__range .components-base-control__field{margin-bottom:0!important}.ugb-columns-width-control__range .components-range-control{flex:1}.ugb-columns-width-control .ugb-design-control-wrapper.components-base-control{margin-bottom:0}.ugb-columns-width-control .ugb-design-control{padding:0}.ugb-columns-width-control .ugb-design-control .components-radio-control__option{width:25%}.ugb-columns-width-control .ugb-design-control .components-base-control__field{margin-bottom:0!important;display:flex;justify-content:space-evenly}.ugb-columns-width-control .ugb-design-panel-item__image{display:block}.ugb-columns-width-control .ugb-columns-width-control__suffix{flex-shrink:0;font-size:14px;margin-left:5px;display:block;text-align:center}.ugb-columns-width-control .ugb-columns-width-control__reset{text-transform:none}.ugb-column-widths-control__columns-slider{height:20px;margin-top:20px}.ugb-column-widths-control__columns-slider [role=slider]{position:absolute;transform:translate(-50%,-50%);width:10px;height:10px;padding:0;border-radius:50%;background-color:#555d66;border:0;outline:0}.ugb-column-widths-control__columns-slider [role=slider]:focus{border:1px solid #555d66;background:#fff}.ugb-column-widths-control__columns-input{display:grid}.ugb-column-widths-control__columns-input input{min-width:40px!important;width:40px;padding:4px 2px!important;font-size:11px;margin:0 auto}.ugb-column-widths-control__columns-input input:not(:hover):not(:focus){border-color:#eee}.ugb-control-separator{height:1px!important;background:#ddd!important;margin:24px -16px!important;border:0!important;padding:0!important;width:calc(100% + 32px)!important;box-shadow:none!important}.components-panel__body-title+.ugb-control-separator{margin-top:0!important}.ugb-design-control{max-height:450px}.ugb-design-control input{opacity:0;height:0;width:0;margin:0;padding:0;position:fixed;top:0}.ugb-design-control .components-radio-control__option{display:inline-block;width:50%;text-align:center}.ugb-design-control label>span{padding:4px;display:block;border-radius:0}.ugb-design-control label>span>img{border-radius:4px}.ugb-design-control input:checked+label>span{box-shadow:inset 0 0 0 1px #1e1e1e}.ugb-design-control input+label>span:hover{background:#f0f0f0}.ugb-design-control .design-label svg{height:12px;margin:0 0 0 5px;fill:#ffad00}.ugb-design-control--columns-3 .ugb-design-control .components-radio-control__option{width:33.3%}.ugb-design-control--columns-4 .ugb-design-control .components-radio-control__option{width:25%}.ugb-design-library-control__open-library{margin:0 0 8px auto!important;display:block}.ugb-design-library-control__open-library__toolbar{font-size:11px;display:flex;justify-content:space-between;padding:0}.ugb-design-library-items{page-break-inside:avoid;break-inside:avoid;column-count:1;column-gap:38px}.ugb-design-library-items.ugb-design-library-items--columns-2{column-count:2}.ugb-design-library-items.ugb-design-library-items--columns-3{column-count:3}.ugb-design-library-items.ugb-design-library-items--columns-4{column-count:4}.ugb-design-library-items .components-base-control__help{text-align:center;font-style:italic}.ugb-design-library-items .ugb-design-library-search__spinner{display:flex}.ugb-design-library-items .ugb-design-library-search__spinner .components-spinner{margin:0 auto}.ugb-modal-design-library__wrapper{overflow:hidden}.ugb-modal-design-library__designs{overflow:auto}.ugb-design-library-item{border-radius:0;box-shadow:0 2px 15px hsla(0,0%,60%,.3);overflow:hidden;transition:all .3s ease-in-out;position:relative;margin-bottom:38px;display:block;transform:translateZ(0);break-inside:avoid;width:100%;will-change:transform}.ugb-design-library-item:hover{transform:translateY(-4px) scale(1.03);box-shadow:0 6px 25px hsla(0,0%,60%,.3)}.ugb-design-library-item img{display:block;pointer-events:none;width:100%;height:auto;min-height:50px;background:#f1f1f1}.ugb-design-library-item footer{padding:8px 12px;font-size:11px;line-height:18px;display:flex;justify-content:space-between}.ugb-design-library-item.ugb--is-busy .ugb-design-library-item__spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) translateY(-10px)}.ugb-design-library-item.ugb--is-busy .components-spinner{margin:0}.ugb-design-library-item.ugb--is-busy img{opacity:.15}.ugb-design-library-item .ugb-design-library-item__image .dashicon{position:absolute;top:calc(50% - 17.5px);left:50%;transform:translate(-50%,-50%);opacity:0;fill:#000;height:24px;width:24px}.ugb-design-library-item .ugb-design-library-item__image .dashicon:before{font-size:24px}.ugb-design-library-item .ugb-design-library-item__image .dashicon,.ugb-design-library-item .ugb-design-library-item__image img{transition:all .3s ease-in-out}.ugb-design-library-item[class*=ugb--is-premium]:hover .ugb-design-library-item__image img{opacity:.4}.ugb-design-library-item[class*=ugb--is-premium]:hover .ugb-design-library-item__image .dashicon{opacity:1}.ugb-design-library-item__image{padding:0!important;border:0!important;text-align:start!important;width:100%!important;margin:0!important;outline:none!important;cursor:pointer;display:block}.ugb-design-library-item__premium{position:absolute;z-index:1;background:#f00069;font-size:10px;color:#fff;line-height:18px;padding:0 6px;border-radius:2px;top:5px;right:5px;text-transform:uppercase;letter-spacing:1px;transition:none!important}.ugb-design-library-item__premium-link{cursor:pointer}.ugb-design-library-item__favorite{border:0;padding:0;cursor:pointer;outline:none;transition:all .3 ease-in-out}.ugb-design-library-item__favorite .dashicon{fill:#bbb;height:14px;width:14px}.ugb-design-library-item__favorite.ugb--is-favorite .dashicon,.ugb-design-library-item__favorite.ugb--is-favorite:hover .dashicon,.ugb-design-library-item__favorite:hover .dashicon{fill:#d30c5c}.ugb-design-control{max-height:40vh;overflow-y:auto}.ugb-design-control .components-base-control__label{margin-left:-16px;margin-right:-16px;margin-bottom:8px}.ugb-design-panel-item{position:relative}.ugb-design-panel-item .ugb-design-panel-item__image{mix-blend-mode:darken}.ugb-design-panel-item__hover-image{position:absolute;top:5px;left:5px;right:5px;width:calc(100% - 10px);opacity:0;transition:opacity .4s ease-in-out}.ugb-design-panel-item:hover .ugb-design-panel-item__hover-image{opacity:1}#editor .ugb--has-background-overlay.ugb--has-background-overlay .ugb-video-background,#editor .ugb--has-background-overlay.ugb--has-background-overlay:before{pointer-events:none}.ugb-icon-control svg .fa-secondary,.ugb-icon-popover svg .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.ugb-icon-is-loading{animation:icon-loading 1.3s linear infinite;height:12px!important;width:12px!important}@keyframes icon-loading{0%{opacity:.8;transform:rotate(0deg)}25%,75%{opacity:.4}50%{opacity:.8}to{opacity:.8;transform:rotate(1turn)}}.ugb-icon--faded{opacity:.4}.ugb-four-number-control__wrapper{display:grid;grid-gap:4px;grid-template-columns:1fr 1fr 1fr 1fr -webkit-min-content;grid-template-columns:1fr 1fr 1fr 1fr min-content;align-items:flex-start}.ugb-four-number-control__wrapper button{padding:6px!important}.ugb-four-number-control__wrapper button.ugb--is-locked,.ugb-four-number-control__wrapper button.ugb--is-locked:hover{background:#aaa!important;color:#fff!important}.ugb-four-number-control__label{display:flex;flex-direction:column;justify-content:center;align-items:center}.ugb-four-number-control__label span{font-size:9px;opacity:.8}.ugb-four-number-control__label input{margin:0;width:100%;padding-left:0!important;padding-right:0!important;text-align:center}.ugb-four-number-control__label input[disabled]{background:#e5e4e8;cursor:not-allowed}.ugb-four-range-control__range{display:flex;align-items:center}.ugb-four-range-control__range .ugb-four-range-control__icon{height:20px;width:20px;flex-shrink:0;margin-right:10px}.ugb-four-range-control__range .components-base-control.components-range-control,.ugb-four-range-control__range .components-base-control__field{margin-bottom:0!important}.ugb-four-range-control__range .components-range-control{flex:1}.ugb-four-range-control .ugb-four-range-control__lock{height:auto;color:#555d66;box-shadow:none!important;margin-left:5px}.ugb-four-range-control .ugb-four-range-control__lock svg{height:16px;width:16px}.ugb-four-range-control.ugb--locked .ugb-four-range-control__range{margin-bottom:8px}.ugb-four-range-control:not(.ugb--locked) .ugb-advanced-range-control{margin-bottom:0}.ugb-global-style-control__item{display:flex;align-items:center}.ugb-global-style-control__item-label{flex-grow:1}li[aria-selected=false] .ugb-global-style-control__item-button{visibility:hidden}.ugb-global-style-control__item-preview{margin-right:12px}.ugb-global-style-control__item--large-preview .ugb-global-style-control__item-preview{margin-right:0;margin-bottom:12px;width:100%}.ugb-global-style-control__item--large-preview.ugb-global-style-control__item{display:flex;flex-wrap:wrap}.ugb-global-style-control .ugb-advanced-autosuggest-control__select{display:flex}.ugb-global-style-control .ugb-advanced-autosuggest-control__select>*{margin-left:8px}.ugb-global-style-control .ugb-advanced-autosuggest-control__select .react-autosuggest__container{flex:1;margin-left:0}.ugb-global-style-control .ugb-advanced-autosuggest-control__select .react-autosuggest__container input{height:100%}.ugb-global-style-control.ugb--has-value .react-autosuggest__suggestions-list>:first-child{border-bottom:1px solid #ddd}.ugb-global-style-control .react-autosuggest__suggestions-container{min-width:248px}.ugb-icon-control .ugb-icon-control__icon-button{height:auto;padding:8px;margin-right:auto}.ugb-icon-control .ugb-icon-control__icon-button svg{width:30px;height:30px}.ugb-icon-control .ugb-icon-control__wrapper{display:flex;justify-content:space-between;margin-bottom:16px}.ugb-icon-popover .components-popover__content{overflow:hidden;width:300px}.ugb-icon-popover__iconlist{display:flex;flex-wrap:wrap;justify-content:center;align-content:flex-start;align-items:flex-start;margin-top:5px;height:200px;overflow:auto}.ugb-icon-popover__iconlist button{background:none;padding:5px;border-color:transparent;box-shadow:none;width:40px;height:40px}.ugb-icon-popover__iconlist button:hover{box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff!important}.ugb-icon-popover__iconlist button:hover>div>svg{color:#000}.ugb-icon-popover__iconlist svg{width:30px!important;height:30px;margin:0;box-sizing:content-box;border-radius:4px}.ugb-icon-popover__iconlist button>div>svg{color:#444}.ugb-icon-popover__iconlist .components-base-control__help{font-style:italic}.ugb-icon-popover__label-container{display:flex;flex-wrap:wrap;align-items:center;margin-bottom:16px}.ugb-icon-popover__label-container .components-base-control__field{margin-bottom:0}.ugb-icon-popover__label-container .ugb-icon-popover__input{flex:1;flex-basis:calc(100% - 50px)}.ugb-icon-popover__label-container .ugb-icon-popover__settings-button{height:30px;margin-left:8px}.ugb-icon-popover__label-container .components-range-control__reset,.ugb-icon-popover__label-container .components-range-control__upload{text-align:center;display:block}.ugb-icon-popover__label-container.ugb-icon--has-upload.ugb-icon--has-reset .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-upload.ugb-icon--has-reset .components-range-control__upload{flex-basis:calc(50% - 4px);margin-top:8px}.ugb-icon-popover__label-container.ugb-icon--has-settings .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-settings .components-range-control__upload{margin-top:8px}.ugb-icon-popover__label-container.ugb-icon--has-upload .components-range-control__reset,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-reset) .components-range-control__upload,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload) .components-range-control__reset{margin-left:8px}.ugb-icon-popover__label-container:not(.ugb-icon--has-settings).ugb-icon--has-upload:not(.ugb-icon--has-reset) .ugb-icon-popover__input,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload).ugb-icon--has-reset .ugb-icon-popover__input{flex-basis:50%}.ugb-icon-popover__label-container:not(.ugb-icon--has-settings).ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__reset,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings).ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__upload,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__reset,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__upload{height:30px}.ugb-icon-popover__label-container.ugb-icon--has-settings.ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-settings.ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__upload,.ugb-icon-popover__label-container.ugb-icon--has-settings:not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-settings:not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__upload{flex-basis:100%}.ugb-icon-popover__drop-area{font-size:12px;font-style:italic;color:#888;text-align:center;margin:0 0 24px;display:block;outline:none}.file-drop-dragging-over-frame>.ugb-icon-popover__iconlist{pointer-events:none}.ugb-icon-popover__drop-indicator{pointer-events:none;position:absolute;top:0;left:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;background:hsla(0,0%,100%,.9);flex-direction:column;transition:background .3s ease-in-out}.ugb-icon-popover__drop-indicator svg{margin-bottom:8px;transform-origin:bottom;animation:ugb-icon-popover__drop-indicator 1.8s ease infinite}.file-drop-dragging-over-target>.ugb-icon-popover__drop-indicator{background:#fff;outline-offset:-10px;outline-style:dashed;outline-width:3px;outline-color:#11a0d2}@keyframes ugb-icon-popover__drop-indicator{10%{transform:translateY(0)}50%{transform:translateY(-8px)}60%{transform:translateY(0)}}.ugb-image-control .ugb-placeholder{height:150px;display:flex;justify-content:center;align-items:center;background:#f1f1f1;margin-bottom:12px;margin-top:.6rem}.ugb-image-control .ugb-placeholder svg{height:50px;fill:#ddd}.ugb-image-control .ugb-image-preview,.ugb-image-control .ugb-placeholder{border-radius:4px;cursor:pointer;transition:all .3s ease-in-out}.ugb-image-control .ugb-image-preview:hover,.ugb-image-control .ugb-placeholder:hover{background:#fafafa}.ugb-image-control .ugb-image-preview:focus,.ugb-image-control .ugb-placeholder:focus{background:#fafafa;box-shadow:0 0 0 2px rgba(30,140,190,.8)}.ugb-image-control .ugb-image-preview-wrapper{position:relative;z-index:1;display:flex;justify-content:center;align-items:center;background:#f1f1f1;margin-top:.6rem;border-radius:4px}.ugb-image-control .ugb-image-preview-wrapper svg{stroke:rgba(0,0,0,.3);stroke-width:1px;fill:#fff}.ugb-image-control .ugb-image-preview{min-width:100px;flex:1 1 100px;margin:0;position:relative;z-index:2;-o-object-fit:contain;object-fit:contain;width:auto;height:auto}.ugb-image-control .ugb-image-preview-remove{background:none!important;color:#ddd;border:none;position:absolute;top:10px;right:4px;cursor:pointer;z-index:3}.ugb-image-shape-control .ugb-design-control{padding:8px;margin:0 40px;border:1px solid #efefef}.ugb-image-upload-placeholder{position:relative;cursor:copy;margin-left:auto;margin-right:auto}.ugb-image-upload-placeholder img{display:block}.ugb-image-upload-has-placeholder{background:#f1f1f1;display:flex;justify-content:center;align-items:center;height:150px;width:100%}.ugb-image-upload-has-placeholder svg{max-height:50px;fill:#ddd;max-width:40%;width:100%}.ugb-image-upload-has-placeholder:hover{background:#fafafa}.ugb-image-upload-has-placeholder:focus{background:#fafafa;box-shadow:0 0 0 2px rgba(30,140,190,.8)}.ugb-image-upload-has-image:hover{opacity:.8}.ugb-image-upload-remove{background:none!important;color:#ddd;border:none;position:absolute;top:10px;right:4px;cursor:pointer;display:none;z-index:9!important}.ugb-image-upload-remove svg{stroke:rgba(0,0,0,.3);stroke-width:1px;fill:#fff;max-width:none}.block-editor-block-list__block.is-selected .ugb-image-upload-remove,.block-editor-block-list__block:hover .ugb-image-upload-remove{display:block}.ugb-modal-design-library{width:100%;max-width:90%;height:90%;min-height:500px;--wp-admin-theme-color:#f00069;--wp-admin-theme-color-darker-10:#bd0053;--wp-admin-theme-color-darker-20:#8a003c}.ugb-modal-design-library .components-modal__content{padding:0;display:flex;flex-direction:column}.ugb-modal-design-library .components-modal__header{margin:0}.ugb-modal-design-library .ugb-modal-design-library__wrapper{display:grid;grid-template-columns:300px auto;grid-template-rows:50px auto;flex:1}.ugb-modal-design-library .ugb-modal-design-library__sidebar{box-shadow:0 0 30px rgba(0,0,0,.1);background:#fff;grid-column:1/2;grid-row:1/3;display:flex;flex-direction:column;overflow:hidden}.ugb-modal-design-library .ugb-modal-design-library__sidebar .ugb-control-separator{margin:8px 0!important;width:100%!important}.ugb-modal-design-library .ugb-modal-design-library__topbar{display:flex;justify-content:flex-end;padding:0 24px;height:50px;align-items:center;grid-column:2/3;grid-row:1/2}.ugb-modal-design-library .ugb-modal-design-library__designs{padding:24px;grid-column:2/3;grid-row:2/3}.ugb-modal-design-library .ugb-modal-design-library__search{padding:24px 24px 0}.ugb-modal-design-library .ugb-modal-design-library__search .components-base-control__field{margin:0}.ugb-modal-design-library .ugb-modal-design-library__topbar .is-pressed{background:#555;color:#fff}.ugb-modal-design-library .ugb-advanced-toolbar-control .components-button.components-toolbar__control.has-text,.ugb-modal-design-library .ugb-advanced-toolbar-control .components-button.components-toolbar__control.has-text.is-pressed,.ugb-modal-design-library .ugb-advanced-toolbar-control .components-button.components-toolbar__control.has-text:hover,.ugb-modal-design-library .ugb-advanced-toolbar-control .ugb-toolbar--full-width{background:transparent}.ugb-modal-design-library .ugb-modal-design-library__filters{overflow-y:auto;padding:24px}.ugb-modal-design-library__filters .ugb-block-list{margin-top:0!important}.ugb-modal-design-library__filters .ugb-block-list .components-button-group{text-align:center}.ugb-block-list h4{margin-bottom:0;padding:0 10px 6px}.ugb-block-list li{margin:0}.ugb-block-list li>div{padding:6px 10px;cursor:pointer}.ugb-block-list li [aria-pressed=true]{font-weight:700;color:#f00069}.ugb-block-list li .is-disabled{opacity:.3}.ugb-block-list .ugb-block-list__count{float:right}.ugb-block-list [data-count="0"]{opacity:.3}.ugb-modal-design-library__color-list-wrapper{display:flex;flex-wrap:wrap;flex-direction:row;justify-content:center}.ugb-modal-design-library__color-list{margin-bottom:8px!important}.ugb-modal-design-library__color-list .components-circular-option-picker{width:24px;flex:0;margin:0 10px 10px;flex-basis:20px}.ugb-modal-design-library__color-list .components-circular-option-picker__option-wrapper{height:22px;width:22px;margin:0}.ugb-modal-design-library__color-list .components-circular-option-picker__option-wrapper .components-circular-option-picker__option{padding:0}.ugb-modal-design-library__color-list .components-circular-option-picker__option.is-pressed+svg{left:3px;top:3px;width:16px;height:16px}.ugb-modal-design-library__color-list .components-circular-option-picker__option:after{box-shadow:inset 0 0 0 1px rgba(0,0,0,.2)!important}.ugb-modal-design-library__color-list .components-circular-option-picker__option:focus:after{width:28px;height:28px;top:-3px;left:-3px}.ugb-modal-design-library__refresh{margin-right:10px}.ugb-modal-design-library__dev-mode .components-base-control__field{margin:2px 24px 0!important}.ugb-modal-welcome-video p{width:470px;margin:16px auto;text-align:center}.ugb-modal-welcome-video .components-modal__content{padding-bottom:20px}.ugb-modal-welcome-video .components-modal__header{margin-bottom:30px}.ugb-modal-welcome-video,.ugb-modal-welcome-video__overlay{animation-duration:.6s!important;transition-duration:.6s!important}.ugb-toggle-panel-form-toggle{margin-right:12px}.ugb-panel-advanced-button{text-transform:uppercase;font-size:9px;background:transparent;width:100%;display:block;border:0;outline:none;position:relative;cursor:pointer;padding-bottom:15px}.ugb-panel-advanced-button:after{content:"❯";position:absolute;transform:translateX(-50%) rotate(90deg);left:50%;bottom:0}.ugb-panel-advanced-button:hover{color:#999}.ugb-toggle-panel-body--advanced .ugb-panel-advanced-button{padding-bottom:0;padding-top:15px}.ugb-toggle-panel-body--advanced .ugb-panel-advanced-button:after{top:0;bottom:auto;transform:translate(-50%) rotate(-90deg)}.ugb-panel-tabs{position:-webkit-sticky;position:sticky;top:-1px;z-index:5}.ugb-panel-tabs .ugb-panel-tabs__wrapper{display:flex!important;flex-wrap:nowrap}.ugb-panel-tabs .ugb-panel-tabs__wrapper,.ugb-panel-tabs .ugb-panel-tabs__wrapper>button{transition:all .1s cubic-bezier(.2,.6,.4,1);background:#fff;box-shadow:none;border:0}.ugb-panel-tabs button{outline:none!important;display:flex;flex-direction:column;justify-content:center;align-items:center;height:80px;padding:0!important;flex:1;margin:0!important;cursor:pointer;color:#1e1e1e;border:0!important}.ugb-panel-tabs button .dashicon{margin:5px;height:20px}.ugb-panel-tabs button.is-active{border-bottom:0;box-shadow:inset 0 0 0 1px #1e1e1e}.ugb-panel-tabs button:hover{background:#f0f0f0}.ugb-panel-tabs button:focus{box-shadow:inset 0 0 0 1.5px #007cba;box-shadow:inset 0 0 0 1.5px var(--wp-admin-theme-color,#007cba)}.ugb-panel-tabs{border-bottom:1px solid #e2e4e7!important}.edit-post-sidebar.ugb--has-panel-tabs{background-color:#f0f3f5}.edit-post-sidebar.ugb--has-panel-tabs .edit-post-settings-sidebar__panel-block .components-panel__body:last-child{margin-bottom:0}[data-ugb-tab]>*{padding-bottom:0!important}.ugb-inspector-panel-controls .components-panel__body .components-panel__body-title:not(:hover){background:#fff}.ugb-inspector-panel-controls .components-panel__body .components-panel__body-title+.components-toggle-control{margin-top:24px!important}.ugb-inspector-panel-controls .components-panel__body.is-opened .components-panel__body-title{margin-bottom:12px;border-bottom:1px solid #e1e1e1;position:-webkit-sticky;position:sticky;top:81px;z-index:4}.ugb-inspector-panel-controls .components-panel__body{background:#fafafa}.ugb-inspector-panel-controls .components-panel__body:first-child{border-top:0!important}[data-ugb-tab=advanced] .ugb-inspector-panel-controls:not(.ugb-panel-advanced),[data-ugb-tab=layout] .block-editor-block-inspector__advanced,[data-ugb-tab=layout] .ugb-inspector-panel-controls:not(.ugb-panel-layout),[data-ugb-tab=style] .block-editor-block-inspector__advanced,[data-ugb-tab=style] .ugb-inspector-panel-controls:not(.ugb-panel-style){display:none}.ugb-design-control-pro-note{position:relative;text-align:center;background:#fff;padding:16px;border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,.12);margin:16px 0;color:#1e1e1e}.ugb-design-control-pro-note h4{margin:0 0 4px;font-size:1em}.ugb-design-control-pro-note p{font-size:.9em;margin-bottom:16px}.ugb-design-control-pro-note a.button{color:#fff;border:0;text-transform:uppercase;display:inline-block;height:auto;width:100%;margin:0 auto;transition:all .3s ease-in-out;box-shadow:none;font-size:10px;letter-spacing:1px;line-height:1.2em;border-radius:25px;padding:10px 18px;background:linear-gradient(330deg,#b300be,#f00069);background-color:#b300be;transition-timing-function:cubic-bezier(.81,.37,.61,1);transition-duration:.2s}.ugb-design-control-pro-note a.button:hover{background:linear-gradient(90deg,#f00069 0,#f00069);color:#fff;transform:scale(1.02)}.ugb-design-control-pro-note .ugb-design-control-pro-note__close{position:absolute;top:0;right:0;color:#777}.ugb-design-control-pro-note svg.ugb-design-control-pro-note__logo{height:24px;width:24px;margin:0 0 12px}.ugb-design-control-pro-note.ugb-pro-note__small{display:grid;padding:0;grid-template-columns:30px 1fr -webkit-min-content;grid-template-columns:30px 1fr min-content;grid-gap:5px;align-items:center;margin-bottom:0}.ugb-design-control-pro-note.ugb-pro-note__small svg{margin:0;height:25px;width:25px}.ugb-design-control-pro-note.ugb-pro-note__small p{text-align:left;margin:0;font-size:10px}.ugb-design-control-pro-note.ugb-pro-note--fade *{transition:all .3s ease-in-out}.ugb-design-control-pro-note.ugb-pro-note--fade p{opacity:.8}.ugb-design-control-pro-note.ugb-pro-note--fade a,.ugb-design-control-pro-note.ugb-pro-note--fade svg{opacity:.7}.ugb-design-control-pro-note.ugb-pro-note--fade:hover a,.ugb-design-control-pro-note.ugb-pro-note--fade:hover p,.ugb-design-control-pro-note.ugb-pro-note--fade:hover svg{opacity:1}.ugb-design-control-pro-note .ugb-design-control-pro-note__notice{font-size:10px;line-height:1.4;max-width:140px;margin:16px auto 0;font-style:italic;color:#aaa}.ugb-pro-control-more-dots{display:flex;background:transparent;margin:0 auto;width:50px;justify-content:center;border-radius:25px;height:25px;align-items:center;cursor:pointer;transition:all .3s ease-in-out;border:none;outline:none}.ugb-pro-control-more-dots .ugb-pro-control-more-dots__dot{width:6px;height:6px;background:#aaa;border-radius:100%;margin:0 2px;transition:all .3s ease-in-out}.ugb-pro-control-more-dots:focus,.ugb-pro-control-more-dots:hover{background:#eee}.ugb-pro-control-more-dots:focus .ugb-pro-control-more-dots__dot,.ugb-pro-control-more-dots:hover .ugb-pro-control-more-dots__dot{background:#555}.ugb-pro-control-button__wrapper{max-height:800px;transition:all .3s ease-in-out;overflow:hidden;margin:0 -16px}.ugb-pro-control-button__wrapper.ugb-pro-control-button--hidden{max-height:0}.ugb-pro-control-button__wrapper .ugb-design-control-pro-note{margin-left:16px;margin-right:16px}.ugb-pro-modal{overflow:hidden!important;border:0!important;background:#000}.ugb-pro-modal .components-modal__header{position:absolute;top:0;right:10px;z-index:3;border:0;background:transparent}.ugb-pro-modal .components-modal__header .components-button svg{fill:#fff}.ugb-pro-modal .components-modal__header .components-button:hover{background-color:rgba(0,0,0,.4)!important}.ugb-pro-modal .components-modal__content{padding:0}.ugb-pro-modal .components-modal__content img{max-width:1000px;height:auto;width:auto!important}.ugb-pro-modal .ugb-pro-modal__footer{padding:30px;text-align:center;display:flex;justify-content:center;align-items:center}.ugb-pro-modal .ugb-pro-modal__footer *{margin:0 5px}.ugb-pro-modal .ugb-pro-modal__footer .button{color:#fff;background:linear-gradient(90deg,#ab5af1 -50%,#fb6874);border:0;height:auto;font-size:14px;font-weight:500;display:flex;align-items:center;margin:0 15px;border-radius:40px;padding:5px 25px}.ugb-pro-modal .ugb-pro-modal__footer .button svg{fill:#fff;margin:0 10px 0 0}.ugb-pro-modal .ugb-pro-modal__footer .button:hover{background:linear-gradient(90deg,#ab5af1 -50%,#fb6874 50%)}.ugb-pro-modal .ugb-pro-modal__footer a:not(.button){color:#fb6874;text-decoration:none}.ugb-pro-modal .ugb-pro-modal__footer a:not(.button):hover{color:#ab5af1}.ugb-pro-modal .ugb-pro-modal__footer .button-ghost{box-shadow:inset 0 0 0 2px #fb6874;background:none;color:#fb6874;font-weight:400;text-transform:none}.ugb-pro-modal .ugb-pro-modal__footer .button-ghost:hover{box-shadow:inset 0 0 0 2px #ab5af1;background:none;font-weight:400;color:#ab5af1}.ugb-base-control-multi-label__responsive{display:flex;margin-left:6px;align-items:center}.ugb-base-control-multi-label__responsive button{height:14px;width:14px;padding:5px!important;min-width:11px!important;box-sizing:content-box;border-radius:0!important;margin:0;border:1px solid transparent}.ugb-base-control-multi-label__responsive button svg{height:100%;width:100%}.ugb-base-control-multi-label__responsive button.is-active,.ugb-base-control-multi-label__responsive button:hover{border:1px solid #1e1e1e!important;box-shadow:none!important}.ugb-base-control-multi-label__responsive button.is-active:not([data-screen=desktop]){background:#007cba;background:var(--wp-admin-theme-color,#007cba);color:#fff;border-color:#007cba!important;border-color:var(--wp-admin-theme-color,#007cba)!important}.ugb-base-control-multi-label__responsive button[data-screen=desktop]:not(:hover){border-color:transparent!important}.ugb-base-control-multi-label__responsive button.is-active:not(:first-child){background:#ab5af1!important}.ugb-small-number-control .components-base-control__field{display:flex;justify-content:space-between;align-items:center}.ugb-small-number-control input{width:80px}.ugb-social-url-text-control+.ugb-social-url-text-control{margin-top:-18px!important}.ugb-sort-control .ugb-sort-control__container{display:flex;flex-direction:row}.ugb-sort-control.ugb-sort-control--axis-y .ugb-sort-control__container{flex-direction:column;max-width:150px;margin:0 auto}.ugb-sort-control .ugb-sort-control__item{box-shadow:none}.ugb-sort-control__item{border-radius:4px;background:#fafafa;width:100%;text-align:center;padding:4px;border:1px solid #ddd;margin:2px;display:block;cursor:grab!important;box-shadow:0 5px 15px rgba(0,0,0,.05)}.ugb-sort-control__item:hover{background:#fff;box-shadow:inset 0 0 0 1px #ddd}.ugb-svg-icon-placeholder{line-height:1}.ugb-svg-icon-placeholder button{font-size:inherit;padding:0;color:inherit;outline:none!important;background:transparent!important;border:none!important;box-shadow:none!important;cursor:copy;display:inline-block;width:auto}.ugb-svg-icon-placeholder button svg{display:block}.ugb-svg-icon-placeholder__button{font-size:inherit!important;padding:inherit!important;display:flex!important;height:auto;overflow:visible}.ugb-svg-icon-placeholder__button:hover{color:inherit!important}.edit-post-sidebar .ugb-url-input-control__input input{width:100%;border-radius:4px!important;border:1px solid #8d96a0!important;flex:1!important}.ugb-url-input-popover{z-index:99989}.ugb-url-input-popover.is-from-top{margin-top:20px!important}.ugb-url-input-popover.is-from-bottom{margin-top:-20px!important}.ugb-url-input-popover .ugb-url-input-control__input input[type=text]{border-radius:4px;border:1px solid #8d96a0;flex:1}.ugb-url-input-popover .ugb-url-input-control__more-button{margin-left:5px}.ugb-url-input-popover .ugb-url-input-popover__input-wrapper{display:flex;align-items:center}.ugb-url-input-popover .ugb-url-input-control__icon{margin-right:10px}.ugb-url-input-popover.ugb--show-advanced .ugb-url-input-popover__input-wrapper{margin-bottom:16px}.ugb-url-input-popover .ugb-url-input-control__input.ugb-url-input-control__input--plain{flex:1;width:300px}.ugb-url-input-popover .ugb-url-input-control__input.ugb-url-input-control__input--plain .components-base-control__field{margin-bottom:0!important}.ugb-url-input-popover .ugb-url-input-control__more-button[aria-expanded=false].ugb--active:not(:hover){box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff}.stackable-components-toolbar{border-right:none!important}.stackable-components-toolbar .components-icon-button{justify-content:center}.stackable-components-toolbar .components-icon-button svg{margin:0!important}.components-stackable-highlight__popover .components-popover__content{overflow:hidden;padding:16px;width:280px}.ugb-component-inline-color-popover{padding:16px}.ugb-highlight-format__color-picker{margin-bottom:16px}.components-stackable-highlight-color__indicator{position:absolute;background:#000;height:3px;width:20px;left:auto;right:auto;top:50%;margin:9px 0 0}.ugb-advanced-toolbar-control .components-base-control__field{margin-bottom:24px}.ugb-bottom-separator .ugb-separator-wrapper,.ugb-top-separator .ugb-separator-wrapper{pointer-events:all}.ugb-design-layout-selector__design-items,.ugb-design-layout-selector__layout-items{display:flex;width:100%;justify-content:flex-start;align-items:center;flex-wrap:wrap;flex-direction:row;row-gap:6px}.ugb-design-layout-selector__spinner{position:absolute;z-index:1;top:0;bottom:0;left:0;right:0;margin:auto;display:flex;align-items:center;justify-content:center}.ugb-design-layout-selector__content{overflow-y:auto;max-height:450px}.ugb-design-layout-selector__content .components-placeholder__instructions:not(:first-child){margin-top:26px}.ugb-design-layout-selector{transition:all .3s ease-in-out;position:relative;max-width:750px;margin:auto!important}.ugb-design-layout-selector.is-busy .ugb-design-layout-selector__content{opacity:.15}.ugb-design-layout-selector__close-button{width:100%;padding-top:8px;align-items:center;justify-content:space-between;display:flex;flex-direction:row}.ugb-design-layout-selector__notice{margin:0!important;font-size:10px!important;font-style:italic;color:#aaa}.ugb-design-layout-selector__image{transition:all .2s ease-in;display:block;width:100%;min-height:70px;-o-object-fit:contain;object-fit:contain;pointer-events:none}.ugb-design-layout-selector .ugb-design-layout-selector__lock{position:absolute;right:8px;top:8px;border-radius:20px;padding:3px;background-image:linear-gradient(180deg,#a911b9,#e74673);fill:#fff;z-index:1;opacity:1;transform:none;transition:all .15s ease-in}.ugb-design-layout-selector .ugb-design-layout-selector__item-premium-button{position:absolute;display:flex;flex-direction:column;z-index:3;color:#fff;border:0;text-transform:uppercase;display:inline-block;height:auto;min-height:auto;width:auto;margin:0 auto;transition:all .3s ease-in-out;box-shadow:none;font-size:10px;letter-spacing:1px;line-height:1em;border-radius:25px;padding:10px 15px;background:linear-gradient(330deg,#b300be,#f00069);background-color:#b300be;transition-timing-function:cubic-bezier(.81,.37,.61,1);transition-duration:.2s;opacity:0;transform:translateY(-50%) translateX(-50%);top:50%;left:50%}.ugb-design-layout-selector .ugb-design-layout-selector__item-premium-button:hover{background:linear-gradient(90deg,#f00069 0,#f00069);color:#fff;transform:translateY(-50%) translateX(-50%) scale(1.02)}.ugb-design-layout-selector .ugb-design-layout-selector__item{position:relative;display:block;break-inside:avoid;padding:0 8px;background:transparent;border:0;order:1}.ugb-design-layout-selector .ugb-design-layout-selector__item.is-premium{order:2}.ugb-design-layout-selector .ugb-design-layout-selector__item.is-premium .ugb-design-layout-selector__wrapper:after{cursor:default}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover .ugb-design-layout-selector__wrapper:after{opacity:.05}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover .ugb-design-layout-selector__wrapper .ugb-design-layout-selector__lock{opacity:0;transform:scale(.5)}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover .ugb-design-layout-selector__wrapper .ugb-design-layout-selector__item-premium-button{opacity:1}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover.is-premium .ugb-design-layout-selector__wrapper:after{opacity:.25}.ugb-design-layout-selector__wrapper{padding:0;cursor:pointer;transition:all .2s ease-in;width:100%;height:-webkit-max-content;height:max-content;display:flex;text-align:left;position:relative;border-radius:8px;overflow:hidden;margin-top:3px}.ugb-design-layout-selector__wrapper>:not(.ugb-design-layout-selector__image){z-index:3}.ugb-design-layout-selector__wrapper:after{content:"";top:0;left:0;right:0;bottom:0;background:#000;z-index:2;display:block;position:absolute;opacity:0;transition:all .2s ease-in}.ugb-design-layout-selector__label{display:block;width:100%;font-size:12px!important;font-weight:400!important;margin-bottom:0;color:#000;text-align:center;margin-top:6px!important}.ugb-design-layout-selector__layout-item{flex-basis:130px}.ugb-design-layout-selector__design-item{flex-basis:170px}.ugb-design-layout-selector__design-item .ugb-design-layout-selector__wrapper{min-height:100px}.ugb-design-layout-selector__design-library{position:relative;margin-top:24px}.ugb-design-layout-selector__design-library.is-busy{opacity:.15}.ugb-panel-controls-separator{margin:0;background:#f0f3f5;text-transform:uppercase;font-size:8px;text-align:center;padding:14px 0;background:#fafafa;border-top:1px solid #f0f0f0;color:#00669b;color:var(--wp-admin-theme-color-darker-10,#00669b)}.ugb--hide-desktop.ugb--hide-desktop.ugb--hide-desktop,.ugb--hide-mobile.ugb--hide-mobile.ugb--hide-mobile,.ugb--hide-tablet.ugb--hide-tablet.ugb--hide-tablet{display:block!important}.ugb--hide-desktop.ugb--hide-desktop.ugb--hide-desktop.ugb-main-block,.ugb--hide-mobile.ugb--hide-mobile.ugb--hide-mobile.ugb-main-block,.ugb--hide-tablet.ugb--hide-tablet.ugb--hide-tablet.ugb-main-block{display:flex!important}.ugb-main-block,[class*=ugb-]+form[class*=-link],[class*=ugb-] form[class*=-link],form[class*=ugb-][class*=-link]{display:flex;justify-content:center;align-items:center}.ugb-main-block{margin-top:35px;margin-bottom:35px;padding:0}.ugb-main-block.alignfull{padding:0 35px}.ugb-block-content,.ugb-inner-block{margin:0;padding:0;width:100%;position:relative}.ugb--full-height{min-height:700px}.ugb--restrict-content-width .ugb-content-wrapper{max-width:var(--content-width);margin:0 auto}.ugb--shadow-0,.ugb-shadow-0{box-shadow:none!important}.ugb--shadow-1,.ugb-shadow-1{box-shadow:0 0 0 1px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-2,.ugb-shadow-2{box-shadow:0 0 0 2px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-3,.ugb-shadow-3{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2)!important}.ugb--shadow-4,.ugb-shadow-4{box-shadow:0 2px 20px hsla(0,0%,60%,.2)!important}.ugb--shadow-5,.ugb-shadow-5{box-shadow:0 5px 30px -10px rgba(18,63,82,.3)!important}.ugb--shadow-6,.ugb-shadow-6{box-shadow:0 10px 30px rgba(0,0,0,.05)!important}.ugb--shadow-7,.ugb-shadow-7{box-shadow:7px 5px 30px rgba(72,73,121,.15)!important}.ugb--shadow-8,.ugb-shadow-8{box-shadow:0 10px 60px rgba(0,0,0,.1)!important}.ugb--shadow-9,.ugb-shadow-9{box-shadow:0 70px 130px -60px rgba(72,73,121,.38)!important}div[class^=wp-block-ugb-]{z-index:1}@supports (-webkit-touch-callout:inherit){[class*=ugb-]{background-attachment:scroll!important}}.ugb-block-content:after,.ugb-block-content:before{content:none!important}[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background{margin-top:0;margin-bottom:0;padding-top:70px;padding-bottom:70px}[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background.ugb-main-block--inner-full>.ugb-inner-block{width:100%}.ugb-bottom-block-separator-panel .ugb-design-control,.ugb-top-block-separator-panel .ugb-design-control{max-height:270px}.ugb-top-block-separator-panel .ugb-design-panel-item__image{transform:scaleY(-1)}.ugb-bottom-separator svg,.ugb-top-separator svg{transition:none!important}.editor-styles-wrapper [data-type^="ugb/"] .ugb-main-block .ugb-block-title{margin:0 0 64px}.editor-styles-wrapper [data-type^="ugb/"] .ugb-main-block .ugb-block-title.ugb-block-title--with-subtitle{margin-bottom:16px}.editor-styles-wrapper [data-type^="ugb/"] .ugb-main-block .ugb-block-description{margin:0 0 64px}.ugb-debugger-panel{padding:16px}.ugb-debugger-panel p{margin:0}.ugb-premium-notice-inspector-popup{margin-left:16px;margin-right:16px}.ugb-global-settings-color-picker__text-name{padding-top:0!important}.ugb-global-settings-color-picker__text-name .components-color-picker__controls{justify-content:space-between}.ugb-global-settings-color-picker__text-name .components-color-picker__inputs-wrapper{padding-top:0!important}.ugb-global-settings-color-picker__text-name input{width:211px}.ugb-global-settings-color-picker{margin-bottom:12px}.ugb-global-settings-color-picker__add-icon{min-width:30px!important;width:30px;height:30px;border-radius:50%}.ugb-global-settings-color-picker__add-icon svg{width:20px}.ugb-global-settings-color-picker__title{margin:0 0 1em!important}.ugb-global-settings-color-picker__reset-button{width:-webkit-max-content;width:max-content;margin-right:0!important;margin:auto auto 12px}.ugb-global-settings__color-picker-disabled-color{pointer-events:none}.ugb-global-settings__color-picker-disabled-color .components-circular-option-picker__option{display:flex;justify-content:center}.ugb-global-settings__color-picker-disabled-color .components-circular-option-picker__option svg{width:12px}.ugb-global-settings-typography-control>.components-base-control__field{margin-bottom:16px}.ugb-global-settings-typography-control>.components-base-control__field>.components-base-control__label{min-height:25px;width:calc(100% - 88px);margin-bottom:0!important;pointer-events:none}.ugb-global-settings-typography-control.ugb-global-settings-typography-control--with-description>.components-base-control__field{margin-bottom:32px}.ugb-global-typography-preview{position:relative}.ugb-global-typography-preview .block-editor-block-list__block,.ugb-global-typography-preview .block-editor-block-list__layout,.ugb-global-typography-preview .editor-styles-wrapper{margin:0!important;padding:0!important;overflow:hidden!important;white-space:nowrap!important;background:transparent!important}.ugb-global-typography-preview .block-editor-block-list__block:after,.ugb-global-typography-preview .block-editor-block-list__block:before,.ugb-global-typography-preview .block-editor-block-list__layout:after,.ugb-global-typography-preview .block-editor-block-list__layout:before,.ugb-global-typography-preview .editor-styles-wrapper:after,.ugb-global-typography-preview .editor-styles-wrapper:before{display:none!important}.ugb-global-typography-preview__label{margin:0!important;padding:0!important;line-height:1.4!important}.ugb-global-typography-preview__description{margin:0!important;padding:0!important;font-size:12px!important;position:absolute;top:100%;width:270px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ugb-deprecated-tester .ugb-deprecated-tester__load-button{display:flex;align-items:center;transition:all .3s ease-in-out;margin-top:5px}.ugb-deprecated-tester .ugb-deprecated-tester__load-button svg{margin-right:8px}.ugb-deprecated-tester.ugb-deprecated-tester--loading .ugb-deprecated-tester__load-button{opacity:.7}.ugb-deprecated-tester.ugb-deprecated-tester--loading .ugb-deprecated-tester__load-button svg{animation:deprecated-test-rotate 1s linear infinite}.ugb-deprecated-tester--row{display:flex;align-items:center;justify-content:space-between;margin:8px 0}.ugb-deprecated-tester--row button{background:#fafafa;border-color:#ddd}.ugb-deprecated-tester--row.ugb--first{justify-content:flex-end}.ugb-deprecated-tester--row>:last-child{display:flex;justify-content:center;align-items:center}.ugb-deprecated-tester--row>:last-child button{display:inline-block;padding:4px;height:26px;width:26px;margin-left:8px}.ugb-deprecated-tester--row>:last-child svg{height:18px;width:18px}.ugb-deprecated-tester--row .ugb--green{color:#0da00d}.ugb-deprecated-tester--name{display:flex}.ugb-deprecated-tester--name button{padding:0;border:0!important;background:transparent!important;box-shadow:none!important}.ugb-deprecated-tester--name svg{display:inline-block;height:15px;width:15px;vertical-align:text-top;color:#ccc;margin-left:4px}.ugb-deprecated-tester--test-details{display:flex;justify-content:flex-start}.ugb-deprecated-tester--test-details .ugb--version{color:#777}.ugb-deprecated-tester--test-details .ugb--plan{background:#fb6874;color:#fff;padding:0 .5em;border-radius:3px;margin-left:.5em;font-size:.6em;text-transform:uppercase}.ugb-deprecated-tester--test-details .ugb--skipped-note{width:100%;font-style:italic}.ugb-deprecated-tester--test-details .components-icon-button{padding:2px;margin-left:4px}.ugb-deprecated-tester--test-details .components-icon-button svg{height:12px;width:12px}.ugb-deprecated-tester--test-details .components-clipboard-button{font-size:11px;margin-left:6px}.ugb-deprecated-tester--test-detail-wrapper{background:#fafafa;padding:6px;border:1px solid #ddd;border-radius:4px}.ugb-deprecated-tester--test-detail-wrapper>div>div{display:flex;flex-wrap:wrap}.ugb-deprecated-tester--test-detail-wrapper .ugb--failed,.ugb-deprecated-tester--test-detail-wrapper .ugb--passed,.ugb-deprecated-tester--test-detail-wrapper .ugb--skipped{padding:0 6px;border-radius:2px;display:inline-block;background:#a7e8a7;color:#0c7b0c;align-self:flex-end;margin:0 0 0 auto}.ugb-deprecated-tester--test-detail-wrapper .ugb--failed{background:#efd5d5;color:#a70d0d}.ugb-deprecated-tester--test-detail-wrapper .ugb--skipped{background:#eee;color:#666}@keyframes deprecated-test-rotate{0%{transform:rotate(0deg)}to{transform:rotate(-359deg)}}.ugb-html-validator .CodeMirror{height:300px}.ugb-html-validator .components-base-control__help{margin-top:0}.ugb-html-validator--invalid,.ugb-html-validator--valid{font-weight:700;text-transform:uppercase;color:#1fb51f}.ugb-html-validator--invalid{color:#e4174d}@media screen and (max-width:600px){.ugb-icon-list.ugb-icon-list--display-grid ul{grid-template-columns:1fr!important}.ugb-icon-list.ugb-icon-list ul{column-count:1!important}.ugb-main-block.alignfull{padding-right:17.5px;padding-left:17.5px}}@media screen and (min-width:1025px){.ugb--full-height{min-height:100vh}}@media screen and (max-width:768px){.ugb-columns.ugb-columns.ugb-columns.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr!important;grid-template-areas:inherit!important}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-columns:1fr!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:inherit!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit}#editor .ugb-columns.ugb-columns.ugb-columns.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-auto-flow:row;grid-template-columns:1fr!important;grid-template-areas:inherit!important}#editor .ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.ugb-column{grid-area:inherit!important}#editor .ugb-columns.ugb-columns--design-plain.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-auto-flow:row;grid-template-columns:1fr 1fr!important}#editor .ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-columns:1fr!important}#editor .ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:inherit!important}#editor .ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.block-editor-block-list__block{grid-area:inherit}}@media screen and (min-width:768px) and (max-width:1025px){#editor .ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout,.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr 1fr!important}}@media (min-width:600px){[data-type="ugb/column"].block-editor-block-contextual-toolbar{margin-bottom:0!important;margin-left:0!important}}@media screen and (min-width:960px){[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background.ugb-main-block--inner-center>.ugb-inner-block{max-width:var(--content-width)}}@media screen and (min-width:1280px){[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background.ugb-main-block--inner-wide>.ugb-inner-block{max-width:1200px}} \ No newline at end of file +@charset "UTF-8";svg.ugb-stackable-icon-gradient{fill:url(#stackable-gradient)!important}.block-editor-block-list__block[data-type^="ugb/"]{margin-top:0!important;margin-bottom:0!important}[data-type^="ugb/"][data-align=full]>*>.ugb-main-block{margin-top:35px;margin-bottom:35px;padding:0 35px}[data-type^="ugb/"]>.wp-block[data-align=full]{margin-left:-10px;margin-right:-10px}.ugb--has-panel-tabs .ugb-panel-tabs~.editorskit-panel{display:none}.components-toolbar__control.ugb--is-premium{position:relative}.components-toolbar__control.ugb--is-premium:after{position:absolute;z-index:1;background:none;line-height:18px;padding:0 6px;border-radius:2px;left:0;right:0;text-transform:uppercase;background-size:100%;background-repeat:no-repeat;font-family:dashicons;content:"\f160";color:#888;font-size:20px;opacity:0}.components-toolbar__control.ugb--is-premium *,.components-toolbar__control.ugb--is-premium:after{transition:all .2s ease-in-out}.components-toolbar__control.ugb--is-premium:disabled{opacity:1}.components-toolbar__control.ugb--is-premium:disabled *{opacity:.3}.components-toolbar__control.ugb--is-premium:hover *{opacity:0}.components-toolbar__control.ugb--is-premium:hover:after{opacity:1}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-base-control__label,body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-toggle-control__label{cursor:help;border-bottom:1px solid transparent}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-base-control__label:hover,body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-base-control .components-toggle-control__label:hover{border-color:#8c33da;color:#8c33da;border-bottom-style:solid!important}body.ugb--help-tips-enabled .components-base-control[class*=ugb--help-tip-]:hover .components-base-control__label,body.ugb--help-tips-enabled .components-base-control[class*=ugb--help-tip-]:hover .components-toggle-control__label{border-color:#a683c5;border-bottom-style:dashed}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle{cursor:pointer}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle:after{content:"\f223";margin-left:10px;font-family:dashicons;font-size:20px;line-height:16px;text-shadow:0 0 1px #000;color:#fafafa}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle:hover{color:#8c33da!important}body.ugb--help-tips-enabled [class*=ugb--help-tip-].components-panel__body .components-panel__body-toggle:hover:after{cursor:help;color:#b266f4;text-shadow:none}.ugb-help-tooltip-video{margin-left:-30px!important}.ugb-help-tooltip-video .components-popover__content{min-width:220px!important;width:220px!important}.ugb-help-tooltip-video .components-panel__body{padding:0 16px 16px}.ugb-help-tooltip-video video{width:100%;height:auto;position:relative;z-index:2;margin:0 -16px 8px;min-width:calc(100% + 32px);min-height:163.5px}.ugb-help-tooltip-video .ugb-help-tooltip-video__link{margin-top:5px;text-align:right;cursor:pointer}.ugb-help-tooltip-video .ugb-help-tooltip-video__link svg{vertical-align:bottom}.ugb-help-tooltip-video .components-spinner{position:absolute;left:calc(50% - 9px);text-align:center;top:82px;margin:0;z-index:1}.ugb-help-tooltip-video .ugb-help-tooltip-video__remove{background:none!important;border:none;position:absolute;top:10px;right:4px;cursor:pointer;z-index:9!important}.ugb-help-tooltip-video .ugb-help-tooltip-video__remove svg{max-width:none;stroke:rgba(0,0,0,.3);stroke-width:1px;fill:#fff}.ugb-help-tooltip-video .ugb-help-tooltip-video__remove:hover{color:#444}.ugb-help-tooltip-video h4{margin:0 0 8px;font-size:1em}.ugb-help-tooltip__checkbox{font-size:11px;margin:20px 0 -10px;color:#777;font-style:italic}.ugb-help-tooltip__checkbox .components-checkbox-control__input-container{margin-right:8px}[data-type="ugb/accordion"] .ugb-accordion__heading{outline:none}[data-type="ugb/accordion"] .ugb-accordion__heading svg{transform:rotate(180deg)!important}[data-type="ugb/accordion"] .ugb-accordion__heading>:first-child{flex:1}[data-type="ugb/accordion"] .ugb-accordion:not(.ugb-accordion--open) .ugb-accordion__content{display:none}[data-type="ugb/accordion"] .ugb-accordion:not(.ugb-accordion--open) .ugb-accordion__heading svg{transform:rotate(0deg)!important}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .ugb-accordion__content-inner{padding-top:0}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__content{overflow:visible}#editor .ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__content .ugb-accordion__content-inner{padding-bottom:0}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading{z-index:0}#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__item.ugb--has-background-overlay .ugb-video-background,#editor .ugb-accordion.ugb-accordion--v2 .ugb-accordion__item.ugb--has-background-overlay:before{z-index:-1!important}.ugb-accordion__heading>div:empty{display:none}.ugb-blockquote{margin-left:0;margin-right:0}.ugb-blockquote__inspector__icon{flex-wrap:wrap}.ugb-blog-post__inspector-spinner>*{margin:0 auto 16px;display:block;float:none}.ugb-blog-posts__item:after{pointer-events:none}[data-type][data-align=full] .ugb-cta.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background,[data-type][data-align=full] .ugb-cta.ugb-main-block:not(.ugb--has-block-background){padding:0}[data-type][data-align=full] .ugb-cta.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background .ugb-cta__item,[data-type][data-align=full] .ugb-cta.ugb-main-block:not(.ugb--has-block-background) .ugb-cta__item{border-radius:0}.ugb-column>.ugb-inner-block>.ugb-block-content>.ugb-column__item{overflow:visible!important}[data-type="ugb/column"]>.block-editor-block-list__block-edit{height:100%}[data-type="ugb/column"]>.block-editor-block-list__block-edit>[data-block]{display:flex;flex-direction:column}.wp-block[data-type="ugb/column"],.wp-block[data-type="ugb/column"] .wp-block{max-width:none}[data-type="ugb/column"],[data-type="ugb/column"]>.ugb-column{height:100%}[data-type="ugb/column"]{transition:none!important}.ugb-column__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-block]:first-child{margin-top:0!important}.ugb-column__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.block-list-appender:not(:first-child){margin-bottom:-28px!important}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:first-child{grid-area:one}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(2){grid-area:two}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(3){grid-area:three}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(4){grid-area:four}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(5){grid-area:five}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(6){grid-area:six}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(7){grid-area:seven}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(8){grid-area:eight}.ugb-columns:not(.ugb-columns--design-plain):not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-columns:auto;grid-auto-flow:row}.ugb-columns .ugb-columns__item{align-items:stretch}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>div{margin-left:0;margin-right:0}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two";grid-template-columns:1fr 1fr;grid-template-rows:auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three three";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four" "five five";grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six" "seven seven seven";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three four" "five six seven eight";grid-template-columns:1fr 1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:first-child{grid-area:one}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(2){grid-area:two}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(3){grid-area:three}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(4){grid-area:four}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(5){grid-area:five}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(6){grid-area:six}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(7){grid-area:seven}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>:nth-child(8){grid-area:eight}.ugb-columns:not(.ugb-columns--design-plain):not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-auto-columns:auto;grid-auto-flow:row}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{display:flex!important;justify-content:stretch;align-items:stretch;height:100%}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{height:100%}.ugb-columns__item>.block-editor-inner-blocks{width:100%}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>div{margin-left:0;margin-right:0}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two";grid-template-columns:1fr 1fr;grid-template-rows:auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two" "three three";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two" "three four";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two" "three four" "five five";grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two three" "four five six";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two three" "four five six" "seven seven seven";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:"one two three four" "five six seven eight";grid-template-columns:1fr 1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.block-editor-block-list__block{display:flex;flex-direction:column}[data-type="ugb/columns"].has-child-selected [data-type="ugb/column"]:not(.has-child-selected):before,[data-type="ugb/columns"].is-selected [data-type="ugb/column"]:not(.has-child-selected):before{border:1px dashed rgba(123,134,162,.3)}[data-type="ugb/column"]:before{top:0!important;bottom:0!important;left:0!important;right:0!important}[data-type="ugb/columns"]:not(.is-selected):before{border:1px dashed rgba(243,73,87,.6)!important}[data-type="ugb/column"]{transition:all .3s ease-in-out!important}[data-type="ugb/column"][style*="transform: tra"]{transition:none!important}.ugb-columns--highlight-1>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:first-child,.ugb-columns--highlight-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(2),.ugb-columns--highlight-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(3),.ugb-columns--highlight-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(4),.ugb-columns--highlight-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(5),.ugb-columns--highlight-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(6),.ugb-columns--highlight-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(7),.ugb-columns--highlight-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="ugb/column"]:nth-child(8){transform:translateY(-20px)!important}[data-align=full] .ugb-container:not(.ugb-container--design-plain):not(.ugb--has-block-background){padding-left:0!important;padding-right:0!important}[data-align=full] .ugb-container:not(.ugb-container--design-plain):not(.ugb--has-block-background)>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{border-radius:0!important}[data-type="ugb/container"][data-align=center]{text-align:inherit}.ugb-container .block-editor-block-list__block{max-width:none!important}[data-align=full] .ugb-countup{border-radius:0!important;margin-top:0;margin-bottom:0}.ugb-design-library-block .components-placeholder__label svg{margin-right:8px}.ugb-design-library-block button.components-button{height:auto;font-weight:600;text-transform:uppercase;font-size:13px;padding:11px 20px;background:#fff}.ugb-insert-library-button svg{width:20px;height:20px}.ugb-insert-library-button{margin-left:10px;margin-right:10px}.ugb-expand__label{font-size:12px;text-transform:uppercase;font-weight:600;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;color:#8e979e;padding:2em 0 0;border:none;box-shadow:none;white-space:nowrap;display:block}.ugb-expand__label:first-child{padding-top:0}.ugb-expand .ugb-expand__less-text p,.ugb-expand .ugb-expand__more-text p{font-size:inherit;color:inherit}.ugb-expand .ugb-block-content>a{display:inline-block}.ugb-feature.ugb-feature--design-basic .ugb-feature__image.ugb-image-upload-placeholder.ugb-image-upload-has-placeholder,.ugb-feature.ugb-feature--design-plain .ugb-feature__image.ugb-image-upload-placeholder.ugb-image-upload-has-placeholder{height:250px}.ugb-feature-grid .ugb-image-upload-placeholder.ugb-image-upload-has-placeholder{height:100px;width:100px;margin:0 auto;border-radius:100%}[data-type][data-align=full] .ugb-header.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background,[data-type][data-align=full] .ugb-header.ugb-main-block:not(.ugb--has-block-background){padding:0}[data-type][data-align=full] .ugb-header.ugb-main-block.ugb-main-block--inner-full.ugb--has-block-background .ugb-header__item,[data-type][data-align=full] .ugb-header.ugb-main-block:not(.ugb--has-block-background) .ugb-header__item{border-radius:0}.editor-styles-wrapper .ugb-heading .ugb-heading__subtitle,.editor-styles-wrapper .ugb-heading .ugb-heading__top-line{margin-bottom:16px}.editor-styles-wrapper .ugb-heading .ugb-heading__title{margin-bottom:8px}.ugb-icon-list ul{list-style:none!important}.ugb-icon-list ul li:before{cursor:pointer}.ugb-icon-list.ugb-icon-list li:last-child{margin-bottom:0!important}.ugb-icon-list__center-align li,.ugb-icon-list__right-align li{width:-webkit-fit-content!important;width:fit-content!important;width:-moz-fit-content!important;margin-left:auto!important}.ugb-icon-list__center-align li{margin-right:auto!important}.ugb-icon-list__left-align li{width:-webkit-fit-content!important;width:fit-content!important;width:-moz-fit-content!important;margin-right:auto!important}.ugb-image-box__image:hover{opacity:1!important}.ugb-image-box__arrow{pointer-events:all!important}[data-type="ugb/notification"] .ugb-notification.ugb-notification--dismissible{display:flex!important}[data-type="ugb/notification"] .ugb-notification__item>:last-child,[data-type="ugb/notification"] .ugb-notification__item>:last-child [role=textbox]{margin-bottom:0}[data-type="ugb/notification"] .ugb-svg-icon-placeholder__button{display:block;width:100%}.ugb-number-box .ugb-number-box__number[data-is-placeholder-visible=true]{transition:none;height:2.5em;width:2.5em;left:calc(50% - 1.25em)}.ugb-number-box .ugb-number-box__item>:not(.ugb-number-box__content){z-index:3!important}.ugb-number-box .ugb-number-box__item>.ugb-number-box__content{z-index:4!important}.ugb-pricing-box__price-line>:first-child{align-self:flex-start}.ugb-pricing-box__price-line>:last-child{align-self:flex-end}[data-type="ugb/separator"]{z-index:30!important}[data-type="ugb/separator"]~.wp-block.is-selected{z-index:31}[data-type="ugb/separator"][data-align=full] .ugb-separator .ugb-separator__svg-inner{overflow:hidden}[data-type="ugb/separator"][data-align=full] .ugb-separator .ugb-separator__svg-wrapper{overflow:visible}.ugb-team-member-setting__social,.ugb-team-member-setting__social .components-base-control__field{margin-bottom:8px!important}.ugb-team-member__image .ugb-image-upload-has-placeholder{border-radius:100%;height:0;padding-bottom:100%}.ugb-team-member__image .ugb-image-upload-has-placeholder svg{top:50%;position:absolute;transform:translateY(-50%)}.ugb-testimonial__image .ugb-image-upload-has-placeholder{border-radius:100%;height:0;padding-bottom:100%}.ugb-testimonial__image .ugb-image-upload-has-placeholder svg{top:50%;position:absolute;transform:translateY(-50%)}#editor [data-type="ugb/video-popup"][data-align=full] .ugb-video-popup.ugb-main-block--inner-full.ugb--has-block-background .ugb-video-popup__wrapper,#editor [data-type="ugb/video-popup"][data-align=full] .ugb-video-popup:not(.ugb--has-block-background) .ugb-video-popup__wrapper{border-radius:0;margin-left:-35px;margin-right:-35px;width:calc(100% + 70px)}.ugb-admin-setting{margin-bottom:16px}.ugb-admin-setting__label-wrapper{display:flex;align-items:center}.ugb-admin-setting__label{width:200px;display:inline-block;font-weight:700;color:#666;padding-right:15px;box-sizing:border-box}.ugb-admin-setting--small .ugb-admin-setting__label{width:130px}.ugb-admin-setting__field{flex:1}body .ugb-admin-setting .ugb-admin-setting__label-wrapper+.ugb-admin-setting__help{margin-left:200px;margin-bottom:24px!important;margin-top:8px!important}input.ugb-admin-text-setting{padding:.5em 1em;box-shadow:0 5px 30px -10px rgba(18,63,82,.1);border:1px solid rgba(0,0,0,.1);margin:0}input.ugb-admin-text-setting[type=text]{width:calc(100% - 300px)}.ugb-admin-toggle-setting__button{outline:0;display:block;height:26px;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:1.5em auto 1em!important;padding:0!important;border:0!important;border-radius:26px;transition:all .4s ease;display:inline-block;background:#e4f5e4;outline:none;outline-offset:3px}.ugb-admin-toggle-setting__button:focus{outline:1px dashed #888}.ugb-admin-toggle-setting__button:after,.ugb-admin-toggle-setting__button:before{position:relative;display:block;content:"";width:26px;height:100%}.ugb-admin-toggle-setting__button:after{left:calc(100% - 26px);background:#3ca540;border-radius:50%;transition:all .2s ease;position:absolute;top:0;box-shadow:0 3px 10px -5px #000}.ugb-admin-toggle-setting__button:before{display:none}.ugb-admin-toggle-setting__button span{position:relative;display:flex;justify-content:center;align-items:center;z-index:2;color:rgba(0,0,0,.4);font-size:11px;line-height:26px;transition:padding .2s ease;padding:0 35px 0 15px}.ugb-admin-toggle-setting__button span:first-child{color:#7b7b7b}.ugb-admin-toggle-setting__button span:nth-child(2){color:#209e25}.ugb-admin-toggle-setting__button span:first-child{display:none}.ugb-admin-toggle-setting__button span:nth-child(2){display:block}.ugb-admin-toggle-setting__button[aria-checked=false]{background:#f0f0f0}.ugb-admin-toggle-setting__button[aria-checked=false]:after{left:0;background:#7b7b7b}.ugb-admin-toggle-setting__button[aria-checked=false] span{padding:0 15px 0 35px}.ugb-admin-toggle-setting__button[aria-checked=false] span:first-child{display:block}.ugb-admin-toggle-setting__button[aria-checked=false] span:nth-child(2){display:none}.ugb-advanced-autosuggest-control{margin-bottom:16px}.ugb-advanced-autosuggest-control__select>*{position:relative}.ugb-advanced-autosuggest-control__select input{width:100%}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-container{position:absolute;top:100%;max-height:272px;overflow-y:auto;z-index:2;background:#fff;width:100%;margin-top:5px;border-radius:6px}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-container:not(:empty){box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2),0 5px 30px -10px rgba(18,63,82,.3)}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-list,.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestions-list li{margin:0}.ugb-advanced-autosuggest-control__select .react-autosuggest__section-container:not(.react-autosuggest__section-container--first){border-top:1px solid #ddd}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestion{background:#fff;padding:8px 16px;cursor:pointer}.ugb-advanced-autosuggest-control__select .react-autosuggest__suggestion--highlighted{background:#f1f1f1}.ugb--autosuggest-empty{font-style:italic;font-size:.9em;color:#999}.ugb--autosuggest-group{background:#fff;padding:14px 16px 8px;font-weight:700;color:#aaa}.ugb-advanced-range-control{width:100%}.ugb-range-control.ugb-range-control--blank .components-range-control__track{width:var(--ugb-advanced-range-control--width)!important}.ugb-range-control.ugb-range-control--blank [class*=ThumbWrapper]{left:var(--ugb-advanced-range-control--width)!important}.ugb-range-control{display:flex;align-items:center}.ugb-range-control .components-range-control{flex:1;margin:0!important}.ugb-range-control .components-input-control__container{position:relative;border-radius:2px;padding-top:0;box-sizing:border-box;display:inline-block;font-size:13px;margin-top:0;width:64px;margin-left:16px}.ugb-range-control .components-range-control__reset{height:30px;min-height:30px;margin-left:8px}.ugb-range-control .components-base-control,.ugb-range-control .components-base-control__field{margin-bottom:0}.ugb-range-control .components-number-control{width:unset}.ugb-advanced-toolbar-control .components-button-group{width:100%}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--full-width{display:flex;flex-wrap:nowrap}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--full-width>button,.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--full-width>button>svg{width:100%!important}.ugb-advanced-toolbar-control .components-button-group svg{height:20px!important;width:auto}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline{flex-wrap:wrap}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline>button{margin-top:-1px!important;margin-left:-1px!important}.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline>button,.ugb-advanced-toolbar-control .components-button-group.ugb-toolbar--multiline>button>svg{width:auto!important}.ugb-advanced-toolbar-control__text-button{align-self:center;width:100%}body.branch-5-4 .ugb-advanced-toolbar-control .components-button-group{border:1px solid #e2e4e7}.ugb-base-control-multi-label{display:grid;grid-template-columns:auto 1fr auto;margin-bottom:5px;align-items:center}.ugb-base-control-multi-label .ugb-base-control-multi-label__label{margin-bottom:0}.ugb-base-control-multi-label__units{top:0;right:0;display:flex}.ugb-base-control-multi-label__units button{border:0;font-size:10px;margin:0;font-weight:400;outline:none;color:#aaa;padding:0 4px;background:transparent;cursor:pointer;text-transform:uppercase}.ugb-base-control-multi-label__units button:hover{color:#333}.ugb-base-control-multi-label__units button.is-active{color:#333;text-decoration:underline}.ugb-base-control-multi-label__units .components-button{text-transform:none}.ugb-modal-get-block-attributes-button textarea{width:50vw;height:60vh;font-family:monospace}.ugb-border-controls__border-type-toolbar button[value=dashed],.ugb-border-controls__border-type-toolbar button[value=dotted],.ugb-border-controls__border-type-toolbar button[value=solid]{position:relative}.ugb-border-controls__border-type-toolbar button[value=dashed]:before,.ugb-border-controls__border-type-toolbar button[value=dotted]:before,.ugb-border-controls__border-type-toolbar button[value=solid]:before{position:absolute;content:"";top:calc(50% - 1px);left:16px;right:16px;border-top:2px solid}.ugb-border-controls__border-type-toolbar button[value=dashed] span,.ugb-border-controls__border-type-toolbar button[value=dotted] span,.ugb-border-controls__border-type-toolbar button[value=solid] span{visibility:hidden}.ugb-border-controls__border-type-toolbar button[value=dashed]:before{border-top-style:dashed}.ugb-border-controls__border-type-toolbar button[value=dotted]:before{top:calc(50% - 2px);border-top:4px dotted}.ugb-border-controls__border-preview{margin-right:12px;width:22px;border-right:0!important;border-bottom:0!important;border-left:0!important}.ugb-button-component.components-button.has-icon .dashicon{margin-left:2px;margin-right:2px}.ugb-button.ugb-button--icon-only .ugb-svg-icon-placeholder__button{display:block}.ugb-button.ugb-button--has-icon .ugb-svg-icon-placeholder__button{height:auto}.ugb-button svg{transition:initial!important}.ugb-button.ugb-button--has-icon .ugb-icon-inner-svg svg.ugb-custom-icon{fill:initial}.ugb-button-icon-control__reset-popover>.components-popover__content{padding:16px;width:250px}.ugb-button-icon-control .components-popover__content{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2),0 5px 30px -10px rgba(18,63,82,.3)}.ugb-button-icon-control .components-base-control__field{display:flex;justify-content:space-between;align-items:center}.ugb-button-icon-control button{display:flex}.components-popover.ugb-button-icon-control__popover{z-index:100000}.components-popover.ugb-button-icon-control__popover .components-popover__content{width:290px}.ugb-button-icon-control__popover .components-panel__body-title{padding:15px!important;background:transparent!important}.ugb-button-icon-control__wrapper{display:flex;align-items:center}.ugb-button-icon-control__wrapper .ugb-button-icon-control__reset{padding:6px;margin:0 6px}.ugb-button-icon-control__wrapper .ugb-button-icon-control__reset svg{width:14px;height:14px}.ugb-button-icon-control__wrapper .ugb-button-icon-control__edit{padding:0 6px}.ugb-button-icon-control__wrapper .ugb-button-icon-control__edit svg{width:18px;height:18px;margin:0}.ugb-button-icon-control .components-toggle-control,.ugb-button-icon-control .components-toggle-control .components-base-control__field,.ugb-button-icon-control .components-toggle-control .components-toggle-control__label{margin-bottom:0!important}.ugb-button-icon-control__text-title{margin:0 0 1em!important}.ugb-button-icon-popover-control-color-preview,.ugb-button-icon-popover-control-image-preview{margin:0 12px 0 0;height:20px;width:20px}.ugb-button-icon-popover-control-color-preview .components-circular-option-picker__option,.ugb-button-icon-popover-control-image-preview .components-circular-option-picker__option{color:transparent!important}.ugb-button-icon-popover-control-color-preview .components-circular-option-picker__option{padding:0}.ugb-button-icon-popover-control-color-preview .components-circular-option-picker__option:focus:after{width:24px;height:24px}.ugb-button-icon-popover-control-color-preview.ugb-button-icon-popover-control-color-preview--transparent:before{background-size:63px!important;opacity:.5}.ugb-button-icon-popover-control-image-preview:before{background:transparent!important}.ugb-button-icon-popover-control-image-preview .components-circular-option-picker__option{padding:0;background-size:cover}.ugb-button-icon-popover-control-image-preview .components-circular-option-picker__option:after{display:none}.ugb-button-icon-popover-control-image-preview svg{height:100%;width:100%;fill:#d1d1d1}.ugb-code-textarea+.CodeMirror{height:500px;margin-left:-16px;margin-right:-16px;border-top:1px solid #ddd;border-bottom:1px solid #ddd;margin-bottom:16px}.ugb-columns-width-control__range{display:flex;align-items:center;margin-bottom:8px}.ugb-columns-width-control__range .ugb-columns-width-control__icon{height:20px;width:20px;flex-shrink:0;font-size:14px;margin-right:10px;font-weight:700;display:block;text-align:center}.ugb-columns-width-control__range .components-base-control.components-range-control,.ugb-columns-width-control__range .components-base-control__field{margin-bottom:0!important}.ugb-columns-width-control__range .components-range-control{flex:1}.ugb-columns-width-control .ugb-design-control-wrapper.components-base-control{margin-bottom:0}.ugb-columns-width-control .ugb-design-control{padding:0}.ugb-columns-width-control .ugb-design-control .components-radio-control__option{width:25%}.ugb-columns-width-control .ugb-design-control .components-base-control__field{margin-bottom:0!important;display:flex;justify-content:space-evenly}.ugb-columns-width-control .ugb-design-panel-item__image{display:block}.ugb-columns-width-control .ugb-columns-width-control__suffix{flex-shrink:0;font-size:14px;margin-left:5px;display:block;text-align:center}.ugb-columns-width-control .ugb-columns-width-control__reset{text-transform:none}.ugb-column-widths-control__columns-slider{height:20px;margin-top:20px}.ugb-column-widths-control__columns-slider [role=slider]{position:absolute;transform:translate(-50%,-50%);width:10px;height:10px;padding:0;border-radius:50%;background-color:#555d66;border:0;outline:0}.ugb-column-widths-control__columns-slider [role=slider]:focus{border:1px solid #555d66;background:#fff}.ugb-column-widths-control__columns-input{display:grid}.ugb-column-widths-control__columns-input input{min-width:40px!important;width:40px;padding:4px 2px!important;font-size:11px;margin:0 auto}.ugb-column-widths-control__columns-input input:not(:hover):not(:focus){border-color:#eee}.ugb-control-separator{height:1px!important;background:#ddd!important;margin:24px -16px!important;border:0!important;padding:0!important;width:calc(100% + 32px)!important;box-shadow:none!important}.components-panel__body-title+.ugb-control-separator{margin-top:0!important}.ugb-design-library-control__open-library{margin:0 0 8px auto!important;display:block}.ugb-design-library-control__open-library__toolbar{font-size:11px;display:flex;justify-content:space-between;padding:0}.ugb-design-control{max-height:450px}.ugb-design-control input{opacity:0;height:0;width:0;margin:0;padding:0;position:fixed;top:0}.ugb-design-control .components-radio-control__option{display:inline-block;width:50%;text-align:center}.ugb-design-control label>span{padding:4px;display:block;border-radius:0}.ugb-design-control label>span>img{border-radius:4px}.ugb-design-control input:checked+label>span{box-shadow:inset 0 0 0 1px #1e1e1e}.ugb-design-control input+label>span:hover{background:#f0f0f0}.ugb-design-control .design-label svg{height:12px;margin:0 0 0 5px;fill:#ffad00}.ugb-design-control--columns-3 .ugb-design-control .components-radio-control__option{width:33.3%}.ugb-design-control--columns-4 .ugb-design-control .components-radio-control__option{width:25%}.ugb-design-library-items{page-break-inside:avoid;break-inside:avoid;column-count:1;column-gap:38px}.ugb-design-library-items.ugb-design-library-items--columns-2{column-count:2}.ugb-design-library-items.ugb-design-library-items--columns-3{column-count:3}.ugb-design-library-items.ugb-design-library-items--columns-4{column-count:4}.ugb-design-library-items .components-base-control__help{text-align:center;font-style:italic}.ugb-design-library-items .ugb-design-library-search__spinner{display:flex}.ugb-design-library-items .ugb-design-library-search__spinner .components-spinner{margin:0 auto}.ugb-modal-design-library__wrapper{overflow:hidden}.ugb-modal-design-library__designs{overflow:auto}.ugb-design-library-item{border-radius:0;box-shadow:0 2px 15px hsla(0,0%,60%,.3);overflow:hidden;transition:all .3s ease-in-out;position:relative;margin-bottom:38px;display:block;transform:translateZ(0);break-inside:avoid;width:100%;will-change:transform}.ugb-design-library-item:hover{transform:translateY(-4px) scale(1.03);box-shadow:0 6px 25px hsla(0,0%,60%,.3)}.ugb-design-library-item img{display:block;pointer-events:none;width:100%;height:auto;min-height:50px;background:#f1f1f1}.ugb-design-library-item footer{padding:8px 12px;font-size:11px;line-height:18px;display:flex;justify-content:space-between}.ugb-design-library-item.ugb--is-busy .ugb-design-library-item__spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) translateY(-10px)}.ugb-design-library-item.ugb--is-busy .components-spinner{margin:0}.ugb-design-library-item.ugb--is-busy img{opacity:.15}.ugb-design-library-item .ugb-design-library-item__image .dashicon{position:absolute;top:calc(50% - 17.5px);left:50%;transform:translate(-50%,-50%);opacity:0;fill:#000;height:24px;width:24px}.ugb-design-library-item .ugb-design-library-item__image .dashicon:before{font-size:24px}.ugb-design-library-item .ugb-design-library-item__image .dashicon,.ugb-design-library-item .ugb-design-library-item__image img{transition:all .3s ease-in-out}.ugb-design-library-item[class*=ugb--is-premium]:hover .ugb-design-library-item__image img{opacity:.4}.ugb-design-library-item[class*=ugb--is-premium]:hover .ugb-design-library-item__image .dashicon{opacity:1}.ugb-design-library-item__image{padding:0!important;border:0!important;text-align:start!important;width:100%!important;margin:0!important;outline:none!important;cursor:pointer;display:block}.ugb-design-library-item__premium{position:absolute;z-index:1;background:#f00069;font-size:10px;color:#fff;line-height:18px;padding:0 6px;border-radius:2px;top:5px;right:5px;text-transform:uppercase;letter-spacing:1px;transition:none!important}.ugb-design-library-item__premium-link{cursor:pointer}.ugb-design-library-item__favorite{border:0;padding:0;cursor:pointer;outline:none;transition:all .3 ease-in-out}.ugb-design-library-item__favorite .dashicon{fill:#bbb;height:14px;width:14px}.ugb-design-library-item__favorite.ugb--is-favorite .dashicon,.ugb-design-library-item__favorite.ugb--is-favorite:hover .dashicon,.ugb-design-library-item__favorite:hover .dashicon{fill:#d30c5c}.ugb-design-control{max-height:40vh;overflow-y:auto}.ugb-design-control .components-base-control__label{margin-left:-16px;margin-right:-16px;margin-bottom:8px}.ugb-design-panel-item{position:relative}.ugb-design-panel-item .ugb-design-panel-item__image{mix-blend-mode:darken}.ugb-design-panel-item__hover-image{position:absolute;top:5px;left:5px;right:5px;width:calc(100% - 10px);opacity:0;transition:opacity .4s ease-in-out}.ugb-design-panel-item:hover .ugb-design-panel-item__hover-image{opacity:1}#editor .ugb--has-background-overlay.ugb--has-background-overlay .ugb-video-background,#editor .ugb--has-background-overlay.ugb--has-background-overlay:before{pointer-events:none}.ugb-icon-control svg .fa-secondary,.ugb-icon-popover svg .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.ugb-icon-is-loading{animation:icon-loading 1.3s linear infinite;height:12px!important;width:12px!important}@keyframes icon-loading{0%{opacity:.8;transform:rotate(0deg)}25%,75%{opacity:.4}50%{opacity:.8}to{opacity:.8;transform:rotate(1turn)}}.ugb-icon--faded{opacity:.4}.ugb-four-number-control__wrapper{display:grid;grid-gap:4px;grid-template-columns:1fr 1fr 1fr 1fr -webkit-min-content;grid-template-columns:1fr 1fr 1fr 1fr min-content;align-items:flex-start}.ugb-four-number-control__wrapper button{padding:6px!important}.ugb-four-number-control__wrapper button.ugb--is-locked,.ugb-four-number-control__wrapper button.ugb--is-locked:hover{background:#aaa!important;color:#fff!important}.ugb-four-number-control__label{display:flex;flex-direction:column;justify-content:center;align-items:center}.ugb-four-number-control__label span{font-size:9px;opacity:.8}.ugb-four-number-control__label input{margin:0;width:100%;padding-left:0!important;padding-right:0!important;text-align:center}.ugb-four-number-control__label input[disabled]{background:#e5e4e8;cursor:not-allowed}.ugb-four-range-control__range{display:flex;align-items:center}.ugb-four-range-control__range .ugb-four-range-control__icon{height:20px;width:20px;flex-shrink:0;margin-right:10px}.ugb-four-range-control__range .components-base-control.components-range-control,.ugb-four-range-control__range .components-base-control__field{margin-bottom:0!important}.ugb-four-range-control__range .components-range-control{flex:1}.ugb-four-range-control .ugb-four-range-control__lock{height:auto;color:#555d66;box-shadow:none!important;margin-left:5px}.ugb-four-range-control .ugb-four-range-control__lock svg{height:16px;width:16px}.ugb-four-range-control.ugb--locked .ugb-four-range-control__range{margin-bottom:8px}.ugb-four-range-control:not(.ugb--locked) .ugb-advanced-range-control{margin-bottom:0}.ugb-global-style-control__item{display:flex;align-items:center}.ugb-global-style-control__item-label{flex-grow:1}li[aria-selected=false] .ugb-global-style-control__item-button{visibility:hidden}.ugb-global-style-control__item-preview{margin-right:12px}.ugb-global-style-control__item--large-preview .ugb-global-style-control__item-preview{margin-right:0;margin-bottom:12px;width:100%}.ugb-global-style-control__item--large-preview.ugb-global-style-control__item{display:flex;flex-wrap:wrap}.ugb-global-style-control .ugb-advanced-autosuggest-control__select{display:flex}.ugb-global-style-control .ugb-advanced-autosuggest-control__select>*{margin-left:8px}.ugb-global-style-control .ugb-advanced-autosuggest-control__select .react-autosuggest__container{flex:1;margin-left:0}.ugb-global-style-control .ugb-advanced-autosuggest-control__select .react-autosuggest__container input{height:100%}.ugb-global-style-control.ugb--has-value .react-autosuggest__suggestions-list>:first-child{border-bottom:1px solid #ddd}.ugb-global-style-control .react-autosuggest__suggestions-container{min-width:248px}.ugb-icon-control .ugb-icon-control__icon-button{height:auto;padding:8px;margin-right:auto}.ugb-icon-control .ugb-icon-control__icon-button svg{width:30px;height:30px}.ugb-icon-control .ugb-icon-control__wrapper{display:flex;justify-content:space-between;margin-bottom:16px}.ugb-icon-popover .components-popover__content{overflow:hidden;width:300px}.ugb-icon-popover__iconlist{display:flex;flex-wrap:wrap;justify-content:center;align-content:flex-start;align-items:flex-start;margin-top:5px;height:200px;overflow:auto}.ugb-icon-popover__iconlist button{background:none;padding:5px;border-color:transparent;box-shadow:none;width:40px;height:40px}.ugb-icon-popover__iconlist button:hover{box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff!important}.ugb-icon-popover__iconlist button:hover>div>svg{color:#000}.ugb-icon-popover__iconlist svg{width:30px!important;height:30px;margin:0;box-sizing:content-box;border-radius:4px}.ugb-icon-popover__iconlist button>div>svg{color:#444}.ugb-icon-popover__iconlist .components-base-control__help{font-style:italic}.ugb-icon-popover__label-container{display:flex;flex-wrap:wrap;align-items:center;margin-bottom:16px}.ugb-icon-popover__label-container .components-base-control__field{margin-bottom:0}.ugb-icon-popover__label-container .ugb-icon-popover__input{flex:1;flex-basis:calc(100% - 50px)}.ugb-icon-popover__label-container .ugb-icon-popover__settings-button{height:30px;margin-left:8px}.ugb-icon-popover__label-container .components-range-control__reset,.ugb-icon-popover__label-container .components-range-control__upload{text-align:center;display:block}.ugb-icon-popover__label-container.ugb-icon--has-upload.ugb-icon--has-reset .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-upload.ugb-icon--has-reset .components-range-control__upload{flex-basis:calc(50% - 4px);margin-top:8px}.ugb-icon-popover__label-container.ugb-icon--has-settings .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-settings .components-range-control__upload{margin-top:8px}.ugb-icon-popover__label-container.ugb-icon--has-upload .components-range-control__reset,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-reset) .components-range-control__upload,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload) .components-range-control__reset{margin-left:8px}.ugb-icon-popover__label-container:not(.ugb-icon--has-settings).ugb-icon--has-upload:not(.ugb-icon--has-reset) .ugb-icon-popover__input,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload).ugb-icon--has-reset .ugb-icon-popover__input{flex-basis:50%}.ugb-icon-popover__label-container:not(.ugb-icon--has-settings).ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__reset,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings).ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__upload,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__reset,.ugb-icon-popover__label-container:not(.ugb-icon--has-settings):not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__upload{height:30px}.ugb-icon-popover__label-container.ugb-icon--has-settings.ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-settings.ugb-icon--has-upload:not(.ugb-icon--has-reset) .components-range-control__upload,.ugb-icon-popover__label-container.ugb-icon--has-settings:not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__reset,.ugb-icon-popover__label-container.ugb-icon--has-settings:not(.ugb-icon--has-upload).ugb-icon--has-reset .components-range-control__upload{flex-basis:100%}.ugb-icon-popover__drop-area{font-size:12px;font-style:italic;color:#888;text-align:center;margin:0 0 24px;display:block;outline:none}.file-drop-dragging-over-frame>.ugb-icon-popover__iconlist{pointer-events:none}.ugb-icon-popover__drop-indicator{pointer-events:none;position:absolute;top:0;left:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;background:hsla(0,0%,100%,.9);flex-direction:column;transition:background .3s ease-in-out}.ugb-icon-popover__drop-indicator svg{margin-bottom:8px;transform-origin:bottom;animation:ugb-icon-popover__drop-indicator 1.8s ease infinite}.file-drop-dragging-over-target>.ugb-icon-popover__drop-indicator{background:#fff;outline-offset:-10px;outline-style:dashed;outline-width:3px;outline-color:#11a0d2}@keyframes ugb-icon-popover__drop-indicator{10%{transform:translateY(0)}50%{transform:translateY(-8px)}60%{transform:translateY(0)}}.ugb-image-control .ugb-placeholder{height:150px;display:flex;justify-content:center;align-items:center;background:#f1f1f1;margin-bottom:12px;margin-top:.6rem}.ugb-image-control .ugb-placeholder svg{height:50px;fill:#ddd}.ugb-image-control .ugb-image-preview,.ugb-image-control .ugb-placeholder{border-radius:4px;cursor:pointer;transition:all .3s ease-in-out}.ugb-image-control .ugb-image-preview:hover,.ugb-image-control .ugb-placeholder:hover{background:#fafafa}.ugb-image-control .ugb-image-preview:focus,.ugb-image-control .ugb-placeholder:focus{background:#fafafa;box-shadow:0 0 0 2px rgba(30,140,190,.8)}.ugb-image-control .ugb-image-preview-wrapper{position:relative;z-index:1;display:flex;justify-content:center;align-items:center;background:#f1f1f1;margin-top:.6rem;border-radius:4px}.ugb-image-control .ugb-image-preview-wrapper svg{stroke:rgba(0,0,0,.3);stroke-width:1px;fill:#fff}.ugb-image-control .ugb-image-preview{min-width:100px;flex:1 1 100px;margin:0;position:relative;z-index:2;-o-object-fit:contain;object-fit:contain;width:auto;height:auto}.ugb-image-control .ugb-image-preview-remove{background:none!important;color:#ddd;border:none;position:absolute;top:10px;right:4px;cursor:pointer;z-index:3}.ugb-image-shape-control .ugb-design-control{padding:8px;margin:0 40px!important;border:1px solid #efefef}.ugb-image-upload-placeholder{position:relative;cursor:copy;margin-left:auto;margin-right:auto}.ugb-image-upload-placeholder img{display:block}.ugb-image-upload-has-placeholder{background:#f1f1f1;display:flex;justify-content:center;align-items:center;height:150px;width:100%}.ugb-image-upload-has-placeholder svg{max-height:50px;fill:#ddd;max-width:40%;width:100%}.ugb-image-upload-has-placeholder:hover{background:#fafafa}.ugb-image-upload-has-placeholder:focus{background:#fafafa;box-shadow:0 0 0 2px rgba(30,140,190,.8)}.ugb-image-upload-has-image:hover{opacity:.8}.ugb-image-upload-remove{background:none!important;color:#ddd;border:none;position:absolute;top:10px;right:4px;cursor:pointer;display:none;z-index:9!important}.ugb-image-upload-remove svg{stroke:rgba(0,0,0,.3);stroke-width:1px;fill:#fff;max-width:none}.block-editor-block-list__block.is-selected .ugb-image-upload-remove,.block-editor-block-list__block:hover .ugb-image-upload-remove{display:block}.ugb-modal-design-library{width:100%;max-width:90%;height:90%;min-height:500px;--wp-admin-theme-color:#f00069;--wp-admin-theme-color-darker-10:#bd0053;--wp-admin-theme-color-darker-20:#8a003c}.ugb-modal-design-library .components-modal__content{padding:0;display:flex;flex-direction:column}.ugb-modal-design-library .components-modal__header{margin:0}.ugb-modal-design-library .ugb-modal-design-library__wrapper{display:grid;grid-template-columns:300px auto;grid-template-rows:50px auto;flex:1}.ugb-modal-design-library .ugb-modal-design-library__sidebar{box-shadow:0 0 30px rgba(0,0,0,.1);background:#fff;grid-column:1/2;grid-row:1/3;display:flex;flex-direction:column;overflow:hidden}.ugb-modal-design-library .ugb-modal-design-library__sidebar .ugb-control-separator{margin:8px 0!important;width:100%!important}.ugb-modal-design-library .ugb-modal-design-library__topbar{display:flex;justify-content:flex-end;padding:0 24px;height:50px;align-items:center;grid-column:2/3;grid-row:1/2}.ugb-modal-design-library .ugb-modal-design-library__designs{padding:24px;grid-column:2/3;grid-row:2/3}.ugb-modal-design-library .ugb-modal-design-library__search{padding:24px 24px 0}.ugb-modal-design-library .ugb-modal-design-library__search .components-base-control__field{margin:0}.ugb-modal-design-library .ugb-modal-design-library__topbar .is-pressed{background:#555;color:#fff}.ugb-modal-design-library .ugb-advanced-toolbar-control .components-button.components-toolbar__control.has-text,.ugb-modal-design-library .ugb-advanced-toolbar-control .components-button.components-toolbar__control.has-text.is-pressed,.ugb-modal-design-library .ugb-advanced-toolbar-control .components-button.components-toolbar__control.has-text:hover,.ugb-modal-design-library .ugb-advanced-toolbar-control .ugb-toolbar--full-width{background:transparent}.ugb-modal-design-library .ugb-modal-design-library__filters{overflow-y:auto;padding:24px}.ugb-modal-design-library__filters .ugb-block-list{margin-top:0!important}.ugb-modal-design-library__filters .ugb-block-list .components-button-group{text-align:center}.ugb-block-list h4{margin-bottom:0;padding:0 10px 6px}.ugb-block-list li{margin:0}.ugb-block-list li>div{padding:6px 10px;cursor:pointer}.ugb-block-list li [aria-pressed=true]{font-weight:700;color:#f00069}.ugb-block-list li .is-disabled{opacity:.3}.ugb-block-list .ugb-block-list__count{float:right}.ugb-block-list [data-count="0"]{opacity:.3}.ugb-modal-design-library__color-list-wrapper{display:flex;flex-wrap:wrap;flex-direction:row;justify-content:center}.ugb-modal-design-library__color-list{margin-bottom:8px!important}.ugb-modal-design-library__color-list .components-circular-option-picker{width:24px;flex:0;margin:0 10px 10px;flex-basis:20px}.ugb-modal-design-library__color-list .components-circular-option-picker__option-wrapper{height:22px;width:22px;margin:0}.ugb-modal-design-library__color-list .components-circular-option-picker__option-wrapper .components-circular-option-picker__option{padding:0}.ugb-modal-design-library__color-list .components-circular-option-picker__option.is-pressed+svg{left:3px;top:3px;width:16px;height:16px}.ugb-modal-design-library__color-list .components-circular-option-picker__option:after{box-shadow:inset 0 0 0 1px rgba(0,0,0,.2)!important}.ugb-modal-design-library__color-list .components-circular-option-picker__option:focus:after{width:28px;height:28px;top:-3px;left:-3px}.ugb-modal-design-library__refresh{margin-right:10px}.ugb-modal-design-library__dev-mode .components-base-control__field{margin:2px 24px 0!important}.ugb-modal-welcome-video p{width:470px;margin:16px auto;text-align:center}.ugb-modal-welcome-video .components-modal__content{padding-bottom:20px}.ugb-modal-welcome-video .components-modal__header{margin-bottom:30px}.ugb-modal-welcome-video,.ugb-modal-welcome-video__overlay{animation-duration:.6s!important;transition-duration:.6s!important}.ugb-toggle-panel-form-toggle{margin-right:12px}.ugb-panel-advanced-button{text-transform:uppercase;font-size:9px;background:transparent;width:100%;display:block;border:0;outline:none;position:relative;cursor:pointer;padding-bottom:15px}.ugb-panel-advanced-button:after{content:"❯";position:absolute;transform:translateX(-50%) rotate(90deg);left:50%;bottom:0}.ugb-panel-advanced-button:hover{color:#999}.ugb-toggle-panel-body--advanced .ugb-panel-advanced-button{padding-bottom:0;padding-top:15px}.ugb-toggle-panel-body--advanced .ugb-panel-advanced-button:after{top:0;bottom:auto;transform:translate(-50%) rotate(-90deg)}.ugb-panel-tabs{position:-webkit-sticky;position:sticky;top:-1px;z-index:5}.ugb-panel-tabs .ugb-panel-tabs__wrapper{display:flex!important;flex-wrap:nowrap}.ugb-panel-tabs .ugb-panel-tabs__wrapper,.ugb-panel-tabs .ugb-panel-tabs__wrapper>button{transition:all .1s cubic-bezier(.2,.6,.4,1);background:#fff;box-shadow:none;border:0}.ugb-panel-tabs button{outline:none!important;display:flex;flex-direction:column;justify-content:center;align-items:center;height:80px;padding:0!important;flex:1;margin:0!important;cursor:pointer;color:#1e1e1e;border:0!important}.ugb-panel-tabs button .dashicon{margin:5px;height:20px}.ugb-panel-tabs button.is-active{border-bottom:0;box-shadow:inset 0 0 0 1px #1e1e1e}.ugb-panel-tabs button:hover{background:#f0f0f0}.ugb-panel-tabs button:focus{box-shadow:inset 0 0 0 1.5px #007cba;box-shadow:inset 0 0 0 1.5px var(--wp-admin-theme-color,#007cba)}.ugb-panel-tabs{border-bottom:1px solid #e2e4e7!important}.edit-post-sidebar.ugb--has-panel-tabs{background-color:#f0f3f5}.edit-post-sidebar.ugb--has-panel-tabs .edit-post-settings-sidebar__panel-block .components-panel__body:last-child{margin-bottom:0}[data-ugb-tab]>*{padding-bottom:0!important}.ugb-inspector-panel-controls .components-panel__body .components-panel__body-title:not(:hover){background:#fff}.ugb-inspector-panel-controls .components-panel__body .components-panel__body-title+.components-toggle-control{margin-top:24px!important}.ugb-inspector-panel-controls .components-panel__body.is-opened .components-panel__body-title{margin-bottom:12px;border-bottom:1px solid #e1e1e1;position:-webkit-sticky;position:sticky;top:81px;z-index:4}.ugb-inspector-panel-controls .components-panel__body{background:#fafafa}.ugb-inspector-panel-controls .components-panel__body:first-child{border-top:0!important}[data-ugb-tab=advanced] .ugb-inspector-panel-controls:not(.ugb-panel-advanced),[data-ugb-tab=layout] .block-editor-block-inspector__advanced,[data-ugb-tab=layout] .ugb-inspector-panel-controls:not(.ugb-panel-layout),[data-ugb-tab=style] .block-editor-block-inspector__advanced,[data-ugb-tab=style] .ugb-inspector-panel-controls:not(.ugb-panel-style){display:none}.ugb-design-control-pro-note{position:relative;text-align:center;background:#fff;padding:16px;border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,.12);margin:16px 0;color:#1e1e1e}.ugb-design-control-pro-note h4{margin:0 0 4px;font-size:1em}.ugb-design-control-pro-note p{font-size:.9em;margin-bottom:16px}.ugb-design-control-pro-note a.button{color:#fff;border:0;text-transform:uppercase;display:inline-block;height:auto;width:100%;margin:0 auto;transition:all .3s ease-in-out;box-shadow:none;font-size:10px;letter-spacing:1px;line-height:1.2em;border-radius:25px;padding:10px 18px;background:linear-gradient(330deg,#b300be,#f00069);background-color:#b300be;transition-timing-function:cubic-bezier(.81,.37,.61,1);transition-duration:.2s}.ugb-design-control-pro-note a.button:hover{background:linear-gradient(90deg,#f00069 0,#f00069);color:#fff;transform:scale(1.02)}.ugb-design-control-pro-note .ugb-design-control-pro-note__close{position:absolute;top:0;right:0;color:#777}.ugb-design-control-pro-note svg.ugb-design-control-pro-note__logo{height:24px;width:24px;margin:0 0 12px}.ugb-design-control-pro-note.ugb-pro-note__small{display:grid;padding:0;grid-template-columns:30px 1fr -webkit-min-content;grid-template-columns:30px 1fr min-content;grid-gap:5px;align-items:center;margin-bottom:0}.ugb-design-control-pro-note.ugb-pro-note__small svg{margin:0;height:25px;width:25px}.ugb-design-control-pro-note.ugb-pro-note__small p{text-align:left;margin:0;font-size:10px}.ugb-design-control-pro-note.ugb-pro-note--fade *{transition:all .3s ease-in-out}.ugb-design-control-pro-note.ugb-pro-note--fade p{opacity:.8}.ugb-design-control-pro-note.ugb-pro-note--fade a,.ugb-design-control-pro-note.ugb-pro-note--fade svg{opacity:.7}.ugb-design-control-pro-note.ugb-pro-note--fade:hover a,.ugb-design-control-pro-note.ugb-pro-note--fade:hover p,.ugb-design-control-pro-note.ugb-pro-note--fade:hover svg{opacity:1}.ugb-design-control-pro-note .ugb-design-control-pro-note__notice{font-size:10px;line-height:1.4;max-width:140px;margin:16px auto 0;font-style:italic;color:#aaa}.ugb-pro-control-more-dots{display:flex;background:transparent;margin:0 auto;width:50px;justify-content:center;border-radius:25px;height:25px;align-items:center;cursor:pointer;transition:all .3s ease-in-out;border:none;outline:none}.ugb-pro-control-more-dots .ugb-pro-control-more-dots__dot{width:6px;height:6px;background:#aaa;border-radius:100%;margin:0 2px;transition:all .3s ease-in-out}.ugb-pro-control-more-dots:focus,.ugb-pro-control-more-dots:hover{background:#eee}.ugb-pro-control-more-dots:focus .ugb-pro-control-more-dots__dot,.ugb-pro-control-more-dots:hover .ugb-pro-control-more-dots__dot{background:#555}.ugb-pro-control-button__wrapper{max-height:800px;transition:all .3s ease-in-out;overflow:hidden;margin:0 -16px}.ugb-pro-control-button__wrapper.ugb-pro-control-button--hidden{max-height:0}.ugb-pro-control-button__wrapper .ugb-design-control-pro-note{margin-left:16px;margin-right:16px}.ugb-pro-modal{overflow:hidden!important;border:0!important;background:#000}.ugb-pro-modal .components-modal__header{position:absolute;top:0;right:10px;z-index:3;border:0;background:transparent}.ugb-pro-modal .components-modal__header .components-button svg{fill:#fff}.ugb-pro-modal .components-modal__header .components-button:hover{background-color:rgba(0,0,0,.4)!important}.ugb-pro-modal .components-modal__content{padding:0}.ugb-pro-modal .components-modal__content img{max-width:1000px;height:auto;width:auto!important}.ugb-pro-modal .ugb-pro-modal__footer{padding:30px;text-align:center;display:flex;justify-content:center;align-items:center}.ugb-pro-modal .ugb-pro-modal__footer *{margin:0 5px}.ugb-pro-modal .ugb-pro-modal__footer .button{color:#fff;background:linear-gradient(90deg,#ab5af1 -50%,#fb6874);border:0;height:auto;font-size:14px;font-weight:500;display:flex;align-items:center;margin:0 15px;border-radius:40px;padding:5px 25px}.ugb-pro-modal .ugb-pro-modal__footer .button svg{fill:#fff;margin:0 10px 0 0}.ugb-pro-modal .ugb-pro-modal__footer .button:hover{background:linear-gradient(90deg,#ab5af1 -50%,#fb6874 50%)}.ugb-pro-modal .ugb-pro-modal__footer a:not(.button){color:#fb6874;text-decoration:none}.ugb-pro-modal .ugb-pro-modal__footer a:not(.button):hover{color:#ab5af1}.ugb-pro-modal .ugb-pro-modal__footer .button-ghost{box-shadow:inset 0 0 0 2px #fb6874;background:none;color:#fb6874;font-weight:400;text-transform:none}.ugb-pro-modal .ugb-pro-modal__footer .button-ghost:hover{box-shadow:inset 0 0 0 2px #ab5af1;background:none;font-weight:400;color:#ab5af1}.ugb-base-control-multi-label__responsive{display:flex;margin-left:6px;align-items:center}.ugb-base-control-multi-label__responsive button{height:14px;width:14px;padding:5px!important;min-width:11px!important;box-sizing:content-box;border-radius:0!important;margin:0;border:1px solid transparent}.ugb-base-control-multi-label__responsive button svg{height:100%;width:100%}.ugb-base-control-multi-label__responsive button.is-active,.ugb-base-control-multi-label__responsive button:hover{border:1px solid #1e1e1e!important;box-shadow:none!important}.ugb-base-control-multi-label__responsive button.is-active:not([data-screen=desktop]){background:#007cba;background:var(--wp-admin-theme-color,#007cba);color:#fff;border-color:#007cba!important;border-color:var(--wp-admin-theme-color,#007cba)!important}.ugb-base-control-multi-label__responsive button[data-screen=desktop]:not(:hover){border-color:transparent!important}.ugb-base-control-multi-label__responsive button.is-active:not(:first-child){background:#ab5af1!important}.ugb-small-number-control .components-base-control__field{display:flex;justify-content:space-between;align-items:center}.ugb-small-number-control input{width:80px}.ugb-social-url-text-control+.ugb-social-url-text-control{margin-top:-18px!important}.ugb-sort-control .ugb-sort-control__container{display:flex;flex-direction:row}.ugb-sort-control.ugb-sort-control--axis-y .ugb-sort-control__container{flex-direction:column;max-width:150px;margin:0 auto}.ugb-sort-control .ugb-sort-control__item{box-shadow:none}.ugb-sort-control__item{border-radius:4px;background:#fafafa;width:100%;text-align:center;padding:4px;border:1px solid #ddd;margin:2px;display:block;cursor:grab!important;box-shadow:0 5px 15px rgba(0,0,0,.05)}.ugb-sort-control__item:hover{background:#fff;box-shadow:inset 0 0 0 1px #ddd}.ugb-svg-icon-placeholder{line-height:1}.ugb-svg-icon-placeholder button{font-size:inherit;padding:0;color:inherit;outline:none!important;background:transparent!important;border:none!important;box-shadow:none!important;cursor:copy;display:inline-block;width:auto}.ugb-svg-icon-placeholder button svg{display:block}.ugb-svg-icon-placeholder__button{font-size:inherit!important;padding:inherit!important;display:flex!important;height:auto;overflow:visible}.ugb-svg-icon-placeholder__button:hover{color:inherit!important}.edit-post-sidebar .ugb-url-input-control__input input{width:100%;border-radius:4px!important;border:1px solid #8d96a0!important;flex:1!important}.ugb-url-input-popover{z-index:99989}.ugb-url-input-popover.is-from-top{margin-top:20px!important}.ugb-url-input-popover.is-from-bottom{margin-top:-20px!important}.ugb-url-input-popover .ugb-url-input-control__input input[type=text]{border-radius:4px;border:1px solid #8d96a0;flex:1}.ugb-url-input-popover .ugb-url-input-control__more-button{margin-left:5px}.ugb-url-input-popover .ugb-url-input-popover__input-wrapper{display:flex;align-items:center}.ugb-url-input-popover .ugb-url-input-control__icon{margin-right:10px}.ugb-url-input-popover.ugb--show-advanced .ugb-url-input-popover__input-wrapper{margin-bottom:16px}.ugb-url-input-popover .ugb-url-input-control__input.ugb-url-input-control__input--plain{flex:1;width:300px}.ugb-url-input-popover .ugb-url-input-control__input.ugb-url-input-control__input--plain .components-base-control__field{margin-bottom:0!important}.ugb-url-input-popover .ugb-url-input-control__more-button[aria-expanded=false].ugb--active:not(:hover){box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff}.stackable-components-toolbar{border-right:none!important}.stackable-components-toolbar .components-icon-button{justify-content:center}.stackable-components-toolbar .components-icon-button svg{margin:0!important}.components-stackable-highlight__popover .components-popover__content{overflow:hidden;padding:16px;width:280px}.ugb-component-inline-color-popover{padding:16px}.ugb-highlight-format__color-picker{margin-bottom:16px}.components-stackable-highlight-color__indicator{position:absolute;background:#000;height:3px;width:20px;left:auto;right:auto;top:50%;margin:9px 0 0}.ugb-advanced-toolbar-control .components-base-control__field{margin-bottom:24px}.ugb-bottom-separator .ugb-separator-wrapper,.ugb-top-separator .ugb-separator-wrapper{pointer-events:all}.ugb-design-layout-selector__design-items,.ugb-design-layout-selector__layout-items{display:flex;width:100%;justify-content:flex-start;align-items:center;flex-wrap:wrap;flex-direction:row;row-gap:6px}.ugb-design-layout-selector__spinner{position:absolute;z-index:1;top:0;bottom:0;left:0;right:0;margin:auto;display:flex;align-items:center;justify-content:center}.ugb-design-layout-selector__content{overflow-y:auto;max-height:450px}.ugb-design-layout-selector__content .components-placeholder__instructions:not(:first-child){margin-top:26px}.ugb-design-layout-selector{transition:all .3s ease-in-out;position:relative;max-width:750px;margin:auto!important}.ugb-design-layout-selector.is-busy .ugb-design-layout-selector__content{opacity:.15}.ugb-design-layout-selector__close-button{width:100%;padding-top:8px;align-items:center;justify-content:space-between;display:flex;flex-direction:row}.ugb-design-layout-selector__notice{margin:0!important;font-size:10px!important;font-style:italic;color:#aaa}.ugb-design-layout-selector__image{transition:all .2s ease-in;display:block;width:100%;min-height:70px;-o-object-fit:contain;object-fit:contain;pointer-events:none}.ugb-design-layout-selector .ugb-design-layout-selector__lock{position:absolute;right:8px;top:8px;border-radius:20px;padding:3px;background-image:linear-gradient(180deg,#a911b9,#e74673);fill:#fff;z-index:1;opacity:1;transform:none;transition:all .15s ease-in}.ugb-design-layout-selector .ugb-design-layout-selector__item-premium-button{position:absolute;display:flex;flex-direction:column;z-index:3;color:#fff;border:0;text-transform:uppercase;display:inline-block;height:auto;min-height:auto;width:auto;margin:0 auto;transition:all .3s ease-in-out;box-shadow:none;font-size:10px;letter-spacing:1px;line-height:1em;border-radius:25px;padding:10px 15px;background:linear-gradient(330deg,#b300be,#f00069);background-color:#b300be;transition-timing-function:cubic-bezier(.81,.37,.61,1);transition-duration:.2s;opacity:0;transform:translateY(-50%) translateX(-50%);top:50%;left:50%}.ugb-design-layout-selector .ugb-design-layout-selector__item-premium-button:hover{background:linear-gradient(90deg,#f00069 0,#f00069);color:#fff;transform:translateY(-50%) translateX(-50%) scale(1.02)}.ugb-design-layout-selector .ugb-design-layout-selector__item{position:relative;display:block;break-inside:avoid;padding:0 8px;background:transparent;border:0;order:1}.ugb-design-layout-selector .ugb-design-layout-selector__item.is-premium{order:2}.ugb-design-layout-selector .ugb-design-layout-selector__item.is-premium .ugb-design-layout-selector__wrapper:after{cursor:default}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover .ugb-design-layout-selector__wrapper:after{opacity:.05}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover .ugb-design-layout-selector__wrapper .ugb-design-layout-selector__lock{opacity:0;transform:scale(.5)}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover .ugb-design-layout-selector__wrapper .ugb-design-layout-selector__item-premium-button{opacity:1}.ugb-design-layout-selector .ugb-design-layout-selector__item:hover.is-premium .ugb-design-layout-selector__wrapper:after{opacity:.25}.ugb-design-layout-selector__wrapper{padding:0;cursor:pointer;transition:all .2s ease-in;width:100%;height:-webkit-max-content;height:max-content;display:flex;text-align:left;position:relative;border-radius:8px;overflow:hidden;margin-top:3px}.ugb-design-layout-selector__wrapper>:not(.ugb-design-layout-selector__image){z-index:3}.ugb-design-layout-selector__wrapper:after{content:"";top:0;left:0;right:0;bottom:0;background:#000;z-index:2;display:block;position:absolute;opacity:0;transition:all .2s ease-in}.ugb-design-layout-selector__label{display:block;width:100%;font-size:12px!important;font-weight:400!important;margin-bottom:0;color:#000;text-align:center;margin-top:6px!important}.ugb-design-layout-selector__layout-item{flex-basis:130px}.ugb-design-layout-selector__design-item{flex-basis:170px}.ugb-design-layout-selector__design-item .ugb-design-layout-selector__wrapper{min-height:100px}.ugb-design-layout-selector__design-library{position:relative;margin-top:24px}.ugb-design-layout-selector__design-library.is-busy{opacity:.15}.ugb-panel-controls-separator{margin:0;background:#f0f3f5;text-transform:uppercase;font-size:8px;text-align:center;padding:14px 0;background:#fafafa;border-top:1px solid #f0f0f0;color:#00669b;color:var(--wp-admin-theme-color-darker-10,#00669b)}.ugb--hide-desktop.ugb--hide-desktop.ugb--hide-desktop,.ugb--hide-mobile.ugb--hide-mobile.ugb--hide-mobile,.ugb--hide-tablet.ugb--hide-tablet.ugb--hide-tablet{display:block!important}.ugb--hide-desktop.ugb--hide-desktop.ugb--hide-desktop.ugb-main-block,.ugb--hide-mobile.ugb--hide-mobile.ugb--hide-mobile.ugb-main-block,.ugb--hide-tablet.ugb--hide-tablet.ugb--hide-tablet.ugb-main-block{display:flex!important}.ugb-main-block,[class*=ugb-]+form[class*=-link],[class*=ugb-] form[class*=-link],form[class*=ugb-][class*=-link]{display:flex;justify-content:center;align-items:center}.ugb-main-block{margin-top:35px;margin-bottom:35px;padding:0}.ugb-main-block.alignfull{padding:0 35px}.ugb-block-content,.ugb-inner-block{margin:0;padding:0;width:100%;position:relative}.ugb--full-height{min-height:700px}.ugb--restrict-content-width .ugb-content-wrapper{max-width:var(--content-width);margin:0 auto}.ugb--shadow-0,.ugb-shadow-0{box-shadow:none!important}.ugb--shadow-1,.ugb-shadow-1{box-shadow:0 0 0 1px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-2,.ugb-shadow-2{box-shadow:0 0 0 2px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-3,.ugb-shadow-3{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2)!important}.ugb--shadow-4,.ugb-shadow-4{box-shadow:0 2px 20px hsla(0,0%,60%,.2)!important}.ugb--shadow-5,.ugb-shadow-5{box-shadow:0 5px 30px -10px rgba(18,63,82,.3)!important}.ugb--shadow-6,.ugb-shadow-6{box-shadow:0 10px 30px rgba(0,0,0,.05)!important}.ugb--shadow-7,.ugb-shadow-7{box-shadow:7px 5px 30px rgba(72,73,121,.15)!important}.ugb--shadow-8,.ugb-shadow-8{box-shadow:0 10px 60px rgba(0,0,0,.1)!important}.ugb--shadow-9,.ugb-shadow-9{box-shadow:0 70px 130px -60px rgba(72,73,121,.38)!important}div[class^=wp-block-ugb-]{z-index:1}@supports (-webkit-touch-callout:inherit){[class*=ugb-]{background-attachment:scroll!important}}.ugb-block-content:after,.ugb-block-content:before{content:none!important}[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background{margin-top:0;margin-bottom:0;padding-top:70px;padding-bottom:70px}[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background.ugb-main-block--inner-full>.ugb-inner-block{width:100%}.ugb-bottom-block-separator-panel .ugb-design-control,.ugb-top-block-separator-panel .ugb-design-control{max-height:270px}.ugb-top-block-separator-panel .ugb-design-panel-item__image{transform:scaleY(-1)}.ugb-bottom-separator svg,.ugb-top-separator svg{transition:none!important}.editor-styles-wrapper [data-type^="ugb/"] .ugb-main-block .ugb-block-title{margin:0 0 64px}.editor-styles-wrapper [data-type^="ugb/"] .ugb-main-block .ugb-block-title.ugb-block-title--with-subtitle{margin-bottom:16px}.editor-styles-wrapper [data-type^="ugb/"] .ugb-main-block .ugb-block-description{margin:0 0 64px}.ugb-debugger-panel{padding:16px}.ugb-debugger-panel p{margin:0}.ugb-premium-notice-inspector-popup{margin-left:16px;margin-right:16px}.ugb-global-settings-color-picker__text-name{padding-top:0!important}.ugb-global-settings-color-picker__text-name .components-color-picker__controls{justify-content:space-between}.ugb-global-settings-color-picker__text-name .components-color-picker__inputs-wrapper{padding-top:0!important}.ugb-global-settings-color-picker__text-name input{width:211px}.ugb-global-settings-color-picker{margin-bottom:12px}.ugb-global-settings-color-picker__add-icon{min-width:30px!important;width:30px;height:30px;border-radius:50%}.ugb-global-settings-color-picker__add-icon svg{width:20px}.ugb-global-settings-color-picker__title{margin:0 0 1em!important}.ugb-global-settings-color-picker__reset-button{width:-webkit-max-content;width:max-content;margin-right:0!important;margin:auto auto 12px}.ugb-global-settings-color-picker__reset-button-popover .components-popover__content{width:250px;padding:12px}.ugb-global-settings__color-picker-disabled-color{pointer-events:none}.ugb-global-settings__color-picker-disabled-color .components-circular-option-picker__option{display:flex;justify-content:center}.ugb-global-settings__color-picker-disabled-color .components-circular-option-picker__option svg{width:12px}.ugb-global-settings-typography-control>.components-base-control__field{margin-bottom:16px}.ugb-global-settings-typography-control>.components-base-control__field>.components-base-control__label{min-height:25px;width:calc(100% - 88px);margin-bottom:0!important;pointer-events:none}.ugb-global-settings-typography-control.ugb-global-settings-typography-control--with-description>.components-base-control__field{margin-bottom:32px}.ugb-global-typography-preview{position:relative}.ugb-global-typography-preview .block-editor-block-list__block,.ugb-global-typography-preview .block-editor-block-list__layout,.ugb-global-typography-preview .editor-styles-wrapper{margin:0!important;padding:0!important;overflow:hidden!important;white-space:nowrap!important;background:transparent!important}.ugb-global-typography-preview .block-editor-block-list__block:after,.ugb-global-typography-preview .block-editor-block-list__block:before,.ugb-global-typography-preview .block-editor-block-list__layout:after,.ugb-global-typography-preview .block-editor-block-list__layout:before,.ugb-global-typography-preview .editor-styles-wrapper:after,.ugb-global-typography-preview .editor-styles-wrapper:before{display:none!important}.ugb-global-typography-preview__label{margin:0!important;padding:0!important;line-height:1.4!important}.ugb-global-typography-preview__description{margin:0!important;padding:0!important;font-size:12px!important;position:absolute;top:100%;width:270px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ugb-deprecated-tester .ugb-deprecated-tester__load-button{display:flex;align-items:center;transition:all .3s ease-in-out;margin-top:5px}.ugb-deprecated-tester .ugb-deprecated-tester__load-button svg{margin-right:8px}.ugb-deprecated-tester.ugb-deprecated-tester--loading .ugb-deprecated-tester__load-button{opacity:.7}.ugb-deprecated-tester.ugb-deprecated-tester--loading .ugb-deprecated-tester__load-button svg{animation:deprecated-test-rotate 1s linear infinite}.ugb-deprecated-tester--row{display:flex;align-items:center;justify-content:space-between;margin:8px 0}.ugb-deprecated-tester--row button{background:#fafafa;border-color:#ddd}.ugb-deprecated-tester--row.ugb--first{justify-content:flex-end}.ugb-deprecated-tester--row>:last-child{display:flex;justify-content:center;align-items:center}.ugb-deprecated-tester--row>:last-child button{display:inline-block;padding:4px;height:26px;width:26px;margin-left:8px}.ugb-deprecated-tester--row>:last-child svg{height:18px;width:18px}.ugb-deprecated-tester--row .ugb--green{color:#0da00d}.ugb-deprecated-tester--name{display:flex}.ugb-deprecated-tester--name button{padding:0;border:0!important;background:transparent!important;box-shadow:none!important}.ugb-deprecated-tester--name svg{display:inline-block;height:15px;width:15px;vertical-align:text-top;color:#ccc;margin-left:4px}.ugb-deprecated-tester--test-details{display:flex;justify-content:flex-start}.ugb-deprecated-tester--test-details .ugb--version{color:#777}.ugb-deprecated-tester--test-details .ugb--plan{background:#fb6874;color:#fff;padding:0 .5em;border-radius:3px;margin-left:.5em;font-size:.6em;text-transform:uppercase}.ugb-deprecated-tester--test-details .ugb--skipped-note{width:100%;font-style:italic}.ugb-deprecated-tester--test-details .components-icon-button{padding:2px;margin-left:4px}.ugb-deprecated-tester--test-details .components-icon-button svg{height:12px;width:12px}.ugb-deprecated-tester--test-details .components-clipboard-button{font-size:11px;margin-left:6px}.ugb-deprecated-tester--test-detail-wrapper{background:#fafafa;padding:6px;border:1px solid #ddd;border-radius:4px}.ugb-deprecated-tester--test-detail-wrapper>div>div{display:flex;flex-wrap:wrap}.ugb-deprecated-tester--test-detail-wrapper .ugb--failed,.ugb-deprecated-tester--test-detail-wrapper .ugb--passed,.ugb-deprecated-tester--test-detail-wrapper .ugb--skipped{padding:0 6px;border-radius:2px;display:inline-block;background:#a7e8a7;color:#0c7b0c;align-self:flex-end;margin:0 0 0 auto}.ugb-deprecated-tester--test-detail-wrapper .ugb--failed{background:#efd5d5;color:#a70d0d}.ugb-deprecated-tester--test-detail-wrapper .ugb--skipped{background:#eee;color:#666}@keyframes deprecated-test-rotate{0%{transform:rotate(0deg)}to{transform:rotate(-359deg)}}.ugb-html-validator .CodeMirror{height:300px}.ugb-html-validator .components-base-control__help{margin-top:0}.ugb-html-validator--invalid,.ugb-html-validator--valid{font-weight:700;text-transform:uppercase;color:#1fb51f}.ugb-html-validator--invalid{color:#e4174d}@media screen and (max-width:600px){.ugb-icon-list.ugb-icon-list--display-grid ul{grid-template-columns:1fr!important}.ugb-icon-list.ugb-icon-list ul{column-count:1!important}.ugb-main-block.alignfull{padding-right:17.5px;padding-left:17.5px}}@media screen and (min-width:1025px){.ugb--full-height{min-height:100vh}}@media screen and (max-width:768px){.ugb-columns.ugb-columns.ugb-columns.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr!important;grid-template-areas:inherit!important}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-columns:1fr!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:inherit!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit}#editor .ugb-columns.ugb-columns.ugb-columns.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-auto-flow:row;grid-template-columns:1fr!important;grid-template-areas:inherit!important}#editor .ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.ugb-column{grid-area:inherit!important}#editor .ugb-columns.ugb-columns--design-plain.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-auto-flow:row;grid-template-columns:1fr 1fr!important}#editor .ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-columns:1fr!important}#editor .ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-areas:inherit!important}#editor .ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout>.block-editor-block-list__block{grid-area:inherit}}@media screen and (min-width:768px) and (max-width:1025px){#editor .ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.block-editor-inner-blocks>.block-editor-block-list__layout,.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr 1fr!important}}@media (min-width:600px){[data-type="ugb/column"].block-editor-block-contextual-toolbar{margin-bottom:0!important;margin-left:0!important}}@media screen and (min-width:960px){[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background.ugb-main-block--inner-center>.ugb-inner-block{max-width:var(--content-width)}}@media screen and (min-width:1280px){[data-type^="ugb/"][data-align=full]>*>.ugb-main-block.ugb--has-block-background.ugb-main-block--inner-wide>.ugb-inner-block{max-width:1200px}} \ No newline at end of file diff --git a/plugins/stackable-ultimate-gutenberg-blocks/dist/editor_blocks.js b/plugins/stackable-ultimate-gutenberg-blocks/dist/editor_blocks.js index 8c7dfdce..b52560a8 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/dist/editor_blocks.js +++ b/plugins/stackable-ultimate-gutenberg-blocks/dist/editor_blocks.js @@ -1,2 +1,2 @@ -var editor_blocks=function(e){function t(t){for(var a,r,l=t[0],c=t[1],s=t[2],b=0,p=[];b0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(u.camelCase)(Object(b.sprintf)(e,t,n))},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return a.length?n.reduce(function(n,i){return m({},n,{},a.reduce(function(n,a,o){var r=m({},t);return void 0!==r.selector&&(r.selector=Object(b.sprintf)(r.selector,o+1)),n[Object(u.camelCase)(Object(b.sprintf)(e,i,a))]=r,n},{}))},{}):n.reduce(function(n,a,i){var o=m({},t);return void 0!==o.selector&&(o.selector=Object(b.sprintf)(o.selector,i+1)),n[Object(u.camelCase)(Object(b.sprintf)(e,a))]=o,n},{})},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f(e,t,["","Tablet","Mobile"])},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(u.omit)(e,t.map(function(e){return Object(u.camelCase)(Object(b.sprintf)(n,e))}))},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.length?Object(u.pick)(e,t.map(function(e){return Object(u.camelCase)(Object(b.sprintf)(n,e))})):e},O=function(e){return Object.keys(h(e))};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=function(e){return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},o=yt(n,i,""),r=a.importantSize,l=void 0!==r&&r,s=a.important,p=void 0===s||s,m=a.inherit,g=void 0===m||m,d=a.inheritMax,f=void 0===d?50:d,h=a.inheritMin,v={},y=o("FontSize"),O=o("TabletFontSize"),w=o("MobileFontSize");if("tablet"!==t&&"mobile"!==t)v={fontFamily:""!==o("FontFamily")?c(o("FontFamily")):void 0,fontSize:""!==y?vt("".concat(y).concat(o("FontSizeUnit")||"px"),l):void 0,fontWeight:""!==o("FontWeight")?o("FontWeight"):void 0,textTransform:""!==o("TextTransform")?o("TextTransform"):void 0,letterSpacing:""!==o("LetterSpacing")?"".concat(o("LetterSpacing"),"px"):void 0,lineHeight:""!==o("LineHeight")?"".concat(o("LineHeight")).concat(o("LineHeightUnit")||"em"):void 0};else if("tablet"===t){if(v={lineHeight:""!==o("TabletLineHeight")?"".concat(o("TabletLineHeight")).concat(o("TabletLineHeightUnit")||"em"):void 0},g){var _=Ot(y,{min:h,max:f});_&&(v.fontSize="".concat(_).concat(o("FontSizeUnit")||"px"))}O&&(v.fontSize=o("TabletFontSize","%s".concat(o("TabletFontSizeUnit")||"px")))}else{if(v={lineHeight:""!==o("MobileLineHeight")?"".concat(o("MobileLineHeight")).concat(o("MobileLineHeightUnit")||"em"):void 0},g){var j=Ot(y,{min:h,max:f});j&&(v.fontSize="".concat(j).concat(o("FontSizeUnit")||"px"));var k=Ot(O,{min:h,max:f});k?v.fontSize="".concat(k).concat(o("TabletFontSizeUnit")||"px"):(j||O)&&(v.fontSize=void 0)}w&&(v.fontSize=o("MobileFontSize","%s".concat(o("MobileFontSizeUnit")||"px")))}return p?ht(v):v},E=n(18),S=n(4);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P={},A=function(){P=function(e){for(var t=1;t'.concat(e.map(function(e){return"<".concat(e,">")}).join(),""),!document||!document.body)return{};document.body.appendChild(t);var n={};return e.forEach(function(e){var a=window.getComputedStyle(t.querySelector(e)).getPropertyValue("font-size");n[e]=Math.round(parseFloat(a))}),document.body.removeChild(t),n}(["h1","h2","h3","h4","h5","h6","p"]))};Object(S.addFilter)("stackable.global-settings.typography.editor-styles","stackable/default-font-sizes",function(e,t,n,a){return e[".ugb-default-font-size .wp-block ".concat(t)]=x("%s","desktop",a,{important:!0}),P={},e});var N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(P).length&&!t||A(),P[e]||P.p||21};function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object(E.a)(function(){A()});var F=function(e){return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},o=yt(n,i),r=a.importantBackgroundColor,l=void 0!==r&&r,c=a.importantBackgroundPosition,s=void 0!==c&&c,p=a.importantBackgroundSize,m=void 0!==p&&p,g=a.importantBackgroundRepeat,d=void 0!==g&&g,f=o("BackgroundCustomSize")?o("BackgroundCustomSize")+(o("BackgroundCustomSizeUnit")||"%"):void 0,h=o("TabletBackgroundCustomSize")?o("TabletBackgroundCustomSize")+(o("TabletBackgroundCustomSizeUnit")||"%"):void 0,v=o("MobileBackgroundCustomSize")?o("MobileBackgroundCustomSize")+(o("MobileBackgroundCustomSizeUnit")||"%"):void 0,y=vt(o("BackgroundColor"),l);return o("BackgroundColorType")||void 0===n[i("BackgroundColorOpacity")]||""===n[i("BackgroundColorOpacity")]||o("BackgroundMediaURL")||o("TabletBackgroundMediaURL")||o("MobileBackgroundMediaURL")||(y=vt("".concat(un(o("BackgroundColor")||"#ffffff",o("BackgroundColorOpacity")||0)),l)),"tablet"!==t&&"mobile"!==t?{backgroundColor:y,backgroundAttachment:o("FixedBackground")?"fixed":void 0,backgroundImage:o("BackgroundMediaURL","url(%s)"),backgroundPosition:vt(o("BackgroundPosition"),s),backgroundRepeat:vt(o("BackgroundRepeat"),d),backgroundSize:o("BackgroundSize")?vt("custom"!==o("BackgroundSize")?o("BackgroundSize"):f,m):void 0,backgroundBlendMode:o("BackgroundImageBlendMode")}:"tablet"===t?{backgroundImage:o("TabletBackgroundMediaURL","url(%s)"),backgroundPosition:vt(o("TabletBackgroundPosition"),s),backgroundRepeat:vt(o("TabletBackgroundRepeat"),d),backgroundSize:o("TabletBackgroundSize")?vt("custom"!==o("TabletBackgroundSize")?o("TabletBackgroundSize"):h,m):void 0}:{backgroundImage:o("MobileBackgroundMediaURL","url(%s)"),backgroundPosition:vt(o("MobileBackgroundPosition"),s),backgroundRepeat:vt(o("MobileBackgroundRepeat"),d),backgroundSize:o("MobileBackgroundSize")?vt("custom"!==o("MobileBackgroundSize")?o("MobileBackgroundSize"):v,m):void 0}},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},o=yt(n,i),r=a.importantBackgroundColor,l=void 0!==r&&r,c=parseInt(o("BackgroundTintStrength","",5)||0,10)/10,s="gradient"===o("BackgroundColorType"),p=un(o("BackgroundColor2")||"#ffffff",0),m=un(o("BackgroundColor")||"#ffffff",0),g="".concat(o("BackgroundGradientLocation1")||"0","%"),d="".concat(o("BackgroundGradientLocation2")||"100","%");return"tablet"!==t&&"mobile"!==t?{backgroundColor:vt(!s&&o("BackgroundColor")?o("BackgroundColor"):void 0,l),backgroundImage:vt(s?"linear-gradient(".concat(o("BackgroundGradientDirection","%sdeg","90deg"),", ").concat(o("BackgroundColor")||p," ").concat(g,", ").concat(o("BackgroundColor2")||m," ").concat(d,")"):void 0,l),opacity:o("BackgroundMediaURL")?c:void 0,mixBlendMode:s?o("BackgroundGradientBlendMode"):void 0}:"tablet"===t?{opacity:o("TabletBackgroundMediaURL")?c:void 0}:{opacity:o("MobileBackgroundMediaURL")?c:void 0}},G=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},a=yt(t,n);return"gradient"===a("BackgroundColorType")||a("BackgroundMediaUrl")||a("TabletBackgroundMediaUrl")||a("MobileBackgroundMediaUrl")},V=function(){var e,t,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return U(n={},".".concat(i),L({},H(a,"desktop",o,r))),U(n,".".concat(i,":before"),L({},W(a,"desktop",o,r))),U(n,"tablet",(U(e={},".".concat(i),L({},H(a,"tablet",o,r))),U(e,".".concat(i,":before"),L({},W(a,"tablet",o,r))),e)),U(n,"mobile",(U(t={},".".concat(i),L({},H(a,"mobile",o,r))),U(t,".".concat(i,":before"),L({},W(a,"mobile",o,r))),t)),n},q=H,K=n(8),J=n.n(K),Y=n(6),X=function(e,t){var n=yt(t.attributes,function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},""),a=n("BackgroundMediaUrl"),i=n("TabletBackgroundMediaUrl"),o=n("MobileBackgroundMediaUrl"),r=J()(["ugb-video-background"],{"ugb--video-hide-tablet":i,"ugb--video-hide-mobile":o}),l=J()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-mobile":o}),c=J()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-tablet":!0});return wp.element.createElement(Y.Fragment,null,ln(a)&&wp.element.createElement("video",{className:r,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:a}),ln(i)&&wp.element.createElement("video",{className:l,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:i}),ln(o)&&wp.element.createElement("video",{className:c,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:o}))};function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Z(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.exclude,a=void 0===n?[]:n,i=t.include,o=void 0===i?[]:i;return y(v(Z({},f(e,{type:"string",default:""},["BorderType","BorderColor"]),{},f(e,{type:"number",default:""},["BorderWidthTop","BorderWidthRight","BorderWidthBottom","BorderWidthLeft","TabletBorderWidthTop","TabletBorderWidthRight","TabletBorderWidthBottom","TabletBorderWidthLeft","MobileBorderWidthTop","MobileBorderWidthRight","MobileBorderWidthBottom","MobileBorderWidthLeft"])),a,e),o,e)},te=ee,ne=n(14),ae=n.n(ne);function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oe=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(e){return Object(u.camelCase)(Object(b.sprintf)(t,e))},o=yt(a,i),r=[];return o("BorderType")?(r.push((ie(e={},n,ht({borderStyle:o("BorderType"),borderColor:o("BorderColor")||"#000000",borderTopWidth:o("BorderWidthTop","%spx")||"1px",borderRightWidth:o("BorderWidthRight","%spx")||"1px",borderBottomWidth:o("BorderWidthBottom","%spx")||"1px",borderLeftWidth:o("BorderWidthLeft","%spx")||"1px"})),ie(e,"tablet",ie({},n,ht({borderTopWidth:o("TabletBorderWidthTop","%spx"),borderRightWidth:o("TabletBorderWidthRight","%spx"),borderBottomWidth:o("TabletBorderWidthBottom","%spx"),borderLeftWidth:o("TabletBorderWidthLeft","%spx")}))),ie(e,"mobile",ie({},n,ht({borderTopWidth:o("MobileBorderWidthTop","%spx"),borderRightWidth:o("MobileBorderWidthRight","%spx"),borderBottomWidth:o("MobileBorderWidthBottom","%spx"),borderLeftWidth:o("MobileBorderWidthLeft","%spx")}))),e)),ae.a.all(r)):r};function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function le(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,a=void 0===n?".ugb-img":n,i=t.exclude,o=void 0===i?[]:i;return v(le({},f(e,{type:"string",default:"",source:"attribute",selector:a,attribute:"src"},["Url"]),{},f(e,{type:"string",default:"",source:"attribute",selector:a,attribute:"alt"},["Alt"]),{},f(e,{type:"string",default:""},["Shape","Size","BlendMode","BackgroundPosition"]),{},f(e,{type:"number",default:""},["Id","Width","Height","TabletWidth","MobileWidth","BorderRadius","Shadow"]),{},f(e,{type:"boolean",default:""},["ShapeStretch","ShapeFlipX","ShapeFlipY","Square","TabletSquare","MobileSquare"]),{},f(e,{type:"string",default:"large"},["Size"])),o,e)},ue=se,be=n(5),pe=n.n(be);function me(){return(me=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1],n=Object(Y.renderToString)(e).replace(/viewbox/,"viewBox").replace(/preserveaspectratio/,"preserveAspectRatio");return t?n.replace(/#/g,"%23"):n};function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function je(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},i=yt(n,a),o=i("Shape"),r=function(e,t){return i(t)&&i(e)?i(e,"%spx"):"auto"};return"tablet"!==t&&"mobile"!==t?{borderRadius:o?void 0:i("BorderRadius","%spx"),width:i("Width","%spx"),height:i("Width")?vt(r("Width","Square")):void 0}:"tablet"===t?{width:i("TabletWidth","%spx"),height:i("TabletWidth")?vt(r("TabletWidth","TabletSquare")):void 0}:{width:i("MobileWidth","%spx"),height:i("MobileWidth")?vt(r("MobileWidth","MobileSquare")):void 0}},Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},a=yt(t,n),i=a("Shape");if(!i)return{};var o=a("ShapeStretch"),r=a("ShapeFlipX"),l=a("ShapeFlipY"),c=xe(i),s=wp.element.createElement(c,{preserveAspectRatio:!["","square"].includes(i)&&o?"none":void 0,transform:r||l?"scale(".concat(r?-1:1,",").concat(l?-1:1,")"):void 0}),p=btoa(we(s));return{"-webkit-mask-image":"url('data:image/svg+xml;base64,".concat(p,"')"),"mask-image":"url('data:image/svg+xml;base64,".concat(p,"')")}},Be=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.inherit,r=void 0===o||o,l=(ke(e={},".".concat(n),je({},Se(t,a,i))),ke(e,"tabletOnly",ke({},".".concat(n),je({},Ee(t,"tablet",a,i)))),ke(e,"mobile",ke({},".".concat(n),je({},Ee(t,"mobile",a,i)))),e);return r?l[".".concat(n)]=je({},l[".".concat(n)],{},Ee(t,"desktop",a,i)):l.desktopTablet=ke({},".".concat(n),je({},Ee(t,"desktop",a,i))),l},Te=n(13),Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{width:e.media_details?e.media_details.width:"",height:e.media_details?e.media_details.height:"",source_url:e.source_url||""}},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?e.media_details&&e.media_details.sizes&&e.media_details.sizes[t]||Pe(e):null};window._stackableCachedImageData={};var Ne=function(e,t){var n=t("core").getMedia,a=e?n(e):null;return a&&void 0!==a.id&&(window._stackableCachedImageData[a.id]=a),a},Me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full",n=Re(e)||Ne(e,Te.select);return n?n.media_details.sizes[t]?n.media_details.sizes[t].source_url:n.source_url:""},Re=function(e){return window._stackableCachedImageData[e]||null};function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function De(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.exclude,a=void 0===n?[]:n;return v(De({},f(e,{type:"string",default:""},["Url","BackgroundPosition","BackgroundRepeat","BackgroundSize"]),{},f(e,{type:"number",default:""},["Id","BackgroundCustomSize"]),{},f(e,{type:"string",default:"large"},["Size"]),{},f(e,{type:"string",default:"px"},["BackgroundCustomSizeUnit"])),a,e)},Le=ze,Ue=function(e){return Object.keys(ze(e))};function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function We(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},i=yt(n,a);return"tablet"!==t&&"mobile"!==t?{backgroundImage:i("Url","url(%s)"),backgroundPosition:vt(i("BackgroundPosition")),backgroundRepeat:vt(i("BackgroundRepeat")),backgroundSize:vt("custom"!==i("BackgroundSize")?i("BackgroundSize"):i("BackgroundCustomSize")?i("BackgroundCustomSize")+i("BackgroundCustomSizeUnit","%s","px"):void 0)}:{}},qe=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Ge(e={},".".concat(n),We({},Ve(t,"desktop",a,i))),Ge(e,"tablet",Ge({},".".concat(n),We({},Ve(t,"tablet",a,i)))),Ge(e,"mobile",Ge({},".".concat(n),We({},Ve(t,"mobile",a,i)))),e};function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Je(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,i=void 0===n?".ugb-button":n,o=t.defaultText,r=void 0===o?Object(b.__)("Button text",a.i18n):o,l=t.exclude,c=void 0===l?[]:l,s=t.include,u=void 0===s?[]:s;return y(v(Je({},k(e),{},f(e,{type:"string",source:"html",selector:"".concat(i," span"),default:r},["Text"]),{},f(e,{type:"string",source:"attribute",selector:i,attribute:"href",default:""},["Url"]),{},f(e,{type:"boolean",source:"attribute",selector:i,attribute:"target",default:""},["NewTab"]),{},f(e,{type:"string",default:""},["Design","Size","Icon","IconPosition","TextColor","BackgroundColorType","BackgroundColor","BackgroundColor2","HoverEffect","HoverTextColor","HoverBackgroundColor","HoverBackgroundColor2"]),{},f(e,{type:"number",default:""},["Opacity","HoverOpacity","PaddingTop","PaddingRight","PaddingBottom","PaddingLeft","BorderRadius","BorderWidth","Shadow","IconSize","IconSpacing","BackgroundGradientDirection","HoverBackgroundGradientDirection"]),{},f(e,{type:"boolean",default:""},["HoverGhostToNormal","NoFollow"])),c,e),u,e)},$e=Xe,Ze=function(e){return Object.keys(Xe(e))};function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function et(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=function(e){return Object(u.camelCase)(Object(b.sprintf)(t,e))},r=yt(a,o,""),l=[];l.push((tt(e={},".".concat(n," .ugb-button--inner"),et({},x(t,"desktop",a))),tt(e,"tablet",tt({},".".concat(n," .ugb-button--inner"),et({},x(t,"tablet",a)))),tt(e,"mobile",tt({},".".concat(n," .ugb-button--inner"),et({},x(t,"mobile",a)))),e));var c=r("BackgroundColor2"),s=r("BackgroundColor"),p=!1;if(""===r("Design")||"basic"===r("Design")){var m;l.push((tt(m={},".".concat(n),{backgroundColor:""!==r("BackgroundColor")?r("BackgroundColor"):void 0,backgroundImage:"gradient"===r("BackgroundColorType")?"linear-gradient(".concat(""!==a[o("BackgroundGradientDirection")]?r("BackgroundGradientDirection","%sdeg","90deg"):"90deg",", ").concat(r("BackgroundColor")||c,", ").concat(r("BackgroundColor2")||s,")"):void 0,paddingTop:""!==r("PaddingTop")?"".concat(r("PaddingTop"),"px"):void 0,paddingRight:""!==r("PaddingRight")?"".concat(r("PaddingRight"),"px"):void 0,paddingBottom:""!==r("PaddingBottom")?"".concat(r("PaddingBottom"),"px"):void 0,paddingLeft:""!==r("PaddingLeft")?"".concat(r("PaddingLeft"),"px"):void 0}),tt(m,".".concat(n," .ugb-button--inner, .").concat(n," svg:not(.ugb-custom-icon)"),{color:vt(ft(r("TextColor"),r("BackgroundColor")))}),tt(m,".".concat(n,":hover .ugb-button--inner, .").concat(n,":hover svg:not(.ugb-custom-icon)"),{color:vt(ft(r("HoverTextColor"),r("HoverBackgroundColor")))}),tt(m,".".concat(n,":hover"),{backgroundColor:""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):void 0}),m)),p=""!==r("HoverBackgroundColor");var g="gradient"===r("BackgroundColorType")&&(r("HoverBackgroundColor")||r("HoverBackgroundColor2")||r("HoverBackgroundGradientDirection"));l.push(tt({},".".concat(n,":before"),{content:g?'""':void 0,backgroundImage:g?"linear-gradient(".concat(r("HoverBackgroundGradientDirection","%sdeg")||r("BackgroundGradientDirection","%sdeg","90deg"),", ").concat(r("HoverBackgroundColor")||r("BackgroundColor")||c,", ").concat(r("HoverBackgroundColor2")||r("BackgroundColor2")||s,")"):void 0})),p=p||g||""!==r("HoverTextColor")}if("ghost"===r("Design")){var d,f;if(l.push((tt(d={},".".concat(n),{borderColor:""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0,borderWidth:""!==r("BorderWidth")?"".concat(r("BorderWidth"),"px"):void 0,paddingTop:""!==r("PaddingTop")?"".concat(r("PaddingTop"),"px"):void 0,paddingRight:""!==r("PaddingRight")?"".concat(r("PaddingRight"),"px"):void 0,paddingBottom:""!==r("PaddingBottom")?"".concat(r("PaddingBottom"),"px"):void 0,paddingLeft:""!==r("PaddingLeft")?"".concat(r("PaddingLeft"),"px"):void 0}),tt(d,".".concat(n," .ugb-button--inner"),{color:""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0}),tt(d,".".concat(n,":hover"),{borderColor:""!==r("HoverBackgroundColor")?vt(r("HoverBackgroundColor")):void 0}),tt(d,".".concat(n,":hover .ugb-button--inner"),{color:""!==r("HoverBackgroundColor")?vt(r("HoverBackgroundColor")):""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0}),d)),""!==r("Icon")||i)l.push((tt(f={},".".concat(n,".ugb-button--has-icon.ugb-button--has-icon svg:not(.ugb-custom-icon)"),{color:""!==r("BackgroundColor")?r("BackgroundColor"):void 0}),tt(f,".".concat(n,".ugb-button--has-icon.ugb-button--has-icon:hover svg:not(.ugb-custom-icon)"),{color:""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):""!==r("BackgroundColor")?r("BackgroundColor"):void 0}),f));p=""!==r("HoverBackgroundColor");var h,v=r("HoverGhostToNormal");if(v)l.push((tt(h={},".".concat(n,":before"),{content:'""',backgroundImage:"linear-gradient(".concat(r("HoverBackgroundGradientDirection","%sdeg","90deg"),", ").concat(r("HoverBackgroundColor")||r("BackgroundColor"),", ").concat(r("HoverBackgroundColor2")||r("HoverBackgroundColor")||r("BackgroundColor"),")"),top:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0,right:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0,bottom:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0,left:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0}),tt(h,".".concat(n,":hover"),{backgroundColor:vt(""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):r("BackgroundColor"))}),tt(h,".".concat(n,":hover .ugb-button--inner"),{color:vt(ft(r("HoverTextColor"),r("HoverBackgroundColor")||r("BackgroundColor")))}),h)),(""!==r("Icon")||i)&&l.push(tt({},".".concat(n,".ugb-button--has-icon.ugb-button--has-icon:hover svg:not(.ugb-custom-icon)"),{color:vt(ft(r("HoverTextColor"),r("HoverBackgroundColor")||r("BackgroundColor")))})),p=!0}if("plain"===r("Design")){var y,O;if(l.push((tt(y={},".".concat(n," .ugb-button--inner"),{color:""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0}),tt(y,".".concat(n,":hover .ugb-button--inner"),{color:""!==r("HoverBackgroundColor")?vt(r("HoverBackgroundColor")):void 0}),y)),""!==r("Icon")||i)l.push((tt(O={},".".concat(n,".ugb-button--has-icon.ugb-button--has-icon svg:not(.ugb-custom-icon)"),{color:""!==r("BackgroundColor")?r("BackgroundColor"):void 0}),tt(O,".".concat(n,".ugb-button--has-icon.ugb-button--has-icon:hover svg:not(.ugb-custom-icon)"),{color:""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):void 0}),O));p=""!==r("HoverBackgroundColor")}if("link"!==r("Design")){var w,_=""!==a[o("IconSpacing")]&&void 0!==a[o("IconSpacing")]?"".concat(r("IconSpacing","%spx",16)):void 0,j=a[o("BorderRadius")];l.push((tt(w={},".".concat(n),{opacity:""!==r("Opacity")?r("Opacity"):void 0,borderRadius:""!==j&&void 0!==j?vt("".concat(j,"px")):void 0}),tt(w,".".concat(n,":before"),{borderRadius:""!==j&&void 0!==j?vt("".concat(j,"px")):void 0}),tt(w,".".concat(n,":hover"),{opacity:""!==r("HoverOpacity")?r("HoverOpacity"):p?1:void 0}),tt(w,".".concat(n,".ugb-button--has-icon.ugb-button--has-icon svg"),{marginLeft:(""!==r("Icon")||i)&&"right"===r("IconPosition")?_:void 0,marginRight:(""!==r("Icon")||i)&&"right"!==r("IconPosition")?_:void 0,width:""!==r("IconSize")||i?"".concat(r("IconSize"),"px"):void 0,height:""!==r("IconSize")||i?"".concat(r("IconSize"),"px"):void 0}),w))}return ae.a.all(l)},at=n(60),it=n.n(at),ot=n(28),rt=n.n(ot);function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ct(e){for(var t=1;t-1))return it()(t);var n=t.match(/--(.*?(?=,))/g);t=n?window.getComputedStyle(document.documentElement).getPropertyValue(n[0])||"#fff":window.getComputedStyle(document.documentElement).getPropertyValue(t.replace("var(","").replace(")",""))||"#fff"}if(t.match(/^rgb/)){var a=rt()(t);a.splice(3,1),t=function(e,t,n){return"#"+[e,t,n].map(function(e){var t=e.toString(16);return 1===t.length?"0"+t:t}).join("")}.apply(void 0,ut(a))}return 3===(t=t.replace(/#/g,"")).length&&(t=t.replace(/(.)(.)(.)/,"$1$1$2$2$3$3")),it()("#".concat(t))}catch(e){return!1}},pt=function(e){return"left"===e||"flex-start"===e?0:"auto"},mt=function(e){return"right"===e||"flex-end"===e?0:"auto"},gt=function(e){return"left"===e?"flex-start":"right"===e?"flex-end":e},dt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=""!==e?e:void 0;return!n&&t&&bt(t)?"#ffffff":n},ft=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#ffffff",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#222222",i=""!==e?e:void 0;return!i&&t?bt(t)?n:a:i},ht=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Object.keys(e).reduce(function(n,a){return ct({},n,st({},a,vt(e[a],t)))},{})},vt=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""!==e&&void 0!==e&&t&&!String(e).match(/!important/i)?"".concat(e," !important"):e},yt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return function(a){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n,r=null!==t?t:function(e){return Object(u.lowerFirst)(e)},l=void 0===e[r(a)]?"":e[r(a)];return""!==l?i?Object(b.sprintf)(i.replace(/%$/,"%%"),l):l:o}},Ot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.min,a=void 0===n?Number.NEGATIVE_INFINITY:n,i=t.max,o=void 0===i?Number.POSITIVE_INFINITY:i;if(""!==e){var r=Object(u.clamp)(e,parseFloat(a),parseFloat(o));if(!isNaN(r))return parseFloat(r)!==parseFloat(e)?r:void 0}},wt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"%s",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"marginBottom",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"%spx",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r="boolean"==typeof o?{important:o}:o,l=r.important,c=void 0!==l&&l,s=r.inherit,u=void 0===s||s,p=r.inheritTabletMax,m=r.inheritTabletMin,g=r.inheritMobileMax,d=r.inheritMobileMin,f=yt(i);if(u){var h,v=f(Object(b.sprintf)(t,""),a),y=f(Object(b.sprintf)(t,"Tablet"),a),O=f(Object(b.sprintf)(t,"Mobile"),a),w=Ot(f(Object(b.sprintf)(t,"")),{min:m,max:p}),_=Ot(f(Object(b.sprintf)(t,"")),{min:d,max:g});return[(h={},st(h,e,st({},n,vt(v,c))),st(h,"tabletOnly",st({},e,st({},n,vt(y||w&&Object(b.sprintf)(a,w),c)))),st(h,"mobile",st({},e,st({},n,vt(O||_&&Object(b.sprintf)(a,_),c)))),h)]}return[{desktopOnly:st({},e,st({},n,vt(f(Object(b.sprintf)(t,""),a),c))),tabletOnly:st({},e,st({},n,vt(f(Object(b.sprintf)(t,"Tablet"),a),c))),mobile:st({},e,st({},n,vt(f(Object(b.sprintf)(t,"Mobile"),a),c)))}]},_t=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"%s",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=yt(a),o=i("contentAlign"),r=i("TabletContentAlign"),l=i("MobileContentAlign"),c=i(Object(b.sprintf)(n,"")),s=i(Object(b.sprintf)(n,"Tablet")),u=i(Object(b.sprintf)(n,"Mobile"));return[(t={},st(t,e,ht({marginLeft:c||o?pt(c||o):void 0,marginRight:c||o?mt(c||o):void 0})),st(t,"tablet",st({},e,ht({marginLeft:s||r?pt(s||r):void 0,marginRight:s||r?mt(s||r):void 0}))),st(t,"mobile",st({},e,ht({marginLeft:u||l?pt(u||l):void 0,marginRight:u||l?mt(u||l):void 0}))),t)]};function jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function kt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,a=void 0===n?".ugb-button-%s":n,i=t.exclude,o=void 0===i?[]:i,r=t.include,l=void 0===r?[]:r,c=Object.keys(At).reduce(function(n,i){return kt({},n,{},f(e,{type:"string",source:"attribute",selector:Object(b.sprintf)(a,i),attribute:"href",default:t["".concat(i,"Default")]?t["".concat(i,"Default")]:""},["".concat(Object(u.upperFirst)(i),"Url")]))},{});return y(v(kt({},$e(e,{exclude:["Text","Url","NoFollow","Icon","IconPosition","NewTab"]}),{},f(e,{type:"boolean",default:""},["NewTab"]),{},f(e,{type:"boolean",default:!0},["UseSocialColors"]),{},c),o,e),l,e)},Et=xt;function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Bt(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=function(e){return Object(u.camelCase)(Object(b.sprintf)(n,e))},r=yt(i,o,""),l=[];if(l.push(Bt({},nt(n,a,i,!0))),!r("UseSocialColors"))return ae.a.all(l);""!==r("Design")&&"basic"!==r("Design")||l.push((Tt(e={},".".concat(a),{backgroundColor:void 0,backgroundImage:void 0}),Tt(e,".".concat(a," .ugb-button--inner, .").concat(a," svg"),{color:void 0}),Tt(e,".".concat(a,":hover .ugb-button--inner, .").concat(a,":hover svg"),{color:void 0}),Tt(e,".".concat(a,":hover"),{backgroundColor:void 0}),Tt(e,".".concat(a,":before"),{content:void 0,backgroundImage:void 0}),e));if("ghost"===r("Design")){var c;l.push((Tt(c={},".".concat(a),{borderColor:void 0}),Tt(c,".".concat(a," .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon svg"),{color:void 0}),Tt(c,".".concat(a,":hover"),{borderColor:void 0}),Tt(c,".".concat(a,":hover .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon:hover svg"),{color:void 0}),c));var s,p=r("HoverGhostToNormal");if(p)l.push((Tt(s={},".".concat(a,":before"),{content:void 0,backgroundImage:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}),Tt(s,".".concat(a,":hover .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon:hover svg"),{color:void 0}),s))}"plain"===r("Design")&&l.push((Tt(t={},".".concat(a," .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon svg"),{color:void 0}),Tt(t,".".concat(a,":hover .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon:hover svg"),{color:void 0}),t));return ae.a.all(l)},At={facebook:{label:Object(b.__)("Facebook",a.i18n),icon:''},twitter:{label:Object(b.__)("Twitter",a.i18n),icon:''},instagram:{label:Object(b.__)("Instagram",a.i18n),icon:''},pinterest:{label:Object(b.__)("Pinterest",a.i18n),icon:''},linkedin:{label:Object(b.__)("LinkedIn",a.i18n),icon:''},youtube:{label:Object(b.__)("YouTube",a.i18n),icon:''},email:{label:Object(b.__)("Email",a.i18n),icon:''}},Nt=n(17);function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Rt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,a=Object(Te.select)("core/block-editor"),i=a.getBlockName,o=a.getSelectedBlockClientId,r=a.getBlockAttributes,l=a.hasMultiSelection,c=a.getMultiSelectedBlockClientIds,b=Object(Te.dispatch)("core/block-editor"),p=b.updateBlockAttributes,m=Object(Te.select)("core/blocks"),g=m.getBlockType;if(n||!l()){var d=n||o();if(d){var f=r(d),h=i(d).replace(/^\w+\//g,""),v=g(i(d)).attributes,y=Object.keys(v).reduce(function(e,t){return Rt({},e,Ft({},t,v[t]?v[t].default:""))},{}),O=Object(S.applyFilters)("stackable.".concat(h,".design.filtered-block-attributes"),Rt({},y,{},t),f),w=Object(S.applyFilters)("stackable.".concat(h,".design.no-text-attributes"),O,f);s(w),p(d,Object(u.omit)(w,["uniqueClass"]))}}else c().forEach(function(n){e(t,n)})};function Ut(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Ht=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Object(Y.useState)(function(){try{var n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return t}}),a=Ut(n,2),i=a[0],o=a[1],r=function(t){try{var n=t instanceof Function?t(i):t;o(n),window.localStorage.setItem(e,JSON.stringify(n))}catch(e){}};return[i,r]},Wt=function(){return void 0!==Nt.registerBlockCollection},Gt=function(){return Wt()};function Vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function qt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,a=void 0===n?".ugb-icon":n,i=t.defaultIcon,o=void 0===i?"fas-cogs":i,r=t.exclude,l=void 0===r?[]:r,c=t.include,s=void 0===c?[]:c;return y(v(qt({},f(e,{type:"string",source:"html",selector:"".concat(a),default:o},["Icon"]),{},f(e,{type:"string",default:""},["Design","ColorType","Color","Color2","BackgroundColorType","BackgroundColor","BackgroundColor2","BackgroundShape","BackgroundShapeColor","Color3","Color4","Color5","Color5","Color6","Color7","Color8","Color9","Color10"]),{},f(e,{type:"number",default:""},["ColorGradientDirection","OutlineWidth","BackgroundColorGradientDirection","Size","TabletSize","MobileSize","BorderRadius","Shadow","Opacity","Padding","Rotation","BackgroundShapeOpacity","BackgroundShapeSize","BackgroundShapeOffsetHorizontal","BackgroundShapeOffsetVertical","MultiOpacity1","MultiOpacity2","MultiOpacity3","MultiOpacity4","MultiOpacity5","MultiOpacity6","MultiOpacity7","MultiOpacity8","MultiOpacity9","MultiOpacity10"]),{},f(e,{type:"boolean",default:""},["ShowBackgroundShape"])),l,e),s,e)},Yt=Jt,Xt=function(e){return Object.keys(Jt(e))};function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zt=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(e){return Object(u.camelCase)(Object(b.sprintf)(t,e))},o=yt(a,i),r=[],l=Ot(o("Size"),{max:200}),c=Ot(o("Size"),{max:200});return r.push(($t(e={},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg"),{width:vt(o("Size","%spx")),height:vt(o("Size","%spx"))}),$t(e,"tabletOnly",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg"),{width:vt(o("TabletSize","%spx")||l&&"".concat(l,"px")),height:vt(o("TabletSize","%spx")||c&&"".concat(c,"px"))})),$t(e,"mobile",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg"),{width:vt(o("MobileSize","%spx")||l&&"".concat(l,"px")),height:vt(o("MobileSize","%spx")||c&&"".concat(c,"px"))})),$t(e,".".concat(n," .ugb-icon-inner-svg"),{color:vt(o("Color")),transform:vt(o("Rotation","rotate(%sdeg)"))}),$t(e,"saveOnly",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg *"),{color:vt(o("Color")),fill:vt(o("Color"))})),$t(e,"editor",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg path, .").concat(n," .ugb-icon-inner-svg svg g, .").concat(n," .ugb-icon-inner-svg svg shape, .").concat(n," .ugb-icon-inner-svg svg circle, .").concat(n," .ugb-icon-inner-svg svg path, .").concat(n," .ugb-icon-inner-svg svg rect, .").concat(n," .ugb-icon-inner-svg svg polygon, .").concat(n," .ugb-icon-inner-svg svg ellipse"),{color:vt(o("Color")),fill:vt(o("Color"))})),$t(e,".".concat(n),{opacity:vt(o("Opacity"))}),e)),"shaped"!==o("Design")&&"outlined"!==o("Design")||r.push($t({},".".concat(n," .ugb-icon__design-wrapper"),{borderRadius:vt(o("BorderRadius","%s%","100%")),padding:vt(o("Padding","%spx"))})),"shaped"===o("Design")&&r.push($t({},".".concat(n," .ugb-icon__design-wrapper"),{background:vt(o("BackgroundColor"))})),"outlined"===o("Design")&&r.push($t({},".".concat(n," .ugb-icon__design-wrapper"),{borderColor:vt(o("BackgroundColor")),borderWidth:vt(o("OutlineWidth","%spx"))})),ae.a.all(Object(S.applyFilters)("stackable.icon-style-set.styles",r,o,n,a))},Qt=function(e){return"string"!=typeof e?0:Object(u.range)(10).reduce(function(t,n){var a=n+1;return new RegExp("(<(circle|ellipse|line|polygon|polyline|rect|shape|path)[^>]*(/>|>[sS]*?)[ \t\r\n\v\f]*){".concat(a,"}"),"gm").test(e)?a:t},0)},en=function(e,t){var n=tn(e,t);return n?n.html[0]:""},tn=function(e,t){return window.FontAwesome?window.FontAwesome.icon({prefix:e,iconName:t}):null},nn=function(){return!!window.FontAwesome},an=function(){return window.FontAwesome?Promise.resolve(!0):new Promise(function(e,t){var n=240,a=setInterval(function(){window.FontAwesome?(clearInterval(a),e(!0)):n--<0&&(clearInterval(a),t(!1))},250)})},on=function(e,t){var n=tn(e,t);return n?Promise.resolve(n):new Promise(function(n,a){var i=240,o=setInterval(function(){var r=tn(e,t);window.FontAwesome?(clearInterval(o),n(r)):i--<0&&(clearInterval(o),a(!1))},250)})};n(25),n(489);n.d(t,"nb",function(){return rn}),n.d(t,"tb",function(){return ln}),n.d(t,"Y",function(){return cn}),n.d(t,"M",function(){return sn}),n.d(t,"ab",function(){return un}),n.d(t,"jb",function(){return bn}),n.d(t,"h",function(){return pn}),n.d(t,"mb",function(){return gn}),n.d(t,"W",function(){return fn}),n.d(t,"pb",function(){return hn}),n.d(t,"cb",function(){return yn}),n.d(t,"ob",function(){return On}),n.d(t,"kb",function(){return wn}),n.d(t,"fb",function(){return l}),n.d(t,"T",function(){return c}),n.d(t,"gb",function(){return s}),n.d(t,"R",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"D",function(){return h}),n.d(t,"C",function(){return O}),n.d(t,"J",function(){return k}),n.d(t,"K",function(){return x}),n.d(t,"I",function(){return C}),n.d(t,"S",function(){return N}),n.d(t,"k",function(){return D}),n.d(t,"j",function(){return I}),n.d(t,"n",function(){return q}),n.d(t,"l",function(){return W}),n.d(t,"m",function(){return V}),n.d(t,"Z",function(){return G}),n.d(t,"L",function(){return X}),n.d(t,"o",function(){return te}),n.d(t,"p",function(){return oe}),n.d(t,"w",function(){return ue}),n.d(t,"B",function(){return Be}),n.d(t,"A",function(){return Se}),n.d(t,"X",function(){return xe}),n.d(t,"U",function(){return Ae}),n.d(t,"f",function(){return Ne}),n.d(t,"V",function(){return Me}),n.d(t,"y",function(){return Le}),n.d(t,"x",function(){return Ue}),n.d(t,"z",function(){return qe}),n.d(t,"r",function(){return $e}),n.d(t,"q",function(){return Ze}),n.d(t,"s",function(){return nt}),n.d(t,"bb",function(){return bt}),n.d(t,"hb",function(){return pt}),n.d(t,"ib",function(){return mt}),n.d(t,"eb",function(){return gt}),n.d(t,"vb",function(){return dt}),n.d(t,"wb",function(){return ft}),n.d(t,"d",function(){return ht}),n.d(t,"c",function(){return vt}),n.d(t,"b",function(){return yt}),n.d(t,"g",function(){return Ot}),n.d(t,"F",function(){return wt}),n.d(t,"E",function(){return _t}),n.d(t,"G",function(){return Et}),n.d(t,"H",function(){return Pt}),n.d(t,"a",function(){return At}),n.d(t,"db",function(){return zt}),n.d(t,"e",function(){return Lt}),n.d(t,"sb",function(){return we}),n.d(t,"ub",function(){return Ht}),n.d(t,"qb",function(){return Wt}),n.d(t,"rb",function(){return Gt}),n.d(t,"u",function(){return Yt}),n.d(t,"t",function(){return Xt}),n.d(t,"v",function(){return Zt}),n.d(t,"lb",function(){return Qt}),n.d(t,"O",function(){return en}),n.d(t,"Q",function(){return nn}),n.d(t,"N",function(){return an}),n.d(t,"P",function(){return on});var rn=function(e,t){return Array.from({length:t-e},function(t,n){return n+e})},ln=function(e){return e.match(/(mp4|webm|ogg)$/i)},cn=function(e){var t="";return(t=(e.match(/youtube\.com\/watch\?v=([^\&\?\/]+)/i)||[])[1])||(t=(e.match(/youtube\.com\/embed\/([^\&\?\/]+)/i)||[])[1]),t||(t=(e.match(/youtube\.com\/v\/([^\&\?\/]+)/i)||[])[1]),t||(t=(e.match(/youtu\.be\/([^\&\?\/]+)/i)||[])[1]),t?{type:"youtube",id:t}:((t=(e.match(/vimeo\.com\/(\w*\/)*(\d+)/i)||[])[2])||(t=(e.match(/^\d+$/i)||[])[0]),t?{type:"vimeo",id:t}:{type:"youtube",id:e})},sn=function e(t){return"short"===t?Object(b.__)("Description for this block. You can use this space for describing your block.",a.i18n):"medium"===t?"".concat(e()," ").concat(e("short")):"long"===t?"".concat(e("medium")," ").concat(e()," ").concat(e("short")):Object(b.__)("Description for this block. Use this space for describing your block. Any text will do.",a.i18n)},un=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Object(S.applyFilters)("stackable.util.hex-to-rgba",null,e,t);if(n)return n;var a=Object(S.applyFilters)("stackable.util.hex-to-rgba.hex",e,t);if(a.indexOf("var(")>-1){var i=a.match(/--(.*?(?=,))/g);a=i?window.getComputedStyle(document.documentElement).getPropertyValue(i[0])||"#fff":window.getComputedStyle(document.documentElement).getPropertyValue(a.replace("var(","").replace(")",""))||"#fff"}(a=a.replace(/#/,"")).length<=4&&(a=a.replace(/#?(.)(.)(.)/,"$1$1$2$2$3$3"));var o=rt()("#".concat(a,"ff"));return o[3]=null!==t?t:1,"rgba(".concat(o.join(", "),")")},bn=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.replace(/\/\*.*?\*\//g,"").replace(/\n\s*\n/g,"").replace(/[\n\r \t]/g," ").replace(/ +/g," ").replace(/ ?([,:;{}]) ?/g,"$1").replace(/[^\}\{]+\{\}/g,"").replace(/[^\}\{]+\{\}/g,"").replace(/;}/g,"}").trim();return t?n.replace(/\s?\!important/g,"").replace(/([;\}])/g," !important$1").replace(/\} !important\}/g,"}}").trim():n},pn=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(e||"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/(.*)?\n/g,"").replace(/([^}]+)({)/g,function(e,i,o){if(i.match(/@\w+/g))return i.replace(/(@\w+[^{]+{\s*)([^{]+)/g,function(e,a,i){var r=gn(i,t,n);return"".concat(a," ").concat(r," ").concat(o)});var r=gn(i,t,n);return(a?"#editor ":"")+"".concat(r," ").concat(o)}).trim()},mn={},gn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i="".concat(e,"-").concat(t,"-").concat(n,"-").concat(a);if(mn[i])return mn[i];var o=e.trim().replace(/[\n\s\t]+/g," ").split(",").map(function(e){var i="";return i=n&&t?e.includes(n)?e:n&&!t?".".concat(n," ").concat(e.trim()):".".concat(n," ").concat(e.trim()).replace(new RegExp("(.".concat(n,") (.").concat(t,"(#|:|\\[|\\.|\\s|$))"),"g"),"$1$2"):e,a?"".concat(a," ").concat(i):i}).join(", ");return mn[i]=o,o},dn="desktop",fn=function(){return dn},hn=function(e){return dn=e},vn=!1,yn=function(){return vn},On=function(e){return vn=e},wn=function(e,t,n){return e.splice(t1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[n(t)];return 0===i?i:i||a},r=Object.keys(i.a).reduce(function(e,i){var r;return p({},e,(m(r={},"".concat(i,"Url"),a("".concat(i,"Url"))),m(r,"onChange".concat(Object(o.upperFirst)(i),"Url"),function(e){return t(m({},n("".concat(i,"Url")),e))}),r))},{});return wp.element.createElement(j,u({design:a("Design",e.designDefault),size:a("Size","normal"),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),useSocialColors:a("UseSocialColors"),newTab:a("NewTab"),onChangeNewTab:function(e){return t(m({},n("NewTab"),e))},isSelected:e.isSelected},r,e))};g.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(g.Content=function(e){var t=function(t){return Object(o.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[t(n)];return 0===i?i:i||a},a=Object.keys(i.a).reduce(function(e,t){return p({},e,m({},"".concat(t,"Url"),n("".concat(t,"Url"))))},{});return wp.element.createElement(j.Content,u({design:n("Design",e.designDefault),size:n("Size","normal"),newTab:n("NewTab"),hoverEffect:n("HoverEffect"),useSocialColors:n("UseSocialColors"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow")},a,e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};var d=g;function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function h(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Te=function(e){var t=e.imageSizes,n=e.value,a=e.className,i=Be(e,["imageSizes","value","className"]),r=function(e){return Object(o.map)(e,function(e){var t=e.name;return{value:e.slug,label:t}})}(t);return Object(o.isEmpty)(r)?null:wp.element.createElement(P.SelectControl,Se({},i,{value:n||"large",options:r,className:l()(a,["ugb--help-tip-image-size"])}))};Te.defaultProps={className:"",label:Object(s.__)("Image Size"),value:"large",imageSizes:[],onChange:function(){}};var Pe=Object(q.compose)([Object(Ce.withSelect)(function(e){return{imageSizes:e("core/block-editor").getSettings().imageSizes}})])(Te),Ae=function(e){var t=e.label,n=e.setAttributes,a=e.enablePaddingTop,i=e.enablePaddingRight,o=e.enablePaddingBottom,r=e.enablePaddingLeft,l=e.attributes,s=l.columnPaddingTop,u=void 0===s?"":s,b=l.columnPaddingBottom,p=void 0===b?"":b,m=l.columnPaddingRight,g=void 0===m?"":m,d=l.columnPaddingLeft,f=void 0===d?"":d,h=l.columnPaddingUnit,v=void 0===h?"px":h,y=l.tabletColumnPaddingTop,O=void 0===y?"":y,w=l.tabletColumnPaddingBottom,_=void 0===w?"":w,j=l.tabletColumnPaddingRight,k=void 0===j?"":j,C=l.tabletColumnPaddingLeft,x=void 0===C?"":C,E=l.tabletColumnPaddingUnit,S=void 0===E?"px":E,B=l.mobileColumnPaddingTop,T=void 0===B?"":B,P=l.mobileColumnPaddingBottom,A=void 0===P?"":P,N=l.mobileColumnPaddingRight,M=void 0===N?"":N,R=l.mobileColumnPaddingLeft,F=void 0===R?"":R,D=l.mobileColumnPaddingUnit,I=void 0===D?"px":D;return wp.element.createElement(c.Fragment,null,wp.element.createElement(ur,{label:t,className:"ugb--help-tip-advanced-column-paddings",defaultLocked:!0,min:[0,0,0],max:[500,30,100],step:1,valueDesktop:{top:u,right:g,bottom:p,left:f},valueDesktopUnit:v,onChangeDesktop:function(e){n({columnPaddingTop:e.top,columnPaddingRight:e.right,columnPaddingBottom:e.bottom,columnPaddingLeft:e.left})},onChangeDesktopUnit:function(e){return n({columnPaddingUnit:e})},valueTablet:{top:O,right:_,bottom:k,left:x},valueTabletUnit:S,onChangeTablet:function(e){n({tabletColumnPaddingTop:e.top,tabletColumnPaddingBottom:e.right,tabletColumnPaddingRight:e.bottom,tabletColumnPaddingLeft:e.left})},onChangeTabletUnit:function(e){return n({tabletColumnPaddingUnit:e})},valueMobile:{top:T,right:A,bottom:M,left:F},valueMobileUnit:I,onChangeMobile:function(e){n({mobileColumnPaddingTop:e.top,mobileColumnPaddingBottom:e.right,mobileColumnPaddingRight:e.bottom,mobileColumnPaddingLeft:e.left})},onChangeMobileUnit:function(e){return n({mobileColumnPaddingUnit:e})},enableTop:a,enableRight:i,enableBottom:o,enableLeft:r}))};Ae.defaultProps={setAttributes:function(){},label:Object(s.__)("Column Paddings",I.i18n),attributes:{},enablePaddingTop:!0,enablePaddingRight:!0,enablePaddingBottom:!0,enablePaddingLeft:!0};var Ne=Ae;function Me(){return(Me=Object.assign||function(e){for(var t=1;t1&&this.props.screens.map(function(t,n){return n>0&&!e.state.isScreenPickerOpen&&!e.state.isMouseOver?null:wp.element.createElement("div",{key:n},wp.element.createElement(P.Button,{className:e.state.screen===t?"is-active":"",onClick:function(){return e.onChangeScreen(t)},icon:Je[t],showTooltip:!1,label:Ye[t],"data-screen":t,onMouseEnter:function(){return e.setState({isMouseOver:t})},onMouseLeave:function(){return e.setState({isMouseOver:!1})}}),e.state.isMouseOver===t&&wp.element.createElement(P.Popover,{focusOnMount:!1,position:"bottom center",className:"components-tooltip","aria-hidden":"true"},Ye[t]))}))}}])&&Ge(n.prototype,a),o&&Ge(n,o),t}();Xe.defaultProps={screens:["desktop"],onChangeScreen:function(){}};var $e=Object(q.withInstanceId)(Xe),Ze=function(e){return wp.element.createElement("div",{className:"ugb-base-control-multi-label"},wp.element.createElement("div",{className:"ugb-base-control-multi-label__label components-base-control__label"},e.label),wp.element.createElement($e,{screens:e.screens,onChangeScreen:e.onChangeScreen}),wp.element.createElement("div",{className:"ugb-base-control-multi-label__units"},e.units.length>1&&e.units.map(function(t,n){return wp.element.createElement("button",{key:n,className:e.unit===t?"is-active":"",onClick:function(){return e.onChangeUnit(t)}},t)}),e.afterButton))};Ze.defaultProps={label:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],onChangeScreen:function(){},afterButton:null};var Qe=Ze;function et(){return(et=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var at=!!P.__experimentalNumberControl,it=function(e){var t=e.allowReset,n=e.withInputField,a=e.isShiftStepEnabled,i=nt(e,["allowReset","withInputField","isShiftStepEnabled"]),r=tt(Object(c.useState)(""===e.value||isNaN(e.value)?"":e.value),2),u=r[0],b=r[1],p=function(t){if(b(t),!isNaN(t)){var n=parseFloat(t);if(!isNaN(n))return void e.onChange(Object(o.clamp)(n,e.min,e.max))}e.onChange(e.resetFallbackValue)},m=l()(["ugb-range-control",e.className],{"ugb-range-control--blank":""===u}),g=""===u,d=e.initialPosition||e.placeholder||"",f=function(e,t,n){var a=(e-t)/(n-t)*100;return"".concat(Object(o.clamp)(a,0,100),"%")}((g?d:u)||e.sliderMin||e.min||0,e.sliderMin||e.min||0,e.sliderMax||e.max||100);return wp.element.createElement("div",{className:m,style:{"--ugb-advanced-range-control--width":f}},wp.element.createElement(P.RangeControl,et({},i,{initialPosition:"",onChange:p,withInputField:!1,allowReset:!1,max:null!==e.sliderMax?e.sliderMax:e.max,min:null!==e.sliderMin?e.sliderMin:e.min})),n&&at&&wp.element.createElement(P.__experimentalNumberControl,{disabled:e.disabled,isShiftStepEnabled:a,max:e.max,min:e.min,onChange:p,onBlur:function(){if(!isNaN(u)){var t=parseFloat(u);if(!isNaN(t))return void b(Object(o.clamp)(t,e.min,e.max))}b(e.resetFallbackValue)},shiftStep:e.shiftStep,step:e.step,value:u,placeholder:null!==e.placeholder?e.placeholder:d}),t&&wp.element.createElement(P.Button,{className:"components-range-control__reset",disabled:e.disabled,isSecondary:!0,isSmall:!0,onClick:function(){b(e.resetFallbackValue),e.onChange(e.resetFallbackValue)}},Object(s.__)("Reset",I.i18n)))};it.defaultProps={className:"",allowReset:!1,withInputField:!0,isShiftStepEnabled:!0,max:1/0,min:-1/0,sliderMax:null,sliderMin:null,shiftStep:10,step:1,resetFallbackValue:"",placeholder:null,initialPosition:0,onChange:function(){}};var ot=it;function rt(e){return(rt="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 lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var st=function(e){var t=function(e){for(var t=1;t0});return a.length?a[0].options[0].label:e},jt=function(e){return e.value},kt=function(e){return wp.element.createElement("div",{className:"ugb--autosuggest-group"},e.title)},Ct=function(e){return e.options},xt=function(){return!0},Et=function(e){function t(){var e,n,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(e=!(a=ht(t).apply(this,arguments))||"object"!==Ot(a)&&"function"!=typeof a?vt(n):a).state={value:e.props.value,label:e.props.value?_t(e.props.value,e.props.options):e.props.value,suggestions:[],isEmpty:!1},e.onSuggestionsFetchRequested=e.onSuggestionsFetchRequested.bind(vt(e)),e.onSuggestionsClearRequested=e.onSuggestionsClearRequested.bind(vt(e)),e.onChange=e.onChange.bind(vt(e)),e.onFocus=e.onFocus.bind(vt(e)),e.autosuggestDiv=Object(c.createRef)(),e}var n,a,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yt(e,t)}(t,c["Component"]),n=t,(a=[{key:"onChange",value:function(e,t){var n=t.newValue;this.props.onChange(n),this.setState({value:n,label:_t(n,this.props.options)})}},{key:"onFocus",value:function(){var e=this;this.props.highlightValueOnFocus&&setTimeout(function(){var t=e.autosuggestDiv.current.querySelector('[data-value="'.concat(e.state.value,'"]'));t&&t.scrollIntoView()},0)}},{key:"onSuggestionsFetchRequested",value:function(e){var t=e.value,n=e.reason;if("input-focused"!==n&&"suggestion-selected"!==n){var a=function(e,t){var n=e.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!n)return t;var a=new RegExp(n,"i");return wt(t)?t.map(function(e){return{title:e.title,options:e.options.filter(function(e){return a.test(e.label)||a.test(e.value)})}}).filter(function(e){return e.options.length>0}):t.filter(function(e){return a.test(e.label)||a.test(e.value)})}(t,this.props.options);this.setState({suggestions:a,isEmpty:""!==t.trim()&&0===a.length})}else this.setState({suggestions:this.props.options,isEmpty:!1})}},{key:"onSuggestionsClearRequested",value:function(){this.setState({suggestions:[]})}},{key:"render",value:function(){var e=this,t=this.state,n=t.label,a=t.suggestions,i={placeholder:"",value:n,onChange:this.onChange,onFocus:this.onFocus,type:"search"};return wp.element.createElement(P.BaseControl,{help:this.props.help,className:l()("ugb-advanced-autosuggest-control",this.props.className)},wp.element.createElement(Qe,{label:this.props.label,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-advanced-autosuggest-control__select",ref:this.autosuggestDiv},wp.element.createElement(dt.a,{multiSection:wt(this.props.options),suggestions:a,focusInputOnSuggestionClick:!1,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:jt,renderSuggestion:function(t){return wp.element.createElement("div",{className:"ugb-autosuggest-option","data-value":t.value,id:"ugb-autosuggest-option--".concat(t.id||Object(o.kebabCase)(t.value))},e.props.renderOption?e.props.renderOption(t):t.label)},renderSectionTitle:kt,getSectionSuggestions:Ct,shouldRenderSuggestions:xt,inputProps:i}),this.state.isEmpty&&wp.element.createElement("div",{className:"ugb--autosuggest-empty"},this.props.noMatchesLabel),this.props.children))}}])&&ft(n.prototype,a),i&&ft(n,i),t}();Et.defaultProps={onChange:function(){},help:"",className:"",screens:["desktop"],options:[],value:"",noMatchesLabel:Object(s.__)("No matches found",I.i18n),renderOption:null,highlightValueOnFocus:!1};var St=Et;function Bt(){return(Bt=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?1:Math.round(parseFloat(e)/parseFloat(t)*10)/10};return"string"==typeof t&&(t=[t,n(t)]),wp.element.createElement(ut,on({},e,{placeholder:t,onChangeUnit:function(t){""!==e.value&&("em"===t||"rem"===t?e.onChange(n(e.value)):"px"===t&&e.onChange(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?21:Math.round(parseFloat(e)*t)}(e.value))),e.onChangeUnit(t)}}))};rn.defaultProps={label:Object(s.__)("Font Size",I.i18n),value:"",onChange:function(){},unit:"px",onChangeUnit:function(){},min:[0,0],max:[150,7],step:[1,.05],units:["px","em"],placeholder:""};var ln=rn;function cn(){return(cn=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var dn=Object(pn.a)(function(e){var t=e.children;return wp.element.createElement("div",{className:"ugb-sort-control__container"},t)}),fn=Object(pn.b)(function(e){var t=e.value,n=(e.key,e.index,gn(e,["value","key","index"]));return wp.element.createElement("div",mn({className:"ugb-sort-control__item"},n),t)}),hn=!1,vn=function e(t){for(var n=t.values?t.values.splice(0,t.num):Object(o.range)(t.num).map(function(e){return e+1});n.length=4?0:this.state.slide+1;this.setState({slide:e})}},{key:"prev",value:function(){var e=this.state.slide<=0?4:this.state.slide-1;this.setState({slide:e})}},{key:"render",value:function(){var e=this.props.tag;return wp.element.createElement(e,null,wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=".concat(this.props.buttonUtmSource,"&utm_campaign=learnmore&utm_medium=gutenberg"),target:"_premium",onClick:this.open,className:this.props.buttonClassName},this.props.button),this.state.isOpen&&wp.element.createElement(P.Modal,{className:"ugb-pro-modal",onRequestClose:this.close},wp.element.createElement("img",{src:"https://da4bu55kgdxvv.cloudfront.net/premium-popup.jpg",alt:Object(s.__)("Premium features",I.i18n)}),wp.element.createElement("div",{className:"ugb-pro-modal__footer"},wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=editor-modal-popup&utm_campaign=upgrade&utm_medium=gutenberg",className:"button button-secondary",target:"_premium",title:Object(s.__)("Upgrade to Premium",I.i18n)},wp.element.createElement(Vn.x,null),Object(s.__)("Upgrade to Premium",I.i18n)),wp.element.createElement("a",{href:"https://demo.wpstackable.com?utm_source=editor-modal-popup&utm_campaign=trydemo&utm_medium=gutenberg",target:"_premium",title:Object(s.__)("Try Premium Demo",I.i18n)},Object(s.__)("Try Premium Demo",I.i18n)))))}}])&&Kn(n.prototype,a),i&&Kn(n,i),t}();$n.defaultProps={button:Object(s.__)("Learn More",I.i18n),buttonClassName:"button button-secondary",tag:"div",buttonUtmSource:"editor-learn-more"};var Zn=$n;function Qn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ea=function(e){var t,n,a,i=e.designId,o=e.image,r=e.label,s=e.onClick,u=e.plan,b=e.isPro,p=Qn(Object(c.useState)(!1),2),m=p[0],g=p[1],d=Qn(Object(c.useState)(!1),2),f=d[0],h=d[1],v=l()(["ugb-design-library-item"],(t={"ugb--is-busy":m},n="ugb--is-".concat(u),a=!b&&"free"!==u,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement("div",{className:v,onMouseEnter:function(){return h(!0)},onMouseLeave:function(){return h(!1)}},m&&wp.element.createElement("span",{className:"ugb-design-library-item__spinner","data-testid":"spinner"},wp.element.createElement(P.Spinner,null)),!b&&"free"!==u&&wp.element.createElement("span",{className:"ugb-design-library-item__premium","data-testid":"premium-tag"},u),wp.element.createElement("button",{className:"ugb-design-library-item__image",onClick:function(){(b||"free"===u)&&(g(!0),Object(Un.b)(i).then(function(e){g(!1),s(e)}))}},!b&&"free"!==u&&wp.element.createElement(P.Dashicon,{icon:"lock"}),wp.element.createElement("img",{src:o,alt:r,loading:"lazy"})),wp.element.createElement("footer",null,(b||"free"===u)&&wp.element.createElement("span",null,r),!b&&"free"!==u&&!f&&wp.element.createElement("span",null,r),!b&&"free"!==u&&f&&wp.element.createElement(Zn,{buttonClassName:"ugb-design-library-item__premium-link",button:wp.element.createElement(c.Fragment,null,e.premiumLabel)})))};ea.defaultProps={designId:"",image:"",label:"",onClick:function(){},plan:"free",isPro:I.isPro,premiumLabel:Object(s.__)("Go Premium",I.i18n)};var ta=ea;var na=function(e){var t,n,a,i=e.designs,o=e.isBusy,r=e.onSelect,c=l()(["ugb-design-library-items"],(t={},n="ugb-design-library-items--columns-".concat(e.columns),a=!o&&e.columns,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement("div",{className:c},(i||[]).map(function(e,t){return wp.element.createElement(ta,{key:t,type:e.type,block:e.block,template:e.template,plan:e.plan,designId:e.id,image:e.image,label:e.label,onClick:function(e){r(e)}})}),o&&wp.element.createElement("div",{className:"ugb-design-library-search__spinner","data-testid":"spinner"},wp.element.createElement(P.Spinner,null)),!o&&!(i||[]).length&&wp.element.createElement("p",{className:"components-base-control__help","data-testid":"nothing-found-note"},Object(s.__)("No designs found",I.i18n)))};na.defaultProps={designs:[],columns:1,onSelect:function(){},isBusy:!1};var aa=na;n(413);function ia(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function oa(e){for(var t=1;t0&&void 0!==o[0]?o[0]:"icon",n=o.length>1&&void 0!==o[1]?o[1]:I.fontAwesomeSearchProIcons,a='{ search(version: "latest", first: 50, query: "'.concat((t||"info").replace(/["'\\]/g,""),'") {\n\t\t\tid\n\t\t\tmembership {\n\t\t\t\tfree\n\t\t\t\t').concat(n?"pro":"","\n\t\t\t}\n\t\t} }"),e.next=5,fetch("https://api.fontawesome.com",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:a})}).then(function(e){return e.json()});case 5:return i=e.sent,e.abrupt("return",i.data.search.reduce(function(e,t){return vi(t,n).forEach(function(t){e.push(t)}),e},[]));case 7:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments;return new Promise(function(a,i){var o=e.apply(t,n);function r(e){fi(o,a,i,r,l,"next",e)}function l(e){fi(o,a,i,r,l,"throw",e)}r(void 0)})});return function(){return t.apply(this,arguments)}}(),vi=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[].concat(di(e.membership.free),di(t?e.membership.pro.filter(function(t){return!e.membership.free.includes(t)}):[]));return n.map(function(t){return{className:"fa".concat(t[0]," fa-").concat(e.id),prefix:"fa".concat(t[0]),iconName:e.id}})},yi=n(105);function Oi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var wi=null,_i=null,ji=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ugb-custom-icon";return e.match(/(]*class=["'])/)?e.replace(/(]*class=["'])/,"$1".concat(t," ")):e.match(/()([\s\S]*)/g,"$1"),n=0;n<2;n++)t=t.replace(/\s*([\s\S]*?)<\/g>\s*/gm,"$1");return t},Ci=function(e){var t=Oi(Object(c.useState)(""),2),n=t[0],a=t[1],o=Oi(Object(c.useState)([]),2),r=o[0],u=o[1],b=Oi(Object(c.useState)(!1),2),p=b[0],m=b[1],g=Oi(Object(c.useState)(!1),2),d=g[0],f=g[1],h=e.returnSVGValue;Object(c.useEffect)(function(){var e=!0;return clearTimeout(wi),wi=setTimeout(function(){e&&(m(!0),hi(n).then(function(t){e&&u(t)}).finally(function(){e&&m(!1)}))},500),function(){e=!1,clearTimeout(wi)}},[n]),Object(c.useEffect)(function(){_i||(_i=wp.data.select("core/block-editor").getSettings().mediaUpload),d?wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:null}):wp.data.select("core/block-editor").getSettings().mediaUpload!==_i&&wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:_i})},[d]);var v=l()(["ugb-icon-popover__label-container"],{"ugb-icon--has-settings":I.isPro,"ugb-icon--has-upload":h,"ugb-icon--has-reset":e.allowReset});return wp.element.createElement(P.Popover,{className:"ugb-icon-popover",onClose:e.onClose,onClickOutside:e.onClickOutside,position:e.position,anchorRef:e.anchorRef},wp.element.createElement(P.PanelBody,null,wp.element.createElement(yi.FileDrop,{onFrameDragEnter:function(){return f(!0)},onFrameDragLeave:function(){return f(!1)},onFrameDrop:function(){return f(!1)},onDrop:function(t){if(h&&t.length)if("image/svg+xml"===t[0].type){var n=new FileReader;n.onload=function(t){f(!1);var n=ki(ji(t.target.result));e.onChange(n),e.onClose()},n.readAsText(t[0])}else f(!1);else f(!1)}},wp.element.createElement("div",{className:v},wp.element.createElement(P.TextControl,{className:"ugb-icon-popover__input",value:n,onChange:a,placeholder:Object(s.__)("Type to search icon",I.i18n)}),I.isPro&&wp.element.createElement(P.Button,{className:"ugb-icon-popover__settings-button",icon:"admin-generic",href:I.settingsUrl+"#icon-settings",target:"_settings",iconSize:"16",label:Object(s.__)("Icon Settings",I.i18n),showTooltip:!0,isSmall:!0,isSecondary:!0}),h&&wp.element.createElement(P.Button,{onClick:function(t){t.preventDefault();var n=document.createElement("input");n.accept="image/svg+xml",n.type="file",n.onchange=function(t){var n=t.target.files;if(n.length){var a=new FileReader;a.onload=function(t){f(!1);var n=ki(ji(t.target.result));e.onChange(n),e.onClose()},a.readAsText(n[0])}else f(!1)},n.click()},isSmall:!0,isPrimary:!0,className:"components-range-control__upload"},Object(s.__)("Upload SVG",I.i18n)),e.allowReset&&wp.element.createElement(P.Button,{onClick:function(){e.onChange(""),e.onClose()},isSmall:!0,isSecondary:!0,className:"components-range-control__reset"},Object(s.__)("Clear icon",I.i18n))),wp.element.createElement("div",{className:"ugb-icon-popover__iconlist"},p&&wp.element.createElement(P.Spinner,null),!p&&r.map(function(t,n){var a=t.prefix,o=t.iconName,r="".concat(a,"-").concat(o);return wp.element.createElement("button",{key:n,className:"components-button ugb-prefix--".concat(a," ugb-icon--").concat(o),onClick:function(){e.returnSVGValue?e.onChange(ki(Object(i.O)(a,o))):e.onChange(r,a,o),e.onClose()}},wp.element.createElement(gg,{prefix:a,iconName:o}))}),!p&&!r.length&&wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("No matches found",I.i18n))),h&&d&&wp.element.createElement("div",{className:"ugb-icon-popover__drop-indicator"},wp.element.createElement(gi,{height:"40",width:"40"}),Object(s.__)("Drop your SVG here",I.i18n)))))};Ci.defaultProps={onChange:function(){},onClose:function(){},onClickOutside:function(){},returnSVGValue:!0,allowReset:!0,anchorRef:void 0,position:"center"};var xi=Ci,Ei=function(e){return wp.element.createElement(ps,{attrNameTemplate:"%sContentAlign",setAttributes:e.setAttributes,blockAttributes:e.blockAttributes},wp.element.createElement(Vs,{label:e.label,className:l()([e.className,"ugb--help-tip-alignment-all"])}))};Ei.defaultProps={className:"",setAttributes:function(){},blockAttributes:{},label:Object(s.__)("Align",I.i18n)};var Si=Ei,Bi=function(){return wp.element.createElement("hr",{className:"ugb-control-separator"})};function Ti(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Pi=function(e){var t=e.color||"transparent";if(Array.isArray(t)){var n=Ti(t,2),a=n[0],i=n[1];t="linear-gradient(90deg, ".concat(a||"transparent",", ").concat(i||"transparent",")")}var o=l()(["components-circular-option-picker__option-wrapper","ugb-button-icon-popover-control-color-preview"],{"ugb-button-icon-popover-control-color-preview--transparent":!t||"transparent"===t});return wp.element.createElement(c.Fragment,null,wp.element.createElement("div",{className:o},wp.element.createElement(P.Button,{className:"components-circular-option-picker__option",label:Object(s.__)("Selected color",I.i18n),style:{background:t},onClick:e.onClick,ref:e._ref}),e.children))};Pi.defaultProps={color:"",onClick:function(){},_ref:null};var Ai=Pi;function Ni(){return(Ni=Object.assign||function(e){for(var t=1;t0)&&wp.element.createElement(P.ToggleControl,{label:Object(s.__)("Fixed Background",I.i18n),checked:e.fixedBackground,onChange:e.onChangeFixedBackground,className:"ugb--help-tip-background-fixed"}),e.hasAdvancedBackground&&e.onChangeBackgroundMedia&&(e.backgroundMediaURL||e.tabletBackgroundMediaURL||e.mobileBackgroundMediaURL)&&wp.element.createElement(Yi,{label:Object(s.__)("Adv. Background Image Settings",I.i18n),onReset:e.onResetAdvancedBackground,allowReset:e.backgroundPosition||e.tabletBackgroundPosition||e.mobileBackgroundPosition||e.backgroundRepeat||e.tabletBackgroundRepeat||e.mobileBackgroundRepeat||e.backgroundSize||e.tabletBackgroundSize||e.mobileBackgroundSize||e.backgroundImageBlendMode},wp.element.createElement(ys,null,wp.element.createElement(pt,{label:Object(s.__)("Image Position",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("Top Left",I.i18n),value:"top left"},{label:Object(s.__)("Top Center",I.i18n),value:"top center"},{label:Object(s.__)("Top Right",I.i18n),value:"top right"},{label:Object(s.__)("Center Left",I.i18n),value:"center left"},{label:Object(s.__)("Center Center",I.i18n),value:"center center"},{label:Object(s.__)("Center Right",I.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",I.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",I.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",I.i18n),value:"bottom right"}],value:e.backgroundPosition,onChange:e.onChangeBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(ys,{screen:"tablet"},wp.element.createElement(pt,{label:Object(s.__)("Image Position",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("Top Left",I.i18n),value:"top left"},{label:Object(s.__)("Top Center",I.i18n),value:"top center"},{label:Object(s.__)("Top Right",I.i18n),value:"top right"},{label:Object(s.__)("Center Left",I.i18n),value:"center left"},{label:Object(s.__)("Center Center",I.i18n),value:"center center"},{label:Object(s.__)("Center Right",I.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",I.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",I.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",I.i18n),value:"bottom right"}],value:e.tabletBackgroundPosition,onChange:e.onChangeTabletBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(ys,{screen:"mobile"},wp.element.createElement(pt,{label:Object(s.__)("Image Position",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("Top Left",I.i18n),value:"top left"},{label:Object(s.__)("Top Center",I.i18n),value:"top center"},{label:Object(s.__)("Top Right",I.i18n),value:"top right"},{label:Object(s.__)("Center Left",I.i18n),value:"center left"},{label:Object(s.__)("Center Center",I.i18n),value:"center center"},{label:Object(s.__)("Center Right",I.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",I.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",I.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",I.i18n),value:"bottom right"}],value:e.mobileBackgroundPosition,onChange:e.onChangeMobileBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(ys,null,wp.element.createElement(pt,{label:Object(s.__)("Image Repeat",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("No-Repeat",I.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",I.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",I.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",I.i18n),value:"repeat-y"}],value:e.backgroundRepeat,onChange:e.onChangeBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(ys,{screen:"tablet"},wp.element.createElement(pt,{label:Object(s.__)("Image Repeat",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("No-Repeat",I.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",I.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",I.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",I.i18n),value:"repeat-y"}],value:e.tabletBackgroundRepeat,onChange:e.onChangeTabletBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(ys,{screen:"mobile"},wp.element.createElement(pt,{label:Object(s.__)("Image Repeat",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("No-Repeat",I.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",I.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",I.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",I.i18n),value:"repeat-y"}],value:e.mobileBackgroundRepeat,onChange:e.onChangeMobileBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(ys,null,wp.element.createElement(pt,{label:Object(s.__)("Image Size",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("Auto",I.i18n),value:"auto"},{label:Object(s.__)("Cover",I.i18n),value:"cover"},{label:Object(s.__)("Contain",I.i18n),value:"contain"},{label:Object(s.__)("Custom",I.i18n),value:"custom"}],value:e.backgroundSize,onChange:e.onChangeBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(ys,{screen:"tablet"},wp.element.createElement(pt,{label:Object(s.__)("Image Size",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("Auto",I.i18n),value:"auto"},{label:Object(s.__)("Cover",I.i18n),value:"cover"},{label:Object(s.__)("Contain",I.i18n),value:"contain"},{label:Object(s.__)("Custom",I.i18n),value:"custom"}],value:e.tabletBackgroundSize,onChange:e.onChangeTabletBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(ys,{screen:"mobile"},wp.element.createElement(pt,{label:Object(s.__)("Image Size",I.i18n),options:[{label:Object(s.__)("Default",I.i18n),value:""},{label:Object(s.__)("Auto",I.i18n),value:"auto"},{label:Object(s.__)("Cover",I.i18n),value:"cover"},{label:Object(s.__)("Contain",I.i18n),value:"contain"},{label:Object(s.__)("Custom",I.i18n),value:"custom"}],value:e.mobileBackgroundSize,onChange:e.onChangeMobileBackgroundSize,className:"ugb--help-tip-background-image-size"})),"custom"===e.backgroundSize&&wp.element.createElement(ys,null,wp.element.createElement(ut,{label:Object(s.__)("Custom Size",I.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.backgroundCustomSizeUnit,onChangeUnit:e.onChangeBackgroundCustomSizeUnit,value:e.backgroundCustomSize,onChange:e.onChangeBackgroundCustomSize,allowReset:!0})),"custom"===e.tabletBackgroundSize&&wp.element.createElement(ys,{screen:"tablet"},wp.element.createElement(ut,{label:Object(s.__)("Custom Size",I.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.tabletBackgroundCustomSizeUnit,onChangeUnit:e.onChangeTabletBackgroundCustomSizeUnit,value:e.tabletBackgroundCustomSize,onChange:e.onChangeTabletBackgroundCustomSize,allowReset:!0})),"custom"===e.mobileBackgroundSize&&wp.element.createElement(ys,{screen:"mobile"},wp.element.createElement(ut,{label:Object(s.__)("Custom Size",I.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.mobileBackgroundCustomSizeUnit,onChangeUnit:e.onChangeMobileBackgroundCustomSizeUnit,value:e.mobileBackgroundCustomSize,onChange:e.onChangeMobileBackgroundCustomSize,allowReset:!0})),e.onChangeBackgroundImageBlendMode&&wp.element.createElement(ne,{label:Object(s.__)("Image Blend Mode",I.i18n),value:e.backgroundImageBlendMode,onChange:e.onChangeBackgroundImageBlendMode})))};fo.defaultProps={backgroundColorType:"",backgroundColor:"",backgroundColorOpacity:"",backgroundColor2:"",backgroundMediaID:"",backgroundMediaURL:"",tabletBackgroundMediaID:"",tabletBackgroundMediaURL:"",mobileBackgroundMediaID:"",mobileBackgroundMediaURL:"",backgroundTintStrength:"",fixedBackground:"",onChangeBackgroundColorType:function(){},onChangeBackgroundColor:function(){},onChangeBackgroundColorOpacity:function(){},onChangeBackgroundColor2:function(){},onChangeBackgroundMedia:function(e){e.url,e.id},onChangeTabletBackgroundMedia:function(e){e.url,e.id},onChangeMobileBackgroundMedia:function(e){e.url,e.id},onChangeBackgroundTintStrength:function(){},onChangeFixedBackground:function(){},labelBackgroundColorType:Object(s.__)("Background Color Type",I.i18n),labelBackgroundColor:Object(s.__)("Background Color",I.i18n),hasAdvancedGradient:!0,backgroundGradientDirection:"",backgroundGradientBlendMode:"",backgroundGradientLocation1:0,backgroundGradientLocation2:100,onResetAdvancedGradient:function(){},onChangeBackgroundGradientDirection:function(){},onChangeBackgroundGradientBlendMode:function(){},onChangeBackgroundGradientLocation1:function(){},onChangeBackgroundGradientLocation2:function(){},hasAdvancedBackground:!0,backgroundMediaAllowVideo:!0,backgroundPosition:"",tabletBackgroundPosition:"",mobileBackgroundPosition:"",backgroundRepeat:"",tabletBackgroundRepeat:"",mobileBackgroundRepeat:"",backgroundSize:"",tabletBackgroundSize:"",mobileBackgroundSize:"",backgroundCustomSize:"",tabletBackgroundCustomSize:"",mobileBackgroundCustomSize:"",backgroundCustomSizeUnit:"%",tabletBackgroundCustomSizeUnit:"%",mobileBackgroundCustomSizeUnit:"%",backgroundImageBlendMode:"",onResetAdvancedBackground:function(){},onChangeBackgroundPosition:function(){},onChangeTabletBackgroundPosition:function(){},onChangeMobileBackgroundPosition:function(){},onChangeBackgroundRepeat:function(){},onChangeTabletBackgroundRepeat:function(){},onChangeMobileBackgroundRepeat:function(){},onChangeBackgroundSize:function(){},onChangeTabletBackgroundSize:function(){},onChangeMobileBackgroundSize:function(){},onChangeBackgroundCustomSize:function(){},onChangeTabletBackgroundCustomSize:function(){},onChangeMobileBackgroundCustomSize:function(){},onChangeBackgroundCustomSizeUnit:function(){},onChangeTabletBackgroundCustomSizeUnit:function(){},onChangeMobileBackgroundCustomSizeUnit:function(){},onChangeBackgroundImageBlendMode:function(){}};var ho=fo;function vo(){return(vo=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[n(t)];return 0===i?i:i||a};return wp.element.createElement(ho,vo({backgroundColorType:e.blockAttributes[n("BackgroundColorType")]||"",backgroundColor:e.blockAttributes[n("BackgroundColor")]||"",backgroundColorOpacity:e.blockAttributes[n("BackgroundColorOpacity")],backgroundColor2:e.blockAttributes[n("BackgroundColor2")]||"",backgroundMediaID:e.blockAttributes[n("BackgroundMediaID")]||"",backgroundMediaURL:e.blockAttributes[n("BackgroundMediaURL")]||"",tabletBackgroundMediaID:e.blockAttributes[n("TabletBackgroundMediaID")]||"",tabletBackgroundMediaURL:e.blockAttributes[n("TabletBackgroundMediaURL")]||"",mobileBackgroundMediaID:e.blockAttributes[n("MobileBackgroundMediaID")]||"",mobileBackgroundMediaURL:e.blockAttributes[n("MobileBackgroundMediaURL")]||"",backgroundTintStrength:e.blockAttributes[n("BackgroundTintStrength")],fixedBackground:e.blockAttributes[n("FixedBackground")]||"",onChangeBackgroundColorType:function(e){return t(yo({},n("BackgroundColorType"),e))},onChangeBackgroundColor:function(e){return t(yo({},n("BackgroundColor"),e))},onChangeBackgroundColorOpacity:function(e){return t(yo({},n("BackgroundColorOpacity"),e))},onChangeBackgroundColor2:function(e){return t(yo({},n("BackgroundColor2"),e))},onChangeBackgroundMedia:function(e){var a,i=e.url,o=e.id;t((yo(a={},n("BackgroundMediaURL"),i),yo(a,n("BackgroundMediaID"),o),a))},onChangeTabletBackgroundMedia:function(e){var a,i=e.url,o=e.id;t((yo(a={},n("TabletBackgroundMediaURL"),i),yo(a,n("TabletBackgroundMediaID"),o),a))},onChangeMobileBackgroundMedia:function(e){var a,i=e.url,o=e.id;t((yo(a={},n("MobileBackgroundMediaURL"),i),yo(a,n("MobileBackgroundMediaID"),o),a))},onChangeBackgroundTintStrength:function(e,a){var i;t((yo(i={},n("BackgroundTintStrength"),e),yo(i,n("BackgroundColor"),a),i))},onChangeFixedBackground:function(e){return t(yo({},n("FixedBackground"),e))},backgroundGradientDirection:a("BackgroundGradientDirection",90),backgroundGradientBlendMode:a("BackgroundGradientBlendMode"),backgroundGradientLocation1:a("BackgroundGradientLocation1",0),backgroundGradientLocation2:a("BackgroundGradientLocation2",100),onChangeBackgroundGradientDirection:function(e){return t(yo({},n("BackgroundGradientDirection"),e))},onChangeBackgroundGradientBlendMode:function(e){return t(yo({},n("BackgroundGradientBlendMode"),e))},onChangeBackgroundGradientLocation1:function(e){return t(yo({},n("BackgroundGradientLocation1"),e))},onChangeBackgroundGradientLocation2:function(e){return t(yo({},n("BackgroundGradientLocation2"),e))},onResetAdvancedGradient:function(){var e;t((yo(e={},n("BackgroundGradientDirection"),""),yo(e,n("BackgroundGradientBlendMode"),""),yo(e,n("BackgroundGradientLocation1"),""),yo(e,n("BackgroundGradientLocation2"),""),e))},backgroundPosition:e.blockAttributes[n("BackgroundPosition")]||"",tabletBackgroundPosition:e.blockAttributes[n("TabletBackgroundPosition")]||"",mobileBackgroundPosition:e.blockAttributes[n("MobileBackgroundPosition")]||"",backgroundRepeat:e.blockAttributes[n("BackgroundRepeat")]||"",tabletBackgroundRepeat:e.blockAttributes[n("TabletBackgroundRepeat")]||"",mobileBackgroundRepeat:e.blockAttributes[n("MobileBackgroundRepeat")]||"",backgroundSize:e.blockAttributes[n("BackgroundSize")]||"",tabletBackgroundSize:e.blockAttributes[n("TabletBackgroundSize")]||"",mobileBackgroundSize:e.blockAttributes[n("MobileBackgroundSize")]||"",backgroundCustomSize:e.blockAttributes[n("BackgroundCustomSize")]||"",tabletBackgroundCustomSize:e.blockAttributes[n("TabletBackgroundCustomSize")]||"",mobileBackgroundCustomSize:e.blockAttributes[n("MobileBackgroundCustomSize")]||"",backgroundCustomSizeUnit:e.blockAttributes[n("BackgroundCustomSizeUnit")]||"%",tabletBackgroundCustomSizeUnit:e.blockAttributes[n("TabletBackgroundCustomSizeUnit")]||"%",mobileBackgroundCustomSizeUnit:e.blockAttributes[n("MobileBackgroundCustomSizeUnit")]||"%",backgroundImageBlendMode:e.blockAttributes[n("BackgroundImageBlendMode")]||"",onChangeBackgroundPosition:function(e){return t(yo({},n("BackgroundPosition"),e))},onChangeTabletBackgroundPosition:function(e){return t(yo({},n("TabletBackgroundPosition"),e))},onChangeMobileBackgroundPosition:function(e){return t(yo({},n("MobileBackgroundPosition"),e))},onChangeBackgroundRepeat:function(e){return t(yo({},n("BackgroundRepeat"),e))},onChangeTabletBackgroundRepeat:function(e){return t(yo({},n("TabletBackgroundRepeat"),e))},onChangeMobileBackgroundRepeat:function(e){return t(yo({},n("MobileBackgroundRepeat"),e))},onChangeBackgroundSize:function(e){return t(yo({},n("BackgroundSize"),e))},onChangeTabletBackgroundSize:function(e){return t(yo({},n("TabletBackgroundSize"),e))},onChangeMobileBackgroundSize:function(e){return t(yo({},n("MobileBackgroundSize"),e))},onChangeBackgroundCustomSize:function(e){return t(yo({},n("BackgroundCustomSize"),e))},onChangeTabletBackgroundCustomSize:function(e){return t(yo({},n("TabletBackgroundCustomSize"),e))},onChangeMobileBackgroundCustomSize:function(e){return t(yo({},n("MobileBackgroundCustomSize"),e))},onChangeBackgroundCustomSizeUnit:function(e){return t(yo({},n("BackgroundCustomSizeUnit"),e))},onChangeTabletBackgroundCustomSizeUnit:function(e){return t(yo({},n("TabletBackgroundCustomSizeUnit"),e))},onChangeMobileBackgroundCustomSizeUnit:function(e){return t(yo({},n("MobileBackgroundCustomSizeUnit"),e))},onChangeBackgroundImageBlendMode:function(e){return t(yo({},n("BackgroundImageBlendMode"),e))},onResetAdvancedBackground:function(){var e;t((yo(e={},n("BackgroundPosition"),""),yo(e,n("TabletBackgroundPosition"),""),yo(e,n("MobileBackgroundPosition"),""),yo(e,n("BackgroundRepeat"),""),yo(e,n("TabletBackgroundRepeat"),""),yo(e,n("MobileBackgroundRepeat"),""),yo(e,n("BackgroundSize"),""),yo(e,n("TabletBackgroundSize"),""),yo(e,n("MobileBackgroundSize"),""),yo(e,n("BackgroundCustomSize"),""),yo(e,n("TabletBackgroundCustomSize"),""),yo(e,n("MobileBackgroundCustomSize"),""),yo(e,n("BackgroundCustomSizeUnit"),"%"),yo(e,n("TabletBackgroundCustomSizeUnit"),"%"),yo(e,n("MobileBackgroundCustomSizeUnit"),"%"),yo(e,n("BackgroundImageBlendMode"),""),e))}},e))};Oo.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{}};var wo=Oo,_o=n(106),jo=n.n(_o),ko=n(107),Co=n.n(ko),xo=n(108),Eo=n.n(xo),So=n(109),Bo=n.n(So);function To(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t$/g)?t:t.match(//g)||[t])[0]:t},hr=function(e){var t=mr({},e,{value:"string"==typeof e.value?fr(e.value):e.value}),n=l()(["ugb-icon-inner-svg",e.className],gr({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(gg,br({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var i=l()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],gr({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:i},a)}return e.showBackgroundShape&&(a=dr(a,e.backgroundShape)),a=Object(K.applyFilters)("stackable.component.svg-icon",a,t)};hr.defaultProps={className:"",value:"",design:"",colorType:"",showBackgroundShape:!1,backgroundShape:"",shadow:"",gradientColor1:"",gradientColor2:"",gradientDirection:0},(hr.Content=function(e){var t=mr({},e,{value:"string"==typeof e.value?fr(e.value):e.value}),n=l()(["ugb-icon-inner-svg",e.className],gr({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(gg.Content,br({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var i=l()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],gr({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:i},a)}return e.showBackgroundShape&&(a=dr(a,e.backgroundShape)),a=Object(K.applyFilters)("stackable.component.svg-icon",a,t)}).defaultProps=mr({},hr.defaultProps);var vr=hr;function yr(){return(yr=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var kr=Object(q.withInstanceId)(function(e){var t=jr(Object(c.useState)(!1),2),n=t[0],a=t[1],i=jr(Object(c.useState)(!1),2),o=i[0],r=i[1],l=e.instanceId,s=e.isOpen,u=e.onChange,b=_r(e,["instanceId","isOpen","onChange"]);return Object(c.useEffect)(function(){e.onToggle(n)},[n]),wp.element.createElement("div",{className:"ugb-svg-icon-placeholder ugb-svg-icon-placeholder-".concat(l)},wp.element.createElement(P.Button,{className:"ugb-svg-icon-placeholder__button",onClick:function(){o?(a(!1),r(!1)):a(!0)}},wp.element.createElement(wr,b)),(null!==s&&s||null===s&&n)&&wp.element.createElement(xi,{onClickOutside:function(e){e.target&&e.target.closest(".ugb-svg-icon-placeholder-".concat(l))?r(!0):(a(!1),r(!1))},onClose:function(){return a(!1)},onChange:u}))});kr.defaultProps={isOpen:null,className:"",value:"",onChange:function(){},onToggle:function(){}};var Cr=kr;function xr(){return(xr=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeTop",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Xr({},this.getEnabledValues(),{top:n}))}},{key:"onChangeRight",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Xr({},this.getEnabledValues(),{right:n}))}},{key:"onChangeBottom",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Xr({},this.getEnabledValues(),{bottom:n}))}},{key:"onChangeLeft",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Xr({},this.getEnabledValues(),{left:n}))}},{key:"render",value:function(){var e=this.props.instanceId,t="ugb-four-number-control-".concat(e,"__item-");return wp.element.createElement(P.BaseControl,{help:this.props.help,className:l()("ugb-four-number-control",this.props.className)},wp.element.createElement(Qe,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-four-number-control__wrapper"},wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-top")},wp.element.createElement("input",{id:"".concat(t,"-top"),type:"number",onChange:this.onChangeTop,"aria-label":Object(s.__)("Top",I.i18n),value:this.props.top,placeholder:this.props.enableTop?"":Object(s.__)("auto",I.i18n),disabled:!this.props.enableTop}),wp.element.createElement("span",null,Object(s.__)("Top",I.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-right")},wp.element.createElement("input",{id:"".concat(t,"-right"),type:"number",onChange:this.onChangeRight,"aria-label":this.props.label,value:this.props.right,placeholder:this.props.enableRight?"":Object(s.__)("auto",I.i18n),disabled:!this.props.enableRight}),wp.element.createElement("span",null,Object(s.__)("Right",I.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-bottom")},wp.element.createElement("input",{id:"".concat(t,"-bottom"),type:"number",onChange:this.onChangeBottom,"aria-label":this.props.label,value:this.props.bottom,placeholder:this.props.enableBottom?"":Object(s.__)("auto",I.i18n),disabled:!this.props.enableBottom}),wp.element.createElement("span",null,Object(s.__)("Bottom",I.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-left")},wp.element.createElement("input",{id:"".concat(t,"-left"),type:"number",onChange:this.onChangeLeft,"aria-label":this.props.label,value:this.props.left,placeholder:this.props.enableLeft?"":Object(s.__)("auto",I.i18n),disabled:!this.props.enableLeft}),wp.element.createElement("span",null,Object(s.__)("Left",I.i18n))),wp.element.createElement(P.Button,{className:this.state.locked?"ugb--is-locked":"",onClick:this.onToggleLock,icon:wp.element.createElement(P.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})})))}}])&&Qr(n.prototype,a),i&&Qr(n,i),t}();al.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0};Object(q.withInstanceId)(al);function il(){return(il=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeAll",value:function(e){var t=e||0===e?e:"";this.props.onChange(this.filterOnlyEnabled({top:t,right:t,bottom:t,left:t}))}},{key:"onChangeTop",value:function(e){this.props.onChange(kl({},this.getEnabledValues(),{top:e||0===e?e:""}))}},{key:"onChangeRight",value:function(e){this.props.onChange(kl({},this.getEnabledValues(),{right:e||0===e?e:""}))}},{key:"onChangeBottom",value:function(e){this.props.onChange(kl({},this.getEnabledValues(),{bottom:e||0===e?e:""}))}},{key:"onChangeLeft",value:function(e){this.props.onChange(kl({},this.getEnabledValues(),{left:e||0===e?e:""}))}},{key:"render",value:function(){var e=this.props,t=e.instanceId,n=e.units,a=e.unit,i="ugb-four-range-control-".concat(t,"__item-"),o={min:this.props.min,max:this.props.max,step:this.props.step,placeholder:this.props.placeholder,initialPosition:this.props.initialPosition,sliderMin:this.props.sliderMin,sliderMax:this.props.sliderMax},r=n.indexOf(a)<0?0:n.indexOf(a);Array.isArray(this.props.min)&&(o.min=this.props.min[r]),Array.isArray(this.props.max)&&(o.max=this.props.max[r]),Array.isArray(this.props.sliderMin)&&(o.sliderMin=this.props.sliderMin[r]),Array.isArray(this.props.sliderMax)&&(o.sliderMax=this.props.sliderMax[r]),Array.isArray(this.props.step)&&(o.step=this.props.step[r]),Array.isArray(this.props.placeholder)&&(o.placeholder=this.props.placeholder[r]),Array.isArray(this.props.initialPosition)&&(o.initialPosition=this.props.initialPosition[r]);var u=l()(["ugb-four-range-control__lock"],{"ugb--is-locked":this.state.locked}),b=wp.element.createElement(P.Button,{className:u,onClick:this.onToggleLock,icon:wp.element.createElement(P.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})});return wp.element.createElement(P.BaseControl,{help:this.props.help,className:l()("ugb-four-range-control",this.props.className,{"ugb--locked":this.state.locked})},wp.element.createElement(Qe,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens,afterButton:b}),this.state.locked&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(ut,wl({id:"".concat(i,"-all"),value:this.firstValue(),onChange:this.onChangeAll,allowReset:!0},o))),!this.state.locked&&wp.element.createElement(c.Fragment,null,this.props.enableTop&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Top",I.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(yl,null))),wp.element.createElement(ut,wl({id:"".concat(i,"-top"),value:this.props.top,onChange:this.onChangeTop,allowReset:!0},o,{placeholder:this.props.placeholderTop||o.placeholder}))),this.props.enableRight&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Right",I.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(dl,null))),wp.element.createElement(ut,wl({id:"".concat(i,"-right"),value:this.props.right,onChange:this.onChangeRight,allowReset:!0},o,{placeholder:this.props.placeholderRight||o.placeholder}))),this.props.enableBottom&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Bottom",I.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(ll,null))),wp.element.createElement(ut,wl({id:"".concat(i,"-bottom"),value:this.props.bottom,onChange:this.onChangeBottom,allowReset:!0},o,{placeholder:this.props.placeholderBottom||o.placeholder}))),this.props.enableLeft&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Left",I.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(bl,null))),wp.element.createElement(ut,wl({id:"".concat(i,"-left"),value:this.props.left,onChange:this.onChangeLeft,allowReset:!0},o,{placeholder:this.props.placeholderLeft||o.placeholder})))))}}])&&xl(n.prototype,a),i&&xl(n,i),t}();Tl.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0,min:0,max:50,sliderMin:null,sliderMax:null,step:1,placeholder:"",placeholderTop:"",placeholderRight:"",placeholderBottom:"",placeholderLeft:"",initialPosition:""};var Pl=Tl,Al=n(113),Nl=n.n(Al),Ml=n(114),Rl=n.n(Ml),Fl=n(115),Dl=n.n(Fl),Il=n(116),zl=n.n(Il),Ll=n(117),Ul=n.n(Ll),Hl=n(118),Wl=n.n(Hl),Gl=n(119),Vl=n.n(Gl),ql=n(120),Kl=n.n(ql),Jl=n(121),Yl=n.n(Jl),Xl=n(122),$l=n.n(Xl),Zl=n(123),Ql=n.n(Zl),ec=n(124),tc=n.n(ec),nc=n(125),ac=n.n(nc),ic=n(126),oc=n.n(ic),rc=n(127),lc=n.n(rc),cc=n(128),sc=n.n(cc),uc=n(129),bc=n.n(uc),pc=n(130),mc=n.n(pc),gc=n(131),dc=n.n(gc),fc=n(132),hc=n.n(fc),vc=n(133),yc=n.n(vc),Oc=n(134),wc=n.n(Oc),_c=n(135),jc=n.n(_c),kc=n(136),Cc=n.n(kc),xc=n(137),Ec=n.n(xc),Sc=n(138),Bc=n.n(Sc),Tc=n(139),Pc=n.n(Tc),Ac=n(140),Nc=n.n(Ac),Mc=n(141),Rc=n.n(Mc),Fc=n(142),Dc=n.n(Fc),Ic=n(51);function zc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Lc(){return(Lc=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"right";if("left"===t)for(var n=e.length-1;n>=1;n--)if(e[n]<10){var a=10-e[n];e[n]=10,e[n-1]-=a}for(var i=0;i=1;r--)if(e[r]<10){var l=10-e[r];e[r]=10,e[r-1]-=l}return e};function qc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Kc(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);te[i]?"right":"left",!0)}),[a,n]}(a,i),2);r[0];(function(e,t,n){var a=Xc(e),i=Vc(a,n);return $c(i)})(i,0,r[1]).forEach(function(e,n){t[n].val=e})}return t},step:1,onUpdate:function(t){return e.onChange(Xc(t))},domain:Yc,values:$c(e.value)},wp.element.createElement(Ic.b,null,function(e){var t=e.getRailProps;return wp.element.createElement(Wc,{getRailProps:t})}),wp.element.createElement(Ic.a,null,function(e){var t=e.handles,n=e.getHandleProps;return wp.element.createElement("div",{className:"slider-handles"},t.map(function(e){return wp.element.createElement(Gc,{key:e.id,handle:e,domain:Yc,getHandleProps:n})}))}))};Zc.defaultProps={onChange:function(){},value:[]};var Qc=Zc;function es(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"";return Object(o.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=Object(i.b)(e.blockAttributes,t,""),a=e.screens;return wp.element.createElement(c.Fragment,null,a.includes("desktop")&&wp.element.createElement(ys,{screens:a},c.Children.toArray(e.children).map(function(a){return Object(c.cloneElement)(a,{value:n(),onChange:function(n){e.onChange?e.onChange(t(),n,""):e.setAttributes(us({},t(),n))}})})),a.includes("tablet")&&wp.element.createElement(ys,{screens:a,screen:"tablet"},c.Children.toArray(e.children).map(function(a){return Object(c.cloneElement)(a,{value:n("Tablet"),placeholder:n("Tablet")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Tablet"),n,"Tablet"):e.setAttributes(us({},t("Tablet"),n))}})})),a.includes("mobile")&&wp.element.createElement(ys,{screens:a,screen:"mobile"},c.Children.toArray(e.children).map(function(a){return Object(c.cloneElement)(a,{value:n("Mobile"),placeholder:n("Mobile")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Mobile"),n,"Mobile"):e.setAttributes(us({},t("Mobile"),n))}})})))};bs.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},onChange:null,placeholder:"",screens:["desktop","tablet","mobile"]};var ps=bs;function ms(e){return(ms="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 gs(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Js={Edit:function(e){var t=e.blockProps,n=e.render,a=e.mainClass,i=e.blockTag,o=Ks(e,["blockProps","render","mainClass","blockTag"]),r=t.blockName,c=t.attributes,s=c.anchor,u=void 0===s?"":s,b=c.design,p=c.blockTag,m=void 0===p?"div":p,g=l()([e.className],Object(K.applyFilters)("stackable.".concat(r,".main-block.classes"),{"ugb-main-block":a},t)),d=l()(["ugb-inner-block"],Object(K.applyFilters)("stackable.".concat(r,".main-block.inner-classes"),{},t)),f=""!==u?u:void 0,h=m||i||"div";return wp.element.createElement(h,qs({},o,{id:f,className:g}),t.styles,Object(K.applyFilters)("stackable.".concat(r,".edit.output.outer"),null,b,t),n&&wp.element.createElement("div",{className:d},Object(K.applyFilters)("stackable.".concat(r,".edit.output.before"),null,b,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(K.applyFilters)("stackable.".concat(r,".edit.output.after"),null,b,t)))}};Js.Edit.defaultProps={styles:null,mainClass:!0},Js.Save=function(e){var t=e.blockProps,n=e.render,a=e.mainClass,i=e.blockTag,o=Ks(e,["blockProps","render","mainClass","blockTag"]),r=t.blockName,c=t.attributes,s=c.anchor,u=void 0===s?"":s,b=c.design,p=c.blockTag,m=void 0===p?"div":p,g=l()([e.className],Object(K.applyFilters)("stackable.".concat(r,".main-block.classes"),{"ugb-main-block":a},t)),d=l()(["ugb-inner-block"],Object(K.applyFilters)("stackable.".concat(r,".main-block.inner-classes"),{},t)),f=""!==u?u:void 0,h=m||i||"div";return wp.element.createElement(h,qs({},o,{id:f,className:g}),t.styles,Object(K.applyFilters)("stackable.".concat(r,".save.output.outer"),null,b,t),n&&wp.element.createElement("div",{className:d},Object(K.applyFilters)("stackable.".concat(r,".save.output.before"),null,b,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(K.applyFilters)("stackable.".concat(r,".save.output.after"),null,b,t)))},Js.Save.defaultProps={styles:null,mainClass:!0};var Ys=Js,Xs=n(48),$s=n(14),Zs=n.n($s);function Qs(e){return(Qs="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 eu(e,t){for(var n=0;n0?i(n[0]):void 0),l=o(n),c=1===l.length&&l[0]&&"ugb/container"===l[0].name;return{isGroupable:r&&l.length&&!c,isUngroupable:c&&!!l[0].innerBlocks.length,blocksSelection:l,groupingBlockName:"ugb/container"}}),Object(Ce.withDispatch)(function(e,t){var n=t.clientIds,a=t.onToggle,i=void 0===a?o.noop:a,r=t.blocksSelection,l=void 0===r?[]:r,c=e("core/block-editor").replaceBlocks;return{onConvertToGroup:function(){if(l.length){var e=l.map(function(e){return Object(Em.cloneBlock)(e)}),t=Object(Em.createBlock)("ugb/container",{},e);c(n,t),i()}},onConvertFromGroup:function(){if(l.length){var e=l[0].innerBlocks;e.length&&(c(n,e),i())}}}})])(function(e){var t=e.onConvertToGroup,n=e.onConvertFromGroup,a=e.isGroupable,i=void 0!==a&&a,o=e.isUngroupable,r=void 0!==o&&o;return Object(Ce.select)("core/block-editor").getSelectedBlockClientIds?wp.element.createElement(c.Fragment,null,i&&wp.element.createElement(Sm.PluginBlockSettingsMenuItem,{icon:Bm,label:Object(s.__)("Group into Container",I.i18n),onClick:t}),r&&wp.element.createElement(Sm.PluginBlockSettingsMenuItem,{icon:Tm,label:Object(s.__)("Ungroup from Container",I.i18n),onClick:n})):null}),Am=Object(Ce.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientIds;return t?{clientIds:t()}:{}})(Pm),Nm=Object(q.withState)({openPopover:!1,changed:!1})(function(e){var t=e.blockName,n=e.openPopover,a=e.changed,i=e.setState,r=e.getJSONBlockAttributes,l=e.setJSONBlockAttributes;return wp.element.createElement(c.Fragment,null,wp.element.createElement(Sm.PluginBlockSettingsMenuItem,{icon:"editor-code",label:"Get / Set Block Attributes",onClick:function(){i({openPopover:!0,changed:!1}),setTimeout(function(){return document.querySelector(".ugb-modal-get-block-attributes-button textarea").select()},100)}}),n&&wp.element.createElement(P.Modal,{title:"".concat(Object(o.startCase)(t)," Block Attributes"),focusOnMount:!0,className:"ugb-modal-get-block-attributes-button",onRequestClose:function(){if(a){var e=document.querySelector(".ugb-modal-get-block-attributes-button textarea").value;l(e)}i({openPopover:!1})}},wp.element.createElement("p",null,'Copy or modify the attributes of the block directly. Use only double quotes "'),wp.element.createElement("textarea",{onChange:function(){return i({changed:!0})}},r())))}),Mm=Object(q.compose)([Object(Ce.withSelect)(function(e,t){var n=t.clientId,a=e("core/block-editor").getBlockName;return{blockName:n&&a(n)?a(n).replace(/^\w+\//g,""):"",getJSONBlockAttributes:function(){var t=e("core/block-editor").getBlockName,a=e("core/blocks").getBlockType;if(!n)return{};var i=e("core/block-editor").getBlockAttributes(n),o=t(n).replace(/^\w+\//g,""),r=a(t(n)).attributes,l=Object.keys(i).reduce(function(e,t){return i[t]!==(r[t]?r[t].default:"")&&(e[t]=i[t]),e},{});return l.uniqueClass=void 0,JSON.stringify(Object(K.applyFilters)("stackable.".concat(o,".design.filtered-block-attributes"),l),null,4)}}}),Object(Ce.withDispatch)(function(e,t){var n=t.clientId;return{setJSONBlockAttributes:function(e){if(n)try{var t=JSON.parse(e);Object(i.e)(t,n)}catch(e){console.error(e)}}}})])(Nm),Rm=Object(Ce.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientId;return t?{clientId:t()}:{}})(Mm);function Fm(){return(Fm=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Im=function(e){var t=e.blockTag,n=e.className,a=e.backgroundAttrName,o=e.blockProps,r=e.showBackground,c=e.showVideoBackground,s=Dm(e,["blockTag","className","backgroundAttrName","blockProps","showBackground","showVideoBackground"]),u=l()([n],{"ugb--has-background-overlay":r&&Object(i.Z)(a,o.attributes)});return wp.element.createElement(t,Fm({className:u},s),e.children,r&&c&&Object(i.L)(a,o))};Im.defaultProps={className:"",backgroundAttrName:"%s",blockProps:{},showBackground:!0,showVideoBackground:!0,blockTag:"div"};var zm=Im,Lm=function(e){return wp.element.createElement(P.Modal,{title:Object(s.__)("Stackable Welcome Guide",I.i18n),className:"ugb-modal-welcome-video",overlayClassName:"ugb-modal-welcome-video__overlay",shouldCloseOnClickOutside:!1,onRequestClose:e.onRequestClose},wp.element.createElement("p",null,Object(s.__)("Hello there 👋 I see you might be new to Stackable, we've made a short 3-minute video so you can make the most out of our unique blocks.",I.i18n)),wp.element.createElement("iframe",{title:Object(s.__)("Video Tutorial",I.i18n),width:"800",height:"413",src:"https://www.youtube.com/embed/UW0Rg96aATA",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),wp.element.createElement("p",null,wp.element.createElement(P.Button,{className:"button-primary",onClick:e.onRequestClose,"data-testid":"button-close"},Object(s.__)("Close it, I'm good",I.i18n))))};Lm.defaultProps={onRequestClose:function(){}};var Um=Lm;function Hm(){return(Hm=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.createHigherOrderComponent)(function(n){var o,c;return c=o=function(o){function c(){return m(this,c),f(this,h(c).apply(this,arguments))}return v(c,l["Component"]),d(c,[{key:"render",value:function(){var o=r()([this.props.className,this.props.attributes.uniqueClass]),l=this.props.blockName,c=Object(i.applyFilters)("stackable.".concat(l,".styles"),e(this.props),this.props),s=wp.element.createElement(a.l,{blockUniqueClassName:this.props.attributes.uniqueClass,blockMainClassName:this.props.mainClassName,style:c,editorMode:t.editorMode||!1});return wp.element.createElement(n,p({},this.props,{className:o,styles:s}))}}]),c}(),O(o,"propTypes",{attributes:u.a.shape({uniqueClass:u.a.string.isRequired}),blockName:u.a.string.isRequired,mainClassName:u.a.string.isRequired}),O(o,"defaultProps",{attributes:{},blockName:"",className:"",mainClassName:""}),c},"withBlockStyles")},_=n(2);function j(e){return(j="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 k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return Object(c.createHigherOrderComponent)(function(t){var n,a;return a=n=function(n){function a(){return k(this,a),E(this,S(a).apply(this,arguments))}return B(a,l["Component"]),x(a,[{key:"componentDidMount",value:function(){var t=this.props.blockName;Object(i.addFilter)("stackable.".concat(t,".setAttributes"),"stackable/".concat(t,"/contentAlign"),function(n){var a=Object(i.applyFilters)("stackable.with-content-align-reseter.attributeNamesToReset",e,t);return["","Tablet","Mobile"].forEach(function(e){void 0!==n[Object(_.R)("%sContentAlign",e)]&&a.forEach(function(t){n[Object(_.R)(t,e)]=""})}),n})}},{key:"render",value:function(){return wp.element.createElement(t,this.props)}}]),a}(),P(n,"defaultProps",{attributes:{},blockName:""}),a},"withContentAlignReseter")};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)}function M(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return function(t){var n=function(n){var o=n.blockName,r=ie(Object(l.useState)(null),2),c=r[0],s=r[1],u=Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.style.block"),null,n);return wp.element.createElement(l.Fragment,null,Object(i.applyFilters)("stackable.edit.inspector.before",null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.before"),null,n),wp.element.createElement(ee.InspectorControls,null,wp.element.createElement(a.hb,{tabs:e,blockProps:n,onTabFirstOpen:s,onClick:s}),(!c||"layout"===c)&&wp.element.createElement(a.cb,null,Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.layout.before"),null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.layout.after"),null,n)),(!c||"style"===c)&&wp.element.createElement(a.cb,{tab:"style"},Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.style.before"),null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.style.after"),null,n),u&&wp.element.createElement("div",{className:"ugb-panel-controls-separator",role:"presentation"},"— — —"),u),(!c||"advanced"===c)&&wp.element.createElement(a.cb,{tab:"advanced"},Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.advanced.before"),null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.advanced.after"),null,n))),wp.element.createElement(t,n))};return n.defaultProps=ne({},t.defaultProps||{},{attributes:{},blockName:""}),n}};function re(e){return(re="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 le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ce(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t * > *",".ugb-block-content > *",".ugb-content-wrapper",".ugb-top-separator",".ugb-bottom-separator",".ugb-inner-block",".ugb-main-block"],Ce=function(e,t,n){void 0===je[e]&&(je[e]={}),je[e][t]=n},xe=function(e){return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return Object(c.createHigherOrderComponent)(function(t){return function(n){function a(){var t;Se(this,a);var n=(t=Pe(this,Ae(a).apply(this,arguments))).props.blockName;return e.forEach(function(e){Ce(n,e[0],e[1])}),t}return Ne(a,l["Component"]),Te(a,[{key:"render",value:function(){return wp.element.createElement(t,this.props)}}]),a}()},"withClickOpenInspector")};function Fe(e){return(Fe="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 De(){return(De=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Ze=function(e){var t=e.image,n=e.label,a=e.className,i=$e(e,["image","label","className"]),o=t?t.match(/https?:/i)?t:Ge.srcUrl?"".concat(Ge.srcUrl,"/").concat(t):t:"",l="free"!==i.plan,c=l&&!Ge.isPro&&Ge.showProNotice;if(l&&!Ge.isPro&&!Ge.showProNotice)return null;var s=r()(["ugb-design-layout-selector__item",a],{"is-premium":i.plan&&!Ge.isPro&&"free"!==i.plan,"is-locked":c}),u=c?"div":"button";return wp.element.createElement(u,Xe({className:s},i),wp.element.createElement("div",{className:"ugb-design-layout-selector__wrapper"},c&&wp.element.createElement(Ke.Icon,{className:"ugb-design-layout-selector__lock",icon:"lock"}),c&&wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=design-library-learn-more&utm_campaign=learnmore&utm_medium=gutenberg",className:"ugb-design-layout-selector__item-premium-button ugb-shadow-4 button button-secondary",target:"_premium",title:Object(qe.__)("Learn More",Ge.i18n)},Object(qe.__)("Learn More",Ge.i18n)),wp.element.createElement("img",{className:"ugb-design-layout-selector__image",src:o,alt:n})),wp.element.createElement("div",{className:"ugb-design-layout-selector__label"},n))};Ze.defaultProps={name:"",label:"",className:""};var Qe=Ze;function et(){return(et=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[n(t)];return 0===i?i:i||a};return wp.element.createElement(S,d({design:a("Design",e.designDefault),size:a("Size","normal"),text:a("Text",""),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),icon:a("Icon"),iconPosition:a("IconPosition"),onChange:function(e){return t(f({},n("Text"),e))},url:a("Url"),newTab:a("NewTab"),noFollow:a("NoFollow"),onChangeUrl:function(e){return t(f({},n("Url"),e))},onChangeNewTab:function(e){return t(f({},n("NewTab"),e))},onChangeNoFollow:function(e){return t(f({},n("NoFollow"),e))},onChangeIcon:function(e){return t(f({},n("Icon"),e))},isSelected:e.isSelected},e))};h.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(h.Content=function(e){var t=function(t){return Object(g.camelCase)(Object(r.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[t(n)];return 0===i?i:i||a};return wp.element.createElement(S.Content,d({design:n("Design",e.designDefault),size:n("Size","normal"),text:n("Text"),icon:n("Icon"),newTab:n("NewTab"),url:n("Url"),noFollow:n("NoFollow"),hoverEffect:n("HoverEffect"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow"),iconPosition:n("IconPosition")},e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};var v=h;function y(){return(y=Object.assign||function(e){for(var t=1;t0&&void 0!==a[0]&&a[0],c&&!t){e.next=9;break}return e.next=4,o()({path:"/wp/v2/stk_design_library".concat(t?"/reset":""),method:"GET"});case 4:return n=e.sent,e.next=7,n;case 7:c=e.sent,t&&(s={},u=[]);case 9:return e.abrupt("return",c);case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),m=function(){var e=l(regeneratorRuntime.mark(function e(t){var n,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=b(t),s[n]){e.next=8;break}return e.next=4,o()({path:"/wp/v2/stk_block_designs/".concat(n),method:"GET"});case 4:return a=e.sent,e.next=7,a;case 7:s[n]=e.sent;case 8:return e.abrupt("return",s[n]);case 9:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),g=function(){var e=l(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u[t]){e.next=7;break}return e.next=3,o()({path:"/wp/v2/stk_design/".concat(t),method:"GET"});case 3:return n=e.sent,e.next=6,n;case 6:u[t]=e.sent;case 7:return e.abrupt("return",u[t]);case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=l(regeneratorRuntime.mark(function e(){var t,n,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]&&a[0],e.next=3,o()({path:"/wp/v2/stk_design_library_dev_mode/",method:"POST",data:{devmode:t}});case 3:return n=e.sent,e.next=6,n;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();Object(a.a)(function(){});var f=function(){var e=l(regeneratorRuntime.mark(function e(t){var n,a,i,o,r,l,c,s,u,b,m,g,d,f,h,v,y,O;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.type,a=void 0===n?"":n,i=t.block,o=void 0===i?"":i,r=t.mood,l=void 0===r?"":r,c=t.plan,s=void 0===c?"":c,u=t.colors,b=void 0===u?[]:u,m=t.categories,g=void 0===m?[]:m,d=t.search,f=void 0===d?"":d,h=t.reset,v=void 0!==h&&h,e.t0=Object,e.next=4,p(v);case 4:return e.t1=e.sent,y=e.t0.values.call(e.t0,e.t1),a&&(y=y.filter(function(e){return e.type===a})),o&&(O=-1===o.indexOf("ugb/")?"ugb/".concat(o):o,y=y.filter(function(e){return e.block===O})),l&&(y=y.filter(function(e){return e.mood===l})),s&&(y=y.filter(function(e){return e.plan===s})),b&&b.length&&(y=y.filter(function(e){return e.colors.some(function(e){return b.includes(e)})})),g&&g.length&&(y=y.filter(function(e){return e.categories.some(function(e){return g.includes(e)})})),f&&f.toLowerCase().replace(/\s+/," ").trim().split(" ").forEach(function(e){y=y.filter(function(t){return["label","plan","block","tags","categories","colors"].some(function(n){return-1!==t[n].toString().toLowerCase().indexOf(e)})})}),e.abrupt("return",y);case 14:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),h=function(){var e=l(regeneratorRuntime.mark(function e(t){var n,a,i,o,r,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p();case 2:if(n=e.sent,a=n[t],i=a.type,o=a.block,r=a.template,"block"!==i||!o){e.next=12;break}return e.next=8,m(o);case 8:return l=e.sent,e.abrupt("return",l[t]);case 12:if(!r){e.next=16;break}return e.next=15,g(t);case 15:return e.abrupt("return",e.sent);case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=l(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Object,e.next=3,p();case 3:return e.t1=e.sent,t=e.t0.values.call(e.t0,e.t1),e.abrupt("return",t.reduce(function(e,t){var n=t.block,a=t.type;return e.includes(n)||"block"!==a||e.push(n),e},[]));case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()},function(e,t){e.exports=wp.apiFetch},function(e,t){e.exports=wp.editPost},,,function(e,t){e.exports=wp.plugins},,,,,,,function(e,t,n){"use strict";n.d(t,"b",function(){return b});var a=n(2),i=n(7);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function r(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.keys(e).reduce(function(o,c){return r({},o,l({},Object(a.mb)(c,t,n,i?"#editor":""),e[c]))},{})},s=function(e){return Object.keys(e).reduce(function(t,n){var a=Object.keys(e[n]).reduce(function(t,a){var o=e[n][a];return void 0===o?t:t+"\n\t"+a.replace(/^(--?)?(.*?$)/,function(e,t,n){return"".concat(t||"").concat(Object(i.kebabCase)(n))})+": "+o+";"},"");return t.push("\n\n"+n+" {"+a+"\n}"),t},[])},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["desktop"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1025,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:768,a=Object(i.sortBy)("string"==typeof e?e.split(",").map(function(e){return e.trim()}):e);return Object(i.isEqual)(a,["desktop","tablet"])?"@media screen and (min-width: "+n+"px)":Object(i.isEqual)(a,["desktop"])?"@media screen and (min-width: "+t+"px)":Object(i.isEqual)(a,["mobile","tablet"])?"@media screen and (max-width: "+t+"px)":Object(i.isEqual)(a,["tablet"])?"@media screen and (min-width: "+n+"px) and (max-width: "+t+"px)":Object(i.isEqual)(a,["mobile"])?"@media screen and (max-width: "+n+"px)":null},b=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1025,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:768,l=arguments.length>5&&void 0!==arguments[5]&&arguments[5],b=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,p=[];Object.keys(t).forEach(function(e){if(["desktopTablet","desktopOnly","tablet","tabletOnly","mobile","ie11","editor"].includes(e)){var n=e;Object.keys(t[n]).forEach(function(e){Object.keys(t[n][e]).forEach(function(a){return void 0===t[n][e][a]?delete t[n][e][a]:{}}),Object.keys(t[n][e]).length||delete t[n][e]}),Object.keys(t[n]).length||delete t[n]}else Object.keys(t[e]).forEach(function(n){return void 0===t[e][n]?delete t[e][n]:{}}),Object.keys(t[e]).length||delete t[e]});var m=Object(i.omit)(t,["desktopTablet","desktopOnly","tablet","tabletOnly","mobile","ie11","editor","saveOnly"]);if(Object.keys(m).length){var g=c(m,n,a,l);Array.prototype.push.apply(p,s(g))}if(void 0!==t.desktopTablet){var d=c(t.desktopTablet,n,a,l),f=s(d);f&&(l?f.forEach(function(e){p.push("\n\n"+u(["desktop","tablet"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["desktop","tablet"],o,r)," {\n").concat(f.join("")," }")))}if(void 0!==t.desktopOnly){var h=c(t.desktopOnly,n,a,l),v=s(h);v&&(l?v.forEach(function(e){p.push("\n\n"+u(["desktop"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["desktop"],o,r)," {\n").concat(v.join("")," }")))}if(void 0!==t.tablet){var y=c(t.tablet,n,a,l),O=s(y);O&&(l?O.forEach(function(e){p.push("\n\n"+u(["mobile","tablet"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["mobile","tablet"],o,r)," {\n").concat(O.join("")," }")))}if(void 0!==t.tabletOnly){var w=c(t.tabletOnly,n,a,l),_=s(w);_&&(l?_.forEach(function(e){p.push("\n\n"+u(["tablet"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["tablet"],o,r)," {\n").concat(_.join("")," }")))}if(void 0!==t.mobile){var j=c(t.mobile,n,a,l),k=s(j);k&&(l?k.forEach(function(e){p.push("\n\n"+u(["mobile"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["mobile"],o,r)," {\n").concat(k.join("")," }")))}if(void 0!==t.ie11){var C=c(t.ie11,n,a,l),x=s(C);x&&p.push("\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n".concat(x.join("")," }"))}return l&&void 0!==t.editor&&!b&&Array.prototype.push.apply(p,e(t.editor,n,a,o,r,l,b++)),l||void 0===t.saveOnly||b||Array.prototype.push.apply(p,e(t.saveOnly,n,a,o,r,l,b++)),p};t.a=function(e){var t=e.style,n=void 0===t?{}:t,i=e.editorMode,o=void 0!==i&&i,r=e.blockUniqueClassName,l=void 0===r?"":r,c=e.blockMainClassName,s=void 0===c?"":c,u=e.breakTablet,p=void 0===u?1025:u,m=e.breakMobile,g=b(n,s,l,p,void 0===m?768:m,o);return o?g?g.map(function(e,t){return wp.element.createElement("style",{key:t},e)}):null:g&&g.length?wp.element.createElement("style",null,Object(a.jb)(g.join(""))):null}},function(e,t,n){"use strict";n.r(t);var a=n(5),i=n.n(a);function o(){return(o=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(O,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(h,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(k,{style:{fill:e}})},title:Object(te.__)("Check",ne.i18n),value:"check"},plus:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(L,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(D,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(G,{style:{fill:e}})},title:Object(te.__)("Plus",ne.i18n),value:"plus"},arrow:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(u,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(l,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(g,{style:{fill:e}})},title:Object(te.__)("Arrow",ne.i18n),value:"arrow"},cross:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(T,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(E,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(M,{style:{fill:e}})},title:Object(te.__)("Cross",ne.i18n),value:"cross"},star:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(X,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(K,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(ee,{style:{fill:e}})},title:Object(te.__)("Star",ne.i18n),value:"star"}},oe=function(e){return"circle"===e||"outline"===e?"".concat(e,"Func"):"iconFunc"},re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return ie[e]?ie[e][oe(t)]():null},le=function(e,t,n){var a=oe(t);if(!ie[e])return"";var i=Object(ae.sb)(ie[e][a](n),!1);return btoa(i)},ce=n(4),se=n(9),ue=n(8),be=n.n(ue);function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"deprecatedIcon_2_9_1",function(){return de}),n.d(t,"deprecatedSchema_1_15_4",function(){return fe});var ge,de=(ge={},["check","plus","arrow","cross","star"].forEach(function(e){["","circle","outline"].forEach(function(t){ge["".concat(e,"-").concat(t||"default")]=Object(ae.sb)(re(e,t))})}),ge),fe={icon:{type:"string",default:"check"},iconShape:{type:"string"},iconColor:{type:"string"},iconSize:{type:"number",default:20},columns:{type:"number",default:1},text:{source:"html",selector:"ul",multiline:"li",default:""},gap:{type:"number",default:16},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},he=[{attributes:fe,save:function(e){var t=e.className,n=e.attributes,a=n.icon,i=n.iconShape,o=n.iconColor,r=n.iconSize,l=n.text,c=n.columns,s=n.gap,u=n.design,b=void 0===u?"":u,p=be()([t.split(" ").filter(function(e){return"ugb-icon-list"!==e}),"ugb-icon-list-wrapper"],Object(ce.applyFilters)("stackable.icon-list.mainclasses_1_15_4",{},b,e)),m=be()(["ugb-icon-list","ugb-icon--icon-".concat(a),"ugb-icon--columns-".concat(c)],Object(ce.applyFilters)("stackable.icon-list.ulclasses_1_15_4",{},b,e)),g={"--icon":"url('data:image/svg+xml;base64,"+le(a,i,o)+"')","--icon-size":r?"".concat(r,"px"):void 0,"--gap":s?"".concat(s,"px"):void 0};return wp.element.createElement("div",{className:p},Object(ce.applyFilters)("stackable.icon-list.save.output.before_1_15_4",null,b,e),wp.element.createElement(se.RichText.Content,{tagName:"ul",className:m,style:g,value:l}),Object(ce.applyFilters)("stackable.icon-list.save.output.after_1_15_4",null,b,e))},migrate:function(e){var t=function(e){return(e||"").replace(/.ugb-icon-list-wrapper .ugb-icon-list li/g,".ugb-icon-list li").replace(/.ugb-icon-list-wrapper .ugb-icon-list/g,".ugb-icon-list ul").replace(/.ugb-icon-list-wrapper/g,".ugb-icon-list")};return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=i.deprecatedIcon_2_9_1["".concat(e,"-").concat(t||"default")]||i.deprecatedIcon_2_9_1["check-".concat(t||"default")];return n||e}(a,o),t.attributes.iconShape=void 0),wp.element.createElement(e,t)}},"withTransformOldIconAttributes");t.default=o},,function(e,t,n){"use strict";n.r(t);var a=n(57);n.d(t,"withTransformOldIconAttributes",function(){return a.default})},,,function(e,t){e.exports="dist/videos/help/typography-family.mp4"},function(e,t){e.exports="dist/videos/help/alignment-title.mp4"},function(e,t){e.exports="dist/videos/help/spacing-title.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-margins.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-paddings.mp4"},function(e,t){e.exports="dist/videos/help/accordion-border-size.mp4"},function(e,t){e.exports=wp.date},function(e,t){e.exports="dist/images/block-team-member-overlay.156c4db.png"},,,,,,,,,,,,,,,,function(e,t){e.exports="dist/images/higher-order-with-design-layout-selector-basic.a9cc4da.png"},function(e,t){e.exports="dist/images/components-image-shape-control-default.f59a6f2.png"},function(e,t){e.exports="dist/images/components-image-shape-control-square.54ea536.png"},function(e,t){e.exports="dist/images/components-image-shape-control-circle.9bd9f74.png"},function(e,t){e.exports="dist/images/components-image-shape-control-blob1.8e07b2a.png"},,function(e){e.exports=JSON.parse('[{"family":"ABeeZee","variants":["regular","italic"],"subsets":["latin"]},{"family":"Abel","variants":["regular"],"subsets":["latin"]},{"family":"Abhaya Libre","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","sinhala"]},{"family":"Abril Fatface","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Aclonica","variants":["regular"],"subsets":["latin"]},{"family":"Acme","variants":["regular"],"subsets":["latin"]},{"family":"Actor","variants":["regular"],"subsets":["latin"]},{"family":"Adamina","variants":["regular"],"subsets":["latin"]},{"family":"Advent Pro","variants":["100","200","300","regular","500","600","700"],"subsets":["greek","latin","latin-ext"]},{"family":"Aguafina Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Akronim","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Aladin","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Alata","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Alatsi","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Aldrich","variants":["regular"],"subsets":["latin"]},{"family":"Alef","variants":["regular","700"],"subsets":["hebrew","latin"]},{"family":"Alegreya","variants":["regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Alegreya SC","variants":["regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Alegreya Sans","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Alegreya Sans SC","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Aleo","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Alex Brush","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Alfa Slab One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Alice","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin"]},{"family":"Alike","variants":["regular"],"subsets":["latin"]},{"family":"Alike Angular","variants":["regular"],"subsets":["latin"]},{"family":"Allan","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Allerta","variants":["regular"],"subsets":["latin"]},{"family":"Allerta Stencil","variants":["regular"],"subsets":["latin"]},{"family":"Allura","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Almarai","variants":["300","regular","700","800"],"subsets":["arabic"]},{"family":"Almendra","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Almendra Display","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Almendra SC","variants":["regular"],"subsets":["latin"]},{"family":"Amarante","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Amaranth","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Amatic SC","variants":["regular","700"],"subsets":["cyrillic","hebrew","latin","latin-ext","vietnamese"]},{"family":"Amethysta","variants":["regular"],"subsets":["latin"]},{"family":"Amiko","variants":["regular","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Amiri","variants":["regular","italic","700","700italic"],"subsets":["arabic","latin","latin-ext"]},{"family":"Amita","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Anaheim","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Andada","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Andika","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Andika New Basic","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Angkor","variants":["regular"],"subsets":["khmer"]},{"family":"Annie Use Your Telescope","variants":["regular"],"subsets":["latin"]},{"family":"Anonymous Pro","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","greek","latin","latin-ext"]},{"family":"Antic","variants":["regular"],"subsets":["latin"]},{"family":"Antic Didone","variants":["regular"],"subsets":["latin"]},{"family":"Antic Slab","variants":["regular"],"subsets":["latin"]},{"family":"Anton","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Arapey","variants":["regular","italic"],"subsets":["latin"]},{"family":"Arbutus","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Arbutus Slab","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Architects Daughter","variants":["regular"],"subsets":["latin"]},{"family":"Archivo","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Archivo Black","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Archivo Narrow","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Aref Ruqaa","variants":["regular","700"],"subsets":["arabic","latin","latin-ext"]},{"family":"Arima Madurai","variants":["100","200","300","regular","500","700","800","900"],"subsets":["latin","latin-ext","tamil","vietnamese"]},{"family":"Arimo","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","latin","latin-ext","vietnamese"]},{"family":"Arizonia","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Armata","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Arsenal","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Artifika","variants":["regular"],"subsets":["latin"]},{"family":"Arvo","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Arya","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Asap","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Asap Condensed","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Asar","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Asset","variants":["regular"],"subsets":["latin"]},{"family":"Assistant","variants":["200","300","regular","500","600","700","800"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Astloch","variants":["regular","700"],"subsets":["latin"]},{"family":"Asul","variants":["regular","700"],"subsets":["latin"]},{"family":"Athiti","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Atma","variants":["300","regular","500","600","700"],"subsets":["bengali","latin","latin-ext"]},{"family":"Atomic Age","variants":["regular"],"subsets":["latin"]},{"family":"Aubrey","variants":["regular"],"subsets":["latin"]},{"family":"Audiowide","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Autour One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Average","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Average Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Averia Gruesa Libre","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Averia Libre","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Averia Sans Libre","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Averia Serif Libre","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"B612","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"B612 Mono","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Bad Script","variants":["regular"],"subsets":["cyrillic","latin"]},{"family":"Bahiana","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bahianita","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bai Jamjuree","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Baloo 2","variants":["regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext","vietnamese"]},{"family":"Baloo Bhai 2","variants":["regular","500","600","700","800"],"subsets":["gujarati","latin","latin-ext","vietnamese"]},{"family":"Baloo Bhaina 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","oriya","vietnamese"]},{"family":"Baloo Chettan 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","malayalam","vietnamese"]},{"family":"Baloo Da 2","variants":["regular","500","600","700","800"],"subsets":["bengali","latin","latin-ext","vietnamese"]},{"family":"Baloo Paaji 2","variants":["regular","500","600","700","800"],"subsets":["gurmukhi","latin","latin-ext","vietnamese"]},{"family":"Baloo Tamma 2","variants":["regular","500","600","700","800"],"subsets":["kannada","latin","latin-ext","vietnamese"]},{"family":"Baloo Tammudu 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","telugu","vietnamese"]},{"family":"Baloo Thambi 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","tamil","vietnamese"]},{"family":"Balsamiq Sans","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Balthazar","variants":["regular"],"subsets":["latin"]},{"family":"Bangers","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barlow","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barlow Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barlow Semi Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barriecito","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barrio","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Basic","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Baskervville","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Battambang","variants":["regular","700"],"subsets":["khmer"]},{"family":"Baumans","variants":["regular"],"subsets":["latin"]},{"family":"Bayon","variants":["regular"],"subsets":["khmer"]},{"family":"Be Vietnam","variants":["100","100italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bebas Neue","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Belgrano","variants":["regular"],"subsets":["latin"]},{"family":"Bellefair","variants":["regular"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Belleza","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bellota","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Bellota Text","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"BenchNine","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Bentham","variants":["regular"],"subsets":["latin"]},{"family":"Berkshire Swash","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Beth Ellen","variants":["regular"],"subsets":["latin"]},{"family":"Bevan","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Display","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Inline Display","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Inline Text","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Stencil Display","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Stencil Text","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Text","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bigelow Rules","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bigshot One","variants":["regular"],"subsets":["latin"]},{"family":"Bilbo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bilbo Swash Caps","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"BioRhyme","variants":["200","300","regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"BioRhyme Expanded","variants":["200","300","regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"Biryani","variants":["200","300","regular","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Bitter","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Black And White Picture","variants":["regular"],"subsets":["korean","latin"]},{"family":"Black Han Sans","variants":["regular"],"subsets":["korean","latin"]},{"family":"Black Ops One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Blinker","variants":["100","200","300","regular","600","700","800","900"],"subsets":["latin","latin-ext"]},{"family":"Bokor","variants":["regular"],"subsets":["khmer"]},{"family":"Bonbon","variants":["regular"],"subsets":["latin"]},{"family":"Boogaloo","variants":["regular"],"subsets":["latin"]},{"family":"Bowlby One","variants":["regular"],"subsets":["latin"]},{"family":"Bowlby One SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Brawler","variants":["regular"],"subsets":["latin"]},{"family":"Bree Serif","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bubblegum Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bubbler One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Buda","variants":["300"],"subsets":["latin"]},{"family":"Buenard","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Bungee","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Hairline","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Inline","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Outline","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Shade","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Butcherman","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Butterfly Kids","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cabin","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Cabin Condensed","variants":["regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Cabin Sketch","variants":["regular","700"],"subsets":["latin"]},{"family":"Caesar Dressing","variants":["regular"],"subsets":["latin"]},{"family":"Cagliostro","variants":["regular"],"subsets":["latin"]},{"family":"Cairo","variants":["200","300","regular","600","700","900"],"subsets":["arabic","latin","latin-ext"]},{"family":"Caladea","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Calistoga","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Calligraffitti","variants":["regular"],"subsets":["latin"]},{"family":"Cambay","variants":["regular","italic","700","700italic"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Cambo","variants":["regular"],"subsets":["latin"]},{"family":"Candal","variants":["regular"],"subsets":["latin"]},{"family":"Cantarell","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Cantata One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cantora One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Capriola","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cardo","variants":["regular","italic","700"],"subsets":["greek","greek-ext","latin","latin-ext"]},{"family":"Carme","variants":["regular"],"subsets":["latin"]},{"family":"Carrois Gothic","variants":["regular"],"subsets":["latin"]},{"family":"Carrois Gothic SC","variants":["regular"],"subsets":["latin"]},{"family":"Carter One","variants":["regular"],"subsets":["latin"]},{"family":"Castoro","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Catamaran","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","tamil"]},{"family":"Caudex","variants":["regular","italic","700","700italic"],"subsets":["greek","greek-ext","latin","latin-ext"]},{"family":"Caveat","variants":["regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Caveat Brush","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cedarville Cursive","variants":["regular"],"subsets":["latin"]},{"family":"Ceviche One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chakra Petch","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Changa","variants":["200","300","regular","500","600","700","800"],"subsets":["arabic","latin","latin-ext"]},{"family":"Changa One","variants":["regular","italic"],"subsets":["latin"]},{"family":"Chango","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Charm","variants":["regular","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Charmonman","variants":["regular","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Chathura","variants":["100","300","regular","700","800"],"subsets":["latin","telugu"]},{"family":"Chau Philomene One","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Chela One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chelsea Market","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chenla","variants":["regular"],"subsets":["khmer"]},{"family":"Cherry Cream Soda","variants":["regular"],"subsets":["latin"]},{"family":"Cherry Swash","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Chewy","variants":["regular"],"subsets":["latin"]},{"family":"Chicle","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chilanka","variants":["regular"],"subsets":["latin","malayalam"]},{"family":"Chivo","variants":["300","300italic","regular","italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Chonburi","variants":["regular"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Cinzel","variants":["regular","500","600","700","800","900"],"subsets":["latin","latin-ext"]},{"family":"Cinzel Decorative","variants":["regular","700","900"],"subsets":["latin"]},{"family":"Clicker Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Coda","variants":["regular","800"],"subsets":["latin","latin-ext"]},{"family":"Coda Caption","variants":["800"],"subsets":["latin","latin-ext"]},{"family":"Codystar","variants":["300","regular"],"subsets":["latin","latin-ext"]},{"family":"Coiny","variants":["regular"],"subsets":["latin","latin-ext","tamil","vietnamese"]},{"family":"Combo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Comfortaa","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Comic Neue","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Coming Soon","variants":["regular"],"subsets":["latin"]},{"family":"Commissioner","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Concert One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Condiment","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Content","variants":["regular","700"],"subsets":["khmer"]},{"family":"Contrail One","variants":["regular"],"subsets":["latin"]},{"family":"Convergence","variants":["regular"],"subsets":["latin"]},{"family":"Cookie","variants":["regular"],"subsets":["latin"]},{"family":"Copse","variants":["regular"],"subsets":["latin"]},{"family":"Corben","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Cormorant","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Garamond","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Infant","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant SC","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Unicase","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Upright","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Courgette","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Courier Prime","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Cousine","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","latin","latin-ext","vietnamese"]},{"family":"Coustard","variants":["regular","900"],"subsets":["latin"]},{"family":"Covered By Your Grace","variants":["regular"],"subsets":["latin"]},{"family":"Crafty Girls","variants":["regular"],"subsets":["latin"]},{"family":"Creepster","variants":["regular"],"subsets":["latin"]},{"family":"Crete Round","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Crimson Pro","variants":["200","300","regular","500","600","700","800","900","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Crimson Text","variants":["regular","italic","600","600italic","700","700italic"],"subsets":["latin"]},{"family":"Croissant One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Crushed","variants":["regular"],"subsets":["latin"]},{"family":"Cuprum","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cute Font","variants":["regular"],"subsets":["korean","latin"]},{"family":"Cutive","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cutive Mono","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"DM Mono","variants":["300","300italic","regular","italic","500","500italic"],"subsets":["latin","latin-ext"]},{"family":"DM Sans","variants":["regular","italic","500","500italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"DM Serif Display","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"DM Serif Text","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Damion","variants":["regular"],"subsets":["latin"]},{"family":"Dancing Script","variants":["regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Dangrek","variants":["regular"],"subsets":["khmer"]},{"family":"Darker Grotesque","variants":["300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"David Libre","variants":["regular","500","700"],"subsets":["hebrew","latin","latin-ext","vietnamese"]},{"family":"Dawning of a New Day","variants":["regular"],"subsets":["latin"]},{"family":"Days One","variants":["regular"],"subsets":["latin"]},{"family":"Dekko","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Delius","variants":["regular"],"subsets":["latin"]},{"family":"Delius Swash Caps","variants":["regular"],"subsets":["latin"]},{"family":"Delius Unicase","variants":["regular","700"],"subsets":["latin"]},{"family":"Della Respira","variants":["regular"],"subsets":["latin"]},{"family":"Denk One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Devonshire","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Dhurjati","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Didact Gothic","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Diplomata","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Diplomata SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Do Hyeon","variants":["regular"],"subsets":["korean","latin"]},{"family":"Dokdo","variants":["regular"],"subsets":["korean","latin"]},{"family":"Domine","variants":["regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"Donegal One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Doppio One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Dorsa","variants":["regular"],"subsets":["latin"]},{"family":"Dosis","variants":["200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Dr Sugiyama","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Duru Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Dynalight","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"EB Garamond","variants":["regular","500","600","700","800","italic","500italic","600italic","700italic","800italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Eagle Lake","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"East Sea Dokdo","variants":["regular"],"subsets":["korean","latin"]},{"family":"Eater","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Economica","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Eczar","variants":["regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"El Messiri","variants":["regular","500","600","700"],"subsets":["arabic","cyrillic","latin"]},{"family":"Electrolize","variants":["regular"],"subsets":["latin"]},{"family":"Elsie","variants":["regular","900"],"subsets":["latin","latin-ext"]},{"family":"Elsie Swash Caps","variants":["regular","900"],"subsets":["latin","latin-ext"]},{"family":"Emblema One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Emilys Candy","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Encode Sans","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Expanded","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Semi Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Semi Expanded","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Engagement","variants":["regular"],"subsets":["latin"]},{"family":"Englebert","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Enriqueta","variants":["regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"Epilogue","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Erica One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Esteban","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Euphoria Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ewert","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Exo","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Exo 2","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Expletus Sans","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin"]},{"family":"Fahkwang","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Fanwood Text","variants":["regular","italic"],"subsets":["latin"]},{"family":"Farro","variants":["300","regular","500","700"],"subsets":["latin","latin-ext"]},{"family":"Farsan","variants":["regular"],"subsets":["gujarati","latin","latin-ext","vietnamese"]},{"family":"Fascinate","variants":["regular"],"subsets":["latin"]},{"family":"Fascinate Inline","variants":["regular"],"subsets":["latin"]},{"family":"Faster One","variants":["regular"],"subsets":["latin"]},{"family":"Fasthand","variants":["regular"],"subsets":["khmer"]},{"family":"Fauna One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Faustina","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Federant","variants":["regular"],"subsets":["latin"]},{"family":"Federo","variants":["regular"],"subsets":["latin"]},{"family":"Felipa","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fenix","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Finger Paint","variants":["regular"],"subsets":["latin"]},{"family":"Fira Code","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Fira Mono","variants":["regular","500","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Fira Sans","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Fira Sans Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Fira Sans Extra Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Fjalla One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fjord One","variants":["regular"],"subsets":["latin"]},{"family":"Flamenco","variants":["300","regular"],"subsets":["latin"]},{"family":"Flavors","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fondamento","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Fontdiner Swanky","variants":["regular"],"subsets":["latin"]},{"family":"Forum","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Francois One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Frank Ruhl Libre","variants":["300","regular","500","700","900"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Freckle Face","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fredericka the Great","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fredoka One","variants":["regular"],"subsets":["latin"]},{"family":"Freehand","variants":["regular"],"subsets":["khmer"]},{"family":"Fresca","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Frijole","variants":["regular"],"subsets":["latin"]},{"family":"Fruktur","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fugaz One","variants":["regular"],"subsets":["latin"]},{"family":"GFS Didot","variants":["regular"],"subsets":["greek"]},{"family":"GFS Neohellenic","variants":["regular","italic","700","700italic"],"subsets":["greek"]},{"family":"Gabriela","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin"]},{"family":"Gaegu","variants":["300","regular","700"],"subsets":["korean","latin"]},{"family":"Gafata","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Galada","variants":["regular"],"subsets":["bengali","latin"]},{"family":"Galdeano","variants":["regular"],"subsets":["latin"]},{"family":"Galindo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Gamja Flower","variants":["regular"],"subsets":["korean","latin"]},{"family":"Gayathri","variants":["100","regular","700"],"subsets":["latin","malayalam"]},{"family":"Gelasio","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Gentium Basic","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Gentium Book Basic","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Geo","variants":["regular","italic"],"subsets":["latin"]},{"family":"Geostar","variants":["regular"],"subsets":["latin"]},{"family":"Geostar Fill","variants":["regular"],"subsets":["latin"]},{"family":"Germania One","variants":["regular"],"subsets":["latin"]},{"family":"Gidugu","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Gilda Display","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Girassol","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Give You Glory","variants":["regular"],"subsets":["latin"]},{"family":"Glass Antiqua","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Glegoo","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Gloria Hallelujah","variants":["regular"],"subsets":["latin"]},{"family":"Goblin One","variants":["regular"],"subsets":["latin"]},{"family":"Gochi Hand","variants":["regular"],"subsets":["latin"]},{"family":"Goldman","variants":["regular","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Gorditas","variants":["regular","700"],"subsets":["latin"]},{"family":"Gothic A1","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["korean","latin"]},{"family":"Gotu","variants":["regular"],"subsets":["devanagari","latin","latin-ext","vietnamese"]},{"family":"Goudy Bookletter 1911","variants":["regular"],"subsets":["latin"]},{"family":"Graduate","variants":["regular"],"subsets":["latin"]},{"family":"Grand Hotel","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Grandstander","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Gravitas One","variants":["regular"],"subsets":["latin"]},{"family":"Great Vibes","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Grenze","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Grenze Gotisch","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Griffy","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Gruppo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Gudea","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Gugi","variants":["regular"],"subsets":["korean","latin"]},{"family":"Gupter","variants":["regular","500","700"],"subsets":["latin"]},{"family":"Gurajada","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Habibi","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Halant","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Hammersmith One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Hanalei","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Hanalei Fill","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Handlee","variants":["regular"],"subsets":["latin"]},{"family":"Hanuman","variants":["regular","700"],"subsets":["khmer"]},{"family":"Happy Monkey","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Harmattan","variants":["regular","700"],"subsets":["arabic","latin","latin-ext"]},{"family":"Headland One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Heebo","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["hebrew","latin"]},{"family":"Henny Penny","variants":["regular"],"subsets":["latin"]},{"family":"Hepta Slab","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Herr Von Muellerhoff","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Hi Melody","variants":["regular"],"subsets":["korean","latin"]},{"family":"Hind","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Hind Guntur","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","telugu"]},{"family":"Hind Madurai","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","tamil"]},{"family":"Hind Siliguri","variants":["300","regular","500","600","700"],"subsets":["bengali","latin","latin-ext"]},{"family":"Hind Vadodara","variants":["300","regular","500","600","700"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Holtwood One SC","variants":["regular"],"subsets":["latin"]},{"family":"Homemade Apple","variants":["regular"],"subsets":["latin"]},{"family":"Homenaje","variants":["regular"],"subsets":["latin"]},{"family":"IBM Plex Mono","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"IBM Plex Sans","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"IBM Plex Sans Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"IBM Plex Serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"IM Fell DW Pica","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell DW Pica SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell Double Pica","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell Double Pica SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell English","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell English SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell French Canon","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell French Canon SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell Great Primer","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell Great Primer SC","variants":["regular"],"subsets":["latin"]},{"family":"Ibarra Real Nova","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext"]},{"family":"Iceberg","variants":["regular"],"subsets":["latin"]},{"family":"Iceland","variants":["regular"],"subsets":["latin"]},{"family":"Imprima","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Inconsolata","variants":["200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Inder","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Indie Flower","variants":["regular"],"subsets":["latin"]},{"family":"Inika","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Inknut Antiqua","variants":["300","regular","500","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Inria Sans","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Inria Serif","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Inter","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Irish Grover","variants":["regular"],"subsets":["latin"]},{"family":"Istok Web","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Italiana","variants":["regular"],"subsets":["latin"]},{"family":"Italianno","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Itim","variants":["regular"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Jacques Francois","variants":["regular"],"subsets":["latin"]},{"family":"Jacques Francois Shadow","variants":["regular"],"subsets":["latin"]},{"family":"Jaldi","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"JetBrains Mono","variants":["100","200","300","regular","500","600","700","800","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Jim Nightshade","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jockey One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jolly Lodger","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jomhuria","variants":["regular"],"subsets":["arabic","latin","latin-ext"]},{"family":"Jomolhari","variants":["regular"],"subsets":["latin","tibetan"]},{"family":"Josefin Sans","variants":["100","200","300","regular","500","600","700","100italic","200italic","300italic","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Josefin Slab","variants":["100","200","300","regular","500","600","700","100italic","200italic","300italic","italic","500italic","600italic","700italic"],"subsets":["latin"]},{"family":"Jost","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Joti One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jua","variants":["regular"],"subsets":["korean","latin"]},{"family":"Judson","variants":["regular","italic","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Julee","variants":["regular"],"subsets":["latin"]},{"family":"Julius Sans One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Junge","variants":["regular"],"subsets":["latin"]},{"family":"Jura","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Just Another Hand","variants":["regular"],"subsets":["latin"]},{"family":"Just Me Again Down Here","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"K2D","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kadwa","variants":["regular","700"],"subsets":["devanagari","latin"]},{"family":"Kalam","variants":["300","regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Kameron","variants":["regular","700"],"subsets":["latin"]},{"family":"Kanit","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kantumruy","variants":["300","regular","700"],"subsets":["khmer"]},{"family":"Karla","variants":["200","300","regular","500","600","700","800","200italic","300italic","italic","500italic","600italic","700italic","800italic"],"subsets":["latin","latin-ext"]},{"family":"Karma","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Katibeh","variants":["regular"],"subsets":["arabic","latin","latin-ext"]},{"family":"Kaushan Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Kavivanar","variants":["regular"],"subsets":["latin","latin-ext","tamil"]},{"family":"Kavoon","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Kdam Thmor","variants":["regular"],"subsets":["khmer"]},{"family":"Keania One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Kelly Slab","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Kenia","variants":["regular"],"subsets":["latin"]},{"family":"Khand","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Khmer","variants":["regular"],"subsets":["khmer"]},{"family":"Khula","variants":["300","regular","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Kirang Haerang","variants":["regular"],"subsets":["korean","latin"]},{"family":"Kite One","variants":["regular"],"subsets":["latin"]},{"family":"Knewave","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"KoHo","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kodchasan","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kosugi","variants":["regular"],"subsets":["cyrillic","japanese","latin"]},{"family":"Kosugi Maru","variants":["regular"],"subsets":["cyrillic","japanese","latin"]},{"family":"Kotta One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Koulen","variants":["regular"],"subsets":["khmer"]},{"family":"Kranky","variants":["regular"],"subsets":["latin"]},{"family":"Kreon","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"Kristi","variants":["regular"],"subsets":["latin"]},{"family":"Krona One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Krub","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kufam","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Kulim Park","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Kumar One","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Kumar One Outline","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Kumbh Sans","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Kurale","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","devanagari","latin","latin-ext"]},{"family":"La Belle Aurore","variants":["regular"],"subsets":["latin"]},{"family":"Lacquer","variants":["regular"],"subsets":["latin"]},{"family":"Laila","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Lakki Reddy","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Lalezar","variants":["regular"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Lancelot","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Langar","variants":["regular"],"subsets":["gurmukhi","latin","latin-ext"]},{"family":"Lateef","variants":["regular"],"subsets":["arabic","latin"]},{"family":"Lato","variants":["100","100italic","300","300italic","regular","italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"League Script","variants":["regular"],"subsets":["latin"]},{"family":"Leckerli One","variants":["regular"],"subsets":["latin"]},{"family":"Ledger","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Lekton","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Lemon","variants":["regular"],"subsets":["latin"]},{"family":"Lemonada","variants":["300","regular","500","600","700"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Lexend Deca","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Exa","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Giga","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Mega","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Peta","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Tera","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Zetta","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Libre Barcode 128","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 128 Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39 Extended","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39 Extended Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39 Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode EAN13 Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Baskerville","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Libre Caslon Display","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Libre Caslon Text","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Libre Franklin","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Life Savers","variants":["regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"Lilita One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Lily Script One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Limelight","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Linden Hill","variants":["regular","italic"],"subsets":["latin"]},{"family":"Literata","variants":["200","300","regular","500","600","700","800","900","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Liu Jian Mao Cao","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Livvic","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lobster","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Lobster Two","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Londrina Outline","variants":["regular"],"subsets":["latin"]},{"family":"Londrina Shadow","variants":["regular"],"subsets":["latin"]},{"family":"Londrina Sketch","variants":["regular"],"subsets":["latin"]},{"family":"Londrina Solid","variants":["100","300","regular","900"],"subsets":["latin"]},{"family":"Long Cang","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Lora","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Love Ya Like A Sister","variants":["regular"],"subsets":["latin"]},{"family":"Loved by the King","variants":["regular"],"subsets":["latin"]},{"family":"Lovers Quarrel","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Luckiest Guy","variants":["regular"],"subsets":["latin"]},{"family":"Lusitana","variants":["regular","700"],"subsets":["latin"]},{"family":"Lustria","variants":["regular"],"subsets":["latin"]},{"family":"M PLUS 1p","variants":["100","300","regular","500","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","japanese","latin","latin-ext","vietnamese"]},{"family":"M PLUS Rounded 1c","variants":["100","300","regular","500","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","japanese","latin","latin-ext","vietnamese"]},{"family":"Ma Shan Zheng","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Macondo","variants":["regular"],"subsets":["latin"]},{"family":"Macondo Swash Caps","variants":["regular"],"subsets":["latin"]},{"family":"Mada","variants":["200","300","regular","500","600","700","900"],"subsets":["arabic","latin"]},{"family":"Magra","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Maiden Orange","variants":["regular"],"subsets":["latin"]},{"family":"Maitree","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Major Mono Display","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Mako","variants":["regular"],"subsets":["latin"]},{"family":"Mali","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Mallanna","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Mandali","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Manjari","variants":["100","regular","700"],"subsets":["latin","malayalam"]},{"family":"Manrope","variants":["200","300","regular","500","600","700","800"],"subsets":["cyrillic","greek","latin","latin-ext"]},{"family":"Mansalva","variants":["regular"],"subsets":["latin"]},{"family":"Manuale","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Marcellus","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Marcellus SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Marck Script","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Margarine","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Markazi Text","variants":["regular","500","600","700"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Marko One","variants":["regular"],"subsets":["latin"]},{"family":"Marmelad","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Martel","variants":["200","300","regular","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Martel Sans","variants":["200","300","regular","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Marvel","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Mate","variants":["regular","italic"],"subsets":["latin"]},{"family":"Mate SC","variants":["regular"],"subsets":["latin"]},{"family":"Maven Pro","variants":["regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"McLaren","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Meddon","variants":["regular"],"subsets":["latin"]},{"family":"MedievalSharp","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Medula One","variants":["regular"],"subsets":["latin"]},{"family":"Meera Inimai","variants":["regular"],"subsets":["latin","tamil"]},{"family":"Megrim","variants":["regular"],"subsets":["latin"]},{"family":"Meie Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Merienda","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Merienda One","variants":["regular"],"subsets":["latin"]},{"family":"Merriweather","variants":["300","300italic","regular","italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Merriweather Sans","variants":["300","regular","500","600","700","800","300italic","italic","500italic","600italic","700italic","800italic"],"subsets":["cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Metal","variants":["regular"],"subsets":["khmer"]},{"family":"Metal Mania","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Metamorphous","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Metrophobic","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Michroma","variants":["regular"],"subsets":["latin"]},{"family":"Milonga","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Miltonian","variants":["regular"],"subsets":["latin"]},{"family":"Miltonian Tattoo","variants":["regular"],"subsets":["latin"]},{"family":"Mina","variants":["regular","700"],"subsets":["bengali","latin","latin-ext"]},{"family":"Miniver","variants":["regular"],"subsets":["latin"]},{"family":"Miriam Libre","variants":["regular","700"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Mirza","variants":["regular","500","600","700"],"subsets":["arabic","latin","latin-ext"]},{"family":"Miss Fajardose","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mitr","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Modak","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Modern Antiqua","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mogra","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Molengo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Molle","variants":["italic"],"subsets":["latin","latin-ext"]},{"family":"Monda","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Monofett","variants":["regular"],"subsets":["latin"]},{"family":"Monoton","variants":["regular"],"subsets":["latin"]},{"family":"Monsieur La Doulaise","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Montaga","variants":["regular"],"subsets":["latin"]},{"family":"Montez","variants":["regular"],"subsets":["latin"]},{"family":"Montserrat","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Montserrat Alternates","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Montserrat Subrayada","variants":["regular","700"],"subsets":["latin"]},{"family":"Moul","variants":["regular"],"subsets":["khmer"]},{"family":"Moulpali","variants":["regular"],"subsets":["khmer"]},{"family":"Mountains of Christmas","variants":["regular","700"],"subsets":["latin"]},{"family":"Mouse Memoirs","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mr Bedfort","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mr Dafoe","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mr De Haviland","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mrs Saint Delafield","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mrs Sheppards","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mukta","variants":["200","300","regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Mukta Mahee","variants":["200","300","regular","500","600","700","800"],"subsets":["gurmukhi","latin","latin-ext"]},{"family":"Mukta Malar","variants":["200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext","tamil"]},{"family":"Mukta Vaani","variants":["200","300","regular","500","600","700","800"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Mulish","variants":["200","300","regular","500","600","700","800","900","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"MuseoModerno","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Mystery Quest","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"NTR","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Nanum Brush Script","variants":["regular"],"subsets":["korean","latin"]},{"family":"Nanum Gothic","variants":["regular","700","800"],"subsets":["korean","latin"]},{"family":"Nanum Gothic Coding","variants":["regular","700"],"subsets":["korean","latin"]},{"family":"Nanum Myeongjo","variants":["regular","700","800"],"subsets":["korean","latin"]},{"family":"Nanum Pen Script","variants":["regular"],"subsets":["korean","latin"]},{"family":"Nerko One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Neucha","variants":["regular"],"subsets":["cyrillic","latin"]},{"family":"Neuton","variants":["200","300","regular","italic","700","800"],"subsets":["latin","latin-ext"]},{"family":"New Rocker","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"News Cycle","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Niconne","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Niramit","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Nixie One","variants":["regular"],"subsets":["latin"]},{"family":"Nobile","variants":["regular","italic","500","500italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Nokora","variants":["regular","700"],"subsets":["khmer"]},{"family":"Norican","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Nosifer","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Notable","variants":["regular"],"subsets":["latin"]},{"family":"Nothing You Could Do","variants":["regular"],"subsets":["latin"]},{"family":"Noticia Text","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Noto Sans","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","devanagari","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Noto Sans HK","variants":["100","300","regular","500","700","900"],"subsets":["chinese-hongkong","latin"]},{"family":"Noto Sans JP","variants":["100","300","regular","500","700","900"],"subsets":["japanese","latin"]},{"family":"Noto Sans KR","variants":["100","300","regular","500","700","900"],"subsets":["korean","latin"]},{"family":"Noto Sans SC","variants":["100","300","regular","500","700","900"],"subsets":["chinese-simplified","latin"]},{"family":"Noto Sans TC","variants":["100","300","regular","500","700","900"],"subsets":["chinese-traditional","latin"]},{"family":"Noto Serif","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Noto Serif JP","variants":["200","300","regular","500","600","700","900"],"subsets":["japanese","latin"]},{"family":"Noto Serif KR","variants":["200","300","regular","500","600","700","900"],"subsets":["korean","latin"]},{"family":"Noto Serif SC","variants":["200","300","regular","500","600","700","900"],"subsets":["chinese-simplified","latin"]},{"family":"Noto Serif TC","variants":["200","300","regular","500","600","700","900"],"subsets":["chinese-traditional","latin"]},{"family":"Nova Cut","variants":["regular"],"subsets":["latin"]},{"family":"Nova Flat","variants":["regular"],"subsets":["latin"]},{"family":"Nova Mono","variants":["regular"],"subsets":["greek","latin"]},{"family":"Nova Oval","variants":["regular"],"subsets":["latin"]},{"family":"Nova Round","variants":["regular"],"subsets":["latin"]},{"family":"Nova Script","variants":["regular"],"subsets":["latin"]},{"family":"Nova Slim","variants":["regular"],"subsets":["latin"]},{"family":"Nova Square","variants":["regular"],"subsets":["latin"]},{"family":"Numans","variants":["regular"],"subsets":["latin"]},{"family":"Nunito","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Nunito Sans","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Odibee Sans","variants":["regular"],"subsets":["latin"]},{"family":"Odor Mean Chey","variants":["regular"],"subsets":["khmer"]},{"family":"Offside","variants":["regular"],"subsets":["latin"]},{"family":"Old Standard TT","variants":["regular","italic","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Oldenburg","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Oleo Script","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Oleo Script Swash Caps","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Open Sans","variants":["300","300italic","regular","italic","600","600italic","700","700italic","800","800italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Open Sans Condensed","variants":["300","300italic","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Oranienbaum","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Orbitron","variants":["regular","500","600","700","800","900"],"subsets":["latin"]},{"family":"Oregano","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Orienta","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Original Surfer","variants":["regular"],"subsets":["latin"]},{"family":"Oswald","variants":["200","300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Over the Rainbow","variants":["regular"],"subsets":["latin"]},{"family":"Overlock","variants":["regular","italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Overlock SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Overpass","variants":["100","100italic","200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Overpass Mono","variants":["300","regular","600","700"],"subsets":["latin","latin-ext"]},{"family":"Ovo","variants":["regular"],"subsets":["latin"]},{"family":"Oxanium","variants":["200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext"]},{"family":"Oxygen","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Oxygen Mono","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"PT Mono","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Sans","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Sans Caption","variants":["regular","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Sans Narrow","variants":["regular","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Serif","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Serif Caption","variants":["regular","italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Pacifico","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Padauk","variants":["regular","700"],"subsets":["latin","myanmar"]},{"family":"Palanquin","variants":["100","200","300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Palanquin Dark","variants":["regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Pangolin","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Paprika","variants":["regular"],"subsets":["latin"]},{"family":"Parisienne","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Passero One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Passion One","variants":["regular","700","900"],"subsets":["latin","latin-ext"]},{"family":"Pathway Gothic One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Patrick Hand","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Patrick Hand SC","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Pattaya","variants":["regular"],"subsets":["cyrillic","latin","latin-ext","thai","vietnamese"]},{"family":"Patua One","variants":["regular"],"subsets":["latin"]},{"family":"Pavanam","variants":["regular"],"subsets":["latin","latin-ext","tamil"]},{"family":"Paytone One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Peddana","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Peralta","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Permanent Marker","variants":["regular"],"subsets":["latin"]},{"family":"Petit Formal Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Petrona","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Philosopher","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","vietnamese"]},{"family":"Piazzolla","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Piedra","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Pinyon Script","variants":["regular"],"subsets":["latin"]},{"family":"Pirata One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Plaster","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Play","variants":["regular","700"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Playball","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Playfair Display","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Playfair Display SC","variants":["regular","italic","700","700italic","900","900italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Podkova","variants":["regular","500","600","700","800"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Poiret One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Poller One","variants":["regular"],"subsets":["latin"]},{"family":"Poly","variants":["regular","italic"],"subsets":["latin"]},{"family":"Pompiere","variants":["regular"],"subsets":["latin"]},{"family":"Pontano Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Poor Story","variants":["regular"],"subsets":["korean","latin"]},{"family":"Poppins","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Port Lligat Sans","variants":["regular"],"subsets":["latin"]},{"family":"Port Lligat Slab","variants":["regular"],"subsets":["latin"]},{"family":"Pragati Narrow","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Prata","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","vietnamese"]},{"family":"Preahvihear","variants":["regular"],"subsets":["khmer"]},{"family":"Press Start 2P","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext"]},{"family":"Pridi","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Princess Sofia","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Prociono","variants":["regular"],"subsets":["latin"]},{"family":"Prompt","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Prosto One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Proza Libre","variants":["regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext"]},{"family":"Public Sans","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext"]},{"family":"Puritan","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Purple Purse","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Quando","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Quantico","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Quattrocento","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Quattrocento Sans","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Questrial","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Quicksand","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Quintessential","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Qwigley","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Racing Sans One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Radley","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Rajdhani","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Rakkas","variants":["regular"],"subsets":["arabic","latin","latin-ext"]},{"family":"Raleway","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Raleway Dots","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ramabhadra","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Ramaraja","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Rambla","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Rammetto One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ranchers","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rancho","variants":["regular"],"subsets":["latin"]},{"family":"Ranga","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Rasa","variants":["300","regular","500","600","700"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Rationale","variants":["regular"],"subsets":["latin"]},{"family":"Ravi Prakash","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Recursive","variants":["300","regular","500","600","700","800","900"],"subsets":["latin","vietnamese"]},{"family":"Red Hat Display","variants":["regular","italic","500","500italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Red Hat Text","variants":["regular","italic","500","500italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Red Rose","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Redressed","variants":["regular"],"subsets":["latin"]},{"family":"Reem Kufi","variants":["regular"],"subsets":["arabic","latin"]},{"family":"Reenie Beanie","variants":["regular"],"subsets":["latin"]},{"family":"Revalia","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rhodium Libre","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Ribeye","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ribeye Marrow","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Righteous","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Risque","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Roboto","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Roboto Condensed","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Roboto Mono","variants":["100","200","300","regular","500","600","700","100italic","200italic","300italic","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Roboto Slab","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Rochester","variants":["regular"],"subsets":["latin"]},{"family":"Rock Salt","variants":["regular"],"subsets":["latin"]},{"family":"Rokkitt","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Romanesco","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ropa Sans","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Rosario","variants":["300","regular","500","600","700","300italic","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Rosarivo","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Rouge Script","variants":["regular"],"subsets":["latin"]},{"family":"Rowdies","variants":["300","regular","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Rozha One","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Rubik","variants":["300","regular","500","600","700","800","900","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","hebrew","latin","latin-ext"]},{"family":"Rubik Mono One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Ruda","variants":["regular","500","600","700","800","900"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Rufina","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Ruge Boogie","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ruluko","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rum Raisin","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ruslan Display","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Russo One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Ruthie","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rye","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sacramento","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sahitya","variants":["regular","700"],"subsets":["devanagari","latin"]},{"family":"Sail","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Saira","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Extra Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Semi Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Stencil One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Salsa","variants":["regular"],"subsets":["latin"]},{"family":"Sanchez","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Sancreek","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sansita","variants":["regular","italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Sansita Swashed","variants":["300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Sarabun","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Sarala","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Sarina","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sarpanch","variants":["regular","500","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Satisfy","variants":["regular"],"subsets":["latin"]},{"family":"Sawarabi Gothic","variants":["regular"],"subsets":["cyrillic","japanese","latin","latin-ext","vietnamese"]},{"family":"Sawarabi Mincho","variants":["regular"],"subsets":["japanese","latin","latin-ext"]},{"family":"Scada","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Scheherazade","variants":["regular","700"],"subsets":["arabic","latin"]},{"family":"Schoolbell","variants":["regular"],"subsets":["latin"]},{"family":"Scope One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Seaweed Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Secular One","variants":["regular"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Sedgwick Ave","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Sedgwick Ave Display","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Sen","variants":["regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"Sevillana","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Seymour One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Shadows Into Light","variants":["regular"],"subsets":["latin"]},{"family":"Shadows Into Light Two","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Shanti","variants":["regular"],"subsets":["latin"]},{"family":"Share","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Share Tech","variants":["regular"],"subsets":["latin"]},{"family":"Share Tech Mono","variants":["regular"],"subsets":["latin"]},{"family":"Shojumaru","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Short Stack","variants":["regular"],"subsets":["latin"]},{"family":"Shrikhand","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Siemreap","variants":["regular"],"subsets":["khmer"]},{"family":"Sigmar One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Signika","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Signika Negative","variants":["300","regular","600","700"],"subsets":["latin","latin-ext"]},{"family":"Simonetta","variants":["regular","italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Single Day","variants":["regular"],"subsets":["korean"]},{"family":"Sintony","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Sirin Stencil","variants":["regular"],"subsets":["latin"]},{"family":"Six Caps","variants":["regular"],"subsets":["latin"]},{"family":"Skranji","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Slabo 13px","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Slabo 27px","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Slackey","variants":["regular"],"subsets":["latin"]},{"family":"Smokum","variants":["regular"],"subsets":["latin"]},{"family":"Smythe","variants":["regular"],"subsets":["latin"]},{"family":"Sniglet","variants":["regular","800"],"subsets":["latin","latin-ext"]},{"family":"Snippet","variants":["regular"],"subsets":["latin"]},{"family":"Snowburst One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sofadi One","variants":["regular"],"subsets":["latin"]},{"family":"Sofia","variants":["regular"],"subsets":["latin"]},{"family":"Solway","variants":["300","regular","500","700","800"],"subsets":["latin"]},{"family":"Song Myung","variants":["regular"],"subsets":["korean","latin"]},{"family":"Sonsie One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sora","variants":["100","200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext"]},{"family":"Sorts Mill Goudy","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Source Code Pro","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Source Sans Pro","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Source Serif Pro","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Space Grotesk","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Space Mono","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Spartan","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext"]},{"family":"Special Elite","variants":["regular"],"subsets":["latin"]},{"family":"Spectral","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Spectral SC","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Spicy Rice","variants":["regular"],"subsets":["latin"]},{"family":"Spinnaker","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Spirax","variants":["regular"],"subsets":["latin"]},{"family":"Squada One","variants":["regular"],"subsets":["latin"]},{"family":"Sree Krushnadevaraya","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Sriracha","variants":["regular"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Srisakdi","variants":["regular","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Staatliches","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stalemate","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stalinist One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Stardos Stencil","variants":["regular","700"],"subsets":["latin"]},{"family":"Stint Ultra Condensed","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stint Ultra Expanded","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stoke","variants":["300","regular"],"subsets":["latin","latin-ext"]},{"family":"Strait","variants":["regular"],"subsets":["latin"]},{"family":"Stylish","variants":["regular"],"subsets":["korean","latin"]},{"family":"Sue Ellen Francisco","variants":["regular"],"subsets":["latin"]},{"family":"Suez One","variants":["regular"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Sulphur Point","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Sumana","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Sunflower","variants":["300","500","700"],"subsets":["korean","latin"]},{"family":"Sunshiney","variants":["regular"],"subsets":["latin"]},{"family":"Supermercado One","variants":["regular"],"subsets":["latin"]},{"family":"Sura","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Suranna","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Suravaram","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Suwannaphum","variants":["regular"],"subsets":["khmer"]},{"family":"Swanky and Moo Moo","variants":["regular"],"subsets":["latin"]},{"family":"Syncopate","variants":["regular","700"],"subsets":["latin"]},{"family":"Syne","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext"]},{"family":"Syne Mono","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Syne Tactile","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Tajawal","variants":["200","300","regular","500","700","800","900"],"subsets":["arabic","latin"]},{"family":"Tangerine","variants":["regular","700"],"subsets":["latin"]},{"family":"Taprom","variants":["regular"],"subsets":["khmer"]},{"family":"Tauri","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Taviraj","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Teko","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Telex","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Tenali Ramakrishna","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Tenor Sans","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Text Me One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Texturina","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Thasadith","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"The Girl Next Door","variants":["regular"],"subsets":["latin"]},{"family":"Tienne","variants":["regular","700","900"],"subsets":["latin"]},{"family":"Tillana","variants":["regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Timmana","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Tinos","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","latin","latin-ext","vietnamese"]},{"family":"Titan One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Titillium Web","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900"],"subsets":["latin","latin-ext"]},{"family":"Tomorrow","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Trade Winds","variants":["regular"],"subsets":["latin"]},{"family":"Trirong","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Trispace","variants":["100","200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Trocchi","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Trochut","variants":["regular","italic","700"],"subsets":["latin"]},{"family":"Trykker","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Tulpen One","variants":["regular"],"subsets":["latin"]},{"family":"Turret Road","variants":["200","300","regular","500","700","800"],"subsets":["latin","latin-ext"]},{"family":"Ubuntu","variants":["300","300italic","regular","italic","500","500italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Ubuntu Condensed","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Ubuntu Mono","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Ultra","variants":["regular"],"subsets":["latin"]},{"family":"Uncial Antiqua","variants":["regular"],"subsets":["latin"]},{"family":"Underdog","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Unica One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"UnifrakturCook","variants":["700"],"subsets":["latin"]},{"family":"UnifrakturMaguntia","variants":["regular"],"subsets":["latin"]},{"family":"Unkempt","variants":["regular","700"],"subsets":["latin"]},{"family":"Unlock","variants":["regular"],"subsets":["latin"]},{"family":"Unna","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"VT323","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Vampiro One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Varela","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Varela Round","variants":["regular"],"subsets":["hebrew","latin","latin-ext","vietnamese"]},{"family":"Varta","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Vast Shadow","variants":["regular"],"subsets":["latin"]},{"family":"Vesper Libre","variants":["regular","500","700","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Viaoda Libre","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Vibes","variants":["regular"],"subsets":["arabic","latin"]},{"family":"Vibur","variants":["regular"],"subsets":["latin"]},{"family":"Vidaloka","variants":["regular"],"subsets":["latin"]},{"family":"Viga","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Voces","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Volkhov","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Vollkorn","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Vollkorn SC","variants":["regular","600","700","900"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Voltaire","variants":["regular"],"subsets":["latin"]},{"family":"Waiting for the Sunrise","variants":["regular"],"subsets":["latin"]},{"family":"Wallpoet","variants":["regular"],"subsets":["latin"]},{"family":"Walter Turncoat","variants":["regular"],"subsets":["latin"]},{"family":"Warnes","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Wellfleet","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Wendy One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Wire One","variants":["regular"],"subsets":["latin"]},{"family":"Work Sans","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Xanh Mono","variants":["regular","italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Yanone Kaffeesatz","variants":["200","300","regular","500","600","700"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Yantramanav","variants":["100","300","regular","500","700","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Yatra One","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Yellowtail","variants":["regular"],"subsets":["latin"]},{"family":"Yeon Sung","variants":["regular"],"subsets":["korean","latin"]},{"family":"Yeseva One","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Yesteryear","variants":["regular"],"subsets":["latin"]},{"family":"Yrsa","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"ZCOOL KuaiLe","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"ZCOOL QingKe HuangYou","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"ZCOOL XiaoWei","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Zeyada","variants":["regular"],"subsets":["latin"]},{"family":"Zhi Mang Xing","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Zilla Slab","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Zilla Slab Highlight","variants":["regular","700"],"subsets":["latin","latin-ext"]}]')},function(e,t){e.exports="dist/images/components-design-separator-control-curve-1.a61eacd.png"},function(e,t){e.exports="dist/images/components-design-separator-control-curve-2.7a9883c.png"},function(e,t){e.exports="dist/images/components-design-separator-control-curve-3.b42e517.png"},function(e,t){e.exports="dist/images/components-design-separator-control-rounded-1.d2b77d9.png"},function(e,t){e.exports="dist/images/components-design-separator-control-rounded-2.e6d5edc.png"},function(e,t){e.exports="dist/images/components-design-separator-control-rounded-3.54719e2.png"},function(e,t){e.exports="dist/images/components-design-separator-control-slant-1.1a7bbee.png"},function(e,t){e.exports="dist/images/components-design-separator-control-slant-2.622c736.png"},function(e,t){e.exports="dist/images/components-design-separator-control-straight-1.3d6e794.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-1.479a6de.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-2.8ad6a1d.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-3.6db0486.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-4.5f9e008.png"},,function(e,t){e.exports="dist/images/components-button-controls-basic.b11a0a1.png"},function(e,t){e.exports="dist/images/components-button-controls-ghost.693bd0a.png"},function(e,t){e.exports="dist/images/components-button-controls-link.5941222.png"},function(e,t){e.exports="dist/images/components-button-controls-plain.9a9337a.png"},function(e,t){e.exports="dist/images/components-icon-controls-plain.08b10ae.png"},function(e,t){e.exports="dist/images/components-icon-controls-shaped.f4f347f.png"},function(e,t){e.exports="dist/images/components-icon-controls-outlined.ecba760.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1.b25dc1c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2.251f715.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3.a91efa1.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1.4c4319a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2.c441aac.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3.2409bb5.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4.9b307d9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1.ec684b9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2.4601b46.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3.4ef0451.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-grid.c178b51.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-grid.9c461c0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-grid.3921dc3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-grid.fe6e028.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-grid.5c04307.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-grid.111efd7.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-grid.ef73de3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-grid.146feaa.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-grid.5d65a3e.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-grid.906e9b0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-uneven.7045e09.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-uneven.a4f271c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-uneven.1983521.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-uneven.929b1cf.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-uneven.a346601.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-uneven.84b5000.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-uneven.42a4995.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-uneven.430f93a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-uneven.f1a848f.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-uneven.8099e5e.png"},,,function(e,t){e.exports="dist/videos/help/full-height.mp4"},function(e,t){e.exports="dist/videos/help/general-restrict-content.mp4"},function(e,t){e.exports="dist/videos/help/general-border-radius.mp4"},function(e,t){e.exports="dist/videos/help/general-shadow.mp4"},function(e,t){e.exports="dist/videos/help/alignment-all.mp4"},function(e,t){e.exports="dist/videos/help/general-columns.mp4"},function(e,t){e.exports="dist/videos/help/column-background-on-off.mp4"},function(e,t){e.exports="dist/videos/help/image-shape.mp4"},function(e,t){e.exports="dist/videos/help/image-size.mp4"},function(e,t){e.exports="dist/videos/help/image-size-no-crop.mp4"},function(e,t){e.exports="dist/videos/help/image-width-crop.mp4"},function(e,t){e.exports="dist/videos/help/image-height-crop.mp4"},function(e,t){e.exports="dist/videos/help/image-square.mp4"},function(e,t){e.exports="dist/videos/help/image-border-radius.mp4"},function(e,t){e.exports="dist/videos/help/image-shadow.mp4"},function(e,t){e.exports="dist/videos/help/typography-size.mp4"},function(e,t){e.exports="dist/videos/help/typography-weight.mp4"},function(e,t){e.exports="dist/videos/help/typography-transform.mp4"},function(e,t){e.exports="dist/videos/help/typography-line-height.mp4"},function(e,t){e.exports="dist/videos/help/typography-letter-spacing.mp4"},function(e,t){e.exports="dist/videos/help/alignment-description.mp4"},function(e,t){e.exports="dist/videos/help/alignment-button.mp4"},function(e,t){e.exports="dist/videos/help/button-padding.mp4"},function(e,t){e.exports="dist/videos/help/button-vertical-padding.mp4"},function(e,t){e.exports="dist/videos/help/button-horizontal-padding.mp4"},function(e,t){e.exports="dist/videos/help/button-size.mp4"},function(e,t){e.exports="dist/videos/help/button-hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/button-hover-opacity.mp4"},function(e,t){e.exports="dist/videos/help/button-hover-color.mp4"},function(e,t){e.exports="dist/videos/help/button-shadow.mp4"},function(e,t){e.exports="dist/videos/help/button-border-radius.mp4"},function(e,t){e.exports="dist/videos/help/button-color-type.mp4"},function(e,t){e.exports="dist/videos/help/button-to-normal.mp4"},function(e,t){e.exports="dist/videos/help/button-collapse.mp4"},function(e,t){e.exports="dist/videos/help/spacing.mp4"},function(e,t){e.exports="dist/videos/help/spacing-block-title.mp4"},function(e,t){e.exports="dist/videos/help/spacing-block-description.mp4"},function(e,t){e.exports="dist/videos/help/spacing-description.mp4"},function(e,t){e.exports="dist/videos/help/spacing-button.mp4"},function(e,t){e.exports="dist/videos/help/spacing-button-gap.mp4"},function(e,t){e.exports="dist/videos/help/hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/background-on-off.mp4"},function(e,t){e.exports="dist/videos/help/background-color-opacity.mp4"},function(e,t){e.exports="dist/videos/help/background-tint.mp4"},function(e,t){e.exports="dist/videos/help/background-color-type.mp4"},function(e,t){e.exports="dist/videos/help/background-fixed.mp4"},function(e,t){e.exports="dist/videos/help/gradient-direction.mp4"},function(e,t){e.exports="dist/videos/help/gradient-location.mp4"},function(e,t){e.exports="dist/videos/help/background-image-position.mp4"},function(e,t){e.exports="dist/videos/help/background-image-repeat.mp4"},function(e,t){e.exports="dist/videos/help/background-image-size.mp4"},function(e,t){e.exports="dist/videos/help/background-blend-mode.mp4"},function(e,t){e.exports="dist/videos/help/separator-top-on.mp4"},function(e,t){e.exports="dist/videos/help/separator-bottom-on.mp4"},function(e,t){e.exports="dist/videos/help/separator-height.mp4"},function(e,t){e.exports="dist/videos/help/separator-width.mp4"},function(e,t){e.exports="dist/videos/help/separator-shadow.mp4"},function(e,t){e.exports="dist/videos/help/separator-bring-to-front.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer2.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer3.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer-opacity.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer-blend-mode.mp4"},function(e,t){e.exports="dist/videos/help/advanced-opacity.mp4"},function(e,t){e.exports="dist/videos/help/advanced-zindex.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-paddings.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-height.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-vertical-align.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-content-width.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-horizontal-align.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-gap.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-column-vertical-align.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-height.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-content-vertical-align.mp4"},function(e,t){e.exports="dist/videos/help/accordion-adjacent-open.mp4"},function(e,t){e.exports="dist/videos/help/accordion-closed-state-background-color.mp4"},function(e,t){e.exports="dist/videos/help/accordion-padding.mp4"},function(e,t){e.exports="dist/videos/help/accordion-title-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-column-width.mp4"},function(e,t){e.exports="dist/videos/help/feature-container-width.mp4"},function(e,t){e.exports="dist/videos/help/feature-container-offset.mp4"},function(e,t){e.exports="dist/videos/help/icon-list-grid.mp4"},function(e,t){e.exports="dist/videos/help/icon-list-gap.mp4"},function(e,t){e.exports="dist/videos/help/image-box-height.mp4"},function(e,t){e.exports="dist/videos/help/notification-dismissible.mp4"},function(e,t){e.exports="dist/videos/help/posts-content-order.mp4"},function(e,t){e.exports="dist/videos/help/posts-meta-separator.mp4"},function(e,t){e.exports="dist/videos/help/divider-margin.mp4"},function(e,t){e.exports="dist/videos/help/pricing-image-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-title-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-price-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-subprice-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-button-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-description-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-image-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-title-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-price-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-subprice-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-button-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-description-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-overlay.mp4"},function(e,t){e.exports="dist/videos/help/image-box-overlay-hover.mp4"},function(e,t){e.exports="dist/videos/help/image-box-hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/image-box-box-hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/image-box-subtitle-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-title-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-line-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-description-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-arrow-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-subtitle-align.mp4"},function(e,t){e.exports="dist/videos/help/image-box-title-align.mp4"},function(e,t){e.exports="dist/videos/help/image-box-description-align.mp4"},function(e,t){e.exports="dist/videos/help/image-box-arrow-align.mp4"},function(e,t){e.exports="dist/videos/help/video-popup-width.mp4"},function(e,t){e.exports="dist/videos/help/video-popup-height.mp4"},function(e,t){e.exports="dist/videos/help/container-image-width.mp4"},function(e,t){e.exports="dist/videos/help/container-image-height.mp4"},function(e,t){e.exports="dist/videos/help/column-row-gap.mp4"},function(e,t){e.exports="dist/videos/help/no-padding.mp4"},function(e,t){e.exports="dist/videos/help/column-width.mp4"},function(e,t){e.exports="dist/videos/help/column-arrangement.mp4"},function(e,t){e.exports="dist/images/block-accordion-basic.b0f3789.png"},function(e,t){e.exports="dist/images/block-accordion-plain.2aeac8f.png"},function(e,t){e.exports="dist/images/block-accordion-colored.d55890a.png"},function(e,t){e.exports="dist/images/block-accordion-colored-hover.71e1fa4.png"},function(e,t){e.exports="dist/images/block-accordion-line-colored.7e3ee29.png"},function(e,t){e.exports="dist/images/block-accordion-line-colored-hover.f73a869.png"},function(e,t){e.exports="dist/images/block-blockquote-basic.0a574ba.png"},function(e,t){e.exports="dist/images/block-blockquote-plain.cd0c86f.png"},function(e,t){e.exports="dist/images/block-blockquote-centered-quote.bf840b2.png"},function(e,t){e.exports="dist/images/block-blockquote-highlight.01eb7a8.png"},function(e,t){e.exports="dist/images/block-blockquote-huge.e6cf111.png"},function(e,t){e.exports="dist/images/block-blog-posts-basic.0431caf.png"},function(e,t){e.exports="dist/images/block-blog-posts-list.78b14dd.png"},function(e,t){e.exports="dist/images/block-blog-posts-horizontal-card.2b40bef.png"},function(e,t){e.exports="dist/images/block-blog-posts-image-card.ef58109.png"},function(e,t){e.exports="dist/images/block-blog-posts-portfolio.70e8e8c.png"},function(e,t){e.exports="dist/images/block-blog-posts-portfolio2.4d079f6.png"},function(e,t){e.exports="dist/images/block-blog-posts-vertical-card.014a38d.png"},function(e,t){e.exports="dist/images/block-blog-posts-vertical-card2.d29365d.png"},function(e,t){e.exports=wp.htmlEntities},function(e,t){e.exports="dist/images/block-button-basic.cf5349e.png"},function(e,t){e.exports="dist/images/block-button-fullwidth.f370f41.png"},function(e,t){e.exports="dist/images/block-button-grouped-1.6509764.png"},function(e,t){e.exports="dist/images/block-button-grouped-2.45eb41b.png"},function(e,t){e.exports="dist/images/block-button-spread.a2b3bf6.png"},function(e,t){e.exports="dist/images/block-call-to-action-basic.82b89ff.png"},function(e,t){e.exports="dist/images/block-call-to-action-plain.aeb4b5d.png"},function(e,t){e.exports="dist/images/block-call-to-action-horizontal.f5eb57b.png"},function(e,t){e.exports="dist/images/block-call-to-action-horizontal-2.a263e44.png"},function(e,t){e.exports="dist/images/block-call-to-action-horizontal-3.6ad5c3f.png"},function(e,t){e.exports="dist/images/block-call-to-action-split-centered.698e3d8.png"},function(e,t){e.exports="dist/images/block-card-basic.ed15cbf.png"},function(e,t){e.exports="dist/images/block-card-plain.01b366e.png"},function(e,t){e.exports="dist/images/block-card-faded.06399e7.png"},function(e,t){e.exports="dist/images/block-card-full.60eb939.png"},function(e,t){e.exports="dist/images/block-card-horizontal.6ade93f.png"},function(e,t){e.exports="dist/images/block-column-basic.eeda154.png"},function(e,t){e.exports="dist/images/block-column-plain.dd6702f.png"},function(e,t){e.exports="dist/images/block-columns-grid.74cce02.png"},function(e,t){e.exports="dist/images/block-columns-plain.f83145c.png"},function(e,t){e.exports="dist/images/block-columns-uneven.2b7a26d.png"},function(e,t){e.exports="dist/images/block-columns-uneven-2.fe56d00.png"},function(e,t){e.exports="dist/images/block-columns-tiled.98ee90d.png"},function(e,t){e.exports="dist/images/block-container-basic.9b80141.png"},function(e,t){e.exports="dist/images/block-container-plain.b0bf4b9.png"},function(e,t){e.exports="dist/images/block-container-image.b7fa0ae.png"},function(e,t){e.exports="dist/images/block-container-image2.74a962d.png"},function(e,t){e.exports="dist/images/block-container-image3.f76131c.png"},function(e,t){e.exports="dist/images/block-count-up-plain.9350896.png"},function(e,t){e.exports="dist/images/block-count-up-plain-2.ba5ab0d.png"},function(e,t){e.exports="dist/images/block-count-up-abstract.b879aca.png"},function(e,t){e.exports="dist/images/block-count-up-boxed.3c1a313.png"},function(e,t){e.exports="dist/images/block-count-up-side.cbaf64f.png"},function(e,t){e.exports="dist/images/block-divider-basic.728eebd.png"},function(e,t){e.exports="dist/images/block-divider-bar.38cc0b7.png"},function(e,t){e.exports="dist/images/block-divider-dots.6f31a0f.png"},function(e,t){e.exports="dist/images/block-divider-asterisks.d07ce3c.png"},function(e,t){e.exports="dist/images/block-feature-grid-basic.d153b82.png"},function(e,t){e.exports="dist/images/block-feature-grid-plain.d4efae7.png"},function(e,t){e.exports="dist/images/block-feature-grid-horizontal.3d10d8c.png"},function(e,t){e.exports="dist/images/block-feature-grid-large-mid.5e400e2.png"},function(e,t){e.exports="dist/images/block-feature-grid-zigzag.419cfe1.png"},function(e,t){e.exports="dist/images/block-feature-basic.21129f8.png"},function(e,t){e.exports="dist/images/block-feature-plain.705697f.png"},function(e,t){e.exports="dist/images/block-feature-half.5af3a76.png"},function(e,t){e.exports="dist/images/block-feature-overlap.6b378a6.png"},function(e,t){e.exports="dist/images/block-feature-overlap2.62db827.png"},function(e,t){e.exports="dist/images/block-feature-overlap3.5bf62b1.png"},function(e,t){e.exports="dist/images/block-feature-overlap4.1ef990f.png"},function(e,t){e.exports="dist/images/block-feature-overlap5.7599add.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape.5069623.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape2.258557d.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape3.98ffc4f.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape4.c2f4c80.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape5.15fefe4.png"},function(e,t){e.exports="dist/images/block-header-basic.a9cc4da.png"},function(e,t){e.exports="dist/images/block-header-plain.aeccf8f.png"},function(e,t){e.exports="dist/images/block-header-center-overlay.3858559.png"},function(e,t){e.exports="dist/images/block-header-half.86b5a6b.png"},function(e,t){e.exports="dist/images/block-header-half-overlay.a31b8a8.png"},function(e,t){e.exports="dist/images/block-header-huge.d9d345e.png"},function(e,t){e.exports="dist/images/block-header-side-overlay.4e79477.png"},function(e,t){e.exports="dist/images/block-image-box-basic.f577755.png"},function(e,t){e.exports="dist/images/block-image-box-plain.7482e86.png"},function(e,t){e.exports="dist/images/block-image-box-box.795349f.png"},function(e,t){e.exports="dist/images/block-image-box-captioned.0b54748.png"},function(e,t){e.exports="dist/images/block-image-box-fade.96e3a05.png"},function(e,t){e.exports="dist/images/block-image-box-line.a32cf82.png"},function(e,t){e.exports="dist/images/block-notification-basic.a1f0aae.png"},function(e,t){e.exports="dist/images/block-notification-plain.eccdf36.png"},function(e,t){e.exports="dist/images/block-notification-bordered.6609d56.png"},function(e,t){e.exports="dist/images/block-notification-outlined.2c2cb01.png"},function(e,t){e.exports="dist/images/block-notification-large-icon.2bbe556.png"},function(e,t){e.exports="dist/images/block-number-box-basic.3d5ce27.png"},function(e,t){e.exports="dist/images/block-number-box-plain.1e11a36.png"},function(e,t){e.exports="dist/images/block-number-box-background.c21ee31.png"},function(e,t){e.exports="dist/images/block-number-box-faded.8c04315.png"},function(e,t){e.exports="dist/images/block-number-box-heading.45de6d4.png"},function(e,t){e.exports="dist/images/block-number-box-heading2.4ee5b2a.png"},function(e,t){e.exports="dist/images/block-pricing-box-basic.f439dd1.png"},function(e,t){e.exports="dist/images/block-pricing-box-plain.d7c8289.png"},function(e,t){e.exports="dist/images/block-pricing-box-colored.9843e4e.png"},function(e,t){e.exports="dist/images/block-pricing-box-compact.dc99fe8.png"},function(e,t){e.exports="dist/images/block-pricing-box-sectioned.cb6f482.png"},function(e,t){e.exports="dist/images/block-team-member-basic.53fb1db.png"},function(e,t){e.exports="dist/images/block-team-member-plain.c44209b.png"},function(e,t){e.exports="dist/images/block-team-member-half.5b481b6.png"},function(e,t){e.exports="dist/images/block-team-member-horizontal.f090d7c.png"},function(e,t){e.exports="dist/images/block-testimonial-basic.13e214f.png"},function(e,t){e.exports="dist/images/block-testimonial-plain.8208cdb.png"},function(e,t){e.exports="dist/images/block-testimonial-background.8a0048a.png"},function(e,t){e.exports="dist/images/block-testimonial-basic2.6fe575a.png"},function(e,t){e.exports="dist/images/block-testimonial-bubble.7e7aa18.png"},function(e,t){e.exports="dist/images/block-testimonial-vertical.8603101.png"},function(e,t){e.exports="dist/images/block-testimonial-vertical-inverse.9eda5f3.png"},function(e,t){e.exports="dist/images/block-text-plain.dc76980.png"},function(e,t){e.exports="dist/images/block-text-side-title-1.72a0b81.png"},function(e,t){e.exports="dist/images/block-text-side-title-2.4b31aa6.png"},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){var a={"./accordion/index.js":459,"./blockquote/index.js":457,"./blog-posts/index.js":461,"./button/index.js":476,"./call-to-action/index.js":464,"./card/index.js":465,"./column/index.js":480,"./columns/index.js":477,"./container/index.js":478,"./count-up/index.js":462,"./design-library/index.js":486,"./divider/index.js":481,"./expand/index.js":482,"./feature-grid/index.js":466,"./feature/index.js":467,"./header/index.js":468,"./heading/index.js":469,"./icon-list/deprecated/index.js":37,"./icon-list/higher-order/index.js":59,"./icon-list/higher-order/with-transform-old-icon-attributes/index.js":57,"./icon-list/index.js":479,"./icon/index.js":470,"./image-box/index.js":463,"./notification/index.js":460,"./number-box/index.js":471,"./pricing-box/index.js":472,"./separator/index.js":456,"./spacer/index.js":483,"./team-member/index.js":473,"./testimonial/index.js":474,"./text/index.js":475,"./video-popup/index.js":458};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id=454},function(e,t,n){"use strict";n.r(t);var a=n(3),i=n(2),o=n(1),r=n(11),l=n(39),c=n(9),s=n(0),u=n(6),b=n(18),p=n(13);function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var g=function(e,t,n,a){return""===t?n?Object(l.applyFormat)(e,{type:"ugb/highlight",attributes:{style:"color: ".concat(n,";")}}):Object(l.removeFormat)(e,"ugb/highlight"):"highlight"===t?Object(l.applyFormat)(e,{type:"ugb/highlight",attributes:{style:(n?"color: ".concat(n,";"):"")+(a?"background-color: ".concat(a):"")}}):Object(l.applyFormat)(e,{type:"ugb/highlight",attributes:{style:(n?"color: ".concat(n,";"):"")+(a?"background: linear-gradient(to bottom, transparent 50%, ".concat(a," 50%)"):"")}})};Object(l.registerFormatType)("ugb/highlight",{title:Object(s.__)("Highlight Text",o.i18n),tagName:"span",className:"ugb-highlight",edit:function(e){var t=m(Object(u.useState)(!1),2),n=t[0],l=t[1],b=Object(u.useRef)(null),p=Object(u.useCallback)(function(e){n&&(e.target.closest(b.current)||e.target.closest(".components-popover")||l(!1))});Object(u.useEffect)(function(){return document.body.addEventListener("click",p),function(){return document.body.removeEventListener("click",p)}},[p]);var d=e.activeAttributes,f=e.isActive,h=e.onChange,v=e.value,y=f?function(e){var t="",n="",a="";if(e.match(/linear-gradient\(/)){a="low";var i=e.match(/linear-gradient\(\s*to bottom\s*,\s*transparent \d+%\s*,\s*(.*?)\s\d+%\)/);i&&(n=i[1])}else if(e.match(/background-color:/)){a="highlight";var o=e.match(/background-color:\s*([^;]*)?/);o&&(n=o[1])}var r=e.match(/(^|[^-])color:\s*([^;]*)?/);return r&&(t=r[2]),{textColor:t,highlightColor:n,colorType:a}}(d.style):{},O=y.textColor,w=void 0===O?"":O,_=y.highlightColor,j=void 0===_?"":_,k=y.colorType,C=void 0===k?"":k,x=(""!==C?j:w)||w;return wp.element.createElement(c.BlockControls,null,wp.element.createElement(r.Toolbar,{className:"stackable-components-toolbar"},wp.element.createElement(r.Button,{className:"components-button components-icon-button components-toolbar__control",icon:"editor-textcolor","aria-haspopup":"true",tooltip:Object(s.__)("Color & Highlight",o.i18n),onClick:function(){return l(!n)}},wp.element.createElement("span",{className:"components-stackable-highlight-color__indicator",style:{backgroundColor:x}})),n&&wp.element.createElement(r.Popover,{position:"bottom center",className:"components-stackable-highlight__popover",focusOnMount:"container",useRef:b},wp.element.createElement("div",{className:"components-stackable-highlight__inner"},wp.element.createElement(a.e,{controls:[{value:"",title:Object(s.__)("Normal",o.i18n)},{value:"highlight",title:Object(s.__)("Highlight",o.i18n)},{value:"low",title:Object(s.__)("Low",o.i18n)}],value:C,onChange:function(e){var t=j||(""!==e?w||"#f34957":j),n="highlight"===e?Object(i.wb)("",t):"low"===e?"":j||w||"";h(g(v,e,n,t),{withoutHistory:!0})},isSmall:!0}),wp.element.createElement("div",{className:"ugb-highlight-format__color-picker"},wp.element.createElement(a.u,{label:Object(s.__)("Text Color",o.i18n),value:w,onChange:function(e){h(g(v,C,e,j),{withoutHistory:!0})}})),""!==C&&wp.element.createElement("div",{className:"ugb-highlight-format__color-picker"},wp.element.createElement(a.u,{label:Object(s.__)("Highlight Color",o.i18n),value:j,onChange:function(e){h(g(v,C,w,e),{withoutHistory:!0})}}))))))},attributes:{style:"style"}}),Object(b.a)(function(){Object(p.select)("core/edit-post").isFeatureActive("disableEditorsKitColorsFormats")||Object(p.dispatch)("core/edit-post").toggleFeature("disableEditorsKitColorsFormats"),Object(p.select)("core/edit-post").isFeatureActive("disableEditorsKitHighlightFormats")||Object(p.dispatch)("core/edit-post").toggleFeature("disableEditorsKitHighlightFormats")});var d=n(17),f=n(58),h=n(27),v=n(7);function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function O(e){return(O="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 w=["style","svg"],_=function(e){return!!e.args&&(4===e.args.length&&("string"==typeof e.args[1]&&"string"==typeof e.args[2]&&"string"==typeof e.args[3]&&("class"===e.args[1]&&!Object(v.isEqual)(e.args[2].match(/ugb-[^\s]+/g),e.args[3].match(/ugb-[^\s]+/g)))))},j=function(e){return!!e.args&&(4===e.args.length&&("string"==typeof e.args[1]&&"string"==typeof e.args[2]&&"string"==typeof e.args[3]&&("class"===e.args[1]&&(e.args[2].match(/wp-image-\d+/)&&!e.args[3].match(/wp-image-\d+/)||!e.args[2].match(/wp-image-\d+/)&&e.args[3].match(/wp-image-\d+/)))))},k=function(e){return!!e.args&&(3===e.args.length&&("style"===e.args[1]&&"style"!==e.args[2]||"style"!==e.args[1]&&"style"===e.args[2]))},C=function(e){return!!e.args&&(4===e.args.length&&("string"==typeof e.args[1]&&("aria-label"===e.args[1]||"title"===e.args[1]||"alt"===e.args[1])))},x=function(e){if(!e.args)return!1;if(3!==e.args.length)return!1;if("object"!==O(e.args[1])||"object"!==O(e.args[2]))return!1;if(!Array.isArray(e.args[1])||!Array.isArray(e.args[2]))return!1;var t=e.args[1].map(function(e){return e[0]}),n=e.args[2].map(function(e){return e[0]}),a=Object(v.difference)(t,n);return!!(a.includes("aria-label")||a.includes("title")||a.includes("alt"))},E=function(e){return!!e.args&&(3===e.args.length&&("svg"===e.args[1]&&"svg"!==e.args[2]||"svg"!==e.args[1]&&"svg"===e.args[2]))},S=function(e){return!!e.args&&(3===e.args.length&&("video"===e.args[1]&&"video"!==e.args[2]||"video"===e.args[2]&&"video"!==e.args[1]))},B=function(e){return!!e.args&&(3===e.args.length&&(!!Array.isArray(e.args[1])&&!!e.args[1].some(function(e){return Array.isArray(e)&&"playsinline"===e[0]})))},T=function(e){var t,n=e.name,a=e.attributes,i=e.innerBlocks,o=e.originalContent;if(e.isValid)return!1;try{t=Object(d.getSaveContent)(n,a,i)}catch(e){return!1}return function(e,t){var n=y([e,t].map(function(e){return function(e){try{return new f.Tokenizer(new h.DecodeEntityParser).tokenize(e)}catch(e){}return null}(e)}),2),a=n[0],i=n[1];if(!a||!i)return!1;var o,r,l=[];for(;o=Object(h.getNextNonWhitespaceToken)(a);){if(r=Object(h.getNextNonWhitespaceToken)(i),"StartTag"===o.type&&l.push(o.tagName.toLowerCase()),!r)return l;if(o.type!==r.type)return l;var c=h.isEqualTokensOfType[o.type];if(c&&!c(o,r))return l;"StartTag"===o.type&&!0===o.selfClosing?l.pop():"EndTag"===o.type&&l.pop(),Object(h.isClosedByToken)(o,i[0])?Object(h.getNextNonWhitespaceToken)(i):Object(h.isClosedByToken)(r,a[0])&&Object(h.getNextNonWhitespaceToken)(a)}return!1}(o,t)};var P=function(){var e;(e=document.createElement("style")).setAttribute("id","ugb-disable-block-warnings"),e.innerHTML='.has-warning[data-type^="ugb/"] { opacity: 0 !important; }',document.body.appendChild(e),setTimeout(function(){A(Object(p.select)("core/editor").getEditorBlocks()).forEach(function(e){e.recovered&&e.replacedClientId&&Object(p.dispatch)("core/block-editor").replaceBlock(e.replacedClientId,e)}),function(){var e=document.querySelector("#ugb-disable-block-warnings");e&&document.body.removeChild(e)}()},0)},A=function e(t){return t.map(function(t){if(t.innerBlocks&&t.innerBlocks.length){var n=e(t.innerBlocks);n.some(function(e){return e.recovered})&&(t.innerBlocks=n,t.replacedClientId=t.clientId,t.recovered=!0)}if(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w,n=e.name,a=e.isValid,i=e.validationIssues;if(!n||!n.match(/^ugb\//))return!1;if(a)return!1;if(!i.length)return!1;if(_(i[0]))return!0;if(k(i[0]))return!0;if(E(i[0]))return!0;if(j(i[0]))return!0;if(S(i[0]))return!0;if(B(i[0]))return!0;if(C(i[0]))return!0;if(x(i[0]))return!0;var o=T(e);return!!o&&o.some(function(e){return t.includes(e)})}(t)){var a=N(t);return a.replacedClientId=t.clientId,a.recovered=!0,console.log("Stackable notice: block "+t.name+" ("+t.clientId+") was auto-recovered, you should not see this after saving your page."),a}return t})},N=function(e){var t=e.name,n=e.attributes,a=e.innerBlocks;return Object(d.createBlock)(t,n,a)};Object(b.a)(function(){window._wpLoadBlockEditor&&window._wpLoadBlockEditor.then(function(){P()})});var M=n(4),R=n(29),F={desktop:"Desktop",tablet:"Tablet",mobile:"Mobile"};Object(M.addAction)("stackable.responsive-toggle.screen.change","stackable/responsive-preview",function(e){var t=Object(p.dispatch)("core/edit-post").__experimentalSetPreviewDeviceType,n=Object(p.select)("core/edit-post").__experimentalGetPreviewDeviceType;if(t){var a=F[e];a!==n()&&t(a)}});Object(p.select)("core/edit-post").__experimentalGetPreviewDeviceType&&Object(R.registerPlugin)("stackable-responsive-toggle-change",{render:function(){var e=Object(p.useSelect)(function(e){return{deviceType:e("core/edit-post").__experimentalGetPreviewDeviceType()}},[]).deviceType,t=Object(v.findKey)(F,function(t){return t===e})||"desktop";return setTimeout(function(){t!==Object(i.W)()&&(Object(i.pb)(t),Object(M.doAction)("stackable.responsive-toggle.screen.change",t)),"desktop"!==t?(Object(i.ob)(!0),Object(M.doAction)("stackable.responsive-toggle.screen.open")):(Object(i.ob)(!1),Object(M.doAction)("stackable.responsive-toggle.screen.close"))},0),null}});var D=n(144),I=n.n(D);function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function U(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return[];var n=[];return e.forEach(function(e,a){var i=e.href;t.some(function(e){return e||null!==i?!!(i&&e&&i.includes(e))&&n.push(a):n.push(a)})}),n},q={},K={},J=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.styleSheets,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:q,a=Array.from(t),i=V(a,e),o=[];return i.forEach(function(e){if(t[e].__id)o.push(t[e].__id);else{var n=I()(Math.floor(Math.random()*(new Date).getTime())).substr(0,10);t[e].__id=n,o.push(n)}}),o.forEach(function(e){var t={},i=Array.from(a).findIndex(function(t){return t.__id===e}),o=Array.from(a[i].cssRules).filter(function(e){return e.media});(!K[e]||K[e]&&!Object(v.isEqual)(K[e],o))&&(K[e]=!Object(v.isEmpty)(o)&&W(o),Array.from(a[i].cssRules).forEach(function(a,i){var o=a.cssText,r=a.media;if(r&&o.includes(".ugb")&&r.mediaText.match(/(max|min)-width/)){var l=r.mediaText.match(/max-width:\s*(\d+)px/),c=r.mediaText.match(/min-width:\s*(\d+)px/),s=l?parseInt(l[1],10):9999,u=c?parseInt(c[1],10):0;if(n&&n[e]&&n[e][i])n[e][i].previousMediaText===r.mediaText?t[i]=U({},n[e][i]):t[i]={cssText:o,mediaText:r.mediaText,min:u,max:s};else t[i]={cssText:o,mediaText:r.mediaText,min:u,max:s}}}),n[e]=U({},t))}),U({},n)},Y=".edit-post-visual-editor",X="Desktop",$={},Z=function(){var e=Object(p.select)("core/edit-post").__experimentalGetPreviewDeviceType;if(e){var t=e();if("Desktop"!==t||"Desktop"!==X){if(X=t,!$[t]){var n=document.querySelector(Y);$[t]=parseInt(window.getComputedStyle(n).width,10)}!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:G,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document.styleSheets,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:q;try{var o=J(n,a,i),r=function(e){var n=z(e.split("vw"),1)[0],a=parseFloat(n)/100*t;return"".concat(a,"px")},l=function(e){return e.replace(/(-?[.0-9]+)vw/g,r)},c=function(e,t,n){a[e].deleteRule(t),a[e].insertRule(n,t)};"Tablet"===e||"Mobile"===e?Object(v.keys)(o).forEach(function(e){var n=Array.from(a).findIndex(function(t){return t.__id===e});Object(v.keys)(o[e]).forEach(function(i){if(a[n]&&a[n].cssRules[i]){var r=o[e][i],s=r.min,u=r.max,b=r.cssText;Object(v.inRange)(t,s,u)?(b&&b.match(/(-?[.0-9]+)vw/g)&&c(n,i,l(b)),a[n].cssRules[i].media.mediaText="screen and (max-width: 5000px)"):(b&&b.match(/(-?[.0-9]+)vw/g)&&c(n,i,l(b)),a[n].cssRules[i].media.mediaText="screen and (min-width: 5000px)"),o[e][i].previousMediaText!==a[n].cssRules[i].media.mediaText&&(o[e][i].previousMediaText=a[n].cssRules[i].media.mediaText)}})}):Object(v.keys)(o).forEach(function(e){var t=Array.from(a).findIndex(function(t){return t.__id===e});Object(v.keys)(o[e]).forEach(function(n){if(a[t]&&a[t].cssRules[n]){var i=o[e][n].cssText;a[t].cssRules[n].media.mediaText!==o[e][n].mediaText&&(o[e][n].previousMediaText=a[t].cssRules[n].media.mediaText,c(t,n,i)),o[e][n].previousMediaText!==a[t].cssRules[n].media.mediaText&&(o[e][n].previousMediaText=a[t].cssRules[n].media.mediaText)}})})}catch(e){console.warn("Stackable error: plugin stylesheet is hosted in a remote location, responsive live editing is disabled. To enable it, please don't use a CDN while using Gutenberg")}}(t,$[t])}}};Object(M.addAction)("stackable.setAttributes.after","stackable/responsive-preview",Z);function Q(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{};return{type:"UPDATE_SETTINGS",payload:Object(v.omit)(e,"type")}}};Object(p.registerStore)("stackable/global-colors",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return re({},e,{},t.payload);default:return e}},actions:se,selectors:{getSettings:function(e){return e}}});Object(b.a)(function(){ie.loadPromise.then(function(){(new ie.models.Settings).fetch().then(function(e){var t,n=e.stackable_global_colors_palette_only,a=e.stackable_global_colors,i=Object(v.head)(a)||[],o=i.map(function(e){return e.slug}),r=Object(p.select)("core/block-editor").getSettings().colors;(r||[]).some(function(e){return e.fallback&&e.colorVar})?(t=function(e){return Object(v.compact)((e||[]).map(function(e){return e.fallback&&e.colorVar?e.slug.match(/^stk-global-color/)?{color:e.fallback,slug:"stk-global-color-".concat(Math.floor(Math.random()*(new Date).getTime())%1e5),rgb:e.rgb||"0, 0, 0",name:e.name||"Untitled Color"}:null:e}))}(r),Object(p.dispatch)("core/block-editor").updateSettings({colors:t}),i=t.filter(function(e){return e.slug.match(/^stk-global-color/)}),o=i.map(function(e){return e.slug})):t=r||[];var l=t.filter(function(e){var t=e.slug;return!o.includes(t)});Object(p.dispatch)("stackable/global-colors").updateSettings({defaultColors:l,useStackableColorsOnly:n,stackableColors:i,isInitializing:!1})})})});var ue=n(5),be=n.n(ue);function pe(){return(pe=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!Array.isArray(t))return e;var a=n.includeSlugNames,i=void 0!==a&&a,o=n.includeColorVar,r=void 0===o||o,l=JSON.stringify(e);if(r&&t.forEach(function(e){e.slug.match(/^stk-global-color/)&&(l=l.replace(new RegExp("var\\(--".concat(e.slug,", ").concat(e.color.replace(")","\\)").replace("(","\\("),"\\)"),"g"),function(t){return e?e.color||"#000000":t}))}),i){var c=t.filter(function(e){return e.slug&&e.slug.match(/^stk-global-color/)}).map(function(e){return e.slug});c.forEach(function(e){var n=Object(v.find)(t,function(t){return t.slug===e});l=l.replace(new RegExp('"'.concat(e,'"'),"g"),n?'"'.concat(n.color,'"')||!1:'"#000000"')})}return JSON.parse(l)}(e.attributes,t);Object(v.isEqual)(o,e.attributes)||i(n,o)}else if(a.includes("core/")&&(a.includes("heading")||a.includes("paragraph"))){var r={style:we({color:{}},e.attributes.style)},l=e.attributes,c=l.backgroundColor,s=l.textColor;if(c&&c.includes("stk-global-color-")){var u=c.match(/stk-global-color-(\S*)/);if(u&&Array.isArray(u)&&u.length>=2){var b=u[1];r.backgroundColor=void 0;var m=Object(v.find)(t,function(e){return e.slug==="stk-global-color-".concat(b)});r.style.color.background=m&&m.color||"#000000"}}if(s&&s.includes("stk-global-color-")){var g=s.match(/stk-global-color-(\S*)/);if(g&&Array.isArray(g)&&g.length>=2){var d=g[1];r.textColor=void 0;var f=Object(v.find)(t,function(e){return e.slug==="stk-global-color-".concat(d)});r.style.color.text=f&&f.color||"#000000"}}i(n,r)}},ke=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!Array.isArray(t))return e;var n=JSON.stringify(e),a=t.filter(function(e){return e.slug.match(/^stk-global-color/)}).map(function(e){return"--".concat(e.slug)});return a.forEach(function(e){var a=new RegExp("var\\(".concat(e,",(.?)#(.*?(?=\\)))\\)"),"g");n=n.replace(a,function(n){var a=Object(v.find)(t,function(t){return"--".concat(t.slug)===e});return a?"var(".concat(e,", ").concat(a.color,")"):n})}),JSON.parse(n)},Ce=function(e){var t=te()(e.match(/^#/)?e:"#".concat(e));return t.splice(3,1),t.join(", ")},xe=function(e){!function t(n){n.forEach(function(n){je(n,e),n.innerBlocks&&n.innerBlocks.length&&t(n.innerBlocks)})}(Object(p.select)("core/block-editor").getBlocks())},Ee=n(8),Se=n.n(Ee);function Be(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:"desktop",n=[];return e.fontFamily&&n.push(e.fontFamily),e.fontSize&&n.push("".concat(e.fontSize).concat(e.fontSizeUnit||"px")),"tablet"===t&&e.tabletFontSize?(e.fontSize&&n.pop(),n.push("".concat(e.tabletFontSize).concat(e.tabletFontSizeUnit||"px"))):"mobile"===t&&(e.tabletFontSize||e.mobileFontSize)&&(e.fontSize&&n.pop(),e.mobileFontSize?n.push("".concat(e.mobileFontSize).concat(e.mobileFontSizeUnit||"px")):n.push("".concat(e.tabletFontSize).concat(e.tabletFontSizeUnit||"px"))),e.fontWeight&&n.push(e.fontWeight),e.textTransform&&n.push(Object(v.upperFirst)(e.textTransform)),n.join(", ")},nt=function(e){var t,n=e.tag,a=Object(p.useSelect)(function(e){return{device:e("core/edit-post").__experimentalGetPreviewDeviceType().toLowerCase()}},[]).device,o=tt(e.styles,a),r=Object(v.omit)(e.styles,["lineHeight","tabletLineHeight","mobileLineHeight"]),l=(Ze(t={},'.ugb-global-typography-preview__label[data-tag="'.concat(e.tag,'"]'),Object(i.K)("%s","desktop",r,{important:!0})),Ze(t,'.ugb-global-typography-preview__label[data-tag="'.concat(e.tag,'"]:not([data-device="desktop"])'),Object(i.K)("%s","tablet",r,{important:!0})),Ze(t,'.ugb-global-typography-preview__label[data-tag="'.concat(e.tag,'"][data-device="mobile"]'),Object(i.K)("%s","mobile",r,{important:!0})),t);return e.styles.fontFamily&&Object(i.fb)(e.styles.fontFamily),wp.element.createElement("div",{className:"ugb-global-typography-preview"},wp.element.createElement("div",{className:"editor-styles-wrapper"},wp.element.createElement("div",{className:"block-editor-block-list__layout"},wp.element.createElement("div",{className:"wp-block block-editor-block-list__block"},wp.element.createElement("style",null,Object(Le.b)(l).join("")),wp.element.createElement(n,{className:"ugb-global-typography-preview__label","data-tag":e.tag,"data-device":a},e.children)))),o&&wp.element.createElement("p",{className:"ugb-global-typography-preview__description"},o))};function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var rt=[{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),1),tag:"h1"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),2),tag:"h2"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),3),tag:"h3"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),4),tag:"h4"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),5),tag:"h5"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),6),tag:"h6"},{label:Object(s.__)("Body Text",o.i18n),tag:"p"}],lt=null;Object(M.addFilter)("stackable.global-settings.inspector","stackable/global-typography",function(e){var t=ot(Object(u.useState)([]),2),n=t[0],i=t[1],r=ot(Object(u.useState)(""),2),l=r[0],c=r[1];Object(u.useEffect)(function(){ie.loadPromise.then(function(){(new ie.models.Settings).fetch().then(function(e){i(Object(v.head)(e.stackable_global_typography)||{}),c(e.stackable_global_typography_apply_to||"blocks-stackable-native")})})},[]),Object(u.useEffect)(function(){Object(M.doAction)("stackable.global-settings.typography.update-trigger",n,l)},[JSON.stringify(n),l]);var b=function(e,t){var a=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:pt;this.setState({isLoading:!0}),fetch(t).then(function(t){return e.setState({isLoading:!1,loaded:!0}),t.json()}).then(function(t){e.updateTestState(t)})}},{key:"onClick",value:function(){this.fetchTests(pt)}},{key:"onClickLocal",value:function(){this.fetchTests(Object(s.sprintf)("%s/dist/deprecation-tests.json",o.srcUrl))}},{key:"onRunAllTests",value:function(){var e=this.state.tests.map(function(e){return e.skip?ht({},e,{passed:!0}):ht({},e,{passed:mt(e.html)})});this.setState({tests:e})}},{key:"onRunTest",value:function(e){var t=this.state.tests.map(function(t){return t.block!==e?t:t.skip?ht({},t,{passed:!0}):ht({},t,{passed:mt(t.html)})});this.setState({tests:t})}},{key:"onShowToggle",value:function(e){this.setState({show:this.state.show.includes(e)?this.state.show.filter(function(t){return t!==e}):this.state.show.concat(e)})}},{key:"render",value:function(){var e=this,t=Se()(["ugb-deprecated-tester"],{"ugb-deprecated-tester--loading":this.state.isLoading});return wp.element.createElement("div",{className:t},wp.element.createElement(r.BaseControl,null,wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("When Stackable blocks are updated, block internal workings may change & editing existing blocks may result in errors if the changes are not backward compatible. This area tests multiple outdated blocks on whether they can migrate properly to newer versions.",o.i18n)),wp.element.createElement(r.Button,{className:"ugb-deprecated-tester__load-button",isSecondary:!0,onClick:this.onClick,disabled:this.state.isLoading},wp.element.createElement(r.Dashicon,{icon:"image-rotate",size:"12"}),Object(s.__)("Load Tests from Server",o.i18n)),!1),this.state.loaded&&wp.element.createElement(u.Fragment,null,wp.element.createElement("hr",null),wp.element.createElement("p",{className:"ugb-deprecated-tester--row ugb--first"},wp.element.createElement(r.Button,{isPrimary:!0,isSmall:!0,onClick:this.onRunAllTests},Object(s.__)("Run All Tests",o.i18n)))),this.state.loaded&&this.state.testBlockNames.map(function(t,n){var a=e.state.tests.filter(function(e){return e.block===t}),i=a.length,l=a.filter(function(e){return e.passed}).length;return wp.element.createElement(u.Fragment,{key:n},wp.element.createElement("div",{key:n,className:"ugb-deprecated-tester--row"},wp.element.createElement("span",{className:"ugb-deprecated-tester--name"},t,wp.element.createElement(r.Button,{isSecondary:!1,icon:"editor-help",onClick:function(){return e.onShowToggle(t)}})),wp.element.createElement("span",{className:i===l?"ugb--green":""},Object(s.sprintf)(Object(s.__)("%d / %d Tests",o.i18n),l,i),wp.element.createElement(r.Button,{isSecondary:!1,onClick:function(){return e.onRunTest(t)},icon:"controls-play"}))),e.state.show.includes(t)&&wp.element.createElement("div",{className:"ugb-deprecated-tester--test-detail-wrapper"},a.map(function(e,t){var n=e.html.replace(/()/g,function(e,t){return t.replace(/\n/g,"\\n").replace(/\t/g,"\\t")});return wp.element.createElement("div",{key:t},wp.element.createElement("div",null,e.description,!e.skip&&!0===e.passed&&wp.element.createElement("small",{className:"ugb--passed"},Object(s.__)("Passed",o.i18n)),!e.skip&&!1===e.passed&&wp.element.createElement("small",{className:"ugb--failed"},Object(s.__)("Failed",o.i18n)),e.skip&&wp.element.createElement("small",{className:"ugb--skipped"},Object(s.__)("Skipped",o.i18n))),wp.element.createElement("div",{className:"ugb-deprecated-tester--test-details"},wp.element.createElement("small",{className:"ugb--version"},Object(s.sprintf)(Object(s.__)("v%s",o.i18n),e.version)),e.plan&&wp.element.createElement("small",{className:"ugb--plan ugb--plan-".concat(e.plan)},e.plan),wp.element.createElement(r.ClipboardButton,{isSecondary:!1,isLink:!0,text:n},Object(s.__)("Copy code",o.i18n)),e.skip&&wp.element.createElement("small",{className:"ugb--skipped-note"},wp.element.createElement("span",{role:"img","aria-label":Object(s.__)("Note",o.i18n)},"⚠️")," ",e.skip)))})))}))}}])&&yt(n.prototype,a),i&&yt(n,i),t}();function kt(e){return(kt="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 Ct(e,t){for(var n=0;nSome sample code

\n\x3c!-- /wp:paragraph --\x3e"};var Pt=Tt,At=function(){return wp.element.createElement(u.Fragment,null,wp.element.createElement(st.PluginSidebarMoreMenuItem,{target:"stackable-block-tester"},Object(s.__)("Stackable Debugger",o.i18n)),wp.element.createElement(st.PluginSidebar,{name:"stackable-block-tester",isPinnable:!1,title:Object(s.__)("Stackable Debugger",o.i18n)},wp.element.createElement("div",{className:"ugb-debugger-panel"},wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("This area contains a number of testing and debugging tools made specifically for Stackable.",o.i18n))),wp.element.createElement(a.fb,{initialOpen:!1,title:Object(s.__)("Block Validity Checker",o.i18n)},wp.element.createElement(Pt,null)),wp.element.createElement(a.fb,{initialOpen:!1,title:Object(s.__)("Block Migration Tests",o.i18n)},wp.element.createElement(jt,null))))};Object(R.registerPlugin)("stackable-convert-to-container-button",{render:a.z}),o.devMode&&(Object(R.registerPlugin)("stackable-block-tester",{icon:"clipboard",render:At}),Object(R.registerPlugin)("stackable-block-attributes-get-button",{render:a.L}));var Nt=n(145),Mt=n.n(Nt),Rt=n(146),Ft=n.n(Rt),Dt=n(147),It=n.n(Dt),zt=n(148),Lt=n.n(zt),Ut=n(149),Ht=n.n(Ut),Wt=n(150),Gt=n.n(Wt),Vt=n(151),qt=n.n(Vt),Kt=n(152),Jt=n.n(Kt),Yt=n(153),Xt=n.n(Yt),$t=n(154),Zt=n.n($t),Qt=n(155),en=n.n(Qt),tn=n(156),nn=n.n(tn),an=n(157),on=n.n(an),rn=n(158),ln=n.n(rn),cn=n(159),sn=n.n(cn),un=n(62),bn=n.n(un),pn=n(160),mn=n.n(pn),gn=n(161),dn=n.n(gn),fn=n(162),hn=n.n(fn),vn=n(163),yn=n.n(vn),On=n(164),wn=n.n(On),_n=n(49),jn=n.n(_n),kn=n(63),Cn=n.n(kn),xn=n(165),En=n.n(xn),Sn=n(166),Bn=n.n(Sn),Tn=n(167),Pn=n.n(Tn),An=n(168),Nn=n.n(An),Mn=n(169),Rn=n.n(Mn),Fn=n(170),Dn=n.n(Fn),In=n(171),zn=n.n(In),Ln=n(172),Un=n.n(Ln),Hn=n(173),Wn=n.n(Hn),Gn=n(174),Vn=n.n(Gn),qn=n(175),Kn=n.n(qn),Jn=n(176),Yn=n.n(Jn),Xn=n(177),$n=n.n(Xn),Zn=n(178),Qn=n.n(Zn),ea=n(179),ta=n.n(ea),na=n(180),aa=n.n(na),ia=n(181),oa=n.n(ia),ra=n(50),la=n.n(ra),ca=n(64),sa=n.n(ca),ua=n(182),ba=n.n(ua),pa=n(183),ma=n.n(pa),ga=n(184),da=n.n(ga),fa=n(185),ha=n.n(fa),va=n(186),ya=n.n(va),Oa=n(187),wa=n.n(Oa),_a=n(188),ja=n.n(_a),ka=n(189),Ca=n.n(ka),xa=n(190),Ea=n.n(xa),Sa=n(191),Ba=n.n(Sa),Ta=n(192),Pa=n.n(Ta),Aa=n(193),Na=n.n(Aa),Ma=n(194),Ra=n.n(Ma),Fa=n(195),Da=n.n(Fa),Ia=n(196),za=n.n(Ia),La=n(197),Ua=n.n(La),Ha=n(198),Wa=n.n(Ha),Ga=n(199),Va=n.n(Ga),qa=n(200),Ka=n.n(qa),Ja=n(201),Ya=n.n(Ja),Xa=n(202),$a=n.n(Xa),Za=n(203),Qa=n.n(Za),ei=n(204),ti=n.n(ei),ni=n(205),ai=n.n(ni),ii=n(206),oi=n.n(ii),ri=n(207),li=n.n(ri),ci=n(208),si=n.n(ci),ui=n(65),bi=n.n(ui),pi=n(209),mi=n.n(pi),gi=n(210),di=n.n(gi),fi=n(211),hi=n.n(fi),vi=n(212),yi=n.n(vi),Oi=n(213),wi=n.n(Oi),_i=n(66),ji=n.n(_i),ki=n(214),Ci=n.n(ki),xi=n(215),Ei=n.n(xi),Si=n(216),Bi=n.n(Si),Ti=n(217),Pi=n.n(Ti),Ai=n(218),Ni=n.n(Ai),Mi=n(219),Ri=n.n(Mi),Fi=n(220),Di=n.n(Fi),Ii=n(221),zi=n.n(Ii),Li=n(67),Ui=n.n(Li),Hi=n(222),Wi=n.n(Hi),Gi=n(223),Vi=n.n(Gi),qi=n(224),Ki=n.n(qi),Ji=n(225),Yi=n.n(Ji),Xi=n(226),$i=n.n(Xi),Zi=n(227),Qi=n.n(Zi),eo=n(228),to=n.n(eo),no=n(229),ao=n.n(no),io=n(230),oo=n.n(io),ro=n(231),lo=n.n(ro),co=n(232),so=n.n(co),uo=n(233),bo=n.n(uo),po=n(234),mo=n.n(po),go=n(235),fo=n.n(go),ho=n(236),vo=n.n(ho),yo=n(237),Oo=n.n(yo),wo=n(238),_o=n.n(wo),jo=n(239),ko=n.n(jo),Co=n(240),xo=n.n(Co),Eo=n(241),So=n.n(Eo),Bo=n(242),To=n.n(Bo),Po=n(243),Ao=n.n(Po),No=n(244),Mo=n.n(No),Ro=n(245),Fo=n.n(Ro),Do=n(246),Io=n.n(Do),zo=n(247),Lo=n.n(zo),Uo=n(248),Ho=n.n(Uo),Wo=n(249),Go=n.n(Wo),Vo=n(250),qo=n.n(Vo),Ko=n(251),Jo=n.n(Ko),Yo=n(252),Xo=n.n(Yo),$o=n(253),Zo=n.n($o),Qo=n(254),er=n.n(Qo),tr=n(255),nr=n.n(tr),ar=n(256),ir=n.n(ar),or=n(257),rr=n.n(or),lr=n(258),cr=n.n(lr),sr=n(259),ur=n.n(sr),br=n(260),pr=n.n(br),mr=n(261),gr=n.n(mr),dr=n(262),fr=n.n(dr),hr=n(263),vr=n.n(hr),yr=n(264),Or=n.n(yr),wr={fullHeight:{video:Mt.a,title:Object(s.__)("Full Height",o.i18n),description:Object(s.__)("Block height takes up the full height of the screen",o.i18n)},generalRestrictContent:{video:Ft.a,title:Object(s.__)("Restrict to Content Width",o.i18n),description:Object(s.__)("Restricts content to a narrower space when block width is set to full width",o.i18n)},generalBorderRadius:{video:It.a,title:Object(s.__)("Border Radius",o.i18n),description:Object(s.__)("Adjusts the radius of block corners to make them more rounded",o.i18n)},generalShadow:{video:Lt.a,title:Object(s.__)("Shadow/Outline",o.i18n),description:Object(s.__)("Adjusts the intensity of the shadow/outline of the block and the appearance of the block border",o.i18n)},alignmentAll:{video:Ht.a,title:Object(s.__)("Align (general / all)",o.i18n),description:Object(s.__)("Adjusts the placement of all content in the block to align left, center or right",o.i18n)},generalColumns:{video:Gt.a,title:Object(s.__)("Columns",o.i18n),description:Object(s.__)("Sets the number of columns",o.i18n)},columnBackgroundOnOff:{video:qt.a,title:Object(s.__)("Column / Container Background",o.i18n),description:Object(s.__)("Background settings for the container or columns.",o.i18n)},imageShape:{video:Jt.a,title:Object(s.__)("Shape",o.i18n),description:Object(s.__)("Change the shape of the image",o.i18n)},imageSize:{video:Xt.a,title:Object(s.__)("Image size",o.i18n),description:Object(s.__)("Sets the image display size to thumbnail, medium, large or full size. A smaller image size will also load faster.",o.i18n)},imageSizeNoCrop:{video:Zt.a,title:Object(s.__)("Image size",o.i18n),description:Object(s.__)("Adjusts the image size / width while preseving the aspect ratio",o.i18n)},imageWidthCrop:{video:en.a,title:Object(s.__)("Image width",o.i18n),description:Object(s.__)("Adjusts the image width",o.i18n)},imageHeightCrop:{video:nn.a,title:Object(s.__)("Image height",o.i18n),description:Object(s.__)("Adjusts the image height",o.i18n)},imageSquare:{video:on.a,title:Object(s.__)("Force Square Image",o.i18n),description:Object(s.__)("Crops image into a square",o.i18n)},imageBorderRadius:{video:ln.a,title:Object(s.__)("Border radius (of image)",o.i18n),description:Object(s.__)("Adjusts the radius of image corners to make them more rounded",o.i18n)},imageShadow:{video:sn.a,title:Object(s.__)("Shadow (of image)",o.i18n),description:Object(s.__)("Adjusts the intensity of the image shadow",o.i18n)},typography:{video:bn.a,title:Object(s.__)("Typography",o.i18n),description:Object(s.__)("Change the font family, size, weight and spacing of the font of this text",o.i18n)},typographyFamily:{video:bn.a,title:Object(s.__)("Font family",o.i18n),description:Object(s.__)("Sets the font set to be used for the element",o.i18n)},typographySize:{video:mn.a,title:Object(s.__)("Font size",o.i18n),description:Object(s.__)("Sets the size of text characters",o.i18n)},typographyWeight:{video:dn.a,title:Object(s.__)("Font weight",o.i18n),description:Object(s.__)("Sets the thinness or thickness of text characters",o.i18n)},typographyTransform:{video:hn.a,title:Object(s.__)("Transform",o.i18n),description:Object(s.__)("Sets the usage of upper or lower case",o.i18n)},typographyLineHeight:{video:yn.a,title:Object(s.__)("Line height",o.i18n),description:Object(s.__)("Sets the vertical distance between lines of text",o.i18n)},typographyLetterSpacing:{video:wn.a,title:Object(s.__)("Letter spacing",o.i18n),description:Object(s.__)("Sets the distance or space between letters",o.i18n)},alignmentImage:{video:jn.a,title:Object(s.__)("Image alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the image to align left, center or right",o.i18n)},alignmentNumber:{video:jn.a,title:Object(s.__)("Number alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the number to align left, center or right",o.i18n)},alignmentIcon:{video:jn.a,title:Object(s.__)("Icon alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the icon to align left, center or right",o.i18n)},alignmentTitle:{video:Cn.a,title:Object(s.__)("Title / subtitle alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the title or subtitle to align left, center or right",o.i18n)},alignmentName:{video:Cn.a,title:Object(s.__)("Name / position alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the name or position to align left, center or right",o.i18n)},alignmentDescription:{video:En.a,title:Object(s.__)("Description / text alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the text to align left, center or right",o.i18n)},alignmentButton:{video:Bn.a,title:Object(s.__)("Button / link alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the button or link to align left, center or right",o.i18n)},buttonPadding:{video:Pn.a,title:Object(s.__)("Button padding",o.i18n),description:Object(s.__)("Adjusts the space between the button text and button borders",o.i18n)},buttonVerticalPadding:{video:Nn.a,title:Object(s.__)("Button vertical padding",o.i18n),description:Object(s.__)("Adjusts the space between the button text and button's top and bottom borders",o.i18n)},buttonHorizontalPadding:{video:Rn.a,title:Object(s.__)("Button horizontal padding",o.i18n),description:Object(s.__)("Adjusts the space between the button text and button's side borders",o.i18n)},buttonSize:{video:Dn.a,title:Object(s.__)("Button size",o.i18n),description:Object(s.__)("Sets the size of the button. Choose from tiny, small, normal, medium or large.",o.i18n)},buttonHoverEffect:{video:zn.a,title:Object(s.__)("Hover effect",o.i18n),description:Object(s.__)("Triggers animation or effects when you mouse over",o.i18n)},buttonHoverOpacity:{video:Un.a,title:Object(s.__)("Hover opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the button when you mouse over",o.i18n)},buttonHoverColor:{video:Wn.a,title:Object(s.__)("Hover colors",o.i18n),description:Object(s.__)("Triggers a change in color when you mouse over",o.i18n)},buttonShadow:{video:Vn.a,title:Object(s.__)("Button shadow",o.i18n),description:Object(s.__)("Adjusts the intensity of the button shadow",o.i18n)},buttonBorderRadius:{video:Kn.a,title:Object(s.__)("Button border radius",o.i18n),description:Object(s.__)("Adjusts the radius of button corners to make them more rounded",o.i18n)},buttonColorType:{video:Yn.a,title:Object(s.__)("Button color type",o.i18n),description:Object(s.__)("Sets the button color type to single or gradient",o.i18n)},buttonToNormal:{video:$n.a,title:Object(s.__)("Change to normal button on hover",o.i18n),description:Object(s.__)("Triggers change from ghost to normal button when you mouse over",o.i18n)},buttonCollapse:{video:Qn.a,title:Object(s.__)("Collapse buttons on",o.i18n),description:Object(s.__)("Sets when buttons will be triggered to arrange vertically",o.i18n)},spacing:{video:ta.a,title:Object(s.__)("Spacing",o.i18n),description:Object(s.__)("Adjusts the space between block elements",o.i18n)},spacingBlockTitle:{video:aa.a,title:Object(s.__)("Block title spacing",o.i18n),description:Object(s.__)("Adjusts the space below the block title",o.i18n)},spacingBlockDescription:{video:oa.a,title:Object(s.__)("Block description spacing",o.i18n),description:Object(s.__)("Adjusts the space below the block description",o.i18n)},spacingImage:{video:la.a,title:Object(s.__)("Image spacing",o.i18n),description:Object(s.__)("Adjusts the space below the image",o.i18n)},spacingNumber:{video:la.a,title:Object(s.__)("Number spacing",o.i18n),description:Object(s.__)("Adjusts the space below the number",o.i18n)},spacingIcon:{video:la.a,title:Object(s.__)("Icon spacing",o.i18n),description:Object(s.__)("Adjusts the space below the icon",o.i18n)},spacingTitle:{video:sa.a,title:Object(s.__)("Title spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},spacingName:{video:sa.a,title:Object(s.__)("Name / position spacing",o.i18n),description:Object(s.__)("Adjusts the space below the name / position",o.i18n)},spacingDescription:{video:ba.a,title:Object(s.__)("Description Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the description",o.i18n)},spacingButton:{video:ma.a,title:Object(s.__)("Button spacing",o.i18n),description:Object(s.__)("Adjusts the space beloe the button",o.i18n)},spacingButtonGap:{video:da.a,title:Object(s.__)("Button spacing gap",o.i18n),description:Object(s.__)("Adjusts the gap between the buttons",o.i18n)},hoverEffect:{video:ha.a,title:Object(s.__)("Hover effect",o.i18n),description:Object(s.__)("Triggers animation or effects when you mouse over",o.i18n)},backgroundOnOff:{video:ya.a,title:Object(s.__)("Background Toggle On/Off",o.i18n),description:Object(s.__)("Turns the block background on/off. Turn on to enable different background settings.",o.i18n),learnMore:"https://wpstackable.com/blog/column-backgrounds-and-block-backgrounds/?utm_medium=Help%20Tooltip&utm_campaign=Help%20Tooltip&utm_source=Plugin"},backgroundColorOpacity:{video:wa.a,title:Object(s.__)("Background Color Opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the background color",o.i18n)},backgroundTint:{video:ja.a,title:Object(s.__)("Background Media Tint Strength",o.i18n),description:Object(s.__)("Adjusts the intensity of the background media tint",o.i18n)},backgroundColorType:{video:Ca.a,title:Object(s.__)("Color type",o.i18n),description:Object(s.__)("Sets the color to either a single color or a gradient",o.i18n)},backgroundFixed:{video:Ea.a,title:Object(s.__)("Fixed Background",o.i18n),description:Object(s.__)("Keeps the background image fixed in place while scrolling",o.i18n)},gradientDirection:{video:Ba.a,title:Object(s.__)("Gradient direction",o.i18n),description:Object(s.__)("Sets the direction (in degrees) of the colors",o.i18n)},gradientLocation:{video:Pa.a,title:Object(s.__)("Gradient Color location",o.i18n),description:Object(s.__)("Sets the placement of each color in relation to the other color",o.i18n)},backgroundImagePosition:{video:Na.a,title:Object(s.__)("Image Position",o.i18n),description:Object(s.__)("Chooses which part of the background image will be the focal point",o.i18n)},backgroundImageRepeat:{video:Ra.a,title:Object(s.__)("Image Repeat",o.i18n),description:Object(s.__)("Covers the background with tiled images",o.i18n)},backgroundImageSize:{video:Da.a,title:Object(s.__)("Image Size",o.i18n),description:Object(s.__)("Sets the display image size",o.i18n)},backgroundBlendMode:{video:za.a,title:Object(s.__)("Image Blend Mode",o.i18n),description:Object(s.__)("Sets how this background gradient/image blends into the other background",o.i18n)},separatorTopOn:{video:Ua.a,title:Object(s.__)("Separator Top On and Off",o.i18n),description:Object(s.__)("Turns the top separator on/off. Turn on to enable different separator settings.",o.i18n)},separatorBottomOn:{video:Wa.a,title:Object(s.__)("Separator Bottom On and Off",o.i18n),description:Object(s.__)("Turns the bottom separator on/off. Turn on to enable different separator settings.",o.i18n)},separatorHeight:{video:Va.a,title:Object(s.__)("Separator height",o.i18n),description:Object(s.__)("Adjusts the height of the separator to stretch or compress vertically",o.i18n)},separatorWidth:{video:Ka.a,title:Object(s.__)("Separator width",o.i18n),description:Object(s.__)("Adusts the width of the separator to stretch or compress horizantally",o.i18n)},separatorShadow:{video:Ya.a,title:Object(s.__)("Shadow",o.i18n),description:Object(s.__)("Adjusts the intensity of the separator shadow and makes the separator more prominent",o.i18n)},separatorBringToFront:{video:$a.a,title:Object(s.__)("Bring to Front",o.i18n),description:Object(s.__)("Brings the separator layer in front of other block elements",o.i18n)},separatorLayer2:{video:Qa.a,title:Object(s.__)("Layer 2",o.i18n),description:Object(s.__)("Turns a second separator layer on/off. Turn on to enable the separate layer settings.",o.i18n)},separatorLayer3:{video:ti.a,title:Object(s.__)("Layer 3",o.i18n),description:Object(s.__)("Turns a third separator layer on/off. Turn on to enable the separate layer settings.",o.i18n)},separatorLayerOpacity:{video:ai.a,title:Object(s.__)("Layer Opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the separator layer",o.i18n)},separatorLayerBlendMode:{video:oi.a,title:Object(s.__)("Layer blend mode",o.i18n),description:Object(s.__)("Sets how the sepator layer is blended into the background",o.i18n)},advancedOpacity:{video:li.a,title:Object(s.__)("Opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the entire block",o.i18n)},advancedZindex:{video:si.a,title:Object(s.__)("Z-Index",o.i18n),description:Object(s.__)("Sets the stack order of different blocks to make one appear in front of another. A block with a higher z-index will show up on top of another block with a lower z-index.",o.i18n)},advancedBlockSpacing:{video:bi.a,title:Object(s.__)("Block Spacing",o.i18n),description:Object(s.__)("Set margins, paddings and alignment of the block and its content",o.i18n)},advancedBlockMargins:{video:bi.a,title:Object(s.__)("Block Margins",o.i18n),description:Object(s.__)("Sets the block margin, i.e. the space outside the block between the block border and the next block",o.i18n)},advancedBlockPaddings:{video:mi.a,title:Object(s.__)("Block Padding",o.i18n),description:Object(s.__)("Sets the block padding, i.e. the space inside the block between the column container and the block border",o.i18n)},advancedBlockHeight:{video:di.a,title:Object(s.__)("Min Block Height",o.i18n),description:Object(s.__)("Adjusts the minimum allowable height of the block",o.i18n)},advancedBlockVerticalAlign:{video:hi.a,title:Object(s.__)("Content Vertical Align",o.i18n),description:Object(s.__)("Sets the placement of the column container to top, center or bottom. Available when the min. block height is set to higher than default.",o.i18n)},advancedBlockContentWidth:{video:yi.a,title:Object(s.__)("Max Content Width",o.i18n),description:Object(s.__)("Adjusts the maximum allowable width of the block. The settings will depend on the block width you set on the toolbar.",o.i18n)},advancedBlockHorizontalAlign:{video:wi.a,title:Object(s.__)("Content Horizontal Align",o.i18n),description:Object(s.__)("Sets the placement of the column container to left, center or right. Not available when block width is set to full width.",o.i18n)},advancedColumnSpacing:{video:ji.a,title:Object(s.__)("Column Spacing & More",o.i18n),description:Object(s.__)("Sets column paddings, the space inside the block between the block elements and the column container border",o.i18n)},advancedColumnPaddings:{video:ji.a,title:Object(s.__)("Column Paddings",o.i18n),description:Object(s.__)("Sets the column padding, the space inside the block between the block elements and the column container border",o.i18n)},advancedColumnGap:{video:Ci.a,title:Object(s.__)("Column Gap",o.i18n),description:Object(s.__)("Sets the distance between two or more columns",o.i18n)},advancedColumnColumnVerticalAlign:{video:Ei.a,title:Object(s.__)("Column Vertical Align",o.i18n),description:Object(s.__)("Sets the placement of the column container to top, center, bottom or stretch. Available when column heights are different.",o.i18n)},advancedColumnHeight:{video:Bi.a,title:Object(s.__)("Min Column Height",o.i18n),description:Object(s.__)("Adjusts the minimum allowable height of the column container",o.i18n)},advancedColumnContentVerticalAlign:{video:Pi.a,title:Object(s.__)("Content Vertical Align",o.i18n),description:Object(s.__)("Sets the placement of the block elements to top, center, bottom or stretch. Available when column heights are different or when min. column height is set to higher than default.",o.i18n)},accordionAdjacentOpen:{video:Ni.a,title:Object(s.__)("Close adjacent on open",o.i18n),description:Object(s.__)("Automatically closes adjacent accordion panels when clicked",o.i18n)},accordionClosedStateBackgroundColor:{video:Ri.a,title:Object(s.__)("Closed state Background Color",o.i18n),description:Object(s.__)("Sets color of the panel when closed",o.i18n)},accordionPadding:{video:Di.a,title:Object(s.__)("Accordion Padding",o.i18n),description:Object(s.__)("Sets the accordion padding, i.e. the space inside the block between the panel elements and the panel border",o.i18n)},accordionTitleSpacing:{video:zi.a,title:Object(s.__)("Accordion Title Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},accordionBorder:{video:Ui.a,title:Object(s.__)("Border",o.i18n),description:Object(s.__)("Adjusts the thickness and color of the border of a closed panel for the Lined to Colored layout",o.i18n)},accordionBorderSize:{video:Ui.a,title:Object(s.__)("Border Size",o.i18n),description:Object(s.__)("Adjusts the thickness of the border of a closed panel for the Lined to Colored layout",o.i18n)},imageColumnWidth:{video:Wi.a,title:Object(s.__)("Image Column Width",o.i18n),description:Object(s.__)("Adjusts the width of the image",o.i18n)},featureContainerWidth:{video:Vi.a,title:Object(s.__)("Container Width",o.i18n),description:Object(s.__)("Adjusts the width of the text and button container",o.i18n)},featureContainerOffset:{video:Ki.a,title:Object(s.__)("Container Offset",o.i18n),description:Object(s.__)("Adjusts the relative arrangement of the image and the text and button contianer",o.i18n)},iconListGrid:{video:Yi.a,title:Object(s.__)("Display as a grid",o.i18n),description:Object(s.__)("Displays the list in an evenly-spaced grid arrangement",o.i18n)},iconListGap:{video:$i.a,title:Object(s.__)("List Gap",o.i18n),description:Object(s.__)("Adjusts the space between different list lines",o.i18n)},imageBoxHeight:{video:Qi.a,title:Object(s.__)("Height",o.i18n),description:Object(s.__)("Adjusts the height of the image box",o.i18n)},notificationDismissible:{video:to.a,title:Object(s.__)("Dismissible",o.i18n),description:Object(s.__)("Provides option to close the notification",o.i18n)},postsContentOrder:{video:ao.a,title:Object(s.__)("Content Order",o.i18n),description:Object(s.__)("Sets the order of the items displayed (category, title, meta, excerpt) for each post",o.i18n)},postsMetaSeparator:{video:oo.a,title:Object(s.__)("Meta Separator",o.i18n),description:Object(s.__)("Sets the separators between meta items (dot, space, comma, dash, pipe)",o.i18n)},dividerMargin:{video:lo.a,title:Object(s.__)("Vertical Margin",o.i18n),description:Object(s.__)("Adjusts the space between the divider and the vertically adjacent blocks",o.i18n)},pricingImageAlign:{video:so.a,title:Object(s.__)("Image Align",o.i18n),description:Object(s.__)("Adjusts the placement of the image to align left, center or right",o.i18n)},pricingTitleAlign:{video:bo.a,title:Object(s.__)("Title Align",o.i18n),description:Object(s.__)("Adjusts the placement of the title to align left, center or right",o.i18n)},pricingPriceAlign:{video:mo.a,title:Object(s.__)("Price Align",o.i18n),description:Object(s.__)("Adjusts the placement of the price to align left, center or right",o.i18n)},pricingSubpriceAlign:{video:fo.a,title:Object(s.__)("Sub Price Align",o.i18n),description:Object(s.__)("Adjusts the placement of the subtitle to align left, center or right",o.i18n)},pricingButtonAlign:{video:vo.a,title:Object(s.__)("Button Align",o.i18n),description:Object(s.__)("Adjusts the placement of the button to align left, center or right",o.i18n)},pricingDescriptionAlign:{video:Oo.a,title:Object(s.__)("Description Align",o.i18n),description:Object(s.__)("Adjusts the placement of the description to align left, center or right",o.i18n)},pricingImageSpacing:{video:_o.a,title:Object(s.__)("Image Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the image",o.i18n)},pricingTitleSpacing:{video:ko.a,title:Object(s.__)("Title Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},pricingPriceSpacing:{video:xo.a,title:Object(s.__)("Price Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the price",o.i18n)},pricingSubpriceSpacing:{video:So.a,title:Object(s.__)("Sub Price Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the subtitle",o.i18n)},pricingButtonSpacing:{video:To.a,title:Object(s.__)("Button Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the button",o.i18n)},pricingDescriptionSpacing:{video:Ao.a,title:Object(s.__)("Description Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the description",o.i18n)},imageBoxOverlay:{video:Mo.a,title:Object(s.__)("Overlay Color",o.i18n),description:Object(s.__)("Sets the overlay color of all image boxes",o.i18n)},imageBoxOverlayHover:{video:Fo.a,title:Object(s.__)("Overlay Hover Color",o.i18n),description:Object(s.__)("Triggers change in overlay color when you mouse over",o.i18n)},imageBoxHoverEffect:{video:Io.a,title:Object(s.__)("Image Hover Effect",o.i18n),description:Object(s.__)("Sets an effect that animates the image",o.i18n)},imageBoxBoxHoverEffect:{video:Lo.a,title:Object(s.__)("Box Hover Effect",o.i18n),description:Object(s.__)("Sets an effect that animates the container of the image",o.i18n)},imageBoxSubtitleSpacing:{video:Ho.a,title:Object(s.__)("Subtitle Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the subtitle",o.i18n)},imageBoxTitleSpacing:{video:Go.a,title:Object(s.__)("Title Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},imageBoxLineSpacing:{video:qo.a,title:Object(s.__)("Line Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the line",o.i18n)},imageBoxDescriptionSpacing:{video:Jo.a,title:Object(s.__)("Description Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the description",o.i18n)},imageBoxArrowSpacing:{video:Xo.a,title:Object(s.__)("Arrow Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the arrow",o.i18n)},imageBoxSubtitleAlign:{video:Zo.a,title:Object(s.__)("Subtitle Align",o.i18n),description:Object(s.__)("Adjusts the placement of the subtitle to align left, center or right",o.i18n)},imageBoxTitleAlign:{video:er.a,title:Object(s.__)("Title Align",o.i18n),description:Object(s.__)("Adjusts the placement of the title to align left, center or right",o.i18n)},imageBoxDescriptionAlign:{video:nr.a,title:Object(s.__)("Description Align",o.i18n),description:Object(s.__)("Adjusts the placement of the description to align left, center or right",o.i18n)},imageBoxArrowAlign:{video:ir.a,title:Object(s.__)("Arrow Align",o.i18n),description:Object(s.__)("Adjusts the placement of the arrow to align left, center or right",o.i18n)},videoPopupWidth:{video:rr.a,title:Object(s.__)("Video popup width",o.i18n),description:Object(s.__)("Adjusts the width of the video popup container",o.i18n)},videoPopupHeight:{video:cr.a,title:Object(s.__)("Video popup height",o.i18n),description:Object(s.__)("Adjusts the height of the video popup container",o.i18n)},containerImageWidth:{video:ur.a,title:Object(s.__)("Image width",o.i18n),description:Object(s.__)("Adjusts the image width",o.i18n)},containerImageHeight:{video:pr.a,title:Object(s.__)("Image height",o.i18n),description:Object(s.__)("Adjusts the image height",o.i18n)},columnRowGap:{video:gr.a,title:Object(s.__)("Row gap",o.i18n),description:Object(s.__)("Adjusts the vertical row gap between columns",o.i18n)},noPadding:{video:fr.a,title:Object(s.__)("No paddings",o.i18n),description:Object(s.__)("Removes all outer paddings of the block",o.i18n)},columnWidth:{video:vr.a,title:Object(s.__)("Column widths",o.i18n),description:Object(s.__)("Adjust the individual widths of each column",o.i18n)},columnArrangement:{video:Or.a,title:Object(s.__)("Column arrangement",o.i18n),description:Object(s.__)("Rearrange and move columns around by dragging each handle",o.i18n)}},_r=function(e){var t=e.getAnchorRect,n=e.title,a=e.videoUrl,i=e.description,l=e.learnMoreUrl,c=e.learnMore,b=Object(u.useRef)();return Object(u.useEffect)(function(){var e=b.current;e.muted=!0,e&&!e.playing&&e.play()},[]),Object(u.useEffect)(function(){window.dispatchEvent(new window.Event("resize"))},[e.videoUrl]),wp.element.createElement(r.Popover,{title:n,focusOnMount:"container",className:"ugb-help-tooltip-video",position:"middle left",getAnchorRect:t},wp.element.createElement(r.PanelBody,null,wp.element.createElement("button",{className:"ugb-help-tooltip-video__remove","data-testid":"close-button",onClick:e.onClickClose},wp.element.createElement(r.Dashicon,{icon:"no"})),a&&wp.element.createElement(u.Fragment,null,wp.element.createElement("video",{ref:b,width:"600",autoPlay:!0,loop:!0,muted:!0,playsinline:!0,role:"img","aria-labelledby":"ugb-help-tooltip-video__description",src:a}),(!b.current||!b.current.playing)&&wp.element.createElement(r.Spinner,null)),wp.element.createElement("div",{className:"ugb-help-tooltip-video__description",id:"ugb-help-tooltip-video__description"},n&&wp.element.createElement("h4",null,n),i,l&&wp.element.createElement("div",{className:"ugb-help-tooltip-video__link"},wp.element.createElement("a",{href:l,target:"_learn"},c," ",wp.element.createElement(r.Dashicon,{icon:"external"}))),wp.element.createElement(r.CheckboxControl,{label:Object(s.__)("Stop showing tooltips",o.i18n),className:"ugb-help-tooltip__checkbox",checked:!e.tooltipsEnabled,onChange:function(t){return e.onTooltipsEnabledChange(!t)}}))))};_r.defaultProps={onClickClose:function(){},getAnchorRect:null,title:Object(s.__)("Help",o.i18n),description:"",videoUrl:"",learnMoreUrl:"",learnMore:Object(s.__)("Learn more",o.i18n),tooltipsEnabled:!0,onTooltipsEnabledChange:function(){}};var jr=_r,kr=null,Cr={},xr={},Er={},Sr=function(e){return e.closest('[class*="ugb--help-tip-"]')},Br=function(){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};Cr[e]=function(n){var a=n.target.closest(e);a&&kr!==a&&(kr=a,t(a))},xr[e]=function(t){var a=t.target.closest(e);t.relatedTarget&&a===t.relatedTarget.closest(e)||a&&kr===a&&(n(kr),kr=null)},document.body.addEventListener("mouseover",Cr[e]),document.body.addEventListener("mouseout",xr[e])}(['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label','[class*="ugb--help-tip-"].components-panel__body .components-panel__body-toggle'].join(", "),function(e){return Object(M.doAction)("stackable.help-video.control.hover.in",e,Sr(e))},function(){return Object(M.doAction)("stackable.help-video.control.hover.out")}),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Er[e]=function(n){var a=n.target.closest(e);a&&t(a)},document.body.addEventListener("click",Er[e])}(['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label'].join(", "),function(e){return Object(M.doAction)("stackable.help-video.control.click",e,Sr(e))})},Tr=function(){var e;e=['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label','[class*="ugb--help-tip-"].components-panel__body .components-panel__body-toggle'].join(", "),document.body.removeEventListener("mouseover",Cr[e]),document.body.removeEventListener("mouseout",xr[e]),function(e){document.body.removeEventListener("click",Er[e])}(['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label'].join(", "))};function Pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Ar(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nr,Mr={show:!1,controlEl:null,target:null},Rr=function(e,t){Nr=setTimeout(function(){Dr(e,t)},1500)},Fr=function(){Nr&&clearTimeout(Nr),Nr=null},Dr=function(e,t){Mr=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=Xr({blockTag:!0,opacity:!0,zIndex:!0,modifyStyles:!0},t);Object(M.addFilter)("stackable.".concat(e,".edit.inspector.advanced.before"),"stackable/".concat(e,"/advanced-general"),Zr(e,n),2),n.modifyStyles&&Object(M.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/advanced-general"),Qr()),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/advanced-general"),el),Object(M.doAction)("stackable.module.advanced-general",e)};function nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function al(e){for(var t=1;t .ugb-inner-block"),{minWidth:"wide"===u&&l("blockWidth")?"auto !important":void 0,maxWidth:Object(i.c)(l("blockWidth","%s".concat(T||"px")))}),il(r,"tablet",(il(a={},F,{minHeight:l("tabletBlockHeight","%s".concat(x||"px")),justifyContent:l("tabletBlockHorizontalAlign"),alignItems:l("tabletBlockVerticalAlign")}),il(a,"".concat(F," > .ugb-inner-block"),{minWidth:"wide"===u&&l("tabletBlockWidth")?"auto !important":void 0,maxWidth:Object(i.c)(l("tabletBlockWidth","%s".concat(A||"px")))}),a)),il(r,"mobile",(il(o={},F,{minHeight:l("mobileBlockHeight","%s".concat(S||"px")),justifyContent:l("mobileBlockHorizontalAlign"),alignItems:l("mobileBlockVerticalAlign")}),il(o,"".concat(F," > .ugb-inner-block"),{minWidth:"wide"===u&&l("mobileBlockWidth")?"auto !important":void 0,maxWidth:Object(i.c)(l("mobileBlockWidth","%s".concat(R||"px")))}),o)),il(r,"ie11",il({},F,{height:l("blockHeight","%s".concat(k))||void 0})),r);return He.a.all([t,D,I,z])}},ll=function(e){return al({},e,{},Object(i.i)("%sMargin%s",{type:"number",default:""},["","Tablet","Mobile"],["Top","Right","Bottom","Left"]),{},Object(i.i)("%sMarginUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sPadding%s",{type:"number",default:""},["","Tablet","Mobile"],["Top","Right","Bottom","Left"]),{},Object(i.i)("%sPaddingUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockHeight",{type:"number",default:""},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockHeightUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockWidth",{type:"number",default:""},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockWidthUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sBlock%sAlign",{type:"string",default:""},["","Tablet","Mobile"],["Vertical","Horizontal"]))},cl=function(e,t){var n=t.attributes,a=n.blockWidth,i=void 0===a?"":a,o=n.tabletBlockWidth,r=void 0===o?"":o,l=n.mobileBlockWidth;return al({},e,{"ugb--has-custom-content-width":""!==i,"ugb--has-custom-content-width-tablet":""!==r,"ugb--has-custom-content-width-mobile":""!==(void 0===l?"":l)})},sl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=al({margins:!0,paddings:!0,height:!0,width:!0,horizontalAlign:!0,verticalAlign:!0,modifyStyles:!0,enableMarginTop:!0,enableMarginRight:!0,enableMarginBottom:!0,enableMarginLeft:!0,enablePaddingTop:!0,enablePaddingRight:!0,enablePaddingBottom:!0,enablePaddingLeft:!0},t);Object(M.addFilter)("stackable.".concat(e,".edit.inspector.advanced.before"),"stackable/".concat(e,"/advanced-block-spacing"),ol(e,n),5),n.modifyStyles&&Object(M.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/advanced-block-spacing"),rl(e)),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/advanced-block-spacing"),ll),Object(M.addFilter)("stackable.".concat(e,".main-block.classes"),"stackable/".concat(e,"/advanced-block-spacing"),cl),Object(M.doAction)("stackable.module.advanced-block-spacing",e)};function ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pl=function(e){return wp.element.createElement(u.Fragment,null,e,wp.element.createElement(a.fb,{title:Object(s.__)("Column Spacing & More",o.i18n),initialOpen:!1,className:"ugb--help-tip-advanced-column-spacing"},wp.element.createElement(a.ib,{type:"advanced"})))},ml=function(e){return function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};o.showProNotice&&Object(M.addFilter)("stackable.".concat(e,".edit.inspector.advanced.before"),"stackable/".concat(e,"/fine-grained"),pl,6),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/advanced-column-spacing"),ml),Object(M.doAction)("stackable.module.advanced-column-spacing",e,t)};function dl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function fl(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return function(e,n){var i=n.setAttributes,l=n.attributes,c=l.showTopSeparator,b=void 0!==c&&c,p=l.topSeparatorDesign,m=void 0===p?"wave-1":p,g=l.topSeparatorColor,d=void 0===g?"":g,f=l.topSeparatorWidth,h=void 0===f?"":f,v=l.topSeparatorFlipHorizontally,y=void 0!==v&&v,O=l.topSeparatorFlipVertically,w=void 0!==O&&O,_=l.topSeparatorShadow,j=void 0===_||_,k=l.topSeparatorBringToFront,C=void 0!==k&&k,x=l.showBottomSeparator,E=void 0!==x&&x,S=l.bottomSeparatorDesign,B=void 0===S?"wave-1":S,T=l.bottomSeparatorColor,P=void 0===T?"":T,A=l.bottomSeparatorWidth,N=void 0===A?"":A,R=l.bottomSeparatorFlipHorizontally,F=void 0!==R&&R,D=l.bottomSeparatorFlipVertically,I=void 0!==D&&D,z=l.bottomSeparatorShadow,L=void 0===z||z,U=l.bottomSeparatorBringToFront,H=void 0!==U&&U;return wp.element.createElement(u.Fragment,null,e,wp.element.createElement(a.fb,{title:Object(s.__)("Top Separator",o.i18n),id:"top-separator",checked:b,onChange:function(e){return i({showTopSeparator:e})},toggleOnSetAttributes:["topSeparatorDesign","topSeparatorColor","topSeparatorHeight","topSeparatorTabletHeight","topSeparatorMobileHeight","topSeparatorWidth","topSeparatorFlipHorizontally","topSeparatorFlipVertically","topSeparatorShadow","topSeparatorBringToFront","showTopSeparatorLayer2","showTopSeparatorLayer3","topSeparatorLayer2Color","topSeparatorLayer3Color","topSeparatorLayer2BlendMode","topSeparatorLayer3BlendMode","topSeparatorLayer2Height","topSeparatorLayer3Height","topSeparatorLayer2Width","topSeparatorLayer3Width","topSeparatorLayer2Opacity","topSeparatorLayer3Opacity","topSeparatorLayer2FlipHorizontally","topSeparatorLayer3FlipHorizontally"],toggleAttributeName:"showTopSeparator",className:"ugb-top-block-separator-panel ugb--help-tip-separator-top-on"},wp.element.createElement(a.F,{label:Object(s.__)("Design",o.i18n),selected:m,onChange:function(e){return i({topSeparatorDesign:e})}}),wp.element.createElement(a.u,{label:Object(s.__)("Color",o.i18n),value:d,onChange:function(e){return i({topSeparatorColor:e})}}),wp.element.createElement(a.kb,{attrNameTemplate:"topSeparator%sHeight",setAttributes:i,blockAttributes:n.attributes},wp.element.createElement(a.c,{label:Object(s.__)("Height",o.i18n),min:"30",max:"400",allowReset:!0,placeholder:"200",className:"ugb--help-tip-separator-height"})),wp.element.createElement(a.c,{label:Object(s.__)("Width",o.i18n),min:"1",max:"4",step:"0.1",value:h,onChange:function(e){return i({topSeparatorWidth:e})},allowReset:!0,placeholder:"1.0",className:"ugb--help-tip-separator-width"}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Horizontally",o.i18n),checked:y,onChange:function(e){return i({topSeparatorFlipHorizontally:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Vertically",o.i18n),checked:w,onChange:function(e){return i({topSeparatorFlipVertically:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Shadow",o.i18n),checked:j,onChange:function(e){return i({topSeparatorShadow:e})},className:"ugb--help-tip-separator-shadow"}),t.enableBringToFront&&wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Bring to Front",o.i18n),checked:C,onChange:function(e){return i({topSeparatorBringToFront:e})},className:"ugb--help-tip-separator-bring-to-front"}),Object(M.applyFilters)("stackable.block-separators.edit.top",null,n),o.showProNotice&&wp.element.createElement(a.jb,{title:Object(s.__)("Say Hello to Gorgeous Separators 👋",o.i18n),description:Object(s.__)("Add a second & third layer to this separator and make it look even sweeter. This feature is only available on Stackable Premium",o.i18n)})),wp.element.createElement(a.fb,{title:Object(s.__)("Bottom Separator",o.i18n),id:"bottom-separator",checked:E,onChange:function(e){return i({showBottomSeparator:e})},toggleOnSetAttributes:["bottomSeparatorDesign","bottomSeparatorColor","bottomSeparatorHeight","bottomSeparatorTabletHeight","bottomSeparatorMobileHeight","bottomSeparatorWidth","bottomSeparatorFlipHorizontally","bottomSeparatorFlipVertically","bottomSeparatorShadow","bottomSeparatorBringToFront","showBottomSeparatorLayer2","showBottomSeparatorLayer3","bottomSeparatorLayer2Color","bottomSeparatorLayer3Color","bottomSeparatorLayer2BlendMode","bottomSeparatorLayer3BlendMode","bottomSeparatorLayer2Height","bottomSeparatorLayer3Height","bottomSeparatorLayer2Width","bottomSeparatorLayer3Width","bottomSeparatorLayer2Opacity","bottomSeparatorLayer3Opacity","bottomSeparatorLayer2FlipHorizontally","bottomSeparatorLayer3FlipHorizontally"],toggleAttributeName:"showBottomSeparator",className:"ugb-bottom-block-separator-panel ugb--help-tip-separator-bottom-on"},wp.element.createElement(a.F,{label:Object(s.__)("Design",o.i18n),selected:B,onChange:function(e){return i({bottomSeparatorDesign:e})}}),wp.element.createElement(a.u,{label:Object(s.__)("Color",o.i18n),value:P,onChange:function(e){return i({bottomSeparatorColor:e})}}),wp.element.createElement(a.kb,{attrNameTemplate:"bottomSeparator%sHeight",setAttributes:i,blockAttributes:n.attributes},wp.element.createElement(a.c,{label:Object(s.__)("Height",o.i18n),min:"30",max:"400",allowReset:!0,placeholder:"200",className:"ugb--help-tip-separator-height"})),wp.element.createElement(a.c,{label:Object(s.__)("Width",o.i18n),min:"1",max:"4",step:"0.1",value:N,onChange:function(e){return i({bottomSeparatorWidth:e})},allowReset:!0,placeholder:"1.0",className:"ugb--help-tip-separator-width"}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Horizontally",o.i18n),checked:F,onChange:function(e){return i({bottomSeparatorFlipHorizontally:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Vertically",o.i18n),checked:I,onChange:function(e){return i({bottomSeparatorFlipVertically:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Shadow",o.i18n),checked:L,onChange:function(e){return i({bottomSeparatorShadow:e})},className:"ugb--help-tip-separator-shadow"}),t.enableBringToFront&&wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Bring to Front",o.i18n),checked:H,onChange:function(e){return i({bottomSeparatorBringToFront:e})},className:"ugb--help-tip-separator-bring-to-front"}),Object(M.applyFilters)("stackable.block-separators.edit.bottom",null,n),o.showProNotice&&wp.element.createElement(a.jb,{title:Object(s.__)("Say Hello to Gorgeous Separators 👋",o.i18n),description:Object(s.__)("Add a second & third layer to this separator and make it look even sweeter. This feature is only available on Stackable Premium",o.i18n)})))}},Kl=function(e){return Gl({},e,{},Object(i.i)("Show%sSeparator",{type:"boolean",default:""},["Top","Bottom"]),{},Object(i.i)("%sSeparator%s",{type:"string",default:"wave-1"},["Top","Bottom"],["Design"]),{},Object(i.i)("%sSeparator%s",{type:"string",default:""},["Top","Bottom"],["Color"]),{},Object(i.i)("%sSeparator%s",{type:"number",default:""},["Top","Bottom"],["Height","TabletHeight","MobileHeight","Width"]),{},Object(i.i)("%sSeparator%s",{type:"boolean",default:""},["Top","Bottom"],["FlipHorizontally","FlipVertically","BringToFront"]),{},Object(i.i)("%sSeparatorShadow",{type:"boolean",default:!0},["Top","Bottom"]),{},Object(i.i)("Show%sSeparator%s",{type:"boolean",default:""},["Top","Bottom"],["Layer2","Layer3"]),{},Object(i.i)("%sSeparator%s",{type:"string",default:""},["Top","Bottom"],["Layer2Color","Layer3Color","Layer2BlendMode","Layer3BlendMode"]),{},Object(i.i)("%sSeparator%s",{type:"number",default:""},["Top","Bottom"],["Layer2Height","Layer3Height","Layer2Width","Layer3Width","Layer2Opacity","Layer3Opacity"]),{},Object(i.i)("%sSeparator%s",{type:"boolean",default:""},["Top","Bottom"],["Layer2FlipHorizontally","Layer3FlipHorizontally"]))},Jl=function(e,t,n){var i=n.attributes,o=i.showTopSeparator,r=void 0!==o&&o,l=i.topSeparatorDesign,c=void 0===l?"wave-1":l,s=i.topSeparatorFlipVertically,b=void 0!==s&&s,p=i.topSeparatorShadow,m=void 0===p||p,g=i.showBottomSeparator,d=void 0!==g&&g,f=i.bottomSeparatorDesign,h=void 0===f?"wave-1":f,v=i.bottomSeparatorFlipVertically,y=void 0!==v&&v,O=i.bottomSeparatorShadow,w=void 0===O||O;return wp.element.createElement(u.Fragment,null,e,r&&wp.element.createElement(u.Fragment,null,wp.element.createElement("div",{className:"ugb-top-separator"},wp.element.createElement(a.lb,{design:c,shadow:m,inverted:b},Object(M.applyFilters)("stackable.module.block-separator.output.top.after",null,n)))),d&&wp.element.createElement(u.Fragment,null,wp.element.createElement("div",{className:"ugb-bottom-separator"},wp.element.createElement(a.lb,{design:h,shadow:w,inverted:y},Object(M.applyFilters)("stackable.module.block-separator.output.bottom.after",null,n)))))},Yl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,n){var a,i=n.attributes,o=i.showTopSeparator,r=void 0!==o&&o,l=i.topSeparatorColor,c=void 0===l?"":l,s=i.topSeparatorHeight,u=void 0===s?"":s,b=i.topSeparatorTabletHeight,p=void 0===b?"":b,m=i.topSeparatorMobileHeight,g=void 0===m?"":m,d=i.topSeparatorWidth,f=void 0===d?"":d,h=i.topSeparatorFlipHorizontally,v=void 0!==h&&h,y=i.topSeparatorBringToFront,O=void 0!==y&&y;if(!r)return e;var w=(Vl(a={},".ugb-top-separator",{zIndex:t.enableBringToFront&&O?6:void 0,transform:v?"scale(-1)":void 0}),Vl(a,".ugb-top-separator svg",{fill:""!==c?c:void 0}),Vl(a,".ugb-top-separator .ugb-separator-wrapper",{transform:""!==f?"scaleX(".concat(f,")"):void 0}),Vl(a,"desktopTablet",Vl({},".ugb-top-separator .ugb-separator-wrapper",{height:""!==u?"".concat(u,"px"):void 0})),Vl(a,"tabletOnly",Vl({},".ugb-top-separator .ugb-separator-wrapper",{height:""!==p?"".concat(p,"px"):void 0})),Vl(a,"mobile",Vl({},".ugb-top-separator .ugb-separator-wrapper",{height:""!==g?"".concat(g,"px"):void 0})),a);return He()(e,w)}},Xl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,n){var a,i=n.attributes,o=i.showBottomSeparator,r=void 0!==o&&o,l=i.bottomSeparatorColor,c=void 0===l?"":l,s=i.bottomSeparatorHeight,u=void 0===s?"":s,b=i.bottomSeparatorTabletHeight,p=void 0===b?"":b,m=i.bottomSeparatorMobileHeight,g=void 0===m?"":m,d=i.bottomSeparatorWidth,f=void 0===d?"":d,h=i.bottomSeparatorFlipHorizontally,v=void 0!==h&&h,y=i.bottomSeparatorBringToFront,O=void 0!==y&&y;if(!r)return e;var w=(Vl(a={},".ugb-bottom-separator",{zIndex:t.enableBringToFront&&O?6:void 0,transform:v?"scaleX(-1)":void 0}),Vl(a,".ugb-bottom-separator svg",{fill:""!==c?c:void 0}),Vl(a,".ugb-bottom-separator .ugb-separator-wrapper",{transform:""!==f?"scaleX(".concat(f,")"):void 0}),Vl(a,"desktopTablet",Vl({},".ugb-bottom-separator .ugb-separator-wrapper",{height:""!==u?"".concat(u,"px"):void 0})),Vl(a,"tabletOnly",Vl({},".ugb-bottom-separator .ugb-separator-wrapper",{height:""!==p?"".concat(p,"px"):void 0})),Vl(a,"mobile",Vl({},".ugb-bottom-separator .ugb-separator-wrapper",{height:""!==g?"".concat(g,"px"):void 0})),a);return He()(e,w)}},$l=function(e,t){var n=t.attributes,a=n.showTopSeparator,i=void 0!==a&&a,o=n.showBottomSeparator;return Gl({},e,{"ugb--has-top-separator":i,"ugb--has-bottom-separator":void 0!==o&&o})};function Zl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Ql(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};if(!xc(t)){var a=Sc.reduce(function(e,n){var a=n.name,i=n.module;return t===a?i:e},null);a&&Cc(t,a)}var i=xc(t);i&&i(e,n)},Sc=[{name:"advanced-general",module:tl},{name:"advanced-responsive",module:Ol},{name:"advanced-block-spacing",module:sl},{name:"advanced-column-spacing",module:gl},{name:"block-background",module:function(e){Object(M.addFilter)("stackable.".concat(e,".edit.inspector.style.block"),"stackable/".concat(e,"/block-background"),Ml,18),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/block-background"),Dl),Object(M.addFilter)("stackable.".concat(e,".edit.inspector.before"),"stackable/".concat(e,"/block-background"),Rl),Object(M.addFilter)("stackable.".concat(e,".settings"),"stackable/".concat(e,"/block-background"),Fl),Object(M.addFilter)("stackable.".concat(e,".main-block.classes"),"stackable/".concat(e,"/block-background"),Il),Object(M.addFilter)("stackable.".concat(e,".main-block.inner-classes"),"stackable/".concat(e,"/block-background"),zl),Object(M.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-background"),Ul),Object(M.addFilter)("stackable.".concat(e,".edit.output.outer"),"stackable/".concat(e,"/block-separators"),Ll),Object(M.addFilter)("stackable.".concat(e,".save.output.outer"),"stackable/".concat(e,"/block-separators"),Ll),Object(M.addFilter)("stackable.".concat(e,".design.filtered-block-attributes"),"stackable/".concat(e,"/block-separators"),Hl),Object(M.doAction)("stackable.module.block-background",e),function(e){Object(M.addFilter)("stackable.".concat(e,".settings"),"stackable/".concat(e,"/block-background"),xl,99),Cl.push("ugb/".concat(e))}(e)}},{name:"block-separators",module:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Gl({enableBringToFront:!0},t);Object(M.addFilter)("stackable.".concat(e,".edit.inspector.style.block"),"stackable/".concat(e,"/block-separators"),ql(e,n),18),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/block-separators"),Kl),Object(M.addFilter)("stackable.".concat(e,".edit.output.outer"),"stackable/".concat(e,"/block-separators"),Jl),Object(M.addFilter)("stackable.".concat(e,".save.output.outer"),"stackable/".concat(e,"/block-separators"),Jl),Object(M.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-separators/top"),Yl(e,n)),Object(M.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-separators/bottom"),Xl(e,n)),Object(M.addFilter)("stackable.".concat(e,".main-block.classes"),"stackable/".concat(e,"/block-separators"),$l),Object(M.doAction)("stackable.module.block-separators",e)}},{name:"block-title",module:function(e){Object(M.removeFilter)("stackable.panel-spacing-body.edit.before","stackable/block-title"),Object(M.addFilter)("stackable.".concat(e,".edit.inspector.style.block"),"stackable/".concat(e,"/block-title"),nc,17),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/block-title"),ac),Object(M.addFilter)("stackable.panel-spacing-body.edit.before","stackable/block-title",oc),Object(M.addFilter)("stackable.".concat(e,".edit.output.before"),"stackable/".concat(e,"/block-title"),ic),Object(M.addFilter)("stackable.".concat(e,".save.output.before"),"stackable/".concat(e,"/block-title"),rc),Object(M.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-title"),lc),Object(M.addFilter)("stackable.with-content-align-reseter.attributeNamesToReset","stackable/".concat(e,"/block-title"),sc),Object(M.addFilter)("stackable.".concat(e,".design.filtered-block-attributes"),"stackable/".concat(e,"/block-title"),cc),Object(M.doAction)("stackable.module.block-title",e)}},{name:"block-designs",module:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};bc({},t);Object(M.addFilter)("stackable.".concat(e,".edit.inspector.layout.before"),"stackable/".concat(e,"/block-designs"),mc(e),20),Object(M.doAction)("stackable.module.block-designs",e)}},{name:"content-align",module:function(e){Object(M.addFilter)("stackable.".concat(e,".edit.inspector.before"),"stackable/".concat(e,"/content-align"),vc,11),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/content-align"),fc),Object(M.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/content-align"),hc,9),Object(M.doAction)("stackable.module.content-align",e)}},{name:"custom-css",module:function(e){o.showProNotice&&Object(M.addFilter)("stackable.".concat(e,".edit.inspector.advanced.after"),"stackable/".concat(e,"/custom-css"),wc,20),Object(M.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/custom-css"),_c),o.isPro||Object(M.addFilter)("stackable.".concat(e,".save.output.outer"),"stackable/pro/".concat(e,"/custom-css/downgrade"),jc),Object(M.doAction)("stackable.module.custom-css",e)}}],Bc=n(10);function Tc(e){return(Tc="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 Pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Ac(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(d.getBlockType)(e)){var n=e.replace(/^\w+\//g,""),a=Ac({},t,{category:Object(i.qb)()?t.category:"stackable",modules:Object(M.applyFilters)("stackable.".concat(n,".modules"),t.modules||{}),deprecated:(t.deprecated||[]).map(function(t){return Ac({},t,{save:Object(Bc.f)(e)(t.save)})})});return Object.keys(a.modules).forEach(function(e){var t=a.modules[e];t&&Ec(n,e,"object"===Tc(t)?t:{})}),a.attributes=Object(M.applyFilters)("stackable.block.attributes",a.attributes),a.attributes=Object(M.applyFilters)("stackable.".concat(n,".attributes"),a.attributes),a.edit=Object(Bc.f)(e)(a.edit),a.save=Object(Bc.f)(e)(a.save),Object(d.registerBlockType)(e,Object(M.applyFilters)("stackable.".concat(n,".settings"),a)),a}};Object(i.qb)()?Object(d.registerBlockCollection)("ugb",{title:Object(s.__)("Stackable",o.i18n),icon:ct.w}):Object(d.setCategories)([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(p,F({style:e},t))},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(v,F({style:e},t))},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(d,F({style:e},t))},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(s,F({style:e},t))},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(E,F({style:e},t))},H=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(w,F({style:e},t))},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(k,F({style:e},t))},G=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(T,F({style:e},t))},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(N,F({style:e},t))},q={"round-thin":{icon:I(),iconFunc:I,title:Object(R.__)("Round Thin",M.i18n),value:"round-thin"},round:{icon:D(),iconFunc:D,title:Object(R.__)("Round",M.i18n),value:"round"},"round-thick":{icon:z(),iconFunc:z,title:Object(R.__)("Round Thick",M.i18n),value:"round-thick"},"round-fat":{icon:L(),iconFunc:L,title:Object(R.__)("Round Fat",M.i18n),value:"round-fat"},"square-thin":{icon:V(),iconFunc:V,title:Object(R.__)("Square Thin",M.i18n),value:"square-thin"},square:{icon:U(),iconFunc:U,title:Object(R.__)("Square",M.i18n),value:"square"},"square-simple":{icon:G(),iconFunc:G,title:Object(R.__)("Square Simple",M.i18n),value:"square-simple"},"square-modern":{icon:W(),iconFunc:W,title:Object(R.__)("Square Modern",M.i18n),value:"square-modern"},"square-fat":{icon:H(),iconFunc:H,title:Object(R.__)("Square Fat",M.i18n),value:"square-fat"}},K=n(2),J=n(9),Y=n(8),X=n.n(Y);function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Z(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(K.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(K.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(K.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-blockquote__item":Object(K.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-blockquote__item":Object(K.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-blockquote__item":Object(K.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}}});var p=e.attributes,m=p.containerBackgroundColor,g=void 0===m?"":m,d=p.textColor,f=void 0===d?"":d;return a.push({".ugb-blockquote__text":fe({},Object(K.K)("text%s","desktop",e.attributes,{important:!0}),{color:Object(K.vb)(f,n.containerBackground&&g)}),tablet:{".ugb-blockquote__text":fe({},Object(K.K)("text%s","tablet",e.attributes,{important:!0}))},mobile:{".ugb-blockquote__text":fe({},Object(K.K)("text%s","mobile",e.attributes,{important:!0}))}}),a.push.apply(a,ge(Object(K.F)(".ugb-blockquote__item","text%sAlign","textAlign","%s",e.attributes,{important:!0}))),me.a.all(a)},ye=n(3),Oe=n(10),we=n(6),_e=n(12);function je(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return Object(o.omit)(e,["videoLink","videoID","video-popup3","previewBackgroundMediaId"].concat(l(t&&t.previewBackgroundMediaId?["previewBackgroundMediaUrl"]:[])))});var c=n(5),s=n.n(c);function u(){return(u=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return _[e]({fill:t})}(o,c))))},migrate:function(e){var t=function(e){return(e||"").replace(/\.ugb-video-popup([\s\{\[\.\#\:])/g,".ugb-video-popup__wrapper$1")};return function(e){for(var t=1;t=5?l/10-.3:l/10+.3}}),V.a.all(a)},X=n(11),$=n(12),Z=n(6);Object(r.addFilter)("stackable.video-popup.edit.inspector.style.before","stackable/video-popup",function(e,t){var n=t.setAttributes,a=t.attributes,o=a.borderRadius,r=void 0===o?"":o,l=a.shadow,c=void 0===l?"":l,s=a.videoLink,u=void 0===s?"":s,b=a.videoID,p=void 0===b?"":b,m=a.playButtonType,g=a.playButtonColor,d=void 0===g?"#ffffff":g,f=a.playButtonOpacity,h=void 0===f?"":f,v=a.width,y=void 0===v?"":v,_=a.tabletWidth,j=void 0===_?"":_,k=a.mobileWidth,C=void 0===k?"":k,x=a.showBlockTitle,E=void 0!==x&&x,B=a.showBlockDescription,T=void 0!==B&&B,P=H(t);return wp.element.createElement(Z.Fragment,null,e,wp.element.createElement(S.fb,{title:Object(O.__)("General",w.i18n),initialOpen:!0},wp.element.createElement(S.V,{label:Object(O.__)("Popup Option #1: Upload Video",w.i18n),help:Object(O.__)("Use .mp4 format for videos",w.i18n),onRemove:function(){return n({videoLink:"",videoID:""})},onChange:function(e){n({videoLink:e.url,videoID:e.url})},imageID:Object(i.tb)(u)?p:"",imageURL:Object(i.tb)(u)?u:"",allowedTypes:["video"]}),wp.element.createElement(X.TextControl,{label:Object(O.__)("Popup Option #2: Video URL",w.i18n),help:Object(O.__)("Paste a Youtube / Vimeo URL",w.i18n),placeholder:"https://",value:Object(i.tb)(u)?"":u,onChange:function(e){return n({videoLink:e,videoID:Object(i.Y)(e).id})},min:1,max:4})),wp.element.createElement(S.fb,{title:Object(O.__)("Container",w.i18n),initialOpen:!1},wp.element.createElement(S.s,{label:Object(O.__)("Background",w.i18n),popoverLabel:Object(O.__)("Background",w.i18n),onReset:function(){n({previewBackgroundColorType:"",previewBackgroundColor:"",previewBackgroundColor2:"",previewBackgroundColorOpacity:"",previewBackgroundMediaID:"",previewBackgroundMediaUrl:"",previewBackgroundTintStrength:"",previewFixedBackground:""})},allowReset:t.attributes.previewBackgroundColor||t.attributes.previewBackgroundMediaUrl,hasColorPreview:t.attributes.previewBackgroundColor,hasImagePreview:t.attributes.previewBackgroundMediaUrl,colorPreview:"gradient"===t.attributes.previewBackgroundColorType?[t.attributes.previewBackgroundColor,t.attributes.previewBackgroundColor2]:t.attributes.previewBackgroundColor,imageUrlPreview:t.attributes.previewBackgroundMediaUrl},wp.element.createElement(S.h,{attrNameTemplate:"preview%s",setAttributes:n,blockAttributes:t.attributes})),P.containerWidth&&wp.element.createElement(Z.Fragment,null,wp.element.createElement(S.yb,{screen:"desktop"},wp.element.createElement(S.c,{label:Object(O.__)("Width",w.i18n),value:y,min:"200",max:"2000",placeholder:"2000",allowReset:!0,onChange:function(e){return t.setAttributes({width:e})},className:"ugb--help-tip-video-popup-width"})),wp.element.createElement(S.yb,{screen:"tablet"},wp.element.createElement(S.c,{label:Object(O.__)("Width",w.i18n),value:j,min:"200",max:"1000",placeholder:"1000",allowReset:!0,onChange:function(e){return t.setAttributes({tabletWidth:e})},className:"ugb--help-tip-video-popup-width"})),wp.element.createElement(S.yb,{screen:"mobile"},wp.element.createElement(S.c,{label:Object(O.__)("Width",w.i18n),value:C,min:"200",max:"700",placeholder:"700",allowReset:!0,onChange:function(e){return t.setAttributes({mobileWidth:e})},className:"ugb--help-tip-video-popup-width"}))),wp.element.createElement(S.kb,{attrNameTemplate:"%sHeight",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(S.c,{label:Object(O.__)("Height",w.i18n),min:0,max:1e3,allowReset:!0,placeholder:"400",className:"ugb--help-tip-video-popup-height"})),P.border&&wp.element.createElement(S.n,{attrNameTemplate:"column%s",setAttributes:n,blockAttributes:t.attributes}),P.borderRadius&&wp.element.createElement(S.c,{label:Object(O.__)("Border Radius",w.i18n),value:r,onChange:function(e){return n({borderRadius:e})},min:0,max:50,allowReset:!0,placeholder:"12",className:"ugb--help-tip-general-border-radius"}),wp.element.createElement(S.c,{label:Object(O.__)("Shadow / Outline",w.i18n),value:c,onChange:function(e){return n({shadow:e})},min:0,max:9,allowReset:!0,placeholder:"3",className:"ugb--help-tip-general-shadow"})),wp.element.createElement(S.fb,{title:Object(O.__)("Play Button",w.i18n),id:"play-button",initialOpen:!1},wp.element.createElement(X.SelectControl,{label:Object(O.__)("Button Style",w.i18n),value:m,options:L.map(function(e){return{value:e.value,label:e.label}}),onChange:function(e){n({playButtonType:e})}}),wp.element.createElement(S.kb,{attrNameTemplate:"%sPlayButtonSize",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(S.c,{label:Object(O.__)("Size",w.i18n),min:10,max:200,allowReset:!0,placeholder:"40"})),wp.element.createElement(S.u,{label:Object(O.__)("Color",w.i18n),value:d,onChange:function(e){return n({playButtonColor:e})}}),wp.element.createElement(S.c,{label:Object(O.__)("Opacity",w.i18n),min:0,max:1,step:.1,value:h,onChange:function(e){return n({playButtonOpacity:e})},allowReset:!0,placeholder:"1.0"})),(E||T)&&wp.element.createElement(S.gb,{initialOpen:!1,blockProps:t}))});var Q=Object($.compose)(W.i,W.g,W.d,Object(W.h)(),Object(W.a)(Y,{editorMode:!0}),Object(W.b)([[".ugb-video-popup__wrapper","background"],[".ugb-video-popup__play-button svg","play-button"]]))(function(e){var t,n,a,i=e.className,o=e.attributes,l=o.playButtonType,c=o.shadow,s=void 0===c?"":c,u=k()([i,"ugb-video-popup--v3"],Object(r.applyFilters)("stackable.video-popup.mainclasses",{},e)),b=k()(["ugb-video-popup__wrapper"],Object(r.applyFilters)("stackable.video-popup.boxclasses",(t={},n="ugb--shadow-".concat(s),a=""!==s,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t),e));return wp.element.createElement(S.k.Edit,{className:u,blockProps:e,render:function(){return wp.element.createElement(Z.Fragment,null,wp.element.createElement(S.G,{className:b,backgroundAttrName:"preview%s",blockProps:e},wp.element.createElement("span",{className:"ugb-video-popup__play-button"},U(l))))}})}),ee=n(19),te=n.n(ee);var ne=Object($.compose)(W.i,Object(W.a)(Y))(function(e){var t,n,a,i=e.className,o=e.attributes,l=o.videoID,c=o.playButtonType,s=o.shadow,u=void 0===s?"":s,b=k()([i,"ugb-video-popup--v3"],Object(r.applyFilters)("stackable.video-popup.mainclasses",{},e)),p=k()(["ugb-video-popup__wrapper"],Object(r.applyFilters)("stackable.video-popup.boxclasses",(t={},n="ugb--shadow-".concat(u),a=""!==u,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t),e));return wp.element.createElement(S.k.Save,{className:b,blockProps:e,render:function(){return wp.element.createElement(Z.Fragment,null,wp.element.createElement(S.G,{className:p,backgroundAttrName:"preview%s",blockProps:e,"data-video":te()(l)},wp.element.createElement("a",{href:"#",className:"ugb-video-popup__overlay","aria-label":"Play"}),wp.element.createElement("span",{className:"ugb-video-popup__play-button"},U(c))))}})});function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"schema",function(){return oe}),n.d(t,"name",function(){return re}),n.d(t,"settings",function(){return le});var oe=function(e){for(var t=1;t]*ugb-notification__close-button.*?.*?<\/span>/,"")});var y=n(353),O=n.n(y),w=n(354),_=n.n(w),j=n(355),k=n.n(j),C=n(356),x=n.n(C),E=n(357),S=n.n(E);function B(){return(B=Object.assign||function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(j)),paddingRight:t("mobileColumnPaddingRight","%s".concat(j)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(j)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(j))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-notification__item":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-notification__item":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-notification__item":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(j)),paddingRight:t("mobileColumnPaddingRight","%s".concat(j)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(j)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(j))})}}}),f.containerBorder&&n.push(D({},Object(l.p)("container%s",".ugb-notification__item",e.attributes)));var k=e.attributes,C=k.dismissible,x=void 0!==C&&C,E=k.dismissibleIconSize,S=void 0===E?"":E,B=k.dismissibleIconTabletSize,T=void 0===B?"":B,P=k.dismissibleIconMobileSize,A=void 0===P?"":P,F=k.dismissibleIconColor,L=void 0===F?"":F;x&&n.push({".ugb-notification__item":{paddingRight:S&&S>40?"100px !important":void 0},".ugb-notification__close-button svg":{fill:L?"".concat(L," !important"):void 0},desktopTablet:{".ugb-notification__close-button":{width:S?"".concat(S,"px"):void 0,height:S?"".concat(S,"px"):void 0}},tabletOnly:{".ugb-notification__close-button":{width:T?"".concat(T,"px"):void 0,height:T?"".concat(T,"px"):void 0}},mobile:{".ugb-notification__close-button":{width:A?"".concat(A,"px"):void 0,height:A?"".concat(A,"px"):void 0}}});var U=e.attributes,H=U.showIcon,W=void 0!==H&&H,G=U.iconColor,V=void 0===G?"":G,q=U.iconAlign,K=void 0===q?"":q,J=U.iconTabletAlign,Y=void 0===J?"":J,X=U.iconMobileAlign,$=void 0===X?"":X;if(W){var Z=Object(l.wb)(V,f.columnBackground&&d);n.push({".ugb-notification__icon svg:not(.ugb-custom-icon)":{color:Z?"".concat(Z," !important"):void 0},".ugb-notification__icon":{marginLeft:""!==K||""!==o?Object(l.c)(Object(l.hb)(K||o)):void 0,marginRight:""!==K||""!==o?Object(l.c)(Object(l.ib)(K||o)):void 0,height:t("iconSize","%spx !important"),width:t("iconSize","%spx !important")},tablet:{".ugb-notification__icon":{marginLeft:""!==Y||""!==c?Object(l.hb)(Y||c):void 0,marginRight:""!==Y||""!==c?Object(l.ib)(Y||c):void 0,height:t("iconTabletSize","%spx !important"),width:t("iconTabletSize","%spx !important")}},mobile:{".ugb-notification__icon":{marginLeft:""!==$||""!==u?Object(l.hb)($||u):void 0,marginRight:""!==$||""!==u?Object(l.ib)($||u):void 0,height:t("iconMobileSize","%spx !important"),width:t("iconMobileSize","%spx !important")}}}),n.push(D({},Object(l.v)("icon%s","ugb-notification__icon",e.attributes)))}var Q=e.attributes,ee=Q.titleColor,te=void 0===ee?"":ee,ne=Q.showTitle;if(void 0===ne||ne){var ae=Object(l.wb)(te,f.columnBackground&&d);n.push({".ugb-notification__title":D({},Object(l.K)("title%s","desktop",e.attributes,{importantSize:!0}),{color:ae?"".concat(ae," !important"):void 0,textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-notification__title":D({},Object(l.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-notification__title":D({},Object(l.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}})}var ie=e.attributes,oe=ie.descriptionColor,re=void 0===oe?"":oe,le=ie.showDescription;if(void 0===le||le){var ce=Object(l.wb)(re,f.columnBackground&&d);n.push({".ugb-notification__description":D({},Object(l.K)("description%s","desktop",e.attributes),{color:ce?"".concat(ce," !important"):void 0,textAlign:t("descriptionAlign","%s !important")}),tablet:{".ugb-notification__description":D({},Object(l.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign","%s !important")})},mobile:{".ugb-notification__description":D({},Object(l.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign","%s !important")})}})}var se=e.attributes,ue=se.showButton,be=void 0!==ue&&ue,pe=se.buttonDesign,me=void 0===pe?"ghost":pe,ge=se.buttonBackgroundColor,de=void 0===ge?"":ge;if(be){if(n.push(D({},Object(l.s)("button%s","ugb-button",e.attributes))),!de&&f.columnBackground){var fe,he,ve=d?Object(l.wb)(de,d,"#ffffff","#424242"):"bordered"===m?"#424242":z[b],ye=ve?"#ffffff"===ve?"#424242":"#ffffff":void 0;if("basic"===me||""===me)n.push((I(fe={},".ugb-button",{backgroundColor:ve||void 0}),I(fe,".ugb-button .ugb-button--inner, .ugb-button.ugb-button--has-icon.ugb-button--has-icon svg",{color:ye||void 0}),I(fe,".ugb-button:hover .ugb-button--inner, .ugb-button:hover svg",{color:ye||void 0}),fe));else n.push((I(he={},".ugb-button",{borderColor:ve||void 0}),I(he,".ugb-button .ugb-button--inner, .ugb-button.ugb-button--has-icon.ugb-button--has-icon svg",{color:ve||void 0}),I(he,".ugb-button:hover .ugb-button--inner, .ugb-button:hover svg",{color:ve||void 0}),he))}n.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")}}})}return f.iconSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-notification__icon","icon%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f.titleSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-notification__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f.descriptionSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-notification__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f.buttonSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),N.a.all(n)},U=n(3),H=n(1),W=n(10),G=n(11),V=n(0),q=n(12),K=n(6);function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Y(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *",e),_=Object(i.applyFilters)("stackable.blog-posts.spacing-paddings.selector","> .ugb-inner-block > .ugb-block-content > .ugb-blog-posts__item",e);b.push({saveOnly:{desktopTablet:P({},w,Object(j.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})),tabletOnly:P({},w,Object(j.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})),mobile:P({},w,Object(j.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))}))},editor:{desktopTablet:P({},_,Object(j.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})),tabletOnly:P({},_,Object(j.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})),mobile:P({},_,Object(j.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))}))}});var k=e.attributes.showImage,x=void 0===k||k;x&&u.imageHeight&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__featured-image img","image%sHeight","height","%spx",e.attributes,{important:!0}))),x&&u.imageWidth&&"list"===l&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__item","image%sWidth","gridTemplateColumns","%spx minmax(0, 1fr)",e.attributes,{important:!0})));var S=e.attributes,A=S.categoryHighlighted,N=void 0!==A&&A,M=S.categoryColor,R=void 0===M?"":M,F=S.showCategory;(void 0===F||F)&&(N?b.push({".ugb-blog-posts__category a":{backgroundColor:Object(j.c)(t("categoryColor")),color:Object(j.c)(Object(j.wb)("",t("categoryColor")))},".ugb-blog-posts__category a:hover":{opacity:t("categoryHoverColor")?void 0:.8,backgroundColor:Object(j.c)(t("categoryHoverColor")),color:Object(j.c)(Object(j.wb)("",t("categoryHoverColor")))}}):b.push({".ugb-blog-posts__category a":{color:Object(j.c)(Object(j.wb)(R,u.columnBackground&&o))},".ugb-blog-posts__category a:hover":{opacity:R&&!t("categoryHoverColor")?.8:void 0,color:Object(j.c)(t("categoryHoverColor"))}}),b.push({".ugb-blog-posts__category":B({},Object(j.K)("category%s","desktop",e.attributes,{importantSize:!0}),{textAlign:t("categoryAlign","%s !important")}),tablet:{".ugb-blog-posts__category":B({},Object(j.K)("category%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("categoryTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__category":B({},Object(j.K)("category%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("categoryMobileAlign","%s !important")})}}));var D=e.attributes,I=D.titleColor,z=void 0===I?"":I,L=D.showTitle;(void 0===L||L)&&b.push({".ugb-blog-posts__title a":{color:Object(j.c)(Object(j.wb)(z,u.columnBackground&&o))},".ugb-blog-posts__title a:hover":{opacity:z&&!t("titleHoverColor")?.8:void 0,color:Object(j.c)(t("titleHoverColor"))},".ugb-blog-posts__title":B({},Object(j.K)("title%s","desktop",e.attributes,{importantSize:!0}),{textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-blog-posts__title":B({},Object(j.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__title":B({},Object(j.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}});var U=e.attributes,H=U.excerptColor,W=void 0===H?"":H,G=U.showExcerpt;(void 0===G||G)&&b.push({".ugb-blog-posts__excerpt, .ugb-blog-posts__excerpt p":B({},Object(j.K)("excerpt%s","desktop",e.attributes,{importantSize:!0}),{color:Object(j.c)(Object(j.wb)(W,u.columnBackground&&o))}),".ugb-blog-posts__excerpt":{textAlign:t("excerptAlign","%s !important")},tablet:{".ugb-blog-posts__excerpt, .ugb-blog-posts__excerpt p":B({},Object(j.K)("excerpt%s","tablet",e.attributes,{importantSize:!0})),".ugb-blog-posts__excerpt":{textAlign:t("excerptTabletAlign","%s !important")}},mobile:{".ugb-blog-posts__excerpt, .ugb-blog-posts__excerpt p":B({},Object(j.K)("excerpt%s","mobile",e.attributes,{importantSize:!0})),".ugb-blog-posts__excerpt":{textAlign:t("excerptMobileAlign","%s !important")}}});var V=e.attributes,q=V.metaColor,K=void 0===q?"":q,J=V.showMeta,Y=void 0===J||J,X=V.showAuthor,$=void 0===X||X,Z=V.showDate,Q=void 0===Z||Z,ee=V.showComments;Y&&($||Q||(void 0===ee||ee))&&b.push({".ugb-blog-posts__meta":B({},Object(j.K)("meta%s","desktop",e.attributes,{importantSize:!0}),{color:Object(j.c)(Object(j.wb)(K,u.columnBackground&&o)),textAlign:t("metaAlign","%s !important")}),tablet:{".ugb-blog-posts__meta":B({},Object(j.K)("meta%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("metaTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__meta":B({},Object(j.K)("meta%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("metaMobileAlign","%s !important")})}});var te=e.attributes.readmoreColor,ne=void 0===te?"":te;return s&&b.push({".ugb-blog-posts__readmore a":{color:Object(j.c)(Object(j.wb)(ne,u.columnBackground&&o))},".ugb-blog-posts__readmore a:hover":{opacity:ne&&!t("readmoreHoverColor")?.8:void 0,color:Object(j.c)(t("readmoreHoverColor"))},".ugb-blog-posts__readmore":B({},Object(j.K)("readmore%s","desktop",e.attributes,{importantSize:!0}),{textAlign:t("readmoreAlign","%s !important")}),tablet:{".ugb-blog-posts__readmore":B({},Object(j.K)("readmore%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("readmoreTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__readmore":B({},Object(j.K)("readmore%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("readmoreMobileAlign","%s !important")})}}),u.imageSpacing&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__featured-image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.categorySpacing&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__category","category%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.titleSpacing&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.excerptSpacing&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__excerpt","excerpt%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.metaSpacing&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__meta","meta%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.readmoreSpacing&&b.push.apply(b,T(Object(j.F)(".ugb-blog-posts__readmore","readmore%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),C.a.all(b)},N=n(3),M=n(6),R=n(11),F=n(0),D=n(489),I=n(25),z=n.n(I);function L(e){return(L="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 U(e,t){for(var n=0;n0&&wp.element.createElement(N.d,{label:Object(F.__)("Filter by Taxonomy",x.i18n),options:n,value:this.props.taxonomyType,onChange:function(t){e.props.onChangeTaxonomyType(t),e.props.onChangeTaxonomy("")}}),n.length>0&&wp.element.createElement(M.Fragment,null,wp.element.createElement(N.d,{label:Object(F.__)("Taxonomy Filter Type",x.i18n),options:[{label:Object(F.__)("Included In",x.i18n),value:"__in"},{label:Object(F.__)("Not In",x.i18n),value:"__not_in"}],value:this.props.taxonomyFilterType,onChange:this.props.onChangeTaxonomyFilterType}),wp.element.createElement(R.FormTokenField,{label:o,suggestions:l,value:c,onChange:function(t){var n=t.map(function(e){return(Object(a.find)(i||[],function(t){return t.name===e})||{}).value});e.props.onChangeTaxonomy(Object(a.compact)(n).join(","))}})))}}])&&U(n.prototype,i),o&&U(n,o),t}();q.defaultProps={postType:"post",onChangePostType:function(){},taxonomyType:"category",onChangeTaxonomyType:function(){},taxonomy:"",onChangeTaxonomy:function(){}};var K=q,J=n(10),Y=n(8),X=n.n(Y),$=n(68),Z=n(284),Q=n(13),ee=n(12);function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ne(e){for(var t=1;tg?r.slice(0,g):r,me=X()(["ugb-blog-posts__item"],ie({},"ugb--shadow-".concat(p||3),!le.imageShadow)),ge=X()(["ugb-blog-posts__featured-image"],ie({},"ugb--shadow-".concat(p||3),le.imageShadow));return ce?wp.element.createElement(N.k.Edit,{className:be,blockProps:this.props,render:function(){return wp.element.createElement(M.Fragment,null,(pe||[]).map(function(t,n){var a=(t.featured_image_urls&&t.featured_image_urls[v||"large"]||[])[0],o=a&&wp.element.createElement("figure",{className:ge},wp.element.createElement("a",null,wp.element.createElement("img",{src:a,alt:Object(F.__)("featured",x.i18n)}))),r=a&&wp.element.createElement("div",{className:"ugb-blog-posts__featured-image-background",style:{backgroundImage:"url(".concat(a,")")}}),l=wp.element.createElement(se,{className:"ugb-blog-posts__title"},wp.element.createElement("a",null,Object(Z.decodeEntities)(t.title.rendered.trim())||Object(F.__)("(Untitled)",x.i18n))),c=t.category_list&&wp.element.createElement("div",{className:"ugb-blog-posts__category",dangerouslySetInnerHTML:{__html:t.category_list.replace(/href=['"].*?['"]/g,"")}}),s=wp.element.createElement("span",{className:"ugb-blog-posts__sep"},ue[k||"dot"]),u=t.author_info&&t.author_info.name&&wp.element.createElement("span",null,t.author_info.name),b=t.date_gmt&&wp.element.createElement("time",{dateTime:Object($.format)("c",t.date_gmt),className:"ugb-blog-posts__date"},Object($.dateI18n)("F d, Y",t.date_gmt)),p=wp.element.createElement("span",null,t.comments_num),m=t.post_excerpt_stackable.split(" "),g=(m=m.length>(_||55)?m.slice(0,_||55).join(" ")+"...":t.post_excerpt_stackable)&&wp.element.createElement("div",{className:"ugb-blog-posts__excerpt",dangerouslySetInnerHTML:{__html:m}}),d=wp.element.createElement("p",{className:"ugb-blog-posts__readmore"},wp.element.createElement("a",null,Q||Object(F.__)("Continue reading",x.i18n))),f=(G||q||J)&&wp.element.createElement("aside",{className:"entry-meta ugb-blog-posts__meta"},G&&u,G&&u&&(q&&b||J&&p)&&s,q&&b,(G&&u||q&&b)&&J&&p&&s,J&&p),h=Object(i.applyFilters)("stackable.blog-posts.edit.output",null,e.props,{itemClasses:me,featuredImageBackground:r,featuredImage:o,category:c,title:l,author:u,separator:s,date:b,comments:p,excerpt:g,readmore:d,meta:f},n);return h||wp.element.createElement(N.G,{tagName:"article",className:me,backgroundAttrName:"column%s",blockProps:e.props,showBackground:le.showBackgroundInItem,showBackgroundVideo:!1,key:n},S&&le.imageAsBackground&&r,S&&!le.imageAsBackground&&le.imageOutsideContainer&&o,wp.element.createElement(N.G,{className:"ugb-blog-posts__content",backgroundAttrName:"column%s",blockProps:e.props,showBackground:le.showBackgroundInContent,showBackgroundVideo:!1},S&&!le.imageAsBackground&&!le.imageOutsideContainer&&o,A&&c,T&&l,L&&f,I&&g,H&&d))}),re&&wp.element.createElement(N.r,{containerClassName:"ugb-blog-posts__load-more-button",attrNameTemplate:"loadMoreButton%s",setAttributes:n,blockAttributes:o,isSelected:!1}))}}):wp.element.createElement(R.Placeholder,{icon:"admin-post",label:Object(F.__)("Posts",x.i18n)},Array.isArray(r)?Object(F.__)("No posts found.",x.i18n):wp.element.createElement(R.Spinner,null))}}])&&oe(n.prototype,a),o&&oe(n,o),t}(),pe=Object(ee.compose)(J.i,J.g,J.d,Object(J.h)(),Object(J.c)(["Category%sAlign","Title%sAlign","Excerpt%sAlign","Meta%sAlign","Readmore%sAlign"]),Object(J.a)(A,{editorMode:!0}),Object(J.b)([[".ugb-blog-posts__featured-image","image"],[".ugb-blog-posts__featured-image img","image"],[".ugb-blog-posts__category","category"],[".ugb-blog-posts__title","title"],[".ugb-blog-posts__excerpt","excerpt"],[".ugb-blog-posts__meta","meta"],[".ugb-blog-posts__readmore","readmore"],[".ugb-blog-posts--design-image-card .ugb-blog-posts__header","image"],[".ugb-blog-posts__item","column-background"],[".ugb-blog-posts__load-more-button","loadmore"]]),Object(Q.withSelect)(function(e,t){var n=t.attributes,o=n.postType,r=void 0===o?"post":o,l=n.numberOfItems,c=void 0===l?6:l,s=n.orderBy,u=void 0===s?"date":s,b=n.order,p=void 0===b?"desc":b,m=n.taxonomyType,g=void 0===m?"":m,d=n.taxonomy,f=void 0===d?"":d,h=n.taxonomyFilterType,v=void 0===h?"__in":h,y=e("core").getEntityRecords,O=Object(a.pickBy)(ne({order:p,orderby:u,per_page:c},Object(i.applyFilters)("stackable.blog-posts.postQuery",{},t)),function(e){return Array.isArray(e)?!Object(a.isEmpty)(e):!Object(a.isUndefined)(e)&&""!==e});return f&&g&&("category"===g?O["__in"===v?"categories":"categories_exclude"]=f:"post_tag"===g?O["__in"===v?"tags":"tags_exclude"]=f:O["__in"===v?g:"".concat(g,"_exclude")]=f),{posts:y("postType",r,O)}}))(be);function me(){return(me=Object.assign||function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-countup__item":Object(r.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-countup__item":Object(r.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-countup__item":Object(r.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}}});var p=e.attributes,m=p.showIcon,g=void 0!==m&&m,d=p.showNumber,f=void 0===d||d,v=p.showTitle,w=void 0===v||v,j=p.showDescription,k=void 0===j||j;g&&a.push.apply(a,O(Object(r.F)(".ugb-countup__icon","icon%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f&&a.push.apply(a,O(Object(r.F)(".ugb-countup__counter","number%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),w&&a.push.apply(a,O(Object(r.F)(".ugb-countup__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),k&&a.push.apply(a,O(Object(r.F)(".ugb-countup__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0})));var C=e.attributes,x=C.columnBackgroundColor,E=void 0===x?"":x,S=C.showBlockBackground,B=void 0!==S&&S,T=C.blockBackgroundBackgroundColor,P=void 0===T?"":T,A=C.iconAlign,N=void 0===A?"":A,M=C.contentAlign,R=void 0===M?"":M,F=C.iconTabletAlign,D=void 0===F?"":F,I=C.tabletContentAlign,z=void 0===I?"":I,L=C.iconMobileAlign,U=void 0===L?"":L,H=C.mobileContentAlign,W=void 0===H?"":H;g&&(a.push({".ugb-countup__icon svg:not(.ugb-custom-icon)":{color:Object(r.vb)(t("iconColor"),n.columnBackground?E:B?P:"")},".ugb-countup__icon":{marginLeft:""!==N||""!==R?Object(r.c)(Object(r.hb)(N||R)):void 0,marginRight:""!==N||""!==R?Object(r.c)(Object(r.ib)(N||R)):void 0},tablet:{".ugb-countup__icon svg":{marginLeft:""!==D||""!==z?Object(r.c)(Object(r.hb)(D||z)):void 0,marginRight:""!==D||""!==z?Object(r.c)(Object(r.ib)(D||z)):void 0}},mobile:{".ugb-countup__icon svg":{marginLeft:""!==U||""!==W?Object(r.c)(Object(r.hb)(U||W)):void 0,marginRight:""!==U||""!==W?Object(r.c)(Object(r.ib)(U||W)):void 0}}}),a.push(_({},Object(r.v)("icon%s","ugb-countup__icon",e.attributes))));var G=e.attributes.titleColor,V=void 0===G?"":G;w&&a.push({".ugb-countup__title":_({},Object(r.K)("title%s","desktop",e.attributes),{color:Object(r.vb)(V,n.columnBackground?E:B?P:""),textAlign:t("titleAlign")}),tablet:{".ugb-countup__title":_({},Object(r.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")})},mobile:{".ugb-countup__title":_({},Object(r.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")})}});var q=e.attributes.numberColor,K=void 0===q?"":q;f&&a.push({".ugb-countup__counter":_({},Object(r.K)("number%s","desktop",e.attributes,{importantSize:!0}),{color:Object(r.vb)(K,n.columnBackground?E:B?P:""),textAlign:t("numberAlign")}),tablet:{".ugb-countup__counter":_({},Object(r.K)("number%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("numberTabletAlign")})},mobile:{".ugb-countup__counter":_({},Object(r.K)("number%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("numberMobileAlign")})}});var J=e.attributes.descriptionColor,Y=void 0===J?"":J;return k&&a.push({".ugb-countup__description":_({},Object(r.K)("description%s","desktop",e.attributes),{color:Object(r.vb)(Y,n.columnBackground?E:B?P:""),textAlign:t("descriptionAlign")}),tablet:{".ugb-countup__description":_({},Object(r.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign")})},mobile:{".ugb-countup__description":_({},Object(r.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign")})}}),y.a.all(a)},C=n(313),x=n.n(C),E=n(314),S=n.n(E),B=n(315),T=n.n(B),P=n(316),A=n.n(P),N=n(317),M=n.n(N),R=n(1),F=n(12),D=n(6);function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["link1Url","link2Url","link3Url","link4Url","link1NewTab","link2NewTab","link3NewTab","link4NewTab","link1NoFollow","link2NoFollow","link3NoFollow","link4NoFollow","image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image4Id"],o(t&&t.image4Id?["image4Url"]:[]))))});var s=n(5),u=n.n(s);function b(){return(b=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(n){var a,o=n.className,r=n.attributes,l=n.attributes,c=l.titleColor,s=l.subtitleColor,u=l.overlayColor,b=l.height,p=l.width,d=l.verticalAlign,h=l.horizontalAlign,v=l.align,O=l.columns,_=l.design,j=void 0===_?"basic":_,k=l.borderRadius,C=void 0===k?12:k,x=l.shadow,E=void 0===x?3:x,S=l.imageHoverEffect,B=void 0===S?"":S,T=l.overlayOpacity,P=void 0===T?7:T,A=l.arrow,N=void 0===A?"":A,M=f()([o,"ugb-image-box","ugb-image-box--v3","ugb-image-box--columns-".concat(O)],Object(i.applyFilters)("stackable.image-box.mainclasses_1_17_3",(w(a={},"ugb-image-box--design-".concat(j),"basic"!==j),w(a,"ugb-image-box--effect-".concat(B),B),w(a,"ugb-image-box--overlay-".concat(P),7!==P),w(a,"ugb-image-box--arrow",N),a),j,n)),R={textAlign:h||void 0,"--overlay-color":u};return wp.element.createElement("div",{className:M,style:R},Object(i.applyFilters)("stackable.image-box.save.output.before_1_17_3",null,j,n),Object(g.nb)(1,O+1).map(function(a){var o=r["imageURL".concat(a)],l=r["title".concat(a)],u=r["description".concat(a)],g=r["link".concat(a)],_=r["newTab".concat(a)],k={backgroundImage:o?"url(".concat(o,")"):void 0,maxWidth:"wide"!==v&&"full"!==v&&1===O?p:void 0,height:b,textAlign:h,justifyContent:d,borderRadius:C},x=f()(["ugb-image-box__item"],Object(i.applyFilters)("stackable.image-box.itemclasses_1_17_3",w({},"ugb--shadow-".concat(E),3!==E),j,a,n)),S=f()(["ugb-image-box__arrow","ugb-image-box__arrow--align-".concat(N)]);return wp.element.createElement("div",{className:x,style:k,key:a},B&&wp.element.createElement("div",{className:"ugb-image-box__image-effect",style:{backgroundImage:o?"url(".concat(o,")"):void 0}}),wp.element.createElement("a",{className:"ugb-image-box__overlay",href:g,target:_?"_blank":void 0}),wp.element.createElement("div",{className:"ugb-image-box__content"},!y.RichText.isEmpty(l)&&wp.element.createElement(y.RichText.Content,{tagName:"h4",className:"ugb-image-box__title",style:e?{color:c}:void 0,value:l}),!y.RichText.isEmpty(u)&&wp.element.createElement(y.RichText.Content,{tagName:"p",className:"ugb-image-box__description",style:t?{color:s}:void 0,value:u})),N&&g&&wp.element.createElement("div",{className:S},wp.element.createElement(m,{style:{fill:c||void 0}})))}),Object(i.applyFilters)("stackable.image-box.save.output.after_1_17_3",null,j,n))}},k=function(e){var t=function(e){return(e||"").replace(/\.ugb-image-box__overlay(\s*{)/g,".ugb-image-box__overlay-hover$1")};return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(g.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(g.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(g.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-image-box__item":Object(g.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-image-box__item":Object(g.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-image-box__item":Object(g.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}}}),a.push({".ugb-image-box__item":{height:Object(g.c)(t("columnHeight","%spx"))},tabletOnly:{".ugb-image-box__item":{height:Object(g.c)(t("tabletColumnHeight","%spx")||i&&"".concat(i,"px"))}},mobile:{".ugb-image-box__item":{height:Object(g.c)(t("mobileColumnHeight","%spx")||i&&"".concat(i,"px"))}}}),a.push({".ugb-image-box__item":{justifyContent:Object(g.c)(t("columnContentVerticalAlign"))},tablet:{".ugb-image-box__item":{justifyContent:Object(g.c)(t("columnContentTabletVerticalAlign"))}},mobile:{".ugb-image-box__item":{justifyContent:Object(g.c)(t("columnContentMobileVerticalAlign"))}}}),a.push({".ugb-image-box__item1 .ugb-image-box__image":{backgroundImage:t("image1Url","url(%s)")},".ugb-image-box__item2 .ugb-image-box__image":{backgroundImage:t("image2Url","url(%s)")},".ugb-image-box__item3 .ugb-image-box__image":{backgroundImage:t("image3Url","url(%s)")},".ugb-image-box__item4 .ugb-image-box__image":{backgroundImage:t("image4Url","url(%s)")},".ugb-image-box__image":{backgroundPosition:Object(g.c)(t("imageBackgroundPosition")),backgroundRepeat:Object(g.c)(t("imageBackgroundRepeat")),backgroundSize:Object(g.c)("custom"===t("imageBackgroundSize")?t("imageBackgroundCustomSize","%s".concat(t("imageBackgroundCustomSizeUnit")||"px")):t("imagebackgroundSize"))}});var p=e.attributes.showOverlay;void 0!==p&&p&&a.push({".ugb-image-box__overlay":V({},Object(g.n)("overlay%s","desktop",e.attributes,{importantBackgroundColor:!0}),{},Object(g.l)("overlay%s","desktop",e.attributes,{importantBackgroundColor:!0})),".ugb-image-box__item:not(:hover) .ugb-image-box__overlay":{opacity:Object(g.c)(t("overlayOpacity"))}});var m=e.attributes.showOverlayHover;void 0!==m&&m&&a.push({".ugb-image-box__overlay-hover":V({},Object(g.n)("overlayHover%s","desktop",e.attributes,{importantBackgroundColor:!0}),{},Object(g.l)("overlayHover%s","desktop",e.attributes,{importantBackgroundColor:!0})),".ugb-image-box__item:hover .ugb-image-box__overlay-hover":{opacity:Object(g.c)(t("overlayHoverOpacity"))}});var d=e.attributes.showSubtitle;(void 0===d||d)&&a.push({".ugb-image-box__subtitle":V({},Object(g.K)("subtitle%s","desktop",e.attributes,{importantSize:!0}),{color:Object(g.c)(t("subtitleColor")),textAlign:t("subtitleAlign","%s !important")}),tablet:{".ugb-image-box__subtitle":V({},Object(g.K)("subtitle%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("subtitleTabletAlign","%s !important")})},mobile:{".ugb-image-box__subtitle":V({},Object(g.K)("subtitle%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("subtitleMobileAlign","%s !important")})}});var f=e.attributes.showTitle;(void 0===f||f)&&a.push({".ugb-image-box__title":V({},Object(g.K)("title%s","desktop",e.attributes,{importantSize:!0}),{color:Object(g.c)(t("titleColor")),textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-image-box__title":V({},Object(g.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-image-box__title":V({},Object(g.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}});var h=e.attributes.showDescription;(void 0===h||h)&&a.push({".ugb-image-box__description":V({},Object(g.K)("description%s","desktop",e.attributes,{importantSize:!0}),{color:Object(g.c)(t("descriptionColor")),textAlign:t("descriptionAlign","%s !important")}),tablet:{".ugb-image-box__description":V({},Object(g.K)("description%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("descriptionTabletAlign","%s !important")})},mobile:{".ugb-image-box__description":V({},Object(g.K)("description%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("descriptionMobileAlign","%s !important")})}});var v=e.attributes.showArrow;return void 0!==v&&v&&(a.push({".ugb-image-box__arrow svg":{fill:Object(g.c)(t("arrowColor"))}}),a.push.apply(a,W(Object(g.F)(".ugb-image-box__arrow svg","arrow%sSize","width","%spx",e.attributes,{important:!0,inherit:!1}))),a.push.apply(a,W(Object(g.F)(".ugb-image-box__arrow","arrow%sAlign","textAlign","%s",e.attributes,{important:!0})))),n.subtitleSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__subtitle","subtitle%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.arrowSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__arrow","arrow%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),U.a.all(a)},J=n(11),Y=n(6),X=n(12),$=n(13);function Z(e){return(Z="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 Q(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,t){for(var n=0;n .ugb-inner-block > .ugb-block-content > *"]={minHeight:void 0},e.tablet["> .ugb-inner-block > .ugb-block-content > *"]={minHeight:void 0},e.mobile["> .ugb-inner-block > .ugb-block-content > *"]={minHeight:void 0},e})},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(1),o=n(7),r=n(4);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object(r.addFilter)("stackable.cta.design.no-text-attributes","stackable/cta",function(e){return Object(o.omit)(e,["title","description","buttonText"])}),Object(r.addFilter)("stackable.cta.design.filtered-block-attributes","stackable/cta",function(e){return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-cta__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-cta__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-cta__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}}});var h=e.attributes,v=h.titleColor,y=void 0===v?"":v,O=h.showTitle;(void 0===O||O)&&c.push({".ugb-cta__title":x({},Object(u.K)("title%s","desktop",e.attributes,{importantSize:!0}),{color:Object(u.vb)(y,0!==r?i:null),textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-cta__title":x({},Object(u.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-cta__title":x({},Object(u.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}});var w=e.attributes,C=w.descriptionColor,E=void 0===C?"":C,S=w.showDescription;(void 0===S||S)&&c.push({".ugb-cta__description":x({},Object(u.K)("description%s","desktop",e.attributes),{color:Object(u.vb)(E,0!==r?i:null),textAlign:t("descriptionAlign","%s !important")}),tablet:{".ugb-cta__description":x({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign","%s !important")})},mobile:{".ugb-cta__description":x({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign","%s !important")})}});var B=e.attributes.showButton;return(void 0===B||B)&&(c.push(x({},Object(u.s)("button%s","ugb-button",e.attributes))),c.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")}}})),_.a.all(c)},B=n(290),T=n.n(B),P=n(291),A=n.n(P),N=n(292),M=n.n(N),R=n(293),F=n.n(R),D=n(294),I=n.n(D),z=n(295),L=n.n(z),U=n(12),H=n(6);function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return c({},Object(i.omit)(e,[].concat(r(t&&t.image1Id?["image1Url"]:[]),["image1Id"],r(t&&t.image2Id?["image2Url"]:[]),["image2Id"],r(t&&t.image3Id?["image3Url"]:[]),["image3Id","button1Url","button1NewTab","button1NoFollow","button2Url","button2NewTab","button2NoFollow","button3Url","button3NewTab","button3NoFollow"])))});var u=n(22),b=n(2),p=n(8),m=n.n(p),g=n(1),d=n(0),f=n(9);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function v(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image4Id"],o(t&&t.image4Id?["image4Url"]:[]),["button1Url","button1NewTab","button1NoFollow","button2Url","button2NewTab","button2NoFollow","button3Url","button3NewTab","button3NoFollow","button4Url","button4NewTab","button4NoFollow"])))});var s=n(22),u=n(2),b=n(8),p=n.n(b),m=n(1),g=n(19),d=n.n(g),f=n(9),h=n(0);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=[{attributes:{design:{type:"string",default:"basic"},columns:{type:"number",default:3},imageSize:{type:"number",default:100},imageID1:{type:"number"},imageID2:{type:"number"},imageID3:{type:"number"},imageUrl1:{type:"url"},imageUrl2:{type:"url"},imageUrl3:{type:"url"},imageAlt1:{type:"string"},imageAlt2:{type:"string"},imageAlt3:{type:"string"},title1:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-feature-grid__title",default:Object(h.__)("Title",m.i18n)},title2:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-feature-grid__title",default:Object(h.__)("Title",m.i18n)},title3:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-feature-grid__title",default:Object(h.__)("Title",m.i18n)},description1:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-feature-grid__description",default:Object(u.M)("short")},description2:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-feature-grid__description",default:Object(u.M)("short")},description3:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-feature-grid__description",default:Object(u.M)("short")},linkUrl1:{type:"string",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-button",attribute:"href",default:""},linkUrl2:{type:"string",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-button",attribute:"href",default:""},linkUrl3:{type:"string",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-button",attribute:"href",default:""},newTab1:{type:"boolean",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-button",attribute:"target",default:!1},newTab2:{type:"boolean",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-button",attribute:"target",default:!1},newTab3:{type:"boolean",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-button",attribute:"target",default:!1},linkText1:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-button span",default:Object(h.__)("Button text",m.i18n)},linkText2:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-button span",default:Object(h.__)("Button text",m.i18n)},linkText3:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-button span",default:Object(h.__)("Button text",m.i18n)},buttonColor:{type:"string"},buttonTextColor:{type:"string"},buttonSize:{type:"string",default:"normal"},buttonBorderRadius:{type:"number",default:4},buttonDesign:{type:"string",default:"link"},buttonIcon:{type:"string"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},hoverEffect:{type:"string",default:""},align:{type:"string"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},save:function(e){var t=e.attributes,n=e.className,a=t.columns,o=t.imageSize,r=t.design,l=t.buttonColor,c=t.buttonTextColor,b=t.buttonSize,m=t.buttonBorderRadius,g=t.buttonDesign,h=void 0===g?"link":g,v=t.buttonIcon,O=t.borderRadius,w=void 0===O?12:O,_=t.shadow,j=void 0===_?3:_,k=p()([n,"ugb-feature-grid","ugb-feature-grid--columns-".concat(a)],Object(i.applyFilters)("stackable.feature-grid.mainclasses_1_17_2",y({},"ugb-feature-grid--design-".concat(r),r&&"basic"!==r),r,e)),C={borderRadius:"plain"!==r&&12!==w?w:void 0};return wp.element.createElement("div",{className:k},Object(i.applyFilters)("stackable.feature-grid.edit.output.before_1_17_2",null,r,e),Object(u.nb)(1,a+1).map(function(n){var a=t["imageUrl".concat(n)],u=t["imageAlt".concat(n)],g=t["title".concat(n)],O=t["description".concat(n)],w=t["linkUrl".concat(n)],_=t["newTab".concat(n)],k=t["linkText".concat(n)],x=p()(["ugb-feature-grid__item"],Object(i.applyFilters)("stackable.feature-grid.itemclasses_1_17_2",y({},"ugb--shadow-".concat(j),"plain"!==r&&3!==j),r,n,e)),E=Object(i.applyFilters)("stackable.feature-grid.itemstyles_1_17_2",{image:{width:a?"".concat(o,"%"):void 0}},r,n,e);return wp.element.createElement("div",{className:x,style:C,key:n},a&&wp.element.createElement("div",{className:"ugb-feature-grid__image"},wp.element.createElement("img",{src:a,style:E.image,alt:d()(g||u)})),wp.element.createElement("div",{className:"ugb-feature-grid__content"},!f.RichText.isEmpty(g)&&wp.element.createElement(f.RichText.Content,{tagName:"h5",className:"ugb-feature-grid__title",value:g}),!f.RichText.isEmpty(O)&&wp.element.createElement(f.RichText.Content,{tagName:"p",className:"ugb-feature-grid__description",value:O}),!f.RichText.isEmpty(k)&&wp.element.createElement(s.b,{size:b,url:w,newTab:_,color:c,text:k,icon:v,design:h,backgroundColor:l,borderRadius:m})))}),Object(i.applyFilters)("stackable.feature-grid.edit.output.after_1_17_2",null,r,e))},migrate:function(e){var t;if(e.imageSize&&"horizontal"!==e.design){var n="wide"!==e.align?m.contentWidth||900:1200,a="plain"===e.design?0:70,i=1===e.columns?n-a:2===e.columns?(n-35)/2-a:(n-70)/3-a;t=parseInt((parseInt(e.imageSize,10)||100)/100*i,10)}return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-feature-grid__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-feature-grid__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-feature-grid__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))})}}});var w=e.attributes,_=w.imageAlign,j=void 0===_?"":_,k=w.imageTabletAlign,C=void 0===k?"":k,x=w.tabletContentAlign,E=void 0===x?"":x,S=w.imageMobileAlign,B=void 0===S?"":S,T=w.mobileContentAlign,P=void 0===T?"":T;c&&(p.push(I({},Object(u.B)("image%s","ugb-img",e.attributes))),p.push({".ugb-img, .ugb-feature-grid__image":{marginLeft:""!==j||""!==b?Object(u.hb)(j||b)+" !important":void 0,marginRight:""!==j||""!==b?Object(u.ib)(j||b)+" !important":void 0},tablet:{".ugb-img, .ugb-feature-grid__image":{marginLeft:""!==C||""!==E?Object(u.hb)(C||E)+" !important":void 0,marginRight:""!==C||""!==E?Object(u.ib)(C||E)+" !important":void 0}},mobile:{".ugb-img, .ugb-feature-grid__image":{marginLeft:""!==B||""!==P?Object(u.hb)(B||P)+" !important":void 0,marginRight:""!==B||""!==P?Object(u.ib)(B||P)+" !important":void 0}}}));var A=e.attributes,M=A.titleColor,D=void 0===M?"":M,L=A.showTitle;if(void 0===L||L){var U=Object(i.applyFilters)("stackable.feature-grid.styles.title.color-selector",".ugb-feature-grid__title",e);p.push(z({},U,{color:Object(u.vb)(D,n.columnBackground&&r)})),p.push({".ugb-feature-grid__title":I({},Object(u.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-feature-grid__title":I({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-feature-grid__title":I({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}})}var H=e.attributes,W=H.descriptionColor,G=void 0===W?"":W,V=H.showDescription;if(void 0===V||V){var q=Object(i.applyFilters)("stackable.feature-grid.styles.description.color-selector",".ugb-feature-grid__description",e);p.push(z({},q,{color:Object(u.vb)(G,n.columnBackground&&r)})),p.push({".ugb-feature-grid__description":I({},Object(u.K)("description%s","desktop",e.attributes),{textAlign:t("descriptionAlign")||t("contentAlign")}),tablet:{".ugb-feature-grid__description":I({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-feature-grid__description":I({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign")||t("mobileContentAlign")})}})}var K=e.attributes,J=K.showButton,Y=void 0===J||J,X=K.buttonDesign,$=void 0===X?"":X;return Y&&(p.push(I({},Object(u.s)("button%s","ugb-button",I({},e.attributes,{buttonDesign:$||"plain"})))),p.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")||t("contentAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")||t("tabletContentAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")||t("mobileContentAlign","%s !important")}}})),n.imageSpacing&&p.push.apply(p,F(Object(u.F)(".ugb-feature-grid__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&p.push.apply(p,F(Object(u.F)(".ugb-feature-grid__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&p.push.apply(p,F(Object(u.F)(".ugb-feature-grid__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&p.push.apply(p,F(Object(u.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),R.a.all(p)},U=n(12),H=n(6),W=n(13);function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["imageId"].concat(o(t&&t.imageId?["imageUrl"]:[]),["imageAlt","buttonUrl","buttonNewTab","buttonNoFollow"])))});var s=n(22),u=n(2),b=n(8),p=n.n(b),m=n(1),g=n(19),d=n.n(g),f=n(9),h=n(0);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function y(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1],n=("number"!=typeof e?50:e)/100*2,a=2-n;return t?"".concat(a.toFixed(2),"fr ").concat(n.toFixed(2),"fr"):"".concat(n.toFixed(2),"fr ").concat(a.toFixed(2),"fr")},ie=function(e){var t=Object(u.b)(e.attributes),n=X(e),a=e.attributes,i=a.design,o=void 0===i?"plain":i,r=a.columnBackgroundColor,l=void 0===r?"":r,c=a.invert,s=void 0!==c&&c,b=[];n.imageColumnWidth&&b.push({desktopTablet:{".ugb-feature__item":{gridTemplateColumns:t("imageColumnWidth")?Object(u.c)(ae(t("imageColumnWidth"),!s)):void 0}},tabletOnly:{".ugb-feature__item":{gridTemplateColumns:t("imageColumnTabletWidth")?Object(u.c)(ae(t("imageColumnTabletWidth"),!s)):void 0}}});var p="basic"===o||"half"===o?".ugb-feature__item":".ugb-feature__content";if(n.borderRadius&&b.push(ne({},p,{borderRadius:t("borderRadius","%spx !important")})),n.border&&b.push(te({},Object(u.p)("column%s",p,e.attributes))),n.columnBackground){var m="basic"===o?"ugb-feature__item":"ugb-feature__content";b.push(te({},n.columnBackground?Object(u.m)("column%s",m,e.attributes,{importantBackgroundColor:!0,importantBackgroundPosition:!0,importantBackgroundSize:!0,importantBackgroundRepeat:!0}):{}))}n.featuredImageAsBackground?(b.push(te({},Object(u.z)("image%s","ugb-feature__image",e.attributes))),b.push({".ugb-feature__item":{height:t("imageBackgroundHeight","%spx !important")},tablet:{".ugb-feature__item":{height:t("imageBackgroundTabletHeight","%spx !important")}},mobile:{".ugb-feature__item":{height:t("imageBackgroundMobileHeight","%spx !important")}}})):b.push(te({},n.featuredImageAsBackground?{}:Object(u.B)("image%s","ugb-img",e.attributes,{inherit:!1})));var g=e.attributes,d=g.titleColor,f=void 0===d?"":d,h=g.showTitle;(void 0===h||h)&&b.push({".ugb-feature__title":te({},Object(u.K)("title%s","desktop",e.attributes),{color:Object(u.vb)(f,n.columnBackground&&l),textAlign:t("titleAlign")}),tablet:{".ugb-feature__title":te({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")})},mobile:{".ugb-feature__title":te({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")})}});var v=e.attributes,y=v.descriptionColor,O=void 0===y?"":y,w=v.showDescription;(void 0===w||w)&&b.push({".ugb-feature__description":te({},Object(u.K)("description%s","desktop",e.attributes),{color:Object(u.vb)(O,n.columnBackground&&l),textAlign:t("descriptionAlign")}),tablet:{".ugb-feature__description":te({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign")})},mobile:{".ugb-feature__description":te({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign")})}});var _=e.attributes.showButton;return(void 0===_||_)&&(b.push(te({},Object(u.s)("button%s","ugb-button",e.attributes))),b.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")}}})),n.titleSpacing&&b.push.apply(b,Q(Object(u.F)(".ugb-feature__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&b.push.apply(b,Q(Object(u.F)(".ugb-feature__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&b.push.apply(b,Q(Object(u.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),Z.a.all(b)},oe=n(11),re=n(6),le=n(12),ce=n(13);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 ue(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t *:last-child .ugb-button",attribute:"href",default:""},buttonNewTab2:{type:"boolean",source:"attribute",selector:".ugb-header__buttons > *:last-child .ugb-button",attribute:"target",default:!1},buttonText2:{source:"html",selector:".ugb-header__buttons > *:last-child .ugb-button span",default:Object(b.__)("Button text",i.i18n)},buttonColor2:{type:"string"},buttonTextColor2:{type:"string",default:"#ffffff"},buttonDesign2:{type:"string",default:"basic"},buttonIcon2:{type:"string"},buttonSize2:{type:"string",default:"normal"},buttonBorderRadius2:{type:"number",default:4},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""},opacity:{type:"number"},url:{type:"string"},id:{type:"number"}},save:function(e){var t,n,a,i,o,l,c,u,b=e.className,p=e.attributes,d=p.buttonURL,v=p.buttonText,y=p.buttonColor,O=p.buttonTextColor,w=p.buttonDesign,_=p.buttonIcon,j=p.cornerButtonRadius,k=p.size,C=p.title,x=p.titleColor,E=p.subtitle,S=p.subtitleColor,B=p.contentAlign,T=void 0===B?"center":B,P=p.backgroundColorType,A=void 0===P?"":P,N=p.backgroundColor,M=p.backgroundColor2,R=p.backgroundColorDirection,F=void 0===R?0:R,D=p.backgroundType,I=void 0===D?"":D,z=p.backgroundImageURL,L=p.backgroundOpacity,U=p.fixedBackground,H=p.design,W=void 0===H?"basic":H,G=p.borderRadius,V=void 0===G?12:G,q=p.shadow,K=void 0===q?3:q,J=p.align,Y=p.contentWidth,X=void 0!==Y&&Y,$=p.buttonNewTab,Z=p.invert,Q=void 0!==Z&&Z,ee=p.fullHeight,te=void 0!==ee&&ee,ne=p.buttonSize2,ae=p.buttonTextColor2,ie=p.buttonColor2,oe=p.buttonText2,re=void 0===oe?"":oe,le=p.buttonBorderRadius2,ce=void 0===le?4:le,se=p.buttonDesign2,ue=void 0===se?"basic":se,be=p.buttonIcon2,pe=void 0===be?"":be,me=p.buttonURL2,ge=void 0===me?"":me,de=p.buttonNewTab2,fe=void 0!==de&&de,he=m()([b,"ugb-header","ugb-header--v2","ugb--background-opacity-"+1*Math.round(L/1),["ugb-header--design-".concat(W)]],Object(r.applyFilters)("stackable.header.mainclasses_1_15_6",(h(t={"ugb--has-background":"plain"!==W&&(N||z),"ugb--has-background-image":"plain"!==W&&z},"ugb--shadow-".concat(K),"plain"!==W&&3!==K),h(t,"ugb--content-width","full"===J&&X),h(t,"ugb-header--invert",Q),h(t,"ugb-header--full-height",te),h(t,"ugb--has-background-gradient","gradient"===A),h(t,"ugb--has-background-video","video"===I),t),W,e)),ve="plain"===W?{}:{"--ugb-background-color":z||"gradient"===A?N:void 0,"--ugb-background-color2":"gradient"===A&&M?M:void 0,"--ugb-background-direction":"gradient"===A?"".concat(F,"deg"):void 0,backgroundAttachment:U?"fixed":void 0,backgroundColor:N||void 0,backgroundImage:z?"url(".concat(z,")"):void 0,borderRadius:12!==V?V:void 0},ye=Object(r.applyFilters)("stackable.header.styles_1_15_6",{main:f({textAlign:T||void 0},ve),title:{color:x||("plain"===W?void 0:"#ffffff"),textAlign:T||void 0},subtitle:{color:S||("plain"===W?void 0:"#ffffff"),textAlign:T||void 0}},W,e);return wp.element.createElement("div",{className:he,style:ye.main},"plain"!==W&&"video"===I&&wp.element.createElement("video",{className:"ugb-video-background",autoPlay:!0,muted:!0,loop:!0,src:z}),Object(r.applyFilters)("stackable.header.save.output.before_1_15_6",null,W,e),(n=!g.RichText.isEmpty(C)&&wp.element.createElement(g.RichText.Content,{tagName:"h2",className:"ugb-header__title",style:ye.title,value:C}),a=!g.RichText.isEmpty(E)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-header__subtitle",style:ye.subtitle,value:E}),i=v&&!!v.length&&wp.element.createElement(s.b,{size:k,url:d,newTab:$,align:T,color:O,text:v,design:w,icon:_,backgroundColor:y,borderRadius:j}),o=re&&!!re.length&&wp.element.createElement(s.b,{size:ne,url:ge,newTab:fe,align:T,color:ae,text:re,design:ue,icon:pe,backgroundColor:ie,borderRadius:ce}),l={titleComp:n,subtitleComp:a,buttonComp:i},c={justifyContent:"right"===T?"flex-end":"left"===T?"flex-start":void 0},u=re?wp.element.createElement("div",{className:"ugb-header__buttons",style:c},l.buttonComp,o):l.buttonComp,"basic"===W||"plain"===W?wp.element.createElement("div",{className:"ugb-content-wrapper"},n,a,u):wp.element.createElement("div",{className:"ugb-content-wrapper"},wp.element.createElement("div",{className:"ugb-header__wrapper"},n,a,u))))},migrate:function(e){var t=function(e){return(e||"").replace(/\.ugb-header(\s*\{)/g,".ugb-header__item$1")},n={};return"half-overlay"===e.design&&e.fullHeight&&(n.design="side-overlay",n[e.invert?"columnPaddingRight":"columnPaddingLeft"]=0),f({},e,{},n,{columnBackgroundColorType:e.backgroundColorType,columnBackgroundColor:e.backgroundColor,columnBackgroundColor2:e.backgroundColor2,columnBackgroundGradientDirection:e.backgroundColorDirection,backgroundType:void 0,columnBackgroundMediaId:e.backgroundImageID,columnBackgroundMediaUrl:e.backgroundImageURL,columnBackgroundTintStrength:e.backgroundOpacity,columnFixedBackground:e.fixedBackground?e.fixedBackground:void 0,restrictContentWidth:e.contentWidth,showButton:!!e.buttonText,buttonUrl:e.buttonURL,buttonNewTab:e.buttonNewTab,buttonBackgroundColor:e.buttonColor,buttonSize:e.size,buttonBorderRadius:e.cornerButtonRadius,showButton2:!!e.buttonText2,button2Url:e.buttonURL2,button2NewTab:e.buttonNewTab2,button2Text:e.buttonText2,button2BackgroundColor:e.buttonColor2,button2TextColor:e.buttonTextColor2,button2Design:e.buttonDesign2,button2Icon:e.buttonIcon2,button2Size:e.buttonSize2,button2BorderRadius:e.buttonBorderRadius2,customCSS:t(e.customCSS),customCSSCompiled:t(e.customCSSCompiled),marginTop:"full"===e.align?0:void 0,marginBottom:"full"===e.align?0:void 0})}}],y=n(3),O=n(10),w=n(14),_=n.n(w),j=function(e){var t=e.attributes,n=t.design,a=void 0===n?"basic":n,i=t.align,o=void 0===i?"":i,l=t.showTitle,c=void 0===l||l,s=t.showSubtitle,u=void 0===s||s,b=t.showButton,p=void 0===b||b,m=t.showButton2,g=void 0!==m&&m,d=t.showBlockBackground,f=void 0!==d&&d,h=t.blockInnerWidth,v=void 0===h?"":h,y=!f&&"full"!==o||f&&"full"!==v;return Object(r.applyFilters)("stackable.header.show",{columnBackground:"plain"!==a,borderRadius:"plain"!==a&&y,border:"plain"!==a&&y,titleSpacing:c,subtitleSpacing:u,buttonSpacing:p||g,buttonGap:p&&g,restrictContent:!f&&"full"===o||f&&"full"===v,overlayBackground:a.match(/overlay/)},e)};function k(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(c)),paddingBottom:t("columnPaddingBottom","%s".concat(c)),paddingRight:t("columnPaddingRight","%s".concat(c)),paddingLeft:t("columnPaddingLeft","%s".concat(c))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(b)),paddingRight:t("tabletColumnPaddingRight","%s".concat(b)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(b)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(b))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(m)),paddingRight:t("mobileColumnPaddingRight","%s".concat(m)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(m)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(m))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-header__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(c)),paddingBottom:t("columnPaddingBottom","%s".concat(c)),paddingRight:t("columnPaddingRight","%s".concat(c)),paddingLeft:t("columnPaddingLeft","%s".concat(c))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-header__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(b)),paddingRight:t("tabletColumnPaddingRight","%s".concat(b)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(b)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(b))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-header__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(m)),paddingRight:t("mobileColumnPaddingRight","%s".concat(m)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(m)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(m))})}}});var g=e.attributes,d=g.overlayColor,f=void 0===d?"":d,h=g.overlayOpacity,v=void 0===h?"0.4":h;n.overlayBackground&&(f||v)&&o.push({".ugb-content-wrapper, .ugb-content-wrapper:after":{background:Object(u.ab)(f||"#000000",""===v?.4:v)+" !important"}});var y=e.attributes,O=y.titleColor,w=void 0===O?"":O,C=y.showTitle;(void 0===C||C)&&o.push({".ugb-header__title":x({},Object(u.K)("title%s","desktop",e.attributes),{color:Object(u.vb)(w,n.columnBackground&&i),textAlign:Object(u.c)(t("titleAlign")||t("contentAlign"))}),tablet:{".ugb-header__title":x({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:Object(u.c)(t("titleTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-header__title":x({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:Object(u.c)(t("titleMobileAlign")||t("mobileContentAlign"))})}});var E=e.attributes,S=E.subtitleColor,B=void 0===S?"":S,T=E.showSubtitle;(void 0===T||T)&&o.push({".ugb-header__subtitle":x({},Object(u.K)("subtitle%s","desktop",e.attributes),{color:Object(u.vb)(B,n.columnBackground&&i),textAlign:t("subtitleAlign")}),tablet:{".ugb-header__subtitle":x({},Object(u.K)("subtitle%s","tablet",e.attributes),{textAlign:t("subtitleTabletAlign")})},mobile:{".ugb-header__subtitle":x({},Object(u.K)("subtitle%s","mobile",e.attributes),{textAlign:t("subtitleMobileAlign")})}});var P=e.attributes,A=P.showButton,N=void 0!==A&&A,M=P.showButton2,R=void 0===M||M;return(N||R)&&(o.push({".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("contentAlign")?"flex-start":"right"===t("contentAlign")?"flex-end":"center"===t("contentAlign")?"center":void 0)},tablet:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("tabletContentAlign")?"flex-start":"right"===t("tabletContentAlign")?"flex-end":"center"===t("tabletContentAlign")?"center":void 0)}},mobile:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("mobileContentAlign")?"flex-start":"right"===t("mobileContentAlign")?"flex-end":"center"===t("mobileContentAlign")?"center":void 0)}}}),t("buttonAlign")&&o.push({".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("buttonAlign")?"flex-start":"right"===t("buttonAlign")?"flex-end":"center"===t("buttonAlign")?"center":void 0)}}),t("buttonTabletAlign")&&o.push({tablet:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("buttonTabletAlign")?"flex-start":"right"===t("buttonTabletAlign")?"flex-end":"center"===t("buttonTabletAlign")?"center":void 0)}}}),t("buttonMobileAlign")&&o.push({mobile:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("buttonMobileAlign")?"flex-start":"right"===t("buttonMobileAlign")?"flex-end":"center"===t("buttonMobileAlign")?"center":void 0)}}})),N&&o.push(x({},Object(u.s)("button%s","ugb-button1",e.attributes))),R&&o.push(x({},Object(u.s)("button2%s","ugb-button2",e.attributes))),n.titleSpacing&&o.push.apply(o,k(Object(u.F)(".ugb-header__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.subtitleSpacing&&o.push.apply(o,k(Object(u.F)(".ugb-header__subtitle","subtitle%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&o.push.apply(o,k(Object(u.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonGap&&o.push.apply(o,k(Object(u.F)(".ugb-button1","buttonGap%s","marginRight","%spx",e.attributes,{important:!0}))),_.a.all(o)},B=n(340),T=n.n(B),P=n(341),A=n.n(P),N=n(342),M=n.n(N),R=n(343),F=n.n(R),D=n(344),I=n.n(D),z=n(345),L=n.n(z),U=n(346),H=n.n(U),W=n(11),G=n(12),V=n(6);function q(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-icon__content-wrapper":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-icon__content-wrapper":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-icon__content-wrapper":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}}}),a.push(m({},Object(l.v)("icon%s","ugb-icon__icon",e.attributes))),n.iconAlign&&a.push({".ugb-icon__icon":Object(l.d)({alignSelf:Object(l.eb)(t("iconAlign"))}),tablet:{".ugb-icon__icon":Object(l.d)({alignSelf:Object(l.eb)(t("tabletIconAlign"))})},mobile:{".ugb-icon__icon":Object(l.d)({alignSelf:Object(l.eb)(t("mobileIconAlign"))})}});var f=e.attributes.showTitle;return(void 0===f||f)&&a.push({".ugb-icon__title":m({color:t("titleColor")},Object(l.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-icon__title":m({},Object(l.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-icon__title":m({},Object(l.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}}),a.push.apply(a,b(Object(l.F)(".ugb-icon__icon","icon%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&a.push.apply(a,b(Object(l.F)(".ugb-icon__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),a.push.apply(a,b(Object(l.F)(".ugb-icon__content-wrapper","%scolumnGap","columnGap","%spx",e.attributes,{important:!0}))),u.a.all(a)},f=n(3),h=n(10),v=n(8),y=n.n(v),O=n(11),w=n(0),_=n(6),j=n(12),k=n(9);function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function E(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-number-box__item":Object(r.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-number-box__item":Object(r.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-number-box__item":Object(r.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}}});var v=e.attributes,w=v.contentAlign,j=void 0===w?"":w,k=v.tabletContentAlign,C=void 0===k?"":k,x=v.mobileContentAlign,E=void 0===x?"":x,S=v.numberBGColor,B=void 0===S?"":S,T=v.numberColor,P=void 0===T?"":T,A=v.numberAlign,N=void 0===A?"":A,M=v.numberTabletAlign,R=void 0===M?"":M,F=v.numberMobileAlign,D=void 0===F?"":F,I=v.numberLineHeight,z=void 0===I?"":I,L=v.numberTabletLineHeight,U=void 0===L?"":L,H=v.numberMobileLineHeight,W=void 0===H?"":H,G=v.numberLineHeightUnit,V=void 0===G?"em":G,q=v.numberTabletLineHeightUnit,K=void 0===q?"em":q,J=v.numberMobileLineHeightUnit,Y=void 0===J?"em":J,X=v.showNumber;(void 0===X||X)&&n.push({".ugb-number-box__number":_({},Object(r.K)("number%s","desktop",e.attributes,{important:!0}),{backgroundColor:s.numberBGColor?Object(r.c)(t("numberBGColor")):void 0,color:Object(r.c)(Object(r.wb)(P,s.numberBGColor&&B)),opacity:t("numberOpacity"),textIndent:"basic"===o||"plain"===o?t("numberLetterSpacing","%spx"):void 0}),desktopTablet:{".ugb-number-box__number":{height:s.numberBGColor?Object(r.c)(t("numberPadding","%sem")):void 0,width:s.numberBGColor?Object(r.c)(t("numberPadding","%sem")):void 0,lineHeight:Object(r.c)(s.numberBGColor&&""===z?t("numberPadding","%sem"):t("numberLineHeight","%s".concat(V))),marginLeft:""!==N||""!==j?Object(r.c)(Object(r.hb)(N||j)):void 0,marginRight:""!==N||""!==j?Object(r.c)(Object(r.ib)(N||j)):void 0,textAlign:Object(r.c)(s.numberBGColor?void 0:t("numberAlign")||t("contentAlign"))}},tabletOnly:{".ugb-number-box__number":_({},Object(r.K)("number%s","tablet",e.attributes,{important:!0}),{lineHeight:Object(r.c)(s.numberBGColor&&""===U?t("numberTabletPadding","%sem"):t("numberTabletLineHeight","%s".concat(K))),marginLeft:""!==R||""!==C?Object(r.c)(Object(r.hb)(R)):void 0,marginRight:""!==R||""!==C?Object(r.c)(Object(r.ib)(R)):void 0,textAlign:Object(r.c)(s.numberBGColor?void 0:t("numberTabletAlign")||t("tabletContentAlign")),height:s.numberBGColor?Object(r.c)(t("numberTabletPadding","%sem")):void 0,width:s.numberBGColor?Object(r.c)(t("numberTabletPadding","%sem")):void 0})},mobile:{".ugb-number-box__number":_({},Object(r.K)("number%s","mobile",e.attributes,{important:!0}),{height:s.numberBGColor?Object(r.c)(t("numberMobilePadding","%sem")):void 0,width:s.numberBGColor?Object(r.c)(t("numberMobilePadding","%sem")):void 0,lineHeight:Object(r.c)(s.numberBGColor&&""===W?t("numberMobilePadding","%sem"):t("numberMobileLineHeight","%s".concat(Y))),marginLeft:""!==D||""!==E?Object(r.c)(Object(r.hb)(D)):void 0,marginRight:""!==D||""!==E?Object(r.c)(Object(r.ib)(D)):void 0,textAlign:Object(r.c)(s.numberBGColor?void 0:t("numberMobileAlign")||t("mobileContentAlign"))})}});var $=e.attributes,Z=$.titleColor,Q=void 0===Z?"":Z,ee=$.showTitle;(void 0===ee||ee)&&n.push({".ugb-number-box__title":_({},Object(r.K)("title%s","desktop",e.attributes),{color:Object(r.vb)(Q,s.columnBackground&&c),textAlign:t("titleAlign")}),tablet:{".ugb-number-box__title":_({},Object(r.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-number-box__title":_({},Object(r.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}});var te=e.attributes,ne=te.descriptionColor,ae=void 0===ne?"":ne,ie=te.showDescription;return(void 0===ie||ie)&&n.push({".ugb-number-box__description":_({},Object(r.K)("description%s","desktop",e.attributes),{color:Object(r.vb)(ae,s.columnBackground&&c),textAlign:t("descriptionAlign")}),tablet:{".ugb-number-box__description":_({},Object(r.K)("description%s","tablet",e.attributes),{textAlign:Object(r.c)(t("descriptionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-number-box__description":_({},Object(r.K)("description%s","mobile",e.attributes),{textAlign:Object(r.c)(t("descriptionMobileAlign")||t("mobileContentAlign"))})}}),s.numberSpacing&&n.push.apply(n,O(Object(r.F)(".ugb-number-box__number","number%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),s.titleSpacing&&n.push.apply(n,O(Object(r.F)(".ugb-number-box__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),s.descriptionSpacing&&n.push.apply(n,O(Object(r.F)(".ugb-number-box__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),y.a.all(n)},C=n(358),x=n.n(C),E=n(359),S=n.n(E),B=n(360),T=n.n(B),P=n(361),A=n.n(P),N=n(362),M=n.n(N),R=n(363),F=n.n(R),D=n(11),I=n(12),z=n(6);function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=2&&wp.element.createElement(D.TextControl,{label:Object(l.sprintf)(Object(l._x)("%s %d %s","Nth Title with description",f.i18n),Object(l.__)("Number",f.i18n),2,Object(l.__)("Label",f.i18n)),value:N,onChange:function(e){return n({num2:e})}}),""!==i&&i>=3&&wp.element.createElement(D.TextControl,{label:Object(l.sprintf)(Object(l._x)("%s %d %s","Nth Title with description",f.i18n),Object(l.__)("Number",f.i18n),3,Object(l.__)("Label",f.i18n)),value:R,onChange:function(e){return n({num3:e})}}),wp.element.createElement(g.vb,{attrNameTemplate:"number%s",setAttributes:n,blockAttributes:t.attributes,fontSizeProps:{max:"basic"===p||"plain"===p?[150,7]:[500,15],min:[0,1]},placeholder:function(e){return 3*e}}),L.numberStyle&&wp.element.createElement(D.SelectControl,{label:Object(l.__)("Number Shape",f.i18n),options:[{label:Object(l.__)("None",f.i18n),value:"none"},{label:Object(l.__)("Circle",f.i18n),value:""},{label:Object(l.__)("Square",f.i18n),value:"square"}],value:B,onChange:function(e){return n({numberStyle:e})}}),L.numberBGColor&&wp.element.createElement(g.kb,{attrNameTemplate:"number%sPadding",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.c,{label:Object(l.__)("Shape Size",f.i18n),min:0,max:5,step:.1,allowReset:!0,placeholder:"2.5"})),L.numberBGColor&&wp.element.createElement(g.u,{value:u,onChange:function(e){return n({numberBGColor:e})},label:Object(l.__)("Number Background Color",f.i18n)}),L.numberColor&&wp.element.createElement(g.u,{value:o,onChange:function(e){return n({numberColor:e})},label:Object(l.__)("Number Color",f.i18n)}),wp.element.createElement(g.c,{label:Object(l.__)("Opacity",f.i18n),min:0,max:1,step:.1,value:I,onChange:function(e){return n({numberOpacity:e})},allowReset:!0,placeholder:"1.0"}),wp.element.createElement(g.kb,{attrNameTemplate:"Number%sAlign",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.f,{label:Object(l.__)("Align",f.i18n),className:"ugb--help-tip-alignment-number"}))),wp.element.createElement(g.fb,{title:Object(l.__)("Title",f.i18n),id:"title",checked:j,onChange:function(e){return n({showTitle:e})},toggleOnSetAttributes:[].concat(U(Object(r.I)("title%s")),["titleTag","titleColor"],U(Object(r.C)("Title%sAlign"))),toggleAttributeName:"showTitle"},wp.element.createElement(g.M,{value:E||"h4",onChange:function(e){return n({titleTag:e})}}),wp.element.createElement(g.vb,{attrNameTemplate:"title%s",setAttributes:n,blockAttributes:t.attributes,htmlTag:E||"h4"}),wp.element.createElement(g.u,{value:c,onChange:function(e){return n({titleColor:e})},label:Object(l.__)("Title Color",f.i18n)}),wp.element.createElement(g.kb,{attrNameTemplate:"Title%sAlign",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.f,{label:Object(l.__)("Align",f.i18n),className:"ugb--help-tip-alignment-title"}))),wp.element.createElement(g.fb,{title:Object(l.__)("Description",f.i18n),id:"description",checked:C,onChange:function(e){return n({showDescription:e})},toggleOnSetAttributes:[].concat(U(Object(r.I)("description%s")),["descriptionColor"],U(Object(r.C)("description%sAlign"))),toggleAttributeName:"showDescription"},wp.element.createElement(g.vb,{attrNameTemplate:"description%s",setAttributes:n,blockAttributes:t.attributes}),wp.element.createElement(g.u,{value:s,onChange:function(e){return n({descriptionColor:e})},label:Object(l.__)("Description Color",f.i18n)}),wp.element.createElement(g.kb,{attrNameTemplate:"description%sAlign",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.f,{label:Object(l.__)("Align",f.i18n),className:"ugb--help-tip-alignment-description"}))))});var H=Object(I.compose)(d.i,d.g,d.d,Object(d.h)(),Object(d.c)(["Number%sAlign","Title%sAlign","Description%sAlign"]),Object(d.a)(k,{editorMode:!0}),Object(d.b)([[".ugb-number-box__item","column-background"],[".ugb-number-box__number","number"],[".ugb-number-box__title","title"],[".ugb-number-box__description","description"]]))(function(e){var t,n=e.className,a=e.setAttributes,i=e.attributes,c=e.attributes,b=c.columns,p=c.design,m=void 0===p?"basic":p,d=c.titleTag,v=void 0===d?"":d,y=c.shadow,O=void 0===y?"":y,w=c.showNumber,_=void 0===w||w,j=c.showTitle,k=void 0===j||j,C=c.showDescription,x=void 0===C||C,E=c.numberStyle,S=void 0===E?"":E,B=s()([n,"ugb-number-box--v3","ugb-number-box--columns-".concat(b)],Object(o.applyFilters)("stackable.number-box.mainclasses",(L(t={},"ugb-number-box--design-".concat(m),"basic"!==m),L(t,"ugb-number-box--number-style-".concat(S),""!==S&&("basic"===m||"plain"===m)),t),m,e)),T=h(e);return wp.element.createElement(g.k.Edit,{className:B,blockProps:e,render:function(){return wp.element.createElement(z.Fragment,null,Object(r.nb)(1,b+1).map(function(t){var n=i["num".concat(t)],c=i["title".concat(t)],b=i["description".concat(t)],p=s()(["ugb-number-box__item","ugb-number-box__item".concat(t)],Object(o.applyFilters)("stackable.number-box.boxclasses",L({},"ugb--shadow-".concat(O),"plain"!==m&&""!==O),m,e));return wp.element.createElement(g.G,{className:p,backgroundAttrName:"column%s",blockProps:e,showBackground:T.columnBackground,key:t},_&&wp.element.createElement(u.RichText,{tagName:"div",className:"ugb-number-box__number",value:n,onChange:function(e){return a(L({},"num".concat(t),e))}}),(k||x)&&wp.element.createElement("div",{className:"ugb-number-box__content"},k&&wp.element.createElement(u.RichText,{tagName:v||"h4",value:c,className:"ugb-number-box__title",onChange:function(e){return a(L({},"title".concat(t),e))},placeholder:Object(l.__)("Title",f.i18n),keepPlaceholderOnFocus:!0}),x&&wp.element.createElement(u.RichText,{tagName:"p",value:b,className:"ugb-number-box__description",onChange:function(e){return a(L({},"description".concat(t),e))},placeholder:Object(r.M)(),keepPlaceholderOnFocus:!0})))}))}})});function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var G=Object(I.compose)(d.i,Object(d.a)(k))(function(e){var t,n=e.className,a=e.attributes,r=a.columns,l=void 0===r?2:r,c=a.design,b=void 0===c?"basic":c,p=a.titleTag,m=void 0===p?"":p,d=a.shadow,f=void 0===d?"":d,v=a.numberStyle,y=void 0===v?"":v,O=a.showNumber,w=void 0===O||O,_=a.showTitle,j=void 0===_||_,k=a.showDescription,C=void 0===k||k,x=s()([n,"ugb-number-box--v3","ugb-number-box--columns-".concat(l)],Object(o.applyFilters)("stackable.number-box.mainclasses",(W(t={},"ugb-number-box--design-".concat(b),"basic"!==b),W(t,"ugb-number-box--number-style-".concat(y),""!==y&&("basic"===b||"plain"===b)),t),b,e)),E=h(e);return wp.element.createElement(g.k.Save,{className:x,blockProps:e,render:function(){return wp.element.createElement(z.Fragment,null,Object(i.range)(1,l+1).map(function(t){var n=a["num".concat(t)],i=a["title".concat(t)],r=a["description".concat(t)],l=s()(["ugb-number-box__item","ugb-number-box__item".concat(t)],Object(o.applyFilters)("stackable.number-box.boxclasses",W({},"ugb--shadow-".concat(f),"plain"!==b&&""!==f),b,e));return wp.element.createElement(g.G,{className:l,backgroundAttrName:"column%s",blockProps:e,showBackground:E.columnBackground,key:t},w&&!u.RichText.isEmpty(n)&&wp.element.createElement(u.RichText.Content,{tagName:"span",className:"ugb-number-box__number",value:n}),(j||C)&&(!u.RichText.isEmpty(i)||!u.RichText.isEmpty(r))&&wp.element.createElement("div",{className:"ugb-number-box__content"},j&&!u.RichText.isEmpty(i)&&wp.element.createElement(u.RichText.Content,{tagName:m||"h4",className:"ugb-number-box__title",value:i}),C&&!u.RichText.isEmpty(r)&&wp.element.createElement(u.RichText.Content,{tagName:"p",className:"ugb-number-box__description",value:r})))}))}})});function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image1Alt","image2Alt","image3Alt","button1Url","button1NewTab","button1NoFollow","button2Url","button2NewTab","button2NoFollow","button3Url","button3NewTab","button3NoFollow"])))});var s=n(22),u=n(2),b=n(8),p=n.n(b),m=n(19),g=n.n(m),d=n(1),f=n(0),h=n(6),v=n(9);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={pricingBoxColor:{type:"string"},priceColor:{type:"string"},perMonthLabelColor:{type:"string"},buttonColor:{type:"string"},buttonTextColor:{type:"string"},buttonDesign:{type:"string",default:"basic"},buttonIcon:{type:"string"},featureListColor:{type:"string"},columns:{type:"number",default:2},size:{type:"string",default:"normal"},cornerButtonRadius:{type:"number",default:4},design:{type:"string",default:"basic"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},hoverEffect:{type:"string",default:""},align:{type:"string"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}};[1,2,3].forEach(function(e){var t=1===e?"":e;w["url".concat(t)]={type:"string",source:"attribute",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-button"),attribute:"href",default:""},w["newTab".concat(t)]={type:"boolean",source:"attribute",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-button"),attribute:"target",default:!1},w["imageURL".concat(t)]={type:"string"},w["imageID".concat(t)]={type:"string"},w["imageAlt".concat(t)]={type:"string"},w["highlightColor".concat(t)]={type:"string",default:""},w["pricingBoxTitle".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__title"),default:Object(f.__)("Title",d.i18n)},w["price".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__price"),default:"".concat(t,"9")},w["pricePrefix".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__price-prefix"),default:"$"},w["priceSuffix".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__price-suffix"),default:".00"},w["perMonthLabel".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__subprice"),default:Object(f.__)("Description",d.i18n)},w["buttonText".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-button span"),default:Object(f.__)("Button text",d.i18n)},w["featureList".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__description"),default:Object(u.M)("medium")}});var _=[{attributes:w,save:function(e){var t=e.className,n=e.attributes,a=n.pricingBoxColor,o=n.priceColor,r=n.perMonthLabelColor,l=n.buttonColor,c=n.buttonTextColor,b=n.buttonDesign,m=n.buttonIcon,d=n.featureListColor,f=n.columns,y=void 0===f?2:f,w=n.size,_=n.cornerButtonRadius,j=n.design,k=void 0===j?"basic":j,C=n.borderRadius,x=void 0===C?12:C,E=n.shadow,S=void 0===E?3:E,B=p()([t,"ugb-pricing-box","ugb-pricing-box--v2","ugb-pricing-box--columns-".concat(y),"ugb-pricing-box--design-".concat(k)],Object(i.applyFilters)("stackable.pricing-box.mainclasses_1_17_3",{},k,e));return wp.element.createElement("div",{className:B},Object(i.applyFilters)("stackable.pricing-box.save.output.before_1_17_3",null,k,e),Object(u.nb)(1,y+1).map(function(t){var f,y,j,C,E,B,T,P,A=1===t?"":t,N=n["pricingBoxTitle".concat(A)],M=n["price".concat(A)],R=n["pricePrefix".concat(A)],F=n["priceSuffix".concat(A)],D=n["perMonthLabel".concat(A)],I=n["url".concat(A)],z=n["newTab".concat(A)],L=n["buttonText".concat(A)],U=n["featureList".concat(A)],H=n["imageURL".concat(A)],W=n["imageAlt".concat(A)],G=n["highlightColor".concat(A)]||"",V=p()(["ugb-pricing-box__item"],Object(i.applyFilters)("stackable.pricing-box.itemclasses_1_17_3",(O(f={},"ugb--shadow-".concat(S),"plain"!==k&&3!==S),O(f,"ugb-pricing-box--highlighted","plain"!==k&&G),O(f,"ugb-pricing-box--is-dark",!("plain"===k||!G)&&Object(u.bb)(G)),f),k,t,e)),q=Object(i.applyFilters)("stackable.pricing-box.styles_1_17_3",{item:{borderRadius:"plain"!==k&&12!==x?x:void 0,backgroundColor:"plain"!==k&&G?G:void 0},title:{color:a},price:{color:o},month:{color:r},description:{color:d}},k,t,e);return wp.element.createElement("div",{className:V,style:q.item,key:t},(y=H&&wp.element.createElement("div",{className:"ugb-pricing-box__image"},wp.element.createElement("img",{src:H,alt:g()(N||W)})),j=H&&wp.element.createElement("div",{className:"ugb-pricing-box__image-bg",style:{backgroundImage:"url(".concat(H,")")}}),C=!v.RichText.isEmpty(N)&&wp.element.createElement(v.RichText.Content,{tagName:"h3",className:"ugb-pricing-box__title",style:q.title,value:N}),E=(!v.RichText.isEmpty(M)||!v.RichText.isEmpty(D))&&wp.element.createElement("div",{className:"ugb-pricing-box__price-wrapper"},!v.RichText.isEmpty(M)&&wp.element.createElement("div",{className:"ugb-pricing-box__price-line"},!v.RichText.isEmpty(R)&&wp.element.createElement(v.RichText.Content,{tagName:"span",className:"ugb-pricing-box__price-prefix",style:q.price,value:R}),wp.element.createElement(v.RichText.Content,{tagName:"span",className:"ugb-pricing-box__price",style:q.price,value:M}),!v.RichText.isEmpty(F)&&wp.element.createElement(v.RichText.Content,{tagName:"span",className:"ugb-pricing-box__price-suffix",style:q.price,value:F})),!v.RichText.isEmpty(D)&&wp.element.createElement(v.RichText.Content,{tagName:"p",className:"ugb-pricing-box__subprice",style:q.month,value:D})),B=L&&!!L.length&&wp.element.createElement("div",{className:"ugb-pricing-box__button"},wp.element.createElement(s.b,{size:w,url:I,newTab:z,color:c,text:L,design:b,icon:m,backgroundColor:l,borderRadius:_})),T=!v.RichText.isEmpty(U)&&wp.element.createElement(v.RichText.Content,{tagName:"p",className:"ugb-pricing-box__description",style:q.description,value:U}),P={imageComp:y,imageBGComp:j,titleComp:C,priceComp:E,buttonComp:B,descriptionComp:T},Object(i.applyFilters)("stackable.pricing-box.save.output_1_17_3",wp.element.createElement(h.Fragment,null,y,C,E,B,T),k,P,t,e)))}),Object(i.applyFilters)("stackable.pricing-box.save.output.after_1_17_3",null,k,e))},migrate:function(e){var t=e.design,n=void 0===t?"basic":t;return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(k)),paddingBottom:t("columnPaddingBottom","%s".concat(k)),paddingRight:t("columnPaddingRight","%s".concat(k)),paddingLeft:t("columnPaddingLeft","%s".concat(k))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(x)),paddingRight:t("tabletColumnPaddingRight","%s".concat(x)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(x)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(x))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(S)),paddingRight:t("mobileColumnPaddingRight","%s".concat(S)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(S)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(S))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-pricing-box__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(k)),paddingBottom:t("columnPaddingBottom","%s".concat(k)),paddingRight:t("columnPaddingRight","%s".concat(k)),paddingLeft:t("columnPaddingLeft","%s".concat(k))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-pricing-box__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(x)),paddingRight:t("tabletColumnPaddingRight","%s".concat(x)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(x)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(x))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-pricing-box__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(S)),paddingRight:t("mobileColumnPaddingRight","%s".concat(S)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(S)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(S))})}}}),l&&(w.push(I({},Object(u.B)("image%s","ugb-img",e.attributes,{inherit:!1}))),w.push({".ugb-img, .ugb-pricing-box__image":{marginLeft:""!==s||""!==p?Object(u.hb)(s||p)+" !important":void 0,marginRight:""!==s||""!==p?Object(u.ib)(s||p)+" !important":void 0},tablet:{".ugb-img, .ugb-pricing-box__image":{marginLeft:""!==g||""!==f?Object(u.hb)(g||f)+" !important":void 0,marginRight:""!==g||""!==f?Object(u.ib)(g||f)+" !important":void 0}},mobile:{".ugb-img, .ugb-pricing-box__image":{marginLeft:""!==v||""!==O?Object(u.hb)(v||O)+" !important":void 0,marginRight:""!==v||""!==O?Object(u.ib)(v||O)+" !important":void 0}}}));var B=e.attributes,T=B.titleColor,P=void 0===T?"":T,A=B.showTitle;(void 0===A||A)&&(w.push({".ugb-pricing-box__title":{color:Object(u.vb)(P,n.columnBackground&&o)}}),w.push({".ugb-pricing-box__title":I({},Object(u.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-pricing-box__title":I({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-pricing-box__title":I({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}}));var M=e.attributes,D=M.priceColor,z=void 0===D?"":D,L=M.showPrice,U=void 0===L||L;if(U){w.push({".ugb-pricing-box__price, .ugb-pricing-box__price-prefix, .ugb-pricing-box__price-suffix":{color:Object(u.vb)(z,n.columnBackground&&o)}});var H=t("priceAlign")||t("contentAlign"),W=t("priceTabletAlign")||t("tabletContentAlign"),G=t("priceMobileAlign")||t("mobileContentAlign");w.push({".ugb-pricing-box__price-line":I({},Object(u.K)("price%s","desktop",e.attributes),{justifyContent:Object(u.c)("center"===H?"center":"left"===H?"flex-start":"right"===H?"flex-end":void 0)}),tablet:{".ugb-pricing-box__price-line":I({},Object(u.K)("price%s","tablet",e.attributes),{justifyContent:Object(u.c)("center"===W?"center":"left"===W?"flex-start":"right"===W?"flex-end":void 0)})},mobile:{".ugb-pricing-box__price-line":I({},Object(u.K)("price%s","mobile",e.attributes),{justifyContent:Object(u.c)("center"===G?"center":"left"===G?"flex-start":"right"===G?"flex-end":void 0)})}})}var V=e.attributes,q=V.pricePrefixColor,K=void 0===q?"":q,J=V.showPricePrefix;U&&(void 0===J||J)&&w.push({".ugb-pricing-box__price-prefix":I({color:K||void 0},Object(u.K)("pricePrefix%s","desktop",e.attributes,{important:!0})),tablet:{".ugb-pricing-box__price-prefix":I({},Object(u.K)("pricePrefix%s","tablet",e.attributes,{important:!0}))},mobile:{".ugb-pricing-box__price-prefix":I({},Object(u.K)("pricePrefix%s","mobile",e.attributes,{important:!0}))}});var Y=e.attributes,X=Y.priceSuffixColor,$=void 0===X?"":X,Z=Y.showPriceSuffix;U&&(void 0===Z||Z)&&w.push({".ugb-pricing-box__price-suffix":I({color:$||void 0},Object(u.K)("priceSuffix%s","desktop",e.attributes,{important:!0})),tablet:{".ugb-pricing-box__price-suffix":I({},Object(u.K)("priceSuffix%s","tablet",e.attributes,{important:!0}))},mobile:{".ugb-pricing-box__price-suffix":I({},Object(u.K)("priceSuffix%s","mobile",e.attributes,{important:!0}))}});var Q=e.attributes,ee=Q.subPriceColor,te=void 0===ee?"":ee,ne=Q.showSubPrice;(void 0===ne||ne)&&(w.push({".ugb-pricing-box__subprice":{color:Object(u.c)(Object(u.vb)(te,n.columnBackground&&o))}}),w.push({".ugb-pricing-box__subprice":I({},Object(u.K)("subPrice%s","desktop",e.attributes,{important:!0}),{textAlign:t("subPriceAlign")||t("contentAlign")}),tablet:{".ugb-pricing-box__subprice":I({},Object(u.K)("subPrice%s","tablet",e.attributes,{important:!0}),{textAlign:t("subPriceTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-pricing-box__subprice":I({},Object(u.K)("subPrice%s","mobile",e.attributes,{important:!0}),{textAlign:t("subPriceMobileAlign")||t("mobileContentAlign")})}}));var ae=e.attributes.showButton;(void 0===ae||ae)&&(w.push(I({},Object(u.s)("button%s","ugb-button",e.attributes))),w.push({".ugb-button-container":{textAlign:Object(u.c)(t("buttonAlign")||t("contentAlign"))},tablet:{".ugb-button-container":{textAlign:Object(u.c)(t("buttonTabletAlign")||t("tabletContentAlign"))}},mobile:{".ugb-button-container":{textAlign:Object(u.c)(t("buttonMobileAlign")||t("mobileContentAlign"))}}}));var ie=e.attributes,oe=ie.descriptionColor,re=void 0===oe?"":oe,le=ie.showDescription;return(void 0===le||le)&&w.push({".ugb-pricing-box__description":I({},Object(u.K)("description%s","desktop",e.attributes),{color:Object(u.vb)(re,n.columnBackground&&o),textAlign:Object(u.c)(t("descriptionAlign")||t("contentAlign"))}),tablet:{".ugb-pricing-box__description":I({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:Object(u.c)(t("descriptionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-pricing-box__description":I({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:Object(u.c)(t("descriptionMobileAlign")||t("mobileContentAlign"))})}}),n.imageSpacing&&w.push.apply(w,F(Object(u.F)(".ugb-pricing-box__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&w.push.apply(w,F(Object(u.F)(".ugb-pricing-box__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.priceSpacing&&w.push.apply(w,F(Object(u.F)(".ugb-pricing-box__price-wrapper","price%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.subPriceSpacing&&w.push.apply(w,F(Object(u.F)(".ugb-pricing-box__subprice","subPrice%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&w.push.apply(w,F(Object(u.F)(".ugb-pricing-box__button","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&w.push.apply(w,F(Object(u.F)(".ugb-pricing-box__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),R.a.all(w)},U=n(3),H=n(10),W=n(12),G=n(13);function V(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)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image1Alt","image2Alt","image3Alt","social1FacebookUrl","social1TwitterUrl","social1InstagramUrl","social1PinterestUrl","social1LinkedinUrl","social1YoutubeUrl","social1EmailUrl","social2FacebookUrl","social2TwitterUrl","social2InstagramUrl","social2PinterestUrl","social2LinkedinUrl","social2YoutubeUrl","social2EmailUrl","social3FacebookUrl","social3TwitterUrl","social3InstagramUrl","social3PinterestUrl","social3LinkedinUrl","social3YoutubeUrl","social3EmailUrl"])))});var s=n(2),u=n(8),b=n.n(u),p=n(1),m=n(0),g=n(9),d=n(6);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=[{attributes:{href1:{type:"url"},href2:{type:"url"},href3:{type:"url"},mediaID1:{type:"number"},mediaID2:{type:"number"},mediaID3:{type:"number"},mediaURL1:{type:"string",source:"attribute",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__image",attribute:"data-src",default:""},mediaURL2:{type:"string",source:"attribute",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__image",attribute:"data-src",default:""},mediaURL3:{type:"string",source:"attribute",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__image",attribute:"data-src",default:""},name1:{source:"html",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__name",default:Object(m.__)("Name",p.i18n)},name2:{source:"html",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__name",default:Object(m.__)("Name",p.i18n)},name3:{source:"html",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__name",default:Object(m.__)("Name",p.i18n)},position1:{source:"html",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__position",default:Object(m.__)("Position",p.i18n)},position2:{source:"html",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__position",default:Object(m.__)("Position",p.i18n)},position3:{source:"html",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__position",default:Object(m.__)("Position",p.i18n)},description1:{source:"html",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__description",default:Object(s.M)("medium")},description2:{source:"html",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__description",default:Object(s.M)("medium")},description3:{source:"html",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__description",default:Object(s.M)("medium")},nameColor:{type:"string"},posColor:{type:"string"},desColor:{type:"string"},columns:{type:"number",default:2},shapes:{type:"string",default:"circle"},design:{type:"string",default:"basic"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},colorOnHover:{type:"boolean",default:!1},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""},href:{type:"url"},hrefTwo:{type:"url"},hrefThree:{type:"url"},mediaID:{type:"number"},mediaIDTwo:{type:"number"},mediaIDThree:{type:"number"},mediaURL:{type:"string"},mediaURLTwo:{type:"string"},mediaURLThree:{type:"string"},name:{type:"string"},nameTwo:{type:"string"},nameThree:{type:"string"},position:{type:"string"},positionTwo:{type:"string"},positionThree:{type:"string"},des:{type:"string"},desTwo:{type:"string"},desThree:{type:"string"},iconColor:{type:"string"},align:{type:"string"}},save:function(e){var t=e.className,n=e.attributes,a=e.attributes,o=a.shapes,r=a.nameColor,l=a.posColor,c=a.desColor,u=a.columns,p=void 0===u?2:u,m=a.design,f=void 0===m?"basic":m,v=a.borderRadius,y=void 0===v?12:v,O=a.shadow,w=void 0===O?3:O,_=b()([t,"ugb-team-member","ugb-team-member--v2","ugb-team-member--columns-".concat(p),"ugb-team-member--image-".concat(o),"ugb-team-member--design-".concat(f)],Object(i.applyFilters)("stackable.team-member.mainclasses_1_17_3",{},f,e));return wp.element.createElement("div",{className:_},Object(i.applyFilters)("stackable.team-member.save.output.before_1_17_3",null,f,e),Object(s.nb)(1,p+1).map(function(t){var a=n["mediaURL".concat(t)],o=n["name".concat(t)],s=n["position".concat(t)],u=n["description".concat(t)],p=b()(["ugb-team-member__item"],Object(i.applyFilters)("stackable.team-member.itemclasses_1_17_3",h({},"ugb--shadow-".concat(w),"plain"!==f&&3!==w),f,t,e)),m=Object(i.applyFilters)("stackable.team-member.itemstyles_1_17_3",{item:{borderRadius:"plain"!==f&&12!==y?y:void 0}},f,t,e),v=a&&wp.element.createElement("div",{className:"ugb-team-member__image",style:{backgroundImage:a?"url(".concat(a,")"):void 0},"data-src":a||void 0}),O=!g.RichText.isEmpty(o)&&wp.element.createElement(g.RichText.Content,{tagName:"h4",className:"ugb-team-member__name",style:{color:r},value:o}),_=!g.RichText.isEmpty(s)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-team-member__position",style:{color:l},value:s}),j=!g.RichText.isEmpty(u)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-team-member__description",style:{color:c},value:u}),k={imageComp:v,nameComp:O,positionComp:_,descriptionComp:j};return wp.element.createElement("div",{className:p,style:m.item,key:t},Object(i.applyFilters)("stackable.team-member.save.output_1_17_3",wp.element.createElement(d.Fragment,null,v,wp.element.createElement("div",{className:"ugb-team-member__content"},O,_,j)),f,k,t,e))}),Object(i.applyFilters)("stackable.team-member.save.output.after",null,f,e))},migrate:function(e){var t;return!e.design||["basic","plain"].includes(e.design)?t=1===e.columns?300:3===e.columns?150:220:"horizontal"===e.design&&(t=1===e.columns?150:3===e.columns?80:110),function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(j)),paddingRight:t("mobileColumnPaddingRight","%s".concat(j)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(j)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(j))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-team-member__item":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-team-member__item":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-team-member__item":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(j)),paddingRight:t("mobileColumnPaddingRight","%s".concat(j)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(j)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(j))})}}});var k=e.attributes,C=k.imageAlign,x=void 0===C?"":C,E=k.imageTabletAlign,S=void 0===E?"":E,B=k.tabletContentAlign,T=void 0===B?"":B,A=k.imageMobileAlign,R=void 0===A?"":A,I=k.mobileContentAlign,z=void 0===I?"":I;!n.imageAsBackground&&p?(d.push(F({},Object(s.B)("image%s","ugb-img",e.attributes,{inherit:!1}))),d.push.apply(d,M(Object(s.F)(".ugb-team-member__image","image%sWidth","width","%spx",e.attributes,{important:!0,inherit:!1}))),d.push({".ugb-img, .ugb-team-member__image":{marginLeft:""!==x||""!==g?Object(s.hb)(x||g)+" !important":void 0,marginRight:""!==x||""!==g?Object(s.ib)(x||g)+" !important":void 0},tablet:{".ugb-img, .ugb-team-member__image":{marginLeft:""!==S||""!==T?Object(s.hb)(S||T)+" !important":void 0,marginRight:""!==S||""!==T?Object(s.ib)(S||T)+" !important":void 0}},mobile:{".ugb-img, .ugb-team-member__image":{marginLeft:""!==R||""!==z?Object(s.hb)(R||z)+" !important":void 0,marginRight:""!==R||""!==z?Object(s.ib)(R||z)+" !important":void 0}}})):p&&(d.push(F({},Object(s.z)("image%s","ugb-team-member__image",e.attributes))),Object(a.range)(1,l+1).forEach(function(e){d.push(D({},".ugb-team-member__item.ugb-team-member__item".concat(e," .ugb-team-member__image"),{backgroundImage:t("image".concat(e,"Url"),"url(%s)")}))}));var L=e.attributes,U=L.nameColor,H=void 0===U?"":U,W=L.showName;(void 0===W||W)&&(d.push({".ugb-team-member__name":{color:Object(s.c)(Object(s.wb)(H,n.columnBackground&&u))}}),d.push({".ugb-team-member__name":F({},Object(s.K)("name%s","desktop",e.attributes),{textAlign:Object(s.c)(t("nameAlign")||t("contentAlign"))}),tablet:{".ugb-team-member__name":F({},Object(s.K)("name%s","tablet",e.attributes),{textAlign:Object(s.c)(t("nameTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-team-member__name":F({},Object(s.K)("name%s","mobile",e.attributes),{textAlign:Object(s.c)(t("nameMobileAlign")||t("mobileContentAlign"))})}}));var G=e.attributes,V=G.positionColor,q=void 0===V?"":V,K=G.showPosition;(void 0===K||K)&&(d.push({".ugb-team-member__position":{color:Object(s.c)(Object(s.wb)(q,n.columnBackground&&u))}}),d.push({".ugb-team-member__position":F({},Object(s.K)("position%s","desktop",e.attributes),{textAlign:Object(s.c)(t("positionAlign")||t("contentAlign"))}),tablet:{".ugb-team-member__position":F({},Object(s.K)("position%s","tablet",e.attributes),{textAlign:Object(s.c)(t("positionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-team-member__position":F({},Object(s.K)("position%s","mobile",e.attributes),{textAlign:Object(s.c)(t("positionMobileAlign")||t("mobileContentAlign"))})}}));var J=e.attributes,Y=J.descriptionColor,X=void 0===Y?"":Y,$=J.showDescription;(void 0===$||$)&&(d.push({".ugb-team-member__description":{color:Object(s.wb)(X,n.columnBackground&&u)}}),d.push({".ugb-team-member__description":F({},Object(s.K)("description%s","desktop",e.attributes),{textAlign:Object(s.c)(t("descriptionAlign")||t("contentAlign"))}),tablet:{".ugb-team-member__description":F({},Object(s.K)("description%s","tablet",e.attributes),{textAlign:Object(s.c)(t("descriptionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-team-member__description":F({},Object(s.K)("description%s","mobile",e.attributes),{textAlign:Object(s.c)(t("descriptionMobileAlign")||t("mobileContentAlign"))})}}));var Z=e.attributes,Q=Z.showSocial,ee=void 0===Q||Q,te=Z.socialDesign,ne=void 0===te?"":te;return ee&&(d.push(F({},Object(s.H)("social%s","ugb-button",F({},e.attributes,{buttonDesign:ne})))),d.push({".ugb-team-member__buttons":{textAlign:Object(s.c)(t("socialAlign")||t("contentAlign"))},tablet:{".ugb-team-member__buttons":{textAlign:Object(s.c)(t("socialTabletAlign")||t("tabletContentAlign"))}},mobile:{".ugb-team-member__buttons":{textAlign:Object(s.c)(t("socialMobileAlign")||t("mobileContentAlign"))}}})),n.imageSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.nameSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__name","name%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.positionSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__position","position%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.socialSpacing&&(d.push.apply(d,M(Object(s.F)(".ugb-button-container","social%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),d.push.apply(d,M(Object(s.F)(".ugb-button","social%sGap","marginLeft","%spx",e.attributes,{important:!0}))),d.push.apply(d,M(Object(s.F)(".ugb-button","social%sGap","marginRight","%spx",e.attributes,{important:!0})))),p&&Object(a.range)(1,l+1).forEach(function(t){e.attributes["image".concat(t,"Shape")]&&d.push(D({},".ugb-team-member__item".concat(t," .ugb-img"),Object(s.A)("image".concat(t,"%s"),e.attributes)))}),N.a.all(d)},z=I,L=n(11),U=n(12),H=n(13);function W(){return(W=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image1Alt","image2Alt","image3Alt"])))});var s=n(2),u=n(8),b=n.n(u),p=n(1),m=n(0),g=n(9);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=[{attributes:{mediaID1:{type:"number"},mediaID2:{type:"number"},mediaID3:{type:"number"},mediaURL1:{type:"string"},mediaURL2:{type:"string"},mediaURL3:{type:"string"},name1:{source:"html",selector:".ugb-testimonial__item:nth-of-type(1) .ugb-testimonial__name",default:Object(m.__)("Name",p.i18n)},name2:{source:"html",selector:".ugb-testimonial__item:nth-of-type(2) .ugb-testimonial__name",default:Object(m.__)("Name",p.i18n)},name3:{source:"html",selector:".ugb-testimonial__item:nth-of-type(3) .ugb-testimonial__name",default:Object(m.__)("Name",p.i18n)},position1:{source:"html",selector:".ugb-testimonial__item:nth-of-type(1) .ugb-testimonial__position",default:Object(m.__)("Position",p.i18n)},position2:{source:"html",selector:".ugb-testimonial__item:nth-of-type(2) .ugb-testimonial__position",default:Object(m.__)("Position",p.i18n)},position3:{source:"html",selector:".ugb-testimonial__item:nth-of-type(3) .ugb-testimonial__position",default:Object(m.__)("Position",p.i18n)},testimonial1:{source:"html",selector:".ugb-testimonial__item:nth-of-type(1) .ugb-testimonial__body",default:Object(s.M)("medium")},testimonial2:{source:"html",selector:".ugb-testimonial__item:nth-of-type(2) .ugb-testimonial__body",default:Object(s.M)("medium")},testimonial3:{source:"html",selector:".ugb-testimonial__item:nth-of-type(3) .ugb-testimonial__body",default:Object(s.M)("medium")},titleColor:{type:"string"},posColor:{type:"string"},bodyTextColor:{type:"string"},backgroundColor:{type:"string",default:""},serif:{type:"boolean",default:!1},columns:{type:"number",default:2},design:{type:"string",default:"basic"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""},href:{type:"url"},hrefTwo:{type:"url"},hrefThree:{type:"url"},mediaID:{type:"number"},mediaIDTwo:{type:"number"},mediaIDThree:{type:"number"},mediaURL:{type:"string"},mediaURLTwo:{type:"string"},mediaURLThree:{type:"string"},testimonialTitle:{type:"string"},testimonialTitleTwo:{type:"string"},testimonialTitleThree:{type:"string"},position:{type:"string"},positionTwo:{type:"string"},positionThree:{type:"string"},body:{type:"string"},bodyTwo:{type:"string"},bodyThree:{type:"string"},iconColor:{type:"string"},align:{type:"string"}},save:function(e){var t=e.className,n=e.attributes,a=n.columns,o=n.titleColor,r=n.posColor,l=n.bodyTextColor,c=n.design,u=void 0===c?"basic":c,p=n.borderRadius,m=void 0===p?12:p,d=n.backgroundColor,h=void 0===d?"":d,v=n.shadow,y=void 0===v?3:v,O=n.serif,w=void 0!==O&&O,_=b()([t,"ugb-testimonial","ugb-testimonial--v2","ugb-testimonial--columns-".concat(a),"ugb-testimonial--design-".concat(u)],Object(i.applyFilters)("stackable.testimonial.mainclasses_1_17_3",{"ugb-testimonial--serif":w},u,e)),j=b()(["ugb-testimonial__item"],Object(i.applyFilters)("stackable.testimonial.itemclasses_1_17_3",f({},"ugb--shadow-".concat(y),"plain"!==u&&3!==y),u,e)),k=Object(i.applyFilters)("stackable.testimonial.styles_1_17_3",{item:{borderRadius:"plain"!==u&&12!==m?m:void 0,backgroundColor:"plain"!==u&&h?h:void 0},bodyWrapper:{},body:{color:l||void 0}},u,e);return wp.element.createElement("div",{className:_},Object(i.applyFilters)("stackable.testimonial.save.output.before_1_17_3",null,u,e),Object(s.nb)(1,a+1).map(function(t){var a=n["mediaURL".concat(t)],l=n["name".concat(t)],c=n["position".concat(t)],s=n["testimonial".concat(t)],p=b()(["ugb-testimonial__body-wrapper"],Object(i.applyFilters)("stackable.testimonial.bodyclasses_1_17_3",{},u,e));return wp.element.createElement("div",{className:j,style:k.item,key:t},wp.element.createElement("div",{className:p,style:k.bodyWrapper},!g.RichText.isEmpty(s)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-testimonial__body",style:k.body,value:s})),wp.element.createElement("div",{className:"ugb-testimonial__person"},a&&wp.element.createElement("div",{className:"ugb-testimonial__image",style:{backgroundImage:"url(".concat(a,")")}}),!g.RichText.isEmpty(l)&&wp.element.createElement(g.RichText.Content,{tagName:"h4",className:"ugb-testimonial__name",style:{color:o},value:l}),!g.RichText.isEmpty(c)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-testimonial__position",style:{color:r},value:c})))}),Object(i.applyFilters)("stackable.testimonial.save.output.after_1_17_3",null,u,e))},migrate:function(e){var t=["","basic","plain","basic2","bubble"].includes(e.design)?75:void 0;return function(e){for(var t=1;t".concat(e.testimonial1,""):e.testimonial1,testimonial2:e.serif?"
".concat(e.testimonial2,""):e.testimonial2,testimonial3:e.serif?"".concat(e.testimonial3,""):e.testimonial3,shadow:"basic2"===e.design?void 0:e.shadow,bubbleBackgroundColor:"bubble"===e.design?e.backgroundColor:void 0,imageWidth:t,imageSquare:!!t||void 0})}}],v=n(373),y=n.n(v),O=n(374),w=n.n(O),_=n(375),j=n.n(_),k=n(376),C=n.n(k),x=n(377),E=n.n(x),S=n(378),B=n.n(S),T=n(379),P=n.n(T),A=function(e){var t=e.attributes,n=t.design,a=void 0===n?"basic":n,o=t.showTestimonial,r=void 0===o||o,l=t.showImage,c=void 0===l||l,s=t.showName,u=void 0===s||s,b=t.showPosition,p=void 0===b||b;return Object(i.applyFilters)("stackable.testimonial.show",{columnBackground:"plain"!==a,borderRadius:"plain"!==a,border:"plain"!==a&&"bubble"!==a,shadow:"plain"!==a,imageAsBackground:!1,testimonialSpacing:r,imageSpacing:c&&!["background","vertical","vertical-inverse"].includes(a),nameSpacing:u,positionSpacing:p},e)},N=n(14),M=n.n(N);function R(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(B)),paddingBottom:t("columnPaddingBottom","%s".concat(B)),paddingRight:t("columnPaddingRight","%s".concat(B)),paddingLeft:t("columnPaddingLeft","%s".concat(B))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(P)),paddingRight:t("tabletColumnPaddingRight","%s".concat(P)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(P)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(P))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(F)),paddingRight:t("mobileColumnPaddingRight","%s".concat(F)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(F)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(F))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-testimonial__item":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(B)),paddingBottom:t("columnPaddingBottom","%s".concat(B)),paddingRight:t("columnPaddingRight","%s".concat(B)),paddingLeft:t("columnPaddingLeft","%s".concat(B))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-testimonial__item":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(P)),paddingRight:t("tabletColumnPaddingRight","%s".concat(P)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(P)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(P))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-testimonial__item":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(F)),paddingRight:t("mobileColumnPaddingRight","%s".concat(F)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(F)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(F))})}}});var z=e.attributes,L=z.testimonialColor,U=void 0===L?"":L,H=z.showTestimonial;(void 0===H||H)&&x.push({".ugb-testimonial__body":D({},Object(s.K)("testimonial%s","desktop",e.attributes,{important:!0}),{color:Object(s.c)(Object(s.wb)(U,(n.columnBackground||"background"===r)&&b)),textAlign:Object(s.c)(t("testimonialAlign")||t("contentAlign"))}),tablet:{".ugb-testimonial__body":D({},Object(s.K)("testimonial%s","tablet",e.attributes,{important:!0}),{textAlign:Object(s.c)(t("testimonialTabletAlign")||t("mobileTabletAlign"))})},mobile:{".ugb-testimonial__body":D({},Object(s.K)("testimonial%s","mobile",e.attributes,{important:!0}),{textAlign:Object(s.c)(t("testimonialMobileAlign")||t("mobileContentAlign"))})}}),!n.imageAsBackground&&m?(x.push(D({},Object(s.B)("image%s","ugb-img",e.attributes,{inherit:!1}))),x.push({desktopTablet:I({},".ugb-testimonial__image",{width:Object(s.c)(t("imageWidth","%spx"))}),tabletOnly:I({},".ugb-testimonial__image",{width:Object(s.c)(t("imageTabletWidth","%spx"))}),mobile:I({},".ugb-testimonial__image",{width:Object(s.c)(t("imageMobileWidth","%spx"))})}),x.push({".ugb-img, .ugb-testimonial__image":{marginLeft:""!==d||""!==h?Object(s.hb)(d||h)+" !important":void 0,marginRight:""!==d||""!==h?Object(s.ib)(d||h)+" !important":void 0},tablet:{".ugb-img, .ugb-testimonial__image":{marginLeft:""!==y||""!==w?Object(s.hb)(y||w)+" !important":void 0,marginRight:""!==y||""!==w?Object(s.ib)(y||w)+" !important":void 0}},mobile:{".ugb-img, .ugb-testimonial__image":{marginLeft:""!==j||""!==C?Object(s.hb)(j||C)+" !important":void 0,marginRight:""!==j||""!==C?Object(s.ib)(j||C)+" !important":void 0}}})):m&&Object(a.range)(1,c+1).forEach(function(e){x.push(I({},".ugb-testimonial__item.ugb-testimonial__item".concat(e," .ugb-testimonial__image"),{backgroundImage:t("image".concat(e,"Url"),"url(%s)")}))});var W=e.attributes,G=W.nameColor,V=void 0===G?"":G,q=W.showName;(void 0===q||q)&&x.push({".ugb-testimonial__name":D({},Object(s.K)("name%s","desktop",e.attributes),{color:Object(s.c)(Object(s.wb)(V,(n.columnBackground||"background"===r)&&b)),textAlign:t("nameAlign")||t("contentAlign")}),tablet:{".ugb-testimonial__name":D({},Object(s.K)("name%s","tablet",e.attributes),{textAlign:t("nameTabletAlign")||t("mobileTabletAlign")})},mobile:{".ugb-testimonial__name":D({},Object(s.K)("name%s","mobile",e.attributes),{textAlign:t("nameMobileAlign")||t("mobileContentAlign")})}});var K=e.attributes,J=K.positionColor,Y=void 0===J?"":J,X=K.showPosition;return(void 0===X||X)&&x.push({".ugb-testimonial__position":D({},Object(s.K)("position%s","desktop",e.attributes,{importantSize:!0}),{color:Object(s.c)(Object(s.wb)(Y,(n.columnBackground||"background"===r)&&b)),textAlign:t("positionAlign")||t("contentAlign")}),tablet:{".ugb-testimonial__position":D({},Object(s.K)("position%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("positionTabletAlign")||t("mobileTabletAlign")})},mobile:{".ugb-testimonial__position":D({},Object(s.K)("position%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("positionMobileAlign")||t("mobileContentAlign")})}}),n.testimonialSpacing&&("bubble"!==r?x.push.apply(x,R(Object(s.F)(".ugb-testimonial__body","testimonial%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))):x.push.apply(x,R(Object(s.F)(".ugb-testimonial__body-wrapper","testimonial%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0})))),n.imageSpacing&&x.push.apply(x,R(Object(s.F)(".ugb-testimonial__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.nameSpacing&&x.push.apply(x,R(Object(s.F)(".ugb-testimonial__name","name%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.positionSpacing&&x.push.apply(x,R(Object(s.F)(".ugb-testimonial__position","position%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),M.a.all(x)},L=n(3),U=n(10),H=n(6),W=n(12),G=n(13);function V(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)){for(var t=0,n=new Array(e.length);t1,reverseTitle:"plain"!==a,titleSpacing:c,subtitleSpacing:u},e)},s=n(14),u=n.n(s);function b(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-text__text-wrapper":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-text__text-wrapper":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-text__text-wrapper":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}}});var f=e.attributes.showColumnRule;void 0!==f&&f&&a.push({".ugb-text__rule":Object(l.d)({background:t("columnRuleColor"),width:t("columnRuleWidth","%spx"),height:t("columnRuleHeight","%s%")})});var h=e.attributes.showTitle;(void 0===h||h)&&a.push({".ugb-text__title-wrapper":{justifyContent:Object(l.c)(t("titleVerticalAlign"))},".ugb-text__title":m({color:t("titleColor")},Object(l.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-text__title":m({},Object(l.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-text__title":m({},Object(l.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}});var v=e.attributes.showSubtitle;return(void 0===v||v)&&a.push({".ugb-text__subtitle":m({},Object(l.K)("subtitle%s","desktop",e.attributes),{color:t("subtitleColor"),textAlign:t("subtitleAlign")}),tablet:{".ugb-text__subtitle":m({},Object(l.K)("subtitle%s","tablet",e.attributes),{textAlign:t("subtitleTabletAlign")})},mobile:{".ugb-text__subtitle":m({},Object(l.K)("subtitle%s","mobile",e.attributes),{textAlign:t("subtitleMobileAlign")})}}),a.push({".ugb-text__text p":m({},Object(l.K)("text%s","desktop",e.attributes),{color:t("textColor"),textAlign:t("textAlign")}),tablet:{".ugb-text__text p":m({},Object(l.K)("text%s","tablet",e.attributes),{textAlign:t("textTabletAlign")})},mobile:{".ugb-text__text p":m({},Object(l.K)("text%s","mobile",e.attributes),{textAlign:t("textMobileAlign")})}}),n.titleSpacing&&a.push.apply(a,b(Object(l.F)(".ugb-text__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.subtitleSpacing&&a.push.apply(a,b(Object(l.F)(".ugb-text__subtitle","subtitle%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),a.push.apply(a,b(Object(l.F)(".ugb-text__text","text%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.a.all(a)},f=n(380),h=n.n(f),v=n(381),y=n.n(v),O=n(382),w=n.n(O),_=n(3),j=n(10),k=n(8),C=n.n(k),x=n(11),E=n(0),S=n(6),B=n(12),T=n(9);function P(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t \*:nth-child\((\d)\) .ugb-button--inner/g,".ugb-button-wrapper .ugb-button$1 .ugb-button--inner").replace(/.ugb-button-wrapper > \*:nth-child\((\d)\) .ugb-button([^-])/g,".ugb-button-wrapper .ugb-button$1$2")};return g({},e,{showButton2:!!e.buttons&&e.buttons>=2,showButton3:!!e.buttons&&e.buttons>=3,design:"full"===e.align?"fullwidth":void 0,columns:void 0,contentAlign:"full"!==e.align?e.align:void 0,align:void 0,cornerButtonRadius:void 0,button1Url:e.url,button1NewTab:e.newTab,button1Text:e.text,button1BackgroundColor:e.color,button1TextColor:e.textColor,button1Size:e.size,button1BorderRadius:e.cornerButtonRadius,button1Design:e.design,button1Icon:e.icon,url:void 0,newTab:void 0,text:void 0,color:void 0,textColor:void 0,size:void 0,icon:void 0,button2Url:e.url2,button2NewTab:e.newTab2,button2Text:e.text2,button2BackgroundColor:e.color2,button2TextColor:e.textColor2,button2Size:e.size2,button2BorderRadius:e.cornerButtonRadius,button2Design:e.design2,button2Icon:e.icon2,url2:void 0,newTab2:void 0,text2:void 0,color2:void 0,textColor2:void 0,size2:void 0,design2:void 0,icon2:void 0,button3Url:e.url3,button3NewTab:e.newTab3,button3Text:e.text3,button3BackgroundColor:e.color3,button3TextColor:e.textColor3,button3Size:e.size3,button3BorderRadius:e.cornerButtonRadius,button3Design:e.design3,button3Icon:e.icon3,url3:void 0,newTab3:void 0,text3:void 0,color3:void 0,textColor3:void 0,size3:void 0,design3:void 0,icon3:void 0,customCSS:t(e.customCSS),customCSSCompiled:t(e.customCSSCompiled)})},y=[{attributes:g({},f,{textColor2:{type:"string"},textColor3:{type:"string"}}),save:h,migrate:v},{attributes:f,save:h,migrate:v}],O=n(3),w=n(10),_=n(14),j=n.n(_);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function C(e){for(var t=1;t2,noPaddings:"full"===l},e)},g=function(e,t){return"grid"===t?e<=5?2:e<=7?3:4:"uneven"===t?e<=3?2:3:"uneven-2"===t?e<=3?2:4===e?3:4:"tiled"===t?e<=3?2:4===e?3:5===e?4:5:e};function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > .ugb-columns__item":{gridTemplateColumns:k.every(function(e){return"1.00fr"===e})?void 0:Object(s.c)(k.join(" "))},tablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-columns__item":{gridTemplateColumns:l("tabletColumns1")&&!C.every(function(e){return"1.00fr"===e})?Object(s.c)(C.join(" ")):void 0}},editor:{"> .ugb-inner-block > .ugb-block-content > .ugb-columns__item > .block-editor-inner-blocks > .block-editor-block-list__layout":{gridTemplateColumns:k.every(function(e){return"1.00fr"===e})?void 0:Object(s.c)(k.join(" "))},tablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-columns__item > .block-editor-inner-blocks > .block-editor-block-list__layout":{gridTemplateColumns:l("tabletColumns1")&&!C.every(function(e){return"1.00fr"===e})?Object(s.c)(C.join(" ")):void 0}}}});var x=e.attributes.noPaddings,E=void 0===x?"":x;_.noPaddings&&E&&c.push({"":{paddingLeft:Object(s.c)(0),paddingRight:Object(s.c)(0)}});var S=e.attributes,B=S.height,T=void 0===B?"":B,P=S.tabletHeight,A=void 0===P?"":P,N=S.mobileHeight,M=void 0===N?"":N;c.push((f(t={},".".concat(w,"-content-wrapper"),{minHeight:"half"===T?"50vh !important":"full"===T?"100vh !important":"custom"===T?Object(s.c)(l("heightNum","%s"+l("heightNumUnit","%s","px"))):void 0}),f(t,"tablet",f({},".".concat(w,"-content-wrapper"),{minHeight:"half"===A?"50vh !important":"full"===A?"100vh !important":"custom"===A?Object(s.c)(l("tabletHeightNum","%s"+l("tabletHeightNumUnit","%s","px"))):void 0})),f(t,"mobile",f({},".".concat(w,"-content-wrapper"),{minHeight:"half"===M?"50vh !important":"full"===M?"100vh !important":"custom"===M?Object(s.c)(l("mobileHeightNum","%s"+l("mobileHeightNumUnit","%s","px"))):void 0})),t)),c.push.apply(c,d(Object(s.F)(".".concat(w,"-content-wrapper > .ugb-column"),"%sColumnVerticalAlign","alignItems","%s",e.attributes,{important:!0}))),c.push.apply(c,d(Object(s.F)(".".concat(w,"-content-wrapper > .ugb-column > .ugb-inner-block"),"%sColumnVerticalAlign","height","auto",e.attributes,{important:!0})));var R=e.attributes,F=R.columnVerticalAlign,D=void 0===F?"":F,I=R.tabletColumnVerticalAlign,z=void 0===I?"":I,L=R.mobileColumnVerticalAlign,U=void 0===L?"":L,H=".".concat(w,"-content-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-editor-block-list__block");return c.push({editor:(i={},f(i,"".concat(H," > .ugb-column"),{height:Object(s.c)(D&&"stretch"!==D?"auto":void 0)}),f(i,H,{justifyContent:l("columnVerticalAlign")}),f(i,"tablet",(n={},f(n,"".concat(H," > .ugb-column"),{height:Object(s.c)(z&&"stretch"!==z?"auto":void 0)}),f(n,H,{justifyContent:l("tabletColumnVerticalAlign")}),n)),f(i,"mobile",(a={},f(a,"".concat(H," > .ugb-column"),{height:Object(s.c)(U&&"stretch"!==U?"auto":void 0)}),f(a,H,{justifyContent:l("mobileColumnVerticalAlign")}),a)),i)}),c.push((f(r={},"h1, h2, h3, h4, h5, h6",{color:l("headingColor")}),f(r,"p, li, label, table",{color:l("bodyTextColor")}),f(r,"a, a:visited, a:focus",{color:l("linkColor")}),f(r,"a:hover",{color:l("linkHoverColor")}),r)),b.a.all(c)},v=n(303),y=n.n(v),O=n(304),w=n.n(O),_=n(305),j=n.n(_),k=n(306),C=n.n(k),x=n(307),E=n.n(x),S=n(3),B=n(10),T=n(8),P=n.n(T),A=n(11),N=n(0),M=n(6),R=n(9),F=n(12),D=n(17);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function z(e){for(var t=1;t6&&(n=6);var a=Object(l.select)("core/block-editor").getBlock(t.clientId).innerBlocks,i=Object(o.range)(n||2).map(function(e){return a[e]||Object(D.createBlock)("ugb/column",{},[])});return Object(l.dispatch)("core/block-editor").replaceInnerBlocks(t.clientId,i,!1),e});var W=Object(F.compose)(Object(F.withState)({sortColumnHighlight:null}),B.i,B.g,B.d,Object(B.h)(),Object(B.c)(),Object(B.a)(h,{editorMode:!0}))(function(e){var t=e.className,n=e.sortColumnHighlight,a=e.attributes,i=a.design,r=void 0===i?"plain":i,l=a.columns,c=void 0===l?2:l,s=a.reverseColumns,u=void 0===s?"":s,b=a.uniqueClass,g=void 0===b?"":b,d=m(e),f=P()([t,"ugb-columns--design-".concat(r),"ugb-columns--columns-".concat(c)],Object(p.applyFilters)("stackable.columns.mainclasses",L({"ugb-columns--reverse":d.reverseColumns&&u},"ugb-columns--highlight-".concat(n+1),null!==n),e)),h=P()(["ugb-columns__item","".concat(g,"-content-wrapper")]),v=Object(o.range)(c).map(function(){return["ugb/column"]});return wp.element.createElement(S.k.Edit,{className:f,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement("div",{className:h},wp.element.createElement(R.InnerBlocks,{templateLock:"all",template:v,allowedBlocks:["ugb/column"]})))}})}),G=Object(F.compose)(B.i,Object(B.a)(h))(function(e){var t=e.className,n=e.attributes,a=n.design,i=void 0===a?"plain":a,o=n.columns,r=void 0===o?3:o,l=n.reverseColumns,c=void 0===l?"":l,s=n.uniqueClass,u=void 0===s?"":s,b=m(e),g=P()([t,"ugb-columns--design-".concat(i),"ugb-columns--columns-".concat(r)],Object(p.applyFilters)("stackable.columns.mainclasses",{"ugb-columns--reverse":b.reverseColumns&&c},e)),d=P()(["ugb-columns__item","".concat(u,"-content-wrapper")]);return wp.element.createElement(S.k.Save,{className:g,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement("div",{className:d},wp.element.createElement(R.InnerBlocks.Content,null)))}})});function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(e){for(var t=1;t6&&(e.columns=6),e}),Object(p.addFilter)("stackable.columns.setAttributes","stackable/columns/design",function(e,t){if(void 0===e.design)return e;var n=t.attributes;return"plain"!==e.design&&n.columns<4&&(e.columns=4),e})},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(1),o=n(8),r=n.n(o),l=n(4),c=n(9);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=[{attributes:{textColor:{type:"string"},contentAlign:{type:"string",default:""},backgroundColorType:{type:"string",default:""},backgroundColor:{type:"string",default:"#f1f1f1"},backgroundColor2:{type:"string",default:""},backgroundColorDirection:{type:"number",default:0},backgroundType:{type:"string",default:""},backgroundImageID:{type:"number"},backgroundImageURL:{type:"string"},backgroundOpacity:{type:"number",default:5},fixedBackground:{type:"boolean",default:!1},height:{type:"string",default:"normal"},contentWidth:{type:"boolean",default:!1},contentLocation:{type:"string",default:"full"},verticalAlign:{type:"string",default:"center"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},align:{type:"string"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},save:function(e){var t,n=e.className,a=e.attributes,i=a.contentAlign,o=a.textColor,s=a.backgroundColorType,b=void 0===s?"":s,p=a.backgroundColor,m=a.backgroundColor2,g=a.backgroundColorDirection,d=void 0===g?0:g,f=a.backgroundType,h=void 0===f?"":f,v=a.backgroundImageURL,y=a.backgroundOpacity,O=a.fixedBackground,w=a.height,_=a.contentLocation,j=a.verticalAlign,k=a.contentWidth,C=a.borderRadius,x=void 0===C?12:C,E=a.shadow,S=void 0===E?3:E,B=a.design,T=void 0===B?"":B,P=r()([n,"ugb-container","ugb--background-opacity-"+1*Math.round(y/1)],Object(l.applyFilters)("stackable.container.mainclasses_1_17_3",(u(t={},"ugb-container--content-".concat(i),i),u(t,"ugb--has-background",p&&"transparent"!==p||v),u(t,"ugb--has-background-image",v),u(t,"ugb-container--height-".concat(w),w),u(t,"ugb-container--align-horizontal-".concat(_),_),u(t,"ugb--content-width",k),u(t,"ugb--shadow-".concat(S),3!==S),u(t,"ugb--has-background-gradient","gradient"===b),u(t,"ugb--has-background-video","video"===h),t),T,e)),A={"--ugb-text-color":o||void 0,backgroundColor:p||void 0,backgroundImage:v?"url(".concat(v,")"):void 0,backgroundAttachment:O?"fixed":void 0,"--ugb-background-color":v||"gradient"===b?p:void 0,"--ugb-background-color2":"gradient"===b&&m?m:void 0,"--ugb-background-direction":"gradient"===b?"".concat(d,"deg"):void 0,"justify-content":"full"!==w&&"half"!==w||!j?void 0:j,borderRadius:12!==x?x:void 0};return wp.element.createElement("div",{className:P,style:A},"video"===h&&wp.element.createElement("video",{className:"ugb-video-background",autoPlay:!0,muted:!0,loop:!0,src:v}),Object(l.applyFilters)("stackable.container.save.output.before_1_17_3",null,T,e),wp.element.createElement("div",{className:"ugb-container__wrapper"},wp.element.createElement("div",{className:"ugb-container__content-wrapper"},wp.element.createElement(c.InnerBlocks.Content,null))),Object(l.applyFilters)("stackable.container.save.output.after_1_17_3",null,T,e))},migrate:function(e){var t=function(e){return(e||"").replace(/\.ugb-container(\s*\{)/g,".ugb-container__wrapper$1")};return function(e){for(var t=1;t .ugb-video-background, ")+".".concat(f,"-wrapper.ugb-container__wrapper:before"),{borderRadius:u("borderRadius","%spx !important")||"12px !important"})),s));y.border&&b.push(h({},Object(p.p)("column%s",".".concat(f,"-wrapper.ugb-container__wrapper"),e.attributes))),b.push({saveOnly:{"> .ugb-inner-block > .ugb-block-content > *":{justifyContent:Object(p.c)(u("columnContentVerticalAlign"))},tablet:{"> .ugb-inner-block > .ugb-block-content > *":{justifyContent:Object(p.c)(u("tabletColumnContentVerticalAlign"))}},mobile:{"> .ugb-inner-block > .ugb-block-content > *":{justifyContent:Object(p.c)(u("mobileColumnContentVerticalAlign"))}}},editor:{"> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper":{justifyContent:Object(p.c)(u("columnContentVerticalAlign"))},tablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper":{justifyContent:Object(p.c)(u("tabletColumnContentVerticalAlign"))}},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper":{justifyContent:Object(p.c)(u("mobileColumnContentVerticalAlign"))}}}});var O=e.attributes,w=O.height,_=void 0===w?"":w,j=O.tabletHeight,k=void 0===j?"":j,C=O.mobileHeight,x=void 0===C?"":C;b.push((v(a={},".".concat(f,"-wrapper > .ugb-container__side"),{paddingTop:"short"===_?"35px !important":"tall"===_?"120px !important":void 0,paddingBottom:"short"===_?"35px !important":"tall"===_?"120px !important":void 0}),v(a,".".concat(f,"-wrapper.ugb-container__wrapper"),{minHeight:"half"===_?"50vh":"full"===_?"100vh":void 0,paddingTop:"short"===_||"tall"===_?"0 !important":void 0,paddingBottom:"short"===_||"tall"===_?"0 !important":void 0}),v(a,"tablet",(v(t={},".".concat(f,"-wrapper > .ugb-container__side"),{paddingTop:"short"===k?"35px !important":"tall"===k?"120px !important":void 0,paddingBottom:"short"===k?"35px !important":"tall"===k?"120px !important":void 0}),v(t,".".concat(f,"-wrapper.ugb-container__wrapper"),{minHeight:"half"===k?"50vh":"full"===k?"100vh":void 0,paddingTop:"short"===k||"tall"===k?"0 !important":void 0,paddingBottom:"short"===k||"tall"===k?"0 !important":void 0}),t)),v(a,"mobile",(v(n={},".".concat(f,"-wrapper > .ugb-container__side"),{paddingTop:"short"===x?"35px !important":"tall"===x?"120px !important":void 0,paddingBottom:"short"===x?"35px !important":"tall"===x?"120px !important":void 0}),v(n,".".concat(f,"-wrapper.ugb-container__wrapper"),{minHeight:"half"===x?"50vh":"full"===x?"100vh":void 0,paddingTop:"short"===x||"tall"===x?"0 !important":void 0,paddingBottom:"short"===x||"tall"===x?"0 !important":void 0}),n)),a));var E=_&&("half"===_||"full"===_),S=k&&("half"===k||"full"===k),B=x&&("half"===x||"full"===x);E&&b.push(v({},".".concat(f,"-wrapper > .ugb-container__side"),{justifyContent:u("contentVerticalAlign")})),(E||S)&&b.push({tablet:v({},".".concat(f,"-wrapper > .ugb-container__side"),{justifyContent:u("contentTabletVerticalAlign")})}),(E||S||B)&&b.push({mobile:v({},".".concat(f,"-wrapper > .ugb-container__side"),{justifyContent:u("contentMobileVerticalAlign")})}),b.push({desktopTablet:v({},".".concat(f,"-content-wrapper.ugb-container__content-wrapper"),{width:Object(p.c)(u("contentWidth","%s%"))}),tabletOnly:v({},".".concat(f,"-content-wrapper.ugb-container__content-wrapper"),{width:Object(p.c)(u("contentTabletWidth","%s%"))}),mobile:v({},".".concat(f,"-content-wrapper.ugb-container__content-wrapper"),{width:Object(p.c)(u("contentMobileWidth","%s%"))})}),b.push((v(i={},".".concat(f,"-wrapper > .ugb-container__side"),{alignItems:Object(p.c)(u("contentHorizontalAlign"))}),v(i,"tablet",v({},".".concat(f,"-wrapper > .ugb-container__side"),{alignItems:Object(p.c)(u("contentTabletHorizontalAlign"))})),v(i,"mobile",v({},".".concat(f,"-wrapper > .ugb-container__side"),{alignItems:Object(p.c)(u("contentMobileHorizontalAlign"))})),i));b.push(h({},y.columnBackground?Object(p.m)("column%s","".concat(f,"-wrapper.ugb-container__wrapper"),e.attributes,{importantBackgroundColor:!0}):{}));var T=e.attributes,P=T.columnBackgroundColor,A=void 0===P?"":P,N=T.headingColor,M=void 0===N?"":N,R=T.bodyTextColor,F=void 0===R?"":R;b.push((v(o={},"h1, h2, h3, h4, h5, h6",{color:u("headingColor")}),v(o,"p, li, label, table",{color:u("bodyTextColor")}),v(o,"a, a:visited, a:focus",{color:u("linkColor")}),v(o,"a:hover",{color:u("linkHoverColor")}),o));var D=e.attributes,I=D.columnPaddingUnit,z=void 0===I?"px":I,L=D.tabletColumnPaddingUnit,U=void 0===L?"px":L,H=D.mobileColumnPaddingUnit,W=void 0===H?"px":H,G=Object(l.applyFilters)("stackable.container.spacing-paddings.selector","> .ugb-inner-block > .ugb-block-content > *",e),V=Object(l.applyFilters)("stackable.container.spacing-paddings.selector","> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper",e);return b.push({saveOnly:{desktopTablet:v({},G,Object(p.d)({paddingTop:u("columnPaddingTop","%s".concat(z)),paddingBottom:u("columnPaddingBottom","%s".concat(z)),paddingRight:u("columnPaddingRight","%s".concat(z)),paddingLeft:u("columnPaddingLeft","%s".concat(z))})),tabletOnly:v({},G,Object(p.d)({paddingTop:u("tabletColumnPaddingTop","%s".concat(U)),paddingRight:u("tabletColumnPaddingRight","%s".concat(U)),paddingBottom:u("tabletColumnPaddingBottom","%s".concat(U)),paddingLeft:u("tabletColumnPaddingLeft","%s".concat(U))})),mobile:v({},G,Object(p.d)({paddingTop:u("mobileColumnPaddingTop","%s".concat(W)),paddingRight:u("mobileColumnPaddingRight","%s".concat(W)),paddingBottom:u("mobileColumnPaddingBottom","%s".concat(W)),paddingLeft:u("mobileColumnPaddingLeft","%s".concat(W))}))},editor:{desktopTablet:v({},V,Object(p.d)({paddingTop:u("columnPaddingTop","%s".concat(z)),paddingBottom:u("columnPaddingBottom","%s".concat(z)),paddingRight:u("columnPaddingRight","%s".concat(z)),paddingLeft:u("columnPaddingLeft","%s".concat(z))})),tabletOnly:v({},V,Object(p.d)({paddingTop:u("tabletColumnPaddingTop","%s".concat(U)),paddingRight:u("tabletColumnPaddingRight","%s".concat(U)),paddingBottom:u("tabletColumnPaddingBottom","%s".concat(U)),paddingLeft:u("tabletColumnPaddingLeft","%s".concat(U))})),mobile:v({},V,Object(p.d)({paddingTop:u("mobileColumnPaddingTop","%s".concat(W)),paddingRight:u("mobileColumnPaddingRight","%s".concat(W)),paddingBottom:u("mobileColumnPaddingBottom","%s".concat(W)),paddingLeft:u("mobileColumnPaddingLeft","%s".concat(W))}))}}),b.push((v(c={},".".concat(f,"-content-wrapper > h1, ")+".".concat(f,"-content-wrapper > h2, ")+".".concat(f,"-content-wrapper > h3, ")+".".concat(f,"-content-wrapper > h4, ")+".".concat(f,"-content-wrapper > h5, ")+".".concat(f,"-content-wrapper > h6"),{color:Object(p.wb)(M,y.columnBackground&&A)}),v(c,".".concat(f,"-content-wrapper > p, ")+".".concat(f,"-content-wrapper > ol li, ")+".".concat(f,"-content-wrapper > ul li"),{color:Object(p.wb)(F,y.columnBackground&&A)}),v(c,"editor",(v(r={},".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h1, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h2, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h3, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h4, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h5, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h6'),{color:Object(p.wb)(M,y.columnBackground&&A)}),v(r,".".concat(f,'-content-wrapper > * > * [data-type*="core/paragraph"] p, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/list"] li'),{color:Object(p.wb)(F,y.columnBackground&&A)}),r)),c)),g.a.all(b)},O=n(308),w=n.n(O),_=n(309),j=n.n(_),k=n(310),C=n.n(k),x=n(311),E=n.n(x),S=n(312),B=n.n(S),T=n(3),P=n(10),A=n(11),N=n(0),M=n(6),R=n(12),F=n(13);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 I(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0}}),Object(F.withSelect)(function(e,t){Object(p.f)(t.attributes.imageId,e)}))(function(e){var t,n=e.className,a=e.attributes,i=a.design,o=void 0===i?"basic":i,s=a.shadow,u=void 0===s?"":s,b=a.restrictContentWidth,p=void 0!==b&&b,m=a.uniqueClass,g=void 0===m?"":m,f=d(e),h=r()([n,"ugb-container--v2","ugb-container--design-".concat(o)],Object(l.applyFilters)("stackable.container.mainclasses",{},e)),v=r()(["ugb-container__wrapper","".concat(g,"-wrapper")],Object(l.applyFilters)("stackable.container.wrapperClasses",(D(t={},"ugb--shadow-".concat(u),f.columnBackground&&""!==u),D(t,"ugb--restrict-content-width",f.restrictContent&&p),t),e)),y=r()(["ugb-container__content-wrapper","".concat(g,"-content-wrapper")],{"ugb-content-wrapper":f.restrictContent&&p});return wp.element.createElement(T.k.Edit,{className:h,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement(T.G,{className:v,backgroundAttrName:"column%s",blockProps:e,showBackground:f.columnBackground},Object(l.applyFilters)("stackable.container.edit.wrapper.output",null,e),wp.element.createElement("div",{className:"ugb-container__side"},wp.element.createElement("div",{className:y},wp.element.createElement(c.InnerBlocks,{templateLock:!1,renderAppender:function(){return e.hasInnerBlocks?wp.element.createElement(c.InnerBlocks.DefaultBlockAppender,null):wp.element.createElement(c.InnerBlocks.ButtonBlockAppender,null)}})))))}})});function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U=Object(R.compose)(P.i,Object(P.a)(y))(function(e){var t,n=e.className,a=e.attributes,i=a.design,o=void 0===i?"":i,s=a.shadow,u=void 0===s?"":s,b=a.restrictContentWidth,p=void 0!==b&&b,m=a.uniqueClass,g=void 0===m?"":m,f=d(e),h=r()([n,"ugb-container--v2","ugb-container--design-".concat(o)],Object(l.applyFilters)("stackable.container.mainclasses",{},e)),v=r()(["ugb-container__wrapper","".concat(g,"-wrapper")],Object(l.applyFilters)("stackable.container.wrapperClasses",(L(t={},"ugb--shadow-".concat(u),f.columnBackground&&""!==u),L(t,"ugb--restrict-content-width",f.restrictContent&&p),t),e)),y=r()(["ugb-container__content-wrapper","".concat(g,"-content-wrapper")],{"ugb-content-wrapper":f.restrictContent&&p});return wp.element.createElement(T.k.Save,{className:h,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement(T.G,{className:v,backgroundAttrName:"column%s",blockProps:e,showBackground:f.columnBackground},Object(l.applyFilters)("stackable.container.save.wrapper.output",null,e),wp.element.createElement("div",{className:"ugb-container__side"},wp.element.createElement("div",{className:y},wp.element.createElement(c.InnerBlocks.Content,null)))))}})});function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var G=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e;if(e||(n=v),"string"==typeof e&&2===e.split("-").length){var a=e.split("-"),i=h(a,2),o=i[0],r=i[1];n=Object(p.O)(o,r)}var l=y(n);if(l){var c=l.querySelectorAll("*");t&&(c.forEach(function(e){e&&!["DEFS","TITLE","DESC"].includes(e.tagName)&&(e.setAttribute("fill",t),e.setAttribute("stroke",t),e.style.fill=t,e.style.stroke=t)}),l.setAttribute("style","fill: ".concat(t," !important; color: ").concat(t," !important")));var s=(new XMLSerializer).serializeToString(l);return window.btoa(s)}},w=n(14),_=n.n(w);function j(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1||h&&h>1||O&&O>1)&&wp.element.createElement(T.ToggleControl,{label:Object(m.__)("Display as a grid (left to right & evenly spaced)",o.i18n),checked:p,onChange:function(e){return n({displayAsGrid:e})},className:"ugb--help-tip-icon-list-grid"}),wp.element.createElement(s.x,{setAttributes:n,blockAttributes:t.attributes})),wp.element.createElement(s.gb,{initialOpen:!1,blockProps:t},wp.element.createElement(s.c,{label:Object(m.__)("List Gap",o.i18n),value:l,onChange:function(e){return n({gap:e})},min:0,max:30,allowReset:!0,placeholder:"16",className:"ugb--help-tip-icon-list-gap"})),wp.element.createElement(s.fb,{title:Object(m.__)("Icon",o.i18n),initialOpen:!1},wp.element.createElement(s.N,{label:Object(m.__)("Icon",o.i18n),value:i||v,onChange:function(e){return n({icon:e})},help:Object(m.__)("You can click on each icon in the Icon List block to change them individually.",o.i18n)}),wp.element.createElement(s.y,null),wp.element.createElement(s.u,{label:Object(m.__)("Icon Color",o.i18n),value:r,onChange:function(e){return n({iconColor:e})}}),wp.element.createElement(s.y,null),wp.element.createElement(s.kb,{attrNameTemplate:"icon%sSize",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(s.c,{label:Object(m.__)("Icon Size",o.i18n),min:0,max:50,allowReset:!0,placeholder:"20"})),wp.element.createElement(s.c,{label:Object(m.__)("Icon Opacity",o.i18n),value:_,min:0,max:1,step:.1,onChange:function(e){return n({opacity:e})},allowReset:!0,placeholder:"1.0"}),wp.element.createElement(s.c,{label:Object(m.__)("Icon Rotation",o.i18n),value:k,min:0,max:360,onChange:function(e){return n({rotation:e})},allowReset:!0,placeholder:"0"})),wp.element.createElement(s.fb,{title:Object(m.__)("List Text",o.i18n),id:"text",initialOpen:!1},wp.element.createElement(s.vb,{attrNameTemplate:"listText%s",setAttributes:n,blockAttributes:t.attributes}),wp.element.createElement(s.u,{value:u,onChange:function(e){return n({listTextColor:e})},label:Object(m.__)("Color",o.i18n)})))});var R=Object(P.compose)(c.i,c.g,c.d,S.withTransformOldIconAttributes,Object(c.h)(),Object(c.c)(),Object(c.a)(E,{editorMode:!0}),Object(c.b)([["ul, ul li","text"]]))(function(e){var t,n,a,i,l,c,u,p,g=e.className,d=e.setAttributes,f=e.isSelected,h=e.attributes,v=h.text,y=h.design,O=void 0===y?"":y,w=h.displayAsGrid,_=void 0!==w&&w,j=b()([g,"ugb-icon-list--v2",(t=e.attributes,n=t.contentAlign,a=t.tabletContentAlign,i=t.mobileContentAlign,l=Object(A.select)("core/edit-post").__experimentalGetPreviewDeviceType,c={},u=l?l():"Desktop",p=("Desktop"===u?n:"Tablet"===u?a:i)||"left",c["ugb-icon-list__".concat(p,"-align")]=p,c)],Object(r.applyFilters)("stackable.icon-list.mainclasses",{"ugb-icon-list--display-grid":_},O,e)),k=Object(B.createRef)(),C=Object(A.select)("core/block-editor").isTyping(),x=M(Object(B.useState)(!1),2),E=x[0],S=x[1],T=M(Object(B.useState)(null),2),P=T[0],R=T[1],F=M(Object(B.useState)(null),2),D=F[0],I=F[1],z=M(Object(B.useState)(null),2),L=z[0],U=z[1],H=function(t){if(U(t),"LI"!==t.target.tagName)return S(!1);var n=Object(A.select)("core/edit-post").__experimentalGetPreviewDeviceType,a=n?n():"Desktop",i=("Desktop"===a?e.attributes.iconSize:"Tablet"===a?e.attributes.iconTabletSize||e.attributes.iconSize:e.attributes.iconMobileSize||e.attributes.iconTabletSize||e.attributes.iconSize)||20;if(t.offsetX<=i+21){var o=Array.from(t.target.parentElement.children).indexOf(t.target)+1,r=t.target.parentElement.currentlyOpenIndex;return r&&r===o?(t.target.parentElement.currentlyOpenIndex=void 0,S(!1)):(t.target.parentElement.currentlyOpenIndex=o,I(o),R(t.target),S(!0))}return t.target.parentElement.currentlyOpenIndex=void 0,R(null),S(!1)};return Object(B.useEffect)(function(){return k.current.addEventListener("click",H),function(){k.current&&k.current.removeEventListener("click",H)}},[]),Object(B.useEffect)(function(){f||(S(!1),L&&(L.target.parentElement.currentlyOpenIndex=void 0))},[f]),wp.element.createElement(s.k.Edit,{className:j,blockProps:e,render:function(){return wp.element.createElement(B.Fragment,null,wp.element.createElement("div",{ref:k},wp.element.createElement(N.RichText,{tagName:"ul",multiline:"li",value:v,onChange:function(e){return d({text:e})},placeholder:Object(m.__)("Text for this block",o.i18n),keepPlaceholderOnFocus:!0}),!C&&f&&E&&wp.element.createElement(s.Q,{position:"bottom left",anchorRef:P,onClose:function(){L&&(L.target.parentElement.currentlyOpenIndex=void 0),S(!1)},onChange:function(e){var t,n,a;d((t={},n="icon".concat(D),a=e,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t))}})))}})}),F=Object(P.compose)(c.i,Object(c.a)(E))(function(e){var t=e.className,n=e.attributes,a=n.text,i=n.design,o=void 0===i?"":i,l=n.displayAsGrid,c=void 0!==l&&l,u=b()([t,"ugb-icon-list--v2"],Object(r.applyFilters)("stackable.icon-list.mainclasses",{"ugb-icon-list--display-grid":c},o,e));return wp.element.createElement(s.k.Save,{className:u,blockProps:e,render:function(){return wp.element.createElement(B.Fragment,null,wp.element.createElement(N.RichText.Content,{tagName:"ul",value:a}))}})});function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z=function(e){for(var t=1;t".concat(e,"")}).join("")},displayAsGrid:{type:"boolean",default:!1},gap:{type:"number",default:""},listTextColor:{type:"string",default:""},opacity:{type:"number",default:""},rotation:{type:"number",default:""}},Object(p.J)("listText%s"),{},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"icon%d",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;if(t<1)return null;var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return Object(m.sprintf)(e,t)},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return f({},"".concat(n(e)),{type:"string",default:""})},o={};return Object(i.range)(1,t+1).forEach(function(e){o=d({},o,{},a(e))}),o}());n.d(t,"name",function(){return L}),n.d(t,"settings",function(){return U});var L="ugb/icon-list",U={title:Object(m.__)("Icon List",o.i18n),description:Object(m.__)("An unordered list with icons. You can use this as a list of features or benefits.",o.i18n),icon:a.r,category:"common",keywords:[Object(m.__)("Icon List",o.i18n),Object(m.__)("Stackable",o.i18n)],attributes:z,supports:{inserter:!o.disabledBlocks.includes(L),anchor:!0},deprecated:l.default,edit:R,save:F,modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-responsive":!0,"block-background":!0,"block-separators":!0,"block-title":!0,"content-align":!0,"block-designs":!0,"custom-css":{default:Object(r.applyFilters)("stackable.icon-list.custom-css.default","")}}};Object(r.addFilter)("stackable.icon-list.setAttributes","stackable/icon-list/icon",function(e,t){return void 0===e.icon?e:(Object(i.range)(1,21).forEach(function(n){t.attributes["icon".concat(n)]&&(e["icon".concat(n)]=void 0)}),e)})},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(1),o=n(2),r=n(14),l=n.n(r),c=n(7),s=n(4),u=function(e){var t=e.attributes,n=t.design,a=void 0===n?"basic":n,i=t.align,o=void 0===i?"":i,r=t.showBlockBackground,l=void 0!==r&&r;return Object(s.applyFilters)("stackable.column.show",{columnBackground:"plain"!==a,borderRadius:"plain"!==a&&!(!l&&"full"===o),border:"plain"!==a},e)};function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function p(e){for(var t=1;t .ugb-video-background, ")+".".concat(f,"-wrapper:before"),{borderRadius:s("borderRadius","%spx !important")||"12px !important"})),r));g.border&&b.push(p({},Object(o.p)("column%s",".".concat(f,"-column-wrapper"),e.attributes)));b.push(p({},g.columnBackground?Object(o.m)("column%s","".concat(f,"-column-wrapper"),e.attributes,{importantBackgroundColor:!0}):{})),b.push({saveOnly:Object(c.first)(Object(o.F)("> .ugb-inner-block > .ugb-block-content > *","%sColumnContentVerticalAlign","justifyContent","%s",e.attributes,{important:!0})),editor:Object(c.first)(Object(o.F)("> .ugb-inner-block > .ugb-block-content > .ugb-column__item","%sColumnContentVerticalAlign","justifyContent","%s",e.attributes,{important:!0}))}),b.push((m(t={},".".concat(f,"-column-wrapper .ugb-column__content-wrapper"),{width:Object(o.c)(s("contentWidth","%s".concat(s("contentWidthUnit")||"%")))}),m(t,"tablet",m({},".".concat(f,"-column-wrapper .ugb-column__content-wrapper"),{width:Object(o.c)(s("contentTabletWidth","%s".concat(s("contentTabletWidthUnit")||"%")))})),m(t,"mobile",m({},".".concat(f,"-column-wrapper .ugb-column__content-wrapper"),{width:Object(o.c)(s("contentMobileWidth","%s".concat(s("contentMobileWidthUnit")||"%")))})),t));var h=e.attributes,v=h.columnPaddingUnit,y=void 0===v?"px":v,O=h.tabletColumnPaddingUnit,w=void 0===O?"px":O,_=h.mobileColumnPaddingUnit,j=void 0===_?"px":_;b.push({saveOnly:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > *":Object(o.d)({paddingTop:s("columnPaddingTop","%s".concat(y)),paddingBottom:s("columnPaddingBottom","%s".concat(y)),paddingRight:s("columnPaddingRight","%s".concat(y)),paddingLeft:s("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(o.d)({paddingTop:s("tabletColumnPaddingTop","%s".concat(w)),paddingRight:s("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:s("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:s("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(o.d)({paddingTop:s("mobileColumnPaddingTop","%s".concat(j)),paddingRight:s("mobileColumnPaddingRight","%s".concat(j)),paddingBottom:s("mobileColumnPaddingBottom","%s".concat(j)),paddingLeft:s("mobileColumnPaddingLeft","%s".concat(j))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-column__item":Object(o.d)({paddingTop:s("columnPaddingTop","%s".concat(y)),paddingBottom:s("columnPaddingBottom","%s".concat(y)),paddingRight:s("columnPaddingRight","%s".concat(y)),paddingLeft:s("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-column__item":Object(o.d)({paddingTop:s("tabletColumnPaddingTop","%s".concat(w)),paddingRight:s("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:s("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:s("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-column__item":Object(o.d)({paddingTop:s("mobileColumnPaddingTop","%s".concat(j)),paddingRight:s("mobileColumnPaddingRight","%s".concat(j)),paddingBottom:s("mobileColumnPaddingBottom","%s".concat(j)),paddingLeft:s("mobileColumnPaddingLeft","%s".concat(j))})}}});var k=e.attributes,C=k.contentWidth,x=void 0===C?"":C,E=k.contentTabletWidth,S=void 0===E?"":E,B=k.contentMobileWidth,T=void 0===B?"":B;x&&b.push(m({},".".concat(f,"-column-wrapper"),{alignItems:Object(o.c)(s("contentHorizontalAlign"))})),(x||S)&&b.push({tablet:m({},".".concat(f,"-column-wrapper"),{alignItems:Object(o.c)(s("contentTabletHorizontalAlign"))})}),(x||S||T)&&b.push({mobile:m({},".".concat(f,"-column-wrapper"),{alignItems:Object(o.c)(s("contentMobileHorizontalAlign"))})});var P=e.attributes,A=P.columnBackgroundColor,N=void 0===A?"":A,M=P.headingColor,R=void 0===M?"":M,F=P.bodyTextColor,D=void 0===F?"":F;return b.push((m(n={},"h1, h2, h3, h4, h5, h6",{color:s("headingColor")}),m(n,"p, li, label, table",{color:s("bodyTextColor")}),m(n,"a, a:visited, a:focus",{color:s("linkColor")}),m(n,"a:hover",{color:s("linkHoverColor")}),n)),b.push((m(i={},".".concat(f,"-column-wrapper > * > h1, ")+".".concat(f,"-column-wrapper > * > h2, ")+".".concat(f,"-column-wrapper > * > h3, ")+".".concat(f,"-column-wrapper > * > h4, ")+".".concat(f,"-column-wrapper > * > h5, ")+".".concat(f,"-column-wrapper > * > h6"),{color:Object(o.wb)(R,g.columnBackground&&N)}),m(i,".".concat(f,"-column-wrapper > * > p, ")+".".concat(f,"-column-wrapper > * > ol li, ")+".".concat(f,"-column-wrapper > * > ul li"),{color:Object(o.wb)(D,g.columnBackground&&N)}),m(i,"editor",(m(a={},".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h1, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h2, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h3, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h4, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h5, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h6'),{color:Object(o.wb)(R,g.columnBackground&&N)}),m(a,".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/paragraph"] p, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/list"] li'),{color:Object(o.wb)(D,g.columnBackground&&N)}),a)),i)),l.a.all(b)},d=n(301),f=n.n(d),h=n(302),v=n.n(h),y=n(3),O=n(10),w=n(8),_=n.n(w),j=n(0),k=n(6),C=n(9),x=n(12),E=n(13);function S(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0}}))(function(e){var t,n,a,i=e.className,o=e.hasInnerBlocks,r=e.attributes,l=r.design,c=void 0===l?"plain":l,u=r.shadow,b=void 0===u?"":u,p=r.uniqueClass,m=void 0===p?"":p,g=_()([i,"ugb-column--design-".concat(c)],Object(s.applyFilters)("stackable.columns.mainclasses",{},e)),d=_()(["ugb-column__item","".concat(m,"-column-wrapper")],(t={},n="ugb--shadow-".concat(b),a=""!==b,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement(y.k.Edit,{className:g,blockProps:e,render:function(){return wp.element.createElement(k.Fragment,null,wp.element.createElement(y.G,{className:d,backgroundAttrName:"column%s",blockProps:e},wp.element.createElement("div",{className:"ugb-column__content-wrapper"},wp.element.createElement(C.InnerBlocks,{templateLock:!1,renderAppender:o?void 0:function(){return wp.element.createElement(C.InnerBlocks.ButtonBlockAppender,null)}}))))}})});var T=Object(x.compose)(O.i,Object(O.a)(g))(function(e){var t,n,a,i=e.className,o=e.attributes,r=o.design,l=void 0===r?"plain":r,c=o.shadow,u=void 0===c?"":c,b=o.uniqueClass,p=void 0===b?"":b,m=_()([i,"ugb-column--design-".concat(l)],Object(s.applyFilters)("stackable.columns.mainclasses",{},e)),g=_()(["ugb-column__item","".concat(p,"-column-wrapper")],(t={},n="ugb--shadow-".concat(u),a=""!==u,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement(y.k.Save,{className:m,blockProps:e,render:function(){return wp.element.createElement(k.Fragment,null,wp.element.createElement(y.G,{className:g,backgroundAttrName:"column%s",blockProps:e},wp.element.createElement("div",{className:"ugb-column__content-wrapper"},wp.element.createElement(C.InnerBlocks.Content,null))))}})});function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=function(e){for(var t=1;t".concat(Object(r.__)("Some short text that can be expanded to show more details.",o.i18n),"

")},moreText:{source:"html",selector:".ugb-expand__more-text",multiline:"p",default:"

".concat(Object(r.__)("Some short text that can be expanded to show more details.",o.i18n)," ").concat(Object(p.M)("medium"),"

")}},Object(p.J)("text%s"),{textColor:{type:"string",default:""},moreLabel:{source:"html",selector:".ugb-expand__more-toggle-text",default:Object(r.__)("Show more",o.i18n)},lessLabel:{source:"html",selector:".ugb-expand__less-toggle-text",default:Object(r.__)("Show less",o.i18n)}},Object(p.J)("link%s"),{linkColor:{type:"string",default:""}},Object(p.i)("%s%sAlign",{type:"string",default:""},["Title","Text","Link"],["","Tablet","Mobile"]),{},Object(p.i)("%s%sBottomMargin",{type:"number",default:""},["Title","Text","Link"],["","Tablet","Mobile"])),T=n(15);n.d(t,"name",function(){return P}),n.d(t,"settings",function(){return A});var P="ugb/expand",A={title:Object(r.__)("Expand / Show More",o.i18n),description:Object(r.__)("Display a small snippet of text. Your readers can toggle it to show more information.",o.i18n),icon:T.k,category:"layout",keywords:[Object(r.__)("Expand",o.i18n),Object(r.__)("Show more/less",o.i18n),Object(r.__)("Stackable",o.i18n)],attributes:B,supports:{inserter:!o.disabledBlocks.includes(P),anchor:!0},deprecated:b,edit:C,save:x,modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-responsive":!0,"content-align":!0,"custom-css":{default:Object(l.applyFilters)("stackable.expand.custom-css.default","")}}}},function(e,t,n){"use strict";n.r(t);var a=n(4),i=n(8),o=n.n(i),r=function(e){var t=e.className,n=e.attributes,i=n.height,r=n.design,l=void 0===r?"":r,c=o()([t,"ugb-spacer"]);return wp.element.createElement("div",{className:c,style:{height:i+"px"}},Object(a.applyFilters)("stackable.spacer.save.output.before_1_15_4",null,l,e))},l=[{attributes:function(e){var t=e.className,n=e.attributes.design,i=void 0===n?"":n,r=o()([t,"ugb-spacer"]);return wp.element.createElement("div",{className:r,style:"height:undefinedpx"},Object(a.applyFilters)("stackable.spacer.save.output.before_1_15_4",null,i,e))},save:r},{attributes:{height:{default:50,type:"number"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},save:r}],c=n(3),s=n(10),u=n(2),b=n(14),p=n.n(b);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e){var t=Object(u.b)(e.attributes),n=[];return n.push({desktopTablet:{".ugb-spacer":{height:t("height","%s".concat(t("heightUnit")||"px"))}},tabletOnly:{".ugb-spacer":{height:t("tabletHeight","%s".concat(t("tabletHeightUnit")||"px"))}},mobile:{".ugb-spacer":{height:t("mobileHeight","%s".concat(t("mobileHeightUnit")||"px"))}}}),n.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(u.camelCase)(Object(b.sprintf)(e,t,n))},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return a.length?n.reduce(function(n,i){return m({},n,{},a.reduce(function(n,a,o){var r=m({},t);return void 0!==r.selector&&(r.selector=Object(b.sprintf)(r.selector,o+1)),n[Object(u.camelCase)(Object(b.sprintf)(e,i,a))]=r,n},{}))},{}):n.reduce(function(n,a,i){var o=m({},t);return void 0!==o.selector&&(o.selector=Object(b.sprintf)(o.selector,i+1)),n[Object(u.camelCase)(Object(b.sprintf)(e,a))]=o,n},{})},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f(e,t,["","Tablet","Mobile"])},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(u.omit)(e,t.map(function(e){return Object(u.camelCase)(Object(b.sprintf)(n,e))}))},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.length?Object(u.pick)(e,t.map(function(e){return Object(u.camelCase)(Object(b.sprintf)(n,e))})):e},O=function(e){return Object.keys(h(e))};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var k=function(e){return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},o=yt(n,i,""),r=a.importantSize,l=void 0!==r&&r,s=a.important,p=void 0===s||s,m=a.inherit,g=void 0===m||m,d=a.inheritMax,f=void 0===d?50:d,h=a.inheritMin,v={},y=o("FontSize"),O=o("TabletFontSize"),w=o("MobileFontSize");if("tablet"!==t&&"mobile"!==t)v={fontFamily:""!==o("FontFamily")?c(o("FontFamily")):void 0,fontSize:""!==y?vt("".concat(y).concat(o("FontSizeUnit")||"px"),l):void 0,fontWeight:""!==o("FontWeight")?o("FontWeight"):void 0,textTransform:""!==o("TextTransform")?o("TextTransform"):void 0,letterSpacing:""!==o("LetterSpacing")?"".concat(o("LetterSpacing"),"px"):void 0,lineHeight:""!==o("LineHeight")?"".concat(o("LineHeight")).concat(o("LineHeightUnit")||"em"):void 0};else if("tablet"===t){if(v={lineHeight:""!==o("TabletLineHeight")?"".concat(o("TabletLineHeight")).concat(o("TabletLineHeightUnit")||"em"):void 0},g){var _=Ot(y,{min:h,max:f});_&&(v.fontSize="".concat(_).concat(o("FontSizeUnit")||"px"))}O&&(v.fontSize=o("TabletFontSize","%s".concat(o("TabletFontSizeUnit")||"px")))}else{if(v={lineHeight:""!==o("MobileLineHeight")?"".concat(o("MobileLineHeight")).concat(o("MobileLineHeightUnit")||"em"):void 0},g){var k=Ot(y,{min:h,max:f});k&&(v.fontSize="".concat(k).concat(o("FontSizeUnit")||"px"));var j=Ot(O,{min:h,max:f});j?v.fontSize="".concat(j).concat(o("TabletFontSizeUnit")||"px"):(k||O)&&(v.fontSize=void 0)}w&&(v.fontSize=o("MobileFontSize","%s".concat(o("MobileFontSizeUnit")||"px")))}return p?ht(v):v},E=n(18),S=n(4);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P={},A=function(){P=function(e){for(var t=1;t'.concat(e.map(function(e){return"<".concat(e,">")}).join(),""),!document||!document.body)return{};document.body.appendChild(t);var n={};return e.forEach(function(e){var a=window.getComputedStyle(t.querySelector(e)).getPropertyValue("font-size");n[e]=Math.round(parseFloat(a))}),document.body.removeChild(t),n}(["h1","h2","h3","h4","h5","h6","p"]))};Object(S.addFilter)("stackable.global-settings.typography.editor-styles","stackable/default-font-sizes",function(e,t,n,a){return e[".ugb-default-font-size .wp-block ".concat(t)]=x("%s","desktop",a,{important:!0}),P={},e});var N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(P).length&&!t||A(),P[e]||P.p||21};function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object(E.a)(function(){A()});var D=function(e){return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},o=yt(n,i),r=a.importantBackgroundColor,l=void 0!==r&&r,c=a.importantBackgroundPosition,s=void 0!==c&&c,p=a.importantBackgroundSize,m=void 0!==p&&p,g=a.importantBackgroundRepeat,d=void 0!==g&&g,f=o("BackgroundCustomSize")?o("BackgroundCustomSize")+(o("BackgroundCustomSizeUnit")||"%"):void 0,h=o("TabletBackgroundCustomSize")?o("TabletBackgroundCustomSize")+(o("TabletBackgroundCustomSizeUnit")||"%"):void 0,v=o("MobileBackgroundCustomSize")?o("MobileBackgroundCustomSize")+(o("MobileBackgroundCustomSizeUnit")||"%"):void 0,y=vt(o("BackgroundColor"),l);return o("BackgroundColorType")||void 0===n[i("BackgroundColorOpacity")]||""===n[i("BackgroundColorOpacity")]||o("BackgroundMediaURL")||o("TabletBackgroundMediaURL")||o("MobileBackgroundMediaURL")||(y=vt("".concat(un(o("BackgroundColor")||"#ffffff",o("BackgroundColorOpacity")||0)),l)),"tablet"!==t&&"mobile"!==t?{backgroundColor:y,backgroundAttachment:o("FixedBackground")?"fixed":void 0,backgroundImage:o("BackgroundMediaURL","url(%s)"),backgroundPosition:vt(o("BackgroundPosition"),s),backgroundRepeat:vt(o("BackgroundRepeat"),d),backgroundSize:o("BackgroundSize")?vt("custom"!==o("BackgroundSize")?o("BackgroundSize"):f,m):void 0,backgroundBlendMode:o("BackgroundImageBlendMode")}:"tablet"===t?{backgroundImage:o("TabletBackgroundMediaURL","url(%s)"),backgroundPosition:vt(o("TabletBackgroundPosition"),s),backgroundRepeat:vt(o("TabletBackgroundRepeat"),d),backgroundSize:o("TabletBackgroundSize")?vt("custom"!==o("TabletBackgroundSize")?o("TabletBackgroundSize"):h,m):void 0}:{backgroundImage:o("MobileBackgroundMediaURL","url(%s)"),backgroundPosition:vt(o("MobileBackgroundPosition"),s),backgroundRepeat:vt(o("MobileBackgroundRepeat"),d),backgroundSize:o("MobileBackgroundSize")?vt("custom"!==o("MobileBackgroundSize")?o("MobileBackgroundSize"):v,m):void 0}},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},o=yt(n,i),r=a.importantBackgroundColor,l=void 0!==r&&r,c=parseInt(o("BackgroundTintStrength","",5)||0,10)/10,s="gradient"===o("BackgroundColorType"),p=un(o("BackgroundColor2")||"#ffffff",0),m=un(o("BackgroundColor")||"#ffffff",0),g="".concat(o("BackgroundGradientLocation1")||"0","%"),d="".concat(o("BackgroundGradientLocation2")||"100","%");return"tablet"!==t&&"mobile"!==t?{backgroundColor:vt(!s&&o("BackgroundColor")?o("BackgroundColor"):void 0,l),backgroundImage:vt(s?"linear-gradient(".concat(o("BackgroundGradientDirection","%sdeg","90deg"),", ").concat(o("BackgroundColor")||p," ").concat(g,", ").concat(o("BackgroundColor2")||m," ").concat(d,")"):void 0,l),opacity:o("BackgroundMediaURL")?c:void 0,mixBlendMode:s?o("BackgroundGradientBlendMode"):void 0}:"tablet"===t?{opacity:o("TabletBackgroundMediaURL")?c:void 0}:{opacity:o("MobileBackgroundMediaURL")?c:void 0}},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},a=yt(t,n);return"gradient"===a("BackgroundColorType")||a("BackgroundMediaUrl")||a("TabletBackgroundMediaUrl")||a("MobileBackgroundMediaUrl")},G=function(){var e,t,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return H(n={},".".concat(i),z({},I(a,"desktop",o,r))),H(n,".".concat(i,":before"),z({},W(a,"desktop",o,r))),H(n,"tablet",(H(e={},".".concat(i),z({},I(a,"tablet",o,r))),H(e,".".concat(i,":before"),z({},W(a,"tablet",o,r))),e)),H(n,"mobile",(H(t={},".".concat(i),z({},I(a,"mobile",o,r))),H(t,".".concat(i,":before"),z({},W(a,"mobile",o,r))),t)),n},q=I,K=n(8),Y=n.n(K),J=n(6),X=function(e,t){var n=yt(t.attributes,function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},""),a=n("BackgroundMediaUrl"),i=n("TabletBackgroundMediaUrl"),o=n("MobileBackgroundMediaUrl"),r=Y()(["ugb-video-background"],{"ugb--video-hide-tablet":i,"ugb--video-hide-mobile":o}),l=Y()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-mobile":o}),c=Y()(["ugb-video-background"],{"ugb--video-hide-desktop":!0,"ugb--video-hide-tablet":!0});return wp.element.createElement(J.Fragment,null,ln(a)&&wp.element.createElement("video",{className:r,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:a}),ln(i)&&wp.element.createElement("video",{className:l,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:i}),ln(o)&&wp.element.createElement("video",{className:c,autoPlay:!0,muted:!0,loop:!0,playsinline:!0,src:o}))};function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Q(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.exclude,a=void 0===n?[]:n,i=t.include,o=void 0===i?[]:i;return y(v(Q({},f(e,{type:"string",default:""},["BorderType","BorderColor"]),{},f(e,{type:"number",default:""},["BorderWidthTop","BorderWidthRight","BorderWidthBottom","BorderWidthLeft","TabletBorderWidthTop","TabletBorderWidthRight","TabletBorderWidthBottom","TabletBorderWidthLeft","MobileBorderWidthTop","MobileBorderWidthRight","MobileBorderWidthBottom","MobileBorderWidthLeft"])),a,e),o,e)},te=ee,ne=n(14),ae=n.n(ne);function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oe=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(e){return Object(u.camelCase)(Object(b.sprintf)(t,e))},o=yt(a,i),r=[];return o("BorderType")?(r.push((ie(e={},n,ht({borderStyle:o("BorderType"),borderColor:o("BorderColor")||"#000000",borderTopWidth:o("BorderWidthTop","%spx")||"1px",borderRightWidth:o("BorderWidthRight","%spx")||"1px",borderBottomWidth:o("BorderWidthBottom","%spx")||"1px",borderLeftWidth:o("BorderWidthLeft","%spx")||"1px"})),ie(e,"tablet",ie({},n,ht({borderTopWidth:o("TabletBorderWidthTop","%spx"),borderRightWidth:o("TabletBorderWidthRight","%spx"),borderBottomWidth:o("TabletBorderWidthBottom","%spx"),borderLeftWidth:o("TabletBorderWidthLeft","%spx")}))),ie(e,"mobile",ie({},n,ht({borderTopWidth:o("MobileBorderWidthTop","%spx"),borderRightWidth:o("MobileBorderWidthRight","%spx"),borderBottomWidth:o("MobileBorderWidthBottom","%spx"),borderLeftWidth:o("MobileBorderWidthLeft","%spx")}))),e)),ae.a.all(r)):r};function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function le(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,a=void 0===n?".ugb-img":n,i=t.exclude,o=void 0===i?[]:i;return v(le({},f(e,{type:"string",default:"",source:"attribute",selector:a,attribute:"src"},["Url"]),{},f(e,{type:"string",default:"",source:"attribute",selector:a,attribute:"alt"},["Alt"]),{},f(e,{type:"string",default:""},["Shape","Size","BlendMode","BackgroundPosition"]),{},f(e,{type:"number",default:""},["Id","Width","Height","TabletWidth","MobileWidth","BorderRadius","Shadow"]),{},f(e,{type:"boolean",default:""},["ShapeStretch","ShapeFlipX","ShapeFlipY","Square","TabletSquare","MobileSquare"]),{},f(e,{type:"string",default:"large"},["Size"])),o,e)},ue=se,be=n(5),pe=n.n(be);function me(){return(me=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1],n=Object(J.renderToString)(e).replace(/viewbox/,"viewBox").replace(/preserveaspectratio/,"preserveAspectRatio");return t?n.replace(/#/g,"%23"):n};function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ke(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},i=yt(n,a),o=i("Shape"),r=function(e,t){return i(t)&&i(e)?i(e,"%spx"):"auto"};return"tablet"!==t&&"mobile"!==t?{borderRadius:o?void 0:i("BorderRadius","%spx"),width:i("Width","%spx"),height:i("Width")?vt(r("Width","Square")):void 0}:"tablet"===t?{width:i("TabletWidth","%spx"),height:i("TabletWidth")?vt(r("TabletWidth","TabletSquare")):void 0}:{width:i("MobileWidth","%spx"),height:i("MobileWidth")?vt(r("MobileWidth","MobileSquare")):void 0}},Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.parentAttrNameTemplate,i=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},o=yt(t,i),r=function(e){if(a){var n=yt(t,function(e){return Object(u.camelCase)(Object(b.sprintf)(a,e))});return void 0!==o(e)?o(e):n(e)}return o(e)},l=r("Shape");if(!l)return{};var c=r("ShapeStretch"),s=r("ShapeFlipX"),p=r("ShapeFlipY"),m=xe(l),g=wp.element.createElement(m,{preserveAspectRatio:!["","square"].includes(l)&&c?"none":void 0,transform:s||p?"scale(".concat(s?-1:1,",").concat(p?-1:1,")"):void 0}),d=btoa(we(g));return{"-webkit-mask-image":"url('data:image/svg+xml;base64,".concat(d,"')"),"mask-image":"url('data:image/svg+xml;base64,".concat(d,"')")}},Be=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.inherit,r=void 0===o||o,l=(je(e={},".".concat(n),ke({},Se(t,a,i))),je(e,"tabletOnly",je({},".".concat(n),ke({},Ee(t,"tablet",a,i)))),je(e,"mobile",je({},".".concat(n),ke({},Ee(t,"mobile",a,i)))),e);return r?l[".".concat(n)]=ke({},l[".".concat(n)],{},Ee(t,"desktop",a,i)):l.desktopTablet=je({},".".concat(n),ke({},Ee(t,"desktop",a,i))),l},Te=n(13),Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{width:e.media_details?e.media_details.width:"",height:e.media_details?e.media_details.height:"",source_url:e.source_url||""}},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?e.media_details&&e.media_details.sizes&&e.media_details.sizes[t]||Pe(e):null};window._stackableCachedImageData={};var Ne=function(e,t){var n=t("core").getMedia,a=e?n(e):null;return a&&void 0!==a.id&&(window._stackableCachedImageData[a.id]=a),a},Me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"full",n=Re(e)||Ne(e,Te.select);return n?n.media_details.sizes[t]?n.media_details.sizes[t].source_url:n.source_url:""},Re=function(e){return window._stackableCachedImageData[e]||null};function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Fe(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.exclude,a=void 0===n?[]:n;return v(Fe({},f(e,{type:"string",default:""},["Url","BackgroundPosition","BackgroundRepeat","BackgroundSize"]),{},f(e,{type:"number",default:""},["Id","BackgroundCustomSize"]),{},f(e,{type:"string",default:"large"},["Size"]),{},f(e,{type:"string",default:"px"},["BackgroundCustomSizeUnit"])),a,e)},ze=Ue,He=function(e){return Object.keys(Ue(e))};function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function We(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"desktop",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=function(t){return Object(u.camelCase)(Object(b.sprintf)(e,t))},i=yt(n,a);return"tablet"!==t&&"mobile"!==t?{backgroundImage:i("Url","url(%s)"),backgroundPosition:vt(i("BackgroundPosition")),backgroundRepeat:vt(i("BackgroundRepeat")),backgroundSize:vt("custom"!==i("BackgroundSize")?i("BackgroundSize"):i("BackgroundCustomSize")?i("BackgroundCustomSize")+i("BackgroundCustomSizeUnit","%s","px"):void 0)}:{}},qe=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Ve(e={},".".concat(n),We({},Ge(t,"desktop",a,i))),Ve(e,"tablet",Ve({},".".concat(n),We({},Ge(t,"tablet",a,i)))),Ve(e,"mobile",Ve({},".".concat(n),We({},Ge(t,"mobile",a,i)))),e};function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Ye(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,i=void 0===n?".ugb-button":n,o=t.defaultText,r=void 0===o?Object(b.__)("Button text",a.i18n):o,l=t.exclude,c=void 0===l?[]:l,s=t.include,u=void 0===s?[]:s;return y(v(Ye({},j(e),{},f(e,{type:"string",source:"html",selector:"".concat(i," span"),default:r},["Text"]),{},f(e,{type:"string",source:"attribute",selector:i,attribute:"href",default:""},["Url"]),{},f(e,{type:"boolean",source:"attribute",selector:i,attribute:"target",default:""},["NewTab"]),{},f(e,{type:"string",default:""},["Design","Size","Icon","IconPosition","TextColor","BackgroundColorType","BackgroundColor","BackgroundColor2","HoverEffect","HoverTextColor","HoverBackgroundColor","HoverBackgroundColor2"]),{},f(e,{type:"number",default:""},["Opacity","HoverOpacity","PaddingTop","PaddingRight","PaddingBottom","PaddingLeft","BorderRadius","BorderWidth","Shadow","IconSize","IconSpacing","BackgroundGradientDirection","HoverBackgroundGradientDirection"]),{},f(e,{type:"boolean",default:""},["HoverGhostToNormal","NoFollow"])),c,e),u,e)},$e=Xe,Qe=function(e){return Object.keys(Xe(e))};function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function et(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=function(e){return Object(u.camelCase)(Object(b.sprintf)(t,e))},r=yt(a,o,""),l=[];l.push((tt(e={},".".concat(n," .ugb-button--inner"),et({},x(t,"desktop",a))),tt(e,"tablet",tt({},".".concat(n," .ugb-button--inner"),et({},x(t,"tablet",a)))),tt(e,"mobile",tt({},".".concat(n," .ugb-button--inner"),et({},x(t,"mobile",a)))),e));var c=r("BackgroundColor2"),s=r("BackgroundColor"),p=!1;if(""===r("Design")||"basic"===r("Design")){var m;l.push((tt(m={},".".concat(n),{backgroundColor:""!==r("BackgroundColor")?r("BackgroundColor"):void 0,backgroundImage:"gradient"===r("BackgroundColorType")?"linear-gradient(".concat(""!==a[o("BackgroundGradientDirection")]?r("BackgroundGradientDirection","%sdeg","90deg"):"90deg",", ").concat(r("BackgroundColor")||c,", ").concat(r("BackgroundColor2")||s,")"):void 0,paddingTop:""!==r("PaddingTop")?"".concat(r("PaddingTop"),"px"):void 0,paddingRight:""!==r("PaddingRight")?"".concat(r("PaddingRight"),"px"):void 0,paddingBottom:""!==r("PaddingBottom")?"".concat(r("PaddingBottom"),"px"):void 0,paddingLeft:""!==r("PaddingLeft")?"".concat(r("PaddingLeft"),"px"):void 0}),tt(m,".".concat(n," .ugb-button--inner, .").concat(n," svg:not(.ugb-custom-icon)"),{color:vt(ft(r("TextColor"),r("BackgroundColor")))}),tt(m,".".concat(n,":hover .ugb-button--inner, .").concat(n,":hover svg:not(.ugb-custom-icon)"),{color:vt(ft(r("HoverTextColor"),r("HoverBackgroundColor")))}),tt(m,".".concat(n,":hover"),{backgroundColor:""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):void 0}),m)),p=""!==r("HoverBackgroundColor");var g="gradient"===r("BackgroundColorType")&&(r("HoverBackgroundColor")||r("HoverBackgroundColor2")||r("HoverBackgroundGradientDirection"));l.push(tt({},".".concat(n,":before"),{content:g?'""':void 0,backgroundImage:g?"linear-gradient(".concat(r("HoverBackgroundGradientDirection","%sdeg")||r("BackgroundGradientDirection","%sdeg","90deg"),", ").concat(r("HoverBackgroundColor")||r("BackgroundColor")||c,", ").concat(r("HoverBackgroundColor2")||r("BackgroundColor2")||s,")"):void 0})),p=p||g||""!==r("HoverTextColor")}if("ghost"===r("Design")){var d,f;if(l.push((tt(d={},".".concat(n),{borderColor:""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0,borderWidth:""!==r("BorderWidth")?"".concat(r("BorderWidth"),"px"):void 0,paddingTop:""!==r("PaddingTop")?"".concat(r("PaddingTop"),"px"):void 0,paddingRight:""!==r("PaddingRight")?"".concat(r("PaddingRight"),"px"):void 0,paddingBottom:""!==r("PaddingBottom")?"".concat(r("PaddingBottom"),"px"):void 0,paddingLeft:""!==r("PaddingLeft")?"".concat(r("PaddingLeft"),"px"):void 0}),tt(d,".".concat(n," .ugb-button--inner"),{color:""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0}),tt(d,".".concat(n,":hover"),{borderColor:""!==r("HoverBackgroundColor")?vt(r("HoverBackgroundColor")):void 0}),tt(d,".".concat(n,":hover .ugb-button--inner"),{color:""!==r("HoverBackgroundColor")?vt(r("HoverBackgroundColor")):""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0}),d)),""!==r("Icon")||i)l.push((tt(f={},".".concat(n,".ugb-button--has-icon.ugb-button--has-icon svg:not(.ugb-custom-icon)"),{color:""!==r("BackgroundColor")?r("BackgroundColor"):void 0}),tt(f,".".concat(n,".ugb-button--has-icon.ugb-button--has-icon:hover svg:not(.ugb-custom-icon)"),{color:""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):""!==r("BackgroundColor")?r("BackgroundColor"):void 0}),f));p=""!==r("HoverBackgroundColor");var h,v=r("HoverGhostToNormal");if(v)l.push((tt(h={},".".concat(n,":before"),{content:'""',backgroundImage:"linear-gradient(".concat(r("HoverBackgroundGradientDirection","%sdeg","90deg"),", ").concat(r("HoverBackgroundColor")||r("BackgroundColor"),", ").concat(r("HoverBackgroundColor2")||r("HoverBackgroundColor")||r("BackgroundColor"),")"),top:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0,right:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0,bottom:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0,left:""!==r("BorderWidth")?"-".concat(r("BorderWidth"),"px"):void 0}),tt(h,".".concat(n,":hover"),{backgroundColor:vt(""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):r("BackgroundColor"))}),tt(h,".".concat(n,":hover .ugb-button--inner"),{color:vt(ft(r("HoverTextColor"),r("HoverBackgroundColor")||r("BackgroundColor")))}),h)),(""!==r("Icon")||i)&&l.push(tt({},".".concat(n,".ugb-button--has-icon.ugb-button--has-icon:hover svg:not(.ugb-custom-icon)"),{color:vt(ft(r("HoverTextColor"),r("HoverBackgroundColor")||r("BackgroundColor")))})),p=!0}if("plain"===r("Design")){var y,O;if(l.push((tt(y={},".".concat(n," .ugb-button--inner"),{color:""!==r("BackgroundColor")?vt(r("BackgroundColor")):void 0}),tt(y,".".concat(n,":hover .ugb-button--inner"),{color:""!==r("HoverBackgroundColor")?vt(r("HoverBackgroundColor")):void 0}),y)),""!==r("Icon")||i)l.push((tt(O={},".".concat(n,".ugb-button--has-icon.ugb-button--has-icon svg:not(.ugb-custom-icon)"),{color:""!==r("BackgroundColor")?r("BackgroundColor"):void 0}),tt(O,".".concat(n,".ugb-button--has-icon.ugb-button--has-icon:hover svg:not(.ugb-custom-icon)"),{color:""!==r("HoverBackgroundColor")?r("HoverBackgroundColor"):void 0}),O));p=""!==r("HoverBackgroundColor")}if("link"!==r("Design")){var w,_=""!==a[o("IconSpacing")]&&void 0!==a[o("IconSpacing")]?"".concat(r("IconSpacing","%spx",16)):void 0,k=a[o("BorderRadius")];l.push((tt(w={},".".concat(n),{opacity:""!==r("Opacity")?r("Opacity"):void 0,borderRadius:""!==k&&void 0!==k?vt("".concat(k,"px")):void 0}),tt(w,".".concat(n,":before"),{borderRadius:""!==k&&void 0!==k?vt("".concat(k,"px")):void 0}),tt(w,".".concat(n,":hover"),{opacity:""!==r("HoverOpacity")?r("HoverOpacity"):p?1:void 0}),tt(w,".".concat(n,".ugb-button--has-icon.ugb-button--has-icon svg"),{marginLeft:(""!==r("Icon")||i)&&"right"===r("IconPosition")?_:void 0,marginRight:(""!==r("Icon")||i)&&"right"!==r("IconPosition")?_:void 0,width:""!==r("IconSize")||i?"".concat(r("IconSize"),"px"):void 0,height:""!==r("IconSize")||i?"".concat(r("IconSize"),"px"):void 0}),w))}return ae.a.all(l)},at=n(43),it=n.n(at),ot=n(25),rt=n.n(ot);function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ct(e){for(var t=1;t-1))return it()(t);var n=t.match(/--(.*?(?=,))/g);t=n?window.getComputedStyle(document.documentElement).getPropertyValue(n[0])||"#fff":window.getComputedStyle(document.documentElement).getPropertyValue(t.replace("var(","").replace(")",""))||"#fff"}if(t.match(/^rgb/)){var a=rt()(t);a.splice(3,1),t=function(e,t,n){return"#"+[e,t,n].map(function(e){var t=e.toString(16);return 1===t.length?"0"+t:t}).join("")}.apply(void 0,ut(a))}return 3===(t=t.replace(/#/g,"")).length&&(t=t.replace(/(.)(.)(.)/,"$1$1$2$2$3$3")),it()("#".concat(t))}catch(e){return!1}},pt=function(e){return"left"===e||"flex-start"===e?0:"auto"},mt=function(e){return"right"===e||"flex-end"===e?0:"auto"},gt=function(e){return"left"===e?"flex-start":"right"===e?"flex-end":e},dt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=""!==e?e:void 0;return!n&&t&&bt(t)?"#ffffff":n},ft=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#ffffff",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#222222",i=""!==e?e:void 0;return!i&&t?bt(t)?n:a:i},ht=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Object.keys(e).reduce(function(n,a){return ct({},n,st({},a,vt(e[a],t)))},{})},vt=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""!==e&&void 0!==e&&t&&!String(e).match(/!important/i)?"".concat(e," !important"):e},yt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return function(a){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n,r=null!==t?t:function(e){return Object(u.lowerFirst)(e)},l=void 0===e[r(a)]?"":e[r(a)];return""!==l?i?Object(b.sprintf)(i.replace(/%$/,"%%"),l):l:o}},Ot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.min,a=void 0===n?Number.NEGATIVE_INFINITY:n,i=t.max,o=void 0===i?Number.POSITIVE_INFINITY:i;if(""!==e){var r=Object(u.clamp)(e,parseFloat(a),parseFloat(o));if(!isNaN(r))return parseFloat(r)!==parseFloat(e)?r:void 0}},wt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"%s",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"marginBottom",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"%spx",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r="boolean"==typeof o?{important:o}:o,l=r.important,c=void 0!==l&&l,s=r.inherit,u=void 0===s||s,p=r.inheritTabletMax,m=r.inheritTabletMin,g=r.inheritMobileMax,d=r.inheritMobileMin,f=yt(i);if(u){var h,v=f(Object(b.sprintf)(t,""),a),y=f(Object(b.sprintf)(t,"Tablet"),a),O=f(Object(b.sprintf)(t,"Mobile"),a),w=Ot(f(Object(b.sprintf)(t,"")),{min:m,max:p}),_=Ot(f(Object(b.sprintf)(t,"")),{min:d,max:g});return[(h={},st(h,e,st({},n,vt(v,c))),st(h,"tabletOnly",st({},e,st({},n,vt(y||w&&Object(b.sprintf)(a,w),c)))),st(h,"mobile",st({},e,st({},n,vt(O||_&&Object(b.sprintf)(a,_),c)))),h)]}return[{desktopOnly:st({},e,st({},n,vt(f(Object(b.sprintf)(t,""),a),c))),tabletOnly:st({},e,st({},n,vt(f(Object(b.sprintf)(t,"Tablet"),a),c))),mobile:st({},e,st({},n,vt(f(Object(b.sprintf)(t,"Mobile"),a),c)))}]},_t=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"%s",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=yt(a),o=i("contentAlign"),r=i("TabletContentAlign"),l=i("MobileContentAlign"),c=i(Object(b.sprintf)(n,"")),s=i(Object(b.sprintf)(n,"Tablet")),u=i(Object(b.sprintf)(n,"Mobile"));return[(t={},st(t,e,ht({marginLeft:c||o?pt(c||o):void 0,marginRight:c||o?mt(c||o):void 0})),st(t,"tablet",st({},e,ht({marginLeft:s||r?pt(s||r):void 0,marginRight:s||r?mt(s||r):void 0}))),st(t,"mobile",st({},e,ht({marginLeft:u||l?pt(u||l):void 0,marginRight:u||l?mt(u||l):void 0}))),t)]};function kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function jt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,a=void 0===n?".ugb-button-%s":n,i=t.exclude,o=void 0===i?[]:i,r=t.include,l=void 0===r?[]:r,c=Object.keys(At).reduce(function(n,i){return jt({},n,{},f(e,{type:"string",source:"attribute",selector:Object(b.sprintf)(a,i),attribute:"href",default:t["".concat(i,"Default")]?t["".concat(i,"Default")]:""},["".concat(Object(u.upperFirst)(i),"Url")]))},{});return y(v(jt({},$e(e,{exclude:["Text","Url","NoFollow","Icon","IconPosition","NewTab"]}),{},f(e,{type:"boolean",default:""},["NewTab"]),{},f(e,{type:"boolean",default:!0},["UseSocialColors"]),{},c),o,e),l,e)},Et=xt;function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Bt(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"%s",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=function(e){return Object(u.camelCase)(Object(b.sprintf)(n,e))},r=yt(i,o,""),l=[];if(l.push(Bt({},nt(n,a,i,!0))),!r("UseSocialColors"))return ae.a.all(l);""!==r("Design")&&"basic"!==r("Design")||l.push((Tt(e={},".".concat(a),{backgroundColor:void 0,backgroundImage:void 0}),Tt(e,".".concat(a," .ugb-button--inner, .").concat(a," svg"),{color:void 0}),Tt(e,".".concat(a,":hover .ugb-button--inner, .").concat(a,":hover svg"),{color:void 0}),Tt(e,".".concat(a,":hover"),{backgroundColor:void 0}),Tt(e,".".concat(a,":before"),{content:void 0,backgroundImage:void 0}),e));if("ghost"===r("Design")){var c;l.push((Tt(c={},".".concat(a),{borderColor:void 0}),Tt(c,".".concat(a," .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon svg"),{color:void 0}),Tt(c,".".concat(a,":hover"),{borderColor:void 0}),Tt(c,".".concat(a,":hover .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon:hover svg"),{color:void 0}),c));var s,p=r("HoverGhostToNormal");if(p)l.push((Tt(s={},".".concat(a,":before"),{content:void 0,backgroundImage:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}),Tt(s,".".concat(a,":hover .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon:hover svg"),{color:void 0}),s))}"plain"===r("Design")&&l.push((Tt(t={},".".concat(a," .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon svg"),{color:void 0}),Tt(t,".".concat(a,":hover .ugb-button--inner, .").concat(a,".ugb-button--has-icon.ugb-button--has-icon:hover svg"),{color:void 0}),t));return ae.a.all(l)},At={facebook:{label:Object(b.__)("Facebook",a.i18n),icon:''},twitter:{label:Object(b.__)("Twitter",a.i18n),icon:''},instagram:{label:Object(b.__)("Instagram",a.i18n),icon:''},pinterest:{label:Object(b.__)("Pinterest",a.i18n),icon:''},linkedin:{label:Object(b.__)("LinkedIn",a.i18n),icon:''},youtube:{label:Object(b.__)("YouTube",a.i18n),icon:''},email:{label:Object(b.__)("Email",a.i18n),icon:''}},Nt=n(17);function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Rt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,a=Object(Te.select)("core/block-editor"),i=a.getBlockName,o=a.getSelectedBlockClientId,r=a.getBlockAttributes,l=a.hasMultiSelection,c=a.getMultiSelectedBlockClientIds,b=Object(Te.dispatch)("core/block-editor"),p=b.updateBlockAttributes,m=Object(Te.select)("core/blocks"),g=m.getBlockType;if(n||!l()){var d=n||o();if(d){var f=r(d),h=i(d).replace(/^\w+\//g,""),v=g(i(d)).attributes,y=Object.keys(v).reduce(function(e,t){return Rt({},e,Dt({},t,v[t]?v[t].default:""))},{}),O=Object(S.applyFilters)("stackable.".concat(h,".design.filtered-block-attributes"),Rt({},y,{},t),f),w=Object(S.applyFilters)("stackable.".concat(h,".design.no-text-attributes"),O,f);s(w),p(d,Object(u.omit)(w,["uniqueClass"]))}}else c().forEach(function(n){e(t,n)})};function Ht(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var It=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Object(J.useState)(function(){try{var n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return t}}),a=Ht(n,2),i=a[0],o=a[1],r=function(t){try{var n=t instanceof Function?t(i):t;o(n),window.localStorage.setItem(e,JSON.stringify(n))}catch(e){}};return[i,r]},Wt=function(){return void 0!==Nt.registerBlockCollection},Vt=function(){return Wt()};function Gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function qt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,a=void 0===n?".ugb-icon":n,i=t.defaultIcon,o=void 0===i?"fas-cogs":i,r=t.exclude,l=void 0===r?[]:r,c=t.include,s=void 0===c?[]:c;return y(v(qt({},f(e,{type:"string",source:"html",selector:"".concat(a),default:o},["Icon"]),{},f(e,{type:"string",default:""},["Design","ColorType","Color","Color2","BackgroundColorType","BackgroundColor","BackgroundColor2","BackgroundShape","BackgroundShapeColor","Color3","Color4","Color5","Color5","Color6","Color7","Color8","Color9","Color10"]),{},f(e,{type:"number",default:""},["ColorGradientDirection","OutlineWidth","BackgroundColorGradientDirection","Size","TabletSize","MobileSize","BorderRadius","Shadow","Opacity","Padding","Rotation","BackgroundShapeOpacity","BackgroundShapeSize","BackgroundShapeOffsetHorizontal","BackgroundShapeOffsetVertical","MultiOpacity1","MultiOpacity2","MultiOpacity3","MultiOpacity4","MultiOpacity5","MultiOpacity6","MultiOpacity7","MultiOpacity8","MultiOpacity9","MultiOpacity10"]),{},f(e,{type:"boolean",default:""},["ShowBackgroundShape"])),l,e),s,e)},Jt=Yt,Xt=function(e){return Object.keys(Yt(e))};function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qt=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"%s",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(e){return Object(u.camelCase)(Object(b.sprintf)(t,e))},o=yt(a,i),r=[],l=Ot(o("Size"),{max:200}),c=Ot(o("Size"),{max:200});return r.push(($t(e={},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg"),{width:vt(o("Size","%spx")),height:vt(o("Size","%spx"))}),$t(e,"tabletOnly",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg"),{width:vt(o("TabletSize","%spx")||l&&"".concat(l,"px")),height:vt(o("TabletSize","%spx")||c&&"".concat(c,"px"))})),$t(e,"mobile",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg"),{width:vt(o("MobileSize","%spx")||l&&"".concat(l,"px")),height:vt(o("MobileSize","%spx")||c&&"".concat(c,"px"))})),$t(e,".".concat(n," .ugb-icon-inner-svg"),{color:vt(o("Color")),transform:vt(o("Rotation","rotate(%sdeg)"))}),$t(e,"saveOnly",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg *"),{color:vt(o("Color")),fill:vt(o("Color"))})),$t(e,"editor",$t({},".".concat(n," .ugb-icon-inner-svg, .").concat(n," .ugb-icon-inner-svg svg path, .").concat(n," .ugb-icon-inner-svg svg g, .").concat(n," .ugb-icon-inner-svg svg shape, .").concat(n," .ugb-icon-inner-svg svg circle, .").concat(n," .ugb-icon-inner-svg svg path, .").concat(n," .ugb-icon-inner-svg svg rect, .").concat(n," .ugb-icon-inner-svg svg polygon, .").concat(n," .ugb-icon-inner-svg svg ellipse"),{color:vt(o("Color")),fill:vt(o("Color"))})),$t(e,".".concat(n),{opacity:vt(o("Opacity"))}),e)),"shaped"!==o("Design")&&"outlined"!==o("Design")||r.push($t({},".".concat(n," .ugb-icon__design-wrapper"),{borderRadius:vt(o("BorderRadius","%s%","100%")),padding:vt(o("Padding","%spx"))})),"shaped"===o("Design")&&r.push($t({},".".concat(n," .ugb-icon__design-wrapper"),{background:vt(o("BackgroundColor"))})),"outlined"===o("Design")&&r.push($t({},".".concat(n," .ugb-icon__design-wrapper"),{borderColor:vt(o("BackgroundColor")),borderWidth:vt(o("OutlineWidth","%spx"))})),ae.a.all(Object(S.applyFilters)("stackable.icon-style-set.styles",r,o,n,a))},Zt=function(e){return"string"!=typeof e?0:Object(u.range)(10).reduce(function(t,n){var a=n+1;return new RegExp("(<(circle|ellipse|line|polygon|polyline|rect|shape|path)[^>]*(/>|>[sS]*?)[ \t\r\n\v\f]*){".concat(a,"}"),"gm").test(e)?a:t},0)},en=function(e,t){var n=tn(e,t);return n?n.html[0]:""},tn=function(e,t){return window.FontAwesome?window.FontAwesome.icon({prefix:e,iconName:t}):null},nn=function(){return!!window.FontAwesome},an=function(){return window.FontAwesome?Promise.resolve(!0):new Promise(function(e,t){var n=240,a=setInterval(function(){window.FontAwesome?(clearInterval(a),e(!0)):n--<0&&(clearInterval(a),t(!1))},250)})},on=function(e,t){var n=tn(e,t);return n?Promise.resolve(n):new Promise(function(n,a){var i=240,o=setInterval(function(){var r=tn(e,t);window.FontAwesome?(clearInterval(o),n(r)):i--<0&&(clearInterval(o),a(!1))},250)})};n(23),n(420);n.d(t,"nb",function(){return rn}),n.d(t,"tb",function(){return ln}),n.d(t,"Y",function(){return cn}),n.d(t,"M",function(){return sn}),n.d(t,"ab",function(){return un}),n.d(t,"jb",function(){return bn}),n.d(t,"h",function(){return pn}),n.d(t,"mb",function(){return gn}),n.d(t,"W",function(){return fn}),n.d(t,"pb",function(){return hn}),n.d(t,"cb",function(){return yn}),n.d(t,"ob",function(){return On}),n.d(t,"kb",function(){return wn}),n.d(t,"fb",function(){return l}),n.d(t,"T",function(){return c}),n.d(t,"gb",function(){return s}),n.d(t,"R",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"D",function(){return h}),n.d(t,"C",function(){return O}),n.d(t,"J",function(){return j}),n.d(t,"K",function(){return x}),n.d(t,"I",function(){return C}),n.d(t,"S",function(){return N}),n.d(t,"k",function(){return F}),n.d(t,"j",function(){return L}),n.d(t,"n",function(){return q}),n.d(t,"l",function(){return W}),n.d(t,"m",function(){return G}),n.d(t,"Z",function(){return V}),n.d(t,"L",function(){return X}),n.d(t,"o",function(){return te}),n.d(t,"p",function(){return oe}),n.d(t,"w",function(){return ue}),n.d(t,"B",function(){return Be}),n.d(t,"A",function(){return Se}),n.d(t,"X",function(){return xe}),n.d(t,"U",function(){return Ae}),n.d(t,"f",function(){return Ne}),n.d(t,"V",function(){return Me}),n.d(t,"y",function(){return ze}),n.d(t,"x",function(){return He}),n.d(t,"z",function(){return qe}),n.d(t,"r",function(){return $e}),n.d(t,"q",function(){return Qe}),n.d(t,"s",function(){return nt}),n.d(t,"bb",function(){return bt}),n.d(t,"hb",function(){return pt}),n.d(t,"ib",function(){return mt}),n.d(t,"eb",function(){return gt}),n.d(t,"vb",function(){return dt}),n.d(t,"wb",function(){return ft}),n.d(t,"d",function(){return ht}),n.d(t,"c",function(){return vt}),n.d(t,"b",function(){return yt}),n.d(t,"g",function(){return Ot}),n.d(t,"F",function(){return wt}),n.d(t,"E",function(){return _t}),n.d(t,"G",function(){return Et}),n.d(t,"H",function(){return Pt}),n.d(t,"a",function(){return At}),n.d(t,"db",function(){return Ut}),n.d(t,"e",function(){return zt}),n.d(t,"sb",function(){return we}),n.d(t,"ub",function(){return It}),n.d(t,"qb",function(){return Wt}),n.d(t,"rb",function(){return Vt}),n.d(t,"u",function(){return Jt}),n.d(t,"t",function(){return Xt}),n.d(t,"v",function(){return Qt}),n.d(t,"lb",function(){return Zt}),n.d(t,"O",function(){return en}),n.d(t,"Q",function(){return nn}),n.d(t,"N",function(){return an}),n.d(t,"P",function(){return on});var rn=function(e,t){return Array.from({length:t-e},function(t,n){return n+e})},ln=function(e){return e.match(/(mp4|webm|ogg)$/i)},cn=function(e){var t="";return(t=(e.match(/youtube\.com\/watch\?v=([^\&\?\/]+)/i)||[])[1])||(t=(e.match(/youtube\.com\/embed\/([^\&\?\/]+)/i)||[])[1]),t||(t=(e.match(/youtube\.com\/v\/([^\&\?\/]+)/i)||[])[1]),t||(t=(e.match(/youtu\.be\/([^\&\?\/]+)/i)||[])[1]),t?{type:"youtube",id:t}:((t=(e.match(/vimeo\.com\/(\w*\/)*(\d+)/i)||[])[2])||(t=(e.match(/^\d+$/i)||[])[0]),t?{type:"vimeo",id:t}:{type:"youtube",id:e})},sn=function e(t){return"short"===t?Object(b.__)("Description for this block. You can use this space for describing your block.",a.i18n):"medium"===t?"".concat(e()," ").concat(e("short")):"long"===t?"".concat(e("medium")," ").concat(e()," ").concat(e("short")):Object(b.__)("Description for this block. Use this space for describing your block. Any text will do.",a.i18n)},un=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Object(S.applyFilters)("stackable.util.hex-to-rgba",null,e,t);if(n)return n;var a=Object(S.applyFilters)("stackable.util.hex-to-rgba.hex",e,t);if(a.indexOf("var(")>-1){var i=a.match(/--(.*?(?=,))/g);a=i?window.getComputedStyle(document.documentElement).getPropertyValue(i[0])||"#fff":window.getComputedStyle(document.documentElement).getPropertyValue(a.replace("var(","").replace(")",""))||"#fff"}(a=a.replace(/#/,"")).length<=4&&(a=a.replace(/#?(.)(.)(.)/,"$1$1$2$2$3$3"));var o=rt()("#".concat(a,"ff"));return o[3]=null!==t?t:1,"rgba(".concat(o.join(", "),")")},bn=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.replace(/\/\*.*?\*\//g,"").replace(/\n\s*\n/g,"").replace(/[\n\r \t]/g," ").replace(/ +/g," ").replace(/ ?([,:;{}]) ?/g,"$1").replace(/[^\}\{]+\{\}/g,"").replace(/[^\}\{]+\{\}/g,"").replace(/;}/g,"}").trim();return t?n.replace(/\s?\!important/g,"").replace(/([;\}])/g," !important$1").replace(/\} !important\}/g,"}}").trim():n},pn=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(e||"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/(.*)?\n/g,"").replace(/([^}]+)({)/g,function(e,i,o){if(i.match(/@\w+/g))return i.replace(/(@\w+[^{]+{\s*)([^{]+)/g,function(e,a,i){var r=gn(i,t,n);return"".concat(a," ").concat(r," ").concat(o)});var r=gn(i,t,n);return(a?"#editor ":"")+"".concat(r," ").concat(o)}).trim()},mn={},gn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i="".concat(e,"-").concat(t,"-").concat(n,"-").concat(a);if(mn[i])return mn[i];var o=e.trim().replace(/[\n\s\t]+/g," ").split(",").map(function(e){var i="";return i=n&&t?e.includes(n)?e:n&&!t?".".concat(n," ").concat(e.trim()):".".concat(n," ").concat(e.trim()).replace(new RegExp("(.".concat(n,") (.").concat(t,"(#|:|\\[|\\.|\\s|$))"),"g"),"$1$2"):e,a?"".concat(a," ").concat(i):i}).join(", ");return mn[i]=o,o},dn="desktop",fn=function(){return dn},hn=function(e){return dn=e},vn=!1,yn=function(){return vn},On=function(e){return vn=e},wn=function(e,t,n){return e.splice(t1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[n(t)];return 0===i?i:i||a},r=Object.keys(i.a).reduce(function(e,i){var r;return p({},e,(m(r={},"".concat(i,"Url"),a("".concat(i,"Url"))),m(r,"onChange".concat(Object(o.upperFirst)(i),"Url"),function(e){return t(m({},n("".concat(i,"Url")),e))}),r))},{});return wp.element.createElement(k,u({design:a("Design",e.designDefault),size:a("Size","normal"),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),useSocialColors:a("UseSocialColors"),newTab:a("NewTab"),onChangeNewTab:function(e){return t(m({},n("NewTab"),e))},isSelected:e.isSelected},r,e))};g.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(g.Content=function(e){var t=function(t){return Object(o.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[t(n)];return 0===i?i:i||a},a=Object.keys(i.a).reduce(function(e,t){return p({},e,m({},"".concat(t,"Url"),n("".concat(t,"Url"))))},{});return wp.element.createElement(k.Content,u({design:n("Design",e.designDefault),size:n("Size","normal"),newTab:n("NewTab"),hoverEffect:n("HoverEffect"),useSocialColors:n("UseSocialColors"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow")},a,e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};var d=g;function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function h(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Ae=function(e){var t=e.imageSizes,n=e.value,a=e.className,i=Pe(e,["imageSizes","value","className"]),r=function(e){return Object(o.map)(e,function(e){var t=e.name;return{value:e.slug,label:t}})}(t);return Object(o.isEmpty)(r)?null:wp.element.createElement(P.SelectControl,Te({},i,{value:n||"large",options:r,className:l()(a,["ugb--help-tip-image-size"])}))};Ae.defaultProps={className:"",label:Object(s.__)("Image Size"),value:"large",imageSizes:[],onChange:function(){}};var Ne=Object(Y.compose)([Object(Ee.withSelect)(function(e){return{imageSizes:e("core/block-editor").getSettings().imageSizes}})])(Ae),Me=function(e){var t=e.label,n=e.setAttributes,a=e.enablePaddingTop,i=e.enablePaddingRight,o=e.enablePaddingBottom,r=e.enablePaddingLeft,l=e.attributes,s=l.columnPaddingTop,u=void 0===s?"":s,b=l.columnPaddingBottom,p=void 0===b?"":b,m=l.columnPaddingRight,g=void 0===m?"":m,d=l.columnPaddingLeft,f=void 0===d?"":d,h=l.columnPaddingUnit,v=void 0===h?"px":h,y=l.tabletColumnPaddingTop,O=void 0===y?"":y,w=l.tabletColumnPaddingBottom,_=void 0===w?"":w,k=l.tabletColumnPaddingRight,j=void 0===k?"":k,C=l.tabletColumnPaddingLeft,x=void 0===C?"":C,E=l.tabletColumnPaddingUnit,S=void 0===E?"px":E,B=l.mobileColumnPaddingTop,T=void 0===B?"":B,P=l.mobileColumnPaddingBottom,A=void 0===P?"":P,N=l.mobileColumnPaddingRight,M=void 0===N?"":N,R=l.mobileColumnPaddingLeft,D=void 0===R?"":R,F=l.mobileColumnPaddingUnit,L=void 0===F?"px":F;return wp.element.createElement(c.Fragment,null,wp.element.createElement(pr,{label:t,className:"ugb--help-tip-advanced-column-paddings",defaultLocked:!0,min:[0,0,0],max:[500,30,100],step:1,valueDesktop:{top:u,right:g,bottom:p,left:f},valueDesktopUnit:v,onChangeDesktop:function(e){n({columnPaddingTop:e.top,columnPaddingRight:e.right,columnPaddingBottom:e.bottom,columnPaddingLeft:e.left})},onChangeDesktopUnit:function(e){return n({columnPaddingUnit:e})},valueTablet:{top:O,right:_,bottom:j,left:x},valueTabletUnit:S,onChangeTablet:function(e){n({tabletColumnPaddingTop:e.top,tabletColumnPaddingBottom:e.right,tabletColumnPaddingRight:e.bottom,tabletColumnPaddingLeft:e.left})},onChangeTabletUnit:function(e){return n({tabletColumnPaddingUnit:e})},valueMobile:{top:T,right:A,bottom:M,left:D},valueMobileUnit:L,onChangeMobile:function(e){n({mobileColumnPaddingTop:e.top,mobileColumnPaddingBottom:e.right,mobileColumnPaddingRight:e.bottom,mobileColumnPaddingLeft:e.left})},onChangeMobileUnit:function(e){return n({mobileColumnPaddingUnit:e})},enableTop:a,enableRight:i,enableBottom:o,enableLeft:r}))};Me.defaultProps={setAttributes:function(){},label:Object(s.__)("Column Paddings",L.i18n),attributes:{},enablePaddingTop:!0,enablePaddingRight:!0,enablePaddingBottom:!0,enablePaddingLeft:!0};var Re=Me;function De(){return(De=Object.assign||function(e){for(var t=1;t1&&this.props.screens.map(function(t,n){return n>0&&!e.state.isScreenPickerOpen&&!e.state.isMouseOver?null:wp.element.createElement("div",{key:n},wp.element.createElement(W,{className:e.state.screen===t?"is-active":"",onClick:function(){return e.onChangeScreen(t)},icon:Xe[t],showTooltip:!1,label:$e[t],"data-screen":t,onMouseEnter:function(){return e.setState({isMouseOver:t})},onMouseLeave:function(){return e.setState({isMouseOver:!1})}}),e.state.isMouseOver===t&&wp.element.createElement(P.Popover,{focusOnMount:!1,position:"bottom center",className:"components-tooltip","aria-hidden":"true"},$e[t]))}))}}])&&qe(n.prototype,a),o&&qe(n,o),t}();Qe.defaultProps={screens:["desktop"],onChangeScreen:function(){}};var Ze=Object(Y.withInstanceId)(Qe),et=function(e){return wp.element.createElement("div",{className:"ugb-base-control-multi-label"},wp.element.createElement("div",{className:"ugb-base-control-multi-label__label components-base-control__label"},e.label),wp.element.createElement(Ze,{screens:e.screens,onChangeScreen:e.onChangeScreen}),wp.element.createElement("div",{className:"ugb-base-control-multi-label__units"},e.units.length>1&&e.units.map(function(t,n){return wp.element.createElement("button",{key:n,className:e.unit===t?"is-active":"",onClick:function(){return e.onChangeUnit(t)}},t)}),e.afterButton))};et.defaultProps={label:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],onChangeScreen:function(){},afterButton:null};var tt=et;function nt(){return(nt=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var ot=!!P.__experimentalNumberControl,rt=function(e){var t=e.allowReset,n=e.withInputField,a=e.isShiftStepEnabled,i=it(e,["allowReset","withInputField","isShiftStepEnabled"]),r=at(Object(c.useState)(""===e.value||isNaN(e.value)?"":e.value),2),u=r[0],b=r[1],p=function(t){if(b(t),!isNaN(t)){var n=parseFloat(t);if(!isNaN(n))return void e.onChange(Object(o.clamp)(n,e.min,e.max))}e.onChange(e.resetFallbackValue)},m=l()(["ugb-range-control",e.className],{"ugb-range-control--blank":""===u}),g=""===u,d=e.initialPosition||e.placeholder||"",f=function(e,t,n){var a=(e-t)/(n-t)*100;return"".concat(Object(o.clamp)(a,0,100),"%")}((g?d:u)||e.sliderMin||e.min||0,e.sliderMin||e.min||0,e.sliderMax||e.max||100);return wp.element.createElement("div",{className:m,style:{"--ugb-advanced-range-control--width":f}},wp.element.createElement(P.RangeControl,nt({},i,{initialPosition:"",onChange:p,withInputField:!1,allowReset:!1,max:null!==e.sliderMax?e.sliderMax:e.max,min:null!==e.sliderMin?e.sliderMin:e.min})),n&&ot&&wp.element.createElement(P.__experimentalNumberControl,{disabled:e.disabled,isShiftStepEnabled:a,max:e.max,min:e.min,onChange:p,onBlur:function(){if(!isNaN(u)){var t=parseFloat(u);if(!isNaN(t))return void b(Object(o.clamp)(t,e.min,e.max))}b(e.resetFallbackValue)},shiftStep:e.shiftStep,step:e.step,value:u,placeholder:null!==e.placeholder?e.placeholder:d}),t&&wp.element.createElement(W,{className:"components-range-control__reset",disabled:e.disabled,isSecondary:!0,isSmall:!0,onClick:function(){b(e.resetFallbackValue),e.onChange(e.resetFallbackValue)}},Object(s.__)("Reset",L.i18n)))};rt.defaultProps={className:"",allowReset:!1,withInputField:!0,isShiftStepEnabled:!0,max:1/0,min:-1/0,sliderMax:null,sliderMin:null,shiftStep:10,step:1,resetFallbackValue:"",placeholder:null,initialPosition:0,onChange:function(){}};var lt=rt;function ct(e){return(ct="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 st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bt=function(e){var t=function(e){for(var t=1;t0});return a.length?a[0].options[0].label:e},Ct=function(e){return e.value},xt=function(e){return wp.element.createElement("div",{className:"ugb--autosuggest-group"},e.title)},Et=function(e){return e.options},St=function(){return!0},Bt=function(e){function t(){var e,n,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(e=!(a=yt(t).apply(this,arguments))||"object"!==_t(a)&&"function"!=typeof a?Ot(n):a).state={value:e.props.value,label:e.props.value?jt(e.props.value,e.props.options):e.props.value,suggestions:[],isEmpty:!1},e.onSuggestionsFetchRequested=e.onSuggestionsFetchRequested.bind(Ot(e)),e.onSuggestionsClearRequested=e.onSuggestionsClearRequested.bind(Ot(e)),e.onChange=e.onChange.bind(Ot(e)),e.onFocus=e.onFocus.bind(Ot(e)),e.autosuggestDiv=Object(c.createRef)(),e}var n,a,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wt(e,t)}(t,c["Component"]),n=t,(a=[{key:"onChange",value:function(e,t){var n=t.newValue;this.props.onChange(n),this.setState({value:n,label:jt(n,this.props.options)})}},{key:"onFocus",value:function(){var e=this;this.props.highlightValueOnFocus&&setTimeout(function(){var t=e.autosuggestDiv.current.querySelector('[data-value="'.concat(e.state.value,'"]'));t&&t.scrollIntoView()},0)}},{key:"onSuggestionsFetchRequested",value:function(e){var t=e.value,n=e.reason;if("input-focused"!==n&&"suggestion-selected"!==n){var a=function(e,t){var n=e.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!n)return t;var a=new RegExp(n,"i");return kt(t)?t.map(function(e){return{title:e.title,options:e.options.filter(function(e){return a.test(e.label)||a.test(e.value)})}}).filter(function(e){return e.options.length>0}):t.filter(function(e){return a.test(e.label)||a.test(e.value)})}(t,this.props.options);this.setState({suggestions:a,isEmpty:""!==t.trim()&&0===a.length})}else this.setState({suggestions:this.props.options,isEmpty:!1})}},{key:"onSuggestionsClearRequested",value:function(){this.setState({suggestions:[]})}},{key:"render",value:function(){var e=this,t=this.state,n=t.label,a=t.suggestions,i={placeholder:"",value:n,onChange:this.onChange,onFocus:this.onFocus,type:"search"};return wp.element.createElement(P.BaseControl,{help:this.props.help,className:l()("ugb-advanced-autosuggest-control",this.props.className)},wp.element.createElement(tt,{label:this.props.label,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-advanced-autosuggest-control__select",ref:this.autosuggestDiv},wp.element.createElement(ht.a,{multiSection:kt(this.props.options),suggestions:a,focusInputOnSuggestionClick:!1,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:Ct,renderSuggestion:function(t){return wp.element.createElement("div",{className:"ugb-autosuggest-option","data-value":t.value,id:"ugb-autosuggest-option--".concat(t.id||Object(o.kebabCase)(t.value))},e.props.renderOption?e.props.renderOption(t):t.label)},renderSectionTitle:xt,getSectionSuggestions:Et,shouldRenderSuggestions:St,inputProps:i}),this.state.isEmpty&&wp.element.createElement("div",{className:"ugb--autosuggest-empty"},this.props.noMatchesLabel),this.props.children))}}])&&vt(n.prototype,a),i&&vt(n,i),t}();Bt.defaultProps={onChange:function(){},help:"",className:"",screens:["desktop"],options:[],value:"",noMatchesLabel:Object(s.__)("No matches found",L.i18n),renderOption:null,highlightValueOnFocus:!1};var Tt=Bt;function Pt(){return(Pt=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?1:Math.round(parseFloat(e)/parseFloat(t)*10)/10};return"string"==typeof t&&(t=[t,n(t)]),wp.element.createElement(pt,ln({},e,{placeholder:t,onChangeUnit:function(t){""!==e.value&&("em"===t||"rem"===t?e.onChange(n(e.value)):"px"===t&&e.onChange(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21;return""===e?21:Math.round(parseFloat(e)*t)}(e.value))),e.onChangeUnit(t)}}))};cn.defaultProps={label:Object(s.__)("Font Size",L.i18n),value:"",onChange:function(){},unit:"px",onChangeUnit:function(){},min:[0,0],max:[150,7],step:[1,.05],units:["px","em"],placeholder:""};var sn=cn;function un(){return(un=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var hn=Object(gn.a)(function(e){var t=e.children;return wp.element.createElement("div",{className:"ugb-sort-control__container"},t)}),vn=Object(gn.b)(function(e){var t=e.value,n=(e.key,e.index,fn(e,["value","key","index"]));return wp.element.createElement("div",dn({className:"ugb-sort-control__item"},n),t)}),yn=!1,On=function e(t){for(var n=t.values?t.values.splice(0,t.num):Object(o.range)(t.num).map(function(e){return e+1});n.length=4?0:this.state.slide+1;this.setState({slide:e})}},{key:"prev",value:function(){var e=this.state.slide<=0?4:this.state.slide-1;this.setState({slide:e})}},{key:"render",value:function(){var e=this.props.tag;return wp.element.createElement(e,null,wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=".concat(this.props.buttonUtmSource,"&utm_campaign=learnmore&utm_medium=gutenberg"),target:"_premium",onClick:this.open,className:this.props.buttonClassName},this.props.button),this.state.isOpen&&wp.element.createElement(P.Modal,{className:"ugb-pro-modal",onRequestClose:this.close},wp.element.createElement("img",{src:"https://da4bu55kgdxvv.cloudfront.net/premium-popup.jpg",alt:Object(s.__)("Premium features",L.i18n)}),wp.element.createElement("div",{className:"ugb-pro-modal__footer"},wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=editor-modal-popup&utm_campaign=upgrade&utm_medium=gutenberg",className:"button button-secondary",target:"_premium",title:Object(s.__)("Upgrade to Premium",L.i18n)},wp.element.createElement(Kn.x,null),Object(s.__)("Upgrade to Premium",L.i18n)),wp.element.createElement("a",{href:"https://demo.wpstackable.com?utm_source=editor-modal-popup&utm_campaign=trydemo&utm_medium=gutenberg",target:"_premium",title:Object(s.__)("Try Premium Demo",L.i18n)},Object(s.__)("Try Premium Demo",L.i18n)))))}}])&&Jn(n.prototype,a),i&&Jn(n,i),t}();Zn.defaultProps={button:Object(s.__)("Learn More",L.i18n),buttonClassName:"button button-secondary",tag:"div",buttonUtmSource:"editor-learn-more"};var ea=Zn;function ta(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var na=function(e){var t,n,a,i=e.designId,o=e.image,r=e.label,s=e.onClick,u=e.plan,b=e.isPro,p=ta(Object(c.useState)(!1),2),m=p[0],g=p[1],d=ta(Object(c.useState)(!1),2),f=d[0],h=d[1],v=l()(["ugb-design-library-item"],(t={"ugb--is-busy":m},n="ugb--is-".concat(u),a=!b&&"free"!==u,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement("div",{className:v,onMouseEnter:function(){return h(!0)},onMouseLeave:function(){return h(!1)}},m&&wp.element.createElement("span",{className:"ugb-design-library-item__spinner","data-testid":"spinner"},wp.element.createElement(P.Spinner,null)),!b&&"free"!==u&&wp.element.createElement("span",{className:"ugb-design-library-item__premium","data-testid":"premium-tag"},u),wp.element.createElement("button",{className:"ugb-design-library-item__image",onClick:function(){(b||"free"===u)&&(g(!0),Object(Wn.b)(i).then(function(e){g(!1),s(e)}))}},!b&&"free"!==u&&wp.element.createElement(P.Dashicon,{icon:"lock"}),wp.element.createElement("img",{src:o,alt:r,loading:"lazy"})),wp.element.createElement("footer",null,(b||"free"===u)&&wp.element.createElement("span",null,r),!b&&"free"!==u&&!f&&wp.element.createElement("span",null,r),!b&&"free"!==u&&f&&wp.element.createElement(ea,{buttonClassName:"ugb-design-library-item__premium-link",button:wp.element.createElement(c.Fragment,null,e.premiumLabel)})))};na.defaultProps={designId:"",image:"",label:"",onClick:function(){},plan:"free",isPro:L.isPro,premiumLabel:Object(s.__)("Go Premium",L.i18n)};var aa=na;var ia=function(e){var t,n,a,i=e.designs,o=e.isBusy,r=e.onSelect,c=l()(["ugb-design-library-items"],(t={},n="ugb-design-library-items--columns-".concat(e.columns),a=!o&&e.columns,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement("div",{className:c},(i||[]).map(function(e,t){return wp.element.createElement(aa,{key:t,type:e.type,block:e.block,template:e.template,plan:e.plan,designId:e.id,image:e.image,label:e.label,onClick:function(e){r(e)}})}),o&&wp.element.createElement("div",{className:"ugb-design-library-search__spinner","data-testid":"spinner"},wp.element.createElement(P.Spinner,null)),!o&&!(i||[]).length&&wp.element.createElement("p",{className:"components-base-control__help","data-testid":"nothing-found-note"},Object(s.__)("No designs found",L.i18n)))};ia.defaultProps={designs:[],columns:1,onSelect:function(){},isBusy:!1};var oa=ia;n(384);function ra(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function la(e){for(var t=1;t0&&void 0!==o[0]?o[0]:"icon",n=o.length>1&&void 0!==o[1]?o[1]:L.fontAwesomeSearchProIcons,a='{ search(version: "latest", first: 50, query: "'.concat((t||"info").replace(/["'\\]/g,""),'") {\n\t\t\tid\n\t\t\tmembership {\n\t\t\t\tfree\n\t\t\t\t').concat(n?"pro":"","\n\t\t\t}\n\t\t} }"),e.next=5,fetch("https://api.fontawesome.com",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:a})}).then(function(e){return e.json()});case 5:return i=e.sent,e.abrupt("return",i.data.search.reduce(function(e,t){return Oi(t,n).forEach(function(t){e.push(t)}),e},[]));case 7:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments;return new Promise(function(a,i){var o=e.apply(t,n);function r(e){vi(o,a,i,r,l,"next",e)}function l(e){vi(o,a,i,r,l,"throw",e)}r(void 0)})});return function(){return t.apply(this,arguments)}}(),Oi=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[].concat(hi(e.membership.free),hi(t?e.membership.pro.filter(function(t){return!e.membership.free.includes(t)}):[]));return n.map(function(t){return{className:"fa".concat(t[0]," fa-").concat(e.id),prefix:"fa".concat(t[0]),iconName:e.id}})},wi=n(77);function _i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ki=null,ji=null,Ci=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ugb-custom-icon";return e.match(/(]*class=["'])/)?e.replace(/(]*class=["'])/,"$1".concat(t," ")):e.match(/()([\s\S]*)/g,"$1"),n=0;n<2;n++)t=t.replace(/\s*([\s\S]*?)<\/g>\s*/gm,"$1");return t},Ei=function(e){var t=_i(Object(c.useState)(""),2),n=t[0],a=t[1],o=_i(Object(c.useState)([]),2),r=o[0],u=o[1],b=_i(Object(c.useState)(!1),2),p=b[0],m=b[1],g=_i(Object(c.useState)(!1),2),d=g[0],f=g[1],h=e.returnSVGValue;Object(c.useEffect)(function(){var e=!0;return clearTimeout(ki),ki=setTimeout(function(){e&&(m(!0),yi(n).then(function(t){e&&u(t)}).finally(function(){e&&m(!1)}))},500),function(){e=!1,clearTimeout(ki)}},[n]),Object(c.useEffect)(function(){ji||(ji=wp.data.select("core/block-editor").getSettings().mediaUpload),d?wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:null}):wp.data.select("core/block-editor").getSettings().mediaUpload!==ji&&wp.data.dispatch("core/block-editor").updateSettings({mediaUpload:ji})},[d]);var v=l()(["ugb-icon-popover__label-container"],{"ugb-icon--has-settings":L.isPro,"ugb-icon--has-upload":h,"ugb-icon--has-reset":e.allowReset});return wp.element.createElement(P.Popover,{className:"ugb-icon-popover",onClose:e.onClose,onClickOutside:e.onClickOutside,position:e.position,anchorRef:e.anchorRef},wp.element.createElement(P.PanelBody,null,wp.element.createElement(wi.FileDrop,{onFrameDragEnter:function(){return f(!0)},onFrameDragLeave:function(){return f(!1)},onFrameDrop:function(){return f(!1)},onDrop:function(t){if(h&&t.length)if("image/svg+xml"===t[0].type){var n=new FileReader;n.onload=function(t){f(!1);var n=xi(Ci(t.target.result));e.onChange(n),e.onClose()},n.readAsText(t[0])}else f(!1);else f(!1)}},wp.element.createElement("div",{className:v},wp.element.createElement(P.TextControl,{className:"ugb-icon-popover__input",value:n,onChange:a,placeholder:Object(s.__)("Type to search icon",L.i18n)}),L.isPro&&wp.element.createElement(W,{className:"ugb-icon-popover__settings-button",icon:"admin-generic",href:L.settingsUrl+"#icon-settings",target:"_settings",iconSize:"16",label:Object(s.__)("Icon Settings",L.i18n),showTooltip:!0,isSmall:!0,isSecondary:!0}),h&&wp.element.createElement(W,{onClick:function(t){t.preventDefault();var n=document.createElement("input");n.accept="image/svg+xml",n.type="file",n.onchange=function(t){var n=t.target.files;if(n.length){var a=new FileReader;a.onload=function(t){f(!1);var n=xi(Ci(t.target.result));e.onChange(n),e.onClose()},a.readAsText(n[0])}else f(!1)},n.click()},isSmall:!0,isPrimary:!0,className:"components-range-control__upload"},Object(s.__)("Upload SVG",L.i18n)),e.allowReset&&wp.element.createElement(W,{onClick:function(){e.onChange(""),e.onClose()},isSmall:!0,isSecondary:!0,className:"components-range-control__reset"},Object(s.__)("Clear icon",L.i18n))),wp.element.createElement("div",{className:"ugb-icon-popover__iconlist"},p&&wp.element.createElement(P.Spinner,null),!p&&r.map(function(t,n){var a=t.prefix,o=t.iconName,r="".concat(a,"-").concat(o);return wp.element.createElement("button",{key:n,className:"components-button ugb-prefix--".concat(a," ugb-icon--").concat(o),onClick:function(){e.returnSVGValue?e.onChange(xi(Object(i.O)(a,o))):e.onChange(r,a,o),e.onClose()}},wp.element.createElement(yg,{prefix:a,iconName:o}))}),!p&&!r.length&&wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("No matches found",L.i18n))),h&&d&&wp.element.createElement("div",{className:"ugb-icon-popover__drop-indicator"},wp.element.createElement(fi,{height:"40",width:"40"}),Object(s.__)("Drop your SVG here",L.i18n)))))};Ei.defaultProps={onChange:function(){},onClose:function(){},onClickOutside:function(){},returnSVGValue:!0,allowReset:!0,anchorRef:void 0,position:"center"};var Si=Ei,Bi=function(e){return wp.element.createElement(gs,{attrNameTemplate:"%sContentAlign",setAttributes:e.setAttributes,blockAttributes:e.blockAttributes},wp.element.createElement(Xs,{label:e.label,className:l()([e.className,"ugb--help-tip-alignment-all"])}))};Bi.defaultProps={className:"",setAttributes:function(){},blockAttributes:{},label:Object(s.__)("Align",L.i18n)};var Ti=Bi,Pi=function(){return wp.element.createElement("hr",{className:"ugb-control-separator"})};function Ai(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Ni=function(e){var t=e.color||"transparent";if(Array.isArray(t)){var n=Ai(t,2),a=n[0],i=n[1];t="linear-gradient(90deg, ".concat(a||"transparent",", ").concat(i||"transparent",")")}var o=l()(["components-circular-option-picker__option-wrapper","ugb-button-icon-popover-control-color-preview"],{"ugb-button-icon-popover-control-color-preview--transparent":!t||"transparent"===t});return wp.element.createElement(c.Fragment,null,wp.element.createElement("div",{className:o},wp.element.createElement(W,{className:"components-circular-option-picker__option",label:Object(s.__)("Selected color",L.i18n),style:{background:t},onClick:e.onClick,ref:e._ref}),e.children))};Ni.defaultProps={color:"",onClick:function(){},_ref:null};var Mi=Ni;function Ri(){return(Ri=Object.assign||function(e){for(var t=1;t0)&&wp.element.createElement(P.ToggleControl,{label:Object(s.__)("Fixed Background",L.i18n),checked:e.fixedBackground,onChange:e.onChangeFixedBackground,className:"ugb--help-tip-background-fixed"}),e.hasAdvancedBackground&&e.onChangeBackgroundMedia&&(e.backgroundMediaURL||e.tabletBackgroundMediaURL||e.mobileBackgroundMediaURL)&&wp.element.createElement($i,{label:Object(s.__)("Adv. Background Image Settings",L.i18n),onReset:e.onResetAdvancedBackground,allowReset:e.backgroundPosition||e.tabletBackgroundPosition||e.mobileBackgroundPosition||e.backgroundRepeat||e.tabletBackgroundRepeat||e.mobileBackgroundRepeat||e.backgroundSize||e.tabletBackgroundSize||e.mobileBackgroundSize||e.backgroundImageBlendMode},wp.element.createElement(ws,null,wp.element.createElement(gt,{label:Object(s.__)("Image Position",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("Top Left",L.i18n),value:"top left"},{label:Object(s.__)("Top Center",L.i18n),value:"top center"},{label:Object(s.__)("Top Right",L.i18n),value:"top right"},{label:Object(s.__)("Center Left",L.i18n),value:"center left"},{label:Object(s.__)("Center Center",L.i18n),value:"center center"},{label:Object(s.__)("Center Right",L.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",L.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",L.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",L.i18n),value:"bottom right"}],value:e.backgroundPosition,onChange:e.onChangeBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(ws,{screen:"tablet"},wp.element.createElement(gt,{label:Object(s.__)("Image Position",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("Top Left",L.i18n),value:"top left"},{label:Object(s.__)("Top Center",L.i18n),value:"top center"},{label:Object(s.__)("Top Right",L.i18n),value:"top right"},{label:Object(s.__)("Center Left",L.i18n),value:"center left"},{label:Object(s.__)("Center Center",L.i18n),value:"center center"},{label:Object(s.__)("Center Right",L.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",L.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",L.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",L.i18n),value:"bottom right"}],value:e.tabletBackgroundPosition,onChange:e.onChangeTabletBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(ws,{screen:"mobile"},wp.element.createElement(gt,{label:Object(s.__)("Image Position",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("Top Left",L.i18n),value:"top left"},{label:Object(s.__)("Top Center",L.i18n),value:"top center"},{label:Object(s.__)("Top Right",L.i18n),value:"top right"},{label:Object(s.__)("Center Left",L.i18n),value:"center left"},{label:Object(s.__)("Center Center",L.i18n),value:"center center"},{label:Object(s.__)("Center Right",L.i18n),value:"center right"},{label:Object(s.__)("Bottom Left",L.i18n),value:"bottom left"},{label:Object(s.__)("Bottom Center",L.i18n),value:"bottom center"},{label:Object(s.__)("Bottom Right",L.i18n),value:"bottom right"}],value:e.mobileBackgroundPosition,onChange:e.onChangeMobileBackgroundPosition,className:"ugb--help-tip-background-image-position"})),wp.element.createElement(ws,null,wp.element.createElement(gt,{label:Object(s.__)("Image Repeat",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("No-Repeat",L.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",L.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",L.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",L.i18n),value:"repeat-y"}],value:e.backgroundRepeat,onChange:e.onChangeBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(ws,{screen:"tablet"},wp.element.createElement(gt,{label:Object(s.__)("Image Repeat",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("No-Repeat",L.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",L.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",L.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",L.i18n),value:"repeat-y"}],value:e.tabletBackgroundRepeat,onChange:e.onChangeTabletBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(ws,{screen:"mobile"},wp.element.createElement(gt,{label:Object(s.__)("Image Repeat",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("No-Repeat",L.i18n),value:"no-repeat"},{label:Object(s.__)("Repeat",L.i18n),value:"repeat"},{label:Object(s.__)("Repeat-X",L.i18n),value:"repeat-x"},{label:Object(s.__)("Repeat-Y",L.i18n),value:"repeat-y"}],value:e.mobileBackgroundRepeat,onChange:e.onChangeMobileBackgroundRepeat,className:"ugb--help-tip-background-image-repeat"})),wp.element.createElement(ws,null,wp.element.createElement(gt,{label:Object(s.__)("Image Size",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("Auto",L.i18n),value:"auto"},{label:Object(s.__)("Cover",L.i18n),value:"cover"},{label:Object(s.__)("Contain",L.i18n),value:"contain"},{label:Object(s.__)("Custom",L.i18n),value:"custom"}],value:e.backgroundSize,onChange:e.onChangeBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(ws,{screen:"tablet"},wp.element.createElement(gt,{label:Object(s.__)("Image Size",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("Auto",L.i18n),value:"auto"},{label:Object(s.__)("Cover",L.i18n),value:"cover"},{label:Object(s.__)("Contain",L.i18n),value:"contain"},{label:Object(s.__)("Custom",L.i18n),value:"custom"}],value:e.tabletBackgroundSize,onChange:e.onChangeTabletBackgroundSize,className:"ugb--help-tip-background-image-size"})),wp.element.createElement(ws,{screen:"mobile"},wp.element.createElement(gt,{label:Object(s.__)("Image Size",L.i18n),options:[{label:Object(s.__)("Default",L.i18n),value:""},{label:Object(s.__)("Auto",L.i18n),value:"auto"},{label:Object(s.__)("Cover",L.i18n),value:"cover"},{label:Object(s.__)("Contain",L.i18n),value:"contain"},{label:Object(s.__)("Custom",L.i18n),value:"custom"}],value:e.mobileBackgroundSize,onChange:e.onChangeMobileBackgroundSize,className:"ugb--help-tip-background-image-size"})),"custom"===e.backgroundSize&&wp.element.createElement(ws,null,wp.element.createElement(pt,{label:Object(s.__)("Custom Size",L.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.backgroundCustomSizeUnit,onChangeUnit:e.onChangeBackgroundCustomSizeUnit,value:e.backgroundCustomSize,onChange:e.onChangeBackgroundCustomSize,allowReset:!0})),"custom"===e.tabletBackgroundSize&&wp.element.createElement(ws,{screen:"tablet"},wp.element.createElement(pt,{label:Object(s.__)("Custom Size",L.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.tabletBackgroundCustomSizeUnit,onChangeUnit:e.onChangeTabletBackgroundCustomSizeUnit,value:e.tabletBackgroundCustomSize,onChange:e.onChangeTabletBackgroundCustomSize,allowReset:!0})),"custom"===e.mobileBackgroundSize&&wp.element.createElement(ws,{screen:"mobile"},wp.element.createElement(pt,{label:Object(s.__)("Custom Size",L.i18n),units:["px","%","vw"],min:[0,0,0],max:[1e3,100,100],unit:e.mobileBackgroundCustomSizeUnit,onChangeUnit:e.onChangeMobileBackgroundCustomSizeUnit,value:e.mobileBackgroundCustomSize,onChange:e.onChangeMobileBackgroundCustomSize,allowReset:!0})),e.onChangeBackgroundImageBlendMode&&wp.element.createElement(ie,{label:Object(s.__)("Image Blend Mode",L.i18n),value:e.backgroundImageBlendMode,onChange:e.onChangeBackgroundImageBlendMode})))};vo.defaultProps={backgroundColorType:"",backgroundColor:"",backgroundColorOpacity:"",backgroundColor2:"",backgroundMediaID:"",backgroundMediaURL:"",tabletBackgroundMediaID:"",tabletBackgroundMediaURL:"",mobileBackgroundMediaID:"",mobileBackgroundMediaURL:"",backgroundTintStrength:"",fixedBackground:"",onChangeBackgroundColorType:function(){},onChangeBackgroundColor:function(){},onChangeBackgroundColorOpacity:function(){},onChangeBackgroundColor2:function(){},onChangeBackgroundMedia:function(e){e.url,e.id},onChangeTabletBackgroundMedia:function(e){e.url,e.id},onChangeMobileBackgroundMedia:function(e){e.url,e.id},onChangeBackgroundTintStrength:function(){},onChangeFixedBackground:function(){},labelBackgroundColorType:Object(s.__)("Background Color Type",L.i18n),labelBackgroundColor:Object(s.__)("Background Color",L.i18n),hasAdvancedGradient:!0,backgroundGradientDirection:"",backgroundGradientBlendMode:"",backgroundGradientLocation1:0,backgroundGradientLocation2:100,onResetAdvancedGradient:function(){},onChangeBackgroundGradientDirection:function(){},onChangeBackgroundGradientBlendMode:function(){},onChangeBackgroundGradientLocation1:function(){},onChangeBackgroundGradientLocation2:function(){},hasAdvancedBackground:!0,backgroundMediaAllowVideo:!0,backgroundPosition:"",tabletBackgroundPosition:"",mobileBackgroundPosition:"",backgroundRepeat:"",tabletBackgroundRepeat:"",mobileBackgroundRepeat:"",backgroundSize:"",tabletBackgroundSize:"",mobileBackgroundSize:"",backgroundCustomSize:"",tabletBackgroundCustomSize:"",mobileBackgroundCustomSize:"",backgroundCustomSizeUnit:"%",tabletBackgroundCustomSizeUnit:"%",mobileBackgroundCustomSizeUnit:"%",backgroundImageBlendMode:"",onResetAdvancedBackground:function(){},onChangeBackgroundPosition:function(){},onChangeTabletBackgroundPosition:function(){},onChangeMobileBackgroundPosition:function(){},onChangeBackgroundRepeat:function(){},onChangeTabletBackgroundRepeat:function(){},onChangeMobileBackgroundRepeat:function(){},onChangeBackgroundSize:function(){},onChangeTabletBackgroundSize:function(){},onChangeMobileBackgroundSize:function(){},onChangeBackgroundCustomSize:function(){},onChangeTabletBackgroundCustomSize:function(){},onChangeMobileBackgroundCustomSize:function(){},onChangeBackgroundCustomSizeUnit:function(){},onChangeTabletBackgroundCustomSizeUnit:function(){},onChangeMobileBackgroundCustomSizeUnit:function(){},onChangeBackgroundImageBlendMode:function(){}};var yo=vo;function Oo(){return(Oo=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[n(t)];return 0===i?i:i||a};return wp.element.createElement(yo,Oo({backgroundColorType:e.blockAttributes[n("BackgroundColorType")]||"",backgroundColor:e.blockAttributes[n("BackgroundColor")]||"",backgroundColorOpacity:e.blockAttributes[n("BackgroundColorOpacity")],backgroundColor2:e.blockAttributes[n("BackgroundColor2")]||"",backgroundMediaID:e.blockAttributes[n("BackgroundMediaID")]||"",backgroundMediaURL:e.blockAttributes[n("BackgroundMediaURL")]||"",tabletBackgroundMediaID:e.blockAttributes[n("TabletBackgroundMediaID")]||"",tabletBackgroundMediaURL:e.blockAttributes[n("TabletBackgroundMediaURL")]||"",mobileBackgroundMediaID:e.blockAttributes[n("MobileBackgroundMediaID")]||"",mobileBackgroundMediaURL:e.blockAttributes[n("MobileBackgroundMediaURL")]||"",backgroundTintStrength:e.blockAttributes[n("BackgroundTintStrength")],fixedBackground:e.blockAttributes[n("FixedBackground")]||"",onChangeBackgroundColorType:function(e){return t(wo({},n("BackgroundColorType"),e))},onChangeBackgroundColor:function(e){return t(wo({},n("BackgroundColor"),e))},onChangeBackgroundColorOpacity:function(e){return t(wo({},n("BackgroundColorOpacity"),e))},onChangeBackgroundColor2:function(e){return t(wo({},n("BackgroundColor2"),e))},onChangeBackgroundMedia:function(e){var a,i=e.url,o=e.id;t((wo(a={},n("BackgroundMediaURL"),i),wo(a,n("BackgroundMediaID"),o),a))},onChangeTabletBackgroundMedia:function(e){var a,i=e.url,o=e.id;t((wo(a={},n("TabletBackgroundMediaURL"),i),wo(a,n("TabletBackgroundMediaID"),o),a))},onChangeMobileBackgroundMedia:function(e){var a,i=e.url,o=e.id;t((wo(a={},n("MobileBackgroundMediaURL"),i),wo(a,n("MobileBackgroundMediaID"),o),a))},onChangeBackgroundTintStrength:function(e,a){var i;t((wo(i={},n("BackgroundTintStrength"),e),wo(i,n("BackgroundColor"),a),i))},onChangeFixedBackground:function(e){return t(wo({},n("FixedBackground"),e))},backgroundGradientDirection:a("BackgroundGradientDirection",90),backgroundGradientBlendMode:a("BackgroundGradientBlendMode"),backgroundGradientLocation1:a("BackgroundGradientLocation1",0),backgroundGradientLocation2:a("BackgroundGradientLocation2",100),onChangeBackgroundGradientDirection:function(e){return t(wo({},n("BackgroundGradientDirection"),e))},onChangeBackgroundGradientBlendMode:function(e){return t(wo({},n("BackgroundGradientBlendMode"),e))},onChangeBackgroundGradientLocation1:function(e){return t(wo({},n("BackgroundGradientLocation1"),e))},onChangeBackgroundGradientLocation2:function(e){return t(wo({},n("BackgroundGradientLocation2"),e))},onResetAdvancedGradient:function(){var e;t((wo(e={},n("BackgroundGradientDirection"),""),wo(e,n("BackgroundGradientBlendMode"),""),wo(e,n("BackgroundGradientLocation1"),""),wo(e,n("BackgroundGradientLocation2"),""),e))},backgroundPosition:e.blockAttributes[n("BackgroundPosition")]||"",tabletBackgroundPosition:e.blockAttributes[n("TabletBackgroundPosition")]||"",mobileBackgroundPosition:e.blockAttributes[n("MobileBackgroundPosition")]||"",backgroundRepeat:e.blockAttributes[n("BackgroundRepeat")]||"",tabletBackgroundRepeat:e.blockAttributes[n("TabletBackgroundRepeat")]||"",mobileBackgroundRepeat:e.blockAttributes[n("MobileBackgroundRepeat")]||"",backgroundSize:e.blockAttributes[n("BackgroundSize")]||"",tabletBackgroundSize:e.blockAttributes[n("TabletBackgroundSize")]||"",mobileBackgroundSize:e.blockAttributes[n("MobileBackgroundSize")]||"",backgroundCustomSize:e.blockAttributes[n("BackgroundCustomSize")]||"",tabletBackgroundCustomSize:e.blockAttributes[n("TabletBackgroundCustomSize")]||"",mobileBackgroundCustomSize:e.blockAttributes[n("MobileBackgroundCustomSize")]||"",backgroundCustomSizeUnit:e.blockAttributes[n("BackgroundCustomSizeUnit")]||"%",tabletBackgroundCustomSizeUnit:e.blockAttributes[n("TabletBackgroundCustomSizeUnit")]||"%",mobileBackgroundCustomSizeUnit:e.blockAttributes[n("MobileBackgroundCustomSizeUnit")]||"%",backgroundImageBlendMode:e.blockAttributes[n("BackgroundImageBlendMode")]||"",onChangeBackgroundPosition:function(e){return t(wo({},n("BackgroundPosition"),e))},onChangeTabletBackgroundPosition:function(e){return t(wo({},n("TabletBackgroundPosition"),e))},onChangeMobileBackgroundPosition:function(e){return t(wo({},n("MobileBackgroundPosition"),e))},onChangeBackgroundRepeat:function(e){return t(wo({},n("BackgroundRepeat"),e))},onChangeTabletBackgroundRepeat:function(e){return t(wo({},n("TabletBackgroundRepeat"),e))},onChangeMobileBackgroundRepeat:function(e){return t(wo({},n("MobileBackgroundRepeat"),e))},onChangeBackgroundSize:function(e){return t(wo({},n("BackgroundSize"),e))},onChangeTabletBackgroundSize:function(e){return t(wo({},n("TabletBackgroundSize"),e))},onChangeMobileBackgroundSize:function(e){return t(wo({},n("MobileBackgroundSize"),e))},onChangeBackgroundCustomSize:function(e){return t(wo({},n("BackgroundCustomSize"),e))},onChangeTabletBackgroundCustomSize:function(e){return t(wo({},n("TabletBackgroundCustomSize"),e))},onChangeMobileBackgroundCustomSize:function(e){return t(wo({},n("MobileBackgroundCustomSize"),e))},onChangeBackgroundCustomSizeUnit:function(e){return t(wo({},n("BackgroundCustomSizeUnit"),e))},onChangeTabletBackgroundCustomSizeUnit:function(e){return t(wo({},n("TabletBackgroundCustomSizeUnit"),e))},onChangeMobileBackgroundCustomSizeUnit:function(e){return t(wo({},n("MobileBackgroundCustomSizeUnit"),e))},onChangeBackgroundImageBlendMode:function(e){return t(wo({},n("BackgroundImageBlendMode"),e))},onResetAdvancedBackground:function(){var e;t((wo(e={},n("BackgroundPosition"),""),wo(e,n("TabletBackgroundPosition"),""),wo(e,n("MobileBackgroundPosition"),""),wo(e,n("BackgroundRepeat"),""),wo(e,n("TabletBackgroundRepeat"),""),wo(e,n("MobileBackgroundRepeat"),""),wo(e,n("BackgroundSize"),""),wo(e,n("TabletBackgroundSize"),""),wo(e,n("MobileBackgroundSize"),""),wo(e,n("BackgroundCustomSize"),""),wo(e,n("TabletBackgroundCustomSize"),""),wo(e,n("MobileBackgroundCustomSize"),""),wo(e,n("BackgroundCustomSizeUnit"),"%"),wo(e,n("TabletBackgroundCustomSizeUnit"),"%"),wo(e,n("MobileBackgroundCustomSizeUnit"),"%"),wo(e,n("BackgroundImageBlendMode"),""),e))}},e))};_o.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{}};var ko=_o,jo=n(78),Co=n.n(jo),xo=n(79),Eo=n.n(xo),So=n(80),Bo=n.n(So),To=n(81),Po=n.n(To);function Ao(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t$/g)?t:t.match(//g)||[t])[0]:t},yr=function(e){var t=dr({},e,{value:"string"==typeof e.value?vr(e.value):e.value}),n=l()(["ugb-icon-inner-svg",e.className],fr({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(yg,mr({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var i=l()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],fr({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:i},a)}return e.showBackgroundShape&&(a=hr(a,e.backgroundShape)),a=Object(J.applyFilters)("stackable.component.svg-icon",a,t)};yr.defaultProps={className:"",value:"",design:"",colorType:"",showBackgroundShape:!1,backgroundShape:"",shadow:"",gradientColor1:"",gradientColor2:"",gradientDirection:0},(yr.Content=function(e){var t=dr({},e,{value:"string"==typeof e.value?vr(e.value):e.value}),n=l()(["ugb-icon-inner-svg",e.className],fr({},"ugb-icon--".concat(e.colorType),e.colorType&&"single"!==e.colorType)),a=wp.element.createElement(yg.Content,mr({},t,{className:n}));if("shaped"===e.design||"outlined"===e.design){var i=l()(["ugb-icon__design-wrapper","ugb-icon__design-".concat(e.design)],fr({},"ugb--shadow-".concat(e.shadow),e.shadow&&"shaped"===e.design));a=wp.element.createElement("div",{className:i},a)}return e.showBackgroundShape&&(a=hr(a,e.backgroundShape)),a=Object(J.applyFilters)("stackable.component.svg-icon",a,t)}).defaultProps=dr({},yr.defaultProps);var Or=yr;function wr(){return(wr=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Cr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var xr=Object(Y.withInstanceId)(function(e){var t=Cr(Object(c.useState)(!1),2),n=t[0],a=t[1],i=Cr(Object(c.useState)(!1),2),o=i[0],r=i[1],l=e.instanceId,s=e.isOpen,u=e.onChange,b=jr(e,["instanceId","isOpen","onChange"]);return Object(c.useEffect)(function(){e.onToggle(n)},[n]),wp.element.createElement("div",{className:"ugb-svg-icon-placeholder ugb-svg-icon-placeholder-".concat(l)},wp.element.createElement(W,{className:"ugb-svg-icon-placeholder__button",onClick:function(){o?(a(!1),r(!1)):a(!0)}},wp.element.createElement(kr,b)),(null!==s&&s||null===s&&n)&&wp.element.createElement(Si,{onClickOutside:function(e){e.target&&e.target.closest(".ugb-svg-icon-placeholder-".concat(l))?r(!0):(a(!1),r(!1))},onClose:function(){return a(!1)},onChange:u}))});xr.defaultProps={isOpen:null,className:"",value:"",onChange:function(){},onToggle:function(){}};var Er=xr;function Sr(){return(Sr=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeTop",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Qr({},this.getEnabledValues(),{top:n}))}},{key:"onChangeRight",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Qr({},this.getEnabledValues(),{right:n}))}},{key:"onChangeBottom",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Qr({},this.getEnabledValues(),{bottom:n}))}},{key:"onChangeLeft",value:function(e){var t=e.target.value,n=t||0===t?t:"";this.state.locked?this.props.onChange(this.filterOnlyEnabled({top:n,right:n,bottom:n,left:n})):this.props.onChange(Qr({},this.getEnabledValues(),{left:n}))}},{key:"render",value:function(){var e=this.props.instanceId,t="ugb-four-number-control-".concat(e,"__item-");return wp.element.createElement(P.BaseControl,{help:this.props.help,className:l()("ugb-four-number-control",this.props.className)},wp.element.createElement(tt,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens}),wp.element.createElement("div",{className:"ugb-four-number-control__wrapper"},wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-top")},wp.element.createElement("input",{id:"".concat(t,"-top"),type:"number",onChange:this.onChangeTop,"aria-label":Object(s.__)("Top",L.i18n),value:this.props.top,placeholder:this.props.enableTop?"":Object(s.__)("auto",L.i18n),disabled:!this.props.enableTop}),wp.element.createElement("span",null,Object(s.__)("Top",L.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-right")},wp.element.createElement("input",{id:"".concat(t,"-right"),type:"number",onChange:this.onChangeRight,"aria-label":this.props.label,value:this.props.right,placeholder:this.props.enableRight?"":Object(s.__)("auto",L.i18n),disabled:!this.props.enableRight}),wp.element.createElement("span",null,Object(s.__)("Right",L.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-bottom")},wp.element.createElement("input",{id:"".concat(t,"-bottom"),type:"number",onChange:this.onChangeBottom,"aria-label":this.props.label,value:this.props.bottom,placeholder:this.props.enableBottom?"":Object(s.__)("auto",L.i18n),disabled:!this.props.enableBottom}),wp.element.createElement("span",null,Object(s.__)("Bottom",L.i18n))),wp.element.createElement("label",{className:"ugb-four-number-control__label",htmlFor:"".concat(t,"-left")},wp.element.createElement("input",{id:"".concat(t,"-left"),type:"number",onChange:this.onChangeLeft,"aria-label":this.props.label,value:this.props.left,placeholder:this.props.enableLeft?"":Object(s.__)("auto",L.i18n),disabled:!this.props.enableLeft}),wp.element.createElement("span",null,Object(s.__)("Left",L.i18n))),wp.element.createElement(W,{className:this.state.locked?"ugb--is-locked":"",onClick:this.onToggleLock,icon:wp.element.createElement(P.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})})))}}])&&tl(n.prototype,a),i&&tl(n,i),t}();ol.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0};Object(Y.withInstanceId)(ol);function rl(){return(rl=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.pick)(e,this.getEnabledLocations())}},{key:"onToggleLock",value:function(){this.setState({locked:!this.state.locked})}},{key:"onChangeAll",value:function(e){var t=e||0===e?e:"";this.props.onChange(this.filterOnlyEnabled({top:t,right:t,bottom:t,left:t}))}},{key:"onChangeTop",value:function(e){this.props.onChange(xl({},this.getEnabledValues(),{top:e||0===e?e:""}))}},{key:"onChangeRight",value:function(e){this.props.onChange(xl({},this.getEnabledValues(),{right:e||0===e?e:""}))}},{key:"onChangeBottom",value:function(e){this.props.onChange(xl({},this.getEnabledValues(),{bottom:e||0===e?e:""}))}},{key:"onChangeLeft",value:function(e){this.props.onChange(xl({},this.getEnabledValues(),{left:e||0===e?e:""}))}},{key:"render",value:function(){var e=this.props,t=e.instanceId,n=e.units,a=e.unit,i="ugb-four-range-control-".concat(t,"__item-"),o={min:this.props.min,max:this.props.max,step:this.props.step,placeholder:this.props.placeholder,initialPosition:this.props.initialPosition,sliderMin:this.props.sliderMin,sliderMax:this.props.sliderMax},r=n.indexOf(a)<0?0:n.indexOf(a);Array.isArray(this.props.min)&&(o.min=this.props.min[r]),Array.isArray(this.props.max)&&(o.max=this.props.max[r]),Array.isArray(this.props.sliderMin)&&(o.sliderMin=this.props.sliderMin[r]),Array.isArray(this.props.sliderMax)&&(o.sliderMax=this.props.sliderMax[r]),Array.isArray(this.props.step)&&(o.step=this.props.step[r]),Array.isArray(this.props.placeholder)&&(o.placeholder=this.props.placeholder[r]),Array.isArray(this.props.initialPosition)&&(o.initialPosition=this.props.initialPosition[r]);var u=l()(["ugb-four-range-control__lock"],{"ugb--is-locked":this.state.locked}),b=wp.element.createElement(W,{className:u,onClick:this.onToggleLock,icon:wp.element.createElement(P.Dashicon,{icon:this.state.locked?"admin-links":"editor-unlink",size:"16"})});return wp.element.createElement(P.BaseControl,{help:this.props.help,className:l()("ugb-four-range-control",this.props.className,{"ugb--locked":this.state.locked})},wp.element.createElement(tt,{label:this.props.label,units:this.props.units,unit:this.props.unit,onChangeUnit:this.props.onChangeUnit,screens:this.props.screens,afterButton:b}),this.state.locked&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(pt,kl({id:"".concat(i,"-all"),value:this.firstValue(),onChange:this.onChangeAll,allowReset:!0},o))),!this.state.locked&&wp.element.createElement(c.Fragment,null,this.props.enableTop&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Top",L.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(wl,null))),wp.element.createElement(pt,kl({id:"".concat(i,"-top"),value:this.props.top,onChange:this.onChangeTop,allowReset:!0},o,{placeholder:this.props.placeholderTop||o.placeholder}))),this.props.enableRight&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Right",L.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(hl,null))),wp.element.createElement(pt,kl({id:"".concat(i,"-right"),value:this.props.right,onChange:this.onChangeRight,allowReset:!0},o,{placeholder:this.props.placeholderRight||o.placeholder}))),this.props.enableBottom&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Bottom",L.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(sl,null))),wp.element.createElement(pt,kl({id:"".concat(i,"-bottom"),value:this.props.bottom,onChange:this.onChangeBottom,allowReset:!0},o,{placeholder:this.props.placeholderBottom||o.placeholder}))),this.props.enableLeft&&wp.element.createElement("div",{className:"ugb-four-range-control__range"},wp.element.createElement(P.Tooltip,{text:Object(s.__)("Left",L.i18n)},wp.element.createElement("span",{className:"ugb-four-range-control__icon"},wp.element.createElement(ml,null))),wp.element.createElement(pt,kl({id:"".concat(i,"-left"),value:this.props.left,onChange:this.onChangeLeft,allowReset:!0},o,{placeholder:this.props.placeholderLeft||o.placeholder})))))}}])&&Sl(n.prototype,a),i&&Sl(n,i),t}();Al.defaultProps={onChange:function(){},defaultLocked:!0,top:"",right:"",bottom:"",left:"",units:["px"],unit:"px",onChangeUnit:function(){},screens:["desktop"],enableTop:!0,enableRight:!0,enableBottom:!0,enableLeft:!0,min:0,max:50,sliderMin:null,sliderMax:null,step:1,placeholder:"",placeholderTop:"",placeholderRight:"",placeholderBottom:"",placeholderLeft:"",initialPosition:""};var Nl=Al,Ml=n(85),Rl=n.n(Ml),Dl=n(86),Fl=n.n(Dl),Ll=n(87),Ul=n.n(Ll),zl=n(88),Hl=n.n(zl),Il=n(89),Wl=n.n(Il),Vl=n(90),Gl=n.n(Vl),ql=n(91),Kl=n.n(ql),Yl=n(92),Jl=n.n(Yl),Xl=n(93),$l=n.n(Xl),Ql=n(94),Zl=n.n(Ql),ec=n(95),tc=n.n(ec),nc=n(96),ac=n.n(nc),ic=n(97),oc=n.n(ic),rc=n(98),lc=n.n(rc),cc=n(99),sc=n.n(cc),uc=n(100),bc=n.n(uc),pc=n(101),mc=n.n(pc),gc=n(102),dc=n.n(gc),fc=n(103),hc=n.n(fc),vc=n(104),yc=n.n(vc),Oc=n(105),wc=n.n(Oc),_c=n(106),kc=n.n(_c),jc=n(107),Cc=n.n(jc),xc=n(108),Ec=n.n(xc),Sc=n(109),Bc=n.n(Sc),Tc=n(110),Pc=n.n(Tc),Ac=n(111),Nc=n.n(Ac),Mc=n(112),Rc=n.n(Mc),Dc=n(113),Fc=n.n(Dc),Lc=n(114),Uc=n.n(Lc),zc=n(38);function Hc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ic(){return(Ic=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"right";if("left"===t)for(var n=e.length-1;n>=1;n--)if(e[n]<10){var a=10-e[n];e[n]=10,e[n-1]-=a}for(var i=0;i=1;r--)if(e[r]<10){var l=10-e[r];e[r]=10,e[r-1]-=l}return e};function Yc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Jc(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);te[i]?"right":"left",!0)}),[a,n]}(a,i),2);r[0];(function(e,t,n){var a=Qc(e),i=Kc(a,n);return Zc(i)})(i,0,r[1]).forEach(function(e,n){t[n].val=e})}return t},step:1,onUpdate:function(t){return e.onChange(Qc(t))},domain:$c,values:Zc(e.value)},wp.element.createElement(zc.b,null,function(e){var t=e.getRailProps;return wp.element.createElement(Gc,{getRailProps:t})}),wp.element.createElement(zc.a,null,function(e){var t=e.handles,n=e.getHandleProps;return wp.element.createElement("div",{className:"slider-handles"},t.map(function(e){return wp.element.createElement(qc,{key:e.id,handle:e,domain:$c,getHandleProps:n})}))}))};es.defaultProps={onChange:function(){},value:[]};var ts=es;function ns(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"";return Object(o.camelCase)(Object(s.sprintf)(e.attrNameTemplate,t))},n=Object(i.b)(e.blockAttributes,t,""),a=e.screens;return wp.element.createElement(c.Fragment,null,a.includes("desktop")&&wp.element.createElement(ws,{screens:a},c.Children.toArray(e.children).map(function(a){return Object(c.cloneElement)(a,{value:n(),onChange:function(n){e.onChange?e.onChange(t(),n,""):e.setAttributes(ps({},t(),n))}})})),a.includes("tablet")&&wp.element.createElement(ws,{screens:a,screen:"tablet"},c.Children.toArray(e.children).map(function(a){return Object(c.cloneElement)(a,{value:n("Tablet"),placeholder:n("Tablet")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Tablet"),n,"Tablet"):e.setAttributes(ps({},t("Tablet"),n))}})})),a.includes("mobile")&&wp.element.createElement(ws,{screens:a,screen:"mobile"},c.Children.toArray(e.children).map(function(a){return Object(c.cloneElement)(a,{value:n("Mobile"),placeholder:n("Mobile")||a.props.placeholder,onChange:function(n){e.onChange?e.onChange(t("Mobile"),n,"Mobile"):e.setAttributes(ps({},t("Mobile"),n))}})})))};ms.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},onChange:null,placeholder:"",screens:["desktop","tablet","mobile"]};var gs=ms;function ds(e){return(ds="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 fs(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Zs={Edit:function(e){var t=e.blockProps,n=e.render,a=e.mainClass,i=e.blockTag,o=Qs(e,["blockProps","render","mainClass","blockTag"]),r=t.blockName,c=t.attributes,s=c.anchor,u=void 0===s?"":s,b=c.design,p=c.blockTag,m=void 0===p?"div":p,g=l()([e.className],Object(J.applyFilters)("stackable.".concat(r,".main-block.classes"),{"ugb-main-block":a},t)),d=l()(["ugb-inner-block"],Object(J.applyFilters)("stackable.".concat(r,".main-block.inner-classes"),{},t)),f=""!==u?u:void 0,h=m||i||"div";return wp.element.createElement(h,$s({},o,{id:f,className:g}),t.styles,Object(J.applyFilters)("stackable.".concat(r,".edit.output.outer"),null,b,t),n&&wp.element.createElement("div",{className:d},Object(J.applyFilters)("stackable.".concat(r,".edit.output.before"),null,b,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(J.applyFilters)("stackable.".concat(r,".edit.output.after"),null,b,t)))}};Zs.Edit.defaultProps={styles:null,mainClass:!0},Zs.Save=function(e){var t=e.blockProps,n=e.render,a=e.mainClass,i=e.blockTag,o=Qs(e,["blockProps","render","mainClass","blockTag"]),r=t.blockName,c=t.attributes,s=c.anchor,u=void 0===s?"":s,b=c.design,p=c.blockTag,m=void 0===p?"div":p,g=l()([e.className],Object(J.applyFilters)("stackable.".concat(r,".main-block.classes"),{"ugb-main-block":a},t)),d=l()(["ugb-inner-block"],Object(J.applyFilters)("stackable.".concat(r,".main-block.inner-classes"),{},t)),f=""!==u?u:void 0,h=m||i||"div";return wp.element.createElement(h,$s({},o,{id:f,className:g}),t.styles,Object(J.applyFilters)("stackable.".concat(r,".save.output.outer"),null,b,t),n&&wp.element.createElement("div",{className:d},Object(J.applyFilters)("stackable.".concat(r,".save.output.before"),null,b,t),wp.element.createElement("div",{className:"ugb-block-content"},n(t)),Object(J.applyFilters)("stackable.".concat(r,".save.output.after"),null,b,t)))},Zs.Save.defaultProps={styles:null,mainClass:!0};var eu=Zs,tu=n(35),nu=n(14),au=n.n(nu);function iu(e){return(iu="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 ou(e,t){for(var n=0;n0?i(n[0]):void 0),l=o(n),c=1===l.length&&l[0]&&"ugb/container"===l[0].name;return{isGroupable:r&&l.length&&!c,isUngroupable:c&&!!l[0].innerBlocks.length,blocksSelection:l,groupingBlockName:"ugb/container"}}),Object(Ee.withDispatch)(function(e,t){var n=t.clientIds,a=t.onToggle,i=void 0===a?o.noop:a,r=t.blocksSelection,l=void 0===r?[]:r,c=e("core/block-editor").replaceBlocks;return{onConvertToGroup:function(){if(l.length){var e=l.map(function(e){return Object(Am.cloneBlock)(e)}),t=Object(Am.createBlock)("ugb/container",{},e);c(n,t),i()}},onConvertFromGroup:function(){if(l.length){var e=l[0].innerBlocks;e.length&&(c(n,e),i())}}}})])(function(e){var t=e.onConvertToGroup,n=e.onConvertFromGroup,a=e.isGroupable,i=void 0!==a&&a,o=e.isUngroupable,r=void 0!==o&&o;return Object(Ee.select)("core/block-editor").getSelectedBlockClientIds?wp.element.createElement(c.Fragment,null,i&&wp.element.createElement(Nm.PluginBlockSettingsMenuItem,{icon:Mm,label:Object(s.__)("Group into Container",L.i18n),onClick:t}),r&&wp.element.createElement(Nm.PluginBlockSettingsMenuItem,{icon:Rm,label:Object(s.__)("Ungroup from Container",L.i18n),onClick:n})):null}),Fm=Object(Ee.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientIds;return t?{clientIds:t()}:{}})(Dm),Lm=Object(Y.withState)({openPopover:!1,changed:!1})(function(e){var t=e.blockName,n=e.openPopover,a=e.changed,i=e.setState,r=e.getJSONBlockAttributes,l=e.setJSONBlockAttributes;return wp.element.createElement(c.Fragment,null,wp.element.createElement(Nm.PluginBlockSettingsMenuItem,{icon:"editor-code",label:"Get / Set Block Attributes",onClick:function(){i({openPopover:!0,changed:!1}),setTimeout(function(){return document.querySelector(".ugb-modal-get-block-attributes-button textarea").select()},100)}}),n&&wp.element.createElement(P.Modal,{title:"".concat(Object(o.startCase)(t)," Block Attributes"),focusOnMount:!0,className:"ugb-modal-get-block-attributes-button",onRequestClose:function(){if(a){var e=document.querySelector(".ugb-modal-get-block-attributes-button textarea").value;l(e)}i({openPopover:!1})}},wp.element.createElement("p",null,'Copy or modify the attributes of the block directly. Use only double quotes "'),wp.element.createElement("textarea",{onChange:function(){return i({changed:!0})}},r())))}),Um=Object(Y.compose)([Object(Ee.withSelect)(function(e,t){var n=t.clientId,a=e("core/block-editor").getBlockName;return{blockName:n&&a(n)?a(n).replace(/^\w+\//g,""):"",getJSONBlockAttributes:function(){var t=e("core/block-editor").getBlockName,a=e("core/blocks").getBlockType;if(!n)return{};var i=e("core/block-editor").getBlockAttributes(n),o=t(n).replace(/^\w+\//g,""),r=a(t(n)).attributes,l=Object.keys(i).reduce(function(e,t){return i[t]!==(r[t]?r[t].default:"")&&(e[t]=i[t]),e},{});return l.uniqueClass=void 0,JSON.stringify(Object(J.applyFilters)("stackable.".concat(o,".design.filtered-block-attributes"),l),null,4)}}}),Object(Ee.withDispatch)(function(e,t){var n=t.clientId;return{setJSONBlockAttributes:function(e){if(n)try{var t=JSON.parse(e);Object(i.e)(t,n)}catch(e){console.error(e)}}}})])(Lm),zm=Object(Ee.withSelect)(function(e){var t=e("core/block-editor").getSelectedBlockClientId;return t?{clientId:t()}:{}})(Um);function Hm(){return(Hm=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Wm=function(e){var t=e.blockTag,n=e.className,a=e.backgroundAttrName,o=e.blockProps,r=e.showBackground,c=e.showVideoBackground,s=Im(e,["blockTag","className","backgroundAttrName","blockProps","showBackground","showVideoBackground"]),u=l()([n],{"ugb--has-background-overlay":r&&Object(i.Z)(a,o.attributes)});return wp.element.createElement(t,Hm({className:u},s),e.children,r&&c&&Object(i.L)(a,o))};Wm.defaultProps={className:"",backgroundAttrName:"%s",blockProps:{},showBackground:!0,showVideoBackground:!0,blockTag:"div"};var Vm=Wm,Gm=function(e){return wp.element.createElement(P.Modal,{title:Object(s.__)("Stackable Welcome Guide",L.i18n),className:"ugb-modal-welcome-video",overlayClassName:"ugb-modal-welcome-video__overlay",shouldCloseOnClickOutside:!1,onRequestClose:e.onRequestClose},wp.element.createElement("p",null,Object(s.__)("Hello there 👋 I see you might be new to Stackable, we've made a short 3-minute video so you can make the most out of our unique blocks.",L.i18n)),wp.element.createElement("iframe",{title:Object(s.__)("Video Tutorial",L.i18n),width:"800",height:"413",src:"https://www.youtube.com/embed/UW0Rg96aATA",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),wp.element.createElement("p",null,wp.element.createElement(W,{className:"button-primary",onClick:e.onRequestClose,"data-testid":"button-close"},Object(s.__)("Close it, I'm good",L.i18n))))};Gm.defaultProps={onRequestClose:function(){}};var qm=Gm;function Km(){return(Km=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.createHigherOrderComponent)(function(n){var o,c;return c=o=function(o){function c(){return m(this,c),f(this,h(c).apply(this,arguments))}return v(c,l["Component"]),d(c,[{key:"render",value:function(){var o=r()([this.props.className,this.props.attributes.uniqueClass]),l=this.props.blockName,c=Object(i.applyFilters)("stackable.".concat(l,".styles"),e(this.props),this.props),s=wp.element.createElement(a.l,{blockUniqueClassName:this.props.attributes.uniqueClass,blockMainClassName:this.props.mainClassName,style:c,editorMode:t.editorMode||!1});return wp.element.createElement(n,p({},this.props,{className:o,styles:s}))}}]),c}(),O(o,"propTypes",{attributes:u.a.shape({uniqueClass:u.a.string.isRequired}),blockName:u.a.string.isRequired,mainClassName:u.a.string.isRequired}),O(o,"defaultProps",{attributes:{},blockName:"",className:"",mainClassName:""}),c},"withBlockStyles")},_=n(2);function k(e){return(k="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 j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return Object(c.createHigherOrderComponent)(function(t){var n,a;return a=n=function(n){function a(){return j(this,a),E(this,S(a).apply(this,arguments))}return B(a,l["Component"]),x(a,[{key:"componentDidMount",value:function(){var t=this.props.blockName;Object(i.addFilter)("stackable.".concat(t,".setAttributes"),"stackable/".concat(t,"/contentAlign"),function(n){var a=Object(i.applyFilters)("stackable.with-content-align-reseter.attributeNamesToReset",e,t);return["","Tablet","Mobile"].forEach(function(e){void 0!==n[Object(_.R)("%sContentAlign",e)]&&a.forEach(function(t){n[Object(_.R)(t,e)]=""})}),n})}},{key:"render",value:function(){return wp.element.createElement(t,this.props)}}]),a}(),P(n,"defaultProps",{attributes:{},blockName:""}),a},"withContentAlignReseter")};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)}function M(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return function(t){var n=function(n){var o=n.blockName,r=ie(Object(l.useState)(null),2),c=r[0],s=r[1],u=Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.style.block"),null,n);return wp.element.createElement(l.Fragment,null,Object(i.applyFilters)("stackable.edit.inspector.before",null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.before"),null,n),wp.element.createElement(ee.InspectorControls,null,wp.element.createElement(a.ib,{tabs:e,blockProps:n,onTabFirstOpen:s,onClick:s}),(!c||"layout"===c)&&wp.element.createElement(a.db,null,Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.layout.before"),null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.layout.after"),null,n)),(!c||"style"===c)&&wp.element.createElement(a.db,{tab:"style"},Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.style.before"),null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.style.after"),null,n),u&&wp.element.createElement("div",{className:"ugb-panel-controls-separator",role:"presentation"},"— — —"),u),(!c||"advanced"===c)&&wp.element.createElement(a.db,{tab:"advanced"},Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.advanced.before"),null,n),Object(i.applyFilters)("stackable.".concat(o,".edit.inspector.advanced.after"),null,n))),wp.element.createElement(t,n))};return n.defaultProps=ne({},t.defaultProps||{},{attributes:{},blockName:""}),n}};function re(e){return(re="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 le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ce(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&(this.props.attributes.uniqueClass=a):this.props.attributes.uniqueClass=a}},{key:"render",value:function(){return wp.element.createElement(e,this.props)}}])&&se(a.prototype,i),o&&se(a,o),n}(),me(t,"defaultProps",{attributes:{},clientId:"",setAttributes:function(){}}),n},"withUniqueClass");Object(i.addFilter)("stackable.user-design-library.save.ignore","stackable/unique-class",function(e){return[].concat(ce(e),["uniqueClass"])}),Object(i.addFilter)("stackable.block.attributes","stackable/unique-class",function(e){return function(e){for(var t=1;t * > *",".ugb-block-content > *",".ugb-content-wrapper",".ugb-top-separator",".ugb-bottom-separator",".ugb-inner-block",".ugb-main-block"],Ce=function(e,t,n){void 0===ke[e]&&(ke[e]={}),ke[e][t]=n},xe=function(e){return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return Object(c.createHigherOrderComponent)(function(t){return function(n){function a(){var t;Se(this,a);var n=(t=Pe(this,Ae(a).apply(this,arguments))).props.blockName;return e.forEach(function(e){Ce(n,e[0],e[1])}),t}return Ne(a,l["Component"]),Te(a,[{key:"render",value:function(){return wp.element.createElement(t,this.props)}}]),a}()},"withClickOpenInspector")};function De(e){return(De="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 Fe(){return(Fe=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Qe=function(e){var t=e.image,n=e.label,a=e.className,i=$e(e,["image","label","className"]),o=t?t.match(/https?:/i)?t:Ve.srcUrl?"".concat(Ve.srcUrl,"/").concat(t):t:"",l="free"!==i.plan,c=l&&!Ve.isPro&&Ve.showProNotice;if(l&&!Ve.isPro&&!Ve.showProNotice)return null;var s=r()(["ugb-design-layout-selector__item",a],{"is-premium":i.plan&&!Ve.isPro&&"free"!==i.plan,"is-locked":c}),u=c?"div":"button";return wp.element.createElement(u,Xe({className:s},i),wp.element.createElement("div",{className:"ugb-design-layout-selector__wrapper"},c&&wp.element.createElement(Ke.Icon,{className:"ugb-design-layout-selector__lock",icon:"lock"}),c&&wp.element.createElement("a",{href:"https://wpstackable.com/upgrade/?utm_source=design-library-learn-more&utm_campaign=learnmore&utm_medium=gutenberg",className:"ugb-design-layout-selector__item-premium-button ugb-shadow-4 button button-secondary",target:"_premium",title:Object(qe.__)("Learn More",Ve.i18n)},Object(qe.__)("Learn More",Ve.i18n)),wp.element.createElement("img",{className:"ugb-design-layout-selector__image",src:o,alt:n})),wp.element.createElement("div",{className:"ugb-design-layout-selector__label"},n))};Qe.defaultProps={name:"",label:"",className:""};var Ze=Qe;function et(){return(et=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[n(t)];return 0===i?i:i||a};return wp.element.createElement(S,d({design:a("Design",e.designDefault),size:a("Size","normal"),text:a("Text",""),shadow:a("Shadow"),hoverEffect:a("HoverEffect"),ghostToNormalEffect:a("HoverGhostToNormal"),icon:a("Icon"),iconPosition:a("IconPosition"),onChange:function(e){return t(f({},n("Text"),e))},url:a("Url"),newTab:a("NewTab"),noFollow:a("NoFollow"),onChangeUrl:function(e){return t(f({},n("Url"),e))},onChangeNewTab:function(e){return t(f({},n("NewTab"),e))},onChangeNoFollow:function(e){return t(f({},n("NoFollow"),e))},onChangeIcon:function(e){return t(f({},n("Icon"),e))},isSelected:e.isSelected},e))};h.defaultProps={attrNameTemplate:"%s",setAttributes:function(){},blockAttributes:{},designDefault:"basic"},(h.Content=function(e){var t=function(t){return Object(g.camelCase)(Object(r.sprintf)(e.attrNameTemplate,t))},n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.blockAttributes[t(n)];return 0===i?i:i||a};return wp.element.createElement(S.Content,d({design:n("Design",e.designDefault),size:n("Size","normal"),text:n("Text"),icon:n("Icon"),newTab:n("NewTab"),url:n("Url"),noFollow:n("NoFollow"),hoverEffect:n("HoverEffect"),ghostToNormalEffect:n("HoverGhostToNormal"),shadow:n("Shadow"),iconPosition:n("IconPosition")},e))}).defaultProps={attrNameTemplate:"%s",blockAttributes:{},designDefault:"basic"};var v=h;function y(){return(y=Object.assign||function(e){for(var t=1;t0&&void 0!==a[0]&&a[0],c&&!t){e.next=9;break}return e.next=4,o()({path:"/wp/v2/stk_design_library".concat(t?"/reset":""),method:"GET"});case 4:return n=e.sent,e.next=7,n;case 7:c=e.sent,t&&(s={},u=[]);case 9:return e.abrupt("return",c);case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),m=function(){var e=l(regeneratorRuntime.mark(function e(t){var n,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=b(t),s[n]){e.next=8;break}return e.next=4,o()({path:"/wp/v2/stk_block_designs/".concat(n),method:"GET"});case 4:return a=e.sent,e.next=7,a;case 7:s[n]=e.sent;case 8:return e.abrupt("return",s[n]);case 9:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),g=function(){var e=l(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u[t]){e.next=7;break}return e.next=3,o()({path:"/wp/v2/stk_design/".concat(t),method:"GET"});case 3:return n=e.sent,e.next=6,n;case 6:u[t]=e.sent;case 7:return e.abrupt("return",u[t]);case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=l(regeneratorRuntime.mark(function e(){var t,n,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]&&a[0],e.next=3,o()({path:"/wp/v2/stk_design_library_dev_mode/",method:"POST",data:{devmode:t}});case 3:return n=e.sent,e.next=6,n;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();Object(a.a)(function(){});var f=function(){var e=l(regeneratorRuntime.mark(function e(t){var n,a,i,o,r,l,c,s,u,b,m,g,d,f,h,v,y,O;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.type,a=void 0===n?"":n,i=t.block,o=void 0===i?"":i,r=t.mood,l=void 0===r?"":r,c=t.plan,s=void 0===c?"":c,u=t.colors,b=void 0===u?[]:u,m=t.categories,g=void 0===m?[]:m,d=t.search,f=void 0===d?"":d,h=t.reset,v=void 0!==h&&h,e.t0=Object,e.next=4,p(v);case 4:return e.t1=e.sent,y=e.t0.values.call(e.t0,e.t1),a&&(y=y.filter(function(e){return e.type===a})),o&&(O=-1===o.indexOf("ugb/")?"ugb/".concat(o):o,y=y.filter(function(e){return e.block===O})),l&&(y=y.filter(function(e){return e.mood===l})),s&&(y=y.filter(function(e){return e.plan===s})),b&&b.length&&(y=y.filter(function(e){return e.colors.some(function(e){return b.includes(e)})})),g&&g.length&&(y=y.filter(function(e){return e.categories.some(function(e){return g.includes(e)})})),f&&f.toLowerCase().replace(/\s+/," ").trim().split(" ").forEach(function(e){y=y.filter(function(t){return["label","plan","block","tags","categories","colors"].some(function(n){return-1!==t[n].toString().toLowerCase().indexOf(e)})})}),e.abrupt("return",y);case 14:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),h=function(){var e=l(regeneratorRuntime.mark(function e(t){var n,a,i,o,r,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p();case 2:if(n=e.sent,a=n[t],i=a.type,o=a.block,r=a.template,"block"!==i||!o){e.next=12;break}return e.next=8,m(o);case 8:return l=e.sent,e.abrupt("return",l[t]);case 12:if(!r){e.next=16;break}return e.next=15,g(t);case 15:return e.abrupt("return",e.sent);case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=l(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Object,e.next=3,p();case 3:return e.t1=e.sent,t=e.t0.values.call(e.t0,e.t1),e.abrupt("return",t.reduce(function(e,t){var n=t.block,a=t.type;return e.includes(n)||"block"!==a||e.push(n),e},[]));case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()},function(e,t){e.exports=wp.apiFetch},function(e,t){e.exports=wp.editPost},,function(e,t){e.exports=wp.plugins},,function(e,t,n){"use strict";n.d(t,"b",function(){return b});var a=n(2),i=n(7);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function r(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.keys(e).reduce(function(o,c){return r({},o,l({},Object(a.mb)(c,t,n,i?"#editor":""),e[c]))},{})},s=function(e){return Object.keys(e).reduce(function(t,n){var a=Object.keys(e[n]).reduce(function(t,a){var o=e[n][a];return void 0===o?t:t+"\n\t"+a.replace(/^(--?)?(.*?$)/,function(e,t,n){return"".concat(t||"").concat(Object(i.kebabCase)(n))})+": "+o+";"},"");return t.push("\n\n"+n+" {"+a+"\n}"),t},[])},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["desktop"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1025,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:768,a=Object(i.sortBy)("string"==typeof e?e.split(",").map(function(e){return e.trim()}):e);return Object(i.isEqual)(a,["desktop","tablet"])?"@media screen and (min-width: "+n+"px)":Object(i.isEqual)(a,["desktop"])?"@media screen and (min-width: "+t+"px)":Object(i.isEqual)(a,["mobile","tablet"])?"@media screen and (max-width: "+t+"px)":Object(i.isEqual)(a,["tablet"])?"@media screen and (min-width: "+n+"px) and (max-width: "+t+"px)":Object(i.isEqual)(a,["mobile"])?"@media screen and (max-width: "+n+"px)":null},b=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1025,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:768,l=arguments.length>5&&void 0!==arguments[5]&&arguments[5],b=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,p=[];Object.keys(t).forEach(function(e){if(["desktopTablet","desktopOnly","tablet","tabletOnly","mobile","ie11","editor"].includes(e)){var n=e;Object.keys(t[n]).forEach(function(e){Object.keys(t[n][e]).forEach(function(a){return void 0===t[n][e][a]?delete t[n][e][a]:{}}),Object.keys(t[n][e]).length||delete t[n][e]}),Object.keys(t[n]).length||delete t[n]}else Object.keys(t[e]).forEach(function(n){return void 0===t[e][n]?delete t[e][n]:{}}),Object.keys(t[e]).length||delete t[e]});var m=Object(i.omit)(t,["desktopTablet","desktopOnly","tablet","tabletOnly","mobile","ie11","editor","saveOnly"]);if(Object.keys(m).length){var g=c(m,n,a,l);Array.prototype.push.apply(p,s(g))}if(void 0!==t.desktopTablet){var d=c(t.desktopTablet,n,a,l),f=s(d);f&&(l?f.forEach(function(e){p.push("\n\n"+u(["desktop","tablet"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["desktop","tablet"],o,r)," {\n").concat(f.join("")," }")))}if(void 0!==t.desktopOnly){var h=c(t.desktopOnly,n,a,l),v=s(h);v&&(l?v.forEach(function(e){p.push("\n\n"+u(["desktop"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["desktop"],o,r)," {\n").concat(v.join("")," }")))}if(void 0!==t.tablet){var y=c(t.tablet,n,a,l),O=s(y);O&&(l?O.forEach(function(e){p.push("\n\n"+u(["mobile","tablet"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["mobile","tablet"],o,r)," {\n").concat(O.join("")," }")))}if(void 0!==t.tabletOnly){var w=c(t.tabletOnly,n,a,l),_=s(w);_&&(l?_.forEach(function(e){p.push("\n\n"+u(["tablet"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["tablet"],o,r)," {\n").concat(_.join("")," }")))}if(void 0!==t.mobile){var k=c(t.mobile,n,a,l),j=s(k);j&&(l?j.forEach(function(e){p.push("\n\n"+u(["mobile"],o,r)+" {\n"+e+" }")}):p.push("\n\n".concat(u(["mobile"],o,r)," {\n").concat(j.join("")," }")))}if(void 0!==t.ie11){var C=c(t.ie11,n,a,l),x=s(C);x&&p.push("\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n".concat(x.join("")," }"))}return l&&void 0!==t.editor&&!b&&Array.prototype.push.apply(p,e(t.editor,n,a,o,r,l,b++)),l||void 0===t.saveOnly||b||Array.prototype.push.apply(p,e(t.saveOnly,n,a,o,r,l,b++)),p};t.a=function(e){var t=e.style,n=void 0===t?{}:t,i=e.editorMode,o=void 0!==i&&i,r=e.blockUniqueClassName,l=void 0===r?"":r,c=e.blockMainClassName,s=void 0===c?"":c,u=e.breakTablet,p=void 0===u?1025:u,m=e.breakMobile,g=b(n,s,l,p,void 0===m?768:m,o);return o?g?g.map(function(e,t){return wp.element.createElement("style",{key:t},e)}):null:g&&g.length?wp.element.createElement("style",null,Object(a.jb)(g.join(""))):null}},function(e,t,n){"use strict";n.r(t);var a=n(5),i=n.n(a);function o(){return(o=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(O,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(h,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(j,{style:{fill:e}})},title:Object(te.__)("Check",ne.i18n),value:"check"},plus:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(z,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(F,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(V,{style:{fill:e}})},title:Object(te.__)("Plus",ne.i18n),value:"plus"},arrow:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(u,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(l,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(g,{style:{fill:e}})},title:Object(te.__)("Arrow",ne.i18n),value:"arrow"},cross:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(T,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(E,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(M,{style:{fill:e}})},title:Object(te.__)("Cross",ne.i18n),value:"cross"},star:{iconFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(X,{style:{fill:e}})},circleFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(K,{style:{fill:e}})},outlineFunc:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return wp.element.createElement(ee,{style:{fill:e}})},title:Object(te.__)("Star",ne.i18n),value:"star"}},oe=function(e){return"circle"===e||"outline"===e?"".concat(e,"Func"):"iconFunc"},re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return ie[e]?ie[e][oe(t)]():null},le=function(e,t,n){var a=oe(t);if(!ie[e])return"";var i=Object(ae.sb)(ie[e][a](n),!1);return btoa(i)},ce=n(4),se=n(9),ue=n(8),be=n.n(ue);function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"deprecatedIcon_2_9_1",function(){return de}),n.d(t,"deprecatedSchema_1_15_4",function(){return fe});var ge,de=(ge={},["check","plus","arrow","cross","star"].forEach(function(e){["","circle","outline"].forEach(function(t){ge["".concat(e,"-").concat(t||"default")]=Object(ae.sb)(re(e,t))})}),ge),fe={icon:{type:"string",default:"check"},iconShape:{type:"string"},iconColor:{type:"string"},iconSize:{type:"number",default:20},columns:{type:"number",default:1},text:{source:"html",selector:"ul",multiline:"li",default:""},gap:{type:"number",default:16},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},he=[{attributes:fe,save:function(e){var t=e.className,n=e.attributes,a=n.icon,i=n.iconShape,o=n.iconColor,r=n.iconSize,l=n.text,c=n.columns,s=n.gap,u=n.design,b=void 0===u?"":u,p=be()([t.split(" ").filter(function(e){return"ugb-icon-list"!==e}),"ugb-icon-list-wrapper"],Object(ce.applyFilters)("stackable.icon-list.mainclasses_1_15_4",{},b,e)),m=be()(["ugb-icon-list","ugb-icon--icon-".concat(a),"ugb-icon--columns-".concat(c)],Object(ce.applyFilters)("stackable.icon-list.ulclasses_1_15_4",{},b,e)),g={"--icon":"url('data:image/svg+xml;base64,"+le(a,i,o)+"')","--icon-size":r?"".concat(r,"px"):void 0,"--gap":s?"".concat(s,"px"):void 0};return wp.element.createElement("div",{className:p},Object(ce.applyFilters)("stackable.icon-list.save.output.before_1_15_4",null,b,e),wp.element.createElement(se.RichText.Content,{tagName:"ul",className:m,style:g,value:l}),Object(ce.applyFilters)("stackable.icon-list.save.output.after_1_15_4",null,b,e))},migrate:function(e){var t=function(e){return(e||"").replace(/.ugb-icon-list-wrapper .ugb-icon-list li/g,".ugb-icon-list li").replace(/.ugb-icon-list-wrapper .ugb-icon-list/g,".ugb-icon-list ul").replace(/.ugb-icon-list-wrapper/g,".ugb-icon-list")};return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=i.deprecatedIcon_2_9_1["".concat(e,"-").concat(t||"default")]||i.deprecatedIcon_2_9_1["check-".concat(t||"default")];return n||e}(a,o),t.attributes.iconShape=void 0),wp.element.createElement(e,t)}},"withTransformOldIconAttributes");t.default=o},function(e,t,n){"use strict";n.r(t);var a=n(41);n.d(t,"withTransformOldIconAttributes",function(){return a.default})},,,function(e,t){e.exports="dist/videos/help/typography-family.mp4"},function(e,t){e.exports="dist/videos/help/alignment-title.mp4"},function(e,t){e.exports="dist/videos/help/spacing-title.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-margins.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-paddings.mp4"},function(e,t){e.exports="dist/videos/help/accordion-border-size.mp4"},function(e,t){e.exports=wp.date},function(e,t){e.exports="dist/images/block-team-member-overlay.156c4db.png"},,,,,function(e,t){e.exports="dist/images/higher-order-with-design-layout-selector-basic.a9cc4da.png"},function(e,t){e.exports="dist/images/components-image-shape-control-default.f59a6f2.png"},function(e,t){e.exports="dist/images/components-image-shape-control-square.54ea536.png"},function(e,t){e.exports="dist/images/components-image-shape-control-circle.9bd9f74.png"},function(e,t){e.exports="dist/images/components-image-shape-control-blob1.8e07b2a.png"},,function(e){e.exports=JSON.parse('[{"family":"ABeeZee","variants":["regular","italic"],"subsets":["latin"]},{"family":"Abel","variants":["regular"],"subsets":["latin"]},{"family":"Abhaya Libre","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","sinhala"]},{"family":"Abril Fatface","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Aclonica","variants":["regular"],"subsets":["latin"]},{"family":"Acme","variants":["regular"],"subsets":["latin"]},{"family":"Actor","variants":["regular"],"subsets":["latin"]},{"family":"Adamina","variants":["regular"],"subsets":["latin"]},{"family":"Advent Pro","variants":["100","200","300","regular","500","600","700"],"subsets":["greek","latin","latin-ext"]},{"family":"Aguafina Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Akaya Kanadaka","variants":["regular"],"subsets":["kannada","latin","latin-ext"]},{"family":"Akaya Telivigala","variants":["regular"],"subsets":["latin","latin-ext","telugu"]},{"family":"Akronim","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Aladin","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Alata","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Alatsi","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Aldrich","variants":["regular"],"subsets":["latin"]},{"family":"Alef","variants":["regular","700"],"subsets":["hebrew","latin"]},{"family":"Alegreya","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Alegreya SC","variants":["regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Alegreya Sans","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Alegreya Sans SC","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Aleo","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Alex Brush","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Alfa Slab One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Alice","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin"]},{"family":"Alike","variants":["regular"],"subsets":["latin"]},{"family":"Alike Angular","variants":["regular"],"subsets":["latin"]},{"family":"Allan","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Allerta","variants":["regular"],"subsets":["latin"]},{"family":"Allerta Stencil","variants":["regular"],"subsets":["latin"]},{"family":"Allura","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Almarai","variants":["300","regular","700","800"],"subsets":["arabic"]},{"family":"Almendra","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Almendra Display","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Almendra SC","variants":["regular"],"subsets":["latin"]},{"family":"Amarante","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Amaranth","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Amatic SC","variants":["regular","700"],"subsets":["cyrillic","hebrew","latin","latin-ext","vietnamese"]},{"family":"Amethysta","variants":["regular"],"subsets":["latin"]},{"family":"Amiko","variants":["regular","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Amiri","variants":["regular","italic","700","700italic"],"subsets":["arabic","latin","latin-ext"]},{"family":"Amita","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Anaheim","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Andada","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Andika","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Andika New Basic","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Angkor","variants":["regular"],"subsets":["khmer"]},{"family":"Annie Use Your Telescope","variants":["regular"],"subsets":["latin"]},{"family":"Anonymous Pro","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","greek","latin","latin-ext"]},{"family":"Antic","variants":["regular"],"subsets":["latin"]},{"family":"Antic Didone","variants":["regular"],"subsets":["latin"]},{"family":"Antic Slab","variants":["regular"],"subsets":["latin"]},{"family":"Anton","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Arapey","variants":["regular","italic"],"subsets":["latin"]},{"family":"Arbutus","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Arbutus Slab","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Architects Daughter","variants":["regular"],"subsets":["latin"]},{"family":"Archivo","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Archivo Black","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Archivo Narrow","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Aref Ruqaa","variants":["regular","700"],"subsets":["arabic","latin","latin-ext"]},{"family":"Arima Madurai","variants":["100","200","300","regular","500","700","800","900"],"subsets":["latin","latin-ext","tamil","vietnamese"]},{"family":"Arimo","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","latin","latin-ext","vietnamese"]},{"family":"Arizonia","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Armata","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Arsenal","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Artifika","variants":["regular"],"subsets":["latin"]},{"family":"Arvo","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Arya","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Asap","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Asap Condensed","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Asar","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Asset","variants":["regular"],"subsets":["latin"]},{"family":"Assistant","variants":["200","300","regular","500","600","700","800"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Astloch","variants":["regular","700"],"subsets":["latin"]},{"family":"Asul","variants":["regular","700"],"subsets":["latin"]},{"family":"Athiti","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Atma","variants":["300","regular","500","600","700"],"subsets":["bengali","latin","latin-ext"]},{"family":"Atomic Age","variants":["regular"],"subsets":["latin"]},{"family":"Aubrey","variants":["regular"],"subsets":["latin"]},{"family":"Audiowide","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Autour One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Average","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Average Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Averia Gruesa Libre","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Averia Libre","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Averia Sans Libre","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Averia Serif Libre","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"B612","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"B612 Mono","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Bad Script","variants":["regular"],"subsets":["cyrillic","latin"]},{"family":"Bahiana","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bahianita","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bai Jamjuree","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Ballet","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Baloo 2","variants":["regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext","vietnamese"]},{"family":"Baloo Bhai 2","variants":["regular","500","600","700","800"],"subsets":["gujarati","latin","latin-ext","vietnamese"]},{"family":"Baloo Bhaina 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","oriya","vietnamese"]},{"family":"Baloo Chettan 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","malayalam","vietnamese"]},{"family":"Baloo Da 2","variants":["regular","500","600","700","800"],"subsets":["bengali","latin","latin-ext","vietnamese"]},{"family":"Baloo Paaji 2","variants":["regular","500","600","700","800"],"subsets":["gurmukhi","latin","latin-ext","vietnamese"]},{"family":"Baloo Tamma 2","variants":["regular","500","600","700","800"],"subsets":["kannada","latin","latin-ext","vietnamese"]},{"family":"Baloo Tammudu 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","telugu","vietnamese"]},{"family":"Baloo Thambi 2","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext","tamil","vietnamese"]},{"family":"Balsamiq Sans","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Balthazar","variants":["regular"],"subsets":["latin"]},{"family":"Bangers","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barlow","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barlow Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barlow Semi Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barriecito","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Barrio","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Basic","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Baskervville","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Battambang","variants":["regular","700"],"subsets":["khmer"]},{"family":"Baumans","variants":["regular"],"subsets":["latin"]},{"family":"Bayon","variants":["regular"],"subsets":["khmer"]},{"family":"Be Vietnam","variants":["100","100italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bebas Neue","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Belgrano","variants":["regular"],"subsets":["latin"]},{"family":"Bellefair","variants":["regular"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Belleza","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bellota","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Bellota Text","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"BenchNine","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Benne","variants":["regular"],"subsets":["kannada","latin","latin-ext"]},{"family":"Bentham","variants":["regular"],"subsets":["latin"]},{"family":"Berkshire Swash","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Beth Ellen","variants":["regular"],"subsets":["latin"]},{"family":"Bevan","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Display","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Inline Display","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Inline Text","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Stencil Display","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Stencil Text","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Big Shoulders Text","variants":["100","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bigelow Rules","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bigshot One","variants":["regular"],"subsets":["latin"]},{"family":"Bilbo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bilbo Swash Caps","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"BioRhyme","variants":["200","300","regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"BioRhyme Expanded","variants":["200","300","regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"Biryani","variants":["200","300","regular","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Bitter","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Black And White Picture","variants":["regular"],"subsets":["korean","latin"]},{"family":"Black Han Sans","variants":["regular"],"subsets":["korean","latin"]},{"family":"Black Ops One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Blinker","variants":["100","200","300","regular","600","700","800","900"],"subsets":["latin","latin-ext"]},{"family":"Bodoni Moda","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext"]},{"family":"Bokor","variants":["regular"],"subsets":["khmer"]},{"family":"Bonbon","variants":["regular"],"subsets":["latin"]},{"family":"Boogaloo","variants":["regular"],"subsets":["latin"]},{"family":"Bowlby One","variants":["regular"],"subsets":["latin"]},{"family":"Bowlby One SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Brawler","variants":["regular"],"subsets":["latin"]},{"family":"Bree Serif","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Brygada 1918","variants":["regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Bubblegum Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Bubbler One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Buda","variants":["300"],"subsets":["latin"]},{"family":"Buenard","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Bungee","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Hairline","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Inline","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Outline","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Bungee Shade","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Butcherman","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Butterfly Kids","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cabin","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Cabin Condensed","variants":["regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Cabin Sketch","variants":["regular","700"],"subsets":["latin"]},{"family":"Caesar Dressing","variants":["regular"],"subsets":["latin"]},{"family":"Cagliostro","variants":["regular"],"subsets":["latin"]},{"family":"Cairo","variants":["200","300","regular","600","700","900"],"subsets":["arabic","latin","latin-ext"]},{"family":"Caladea","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Calistoga","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Calligraffitti","variants":["regular"],"subsets":["latin"]},{"family":"Cambay","variants":["regular","italic","700","700italic"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Cambo","variants":["regular"],"subsets":["latin"]},{"family":"Candal","variants":["regular"],"subsets":["latin"]},{"family":"Cantarell","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Cantata One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cantora One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Capriola","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cardo","variants":["regular","italic","700"],"subsets":["greek","greek-ext","latin","latin-ext"]},{"family":"Carme","variants":["regular"],"subsets":["latin"]},{"family":"Carrois Gothic","variants":["regular"],"subsets":["latin"]},{"family":"Carrois Gothic SC","variants":["regular"],"subsets":["latin"]},{"family":"Carter One","variants":["regular"],"subsets":["latin"]},{"family":"Castoro","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Catamaran","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","tamil"]},{"family":"Caudex","variants":["regular","italic","700","700italic"],"subsets":["greek","greek-ext","latin","latin-ext"]},{"family":"Caveat","variants":["regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Caveat Brush","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cedarville Cursive","variants":["regular"],"subsets":["latin"]},{"family":"Ceviche One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chakra Petch","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Changa","variants":["200","300","regular","500","600","700","800"],"subsets":["arabic","latin","latin-ext"]},{"family":"Changa One","variants":["regular","italic"],"subsets":["latin"]},{"family":"Chango","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Charm","variants":["regular","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Charmonman","variants":["regular","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Chathura","variants":["100","300","regular","700","800"],"subsets":["latin","telugu"]},{"family":"Chau Philomene One","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Chela One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chelsea Market","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chenla","variants":["regular"],"subsets":["khmer"]},{"family":"Cherry Cream Soda","variants":["regular"],"subsets":["latin"]},{"family":"Cherry Swash","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Chewy","variants":["regular"],"subsets":["latin"]},{"family":"Chicle","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Chilanka","variants":["regular"],"subsets":["latin","malayalam"]},{"family":"Chivo","variants":["300","300italic","regular","italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Chonburi","variants":["regular"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Cinzel","variants":["regular","500","600","700","800","900"],"subsets":["latin","latin-ext"]},{"family":"Cinzel Decorative","variants":["regular","700","900"],"subsets":["latin"]},{"family":"Clicker Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Coda","variants":["regular","800"],"subsets":["latin","latin-ext"]},{"family":"Coda Caption","variants":["800"],"subsets":["latin","latin-ext"]},{"family":"Codystar","variants":["300","regular"],"subsets":["latin","latin-ext"]},{"family":"Coiny","variants":["regular"],"subsets":["latin","latin-ext","tamil","vietnamese"]},{"family":"Combo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Comfortaa","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Comic Neue","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Coming Soon","variants":["regular"],"subsets":["latin"]},{"family":"Commissioner","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Concert One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Condiment","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Content","variants":["regular","700"],"subsets":["khmer"]},{"family":"Contrail One","variants":["regular"],"subsets":["latin"]},{"family":"Convergence","variants":["regular"],"subsets":["latin"]},{"family":"Cookie","variants":["regular"],"subsets":["latin"]},{"family":"Copse","variants":["regular"],"subsets":["latin"]},{"family":"Corben","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Cormorant","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Garamond","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Infant","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant SC","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Unicase","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cormorant Upright","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Courgette","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Courier Prime","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Cousine","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","latin","latin-ext","vietnamese"]},{"family":"Coustard","variants":["regular","900"],"subsets":["latin"]},{"family":"Covered By Your Grace","variants":["regular"],"subsets":["latin"]},{"family":"Crafty Girls","variants":["regular"],"subsets":["latin"]},{"family":"Creepster","variants":["regular"],"subsets":["latin"]},{"family":"Crete Round","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Crimson Pro","variants":["200","300","regular","500","600","700","800","900","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Crimson Text","variants":["regular","italic","600","600italic","700","700italic"],"subsets":["latin"]},{"family":"Croissant One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Crushed","variants":["regular"],"subsets":["latin"]},{"family":"Cuprum","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Cute Font","variants":["regular"],"subsets":["korean","latin"]},{"family":"Cutive","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Cutive Mono","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"DM Mono","variants":["300","300italic","regular","italic","500","500italic"],"subsets":["latin","latin-ext"]},{"family":"DM Sans","variants":["regular","italic","500","500italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"DM Serif Display","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"DM Serif Text","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Damion","variants":["regular"],"subsets":["latin"]},{"family":"Dancing Script","variants":["regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Dangrek","variants":["regular"],"subsets":["khmer"]},{"family":"Darker Grotesque","variants":["300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"David Libre","variants":["regular","500","700"],"subsets":["hebrew","latin","latin-ext","vietnamese"]},{"family":"Dawning of a New Day","variants":["regular"],"subsets":["latin"]},{"family":"Days One","variants":["regular"],"subsets":["latin"]},{"family":"Dekko","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Delius","variants":["regular"],"subsets":["latin"]},{"family":"Delius Swash Caps","variants":["regular"],"subsets":["latin"]},{"family":"Delius Unicase","variants":["regular","700"],"subsets":["latin"]},{"family":"Della Respira","variants":["regular"],"subsets":["latin"]},{"family":"Denk One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Devonshire","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Dhurjati","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Didact Gothic","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Diplomata","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Diplomata SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Do Hyeon","variants":["regular"],"subsets":["korean","latin"]},{"family":"Dokdo","variants":["regular"],"subsets":["korean","latin"]},{"family":"Domine","variants":["regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"Donegal One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Doppio One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Dorsa","variants":["regular"],"subsets":["latin"]},{"family":"Dosis","variants":["200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"DotGothic16","variants":["regular"],"subsets":["cyrillic","japanese","latin","latin-ext"]},{"family":"Dr Sugiyama","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Duru Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Dynalight","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"EB Garamond","variants":["regular","500","600","700","800","italic","500italic","600italic","700italic","800italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Eagle Lake","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"East Sea Dokdo","variants":["regular"],"subsets":["korean","latin"]},{"family":"Eater","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Economica","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Eczar","variants":["regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"El Messiri","variants":["regular","500","600","700"],"subsets":["arabic","cyrillic","latin"]},{"family":"Electrolize","variants":["regular"],"subsets":["latin"]},{"family":"Elsie","variants":["regular","900"],"subsets":["latin","latin-ext"]},{"family":"Elsie Swash Caps","variants":["regular","900"],"subsets":["latin","latin-ext"]},{"family":"Emblema One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Emilys Candy","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Encode Sans","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Expanded","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Semi Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Encode Sans Semi Expanded","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Engagement","variants":["regular"],"subsets":["latin"]},{"family":"Englebert","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Enriqueta","variants":["regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"Epilogue","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Erica One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Esteban","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Euphoria Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ewert","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Exo","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Exo 2","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Expletus Sans","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin"]},{"family":"Fahkwang","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Fanwood Text","variants":["regular","italic"],"subsets":["latin"]},{"family":"Farro","variants":["300","regular","500","700"],"subsets":["latin","latin-ext"]},{"family":"Farsan","variants":["regular"],"subsets":["gujarati","latin","latin-ext","vietnamese"]},{"family":"Fascinate","variants":["regular"],"subsets":["latin"]},{"family":"Fascinate Inline","variants":["regular"],"subsets":["latin"]},{"family":"Faster One","variants":["regular"],"subsets":["latin"]},{"family":"Fasthand","variants":["regular"],"subsets":["khmer"]},{"family":"Fauna One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Faustina","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Federant","variants":["regular"],"subsets":["latin"]},{"family":"Federo","variants":["regular"],"subsets":["latin"]},{"family":"Felipa","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fenix","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Finger Paint","variants":["regular"],"subsets":["latin"]},{"family":"Fira Code","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Fira Mono","variants":["regular","500","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Fira Sans","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Fira Sans Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Fira Sans Extra Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Fjalla One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fjord One","variants":["regular"],"subsets":["latin"]},{"family":"Flamenco","variants":["300","regular"],"subsets":["latin"]},{"family":"Flavors","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fondamento","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Fontdiner Swanky","variants":["regular"],"subsets":["latin"]},{"family":"Forum","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Francois One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Frank Ruhl Libre","variants":["300","regular","500","700","900"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Fraunces","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Freckle Face","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fredericka the Great","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fredoka One","variants":["regular"],"subsets":["latin"]},{"family":"Freehand","variants":["regular"],"subsets":["khmer"]},{"family":"Fresca","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Frijole","variants":["regular"],"subsets":["latin"]},{"family":"Fruktur","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Fugaz One","variants":["regular"],"subsets":["latin"]},{"family":"GFS Didot","variants":["regular"],"subsets":["greek"]},{"family":"GFS Neohellenic","variants":["regular","italic","700","700italic"],"subsets":["greek"]},{"family":"Gabriela","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin"]},{"family":"Gaegu","variants":["300","regular","700"],"subsets":["korean","latin"]},{"family":"Gafata","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Galada","variants":["regular"],"subsets":["bengali","latin"]},{"family":"Galdeano","variants":["regular"],"subsets":["latin"]},{"family":"Galindo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Gamja Flower","variants":["regular"],"subsets":["korean","latin"]},{"family":"Gayathri","variants":["100","regular","700"],"subsets":["latin","malayalam"]},{"family":"Gelasio","variants":["regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Gentium Basic","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Gentium Book Basic","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Geo","variants":["regular","italic"],"subsets":["latin"]},{"family":"Geostar","variants":["regular"],"subsets":["latin"]},{"family":"Geostar Fill","variants":["regular"],"subsets":["latin"]},{"family":"Germania One","variants":["regular"],"subsets":["latin"]},{"family":"Gidugu","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Gilda Display","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Girassol","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Give You Glory","variants":["regular"],"subsets":["latin"]},{"family":"Glass Antiqua","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Glegoo","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Gloria Hallelujah","variants":["regular"],"subsets":["latin"]},{"family":"Goblin One","variants":["regular"],"subsets":["latin"]},{"family":"Gochi Hand","variants":["regular"],"subsets":["latin"]},{"family":"Goldman","variants":["regular","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Gorditas","variants":["regular","700"],"subsets":["latin"]},{"family":"Gothic A1","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["korean","latin"]},{"family":"Gotu","variants":["regular"],"subsets":["devanagari","latin","latin-ext","vietnamese"]},{"family":"Goudy Bookletter 1911","variants":["regular"],"subsets":["latin"]},{"family":"Graduate","variants":["regular"],"subsets":["latin"]},{"family":"Grand Hotel","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Grandstander","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Gravitas One","variants":["regular"],"subsets":["latin"]},{"family":"Great Vibes","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Grenze","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Grenze Gotisch","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Griffy","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Gruppo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Gudea","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Gugi","variants":["regular"],"subsets":["korean","latin"]},{"family":"Gupter","variants":["regular","500","700"],"subsets":["latin"]},{"family":"Gurajada","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Habibi","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Hachi Maru Pop","variants":["regular"],"subsets":["cyrillic","japanese","latin","latin-ext"]},{"family":"Halant","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Hammersmith One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Hanalei","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Hanalei Fill","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Handlee","variants":["regular"],"subsets":["latin"]},{"family":"Hanuman","variants":["regular","700"],"subsets":["khmer"]},{"family":"Happy Monkey","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Harmattan","variants":["regular","700"],"subsets":["arabic","latin","latin-ext"]},{"family":"Headland One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Heebo","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["hebrew","latin"]},{"family":"Henny Penny","variants":["regular"],"subsets":["latin"]},{"family":"Hepta Slab","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Herr Von Muellerhoff","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Hi Melody","variants":["regular"],"subsets":["korean","latin"]},{"family":"Hind","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Hind Guntur","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","telugu"]},{"family":"Hind Madurai","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","tamil"]},{"family":"Hind Siliguri","variants":["300","regular","500","600","700"],"subsets":["bengali","latin","latin-ext"]},{"family":"Hind Vadodara","variants":["300","regular","500","600","700"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Holtwood One SC","variants":["regular"],"subsets":["latin"]},{"family":"Homemade Apple","variants":["regular"],"subsets":["latin"]},{"family":"Homenaje","variants":["regular"],"subsets":["latin"]},{"family":"IBM Plex Mono","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"IBM Plex Sans","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"IBM Plex Sans Condensed","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"IBM Plex Serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"IM Fell DW Pica","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell DW Pica SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell Double Pica","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell Double Pica SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell English","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell English SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell French Canon","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell French Canon SC","variants":["regular"],"subsets":["latin"]},{"family":"IM Fell Great Primer","variants":["regular","italic"],"subsets":["latin"]},{"family":"IM Fell Great Primer SC","variants":["regular"],"subsets":["latin"]},{"family":"Ibarra Real Nova","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext"]},{"family":"Iceberg","variants":["regular"],"subsets":["latin"]},{"family":"Iceland","variants":["regular"],"subsets":["latin"]},{"family":"Imbue","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Imprima","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Inconsolata","variants":["200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Inder","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Indie Flower","variants":["regular"],"subsets":["latin"]},{"family":"Inika","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Inknut Antiqua","variants":["300","regular","500","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Inria Sans","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Inria Serif","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Inter","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Irish Grover","variants":["regular"],"subsets":["latin"]},{"family":"Istok Web","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Italiana","variants":["regular"],"subsets":["latin"]},{"family":"Italianno","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Itim","variants":["regular"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Jacques Francois","variants":["regular"],"subsets":["latin"]},{"family":"Jacques Francois Shadow","variants":["regular"],"subsets":["latin"]},{"family":"Jaldi","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"JetBrains Mono","variants":["100","200","300","regular","500","600","700","800","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Jim Nightshade","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jockey One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jolly Lodger","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jomhuria","variants":["regular"],"subsets":["arabic","latin","latin-ext"]},{"family":"Jomolhari","variants":["regular"],"subsets":["latin","tibetan"]},{"family":"Josefin Sans","variants":["100","200","300","regular","500","600","700","100italic","200italic","300italic","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Josefin Slab","variants":["100","200","300","regular","500","600","700","100italic","200italic","300italic","italic","500italic","600italic","700italic"],"subsets":["latin"]},{"family":"Jost","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Joti One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Jua","variants":["regular"],"subsets":["korean","latin"]},{"family":"Judson","variants":["regular","italic","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Julee","variants":["regular"],"subsets":["latin"]},{"family":"Julius Sans One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Junge","variants":["regular"],"subsets":["latin"]},{"family":"Jura","variants":["300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Just Another Hand","variants":["regular"],"subsets":["latin"]},{"family":"Just Me Again Down Here","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"K2D","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kadwa","variants":["regular","700"],"subsets":["devanagari","latin"]},{"family":"Kalam","variants":["300","regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Kameron","variants":["regular","700"],"subsets":["latin"]},{"family":"Kanit","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kantumruy","variants":["300","regular","700"],"subsets":["khmer"]},{"family":"Karla","variants":["200","300","regular","500","600","700","800","200italic","300italic","italic","500italic","600italic","700italic","800italic"],"subsets":["latin","latin-ext"]},{"family":"Karma","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Katibeh","variants":["regular"],"subsets":["arabic","latin","latin-ext"]},{"family":"Kaushan Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Kavivanar","variants":["regular"],"subsets":["latin","latin-ext","tamil"]},{"family":"Kavoon","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Kdam Thmor","variants":["regular"],"subsets":["khmer"]},{"family":"Keania One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Kelly Slab","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Kenia","variants":["regular"],"subsets":["latin"]},{"family":"Khand","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Khmer","variants":["regular"],"subsets":["khmer"]},{"family":"Khula","variants":["300","regular","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Kirang Haerang","variants":["regular"],"subsets":["korean","latin"]},{"family":"Kite One","variants":["regular"],"subsets":["latin"]},{"family":"Knewave","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"KoHo","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kodchasan","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kosugi","variants":["regular"],"subsets":["cyrillic","japanese","latin"]},{"family":"Kosugi Maru","variants":["regular"],"subsets":["cyrillic","japanese","latin"]},{"family":"Kotta One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Koulen","variants":["regular"],"subsets":["khmer"]},{"family":"Kranky","variants":["regular"],"subsets":["latin"]},{"family":"Kreon","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"Kristi","variants":["regular"],"subsets":["latin"]},{"family":"Krona One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Krub","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Kufam","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Kulim Park","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Kumar One","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Kumar One Outline","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Kumbh Sans","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Kurale","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","devanagari","latin","latin-ext"]},{"family":"La Belle Aurore","variants":["regular"],"subsets":["latin"]},{"family":"Lacquer","variants":["regular"],"subsets":["latin"]},{"family":"Laila","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Lakki Reddy","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Lalezar","variants":["regular"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Lancelot","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Langar","variants":["regular"],"subsets":["gurmukhi","latin","latin-ext"]},{"family":"Lateef","variants":["regular"],"subsets":["arabic","latin"]},{"family":"Lato","variants":["100","100italic","300","300italic","regular","italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"League Script","variants":["regular"],"subsets":["latin"]},{"family":"Leckerli One","variants":["regular"],"subsets":["latin"]},{"family":"Ledger","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Lekton","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Lemon","variants":["regular"],"subsets":["latin"]},{"family":"Lemonada","variants":["300","regular","500","600","700"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Lexend Deca","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Exa","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Giga","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Mega","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Peta","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Tera","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lexend Zetta","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Libre Barcode 128","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 128 Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39 Extended","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39 Extended Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode 39 Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Barcode EAN13 Text","variants":["regular"],"subsets":["latin"]},{"family":"Libre Baskerville","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Libre Caslon Display","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Libre Caslon Text","variants":["regular","italic","700"],"subsets":["latin","latin-ext"]},{"family":"Libre Franklin","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Life Savers","variants":["regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"Lilita One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Lily Script One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Limelight","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Linden Hill","variants":["regular","italic"],"subsets":["latin"]},{"family":"Literata","variants":["200","300","regular","500","600","700","800","900","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Liu Jian Mao Cao","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Livvic","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Lobster","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Lobster Two","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Londrina Outline","variants":["regular"],"subsets":["latin"]},{"family":"Londrina Shadow","variants":["regular"],"subsets":["latin"]},{"family":"Londrina Sketch","variants":["regular"],"subsets":["latin"]},{"family":"Londrina Solid","variants":["100","300","regular","900"],"subsets":["latin"]},{"family":"Long Cang","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Lora","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Love Ya Like A Sister","variants":["regular"],"subsets":["latin"]},{"family":"Loved by the King","variants":["regular"],"subsets":["latin"]},{"family":"Lovers Quarrel","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Luckiest Guy","variants":["regular"],"subsets":["latin"]},{"family":"Lusitana","variants":["regular","700"],"subsets":["latin"]},{"family":"Lustria","variants":["regular"],"subsets":["latin"]},{"family":"M PLUS 1p","variants":["100","300","regular","500","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","japanese","latin","latin-ext","vietnamese"]},{"family":"M PLUS Rounded 1c","variants":["100","300","regular","500","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","japanese","latin","latin-ext","vietnamese"]},{"family":"Ma Shan Zheng","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Macondo","variants":["regular"],"subsets":["latin"]},{"family":"Macondo Swash Caps","variants":["regular"],"subsets":["latin"]},{"family":"Mada","variants":["200","300","regular","500","600","700","900"],"subsets":["arabic","latin"]},{"family":"Magra","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Maiden Orange","variants":["regular"],"subsets":["latin"]},{"family":"Maitree","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Major Mono Display","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Mako","variants":["regular"],"subsets":["latin"]},{"family":"Mali","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Mallanna","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Mandali","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Manjari","variants":["100","regular","700"],"subsets":["latin","malayalam"]},{"family":"Manrope","variants":["200","300","regular","500","600","700","800"],"subsets":["cyrillic","greek","latin","latin-ext"]},{"family":"Mansalva","variants":["regular"],"subsets":["latin"]},{"family":"Manuale","variants":["regular","500","600","700","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Marcellus","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Marcellus SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Marck Script","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Margarine","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Markazi Text","variants":["regular","500","600","700"],"subsets":["arabic","latin","latin-ext","vietnamese"]},{"family":"Marko One","variants":["regular"],"subsets":["latin"]},{"family":"Marmelad","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Martel","variants":["200","300","regular","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Martel Sans","variants":["200","300","regular","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Marvel","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Mate","variants":["regular","italic"],"subsets":["latin"]},{"family":"Mate SC","variants":["regular"],"subsets":["latin"]},{"family":"Maven Pro","variants":["regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"McLaren","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Meddon","variants":["regular"],"subsets":["latin"]},{"family":"MedievalSharp","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Medula One","variants":["regular"],"subsets":["latin"]},{"family":"Meera Inimai","variants":["regular"],"subsets":["latin","tamil"]},{"family":"Megrim","variants":["regular"],"subsets":["latin"]},{"family":"Meie Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Merienda","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Merienda One","variants":["regular"],"subsets":["latin"]},{"family":"Merriweather","variants":["300","300italic","regular","italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Merriweather Sans","variants":["300","regular","500","600","700","800","300italic","italic","500italic","600italic","700italic","800italic"],"subsets":["cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Metal","variants":["regular"],"subsets":["khmer"]},{"family":"Metal Mania","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Metamorphous","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Metrophobic","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Michroma","variants":["regular"],"subsets":["latin"]},{"family":"Milonga","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Miltonian","variants":["regular"],"subsets":["latin"]},{"family":"Miltonian Tattoo","variants":["regular"],"subsets":["latin"]},{"family":"Mina","variants":["regular","700"],"subsets":["bengali","latin","latin-ext"]},{"family":"Miniver","variants":["regular"],"subsets":["latin"]},{"family":"Miriam Libre","variants":["regular","700"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Mirza","variants":["regular","500","600","700"],"subsets":["arabic","latin","latin-ext"]},{"family":"Miss Fajardose","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mitr","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Modak","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Modern Antiqua","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mogra","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Molengo","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Molle","variants":["italic"],"subsets":["latin","latin-ext"]},{"family":"Monda","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Monofett","variants":["regular"],"subsets":["latin"]},{"family":"Monoton","variants":["regular"],"subsets":["latin"]},{"family":"Monsieur La Doulaise","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Montaga","variants":["regular"],"subsets":["latin"]},{"family":"Montez","variants":["regular"],"subsets":["latin"]},{"family":"Montserrat","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Montserrat Alternates","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Montserrat Subrayada","variants":["regular","700"],"subsets":["latin"]},{"family":"Moul","variants":["regular"],"subsets":["khmer"]},{"family":"Moulpali","variants":["regular"],"subsets":["khmer"]},{"family":"Mountains of Christmas","variants":["regular","700"],"subsets":["latin"]},{"family":"Mouse Memoirs","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mr Bedfort","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mr Dafoe","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mr De Haviland","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mrs Saint Delafield","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mrs Sheppards","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Mukta","variants":["200","300","regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Mukta Mahee","variants":["200","300","regular","500","600","700","800"],"subsets":["gurmukhi","latin","latin-ext"]},{"family":"Mukta Malar","variants":["200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext","tamil"]},{"family":"Mukta Vaani","variants":["200","300","regular","500","600","700","800"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Mulish","variants":["200","300","regular","500","600","700","800","900","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"MuseoModerno","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Mystery Quest","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"NTR","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Nanum Brush Script","variants":["regular"],"subsets":["korean","latin"]},{"family":"Nanum Gothic","variants":["regular","700","800"],"subsets":["korean","latin"]},{"family":"Nanum Gothic Coding","variants":["regular","700"],"subsets":["korean","latin"]},{"family":"Nanum Myeongjo","variants":["regular","700","800"],"subsets":["korean","latin"]},{"family":"Nanum Pen Script","variants":["regular"],"subsets":["korean","latin"]},{"family":"Nerko One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Neucha","variants":["regular"],"subsets":["cyrillic","latin"]},{"family":"Neuton","variants":["200","300","regular","italic","700","800"],"subsets":["latin","latin-ext"]},{"family":"New Rocker","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"News Cycle","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Newsreader","variants":["200","300","regular","500","600","700","800","200italic","300italic","italic","500italic","600italic","700italic","800italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Niconne","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Niramit","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Nixie One","variants":["regular"],"subsets":["latin"]},{"family":"Nobile","variants":["regular","italic","500","500italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Nokora","variants":["regular","700"],"subsets":["khmer"]},{"family":"Norican","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Nosifer","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Notable","variants":["regular"],"subsets":["latin"]},{"family":"Nothing You Could Do","variants":["regular"],"subsets":["latin"]},{"family":"Noticia Text","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Noto Sans","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","devanagari","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Noto Sans HK","variants":["100","300","regular","500","700","900"],"subsets":["chinese-hongkong","latin"]},{"family":"Noto Sans JP","variants":["100","300","regular","500","700","900"],"subsets":["japanese","latin"]},{"family":"Noto Sans KR","variants":["100","300","regular","500","700","900"],"subsets":["korean","latin"]},{"family":"Noto Sans SC","variants":["100","300","regular","500","700","900"],"subsets":["chinese-simplified","latin"]},{"family":"Noto Sans TC","variants":["100","300","regular","500","700","900"],"subsets":["chinese-traditional","latin"]},{"family":"Noto Serif","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Noto Serif JP","variants":["200","300","regular","500","600","700","900"],"subsets":["japanese","latin"]},{"family":"Noto Serif KR","variants":["200","300","regular","500","600","700","900"],"subsets":["korean","latin"]},{"family":"Noto Serif SC","variants":["200","300","regular","500","600","700","900"],"subsets":["chinese-simplified","latin"]},{"family":"Noto Serif TC","variants":["200","300","regular","500","600","700","900"],"subsets":["chinese-traditional","latin"]},{"family":"Nova Cut","variants":["regular"],"subsets":["latin"]},{"family":"Nova Flat","variants":["regular"],"subsets":["latin"]},{"family":"Nova Mono","variants":["regular"],"subsets":["greek","latin"]},{"family":"Nova Oval","variants":["regular"],"subsets":["latin"]},{"family":"Nova Round","variants":["regular"],"subsets":["latin"]},{"family":"Nova Script","variants":["regular"],"subsets":["latin"]},{"family":"Nova Slim","variants":["regular"],"subsets":["latin"]},{"family":"Nova Square","variants":["regular"],"subsets":["latin"]},{"family":"Numans","variants":["regular"],"subsets":["latin"]},{"family":"Nunito","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Nunito Sans","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Odibee Sans","variants":["regular"],"subsets":["latin"]},{"family":"Odor Mean Chey","variants":["regular"],"subsets":["khmer"]},{"family":"Offside","variants":["regular"],"subsets":["latin"]},{"family":"Oi","variants":["regular"],"subsets":["greek","latin","latin-ext","vietnamese"]},{"family":"Old Standard TT","variants":["regular","italic","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Oldenburg","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Oleo Script","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Oleo Script Swash Caps","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Open Sans","variants":["300","300italic","regular","italic","600","600italic","700","700italic","800","800italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Open Sans Condensed","variants":["300","300italic","700"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Oranienbaum","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Orbitron","variants":["regular","500","600","700","800","900"],"subsets":["latin"]},{"family":"Oregano","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Orienta","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Original Surfer","variants":["regular"],"subsets":["latin"]},{"family":"Oswald","variants":["200","300","regular","500","600","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Over the Rainbow","variants":["regular"],"subsets":["latin"]},{"family":"Overlock","variants":["regular","italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Overlock SC","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Overpass","variants":["100","100italic","200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Overpass Mono","variants":["300","regular","600","700"],"subsets":["latin","latin-ext"]},{"family":"Ovo","variants":["regular"],"subsets":["latin"]},{"family":"Oxanium","variants":["200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext"]},{"family":"Oxygen","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Oxygen Mono","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"PT Mono","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Sans","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Sans Caption","variants":["regular","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Sans Narrow","variants":["regular","700"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Serif","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"PT Serif Caption","variants":["regular","italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Pacifico","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Padauk","variants":["regular","700"],"subsets":["latin","myanmar"]},{"family":"Palanquin","variants":["100","200","300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Palanquin Dark","variants":["regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Pangolin","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Paprika","variants":["regular"],"subsets":["latin"]},{"family":"Parisienne","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Passero One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Passion One","variants":["regular","700","900"],"subsets":["latin","latin-ext"]},{"family":"Pathway Gothic One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Patrick Hand","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Patrick Hand SC","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Pattaya","variants":["regular"],"subsets":["cyrillic","latin","latin-ext","thai","vietnamese"]},{"family":"Patua One","variants":["regular"],"subsets":["latin"]},{"family":"Pavanam","variants":["regular"],"subsets":["latin","latin-ext","tamil"]},{"family":"Paytone One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Peddana","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Peralta","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Permanent Marker","variants":["regular"],"subsets":["latin"]},{"family":"Petit Formal Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Petrona","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Philosopher","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","vietnamese"]},{"family":"Piazzolla","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Piedra","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Pinyon Script","variants":["regular"],"subsets":["latin"]},{"family":"Pirata One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Plaster","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Play","variants":["regular","700"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Playball","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Playfair Display","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Playfair Display SC","variants":["regular","italic","700","700italic","900","900italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Podkova","variants":["regular","500","600","700","800"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Poiret One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Poller One","variants":["regular"],"subsets":["latin"]},{"family":"Poly","variants":["regular","italic"],"subsets":["latin"]},{"family":"Pompiere","variants":["regular"],"subsets":["latin"]},{"family":"Pontano Sans","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Poor Story","variants":["regular"],"subsets":["korean","latin"]},{"family":"Poppins","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Port Lligat Sans","variants":["regular"],"subsets":["latin"]},{"family":"Port Lligat Slab","variants":["regular"],"subsets":["latin"]},{"family":"Potta One","variants":["regular"],"subsets":["japanese","latin","latin-ext","vietnamese"]},{"family":"Pragati Narrow","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Prata","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","vietnamese"]},{"family":"Preahvihear","variants":["regular"],"subsets":["khmer"]},{"family":"Press Start 2P","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext"]},{"family":"Pridi","variants":["200","300","regular","500","600","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Princess Sofia","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Prociono","variants":["regular"],"subsets":["latin"]},{"family":"Prompt","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Prosto One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Proza Libre","variants":["regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext"]},{"family":"Public Sans","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext"]},{"family":"Puritan","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Purple Purse","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Quando","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Quantico","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Quattrocento","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Quattrocento Sans","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Questrial","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Quicksand","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Quintessential","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Qwigley","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Racing Sans One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Radley","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Rajdhani","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Rakkas","variants":["regular"],"subsets":["arabic","latin","latin-ext"]},{"family":"Raleway","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Raleway Dots","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ramabhadra","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Ramaraja","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Rambla","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Rammetto One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ranchers","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rancho","variants":["regular"],"subsets":["latin"]},{"family":"Ranga","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Rasa","variants":["300","regular","500","600","700"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Rationale","variants":["regular"],"subsets":["latin"]},{"family":"Ravi Prakash","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Recursive","variants":["300","regular","500","600","700","800","900"],"subsets":["latin","vietnamese"]},{"family":"Red Hat Display","variants":["regular","italic","500","500italic","700","700italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Red Hat Text","variants":["regular","italic","500","500italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Red Rose","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Redressed","variants":["regular"],"subsets":["latin"]},{"family":"Reem Kufi","variants":["regular"],"subsets":["arabic","latin"]},{"family":"Reenie Beanie","variants":["regular"],"subsets":["latin"]},{"family":"Reggae One","variants":["regular"],"subsets":["cyrillic","japanese","latin","latin-ext"]},{"family":"Revalia","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rhodium Libre","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Ribeye","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ribeye Marrow","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Righteous","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Risque","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Roboto","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Roboto Condensed","variants":["300","300italic","regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Roboto Mono","variants":["100","200","300","regular","500","600","700","100italic","200italic","300italic","italic","500italic","600italic","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Roboto Slab","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Rochester","variants":["regular"],"subsets":["latin"]},{"family":"Rock Salt","variants":["regular"],"subsets":["latin"]},{"family":"RocknRoll One","variants":["regular"],"subsets":["cyrillic","japanese","latin","latin-ext"]},{"family":"Rokkitt","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Romanesco","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ropa Sans","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Rosario","variants":["300","regular","500","600","700","300italic","italic","500italic","600italic","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Rosarivo","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Rouge Script","variants":["regular"],"subsets":["latin"]},{"family":"Rowdies","variants":["300","regular","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Rozha One","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Rubik","variants":["300","regular","500","600","700","800","900","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","hebrew","latin","latin-ext"]},{"family":"Rubik Mono One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Ruda","variants":["regular","500","600","700","800","900"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Rufina","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Ruge Boogie","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ruluko","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rum Raisin","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Ruslan Display","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Russo One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Ruthie","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Rye","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sacramento","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sahitya","variants":["regular","700"],"subsets":["devanagari","latin"]},{"family":"Sail","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Saira","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Extra Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Semi Condensed","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Saira Stencil One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Salsa","variants":["regular"],"subsets":["latin"]},{"family":"Sanchez","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Sancreek","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sansita","variants":["regular","italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Sansita Swashed","variants":["300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Sarabun","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Sarala","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Sarina","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sarpanch","variants":["regular","500","600","700","800","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Satisfy","variants":["regular"],"subsets":["latin"]},{"family":"Sawarabi Gothic","variants":["regular"],"subsets":["cyrillic","japanese","latin","latin-ext","vietnamese"]},{"family":"Sawarabi Mincho","variants":["regular"],"subsets":["japanese","latin","latin-ext"]},{"family":"Scada","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext"]},{"family":"Scheherazade","variants":["regular","700"],"subsets":["arabic","latin"]},{"family":"Schoolbell","variants":["regular"],"subsets":["latin"]},{"family":"Scope One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Seaweed Script","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Secular One","variants":["regular"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Sedgwick Ave","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Sedgwick Ave Display","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Sen","variants":["regular","700","800"],"subsets":["latin","latin-ext"]},{"family":"Sevillana","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Seymour One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Shadows Into Light","variants":["regular"],"subsets":["latin"]},{"family":"Shadows Into Light Two","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Shanti","variants":["regular"],"subsets":["latin"]},{"family":"Share","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Share Tech","variants":["regular"],"subsets":["latin"]},{"family":"Share Tech Mono","variants":["regular"],"subsets":["latin"]},{"family":"Shippori Mincho","variants":["regular","500","600","700","800"],"subsets":["japanese","latin","latin-ext"]},{"family":"Shippori Mincho B1","variants":["regular","500","600","700","800"],"subsets":["japanese","latin","latin-ext"]},{"family":"Shojumaru","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Short Stack","variants":["regular"],"subsets":["latin"]},{"family":"Shrikhand","variants":["regular"],"subsets":["gujarati","latin","latin-ext"]},{"family":"Siemreap","variants":["regular"],"subsets":["khmer"]},{"family":"Sigmar One","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Signika","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Signika Negative","variants":["300","regular","600","700"],"subsets":["latin","latin-ext"]},{"family":"Simonetta","variants":["regular","italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Single Day","variants":["regular"],"subsets":["korean"]},{"family":"Sintony","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Sirin Stencil","variants":["regular"],"subsets":["latin"]},{"family":"Six Caps","variants":["regular"],"subsets":["latin"]},{"family":"Skranji","variants":["regular","700"],"subsets":["latin","latin-ext"]},{"family":"Slabo 13px","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Slabo 27px","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Slackey","variants":["regular"],"subsets":["latin"]},{"family":"Smokum","variants":["regular"],"subsets":["latin"]},{"family":"Smythe","variants":["regular"],"subsets":["latin"]},{"family":"Sniglet","variants":["regular","800"],"subsets":["latin","latin-ext"]},{"family":"Snippet","variants":["regular"],"subsets":["latin"]},{"family":"Snowburst One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sofadi One","variants":["regular"],"subsets":["latin"]},{"family":"Sofia","variants":["regular"],"subsets":["latin"]},{"family":"Solway","variants":["300","regular","500","700","800"],"subsets":["latin"]},{"family":"Song Myung","variants":["regular"],"subsets":["korean","latin"]},{"family":"Sonsie One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Sora","variants":["100","200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext"]},{"family":"Sorts Mill Goudy","variants":["regular","italic"],"subsets":["latin","latin-ext"]},{"family":"Source Code Pro","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Source Sans Pro","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"]},{"family":"Source Serif Pro","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Space Grotesk","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Space Mono","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Spartan","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext"]},{"family":"Special Elite","variants":["regular"],"subsets":["latin"]},{"family":"Spectral","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Spectral SC","variants":["200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Spicy Rice","variants":["regular"],"subsets":["latin"]},{"family":"Spinnaker","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Spirax","variants":["regular"],"subsets":["latin"]},{"family":"Squada One","variants":["regular"],"subsets":["latin"]},{"family":"Sree Krushnadevaraya","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Sriracha","variants":["regular"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Srisakdi","variants":["regular","700"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Staatliches","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stalemate","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stalinist One","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Stardos Stencil","variants":["regular","700"],"subsets":["latin"]},{"family":"Stick","variants":["regular"],"subsets":["cyrillic","japanese","latin","latin-ext"]},{"family":"Stint Ultra Condensed","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stint Ultra Expanded","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Stoke","variants":["300","regular"],"subsets":["latin","latin-ext"]},{"family":"Strait","variants":["regular"],"subsets":["latin"]},{"family":"Stylish","variants":["regular"],"subsets":["korean","latin"]},{"family":"Sue Ellen Francisco","variants":["regular"],"subsets":["latin"]},{"family":"Suez One","variants":["regular"],"subsets":["hebrew","latin","latin-ext"]},{"family":"Sulphur Point","variants":["300","regular","700"],"subsets":["latin","latin-ext"]},{"family":"Sumana","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Sunflower","variants":["300","500","700"],"subsets":["korean","latin"]},{"family":"Sunshiney","variants":["regular"],"subsets":["latin"]},{"family":"Supermercado One","variants":["regular"],"subsets":["latin"]},{"family":"Sura","variants":["regular","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Suranna","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Suravaram","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Suwannaphum","variants":["regular"],"subsets":["khmer"]},{"family":"Swanky and Moo Moo","variants":["regular"],"subsets":["latin"]},{"family":"Syncopate","variants":["regular","700"],"subsets":["latin"]},{"family":"Syne","variants":["regular","500","600","700","800"],"subsets":["latin","latin-ext"]},{"family":"Syne Mono","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Syne Tactile","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Tajawal","variants":["200","300","regular","500","700","800","900"],"subsets":["arabic","latin"]},{"family":"Tangerine","variants":["regular","700"],"subsets":["latin"]},{"family":"Taprom","variants":["regular"],"subsets":["khmer"]},{"family":"Tauri","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Taviraj","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Teko","variants":["300","regular","500","600","700"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Telex","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Tenali Ramakrishna","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Tenor Sans","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Text Me One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Texturina","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Thasadith","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"The Girl Next Door","variants":["regular"],"subsets":["latin"]},{"family":"Tienne","variants":["regular","700","900"],"subsets":["latin"]},{"family":"Tillana","variants":["regular","500","600","700","800"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Timmana","variants":["regular"],"subsets":["latin","telugu"]},{"family":"Tinos","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","hebrew","latin","latin-ext","vietnamese"]},{"family":"Titan One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Titillium Web","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900"],"subsets":["latin","latin-ext"]},{"family":"Tomorrow","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext"]},{"family":"Trade Winds","variants":["regular"],"subsets":["latin"]},{"family":"Trirong","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],"subsets":["latin","latin-ext","thai","vietnamese"]},{"family":"Trispace","variants":["100","200","300","regular","500","600","700","800"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Trocchi","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Trochut","variants":["regular","italic","700"],"subsets":["latin"]},{"family":"Truculenta","variants":["100","200","300","regular","500","600","700","800","900"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Trykker","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Tulpen One","variants":["regular"],"subsets":["latin"]},{"family":"Turret Road","variants":["200","300","regular","500","700","800"],"subsets":["latin","latin-ext"]},{"family":"Ubuntu","variants":["300","300italic","regular","italic","500","500italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Ubuntu Condensed","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Ubuntu Mono","variants":["regular","italic","700","700italic"],"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext"]},{"family":"Ultra","variants":["regular"],"subsets":["latin"]},{"family":"Uncial Antiqua","variants":["regular"],"subsets":["latin"]},{"family":"Underdog","variants":["regular"],"subsets":["cyrillic","latin","latin-ext"]},{"family":"Unica One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"UnifrakturCook","variants":["700"],"subsets":["latin"]},{"family":"UnifrakturMaguntia","variants":["regular"],"subsets":["latin"]},{"family":"Unkempt","variants":["regular","700"],"subsets":["latin"]},{"family":"Unlock","variants":["regular"],"subsets":["latin"]},{"family":"Unna","variants":["regular","italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"VT323","variants":["regular"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Vampiro One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Varela","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Varela Round","variants":["regular"],"subsets":["hebrew","latin","latin-ext","vietnamese"]},{"family":"Varta","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Vast Shadow","variants":["regular"],"subsets":["latin"]},{"family":"Vesper Libre","variants":["regular","500","700","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Viaoda Libre","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Vibes","variants":["regular"],"subsets":["arabic","latin"]},{"family":"Vibur","variants":["regular"],"subsets":["latin"]},{"family":"Vidaloka","variants":["regular"],"subsets":["latin"]},{"family":"Viga","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Voces","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Volkhov","variants":["regular","italic","700","700italic"],"subsets":["latin"]},{"family":"Vollkorn","variants":["regular","500","600","700","800","900","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["cyrillic","cyrillic-ext","greek","latin","latin-ext","vietnamese"]},{"family":"Vollkorn SC","variants":["regular","600","700","900"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Voltaire","variants":["regular"],"subsets":["latin"]},{"family":"Waiting for the Sunrise","variants":["regular"],"subsets":["latin"]},{"family":"Wallpoet","variants":["regular"],"subsets":["latin"]},{"family":"Walter Turncoat","variants":["regular"],"subsets":["latin"]},{"family":"Warnes","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Wellfleet","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Wendy One","variants":["regular"],"subsets":["latin","latin-ext"]},{"family":"Wire One","variants":["regular"],"subsets":["latin"]},{"family":"Work Sans","variants":["100","200","300","regular","500","600","700","800","900","100italic","200italic","300italic","italic","500italic","600italic","700italic","800italic","900italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Xanh Mono","variants":["regular","italic"],"subsets":["latin","latin-ext","vietnamese"]},{"family":"Yanone Kaffeesatz","variants":["200","300","regular","500","600","700"],"subsets":["cyrillic","latin","latin-ext","vietnamese"]},{"family":"Yantramanav","variants":["100","300","regular","500","700","900"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Yatra One","variants":["regular"],"subsets":["devanagari","latin","latin-ext"]},{"family":"Yellowtail","variants":["regular"],"subsets":["latin"]},{"family":"Yeon Sung","variants":["regular"],"subsets":["korean","latin"]},{"family":"Yeseva One","variants":["regular"],"subsets":["cyrillic","cyrillic-ext","latin","latin-ext","vietnamese"]},{"family":"Yesteryear","variants":["regular"],"subsets":["latin"]},{"family":"Yrsa","variants":["300","regular","500","600","700"],"subsets":["latin","latin-ext"]},{"family":"Yusei Magic","variants":["regular"],"subsets":["japanese","latin","latin-ext"]},{"family":"ZCOOL KuaiLe","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"ZCOOL QingKe HuangYou","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"ZCOOL XiaoWei","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Zeyada","variants":["regular"],"subsets":["latin"]},{"family":"Zhi Mang Xing","variants":["regular"],"subsets":["chinese-simplified","latin"]},{"family":"Zilla Slab","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"],"subsets":["latin","latin-ext"]},{"family":"Zilla Slab Highlight","variants":["regular","700"],"subsets":["latin","latin-ext"]}]')},function(e,t){e.exports="dist/images/components-design-separator-control-curve-1.a61eacd.png"},function(e,t){e.exports="dist/images/components-design-separator-control-curve-2.7a9883c.png"},function(e,t){e.exports="dist/images/components-design-separator-control-curve-3.b42e517.png"},function(e,t){e.exports="dist/images/components-design-separator-control-rounded-1.d2b77d9.png"},function(e,t){e.exports="dist/images/components-design-separator-control-rounded-2.e6d5edc.png"},function(e,t){e.exports="dist/images/components-design-separator-control-rounded-3.54719e2.png"},function(e,t){e.exports="dist/images/components-design-separator-control-slant-1.1a7bbee.png"},function(e,t){e.exports="dist/images/components-design-separator-control-slant-2.622c736.png"},function(e,t){e.exports="dist/images/components-design-separator-control-straight-1.3d6e794.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-1.479a6de.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-2.8ad6a1d.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-3.6db0486.png"},function(e,t){e.exports="dist/images/components-design-separator-control-wave-4.5f9e008.png"},,function(e,t){e.exports="dist/images/components-button-controls-basic.b11a0a1.png"},function(e,t){e.exports="dist/images/components-button-controls-ghost.693bd0a.png"},function(e,t){e.exports="dist/images/components-button-controls-link.5941222.png"},function(e,t){e.exports="dist/images/components-button-controls-plain.9a9337a.png"},function(e,t){e.exports="dist/images/components-icon-controls-plain.08b10ae.png"},function(e,t){e.exports="dist/images/components-icon-controls-shaped.f4f347f.png"},function(e,t){e.exports="dist/images/components-icon-controls-outlined.ecba760.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1.b25dc1c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2.251f715.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3.a91efa1.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1.4c4319a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2.c441aac.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3.2409bb5.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4.9b307d9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1.ec684b9.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2.4601b46.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3.4ef0451.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-grid.c178b51.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-grid.9c461c0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-grid.3921dc3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-grid.fe6e028.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-grid.5c04307.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-grid.111efd7.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-grid.ef73de3.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-grid.146feaa.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-grid.5d65a3e.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-grid.906e9b0.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-1-uneven.7045e09.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-2-uneven.a4f271c.png"},function(e,t){e.exports="dist/images/components-columns-width-control-2-3-uneven.1983521.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-1-uneven.929b1cf.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-2-uneven.a346601.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-3-uneven.84b5000.png"},function(e,t){e.exports="dist/images/components-columns-width-control-3-4-uneven.42a4995.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-1-uneven.430f93a.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-2-uneven.f1a848f.png"},function(e,t){e.exports="dist/images/components-columns-width-control-4-3-uneven.8099e5e.png"},,function(e,t){e.exports="dist/videos/help/full-height.mp4"},function(e,t){e.exports="dist/videos/help/general-restrict-content.mp4"},function(e,t){e.exports="dist/videos/help/general-border-radius.mp4"},function(e,t){e.exports="dist/videos/help/general-shadow.mp4"},function(e,t){e.exports="dist/videos/help/alignment-all.mp4"},function(e,t){e.exports="dist/videos/help/general-columns.mp4"},function(e,t){e.exports="dist/videos/help/column-background-on-off.mp4"},function(e,t){e.exports="dist/videos/help/image-shape.mp4"},function(e,t){e.exports="dist/videos/help/image-size.mp4"},function(e,t){e.exports="dist/videos/help/image-size-no-crop.mp4"},function(e,t){e.exports="dist/videos/help/image-width-crop.mp4"},function(e,t){e.exports="dist/videos/help/image-height-crop.mp4"},function(e,t){e.exports="dist/videos/help/image-square.mp4"},function(e,t){e.exports="dist/videos/help/image-border-radius.mp4"},function(e,t){e.exports="dist/videos/help/image-shadow.mp4"},function(e,t){e.exports="dist/videos/help/typography-size.mp4"},function(e,t){e.exports="dist/videos/help/typography-weight.mp4"},function(e,t){e.exports="dist/videos/help/typography-transform.mp4"},function(e,t){e.exports="dist/videos/help/typography-line-height.mp4"},function(e,t){e.exports="dist/videos/help/typography-letter-spacing.mp4"},function(e,t){e.exports="dist/videos/help/alignment-description.mp4"},function(e,t){e.exports="dist/videos/help/alignment-button.mp4"},function(e,t){e.exports="dist/videos/help/button-padding.mp4"},function(e,t){e.exports="dist/videos/help/button-vertical-padding.mp4"},function(e,t){e.exports="dist/videos/help/button-horizontal-padding.mp4"},function(e,t){e.exports="dist/videos/help/button-size.mp4"},function(e,t){e.exports="dist/videos/help/button-hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/button-hover-opacity.mp4"},function(e,t){e.exports="dist/videos/help/button-hover-color.mp4"},function(e,t){e.exports="dist/videos/help/button-shadow.mp4"},function(e,t){e.exports="dist/videos/help/button-border-radius.mp4"},function(e,t){e.exports="dist/videos/help/button-color-type.mp4"},function(e,t){e.exports="dist/videos/help/button-to-normal.mp4"},function(e,t){e.exports="dist/videos/help/button-collapse.mp4"},function(e,t){e.exports="dist/videos/help/spacing.mp4"},function(e,t){e.exports="dist/videos/help/spacing-block-title.mp4"},function(e,t){e.exports="dist/videos/help/spacing-block-description.mp4"},function(e,t){e.exports="dist/videos/help/spacing-description.mp4"},function(e,t){e.exports="dist/videos/help/spacing-button.mp4"},function(e,t){e.exports="dist/videos/help/spacing-button-gap.mp4"},function(e,t){e.exports="dist/videos/help/hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/background-on-off.mp4"},function(e,t){e.exports="dist/videos/help/background-color-opacity.mp4"},function(e,t){e.exports="dist/videos/help/background-tint.mp4"},function(e,t){e.exports="dist/videos/help/background-color-type.mp4"},function(e,t){e.exports="dist/videos/help/background-fixed.mp4"},function(e,t){e.exports="dist/videos/help/gradient-direction.mp4"},function(e,t){e.exports="dist/videos/help/gradient-location.mp4"},function(e,t){e.exports="dist/videos/help/background-image-position.mp4"},function(e,t){e.exports="dist/videos/help/background-image-repeat.mp4"},function(e,t){e.exports="dist/videos/help/background-image-size.mp4"},function(e,t){e.exports="dist/videos/help/background-blend-mode.mp4"},function(e,t){e.exports="dist/videos/help/separator-top-on.mp4"},function(e,t){e.exports="dist/videos/help/separator-bottom-on.mp4"},function(e,t){e.exports="dist/videos/help/separator-height.mp4"},function(e,t){e.exports="dist/videos/help/separator-width.mp4"},function(e,t){e.exports="dist/videos/help/separator-shadow.mp4"},function(e,t){e.exports="dist/videos/help/separator-bring-to-front.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer2.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer3.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer-opacity.mp4"},function(e,t){e.exports="dist/videos/help/separator-layer-blend-mode.mp4"},function(e,t){e.exports="dist/videos/help/advanced-opacity.mp4"},function(e,t){e.exports="dist/videos/help/advanced-zindex.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-paddings.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-height.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-vertical-align.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-content-width.mp4"},function(e,t){e.exports="dist/videos/help/advanced-block-horizontal-align.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-gap.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-column-vertical-align.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-height.mp4"},function(e,t){e.exports="dist/videos/help/advanced-column-content-vertical-align.mp4"},function(e,t){e.exports="dist/videos/help/accordion-adjacent-open.mp4"},function(e,t){e.exports="dist/videos/help/accordion-closed-state-background-color.mp4"},function(e,t){e.exports="dist/videos/help/accordion-padding.mp4"},function(e,t){e.exports="dist/videos/help/accordion-title-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-column-width.mp4"},function(e,t){e.exports="dist/videos/help/feature-container-width.mp4"},function(e,t){e.exports="dist/videos/help/feature-container-offset.mp4"},function(e,t){e.exports="dist/videos/help/icon-list-grid.mp4"},function(e,t){e.exports="dist/videos/help/icon-list-gap.mp4"},function(e,t){e.exports="dist/videos/help/image-box-height.mp4"},function(e,t){e.exports="dist/videos/help/notification-dismissible.mp4"},function(e,t){e.exports="dist/videos/help/posts-content-order.mp4"},function(e,t){e.exports="dist/videos/help/posts-meta-separator.mp4"},function(e,t){e.exports="dist/videos/help/divider-margin.mp4"},function(e,t){e.exports="dist/videos/help/pricing-image-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-title-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-price-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-subprice-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-button-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-description-align.mp4"},function(e,t){e.exports="dist/videos/help/pricing-image-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-title-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-price-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-subprice-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-button-spacing.mp4"},function(e,t){e.exports="dist/videos/help/pricing-description-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-overlay.mp4"},function(e,t){e.exports="dist/videos/help/image-box-overlay-hover.mp4"},function(e,t){e.exports="dist/videos/help/image-box-hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/image-box-box-hover-effect.mp4"},function(e,t){e.exports="dist/videos/help/image-box-subtitle-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-title-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-line-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-description-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-arrow-spacing.mp4"},function(e,t){e.exports="dist/videos/help/image-box-subtitle-align.mp4"},function(e,t){e.exports="dist/videos/help/image-box-title-align.mp4"},function(e,t){e.exports="dist/videos/help/image-box-description-align.mp4"},function(e,t){e.exports="dist/videos/help/image-box-arrow-align.mp4"},function(e,t){e.exports="dist/videos/help/video-popup-width.mp4"},function(e,t){e.exports="dist/videos/help/video-popup-height.mp4"},function(e,t){e.exports="dist/videos/help/container-image-width.mp4"},function(e,t){e.exports="dist/videos/help/container-image-height.mp4"},function(e,t){e.exports="dist/videos/help/column-row-gap.mp4"},function(e,t){e.exports="dist/videos/help/no-padding.mp4"},function(e,t){e.exports="dist/videos/help/column-width.mp4"},function(e,t){e.exports="dist/videos/help/column-arrangement.mp4"},function(e,t){e.exports="dist/images/block-accordion-basic.b0f3789.png"},function(e,t){e.exports="dist/images/block-accordion-plain.2aeac8f.png"},function(e,t){e.exports="dist/images/block-accordion-colored.d55890a.png"},function(e,t){e.exports="dist/images/block-accordion-colored-hover.71e1fa4.png"},function(e,t){e.exports="dist/images/block-accordion-line-colored.7e3ee29.png"},function(e,t){e.exports="dist/images/block-accordion-line-colored-hover.f73a869.png"},function(e,t){e.exports="dist/images/block-blockquote-basic.0a574ba.png"},function(e,t){e.exports="dist/images/block-blockquote-plain.cd0c86f.png"},function(e,t){e.exports="dist/images/block-blockquote-centered-quote.bf840b2.png"},function(e,t){e.exports="dist/images/block-blockquote-highlight.01eb7a8.png"},function(e,t){e.exports="dist/images/block-blockquote-huge.e6cf111.png"},function(e,t){e.exports="dist/images/block-blog-posts-basic.0431caf.png"},function(e,t){e.exports="dist/images/block-blog-posts-list.78b14dd.png"},function(e,t){e.exports="dist/images/block-blog-posts-horizontal-card.2b40bef.png"},function(e,t){e.exports="dist/images/block-blog-posts-image-card.ef58109.png"},function(e,t){e.exports="dist/images/block-blog-posts-portfolio.70e8e8c.png"},function(e,t){e.exports="dist/images/block-blog-posts-portfolio2.4d079f6.png"},function(e,t){e.exports="dist/images/block-blog-posts-vertical-card.014a38d.png"},function(e,t){e.exports="dist/images/block-blog-posts-vertical-card2.d29365d.png"},function(e,t){e.exports=wp.htmlEntities},function(e,t){e.exports="dist/images/block-button-basic.cf5349e.png"},function(e,t){e.exports="dist/images/block-button-fullwidth.f370f41.png"},function(e,t){e.exports="dist/images/block-button-grouped-1.6509764.png"},function(e,t){e.exports="dist/images/block-button-grouped-2.45eb41b.png"},function(e,t){e.exports="dist/images/block-button-spread.a2b3bf6.png"},function(e,t){e.exports="dist/images/block-call-to-action-basic.82b89ff.png"},function(e,t){e.exports="dist/images/block-call-to-action-plain.aeb4b5d.png"},function(e,t){e.exports="dist/images/block-call-to-action-horizontal.f5eb57b.png"},function(e,t){e.exports="dist/images/block-call-to-action-horizontal-2.a263e44.png"},function(e,t){e.exports="dist/images/block-call-to-action-horizontal-3.6ad5c3f.png"},function(e,t){e.exports="dist/images/block-call-to-action-split-centered.698e3d8.png"},function(e,t){e.exports="dist/images/block-card-basic.ed15cbf.png"},function(e,t){e.exports="dist/images/block-card-plain.01b366e.png"},function(e,t){e.exports="dist/images/block-card-faded.06399e7.png"},function(e,t){e.exports="dist/images/block-card-full.60eb939.png"},function(e,t){e.exports="dist/images/block-card-horizontal.6ade93f.png"},function(e,t){e.exports="dist/images/block-column-basic.eeda154.png"},function(e,t){e.exports="dist/images/block-column-plain.dd6702f.png"},function(e,t){e.exports="dist/images/block-columns-grid.74cce02.png"},function(e,t){e.exports="dist/images/block-columns-plain.f83145c.png"},function(e,t){e.exports="dist/images/block-columns-uneven.2b7a26d.png"},function(e,t){e.exports="dist/images/block-columns-uneven-2.fe56d00.png"},function(e,t){e.exports="dist/images/block-columns-tiled.98ee90d.png"},function(e,t){e.exports="dist/images/block-container-basic.9b80141.png"},function(e,t){e.exports="dist/images/block-container-plain.b0bf4b9.png"},function(e,t){e.exports="dist/images/block-container-image.b7fa0ae.png"},function(e,t){e.exports="dist/images/block-container-image2.74a962d.png"},function(e,t){e.exports="dist/images/block-container-image3.f76131c.png"},function(e,t){e.exports="dist/images/block-count-up-plain.9350896.png"},function(e,t){e.exports="dist/images/block-count-up-plain-2.ba5ab0d.png"},function(e,t){e.exports="dist/images/block-count-up-abstract.b879aca.png"},function(e,t){e.exports="dist/images/block-count-up-boxed.3c1a313.png"},function(e,t){e.exports="dist/images/block-count-up-side.cbaf64f.png"},function(e,t){e.exports="dist/images/block-divider-basic.728eebd.png"},function(e,t){e.exports="dist/images/block-divider-bar.38cc0b7.png"},function(e,t){e.exports="dist/images/block-divider-dots.6f31a0f.png"},function(e,t){e.exports="dist/images/block-divider-asterisks.d07ce3c.png"},function(e,t){e.exports="dist/images/block-feature-grid-basic.d153b82.png"},function(e,t){e.exports="dist/images/block-feature-grid-plain.d4efae7.png"},function(e,t){e.exports="dist/images/block-feature-grid-horizontal.3d10d8c.png"},function(e,t){e.exports="dist/images/block-feature-grid-large-mid.5e400e2.png"},function(e,t){e.exports="dist/images/block-feature-grid-zigzag.419cfe1.png"},function(e,t){e.exports="dist/images/block-feature-basic.21129f8.png"},function(e,t){e.exports="dist/images/block-feature-plain.705697f.png"},function(e,t){e.exports="dist/images/block-feature-half.5af3a76.png"},function(e,t){e.exports="dist/images/block-feature-overlap.6b378a6.png"},function(e,t){e.exports="dist/images/block-feature-overlap2.62db827.png"},function(e,t){e.exports="dist/images/block-feature-overlap3.5bf62b1.png"},function(e,t){e.exports="dist/images/block-feature-overlap4.1ef990f.png"},function(e,t){e.exports="dist/images/block-feature-overlap5.7599add.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape.5069623.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape2.258557d.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape3.98ffc4f.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape4.c2f4c80.png"},function(e,t){e.exports="dist/images/block-feature-overlap-shape5.15fefe4.png"},function(e,t){e.exports="dist/images/block-header-basic.a9cc4da.png"},function(e,t){e.exports="dist/images/block-header-plain.aeccf8f.png"},function(e,t){e.exports="dist/images/block-header-center-overlay.3858559.png"},function(e,t){e.exports="dist/images/block-header-half.86b5a6b.png"},function(e,t){e.exports="dist/images/block-header-half-overlay.a31b8a8.png"},function(e,t){e.exports="dist/images/block-header-huge.d9d345e.png"},function(e,t){e.exports="dist/images/block-header-side-overlay.4e79477.png"},function(e,t){e.exports="dist/images/block-image-box-basic.f577755.png"},function(e,t){e.exports="dist/images/block-image-box-plain.7482e86.png"},function(e,t){e.exports="dist/images/block-image-box-box.795349f.png"},function(e,t){e.exports="dist/images/block-image-box-captioned.0b54748.png"},function(e,t){e.exports="dist/images/block-image-box-fade.96e3a05.png"},function(e,t){e.exports="dist/images/block-image-box-line.a32cf82.png"},function(e,t){e.exports="dist/images/block-notification-basic.a1f0aae.png"},function(e,t){e.exports="dist/images/block-notification-plain.eccdf36.png"},function(e,t){e.exports="dist/images/block-notification-bordered.6609d56.png"},function(e,t){e.exports="dist/images/block-notification-outlined.2c2cb01.png"},function(e,t){e.exports="dist/images/block-notification-large-icon.2bbe556.png"},function(e,t){e.exports="dist/images/block-number-box-basic.3d5ce27.png"},function(e,t){e.exports="dist/images/block-number-box-plain.1e11a36.png"},function(e,t){e.exports="dist/images/block-number-box-background.c21ee31.png"},function(e,t){e.exports="dist/images/block-number-box-faded.8c04315.png"},function(e,t){e.exports="dist/images/block-number-box-heading.45de6d4.png"},function(e,t){e.exports="dist/images/block-number-box-heading2.4ee5b2a.png"},function(e,t){e.exports="dist/images/block-pricing-box-basic.f439dd1.png"},function(e,t){e.exports="dist/images/block-pricing-box-plain.d7c8289.png"},function(e,t){e.exports="dist/images/block-pricing-box-colored.9843e4e.png"},function(e,t){e.exports="dist/images/block-pricing-box-compact.dc99fe8.png"},function(e,t){e.exports="dist/images/block-pricing-box-sectioned.cb6f482.png"},function(e,t){e.exports="dist/images/block-team-member-basic.53fb1db.png"},function(e,t){e.exports="dist/images/block-team-member-plain.c44209b.png"},function(e,t){e.exports="dist/images/block-team-member-half.5b481b6.png"},function(e,t){e.exports="dist/images/block-team-member-horizontal.f090d7c.png"},function(e,t){e.exports="dist/images/block-testimonial-basic.13e214f.png"},function(e,t){e.exports="dist/images/block-testimonial-plain.8208cdb.png"},function(e,t){e.exports="dist/images/block-testimonial-background.8a0048a.png"},function(e,t){e.exports="dist/images/block-testimonial-basic2.6fe575a.png"},function(e,t){e.exports="dist/images/block-testimonial-bubble.7e7aa18.png"},function(e,t){e.exports="dist/images/block-testimonial-vertical.8603101.png"},function(e,t){e.exports="dist/images/block-testimonial-vertical-inverse.9eda5f3.png"},function(e,t){e.exports="dist/images/block-text-plain.dc76980.png"},function(e,t){e.exports="dist/images/block-text-side-title-1.72a0b81.png"},function(e,t){e.exports="dist/images/block-text-side-title-2.4b31aa6.png"},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})},,,function(e,t,n){var a={"./accordion/index.js":392,"./blockquote/index.js":390,"./blog-posts/index.js":394,"./button/index.js":409,"./call-to-action/index.js":397,"./card/index.js":398,"./column/index.js":416,"./columns/index.js":410,"./container/index.js":411,"./count-up/index.js":395,"./design-library/index.js":417,"./divider/index.js":413,"./expand/index.js":414,"./feature-grid/index.js":399,"./feature/index.js":400,"./header/index.js":401,"./heading/index.js":402,"./icon-list/deprecated/index.js":29,"./icon-list/higher-order/index.js":42,"./icon-list/higher-order/with-transform-old-icon-attributes/index.js":41,"./icon-list/index.js":412,"./icon/index.js":403,"./image-box/index.js":396,"./notification/index.js":393,"./number-box/index.js":404,"./pricing-box/index.js":405,"./separator/index.js":389,"./spacer/index.js":415,"./team-member/index.js":406,"./testimonial/index.js":407,"./text/index.js":408,"./video-popup/index.js":391};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id=387},function(e,t,n){"use strict";n.r(t);var a=n(3),i=n(2),o=n(1),r=n(11),l=n(31),c=n(9),s=n(0),u=n(6),b=n(18),p=n(13);function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var g=function(e,t,n,a){return""===t?n?Object(l.applyFormat)(e,{type:"ugb/highlight",attributes:{style:"color: ".concat(n,";")}}):Object(l.removeFormat)(e,"ugb/highlight"):"highlight"===t?Object(l.applyFormat)(e,{type:"ugb/highlight",attributes:{style:(n?"color: ".concat(n,";"):"")+(a?"background-color: ".concat(a):"")}}):Object(l.applyFormat)(e,{type:"ugb/highlight",attributes:{style:(n?"color: ".concat(n,";"):"")+(a?"background: linear-gradient(to bottom, transparent 50%, ".concat(a," 50%)"):"")}})};Object(l.registerFormatType)("ugb/highlight",{title:Object(s.__)("Highlight Text",o.i18n),tagName:"span",className:"ugb-highlight",edit:function(e){var t=m(Object(u.useState)(!1),2),n=t[0],l=t[1],b=Object(u.useRef)(null),p=Object(u.useCallback)(function(e){n&&(e.target.closest(b.current)||e.target.closest(".components-popover")||l(!1))});Object(u.useEffect)(function(){return document.body.addEventListener("click",p),function(){return document.body.removeEventListener("click",p)}},[p]);var d=e.activeAttributes,f=e.isActive,h=e.onChange,v=e.value,y=f?function(e){var t="",n="",a="";if(e.match(/linear-gradient\(/)){a="low";var i=e.match(/linear-gradient\(\s*to bottom\s*,\s*transparent \d+%\s*,\s*(.*?)\s\d+%\)/);i&&(n=i[1])}else if(e.match(/background-color:/)){a="highlight";var o=e.match(/background-color:\s*([^;]*)?/);o&&(n=o[1])}var r=e.match(/(^|[^-])color:\s*([^;]*)?/);return r&&(t=r[2]),{textColor:t,highlightColor:n,colorType:a}}(d.style):{},O=y.textColor,w=void 0===O?"":O,_=y.highlightColor,k=void 0===_?"":_,j=y.colorType,C=void 0===j?"":j,x=(""!==C?k:w)||w;return wp.element.createElement(c.BlockControls,null,wp.element.createElement(r.Toolbar,{className:"stackable-components-toolbar"},wp.element.createElement(a.o,{className:"components-button components-icon-button components-toolbar__control",icon:"editor-textcolor","aria-haspopup":"true",tooltip:Object(s.__)("Color & Highlight",o.i18n),onClick:function(){return l(!n)}},wp.element.createElement("span",{className:"components-stackable-highlight-color__indicator",style:{backgroundColor:x}})),n&&wp.element.createElement(r.Popover,{position:"bottom center",className:"components-stackable-highlight__popover",focusOnMount:"container",useRef:b,isAlternate:!0},wp.element.createElement("div",{className:"components-stackable-highlight__inner"},wp.element.createElement(a.e,{controls:[{value:"",title:Object(s.__)("Normal",o.i18n)},{value:"highlight",title:Object(s.__)("Highlight",o.i18n)},{value:"low",title:Object(s.__)("Low",o.i18n)}],value:C,onChange:function(e){var t=k||(""!==e?w||"#f34957":k),n="highlight"===e?Object(i.wb)("",t):"low"===e?"":k||w||"";h(g(v,e,n,t),{withoutHistory:!0})},isSmall:!0}),wp.element.createElement("div",{className:"ugb-highlight-format__color-picker"},wp.element.createElement(a.v,{label:Object(s.__)("Text Color",o.i18n),value:w,onChange:function(e){h(g(v,C,e,k),{withoutHistory:!0})}})),""!==C&&wp.element.createElement("div",{className:"ugb-highlight-format__color-picker"},wp.element.createElement(a.v,{label:Object(s.__)("Highlight Color",o.i18n),value:k,onChange:function(e){h(g(v,C,w,e),{withoutHistory:!0})}}))))))},attributes:{style:"style"}}),Object(b.a)(function(){Object(p.select)("core/edit-post").isFeatureActive("disableEditorsKitColorsFormats")||Object(p.dispatch)("core/edit-post").toggleFeature("disableEditorsKitColorsFormats"),Object(p.select)("core/edit-post").isFeatureActive("disableEditorsKitHighlightFormats")||Object(p.dispatch)("core/edit-post").toggleFeature("disableEditorsKitHighlightFormats")});var d=n(17),f=n(7);function h(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:y,n=e.name,a=e.isValid,i=e.validationIssues,o=e.originalContent;if(!n||!n.match(/^ugb\//))return!1;if(!n.match(/separator/)&&!o.match(/ugb-main-block/))return!1;if(a)return!1;if(!i.length)return!1;if(O(i[0]))return!0;if(_(i[0]))return!0;if(x(i[0]))return!0;if(w(i[0]))return!0;if(E(i[0]))return!0;if(S(i[0]))return!0;if(k(i[0]))return!0;if(j(i[0]))return!0;if(C(i[0]))return!0;var r=P(e);return!!r&&r.some(function(e){return t.includes(e)})}(t)){var a=M(t);return a.replacedClientId=t.clientId,a.recovered=!0,console.log("Stackable notice: block "+t.name+" ("+t.clientId+") was auto-recovered, you should not see this after saving your page."),a}return t})},M=function(e){var t=e.name,n=e.attributes,a=e.innerBlocks;return Object(d.createBlock)(t,n,a)};Object(b.a)(function(){window._wpLoadBlockEditor&&window._wpLoadBlockEditor.then(function(){A()})});var R=n(4),D=n(26),F={desktop:"Desktop",tablet:"Tablet",mobile:"Mobile"};Object(R.addAction)("stackable.responsive-toggle.screen.change","stackable/responsive-preview",function(e){var t=Object(p.dispatch)("core/edit-post").__experimentalSetPreviewDeviceType,n=Object(p.select)("core/edit-post").__experimentalGetPreviewDeviceType;if(t){var a=F[e];a!==n()&&t(a)}});Object(p.select)("core/edit-post").__experimentalGetPreviewDeviceType&&Object(D.registerPlugin)("stackable-responsive-toggle-change",{render:function(){var e=Object(p.useSelect)(function(e){return{deviceType:e("core/edit-post").__experimentalGetPreviewDeviceType()}},[]).deviceType,t=Object(f.findKey)(F,function(t){return t===e})||"desktop";return setTimeout(function(){t!==Object(i.W)()&&(Object(i.pb)(t),Object(R.doAction)("stackable.responsive-toggle.screen.change",t)),"desktop"!==t?(Object(i.ob)(!0),Object(R.doAction)("stackable.responsive-toggle.screen.open")):(Object(i.ob)(!1),Object(R.doAction)("stackable.responsive-toggle.screen.close"))},0),null}});var L=n(115),U=n.n(L);function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function I(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return[];var n=[];return e.forEach(function(e,a){var i=e.href;t.some(function(e){return e||null!==i?!!(i&&e&&i.includes(e))&&n.push(a):n.push(a)})}),n},K={},Y={},J=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.styleSheets,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:K,a=Array.from(t),i=q(a,e),o=[];return i.forEach(function(e){if(t[e].__id)o.push(t[e].__id);else{var n=U()(Math.floor(Math.random()*(new Date).getTime())).substr(0,10);t[e].__id=n,o.push(n)}}),o.forEach(function(e){var t={},i=Array.from(a).findIndex(function(t){return t.__id===e}),o=Array.from(a[i].cssRules).filter(function(e){return e.media});(!Y[e]||Y[e]&&!Object(f.isEqual)(Y[e],o))&&(Y[e]=!Object(f.isEmpty)(o)&&V(o),Array.from(a[i].cssRules).forEach(function(a,i){var o=a.cssText,r=a.media;if(r&&o.includes(".ugb")&&r.mediaText.match(/(max|min)-width/)){var l=r.mediaText.match(/max-width:\s*(\d+)px/),c=r.mediaText.match(/min-width:\s*(\d+)px/),s=l?parseInt(l[1],10):9999,u=c?parseInt(c[1],10):0;if(n&&n[e]&&n[e][i])n[e][i].previousMediaText===r.mediaText?t[i]=I({},n[e][i]):t[i]={cssText:o,mediaText:r.mediaText,min:u,max:s};else t[i]={cssText:o,mediaText:r.mediaText,min:u,max:s}}}),n[e]=I({},t))}),I({},n)},X=".edit-post-visual-editor > .editor-styles-wrapper, .edit-post-visual-editor.editor-styles-wrapper",$="Desktop",Q={},Z=function(){var e=Object(p.select)("core/edit-post").__experimentalGetPreviewDeviceType;if(e){var t=e();if("Desktop"!==t||"Desktop"!==$){if($=t,!Q[t]){var n=document.querySelector(X);Q[t]=parseInt(window.getComputedStyle(n).width,10)}!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:G,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document.styleSheets,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:K;try{var o=J(n,a,i),r=function(e){var n=z(e.split("vw"),1)[0],a=parseFloat(n)/100*t;return"".concat(a,"px")},l=function(e){return e.replace(/(-?[.0-9]+)vw/g,r)},c=function(e,t,n){a[e].deleteRule(t),a[e].insertRule(n,t)};"Tablet"===e||"Mobile"===e?Object(f.keys)(o).forEach(function(e){var n=Array.from(a).findIndex(function(t){return t.__id===e});Object(f.keys)(o[e]).forEach(function(i){if(a[n]&&a[n].cssRules[i]){var r=o[e][i],s=r.min,u=r.max,b=r.cssText;Object(f.inRange)(t,s,u)?(b&&b.match(/(-?[.0-9]+)vw/g)&&c(n,i,l(b)),a[n].cssRules[i].media.mediaText="screen and (max-width: 5000px)"):(b&&b.match(/(-?[.0-9]+)vw/g)&&c(n,i,l(b)),a[n].cssRules[i].media.mediaText="screen and (min-width: 5000px)"),o[e][i].previousMediaText!==a[n].cssRules[i].media.mediaText&&(o[e][i].previousMediaText=a[n].cssRules[i].media.mediaText)}})}):Object(f.keys)(o).forEach(function(e){var t=Array.from(a).findIndex(function(t){return t.__id===e});Object(f.keys)(o[e]).forEach(function(n){if(a[t]&&a[t].cssRules[n]){var i=o[e][n].cssText;a[t].cssRules[n].media.mediaText!==o[e][n].mediaText&&(o[e][n].previousMediaText=a[t].cssRules[n].media.mediaText,c(t,n,i)),o[e][n].previousMediaText!==a[t].cssRules[n].media.mediaText&&(o[e][n].previousMediaText=a[t].cssRules[n].media.mediaText)}})})}catch(e){console.warn("Stackable error: plugin stylesheet is hosted in a remote location, responsive live editing is disabled. To enable it, please don't use a CDN while using Gutenberg")}}(t,Q[t])}}};Object(R.addAction)("stackable.setAttributes.after","stackable/responsive-preview",Z);function ee(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{};return{type:"UPDATE_SETTINGS",payload:Object(f.omit)(e,"type")}}};Object(p.registerStore)("stackable/global-colors",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:se,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return le({},e,{},t.payload);default:return e}},actions:ue,selectors:{getSettings:function(e){return e}}});Object(b.a)(function(){oe.loadPromise.then(function(){(new oe.models.Settings).fetch().then(function(e){var t,n=e.stackable_global_colors_palette_only,a=e.stackable_global_colors,i=Object(f.head)(a)||[],o=i.map(function(e){return e.slug}),r=Object(p.select)("core/block-editor").getSettings().colors;(r||[]).some(function(e){return e.fallback&&e.colorVar})?(t=function(e){return Object(f.compact)((e||[]).map(function(e){return e.fallback&&e.colorVar?e.slug.match(/^stk-global-color/)?{color:e.fallback,slug:"stk-global-color-".concat(Math.floor(Math.random()*(new Date).getTime())%1e5),rgb:e.rgb||"0, 0, 0",name:e.name||"Untitled Color"}:null:e}))}(r),Object(p.dispatch)("core/block-editor").updateSettings({colors:t}),i=t.filter(function(e){return e.slug.match(/^stk-global-color/)}),o=i.map(function(e){return e.slug})):t=r||[];var l=t.filter(function(e){var t=e.slug;return!o.includes(t)});Object(p.dispatch)("stackable/global-colors").updateSettings({defaultColors:l,useStackableColorsOnly:n,stackableColors:i,isInitializing:!1})})})});var be=n(5),pe=n.n(be);function me(){return(me=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!Array.isArray(t))return e;var a=n.includeSlugNames,i=void 0!==a&&a,o=n.includeColorVar,r=void 0===o||o,l=JSON.stringify(e);if(r&&t.forEach(function(e){e.slug.match(/^stk-global-color/)&&(l=l.replace(new RegExp("var\\(--".concat(e.slug,", ").concat(e.color.replace(")","\\)").replace("(","\\("),"\\)"),"g"),function(t){return e?e.color||"#000000":t}))}),i){var c=t.filter(function(e){return e.slug&&e.slug.match(/^stk-global-color/)}).map(function(e){return e.slug});c.forEach(function(e){var n=Object(f.find)(t,function(t){return t.slug===e});l=l.replace(new RegExp('"'.concat(e,'"'),"g"),n?'"'.concat(n.color,'"')||!1:'"#000000"')})}return JSON.parse(l)}(e.attributes,t);Object(f.isEqual)(o,e.attributes)||i(n,o)}else if(a.includes("core/")&&(a.includes("heading")||a.includes("paragraph"))){var r={style:_e({color:{}},e.attributes.style)},l=e.attributes,c=l.backgroundColor,s=l.textColor;if(c&&c.includes("stk-global-color-")){var u=c.match(/stk-global-color-(\S*)/);if(u&&Array.isArray(u)&&u.length>=2){var b=u[1];r.backgroundColor=void 0;var m=Object(f.find)(t,function(e){return e.slug==="stk-global-color-".concat(b)});r.style.color.background=m&&m.color||"#000000"}}if(s&&s.includes("stk-global-color-")){var g=s.match(/stk-global-color-(\S*)/);if(g&&Array.isArray(g)&&g.length>=2){var d=g[1];r.textColor=void 0;var h=Object(f.find)(t,function(e){return e.slug==="stk-global-color-".concat(d)});r.style.color.text=h&&h.color||"#000000"}}i(n,r)}},Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!Array.isArray(t))return e;var n=JSON.stringify(e),a=t.filter(function(e){return e.slug.match(/^stk-global-color/)}).map(function(e){return"--".concat(e.slug)});return a.forEach(function(e){var a=new RegExp("var\\(".concat(e,",(.?)#(.*?(?=\\)))\\)"),"g");n=n.replace(a,function(n){var a=Object(f.find)(t,function(t){return"--".concat(t.slug)===e});return a?"var(".concat(e,", ").concat(a.color,")"):n})}),JSON.parse(n)},xe=function(e){var t=ne()(e.match(/^#/)?e:"#".concat(e));return t.splice(3,1),t.join(", ")},Ee=function(e){!function t(n){n.forEach(function(n){je(n,e),n.innerBlocks&&n.innerBlocks.length&&t(n.innerBlocks)})}(Object(p.select)("core/block-editor").getBlocks())},Se=n(8),Be=n.n(Se);function Te(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:"desktop",n=[];return e.fontFamily&&n.push(e.fontFamily),e.fontSize&&n.push("".concat(e.fontSize).concat(e.fontSizeUnit||"px")),"tablet"===t&&e.tabletFontSize?(e.fontSize&&n.pop(),n.push("".concat(e.tabletFontSize).concat(e.tabletFontSizeUnit||"px"))):"mobile"===t&&(e.tabletFontSize||e.mobileFontSize)&&(e.fontSize&&n.pop(),e.mobileFontSize?n.push("".concat(e.mobileFontSize).concat(e.mobileFontSizeUnit||"px")):n.push("".concat(e.tabletFontSize).concat(e.tabletFontSizeUnit||"px"))),e.fontWeight&&n.push(e.fontWeight),e.textTransform&&n.push(Object(f.upperFirst)(e.textTransform)),n.join(", ")},at=function(e){var t,n=e.tag,a=Object(p.useSelect)(function(e){return{device:e("core/edit-post").__experimentalGetPreviewDeviceType().toLowerCase()}},[]).device,o=nt(e.styles,a),r=Object(f.omit)(e.styles,["lineHeight","tabletLineHeight","mobileLineHeight"]),l=(Ze(t={},'.ugb-global-typography-preview__label[data-tag="'.concat(e.tag,'"]'),Object(i.K)("%s","desktop",r,{important:!0})),Ze(t,'.ugb-global-typography-preview__label[data-tag="'.concat(e.tag,'"]:not([data-device="desktop"])'),Object(i.K)("%s","tablet",r,{important:!0})),Ze(t,'.ugb-global-typography-preview__label[data-tag="'.concat(e.tag,'"][data-device="mobile"]'),Object(i.K)("%s","mobile",r,{important:!0})),t);return e.styles.fontFamily&&Object(i.fb)(e.styles.fontFamily),wp.element.createElement("div",{className:"ugb-global-typography-preview"},wp.element.createElement("div",{className:"editor-styles-wrapper"},wp.element.createElement("div",{className:"block-editor-block-list__layout"},wp.element.createElement("div",{className:"wp-block block-editor-block-list__block"},wp.element.createElement("style",null,Object(He.b)(l).join("")),wp.element.createElement(n,{className:"ugb-global-typography-preview__label","data-tag":e.tag,"data-device":a},e.children)))),o&&wp.element.createElement("p",{className:"ugb-global-typography-preview__description"},o))};function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var lt=[{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),1),tag:"h1"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),2),tag:"h2"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),3),tag:"h3"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),4),tag:"h4"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),5),tag:"h5"},{label:Object(s.sprintf)(Object(s.__)("Heading %d",o.i18n),6),tag:"h6"},{label:Object(s.__)("Body Text",o.i18n),tag:"p"}],ct=null;Object(R.addFilter)("stackable.global-settings.inspector","stackable/global-typography",function(e){var t=rt(Object(u.useState)([]),2),n=t[0],i=t[1],r=rt(Object(u.useState)(""),2),l=r[0],c=r[1];Object(u.useEffect)(function(){oe.loadPromise.then(function(){(new oe.models.Settings).fetch().then(function(e){i(Object(f.head)(e.stackable_global_typography)||{}),c(e.stackable_global_typography_apply_to||"blocks-stackable-native")})})},[]),Object(u.useEffect)(function(){Object(R.doAction)("stackable.global-settings.typography.update-trigger",n,l)},[JSON.stringify(n),l]);var b=function(e,t){var a=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:mt;this.setState({isLoading:!0}),fetch(t).then(function(t){return e.setState({isLoading:!1,loaded:!0}),t.json()}).then(function(t){e.updateTestState(t)})}},{key:"onClick",value:function(){this.fetchTests(mt)}},{key:"onClickLocal",value:function(){this.fetchTests(Object(s.sprintf)("%s/dist/deprecation-tests.json",o.srcUrl))}},{key:"onRunAllTests",value:function(){var e=this.state.tests.map(function(e){return e.skip?vt({},e,{passed:!0}):vt({},e,{passed:gt(e.html)})});this.setState({tests:e})}},{key:"onRunTest",value:function(e){var t=this.state.tests.map(function(t){return t.block!==e?t:t.skip?vt({},t,{passed:!0}):vt({},t,{passed:gt(t.html)})});this.setState({tests:t})}},{key:"onShowToggle",value:function(e){this.setState({show:this.state.show.includes(e)?this.state.show.filter(function(t){return t!==e}):this.state.show.concat(e)})}},{key:"render",value:function(){var e=this,t=Be()(["ugb-deprecated-tester"],{"ugb-deprecated-tester--loading":this.state.isLoading});return wp.element.createElement("div",{className:t},wp.element.createElement(r.BaseControl,null,wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("When Stackable blocks are updated, block internal workings may change & editing existing blocks may result in errors if the changes are not backward compatible. This area tests multiple outdated blocks on whether they can migrate properly to newer versions.",o.i18n)),wp.element.createElement(r.Button,{className:"ugb-deprecated-tester__load-button",isSecondary:!0,onClick:this.onClick,disabled:this.state.isLoading},wp.element.createElement(r.Dashicon,{icon:"image-rotate",size:"12"}),Object(s.__)("Load Tests from Server",o.i18n)),!1),this.state.loaded&&wp.element.createElement(u.Fragment,null,wp.element.createElement("hr",null),wp.element.createElement("p",{className:"ugb-deprecated-tester--row ugb--first"},wp.element.createElement(r.Button,{isPrimary:!0,isSmall:!0,onClick:this.onRunAllTests},Object(s.__)("Run All Tests",o.i18n)))),this.state.loaded&&this.state.testBlockNames.map(function(t,n){var a=e.state.tests.filter(function(e){return e.block===t}),i=a.length,l=a.filter(function(e){return e.passed}).length;return wp.element.createElement(u.Fragment,{key:n},wp.element.createElement("div",{key:n,className:"ugb-deprecated-tester--row"},wp.element.createElement("span",{className:"ugb-deprecated-tester--name"},t,wp.element.createElement(r.Button,{isSecondary:!1,icon:"editor-help",onClick:function(){return e.onShowToggle(t)}})),wp.element.createElement("span",{className:i===l?"ugb--green":""},Object(s.sprintf)(Object(s.__)("%d / %d Tests",o.i18n),l,i),wp.element.createElement(r.Button,{isSecondary:!1,onClick:function(){return e.onRunTest(t)},icon:"controls-play"}))),e.state.show.includes(t)&&wp.element.createElement("div",{className:"ugb-deprecated-tester--test-detail-wrapper"},a.map(function(e,t){var n=e.html.replace(/()/g,function(e,t){return t.replace(/\n/g,"\\n").replace(/\t/g,"\\t")});return wp.element.createElement("div",{key:t},wp.element.createElement("div",null,e.description,!e.skip&&!0===e.passed&&wp.element.createElement("small",{className:"ugb--passed"},Object(s.__)("Passed",o.i18n)),!e.skip&&!1===e.passed&&wp.element.createElement("small",{className:"ugb--failed"},Object(s.__)("Failed",o.i18n)),e.skip&&wp.element.createElement("small",{className:"ugb--skipped"},Object(s.__)("Skipped",o.i18n))),wp.element.createElement("div",{className:"ugb-deprecated-tester--test-details"},wp.element.createElement("small",{className:"ugb--version"},Object(s.sprintf)(Object(s.__)("v%s",o.i18n),e.version)),e.plan&&wp.element.createElement("small",{className:"ugb--plan ugb--plan-".concat(e.plan)},e.plan),wp.element.createElement(r.ClipboardButton,{isSecondary:!1,isLink:!0,text:n},Object(s.__)("Copy code",o.i18n)),e.skip&&wp.element.createElement("small",{className:"ugb--skipped-note"},wp.element.createElement("span",{role:"img","aria-label":Object(s.__)("Note",o.i18n)},"⚠️")," ",e.skip)))})))}))}}])&&Ot(n.prototype,a),i&&Ot(n,i),t}();function Ct(e){return(Ct="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 xt(e,t){for(var n=0;nSome sample code

\n\x3c!-- /wp:paragraph --\x3e"};var At=Pt,Nt=function(){return wp.element.createElement(u.Fragment,null,wp.element.createElement(ut.PluginSidebarMoreMenuItem,{target:"stackable-block-tester"},Object(s.__)("Stackable Debugger",o.i18n)),wp.element.createElement(ut.PluginSidebar,{name:"stackable-block-tester",isPinnable:!1,title:Object(s.__)("Stackable Debugger",o.i18n)},wp.element.createElement("div",{className:"ugb-debugger-panel"},wp.element.createElement("p",{className:"components-base-control__help"},Object(s.__)("This area contains a number of testing and debugging tools made specifically for Stackable.",o.i18n))),wp.element.createElement(a.gb,{initialOpen:!1,title:Object(s.__)("Block Validity Checker",o.i18n)},wp.element.createElement(At,null)),wp.element.createElement(a.gb,{initialOpen:!1,title:Object(s.__)("Block Migration Tests",o.i18n)},wp.element.createElement(jt,null))))};Object(D.registerPlugin)("stackable-convert-to-container-button",{render:a.A}),o.devMode&&(Object(D.registerPlugin)("stackable-block-tester",{icon:"clipboard",render:Nt}),Object(D.registerPlugin)("stackable-block-attributes-get-button",{render:a.M}));var Mt=n(116),Rt=n.n(Mt),Dt=n(117),Ft=n.n(Dt),Lt=n(118),Ut=n.n(Lt),zt=n(119),Ht=n.n(zt),It=n(120),Wt=n.n(It),Vt=n(121),Gt=n.n(Vt),qt=n(122),Kt=n.n(qt),Yt=n(123),Jt=n.n(Yt),Xt=n(124),$t=n.n(Xt),Qt=n(125),Zt=n.n(Qt),en=n(126),tn=n.n(en),nn=n(127),an=n.n(nn),on=n(128),rn=n.n(on),ln=n(129),cn=n.n(ln),sn=n(130),un=n.n(sn),bn=n(45),pn=n.n(bn),mn=n(131),gn=n.n(mn),dn=n(132),fn=n.n(dn),hn=n(133),vn=n.n(hn),yn=n(134),On=n.n(yn),wn=n(135),_n=n.n(wn),kn=n(36),jn=n.n(kn),Cn=n(46),xn=n.n(Cn),En=n(136),Sn=n.n(En),Bn=n(137),Tn=n.n(Bn),Pn=n(138),An=n.n(Pn),Nn=n(139),Mn=n.n(Nn),Rn=n(140),Dn=n.n(Rn),Fn=n(141),Ln=n.n(Fn),Un=n(142),zn=n.n(Un),Hn=n(143),In=n.n(Hn),Wn=n(144),Vn=n.n(Wn),Gn=n(145),qn=n.n(Gn),Kn=n(146),Yn=n.n(Kn),Jn=n(147),Xn=n.n(Jn),$n=n(148),Qn=n.n($n),Zn=n(149),ea=n.n(Zn),ta=n(150),na=n.n(ta),aa=n(151),ia=n.n(aa),oa=n(152),ra=n.n(oa),la=n(37),ca=n.n(la),sa=n(47),ua=n.n(sa),ba=n(153),pa=n.n(ba),ma=n(154),ga=n.n(ma),da=n(155),fa=n.n(da),ha=n(156),va=n.n(ha),ya=n(157),Oa=n.n(ya),wa=n(158),_a=n.n(wa),ka=n(159),ja=n.n(ka),Ca=n(160),xa=n.n(Ca),Ea=n(161),Sa=n.n(Ea),Ba=n(162),Ta=n.n(Ba),Pa=n(163),Aa=n.n(Pa),Na=n(164),Ma=n.n(Na),Ra=n(165),Da=n.n(Ra),Fa=n(166),La=n.n(Fa),Ua=n(167),za=n.n(Ua),Ha=n(168),Ia=n.n(Ha),Wa=n(169),Va=n.n(Wa),Ga=n(170),qa=n.n(Ga),Ka=n(171),Ya=n.n(Ka),Ja=n(172),Xa=n.n(Ja),$a=n(173),Qa=n.n($a),Za=n(174),ei=n.n(Za),ti=n(175),ni=n.n(ti),ai=n(176),ii=n.n(ai),oi=n(177),ri=n.n(oi),li=n(178),ci=n.n(li),si=n(179),ui=n.n(si),bi=n(48),pi=n.n(bi),mi=n(180),gi=n.n(mi),di=n(181),fi=n.n(di),hi=n(182),vi=n.n(hi),yi=n(183),Oi=n.n(yi),wi=n(184),_i=n.n(wi),ki=n(49),ji=n.n(ki),Ci=n(185),xi=n.n(Ci),Ei=n(186),Si=n.n(Ei),Bi=n(187),Ti=n.n(Bi),Pi=n(188),Ai=n.n(Pi),Ni=n(189),Mi=n.n(Ni),Ri=n(190),Di=n.n(Ri),Fi=n(191),Li=n.n(Fi),Ui=n(192),zi=n.n(Ui),Hi=n(50),Ii=n.n(Hi),Wi=n(193),Vi=n.n(Wi),Gi=n(194),qi=n.n(Gi),Ki=n(195),Yi=n.n(Ki),Ji=n(196),Xi=n.n(Ji),$i=n(197),Qi=n.n($i),Zi=n(198),eo=n.n(Zi),to=n(199),no=n.n(to),ao=n(200),io=n.n(ao),oo=n(201),ro=n.n(oo),lo=n(202),co=n.n(lo),so=n(203),uo=n.n(so),bo=n(204),po=n.n(bo),mo=n(205),go=n.n(mo),fo=n(206),ho=n.n(fo),vo=n(207),yo=n.n(vo),Oo=n(208),wo=n.n(Oo),_o=n(209),ko=n.n(_o),jo=n(210),Co=n.n(jo),xo=n(211),Eo=n.n(xo),So=n(212),Bo=n.n(So),To=n(213),Po=n.n(To),Ao=n(214),No=n.n(Ao),Mo=n(215),Ro=n.n(Mo),Do=n(216),Fo=n.n(Do),Lo=n(217),Uo=n.n(Lo),zo=n(218),Ho=n.n(zo),Io=n(219),Wo=n.n(Io),Vo=n(220),Go=n.n(Vo),qo=n(221),Ko=n.n(qo),Yo=n(222),Jo=n.n(Yo),Xo=n(223),$o=n.n(Xo),Qo=n(224),Zo=n.n(Qo),er=n(225),tr=n.n(er),nr=n(226),ar=n.n(nr),ir=n(227),or=n.n(ir),rr=n(228),lr=n.n(rr),cr=n(229),sr=n.n(cr),ur=n(230),br=n.n(ur),pr=n(231),mr=n.n(pr),gr=n(232),dr=n.n(gr),fr=n(233),hr=n.n(fr),vr=n(234),yr=n.n(vr),Or=n(235),wr=n.n(Or),_r={fullHeight:{video:Rt.a,title:Object(s.__)("Full Height",o.i18n),description:Object(s.__)("Block height takes up the full height of the screen",o.i18n)},generalRestrictContent:{video:Ft.a,title:Object(s.__)("Restrict to Content Width",o.i18n),description:Object(s.__)("Restricts content to a narrower space when block width is set to full width",o.i18n)},generalBorderRadius:{video:Ut.a,title:Object(s.__)("Border Radius",o.i18n),description:Object(s.__)("Adjusts the radius of block corners to make them more rounded",o.i18n)},generalShadow:{video:Ht.a,title:Object(s.__)("Shadow/Outline",o.i18n),description:Object(s.__)("Adjusts the intensity of the shadow/outline of the block and the appearance of the block border",o.i18n)},alignmentAll:{video:Wt.a,title:Object(s.__)("Align (general / all)",o.i18n),description:Object(s.__)("Adjusts the placement of all content in the block to align left, center or right",o.i18n)},generalColumns:{video:Gt.a,title:Object(s.__)("Columns",o.i18n),description:Object(s.__)("Sets the number of columns",o.i18n)},columnBackgroundOnOff:{video:Kt.a,title:Object(s.__)("Column / Container Background",o.i18n),description:Object(s.__)("Background settings for the container or columns.",o.i18n)},imageShape:{video:Jt.a,title:Object(s.__)("Shape",o.i18n),description:Object(s.__)("Change the shape of the image",o.i18n)},imageSize:{video:$t.a,title:Object(s.__)("Image size",o.i18n),description:Object(s.__)("Sets the image display size to thumbnail, medium, large or full size. A smaller image size will also load faster.",o.i18n)},imageSizeNoCrop:{video:Zt.a,title:Object(s.__)("Image size",o.i18n),description:Object(s.__)("Adjusts the image size / width while preseving the aspect ratio",o.i18n)},imageWidthCrop:{video:tn.a,title:Object(s.__)("Image width",o.i18n),description:Object(s.__)("Adjusts the image width",o.i18n)},imageHeightCrop:{video:an.a,title:Object(s.__)("Image height",o.i18n),description:Object(s.__)("Adjusts the image height",o.i18n)},imageSquare:{video:rn.a,title:Object(s.__)("Force Square Image",o.i18n),description:Object(s.__)("Crops image into a square",o.i18n)},imageBorderRadius:{video:cn.a,title:Object(s.__)("Border radius (of image)",o.i18n),description:Object(s.__)("Adjusts the radius of image corners to make them more rounded",o.i18n)},imageShadow:{video:un.a,title:Object(s.__)("Shadow (of image)",o.i18n),description:Object(s.__)("Adjusts the intensity of the image shadow",o.i18n)},typography:{video:pn.a,title:Object(s.__)("Typography",o.i18n),description:Object(s.__)("Change the font family, size, weight and spacing of the font of this text",o.i18n)},typographyFamily:{video:pn.a,title:Object(s.__)("Font family",o.i18n),description:Object(s.__)("Sets the font set to be used for the element",o.i18n)},typographySize:{video:gn.a,title:Object(s.__)("Font size",o.i18n),description:Object(s.__)("Sets the size of text characters",o.i18n)},typographyWeight:{video:fn.a,title:Object(s.__)("Font weight",o.i18n),description:Object(s.__)("Sets the thinness or thickness of text characters",o.i18n)},typographyTransform:{video:vn.a,title:Object(s.__)("Transform",o.i18n),description:Object(s.__)("Sets the usage of upper or lower case",o.i18n)},typographyLineHeight:{video:On.a,title:Object(s.__)("Line height",o.i18n),description:Object(s.__)("Sets the vertical distance between lines of text",o.i18n)},typographyLetterSpacing:{video:_n.a,title:Object(s.__)("Letter spacing",o.i18n),description:Object(s.__)("Sets the distance or space between letters",o.i18n)},alignmentImage:{video:jn.a,title:Object(s.__)("Image alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the image to align left, center or right",o.i18n)},alignmentNumber:{video:jn.a,title:Object(s.__)("Number alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the number to align left, center or right",o.i18n)},alignmentIcon:{video:jn.a,title:Object(s.__)("Icon alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the icon to align left, center or right",o.i18n)},alignmentTitle:{video:xn.a,title:Object(s.__)("Title / subtitle alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the title or subtitle to align left, center or right",o.i18n)},alignmentName:{video:xn.a,title:Object(s.__)("Name / position alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the name or position to align left, center or right",o.i18n)},alignmentDescription:{video:Sn.a,title:Object(s.__)("Description / text alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the text to align left, center or right",o.i18n)},alignmentButton:{video:Tn.a,title:Object(s.__)("Button / link alignment",o.i18n),description:Object(s.__)("Adjusts the placement of the button or link to align left, center or right",o.i18n)},buttonPadding:{video:An.a,title:Object(s.__)("Button padding",o.i18n),description:Object(s.__)("Adjusts the space between the button text and button borders",o.i18n)},buttonVerticalPadding:{video:Mn.a,title:Object(s.__)("Button vertical padding",o.i18n),description:Object(s.__)("Adjusts the space between the button text and button's top and bottom borders",o.i18n)},buttonHorizontalPadding:{video:Dn.a,title:Object(s.__)("Button horizontal padding",o.i18n),description:Object(s.__)("Adjusts the space between the button text and button's side borders",o.i18n)},buttonSize:{video:Ln.a,title:Object(s.__)("Button size",o.i18n),description:Object(s.__)("Sets the size of the button. Choose from tiny, small, normal, medium or large.",o.i18n)},buttonHoverEffect:{video:zn.a,title:Object(s.__)("Hover effect",o.i18n),description:Object(s.__)("Triggers animation or effects when you mouse over",o.i18n)},buttonHoverOpacity:{video:In.a,title:Object(s.__)("Hover opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the button when you mouse over",o.i18n)},buttonHoverColor:{video:Vn.a,title:Object(s.__)("Hover colors",o.i18n),description:Object(s.__)("Triggers a change in color when you mouse over",o.i18n)},buttonShadow:{video:qn.a,title:Object(s.__)("Button shadow",o.i18n),description:Object(s.__)("Adjusts the intensity of the button shadow",o.i18n)},buttonBorderRadius:{video:Yn.a,title:Object(s.__)("Button border radius",o.i18n),description:Object(s.__)("Adjusts the radius of button corners to make them more rounded",o.i18n)},buttonColorType:{video:Xn.a,title:Object(s.__)("Button color type",o.i18n),description:Object(s.__)("Sets the button color type to single or gradient",o.i18n)},buttonToNormal:{video:Qn.a,title:Object(s.__)("Change to normal button on hover",o.i18n),description:Object(s.__)("Triggers change from ghost to normal button when you mouse over",o.i18n)},buttonCollapse:{video:ea.a,title:Object(s.__)("Collapse buttons on",o.i18n),description:Object(s.__)("Sets when buttons will be triggered to arrange vertically",o.i18n)},spacing:{video:na.a,title:Object(s.__)("Spacing",o.i18n),description:Object(s.__)("Adjusts the space between block elements",o.i18n)},spacingBlockTitle:{video:ia.a,title:Object(s.__)("Block title spacing",o.i18n),description:Object(s.__)("Adjusts the space below the block title",o.i18n)},spacingBlockDescription:{video:ra.a,title:Object(s.__)("Block description spacing",o.i18n),description:Object(s.__)("Adjusts the space below the block description",o.i18n)},spacingImage:{video:ca.a,title:Object(s.__)("Image spacing",o.i18n),description:Object(s.__)("Adjusts the space below the image",o.i18n)},spacingNumber:{video:ca.a,title:Object(s.__)("Number spacing",o.i18n),description:Object(s.__)("Adjusts the space below the number",o.i18n)},spacingIcon:{video:ca.a,title:Object(s.__)("Icon spacing",o.i18n),description:Object(s.__)("Adjusts the space below the icon",o.i18n)},spacingTitle:{video:ua.a,title:Object(s.__)("Title spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},spacingName:{video:ua.a,title:Object(s.__)("Name / position spacing",o.i18n),description:Object(s.__)("Adjusts the space below the name / position",o.i18n)},spacingDescription:{video:pa.a,title:Object(s.__)("Description Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the description",o.i18n)},spacingButton:{video:ga.a,title:Object(s.__)("Button spacing",o.i18n),description:Object(s.__)("Adjusts the space beloe the button",o.i18n)},spacingButtonGap:{video:fa.a,title:Object(s.__)("Button spacing gap",o.i18n),description:Object(s.__)("Adjusts the gap between the buttons",o.i18n)},hoverEffect:{video:va.a,title:Object(s.__)("Hover effect",o.i18n),description:Object(s.__)("Triggers animation or effects when you mouse over",o.i18n)},backgroundOnOff:{video:Oa.a,title:Object(s.__)("Background Toggle On/Off",o.i18n),description:Object(s.__)("Turns the block background on/off. Turn on to enable different background settings.",o.i18n),learnMore:"https://wpstackable.com/blog/column-backgrounds-and-block-backgrounds/?utm_medium=Help%20Tooltip&utm_campaign=Help%20Tooltip&utm_source=Plugin"},backgroundColorOpacity:{video:_a.a,title:Object(s.__)("Background Color Opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the background color",o.i18n)},backgroundTint:{video:ja.a,title:Object(s.__)("Background Media Tint Strength",o.i18n),description:Object(s.__)("Adjusts the intensity of the background media tint",o.i18n)},backgroundColorType:{video:xa.a,title:Object(s.__)("Color type",o.i18n),description:Object(s.__)("Sets the color to either a single color or a gradient",o.i18n)},backgroundFixed:{video:Sa.a,title:Object(s.__)("Fixed Background",o.i18n),description:Object(s.__)("Keeps the background image fixed in place while scrolling",o.i18n)},gradientDirection:{video:Ta.a,title:Object(s.__)("Gradient direction",o.i18n),description:Object(s.__)("Sets the direction (in degrees) of the colors",o.i18n)},gradientLocation:{video:Aa.a,title:Object(s.__)("Gradient Color location",o.i18n),description:Object(s.__)("Sets the placement of each color in relation to the other color",o.i18n)},backgroundImagePosition:{video:Ma.a,title:Object(s.__)("Image Position",o.i18n),description:Object(s.__)("Chooses which part of the background image will be the focal point",o.i18n)},backgroundImageRepeat:{video:Da.a,title:Object(s.__)("Image Repeat",o.i18n),description:Object(s.__)("Covers the background with tiled images",o.i18n)},backgroundImageSize:{video:La.a,title:Object(s.__)("Image Size",o.i18n),description:Object(s.__)("Sets the display image size",o.i18n)},backgroundBlendMode:{video:za.a,title:Object(s.__)("Image Blend Mode",o.i18n),description:Object(s.__)("Sets how this background gradient/image blends into the other background",o.i18n)},separatorTopOn:{video:Ia.a,title:Object(s.__)("Separator Top On and Off",o.i18n),description:Object(s.__)("Turns the top separator on/off. Turn on to enable different separator settings.",o.i18n)},separatorBottomOn:{video:Va.a,title:Object(s.__)("Separator Bottom On and Off",o.i18n),description:Object(s.__)("Turns the bottom separator on/off. Turn on to enable different separator settings.",o.i18n)},separatorHeight:{video:qa.a,title:Object(s.__)("Separator height",o.i18n),description:Object(s.__)("Adjusts the height of the separator to stretch or compress vertically",o.i18n)},separatorWidth:{video:Ya.a,title:Object(s.__)("Separator width",o.i18n),description:Object(s.__)("Adusts the width of the separator to stretch or compress horizantally",o.i18n)},separatorShadow:{video:Xa.a,title:Object(s.__)("Shadow",o.i18n),description:Object(s.__)("Adjusts the intensity of the separator shadow and makes the separator more prominent",o.i18n)},separatorBringToFront:{video:Qa.a,title:Object(s.__)("Bring to Front",o.i18n),description:Object(s.__)("Brings the separator layer in front of other block elements",o.i18n)},separatorLayer2:{video:ei.a,title:Object(s.__)("Layer 2",o.i18n),description:Object(s.__)("Turns a second separator layer on/off. Turn on to enable the separate layer settings.",o.i18n)},separatorLayer3:{video:ni.a,title:Object(s.__)("Layer 3",o.i18n),description:Object(s.__)("Turns a third separator layer on/off. Turn on to enable the separate layer settings.",o.i18n)},separatorLayerOpacity:{video:ii.a,title:Object(s.__)("Layer Opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the separator layer",o.i18n)},separatorLayerBlendMode:{video:ri.a,title:Object(s.__)("Layer blend mode",o.i18n),description:Object(s.__)("Sets how the sepator layer is blended into the background",o.i18n)},advancedOpacity:{video:ci.a,title:Object(s.__)("Opacity",o.i18n),description:Object(s.__)("Adjusts the transparency of the entire block",o.i18n)},advancedZindex:{video:ui.a,title:Object(s.__)("Z-Index",o.i18n),description:Object(s.__)("Sets the stack order of different blocks to make one appear in front of another. A block with a higher z-index will show up on top of another block with a lower z-index.",o.i18n)},advancedBlockSpacing:{video:pi.a,title:Object(s.__)("Block Spacing",o.i18n),description:Object(s.__)("Set margins, paddings and alignment of the block and its content",o.i18n)},advancedBlockMargins:{video:pi.a,title:Object(s.__)("Block Margins",o.i18n),description:Object(s.__)("Sets the block margin, i.e. the space outside the block between the block border and the next block",o.i18n)},advancedBlockPaddings:{video:gi.a,title:Object(s.__)("Block Padding",o.i18n),description:Object(s.__)("Sets the block padding, i.e. the space inside the block between the column container and the block border",o.i18n)},advancedBlockHeight:{video:fi.a,title:Object(s.__)("Min Block Height",o.i18n),description:Object(s.__)("Adjusts the minimum allowable height of the block",o.i18n)},advancedBlockVerticalAlign:{video:vi.a,title:Object(s.__)("Content Vertical Align",o.i18n),description:Object(s.__)("Sets the placement of the column container to top, center or bottom. Available when the min. block height is set to higher than default.",o.i18n)},advancedBlockContentWidth:{video:Oi.a,title:Object(s.__)("Max Content Width",o.i18n),description:Object(s.__)("Adjusts the maximum allowable width of the block. The settings will depend on the block width you set on the toolbar.",o.i18n)},advancedBlockHorizontalAlign:{video:_i.a,title:Object(s.__)("Content Horizontal Align",o.i18n),description:Object(s.__)("Sets the placement of the column container to left, center or right. Not available when block width is set to full width.",o.i18n)},advancedColumnSpacing:{video:ji.a,title:Object(s.__)("Column Spacing & More",o.i18n),description:Object(s.__)("Sets column paddings, the space inside the block between the block elements and the column container border",o.i18n)},advancedColumnPaddings:{video:ji.a,title:Object(s.__)("Column Paddings",o.i18n),description:Object(s.__)("Sets the column padding, the space inside the block between the block elements and the column container border",o.i18n)},advancedColumnGap:{video:xi.a,title:Object(s.__)("Column Gap",o.i18n),description:Object(s.__)("Sets the distance between two or more columns",o.i18n)},advancedColumnColumnVerticalAlign:{video:Si.a,title:Object(s.__)("Column Vertical Align",o.i18n),description:Object(s.__)("Sets the placement of the column container to top, center, bottom or stretch. Available when column heights are different.",o.i18n)},advancedColumnHeight:{video:Ti.a,title:Object(s.__)("Min Column Height",o.i18n),description:Object(s.__)("Adjusts the minimum allowable height of the column container",o.i18n)},advancedColumnContentVerticalAlign:{video:Ai.a,title:Object(s.__)("Content Vertical Align",o.i18n),description:Object(s.__)("Sets the placement of the block elements to top, center, bottom or stretch. Available when column heights are different or when min. column height is set to higher than default.",o.i18n)},accordionAdjacentOpen:{video:Mi.a,title:Object(s.__)("Close adjacent on open",o.i18n),description:Object(s.__)("Automatically closes adjacent accordion panels when clicked",o.i18n)},accordionClosedStateBackgroundColor:{video:Di.a,title:Object(s.__)("Closed state Background Color",o.i18n),description:Object(s.__)("Sets color of the panel when closed",o.i18n)},accordionPadding:{video:Li.a,title:Object(s.__)("Accordion Padding",o.i18n),description:Object(s.__)("Sets the accordion padding, i.e. the space inside the block between the panel elements and the panel border",o.i18n)},accordionTitleSpacing:{video:zi.a,title:Object(s.__)("Accordion Title Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},accordionBorder:{video:Ii.a,title:Object(s.__)("Border",o.i18n),description:Object(s.__)("Adjusts the thickness and color of the border of a closed panel for the Lined to Colored layout",o.i18n)},accordionBorderSize:{video:Ii.a,title:Object(s.__)("Border Size",o.i18n),description:Object(s.__)("Adjusts the thickness of the border of a closed panel for the Lined to Colored layout",o.i18n)},imageColumnWidth:{video:Vi.a,title:Object(s.__)("Image Column Width",o.i18n),description:Object(s.__)("Adjusts the width of the image",o.i18n)},featureContainerWidth:{video:qi.a,title:Object(s.__)("Container Width",o.i18n),description:Object(s.__)("Adjusts the width of the text and button container",o.i18n)},featureContainerOffset:{video:Yi.a,title:Object(s.__)("Container Offset",o.i18n),description:Object(s.__)("Adjusts the relative arrangement of the image and the text and button contianer",o.i18n)},iconListGrid:{video:Xi.a,title:Object(s.__)("Display as a grid",o.i18n),description:Object(s.__)("Displays the list in an evenly-spaced grid arrangement",o.i18n)},iconListGap:{video:Qi.a,title:Object(s.__)("List Gap",o.i18n),description:Object(s.__)("Adjusts the space between different list lines",o.i18n)},imageBoxHeight:{video:eo.a,title:Object(s.__)("Height",o.i18n),description:Object(s.__)("Adjusts the height of the image box",o.i18n)},notificationDismissible:{video:no.a,title:Object(s.__)("Dismissible",o.i18n),description:Object(s.__)("Provides option to close the notification",o.i18n)},postsContentOrder:{video:io.a,title:Object(s.__)("Content Order",o.i18n),description:Object(s.__)("Sets the order of the items displayed (category, title, meta, excerpt) for each post",o.i18n)},postsMetaSeparator:{video:ro.a,title:Object(s.__)("Meta Separator",o.i18n),description:Object(s.__)("Sets the separators between meta items (dot, space, comma, dash, pipe)",o.i18n)},dividerMargin:{video:co.a,title:Object(s.__)("Vertical Margin",o.i18n),description:Object(s.__)("Adjusts the space between the divider and the vertically adjacent blocks",o.i18n)},pricingImageAlign:{video:uo.a,title:Object(s.__)("Image Align",o.i18n),description:Object(s.__)("Adjusts the placement of the image to align left, center or right",o.i18n)},pricingTitleAlign:{video:po.a,title:Object(s.__)("Title Align",o.i18n),description:Object(s.__)("Adjusts the placement of the title to align left, center or right",o.i18n)},pricingPriceAlign:{video:go.a,title:Object(s.__)("Price Align",o.i18n),description:Object(s.__)("Adjusts the placement of the price to align left, center or right",o.i18n)},pricingSubpriceAlign:{video:ho.a,title:Object(s.__)("Sub Price Align",o.i18n),description:Object(s.__)("Adjusts the placement of the subtitle to align left, center or right",o.i18n)},pricingButtonAlign:{video:yo.a,title:Object(s.__)("Button Align",o.i18n),description:Object(s.__)("Adjusts the placement of the button to align left, center or right",o.i18n)},pricingDescriptionAlign:{video:wo.a,title:Object(s.__)("Description Align",o.i18n),description:Object(s.__)("Adjusts the placement of the description to align left, center or right",o.i18n)},pricingImageSpacing:{video:ko.a,title:Object(s.__)("Image Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the image",o.i18n)},pricingTitleSpacing:{video:Co.a,title:Object(s.__)("Title Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},pricingPriceSpacing:{video:Eo.a,title:Object(s.__)("Price Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the price",o.i18n)},pricingSubpriceSpacing:{video:Bo.a,title:Object(s.__)("Sub Price Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the subtitle",o.i18n)},pricingButtonSpacing:{video:Po.a,title:Object(s.__)("Button Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the button",o.i18n)},pricingDescriptionSpacing:{video:No.a,title:Object(s.__)("Description Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the description",o.i18n)},imageBoxOverlay:{video:Ro.a,title:Object(s.__)("Overlay Color",o.i18n),description:Object(s.__)("Sets the overlay color of all image boxes",o.i18n)},imageBoxOverlayHover:{video:Fo.a,title:Object(s.__)("Overlay Hover Color",o.i18n),description:Object(s.__)("Triggers change in overlay color when you mouse over",o.i18n)},imageBoxHoverEffect:{video:Uo.a,title:Object(s.__)("Image Hover Effect",o.i18n),description:Object(s.__)("Sets an effect that animates the image",o.i18n)},imageBoxBoxHoverEffect:{video:Ho.a,title:Object(s.__)("Box Hover Effect",o.i18n),description:Object(s.__)("Sets an effect that animates the container of the image",o.i18n)},imageBoxSubtitleSpacing:{video:Wo.a,title:Object(s.__)("Subtitle Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the subtitle",o.i18n)},imageBoxTitleSpacing:{video:Go.a,title:Object(s.__)("Title Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the title",o.i18n)},imageBoxLineSpacing:{video:Ko.a,title:Object(s.__)("Line Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the line",o.i18n)},imageBoxDescriptionSpacing:{video:Jo.a,title:Object(s.__)("Description Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the description",o.i18n)},imageBoxArrowSpacing:{video:$o.a,title:Object(s.__)("Arrow Spacing",o.i18n),description:Object(s.__)("Adjusts the space below the arrow",o.i18n)},imageBoxSubtitleAlign:{video:Zo.a,title:Object(s.__)("Subtitle Align",o.i18n),description:Object(s.__)("Adjusts the placement of the subtitle to align left, center or right",o.i18n)},imageBoxTitleAlign:{video:tr.a,title:Object(s.__)("Title Align",o.i18n),description:Object(s.__)("Adjusts the placement of the title to align left, center or right",o.i18n)},imageBoxDescriptionAlign:{video:ar.a,title:Object(s.__)("Description Align",o.i18n),description:Object(s.__)("Adjusts the placement of the description to align left, center or right",o.i18n)},imageBoxArrowAlign:{video:or.a,title:Object(s.__)("Arrow Align",o.i18n),description:Object(s.__)("Adjusts the placement of the arrow to align left, center or right",o.i18n)},videoPopupWidth:{video:lr.a,title:Object(s.__)("Video popup width",o.i18n),description:Object(s.__)("Adjusts the width of the video popup container",o.i18n)},videoPopupHeight:{video:sr.a,title:Object(s.__)("Video popup height",o.i18n),description:Object(s.__)("Adjusts the height of the video popup container",o.i18n)},containerImageWidth:{video:br.a,title:Object(s.__)("Image width",o.i18n),description:Object(s.__)("Adjusts the image width",o.i18n)},containerImageHeight:{video:mr.a,title:Object(s.__)("Image height",o.i18n),description:Object(s.__)("Adjusts the image height",o.i18n)},columnRowGap:{video:dr.a,title:Object(s.__)("Row gap",o.i18n),description:Object(s.__)("Adjusts the vertical row gap between columns",o.i18n)},noPadding:{video:hr.a,title:Object(s.__)("No paddings",o.i18n),description:Object(s.__)("Removes all outer paddings of the block",o.i18n)},columnWidth:{video:yr.a,title:Object(s.__)("Column widths",o.i18n),description:Object(s.__)("Adjust the individual widths of each column",o.i18n)},columnArrangement:{video:wr.a,title:Object(s.__)("Column arrangement",o.i18n),description:Object(s.__)("Rearrange and move columns around by dragging each handle",o.i18n)}},kr=function(e){var t=e.getAnchorRect,n=e.title,a=e.videoUrl,i=e.description,l=e.learnMoreUrl,c=e.learnMore,b=Object(u.useRef)();return Object(u.useEffect)(function(){var e=b.current;e.muted=!0,e&&!e.playing&&e.play()},[]),Object(u.useEffect)(function(){window.dispatchEvent(new window.Event("resize"))},[e.videoUrl]),wp.element.createElement(r.Popover,{title:n,focusOnMount:"container",className:"ugb-help-tooltip-video",position:"middle left",getAnchorRect:t},wp.element.createElement(r.PanelBody,null,wp.element.createElement("button",{className:"ugb-help-tooltip-video__remove","data-testid":"close-button",onClick:e.onClickClose},wp.element.createElement(r.Dashicon,{icon:"no"})),a&&wp.element.createElement(u.Fragment,null,wp.element.createElement("video",{ref:b,width:"600",autoPlay:!0,loop:!0,muted:!0,playsinline:!0,role:"img","aria-labelledby":"ugb-help-tooltip-video__description",src:a}),(!b.current||!b.current.playing)&&wp.element.createElement(r.Spinner,null)),wp.element.createElement("div",{className:"ugb-help-tooltip-video__description",id:"ugb-help-tooltip-video__description"},n&&wp.element.createElement("h4",null,n),i,l&&wp.element.createElement("div",{className:"ugb-help-tooltip-video__link"},wp.element.createElement("a",{href:l,target:"_learn"},c," ",wp.element.createElement(r.Dashicon,{icon:"external"}))),wp.element.createElement(r.CheckboxControl,{label:Object(s.__)("Stop showing tooltips",o.i18n),className:"ugb-help-tooltip__checkbox",checked:!e.tooltipsEnabled,onChange:function(t){return e.onTooltipsEnabledChange(!t)}}))))};kr.defaultProps={onClickClose:function(){},getAnchorRect:null,title:Object(s.__)("Help",o.i18n),description:"",videoUrl:"",learnMoreUrl:"",learnMore:Object(s.__)("Learn more",o.i18n),tooltipsEnabled:!0,onTooltipsEnabledChange:function(){}};var jr=kr,Cr=null,xr={},Er={},Sr={},Br=function(e){return e.closest('[class*="ugb--help-tip-"]')},Tr=function(){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};xr[e]=function(n){var a=n.target.closest(e);a&&Cr!==a&&(Cr=a,t(a))},Er[e]=function(t){var a=t.target.closest(e);t.relatedTarget&&a===t.relatedTarget.closest(e)||a&&Cr===a&&(n(Cr),Cr=null)},document.body.addEventListener("mouseover",xr[e]),document.body.addEventListener("mouseout",Er[e])}(['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label','[class*="ugb--help-tip-"].components-panel__body .components-panel__body-toggle'].join(", "),function(e){return Object(R.doAction)("stackable.help-video.control.hover.in",e,Br(e))},function(){return Object(R.doAction)("stackable.help-video.control.hover.out")}),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Sr[e]=function(n){var a=n.target.closest(e);a&&t(a)},document.body.addEventListener("click",Sr[e])}(['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label'].join(", "),function(e){return Object(R.doAction)("stackable.help-video.control.click",e,Br(e))})},Pr=function(){var e;e=['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label','[class*="ugb--help-tip-"].components-panel__body .components-panel__body-toggle'].join(", "),document.body.removeEventListener("mouseover",xr[e]),document.body.removeEventListener("mouseout",Er[e]),function(e){document.body.removeEventListener("click",Sr[e])}(['[class*="ugb--help-tip-"].components-base-control .components-base-control__label','[class*="ugb--help-tip-"].components-base-control .components-toggle-control__label'].join(", "))};function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Nr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mr,Rr={show:!1,controlEl:null,target:null},Dr=function(e,t){Mr=setTimeout(function(){Lr(e,t)},1500)},Fr=function(){Mr&&clearTimeout(Mr),Mr=null},Lr=function(e,t){Rr=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=$r({blockTag:!0,opacity:!0,zIndex:!0,modifyStyles:!0},t);Object(R.addFilter)("stackable.".concat(e,".edit.inspector.advanced.before"),"stackable/".concat(e,"/advanced-general"),Zr(e,n),2),n.modifyStyles&&Object(R.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/advanced-general"),el()),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/advanced-general"),tl),Object(R.doAction)("stackable.module.advanced-general",e)};function al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function il(e){for(var t=1;t .ugb-inner-block"),{minWidth:"wide"===u&&l("blockWidth")?"auto !important":void 0,maxWidth:Object(i.c)(l("blockWidth","%s".concat(T||"px")))}),ol(r,"tablet",(ol(a={},D,{minHeight:l("tabletBlockHeight","%s".concat(x||"px")),justifyContent:l("tabletBlockHorizontalAlign"),alignItems:l("tabletBlockVerticalAlign")}),ol(a,"".concat(D," > .ugb-inner-block"),{minWidth:"wide"===u&&l("tabletBlockWidth")?"auto !important":void 0,maxWidth:Object(i.c)(l("tabletBlockWidth","%s".concat(A||"px")))}),a)),ol(r,"mobile",(ol(o={},D,{minHeight:l("mobileBlockHeight","%s".concat(S||"px")),justifyContent:l("mobileBlockHorizontalAlign"),alignItems:l("mobileBlockVerticalAlign")}),ol(o,"".concat(D," > .ugb-inner-block"),{minWidth:"wide"===u&&l("mobileBlockWidth")?"auto !important":void 0,maxWidth:Object(i.c)(l("mobileBlockWidth","%s".concat(M||"px")))}),o)),ol(r,"ie11",ol({},D,{height:l("blockHeight","%s".concat(j))||void 0})),r);return We.a.all([t,F,L,U])}},cl=function(e){return il({},e,{},Object(i.i)("%sMargin%s",{type:"number",default:""},["","Tablet","Mobile"],["Top","Right","Bottom","Left"]),{},Object(i.i)("%sMarginUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sPadding%s",{type:"number",default:""},["","Tablet","Mobile"],["Top","Right","Bottom","Left"]),{},Object(i.i)("%sPaddingUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockHeight",{type:"number",default:""},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockHeightUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockWidth",{type:"number",default:""},["","Tablet","Mobile"]),{},Object(i.i)("%sBlockWidthUnit",{type:"string",default:"px"},["","Tablet","Mobile"]),{},Object(i.i)("%sBlock%sAlign",{type:"string",default:""},["","Tablet","Mobile"],["Vertical","Horizontal"]))},sl=function(e,t){var n=t.attributes,a=n.blockWidth,i=void 0===a?"":a,o=n.tabletBlockWidth,r=void 0===o?"":o,l=n.mobileBlockWidth;return il({},e,{"ugb--has-custom-content-width":""!==i,"ugb--has-custom-content-width-tablet":""!==r,"ugb--has-custom-content-width-mobile":""!==(void 0===l?"":l)})},ul=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=il({margins:!0,paddings:!0,height:!0,width:!0,horizontalAlign:!0,verticalAlign:!0,modifyStyles:!0,enableMarginTop:!0,enableMarginRight:!0,enableMarginBottom:!0,enableMarginLeft:!0,enablePaddingTop:!0,enablePaddingRight:!0,enablePaddingBottom:!0,enablePaddingLeft:!0,paddingUnits:["px","em","%"],marginUnits:["px","%"]},t);Object(R.addFilter)("stackable.".concat(e,".edit.inspector.advanced.before"),"stackable/".concat(e,"/advanced-block-spacing"),rl(e,n),5),n.modifyStyles&&Object(R.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/advanced-block-spacing"),ll(e)),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/advanced-block-spacing"),cl),Object(R.addFilter)("stackable.".concat(e,".main-block.classes"),"stackable/".concat(e,"/advanced-block-spacing"),sl),Object(R.doAction)("stackable.module.advanced-block-spacing",e)};function bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function pl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ml=function(e){return wp.element.createElement(u.Fragment,null,e,wp.element.createElement(a.gb,{title:Object(s.__)("Column Spacing & More",o.i18n),initialOpen:!1,className:"ugb--help-tip-advanced-column-spacing"},wp.element.createElement(a.jb,{type:"advanced"})))},gl=function(e){return function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};o.showProNotice&&Object(R.addFilter)("stackable.".concat(e,".edit.inspector.advanced.before"),"stackable/".concat(e,"/fine-grained"),ml,6),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/advanced-column-spacing"),gl),Object(R.doAction)("stackable.module.advanced-column-spacing",e,t)};function fl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function hl(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return function(e,n){var i=n.setAttributes,l=n.attributes,c=l.showTopSeparator,b=void 0!==c&&c,p=l.topSeparatorDesign,m=void 0===p?"wave-1":p,g=l.topSeparatorColor,d=void 0===g?"":g,f=l.topSeparatorWidth,h=void 0===f?"":f,v=l.topSeparatorFlipHorizontally,y=void 0!==v&&v,O=l.topSeparatorFlipVertically,w=void 0!==O&&O,_=l.topSeparatorShadow,k=void 0===_||_,j=l.topSeparatorBringToFront,C=void 0!==j&&j,x=l.showBottomSeparator,E=void 0!==x&&x,S=l.bottomSeparatorDesign,B=void 0===S?"wave-1":S,T=l.bottomSeparatorColor,P=void 0===T?"":T,A=l.bottomSeparatorWidth,N=void 0===A?"":A,M=l.bottomSeparatorFlipHorizontally,D=void 0!==M&&M,F=l.bottomSeparatorFlipVertically,L=void 0!==F&&F,U=l.bottomSeparatorShadow,z=void 0===U||U,H=l.bottomSeparatorBringToFront,I=void 0!==H&&H;return wp.element.createElement(u.Fragment,null,e,wp.element.createElement(a.gb,{title:Object(s.__)("Top Separator",o.i18n),id:"top-separator",checked:b,onChange:function(e){return i({showTopSeparator:e})},toggleOnSetAttributes:["topSeparatorDesign","topSeparatorColor","topSeparatorHeight","topSeparatorTabletHeight","topSeparatorMobileHeight","topSeparatorWidth","topSeparatorFlipHorizontally","topSeparatorFlipVertically","topSeparatorShadow","topSeparatorBringToFront","showTopSeparatorLayer2","showTopSeparatorLayer3","topSeparatorLayer2Color","topSeparatorLayer3Color","topSeparatorLayer2BlendMode","topSeparatorLayer3BlendMode","topSeparatorLayer2Height","topSeparatorLayer3Height","topSeparatorLayer2Width","topSeparatorLayer3Width","topSeparatorLayer2Opacity","topSeparatorLayer3Opacity","topSeparatorLayer2FlipHorizontally","topSeparatorLayer3FlipHorizontally"],toggleAttributeName:"showTopSeparator",className:"ugb-top-block-separator-panel ugb--help-tip-separator-top-on"},wp.element.createElement(a.G,{label:Object(s.__)("Design",o.i18n),selected:m,onChange:function(e){return i({topSeparatorDesign:e})}}),wp.element.createElement(a.v,{label:Object(s.__)("Color",o.i18n),value:d,onChange:function(e){return i({topSeparatorColor:e})}}),wp.element.createElement(a.lb,{attrNameTemplate:"topSeparator%sHeight",setAttributes:i,blockAttributes:n.attributes},wp.element.createElement(a.c,{label:Object(s.__)("Height",o.i18n),min:"30",max:"400",allowReset:!0,placeholder:"200",className:"ugb--help-tip-separator-height"})),wp.element.createElement(a.c,{label:Object(s.__)("Width",o.i18n),min:"1",max:"4",step:"0.1",value:h,onChange:function(e){return i({topSeparatorWidth:e})},allowReset:!0,placeholder:"1.0",className:"ugb--help-tip-separator-width"}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Horizontally",o.i18n),checked:y,onChange:function(e){return i({topSeparatorFlipHorizontally:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Vertically",o.i18n),checked:w,onChange:function(e){return i({topSeparatorFlipVertically:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Shadow",o.i18n),checked:k,onChange:function(e){return i({topSeparatorShadow:e})},className:"ugb--help-tip-separator-shadow"}),t.enableBringToFront&&wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Bring to Front",o.i18n),checked:C,onChange:function(e){return i({topSeparatorBringToFront:e})},className:"ugb--help-tip-separator-bring-to-front"}),Object(R.applyFilters)("stackable.block-separators.edit.top",null,n),o.showProNotice&&wp.element.createElement(a.kb,{title:Object(s.__)("Say Hello to Gorgeous Separators 👋",o.i18n),description:Object(s.__)("Add a second & third layer to this separator and make it look even sweeter. This feature is only available on Stackable Premium",o.i18n)})),wp.element.createElement(a.gb,{title:Object(s.__)("Bottom Separator",o.i18n),id:"bottom-separator",checked:E,onChange:function(e){return i({showBottomSeparator:e})},toggleOnSetAttributes:["bottomSeparatorDesign","bottomSeparatorColor","bottomSeparatorHeight","bottomSeparatorTabletHeight","bottomSeparatorMobileHeight","bottomSeparatorWidth","bottomSeparatorFlipHorizontally","bottomSeparatorFlipVertically","bottomSeparatorShadow","bottomSeparatorBringToFront","showBottomSeparatorLayer2","showBottomSeparatorLayer3","bottomSeparatorLayer2Color","bottomSeparatorLayer3Color","bottomSeparatorLayer2BlendMode","bottomSeparatorLayer3BlendMode","bottomSeparatorLayer2Height","bottomSeparatorLayer3Height","bottomSeparatorLayer2Width","bottomSeparatorLayer3Width","bottomSeparatorLayer2Opacity","bottomSeparatorLayer3Opacity","bottomSeparatorLayer2FlipHorizontally","bottomSeparatorLayer3FlipHorizontally"],toggleAttributeName:"showBottomSeparator",className:"ugb-bottom-block-separator-panel ugb--help-tip-separator-bottom-on"},wp.element.createElement(a.G,{label:Object(s.__)("Design",o.i18n),selected:B,onChange:function(e){return i({bottomSeparatorDesign:e})}}),wp.element.createElement(a.v,{label:Object(s.__)("Color",o.i18n),value:P,onChange:function(e){return i({bottomSeparatorColor:e})}}),wp.element.createElement(a.lb,{attrNameTemplate:"bottomSeparator%sHeight",setAttributes:i,blockAttributes:n.attributes},wp.element.createElement(a.c,{label:Object(s.__)("Height",o.i18n),min:"30",max:"400",allowReset:!0,placeholder:"200",className:"ugb--help-tip-separator-height"})),wp.element.createElement(a.c,{label:Object(s.__)("Width",o.i18n),min:"1",max:"4",step:"0.1",value:N,onChange:function(e){return i({bottomSeparatorWidth:e})},allowReset:!0,placeholder:"1.0",className:"ugb--help-tip-separator-width"}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Horizontally",o.i18n),checked:D,onChange:function(e){return i({bottomSeparatorFlipHorizontally:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Flip Vertically",o.i18n),checked:L,onChange:function(e){return i({bottomSeparatorFlipVertically:e})}}),wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Shadow",o.i18n),checked:z,onChange:function(e){return i({bottomSeparatorShadow:e})},className:"ugb--help-tip-separator-shadow"}),t.enableBringToFront&&wp.element.createElement(r.ToggleControl,{label:Object(s.__)("Bring to Front",o.i18n),checked:I,onChange:function(e){return i({bottomSeparatorBringToFront:e})},className:"ugb--help-tip-separator-bring-to-front"}),Object(R.applyFilters)("stackable.block-separators.edit.bottom",null,n),o.showProNotice&&wp.element.createElement(a.kb,{title:Object(s.__)("Say Hello to Gorgeous Separators 👋",o.i18n),description:Object(s.__)("Add a second & third layer to this separator and make it look even sweeter. This feature is only available on Stackable Premium",o.i18n)})))}},Yl=function(e){return Gl({},e,{},Object(i.i)("Show%sSeparator",{type:"boolean",default:""},["Top","Bottom"]),{},Object(i.i)("%sSeparator%s",{type:"string",default:"wave-1"},["Top","Bottom"],["Design"]),{},Object(i.i)("%sSeparator%s",{type:"string",default:""},["Top","Bottom"],["Color"]),{},Object(i.i)("%sSeparator%s",{type:"number",default:""},["Top","Bottom"],["Height","TabletHeight","MobileHeight","Width"]),{},Object(i.i)("%sSeparator%s",{type:"boolean",default:""},["Top","Bottom"],["FlipHorizontally","FlipVertically","BringToFront"]),{},Object(i.i)("%sSeparatorShadow",{type:"boolean",default:!0},["Top","Bottom"]),{},Object(i.i)("Show%sSeparator%s",{type:"boolean",default:""},["Top","Bottom"],["Layer2","Layer3"]),{},Object(i.i)("%sSeparator%s",{type:"string",default:""},["Top","Bottom"],["Layer2Color","Layer3Color","Layer2BlendMode","Layer3BlendMode"]),{},Object(i.i)("%sSeparator%s",{type:"number",default:""},["Top","Bottom"],["Layer2Height","Layer3Height","Layer2Width","Layer3Width","Layer2Opacity","Layer3Opacity"]),{},Object(i.i)("%sSeparator%s",{type:"boolean",default:""},["Top","Bottom"],["Layer2FlipHorizontally","Layer3FlipHorizontally"]))},Jl=function(e,t,n){var i=n.attributes,o=i.showTopSeparator,r=void 0!==o&&o,l=i.topSeparatorDesign,c=void 0===l?"wave-1":l,s=i.topSeparatorFlipVertically,b=void 0!==s&&s,p=i.topSeparatorShadow,m=void 0===p||p,g=i.showBottomSeparator,d=void 0!==g&&g,f=i.bottomSeparatorDesign,h=void 0===f?"wave-1":f,v=i.bottomSeparatorFlipVertically,y=void 0!==v&&v,O=i.bottomSeparatorShadow,w=void 0===O||O;return wp.element.createElement(u.Fragment,null,e,r&&wp.element.createElement(u.Fragment,null,wp.element.createElement("div",{className:"ugb-top-separator"},wp.element.createElement(a.mb,{design:c,shadow:m,inverted:b},Object(R.applyFilters)("stackable.module.block-separator.output.top.after",null,n)))),d&&wp.element.createElement(u.Fragment,null,wp.element.createElement("div",{className:"ugb-bottom-separator"},wp.element.createElement(a.mb,{design:h,shadow:w,inverted:y},Object(R.applyFilters)("stackable.module.block-separator.output.bottom.after",null,n)))))},Xl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,n){var a,i=n.attributes,o=i.showTopSeparator,r=void 0!==o&&o,l=i.topSeparatorColor,c=void 0===l?"":l,s=i.topSeparatorHeight,u=void 0===s?"":s,b=i.topSeparatorTabletHeight,p=void 0===b?"":b,m=i.topSeparatorMobileHeight,g=void 0===m?"":m,d=i.topSeparatorWidth,f=void 0===d?"":d,h=i.topSeparatorFlipHorizontally,v=void 0!==h&&h,y=i.topSeparatorBringToFront,O=void 0!==y&&y;if(!r)return e;var w=(ql(a={},".ugb-top-separator",{zIndex:t.enableBringToFront&&O?6:void 0,transform:v?"scale(-1)":void 0}),ql(a,".ugb-top-separator svg",{fill:""!==c?c:void 0}),ql(a,".ugb-top-separator .ugb-separator-wrapper",{transform:""!==f?"scaleX(".concat(f,")"):void 0}),ql(a,"desktopTablet",ql({},".ugb-top-separator .ugb-separator-wrapper",{height:""!==u?"".concat(u,"px"):void 0})),ql(a,"tabletOnly",ql({},".ugb-top-separator .ugb-separator-wrapper",{height:""!==p?"".concat(p,"px"):void 0})),ql(a,"mobile",ql({},".ugb-top-separator .ugb-separator-wrapper",{height:""!==g?"".concat(g,"px"):void 0})),a);return We()(e,w)}},$l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,n){var a,i=n.attributes,o=i.showBottomSeparator,r=void 0!==o&&o,l=i.bottomSeparatorColor,c=void 0===l?"":l,s=i.bottomSeparatorHeight,u=void 0===s?"":s,b=i.bottomSeparatorTabletHeight,p=void 0===b?"":b,m=i.bottomSeparatorMobileHeight,g=void 0===m?"":m,d=i.bottomSeparatorWidth,f=void 0===d?"":d,h=i.bottomSeparatorFlipHorizontally,v=void 0!==h&&h,y=i.bottomSeparatorBringToFront,O=void 0!==y&&y;if(!r)return e;var w=(ql(a={},".ugb-bottom-separator",{zIndex:t.enableBringToFront&&O?6:void 0,transform:v?"scaleX(-1)":void 0}),ql(a,".ugb-bottom-separator svg",{fill:""!==c?c:void 0}),ql(a,".ugb-bottom-separator .ugb-separator-wrapper",{transform:""!==f?"scaleX(".concat(f,")"):void 0}),ql(a,"desktopTablet",ql({},".ugb-bottom-separator .ugb-separator-wrapper",{height:""!==u?"".concat(u,"px"):void 0})),ql(a,"tabletOnly",ql({},".ugb-bottom-separator .ugb-separator-wrapper",{height:""!==p?"".concat(p,"px"):void 0})),ql(a,"mobile",ql({},".ugb-bottom-separator .ugb-separator-wrapper",{height:""!==g?"".concat(g,"px"):void 0})),a);return We()(e,w)}},Ql=function(e,t){var n=t.attributes,a=n.showTopSeparator,i=void 0!==a&&a,o=n.showBottomSeparator;return Gl({},e,{"ugb--has-top-separator":i,"ugb--has-bottom-separator":void 0!==o&&o})};function Zl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ec(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return function(t,n){var a=Object(i.b)(n.attributes),o=n.attributes,r=o.showBlockTitle,l=void 0!==r&&r,c=o.blockTitleColor,s=void 0===c?"":c,u=o.showBlockDescription,b=void 0!==u&&u,p=o.blockDescriptionColor,m=void 0===p?"":p,g=o.showBlockBackground,d=void 0!==g&&g,f=o.blockBackgroundBackgroundColor,h=void 0===f?"":f,v=[t],y=a("blockTitleWidth")||a("blockTitleTabletWidth")||a("blockTitleMobileWidth");l&&v.push({".ugb-block-title":ec({},Object(i.K)("BlockTitle%s","desktop",n.attributes),{color:Object(i.vb)(s,d&&h),textAlign:a("blockTitleAlign"),marginBottom:Object(i.c)(a("blockTitleBottomMargin","%spx"),e.marginBottomImportant),maxWidth:Object(i.c)(a("blockTitleWidth","%s"+a("blockTitleWidthUnit","%s","px"))),marginLeft:y?Object(i.c)(Object(i.hb)(a("blockTitleHorizontalAlign"))):void 0,marginRight:y?Object(i.c)(Object(i.ib)(a("blockTitleHorizontalAlign"))):void 0}),tablet:{".ugb-block-title":ec({},Object(i.K)("BlockTitle%s","tablet",n.attributes),{textAlign:a("blockTitleTabletAlign"),marginBottom:Object(i.c)(a("blockTitleTabletBottomMargin","%spx"),e.marginBottomImportant),maxWidth:Object(i.c)(a("blockTitleTabletWidth","%s"+a("blockTitleTabletWidthUnit","%s","px")))})},mobile:{".ugb-block-title":ec({},Object(i.K)("BlockTitle%s","mobile",n.attributes),{textAlign:a("blockTitleMobileAlign"),marginBottom:Object(i.c)(a("blockTitleMobileBottomMargin","%spx"),e.marginBottomImportant),maxWidth:Object(i.c)(a("blockTitleMobileWidth","%s"+a("blockTitleMobileWidthUnit","%s","px")))})}});var O=a("blockDescriptionWidth")||a("blockDescriptionTabletWidth")||a("blockDescriptionMobileWidth");return b&&v.push({".ugb-block-description":ec({},Object(i.K)("BlockDescription%s","desktop",n.attributes),{color:Object(i.vb)(m,d&&h),textAlign:a("blockDescriptionAlign"),marginBottom:a("blockDescriptionBottomMargin","%spx"),maxWidth:Object(i.c)(a("blockDescriptionWidth","%s"+a("blockDescriptionWidthUnit","%s","px"))),marginLeft:O?Object(i.c)(Object(i.hb)(a("blockDescriptionHorizontalAlign"))):void 0,marginRight:O?Object(i.c)(Object(i.ib)(a("blockDescriptionHorizontalAlign"))):void 0}),tablet:{".ugb-block-description":ec({},Object(i.K)("BlockDescription%s","tablet",n.attributes),{textAlign:a("blockDescriptionTabletAlign"),marginBottom:a("blockDescriptionTabletBottomMargin","%spx"),maxWidth:Object(i.c)(a("blockDescriptionTabletWidth","%s"+a("blockDescriptionTabletWidthUnit","%s","px")))})},mobile:{".ugb-block-description":ec({},Object(i.K)("BlockDescription%s","mobile",n.attributes),{textAlign:a("blockDescriptionMobileAlign"),marginBottom:a("blockDescriptionMobileBottomMargin","%spx"),maxWidth:Object(i.c)(a("blockDescriptionMobileWidth","%s"+a("blockDescriptionMobileWidthUnit","%s","px")))})}}),We.a.all(v)}},sc=function(e){return Object(f.omit)(ec({},e,{blockTitle:Object(s.__)("Title for This Block",o.i18n),blockDescription:Object(i.M)()}),[e.showBlockTitle?"blockTitle":"",e.showBlockDescription?"blockDescription":""])},uc=function(e){return[].concat(nc(e),["BlockTitle%sAlign","BlockDescription%sAlign"])};function bc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function pc(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};if(!Ec(t)){var a=Bc.reduce(function(e,n){var a=n.name,i=n.module;return t===a?i:e},null);a&&xc(t,a)}var i=Ec(t);i&&i(e,n)},Bc=[{name:"advanced-general",module:nl},{name:"advanced-responsive",module:wl},{name:"advanced-block-spacing",module:ul},{name:"advanced-column-spacing",module:dl},{name:"block-background",module:function(e){Object(R.addFilter)("stackable.".concat(e,".edit.inspector.style.block"),"stackable/".concat(e,"/block-background"),Rl,18),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/block-background"),Ll),Object(R.addFilter)("stackable.".concat(e,".edit.inspector.before"),"stackable/".concat(e,"/block-background"),Dl),Object(R.addFilter)("stackable.".concat(e,".settings"),"stackable/".concat(e,"/block-background"),Fl),Object(R.addFilter)("stackable.".concat(e,".main-block.classes"),"stackable/".concat(e,"/block-background"),Ul),Object(R.addFilter)("stackable.".concat(e,".main-block.inner-classes"),"stackable/".concat(e,"/block-background"),zl),Object(R.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-background"),Il),Object(R.addFilter)("stackable.".concat(e,".edit.output.outer"),"stackable/".concat(e,"/block-separators"),Hl),Object(R.addFilter)("stackable.".concat(e,".save.output.outer"),"stackable/".concat(e,"/block-separators"),Hl),Object(R.addFilter)("stackable.".concat(e,".design.filtered-block-attributes"),"stackable/".concat(e,"/block-separators"),Wl),Object(R.doAction)("stackable.module.block-background",e),function(e){Object(R.addFilter)("stackable.".concat(e,".settings"),"stackable/".concat(e,"/block-background"),El,99),xl.push("ugb/".concat(e))}(e)}},{name:"block-separators",module:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Gl({enableBringToFront:!0},t);Object(R.addFilter)("stackable.".concat(e,".edit.inspector.style.block"),"stackable/".concat(e,"/block-separators"),Kl(e,n),18),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/block-separators"),Yl),Object(R.addFilter)("stackable.".concat(e,".edit.output.outer"),"stackable/".concat(e,"/block-separators"),Jl),Object(R.addFilter)("stackable.".concat(e,".save.output.outer"),"stackable/".concat(e,"/block-separators"),Jl),Object(R.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-separators/top"),Xl(e,n)),Object(R.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-separators/bottom"),$l(e,n)),Object(R.addFilter)("stackable.".concat(e,".main-block.classes"),"stackable/".concat(e,"/block-separators"),Ql),Object(R.doAction)("stackable.module.block-separators",e)}},{name:"block-title",module:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ec({marginBottomImportant:!1},t);Object(R.removeFilter)("stackable.panel-spacing-body.edit.before","stackable/block-title"),Object(R.addFilter)("stackable.".concat(e,".edit.inspector.style.block"),"stackable/".concat(e,"/block-title"),ac,17),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/block-title"),ic),Object(R.addFilter)("stackable.panel-spacing-body.edit.before","stackable/block-title",rc),Object(R.addFilter)("stackable.".concat(e,".edit.output.before"),"stackable/".concat(e,"/block-title"),oc),Object(R.addFilter)("stackable.".concat(e,".save.output.before"),"stackable/".concat(e,"/block-title"),lc),Object(R.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/block-title"),cc(n)),Object(R.addFilter)("stackable.with-content-align-reseter.attributeNamesToReset","stackable/".concat(e,"/block-title"),uc),Object(R.addFilter)("stackable.".concat(e,".design.filtered-block-attributes"),"stackable/".concat(e,"/block-title"),sc),Object(R.doAction)("stackable.module.block-title",e)}},{name:"block-designs",module:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pc({},t);Object(R.addFilter)("stackable.".concat(e,".edit.inspector.layout.before"),"stackable/".concat(e,"/block-designs"),gc(e),20),Object(R.doAction)("stackable.module.block-designs",e)}},{name:"content-align",module:function(e){Object(R.addFilter)("stackable.".concat(e,".edit.inspector.before"),"stackable/".concat(e,"/content-align"),yc,11),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/content-align"),hc),Object(R.addFilter)("stackable.".concat(e,".styles"),"stackable/".concat(e,"/content-align"),vc,9),Object(R.doAction)("stackable.module.content-align",e)}},{name:"custom-css",module:function(e){o.showProNotice&&Object(R.addFilter)("stackable.".concat(e,".edit.inspector.advanced.after"),"stackable/".concat(e,"/custom-css"),_c,20),Object(R.addFilter)("stackable.".concat(e,".attributes"),"stackable/".concat(e,"/custom-css"),kc),o.isPro||Object(R.addFilter)("stackable.".concat(e,".save.output.outer"),"stackable/pro/".concat(e,"/custom-css/downgrade"),jc),Object(R.doAction)("stackable.module.custom-css",e)}}],Tc=n(10);function Pc(e){return(Pc="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 Ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Nc(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(d.getBlockType)(e)){var n=e.replace(/^\w+\//g,""),a=Nc({},t,{category:Object(i.qb)()?t.category:"stackable",modules:Object(R.applyFilters)("stackable.".concat(n,".modules"),t.modules||{}),deprecated:(t.deprecated||[]).map(function(t){return Nc({},t,{save:Object(Tc.f)(e)(t.save)})})});return Object.keys(a.modules).forEach(function(e){var t=a.modules[e];t&&Sc(n,e,"object"===Pc(t)?t:{})}),a.attributes=Object(R.applyFilters)("stackable.block.attributes",a.attributes),a.attributes=Object(R.applyFilters)("stackable.".concat(n,".attributes"),a.attributes),a.edit=Object(Tc.f)(e)(a.edit),a.save=Object(Tc.f)(e)(a.save),Object(d.registerBlockType)(e,Object(R.applyFilters)("stackable.".concat(n,".settings"),a)),a}};Object(i.qb)()?Object(d.registerBlockCollection)("ugb",{title:Object(s.__)("Stackable",o.i18n),icon:st.w}):Object(d.setCategories)([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(p,D({style:e},t))},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(v,D({style:e},t))},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(d,D({style:e},t))},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(s,D({style:e},t))},H=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(E,D({style:e},t))},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(w,D({style:e},t))},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(j,D({style:e},t))},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(T,D({style:e},t))},G=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wp.element.createElement(N,D({style:e},t))},q={"round-thin":{icon:L(),iconFunc:L,title:Object(R.__)("Round Thin",M.i18n),value:"round-thin"},round:{icon:F(),iconFunc:F,title:Object(R.__)("Round",M.i18n),value:"round"},"round-thick":{icon:U(),iconFunc:U,title:Object(R.__)("Round Thick",M.i18n),value:"round-thick"},"round-fat":{icon:z(),iconFunc:z,title:Object(R.__)("Round Fat",M.i18n),value:"round-fat"},"square-thin":{icon:G(),iconFunc:G,title:Object(R.__)("Square Thin",M.i18n),value:"square-thin"},square:{icon:H(),iconFunc:H,title:Object(R.__)("Square",M.i18n),value:"square"},"square-simple":{icon:V(),iconFunc:V,title:Object(R.__)("Square Simple",M.i18n),value:"square-simple"},"square-modern":{icon:W(),iconFunc:W,title:Object(R.__)("Square Modern",M.i18n),value:"square-modern"},"square-fat":{icon:I(),iconFunc:I,title:Object(R.__)("Square Fat",M.i18n),value:"square-fat"}},K=n(2),Y=n(9),J=n(8),X=n.n(J);function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Q(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(K.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(K.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(K.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-blockquote__item":Object(K.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-blockquote__item":Object(K.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-blockquote__item":Object(K.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}}});var p=e.attributes,m=p.containerBackgroundColor,g=void 0===m?"":m,d=p.textColor,f=void 0===d?"":d;return a.push({".ugb-blockquote__text":fe({},Object(K.K)("text%s","desktop",e.attributes,{important:!0}),{color:Object(K.vb)(f,n.containerBackground&&g)}),tablet:{".ugb-blockquote__text":fe({},Object(K.K)("text%s","tablet",e.attributes,{important:!0}))},mobile:{".ugb-blockquote__text":fe({},Object(K.K)("text%s","mobile",e.attributes,{important:!0}))}}),a.push.apply(a,ge(Object(K.F)(".ugb-blockquote__item","text%sAlign","textAlign","%s",e.attributes,{important:!0}))),me.a.all(a)},ye=n(3),Oe=n(10),we=n(6),_e=n(12);function ke(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return Object(o.omit)(e,["videoLink","videoID","video-popup3","previewBackgroundMediaId"].concat(l(t&&t.previewBackgroundMediaId?["previewBackgroundMediaUrl"]:[])))});var c=n(5),s=n.n(c);function u(){return(u=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return _[e]({fill:t})}(o,c))))},migrate:function(e){var t=function(e){return(e||"").replace(/\.ugb-video-popup([\s\{\[\.\#\:])/g,".ugb-video-popup__wrapper$1")};return function(e){for(var t=1;t=5?l/10-.3:l/10+.3}}),G.a.all(a)},X=n(11),$=n(12),Q=n(6);Object(r.addFilter)("stackable.video-popup.edit.inspector.style.before","stackable/video-popup",function(e,t){var n=t.setAttributes,a=t.attributes,o=a.borderRadius,r=void 0===o?"":o,l=a.shadow,c=void 0===l?"":l,s=a.videoLink,u=void 0===s?"":s,b=a.videoID,p=void 0===b?"":b,m=a.playButtonType,g=a.playButtonColor,d=void 0===g?"#ffffff":g,f=a.playButtonOpacity,h=void 0===f?"":f,v=a.width,y=void 0===v?"":v,_=a.tabletWidth,k=void 0===_?"":_,j=a.mobileWidth,C=void 0===j?"":j,x=a.showBlockTitle,E=void 0!==x&&x,B=a.showBlockDescription,T=void 0!==B&&B,P=I(t);return wp.element.createElement(Q.Fragment,null,e,wp.element.createElement(S.gb,{title:Object(O.__)("General",w.i18n),initialOpen:!0},wp.element.createElement(S.W,{label:Object(O.__)("Popup Option #1: Upload Video",w.i18n),help:Object(O.__)("Use .mp4 format for videos",w.i18n),onRemove:function(){return n({videoLink:"",videoID:""})},onChange:function(e){n({videoLink:e.url,videoID:e.url})},imageID:Object(i.tb)(u)?p:"",imageURL:Object(i.tb)(u)?u:"",allowedTypes:["video"]}),wp.element.createElement(X.TextControl,{label:Object(O.__)("Popup Option #2: Video URL",w.i18n),help:Object(O.__)("Paste a Youtube / Vimeo URL",w.i18n),placeholder:"https://",value:Object(i.tb)(u)?"":u,onChange:function(e){return n({videoLink:e,videoID:Object(i.Y)(e).id})},min:1,max:4})),wp.element.createElement(S.gb,{title:Object(O.__)("Container",w.i18n),initialOpen:!1},wp.element.createElement(S.t,{label:Object(O.__)("Background",w.i18n),popoverLabel:Object(O.__)("Background",w.i18n),onReset:function(){n({previewBackgroundColorType:"",previewBackgroundColor:"",previewBackgroundColor2:"",previewBackgroundColorOpacity:"",previewBackgroundMediaID:"",previewBackgroundMediaUrl:"",previewBackgroundTintStrength:"",previewFixedBackground:""})},allowReset:t.attributes.previewBackgroundColor||t.attributes.previewBackgroundMediaUrl,hasColorPreview:t.attributes.previewBackgroundColor,hasImagePreview:t.attributes.previewBackgroundMediaUrl,colorPreview:"gradient"===t.attributes.previewBackgroundColorType?[t.attributes.previewBackgroundColor,t.attributes.previewBackgroundColor2]:t.attributes.previewBackgroundColor,imageUrlPreview:t.attributes.previewBackgroundMediaUrl},wp.element.createElement(S.h,{attrNameTemplate:"preview%s",setAttributes:n,blockAttributes:t.attributes})),P.containerWidth&&wp.element.createElement(Q.Fragment,null,wp.element.createElement(S.zb,{screen:"desktop"},wp.element.createElement(S.c,{label:Object(O.__)("Width",w.i18n),value:y,min:"200",max:"2000",placeholder:"2000",allowReset:!0,onChange:function(e){return t.setAttributes({width:e})},className:"ugb--help-tip-video-popup-width"})),wp.element.createElement(S.zb,{screen:"tablet"},wp.element.createElement(S.c,{label:Object(O.__)("Width",w.i18n),value:k,min:"200",max:"1000",placeholder:"1000",allowReset:!0,onChange:function(e){return t.setAttributes({tabletWidth:e})},className:"ugb--help-tip-video-popup-width"})),wp.element.createElement(S.zb,{screen:"mobile"},wp.element.createElement(S.c,{label:Object(O.__)("Width",w.i18n),value:C,min:"200",max:"700",placeholder:"700",allowReset:!0,onChange:function(e){return t.setAttributes({mobileWidth:e})},className:"ugb--help-tip-video-popup-width"}))),wp.element.createElement(S.lb,{attrNameTemplate:"%sHeight",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(S.c,{label:Object(O.__)("Height",w.i18n),min:0,max:1e3,allowReset:!0,placeholder:"400",className:"ugb--help-tip-video-popup-height"})),P.border&&wp.element.createElement(S.n,{attrNameTemplate:"column%s",setAttributes:n,blockAttributes:t.attributes}),P.borderRadius&&wp.element.createElement(S.c,{label:Object(O.__)("Border Radius",w.i18n),value:r,onChange:function(e){return n({borderRadius:e})},min:0,max:50,allowReset:!0,placeholder:"12",className:"ugb--help-tip-general-border-radius"}),wp.element.createElement(S.c,{label:Object(O.__)("Shadow / Outline",w.i18n),value:c,onChange:function(e){return n({shadow:e})},min:0,max:9,allowReset:!0,placeholder:"3",className:"ugb--help-tip-general-shadow"})),wp.element.createElement(S.gb,{title:Object(O.__)("Play Button",w.i18n),id:"play-button",initialOpen:!1},wp.element.createElement(X.SelectControl,{label:Object(O.__)("Button Style",w.i18n),value:m,options:z.map(function(e){return{value:e.value,label:e.label}}),onChange:function(e){n({playButtonType:e})}}),wp.element.createElement(S.lb,{attrNameTemplate:"%sPlayButtonSize",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(S.c,{label:Object(O.__)("Size",w.i18n),min:10,max:200,allowReset:!0,placeholder:"40"})),wp.element.createElement(S.v,{label:Object(O.__)("Color",w.i18n),value:d,onChange:function(e){return n({playButtonColor:e})}}),wp.element.createElement(S.c,{label:Object(O.__)("Opacity",w.i18n),min:0,max:1,step:.1,value:h,onChange:function(e){return n({playButtonOpacity:e})},allowReset:!0,placeholder:"1.0"})),(E||T)&&wp.element.createElement(S.hb,{initialOpen:!1,blockProps:t}))});var Z=Object($.compose)(W.i,W.g,W.d,Object(W.h)(),Object(W.a)(J,{editorMode:!0}),Object(W.b)([[".ugb-video-popup__wrapper","background"],[".ugb-video-popup__play-button svg","play-button"]]))(function(e){var t,n,a,i=e.className,o=e.attributes,l=o.playButtonType,c=o.shadow,s=void 0===c?"":c,u=j()([i,"ugb-video-popup--v3"],Object(r.applyFilters)("stackable.video-popup.mainclasses",{},e)),b=j()(["ugb-video-popup__wrapper"],Object(r.applyFilters)("stackable.video-popup.boxclasses",(t={},n="ugb--shadow-".concat(s),a=""!==s,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t),e));return wp.element.createElement(S.k.Edit,{className:u,blockProps:e,render:function(){return wp.element.createElement(Q.Fragment,null,wp.element.createElement(S.H,{className:b,backgroundAttrName:"preview%s",blockProps:e},wp.element.createElement("span",{className:"ugb-video-popup__play-button"},H(l))))}})}),ee=n(19),te=n.n(ee);var ne=Object($.compose)(W.i,Object(W.a)(J))(function(e){var t,n,a,i=e.className,o=e.attributes,l=o.videoID,c=o.playButtonType,s=o.shadow,u=void 0===s?"":s,b=j()([i,"ugb-video-popup--v3"],Object(r.applyFilters)("stackable.video-popup.mainclasses",{},e)),p=j()(["ugb-video-popup__wrapper"],Object(r.applyFilters)("stackable.video-popup.boxclasses",(t={},n="ugb--shadow-".concat(u),a=""!==u,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t),e));return wp.element.createElement(S.k.Save,{className:b,blockProps:e,render:function(){return wp.element.createElement(Q.Fragment,null,wp.element.createElement(S.H,{className:p,backgroundAttrName:"preview%s",blockProps:e,"data-video":te()(l)},wp.element.createElement("a",{href:"#",className:"ugb-video-popup__overlay","aria-label":"Play"}),wp.element.createElement("span",{className:"ugb-video-popup__play-button"},H(c))))}})});function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"schema",function(){return oe}),n.d(t,"name",function(){return re}),n.d(t,"settings",function(){return le});var oe=function(e){for(var t=1;tDescription for this block. Use this space for describing your block. Any text will do.

",attributes:{content:"Description for this block. Use this space for describing your block. Any text will do.",dropCap:!1}}]},deprecated:z,edit:ae,save:ie,supports:{inserter:!m.disabledBlocks.includes(re),anchor:!0},modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-responsive":!0,"content-align":!0,"block-designs":!0,"custom-css":{default:Object(i.applyFilters)("stackable.cta.custom-css.default","")}}}},function(e,t,n){"use strict";n.r(t);var a=n(7),i=n(4);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object(i.addFilter)("stackable.notification.design.no-text-attributes","stackable/notification",function(e){return Object(a.omit)(e,["title","description","buttonText"])}),Object(i.addFilter)("stackable.notification.design.filtered-block-attributes","stackable/notification",function(e){return function(e){for(var t=1;t]*ugb-notification__close-button.*?.*?<\/span>/,"")});var y=n(324),O=n.n(y),w=n(325),_=n.n(w),k=n(326),j=n.n(k),C=n(327),x=n.n(C),E=n(328),S=n.n(E);function B(){return(B=Object.assign||function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(k)),paddingRight:t("mobileColumnPaddingRight","%s".concat(k)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(k)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(k))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-notification__item":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-notification__item":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-notification__item":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(k)),paddingRight:t("mobileColumnPaddingRight","%s".concat(k)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(k)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(k))})}}}),f.containerBorder&&n.push(F({},Object(l.p)("container%s",".ugb-notification__item",e.attributes)));var j=e.attributes,C=j.dismissible,x=void 0!==C&&C,E=j.dismissibleIconSize,S=void 0===E?"":E,B=j.dismissibleIconTabletSize,T=void 0===B?"":B,P=j.dismissibleIconMobileSize,A=void 0===P?"":P,D=j.dismissibleIconColor,z=void 0===D?"":D;x&&n.push({".ugb-notification__item":{paddingRight:S&&S>40?"100px !important":void 0},".ugb-notification__close-button svg":{fill:z?"".concat(z," !important"):void 0},desktopTablet:{".ugb-notification__close-button":{width:S?"".concat(S,"px"):void 0,height:S?"".concat(S,"px"):void 0}},tabletOnly:{".ugb-notification__close-button":{width:T?"".concat(T,"px"):void 0,height:T?"".concat(T,"px"):void 0}},mobile:{".ugb-notification__close-button":{width:A?"".concat(A,"px"):void 0,height:A?"".concat(A,"px"):void 0}}});var H=e.attributes,I=H.showIcon,W=void 0!==I&&I,V=H.iconColor,G=void 0===V?"":V,q=H.iconAlign,K=void 0===q?"":q,Y=H.iconTabletAlign,J=void 0===Y?"":Y,X=H.iconMobileAlign,$=void 0===X?"":X;if(W){var Q=Object(l.wb)(G,f.columnBackground&&d);n.push({".ugb-notification__icon svg:not(.ugb-custom-icon)":{color:Q?"".concat(Q," !important"):void 0},".ugb-notification__icon":{marginLeft:""!==K||""!==o?Object(l.c)(Object(l.hb)(K||o)):void 0,marginRight:""!==K||""!==o?Object(l.c)(Object(l.ib)(K||o)):void 0,height:t("iconSize","%spx !important"),width:t("iconSize","%spx !important")},tablet:{".ugb-notification__icon":{marginLeft:""!==J||""!==c?Object(l.hb)(J||c):void 0,marginRight:""!==J||""!==c?Object(l.ib)(J||c):void 0,height:t("iconTabletSize","%spx !important"),width:t("iconTabletSize","%spx !important")}},mobile:{".ugb-notification__icon":{marginLeft:""!==$||""!==u?Object(l.hb)($||u):void 0,marginRight:""!==$||""!==u?Object(l.ib)($||u):void 0,height:t("iconMobileSize","%spx !important"),width:t("iconMobileSize","%spx !important")}}}),n.push(F({},Object(l.v)("icon%s","ugb-notification__icon",e.attributes)))}var Z=e.attributes,ee=Z.titleColor,te=void 0===ee?"":ee,ne=Z.showTitle;if(void 0===ne||ne){var ae=Object(l.wb)(te,f.columnBackground&&d);n.push({".ugb-notification__title":F({},Object(l.K)("title%s","desktop",e.attributes,{importantSize:!0}),{color:ae?"".concat(ae," !important"):void 0,textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-notification__title":F({},Object(l.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-notification__title":F({},Object(l.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}})}var ie=e.attributes,oe=ie.descriptionColor,re=void 0===oe?"":oe,le=ie.showDescription;if(void 0===le||le){var ce=Object(l.wb)(re,f.columnBackground&&d);n.push({".ugb-notification__description":F({},Object(l.K)("description%s","desktop",e.attributes),{color:ce?"".concat(ce," !important"):void 0,textAlign:t("descriptionAlign","%s !important")}),tablet:{".ugb-notification__description":F({},Object(l.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign","%s !important")})},mobile:{".ugb-notification__description":F({},Object(l.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign","%s !important")})}})}var se=e.attributes,ue=se.showButton,be=void 0!==ue&&ue,pe=se.buttonDesign,me=void 0===pe?"ghost":pe,ge=se.buttonBackgroundColor,de=void 0===ge?"":ge;if(be){if(n.push(F({},Object(l.s)("button%s","ugb-button",e.attributes))),!de&&f.columnBackground){var fe,he,ve=d?Object(l.wb)(de,d,"#ffffff","#424242"):"bordered"===m?"#424242":U[b],ye=ve?"#ffffff"===ve?"#424242":"#ffffff":void 0;if("basic"===me||""===me)n.push((L(fe={},".ugb-button",{backgroundColor:ve||void 0}),L(fe,".ugb-button .ugb-button--inner, .ugb-button.ugb-button--has-icon.ugb-button--has-icon svg",{color:ye||void 0}),L(fe,".ugb-button:hover .ugb-button--inner, .ugb-button:hover svg",{color:ye||void 0}),fe));else n.push((L(he={},".ugb-button",{borderColor:ve||void 0}),L(he,".ugb-button .ugb-button--inner, .ugb-button.ugb-button--has-icon.ugb-button--has-icon svg",{color:ve||void 0}),L(he,".ugb-button:hover .ugb-button--inner, .ugb-button:hover svg",{color:ve||void 0}),he))}n.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")}}})}return f.iconSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-notification__icon","icon%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f.titleSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-notification__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f.descriptionSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-notification__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f.buttonSpacing&&n.push.apply(n,R(Object(l.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),N.a.all(n)},H=n(3),I=n(1),W=n(10),V=n(11),G=n(0),q=n(12),K=n(6);function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function J(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *",e),_=Object(i.applyFilters)("stackable.blog-posts.spacing-paddings.selector","> .ugb-inner-block > .ugb-block-content > .ugb-blog-posts__item",e);b.push({saveOnly:{desktopTablet:P({},w,Object(k.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})),tabletOnly:P({},w,Object(k.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})),mobile:P({},w,Object(k.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))}))},editor:{desktopTablet:P({},_,Object(k.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})),tabletOnly:P({},_,Object(k.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})),mobile:P({},_,Object(k.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))}))}});var j=e.attributes.showImage,x=void 0===j||j;x&&u.imageHeight&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__featured-image img","image%sHeight","height","%spx",e.attributes,{important:!0}))),x&&u.imageWidth&&"list"===l&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__item","image%sWidth","gridTemplateColumns","%spx minmax(0, 1fr)",e.attributes,{important:!0})));var S=e.attributes,A=S.categoryHighlighted,N=void 0!==A&&A,M=S.categoryColor,R=void 0===M?"":M,D=S.showCategory;(void 0===D||D)&&(N?b.push({".ugb-blog-posts__category a":{backgroundColor:Object(k.c)(t("categoryColor")),color:Object(k.c)(Object(k.wb)("",t("categoryColor")))},".ugb-blog-posts__category a:hover":{opacity:t("categoryHoverColor")?void 0:.8,backgroundColor:Object(k.c)(t("categoryHoverColor")),color:Object(k.c)(Object(k.wb)("",t("categoryHoverColor")))}}):b.push({".ugb-blog-posts__category a":{color:Object(k.c)(Object(k.wb)(R,u.columnBackground&&o))},".ugb-blog-posts__category a:hover":{opacity:R&&!t("categoryHoverColor")?.8:void 0,color:Object(k.c)(t("categoryHoverColor"))}}),b.push({".ugb-blog-posts__category":B({},Object(k.K)("category%s","desktop",e.attributes,{importantSize:!0}),{textAlign:t("categoryAlign","%s !important")}),tablet:{".ugb-blog-posts__category":B({},Object(k.K)("category%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("categoryTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__category":B({},Object(k.K)("category%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("categoryMobileAlign","%s !important")})}}));var F=e.attributes,L=F.titleColor,U=void 0===L?"":L,z=F.showTitle;(void 0===z||z)&&b.push({".ugb-blog-posts__title a":{color:Object(k.c)(Object(k.wb)(U,u.columnBackground&&o))},".ugb-blog-posts__title a:hover":{opacity:U&&!t("titleHoverColor")?.8:void 0,color:Object(k.c)(t("titleHoverColor"))},".ugb-blog-posts__title":B({},Object(k.K)("title%s","desktop",e.attributes,{importantSize:!0}),{textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-blog-posts__title":B({},Object(k.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__title":B({},Object(k.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}});var H=e.attributes,I=H.excerptColor,W=void 0===I?"":I,V=H.showExcerpt;(void 0===V||V)&&b.push({".ugb-blog-posts__excerpt, .ugb-blog-posts__excerpt p":B({},Object(k.K)("excerpt%s","desktop",e.attributes,{importantSize:!0}),{color:Object(k.c)(Object(k.wb)(W,u.columnBackground&&o))}),".ugb-blog-posts__excerpt":{textAlign:t("excerptAlign","%s !important")},tablet:{".ugb-blog-posts__excerpt, .ugb-blog-posts__excerpt p":B({},Object(k.K)("excerpt%s","tablet",e.attributes,{importantSize:!0})),".ugb-blog-posts__excerpt":{textAlign:t("excerptTabletAlign","%s !important")}},mobile:{".ugb-blog-posts__excerpt, .ugb-blog-posts__excerpt p":B({},Object(k.K)("excerpt%s","mobile",e.attributes,{importantSize:!0})),".ugb-blog-posts__excerpt":{textAlign:t("excerptMobileAlign","%s !important")}}});var G=e.attributes,q=G.metaColor,K=void 0===q?"":q,Y=G.showMeta,J=void 0===Y||Y,X=G.showAuthor,$=void 0===X||X,Q=G.showDate,Z=void 0===Q||Q,ee=G.showComments;J&&($||Z||(void 0===ee||ee))&&b.push({".ugb-blog-posts__meta":B({},Object(k.K)("meta%s","desktop",e.attributes,{importantSize:!0}),{color:Object(k.c)(Object(k.wb)(K,u.columnBackground&&o)),textAlign:t("metaAlign","%s !important")}),tablet:{".ugb-blog-posts__meta":B({},Object(k.K)("meta%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("metaTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__meta":B({},Object(k.K)("meta%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("metaMobileAlign","%s !important")})}});var te=e.attributes.readmoreColor,ne=void 0===te?"":te;return s&&b.push({".ugb-blog-posts__readmore a":{color:Object(k.c)(Object(k.wb)(ne,u.columnBackground&&o))},".ugb-blog-posts__readmore a:hover":{opacity:ne&&!t("readmoreHoverColor")?.8:void 0,color:Object(k.c)(t("readmoreHoverColor"))},".ugb-blog-posts__readmore":B({},Object(k.K)("readmore%s","desktop",e.attributes,{importantSize:!0}),{textAlign:t("readmoreAlign","%s !important")}),tablet:{".ugb-blog-posts__readmore":B({},Object(k.K)("readmore%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("readmoreTabletAlign","%s !important")})},mobile:{".ugb-blog-posts__readmore":B({},Object(k.K)("readmore%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("readmoreMobileAlign","%s !important")})}}),u.imageSpacing&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__featured-image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.categorySpacing&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__category","category%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.titleSpacing&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.excerptSpacing&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__excerpt","excerpt%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.metaSpacing&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__meta","meta%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.readmoreSpacing&&b.push.apply(b,T(Object(k.F)(".ugb-blog-posts__readmore","readmore%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),C.a.all(b)},N=n(3),M=n(6),R=n(11),D=n(0),F=n(420),L=n(23),U=n.n(L);function z(e){return(z="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 H(e,t){for(var n=0;n0&&wp.element.createElement(N.d,{label:Object(D.__)("Filter by Taxonomy",x.i18n),options:n,value:this.props.taxonomyType,onChange:function(t){e.props.onChangeTaxonomyType(t),e.props.onChangeTaxonomy("")}}),n.length>0&&wp.element.createElement(M.Fragment,null,wp.element.createElement(N.d,{label:Object(D.__)("Taxonomy Filter Type",x.i18n),options:[{label:Object(D.__)("Included In",x.i18n),value:"__in"},{label:Object(D.__)("Not In",x.i18n),value:"__not_in"}],value:this.props.taxonomyFilterType,onChange:this.props.onChangeTaxonomyFilterType}),wp.element.createElement(R.FormTokenField,{label:o,suggestions:l,value:c,onChange:function(t){var n=t.map(function(e){return(Object(a.find)(i||[],function(t){return t.name===e})||{}).value});e.props.onChangeTaxonomy(Object(a.compact)(n).join(","))}})))}}])&&H(n.prototype,i),o&&H(n,o),t}();q.defaultProps={postType:"post",onChangePostType:function(){},taxonomyType:"category",onChangeTaxonomyType:function(){},taxonomy:"",onChangeTaxonomy:function(){}};var K=q,Y=n(10),J=n(8),X=n.n(J),$=n(51),Q=n(255),Z=n(13),ee=n(12);function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ne(e){for(var t=1;tg?r.slice(0,g):r,me=X()(["ugb-blog-posts__item"],ie({},"ugb--shadow-".concat(p||3),!le.imageShadow)),ge=X()(["ugb-blog-posts__featured-image"],ie({},"ugb--shadow-".concat(p||3),le.imageShadow));return ce?wp.element.createElement(N.k.Edit,{className:be,blockProps:this.props,render:function(){return wp.element.createElement(M.Fragment,null,(pe||[]).map(function(t,n){var a=(t.featured_image_urls&&t.featured_image_urls[v||"large"]||[])[0],o=a&&wp.element.createElement("figure",{className:ge},wp.element.createElement("a",null,wp.element.createElement("img",{src:a,alt:Object(D.__)("featured",x.i18n)}))),r=a&&wp.element.createElement("div",{className:"ugb-blog-posts__featured-image-background",style:{backgroundImage:"url(".concat(a,")")}}),l=wp.element.createElement(se,{className:"ugb-blog-posts__title"},wp.element.createElement("a",null,Object(Q.decodeEntities)(t.title.rendered.trim())||Object(D.__)("(Untitled)",x.i18n))),c=t.category_list&&wp.element.createElement("div",{className:"ugb-blog-posts__category",dangerouslySetInnerHTML:{__html:t.category_list.replace(/href=['"].*?['"]/g,"")}}),s=wp.element.createElement("span",{className:"ugb-blog-posts__sep"},ue[j||"dot"]),u=t.author_info&&t.author_info.name&&wp.element.createElement("span",null,t.author_info.name),b=t.date_gmt&&wp.element.createElement("time",{dateTime:Object($.format)("c",t.date_gmt),className:"ugb-blog-posts__date"},Object($.dateI18n)("F d, Y",t.date_gmt)),p=wp.element.createElement("span",null,t.comments_num),m=t.post_excerpt_stackable.split(" "),g=(m=m.length>(_||55)?m.slice(0,_||55).join(" ")+"...":t.post_excerpt_stackable)&&wp.element.createElement("div",{className:"ugb-blog-posts__excerpt",dangerouslySetInnerHTML:{__html:m}}),d=wp.element.createElement("p",{className:"ugb-blog-posts__readmore"},wp.element.createElement("a",null,Z||Object(D.__)("Continue reading",x.i18n))),f=(V||q||Y)&&wp.element.createElement("aside",{className:"entry-meta ugb-blog-posts__meta"},V&&u,V&&u&&(q&&b||Y&&p)&&s,q&&b,(V&&u||q&&b)&&Y&&p&&s,Y&&p),h=Object(i.applyFilters)("stackable.blog-posts.edit.output",null,e.props,{itemClasses:me,featuredImageBackground:r,featuredImage:o,category:c,title:l,author:u,separator:s,date:b,comments:p,excerpt:g,readmore:d,meta:f},n);return h||wp.element.createElement(N.H,{tagName:"article",className:me,backgroundAttrName:"column%s",blockProps:e.props,showBackground:le.showBackgroundInItem,showBackgroundVideo:!1,key:n},S&&le.imageAsBackground&&r,S&&!le.imageAsBackground&&le.imageOutsideContainer&&o,wp.element.createElement(N.H,{className:"ugb-blog-posts__content",backgroundAttrName:"column%s",blockProps:e.props,showBackground:le.showBackgroundInContent,showBackgroundVideo:!1},S&&!le.imageAsBackground&&!le.imageOutsideContainer&&o,A&&c,T&&l,z&&f,L&&g,I&&d))}),re&&wp.element.createElement(N.s,{containerClassName:"ugb-blog-posts__load-more-button",attrNameTemplate:"loadMoreButton%s",setAttributes:n,blockAttributes:o,isSelected:!1}))}}):wp.element.createElement(R.Placeholder,{icon:"admin-post",label:Object(D.__)("Posts",x.i18n)},Array.isArray(r)?Object(D.__)("No posts found.",x.i18n):wp.element.createElement(R.Spinner,null))}}])&&oe(n.prototype,a),o&&oe(n,o),t}(),pe=Object(ee.compose)(Y.i,Y.g,Y.d,Object(Y.h)(),Object(Y.c)(["Category%sAlign","Title%sAlign","Excerpt%sAlign","Meta%sAlign","Readmore%sAlign"]),Object(Y.a)(A,{editorMode:!0}),Object(Y.b)([[".ugb-blog-posts__featured-image","image"],[".ugb-blog-posts__featured-image img","image"],[".ugb-blog-posts__category","category"],[".ugb-blog-posts__title","title"],[".ugb-blog-posts__excerpt","excerpt"],[".ugb-blog-posts__meta","meta"],[".ugb-blog-posts__readmore","readmore"],[".ugb-blog-posts--design-image-card .ugb-blog-posts__header","image"],[".ugb-blog-posts__item","column-background"],[".ugb-blog-posts__load-more-button","loadmore"]]),Object(Z.withSelect)(function(e,t){var n=t.attributes,o=n.postType,r=void 0===o?"post":o,l=n.numberOfItems,c=void 0===l?6:l,s=n.orderBy,u=void 0===s?"date":s,b=n.order,p=void 0===b?"desc":b,m=n.taxonomyType,g=void 0===m?"":m,d=n.taxonomy,f=void 0===d?"":d,h=n.taxonomyFilterType,v=void 0===h?"__in":h,y=e("core").getEntityRecords,O=Object(a.pickBy)(ne({order:p,orderby:u,per_page:c},Object(i.applyFilters)("stackable.blog-posts.postQuery",{},t)),function(e){return Array.isArray(e)?!Object(a.isEmpty)(e):!Object(a.isUndefined)(e)&&""!==e});return f&&g&&("category"===g?O["__in"===v?"categories":"categories_exclude"]=f:"post_tag"===g?O["__in"===v?"tags":"tags_exclude"]=f:O["__in"===v?g:"".concat(g,"_exclude")]=f),{posts:y("postType",r,O)}}))(be);function me(){return(me=Object.assign||function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(c.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(c.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(c.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-countup__item":Object(c.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-countup__item":Object(c.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-countup__item":Object(c.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}}});var p=e.attributes,m=p.showIcon,g=void 0!==m&&m,d=p.showNumber,f=void 0===d||d,h=p.showTitle,v=void 0===h||h,O=p.showDescription,k=void 0===O||O;g&&a.push.apply(a,_(Object(c.F)(".ugb-countup__icon","icon%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),f&&a.push.apply(a,_(Object(c.F)(".ugb-countup__counter","number%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),v&&a.push.apply(a,_(Object(c.F)(".ugb-countup__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),k&&a.push.apply(a,_(Object(c.F)(".ugb-countup__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0})));var C=e.attributes,x=C.columnBackgroundColor,E=void 0===x?"":x,S=C.showBlockBackground,B=void 0!==S&&S,T=C.blockBackgroundBackgroundColor,P=void 0===T?"":T,A=C.iconAlign,N=void 0===A?"":A,M=C.contentAlign,R=void 0===M?"":M,D=C.iconTabletAlign,F=void 0===D?"":D,L=C.tabletContentAlign,U=void 0===L?"":L,z=C.iconMobileAlign,H=void 0===z?"":z,I=C.mobileContentAlign,W=void 0===I?"":I;g&&(a.push({".ugb-countup__icon svg:not(.ugb-custom-icon)":{color:Object(c.vb)(t("iconColor"),n.columnBackground?E:B?P:"")},".ugb-countup__icon":{marginLeft:""!==N||""!==R?Object(c.c)(Object(c.hb)(N||R)):void 0,marginRight:""!==N||""!==R?Object(c.c)(Object(c.ib)(N||R)):void 0},tablet:{".ugb-countup__icon svg":{marginLeft:""!==F||""!==U?Object(c.c)(Object(c.hb)(F||U)):void 0,marginRight:""!==F||""!==U?Object(c.c)(Object(c.ib)(F||U)):void 0}},mobile:{".ugb-countup__icon svg":{marginLeft:""!==H||""!==W?Object(c.c)(Object(c.hb)(H||W)):void 0,marginRight:""!==H||""!==W?Object(c.c)(Object(c.ib)(H||W)):void 0}}}),a.push(j({},Object(c.v)("icon%s","ugb-countup__icon",e.attributes))));var V=e.attributes.titleColor,G=void 0===V?"":V;v&&a.push({".ugb-countup__title":j({},Object(c.K)("title%s","desktop",e.attributes),{color:Object(c.vb)(G,n.columnBackground?E:B?P:""),textAlign:t("titleAlign")}),tablet:{".ugb-countup__title":j({},Object(c.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")})},mobile:{".ugb-countup__title":j({},Object(c.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")})}});var q=e.attributes.numberColor,K=void 0===q?"":q;f&&a.push({".ugb-countup__counter":j({},Object(c.K)("number%s","desktop",e.attributes,{importantSize:!0}),{color:Object(c.vb)(K,n.columnBackground?E:B?P:""),textAlign:t("numberAlign")}),tablet:{".ugb-countup__counter":j({},Object(c.K)("number%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("numberTabletAlign")})},mobile:{".ugb-countup__counter":j({},Object(c.K)("number%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("numberMobileAlign")})}});var Y=e.attributes.descriptionColor,J=void 0===Y?"":Y;return k&&a.push({".ugb-countup__description":j({},Object(c.K)("description%s","desktop",e.attributes),{color:Object(c.vb)(J,n.columnBackground?E:B?P:""),textAlign:t("descriptionAlign")}),tablet:{".ugb-countup__description":j({},Object(c.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign")})},mobile:{".ugb-countup__description":j({},Object(c.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign")})}}),w.a.all(a)},E=n(284),S=n.n(E),B=n(285),T=n.n(B),P=n(286),A=n.n(P),N=n(287),M=n.n(N),R=n(288),D=n.n(R),F=n(1),L=n(12),U=n(6);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 H(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["link1Url","link2Url","link3Url","link4Url","link1NewTab","link2NewTab","link3NewTab","link4NewTab","link1NoFollow","link2NoFollow","link3NoFollow","link4NoFollow","image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image4Id"],o(t&&t.image4Id?["image4Url"]:[]))))});var s=n(5),u=n.n(s);function b(){return(b=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(n){var a,o=n.className,r=n.attributes,l=n.attributes,c=l.titleColor,s=l.subtitleColor,u=l.overlayColor,b=l.height,p=l.width,d=l.verticalAlign,h=l.horizontalAlign,v=l.align,O=l.columns,_=l.design,k=void 0===_?"basic":_,j=l.borderRadius,C=void 0===j?12:j,x=l.shadow,E=void 0===x?3:x,S=l.imageHoverEffect,B=void 0===S?"":S,T=l.overlayOpacity,P=void 0===T?7:T,A=l.arrow,N=void 0===A?"":A,M=f()([o,"ugb-image-box","ugb-image-box--v3","ugb-image-box--columns-".concat(O)],Object(i.applyFilters)("stackable.image-box.mainclasses_1_17_3",(w(a={},"ugb-image-box--design-".concat(k),"basic"!==k),w(a,"ugb-image-box--effect-".concat(B),B),w(a,"ugb-image-box--overlay-".concat(P),7!==P),w(a,"ugb-image-box--arrow",N),a),k,n)),R={textAlign:h||void 0,"--overlay-color":u};return wp.element.createElement("div",{className:M,style:R},Object(i.applyFilters)("stackable.image-box.save.output.before_1_17_3",null,k,n),Object(g.nb)(1,O+1).map(function(a){var o=r["imageURL".concat(a)],l=r["title".concat(a)],u=r["description".concat(a)],g=r["link".concat(a)],_=r["newTab".concat(a)],j={backgroundImage:o?"url(".concat(o,")"):void 0,maxWidth:"wide"!==v&&"full"!==v&&1===O?p:void 0,height:b,textAlign:h,justifyContent:d,borderRadius:C},x=f()(["ugb-image-box__item"],Object(i.applyFilters)("stackable.image-box.itemclasses_1_17_3",w({},"ugb--shadow-".concat(E),3!==E),k,a,n)),S=f()(["ugb-image-box__arrow","ugb-image-box__arrow--align-".concat(N)]);return wp.element.createElement("div",{className:x,style:j,key:a},B&&wp.element.createElement("div",{className:"ugb-image-box__image-effect",style:{backgroundImage:o?"url(".concat(o,")"):void 0}}),wp.element.createElement("a",{className:"ugb-image-box__overlay",href:g,target:_?"_blank":void 0}),wp.element.createElement("div",{className:"ugb-image-box__content"},!y.RichText.isEmpty(l)&&wp.element.createElement(y.RichText.Content,{tagName:"h4",className:"ugb-image-box__title",style:e?{color:c}:void 0,value:l}),!y.RichText.isEmpty(u)&&wp.element.createElement(y.RichText.Content,{tagName:"p",className:"ugb-image-box__description",style:t?{color:s}:void 0,value:u})),N&&g&&wp.element.createElement("div",{className:S},wp.element.createElement(m,{style:{fill:c||void 0}})))}),Object(i.applyFilters)("stackable.image-box.save.output.after_1_17_3",null,k,n))}},j=function(e){var t=function(e){return(e||"").replace(/\.ugb-image-box__overlay(\s*{)/g,".ugb-image-box__overlay-hover$1")};return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(g.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(g.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(g.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-image-box__item":Object(g.d)({paddingTop:t("columnPaddingTop","%s".concat(l)),paddingBottom:t("columnPaddingBottom","%s".concat(l)),paddingRight:t("columnPaddingRight","%s".concat(l)),paddingLeft:t("columnPaddingLeft","%s".concat(l))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-image-box__item":Object(g.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(s)),paddingRight:t("tabletColumnPaddingRight","%s".concat(s)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(s)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(s))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-image-box__item":Object(g.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(b)),paddingRight:t("mobileColumnPaddingRight","%s".concat(b)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(b)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(b))})}}}),a.push({".ugb-image-box__item":{height:Object(g.c)(t("columnHeight","%spx"))},tabletOnly:{".ugb-image-box__item":{height:Object(g.c)(t("tabletColumnHeight","%spx")||i&&"".concat(i,"px"))}},mobile:{".ugb-image-box__item":{height:Object(g.c)(t("mobileColumnHeight","%spx")||i&&"".concat(i,"px"))}}}),a.push({".ugb-image-box__item":{justifyContent:Object(g.c)(t("columnContentVerticalAlign"))},tablet:{".ugb-image-box__item":{justifyContent:Object(g.c)(t("columnContentTabletVerticalAlign"))}},mobile:{".ugb-image-box__item":{justifyContent:Object(g.c)(t("columnContentMobileVerticalAlign"))}}}),a.push({".ugb-image-box__item1 .ugb-image-box__image":{backgroundImage:t("image1Url","url(%s)")},".ugb-image-box__item2 .ugb-image-box__image":{backgroundImage:t("image2Url","url(%s)")},".ugb-image-box__item3 .ugb-image-box__image":{backgroundImage:t("image3Url","url(%s)")},".ugb-image-box__item4 .ugb-image-box__image":{backgroundImage:t("image4Url","url(%s)")},".ugb-image-box__image":{backgroundPosition:Object(g.c)(t("imageBackgroundPosition")),backgroundRepeat:Object(g.c)(t("imageBackgroundRepeat")),backgroundSize:Object(g.c)("custom"===t("imageBackgroundSize")?t("imageBackgroundCustomSize","%s".concat(t("imageBackgroundCustomSizeUnit")||"px")):t("imagebackgroundSize"))}});var p=e.attributes.showOverlay;void 0!==p&&p&&a.push({".ugb-image-box__overlay":G({},Object(g.n)("overlay%s","desktop",e.attributes,{importantBackgroundColor:!0}),{},Object(g.l)("overlay%s","desktop",e.attributes,{importantBackgroundColor:!0})),".ugb-image-box__item:not(:hover) .ugb-image-box__overlay":{opacity:Object(g.c)(t("overlayOpacity"))}});var m=e.attributes.showOverlayHover;void 0!==m&&m&&a.push({".ugb-image-box__overlay-hover":G({},Object(g.n)("overlayHover%s","desktop",e.attributes,{importantBackgroundColor:!0}),{},Object(g.l)("overlayHover%s","desktop",e.attributes,{importantBackgroundColor:!0})),".ugb-image-box__item:hover .ugb-image-box__overlay-hover":{opacity:Object(g.c)(t("overlayHoverOpacity"))}});var d=e.attributes.showSubtitle;(void 0===d||d)&&a.push({".ugb-image-box__subtitle":G({},Object(g.K)("subtitle%s","desktop",e.attributes,{importantSize:!0}),{color:Object(g.c)(t("subtitleColor")),textAlign:t("subtitleAlign","%s !important")}),tablet:{".ugb-image-box__subtitle":G({},Object(g.K)("subtitle%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("subtitleTabletAlign","%s !important")})},mobile:{".ugb-image-box__subtitle":G({},Object(g.K)("subtitle%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("subtitleMobileAlign","%s !important")})}});var f=e.attributes.showTitle;(void 0===f||f)&&a.push({".ugb-image-box__title":G({},Object(g.K)("title%s","desktop",e.attributes,{importantSize:!0}),{color:Object(g.c)(t("titleColor")),textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-image-box__title":G({},Object(g.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-image-box__title":G({},Object(g.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}});var h=e.attributes.showDescription;(void 0===h||h)&&a.push({".ugb-image-box__description":G({},Object(g.K)("description%s","desktop",e.attributes,{importantSize:!0}),{color:Object(g.c)(t("descriptionColor")),textAlign:t("descriptionAlign","%s !important")}),tablet:{".ugb-image-box__description":G({},Object(g.K)("description%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("descriptionTabletAlign","%s !important")})},mobile:{".ugb-image-box__description":G({},Object(g.K)("description%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("descriptionMobileAlign","%s !important")})}});var v=e.attributes.showArrow;return void 0!==v&&v&&(a.push({".ugb-image-box__arrow svg":{fill:Object(g.c)(t("arrowColor"))}}),a.push.apply(a,W(Object(g.F)(".ugb-image-box__arrow svg","arrow%sSize","width","%spx",e.attributes,{important:!0,inherit:!1}))),a.push.apply(a,W(Object(g.F)(".ugb-image-box__arrow","arrow%sAlign","textAlign","%s",e.attributes,{important:!0})))),n.subtitleSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__subtitle","subtitle%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.arrowSpacing&&a.push.apply(a,W(Object(g.F)(".ugb-image-box__arrow","arrow%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),H.a.all(a)},Y=n(11),J=n(6),X=n(12),$=n(13);function Q(e){return(Q="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 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,t){for(var n=0;n .ugb-inner-block > .ugb-block-content > *"]={minHeight:void 0},e.tablet["> .ugb-inner-block > .ugb-block-content > *"]={minHeight:void 0},e.mobile["> .ugb-inner-block > .ugb-block-content > *"]={minHeight:void 0},e})},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(1),o=n(7),r=n(4);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object(r.addFilter)("stackable.cta.design.no-text-attributes","stackable/cta",function(e){return Object(o.omit)(e,["title","description","buttonText"])}),Object(r.addFilter)("stackable.cta.design.filtered-block-attributes","stackable/cta",function(e){return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-cta__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-cta__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-cta__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}}});var h=e.attributes,v=h.titleColor,y=void 0===v?"":v,O=h.showTitle;(void 0===O||O)&&c.push({".ugb-cta__title":x({},Object(u.K)("title%s","desktop",e.attributes,{importantSize:!0}),{color:Object(u.vb)(y,0!==r?i:null),textAlign:t("titleAlign","%s !important")}),tablet:{".ugb-cta__title":x({},Object(u.K)("title%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("titleTabletAlign","%s !important")})},mobile:{".ugb-cta__title":x({},Object(u.K)("title%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("titleMobileAlign","%s !important")})}});var w=e.attributes,C=w.descriptionColor,E=void 0===C?"":C,S=w.showDescription;(void 0===S||S)&&c.push({".ugb-cta__description":x({},Object(u.K)("description%s","desktop",e.attributes),{color:Object(u.vb)(E,0!==r?i:null),textAlign:t("descriptionAlign","%s !important")}),tablet:{".ugb-cta__description":x({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign","%s !important")})},mobile:{".ugb-cta__description":x({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign","%s !important")})}});var B=e.attributes.showButton;return(void 0===B||B)&&(c.push(x({},Object(u.s)("button%s","ugb-button",e.attributes))),c.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")}}})),_.a.all(c)},B=n(261),T=n.n(B),P=n(262),A=n.n(P),N=n(263),M=n.n(N),R=n(264),D=n.n(R),F=n(265),L=n.n(F),U=n(266),z=n.n(U),H=n(12),I=n(6);function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return c({},Object(i.omit)(e,[].concat(r(t&&t.image1Id?["image1Url"]:[]),["image1Id"],r(t&&t.image2Id?["image2Url"]:[]),["image2Id"],r(t&&t.image3Id?["image3Url"]:[]),["image3Id","button1Url","button1NewTab","button1NoFollow","button2Url","button2NewTab","button2NoFollow","button3Url","button3NewTab","button3NoFollow"])))});var u=n(21),b=n(2),p=n(8),m=n.n(p),g=n(1),d=n(0),f=n(9);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function v(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image4Id"],o(t&&t.image4Id?["image4Url"]:[]),["button1Url","button1NewTab","button1NoFollow","button2Url","button2NewTab","button2NoFollow","button3Url","button3NewTab","button3NoFollow","button4Url","button4NewTab","button4NoFollow"])))});var s=n(21),u=n(2),b=n(8),p=n.n(b),m=n(1),g=n(19),d=n.n(g),f=n(9),h=n(0);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=[{attributes:{design:{type:"string",default:"basic"},columns:{type:"number",default:3},imageSize:{type:"number",default:100},imageID1:{type:"number"},imageID2:{type:"number"},imageID3:{type:"number"},imageUrl1:{type:"url"},imageUrl2:{type:"url"},imageUrl3:{type:"url"},imageAlt1:{type:"string"},imageAlt2:{type:"string"},imageAlt3:{type:"string"},title1:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-feature-grid__title",default:Object(h.__)("Title",m.i18n)},title2:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-feature-grid__title",default:Object(h.__)("Title",m.i18n)},title3:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-feature-grid__title",default:Object(h.__)("Title",m.i18n)},description1:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-feature-grid__description",default:Object(u.M)("short")},description2:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-feature-grid__description",default:Object(u.M)("short")},description3:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-feature-grid__description",default:Object(u.M)("short")},linkUrl1:{type:"string",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-button",attribute:"href",default:""},linkUrl2:{type:"string",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-button",attribute:"href",default:""},linkUrl3:{type:"string",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-button",attribute:"href",default:""},newTab1:{type:"boolean",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-button",attribute:"target",default:!1},newTab2:{type:"boolean",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-button",attribute:"target",default:!1},newTab3:{type:"boolean",source:"attribute",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-button",attribute:"target",default:!1},linkText1:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(1) .ugb-button span",default:Object(h.__)("Button text",m.i18n)},linkText2:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(2) .ugb-button span",default:Object(h.__)("Button text",m.i18n)},linkText3:{source:"html",selector:".ugb-feature-grid__item:nth-of-type(3) .ugb-button span",default:Object(h.__)("Button text",m.i18n)},buttonColor:{type:"string"},buttonTextColor:{type:"string"},buttonSize:{type:"string",default:"normal"},buttonBorderRadius:{type:"number",default:4},buttonDesign:{type:"string",default:"link"},buttonIcon:{type:"string"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},hoverEffect:{type:"string",default:""},align:{type:"string"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},save:function(e){var t=e.attributes,n=e.className,a=t.columns,o=t.imageSize,r=t.design,l=t.buttonColor,c=t.buttonTextColor,b=t.buttonSize,m=t.buttonBorderRadius,g=t.buttonDesign,h=void 0===g?"link":g,v=t.buttonIcon,O=t.borderRadius,w=void 0===O?12:O,_=t.shadow,k=void 0===_?3:_,j=p()([n,"ugb-feature-grid","ugb-feature-grid--columns-".concat(a)],Object(i.applyFilters)("stackable.feature-grid.mainclasses_1_17_2",y({},"ugb-feature-grid--design-".concat(r),r&&"basic"!==r),r,e)),C={borderRadius:"plain"!==r&&12!==w?w:void 0};return wp.element.createElement("div",{className:j},Object(i.applyFilters)("stackable.feature-grid.edit.output.before_1_17_2",null,r,e),Object(u.nb)(1,a+1).map(function(n){var a=t["imageUrl".concat(n)],u=t["imageAlt".concat(n)],g=t["title".concat(n)],O=t["description".concat(n)],w=t["linkUrl".concat(n)],_=t["newTab".concat(n)],j=t["linkText".concat(n)],x=p()(["ugb-feature-grid__item"],Object(i.applyFilters)("stackable.feature-grid.itemclasses_1_17_2",y({},"ugb--shadow-".concat(k),"plain"!==r&&3!==k),r,n,e)),E=Object(i.applyFilters)("stackable.feature-grid.itemstyles_1_17_2",{image:{width:a?"".concat(o,"%"):void 0}},r,n,e);return wp.element.createElement("div",{className:x,style:C,key:n},a&&wp.element.createElement("div",{className:"ugb-feature-grid__image"},wp.element.createElement("img",{src:a,style:E.image,alt:d()(g||u)})),wp.element.createElement("div",{className:"ugb-feature-grid__content"},!f.RichText.isEmpty(g)&&wp.element.createElement(f.RichText.Content,{tagName:"h5",className:"ugb-feature-grid__title",value:g}),!f.RichText.isEmpty(O)&&wp.element.createElement(f.RichText.Content,{tagName:"p",className:"ugb-feature-grid__description",value:O}),!f.RichText.isEmpty(j)&&wp.element.createElement(s.b,{size:b,url:w,newTab:_,color:c,text:j,icon:v,design:h,backgroundColor:l,borderRadius:m})))}),Object(i.applyFilters)("stackable.feature-grid.edit.output.after_1_17_2",null,r,e))},migrate:function(e){var t;if(e.imageSize&&"horizontal"!==e.design){var n="wide"!==e.align?m.contentWidth||900:1200,a="plain"===e.design?0:70,i=1===e.columns?n-a:2===e.columns?(n-35)/2-a:(n-70)/3-a;t=parseInt((parseInt(e.imageSize,10)||100)/100*i,10)}return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-feature-grid__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(f)),paddingBottom:t("columnPaddingBottom","%s".concat(f)),paddingRight:t("columnPaddingRight","%s".concat(f)),paddingLeft:t("columnPaddingLeft","%s".concat(f))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-feature-grid__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(v)),paddingRight:t("tabletColumnPaddingRight","%s".concat(v)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(v)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(v))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-feature-grid__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(O)),paddingRight:t("mobileColumnPaddingRight","%s".concat(O)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(O)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(O))})}}});var w=e.attributes,_=w.imageAlign,k=void 0===_?"":_,j=w.imageTabletAlign,C=void 0===j?"":j,x=w.tabletContentAlign,E=void 0===x?"":x,S=w.imageMobileAlign,B=void 0===S?"":S,T=w.mobileContentAlign,P=void 0===T?"":T;c&&(p.push(L({},Object(u.B)("image%s","ugb-img",e.attributes))),p.push({".ugb-img, .ugb-feature-grid__image":{marginLeft:""!==k||""!==b?Object(u.hb)(k||b)+" !important":void 0,marginRight:""!==k||""!==b?Object(u.ib)(k||b)+" !important":void 0},tablet:{".ugb-img, .ugb-feature-grid__image":{marginLeft:""!==C||""!==E?Object(u.hb)(C||E)+" !important":void 0,marginRight:""!==C||""!==E?Object(u.ib)(C||E)+" !important":void 0}},mobile:{".ugb-img, .ugb-feature-grid__image":{marginLeft:""!==B||""!==P?Object(u.hb)(B||P)+" !important":void 0,marginRight:""!==B||""!==P?Object(u.ib)(B||P)+" !important":void 0}}}));var A=e.attributes,M=A.titleColor,F=void 0===M?"":M,z=A.showTitle;if(void 0===z||z){var H=Object(i.applyFilters)("stackable.feature-grid.styles.title.color-selector",".ugb-feature-grid__title",e);p.push(U({},H,{color:Object(u.vb)(F,n.columnBackground&&r)})),p.push({".ugb-feature-grid__title":L({},Object(u.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-feature-grid__title":L({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-feature-grid__title":L({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}})}var I=e.attributes,W=I.descriptionColor,V=void 0===W?"":W,G=I.showDescription;if(void 0===G||G){var q=Object(i.applyFilters)("stackable.feature-grid.styles.description.color-selector",".ugb-feature-grid__description",e);p.push(U({},q,{color:Object(u.vb)(V,n.columnBackground&&r)})),p.push({".ugb-feature-grid__description":L({},Object(u.K)("description%s","desktop",e.attributes),{textAlign:t("descriptionAlign")||t("contentAlign")}),tablet:{".ugb-feature-grid__description":L({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-feature-grid__description":L({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign")||t("mobileContentAlign")})}})}var K=e.attributes,Y=K.showButton,J=void 0===Y||Y,X=K.buttonDesign,$=void 0===X?"":X;return J&&(p.push(L({},Object(u.s)("button%s","ugb-button",L({},e.attributes,{buttonDesign:$||"plain"})))),p.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")||t("contentAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")||t("tabletContentAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")||t("mobileContentAlign","%s !important")}}})),n.imageSpacing&&p.push.apply(p,D(Object(u.F)(".ugb-feature-grid__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&p.push.apply(p,D(Object(u.F)(".ugb-feature-grid__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&p.push.apply(p,D(Object(u.F)(".ugb-feature-grid__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&p.push.apply(p,D(Object(u.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),R.a.all(p)},H=n(12),I=n(6),W=n(13);function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["imageId"].concat(o(t&&t.imageId?["imageUrl"]:[]),["imageAlt","buttonUrl","buttonNewTab","buttonNoFollow"])))});var s=n(21),u=n(2),b=n(8),p=n.n(b),m=n(1),g=n(19),d=n.n(g),f=n(9),h=n(0);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function y(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1],n=("number"!=typeof e?50:e)/100*2,a=2-n;return t?"".concat(a.toFixed(2),"fr ").concat(n.toFixed(2),"fr"):"".concat(n.toFixed(2),"fr ").concat(a.toFixed(2),"fr")},ie=function(e){var t=Object(u.b)(e.attributes),n=X(e),a=e.attributes,i=a.design,o=void 0===i?"plain":i,r=a.columnBackgroundColor,l=void 0===r?"":r,c=a.invert,s=void 0!==c&&c,b=[];n.imageColumnWidth&&b.push({desktopTablet:{".ugb-feature__item":{gridTemplateColumns:t("imageColumnWidth")?Object(u.c)(ae(t("imageColumnWidth"),!s)):void 0}},tabletOnly:{".ugb-feature__item":{gridTemplateColumns:t("imageColumnTabletWidth")?Object(u.c)(ae(t("imageColumnTabletWidth"),!s)):void 0}}});var p="basic"===o||"half"===o?".ugb-feature__item":".ugb-feature__content";if(n.borderRadius&&b.push(ne({},p,{borderRadius:t("borderRadius","%spx !important")})),n.border&&b.push(te({},Object(u.p)("column%s",p,e.attributes))),n.columnBackground){var m="basic"===o?"ugb-feature__item":"ugb-feature__content";b.push(te({},n.columnBackground?Object(u.m)("column%s",m,e.attributes,{importantBackgroundColor:!0,importantBackgroundPosition:!0,importantBackgroundSize:!0,importantBackgroundRepeat:!0}):{}))}n.featuredImageAsBackground?(b.push(te({},Object(u.z)("image%s","ugb-feature__image",e.attributes))),b.push({".ugb-feature__item":{height:t("imageBackgroundHeight","%spx !important")},tablet:{".ugb-feature__item":{height:t("imageBackgroundTabletHeight","%spx !important")}},mobile:{".ugb-feature__item":{height:t("imageBackgroundMobileHeight","%spx !important")}}})):b.push(te({},n.featuredImageAsBackground?{}:Object(u.B)("image%s","ugb-img",e.attributes,{inherit:!1})));var g=e.attributes,d=g.titleColor,f=void 0===d?"":d,h=g.showTitle;(void 0===h||h)&&b.push({".ugb-feature__title":te({},Object(u.K)("title%s","desktop",e.attributes),{color:Object(u.vb)(f,n.columnBackground&&l),textAlign:t("titleAlign")}),tablet:{".ugb-feature__title":te({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")})},mobile:{".ugb-feature__title":te({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")})}});var v=e.attributes,y=v.descriptionColor,O=void 0===y?"":y,w=v.showDescription;(void 0===w||w)&&b.push({".ugb-feature__description":te({},Object(u.K)("description%s","desktop",e.attributes),{color:Object(u.vb)(O,n.columnBackground&&l),textAlign:t("descriptionAlign")}),tablet:{".ugb-feature__description":te({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:t("descriptionTabletAlign")})},mobile:{".ugb-feature__description":te({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:t("descriptionMobileAlign")})}});var _=e.attributes.showButton;return(void 0===_||_)&&(b.push(te({},Object(u.s)("button%s","ugb-button",e.attributes))),b.push({".ugb-button-container":{textAlign:t("buttonAlign","%s !important")},tablet:{".ugb-button-container":{textAlign:t("buttonTabletAlign","%s !important")}},mobile:{".ugb-button-container":{textAlign:t("buttonMobileAlign","%s !important")}}})),n.titleSpacing&&b.push.apply(b,Z(Object(u.F)(".ugb-feature__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&b.push.apply(b,Z(Object(u.F)(".ugb-feature__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&b.push.apply(b,Z(Object(u.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),Q.a.all(b)},oe=n(11),re=n(6),le=n(12),ce=n(13);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 ue(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t *:last-child .ugb-button",attribute:"href",default:""},buttonNewTab2:{type:"boolean",source:"attribute",selector:".ugb-header__buttons > *:last-child .ugb-button",attribute:"target",default:!1},buttonText2:{source:"html",selector:".ugb-header__buttons > *:last-child .ugb-button span",default:Object(b.__)("Button text",i.i18n)},buttonColor2:{type:"string"},buttonTextColor2:{type:"string",default:"#ffffff"},buttonDesign2:{type:"string",default:"basic"},buttonIcon2:{type:"string"},buttonSize2:{type:"string",default:"normal"},buttonBorderRadius2:{type:"number",default:4},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""},opacity:{type:"number"},url:{type:"string"},id:{type:"number"}},save:function(e){var t,n,a,i,o,l,c,u,b=e.className,p=e.attributes,d=p.buttonURL,v=p.buttonText,y=p.buttonColor,O=p.buttonTextColor,w=p.buttonDesign,_=p.buttonIcon,k=p.cornerButtonRadius,j=p.size,C=p.title,x=p.titleColor,E=p.subtitle,S=p.subtitleColor,B=p.contentAlign,T=void 0===B?"center":B,P=p.backgroundColorType,A=void 0===P?"":P,N=p.backgroundColor,M=p.backgroundColor2,R=p.backgroundColorDirection,D=void 0===R?0:R,F=p.backgroundType,L=void 0===F?"":F,U=p.backgroundImageURL,z=p.backgroundOpacity,H=p.fixedBackground,I=p.design,W=void 0===I?"basic":I,V=p.borderRadius,G=void 0===V?12:V,q=p.shadow,K=void 0===q?3:q,Y=p.align,J=p.contentWidth,X=void 0!==J&&J,$=p.buttonNewTab,Q=p.invert,Z=void 0!==Q&&Q,ee=p.fullHeight,te=void 0!==ee&&ee,ne=p.buttonSize2,ae=p.buttonTextColor2,ie=p.buttonColor2,oe=p.buttonText2,re=void 0===oe?"":oe,le=p.buttonBorderRadius2,ce=void 0===le?4:le,se=p.buttonDesign2,ue=void 0===se?"basic":se,be=p.buttonIcon2,pe=void 0===be?"":be,me=p.buttonURL2,ge=void 0===me?"":me,de=p.buttonNewTab2,fe=void 0!==de&&de,he=m()([b,"ugb-header","ugb-header--v2","ugb--background-opacity-"+1*Math.round(z/1),["ugb-header--design-".concat(W)]],Object(r.applyFilters)("stackable.header.mainclasses_1_15_6",(h(t={"ugb--has-background":"plain"!==W&&(N||U),"ugb--has-background-image":"plain"!==W&&U},"ugb--shadow-".concat(K),"plain"!==W&&3!==K),h(t,"ugb--content-width","full"===Y&&X),h(t,"ugb-header--invert",Z),h(t,"ugb-header--full-height",te),h(t,"ugb--has-background-gradient","gradient"===A),h(t,"ugb--has-background-video","video"===L),t),W,e)),ve="plain"===W?{}:{"--ugb-background-color":U||"gradient"===A?N:void 0,"--ugb-background-color2":"gradient"===A&&M?M:void 0,"--ugb-background-direction":"gradient"===A?"".concat(D,"deg"):void 0,backgroundAttachment:H?"fixed":void 0,backgroundColor:N||void 0,backgroundImage:U?"url(".concat(U,")"):void 0,borderRadius:12!==G?G:void 0},ye=Object(r.applyFilters)("stackable.header.styles_1_15_6",{main:f({textAlign:T||void 0},ve),title:{color:x||("plain"===W?void 0:"#ffffff"),textAlign:T||void 0},subtitle:{color:S||("plain"===W?void 0:"#ffffff"),textAlign:T||void 0}},W,e);return wp.element.createElement("div",{className:he,style:ye.main},"plain"!==W&&"video"===L&&wp.element.createElement("video",{className:"ugb-video-background",autoPlay:!0,muted:!0,loop:!0,src:U}),Object(r.applyFilters)("stackable.header.save.output.before_1_15_6",null,W,e),(n=!g.RichText.isEmpty(C)&&wp.element.createElement(g.RichText.Content,{tagName:"h2",className:"ugb-header__title",style:ye.title,value:C}),a=!g.RichText.isEmpty(E)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-header__subtitle",style:ye.subtitle,value:E}),i=v&&!!v.length&&wp.element.createElement(s.b,{size:j,url:d,newTab:$,align:T,color:O,text:v,design:w,icon:_,backgroundColor:y,borderRadius:k}),o=re&&!!re.length&&wp.element.createElement(s.b,{size:ne,url:ge,newTab:fe,align:T,color:ae,text:re,design:ue,icon:pe,backgroundColor:ie,borderRadius:ce}),l={titleComp:n,subtitleComp:a,buttonComp:i},c={justifyContent:"right"===T?"flex-end":"left"===T?"flex-start":void 0},u=re?wp.element.createElement("div",{className:"ugb-header__buttons",style:c},l.buttonComp,o):l.buttonComp,"basic"===W||"plain"===W?wp.element.createElement("div",{className:"ugb-content-wrapper"},n,a,u):wp.element.createElement("div",{className:"ugb-content-wrapper"},wp.element.createElement("div",{className:"ugb-header__wrapper"},n,a,u))))},migrate:function(e){var t=function(e){return(e||"").replace(/\.ugb-header(\s*\{)/g,".ugb-header__item$1")},n={};return"half-overlay"===e.design&&e.fullHeight&&(n.design="side-overlay",n[e.invert?"columnPaddingRight":"columnPaddingLeft"]=0),f({},e,{},n,{columnBackgroundColorType:e.backgroundColorType,columnBackgroundColor:e.backgroundColor,columnBackgroundColor2:e.backgroundColor2,columnBackgroundGradientDirection:e.backgroundColorDirection,backgroundType:void 0,columnBackgroundMediaId:e.backgroundImageID,columnBackgroundMediaUrl:e.backgroundImageURL,columnBackgroundTintStrength:e.backgroundOpacity,columnFixedBackground:e.fixedBackground?e.fixedBackground:void 0,restrictContentWidth:e.contentWidth,showButton:!!e.buttonText,buttonUrl:e.buttonURL,buttonNewTab:e.buttonNewTab,buttonBackgroundColor:e.buttonColor,buttonSize:e.size,buttonBorderRadius:e.cornerButtonRadius,showButton2:!!e.buttonText2,button2Url:e.buttonURL2,button2NewTab:e.buttonNewTab2,button2Text:e.buttonText2,button2BackgroundColor:e.buttonColor2,button2TextColor:e.buttonTextColor2,button2Design:e.buttonDesign2,button2Icon:e.buttonIcon2,button2Size:e.buttonSize2,button2BorderRadius:e.buttonBorderRadius2,customCSS:t(e.customCSS),customCSSCompiled:t(e.customCSSCompiled),marginTop:"full"===e.align?0:void 0,marginBottom:"full"===e.align?0:void 0})}}],y=n(3),O=n(10),w=n(14),_=n.n(w),k=function(e){var t=e.attributes,n=t.design,a=void 0===n?"basic":n,i=t.align,o=void 0===i?"":i,l=t.showTitle,c=void 0===l||l,s=t.showSubtitle,u=void 0===s||s,b=t.showButton,p=void 0===b||b,m=t.showButton2,g=void 0!==m&&m,d=t.showBlockBackground,f=void 0!==d&&d,h=t.blockInnerWidth,v=void 0===h?"":h,y=!f&&"full"!==o||f&&"full"!==v;return Object(r.applyFilters)("stackable.header.show",{columnBackground:"plain"!==a,borderRadius:"plain"!==a&&y,border:"plain"!==a&&y,titleSpacing:c,subtitleSpacing:u,buttonSpacing:p||g,buttonGap:p&&g,restrictContent:!f&&"full"===o||f&&"full"===v,overlayBackground:a.match(/overlay/)},e)};function j(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(c)),paddingBottom:t("columnPaddingBottom","%s".concat(c)),paddingRight:t("columnPaddingRight","%s".concat(c)),paddingLeft:t("columnPaddingLeft","%s".concat(c))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(b)),paddingRight:t("tabletColumnPaddingRight","%s".concat(b)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(b)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(b))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(m)),paddingRight:t("mobileColumnPaddingRight","%s".concat(m)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(m)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(m))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-header__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(c)),paddingBottom:t("columnPaddingBottom","%s".concat(c)),paddingRight:t("columnPaddingRight","%s".concat(c)),paddingLeft:t("columnPaddingLeft","%s".concat(c))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-header__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(b)),paddingRight:t("tabletColumnPaddingRight","%s".concat(b)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(b)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(b))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-header__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(m)),paddingRight:t("mobileColumnPaddingRight","%s".concat(m)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(m)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(m))})}}});var g=e.attributes,d=g.overlayColor,f=void 0===d?"":d,h=g.overlayOpacity,v=void 0===h?"0.4":h;n.overlayBackground&&(f||v)&&o.push({".ugb-content-wrapper, .ugb-content-wrapper:after":{background:Object(u.ab)(f||"#000000",""===v?.4:v)+" !important"}});var y=e.attributes,O=y.titleColor,w=void 0===O?"":O,C=y.showTitle;(void 0===C||C)&&o.push({".ugb-header__title":x({},Object(u.K)("title%s","desktop",e.attributes),{color:Object(u.vb)(w,n.columnBackground&&i),textAlign:Object(u.c)(t("titleAlign")||t("contentAlign"))}),tablet:{".ugb-header__title":x({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:Object(u.c)(t("titleTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-header__title":x({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:Object(u.c)(t("titleMobileAlign")||t("mobileContentAlign"))})}});var E=e.attributes,S=E.subtitleColor,B=void 0===S?"":S,T=E.showSubtitle;(void 0===T||T)&&o.push({".ugb-header__subtitle":x({},Object(u.K)("subtitle%s","desktop",e.attributes),{color:Object(u.vb)(B,n.columnBackground&&i),textAlign:t("subtitleAlign")}),tablet:{".ugb-header__subtitle":x({},Object(u.K)("subtitle%s","tablet",e.attributes),{textAlign:t("subtitleTabletAlign")})},mobile:{".ugb-header__subtitle":x({},Object(u.K)("subtitle%s","mobile",e.attributes),{textAlign:t("subtitleMobileAlign")})}});var P=e.attributes,A=P.showButton,N=void 0!==A&&A,M=P.showButton2,R=void 0===M||M;return(N||R)&&(o.push({".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("contentAlign")?"flex-start":"right"===t("contentAlign")?"flex-end":"center"===t("contentAlign")?"center":void 0)},tablet:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("tabletContentAlign")?"flex-start":"right"===t("tabletContentAlign")?"flex-end":"center"===t("tabletContentAlign")?"center":void 0)}},mobile:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("mobileContentAlign")?"flex-start":"right"===t("mobileContentAlign")?"flex-end":"center"===t("mobileContentAlign")?"center":void 0)}}}),t("buttonAlign")&&o.push({".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("buttonAlign")?"flex-start":"right"===t("buttonAlign")?"flex-end":"center"===t("buttonAlign")?"center":void 0)}}),t("buttonTabletAlign")&&o.push({tablet:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("buttonTabletAlign")?"flex-start":"right"===t("buttonTabletAlign")?"flex-end":"center"===t("buttonTabletAlign")?"center":void 0)}}}),t("buttonMobileAlign")&&o.push({mobile:{".ugb-header__buttons":{justifyContent:Object(u.c)("left"===t("buttonMobileAlign")?"flex-start":"right"===t("buttonMobileAlign")?"flex-end":"center"===t("buttonMobileAlign")?"center":void 0)}}})),N&&o.push(x({},Object(u.s)("button%s","ugb-button1",e.attributes))),R&&o.push(x({},Object(u.s)("button2%s","ugb-button2",e.attributes))),n.titleSpacing&&o.push.apply(o,j(Object(u.F)(".ugb-header__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.subtitleSpacing&&o.push.apply(o,j(Object(u.F)(".ugb-header__subtitle","subtitle%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&o.push.apply(o,j(Object(u.F)(".ugb-button-container","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonGap&&o.push.apply(o,j(Object(u.F)(".ugb-button1","buttonGap%s","marginRight","%spx",e.attributes,{important:!0}))),_.a.all(o)},B=n(311),T=n.n(B),P=n(312),A=n.n(P),N=n(313),M=n.n(N),R=n(314),D=n.n(R),F=n(315),L=n.n(F),U=n(316),z=n.n(U),H=n(317),I=n.n(H),W=n(11),V=n(12),G=n(6);function q(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-icon__content-wrapper":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-icon__content-wrapper":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-icon__content-wrapper":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}}}),a.push(m({},Object(l.v)("icon%s","ugb-icon__icon",e.attributes))),n.iconAlign&&a.push({".ugb-icon__icon":Object(l.d)({alignSelf:Object(l.eb)(t("iconAlign"))}),tablet:{".ugb-icon__icon":Object(l.d)({alignSelf:Object(l.eb)(t("iconTabletAlign"))})},mobile:{".ugb-icon__icon":Object(l.d)({alignSelf:Object(l.eb)(t("iconMobileAlign"))})}});var f=e.attributes.showTitle;return(void 0===f||f)&&a.push({".ugb-icon__title":m({color:t("titleColor")},Object(l.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-icon__title":m({},Object(l.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-icon__title":m({},Object(l.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}}),a.push.apply(a,b(Object(l.F)(".ugb-icon__icon","icon%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&a.push.apply(a,b(Object(l.F)(".ugb-icon__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),a.push.apply(a,b(Object(l.F)(".ugb-icon__content-wrapper","%scolumnGap","columnGap","%spx",e.attributes,{important:!0}))),u.a.all(a)},f=n(3),h=n(10),v=n(8),y=n.n(v),O=n(11),w=n(0),_=n(6),k=n(12),j=n(9);function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,i=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(a=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function E(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t
',icon2:'',icon3:'',iconIcon:'
',iconDesign:"plain",newTab1:!1,newTab2:!1,newTab3:!1,newTab4:!1,newTab5:!1,newTab6:!1,newTab7:!1,newTab8:!1,showTitle:!1,titleTop:!1,titleLineHeightUnit:"em",titleTabletLineHeightUnit:"em",titleMobileLineHeightUnit:"em",uniqueClass:"ugb-34c3b52",hideDesktop:!1,hideTablet:!1,hideMobile:!1,showBlockBackground:!1,blockBackgroundBackgroundCustomSizeUnit:"%",blockBackgroundTabletBackgroundCustomSizeUnit:"%",blockBackgroundMobileBackgroundCustomSizeUnit:"%",topSeparatorDesign:"wave-1",bottomSeparatorDesign:"wave-1",topSeparatorShadow:!0,bottomSeparatorShadow:!0,showBlockTitle:!1,blockTitleLineHeightUnit:"em",blockTitleTabletLineHeightUnit:"em",blockTitleMobileLineHeightUnit:"em",showBlockDescription:!1,blockDescriptionLineHeightUnit:"em",blockDescriptionTabletLineHeightUnit:"em",blockDescriptionMobileLineHeightUnit:"em"}},supports:{align:["center","wide","full"],inserter:!a.disabledBlocks.includes(R),anchor:!0},edit:S,save:T,deprecated:P,modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-column-spacing":{paddings:!1},"advanced-responsive":!0,"block-background":!0,"block-separators":!0,"block-title":{marginBottomImportant:!0},"content-align":!0,"block-designs":!0,"custom-css":{default:Object(r.applyFilters)("stackable.icon.custom-css.default","")}}}},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(7),o=n(4);Object(o.addFilter)("stackable.number-box.design.no-text-attributes","stackable/number-box",function(e){return Object(i.omit)(e,["num1","num2","num3","title1","title2","title3","description1","description2","description3"])});var r=n(2),l=n(0),c=n(8),s=n.n(c),u=n(9);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=[{attributes:{num1:{source:"html",selector:".ugb-number-box__item:nth-of-type(1) .ugb-number-box__number",default:"01"},num2:{source:"html",selector:".ugb-number-box__item:nth-of-type(2) .ugb-number-box__number",default:"02"},num3:{source:"html",selector:".ugb-number-box__item:nth-of-type(3) .ugb-number-box__number",default:"03"},title1:{source:"html",selector:".ugb-number-box__item:nth-of-type(1) .ugb-number-box__title",default:Object(l.__)("Title")},title2:{source:"html",selector:".ugb-number-box__item:nth-of-type(2) .ugb-number-box__title",default:Object(l.__)("Title")},title3:{source:"html",selector:".ugb-number-box__item:nth-of-type(3) .ugb-number-box__title",default:Object(l.__)("Title")},description1:{source:"html",selector:".ugb-number-box__item:nth-of-type(1) .ugb-number-box__description",default:Object(r.M)()},description2:{source:"html",selector:".ugb-number-box__item:nth-of-type(2) .ugb-number-box__description",default:Object(r.M)()},description3:{source:"html",selector:".ugb-number-box__item:nth-of-type(3) .ugb-number-box__description",default:Object(r.M)()},numberColor:{type:"string"},numberBGColor:{type:"string"},titleColor:{type:"string"},descriptionColor:{type:"string"},columns:{type:"number",default:3},design:{type:"string",default:"basic"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},backgroundColor:{type:"string"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""},numberBox:{type:"string"},numberBoxTwo:{type:"string"},numberBoxThree:{type:"string"},name:{type:"string"},nameTwo:{type:"string"},nameThree:{type:"string"},body:{type:"string"},bodyTwo:{type:"string"},bodyThree:{type:"string"},numberBoxColor:{type:"string"},nameColor:{type:"string"},bodyTextColor:{type:"string"}},save:function(e){var t=e.className,n=e.attributes,a=n.numberColor,l=n.titleColor,c=n.descriptionColor,b=n.numberBGColor,m=n.columns,g=void 0===m?3:m,d=n.design,f=void 0===d?"basic":d,h=n.borderRadius,v=void 0===h?12:h,y=n.shadow,O=void 0===y?3:y,w=n.backgroundColor,_=s()([t,"ugb-number-box","ugb-number-box--v2","ugb-number-box--columns-".concat(g)],Object(o.applyFilters)("stackable.number-box.mainclasses_1_15",p({},"ugb-number-box--design-".concat(f),"basic"!==f),f,e));return wp.element.createElement("div",{className:_},Object(o.applyFilters)("stackable.number-box.save.output.before_1_15",null,f,e),Object(i.range)(1,g+1).map(function(t){var i=n["num".concat(t)],m=n["title".concat(t)],g=n["description".concat(t)],d=s()(["ugb-number-box__item"],Object(o.applyFilters)("stackable.number-box.boxclasses_1_15",p({},"ugb--shadow-".concat(O),"plain"!==f&&3!==O),f,e)),h=Object(o.applyFilters)("stackable.number-box.styles_1_15",{box:{borderRadius:"plain"!==f&&12!==v?v:void 0,backgroundColor:"plain"!==f&&w?w:void 0},number:{backgroundColor:b,color:a||(b?Object(r.bb)(b)?"#ffffff":"#222222":void 0)},title:{color:l||("plain"===f?void 0:w?Object(r.bb)(w)?"#ffffff":"#222222":void 0)},description:{color:c||("plain"===f?void 0:w?Object(r.bb)(w)?"#ffffff":"#222222":void 0)}},f,e);return wp.element.createElement("div",{className:d,style:h.box,key:t},!u.RichText.isEmpty(i)&&wp.element.createElement(u.RichText.Content,{tagName:"span",className:"ugb-number-box__number",style:h.number,value:i}),(!u.RichText.isEmpty(m)||!u.RichText.isEmpty(g))&&wp.element.createElement("div",{className:"ugb-number-box__content"},!u.RichText.isEmpty(m)&&wp.element.createElement(u.RichText.Content,{tagName:"h4",className:"ugb-number-box__title",style:h.title,value:m}),!u.RichText.isEmpty(g)&&wp.element.createElement(u.RichText.Content,{tagName:"p",className:"ugb-number-box__description",style:h.description,value:g})))}),Object(o.applyFilters)("stackable.number-box.save.output.after_1_15",null,f,e))},migrate:function(e){return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(r.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-number-box__item":Object(r.d)({paddingTop:t("columnPaddingTop","%s".concat(p)),paddingBottom:t("columnPaddingBottom","%s".concat(p)),paddingRight:t("columnPaddingRight","%s".concat(p)),paddingLeft:t("columnPaddingLeft","%s".concat(p))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-number-box__item":Object(r.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(g)),paddingRight:t("tabletColumnPaddingRight","%s".concat(g)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(g)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(g))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-number-box__item":Object(r.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(f)),paddingRight:t("mobileColumnPaddingRight","%s".concat(f)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(f)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(f))})}}});var v=e.attributes,w=v.contentAlign,k=void 0===w?"":w,j=v.tabletContentAlign,C=void 0===j?"":j,x=v.mobileContentAlign,E=void 0===x?"":x,S=v.numberBGColor,B=void 0===S?"":S,T=v.numberColor,P=void 0===T?"":T,A=v.numberAlign,N=void 0===A?"":A,M=v.numberTabletAlign,R=void 0===M?"":M,D=v.numberMobileAlign,F=void 0===D?"":D,L=v.numberLineHeight,U=void 0===L?"":L,z=v.numberTabletLineHeight,H=void 0===z?"":z,I=v.numberMobileLineHeight,W=void 0===I?"":I,V=v.numberLineHeightUnit,G=void 0===V?"em":V,q=v.numberTabletLineHeightUnit,K=void 0===q?"em":q,Y=v.numberMobileLineHeightUnit,J=void 0===Y?"em":Y,X=v.showNumber;(void 0===X||X)&&n.push({".ugb-number-box__number":_({},Object(r.K)("number%s","desktop",e.attributes,{important:!0}),{backgroundColor:s.numberBGColor?Object(r.c)(t("numberBGColor")):void 0,color:Object(r.c)(Object(r.wb)(P,s.numberBGColor&&B)),opacity:t("numberOpacity"),textIndent:"basic"===o||"plain"===o?t("numberLetterSpacing","%spx"):void 0}),desktopTablet:{".ugb-number-box__number":{height:s.numberBGColor?Object(r.c)(t("numberPadding","%sem")):void 0,width:s.numberBGColor?Object(r.c)(t("numberPadding","%sem")):void 0,lineHeight:Object(r.c)(s.numberBGColor&&""===U?t("numberPadding","%sem"):t("numberLineHeight","%s".concat(G))),marginLeft:""!==N||""!==k?Object(r.c)(Object(r.hb)(N||k)):void 0,marginRight:""!==N||""!==k?Object(r.c)(Object(r.ib)(N||k)):void 0,textAlign:Object(r.c)(s.numberBGColor?void 0:t("numberAlign")||t("contentAlign"))}},tabletOnly:{".ugb-number-box__number":_({},Object(r.K)("number%s","tablet",e.attributes,{important:!0}),{lineHeight:Object(r.c)(s.numberBGColor&&""===H?t("numberTabletPadding","%sem"):t("numberTabletLineHeight","%s".concat(K))),marginLeft:""!==R||""!==C?Object(r.c)(Object(r.hb)(R)):void 0,marginRight:""!==R||""!==C?Object(r.c)(Object(r.ib)(R)):void 0,textAlign:Object(r.c)(s.numberBGColor?void 0:t("numberTabletAlign")||t("tabletContentAlign")),height:s.numberBGColor?Object(r.c)(t("numberTabletPadding","%sem")):void 0,width:s.numberBGColor?Object(r.c)(t("numberTabletPadding","%sem")):void 0})},mobile:{".ugb-number-box__number":_({},Object(r.K)("number%s","mobile",e.attributes,{important:!0}),{height:s.numberBGColor?Object(r.c)(t("numberMobilePadding","%sem")):void 0,width:s.numberBGColor?Object(r.c)(t("numberMobilePadding","%sem")):void 0,lineHeight:Object(r.c)(s.numberBGColor&&""===W?t("numberMobilePadding","%sem"):t("numberMobileLineHeight","%s".concat(J))),marginLeft:""!==F||""!==E?Object(r.c)(Object(r.hb)(F)):void 0,marginRight:""!==F||""!==E?Object(r.c)(Object(r.ib)(F)):void 0,textAlign:Object(r.c)(s.numberBGColor?void 0:t("numberMobileAlign")||t("mobileContentAlign"))})}});var $=e.attributes,Q=$.titleColor,Z=void 0===Q?"":Q,ee=$.showTitle;(void 0===ee||ee)&&n.push({".ugb-number-box__title":_({},Object(r.K)("title%s","desktop",e.attributes),{color:Object(r.vb)(Z,s.columnBackground&&c),textAlign:t("titleAlign")}),tablet:{".ugb-number-box__title":_({},Object(r.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-number-box__title":_({},Object(r.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}});var te=e.attributes,ne=te.descriptionColor,ae=void 0===ne?"":ne,ie=te.showDescription;return(void 0===ie||ie)&&n.push({".ugb-number-box__description":_({},Object(r.K)("description%s","desktop",e.attributes),{color:Object(r.vb)(ae,s.columnBackground&&c),textAlign:t("descriptionAlign")}),tablet:{".ugb-number-box__description":_({},Object(r.K)("description%s","tablet",e.attributes),{textAlign:Object(r.c)(t("descriptionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-number-box__description":_({},Object(r.K)("description%s","mobile",e.attributes),{textAlign:Object(r.c)(t("descriptionMobileAlign")||t("mobileContentAlign"))})}}),s.numberSpacing&&n.push.apply(n,O(Object(r.F)(".ugb-number-box__number","number%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),s.titleSpacing&&n.push.apply(n,O(Object(r.F)(".ugb-number-box__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),s.descriptionSpacing&&n.push.apply(n,O(Object(r.F)(".ugb-number-box__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),y.a.all(n)},C=n(329),x=n.n(C),E=n(330),S=n.n(E),B=n(331),T=n.n(B),P=n(332),A=n.n(P),N=n(333),M=n.n(N),R=n(334),D=n.n(R),F=n(11),L=n(12),U=n(6);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 H(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=2&&wp.element.createElement(F.TextControl,{label:Object(l.sprintf)(Object(l._x)("%s %d %s","Nth Title with description",f.i18n),Object(l.__)("Number",f.i18n),2,Object(l.__)("Label",f.i18n)),value:N,onChange:function(e){return n({num2:e})}}),""!==i&&i>=3&&wp.element.createElement(F.TextControl,{label:Object(l.sprintf)(Object(l._x)("%s %d %s","Nth Title with description",f.i18n),Object(l.__)("Number",f.i18n),3,Object(l.__)("Label",f.i18n)),value:R,onChange:function(e){return n({num3:e})}}),wp.element.createElement(g.wb,{attrNameTemplate:"number%s",setAttributes:n,blockAttributes:t.attributes,fontSizeProps:{max:"basic"===p||"plain"===p?[150,7]:[500,15],min:[0,1]},placeholder:function(e){return 3*e}}),z.numberStyle&&wp.element.createElement(F.SelectControl,{label:Object(l.__)("Number Shape",f.i18n),options:[{label:Object(l.__)("None",f.i18n),value:"none"},{label:Object(l.__)("Circle",f.i18n),value:""},{label:Object(l.__)("Square",f.i18n),value:"square"}],value:B,onChange:function(e){return n({numberStyle:e})}}),z.numberBGColor&&wp.element.createElement(g.lb,{attrNameTemplate:"number%sPadding",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.c,{label:Object(l.__)("Shape Size",f.i18n),min:0,max:5,step:.1,allowReset:!0,placeholder:"2.5"})),z.numberBGColor&&wp.element.createElement(g.v,{value:u,onChange:function(e){return n({numberBGColor:e})},label:Object(l.__)("Number Background Color",f.i18n)}),z.numberColor&&wp.element.createElement(g.v,{value:o,onChange:function(e){return n({numberColor:e})},label:Object(l.__)("Number Color",f.i18n)}),wp.element.createElement(g.c,{label:Object(l.__)("Opacity",f.i18n),min:0,max:1,step:.1,value:L,onChange:function(e){return n({numberOpacity:e})},allowReset:!0,placeholder:"1.0"}),wp.element.createElement(g.lb,{attrNameTemplate:"Number%sAlign",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.f,{label:Object(l.__)("Align",f.i18n),className:"ugb--help-tip-alignment-number"}))),wp.element.createElement(g.gb,{title:Object(l.__)("Title",f.i18n),id:"title",checked:k,onChange:function(e){return n({showTitle:e})},toggleOnSetAttributes:[].concat(H(Object(r.I)("title%s")),["titleTag","titleColor"],H(Object(r.C)("Title%sAlign"))),toggleAttributeName:"showTitle"},wp.element.createElement(g.N,{value:E||"h4",onChange:function(e){return n({titleTag:e})}}),wp.element.createElement(g.wb,{attrNameTemplate:"title%s",setAttributes:n,blockAttributes:t.attributes,htmlTag:E||"h4"}),wp.element.createElement(g.v,{value:c,onChange:function(e){return n({titleColor:e})},label:Object(l.__)("Title Color",f.i18n)}),wp.element.createElement(g.lb,{attrNameTemplate:"Title%sAlign",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.f,{label:Object(l.__)("Align",f.i18n),className:"ugb--help-tip-alignment-title"}))),wp.element.createElement(g.gb,{title:Object(l.__)("Description",f.i18n),id:"description",checked:C,onChange:function(e){return n({showDescription:e})},toggleOnSetAttributes:[].concat(H(Object(r.I)("description%s")),["descriptionColor"],H(Object(r.C)("description%sAlign"))),toggleAttributeName:"showDescription"},wp.element.createElement(g.wb,{attrNameTemplate:"description%s",setAttributes:n,blockAttributes:t.attributes}),wp.element.createElement(g.v,{value:s,onChange:function(e){return n({descriptionColor:e})},label:Object(l.__)("Description Color",f.i18n)}),wp.element.createElement(g.lb,{attrNameTemplate:"description%sAlign",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(g.f,{label:Object(l.__)("Align",f.i18n),className:"ugb--help-tip-alignment-description"}))))});var I=Object(L.compose)(d.i,d.g,d.d,Object(d.h)(),Object(d.c)(["Number%sAlign","Title%sAlign","Description%sAlign"]),Object(d.a)(j,{editorMode:!0}),Object(d.b)([[".ugb-number-box__item","column-background"],[".ugb-number-box__number","number"],[".ugb-number-box__title","title"],[".ugb-number-box__description","description"]]))(function(e){var t,n=e.className,a=e.setAttributes,i=e.attributes,c=e.attributes,b=c.columns,p=c.design,m=void 0===p?"basic":p,d=c.titleTag,v=void 0===d?"":d,y=c.shadow,O=void 0===y?"":y,w=c.showNumber,_=void 0===w||w,k=c.showTitle,j=void 0===k||k,C=c.showDescription,x=void 0===C||C,E=c.numberStyle,S=void 0===E?"":E,B=s()([n,"ugb-number-box--v3","ugb-number-box--columns-".concat(b)],Object(o.applyFilters)("stackable.number-box.mainclasses",(z(t={},"ugb-number-box--design-".concat(m),"basic"!==m),z(t,"ugb-number-box--number-style-".concat(S),""!==S&&("basic"===m||"plain"===m)),t),m,e)),T=h(e);return wp.element.createElement(g.k.Edit,{className:B,blockProps:e,render:function(){return wp.element.createElement(U.Fragment,null,Object(r.nb)(1,b+1).map(function(t){var n=i["num".concat(t)],c=i["title".concat(t)],b=i["description".concat(t)],p=s()(["ugb-number-box__item","ugb-number-box__item".concat(t)],Object(o.applyFilters)("stackable.number-box.boxclasses",z({},"ugb--shadow-".concat(O),"plain"!==m&&""!==O),m,e));return wp.element.createElement(g.H,{className:p,backgroundAttrName:"column%s",blockProps:e,showBackground:T.columnBackground,key:t},_&&wp.element.createElement(u.RichText,{tagName:"div",className:"ugb-number-box__number",value:n,onChange:function(e){return a(z({},"num".concat(t),e))}}),(j||x)&&wp.element.createElement("div",{className:"ugb-number-box__content"},j&&wp.element.createElement(u.RichText,{tagName:v||"h4",value:c,className:"ugb-number-box__title",onChange:function(e){return a(z({},"title".concat(t),e))},placeholder:Object(l.__)("Title",f.i18n),keepPlaceholderOnFocus:!0}),x&&wp.element.createElement(u.RichText,{tagName:"p",value:b,className:"ugb-number-box__description",onChange:function(e){return a(z({},"description".concat(t),e))},placeholder:Object(r.M)(),keepPlaceholderOnFocus:!0})))}))}})});function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V=Object(L.compose)(d.i,Object(d.a)(j))(function(e){var t,n=e.className,a=e.attributes,r=a.columns,l=void 0===r?2:r,c=a.design,b=void 0===c?"basic":c,p=a.titleTag,m=void 0===p?"":p,d=a.shadow,f=void 0===d?"":d,v=a.numberStyle,y=void 0===v?"":v,O=a.showNumber,w=void 0===O||O,_=a.showTitle,k=void 0===_||_,j=a.showDescription,C=void 0===j||j,x=s()([n,"ugb-number-box--v3","ugb-number-box--columns-".concat(l)],Object(o.applyFilters)("stackable.number-box.mainclasses",(W(t={},"ugb-number-box--design-".concat(b),"basic"!==b),W(t,"ugb-number-box--number-style-".concat(y),""!==y&&("basic"===b||"plain"===b)),t),b,e)),E=h(e);return wp.element.createElement(g.k.Save,{className:x,blockProps:e,render:function(){return wp.element.createElement(U.Fragment,null,Object(i.range)(1,l+1).map(function(t){var n=a["num".concat(t)],i=a["title".concat(t)],r=a["description".concat(t)],l=s()(["ugb-number-box__item","ugb-number-box__item".concat(t)],Object(o.applyFilters)("stackable.number-box.boxclasses",W({},"ugb--shadow-".concat(f),"plain"!==b&&""!==f),b,e));return wp.element.createElement(g.H,{className:l,backgroundAttrName:"column%s",blockProps:e,showBackground:E.columnBackground,key:t},w&&!u.RichText.isEmpty(n)&&wp.element.createElement(u.RichText.Content,{tagName:"span",className:"ugb-number-box__number",value:n}),(k||C)&&(!u.RichText.isEmpty(i)||!u.RichText.isEmpty(r))&&wp.element.createElement("div",{className:"ugb-number-box__content"},k&&!u.RichText.isEmpty(i)&&wp.element.createElement(u.RichText.Content,{tagName:m||"h4",className:"ugb-number-box__title",value:i}),C&&!u.RichText.isEmpty(r)&&wp.element.createElement(u.RichText.Content,{tagName:"p",className:"ugb-number-box__description",value:r})))}))}})});function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image1Alt","image2Alt","image3Alt","button1Url","button1NewTab","button1NoFollow","button2Url","button2NewTab","button2NoFollow","button3Url","button3NewTab","button3NoFollow"])))});var s=n(21),u=n(2),b=n(8),p=n.n(b),m=n(19),g=n.n(m),d=n(1),f=n(0),h=n(6),v=n(9);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={pricingBoxColor:{type:"string"},priceColor:{type:"string"},perMonthLabelColor:{type:"string"},buttonColor:{type:"string"},buttonTextColor:{type:"string"},buttonDesign:{type:"string",default:"basic"},buttonIcon:{type:"string"},featureListColor:{type:"string"},columns:{type:"number",default:2},size:{type:"string",default:"normal"},cornerButtonRadius:{type:"number",default:4},design:{type:"string",default:"basic"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},hoverEffect:{type:"string",default:""},align:{type:"string"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}};[1,2,3].forEach(function(e){var t=1===e?"":e;w["url".concat(t)]={type:"string",source:"attribute",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-button"),attribute:"href",default:""},w["newTab".concat(t)]={type:"boolean",source:"attribute",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-button"),attribute:"target",default:!1},w["imageURL".concat(t)]={type:"string"},w["imageID".concat(t)]={type:"string"},w["imageAlt".concat(t)]={type:"string"},w["highlightColor".concat(t)]={type:"string",default:""},w["pricingBoxTitle".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__title"),default:Object(f.__)("Title",d.i18n)},w["price".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__price"),default:"".concat(t,"9")},w["pricePrefix".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__price-prefix"),default:"$"},w["priceSuffix".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__price-suffix"),default:".00"},w["perMonthLabel".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__subprice"),default:Object(f.__)("Description",d.i18n)},w["buttonText".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-button span"),default:Object(f.__)("Button text",d.i18n)},w["featureList".concat(t)]={source:"html",selector:".ugb-pricing-box__item:nth-of-type(".concat(e,") .ugb-pricing-box__description"),default:Object(u.M)("medium")}});var _=[{attributes:w,save:function(e){var t=e.className,n=e.attributes,a=n.pricingBoxColor,o=n.priceColor,r=n.perMonthLabelColor,l=n.buttonColor,c=n.buttonTextColor,b=n.buttonDesign,m=n.buttonIcon,d=n.featureListColor,f=n.columns,y=void 0===f?2:f,w=n.size,_=n.cornerButtonRadius,k=n.design,j=void 0===k?"basic":k,C=n.borderRadius,x=void 0===C?12:C,E=n.shadow,S=void 0===E?3:E,B=p()([t,"ugb-pricing-box","ugb-pricing-box--v2","ugb-pricing-box--columns-".concat(y),"ugb-pricing-box--design-".concat(j)],Object(i.applyFilters)("stackable.pricing-box.mainclasses_1_17_3",{},j,e));return wp.element.createElement("div",{className:B},Object(i.applyFilters)("stackable.pricing-box.save.output.before_1_17_3",null,j,e),Object(u.nb)(1,y+1).map(function(t){var f,y,k,C,E,B,T,P,A=1===t?"":t,N=n["pricingBoxTitle".concat(A)],M=n["price".concat(A)],R=n["pricePrefix".concat(A)],D=n["priceSuffix".concat(A)],F=n["perMonthLabel".concat(A)],L=n["url".concat(A)],U=n["newTab".concat(A)],z=n["buttonText".concat(A)],H=n["featureList".concat(A)],I=n["imageURL".concat(A)],W=n["imageAlt".concat(A)],V=n["highlightColor".concat(A)]||"",G=p()(["ugb-pricing-box__item"],Object(i.applyFilters)("stackable.pricing-box.itemclasses_1_17_3",(O(f={},"ugb--shadow-".concat(S),"plain"!==j&&3!==S),O(f,"ugb-pricing-box--highlighted","plain"!==j&&V),O(f,"ugb-pricing-box--is-dark",!("plain"===j||!V)&&Object(u.bb)(V)),f),j,t,e)),q=Object(i.applyFilters)("stackable.pricing-box.styles_1_17_3",{item:{borderRadius:"plain"!==j&&12!==x?x:void 0,backgroundColor:"plain"!==j&&V?V:void 0},title:{color:a},price:{color:o},month:{color:r},description:{color:d}},j,t,e);return wp.element.createElement("div",{className:G,style:q.item,key:t},(y=I&&wp.element.createElement("div",{className:"ugb-pricing-box__image"},wp.element.createElement("img",{src:I,alt:g()(N||W)})),k=I&&wp.element.createElement("div",{className:"ugb-pricing-box__image-bg",style:{backgroundImage:"url(".concat(I,")")}}),C=!v.RichText.isEmpty(N)&&wp.element.createElement(v.RichText.Content,{tagName:"h3",className:"ugb-pricing-box__title",style:q.title,value:N}),E=(!v.RichText.isEmpty(M)||!v.RichText.isEmpty(F))&&wp.element.createElement("div",{className:"ugb-pricing-box__price-wrapper"},!v.RichText.isEmpty(M)&&wp.element.createElement("div",{className:"ugb-pricing-box__price-line"},!v.RichText.isEmpty(R)&&wp.element.createElement(v.RichText.Content,{tagName:"span",className:"ugb-pricing-box__price-prefix",style:q.price,value:R}),wp.element.createElement(v.RichText.Content,{tagName:"span",className:"ugb-pricing-box__price",style:q.price,value:M}),!v.RichText.isEmpty(D)&&wp.element.createElement(v.RichText.Content,{tagName:"span",className:"ugb-pricing-box__price-suffix",style:q.price,value:D})),!v.RichText.isEmpty(F)&&wp.element.createElement(v.RichText.Content,{tagName:"p",className:"ugb-pricing-box__subprice",style:q.month,value:F})),B=z&&!!z.length&&wp.element.createElement("div",{className:"ugb-pricing-box__button"},wp.element.createElement(s.b,{size:w,url:L,newTab:U,color:c,text:z,design:b,icon:m,backgroundColor:l,borderRadius:_})),T=!v.RichText.isEmpty(H)&&wp.element.createElement(v.RichText.Content,{tagName:"p",className:"ugb-pricing-box__description",style:q.description,value:H}),P={imageComp:y,imageBGComp:k,titleComp:C,priceComp:E,buttonComp:B,descriptionComp:T},Object(i.applyFilters)("stackable.pricing-box.save.output_1_17_3",wp.element.createElement(h.Fragment,null,y,C,E,B,T),j,P,t,e)))}),Object(i.applyFilters)("stackable.pricing-box.save.output.after_1_17_3",null,j,e))},migrate:function(e){var t=e.design,n=void 0===t?"basic":t;return function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(j)),paddingBottom:t("columnPaddingBottom","%s".concat(j)),paddingRight:t("columnPaddingRight","%s".concat(j)),paddingLeft:t("columnPaddingLeft","%s".concat(j))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(x)),paddingRight:t("tabletColumnPaddingRight","%s".concat(x)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(x)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(x))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(S)),paddingRight:t("mobileColumnPaddingRight","%s".concat(S)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(S)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(S))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-pricing-box__item":Object(u.d)({paddingTop:t("columnPaddingTop","%s".concat(j)),paddingBottom:t("columnPaddingBottom","%s".concat(j)),paddingRight:t("columnPaddingRight","%s".concat(j)),paddingLeft:t("columnPaddingLeft","%s".concat(j))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-pricing-box__item":Object(u.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(x)),paddingRight:t("tabletColumnPaddingRight","%s".concat(x)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(x)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(x))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-pricing-box__item":Object(u.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(S)),paddingRight:t("mobileColumnPaddingRight","%s".concat(S)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(S)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(S))})}}}),l&&(w.push(L({},Object(u.B)("image%s","ugb-img",e.attributes,{inherit:!1}))),w.push({".ugb-img, .ugb-pricing-box__image":{marginLeft:""!==s||""!==p?Object(u.hb)(s||p)+" !important":void 0,marginRight:""!==s||""!==p?Object(u.ib)(s||p)+" !important":void 0},tablet:{".ugb-img, .ugb-pricing-box__image":{marginLeft:""!==g||""!==f?Object(u.hb)(g||f)+" !important":void 0,marginRight:""!==g||""!==f?Object(u.ib)(g||f)+" !important":void 0}},mobile:{".ugb-img, .ugb-pricing-box__image":{marginLeft:""!==v||""!==O?Object(u.hb)(v||O)+" !important":void 0,marginRight:""!==v||""!==O?Object(u.ib)(v||O)+" !important":void 0}}}));var B=e.attributes,T=B.titleColor,P=void 0===T?"":T,A=B.showTitle;(void 0===A||A)&&(w.push({".ugb-pricing-box__title":{color:Object(u.vb)(P,n.columnBackground&&o)}}),w.push({".ugb-pricing-box__title":L({},Object(u.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-pricing-box__title":L({},Object(u.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-pricing-box__title":L({},Object(u.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}}));var M=e.attributes,F=M.priceColor,U=void 0===F?"":F,z=M.showPrice,H=void 0===z||z;if(H){w.push({".ugb-pricing-box__price, .ugb-pricing-box__price-prefix, .ugb-pricing-box__price-suffix":{color:Object(u.vb)(U,n.columnBackground&&o)}});var I=t("priceAlign")||t("contentAlign"),W=t("priceTabletAlign")||t("tabletContentAlign"),V=t("priceMobileAlign")||t("mobileContentAlign");w.push({".ugb-pricing-box__price-line":L({},Object(u.K)("price%s","desktop",e.attributes),{justifyContent:Object(u.c)("center"===I?"center":"left"===I?"flex-start":"right"===I?"flex-end":void 0)}),tablet:{".ugb-pricing-box__price-line":L({},Object(u.K)("price%s","tablet",e.attributes),{justifyContent:Object(u.c)("center"===W?"center":"left"===W?"flex-start":"right"===W?"flex-end":void 0)})},mobile:{".ugb-pricing-box__price-line":L({},Object(u.K)("price%s","mobile",e.attributes),{justifyContent:Object(u.c)("center"===V?"center":"left"===V?"flex-start":"right"===V?"flex-end":void 0)})}})}var G=e.attributes,q=G.pricePrefixColor,K=void 0===q?"":q,Y=G.showPricePrefix;H&&(void 0===Y||Y)&&w.push({".ugb-pricing-box__price-prefix":L({color:K||void 0},Object(u.K)("pricePrefix%s","desktop",e.attributes,{important:!0})),tablet:{".ugb-pricing-box__price-prefix":L({},Object(u.K)("pricePrefix%s","tablet",e.attributes,{important:!0}))},mobile:{".ugb-pricing-box__price-prefix":L({},Object(u.K)("pricePrefix%s","mobile",e.attributes,{important:!0}))}});var J=e.attributes,X=J.priceSuffixColor,$=void 0===X?"":X,Q=J.showPriceSuffix;H&&(void 0===Q||Q)&&w.push({".ugb-pricing-box__price-suffix":L({color:$||void 0},Object(u.K)("priceSuffix%s","desktop",e.attributes,{important:!0})),tablet:{".ugb-pricing-box__price-suffix":L({},Object(u.K)("priceSuffix%s","tablet",e.attributes,{important:!0}))},mobile:{".ugb-pricing-box__price-suffix":L({},Object(u.K)("priceSuffix%s","mobile",e.attributes,{important:!0}))}});var Z=e.attributes,ee=Z.subPriceColor,te=void 0===ee?"":ee,ne=Z.showSubPrice;(void 0===ne||ne)&&(w.push({".ugb-pricing-box__subprice":{color:Object(u.c)(Object(u.vb)(te,n.columnBackground&&o))}}),w.push({".ugb-pricing-box__subprice":L({},Object(u.K)("subPrice%s","desktop",e.attributes,{important:!0}),{textAlign:t("subPriceAlign")||t("contentAlign")}),tablet:{".ugb-pricing-box__subprice":L({},Object(u.K)("subPrice%s","tablet",e.attributes,{important:!0}),{textAlign:t("subPriceTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-pricing-box__subprice":L({},Object(u.K)("subPrice%s","mobile",e.attributes,{important:!0}),{textAlign:t("subPriceMobileAlign")||t("mobileContentAlign")})}}));var ae=e.attributes.showButton;(void 0===ae||ae)&&(w.push(L({},Object(u.s)("button%s","ugb-button",e.attributes))),w.push({".ugb-button-container":{textAlign:Object(u.c)(t("buttonAlign")||t("contentAlign"))},tablet:{".ugb-button-container":{textAlign:Object(u.c)(t("buttonTabletAlign")||t("tabletContentAlign"))}},mobile:{".ugb-button-container":{textAlign:Object(u.c)(t("buttonMobileAlign")||t("mobileContentAlign"))}}}));var ie=e.attributes,oe=ie.descriptionColor,re=void 0===oe?"":oe,le=ie.showDescription;return(void 0===le||le)&&w.push({".ugb-pricing-box__description":L({},Object(u.K)("description%s","desktop",e.attributes),{color:Object(u.vb)(re,n.columnBackground&&o),textAlign:Object(u.c)(t("descriptionAlign")||t("contentAlign"))}),tablet:{".ugb-pricing-box__description":L({},Object(u.K)("description%s","tablet",e.attributes),{textAlign:Object(u.c)(t("descriptionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-pricing-box__description":L({},Object(u.K)("description%s","mobile",e.attributes),{textAlign:Object(u.c)(t("descriptionMobileAlign")||t("mobileContentAlign"))})}}),n.imageSpacing&&w.push.apply(w,D(Object(u.F)(".ugb-pricing-box__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.titleSpacing&&w.push.apply(w,D(Object(u.F)(".ugb-pricing-box__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.priceSpacing&&w.push.apply(w,D(Object(u.F)(".ugb-pricing-box__price-wrapper","price%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.subPriceSpacing&&w.push.apply(w,D(Object(u.F)(".ugb-pricing-box__subprice","subPrice%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.buttonSpacing&&w.push.apply(w,D(Object(u.F)(".ugb-pricing-box__button","button%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&w.push.apply(w,D(Object(u.F)(".ugb-pricing-box__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),R.a.all(w)},H=n(3),I=n(10),W=n(12),V=n(13);function G(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)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image1Alt","image2Alt","image3Alt","showEmail","showFacebook","showImage","showInstagram","showLinkedin","showPinterest","showTwitter","showYoutube","social1FacebookUrl","social1TwitterUrl","social1InstagramUrl","social1PinterestUrl","social1LinkedinUrl","social1YoutubeUrl","social1EmailUrl","social2FacebookUrl","social2TwitterUrl","social2InstagramUrl","social2PinterestUrl","social2LinkedinUrl","social2YoutubeUrl","social2EmailUrl","social3FacebookUrl","social3TwitterUrl","social3InstagramUrl","social3PinterestUrl","social3LinkedinUrl","social3YoutubeUrl","social3EmailUrl"])))});var s=n(2),u=n(8),b=n.n(u),p=n(1),m=n(0),g=n(9),d=n(6);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=[{attributes:{href1:{type:"url"},href2:{type:"url"},href3:{type:"url"},mediaID1:{type:"number"},mediaID2:{type:"number"},mediaID3:{type:"number"},mediaURL1:{type:"string",source:"attribute",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__image",attribute:"data-src",default:""},mediaURL2:{type:"string",source:"attribute",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__image",attribute:"data-src",default:""},mediaURL3:{type:"string",source:"attribute",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__image",attribute:"data-src",default:""},name1:{source:"html",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__name",default:Object(m.__)("Name",p.i18n)},name2:{source:"html",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__name",default:Object(m.__)("Name",p.i18n)},name3:{source:"html",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__name",default:Object(m.__)("Name",p.i18n)},position1:{source:"html",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__position",default:Object(m.__)("Position",p.i18n)},position2:{source:"html",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__position",default:Object(m.__)("Position",p.i18n)},position3:{source:"html",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__position",default:Object(m.__)("Position",p.i18n)},description1:{source:"html",selector:".ugb-team-member__item:nth-of-type(1) .ugb-team-member__description",default:Object(s.M)("medium")},description2:{source:"html",selector:".ugb-team-member__item:nth-of-type(2) .ugb-team-member__description",default:Object(s.M)("medium")},description3:{source:"html",selector:".ugb-team-member__item:nth-of-type(3) .ugb-team-member__description",default:Object(s.M)("medium")},nameColor:{type:"string"},posColor:{type:"string"},desColor:{type:"string"},columns:{type:"number",default:2},shapes:{type:"string",default:"circle"},design:{type:"string",default:"basic"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},colorOnHover:{type:"boolean",default:!1},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""},href:{type:"url"},hrefTwo:{type:"url"},hrefThree:{type:"url"},mediaID:{type:"number"},mediaIDTwo:{type:"number"},mediaIDThree:{type:"number"},mediaURL:{type:"string"},mediaURLTwo:{type:"string"},mediaURLThree:{type:"string"},name:{type:"string"},nameTwo:{type:"string"},nameThree:{type:"string"},position:{type:"string"},positionTwo:{type:"string"},positionThree:{type:"string"},des:{type:"string"},desTwo:{type:"string"},desThree:{type:"string"},iconColor:{type:"string"},align:{type:"string"}},save:function(e){var t=e.className,n=e.attributes,a=e.attributes,o=a.shapes,r=a.nameColor,l=a.posColor,c=a.desColor,u=a.columns,p=void 0===u?2:u,m=a.design,f=void 0===m?"basic":m,v=a.borderRadius,y=void 0===v?12:v,O=a.shadow,w=void 0===O?3:O,_=b()([t,"ugb-team-member","ugb-team-member--v2","ugb-team-member--columns-".concat(p),"ugb-team-member--image-".concat(o),"ugb-team-member--design-".concat(f)],Object(i.applyFilters)("stackable.team-member.mainclasses_1_17_3",{},f,e));return wp.element.createElement("div",{className:_},Object(i.applyFilters)("stackable.team-member.save.output.before_1_17_3",null,f,e),Object(s.nb)(1,p+1).map(function(t){var a=n["mediaURL".concat(t)],o=n["name".concat(t)],s=n["position".concat(t)],u=n["description".concat(t)],p=b()(["ugb-team-member__item"],Object(i.applyFilters)("stackable.team-member.itemclasses_1_17_3",h({},"ugb--shadow-".concat(w),"plain"!==f&&3!==w),f,t,e)),m=Object(i.applyFilters)("stackable.team-member.itemstyles_1_17_3",{item:{borderRadius:"plain"!==f&&12!==y?y:void 0}},f,t,e),v=a&&wp.element.createElement("div",{className:"ugb-team-member__image",style:{backgroundImage:a?"url(".concat(a,")"):void 0},"data-src":a||void 0}),O=!g.RichText.isEmpty(o)&&wp.element.createElement(g.RichText.Content,{tagName:"h4",className:"ugb-team-member__name",style:{color:r},value:o}),_=!g.RichText.isEmpty(s)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-team-member__position",style:{color:l},value:s}),k=!g.RichText.isEmpty(u)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-team-member__description",style:{color:c},value:u}),j={imageComp:v,nameComp:O,positionComp:_,descriptionComp:k};return wp.element.createElement("div",{className:p,style:m.item,key:t},Object(i.applyFilters)("stackable.team-member.save.output_1_17_3",wp.element.createElement(d.Fragment,null,v,wp.element.createElement("div",{className:"ugb-team-member__content"},O,_,k)),f,j,t,e))}),Object(i.applyFilters)("stackable.team-member.save.output.after",null,f,e))},migrate:function(e){var t;return!e.design||["basic","plain"].includes(e.design)?t=1===e.columns?300:3===e.columns?150:220:"horizontal"===e.design&&(t=1===e.columns?150:3===e.columns?80:110),function(e){for(var t=1;t .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(k)),paddingRight:t("mobileColumnPaddingRight","%s".concat(k)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(k)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(k))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-team-member__item":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(y)),paddingBottom:t("columnPaddingBottom","%s".concat(y)),paddingRight:t("columnPaddingRight","%s".concat(y)),paddingLeft:t("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-team-member__item":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(w)),paddingRight:t("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-team-member__item":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(k)),paddingRight:t("mobileColumnPaddingRight","%s".concat(k)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(k)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(k))})}}});var j=e.attributes,C=j.imageAlign,x=void 0===C?"":C,E=j.imageTabletAlign,S=void 0===E?"":E,B=j.tabletContentAlign,T=void 0===B?"":B,A=j.imageMobileAlign,R=void 0===A?"":A,L=j.mobileContentAlign,U=void 0===L?"":L;!n.imageAsBackground&&p?(d.push(D({},Object(s.B)("image%s","ugb-img",e.attributes,{inherit:!1}))),d.push.apply(d,M(Object(s.F)(".ugb-team-member__image","image%sWidth","width","%spx",e.attributes,{important:!0,inherit:!1}))),d.push({".ugb-img, .ugb-team-member__image":{marginLeft:""!==x||""!==g?Object(s.hb)(x||g)+" !important":void 0,marginRight:""!==x||""!==g?Object(s.ib)(x||g)+" !important":void 0},tablet:{".ugb-img, .ugb-team-member__image":{marginLeft:""!==S||""!==T?Object(s.hb)(S||T)+" !important":void 0,marginRight:""!==S||""!==T?Object(s.ib)(S||T)+" !important":void 0}},mobile:{".ugb-img, .ugb-team-member__image":{marginLeft:""!==R||""!==U?Object(s.hb)(R||U)+" !important":void 0,marginRight:""!==R||""!==U?Object(s.ib)(R||U)+" !important":void 0}}})):p&&(d.push(D({},Object(s.z)("image%s","ugb-team-member__image",e.attributes))),Object(a.range)(1,l+1).forEach(function(e){d.push(F({},".ugb-team-member__item.ugb-team-member__item".concat(e," .ugb-team-member__image"),{backgroundImage:t("image".concat(e,"Url"),"url(%s)")}))}));var z=e.attributes,H=z.nameColor,I=void 0===H?"":H,W=z.showName;(void 0===W||W)&&(d.push({".ugb-team-member__name":{color:Object(s.c)(Object(s.wb)(I,n.columnBackground&&u))}}),d.push({".ugb-team-member__name":D({},Object(s.K)("name%s","desktop",e.attributes),{textAlign:Object(s.c)(t("nameAlign")||t("contentAlign"))}),tablet:{".ugb-team-member__name":D({},Object(s.K)("name%s","tablet",e.attributes),{textAlign:Object(s.c)(t("nameTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-team-member__name":D({},Object(s.K)("name%s","mobile",e.attributes),{textAlign:Object(s.c)(t("nameMobileAlign")||t("mobileContentAlign"))})}}));var V=e.attributes,G=V.positionColor,q=void 0===G?"":G,K=V.showPosition;(void 0===K||K)&&(d.push({".ugb-team-member__position":{color:Object(s.c)(Object(s.wb)(q,n.columnBackground&&u))}}),d.push({".ugb-team-member__position":D({},Object(s.K)("position%s","desktop",e.attributes),{textAlign:Object(s.c)(t("positionAlign")||t("contentAlign"))}),tablet:{".ugb-team-member__position":D({},Object(s.K)("position%s","tablet",e.attributes),{textAlign:Object(s.c)(t("positionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-team-member__position":D({},Object(s.K)("position%s","mobile",e.attributes),{textAlign:Object(s.c)(t("positionMobileAlign")||t("mobileContentAlign"))})}}));var Y=e.attributes,J=Y.descriptionColor,X=void 0===J?"":J,$=Y.showDescription;(void 0===$||$)&&(d.push({".ugb-team-member__description":{color:Object(s.wb)(X,n.columnBackground&&u)}}),d.push({".ugb-team-member__description":D({},Object(s.K)("description%s","desktop",e.attributes),{textAlign:Object(s.c)(t("descriptionAlign")||t("contentAlign"))}),tablet:{".ugb-team-member__description":D({},Object(s.K)("description%s","tablet",e.attributes),{textAlign:Object(s.c)(t("descriptionTabletAlign")||t("tabletContentAlign"))})},mobile:{".ugb-team-member__description":D({},Object(s.K)("description%s","mobile",e.attributes),{textAlign:Object(s.c)(t("descriptionMobileAlign")||t("mobileContentAlign"))})}}));var Q=e.attributes,Z=Q.showSocial,ee=void 0===Z||Z,te=Q.socialDesign,ne=void 0===te?"":te;return ee&&(d.push(D({},Object(s.H)("social%s","ugb-button",D({},e.attributes,{buttonDesign:ne})))),d.push({".ugb-team-member__buttons":{textAlign:Object(s.c)(t("socialAlign")||t("contentAlign"))},tablet:{".ugb-team-member__buttons":{textAlign:Object(s.c)(t("socialTabletAlign")||t("tabletContentAlign"))}},mobile:{".ugb-team-member__buttons":{textAlign:Object(s.c)(t("socialMobileAlign")||t("mobileContentAlign"))}}})),n.imageSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.nameSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__name","name%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.positionSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__position","position%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.descriptionSpacing&&d.push.apply(d,M(Object(s.F)(".ugb-team-member__description","description%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.socialSpacing&&(d.push.apply(d,M(Object(s.F)(".ugb-button-container","social%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),d.push.apply(d,M(Object(s.F)(".ugb-button","social%sGap","marginLeft","%spx",e.attributes,{important:!0}))),d.push.apply(d,M(Object(s.F)(".ugb-button","social%sGap","marginRight","%spx",e.attributes,{important:!0})))),p&&Object(a.range)(1,l+1).forEach(function(t){e.attributes["image".concat(t,"Shape")]&&d.push(F({},".ugb-team-member__item".concat(t," .ugb-img"),Object(s.A)("image".concat(t,"%s"),e.attributes)))}),N.a.all(d)},U=L,z=n(11),H=n(12),I=n(13);function W(){return(W=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return l({},Object(a.omit)(e,["image1Id"].concat(o(t&&t.image1Id?["image1Url"]:[]),["image2Id"],o(t&&t.image2Id?["image2Url"]:[]),["image3Id"],o(t&&t.image3Id?["image3Url"]:[]),["image1Alt","image2Alt","image3Alt"])))});var s=n(2),u=n(8),b=n.n(u),p=n(1),m=n(0),g=n(9);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=[{attributes:{mediaID1:{type:"number"},mediaID2:{type:"number"},mediaID3:{type:"number"},mediaURL1:{type:"string"},mediaURL2:{type:"string"},mediaURL3:{type:"string"},name1:{source:"html",selector:".ugb-testimonial__item:nth-of-type(1) .ugb-testimonial__name",default:Object(m.__)("Name",p.i18n)},name2:{source:"html",selector:".ugb-testimonial__item:nth-of-type(2) .ugb-testimonial__name",default:Object(m.__)("Name",p.i18n)},name3:{source:"html",selector:".ugb-testimonial__item:nth-of-type(3) .ugb-testimonial__name",default:Object(m.__)("Name",p.i18n)},position1:{source:"html",selector:".ugb-testimonial__item:nth-of-type(1) .ugb-testimonial__position",default:Object(m.__)("Position",p.i18n)},position2:{source:"html",selector:".ugb-testimonial__item:nth-of-type(2) .ugb-testimonial__position",default:Object(m.__)("Position",p.i18n)},position3:{source:"html",selector:".ugb-testimonial__item:nth-of-type(3) .ugb-testimonial__position",default:Object(m.__)("Position",p.i18n)},testimonial1:{source:"html",selector:".ugb-testimonial__item:nth-of-type(1) .ugb-testimonial__body",default:Object(s.M)("medium")},testimonial2:{source:"html",selector:".ugb-testimonial__item:nth-of-type(2) .ugb-testimonial__body",default:Object(s.M)("medium")},testimonial3:{source:"html",selector:".ugb-testimonial__item:nth-of-type(3) .ugb-testimonial__body",default:Object(s.M)("medium")},titleColor:{type:"string"},posColor:{type:"string"},bodyTextColor:{type:"string"},backgroundColor:{type:"string",default:""},serif:{type:"boolean",default:!1},columns:{type:"number",default:2},design:{type:"string",default:"basic"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""},href:{type:"url"},hrefTwo:{type:"url"},hrefThree:{type:"url"},mediaID:{type:"number"},mediaIDTwo:{type:"number"},mediaIDThree:{type:"number"},mediaURL:{type:"string"},mediaURLTwo:{type:"string"},mediaURLThree:{type:"string"},testimonialTitle:{type:"string"},testimonialTitleTwo:{type:"string"},testimonialTitleThree:{type:"string"},position:{type:"string"},positionTwo:{type:"string"},positionThree:{type:"string"},body:{type:"string"},bodyTwo:{type:"string"},bodyThree:{type:"string"},iconColor:{type:"string"},align:{type:"string"}},save:function(e){var t=e.className,n=e.attributes,a=n.columns,o=n.titleColor,r=n.posColor,l=n.bodyTextColor,c=n.design,u=void 0===c?"basic":c,p=n.borderRadius,m=void 0===p?12:p,d=n.backgroundColor,h=void 0===d?"":d,v=n.shadow,y=void 0===v?3:v,O=n.serif,w=void 0!==O&&O,_=b()([t,"ugb-testimonial","ugb-testimonial--v2","ugb-testimonial--columns-".concat(a),"ugb-testimonial--design-".concat(u)],Object(i.applyFilters)("stackable.testimonial.mainclasses_1_17_3",{"ugb-testimonial--serif":w},u,e)),k=b()(["ugb-testimonial__item"],Object(i.applyFilters)("stackable.testimonial.itemclasses_1_17_3",f({},"ugb--shadow-".concat(y),"plain"!==u&&3!==y),u,e)),j=Object(i.applyFilters)("stackable.testimonial.styles_1_17_3",{item:{borderRadius:"plain"!==u&&12!==m?m:void 0,backgroundColor:"plain"!==u&&h?h:void 0},bodyWrapper:{},body:{color:l||void 0}},u,e);return wp.element.createElement("div",{className:_},Object(i.applyFilters)("stackable.testimonial.save.output.before_1_17_3",null,u,e),Object(s.nb)(1,a+1).map(function(t){var a=n["mediaURL".concat(t)],l=n["name".concat(t)],c=n["position".concat(t)],s=n["testimonial".concat(t)],p=b()(["ugb-testimonial__body-wrapper"],Object(i.applyFilters)("stackable.testimonial.bodyclasses_1_17_3",{},u,e));return wp.element.createElement("div",{className:k,style:j.item,key:t},wp.element.createElement("div",{className:p,style:j.bodyWrapper},!g.RichText.isEmpty(s)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-testimonial__body",style:j.body,value:s})),wp.element.createElement("div",{className:"ugb-testimonial__person"},a&&wp.element.createElement("div",{className:"ugb-testimonial__image",style:{backgroundImage:"url(".concat(a,")")}}),!g.RichText.isEmpty(l)&&wp.element.createElement(g.RichText.Content,{tagName:"h4",className:"ugb-testimonial__name",style:{color:o},value:l}),!g.RichText.isEmpty(c)&&wp.element.createElement(g.RichText.Content,{tagName:"p",className:"ugb-testimonial__position",style:{color:r},value:c})))}),Object(i.applyFilters)("stackable.testimonial.save.output.after_1_17_3",null,u,e))},migrate:function(e){var t=["","basic","plain","basic2","bubble"].includes(e.design)?75:void 0;return function(e){for(var t=1;t".concat(e.testimonial1,""):e.testimonial1,testimonial2:e.serif?"".concat(e.testimonial2,""):e.testimonial2,testimonial3:e.serif?"".concat(e.testimonial3,""):e.testimonial3,shadow:"basic2"===e.design?void 0:e.shadow,bubbleBackgroundColor:"bubble"===e.design?e.backgroundColor:void 0,imageWidth:t,imageSquare:!!t||void 0})}}],v=n(344),y=n.n(v),O=n(345),w=n.n(O),_=n(346),k=n.n(_),j=n(347),C=n.n(j),x=n(348),E=n.n(x),S=n(349),B=n.n(S),T=n(350),P=n.n(T),A=function(e){var t=e.attributes,n=t.design,a=void 0===n?"basic":n,o=t.showTestimonial,r=void 0===o||o,l=t.showImage,c=void 0===l||l,s=t.showName,u=void 0===s||s,b=t.showPosition,p=void 0===b||b;return Object(i.applyFilters)("stackable.testimonial.show",{columnBackground:"plain"!==a,borderRadius:"plain"!==a,border:"plain"!==a&&"bubble"!==a,shadow:"plain"!==a,imageAsBackground:!1,testimonialSpacing:r,imageSpacing:c&&!["background","vertical","vertical-inverse"].includes(a),nameSpacing:u,positionSpacing:p},e)},N=n(14),M=n.n(N);function R(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(B)),paddingBottom:t("columnPaddingBottom","%s".concat(B)),paddingRight:t("columnPaddingRight","%s".concat(B)),paddingLeft:t("columnPaddingLeft","%s".concat(B))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(P)),paddingRight:t("tabletColumnPaddingRight","%s".concat(P)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(P)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(P))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(D)),paddingRight:t("mobileColumnPaddingRight","%s".concat(D)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(D)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(D))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-testimonial__item":Object(s.d)({paddingTop:t("columnPaddingTop","%s".concat(B)),paddingBottom:t("columnPaddingBottom","%s".concat(B)),paddingRight:t("columnPaddingRight","%s".concat(B)),paddingLeft:t("columnPaddingLeft","%s".concat(B))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-testimonial__item":Object(s.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(P)),paddingRight:t("tabletColumnPaddingRight","%s".concat(P)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(P)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(P))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-testimonial__item":Object(s.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(D)),paddingRight:t("mobileColumnPaddingRight","%s".concat(D)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(D)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(D))})}}});var U=e.attributes,z=U.testimonialColor,H=void 0===z?"":z,I=U.showTestimonial;(void 0===I||I)&&x.push({".ugb-testimonial__body":F({},Object(s.K)("testimonial%s","desktop",e.attributes,{important:!0}),{color:Object(s.c)(Object(s.wb)(H,(n.columnBackground||"background"===r)&&b)),textAlign:Object(s.c)(t("testimonialAlign")||t("contentAlign"))}),tablet:{".ugb-testimonial__body":F({},Object(s.K)("testimonial%s","tablet",e.attributes,{important:!0}),{textAlign:Object(s.c)(t("testimonialTabletAlign")||t("mobileTabletAlign"))})},mobile:{".ugb-testimonial__body":F({},Object(s.K)("testimonial%s","mobile",e.attributes,{important:!0}),{textAlign:Object(s.c)(t("testimonialMobileAlign")||t("mobileContentAlign"))})}}),!n.imageAsBackground&&m?(x.push(F({},Object(s.B)("image%s","ugb-img",e.attributes,{inherit:!1}))),x.push({desktopTablet:L({},".ugb-testimonial__image",{width:Object(s.c)(t("imageWidth","%spx"))}),tabletOnly:L({},".ugb-testimonial__image",{width:Object(s.c)(t("imageTabletWidth","%spx"))}),mobile:L({},".ugb-testimonial__image",{width:Object(s.c)(t("imageMobileWidth","%spx"))})}),x.push({".ugb-img, .ugb-testimonial__image":{marginLeft:""!==d||""!==h?Object(s.hb)(d||h)+" !important":void 0,marginRight:""!==d||""!==h?Object(s.ib)(d||h)+" !important":void 0},tablet:{".ugb-img, .ugb-testimonial__image":{marginLeft:""!==y||""!==w?Object(s.hb)(y||w)+" !important":void 0,marginRight:""!==y||""!==w?Object(s.ib)(y||w)+" !important":void 0}},mobile:{".ugb-img, .ugb-testimonial__image":{marginLeft:""!==k||""!==C?Object(s.hb)(k||C)+" !important":void 0,marginRight:""!==k||""!==C?Object(s.ib)(k||C)+" !important":void 0}}})):m&&Object(a.range)(1,c+1).forEach(function(e){x.push(L({},".ugb-testimonial__item.ugb-testimonial__item".concat(e," .ugb-testimonial__image"),{backgroundImage:t("image".concat(e,"Url"),"url(%s)")}))});var W=e.attributes,V=W.nameColor,G=void 0===V?"":V,q=W.showName;(void 0===q||q)&&x.push({".ugb-testimonial__name":F({},Object(s.K)("name%s","desktop",e.attributes),{color:Object(s.c)(Object(s.wb)(G,(n.columnBackground||"background"===r)&&b)),textAlign:t("nameAlign")||t("contentAlign")}),tablet:{".ugb-testimonial__name":F({},Object(s.K)("name%s","tablet",e.attributes),{textAlign:t("nameTabletAlign")||t("mobileTabletAlign")})},mobile:{".ugb-testimonial__name":F({},Object(s.K)("name%s","mobile",e.attributes),{textAlign:t("nameMobileAlign")||t("mobileContentAlign")})}});var K=e.attributes,Y=K.positionColor,J=void 0===Y?"":Y,X=K.showPosition;return(void 0===X||X)&&x.push({".ugb-testimonial__position":F({},Object(s.K)("position%s","desktop",e.attributes,{importantSize:!0}),{color:Object(s.c)(Object(s.wb)(J,(n.columnBackground||"background"===r)&&b)),textAlign:t("positionAlign")||t("contentAlign")}),tablet:{".ugb-testimonial__position":F({},Object(s.K)("position%s","tablet",e.attributes,{importantSize:!0}),{textAlign:t("positionTabletAlign")||t("mobileTabletAlign")})},mobile:{".ugb-testimonial__position":F({},Object(s.K)("position%s","mobile",e.attributes,{importantSize:!0}),{textAlign:t("positionMobileAlign")||t("mobileContentAlign")})}}),n.testimonialSpacing&&("bubble"!==r?x.push.apply(x,R(Object(s.F)(".ugb-testimonial__body","testimonial%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))):x.push.apply(x,R(Object(s.F)(".ugb-testimonial__body-wrapper","testimonial%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0})))),n.imageSpacing&&x.push.apply(x,R(Object(s.F)(".ugb-testimonial__image","image%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.nameSpacing&&x.push.apply(x,R(Object(s.F)(".ugb-testimonial__name","name%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.positionSpacing&&x.push.apply(x,R(Object(s.F)(".ugb-testimonial__position","position%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),M.a.all(x)},z=n(3),H=n(10),I=n(6),W=n(12),V=n(13);function G(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)){for(var t=0,n=new Array(e.length);t1,reverseTitle:"plain"!==a,titleSpacing:c,subtitleSpacing:u},e)},s=n(14),u=n.n(s);function b(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-text__text-wrapper":Object(l.d)({paddingTop:t("columnPaddingTop","%s".concat(r)),paddingBottom:t("columnPaddingBottom","%s".concat(r)),paddingRight:t("columnPaddingRight","%s".concat(r)),paddingLeft:t("columnPaddingLeft","%s".concat(r))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-text__text-wrapper":Object(l.d)({paddingTop:t("tabletColumnPaddingTop","%s".concat(p)),paddingRight:t("tabletColumnPaddingRight","%s".concat(p)),paddingBottom:t("tabletColumnPaddingBottom","%s".concat(p)),paddingLeft:t("tabletColumnPaddingLeft","%s".concat(p))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-text__text-wrapper":Object(l.d)({paddingTop:t("mobileColumnPaddingTop","%s".concat(d)),paddingRight:t("mobileColumnPaddingRight","%s".concat(d)),paddingBottom:t("mobileColumnPaddingBottom","%s".concat(d)),paddingLeft:t("mobileColumnPaddingLeft","%s".concat(d))})}}});var f=e.attributes.showColumnRule;void 0!==f&&f&&a.push({".ugb-text__rule":Object(l.d)({background:t("columnRuleColor"),width:t("columnRuleWidth","%spx"),height:t("columnRuleHeight","%s%")})});var h=e.attributes.showTitle;(void 0===h||h)&&a.push({".ugb-text__title-wrapper":{justifyContent:Object(l.c)(t("titleVerticalAlign"))},".ugb-text__title":m({color:t("titleColor")},Object(l.K)("title%s","desktop",e.attributes),{textAlign:t("titleAlign")||t("contentAlign")}),tablet:{".ugb-text__title":m({},Object(l.K)("title%s","tablet",e.attributes),{textAlign:t("titleTabletAlign")||t("tabletContentAlign")})},mobile:{".ugb-text__title":m({},Object(l.K)("title%s","mobile",e.attributes),{textAlign:t("titleMobileAlign")||t("mobileContentAlign")})}});var v=e.attributes.showSubtitle;return(void 0===v||v)&&a.push({".ugb-text__subtitle":m({},Object(l.K)("subtitle%s","desktop",e.attributes),{color:t("subtitleColor"),textAlign:t("subtitleAlign")}),tablet:{".ugb-text__subtitle":m({},Object(l.K)("subtitle%s","tablet",e.attributes),{textAlign:t("subtitleTabletAlign")})},mobile:{".ugb-text__subtitle":m({},Object(l.K)("subtitle%s","mobile",e.attributes),{textAlign:t("subtitleMobileAlign")})}}),a.push({".ugb-text__text p":m({},Object(l.K)("text%s","desktop",e.attributes),{color:t("textColor"),textAlign:t("textAlign")}),tablet:{".ugb-text__text p":m({},Object(l.K)("text%s","tablet",e.attributes),{textAlign:t("textTabletAlign")})},mobile:{".ugb-text__text p":m({},Object(l.K)("text%s","mobile",e.attributes),{textAlign:t("textMobileAlign")})}}),n.titleSpacing&&a.push.apply(a,b(Object(l.F)(".ugb-text__title","title%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),n.subtitleSpacing&&a.push.apply(a,b(Object(l.F)(".ugb-text__subtitle","subtitle%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),a.push.apply(a,b(Object(l.F)(".ugb-text__text","text%sBottomMargin","marginBottom","%spx",e.attributes,{important:!0}))),u.a.all(a)},f=n(351),h=n.n(f),v=n(352),y=n.n(v),O=n(353),w=n.n(O),_=n(3),k=n(10),j=n(8),C=n.n(j),x=n(11),E=n(0),S=n(6),B=n(12),T=n(9);function P(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t \*:nth-child\((\d)\) .ugb-button--inner/g,".ugb-button-wrapper .ugb-button$1 .ugb-button--inner").replace(/.ugb-button-wrapper > \*:nth-child\((\d)\) .ugb-button([^-])/g,".ugb-button-wrapper .ugb-button$1$2")};return d({},e,{showButton2:!!e.buttons&&e.buttons>=2,showButton3:!!e.buttons&&e.buttons>=3,design:"full"===e.align?"fullwidth":void 0,columns:void 0,contentAlign:"full"!==e.align?e.align:void 0,align:void 0,cornerButtonRadius:void 0,button1Url:e.url,button1NewTab:e.newTab,button1Text:e.text,button1BackgroundColor:e.color,button1TextColor:e.textColor,button1Size:e.size,button1BorderRadius:e.cornerButtonRadius,button1Design:e.design,button1Icon:e.icon,url:void 0,newTab:void 0,text:void 0,color:void 0,textColor:void 0,size:void 0,icon:void 0,button2Url:e.url2,button2NewTab:e.newTab2,button2Text:e.text2,button2BackgroundColor:e.color2,button2TextColor:e.textColor2,button2Size:e.size2,button2BorderRadius:e.cornerButtonRadius,button2Design:e.design2,button2Icon:e.icon2,url2:void 0,newTab2:void 0,text2:void 0,color2:void 0,textColor2:void 0,size2:void 0,design2:void 0,icon2:void 0,button3Url:e.url3,button3NewTab:e.newTab3,button3Text:e.text3,button3BackgroundColor:e.color3,button3TextColor:e.textColor3,button3Size:e.size3,button3BorderRadius:e.cornerButtonRadius,button3Design:e.design3,button3Icon:e.icon3,url3:void 0,newTab3:void 0,text3:void 0,color3:void 0,textColor3:void 0,size3:void 0,design3:void 0,icon3:void 0,customCSS:t(e.customCSS),customCSSCompiled:t(e.customCSSCompiled)})},O=[{attributes:d({},h,{textColor2:{type:"string"},textColor3:{type:"string"}}),save:v,migrate:y},{attributes:h,save:v,migrate:y}],w=n(3),_=n(10),k=n(14),j=n.n(k);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function x(e){for(var t=1;t2,noPaddings:"full"===l},e)},g=function(e,t){return"grid"===t?e<=5?2:e<=7?3:4:"uneven"===t?e<=3?2:3:"uneven-2"===t?e<=3?2:4===e?3:4:"tiled"===t?e<=3?2:4===e?3:5===e?4:5:e};function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t .ugb-inner-block > .ugb-block-content > .ugb-columns__item":{gridTemplateColumns:j.every(function(e){return"1.00fr"===e})?void 0:Object(s.c)(j.join(" "))},tablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-columns__item":{gridTemplateColumns:l("tabletColumns1")&&!C.every(function(e){return"1.00fr"===e})?Object(s.c)(C.join(" ")):void 0}},editor:{"> .ugb-inner-block > .ugb-block-content > .ugb-columns__item > .block-editor-inner-blocks > .block-editor-block-list__layout":{gridTemplateColumns:j.every(function(e){return"1.00fr"===e})?void 0:Object(s.c)(j.join(" "))},tablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-columns__item > .block-editor-inner-blocks > .block-editor-block-list__layout":{gridTemplateColumns:l("tabletColumns1")&&!C.every(function(e){return"1.00fr"===e})?Object(s.c)(C.join(" ")):void 0}}}});var x=e.attributes.noPaddings,E=void 0===x?"":x;_.noPaddings&&E&&c.push({"":{paddingLeft:Object(s.c)(0),paddingRight:Object(s.c)(0)}});var S=e.attributes,B=S.height,T=void 0===B?"":B,P=S.tabletHeight,A=void 0===P?"":P,N=S.mobileHeight,M=void 0===N?"":N;c.push((f(t={},".".concat(w,"-content-wrapper"),{minHeight:"half"===T?"50vh !important":"full"===T?"100vh !important":"custom"===T?Object(s.c)(l("heightNum","%s"+l("heightNumUnit","%s","px"))):void 0}),f(t,"tablet",f({},".".concat(w,"-content-wrapper"),{minHeight:"half"===A?"50vh !important":"full"===A?"100vh !important":"custom"===A?Object(s.c)(l("tabletHeightNum","%s"+l("tabletHeightNumUnit","%s","px"))):void 0})),f(t,"mobile",f({},".".concat(w,"-content-wrapper"),{minHeight:"half"===M?"50vh !important":"full"===M?"100vh !important":"custom"===M?Object(s.c)(l("mobileHeightNum","%s"+l("mobileHeightNumUnit","%s","px"))):void 0})),t)),c.push.apply(c,d(Object(s.F)(".".concat(w,"-content-wrapper > .ugb-column"),"%sColumnVerticalAlign","alignItems","%s",e.attributes,{important:!0}))),c.push.apply(c,d(Object(s.F)(".".concat(w,"-content-wrapper > .ugb-column > .ugb-inner-block"),"%sColumnVerticalAlign","height","auto",e.attributes,{important:!0})));var R=e.attributes,D=R.columnVerticalAlign,F=void 0===D?"":D,L=R.tabletColumnVerticalAlign,U=void 0===L?"":L,z=R.mobileColumnVerticalAlign,H=void 0===z?"":z,I=".".concat(w,"-content-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-editor-block-list__block");return c.push({editor:(i={},f(i,"".concat(I," > .ugb-column"),{height:Object(s.c)(F&&"stretch"!==F?"auto":void 0)}),f(i,I,{justifyContent:l("columnVerticalAlign")}),f(i,"tablet",(n={},f(n,"".concat(I," > .ugb-column"),{height:Object(s.c)(U&&"stretch"!==U?"auto":void 0)}),f(n,I,{justifyContent:l("tabletColumnVerticalAlign")}),n)),f(i,"mobile",(a={},f(a,"".concat(I," > .ugb-column"),{height:Object(s.c)(H&&"stretch"!==H?"auto":void 0)}),f(a,I,{justifyContent:l("mobileColumnVerticalAlign")}),a)),i)}),c.push((f(r={},"h1, h2, h3, h4, h5, h6",{color:l("headingColor")}),f(r,"p, li, label, table",{color:l("bodyTextColor")}),f(r,"a, a:visited, a:focus",{color:l("linkColor")}),f(r,"a:hover",{color:l("linkHoverColor")}),r)),b.a.all(c)},v=n(274),y=n.n(v),O=n(275),w=n.n(O),_=n(276),k=n.n(_),j=n(277),C=n.n(j),x=n(278),E=n.n(x),S=n(3),B=n(10),T=n(8),P=n.n(T),A=n(11),N=n(0),M=n(6),R=n(9),D=n(12),F=n(17);function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function U(e){for(var t=1;t6&&(n=6);var a=Object(l.select)("core/block-editor").getBlock(t.clientId).innerBlocks,i=Object(o.range)(n||2).map(function(e){return a[e]||Object(F.createBlock)("ugb/column",{},[])});return Object(l.dispatch)("core/block-editor").replaceInnerBlocks(t.clientId,i,!1),e});var W=Object(D.compose)(Object(D.withState)({sortColumnHighlight:null}),B.i,B.g,B.d,Object(B.h)(),Object(B.c)(),Object(B.a)(h,{editorMode:!0}))(function(e){var t=e.className,n=e.sortColumnHighlight,a=e.attributes,i=a.design,r=void 0===i?"plain":i,l=a.columns,c=void 0===l?2:l,s=a.reverseColumns,u=void 0===s?"":s,b=a.uniqueClass,g=void 0===b?"":b,d=m(e),f=P()([t,"ugb-columns--design-".concat(r),"ugb-columns--columns-".concat(c)],Object(p.applyFilters)("stackable.columns.mainclasses",z({"ugb-columns--reverse":d.reverseColumns&&u},"ugb-columns--highlight-".concat(n+1),null!==n),e)),h=P()(["ugb-columns__item","".concat(g,"-content-wrapper")]),v=Object(o.range)(c).map(function(){return["ugb/column"]});return wp.element.createElement(S.k.Edit,{className:f,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement("div",{className:h},wp.element.createElement(R.InnerBlocks,{templateLock:"all",template:v,allowedBlocks:["ugb/column"]})))}})}),V=Object(D.compose)(B.i,Object(B.a)(h))(function(e){var t=e.className,n=e.attributes,a=n.design,i=void 0===a?"plain":a,o=n.columns,r=void 0===o?3:o,l=n.reverseColumns,c=void 0===l?"":l,s=n.uniqueClass,u=void 0===s?"":s,b=m(e),g=P()([t,"ugb-columns--design-".concat(i),"ugb-columns--columns-".concat(r)],Object(p.applyFilters)("stackable.columns.mainclasses",{"ugb-columns--reverse":b.reverseColumns&&c},e)),d=P()(["ugb-columns__item","".concat(u,"-content-wrapper")]);return wp.element.createElement(S.k.Save,{className:g,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement("div",{className:d},wp.element.createElement(R.InnerBlocks.Content,null)))}})});function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(e){for(var t=1;t
',attributes:{design:"basic",columnBackgroundCustomSizeUnit:"%",columnTabletBackgroundCustomSizeUnit:"%",columnMobileBackgroundCustomSizeUnit:"%",uniqueClass:"ugb-86df09f",hideDesktop:!1,hideTablet:!1,hideMobile:!1},innerBlocks:[{clientId:"f9424a9c-6505-4b24-bba7-5f47154f06ee",name:"ugb/text",isValid:!0,validationIssues:[],originalContent:'

Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.

',attributes:{design:"plain",columns:1,reverseTitle:!1,alignment:"center",showColumnRule:!1,showTitle:!1,titleLineHeightUnit:"em",titleTabletLineHeightUnit:"em",titleMobileLineHeightUnit:"em",showSubtitle:!1,subtitleLineHeightUnit:"em",subtitleTabletLineHeightUnit:"em",subtitleMobileLineHeightUnit:"em",subtitleColor:"",subtitleOnTop:!1,text1:"Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.",textLineHeightUnit:"em",textTabletLineHeightUnit:"em",textMobileLineHeightUnit:"em",uniqueClass:"ugb-b4acf03",hideDesktop:!1,hideTablet:!1,hideMobile:!1,showBlockBackground:!1,blockBackgroundBackgroundCustomSizeUnit:"%",blockBackgroundTabletBackgroundCustomSizeUnit:"%",blockBackgroundMobileBackgroundCustomSizeUnit:"%",topSeparatorDesign:"wave-1",bottomSeparatorDesign:"wave-1"}}]},{clientId:"35a9a6fb-fa22-45f0-8bd8-b55118218bc5",name:"ugb/column",isValid:!0,validationIssues:[],originalContent:'
',attributes:{design:"basic",columnBackgroundCustomSizeUnit:"%",columnTabletBackgroundCustomSizeUnit:"%",columnMobileBackgroundCustomSizeUnit:"%",uniqueClass:"ugb-9278b23",hideDesktop:!1,hideTablet:!1,hideMobile:!1},innerBlocks:[{clientId:"11a58c75-44ce-47ec-ba4c-12081a5f7bb3",name:"ugb/text",isValid:!0,validationIssues:[],originalContent:'

Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.

',attributes:{design:"plain",columns:1,reverseTitle:!1,alignment:"center",showColumnRule:!1,showTitle:!1,titleLineHeightUnit:"em",titleTabletLineHeightUnit:"em",titleMobileLineHeightUnit:"em",showSubtitle:!1,subtitleLineHeightUnit:"em",subtitleTabletLineHeightUnit:"em",subtitleMobileLineHeightUnit:"em",subtitleOnTop:!1,text1:"Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.",textLineHeightUnit:"em",textTabletLineHeightUnit:"em",textMobileLineHeightUnit:"em",uniqueClass:"ugb-6e7c623",hideDesktop:!1,hideTablet:!1,hideMobile:!1,showBlockBackground:!1,blockBackgroundBackgroundCustomSizeUnit:"%",blockBackgroundTabletBackgroundCustomSizeUnit:"%",blockBackgroundMobileBackgroundCustomSizeUnit:"%",topSeparatorDesign:"wave-1",bottomSeparatorDesign:"wave-1",topSeparatorShadow:!0,bottomSeparatorShadow:!0}}]}]},supports:{html:!1,inserter:!i.disabledBlocks.includes(Y),anchor:!0},edit:W,save:V,modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-responsive":!0,"block-background":!0,"block-separators":!0,"block-title":!0,"content-align":!0,"custom-css":{default:Object(p.applyFilters)("stackable.columns.custom-css.default","")}}};Object(p.addFilter)("stackable.columns.setAttributes","stackable/columns/design",function(e,t){if(void 0===e.design)return e;var n=t.attributes;return"grid"!==e.design&&n.columns>6&&(e.columns=6),e}),Object(p.addFilter)("stackable.columns.setAttributes","stackable/columns/design",function(e,t){if(void 0===e.design)return e;var n=t.attributes;return"plain"!==e.design&&n.columns<4&&(e.columns=4),e})},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(1),o=n(8),r=n.n(o),l=n(4),c=n(9);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=[{attributes:{textColor:{type:"string"},contentAlign:{type:"string",default:""},backgroundColorType:{type:"string",default:""},backgroundColor:{type:"string",default:"#f1f1f1"},backgroundColor2:{type:"string",default:""},backgroundColorDirection:{type:"number",default:0},backgroundType:{type:"string",default:""},backgroundImageID:{type:"number"},backgroundImageURL:{type:"string"},backgroundOpacity:{type:"number",default:5},fixedBackground:{type:"boolean",default:!1},height:{type:"string",default:"normal"},contentWidth:{type:"boolean",default:!1},contentLocation:{type:"string",default:"full"},verticalAlign:{type:"string",default:"center"},borderRadius:{type:"number",default:12},shadow:{type:"number",default:3},align:{type:"string"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},save:function(e){var t,n=e.className,a=e.attributes,i=a.contentAlign,o=a.textColor,s=a.backgroundColorType,b=void 0===s?"":s,p=a.backgroundColor,m=a.backgroundColor2,g=a.backgroundColorDirection,d=void 0===g?0:g,f=a.backgroundType,h=void 0===f?"":f,v=a.backgroundImageURL,y=a.backgroundOpacity,O=a.fixedBackground,w=a.height,_=a.contentLocation,k=a.verticalAlign,j=a.contentWidth,C=a.borderRadius,x=void 0===C?12:C,E=a.shadow,S=void 0===E?3:E,B=a.design,T=void 0===B?"":B,P=r()([n,"ugb-container","ugb--background-opacity-"+1*Math.round(y/1)],Object(l.applyFilters)("stackable.container.mainclasses_1_17_3",(u(t={},"ugb-container--content-".concat(i),i),u(t,"ugb--has-background",p&&"transparent"!==p||v),u(t,"ugb--has-background-image",v),u(t,"ugb-container--height-".concat(w),w),u(t,"ugb-container--align-horizontal-".concat(_),_),u(t,"ugb--content-width",j),u(t,"ugb--shadow-".concat(S),3!==S),u(t,"ugb--has-background-gradient","gradient"===b),u(t,"ugb--has-background-video","video"===h),t),T,e)),A={"--ugb-text-color":o||void 0,backgroundColor:p||void 0,backgroundImage:v?"url(".concat(v,")"):void 0,backgroundAttachment:O?"fixed":void 0,"--ugb-background-color":v||"gradient"===b?p:void 0,"--ugb-background-color2":"gradient"===b&&m?m:void 0,"--ugb-background-direction":"gradient"===b?"".concat(d,"deg"):void 0,"justify-content":"full"!==w&&"half"!==w||!k?void 0:k,borderRadius:12!==x?x:void 0};return wp.element.createElement("div",{className:P,style:A},"video"===h&&wp.element.createElement("video",{className:"ugb-video-background",autoPlay:!0,muted:!0,loop:!0,src:v}),Object(l.applyFilters)("stackable.container.save.output.before_1_17_3",null,T,e),wp.element.createElement("div",{className:"ugb-container__wrapper"},wp.element.createElement("div",{className:"ugb-container__content-wrapper"},wp.element.createElement(c.InnerBlocks.Content,null))),Object(l.applyFilters)("stackable.container.save.output.after_1_17_3",null,T,e))},migrate:function(e){var t=function(e){return(e||"").replace(/\.ugb-container(\s*\{)/g,".ugb-container__wrapper$1")};return function(e){for(var t=1;t .ugb-video-background, ")+".".concat(f,"-wrapper.ugb-container__wrapper:before"),{borderRadius:u("borderRadius","%spx !important")||"12px !important"})),s));y.border&&b.push(h({},Object(p.p)("column%s",".".concat(f,"-wrapper.ugb-container__wrapper"),e.attributes))),b.push({saveOnly:{"> .ugb-inner-block > .ugb-block-content > *":{justifyContent:Object(p.c)(u("columnContentVerticalAlign"))},tablet:{"> .ugb-inner-block > .ugb-block-content > *":{justifyContent:Object(p.c)(u("tabletColumnContentVerticalAlign"))}},mobile:{"> .ugb-inner-block > .ugb-block-content > *":{justifyContent:Object(p.c)(u("mobileColumnContentVerticalAlign"))}}},editor:{"> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper":{justifyContent:Object(p.c)(u("columnContentVerticalAlign"))},tablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper":{justifyContent:Object(p.c)(u("tabletColumnContentVerticalAlign"))}},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper":{justifyContent:Object(p.c)(u("mobileColumnContentVerticalAlign"))}}}});var O=e.attributes,w=O.height,_=void 0===w?"":w,k=O.tabletHeight,j=void 0===k?"":k,C=O.mobileHeight,x=void 0===C?"":C;b.push((v(a={},".".concat(f,"-wrapper > .ugb-container__side"),{paddingTop:"short"===_?"35px !important":"tall"===_?"120px !important":void 0,paddingBottom:"short"===_?"35px !important":"tall"===_?"120px !important":void 0}),v(a,".".concat(f,"-wrapper.ugb-container__wrapper"),{minHeight:"half"===_?"50vh":"full"===_?"100vh":void 0,paddingTop:"short"===_||"tall"===_?"0 !important":void 0,paddingBottom:"short"===_||"tall"===_?"0 !important":void 0}),v(a,"tablet",(v(t={},".".concat(f,"-wrapper > .ugb-container__side"),{paddingTop:"short"===j?"35px !important":"tall"===j?"120px !important":void 0,paddingBottom:"short"===j?"35px !important":"tall"===j?"120px !important":void 0}),v(t,".".concat(f,"-wrapper.ugb-container__wrapper"),{minHeight:"half"===j?"50vh":"full"===j?"100vh":void 0,paddingTop:"short"===j||"tall"===j?"0 !important":void 0,paddingBottom:"short"===j||"tall"===j?"0 !important":void 0}),t)),v(a,"mobile",(v(n={},".".concat(f,"-wrapper > .ugb-container__side"),{paddingTop:"short"===x?"35px !important":"tall"===x?"120px !important":void 0,paddingBottom:"short"===x?"35px !important":"tall"===x?"120px !important":void 0}),v(n,".".concat(f,"-wrapper.ugb-container__wrapper"),{minHeight:"half"===x?"50vh":"full"===x?"100vh":void 0,paddingTop:"short"===x||"tall"===x?"0 !important":void 0,paddingBottom:"short"===x||"tall"===x?"0 !important":void 0}),n)),a));var E=_&&("half"===_||"full"===_),S=j&&("half"===j||"full"===j),B=x&&("half"===x||"full"===x);E&&b.push(v({},".".concat(f,"-wrapper > .ugb-container__side"),{justifyContent:u("contentVerticalAlign")})),(E||S)&&b.push({tablet:v({},".".concat(f,"-wrapper > .ugb-container__side"),{justifyContent:u("contentTabletVerticalAlign")})}),(E||S||B)&&b.push({mobile:v({},".".concat(f,"-wrapper > .ugb-container__side"),{justifyContent:u("contentMobileVerticalAlign")})}),b.push({desktopTablet:v({},".".concat(f,"-content-wrapper.ugb-container__content-wrapper"),{width:Object(p.c)(u("contentWidth","%s%"))}),tabletOnly:v({},".".concat(f,"-content-wrapper.ugb-container__content-wrapper"),{width:Object(p.c)(u("contentTabletWidth","%s%"))}),mobile:v({},".".concat(f,"-content-wrapper.ugb-container__content-wrapper"),{width:Object(p.c)(u("contentMobileWidth","%s%"))})}),b.push((v(i={},".".concat(f,"-wrapper > .ugb-container__side"),{alignItems:Object(p.c)(u("contentHorizontalAlign"))}),v(i,"tablet",v({},".".concat(f,"-wrapper > .ugb-container__side"),{alignItems:Object(p.c)(u("contentTabletHorizontalAlign"))})),v(i,"mobile",v({},".".concat(f,"-wrapper > .ugb-container__side"),{alignItems:Object(p.c)(u("contentMobileHorizontalAlign"))})),i));b.push(h({},y.columnBackground?Object(p.m)("column%s","".concat(f,"-wrapper.ugb-container__wrapper"),e.attributes,{importantBackgroundColor:!0}):{}));var T=e.attributes,P=T.columnBackgroundColor,A=void 0===P?"":P,N=T.headingColor,M=void 0===N?"":N,R=T.bodyTextColor,D=void 0===R?"":R;b.push((v(o={},"h1, h2, h3, h4, h5, h6",{color:u("headingColor")}),v(o,"p, li, label, table",{color:u("bodyTextColor")}),v(o,"a, a:visited, a:focus",{color:u("linkColor")}),v(o,"a:hover",{color:u("linkHoverColor")}),o));var F=e.attributes,L=F.columnPaddingUnit,U=void 0===L?"px":L,z=F.tabletColumnPaddingUnit,H=void 0===z?"px":z,I=F.mobileColumnPaddingUnit,W=void 0===I?"px":I,V=Object(l.applyFilters)("stackable.container.spacing-paddings.selector","> .ugb-inner-block > .ugb-block-content > *",e),G=Object(l.applyFilters)("stackable.container.spacing-paddings.selector","> .ugb-inner-block > .ugb-block-content > .ugb-container__wrapper",e);return b.push({saveOnly:{desktopTablet:v({},V,Object(p.d)({paddingTop:u("columnPaddingTop","%s".concat(U)),paddingBottom:u("columnPaddingBottom","%s".concat(U)),paddingRight:u("columnPaddingRight","%s".concat(U)),paddingLeft:u("columnPaddingLeft","%s".concat(U))})),tabletOnly:v({},V,Object(p.d)({paddingTop:u("tabletColumnPaddingTop","%s".concat(H)),paddingRight:u("tabletColumnPaddingRight","%s".concat(H)),paddingBottom:u("tabletColumnPaddingBottom","%s".concat(H)),paddingLeft:u("tabletColumnPaddingLeft","%s".concat(H))})),mobile:v({},V,Object(p.d)({paddingTop:u("mobileColumnPaddingTop","%s".concat(W)),paddingRight:u("mobileColumnPaddingRight","%s".concat(W)),paddingBottom:u("mobileColumnPaddingBottom","%s".concat(W)),paddingLeft:u("mobileColumnPaddingLeft","%s".concat(W))}))},editor:{desktopTablet:v({},G,Object(p.d)({paddingTop:u("columnPaddingTop","%s".concat(U)),paddingBottom:u("columnPaddingBottom","%s".concat(U)),paddingRight:u("columnPaddingRight","%s".concat(U)),paddingLeft:u("columnPaddingLeft","%s".concat(U))})),tabletOnly:v({},G,Object(p.d)({paddingTop:u("tabletColumnPaddingTop","%s".concat(H)),paddingRight:u("tabletColumnPaddingRight","%s".concat(H)),paddingBottom:u("tabletColumnPaddingBottom","%s".concat(H)),paddingLeft:u("tabletColumnPaddingLeft","%s".concat(H))})),mobile:v({},G,Object(p.d)({paddingTop:u("mobileColumnPaddingTop","%s".concat(W)),paddingRight:u("mobileColumnPaddingRight","%s".concat(W)),paddingBottom:u("mobileColumnPaddingBottom","%s".concat(W)),paddingLeft:u("mobileColumnPaddingLeft","%s".concat(W))}))}}),b.push((v(c={},".".concat(f,"-content-wrapper > h1, ")+".".concat(f,"-content-wrapper > h2, ")+".".concat(f,"-content-wrapper > h3, ")+".".concat(f,"-content-wrapper > h4, ")+".".concat(f,"-content-wrapper > h5, ")+".".concat(f,"-content-wrapper > h6"),{color:Object(p.wb)(M,y.columnBackground&&A)}),v(c,".".concat(f,"-content-wrapper > p, ")+".".concat(f,"-content-wrapper > ol li, ")+".".concat(f,"-content-wrapper > ul li"),{color:Object(p.wb)(D,y.columnBackground&&A)}),v(c,"editor",(v(r={},".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h1, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h2, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h3, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h4, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h5, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/heading"] h6'),{color:Object(p.wb)(M,y.columnBackground&&A)}),v(r,".".concat(f,'-content-wrapper > * > * [data-type*="core/paragraph"] p, ')+".".concat(f,'-content-wrapper > * > * [data-type*="core/list"] li'),{color:Object(p.wb)(D,y.columnBackground&&A)}),r)),c)),g.a.all(b)},O=n(279),w=n.n(O),_=n(280),k=n.n(_),j=n(281),C=n.n(j),x=n(282),E=n.n(x),S=n(283),B=n.n(S),T=n(3),P=n(10),A=n(11),N=n(0),M=n(6),R=n(12),D=n(13);function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0}}),Object(D.withSelect)(function(e,t){Object(p.f)(t.attributes.imageId,e)}))(function(e){var t,n=e.className,a=e.attributes,i=a.design,o=void 0===i?"basic":i,s=a.shadow,u=void 0===s?"":s,b=a.restrictContentWidth,p=void 0!==b&&b,m=a.uniqueClass,g=void 0===m?"":m,f=d(e),h=r()([n,"ugb-container--v2","ugb-container--design-".concat(o)],Object(l.applyFilters)("stackable.container.mainclasses",{},e)),v=r()(["ugb-container__wrapper","".concat(g,"-wrapper")],Object(l.applyFilters)("stackable.container.wrapperClasses",(F(t={},"ugb--shadow-".concat(u),f.columnBackground&&""!==u),F(t,"ugb--restrict-content-width",f.restrictContent&&p),t),e)),y=r()(["ugb-container__content-wrapper","".concat(g,"-content-wrapper")],{"ugb-content-wrapper":f.restrictContent&&p});return wp.element.createElement(T.k.Edit,{className:h,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement(T.H,{className:v,backgroundAttrName:"column%s",blockProps:e,showBackground:f.columnBackground},Object(l.applyFilters)("stackable.container.edit.wrapper.output",null,e),wp.element.createElement("div",{className:"ugb-container__side"},wp.element.createElement("div",{className:y},wp.element.createElement(c.InnerBlocks,{templateLock:!1,renderAppender:function(){return e.hasInnerBlocks?wp.element.createElement(c.InnerBlocks.DefaultBlockAppender,null):wp.element.createElement(c.InnerBlocks.ButtonBlockAppender,null)}})))))}})});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}var H=Object(R.compose)(P.i,Object(P.a)(y))(function(e){var t,n=e.className,a=e.attributes,i=a.design,o=void 0===i?"":i,s=a.shadow,u=void 0===s?"":s,b=a.restrictContentWidth,p=void 0!==b&&b,m=a.uniqueClass,g=void 0===m?"":m,f=d(e),h=r()([n,"ugb-container--v2","ugb-container--design-".concat(o)],Object(l.applyFilters)("stackable.container.mainclasses",{},e)),v=r()(["ugb-container__wrapper","".concat(g,"-wrapper")],Object(l.applyFilters)("stackable.container.wrapperClasses",(z(t={},"ugb--shadow-".concat(u),f.columnBackground&&""!==u),z(t,"ugb--restrict-content-width",f.restrictContent&&p),t),e)),y=r()(["ugb-container__content-wrapper","".concat(g,"-content-wrapper")],{"ugb-content-wrapper":f.restrictContent&&p});return wp.element.createElement(T.k.Save,{className:h,blockProps:e,render:function(){return wp.element.createElement(M.Fragment,null,wp.element.createElement(T.H,{className:v,backgroundAttrName:"column%s",blockProps:e,showBackground:f.columnBackground},Object(l.applyFilters)("stackable.container.save.wrapper.output",null,e),wp.element.createElement("div",{className:"ugb-container__side"},wp.element.createElement("div",{className:y},wp.element.createElement(c.InnerBlocks.Content,null)))))}})});function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V=function(e){for(var t=1;t

Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.

',attributes:{design:"plain",columns:1,reverseTitle:!1,alignment:"center",showColumnRule:!1,showTitle:!1,titleLineHeightUnit:"em",titleTabletLineHeightUnit:"em",titleMobileLineHeightUnit:"em",showSubtitle:!1,subtitleLineHeightUnit:"em",subtitleTabletLineHeightUnit:"em",subtitleMobileLineHeightUnit:"em",subtitleColor:"",subtitleOnTop:!1,text1:"Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.",textLineHeightUnit:"em",textTabletLineHeightUnit:"em",textMobileLineHeightUnit:"em",uniqueClass:"ugb-c5deeb7",hideDesktop:!1,hideTablet:!1,hideMobile:!1,showBlockBackground:!1,blockBackgroundBackgroundCustomSizeUnit:"%",blockBackgroundTabletBackgroundCustomSizeUnit:"%",blockBackgroundMobileBackgroundCustomSizeUnit:"%",topSeparatorDesign:"wave-1",bottomSeparatorDesign:"wave-1"}}]},modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-column-spacing":{columnGap:!1,paddings:!1},"advanced-responsive":!0,"block-background":!0,"block-separators":!0,"content-align":!0,"custom-css":{default:Object(l.applyFilters)("stackable.container.custom-css.default","")}}};Object(l.addFilter)("stackable.container.advanced-column-spacing.vertical-align","stackable/container",function(){return{}})},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(7),o=n(1),r=n(4);Object(r.addFilter)("stackable.icon-list.design.no-text-attributes","stackable/icon-list",function(e){return Object(i.omit)(e,["text"])});var l=n(29),c=n(10),s=n(3),u=n(8),b=n.n(u),p=n(2),m=n(0);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function d(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e;if(e||(n=v),"string"==typeof e&&2===e.split("-").length){var a=e.split("-"),i=h(a,2),o=i[0],r=i[1];n=Object(p.O)(o,r)}var l=y(n);if(l){var c=l.querySelectorAll("*");t&&(c.forEach(function(e){e&&!["DEFS","TITLE","DESC"].includes(e.tagName)&&(e.setAttribute("fill",t),e.setAttribute("stroke",t),e.style.fill=t,e.style.stroke=t)}),l.setAttribute("style","fill: ".concat(t," !important; color: ").concat(t," !important")));var s=(new XMLSerializer).serializeToString(l);return window.btoa(s)}},w=n(14),_=n.n(w);function k(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1||h&&h>1||O&&O>1)&&wp.element.createElement(T.ToggleControl,{label:Object(m.__)("Display as a grid (left to right & evenly spaced)",o.i18n),checked:p,onChange:function(e){return n({displayAsGrid:e})},className:"ugb--help-tip-icon-list-grid"}),wp.element.createElement(s.y,{setAttributes:n,blockAttributes:t.attributes})),wp.element.createElement(s.hb,{initialOpen:!1,blockProps:t},wp.element.createElement(s.c,{label:Object(m.__)("List Gap",o.i18n),value:l,onChange:function(e){return n({gap:e})},min:0,max:30,allowReset:!0,placeholder:"16",className:"ugb--help-tip-icon-list-gap"})),wp.element.createElement(s.gb,{title:Object(m.__)("Icon",o.i18n),initialOpen:!1},wp.element.createElement(s.O,{label:Object(m.__)("Icon",o.i18n),value:i||v,onChange:function(e){return n({icon:e})},help:Object(m.__)("You can click on each icon in the Icon List block to change them individually.",o.i18n)}),wp.element.createElement(s.z,null),wp.element.createElement(s.v,{label:Object(m.__)("Icon Color",o.i18n),value:r,onChange:function(e){return n({iconColor:e})}}),wp.element.createElement(s.z,null),wp.element.createElement(s.lb,{attrNameTemplate:"icon%sSize",setAttributes:n,blockAttributes:t.attributes},wp.element.createElement(s.c,{label:Object(m.__)("Icon Size",o.i18n),min:0,max:50,allowReset:!0,placeholder:"20"})),wp.element.createElement(s.c,{label:Object(m.__)("Icon Opacity",o.i18n),value:_,min:0,max:1,step:.1,onChange:function(e){return n({opacity:e})},allowReset:!0,placeholder:"1.0"}),wp.element.createElement(s.c,{label:Object(m.__)("Icon Rotation",o.i18n),value:j,min:0,max:360,onChange:function(e){return n({rotation:e})},allowReset:!0,placeholder:"0"})),wp.element.createElement(s.gb,{title:Object(m.__)("List Text",o.i18n),id:"text",initialOpen:!1},wp.element.createElement(s.wb,{attrNameTemplate:"listText%s",setAttributes:n,blockAttributes:t.attributes}),wp.element.createElement(s.v,{value:u,onChange:function(e){return n({listTextColor:e})},label:Object(m.__)("Color",o.i18n)})))});var R=Object(P.compose)(c.i,c.g,c.d,S.withTransformOldIconAttributes,Object(c.h)(),Object(c.c)(),Object(c.a)(E,{editorMode:!0}),Object(c.b)([["ul, ul li","text"]]))(function(e){var t,n,a,i,l,c,u,p,g=e.className,d=e.setAttributes,f=e.isSelected,h=e.attributes,v=h.text,y=h.design,O=void 0===y?"":y,w=h.displayAsGrid,_=void 0!==w&&w,k=b()([g,"ugb-icon-list--v2",(t=e.attributes,n=t.contentAlign,a=t.tabletContentAlign,i=t.mobileContentAlign,l=Object(A.select)("core/edit-post").__experimentalGetPreviewDeviceType,c={},u=l?l():"Desktop",p=("Desktop"===u?n:"Tablet"===u?a:i)||"left",c["ugb-icon-list__".concat(p,"-align")]=p,c)],Object(r.applyFilters)("stackable.icon-list.mainclasses",{"ugb-icon-list--display-grid":_},O,e)),j=Object(B.createRef)(),C=Object(A.select)("core/block-editor").isTyping(),x=M(Object(B.useState)(!1),2),E=x[0],S=x[1],T=M(Object(B.useState)(null),2),P=T[0],R=T[1],D=M(Object(B.useState)(null),2),F=D[0],L=D[1],U=M(Object(B.useState)(null),2),z=U[0],H=U[1],I=function(t){if(H(t),"LI"!==t.target.tagName)return S(!1);var n=Object(A.select)("core/edit-post").__experimentalGetPreviewDeviceType,a=n?n():"Desktop",i=("Desktop"===a?e.attributes.iconSize:"Tablet"===a?e.attributes.iconTabletSize||e.attributes.iconSize:e.attributes.iconMobileSize||e.attributes.iconTabletSize||e.attributes.iconSize)||20;if(t.offsetX<=i+21){var o=Array.from(t.target.parentElement.children).indexOf(t.target)+1,r=t.target.parentElement.currentlyOpenIndex;return r&&r===o?(t.target.parentElement.currentlyOpenIndex=void 0,S(!1)):(t.target.parentElement.currentlyOpenIndex=o,L(o),R(t.target),S(!0))}return t.target.parentElement.currentlyOpenIndex=void 0,R(null),S(!1)};return Object(B.useEffect)(function(){return j.current.addEventListener("click",I),function(){j.current&&j.current.removeEventListener("click",I)}},[]),Object(B.useEffect)(function(){f||(S(!1),z&&(z.target.parentElement.currentlyOpenIndex=void 0))},[f]),wp.element.createElement(s.k.Edit,{className:k,blockProps:e,render:function(){return wp.element.createElement(B.Fragment,null,wp.element.createElement("div",{ref:j},wp.element.createElement(N.RichText,{tagName:"ul",multiline:"li",value:v,onChange:function(e){return d({text:e})},placeholder:Object(m.__)("Text for this block",o.i18n),keepPlaceholderOnFocus:!0}),!C&&f&&E&&wp.element.createElement(s.R,{position:"bottom left",anchorRef:P,onClose:function(){z&&(z.target.parentElement.currentlyOpenIndex=void 0),S(!1)},onChange:function(e){var t,n,a;d((t={},n="icon".concat(F),a=e,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t))}})))}})}),D=Object(P.compose)(c.i,Object(c.a)(E))(function(e){var t=e.className,n=e.attributes,a=n.text,i=n.design,o=void 0===i?"":i,l=n.displayAsGrid,c=void 0!==l&&l,u=b()([t,"ugb-icon-list--v2"],Object(r.applyFilters)("stackable.icon-list.mainclasses",{"ugb-icon-list--display-grid":c},o,e));return wp.element.createElement(s.k.Save,{className:u,blockProps:e,render:function(){return wp.element.createElement(B.Fragment,null,wp.element.createElement(N.RichText.Content,{tagName:"ul",value:a}))}})});function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U=function(e){for(var t=1;t".concat(e,"")}).join("")},displayAsGrid:{type:"boolean",default:!1},gap:{type:"number",default:""},listTextColor:{type:"string",default:""},opacity:{type:"number",default:""},rotation:{type:"number",default:""}},Object(p.J)("listText%s"),{},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"icon%d",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;if(t<1)return null;var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return Object(m.sprintf)(e,t)},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return f({},"".concat(n(e)),{type:"string",default:""})},o={};return Object(i.range)(1,t+1).forEach(function(e){o=d({},o,{},a(e))}),o}());n.d(t,"name",function(){return z}),n.d(t,"settings",function(){return H});var z="ugb/icon-list",H={title:Object(m.__)("Icon List",o.i18n),description:Object(m.__)("An unordered list with icons. You can use this as a list of features or benefits.",o.i18n),icon:a.r,category:"common",keywords:[Object(m.__)("Icon List",o.i18n),Object(m.__)("Stackable",o.i18n)],attributes:U,example:{attributes:{icon:'',columns:2,text:"
  • Line 1
  • Line 2
  • Line 3
  • Line 4
  • Line 5
  • Line 6
  • ",displayAsGrid:!1,listTextLineHeightUnit:"em",listTextTabletLineHeightUnit:"em",listTextMobileLineHeightUnit:"em",uniqueClass:"ugb-495b710",hideDesktop:!1,hideTablet:!1,hideMobile:!1,showBlockBackground:!1,blockBackgroundBackgroundCustomSizeUnit:"%",blockBackgroundTabletBackgroundCustomSizeUnit:"%",blockBackgroundMobileBackgroundCustomSizeUnit:"%",topSeparatorDesign:"wave-1",bottomSeparatorDesign:"wave-1",topSeparatorShadow:!0,bottomSeparatorShadow:!0,showBlockTitle:!1,blockTitleLineHeightUnit:"em",blockTitleTabletLineHeightUnit:"em",blockTitleMobileLineHeightUnit:"em",showBlockDescription:!1,blockDescriptionLineHeightUnit:"em",blockDescriptionTabletLineHeightUnit:"em",blockDescriptionMobileLineHeightUnit:"em"}},supports:{inserter:!o.disabledBlocks.includes(z),anchor:!0},deprecated:l.default,edit:R,save:D,modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-responsive":!0,"block-background":!0,"block-separators":!0,"block-title":!0,"content-align":!0,"block-designs":!0,"custom-css":{default:Object(r.applyFilters)("stackable.icon-list.custom-css.default","")}}};Object(r.addFilter)("stackable.icon-list.setAttributes","stackable/icon-list/icon",function(e,t){return void 0===e.icon?e:(Object(i.range)(1,21).forEach(function(n){t.attributes["icon".concat(n)]&&(e["icon".concat(n)]=void 0)}),e)})},function(e,t,n){"use strict";n.r(t);var a=n(1),i=n(15),o=n(2),r=n(14),l=n.n(r),c=function(e){var t=Object(o.b)(e.attributes),n=[],a=e.attributes,i=a.design,r=void 0===i?"basic":i,c=a.contentAlign,s=void 0===c?"":c,u=a.tabletContentAlign,b=void 0===u?"":u,p=a.mobileContentAlign,m=void 0===p?"":p;return n.push({".ugb-block-content":{marginTop:Object(o.c)(t("hrMarginTop","%spx")),marginBottom:Object(o.c)(t("hrMarginBottom","%spx"))}}),"basic"!==r&&"bar"!==r||n.push({"hr.ugb-divider__hr":{backgroundColor:Object(o.c)(t("color")),height:Object(o.c)(t("height","%spx")),width:Object(o.c)(t("width","%s%")),marginLeft:Object(o.c)(Object(o.hb)(s)),marginRight:Object(o.c)(Object(o.ib)(s)),borderRadius:"bar"===r?Object(o.c)(t("height","calc(%spx / 2)")):void 0},tablet:{"hr.ugb-divider__hr":{marginLeft:Object(o.c)(""!==b?Object(o.hb)(b):void 0),marginRight:Object(o.c)(""!==b?Object(o.ib)(b):void 0)}},mobile:{"hr.ugb-divider__hr":{marginLeft:Object(o.c)(""!==m?Object(o.hb)(m):void 0),marginRight:Object(o.c)(""!==m?Object(o.ib)(m):void 0)}}}),"dots"!==r&&"asterisks"!==r||n.push({".ugb-divider__dots":{width:Object(o.c)(t("width","%s%")),marginLeft:Object(o.c)(Object(o.hb)(s)),marginRight:Object(o.c)(Object(o.ib)(s))},".ugb-divider__dot":{backgroundColor:"dots"===r?Object(o.c)(t("color")):void 0,height:Object(o.c)(t("height","%spx")),width:Object(o.c)(t("height","%spx"))},tablet:{".ugb-divider__dots":{marginLeft:Object(o.c)(""!==b?Object(o.hb)(b):void 0),marginRight:Object(o.c)(""!==b?Object(o.ib)(b):void 0)}},mobile:{".ugb-divider__dots":{marginLeft:Object(o.c)(""!==m?Object(o.hb)(m):void 0),marginRight:Object(o.c)(""!==m?Object(o.ib)(m):void 0)}}}),"asterisks"===r&&n.push({".ugb-divider__dot:before":{color:t("color"),fontSize:t("height","calc(%spx * 1.8)")}}),l.a.all(n)},s=n(289),u=n.n(s),b=n(290),p=n.n(b),m=n(291),g=n.n(m),d=n(292),f=n.n(d),h=n(3),v=n(10),y=n(8),O=n.n(y),w=n(0),_=n(4),k=n(6),j=n(12);function C(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t".concat(Object(r.__)("Some short text that can be expanded to show more details.",o.i18n),"

    ")},moreText:{source:"html",selector:".ugb-expand__more-text",multiline:"p",default:"

    ".concat(Object(r.__)("Some short text that can be expanded to show more details.",o.i18n)," ").concat(Object(p.M)("medium"),"

    ")}},Object(p.J)("text%s"),{textColor:{type:"string",default:""},moreLabel:{source:"html",selector:".ugb-expand__more-toggle-text",default:Object(r.__)("Show more",o.i18n)},lessLabel:{source:"html",selector:".ugb-expand__less-toggle-text",default:Object(r.__)("Show less",o.i18n)}},Object(p.J)("link%s"),{linkColor:{type:"string",default:""}},Object(p.i)("%s%sAlign",{type:"string",default:""},["Title","Text","Link"],["","Tablet","Mobile"]),{},Object(p.i)("%s%sBottomMargin",{type:"number",default:""},["Title","Text","Link"],["","Tablet","Mobile"])),T=n(15);n.d(t,"name",function(){return P}),n.d(t,"settings",function(){return A});var P="ugb/expand",A={title:Object(r.__)("Expand / Show More",o.i18n),description:Object(r.__)("Display a small snippet of text. Your readers can toggle it to show more information.",o.i18n),icon:T.k,category:"layout",keywords:[Object(r.__)("Expand",o.i18n),Object(r.__)("Show more/less",o.i18n),Object(r.__)("Stackable",o.i18n)],attributes:B,example:{attributes:{title:"Title for This Block",showTitle:!0,titleLineHeightUnit:"em",titleTabletLineHeightUnit:"em",titleMobileLineHeightUnit:"em",text:"

    Some short text that can be expanded to show more details.

    ",moreText:"

    Some short text that can be expanded to show more details. Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.

    ",textFontSize:16,textLineHeightUnit:"em",textTabletLineHeightUnit:"em",textMobileLineHeightUnit:"em",moreLabel:"Show more",lessLabel:"Show less",linkFontSize:18,linkLineHeightUnit:"em",linkTabletLineHeightUnit:"em",linkMobileLineHeightUnit:"em",uniqueClass:"ugb-84c0eed",hideDesktop:!1,hideTablet:!1,hideMobile:!1}},supports:{inserter:!o.disabledBlocks.includes(P),anchor:!0},deprecated:b,edit:C,save:x,modules:{"advanced-general":!0,"advanced-block-spacing":!0,"advanced-responsive":!0,"content-align":!0,"custom-css":{default:Object(l.applyFilters)("stackable.expand.custom-css.default","")}}}},function(e,t,n){"use strict";n.r(t);var a=n(15),i=n(4),o=n(8),r=n.n(o),l=function(e){var t=e.className,n=e.attributes,a=n.height,o=n.design,l=void 0===o?"":o,c=r()([t,"ugb-spacer"]);return wp.element.createElement("div",{className:c,style:{height:a+"px"}},Object(i.applyFilters)("stackable.spacer.save.output.before_1_15_4",null,l,e))},c=[{attributes:function(e){var t=e.className,n=e.attributes.design,a=void 0===n?"":n,o=r()([t,"ugb-spacer"]);return wp.element.createElement("div",{className:o,style:"height:undefinedpx"},Object(i.applyFilters)("stackable.spacer.save.output.before_1_15_4",null,a,e))},save:l},{attributes:{height:{default:50,type:"number"},customCSSUniqueID:{type:"string",default:""},customCSS:{type:"string",default:""},customCSSCompiled:{type:"string",default:""}},save:l}],s=n(3),u=n(10),b=n(2),p=n(14),m=n.n(p);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}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}var f=function(e){var t=Object(b.b)(e.attributes),n=[];return n.push({desktopTablet:{".ugb-spacer":{height:t("height","%s".concat(t("heightUnit")||"px"))}},tabletOnly:{".ugb-spacer":{height:t("tabletHeight","%s".concat(t("tabletHeightUnit")||"px"))}},mobile:{".ugb-spacer":{height:t("mobileHeight","%s".concat(t("mobileHeightUnit")||"px"))}}}),n.push(function(e){for(var t=1;t .ugb-video-background, ")+".".concat(f,"-wrapper:before"),{borderRadius:s("borderRadius","%spx !important")||"12px !important"})),r));g.border&&b.push(p({},Object(o.p)("column%s",".".concat(f,"-column-wrapper"),e.attributes)));b.push(p({},g.columnBackground?Object(o.m)("column%s","".concat(f,"-column-wrapper"),e.attributes,{importantBackgroundColor:!0}):{})),b.push({saveOnly:Object(c.first)(Object(o.F)("> .ugb-inner-block > .ugb-block-content > *","%sColumnContentVerticalAlign","justifyContent","%s",e.attributes,{important:!0})),editor:Object(c.first)(Object(o.F)("> .ugb-inner-block > .ugb-block-content > .ugb-column__item","%sColumnContentVerticalAlign","justifyContent","%s",e.attributes,{important:!0}))}),b.push((m(t={},".".concat(f,"-column-wrapper .ugb-column__content-wrapper"),{width:Object(o.c)(s("contentWidth","%s".concat(s("contentWidthUnit")||"%")))}),m(t,"tablet",m({},".".concat(f,"-column-wrapper .ugb-column__content-wrapper"),{width:Object(o.c)(s("contentTabletWidth","%s".concat(s("contentTabletWidthUnit")||"%")))})),m(t,"mobile",m({},".".concat(f,"-column-wrapper .ugb-column__content-wrapper"),{width:Object(o.c)(s("contentMobileWidth","%s".concat(s("contentMobileWidthUnit")||"%")))})),t));var h=e.attributes,v=h.columnPaddingUnit,y=void 0===v?"px":v,O=h.tabletColumnPaddingUnit,w=void 0===O?"px":O,_=h.mobileColumnPaddingUnit,k=void 0===_?"px":_;b.push({saveOnly:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > *":Object(o.d)({paddingTop:s("columnPaddingTop","%s".concat(y)),paddingBottom:s("columnPaddingBottom","%s".concat(y)),paddingRight:s("columnPaddingRight","%s".concat(y)),paddingLeft:s("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > *":Object(o.d)({paddingTop:s("tabletColumnPaddingTop","%s".concat(w)),paddingRight:s("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:s("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:s("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > *":Object(o.d)({paddingTop:s("mobileColumnPaddingTop","%s".concat(k)),paddingRight:s("mobileColumnPaddingRight","%s".concat(k)),paddingBottom:s("mobileColumnPaddingBottom","%s".concat(k)),paddingLeft:s("mobileColumnPaddingLeft","%s".concat(k))})}},editor:{desktopTablet:{"> .ugb-inner-block > .ugb-block-content > .ugb-column__item":Object(o.d)({paddingTop:s("columnPaddingTop","%s".concat(y)),paddingBottom:s("columnPaddingBottom","%s".concat(y)),paddingRight:s("columnPaddingRight","%s".concat(y)),paddingLeft:s("columnPaddingLeft","%s".concat(y))})},tabletOnly:{"> .ugb-inner-block > .ugb-block-content > .ugb-column__item":Object(o.d)({paddingTop:s("tabletColumnPaddingTop","%s".concat(w)),paddingRight:s("tabletColumnPaddingRight","%s".concat(w)),paddingBottom:s("tabletColumnPaddingBottom","%s".concat(w)),paddingLeft:s("tabletColumnPaddingLeft","%s".concat(w))})},mobile:{"> .ugb-inner-block > .ugb-block-content > .ugb-column__item":Object(o.d)({paddingTop:s("mobileColumnPaddingTop","%s".concat(k)),paddingRight:s("mobileColumnPaddingRight","%s".concat(k)),paddingBottom:s("mobileColumnPaddingBottom","%s".concat(k)),paddingLeft:s("mobileColumnPaddingLeft","%s".concat(k))})}}});var j=e.attributes,C=j.contentWidth,x=void 0===C?"":C,E=j.contentTabletWidth,S=void 0===E?"":E,B=j.contentMobileWidth,T=void 0===B?"":B;x&&b.push(m({},".".concat(f,"-column-wrapper"),{alignItems:Object(o.c)(s("contentHorizontalAlign"))})),(x||S)&&b.push({tablet:m({},".".concat(f,"-column-wrapper"),{alignItems:Object(o.c)(s("contentTabletHorizontalAlign"))})}),(x||S||T)&&b.push({mobile:m({},".".concat(f,"-column-wrapper"),{alignItems:Object(o.c)(s("contentMobileHorizontalAlign"))})});var P=e.attributes,A=P.columnBackgroundColor,N=void 0===A?"":A,M=P.headingColor,R=void 0===M?"":M,D=P.bodyTextColor,F=void 0===D?"":D;return b.push((m(n={},"h1, h2, h3, h4, h5, h6",{color:s("headingColor")}),m(n,"p, li, label, table",{color:s("bodyTextColor")}),m(n,"a, a:visited, a:focus",{color:s("linkColor")}),m(n,"a:hover",{color:s("linkHoverColor")}),n)),b.push((m(i={},".".concat(f,"-column-wrapper > * > h1, ")+".".concat(f,"-column-wrapper > * > h2, ")+".".concat(f,"-column-wrapper > * > h3, ")+".".concat(f,"-column-wrapper > * > h4, ")+".".concat(f,"-column-wrapper > * > h5, ")+".".concat(f,"-column-wrapper > * > h6"),{color:Object(o.wb)(R,g.columnBackground&&N)}),m(i,".".concat(f,"-column-wrapper > * > p, ")+".".concat(f,"-column-wrapper > * > ol li, ")+".".concat(f,"-column-wrapper > * > ul li"),{color:Object(o.wb)(F,g.columnBackground&&N)}),m(i,"editor",(m(a={},".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h1, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h2, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h3, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h4, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h5, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/heading"] h6'),{color:Object(o.wb)(R,g.columnBackground&&N)}),m(a,".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/paragraph"] p, ')+".".concat(f,'-column-wrapper > * > * > * > [data-type*="core/list"] li'),{color:Object(o.wb)(F,g.columnBackground&&N)}),a)),i)),l.a.all(b)},d=n(272),f=n.n(d),h=n(273),v=n.n(h),y=n(3),O=n(10),w=n(8),_=n.n(w),k=n(0),j=n(6),C=n(9),x=n(12),E=n(13);function S(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0}}))(function(e){var t,n,a,i=e.className,o=e.hasInnerBlocks,r=e.attributes,l=r.design,c=void 0===l?"plain":l,u=r.shadow,b=void 0===u?"":u,p=r.uniqueClass,m=void 0===p?"":p,g=_()([i,"ugb-column--design-".concat(c)],Object(s.applyFilters)("stackable.columns.mainclasses",{},e)),d=_()(["ugb-column__item","".concat(m,"-column-wrapper")],(t={},n="ugb--shadow-".concat(b),a=""!==b,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement(y.k.Edit,{className:g,blockProps:e,render:function(){return wp.element.createElement(j.Fragment,null,wp.element.createElement(y.H,{className:d,backgroundAttrName:"column%s",blockProps:e},wp.element.createElement("div",{className:"ugb-column__content-wrapper"},wp.element.createElement(C.InnerBlocks,{templateLock:!1,renderAppender:o?void 0:function(){return wp.element.createElement(C.InnerBlocks.ButtonBlockAppender,null)}}))))}})});var T=Object(x.compose)(O.i,Object(O.a)(g))(function(e){var t,n,a,i=e.className,o=e.attributes,r=o.design,l=void 0===r?"plain":r,c=o.shadow,u=void 0===c?"":c,b=o.uniqueClass,p=void 0===b?"":b,m=_()([i,"ugb-column--design-".concat(l)],Object(s.applyFilters)("stackable.columns.mainclasses",{},e)),g=_()(["ugb-column__item","".concat(p,"-column-wrapper")],(t={},n="ugb--shadow-".concat(u),a=""!==u,n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t));return wp.element.createElement(y.k.Save,{className:m,blockProps:e,render:function(){return wp.element.createElement(j.Fragment,null,wp.element.createElement(y.H,{className:g,backgroundAttrName:"column%s",blockProps:e},wp.element.createElement("div",{className:"ugb-column__content-wrapper"},wp.element.createElement(C.InnerBlocks.Content,null))))}})});function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=function(e){for(var t=1;t/g,c=/<\/?([^\s\/>]+)/;function f(e,t,n){return p(e=e||"",d(t=t||[],n=n||""))}function d(e,t){return{allowable_tags:e=function(e){let t=new Set;if("string"==typeof e){let n;for(;n=u.exec(e);)t.add(n[1])}else a.nonNative||"function"!=typeof e[a.iterator]?"function"==typeof e.forEach&&e.forEach(t.add,t):t=new Set(e);return t}(e),tag_replacement:t,state:i,tag_buffer:"",depth:0,in_quote_char:""}}function p(e,t){let n=t.allowable_tags,r=t.tag_replacement,o=t.state,a=t.tag_buffer,u=t.depth,c=t.in_quote_char,f="";for(let t=0,d=e.length;t":if(c)break;if(u){u--;break}c="",o=i,a+=">",n.has(h(a))?f+=a:f+=r,a="";break;case'"':case"'":c=d===c?"":c||d,a+=d;break;case"-":"":"--"==a.slice(-2)&&(o=i),a="";break;default:a+=d}}return t.state=o,t.tag_buffer=a,t.depth=u,t.in_quote_char=c,f}function h(e){let t=c.exec(e);return t?t[1].toLowerCase():null}f.init_streaming_mode=function(e,t){let n=d(e=e||[],t=t||"");return function(e){return p(e||"",n)}},void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}()},,function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},,,,function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.isValidCharacterReference=E,t.getTextPiecesSplitOnWhitespace=C,t.getTextWithCollapsedWhitespace=P,t.getMeaningfulAttributePairs=j,t.isEquivalentTextTokens=N,t.getNormalizedStyleValue=D,t.getStyleProperties=A,t.isEqualTagAttributePairs=M,t.getNextNonWhitespaceToken=B,t.isClosedByToken=R,t.isEquivalentHTML=z,t.getBlockContentValidationResult=H,t.isValidBlockContent=function(e,t,n){return H(e,t,n,(0,p.createLogger)()).isValid},t.isEqualTokensOfType=t.isEqualAttributesOfName=t.DecodeEntityParser=void 0;var o=r(n(40)),a=r(n(23)),i=r(n(416)),l=r(n(43)),s=r(n(418)),u=r(n(419)),c=n(58),f=n(7),d=n(420),p=n(421),h=n(44),g=n(34);function m(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}var b=/[\t\n\r\v\f ]+/g,v=/^[\t\n\r\v\f ]*$/,y=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,w=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],k=[].concat(w,["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),_=[f.identity,P],x=/^[\da-z]+$/i,S=/^#\d+$/,T=/^#x[\da-f]+$/i;function E(e){return x.test(e)||S.test(e)||T.test(e)}var O=function(){function e(){(0,s.default)(this,e)}return(0,u.default)(e,[{key:"parse",value:function(e){if(E(e))return(0,d.decodeEntities)("&"+e+";")}}]),e}();function C(e){return e.trim().split(b)}function P(e){return C(e).join(" ")}function j(e){return e.attributes.filter(function(e){var t=(0,l.default)(e,2),n=t[0];return t[1]||0===n.indexOf("data-")||(0,f.includes)(k,n)})}function N(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,p.createLogger)(),r=e.chars,o=t.chars,a=0;a<_.length;a++){var i=_[a];if((r=i(r))===(o=i(o)))return!0}return n.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function D(e){return e.replace(y,"url($1)")}function A(e){var t=e.replace(/;?\s*$/,"").split(";").map(function(e){var t=e.split(":"),n=(0,i.default)(t),r=n[0],o=n.slice(1).join(":");return[r.trim(),D(o.trim())]});return(0,f.fromPairs)(t)}t.DecodeEntityParser=O;var I=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:(0,p.createLogger)();if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;for(var r={},o=0;o2&&void 0!==arguments[2]?arguments[2]:(0,p.createLogger)();return e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):M.apply(void 0,(0,o.default)([e,t].map(j)).concat([n]))},Chars:N,Comment:N};function B(e){for(var t;t=e.shift();){if("Chars"!==t.type)return t;if(!v.test(t.chars))return t}}function R(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function z(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,p.createLogger)(),a=[e,t].map(function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,p.createLogger)();try{return new c.Tokenizer(new O).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}(e,o)}),i=(0,l.default)(a,2),s=i[0],u=i[1];if(!s||!u)return!1;for(;n=B(s);){if(!(r=B(u)))return o.warning("Expected end of content, instead saw %o.",n),!1;if(n.type!==r.type)return o.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",r.type,r,n.type,n),!1;var f=L[n.type];if(f&&!f(n,r,o))return!1;R(n,u[0])?B(u):R(r,s[0])&&B(s)}return!(r=B(u))||(o.warning("Expected %o, instead saw end of content.",r),!1)}function H(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,p.createQueuedLogger)(),a=(0,g.normalizeBlockType)(e);try{r=(0,h.getSaveContent)(a,t)}catch(e){return o.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),{isValid:!1,validationIssues:o.getItems()}}var i=z(n,r,o);return i||o.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",a.name,a,r,n),{isValid:i,validationIssues:o.getItems()}}t.isEqualTokensOfType=L},function(e,t,n){"use strict";var r=n(387),o=n(392),a=n(394);e.exports=function(e){var t,n=r(e);return n.space?((t=Array(3))[0]=a(n.values[0],0,255),t[1]=a(n.values[1],0,255),t[2]=a(n.values[2],0,255),"h"===n.space[0]&&(t=o.rgb(t)),t.push(a(n.alpha,0,1)),t):[]}},,function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.unstable__bootstrapServerSideBlockDefinitions=function(e){t.serverSideBlockDefinitions=p=f({},p,{},e)},t.registerBlockType=function(e,t){if(t=f({name:e},d,{},(0,a.get)(p,e),{},t),"string"!=typeof e)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(e))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,l.select)("core/blocks").getBlockType(e))return void console.error('Block "'+e+'" is already registered.');var n=f({},t);(t=(0,i.applyFilters)("blocks.registerBlockType",t,e)).deprecated&&(t.deprecated=t.deprecated.map(function(t){return(0,a.pick)((0,i.applyFilters)("blocks.registerBlockType",f({},(0,a.omit)(n,u.DEPRECATED_ENTRY_KEYS),{},t),e),u.DEPRECATED_ENTRY_KEYS)}));if(!(0,a.isPlainObject)(t))return void console.error("Block settings must be a valid object.");if(!(0,a.isFunction)(t.save))return void console.error('The "save" property must be a valid function.');if("edit"in t&&!(0,a.isFunction)(t.edit))return void console.error('The "edit" property must be a valid function.');if(!("category"in t))return void console.error('The block "'+e+'" must have a category.');if("category"in t&&!(0,a.some)((0,l.select)("core/blocks").getCategories(),{slug:t.category}))return void console.error('The block "'+e+'" must have a registered category.');if(!("title"in t)||""===t.title)return void console.error('The block "'+e+'" must have a title.');if("string"!=typeof t.title)return void console.error("Block titles must be strings.");if(t.icon=(0,s.normalizeIconObject)(t.icon),!(0,s.isValidIcon)(t.icon.src))return void console.error("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional");return(0,l.dispatch)("core/blocks").addBlockTypes(t),t},t.registerBlockCollection=function(e,t){var n=t.title,r=t.icon;(0,l.dispatch)("core/blocks").addBlockCollection(e,n,r)},t.unregisterBlockCollection=function(e){(0,l.dispatch)("core/blocks").removeBlockCollection(e)},t.unregisterBlockType=function(e){var t=(0,l.select)("core/blocks").getBlockType(e);if(!t)return void console.error('Block "'+e+'" is not registered.');return(0,l.dispatch)("core/blocks").removeBlockTypes(e),t},t.setFreeformContentHandlerName=function(e){(0,l.dispatch)("core/blocks").setFreeformFallbackBlockName(e)},t.getFreeformContentHandlerName=function(){return(0,l.select)("core/blocks").getFreeformFallbackBlockName()},t.getGroupingBlockName=function(){return(0,l.select)("core/blocks").getGroupingBlockName()},t.setUnregisteredTypeHandlerName=function(e){(0,l.dispatch)("core/blocks").setUnregisteredFallbackBlockName(e)},t.getUnregisteredTypeHandlerName=function(){return(0,l.select)("core/blocks").getUnregisteredFallbackBlockName()},t.setDefaultBlockName=function(e){(0,l.dispatch)("core/blocks").setDefaultBlockName(e)},t.setGroupingBlockName=function(e){(0,l.dispatch)("core/blocks").setGroupingBlockName(e)},t.getDefaultBlockName=function(){return(0,l.select)("core/blocks").getDefaultBlockName()},t.getBlockType=function(e){return(0,l.select)("core/blocks").getBlockType(e)},t.getBlockTypes=function(){return(0,l.select)("core/blocks").getBlockTypes()},t.getBlockSupport=function(e,t,n){return(0,l.select)("core/blocks").getBlockSupport(e,t,n)},t.hasBlockSupport=function(e,t,n){return(0,l.select)("core/blocks").hasBlockSupport(e,t,n)},t.isReusableBlock=function(e){return"core/block"===e.name},t.unregisterBlockVariation=t.registerBlockVariation=t.unregisterBlockStyle=t.registerBlockStyle=t.hasChildBlocksWithInserterSupport=t.hasChildBlocks=t.getChildBlockNames=t.serverSideBlockDefinitions=t.DEFAULT_BLOCK_TYPE_SETTINGS=void 0;var o=r(n(23)),a=n(7),i=n(4),l=n(13),s=n(34),u=n(76);function c(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 f(e){for(var t=1;t0||e.offsetHeight>0||e.getClientRects().length>0}function l(e){var t=e.querySelectorAll(a);return Array.from(t).filter(function(e){return!!i(e)&&("AREA"!==e.nodeName||function(e){var t=e.closest("map[name]");if(!t)return!1;var n=document.querySelector('img[usemap="#'+t.name+'"]');return!!n&&i(n)}(e))})}var s=n(7);function u(e){var t=e.getAttribute("tabindex");return null===t?0:parseInt(t,10)}function c(e){return-1!==u(e)}function f(e,t){return{element:e,index:t}}function d(e){return e.element}function p(e,t){var n=u(e.element),r=u(t.element);return n===r?e.index-t.index:n-r}function h(e){return e.filter(c).map(f).sort(p).map(d).reduce((t={},function(e,n){var r=n.nodeName,o=n.type,a=n.checked,i=n.name;if("INPUT"!==r||"radio"!==o||!i)return e.concat(n);var l=t.hasOwnProperty(i);if(!a&&l)return e;if(l){var u=t[i];e=Object(s.without)(e,u)}return t[i]=n,e.concat(n)}),[]);var t}function g(e){return h(l(e))}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,t=l(document.body),n=t.indexOf(e);return t.length=n,Object(s.last)(h(t))}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,t=l(document.body),n=t.indexOf(e),r=t.slice(n+1).filter(function(t){return!e.contains(t)});return Object(s.first)(h(r))}var v=window,y=v.DOMParser,w=v.getComputedStyle,k=window.Node,_=k.TEXT_NODE,x=k.ELEMENT_NODE,S=k.DOCUMENT_POSITION_PRECEDING,T=k.DOCUMENT_POSITION_FOLLOWING;function E(e,t,n){if(Object(s.includes)(["INPUT","TEXTAREA"],e.tagName))return e.selectionStart===e.selectionEnd&&(t?0===e.selectionStart:e.value.length===e.selectionStart);if(!e.isContentEditable)return!0;var r=window.getSelection();if(!r.rangeCount)return!1;var o=r.getRangeAt(0),a=o.cloneRange(),i=function(e){var t=e.anchorNode,n=e.focusNode,r=e.anchorOffset,o=e.focusOffset,a=t.compareDocumentPosition(n);return!(a&S)&&(!!(a&T)||(0!==a||r<=o))}(r),l=r.isCollapsed;l||a.collapse(!i);var u=P(a);if(!u)return!1;var c=window.getComputedStyle(e),f=parseInt(c.lineHeight,10)||0;if(!l&&u.height>f&&i===t)return!1;var d=parseInt(c["padding".concat(t?"Top":"Bottom")],10)||0,p=3*parseInt(f,10)/4,h=e.getBoundingClientRect(),g=P(o);if(!(t?h.top+d>g.top-p:h.bottom-d3&&void 0!==arguments[3])||arguments[3];if(e)if(n&&e.isContentEditable){var o=n.height/2,a=e.getBoundingClientRect(),i=n.left,l=t?a.bottom-o:a.top+o,s=D(document,i,l,e);if(!s||!e.contains(s.startContainer))return!r||s&&s.startContainer&&s.startContainer.contains(e)?void N(e,t):(e.scrollIntoView(t),void A(e,t,n,!1));var u=window.getSelection();u.removeAllRanges(),u.addRange(s),e.focus(),u.removeAllRanges(),u.addRange(s)}else N(e,t)}function I(e){try{var t=e.nodeName,n=e.selectionStart,r=e.contentEditable;return"INPUT"===t&&null!==n||"TEXTAREA"===t||"true"===r}catch(e){return!1}}function M(){if(I(document.activeElement))return!0;var e=window.getSelection(),t=e.rangeCount?e.getRangeAt(0):null;return t&&!t.collapsed}function L(e){if(Object(s.includes)(["INPUT","TEXTAREA"],e.nodeName))return 0===e.selectionStart&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;var t=window.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;if(!n)return!0;var r=n.startContainer,o=n.endContainer,a=n.startOffset,i=n.endOffset;if(r===e&&o===e&&0===a&&i===e.childNodes.length)return!0;var l=e.lastChild,u=l.nodeType===_?l.data.length:l.childNodes.length;return r===e.firstChild&&o===e.lastChild&&0===a&&i===u}function B(e){if(e){if(e.scrollHeight>e.clientHeight){var t=window.getComputedStyle(e).overflowY;if(/(auto|scroll)/.test(t))return e}return B(e.parentNode)}}function R(e){for(var t;(t=e.parentNode)&&t.nodeType!==x;);return t?"static"!==w(t).position?t:t.offsetParent:null}function z(e,t){q(t,e.parentNode),H(e)}function H(e){e.parentNode.removeChild(e)}function q(e,t){t.parentNode.insertBefore(e,t.nextSibling)}function F(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function U(e,t){for(var n=e.ownerDocument.createElement(t);e.firstChild;)n.appendChild(e.firstChild);return e.parentNode.replaceChild(n,e),n}function V(e,t){t.parentNode.insertBefore(e,t),e.appendChild(t)}function $(e){return(new y).parseFromString(e,"text/html").body.textContent||""}n.d(t,"focus",function(){return W}),n.d(t,"isHorizontalEdge",function(){return O}),n.d(t,"isVerticalEdge",function(){return C}),n.d(t,"getRectangleFromRange",function(){return P}),n.d(t,"computeCaretRect",function(){return j}),n.d(t,"placeCaretAtHorizontalEdge",function(){return N}),n.d(t,"placeCaretAtVerticalEdge",function(){return A}),n.d(t,"isTextField",function(){return I}),n.d(t,"documentHasSelection",function(){return M}),n.d(t,"isEntirelySelected",function(){return L}),n.d(t,"getScrollContainer",function(){return B}),n.d(t,"getOffsetParent",function(){return R}),n.d(t,"replace",function(){return z}),n.d(t,"remove",function(){return H}),n.d(t,"insertAfter",function(){return q}),n.d(t,"unwrap",function(){return F}),n.d(t,"replaceTag",function(){return U}),n.d(t,"wrap",function(){return V}),n.d(t,"__unstableStripHTML",function(){return $});var W={focusable:r,tabbable:o}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,a,i,l],c=0;(s=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.createBlock=p,t.cloneBlock=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r=arguments.length>2?arguments[2]:void 0;var o=(0,i.default)();return d({},t,{clientId:o,attributes:d({},t.attributes,{},n),innerBlocks:r||t.innerBlocks.map(function(t){return e(t)})})},t.getPossibleBlockTransformations=function(e){if((0,l.isEmpty)(e))return[];var t=g(e),n=m(e);return(0,l.uniq)([].concat((0,o.default)(t),(0,o.default)(n)))},t.findTransform=w,t.getBlockTransforms=k,t.switchToBlockType=function(e,t){var n=(0,l.castArray)(e),r=n.length>1,o=n[0],a=o.name;if(!v(t)&&r&&!y(n))return null;var i,c=k("from",t),f=w(k("to",a),function(e){return"block"===e.type&&(b(e)||-1!==e.blocks.indexOf(t))&&(!r||e.isMultiBlock)})||w(c,function(e){return"block"===e.type&&(b(e)||-1!==e.blocks.indexOf(a))&&(!r||e.isMultiBlock)});if(!f)return null;i=f.isMultiBlock?(0,l.has)(f,"__experimentalConvert")?f.__experimentalConvert(n):f.transform(n.map(function(e){return e.attributes}),n.map(function(e){return e.innerBlocks})):(0,l.has)(f,"__experimentalConvert")?f.__experimentalConvert(o):f.transform(o.attributes,o.innerBlocks);if(!(0,l.isObjectLike)(i))return null;if((i=(0,l.castArray)(i)).some(function(e){return!(0,u.getBlockType)(e.name)}))return null;var p=(0,l.findIndex)(i,function(e){return e.name===t});if(p<0)return null;return i.map(function(t,n){var r=d({},t,{clientId:n===p?o.clientId:t.clientId});return(0,s.applyFilters)("blocks.switchToBlockType.transformedBlock",r,e)})},t.getBlockFromExample=t.isBlockSelectionOfSameType=t.isContainerGroupBlock=t.isWildcardBlockTransform=void 0;var o=r(n(40)),a=r(n(23)),i=r(n(427)),l=n(7),s=n(4),u=n(30),c=n(34);function f(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 d(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=(0,u.getBlockType)(e),o=(0,l.reduce)(r.attributes,function(e,n,r){var o=t[r];return void 0!==o?e[r]=o:n.hasOwnProperty("default")&&(e[r]=n.default),-1!==["node","children"].indexOf(n.source)&&("string"==typeof e[r]?e[r]=[e[r]]:Array.isArray(e[r])||(e[r]=[])),e},{});return{clientId:(0,i.default)(),name:e,isValid:!0,attributes:o,innerBlocks:n}}var h=function(e,t,n){if((0,l.isEmpty)(n))return!1;var r=n.length>1,o=(0,l.first)(n).name;if(!(b(e)||!r||e.isMultiBlock))return!1;if(!b(e)&&!(0,l.every)(n,{name:o}))return!1;if(!("block"===e.type))return!1;var a=(0,l.first)(n);if(!("from"!==t||-1!==e.blocks.indexOf(a.name)||b(e)))return!1;if(!r&&v(a.name)&&v(e.blockName))return!1;if((0,l.isFunction)(e.isMatch)){var i=e.isMultiBlock?n.map(function(e){return e.attributes}):a.attributes;if(!e.isMatch(i))return!1}return!0},g=function(e){if((0,l.isEmpty)(e))return[];var t=(0,u.getBlockTypes)();return(0,l.filter)(t,function(t){return!!w(k("from",t.name),function(t){return h(t,"from",e)})})},m=function(e){if((0,l.isEmpty)(e))return[];var t=(0,l.first)(e),n=k("to",(0,u.getBlockType)(t.name).name),r=(0,l.filter)(n,function(t){return t&&h(t,"to",e)});return(0,l.flatMap)(r,function(e){return e.blocks}).map(function(e){return(0,u.getBlockType)(e)})},b=function(e){return e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*")};t.isWildcardBlockTransform=b;var v=function(e){return e===(0,u.getGroupingBlockName)()};t.isContainerGroupBlock=v;var y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!e.length)return!1;var t=e[0].name;return(0,l.every)(e,["name",t])};function w(e,t){for(var n=(0,s.createHooks)(),r=function(r){var o=e[r];t(o)&&n.addFilter("transform","transform/"+r.toString(),function(e){return e||o},o.priority)},o=0;o3&&void 0!==arguments[3]?arguments[3]:"vertical",o=e.title,a=m(e,t,"accessibility"),i=void 0!==n,l=a&&a!==o;if(i&&"vertical"===r)return l?(0,u.sprintf)((0,u.__)("%1$s Block. Row %2$d. %3$s"),o,n,a):(0,u.sprintf)((0,u.__)("%s Block. Row %d"),o,n);if(i&&"horizontal"===r)return l?(0,u.sprintf)((0,u.__)("%1$s Block. Column %2$d. %3$s"),o,n,a):(0,u.sprintf)((0,u.__)("%s Block. Column %d"),o,n);if(l)return(0,u.sprintf)((0,u.__)("%1$s Block. %2$s"),o,a);return(0,u.sprintf)((0,u.__)("%s Block"),o)};var a=o(n(23)),i=n(7),l=r(n(426)),s=n(6),u=n(0),c=n(31),f=n(30),d=n(33);function p(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}var h=["#191e23","#f8f9f9"];function g(e){return!!e&&((0,i.isString)(e)||(0,s.isValidElement)(e)||(0,i.isFunction)(e)||e instanceof s.Component)}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visual",r=e.__experimentalLabel,o=e.title,a=r&&r(t,{context:n});return a?(0,c.__unstableStripHTML)(a):o}},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.getPhrasingContentSchema=c,t.isPhrasingContent=function(e){var t=e.nodeName.toLowerCase();return c().hasOwnProperty(t)||"span"===t},t.isTextContent=function(e){var t=e.nodeName.toLowerCase();return s.hasOwnProperty(t)||"span"===t};var o=r(n(23)),a=n(7);function i(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 l(e){for(var t=1;t])/i.test(e)},t.deepFilterNodeList=m,t.deepFilterHTML=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,m(r.body.childNodes,t,r,n),r.body.innerHTML},t.removeInvalidHTML=function(e,t,n){var r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,function e(t,n,r,o){Array.from(t).forEach(function(t){var a=t.nodeName.toLowerCase();if(!r.hasOwnProperty(a)||r[a].isMatch&&!r[a].isMatch(t))e(t.childNodes,n,r,o),o&&!(0,u.isPhrasingContent)(t)&&t.nextElementSibling&&(0,l.insertAfter)(n.createElement("br"),t),(0,l.unwrap)(t);else if(t.nodeType===p){var s=r[a],c=s.attributes,f=void 0===c?[]:c,d=s.classes,h=void 0===d?[]:d,m=s.children,b=s.require,v=void 0===b?[]:b,y=s.allowEmpty;if(m&&!y&&g(t))return void(0,l.remove)(t);if(t.hasAttributes()&&(Array.from(t.attributes).forEach(function(e){var n=e.name;"class"===n||(0,i.includes)(f,n)||t.removeAttribute(n)}),t.classList&&t.classList.length)){var w=h.map(function(e){return"string"==typeof e?function(t){return t===e}:e instanceof RegExp?function(t){return e.test(t)}:i.noop});Array.from(t.classList).forEach(function(e){w.some(function(t){return t(e)})||t.classList.remove(e)}),t.classList.length||t.removeAttribute("class")}if(t.hasChildNodes()){if("*"===m)return;if(m)v.length&&!t.querySelector(v.join(","))?(e(t.childNodes,n,r,o),(0,l.unwrap)(t)):"BODY"===t.parentNode.nodeName&&(0,u.isPhrasingContent)(t)?(e(t.childNodes,n,r,o),Array.from(t.childNodes).some(function(e){return!(0,u.isPhrasingContent)(e)})&&(0,l.unwrap)(t)):e(t.childNodes,n,m,o);else for(;t.firstChild;)(0,l.remove)(t.firstChild)}}})}(r.body.childNodes,r,t,n),r.body.innerHTML},t.getSibling=function e(t,n){var r=t["".concat(n,"Sibling")];if(r&&(0,u.isPhrasingContent)(r))return r;var o=t.parentNode;if(!o||!(0,u.isPhrasingContent)(o))return;return e(o,n)};var o=r(n(23)),a=r(n(40)),i=n(7),l=n(31),s=n(77),u=n(35);function c(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 f(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[],r=(0,c.normalizeBlockType)(e),u=r.save;if(u.prototype instanceof o.Component){var p=new u({attributes:t});u=p.render.bind(p)}var h=u({attributes:t,innerBlocks:n});if((0,i.isObject)(h)&&(0,l.hasFilter)("blocks.getSaveContent.extraProps")){var g=(0,l.applyFilters)("blocks.getSaveContent.extraProps",function(e){for(var t=1;t/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}function b(e){var t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=h(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function v(e,t,n){var r=(0,i.isEmpty)(t)?"":m(t)+" ",o=(0,i.startsWith)(e,"core/")?e.slice(5):e;return n?"\x3c!-- wp:".concat(o," ").concat(r,"--\x3e\n")+n+"\n\x3c!-- /wp:".concat(o," --\x3e"):"\x3c!-- wp:".concat(o," ").concat(r,"/--\x3e")}function y(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isInnerBlocks,n=void 0!==t&&t,r=e.name,o=b(e);return r===(0,u.getUnregisteredTypeHandlerName)()||!n&&r===(0,u.getFreeformContentHandlerName)()?o:v(r,g((0,u.getBlockType)(r),e.attributes),o)}},function(e,t,n){var r=n(425);function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(n,i,l):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.isOfType=x,t.isOfTypes=S,t.isValidByType=T,t.isValidByEnum=E,t.isAmbiguousStringSource=function(e){var t=e.source,n=e.type,r=k.has(t),o="string"==typeof n;return r&&o},t.matcherFromSource=O,t.parseWithAttributeSchema=C,t.getBlockAttribute=P,t.getBlockAttributes=j,t.getMigratedBlock=N,t.createBlockWithFallback=D,t.serializeBlockNode=A,t.default=t.parseWithGrammar=t.toBooleanAttributeMatcher=void 0;var o=r(n(43)),a=r(n(40)),i=r(n(23)),l=n(84),s=n(7),u=n(484),c=n(4),f=n(485),d=n(30),p=n(33),h=n(27),g=n(44),m=n(432),b=n(34),v=n(76);function y(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 w(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},r=(0,b.normalizeBlockType)(e),o=(0,s.mapValues)(r.attributes,function(e,r){return P(r,e,t,n)});return(0,c.applyFilters)("blocks.getBlockAttributes",o,r,t,n)}function N(e,t){var n=(0,d.getBlockType)(e.name),r=n.deprecated;if(!r||!r.length)return e;for(var i=e,l=i.originalContent,u=i.innerBlocks,c=0;c0&&(k.isValid?console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",m.name,m,(0,g.getSaveContent)(m,k.attributes),k.originalContent):k.validationIssues.forEach(function(e){var t=e.log,n=e.args;return t.apply(void 0,(0,a.default)(n))})),k}}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isCommentDelimited,r=void 0===n||n,o=e.blockName,a=e.attrs,i=void 0===a?{}:a,l=e.innerBlocks,s=void 0===l?[]:l,u=e.innerContent,c=0,f=(void 0===u?[]:u).map(function(e){return null!==e?e:A(s[c++],t)}).join("\n").replace(/\n+/g,"\n").trim();return r?(0,g.getCommentDelimitedContent)(o,i,f):f}t.toBooleanAttributeMatcher=_;var I,M=(I=f.parse,function(e){return I(e).reduce(function(e,t){var n=D(t);return n&&e.push(n),e},[])});t.parseWithGrammar=M;var L=M;t.default=L},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(410)},,,,function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(){return(o=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,r=t.emitMouse,o=t.emitTouch;return k({},e,{onMouseDown:y(e.onMouseDown,r),onTouchStart:y(e.onTouchStart,o)})}),n}return p(t,g["Component"]),l(t,[{key:"render",value:function(){var e=this.getRailProps,t=this.props,n=t.getEventData,r=t.activeHandleID,o=(0,t.children)({getEventData:n,activeHandleID:r,getRailProps:e});return o&&m.a.Children.only(o)}}]),t}();_.propTypes={};var x=_,S=function(e){function t(){return a(this,t),c(this,f(t).apply(this,arguments))}return p(t,g["Component"]),l(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.values,r=e.scale,o=e.count,a=t({getEventData:e.getEventData,activeHandleID:e.activeHandleID,ticks:(n||r.getTicks(o)).map(function(e){return{id:"$$-".concat(e),value:e,percent:r.getValue(e)}})});return a&&m.a.Children.only(a)}}]),t}();S.propTypes={},S.defaultProps={count:10};var T=S;function E(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 O(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,r=t.emitMouse,o=t.emitTouch;return O({},e,{onMouseDown:y(e.onMouseDown,r),onTouchStart:y(e.onTouchStart,o)})}),n}return p(t,g["Component"]),l(t,[{key:"render",value:function(){for(var e=this.getTrackProps,t=this.props,n=t.children,r=t.left,o=t.right,a=t.scale,i=t.handles,l=t.getEventData,s=t.activeHandleID,u=a.getDomain(),c=[],f=0;f1&&void 0!==arguments[1]?arguments[1]:{},r=n.props,o=r.emitKeyboard,a=r.emitMouse,i=r.emitTouch;return N({},t,{onKeyDown:y(t.onKeyDown,function(t){return o(t,e)}),onMouseDown:y(t.onMouseDown,n.autofocus,function(t){return a(t,e)}),onTouchStart:y(t.onTouchStart,function(t){return i(t,e)})})}),n}return p(t,g["Component"]),l(t,[{key:"render",value:function(){var e=this.getHandleProps,t=this.props,n=t.activeHandleID,r=(0,t.children)({handles:t.handles,activeHandleID:n,getHandleProps:e});return r&&m.a.Children.only(r)}}]),t}();D.propTypes={};var A=D;function I(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);tn.val?e?-1:1:n.val>t.val?e?1:-1:0}}function B(e,t,n,r){var o=e.findIndex(function(e){return e.key===t});if(-1!==o){var a=e[o],i=a.key;return a.val===n?e:[].concat(I(e.slice(0,o)),[{key:i,val:n}],I(e.slice(o+1))).sort(L(r))}return e}function R(e,t){if(!e)return[0,0];var n=e.getBoundingClientRect();return[t?n.top:n.left,t?n.bottom:n.right]}function z(e){var t=e.type,n=void 0===t?"":t,r=e.touches;return!r||r.length>1||"touchend"===n.toLowerCase()&&r.length>0}function H(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=0;return{handles:e.map(function(e){var t=n.getValue(e);return e!==t&&(o+=1,v()(!r,"".concat(M," Invalid value encountered. Changing ").concat(e," to ").concat(t,"."))),t}).map(function(e,t){return{key:"$$-".concat(t),val:e}}).sort(L(t)),changes:o}}var F=function(e,t){return et?1:e>=t?0:NaN};var U,V;1===(U=F).length&&(V=U,U=function(e,t){return F(V(e),t)});var $=Array.prototype,W=($.slice,$.map,Math.sqrt(50)),G=Math.sqrt(10),K=Math.sqrt(2),Q=function(e,t,n){var r,o,a,i,l=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t=0?(a>=W?10:a>=G?5:a>=K?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(a>=W?10:a>=G?5:a>=K?2:1)}(e,t,n))||!isFinite(i))return[];if(i>0)for(e=Math.ceil(e/i),t=Math.floor(t/i),a=new Array(o=Math.ceil(t-e+1));++ll?s:l)}),this.step=1,this.domain=[0,1],this.range=[0,1]},J="undefined"!=typeof window&&"undefined"!=typeof document,ee=function(){},te=function(e,t,n,r){var o=r?e-t:e+t;return r?Math.max(n[0],o):Math.min(n[1],o)},ne=function(e,t,n,r){var o=r?e+t:e-t;return r?Math.min(n[1],o):Math.max(n[0],o)},re=function(e){function t(){var e,n;a(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0)}if(-1===i)return t;for(var f=l?r:-r,d=0;db,"".concat(M," Max must be greater than min (even if reversed). Max is ").concat(y,". Min is ").concat(b,"."));var w=q(i||t.values,s,p,f),k=w.handles;(w.changes||void 0===i||i===t.values)&&(u(k.map(function(e){return e.val})),c(k.map(function(e){return e.val}))),g.step=a,g.values=i,g.domain=l,g.handles=k,g.reversed=s}else if(n=i,o=t.values,!(n===o||n.length===o.length&&n.reduce(function(e){return function(t,n,r){return t&&e[r]===n}}(o),!0))){var _=q(i,s,p,f),x=_.handles;_.changes&&(u(x.map(function(e){return e.val})),c(x.map(function(e){return e.val}))),g.values=i,g.handles=x}return Object.keys(g).length?g:null}}]),t}();re.propTypes={},re.defaultProps={mode:1,step:.1,domain:[0,100],component:"div",rootProps:{},rootStyle:{},vertical:!1,reversed:!1,onChange:ee,onUpdate:ee,onSlideStart:ee,onSlideEnd:ee,disabled:!1,flatten:!1,warnOnChanges:!1};var oe=re;n.d(t,"c",function(){return oe}),n.d(t,"b",function(){return x}),n.d(t,"a",function(){return A}),oe.Rail=x,oe.Ticks=T,oe.Tracks=P,oe.Handles=A},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],a=0;a=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122?o+=r.charAt(i):l<128?o+=a[l]:l<2048?o+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?o+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(i+=1,l=65536+((1023&l)<<10|1023&r.charCodeAt(i)),o+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,a){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(a&&(a.plainObjects||a.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var l=t;return o(t)&&!o(n)&&(l=i(t,a)),o(t)&&o(n)?(n.forEach(function(n,o){if(r.call(t,o)){var i=t[o];i&&"object"==typeof i&&n&&"object"==typeof n?t[o]=e(i,n,a):t.push(n)}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var i=n[o];return r.call(t,o)?t[o]=e(t[o],i,a):t[o]=i,t},l)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!0;var i={},l=void 0,s=void 0;for(l=0,s=n.length;l",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},o=/^#[xX]([A-Fa-f0-9]+)$/,a=/^#([0-9]+)$/,i=/^([A-Za-z0-9]+)$/,l=function(){function e(e){this.named=e}return e.prototype.parse=function(e){if(e){var t=e.match(o);return t?String.fromCharCode(parseInt(t[1],16)):(t=e.match(a))?String.fromCharCode(parseInt(t[1],10)):(t=e.match(i))?this.named[t[1]]:void 0}},e}(),s=/[\t\n\f ]/,u=/[A-Za-z]/,c=/\r\n?/g;function f(e){return s.test(e)}function d(e){return u.test(e)}var p=function(){function e(e,t){this.delegate=e,this.entityParser=t,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer.toLowerCase();"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||d(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){"-"===this.consume()&&"-"===this.peek()&&(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment())},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();f(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();f(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();f(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();f(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();f(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();f(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();f(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();f(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||d(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(c,"\n")}(e);this.index"!==this.input.substring(this.index,this.index+8)||"style"===e&&""!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),h=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new p(this,e),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(T)}}]),e}();function T(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function E(e,t){return Object.keys(e).reduce(function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n},{})}var O={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},C=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function P(e,t){Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function j(e,t){e.style["".concat(C,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function N(e,t){e.style["".concat(C,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function D(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function A(e,t,n){return Math.max(e,Math.min(n,t))}function I(e){return"px"===e.substr(-2)?parseFloat(e):0}function M(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function L(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function B(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function R(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:R(e.parentNode,t,r)}}function z(e){var t=e.lockOffset,n=e.width,r=e.height,o=t,a=t,i="px";if("string"==typeof t){var l=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);_()(null!==l,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),a=parseFloat(t),i=l[1]}return _()(isFinite(o)&&isFinite(a),"lockOffset value should be a finite. Given %s",t),"%"===i&&(o=o*n/100,a=a*r/100),{x:o,y:a}}function H(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find(function(e){return n.test(t[e])})}(e)?e:H(e.parentNode):null}var q=27,F=32,U=37,V=38,$=39,W=40,G={Anchor:"A",Button:"BUTTON",Canvas:"CANVAS",Input:"INPUT",Option:"OPTION",Textarea:"TEXTAREA",Select:"SELECT"};function K(e){return null!=e.sortableHandle}var Q=function(){function e(t,n){l(this,e),this.container=t,this.onScrollCallback=n}return u(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,a=e.width,i=e.height,l={x:0,y:0},s={x:1,y:1},u=10,c=10,f=this.container,d=f.scrollTop,p=f.scrollLeft,h=f.scrollHeight,g=f.scrollWidth,m=0===d,b=h-d-f.clientHeight==0,v=0===p,y=g-p-f.clientWidth==0;n.y>=o.y-i/2&&!b?(l.y=1,s.y=c*Math.abs((o.y-i/2-n.y)/i)):n.x>=o.x-a/2&&!y?(l.x=1,s.x=u*Math.abs((o.x-a/2-n.x)/a)):n.y<=r.y+i/2&&!m?(l.y=-1,s.y=c*Math.abs((n.y-i/2-r.y)/i)):n.x<=r.x+a/2&&!v&&(l.x=-1,s.x=u*Math.abs((n.x-a/2-r.x)/a)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===l.x&&0===l.y||(this.interval=setInterval(function(){t.isAutoScrolling=!0;var e={left:s.x*l.x,top:s.y*l.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)},5))}}]),e}();var Y={axis:y.a.oneOf(["x","y","xy"]),contentWindow:y.a.any,disableAutoscroll:y.a.bool,distance:y.a.number,getContainer:y.a.func,getHelperDimensions:y.a.func,helperClass:y.a.string,helperContainer:y.a.oneOfType([y.a.func,"undefined"==typeof HTMLElement?y.a.any:y.a.instanceOf(HTMLElement)]),hideSortableGhost:y.a.bool,keyboardSortingTransitionDuration:y.a.number,lockAxis:y.a.string,lockOffset:y.a.oneOfType([y.a.number,y.a.string,y.a.arrayOf(y.a.oneOfType([y.a.number,y.a.string]))]),lockToContainerEdges:y.a.bool,onSortEnd:y.a.func,onSortMove:y.a.func,onSortOver:y.a.func,onSortStart:y.a.func,pressDelay:y.a.number,pressThreshold:y.a.number,keyCodes:y.a.shape({lift:y.a.arrayOf(y.a.number),drop:y.a.arrayOf(y.a.number),cancel:y.a.arrayOf(y.a.number),up:y.a.arrayOf(y.a.number),down:y.a.arrayOf(y.a.number)}),shouldCancelStart:y.a.func,transitionDuration:y.a.number,updateBeforeSortStart:y.a.func,useDragHandle:y.a.bool,useWindowAsScrollContainer:y.a.bool},X={lift:[F],drop:[F],cancel:[q],up:[V,U],down:[W,$]},Z={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:X,shouldCancelStart:function(e){return-1!==[G.Input,G.Textarea,G.Select,G.Option,G.Button].indexOf(e.target.tagName)||!!D(e.target,function(e){return"true"===e.contentEditable})},transitionDuration:300,useWindowAsScrollContainer:!1},J=Object.keys(Y);function ee(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return l(this,n),a(d(d(t=p(this,h(n).call(this,e)))),"state",{}),a(d(d(t)),"handleStart",function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=B(e);var a=D(e.target,function(e){return null!=e.sortableInfo});if(a&&a.sortableInfo&&t.nodeIsChild(a)&&!t.state.sorting){var i=t.props.useDragHandle,l=a.sortableInfo,s=l.index,u=l.collection;if(l.disabled)return;if(i&&!D(e.target,K))return;t.manager.active={collection:u,index:s},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||e.target.tagName!==G.Anchor||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}}}),a(d(d(t)),"nodeIsChild",function(e){return e.sortableInfo.manager===t.manager}),a(d(d(t)),"handleMove",function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var a=B(e),i={x:t.position.x-a.x,y:t.position.y-a.y},l=Math.abs(i.x)+Math.abs(i.y);t.delta=i,r||o&&!(l>=o)?r&&l>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}}),a(d(d(t)),"handleEnd",function(){t.touched=!1,t.cancel()}),a(d(d(t)),"cancel",function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)}),a(d(d(t)),"handlePress",function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n,r,o,c,m,b,v=p.sortableInfo.index,y=(n=p,{bottom:I((r=window.getComputedStyle(n)).marginBottom),left:I(r.marginLeft),right:I(r.marginRight),top:I(r.marginTop)}),w=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:I(t.gridColumnGap),y:I(t.gridRowGap)}:{x:0,y:0}}(t.container),k=t.scrollContainer.getBoundingClientRect(),_=l({index:v,node:p,collection:h});if(t.node=p,t.margin=y,t.gridGap=w,t.width=_.width,t.height=_.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=k,t.index=v,t.newIndex=v,t.axis={x:a.indexOf("x")>=0,y:a.indexOf("y")>=0},t.offsetEdge=R(p,t.container),t.initialOffset=B(g?i({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((c="input, textarea, select, canvas, [contenteditable]",m=(o=p).querySelectorAll(c),x((b=o.cloneNode(!0)).querySelectorAll(c)).forEach(function(e,t){"file"!==e.type&&(e.value=m[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===G.Canvas&&m[t].width>0&&m[t].height>0&&e.getContext("2d").drawImage(m[t],0,0)}),b)),P(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-y.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-y.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),u&&(t.sortableGhost=p,P(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var S=d?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,T=S.top,E=S.left,C=S.width,j=T+S.height,N=E+C;t.axis.x&&(t.minTranslate.x=E-t.boundingClientRect.left,t.maxTranslate.x=N-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=T-t.boundingClientRect.top,t.maxTranslate.y=j-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(d?0:k.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(d?t.contentWindow.innerWidth:k.left+k.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(d?0:k.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(d?t.contentWindow.innerHeight:k.top+k.height)-t.boundingClientRect.top-t.height/2);s&&s.split(" ").forEach(function(e){return t.helper.classList.add(e)}),t.listenerNode=e.touches?p:t.contentWindow,g?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(O.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),O.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)})),t.setState({sorting:!0,sortingIndex:v}),f&&f({node:p,index:v,collection:h,isKeySorting:g,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),g&&t.keyMove(0)},o=t.props,a=o.axis,l=o.getHelperDimensions,s=o.helperClass,u=o.hideSortableGhost,c=o.updateBeforeSortStart,f=o.onSortStart,d=o.useWindowAsScrollContainer,p=n.node,h=n.collection,g=t.manager.isKeySorting,m=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var n=function(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}(function(){var t=p.sortableInfo.index;return Promise.resolve(c({collection:h,index:t,node:p,isKeySorting:g},e)).then(function(){})},function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n});if(n&&n.then)return n.then(function(){})}}();return m&&m.then?m.then(r):r()}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}),a(d(d(t)),"handleSortMove",function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)}),a(d(d(t)),"handleSortEnd",function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,a=t.manager,i=a.active.collection,l=a.isKeySorting,s=t.manager.getOrderedRefs();t.listenerNode&&(l?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(O.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),O.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)}))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&P(t.sortableGhost,{opacity:"",visibility:""});for(var u=0,c=s.length;ur)){t.prevIndex=a,t.newIndex=o;var i=function(e,t,n){return et?e-1:e>n&&em?m/2:this.height/2,width:this.width>g?g/2:this.width/2},v=u&&h>this.index&&h<=c,y=u&&h=c,w={x:0,y:0},k=i[f].edgeOffset;k||(k=R(p,this.container),i[f].edgeOffset=k,u&&(i[f].boundingClientRect=L(p,o)));var _=f0&&i[f-1];_&&!_.edgeOffset&&(_.edgeOffset=R(_.node,this.container),u&&(_.boundingClientRect=L(_.node,o))),h!==this.index?(t&&N(p,t),this.axis.x?this.axis.y?y||hthis.containerBoundingRect.width-b.width&&_&&(w.x=_.edgeOffset.left-k.left,w.y=_.edgeOffset.top-k.top),null===this.newIndex&&(this.newIndex=h)):(v||h>this.index&&(l+a.left+b.width>=k.left&&s+a.top+b.height>=k.top||s+a.top+b.height>=k.top+m))&&(w.x=-(this.width+this.marginOffset.x),k.left+w.xthis.index&&l+a.left+b.width>=k.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=h):(y||hthis.index&&s+a.top+b.height>=k.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=h):(y||h1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return l(this,n),p(this,h(n).apply(this,arguments))}return m(n,b["Component"]),u(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=Object(w.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return _()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return Object(b.createElement)(e,r({ref:t},E(this.props,ne)))}}]),n}(),a(t,"displayName",M("sortableElement",e)),a(t,"contextTypes",{manager:y.a.object.isRequired}),a(t,"propTypes",te),a(t,"defaultProps",{collection:0}),n}},function(e,t,n){"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,s=i(e),u=1;u1&&void 0!==arguments[1]?arguments[1]:e,n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(23)),a=r(n(40)),i=n(7),l=n(434),s=n(33),u=n(30),c=n(46);function f(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}var d=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],d=(0,s.getBlockTransforms)("from"),p=(0,s.findTransform)(d,function(e){return-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&(0,i.some)((0,i.castArray)(e.tag),function(e){return(0,l.regexp)(e).test(t)})});if(!p)return[t];var h,g=(0,i.castArray)(p.tag),m=(0,i.find)(g,function(e){return(0,l.regexp)(e).test(t)}),b=n;if(h=(0,l.next)(m,t,n)){n=h.index+h.content.length;var v=t.substr(0,h.index),y=t.substr(n);if(!((0,i.includes)(h.shortcode.content||"","<")||/(\n|

    )\s*$/.test(v)&&/^\s*(\n|<\/p>)/.test(y)))return e(t,n);if(p.isMatch&&!p.isMatch(h.shortcode.attrs))return e(t,b,[].concat((0,a.default)(r),[p.blockName]));var w=(0,i.mapValues)((0,i.pickBy)(p.attributes,function(e){return e.shortcode}),function(e){return e.shortcode(h.shortcode.attrs,h)});return[v,(0,s.createBlock)(p.blockName,(0,c.getBlockAttributes)(function(e){for(var t=1;t0)},t.eventHasFiles=function(e){var t=!1;if(e.dataTransfer){var n=e.dataTransfer.types;for(var r in n)if("Files"===n[r]){t=!0;break}}return t},t.propTypes={className:i.default.string,targetClassName:i.default.string,draggingOverFrameClassName:i.default.string,draggingOverTargetClassName:i.default.string,onDragOver:i.default.func,onDragLeave:i.default.func,onDrop:i.default.func,dropEffect:i.default.oneOf(["copy","move","link","none"]),frame:function(e,t,n){var r=e[t];return null==r?new Error("Warning: Required prop `"+t+"` was not specified in `"+n+"`"):r===document||r instanceof HTMLElement?void 0:new Error("Warning: Prop `"+t+"` must be one of the following: document, HTMLElement!")},onFrameDragEnter:i.default.func,onFrameDragLeave:i.default.func,onFrameDrop:i.default.func},t.defaultProps={dropEffect:"copy",frame:"undefined"==typeof window?void 0:window.document,className:"file-drop",targetClassName:"file-drop-target",draggingOverFrameClassName:"file-drop-dragging-over-frame",draggingOverTargetClassName:"file-drop-dragging-over-target"},t}(l.default.PureComponent);t.FileDrop=s},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=function(e,t){var n,r,o,a=0;function i(){var t,i,l=r,s=arguments.length;e:for(;l;){if(l.args.length===arguments.length){for(i=0;i>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[s>>>5]|=128<>>9<<4)]=s;var h=l._ff,g=l._gg,m=l._hh,b=l._ii;for(p=0;p>>0,c=c+y>>>0,f=f+w>>>0,d=d+k>>>0}return r.endian([u,c,f,d])})._ff=function(e,t,n,r,o,a,i){var l=e+(t&n|~t&r)+(o>>>0)+i;return(l<>>32-a)+t},l._gg=function(e,t,n,r,o,a,i){var l=e+(t&r|n&~r)+(o>>>0)+i;return(l<>>32-a)+t},l._hh=function(e,t,n,r,o,a,i){var l=e+(t^n^r)+(o>>>0)+i;return(l<>>32-a)+t},l._ii=function(e,t,n,r,o,a,i){var l=e+(n^(t|~r))+(o>>>0)+i;return(l<>>32-a)+t},l._blocksize=16,l._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(l(e,t));return t&&t.asBytes?n:t&&t.asString?i.bytesToString(n):r.bytesToHex(n)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict"; +(window.webpackJsonp_name_=window.webpackJsonp_name_||[]).push([[1],{115:function(e,t,n){var r,o,i,a,l;r=n(385),o=n(56).utf8,i=n(386),a=n(56).bin,(l=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):o.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var n=r.bytesToWords(e),u=8*e.length,s=1732584193,c=-271733879,f=-1732584194,d=271733878,p=0;p>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[u>>>5]|=128<>>9<<4)]=u;var h=l._ff,g=l._gg,m=l._hh,v=l._ii;for(p=0;p>>0,c=c+b>>>0,f=f+w>>>0,d=d+S>>>0}return r.endian([s,c,f,d])})._ff=function(e,t,n,r,o,i,a){var l=e+(t&n|~t&r)+(o>>>0)+a;return(l<>>32-i)+t},l._gg=function(e,t,n,r,o,i,a){var l=e+(t&r|n&~r)+(o>>>0)+a;return(l<>>32-i)+t},l._hh=function(e,t,n,r,o,i,a){var l=e+(t^n^r)+(o>>>0)+a;return(l<>>32-i)+t},l._ii=function(e,t,n,r,o,i,a){var l=e+(n^(t|~r))+(o>>>0)+a;return(l<>>32-i)+t},l._blocksize=16,l._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(l(e,t));return t&&t.asBytes?n:t&&t.asString?a.bytesToString(n):r.bytesToHex(n)}},14:function(e,t,n){e.exports=function(){"use strict";var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function i(e,t,r){var i={};return r.isMergeableObject(e)&&o(e).forEach(function(t){i[t]=n(e[t],r)}),o(t).forEach(function(o){r.isMergeableObject(t[o])&&e[o]?i[o]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(o,r)(e[o],t[o],r):i[o]=n(t[o],r)}),i}function a(t,o,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||e;var l=Array.isArray(o);return l===Array.isArray(t)?l?a.arrayMerge(t,o,a):i(t,o,a):n(o,a)}return a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return a(e,n,t)},{})},a}()},16:function(e,t,n){e.exports=n(368)()},18:function(e,t,n){"use strict";t.a=function(e){if("complete"===document.readyState||"interactive"===document.readyState)return e();document.addEventListener("DOMContentLoaded",e)}},19:function(e,t,n){"use strict";var r;!function(o){if("function"!=typeof i){var i=function(e){return e};i.nonNative=!0}const a=i("plaintext"),l=i("html"),u=i("comment"),s=/<(\w*)>/g,c=/<\/?([^\s\/>]+)/;function f(e,t,n){return p(e=e||"",d(t=t||[],n=n||""))}function d(e,t){return{allowable_tags:e=function(e){let t=new Set;if("string"==typeof e){let n;for(;n=s.exec(e);)t.add(n[1])}else i.nonNative||"function"!=typeof e[i.iterator]?"function"==typeof e.forEach&&e.forEach(t.add,t):t=new Set(e);return t}(e),tag_replacement:t,state:a,tag_buffer:"",depth:0,in_quote_char:""}}function p(e,t){let n=t.allowable_tags,r=t.tag_replacement,o=t.state,i=t.tag_buffer,s=t.depth,c=t.in_quote_char,f="";for(let t=0,d=e.length;t":if(c)break;if(s){s--;break}c="",o=a,i+=">",n.has(h(i))?f+=i:f+=r,i="";break;case'"':case"'":c=d===c?"":c||d,i+=d;break;case"-":"":"--"==i.slice(-2)&&(o=a),i="";break;default:i+=d}}return t.state=o,t.tag_buffer=i,t.depth=s,t.in_quote_char=c,f}function h(e){let t=c.exec(e);return t?t[1].toLowerCase():null}f.init_streaming_mode=function(e,t){let n=d(e=e||[],t=t||"");return function(e){return p(e||"",n)}},void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}()},25:function(e,t,n){"use strict";var r=n(358),o=n(363),i=n(365);e.exports=function(e){var t,n=r(e);return n.space?((t=Array(3))[0]=i(n.values[0],0,255),t[1]=i(n.values[1],0,255),t[2]=i(n.values[2],0,255),"h"===n.space[0]&&(t=o.rgb(t)),t.push(i(n.alpha,0,1)),t):[]}},27:function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,l){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,i,a,l],c=0;(u=new Error(t.replace(/%s/g,function(){return s[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},30:function(e,t,n){"use strict";e.exports=function(){}},34:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(381)},355:function(e,t,n){"use strict"; /** @license React v16.12.0 * react.production.min.js * @@ -22,7 +6,7 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(71),o="function"==typeof Symbol&&Symbol.for,a=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,s=o?Symbol.for("react.strict_mode"):60108,u=o?Symbol.for("react.profiler"):60114,c=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.forward_ref"):60112,p=o?Symbol.for("react.suspense"):60113;o&&Symbol.for("react.suspense_list");var h=o?Symbol.for("react.memo"):60115,g=o?Symbol.for("react.lazy"):60116;o&&Symbol.for("react.fundamental"),o&&Symbol.for("react.responder"),o&&Symbol.for("react.scope");var m="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nN.length&&N.push(e)}function I(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var s=!1;if(null===t)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case a:case i:s=!0}}if(s)return r(o,t,""===n?"."+M(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;u10&&/[0-9](?:\s|\/)/.test(e)&&(s=e.match(/([0-9]+)/g).map(function(e){return parseFloat(e)}),l=e.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(e))if(o(e)){var h=a(e.r,e.red,e.R,null);null!==h?(l="rgb",s=[h,a(e.g,e.green,e.G),a(e.b,e.blue,e.B)]):(l="hsl",s=[a(e.h,e.hue,e.H),a(e.s,e.saturation,e.S),a(e.l,e.lightness,e.L,e.b,e.brightness)]),u=a(e.a,e.alpha,e.opacity,1),null!=e.opacity&&(u/=100)}else(Array.isArray(e)||t.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))&&(s=[e[0],e[1],e[2]],l="rgb",u=4===e.length?e[3]:1);else l="rgb",s=[e>>>16,(65280&e)>>>8,255&e];return{space:l,values:s,alpha:u}};var i={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,n(388))},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){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},function(e,t){e.exports=function(){for(var e=0;e1&&r--,a=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,o[u]=255*a;return o}},r.hsl=function(e){var t,n,r=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(r,o,a),l=Math.max(r,o,a),s=l-i;return l===i?t=0:r===l?t=(o-a)/s:o===l?t=2+(a-r)/s:a===l&&(t=4+(r-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),n=(i+l)/2,[t,100*(l===i?0:n<=.5?s/(l+i):s/(2-l-i)),100*n]}},function(e,t,n){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},function(e,t){e.exports=function(e,t,n){return tn?n:e:et?t:e}},function(e,t,n){"use strict";var r=n(52),o=n(72),a=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,s=Array.prototype.push,u=function(e,t){s.apply(e,l(t)?t:[t])},c=Date.prototype.toISOString,f=o.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return c.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,n,o,a,i,s,c,f,p,h,g,m,b){var v,y=t;if("function"==typeof c?y=c(n,y):y instanceof Date?y=h(y):"comma"===o&&l(y)&&(y=y.join(",")),null===y){if(a)return s&&!m?s(n,d.encoder,b,"key"):n;y=""}if("string"==typeof(v=y)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||r.isBuffer(y))return s?[g(m?n:s(n,d.encoder,b,"key"))+"="+g(s(y,d.encoder,b,"value"))]:[g(n)+"="+g(String(y))];var w,k=[];if(void 0===y)return k;if(l(c))w=c;else{var _=Object.keys(y);w=f?_.sort(f):_}for(var x=0;x0?v+b:""}},function(e,t,n){"use strict";var r=n(52),o=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,i=n.depth>0&&/(\[[^[\]]*])/.exec(r),l=i?r.slice(0,i.index):r,s=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;s.push(l)}for(var u=0;n.depth>0&&null!==(i=a.exec(r))&&u=0;--o){var a,i=e[o];if("[]"===i&&n.parseArrays)a=[].concat(r);else{a=n.plainObjects?Object.create(null):{};var l="["===i.charAt(0)&&"]"===i.charAt(i.length-1)?i.slice(1,-1):i,s=parseInt(l,10);n.parseArrays||""!==l?!isNaN(s)&&i!==l&&String(s)===l&&s>=0&&n.parseArrays&&s<=n.arrayLimit?(a=[])[s]=r:a[l]=r:a={0:r}}r=a}return r}(s,t,n)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,s={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,f=u.split(t.delimiter,c),d=-1,p=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(g=g.split(",")),m.indexOf("[]=")>-1&&(g=a(g)?[g]:g),o.call(s,h)?s[h]=r.combine(s[h],g):s[h]=g}return s}(e,n):e,c=n.plainObjects?Object.create(null):{},f=Object.keys(u),d=0;d0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,a=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&a)this.highlightFirstSuggestion();else if(o){var i=this.getHighlightedSuggestion();i!=t.highlightedSuggestion&&o({suggestion:i})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState(function(o){var a=o.valueBeforeUpDown;return null===t?a=null:null===a&&void 0!==n&&(a=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:a}})}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState(function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}})}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,a=n.getSectionSuggestions;return o?a(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,a=r.onChange;t!==o&&a(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,a=t.onSuggestionsFetchRequested,l=t.renderSuggestion,s=t.inputProps,f=t.multiSection,p=t.renderSectionTitle,h=t.id,g=t.getSectionSuggestions,m=t.theme,b=t.getSuggestionValue,v=t.alwaysRenderSuggestions,y=t.highlightFirstSuggestion,w=this.state,k=w.isFocused,_=w.isCollapsed,x=w.highlightedSectionIndex,S=w.highlightedSuggestionIndex,T=w.valueBeforeUpDown,E=v?d:this.props.shouldRenderSuggestions,O=s.value,C=s.onFocus,P=s.onKeyDown,j=this.willRenderSuggestions(this.props),N=v||k&&!_&&j,D=N?n:[],A=r({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=E(O);e.setState({isFocused:!0,isCollapsed:!n}),C&&C(t),n&&a({value:O,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,o=E(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},y?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!o})),o?a({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(_)E(O)&&(a({value:O,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var i=r.newHighlightedSectionIndex,l=r.newHighlightedItemIndex,s=void 0;s=null===l?null===T?O:T:e.getSuggestionValueByIndex(i,l),e.updateHighlightedSuggestion(i,l,O),e.maybeCallOnChange(t,s,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout(function(){e.justPressedUpDown=!1});break;case 13:if(229===t.keyCode)break;var u=e.getHighlightedSuggestion();if(N&&!v&&e.closeSuggestions(),null!=u){var c=b(u);e.maybeCallOnChange(t,c,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:c,suggestionIndex:S,sectionIndex:x,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout(function(){e.justSelectedSuggestion=!1})}break;case 27:N&&t.preventDefault();var f=N&&!v;if(null===T){if(!f){e.maybeCallOnChange(t,"","escape"),E("")?a({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,T,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}P&&P(t)}}),I={query:this.getQuery()};return i.default.createElement(u.default,{multiSection:f,items:D,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:l,renderItemData:I,renderSectionTitle:p,getSectionItems:g,highlightedSectionIndex:x,highlightedItemIndex:S,inputProps:A,itemProps:this.itemProps,theme:(0,c.mapToAutowhateverTheme)(m),id:h,ref:this.storeAutowhateverRef})}}]),t}();p.propTypes={suggestions:l.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:l.default.func,onSuggestionHighlighted:l.default.func,renderInputComponent:l.default.func,renderSuggestionsContainer:l.default.func,getSuggestionValue:l.default.func.isRequired,renderSuggestion:l.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:l.default.func,alwaysRenderSuggestions:l.default.bool,multiSection:l.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:l.default.bool,highlightFirstSuggestion:l.default.bool,theme:l.default.object,id:l.default.string},p.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return i.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:c.defaultTheme,id:"1"};var h=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout(function(){e.justMouseEntered=!1})},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,a=r.onSuggestionSelected,i=r.onSuggestionsFetchRequested;a&&a(t,n),o?i({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,a=e.getSuggestionIndices(e.findSuggestionElement(t.target)),i=a.sectionIndex,l=a.suggestionIndex,s=e.getSuggestion(i,l),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:l,sectionIndex:i,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout(function(){e.justSelectedSuggestion=!1})},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,a=n.onBlur,i=e.getHighlightedSuggestion(),l=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!l}),a&&a(e.blurEvent,{highlightedSuggestion:i})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=p},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;rr+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,a=t.renderInputComponent,i=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,c=this.state.isInputFocused,f=o?this.renderSections():this.renderItems(),d=null!==f,p=this.getItemId(s,u),h="react-autowhatever-"+n,g=r({role:"combobox","aria-haspopup":"listbox","aria-owns":h,"aria-expanded":d},e("react-autowhatever-"+n+"-container","container",d&&"containerOpen"),this.props.containerProps),m=a(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":h,"aria-activedescendant":p},e("react-autowhatever-"+n+"-input","input",d&&"inputOpen",c&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),b=i({containerProps:r({id:h,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",d&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return l.default.createElement("div",g,m,b)}}]),t}();g.propTypes={id:s.default.string,multiSection:s.default.bool,renderInputComponent:s.default.func,renderItemsContainer:s.default.func,items:s.default.array.isRequired,renderItem:s.default.func,renderItemData:s.default.object,renderSectionTitle:s.default.func,getSectionItems:s.default.func,containerProps:s.default.object,inputProps:s.default.object,itemProps:s.default.oneOfType([s.default.object,s.default.func]),highlightedSectionIndex:s.default.number,highlightedItemIndex:s.default.number,theme:s.default.oneOfType([s.default.object,s.default.array])},g.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return l.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return l.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:h,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:h,inputProps:h,itemProps:h,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=g},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function o(e){var o=r(e,2),a=o[0],i=o[1];return n?null===i||i===t[a]-1?null===(a=function(e){for(null===e?e=0:e++;e=0&&0===t[e];)e--;return-1===e?null:e}(a))?[null,null]:[a,t[a]-1]:[a,i-1]:0===t||0===i?[null,null]:null===i?[null,t-1]:[null,i-1]},isLast:function(e){return null===o(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?t-1:0),r=1;r=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete l.sectionIndex,delete l.itemIndex,"function"==typeof l.onMouseEnter&&(l.onMouseEnter=this.onMouseEnter),"function"==typeof l.onMouseLeave&&(l.onMouseLeave=this.onMouseLeave),"function"==typeof l.onMouseDown&&(l.onMouseDown=this.onMouseDown),"function"==typeof l.onClick&&(l.onClick=this.onClick),i.default.createElement("li",r({role:"option"},l,{ref:this.storeItemReference}),o(n,r({isHighlighted:t},a)))}}]),t}();f.propTypes={sectionIndex:l.default.number,isHighlighted:l.default.bool.isRequired,itemIndex:l.default.number.isRequired,item:l.default.any.isRequired,renderItem:l.default.func.isRequired,renderItemData:l.default.object.isRequired,onMouseEnter:l.default.func,onMouseLeave:l.default.func,onMouseDown:l.default.func,onClick:l.default.func},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict"; + */var r=n(54),o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,a=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,s=o?Symbol.for("react.profiler"):60114,c=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.forward_ref"):60112,p=o?Symbol.for("react.suspense"):60113;o&&Symbol.for("react.suspense_list");var h=o?Symbol.for("react.memo"):60115,g=o?Symbol.for("react.lazy"):60116;o&&Symbol.for("react.fundamental"),o&&Symbol.for("react.responder"),o&&Symbol.for("react.scope");var m="function"==typeof Symbol&&Symbol.iterator;function v(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nD.length&&D.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case i:case a:u=!0}}if(u)return r(o,t,""===n?"."+R(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s10&&/[0-9](?:\s|\/)/.test(e)&&(u=e.match(/([0-9]+)/g).map(function(e){return parseFloat(e)}),l=e.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(e))if(o(e)){var h=i(e.r,e.red,e.R,null);null!==h?(l="rgb",u=[h,i(e.g,e.green,e.G),i(e.b,e.blue,e.B)]):(l="hsl",u=[i(e.h,e.hue,e.H),i(e.s,e.saturation,e.S),i(e.l,e.lightness,e.L,e.b,e.brightness)]),s=i(e.a,e.alpha,e.opacity,1),null!=e.opacity&&(s/=100)}else(Array.isArray(e)||t.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))&&(u=[e[0],e[1],e[2]],l="rgb",s=4===e.length?e[3]:1);else l="rgb",u=[e>>>16,(65280&e)>>>8,255&e];return{space:l,values:u,alpha:s}};var a={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,n(359))},359: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},360:function(e,t,n){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},361:function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},362:function(e,t){e.exports=function(){for(var e=0;e1&&r--,i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,o[s]=255*i;return o}},r.hsl=function(e){var t,n,r=e[0]/255,o=e[1]/255,i=e[2]/255,a=Math.min(r,o,i),l=Math.max(r,o,i),u=l-a;return l===a?t=0:r===l?t=(o-i)/u:o===l?t=2+(i-r)/u:i===l&&(t=4+(r-o)/u),(t=Math.min(60*t,360))<0&&(t+=360),n=(a+l)/2,[t,100*(l===a?0:n<=.5?u/(l+a):u/(2-l-a)),100*n]}},364:function(e,t,n){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},365:function(e,t){e.exports=function(e,t,n){return tn?n:e:et?t:e}},366:function(e,t,n){"use strict";var r=n(39),o=n(55),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,u=Array.prototype.push,s=function(e,t){u.apply(e,l(t)?t:[t])},c=Date.prototype.toISOString,f=o.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return c.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,n,o,i,a,u,c,f,p,h,g,m,v){var y,b=t;if("function"==typeof c?b=c(n,b):b instanceof Date?b=h(b):"comma"===o&&l(b)&&(b=b.join(",")),null===b){if(i)return u&&!m?u(n,d.encoder,v,"key"):n;b=""}if("string"==typeof(y=b)||"number"==typeof y||"boolean"==typeof y||"symbol"==typeof y||"bigint"==typeof y||r.isBuffer(b))return u?[g(m?n:u(n,d.encoder,v,"key"))+"="+g(u(b,d.encoder,v,"value"))]:[g(n)+"="+g(String(b))];var w,S=[];if(void 0===b)return S;if(l(c))w=c;else{var x=Object.keys(b);w=f?x.sort(f):x}for(var k=0;k0?y+v:""}},367:function(e,t,n){"use strict";var r=n(39),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},u=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=n.depth>0&&/(\[[^[\]]*])/.exec(r),l=a?r.slice(0,a.index):r,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var s=0;n.depth>0&&null!==(a=i.exec(r))&&s=0;--o){var i,a=e[o];if("[]"===a&&n.parseArrays)i=[].concat(r);else{i=n.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=r:i[l]=r:i={0:r}}r=i}return r}(u,t,n)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){var n,u={},s=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,f=s.split(t.delimiter,c),d=-1,p=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(g=g.split(",")),m.indexOf("[]=")>-1&&(g=i(g)?[g]:g),o.call(u,h)?u[h]=r.combine(u[h],g):u[h]=g}return u}(e,n):e,c=n.plainObjects?Object.create(null):{},f=Object.keys(s),d=0;d0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,i=n.highlightFirstSuggestion;if(!(0,u.default)(r,e.suggestions)&&r.length>0&&i)this.highlightFirstSuggestion();else if(o){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&o({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState(function(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}})}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState(function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}})}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,l=t.renderSuggestion,u=t.inputProps,f=t.multiSection,p=t.renderSectionTitle,h=t.id,g=t.getSectionSuggestions,m=t.theme,v=t.getSuggestionValue,y=t.alwaysRenderSuggestions,b=t.highlightFirstSuggestion,w=this.state,S=w.isFocused,x=w.isCollapsed,k=w.highlightedSectionIndex,E=w.highlightedSuggestionIndex,T=w.valueBeforeUpDown,C=y?d:this.props.shouldRenderSuggestions,O=u.value,P=u.onFocus,_=u.onKeyDown,I=this.willRenderSuggestions(this.props),D=y||S&&!x&&I,j=D?n:[],M=r({},u,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=C(O);e.setState({isFocused:!0,isCollapsed:!n}),P&&P(t),n&&i({value:O,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,o=C(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},b?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!o})),o?i({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(x)C(O)&&(i({value:O,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,l=r.newHighlightedItemIndex,u=void 0;u=null===l?null===T?O:T:e.getSuggestionValueByIndex(a,l),e.updateHighlightedSuggestion(a,l,O),e.maybeCallOnChange(t,u,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout(function(){e.justPressedUpDown=!1});break;case 13:if(229===t.keyCode)break;var s=e.getHighlightedSuggestion();if(D&&!y&&e.closeSuggestions(),null!=s){var c=v(s);e.maybeCallOnChange(t,c,"enter"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:c,suggestionIndex:E,sectionIndex:k,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout(function(){e.justSelectedSuggestion=!1})}break;case 27:D&&t.preventDefault();var f=D&&!y;if(null===T){if(!f){e.maybeCallOnChange(t,"","escape"),C("")?i({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,T,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}_&&_(t)}}),N={query:this.getQuery()};return a.default.createElement(s.default,{multiSection:f,items:j,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:l,renderItemData:N,renderSectionTitle:p,getSectionItems:g,highlightedSectionIndex:k,highlightedItemIndex:E,inputProps:M,itemProps:this.itemProps,theme:(0,c.mapToAutowhateverTheme)(m),id:h,ref:this.storeAutowhateverRef})}}]),t}();p.propTypes={suggestions:l.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:l.default.func,onSuggestionHighlighted:l.default.func,renderInputComponent:l.default.func,renderSuggestionsContainer:l.default.func,getSuggestionValue:l.default.func.isRequired,renderSuggestion:l.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:l.default.func,alwaysRenderSuggestions:l.default.bool,multiSection:l.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:l.default.bool,highlightFirstSuggestion:l.default.bool,theme:l.default.object,id:l.default.string},p.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:c.defaultTheme,id:"1"};var h=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout(function(){e.justMouseEntered=!1})},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;i&&i(t,n),o?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=i.sectionIndex,l=i.suggestionIndex,u=e.getSuggestion(a,l),s=e.props.getSuggestionValue(u);e.maybeCallOnChange(t,s,"click"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:s,suggestionIndex:l,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout(function(){e.justSelectedSuggestion=!1})},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,a=e.getHighlightedSuggestion(),l=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!l}),i&&i(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=p},371:function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;rr+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,i=t.renderInputComponent,a=t.renderItemsContainer,u=t.highlightedSectionIndex,s=t.highlightedItemIndex,c=this.state.isInputFocused,f=o?this.renderSections():this.renderItems(),d=null!==f,p=this.getItemId(u,s),h="react-autowhatever-"+n,g=r({role:"combobox","aria-haspopup":"listbox","aria-owns":h,"aria-expanded":d},e("react-autowhatever-"+n+"-container","container",d&&"containerOpen"),this.props.containerProps),m=i(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":h,"aria-activedescendant":p},e("react-autowhatever-"+n+"-input","input",d&&"inputOpen",c&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=a({containerProps:r({id:h,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",d&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return l.default.createElement("div",g,m,v)}}]),t}();g.propTypes={id:u.default.string,multiSection:u.default.bool,renderInputComponent:u.default.func,renderItemsContainer:u.default.func,items:u.default.array.isRequired,renderItem:u.default.func,renderItemData:u.default.object,renderSectionTitle:u.default.func,getSectionItems:u.default.func,containerProps:u.default.object,inputProps:u.default.object,itemProps:u.default.oneOfType([u.default.object,u.default.func]),highlightedSectionIndex:u.default.number,highlightedItemIndex:u.default.number,theme:u.default.oneOfType([u.default.object,u.default.array])},g.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return l.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return l.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:h,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:h,inputProps:h,itemProps:h,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=g},374:function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function o(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||a===t[i]-1?null===(i=function(e){for(null===e?e=0:e++;e=0&&0===t[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,t[i]-1]:[i,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===o(e)[1]}}}},375:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?t-1:0),r=1;r=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete l.sectionIndex,delete l.itemIndex,"function"==typeof l.onMouseEnter&&(l.onMouseEnter=this.onMouseEnter),"function"==typeof l.onMouseLeave&&(l.onMouseLeave=this.onMouseLeave),"function"==typeof l.onMouseDown&&(l.onMouseDown=this.onMouseDown),"function"==typeof l.onClick&&(l.onClick=this.onClick),a.default.createElement("li",r({role:"option"},l,{ref:this.storeItemReference}),o(n,r({isHighlighted:t},i)))}}]),t}();f.propTypes={sectionIndex:l.default.number,isHighlighted:l.default.bool.isRequired,itemIndex:l.default.number.isRequired,item:l.default.any.isRequired,renderItem:l.default.func.isRequired,renderItemData:l.default.object.isRequired,onMouseEnter:l.default.func,onMouseLeave:l.default.func,onMouseDown:l.default.func,onClick:l.default.func},t.default=f},38:function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(){return(o=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,r=t.emitMouse,o=t.emitTouch;return S({},e,{onMouseDown:b(e.onMouseDown,r),onTouchStart:b(e.onTouchStart,o)})}),n}return p(t,g["Component"]),l(t,[{key:"render",value:function(){var e=this.getRailProps,t=this.props,n=t.getEventData,r=t.activeHandleID,o=(0,t.children)({getEventData:n,activeHandleID:r,getRailProps:e});return o&&m.a.Children.only(o)}}]),t}();x.propTypes={};var k=x,E=function(e){function t(){return i(this,t),c(this,f(t).apply(this,arguments))}return p(t,g["Component"]),l(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.values,r=e.scale,o=e.count,i=t({getEventData:e.getEventData,activeHandleID:e.activeHandleID,ticks:(n||r.getTicks(o)).map(function(e){return{id:"$$-".concat(e),value:e,percent:r.getValue(e)}})});return i&&m.a.Children.only(i)}}]),t}();E.propTypes={},E.defaultProps={count:10};var T=E;function C(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 O(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.props,r=t.emitMouse,o=t.emitTouch;return O({},e,{onMouseDown:b(e.onMouseDown,r),onTouchStart:b(e.onTouchStart,o)})}),n}return p(t,g["Component"]),l(t,[{key:"render",value:function(){for(var e=this.getTrackProps,t=this.props,n=t.children,r=t.left,o=t.right,i=t.scale,a=t.handles,l=t.getEventData,u=t.activeHandleID,s=i.getDomain(),c=[],f=0;f1&&void 0!==arguments[1]?arguments[1]:{},r=n.props,o=r.emitKeyboard,i=r.emitMouse,a=r.emitTouch;return D({},t,{onKeyDown:b(t.onKeyDown,function(t){return o(t,e)}),onMouseDown:b(t.onMouseDown,n.autofocus,function(t){return i(t,e)}),onTouchStart:b(t.onTouchStart,function(t){return a(t,e)})})}),n}return p(t,g["Component"]),l(t,[{key:"render",value:function(){var e=this.getHandleProps,t=this.props,n=t.activeHandleID,r=(0,t.children)({handles:t.handles,activeHandleID:n,getHandleProps:e});return r&&m.a.Children.only(r)}}]),t}();j.propTypes={};var M=j;function N(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);tn.val?e?-1:1:n.val>t.val?e?1:-1:0}}function L(e,t,n,r){var o=e.findIndex(function(e){return e.key===t});if(-1!==o){var i=e[o],a=i.key;return i.val===n?e:[].concat(N(e.slice(0,o)),[{key:a,val:n}],N(e.slice(o+1))).sort(F(r))}return e}function A(e,t){if(!e)return[0,0];var n=e.getBoundingClientRect();return[t?n.top:n.left,t?n.bottom:n.right]}function U(e){var t=e.type,n=void 0===t?"":t,r=e.touches;return!r||r.length>1||"touchend"===n.toLowerCase()&&r.length>0}function z(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=0;return{handles:e.map(function(e){var t=n.getValue(e);return e!==t&&(o+=1,y()(!r,"".concat(R," Invalid value encountered. Changing ").concat(e," to ").concat(t,"."))),t}).map(function(e,t){return{key:"$$-".concat(t),val:e}}).sort(F(t)),changes:o}}var B=function(e,t){return et?1:e>=t?0:NaN};var W,V;1===(W=B).length&&(V=W,W=function(e,t){return B(V(e),t)});var q=Array.prototype,K=(q.slice,q.map,Math.sqrt(50)),$=Math.sqrt(10),Q=Math.sqrt(2),Y=function(e,t,n){var r,o,i,a,l=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t=0?(i>=K?10:i>=$?5:i>=Q?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=K?10:i>=$?5:i>=Q?2:1)}(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),i=new Array(o=Math.ceil(t-e+1));++ll?u:l)}),this.step=1,this.domain=[0,1],this.range=[0,1]},J="undefined"!=typeof window&&"undefined"!=typeof document,ee=function(){},te=function(e,t,n,r){var o=r?e-t:e+t;return r?Math.max(n[0],o):Math.min(n[1],o)},ne=function(e,t,n,r){var o=r?e+t:e-t;return r?Math.min(n[1],o):Math.max(n[0],o)},re=function(e){function t(){var e,n;i(this,t);for(var r=arguments.length,o=new Array(r),a=0;a0)}if(-1===a)return t;for(var f=l?r:-r,d=0;dv,"".concat(R," Max must be greater than min (even if reversed). Max is ").concat(b,". Min is ").concat(v,"."));var w=H(a||t.values,u,p,f),S=w.handles;(w.changes||void 0===a||a===t.values)&&(s(S.map(function(e){return e.val})),c(S.map(function(e){return e.val}))),g.step=i,g.values=a,g.domain=l,g.handles=S,g.reversed=u}else if(n=a,o=t.values,!(n===o||n.length===o.length&&n.reduce(function(e){return function(t,n,r){return t&&e[r]===n}}(o),!0))){var x=H(a,u,p,f),k=x.handles;x.changes&&(s(k.map(function(e){return e.val})),c(k.map(function(e){return e.val}))),g.values=a,g.handles=k}return Object.keys(g).length?g:null}}]),t}();re.propTypes={},re.defaultProps={mode:1,step:.1,domain:[0,100],component:"div",rootProps:{},rootStyle:{},vertical:!1,reversed:!1,onChange:ee,onUpdate:ee,onSlideStart:ee,onSlideEnd:ee,disabled:!1,flatten:!1,warnOnChanges:!1};var oe=re;n.d(t,"c",function(){return oe}),n.d(t,"b",function(){return k}),n.d(t,"a",function(){return M}),oe.Rail=k,oe.Ticks=T,oe.Tracks=_,oe.Handles=M},380:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},381:function(e,t,n){"use strict"; /** @license React v16.12.0 * react-dom.production.min.js * @@ -30,7 +14,7 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(5),o=n(71),a=n(411);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n

    ")&&0===n.indexOf("

    ")&&(I="INLINE"));if("INLINE"===I)return A(n);var z=(0,k.default)(n),H=z.length>1;if("AUTO"===I&&!H&&(0,p.default)(n,M))return A(n);var q=(0,a.filter)((0,i.getBlockTransforms)("from"),{type:"raw"}).map(function(e){return e.isMatch?e:N({},e,{isMatch:function(t){return e.selector&&t.matches(e.selector)}})}),F=(0,O.getPhrasingContentSchema)("paste"),U=(0,C.getBlockContentSchema)(q,F,!0),V=(0,a.compact)((0,a.flatMap)(z,function(e){if("string"!=typeof e)return e;var t=[S.default,m.default,g.default,b.default,v.default,h.default,f.default,d.default,w.default,y.default];B||t.unshift(x.default);var n=N({},U,{},F);return e=(0,C.deepFilterHTML)(e,t,U),e=(0,C.removeInvalidHTML)(e,n),e=(0,c.default)(e),e=(0,C.deepFilterHTML)(e,[T.default,E.default,P.default],U),D.log("Processed HTML piece:\n\n",e),function(e){var t=e.html,n=e.rawTransforms,r=document.implementation.createHTMLDocument("");return r.body.innerHTML=t,Array.from(r.body.children).map(function(e){var t=(0,i.findTransform)(n,function(t){return(0,t.isMatch)(e)});if(!t)return(0,i.createBlock)("core/html",(0,u.getBlockAttributes)("core/html",e.outerHTML));var r=t.transform,o=t.blockName;return r?r(e):(0,i.createBlock)(o,(0,u.getBlockAttributes)(o,e.outerHTML))})}({html:e,rawTransforms:q})}));if("AUTO"===I&&1===V.length&&(0,l.hasBlockSupport)(V[0].name,"__unstablePasteTextInline",!1)){var $=o.trim();if(""!==$&&-1===$.indexOf("\n"))return(0,C.removeInvalidHTML)((0,s.getBlockContent)(V[0]),F)}return V};var o=r(n(23)),a=n(7),i=n(33),l=n(30),s=n(44),u=n(46),c=r(n(56)),f=r(n(78)),d=r(n(436)),p=r(n(437)),h=r(n(438)),g=r(n(439)),m=r(n(440)),b=r(n(79)),v=r(n(441)),y=r(n(80)),w=r(n(81)),k=r(n(82)),_=r(n(443)),x=r(n(445)),S=r(n(446)),T=r(n(447)),E=r(n(448)),O=n(35),C=n(41),P=r(n(449));function j(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 N(e){for(var t=1;t (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:

    foo
    ",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].defaultValue);return n}var a={},i={},l={},s=o(!0),u="vanilla",c={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:o(!0),allOn:function(){"use strict";var e=o(!0),t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=!0);return t}()};function f(e,t){"use strict";var n=t?"Error in "+t+" extension->":"Error in unnamed extension",r={valid:!0,error:""};a.helper.isArray(e)||(e=[e]);for(var o=0;o").replace(/&/g,"&")};var p=function(e,t,n,r){"use strict";var o,a,i,l,s,u=r||"",c=u.indexOf("g")>-1,f=new RegExp(t+"|"+n,"g"+u.replace(/g/g,"")),d=new RegExp(t,u.replace(/g/g,"")),p=[];do{for(o=0;i=f.exec(e);)if(d.test(i[0]))o++||(l=(a=f.lastIndex)-i[0].length);else if(o&&!--o){s=i.index+i[0].length;var h={left:{start:l,end:a},match:{start:a,end:i.index},right:{start:i.index,end:s},wholeMatch:{start:l,end:s}};if(p.push(h),!c)return p}}while(o&&(f.lastIndex=a));return p};a.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var o=p(e,t,n,r),a=[],i=0;i0){var c=[];0!==l[0].wholeMatch.start&&c.push(e.slice(0,l[0].wholeMatch.start));for(var f=0;f=0?r+(n||0):r},a.helper.splitAtIndex=function(e,t){"use strict";if(!a.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},a.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e})},a.helper.padEnd=function(e,t,n){"use strict";return t>>=0,n=String(n||" "),e.length>t?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),a.helper.regexes={asteriskDashAndColon:/([*_:~])/g},a.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:"S"},a.Converter=function(e){"use strict";var t={},n=[],r=[],o={},i=u,d={parsed:{},raw:"",format:""};function p(e,t){if(t=t||null,a.helper.isString(e)){if(t=e=a.helper.stdExtName(e),a.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new a.Converter));a.helper.isArray(e)||(e=[e]);var o=f(e,t);if(!o.valid)throw Error(o.error);for(var i=0;i[ \t]+¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var n=t.createElement("div");n.innerHTML=e;var r={preList:function(e){for(var t=e.querySelectorAll("pre"),n=[],r=0;r'}else n.push(t[r].innerHTML),t[r].innerHTML="",t[r].setAttribute("prenum",r.toString());return n}(n)};!function e(t){for(var n=0;n? ?(['"].*['"])?\)$/m)>-1)i="";else if(!i){if(o||(o=r.toLowerCase().replace(/ ?\n/g," ")),i="#"+o,a.helper.isUndefined(n.gUrls[o]))return e;i=n.gUrls[o],a.helper.isUndefined(n.gTitles[o])||(u=n.gTitles[o])}var c='"};return e=(e=(e=(e=(e=n.converter._dispatch("anchors.before",e,t,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[([^\[\]]+)]()()()()()/g,r),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,function(e,n,r,o,i){if("\\"===r)return n+o;if(!a.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var l=t.ghMentionsLink.replace(/\{u}/g,i),s="";return t.openLinksInNewWindow&&(s=' rel="noopener noreferrer" target="¨E95Eblank"'),n+'"+o+""})),e=n.converter._dispatch("anchors.after",e,t,n)});var h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,g=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,m=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,v=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(e){"use strict";return function(t,n,r,o,i,l,s){var u=r=r.replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback),c="",f="",d=n||"",p=s||"";return/^www\./i.test(r)&&(r=r.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&l&&(c=l),e.openLinksInNewWindow&&(f=' rel="noopener noreferrer" target="¨E95Eblank"'),d+'"+u+""+c+p}},w=function(e,t){"use strict";return function(n,r,o){var i="mailto:";return r=r||"",o=a.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(i=a.helper.encodeEmailAddress(i+o),o=a.helper.encodeEmailAddress(o)):i+=o,r+''+o+""}};a.subParser("autoLinks",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(m,y(t))).replace(v,w(t,n)),e=n.converter._dispatch("autoLinks.after",e,t,n)}),a.subParser("simplifiedAutoLinks",function(e,t,n){"use strict";return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(g,y(t)):e.replace(h,y(t))).replace(b,w(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e}),a.subParser("blockGamut",function(e,t,n){"use strict";return e=n.converter._dispatch("blockGamut.before",e,t,n),e=a.subParser("blockQuotes")(e,t,n),e=a.subParser("headers")(e,t,n),e=a.subParser("horizontalRule")(e,t,n),e=a.subParser("lists")(e,t,n),e=a.subParser("codeBlocks")(e,t,n),e=a.subParser("tables")(e,t,n),e=a.subParser("hashHTMLBlocks")(e,t,n),e=a.subParser("paragraphs")(e,t,n),e=n.converter._dispatch("blockGamut.after",e,t,n)}),a.subParser("blockQuotes",function(e,t,n){"use strict";e=n.converter._dispatch("blockQuotes.before",e,t,n),e+="\n\n";var r=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(r=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(r,function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=a.subParser("githubCodeBlocks")(e,t,n),e=(e=(e=a.subParser("blockGamut")(e,t,n)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*
    [^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=(n=n.replace(/^  /gm,"¨0")).replace(/¨0/g,"")}),a.subParser("hashBlock")("
    \n"+e+"\n
    ",t,n)}),e=n.converter._dispatch("blockQuotes.after",e,t,n)}),a.subParser("codeBlocks",function(e,t,n){"use strict";e=n.converter._dispatch("codeBlocks.before",e,t,n);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,function(e,r,o){var i=r,l=o,s="\n";return i=a.subParser("outdent")(i,t,n),i=a.subParser("encodeCode")(i,t,n),i=(i=(i=a.subParser("detab")(i,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(s=""),i="
    "+i+s+"
    ",a.subParser("hashBlock")(i,t,n)+l})).replace(/¨0/,""),e=n.converter._dispatch("codeBlocks.after",e,t,n)}),a.subParser("codeSpans",function(e,t,n){"use strict";return void 0===(e=n.converter._dispatch("codeSpans.before",e,t,n))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,r,o,i){var l=i;return l=(l=l.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),l=r+""+(l=a.subParser("encodeCode")(l,t,n))+"",l=a.subParser("hashHTMLSpans")(l,t,n)}),e=n.converter._dispatch("codeSpans.after",e,t,n)}),a.subParser("completeHTMLDocument",function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",o="\n",a="",i='\n',l="",s="";for(var u in void 0!==n.metadata.parsed.doctype&&(o="\n","html"!==(r=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==r||(i='')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(u))switch(u.toLowerCase()){case"doctype":break;case"title":a=""+n.metadata.parsed.title+"\n";break;case"charset":i="html"===r||"html5"===r?'\n':'\n';break;case"language":case"lang":l=' lang="'+n.metadata.parsed[u]+'"',s+='\n';break;default:s+='\n'}return e=o+"\n\n"+a+i+s+"\n\n"+e.trim()+"\n\n",e=n.converter._dispatch("completeHTMLDocument.after",e,t,n)}),a.subParser("detab",function(e,t,n){"use strict";return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,function(e,t){for(var n=t,r=4-n.length%4,o=0;o/g,">"),e=n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)}),a.subParser("encodeBackslashEscapes",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("encodeBackslashEscapes.before",e,t,n)).replace(/\\(\\)/g,a.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,a.helper.escapeCharactersCallback),e=n.converter._dispatch("encodeBackslashEscapes.after",e,t,n)}),a.subParser("encodeCode",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("encodeCode.before",e,t,n)).replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,a.helper.escapeCharactersCallback),e=n.converter._dispatch("encodeCode.after",e,t,n)}),a.subParser("escapeSpecialCharsWithinTagAttributes",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,n)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,a.helper.escapeCharactersCallback)})).replace(/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,function(e){return e.replace(/([\\`*_~=|])/g,a.helper.escapeCharactersCallback)}),e=n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,n)}),a.subParser("githubCodeBlocks",function(e,t,n){"use strict";return t.ghCodeBlocks?(e=n.converter._dispatch("githubCodeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(e,r,o,i){var l=t.omitExtraWLInCodeBlocks?"":"\n";return i=a.subParser("encodeCode")(i,t,n),i="
    "+(i=(i=(i=a.subParser("detab")(i,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+l+"
    ",i=a.subParser("hashBlock")(i,t,n),"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:i})-1)+"G\n\n"})).replace(/¨0/,""),n.converter._dispatch("githubCodeBlocks.after",e,t,n)):e}),a.subParser("hashBlock",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",e=n.converter._dispatch("hashBlock.after",e,t,n)}),a.subParser("hashCodeTags",function(e,t,n){"use strict";e=n.converter._dispatch("hashCodeTags.before",e,t,n);return e=a.helper.replaceRecursiveRegExp(e,function(e,r,o,i){var l=o+a.subParser("encodeCode")(r,t,n)+i;return"¨C"+(n.gHtmlSpans.push(l)-1)+"C"},"]*>","","gim"),e=n.converter._dispatch("hashCodeTags.after",e,t,n)}),a.subParser("hashElement",function(e,t,n){"use strict";return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),r="\n\n¨K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}}),a.subParser("hashHTMLBlocks",function(e,t,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,t,n);var r=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,r,o){var a=e;return-1!==r.search(/\bmarkdown\b/)&&(a=r+n.converter.makeHtml(t)+o),"\n\n¨K"+(n.gHtmlBlocks.push(a)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,t){return"<"+t+">"}));for(var i=0;i]*>)","im"),u="<"+r[i]+"\\b[^>]*>",c="";-1!==(l=a.helper.regexIndexOf(e,s));){var f=a.helper.splitAtIndex(e,l),d=a.helper.replaceRecursiveRegExp(f[1],o,u,c,"im");if(d===f[1])break;e=f[0].concat(d)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,a.subParser("hashElement")(e,t,n)),e=(e=a.helper.replaceRecursiveRegExp(e,function(e){return"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,a.subParser("hashElement")(e,t,n)),e=n.converter._dispatch("hashHTMLBlocks.after",e,t,n)}),a.subParser("hashHTMLSpans",function(e,t,n){"use strict";function r(e){return"¨C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,function(e){return r(e)})).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(e){return r(e)})).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(e){return r(e)})).replace(/<[^>]+?>/gi,function(e){return r(e)}),e=n.converter._dispatch("hashHTMLSpans.after",e,t,n)}),a.subParser("unhashHTMLSpans",function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r]*>\\s*]*>","^ {0,3}\\s*
    ","gim"),e=n.converter._dispatch("hashPreCodeTags.after",e,t,n)}),a.subParser("headers",function(e,t,n){"use strict";e=n.converter._dispatch("headers.before",e,t,n);var r=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,i=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,function(e,o){var i=a.subParser("spanGamut")(o,t,n),l=t.noHeaderId?"":' id="'+s(o)+'"',u=""+i+"";return a.subParser("hashBlock")(u,t,n)})).replace(i,function(e,o){var i=a.subParser("spanGamut")(o,t,n),l=t.noHeaderId?"":' id="'+s(o)+'"',u=r+1,c=""+i+"";return a.subParser("hashBlock")(c,t,n)});var l=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function s(e){var r,o;if(t.customizedHeaderId){var i=e.match(/\{([^{]+?)}\s*$/);i&&i[1]&&(e=i[1])}return r=e,o=a.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(r=o+r),r=t.ghCompatibleHeaderId?r.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?r.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():r.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(r=o+r),n.hashLinkCounts[r]?r=r+"-"+n.hashLinkCounts[r]++:n.hashLinkCounts[r]=1,r}return e=e.replace(l,function(e,o,i){var l=i;t.customizedHeaderId&&(l=i.replace(/\s?\{([^{]+?)}\s*$/,""));var u=a.subParser("spanGamut")(l,t,n),c=t.noHeaderId?"":' id="'+s(i)+'"',f=r-1+o.length,d=""+u+"";return a.subParser("hashBlock")(d,t,n)}),e=n.converter._dispatch("headers.after",e,t,n)}),a.subParser("horizontalRule",function(e,t,n){"use strict";e=n.converter._dispatch("horizontalRule.before",e,t,n);var r=a.subParser("hashBlock")("
    ",t,n);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,r),e=n.converter._dispatch("horizontalRule.after",e,t,n)}),a.subParser("images",function(e,t,n){"use strict";function r(e,t,r,o,i,l,s,u){var c=n.gUrls,f=n.gTitles,d=n.gDimensions;if(r=r.toLowerCase(),u||(u=""),e.search(/\(? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if(""!==r&&null!==r||(r=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+r,a.helper.isUndefined(c[r]))return e;o=c[r],a.helper.isUndefined(f[r])||(u=f[r]),a.helper.isUndefined(d[r])||(i=d[r].width,l=d[r].height)}t=t.replace(/"/g,""").replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback);var p=''+t+'"}return e=(e=(e=(e=(e=(e=n.converter._dispatch("images.before",e,t,n)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,function(e,t,n,o,a,i,l,s){return r(e,t,n,o=o.replace(/\s/g,""),a,i,l,s)})).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,r)).replace(/!\[([^\[\]]+)]()()()()()/g,r),e=n.converter._dispatch("images.after",e,t,n)}),a.subParser("italicsAndBold",function(e,t,n){"use strict";function r(e,t,n){return t+e+n}return e=n.converter._dispatch("italicsAndBold.before",e,t,n),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return r(t,"","")})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return r(t,"","")})).replace(/\b_(\S[\s\S]*?)_\b/g,function(e,t){return r(t,"","")}):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?r(t,"",""):e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?r(t,"",""):e})).replace(/_([^\s_][\s\S]*?)_/g,function(e,t){return/\S$/.test(t)?r(t,"",""):e}),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(e,t,n){return r(n,t+"","")})).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(e,t,n){return r(n,t+"","")})).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(e,t,n){return r(n,t+"","")}):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(e,t){return/\S$/.test(t)?r(t,"",""):e})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(e,t){return/\S$/.test(t)?r(t,"",""):e})).replace(/\*([^\s*][\s\S]*?)\*/g,function(e,t){return/\S$/.test(t)?r(t,"",""):e}),e=n.converter._dispatch("italicsAndBold.after",e,t,n)}),a.subParser("lists",function(e,t,n){"use strict";function r(e,r){n.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,i=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,function(e,r,o,l,s,u,c){c=c&&""!==c.trim();var f=a.subParser("outdent")(s,t,n),d="";return u&&t.tasklists&&(d=' class="task-list-item" style="list-style-type: none;"',f=f.replace(/^[ \t]*\[(x|X| )?]/m,function(){var e='-1?(f=a.subParser("githubCodeBlocks")(f,t,n),f=a.subParser("blockGamut")(f,t,n)):(f=(f=a.subParser("lists")(f,t,n)).replace(/\n$/,""),f=(f=a.subParser("hashHTMLBlocks")(f,t,n)).replace(/\n\n+/g,"\n\n"),f=i?a.subParser("paragraphs")(f,t,n):a.subParser("spanGamut")(f,t,n)),f=""+(f=f.replace("¨A",""))+"\n"})).replace(/¨0/g,""),n.gListLevel--,r&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function i(e,n,a){var i=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,l=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,s="ul"===n?i:l,u="";if(-1!==e.search(s))!function t(c){var f=c.search(s),d=o(e,n);-1!==f?(u+="\n\n<"+n+d+">\n"+r(c.slice(0,f),!!a)+"\n",s="ul"===(n="ul"===n?"ol":"ul")?i:l,t(c.slice(f))):u+="\n\n<"+n+d+">\n"+r(c,!!a)+"\n"}(e);else{var c=o(e,n);u="\n\n<"+n+c+">\n"+r(e,!!a)+"\n"}return u}return e=n.converter._dispatch("lists.before",e,t,n),e+="¨0",e=(e=n.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n){return i(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)}):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n,r){return i(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)})).replace(/¨0/,""),e=n.converter._dispatch("lists.after",e,t,n)}),a.subParser("metadata",function(e,t,n){"use strict";if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,function(e,t,r){return n.metadata.parsed[t]=r,""})}return e=(e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(e,t,n){return r(n),"¨M"})).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(e,t,o){return t&&(n.metadata.format=t),r(o),"¨M"})).replace(/¨M/g,""),e=n.converter._dispatch("metadata.after",e,t,n)}),a.subParser("outdent",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=n.converter._dispatch("outdent.after",e,t,n)}),a.subParser("paragraphs",function(e,t,n){"use strict";for(var r=(e=(e=(e=n.converter._dispatch("paragraphs.before",e,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],i=r.length,l=0;l=0?o.push(s):s.search(/\S/)>=0&&(s=(s=a.subParser("spanGamut")(s,t,n)).replace(/^([ \t]*)/g,"

    "),s+="

    ",o.push(s))}for(i=o.length,l=0;l]*>\s*]*>/.test(c)&&(f=!0)}o[l]=c}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.converter._dispatch("paragraphs.after",e,t,n)}),a.subParser("runExtension",function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t}),a.subParser("spanGamut",function(e,t,n){"use strict";return e=n.converter._dispatch("spanGamut.before",e,t,n),e=a.subParser("codeSpans")(e,t,n),e=a.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=a.subParser("encodeBackslashEscapes")(e,t,n),e=a.subParser("images")(e,t,n),e=a.subParser("anchors")(e,t,n),e=a.subParser("autoLinks")(e,t,n),e=a.subParser("simplifiedAutoLinks")(e,t,n),e=a.subParser("emoji")(e,t,n),e=a.subParser("underline")(e,t,n),e=a.subParser("italicsAndBold")(e,t,n),e=a.subParser("strikethrough")(e,t,n),e=a.subParser("ellipsis")(e,t,n),e=a.subParser("hashHTMLSpans")(e,t,n),e=a.subParser("encodeAmpsAndAngles")(e,t,n),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
    \n")):e=e.replace(/ +\n/g,"
    \n"),e=n.converter._dispatch("spanGamut.after",e,t,n)}),a.subParser("strikethrough",function(e,t,n){"use strict";return t.strikethrough&&(e=(e=n.converter._dispatch("strikethrough.before",e,t,n)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,r){return function(e){return t.simplifiedAutoLink&&(e=a.subParser("simplifiedAutoLinks")(e,t,n)),""+e+""}(r)}),e=n.converter._dispatch("strikethrough.after",e,t,n)),e}),a.subParser("stripLinkDefinitions",function(e,t,n){"use strict";var r=function(e,r,o,i,l,s,u){return r=r.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?n.gUrls[r]=o.replace(/\s/g,""):n.gUrls[r]=a.subParser("encodeAmpsAndAngles")(o,t,n),s?s+u:(u&&(n.gTitles[r]=u.replace(/"|'/g,""")),t.parseImgDimensions&&i&&l&&(n.gDimensions[r]={width:i,height:l}),"")};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,r)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,r)).replace(/¨0/,"")}),a.subParser("tables",function(e,t,n){"use strict";if(!t.tables)return e;function r(e,r){return""+a.subParser("spanGamut")(e,t,n)+"\n"}function o(e){var o,i=e.split("\n");for(o=0;o"+(s=a.subParser("spanGamut")(s,t,n))+"\n"));for(o=0;o\n\n\n",o=0;o\n";for(var a=0;a\n"}return n+="\n\n"}(h,m)}return e=(e=(e=(e=n.converter._dispatch("tables.before",e,t,n)).replace(/\\(\|)/g,a.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),e=n.converter._dispatch("tables.after",e,t,n)}),a.subParser("underline",function(e,t,n){"use strict";return t.underline?(e=n.converter._dispatch("underline.before",e,t,n),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return""+t+""})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return""+t+""}):(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?""+t+"":e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?""+t+"":e})).replace(/(_)/g,a.helper.escapeCharactersCallback),e=n.converter._dispatch("underline.after",e,t,n)):e}),a.subParser("unescapeSpecialChars",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)}),e=n.converter._dispatch("unescapeSpecialChars.after",e,t,n)}),a.subParser("makeMarkdown.blockquote",function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,i=0;i ")}),a.subParser("makeMarkdown.codeBlock",function(e,t){"use strict";var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"}),a.subParser("makeMarkdown.codeSpan",function(e){"use strict";return"`"+e.innerHTML+"`"}),a.subParser("makeMarkdown.emphasis",function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="*";for(var r=e.childNodes,o=r.length,i=0;i",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t}),a.subParser("makeMarkdown.links",function(e,t){"use strict";var n="";if(e.hasChildNodes()&&e.hasAttribute("href")){var r=e.childNodes,o=r.length;n="[";for(var i=0;i",e.hasAttribute("title")&&(n+=' "'+e.getAttribute("title")+'"'),n+=")"}return n}),a.subParser("makeMarkdown.list",function(e,t,n){"use strict";var r="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,l=e.getAttribute("start")||1,s=0;s"+t.preList[n]+""}),a.subParser("makeMarkdown.strikethrough",function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="~~";for(var r=e.childNodes,o=r.length,i=0;itr>th"),s=e.querySelectorAll("tbody>tr");for(n=0;nh&&(h=g)}for(n=0;n/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")});void 0===(r=function(){"use strict";return a}.call(t,n,t,e))||(e.exports=r)}).call(this)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){"IFRAME"===e.nodeName&&(0,r.remove)(e)};var r=n(31)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e.id||0!==e.id.indexOf("docs-internal-guid-"))return;(0,r.unwrap)(e)};var r=n(31)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e.nodeType!==e.TEXT_NODE)return;if(e.parentElement.closest("pre"))return;var t=e.data.replace(/[ \r\n\t]+/g," ");if(" "===t[0]){var n=(0,r.getSibling)(e,"previous");n&&"BR"!==n.nodeName&&" "!==n.textContent.slice(-1)||(t=t.slice(1))}if(" "===t[t.length-1]){var o=(0,r.getSibling)(e,"next");(!o||"BR"===o.nodeName||o.nodeType===o.TEXT_NODE&&(" "===(a=o.textContent[0])||"\r"===a||"\n"===a||"\t"===a))&&(t=t.slice(0,-1))}var a;t?e.data=t:e.parentNode.removeChild(e)};var r=n(41)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("BR"!==e.nodeName)return;if((0,r.getSibling)(e,"next"))return;e.parentNode.removeChild(e)};var r=n(41)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("P"!==e.nodeName)return;if(e.hasChildNodes())return;e.parentNode.removeChild(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCategories=function(){return(0,r.select)("core/blocks").getCategories()},t.setCategories=function(e){(0,r.dispatch)("core/blocks").setCategories(e)},t.updateCategory=function(e,t){(0,r.dispatch)("core/blocks").updateCategory(e,t)};var r=n(13)},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.doBlocksMatchTemplate=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length===n.length&&(0,i.every)(n,function(n,r){var o=(0,a.default)(n,3),i=o[0],l=o[2],s=t[r];return i===s.name&&e(s.innerBlocks,l)})},t.synchronizeBlocksWithTemplate=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];var n=arguments.length>1?arguments[1]:void 0;if(!n)return t;return(0,i.map)(n,function(n,r){var f=(0,a.default)(n,3),d=f[0],p=f[1],h=f[2],g=t[r];if(g&&g.name===d){var m=e(g.innerBlocks,h);return function(e){for(var t=1;t>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-a)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,o=0;r>>6-2*o);return t}},e.exports=r},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} + */var r,o,i,a,l;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,s=null,c=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(c,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(c,0))},o=function(e,t){s=setTimeout(e,t)},i=function(){clearTimeout(s)},a=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,h=window.setTimeout,g=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var v=p.now();t.unstable_now=function(){return p.now()-v}}var y=!1,b=null,w=-1,S=5,x=0;a=function(){return t.unstable_now()>=x},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125P(a,n))void 0!==u&&0>P(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==u&&0>P(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var _=[],I=[],D=1,j=null,M=3,N=!1,R=!1,F=!1;function L(e){for(var t=C(I);null!==t;){if(null===t.callback)O(I);else{if(!(t.startTime<=e))break;O(I),t.sortIndex=t.expirationTime,T(_,t)}t=C(I)}}function A(e){if(F=!1,L(e),!R)if(null!==C(_))R=!0,r(U);else{var t=C(I);null!==t&&o(A,t.startTime-e)}}function U(e,n){R=!1,F&&(F=!1,i()),N=!0;var r=M;try{for(L(n),j=C(_);null!==j&&(!(j.expirationTime>n)||e&&!a());){var l=j.callback;if(null!==l){j.callback=null,M=j.priorityLevel;var u=l(j.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?j.callback=u:j===C(_)&&O(_),L(n)}else O(_);j=C(_)}if(null!==j)var s=!0;else{var c=C(I);null!==c&&o(A,c.startTime-n),s=!1}return s}finally{j=null,M=r,N=!1}}function z(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=l;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=M;M=e;try{return t()}finally{M=n}},t.unstable_next=function(e){switch(M){case 1:case 2:case 3:var t=3;break;default:t=M}var n=M;M=t;try{return e()}finally{M=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var u=a.delay;u="number"==typeof u&&0l?(e.sortIndex=u,T(I,e),null===C(_)&&e===C(I)&&(F?i():F=!0,o(A,u-l))):(e.sortIndex=a,T(_,e),R||N||(R=!0,r(U))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=M;return function(){var n=M;M=t;try{return e.apply(this,arguments)}finally{M=n}}},t.unstable_getCurrentPriorityLevel=function(){return M},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var n=C(_);return n!==j&&null!==j&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,o=0;r>>6-2*o);return t}},e.exports=r},386:function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.r(t),n.d(t,"autop",function(){return i}),n.d(t,"removep",function(){return l});var o=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");function a(e,t){for(var n=function(e){for(var t,n=[],r=e;t=r.match(o);)n.push(r.slice(0,t.index)),n.push(t[0]),r=r.slice(t.index+t[0].length);return r.length&&n.push(r),n}(e),r=!1,a=Object.keys(t),i=1;i1&&void 0!==arguments[1])||arguments[1],n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf(""),i=o.pop();e="";for(var l=0;l";n.push([c,s.substr(u)+""]),e+=s.substr(0,u)+c}else e+=s}e+=i}var f="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=a(e=(e=(e=(e=e.replace(/\s*/g,"\n\n")).replace(new RegExp("(<"+f+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("()","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("\s*/g,"")),-1!==e.indexOf("")&&(e=(e=(e=e.replace(/(]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("]*>)/,"$1")).replace(/<\/figcaption>\s*/,""));var d=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",d.forEach(function(t){e+="

    "+t.replace(/^\n*|\n*$/g,"")+"

    \n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/

    \s*<\/p>/g,"")).replace(/

    ([^<]+)<\/(div|address|form)>/g,"

    $1

    ")).replace(new RegExp("

    \\s*(]*>)\\s*

    ","g"),"$1")).replace(/

    (/g,"$1")).replace(/

    ]*)>/gi,"

    ")).replace(/<\/blockquote><\/p>/g,"

    ")).replace(new RegExp("

    \\s*(]*>)","g"),"$1")).replace(new RegExp("(]*>)\\s*

    ","g"),"$1"),t&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,function(e){return e[0].replace(/\n/g,"")})).replace(/
    |/g,"
    ")).replace(/(
    )?\s*\n/g,function(e,t){return t?e:"
    \n"})).replace(//g,"\n")),e=(e=(e=e.replace(new RegExp("(]*>)\\s*
    ","g"),"$1")).replace(/
    (\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"

    "),n.forEach(function(t){var n=r(t,2),o=n[0],a=n[1];e=e.replace(o,a)}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?\s?/g,"\n")),e}function l(e){var t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",r=t+"|pre",o=[],a=!1,i=!1;return e?(-1===e.indexOf("]*>[\s\S]*?<\/\1>/g,function(e){return o.push(e),""})),-1!==e.indexOf("]*>[\s\S]+?<\/pre>/g,function(e){return(e=(e=e.replace(/
    (\r\n|\n)?/g,"")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"")).replace(/\r?\n/g,"")})),-1!==e.indexOf("[caption")&&(i=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/]*)>/g,"").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*\\s*","g"),"\n")).replace(new RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(

    ]+>[\s\S]*?)<\/p>/g,"$1")).replace(/]*)?>\s*

    /gi,"\n\n")).replace(/\s*

    /gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)
    \s*/gi,function(e,t){return t&&-1!==t.indexOf("\n")?"\n\n":"\n"})).replace(/\s*

    \s*/g,"
    \n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(new RegExp("\\s*\\s*","g"),"\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("/g,"\n")),-1!==e.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==e.indexOf("/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"

    \n")).replace(/\s*(

    ]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),a&&(e=e.replace(//g,"\n")),i&&(e=e.replace(/]*)>/g,"")),o.length&&(e=e.replace(//g,function(){return o.shift()})),e):""}},function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o,a,i,l;n.r(t),n.d(t,"parse",function(){return f});var s=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function u(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function c(e){return u(null,{},[],e,[e])}var f=function(e){o=e,a=0,i=[],l=[],s.lastIndex=0;do{}while(d());return i};function d(){var e=function(){var e=s.exec(o);if(null===e)return["no-more-tokens"];var t=e.index,n=r(e,7),a=n[0],i=n[1],l=n[2],u=n[3],c=n[4],f=n[6],d=a.length,p=!!i,h=!!f,g=(l||"core/")+u,m=!!c,b=m?function(e){try{return JSON.parse(e)}catch(e){return null}}(c):{};if(h)return["void-block",g,b,t,d];if(p)return["block-closer",g,null,t,d];return["block-opener",g,b,t,d]}(),t=r(e,5),n=t[0],f=t[1],d=t[2],m=t[3],b=t[4],v=l.length,y=m>a?a:null;switch(n){case"no-more-tokens":if(0===v)return p(),!1;if(1===v)return g(),!1;for(;00&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,o=e.indexOf("?");return-1!==o&&(t=Object.assign(Object(r.parse)(e.substr(o+1)),t),n=n.substr(0,o)),n+"?"+Object(r.stringify)(t)}},function(e,t,n){"use strict";var r=n(6);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=n(8),l=n.n(i);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}var u=Object(r.createElement)(function(e){var t=e.className,n=e.isPressed,i=function(e){for(var t=1;t1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122?o+=r.charAt(a):l<128?o+=i[l]:l<2048?o+=i[192|l>>6]+i[128|63&l]:l<55296||l>=57344?o+=i[224|l>>12]+i[128|l>>6&63]+i[128|63&l]:(a+=1,l=65536+((1023&l)<<10|1023&r.charCodeAt(a)),o+=i[240|l>>18]+i[128|l>>12&63]+i[128|l>>6&63]+i[128|63&l])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(i&&(i.plainObjects||i.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var l=t;return o(t)&&!o(n)&&(l=a(t,i)),o(t)&&o(n)?(n.forEach(function(n,o){if(r.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,i):t.push(n)}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var a=n[o];return r.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t},l)}}},40:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!0;var a={},l=void 0,u=void 0;for(l=0,u=n.length;l0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,o=e.indexOf("?");return-1!==o&&(t=Object.assign(Object(r.parse)(e.substr(o+1)),t),n=n.substr(0,o)),n+"?"+Object(r.stringify)(t)}},421:function(e,t,n){"use strict";var r=n(6);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var a=n(8),l=n.n(a);function u(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}var s=Object(r.createElement)(function(e){var t=e.className,n=e.isPressed,a=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(T)}}]),e}();function T(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function C(e,t){return Object.keys(e).reduce(function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n},{})}var O={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},P=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function _(e,t){Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function I(e,t){e.style["".concat(P,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function D(e,t){e.style["".concat(P,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function j(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function M(e,t,n){return Math.max(e,Math.min(n,t))}function N(e){return"px"===e.substr(-2)?parseFloat(e):0}function R(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function F(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function L(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function A(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:A(e.parentNode,t,r)}}function U(e){var t=e.lockOffset,n=e.width,r=e.height,o=t,i=t,a="px";if("string"==typeof t){var l=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);x()(null!==l,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),i=parseFloat(t),a=l[1]}return x()(isFinite(o)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,i=i*r/100),{x:o,y:i}}function z(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find(function(e){return n.test(t[e])})}(e)?e:z(e.parentNode):null}var H=27,B=32,W=37,V=38,q=39,K=40,$={Anchor:"A",Button:"BUTTON",Canvas:"CANVAS",Input:"INPUT",Option:"OPTION",Textarea:"TEXTAREA",Select:"SELECT"};function Q(e){return null!=e.sortableHandle}var Y=function(){function e(t,n){l(this,e),this.container=t,this.onScrollCallback=n}return s(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,l={x:0,y:0},u={x:1,y:1},s=10,c=10,f=this.container,d=f.scrollTop,p=f.scrollLeft,h=f.scrollHeight,g=f.scrollWidth,m=0===d,v=h-d-f.clientHeight==0,y=0===p,b=g-p-f.clientWidth==0;n.y>=o.y-a/2&&!v?(l.y=1,u.y=c*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!b?(l.x=1,u.x=s*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!m?(l.y=-1,u.y=c*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!y&&(l.x=-1,u.x=s*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===l.x&&0===l.y||(this.interval=setInterval(function(){t.isAutoScrolling=!0;var e={left:u.x*l.x,top:u.y*l.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)},5))}}]),e}();var X={axis:b.a.oneOf(["x","y","xy"]),contentWindow:b.a.any,disableAutoscroll:b.a.bool,distance:b.a.number,getContainer:b.a.func,getHelperDimensions:b.a.func,helperClass:b.a.string,helperContainer:b.a.oneOfType([b.a.func,"undefined"==typeof HTMLElement?b.a.any:b.a.instanceOf(HTMLElement)]),hideSortableGhost:b.a.bool,keyboardSortingTransitionDuration:b.a.number,lockAxis:b.a.string,lockOffset:b.a.oneOfType([b.a.number,b.a.string,b.a.arrayOf(b.a.oneOfType([b.a.number,b.a.string]))]),lockToContainerEdges:b.a.bool,onSortEnd:b.a.func,onSortMove:b.a.func,onSortOver:b.a.func,onSortStart:b.a.func,pressDelay:b.a.number,pressThreshold:b.a.number,keyCodes:b.a.shape({lift:b.a.arrayOf(b.a.number),drop:b.a.arrayOf(b.a.number),cancel:b.a.arrayOf(b.a.number),up:b.a.arrayOf(b.a.number),down:b.a.arrayOf(b.a.number)}),shouldCancelStart:b.a.func,transitionDuration:b.a.number,updateBeforeSortStart:b.a.func,useDragHandle:b.a.bool,useWindowAsScrollContainer:b.a.bool},G={lift:[B],drop:[B],cancel:[H],up:[V,W],down:[K,q]},Z={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:G,shouldCancelStart:function(e){return-1!==[$.Input,$.Textarea,$.Select,$.Option,$.Button].indexOf(e.target.tagName)||!!j(e.target,function(e){return"true"===e.contentEditable})},transitionDuration:300,useWindowAsScrollContainer:!1},J=Object.keys(X);function ee(e){var t,n,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return l(this,n),i(d(d(t=p(this,h(n).call(this,e)))),"state",{}),i(d(d(t)),"handleStart",function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=L(e);var i=j(e.target,function(e){return null!=e.sortableInfo});if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,l=i.sortableInfo,u=l.index,s=l.collection;if(l.disabled)return;if(a&&!j(e.target,Q))return;t.manager.active={collection:s,index:u},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||e.target.tagName!==$.Anchor||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}}}),i(d(d(t)),"nodeIsChild",function(e){return e.sortableInfo.manager===t.manager}),i(d(d(t)),"handleMove",function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=L(e),a={x:t.position.x-i.x,y:t.position.y-i.y},l=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(l>=o)?r&&l>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}}),i(d(d(t)),"handleEnd",function(){t.touched=!1,t.cancel()}),i(d(d(t)),"cancel",function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)}),i(d(d(t)),"handlePress",function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n,r,o,c,m,v,y=p.sortableInfo.index,b=(n=p,{bottom:N((r=window.getComputedStyle(n)).marginBottom),left:N(r.marginLeft),right:N(r.marginRight),top:N(r.marginTop)}),w=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:N(t.gridColumnGap),y:N(t.gridRowGap)}:{x:0,y:0}}(t.container),S=t.scrollContainer.getBoundingClientRect(),x=l({index:y,node:p,collection:h});if(t.node=p,t.margin=b,t.gridGap=w,t.width=x.width,t.height=x.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=S,t.index=y,t.newIndex=y,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=A(p,t.container),t.initialOffset=L(g?a({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((c="input, textarea, select, canvas, [contenteditable]",m=(o=p).querySelectorAll(c),k((v=o.cloneNode(!0)).querySelectorAll(c)).forEach(function(e,t){"file"!==e.type&&(e.value=m[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===$.Canvas&&m[t].width>0&&m[t].height>0&&e.getContext("2d").drawImage(m[t],0,0)}),v)),_(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-b.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-b.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),s&&(t.sortableGhost=p,_(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var E=d?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,T=E.top,C=E.left,P=E.width,I=T+E.height,D=C+P;t.axis.x&&(t.minTranslate.x=C-t.boundingClientRect.left,t.maxTranslate.x=D-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=T-t.boundingClientRect.top,t.maxTranslate.y=I-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(d?0:S.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(d?t.contentWindow.innerWidth:S.left+S.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(d?0:S.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(d?t.contentWindow.innerHeight:S.top+S.height)-t.boundingClientRect.top-t.height/2);u&&u.split(" ").forEach(function(e){return t.helper.classList.add(e)}),t.listenerNode=e.touches?p:t.contentWindow,g?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(O.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),O.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)})),t.setState({sorting:!0,sortingIndex:y}),f&&f({node:p,index:y,collection:h,isKeySorting:g,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),g&&t.keyMove(0)},o=t.props,i=o.axis,l=o.getHelperDimensions,u=o.helperClass,s=o.hideSortableGhost,c=o.updateBeforeSortStart,f=o.onSortStart,d=o.useWindowAsScrollContainer,p=n.node,h=n.collection,g=t.manager.isKeySorting,m=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var n=function(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}(function(){var t=p.sortableInfo.index;return Promise.resolve(c({collection:h,index:t,node:p,isKeySorting:g},e)).then(function(){})},function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n});if(n&&n.then)return n.then(function(){})}}();return m&&m.then?m.then(r):r()}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}),i(d(d(t)),"handleSortMove",function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)}),i(d(d(t)),"handleSortEnd",function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,l=i.isKeySorting,u=t.manager.getOrderedRefs();t.listenerNode&&(l?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(O.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),O.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)}))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&_(t.sortableGhost,{opacity:"",visibility:""});for(var s=0,c=u.length;sr)){t.prevIndex=i,t.newIndex=o;var a=function(e,t,n){return et?e-1:e>n&&em?m/2:this.height/2,width:this.width>g?g/2:this.width/2},y=s&&h>this.index&&h<=c,b=s&&h=c,w={x:0,y:0},S=a[f].edgeOffset;S||(S=A(p,this.container),a[f].edgeOffset=S,s&&(a[f].boundingClientRect=F(p,o)));var x=f0&&a[f-1];x&&!x.edgeOffset&&(x.edgeOffset=A(x.node,this.container),s&&(x.boundingClientRect=F(x.node,o))),h!==this.index?(t&&D(p,t),this.axis.x?this.axis.y?b||hthis.containerBoundingRect.width-v.width&&x&&(w.x=x.edgeOffset.left-S.left,w.y=x.edgeOffset.top-S.top),null===this.newIndex&&(this.newIndex=h)):(y||h>this.index&&(l+i.left+v.width>=S.left&&u+i.top+v.height>=S.top||u+i.top+v.height>=S.top+m))&&(w.x=-(this.width+this.marginOffset.x),S.left+w.xthis.index&&l+i.left+v.width>=S.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=h):(b||hthis.index&&u+i.top+v.height>=S.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=h):(b||h1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return l(this,n),p(this,h(n).apply(this,arguments))}return m(n,v["Component"]),s(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=Object(w.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return x()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return Object(v.createElement)(e,r({ref:t},C(this.props,ne)))}}]),n}(),i(t,"displayName",R("sortableElement",e)),i(t,"contextTypes",{manager:b.a.object.isRequired}),i(t,"propTypes",te),i(t,"defaultProps",{collection:0}),n}},54:function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=a(e),s=1;s0)},t.eventHasFiles=function(e){var t=!1;if(e.dataTransfer){var n=e.dataTransfer.types;for(var r in n)if("Files"===n[r]){t=!0;break}}return t},t.propTypes={className:a.default.string,targetClassName:a.default.string,draggingOverFrameClassName:a.default.string,draggingOverTargetClassName:a.default.string,onDragOver:a.default.func,onDragLeave:a.default.func,onDrop:a.default.func,dropEffect:a.default.oneOf(["copy","move","link","none"]),frame:function(e,t,n){var r=e[t];return null==r?new Error("Warning: Required prop `"+t+"` was not specified in `"+n+"`"):r===document||r instanceof HTMLElement?void 0:new Error("Warning: Prop `"+t+"` must be one of the following: document, HTMLElement!")},onFrameDragEnter:a.default.func,onFrameDragLeave:a.default.func,onFrameDrop:a.default.func},t.defaultProps={dropEffect:"copy",frame:"undefined"==typeof window?void 0:window.document,className:"file-drop",targetClassName:"file-drop-target",draggingOverFrameClassName:"file-drop-dragging-over-frame",draggingOverTargetClassName:"file-drop-dragging-over-target"},t}(l.default.PureComponent);t.FileDrop=u},8:function(e,t,n){var r; +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t:first-child{margin-top:0!important}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .ugb-accordion__content-inner>:last-child{margin-bottom:0!important}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .wp-block-image.wp-block-image.wp-block-image>img{max-width:100%}.ugb-accordion.ugb-accordion--v2:not(.ugb-accordion--open) .ugb-accordion__heading{margin-bottom:0}.ugb-accordion.ugb-accordion--v2:not(.ugb-accordion--open) .ugb-accordion__content{max-height:0;transform:translateY(25px);opacity:0}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__item{border-bottom:1px solid rgba(0,0,0,.1)}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__heading{box-shadow:none;border-radius:0;padding:0;margin-bottom:35px}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__heading:focus{outline-offset:10px}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__content .ugb-accordion__content-inner{padding:0 0 35px}.ugb-blockquote.ugb-blockquote--v3{border:0!important;padding:0!important;font-style:italic;text-align:inherit;background-color:transparent;position:relative;overflow:visible}.ugb-blockquote.ugb-blockquote--v3:after,.ugb-blockquote.ugb-blockquote--v3:not(.ugb--has-block-background):before{content:"";display:none!important}.ugb-blockquote.ugb-blockquote--v3 .ugb-blockquote__item{position:relative;padding:60px 35px}.ugb-blockquote.ugb-blockquote--v3 .ugb-blockquote__quote{position:absolute;fill:rgba(129,141,165,.32);width:70px;height:70px;transform:translateX(-50%) translateY(-30%);top:0;left:0;z-index:5}.ugb-blockquote.ugb-blockquote--v3 .ugb-blockquote__content{position:relative;z-index:6}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--small-quote .ugb-blockquote__quote{top:60px;left:35px;transform:translateX(-100%) translateY(-80%)}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;padding:60px 35px;overflow:hidden}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__quote{transform:translateX(-30%) translateY(-30%);top:21px;left:35px}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic.ugb-blockquote--small-quote .ugb-blockquote__quote{top:60px;left:35px;transform:translateX(-100%) translateY(-80%)}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-block-content{display:grid;grid-column-gap:35px;grid-row-gap:60px}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-block-content>:last-child{margin-bottom:0}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-1 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-2 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__item{display:flex;flex-direction:column;overflow:hidden}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__content{flex:1;display:flex;flex-direction:column;background-size:cover;background-position:50%}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__excerpt,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__featured-image,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__readmore,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__title{margin:0 0 16px}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__featured-image{border-radius:12px;overflow:hidden}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__featured-image img{-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;width:100%;display:block}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category{font-size:11px;text-transform:uppercase}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category a,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category a:hover,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__title a,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__title a:hover{text-decoration:none;box-shadow:none}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta{font-size:11px;text-transform:uppercase;color:var(--s-primary-color,#2091e1)}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta>:not(.ugb-blog-posts__sep){margin:0}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta>.ugb-blog-posts__sep{margin:0 .25em}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--cat-highlighted .ugb-blog-posts__category{color:transparent!important;margin-left:-3px;margin-right:-3px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--cat-highlighted .ugb-blog-posts__category a{background-color:var(--s-primary-color,#2091e1);color:#fff;display:inline-block;padding:3px 10px;border-radius:4px;margin:0 3px 3px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__item{overflow:visible}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__category{order:1}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__featured-image{order:2}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__excerpt,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__featured-image,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__meta,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__readmore,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__title{order:3}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item{overflow:visible;display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1fr);align-items:flex-start;grid-gap:35px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item>:first-child:last-child{grid-column:1/3}.ugb-button-wrapper .ugb-block-content{display:flex!important;justify-content:center;flex-wrap:wrap;align-items:center;margin-left:-.5em;margin-right:-.5em;width:calc(100% + 1em)}.ugb-button-wrapper .ugb-block-content .ugb-button{margin:0 .5em .5em;display:block}.ugb-button-wrapper .ugb-block-content .ugb-button.ugb-button--has-icon,.ugb-button-wrapper .ugb-block-content .ugb-button.ugb-has-icon{display:flex}.ugb-button-wrapper.ugb-button--design-spread .ugb-block-content{justify-content:space-between}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content{justify-content:space-evenly}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:auto}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3){margin-left:auto}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content{justify-content:space-evenly}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:auto}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:auto}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content{flex-wrap:nowrap}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content>*{width:100%}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content .ugb-button{text-align:center}.ugb-button-wrapper .ugb-button.ugb-button--design-link,.ugb-button-wrapper .ugb-button.ugb-button--design-plain,.ugb-button-wrapper .ugb-button.ugb-link-button,.ugb-button-wrapper .ugb-button.ugb-plain-button{margin-left:.75em;margin-right:.75em}.ugb-cta.ugb-cta--v2 .ugb-cta__item{text-align:center;display:flex;flex-direction:column;justify-content:center}.ugb-cta.ugb-cta--v2 .ugb-cta__description,.ugb-cta.ugb-cta--v2 .ugb-cta__title{margin:0 0 16px}.ugb-cta.ugb-cta--v2:not(.ugb-cta--design-plain) .ugb-cta__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-cta.ugb-cta--v2.ugb-cta--design-plain .ugb-cta__item{padding:0 35px}.ugb-cta.ugb-main-block.alignfull.ugb-main-block--inner-full,.ugb-cta.ugb-main-block.alignfull:not(.ugb--has-block-background){padding:0}.ugb-cta.ugb-main-block.alignfull.ugb-main-block--inner-full .ugb-cta__item,.ugb-cta.ugb-main-block.alignfull:not(.ugb--has-block-background) .ugb-cta__item{border-radius:0}.ugb-card.ugb-card--v2 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-card.ugb-card--v2 .ugb-block-content>:last-child{margin-bottom:0}.ugb-card.ugb-card--v2 .ugb-card__item{display:flex;flex-direction:column}.ugb-card.ugb-card--v2 .ugb-card__content{flex:1;display:flex;flex-direction:column;background-size:cover;background-position:50%;padding:60px 35px}.ugb-card.ugb-card--v2 .ugb-card__description,.ugb-card.ugb-card--v2 .ugb-card__subtitle{margin:0 0 16px}.ugb-card.ugb-card--v2 .ugb-card__image{height:300px;width:100%;background-size:cover;background-position:50%}.ugb-card.ugb-card--v2 .ugb-card__title{margin:0 0 8px}.ugb-card.ugb-card--v2 .ugb-card__subtitle{font-size:.85em}.ugb-card.ugb-card--v2:not(.ugb-card--design-plain) .ugb-card__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden}.ugb-card.ugb-card--v2.ugb-card--design-plain .ugb-card__image{margin-bottom:0 0 16px 0}.ugb-card.ugb-card--v2.ugb-card--design-plain .ugb-card__content{padding:0}.ugb-card.ugb-card--v2.ugb-card--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-card.ugb-card--v2.ugb-card--columns-3 .ugb-card__item:nth-child(2){-ms-grid-column:3}.ugb-card.ugb-card--v2.ugb-card--columns-3 .ugb-card__item:nth-child(3){-ms-grid-column:5}.ugb-card.ugb-card--v2.ugb-card--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-card.ugb-card--v2.ugb-card--columns-2 .ugb-card__item:nth-child(2){-ms-grid-column:3}.ugb-column .ugb-column__item>:first-child{margin-top:0}.ugb-column .ugb-column__item>:last-child{margin-bottom:0}.ugb-column.ugb-main-block{margin-top:0;margin-bottom:0}.ugb-column,.ugb-column .ugb-column__item,.ugb-column>.ugb-inner-block,.ugb-column>.ugb-inner-block>.ugb-block-content{height:100%}.ugb-column .ugb-column__item{display:flex;flex-direction:column}.ugb-columns .ugb-column{align-items:flex-start}.ugb-column.ugb-column--design-basic>.ugb-inner-block>.ugb-block-content>.ugb-column__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:35px}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:first-child{grid-area:one}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(2){grid-area:two}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(3){grid-area:three}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(4){grid-area:four}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(5){grid-area:five}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(6){grid-area:six}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(7){grid-area:seven}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(8){grid-area:eight}.ugb-columns:not(.ugb-columns--design-plain):not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-columns:auto;grid-auto-flow:row}.ugb-columns .ugb-columns__item{align-items:stretch}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>div{margin-left:0;margin-right:0}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two";grid-template-columns:1fr 1fr;grid-template-rows:auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three three";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four" "five five";grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six" "seven seven seven";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three four" "five six seven eight";grid-template-columns:1fr 1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-container.ugb-container--v2.alignfull:not(.ugb-container--design-plain):not(.ugb--has-block-background){padding-left:0;padding-right:0}.ugb-container.ugb-container--v2.alignfull:not(.ugb-container--design-plain):not(.ugb--has-block-background)>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{border-radius:0!important}.ugb-container.ugb-container--v2>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px;display:flex;flex-direction:column;justify-content:center}.ugb-container.ugb-container--v2 .ugb-container__side{display:flex;flex-direction:column;align-items:center;justify-content:center}.ugb-container.ugb-container--v2 .ugb-container__content-wrapper,.ugb-container.ugb-container--v2 .ugb-container__side{width:100%}.ugb-container.ugb-container--v2 .ugb-container__content-wrapper>:first-child{margin-top:0}.ugb-container.ugb-container--v2 .ugb-container__content-wrapper>:last-child{margin-bottom:0}.ugb-container.ugb-container--v2 .ugb--has-block-background,.ugb-container.ugb-container--v2 .ugb-main-block.alignfull{width:auto!important;margin-left:0;margin-right:0}.ugb-container.ugb-container--v2.ugb-container--design-plain>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{background:none;padding-left:0;padding-right:0;box-shadow:none;border-radius:0;overflow:visible}.ugb-count-up.ugb-countup--v4{text-align:center}.ugb-count-up.ugb-countup--v4 .ugb-countup__item{display:flex;flex-direction:column}.ugb-count-up.ugb-countup--v4 .ugb-countup__item>*{z-index:2}.ugb-count-up.ugb-countup--v4 .ugb-countup--hide,.ugb-count-up.ugb-countup--v4 .ugb-countup-hide{visibility:hidden}.ugb-count-up.ugb-countup--v4 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-count-up.ugb-countup--v4 .ugb-countup__counter{font-size:40px;line-height:1em;white-space:nowrap}.ugb-count-up.ugb-countup--v4 .ugb-countup__icon{z-index:1}.ugb-count-up.ugb-countup--v4 .ugb-countup__icon svg{margin:0 auto;height:50px;width:50px}.ugb-count-up.ugb-countup--v4 .ugb-countup__icon.ugb-countup__icon--v2{display:flex;flex-direction:column;align-items:center}.ugb-count-up.ugb-countup--v4 .ugb-countup__counter,.ugb-count-up.ugb-countup--v4 .ugb-countup__icon,.ugb-count-up.ugb-countup--v4 .ugb-countup__title{margin:0 0 16px}.ugb-count-up.ugb-countup--v4 .ugb-countup__description{margin-bottom:0}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-countup__item:nth-child(2){-ms-grid-column:3}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-countup__item:nth-child(3){-ms-grid-column:5}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-countup__item:nth-child(4){-ms-grid-column:7}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-countup__item:nth-child(2){-ms-grid-column:3}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-countup__item:nth-child(3){-ms-grid-column:5}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-2 .ugb-countup__item:nth-child(2){-ms-grid-column:3}.ugb-divider.ugb-divider--v2{padding-left:0!important;padding-right:0!important}.ugb-divider.ugb-divider--v2 hr{background:none;background-color:#ddd!important;border:0!important;padding:0!important;max-width:none!important;margin:0 auto!important;width:50%;height:1px}.ugb-divider.ugb-divider--v2 hr:after,.ugb-divider.ugb-divider--v2 hr:before{display:none}.ugb-divider.ugb-divider--v2 .ugb-divider__dots{margin:0 auto;display:flex;flex-direction:row;justify-content:space-between;overflow:hidden}.ugb-divider.ugb-divider--v2 .ugb-divider__dot{flex-shrink:0}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks hr,.ugb-divider.ugb-divider--v2.ugb-divider--design-dots hr{background-color:transparent!important;height:0!important}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks .ugb-divider__dot,.ugb-divider.ugb-divider--v2.ugb-divider--design-dots .ugb-divider__dot{border-radius:100%;background-color:#ddd}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks .ugb-divider__dot{background:transparent;position:relative}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks .ugb-divider__dot:before{content:"*";font-family:Georgia,Times,Times New Roman,serif;line-height:1;vertical-align:middle;position:absolute;top:0;left:0}.ugb-expand.ugb-expand--v2 .ugb-expand__less-text,.ugb-expand.ugb-expand--v2 .ugb-expand__more-text,.ugb-expand.ugb-expand--v2 .ugb-expand__title{margin:0 0 16px}.ugb-expand.ugb-expand--v2 .ugb-expand__less-toggle-text,.ugb-expand.ugb-expand--v2 .ugb-expand__more-toggle-text{display:inline-block}.ugb-expand.ugb-expand--more .ugb-expand__less-text,.ugb-expand.ugb-expand--more .ugb-expand__more-toggle-text{display:none}.ugb-expand.ugb-expand--more .ugb-expand__more-text{display:block!important}.ugb-expand.ugb-expand--more .ugb-expand__less-toggle-text{display:inline-block!important}.ugb-feature.ugb-feature--v2{text-align:left}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-feature.ugb-feature--v2 .ugb-feature__item{display:grid;justify-content:center;align-items:center;grid-template-columns:1fr 1fr;grid-gap:35px}.ugb-feature.ugb-feature--v2 .ugb-feature__image-side{display:flex;justify-content:center;align-items:center}.ugb-feature.ugb-feature--v2 .ugb-feature__image.ugb-feature__image-has-shape{box-shadow:none!important;border-radius:0!important}.ugb-feature.ugb-feature--v2 .ugb-feature__description,.ugb-feature.ugb-feature--v2 .ugb-feature__title{margin:0 0 16px}.ugb-feature.ugb-feature--v2 .ugb-feature__content,.ugb-feature.ugb-feature--v2 .ugb-feature__item{background-size:cover;background-position:50%}.ugb-feature.ugb-feature--v2.ugb-feature--invert .ugb-feature__content{grid-column:2;grid-row:1}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px;text-align:center}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content>:last-child{margin-bottom:0}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__content{z-index:2}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__item{display:flex;flex-direction:column;background-size:cover;background-position:50%}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image{margin-left:auto;margin-right:auto}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image img{margin:0 auto;height:auto;max-width:100%;position:relative}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__description,.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image,.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__title{margin:0 0 16px}.ugb-feature-grid.ugb-feature-grid--v2:not(.ugb-feature-grid--design-plain) .ugb-feature-grid__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image{min-height:1px}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-feature-grid__item:nth-child(2){-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-feature-grid__item:nth-child(3){-ms-grid-column:5}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-feature-grid__item:nth-child(4){-ms-grid-column:7}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-3 .ugb-feature-grid__item:nth-child(2){-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-3 .ugb-feature-grid__item:nth-child(3){-ms-grid-column:5}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-2 .ugb-feature-grid__item:nth-child(2){-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--design-horizontal .ugb-feature-grid__item{display:-ms-grid;-ms-grid-columns:1fr 35px 1fr}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--design-horizontal .ugb-feature-grid__content{-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--design-horizontal .ugb-feature-grid__item>:first-child:last-child{-ms-grid-column:1!important;-ms-grid-column-span:3}.ugb-header.ugb-header--v3{text-align:center}.ugb-header.ugb-header--v3:not(.ugb-header--design-plain) .ugb-header__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:150px 60px}.ugb-header.ugb-header--v3 .ugb-header__item{padding:150px 60px;justify-content:center;display:flex;flex-direction:column}.ugb-header.ugb-header--v3 .ugb-button{position:relative;margin-top:0;margin-bottom:0}.ugb-header.ugb-header--v3 .ugb-header__subtitle,.ugb-header.ugb-header--v3 .ugb-header__title{margin:0 0 16px}.ugb-header.ugb-header--v3 .ugb-header__buttons{display:flex;align-items:center;justify-content:center;margin-left:-.5em;margin-right:-.5em}.ugb-header.ugb-header--v3 .ugb-header__buttons>*{margin:0 .5em .5em}.ugb-header.ugb-header--v3.ugb-main-block.alignfull:not(.ugb-main-block--inner-center):not(.ugb-main-block--inner-wide){padding:0}.ugb-header.ugb-header--v3.ugb-main-block.alignfull:not(.ugb-main-block--inner-center):not(.ugb-main-block--inner-wide) .ugb-header__item{border-radius:0}.ugb-heading__bottom-line,.ugb-heading__top-line{height:4px;width:100px;background:#333}.ugb-heading .ugb-heading__subtitle,.ugb-heading .ugb-heading__top-line{margin-bottom:16px}.ugb-heading .ugb-heading__title{margin-top:0!important;margin-bottom:8px}.ugb-icon .ugb-inner-block{width:auto}.ugb-icon .ugb-icon__content-wrapper{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-icon .ugb-icon__item{text-align:center;display:flex;flex-direction:column;align-items:center}.ugb-icon.ugb-main-block .ugb-icon-inner-svg svg{height:50px;width:50px}.ugb-icon .ugb-icon__icon{display:inline-block}.ugb-icon .ugb-icon__title{width:100%;margin:0!important}.ugb-icon .ugb-icon__icon:first-child,.ugb-icon .ugb-icon__title:first-child{margin-bottom:16px}.ugb-icon-list.ugb-icon-list--v2 ul{margin:0!important;padding:0!important;list-style:none!important}.ugb-icon-list.ugb-icon-list--v2 li:before{content:"";display:inline-block;vertical-align:middle;height:20px;width:20px;margin-right:1em;background-size:contain!important;background-repeat:no-repeat;background-position:50%;margin-bottom:5px}.ugb-icon-list.ugb-icon-list--v2 li{margin-top:0!important;margin-bottom:16px;list-style:none!important;text-indent:calc(var(--icon-size, 20px)*-1 - 1em)!important;padding-left:calc(var(--icon-size, 20px) + 1em)!important}.ugb-icon-list.ugb-icon-list--v2 li:last-child{margin-bottom:0!important}.ugb-icon-list.ugb-icon-list--v2 li ul{column-count:1;margin-top:16px;list-style:none;margin-left:0}.ugb-icon-list.ugb-icon-list--v2.ugb-icon-list--display-grid ul{display:grid;grid-column-gap:20px}.ugb-icon-list.ugb-icon-list--v2 li{page-break-inside:avoid;break-inside:avoid}.ugb-image-box.ugb-image-box--v4{text-align:center}.ugb-image-box.ugb-image-box--v4 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item{position:relative;height:350px;box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:35px;display:flex;flex-direction:column;justify-content:center}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image-wrapper,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-link{position:absolute;top:0;left:0;right:0;bottom:0}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image-wrapper{height:auto;z-index:1;-webkit-mask-image:-webkit-radial-gradient(#fff,#000);transform:translateZ(0)}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image{height:100%;background-size:cover;background-position:50%;will-change:filter,transform}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover{pointer-events:none;z-index:2;background-color:#000;opacity:.7}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover{z-index:3}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-link{z-index:5}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item:hover .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item:not(:hover) .ugb-image-box__overlay-hover{opacity:0!important}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content{z-index:4}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content>:first-child{margin-top:0}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content>:last-child{margin-bottom:0}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__description,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__line,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__subtitle,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__title{color:#fff;margin:0 0 16px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__subtitle{font-size:.8em;margin-bottom:5.33333px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__box{border-radius:12px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__arrow{pointer-events:none;z-index:4;position:absolute;bottom:35px;left:35px;right:35px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__arrow svg{display:inline-block;fill:#fff;width:30px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__arrow,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__description,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__header,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image-wrapper,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__line,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-link,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__subtitle,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__title{transition:all .4s ease-in-out}.ugb-image-box.ugb-image-box--v4.ugb-image-box--effect-zoom-in .ugb-image-box__item:hover .ugb-image-box__image,.ugb-image-box.ugb-image-box--v4.ugb-image-box--effect-zoom-out .ugb-image-box__item .ugb-image-box__image{transform:scale(1.1)}.ugb-image-box.ugb-image-box--v4.ugb-image-box--effect-zoom-out .ugb-image-box__item:hover .ugb-image-box__image{transform:scale(1)}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__description{margin-bottom:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic.ugb-image-box--with-arrow .ugb-image-box__item{padding-bottom:70px}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__subtitle{opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__description{transform:translateY(-30px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__arrow{transform:translateY(30px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__item:hover .ugb-image-box__arrow,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__item:hover .ugb-image-box__description,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__item:hover .ugb-image-box__subtitle{transform:translateY(0);opacity:1}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain{text-align:left}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item{justify-content:flex-end}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__arrow{position:relative;bottom:auto;left:auto;right:auto}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__content{transform:translateY(30px);margin-bottom:10px}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__description{transform:translateY(-30px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__arrow{transform:translateY(-60px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item:hover .ugb-image-box__arrow,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item:hover .ugb-image-box__content,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item:hover .ugb-image-box__description{transform:translateY(0);opacity:1}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-image-box__item:nth-child(2){-ms-grid-column:3}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-image-box__item:nth-child(3){-ms-grid-column:5}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-image-box__item:nth-child(4){-ms-grid-column:7}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-3 .ugb-image-box__item:nth-child(2){-ms-grid-column:3}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-3 .ugb-image-box__item:nth-child(3){-ms-grid-column:5}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-2 .ugb-image-box__item:nth-child(2){-ms-grid-column:3}.ugb-notification.ugb-notification--v2 .ugb-notification__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:35px;display:flex;flex-direction:column}.ugb-notification.ugb-notification--v2 .ugb-notification__item>:last-child{margin-bottom:0}.ugb-notification.ugb-notification--v2 .ugb-notification__description,.ugb-notification.ugb-notification--v2 .ugb-notification__icon,.ugb-notification.ugb-notification--v2 .ugb-notification__title{margin:0 0 16px}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__item{background-color:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__title,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__title{color:#fff}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__icon{fill:#fff}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-error .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-error .ugb-notification__item{background-color:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-info .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-info .ugb-notification__item{background-color:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__item{background-color:#ffdd57}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__title,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__title{color:#424242}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__icon{fill:#424242}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__item{background:none;border-radius:0;box-shadow:none}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__title{color:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__icon{fill:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-button{border-color:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__title{color:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__icon{fill:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-button{border-color:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__title{color:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__icon{fill:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-button{border-color:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__title{color:#ff6f2f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__icon{fill:#ff6f2f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-button{border-color:#ff6f2f}.ugb-notification.ugb-notification--v2.ugb-notification--dismissible{display:none}.ugb-notification.ugb-notification--v2.ugb-notification--dismissible .ugb-notification__item{position:relative;padding-right:60px}.ugb-notification__icon,.ugb-notification__icon svg{width:30px;height:30px}.ugb-notification__close-button{position:absolute!important;top:0;right:0;z-index:2;margin-right:30px;margin-top:30px;font-size:8px;cursor:pointer;width:16px;height:16px;padding:.3rem 0 0;display:flex;justify-content:center;align-items:center}.ugb-notification__close-button svg{width:100%;height:auto}.ugb-number-box.ugb-number-box--v3{text-align:center}.ugb-number-box.ugb-number-box--v3 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-1 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item{margin-bottom:0!important}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item .ugb-number-box__content{z-index:4}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item{display:flex;flex-direction:column;box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-number-box.ugb-number-box--v3 .ugb-number-box .ugb-inner-block{text-align:center}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__number{background-color:#ddd;background-color:var(--s-primary-color,#ddd);color:#fff;border-radius:100%;font-size:3em;display:block;padding:0;overflow:visible;margin:0 auto;height:2.5em;width:2.5em;line-height:2.5em;box-sizing:content-box;white-space:nowrap!important;text-align:center;z-index:3}.ugb-number-box.ugb-number-box--v3.ugb-number-box--number-style-square .ugb-number-box__number{border-radius:0}.ugb-number-box.ugb-number-box--v3.ugb-number-box--number-style-none .ugb-number-box__number{display:block;background:none;border-radius:0;color:#222;color:var(--s-primary-color,#222);line-height:1em;height:auto;width:100%}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__number{margin:0 auto 16px}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__description,.ugb-number-box.ugb-number-box--v3 .ugb-number-box__title{margin:0 0 16px}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__title{line-height:1.1em}.ugb-number-box.ugb-number-box--v3.ugb-number-box--design-plain .ugb-number-box__item{box-shadow:none;border-radius:0;padding:0;background:none}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-number-box__item:nth-child(2){-ms-grid-column:3}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-number-box__item:nth-child(3){-ms-grid-column:5}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-number-box__item:nth-child(2){-ms-grid-column:3}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-block-content{text-align:center;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px;align-items:center}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px;display:flex;flex-direction:column}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__feature-list{display:flex;flex-direction:column;justify-content:center;align-items:center}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-line{display:flex;justify-content:center}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-prefix{align-self:flex-start;font-size:1.2em}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-suffix{align-self:flex-end;font-size:1.5em}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price{font-size:3.5em;line-height:100%!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__subprice{font-size:.75em;color:#ddd;text-transform:uppercase;line-height:100%!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image{margin-left:auto;margin-right:auto;width:100%}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image .ugb-img{margin:0 auto;display:block}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__description,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-wrapper,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__subprice,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__title{margin:0 0 16px}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__button{margin-top:32px;margin-bottom:32px}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--design-plain .ugb-pricing-box__item{background:none;padding:0;box-shadow:none;border-radius:0}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image{min-height:1px}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-pricing-box__item:nth-child(2){-ms-grid-column:3}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-pricing-box__item:nth-child(3){-ms-grid-column:5}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-2 .ugb-pricing-box__item:nth-child(2){-ms-grid-column:3}.ugb-separator .ugb-block-content .ugb-separator__svg-wrapper{height:200px}.ugb-separator{box-sizing:content-box;position:relative}.ugb-separator.ugb-separator.ugb-separator.ugb-separator{z-index:2}.ugb-separator.ugb-separator--flip-vertical{transform:scaleY(-1)}.ugb-separator.ugb-separator--flip-horizontal{transform:scaleX(-1)}.ugb-separator.ugb-separator--flip-vertical.ugb-separator--flip-horizontal{transform:scaleY(-1) scaleX(-1)}.ugb-separator .ugb-separator__svg-wrapper{position:relative;display:flex;align-items:flex-end;overflow-x:hidden;overflow-y:visible;box-sizing:content-box}.ugb-separator.alignfull,.ugb-separator.alignfull .ugb-separator__svg-wrapper{overflow:visible}.ugb-separator .ugb-separator__svg-inner{position:relative;height:100%;width:100%}.ugb-separator svg{height:100%;width:100%;display:block;fill:#abb8c3;position:absolute;top:0;left:0;right:0;bottom:0;z-index:3;transform-origin:bottom}.ugb-separator svg.ugb-separator--no-shadow :not(:last-child){display:none}.ugb-separator .ugb-separator__bottom-pad,.ugb-separator .ugb-separator__top-pad{height:0;width:100%;z-index:2;position:relative}.ugb-separator .ugb-separator__top-pad{margin-bottom:-1px}.ugb-separator .ugb-separator__bottom-pad{margin-top:-1px;background:#abb8c3}.ugb-spacer.ugb-spacer--v2{height:50px;margin-top:0!important;margin-bottom:0!important;background-size:cover;background-position:50%;padding:0!important}.ugb-spacer.ugb-spacer--v2 .ugb-block-content,.ugb-spacer.ugb-spacer--v2 .ugb-inner-block,.ugb-spacer.ugb-spacer--v2 .ugb-spacer--inner{height:100%}.ugb-spacer.ugb-spacer--v2 .ugb-bottom-separator,.ugb-spacer.ugb-spacer--v2 .ugb-top-separator{z-index:6}.ugb-spacer.ugb-spacer--v2.ugb--has-bottom-separator,.ugb-spacer.ugb-spacer--v2.ugb--has-top-separator{padding:0!important}.ugb-team-member.ugb-team-member--v3 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-team-member.ugb-team-member--v3 .ugb-block-content>:last-child{margin-bottom:0}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__item{display:flex;flex-direction:column;text-align:center}.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-half .ugb-team-member__content,.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-horizontal .ugb-team-member__content{flex:1}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__content{display:flex;flex-direction:column;background-size:cover;background-position:50%}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__image{width:300px;height:auto;margin:0 auto;background-size:cover;background-position:50%}.ugb-team-member.ugb-team-member--v3 .ugb-img{margin:0 auto}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-2 .ugb-team-member__image{width:220px}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-team-member__image{width:150px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__image{margin-bottom:24px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__buttons,.ugb-team-member.ugb-team-member--v3 .ugb-team-member__description,.ugb-team-member.ugb-team-member--v3 .ugb-team-member__position{margin:0 0 16px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__name{margin-bottom:8px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__position{color:#aaa}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__buttons{margin-left:-4px;margin-right:-4px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__buttons .ugb-button-container{display:inline-block;margin:0 4px 4px}.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-basic .ugb-team-member__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__image{min-height:1px}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-team-member__item:nth-child(2){-ms-grid-column:3}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-team-member__item:nth-child(3){-ms-grid-column:5}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-2 .ugb-team-member__item:nth-child(2){-ms-grid-column:3}.ugb-testimonial--v3.ugb-testimonial .ugb-block-content{text-align:center;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px;display:flex;flex-direction:column}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__image{height:auto;width:75px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__position{font-size:.75em;text-transform:uppercase;color:#aaa}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__image{margin:0 auto 16px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__body,.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__name{margin:0 0 16px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__position{margin-bottom:0}.ugb-testimonial.ugb-testimonial--v3.ugb-testimonial--design-plain .ugb-testimonial__item{background:none;padding:0;box-shadow:none;border-radius:0}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-3 .ugb-testimonial__item:nth-child(2){-ms-grid-column:3}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-3 .ugb-testimonial__item:nth-child(3){-ms-grid-column:5}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-2 .ugb-testimonial__item:nth-child(2){-ms-grid-column:3}.ugb-text__text-wrapper{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-column-gap:35px}.ugb-text__text{display:flex;flex-direction:column}.ugb-text__text>p{margin-bottom:16px}.ugb-text--has-rule.ugb-text--columns-2 .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr}.ugb-text--has-rule.ugb-text--columns-3 .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr 1px 1fr}.ugb-text--has-rule.ugb-text--columns-4 .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr 1px 1fr 1px 1fr}.ugb-text__rule{width:1px;background:#ddd;height:100%;margin:auto}.ugb-text--design-side-title-1 .ugb-block-content,.ugb-text--design-side-title-2 .ugb-block-content{display:grid;grid-template-columns:1fr 1fr;grid-gap:35px;grid-row-gap:0}.ugb-text--design-side-title-1.ugb-text--columns-2 .ugb-block-content{grid-template-columns:1fr 2fr}.ugb-text--design-side-title-1.ugb-text--columns-3 .ugb-block-content{grid-template-columns:1fr 3fr}.ugb-text--design-side-title-1.ugb-text--columns-4 .ugb-block-content{grid-template-columns:1fr 4fr}.ugb-text--design-side-title-1.ugb-text--reverse-title.ugb-text--columns-2 .ugb-block-content{grid-template-columns:2fr 1fr}.ugb-text--design-side-title-1.ugb-text--reverse-title.ugb-text--columns-3 .ugb-block-content{grid-template-columns:3fr 1fr}.ugb-text--design-side-title-1.ugb-text--reverse-title.ugb-text--columns-4 .ugb-block-content{grid-template-columns:4fr 1fr}.ugb-text--design-side-title-2 .ugb-block-content{grid-template-columns:-webkit-max-content 1fr;grid-template-columns:max-content 1fr;grid-template-columns:fit-content(75%) 1fr}.ugb-text--design-side-title-2.ugb-text--reverse-title .ugb-block-content{grid-template-columns:1fr -webkit-max-content;grid-template-columns:1fr max-content;grid-template-columns:1fr fit-content(75%)}.ugb-text--reverse-title .ugb-text__title-wrapper{grid-column:2/3;grid-row:1}.ugb-text--reverse-title .ugb-text__text-wrapper{grid-column:1/2;grid-row:1}.ugb-text--subtitle-top .ugb-text__subtitle{order:1}.ugb-text--subtitle-top .ugb-text__title{order:2}.ugb-text__title-wrapper{display:flex;flex-direction:column}.ugb-text .ugb-text__title{margin:0 0 8px}.ugb-text .ugb-text__subtitle{margin:0 0 16px;font-size:.85em}.ugb-text--has-rule .ugb-text__text{column-rule:1px solid #ddd;column-gap:52.5px}.ugb-video-popup--v3 .ugb-video-popup__play-button{position:absolute}.ugb-video-popup--v3 .ugb-video-popup__play-button svg{fill:#fff}.ugb-video-popup__wrapper{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;margin-left:auto;margin-right:auto;overflow:hidden;position:relative;width:100%;height:400px;padding:0;background-color:#000;background-size:cover;background-position:50%;border-radius:12px}.ugb-video-popup__wrapper:before{transition:all .3s ease-in-out}.ugb-video-popup.ugb-video-popup--v3.alignfull.ugb-main-block--inner-full.ugb--has-block-background .ugb-video-popup__wrapper,.ugb-video-popup.ugb-video-popup--v3.alignfull:not(.ugb--has-block-background) .ugb-video-popup__wrapper{border-radius:0;margin-left:-35px;margin-right:-35px;width:calc(100% + 70px)}.ugb-video-popup__overlay{position:absolute!important;top:0;left:0;right:0;bottom:0;z-index:6!important}.ugb-video-popup__play-button{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;display:flex;justify-content:center;align-items:center;flex-direction:column}.ugb-video-popup__play-button svg{fill:#fff;width:10%;height:10%;min-width:30px;min-height:30px}.ugb-video-popup--button-circle .ugb-video-popup__play-button svg,.ugb-video-popup--button-outline .ugb-video-popup__play-button svg{min-width:50px;min-height:50px}#bp_container .bp-x,#bp_container .bp-x:hover{background:none!important}#bp_sv{margin:auto!important}.ugb-button{border:none;border-radius:4px;display:inline-block;cursor:pointer;opacity:1;background:#2091e1;background:var(--s-primary-color,#2091e1);padding:8px 26px;line-height:1.5!important;align-items:center;font-size:1em;position:relative}.ugb-button,.ugb-button .ugb-button--inner{transition:all .2s ease-in-out;box-shadow:none!important}.ugb-button .ugb-button--inner{text-decoration:none!important;display:block;color:#fff;margin:0!important;padding:0!important}.ugb-button:hover{opacity:.85;box-shadow:none!important}.ugb-button:not(.ugb-link-button):not(.ugb-button--design-link){text-decoration:none!important}.ugb-button.ugb--shadow-0{box-shadow:none!important}.ugb-button.ugb--shadow-1{box-shadow:0 0 0 1px hsla(0,0%,47.1%,.1)!important}.ugb-button.ugb--shadow-2{box-shadow:0 0 0 2px hsla(0,0%,47.1%,.1)!important}.ugb-button.ugb--shadow-3{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2)!important}.ugb-button.ugb--shadow-4{box-shadow:0 2px 22px hsla(0,0%,60%,.25)!important}.ugb-button.ugb--shadow-5{box-shadow:0 5px 30px -6px rgba(18,63,82,.29)!important}.ugb-button.ugb--shadow-6{box-shadow:0 10px 30px 1px rgba(0,0,0,.07)!important}.ugb-button.ugb--shadow-7{box-shadow:5px 7px 21px 3px rgba(72,73,121,.14)!important}.ugb-button.ugb--shadow-8{box-shadow:0 10px 33px -3px rgba(0,0,0,.12)!important}.ugb-button.ugb--shadow-9{box-shadow:0 10px 34px -3px rgba(72,73,121,.2)!important}.ugb-button:before{position:absolute;z-index:1;border-radius:4px;top:0;left:0;right:0;bottom:0;transition:all .2s ease-in-out;opacity:0}.ugb-button:hover:before{opacity:1}.ugb-button *{position:relative;z-index:2}.ugb-button.ugb-button--design-ghost:before{top:-2px;left:-2px;right:-2px;bottom:-2px}.ugb-button.ugb--hover-effect-lift:hover{transform:translateY(-10%)}.ugb-button.ugb--hover-effect-scale:hover{transform:scale(1.03)}.ugb-button.ugb--hover-effect-lift-scale:hover{transform:scale(1.03) translateY(-10%)}.ugb-button.ugb--hover-effect-scale-more:hover{transform:scale(1.13)}.ugb-button.ugb--hover-effect-lift-scale-more:hover{transform:scale(1.13) translateY(-10%)}.ugb-button .ugb-button--inner:hover{color:#fff}.ugb-button.ugb-button--size-tiny{padding:.3em 1em}.ugb-button.ugb-button--size-tiny .ugb-button--inner{font-size:.7em}.ugb-button.ugb-button--size-small .ugb-button--inner{font-size:.85em}.ugb-button.ugb-button--size-medium{padding:.6em 1.5em}.ugb-button.ugb-button--size-medium .ugb-button--inner{font-size:1.075em}.ugb-button.ugb-button--size-large{padding:.8em 1.75em}.ugb-button.ugb-button--size-large .ugb-button--inner{font-size:1.15em}.ugb-button--align-left{margin-right:auto}.ugb-button--align-center{margin-left:auto;margin-right:auto}.ugb-button--align-right{margin-left:auto}.ugb-button--align-full{text-align:center}.ugb-button.ugb-button--icon-only{padding:.7em}.ugb-button.ugb-button--icon-only svg{margin:0!important}.ugb-button--design-ghost{background-color:transparent;border:2px solid #2091e1;border:2px solid var(--s-primary-color,#2091e1)}.ugb-button--design-ghost .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-ghost:hover{opacity:.85;box-shadow:none!important}.ugb-button--design-ghost:hover .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background-color:#2091e1;background-color:var(--s-primary-color,#2091e1)}.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover .ugb-button--inner,.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg:not(.ugb-custom-icon){color:#fff}.ugb-button--design-plain{background-color:transparent;border:none;padding-left:0;padding-right:0}.ugb-button--design-plain .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-plain:hover{opacity:.85;box-shadow:none!important}.ugb-button--design-plain:hover .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-link{background:transparent;padding:0;border-radius:0!important}.ugb-button.ugb-button--has-icon{display:inline-flex;justify-content:center;align-items:center}.ugb-button.ugb-button--has-icon svg:not(.ugb-custom-icon){color:#fff}.ugb-button.ugb-button--has-icon svg{width:1em;height:1em;margin-bottom:0!important;margin-right:16px}.ugb-button.ugb-button--has-icon.ugb-button--icon-position-right{flex-direction:row-reverse}.ugb-button.ugb-button--has-icon.ugb-button--icon-position-right svg{margin-right:0;margin-left:16px}.ugb-button--has-icon.ugb-button--design-ghost svg:not(.ugb-custom-icon),.ugb-button--has-icon.ugb-button--design-plain svg:not(.ugb-custom-icon){color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--size-small.ugb-button--has-icon svg,.ugb-button--size-tiny.ugb-button--has-icon svg{width:.75em;height:.75em}.ugb-button--size-medium.ugb-button--has-icon svg{width:1.25em;height:1.25em}.ugb-button--size-large.ugb-button--has-icon svg{width:1.5em;height:1.5em}.ugb--has-background-overlay{position:relative;z-index:1;background-size:cover;background-position:50%}.ugb--has-background-overlay.ugb--has-background-overlay:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:2}.ugb--has-background-overlay>*{position:relative;z-index:3}.ugb-main-block svg .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.ugb-main-block svg .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:1;opacity:var(--fa-primary-opacity,1)}.ugb-img{-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}.ugb-img.ugb-img--shape{mask-mode:alpha;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center;border-radius:none}.ugb-img.ugb-image--shape-stretch{-webkit-mask-size:100% 100%;mask-size:100% 100%}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook{background:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost{border-color:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-plain svg{color:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter{background:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost{border-color:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-plain svg{color:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram{background:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost{border-color:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-plain svg{color:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest{background:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost{border-color:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-plain svg{color:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin{background:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost{border-color:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-plain svg{color:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube{background:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost{border-color:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-plain svg{color:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email{background:#a6b1b7}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost{border-color:#a6b1b7}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#a6b1b7}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-plain svg{color:#a6b1b7}.ugb-icon__bg-shape-wrapper{position:relative}.ugb-icon__bg-shape-wrapper>:not(.ugb-icon__bg-shape){position:relative;z-index:2}.ugb-icon__bg-shape-wrapper .ugb-icon__bg-shape{position:absolute;z-index:1;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);height:100%;width:100%;color:#cde;fill:#cde}.ugb-icon-inner-svg svg{display:block}.ugb-icon__design-wrapper{padding:20px}.ugb-icon__design-wrapper.ugb--shadow-9{box-shadow:0 25px 60px -15px rgba(72,73,121,.38)!important}.ugb-icon__design-wrapper.ugb-icon__design-shaped{background-color:#ddd}.ugb-icon__design-wrapper.ugb-icon__design-outlined{border:3px solid #ddd}.ugb-icon__gradient{opacity:0!important;height:0!important;width:0!important;visibility:hidden!important;overflow:hidden!important;position:absolute!important;z-index:-99999!important;max-height:0!important;max-width:0!important;min-height:0!important;min-width:0!important}.ugb-highlight[style*=background]{padding:.1em .4em;display:inline}.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull{margin-top:0;margin-bottom:0;padding-top:70px;padding-bottom:70px}.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull.ugb-main-block--inner-full>.ugb-inner-block{width:100%}.ugb-main-block.ugb--has-block-background{background-size:cover;background-position:50%}.ugb-main-block>*{z-index:2}.ugb-main-block .ugb-inner-block{z-index:5}.ugb-main-block.ugb--has-top-separator{padding-top:200px!important}.ugb-main-block.ugb--has-bottom-separator{padding-bottom:200px!important}.ugb-bottom-separator,.ugb-top-separator{pointer-events:none;position:absolute!important;top:-1px;left:-1px;right:-1px;bottom:-1px;overflow:hidden;margin:0}.ugb-bottom-separator .ugb-separator-wrapper,.ugb-top-separator .ugb-separator-wrapper{position:absolute;top:auto;left:0;right:0;bottom:0;height:200px;margin:0}.ugb-bottom-separator .ugb-separator__layer-1,.ugb-bottom-separator .ugb-separator__shadow,.ugb-top-separator .ugb-separator__layer-1,.ugb-top-separator .ugb-separator__shadow{position:absolute;fill:#fff;height:100%;width:100%;z-index:4}.ugb-bottom-separator svg,.ugb-top-separator svg{left:0;right:0}.ugb-bottom-separator .ugb-separator__shadow,.ugb-top-separator .ugb-separator__shadow{z-index:3}.ugb-top-separator{transform:scaleY(-1)}.ugb-bottom-separator .ugb-separator-wrapper{top:auto;bottom:0}.ugb-bottom-separator .ugb-separator__layer-1,.ugb-bottom-separator .ugb-separator__shadow{transform:none}.ugb-main-block .ugb-block-title{margin:0 0 64px}.ugb-main-block .ugb-block-title.ugb-block-title--with-subtitle{margin-bottom:16px}.ugb-main-block .ugb-block-description{margin:0 0 64px}.ugb-main-block,[class*=ugb-]+form[class*=-link],[class*=ugb-] form[class*=-link],form[class*=ugb-][class*=-link]{display:flex;justify-content:center;align-items:center}.ugb-main-block{margin-top:35px;margin-bottom:35px;padding:0}.ugb-main-block.alignfull{padding:0 35px}.ugb-block-content,.ugb-inner-block{margin:0;padding:0;width:100%;position:relative}.ugb--full-height{min-height:700px}.ugb--restrict-content-width .ugb-content-wrapper{max-width:var(--content-width);margin:0 auto}.ugb--shadow-0,.ugb-shadow-0{box-shadow:none!important}.ugb--shadow-1,.ugb-shadow-1{box-shadow:0 0 0 1px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-2,.ugb-shadow-2{box-shadow:0 0 0 2px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-3,.ugb-shadow-3{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2)!important}.ugb--shadow-4,.ugb-shadow-4{box-shadow:0 2px 20px hsla(0,0%,60%,.2)!important}.ugb--shadow-5,.ugb-shadow-5{box-shadow:0 5px 30px -10px rgba(18,63,82,.3)!important}.ugb--shadow-6,.ugb-shadow-6{box-shadow:0 10px 30px rgba(0,0,0,.05)!important}.ugb--shadow-7,.ugb-shadow-7{box-shadow:7px 5px 30px rgba(72,73,121,.15)!important}.ugb--shadow-8,.ugb-shadow-8{box-shadow:0 10px 60px rgba(0,0,0,.1)!important}.ugb--shadow-9,.ugb-shadow-9{box-shadow:0 70px 130px -60px rgba(72,73,121,.38)!important}div[class^=wp-block-ugb-]{z-index:1}@supports (-webkit-touch-callout:inherit){[class*=ugb-]{background-attachment:scroll!important}}.ugb-block-content:after,.ugb-block-content:before{content:none!important}.ugb-main-block{position:relative}.ugb-main-block .ugb-video-background{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);width:100%;height:100%;z-index:1;-o-object-fit:cover;object-fit:cover}@media screen and (max-width:600px){.ugb-accordion.ugb-accordion--v2.ugb-accordion.ugb-accordion--design-basic .ugb-accordion__heading,.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__item{padding:35px 17.5px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-2 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item{grid-template-columns:minmax(0,1fr);grid-gap:0}.ugb-button-wrapper.ugb-button--design-spread .ugb-block-content{justify-content:center}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content{justify-content:flex-start}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:0}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3){margin-left:0}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content{justify-content:flex-end}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content{flex-wrap:wrap}.ugb-cta.ugb-cta--v2:not(.ugb-cta--design-plain) .ugb-cta__item{padding:35px 17.5px}.ugb-card.ugb-card--v2 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-container.ugb-container--v2>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{padding:35px 17.5px}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-block-content,.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-feature-grid.ugb-feature-grid--v2:not(.ugb-feature-grid--design-plain) .ugb-feature-grid__item,.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item{padding:35px 17.5px}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-header.ugb-header--v3:not(.ugb-header--design-plain) .ugb-header__item{padding:35px 17.5px}.ugb-header.ugb-header--v3 .ugb-header__buttons{flex-wrap:wrap}.ugb-icon-list.ugb-icon-list--v2.ugb-icon-list.ugb-icon-list--display-grid ul{grid-template-columns:1fr}.ugb-icon-list.ugb-icon-list--v2.ugb-icon-list.ugb-icon-list ul{column-count:1}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item{padding:35px 17.5px}.ugb-image-box.ugb-image-box--v4 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-notification.ugb-notification--v2 .ugb-notification__item{padding:35px 17.5px}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item{padding:35px 17.5px}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-basic .ugb-team-member__item{padding:35px 17.5px}.ugb-team-member.ugb-team-member--v3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{padding:35px 17.5px}.ugb-testimonial.ugb-testimonial--v3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-3 .ugb-text__text-wrapper{grid-template-columns:1fr;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-3 .ugb-text__rule{display:none!important}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-2 .ugb-block-content{display:block}.ugb-text.ugb-text--design-plain.ugb-text--columns-3 .ugb-text__text-wrapper{grid-template-columns:1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain.ugb-text--columns-3 .ugb-text__rule{display:none!important}.ugb-video-popup__wrapper{padding:35px 17.5px}.ugb--hide-mobile{display:none!important}.ugb-main-block.alignfull{padding-right:17.5px;padding-left:17.5px}}@media screen and (min-width:1025px){.ugb--full-height{min-height:100vh}.ugb-main-block .ugb-video-background.ugb--video-hide-desktop{display:none!important}}@media screen and (max-width:782px){.ugb-accordion.ugb-accordion--v2.ugb-accordion.ugb-accordion--design-basic .ugb-accordion__heading,.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__item{padding:40px 23.33333px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-container.ugb-container--v2>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper,.ugb-cta.ugb-cta--v2:not(.ugb-cta--design-plain) .ugb-cta__item,.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item{padding:40px 23.33333px}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item,.ugb-feature.ugb-feature--v2.ugb-feature--design-plain .ugb-feature__item{grid-template-columns:1fr!important}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__content,.ugb-feature.ugb-feature--v2.ugb-feature--design-plain .ugb-feature__content{grid-row:2;grid-column:1}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__image-side,.ugb-feature.ugb-feature--v2.ugb-feature--design-plain .ugb-feature__image-side{grid-row:1;grid-column:1}.ugb-feature-grid.ugb-feature-grid--v2:not(.ugb-feature-grid--design-plain) .ugb-feature-grid__item,.ugb-header.ugb-header--v3:not(.ugb-header--design-plain) .ugb-header__item,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item,.ugb-notification.ugb-notification--v2 .ugb-notification__item{padding:40px 23.33333px}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item,.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-basic .ugb-team-member__item,.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{padding:40px 23.33333px}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4 .ugb-text__text-wrapper{grid-template-columns:1fr 1fr;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4.ugb-text--has-rule .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4.ugb-text--has-rule .ugb-text__rule-2{display:none!important}.ugb-video-popup__wrapper{padding:40px 23.33333px}}@media screen and (min-width:600px) and (max-width:1280px){.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}@media screen and (max-width:1440px){.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-3 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}@media screen and (max-width:960px){.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-2 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-3 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-count-up.ugb-countup--v4 .ugb-countup__counter{font-size:calc(1rem + 4vw)}.ugb-icon .ugb-icon__content-wrapper{display:flex;flex-direction:row;flex-wrap:wrap}.ugb-icon .ugb-icon__item{flex:1;white-space:nowrap;min-width:-webkit-fit-content;min-width:fit-content;flex-shrink:0;margin:16px 17.5px}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-block-content,.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-block-content,.ugb-testimonial.ugb-testimonial--v3.ugb-testimonial--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-3 .ugb-block-content,.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4 .ugb-block-content{display:block}}@media screen and (-ms-high-contrast:active) and (min-width:600px),screen and (-ms-high-contrast:none) and (min-width:600px){.ugb-blog-posts.ugb-blog-posts--v2 .ugb-block-content{display:flex;flex-wrap:wrap}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__item{margin-left:17.5px;margin-right:17.5px;margin-bottom:35px!important}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-blog-posts__item{width:calc(25% - 35px)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-3 .ugb-blog-posts__item{width:calc(33.33333% - 35px)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-2 .ugb-blog-posts__item{width:calc(50% - 35px)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-1 .ugb-blog-posts__item{width:100%}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-portfolio2 .ugb-blog-posts__item{padding:35px 5%!important}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item{display:-ms-grid;-ms-grid-columns:1fr 35px 1fr}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__content{-ms-grid-column:3}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item>:first-child:last-child{-ms-grid-column:1!important;-ms-grid-column-span:3}.ugb-blog-posts.ugb-blog-posts--v2:not(.ugb-blog-posts--design-horizontal-card) .ugb-blog-posts__content{flex:1 1 auto}}@media screen and (-ms-high-contrast:active) and (max-width:600px),screen and (-ms-high-contrast:none) and (max-width:600px){.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__item{display:block;margin-bottom:35px!important}.ugb-block-content{display:block!important}.ugb-card__item{margin-bottom:35px}}@media screen and (max-width:1025px){.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:0}.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2),.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}}@media screen and (max-width:768px){.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:0}.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2),.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-columns.ugb-columns.ugb-columns.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr!important;grid-template-areas:inherit!important}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-columns:1fr!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:inherit!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit}.ugb-bottom-separator .ugb-separator-wrapper,.ugb-top-separator .ugb-separator-wrapper{height:23vw}.ugb-main-block.ugb--has-top-separator{padding-top:23vw!important}.ugb-main-block.ugb--has-bottom-separator{padding-bottom:23vw!important}.ugb-main-block .ugb-video-background.ugb--video-hide-mobile{display:none!important}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){.ugb-card.ugb-card--v2:not(.ugb-card--design-horizontal) .ugb-card__content{flex:1 1 auto}}@media screen and (min-width:768px) and (max-width:1025px){.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr 1fr!important}.ugb-main-block .ugb-video-background.ugb--video-hide-tablet{display:none!important}}@media screen and (max-width:960px) and (min-width:600px){.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row}}@media screen and (max-width:600px) and (-ms-high-contrast:active),screen and (max-width:600px) and (-ms-high-contrast:none){.ugb-count-up.ugb-countup--v4 .ugb-block-content{display:block!important}.ugb-count-up.ugb-countup--v4 .ugb-countup__item{margin-bottom:35px}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content{display:block!important}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__item{margin-bottom:35px}.ugb-image-box.ugb-image-box--v4 .ugb-block-content{display:block!important}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item{margin-bottom:35px}.ugb-number-box.ugb-number-box--v3 .ugb-block-content{display:block!important}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item{margin-bottom:35px!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-block-content{display:block!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item{margin-bottom:35px}.ugb-team-member.ugb-team-member--v3 .ugb-block-content{display:block!important}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__item{margin-bottom:35px}.ugb-testimonial--v3.ugb-testimonial .ugb-block-content{display:block!important}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{margin-bottom:35px}}@media (-ms-high-contrast:none){.ugb-feature.ugb-feature--v2 .ugb-feature__image.ugb-feature__image-has-shape.ugb-img.ugb-img--shape,.ugb-img.ugb-img--shape,::-ms-backdrop{border-radius:9999px!important}}@media screen and (min-width:600px) and (max-width:960px){.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-block-content,.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row}}@media (max-width:1024px){.ugb-separator .ugb-block-content .ugb-separator__svg-wrapper{height:175px}}@media (max-width:767px){.ugb-separator .ugb-block-content .ugb-separator__svg-wrapper{height:75px}}@media screen and (max-width:480px){.ugb-text:not(.ugb-text--design-plain) .ugb-block-content{display:block}.ugb-text:not(.ugb-text--design-plain) .ugb-text__text-wrapper{grid-template-columns:1fr!important;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain) .ugb-text__rule{display:none!important}.ugb-text.ugb-text--design-plain .ugb-text__text-wrapper{grid-template-columns:1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain .ugb-text__rule{display:none!important}}@media screen and (max-width:960px) and (min-width:480px){.ugb-text.ugb-text--design-plain.ugb-text--columns-4 .ugb-text__text-wrapper{grid-template-columns:1fr 1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain.ugb-text--columns-4.ugb-text--has-rule .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain.ugb-text--columns-4.ugb-text--has-rule .ugb-text__rule-2{display:none!important}}@media screen and (min-width:961px){.ugb--hide-desktop{display:none!important}}@media screen and (min-width:601px) and (max-width:960px){.ugb--hide-tablet{display:none!important}}@media screen and (min-width:960px){.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull.ugb-main-block--inner-center>.ugb-inner-block{max-width:900px;max-width:var(--content-width)}}@media screen and (min-width:1280px){.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull.ugb-main-block--inner-wide>.ugb-inner-block{width:75vw;min-width:1200px}} \ No newline at end of file +.ugb-accordion.ugb-accordion--v2.ugb-accordion--open>.ugb-inner-block>.ugb-block-content>.ugb-accordion__item>.ugb-accordion__heading .ugb-accordion__arrow{transform:rotate(180deg)}.ugb-accordion.ugb-accordion--v2.ugb-accordion.ugb-accordion--design-basic .ugb-accordion__heading{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:17.5px 35px}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading{margin:0;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:margin .3s ease-in-out;will-change:margin}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading .ugb-accordion__title{flex:1;margin:0!important;order:1}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading .ugb-accordion__arrow{flex-shrink:0;order:3;transition:transform .3s ease-in-out;transform:rotate(0deg)}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading:after{content:"";width:26.25px;display:block;order:2;flex-shrink:0}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading:focus{outline-width:1px;outline-style:dotted}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__heading.ugb--shadow-9{box-shadow:0 25px 60px -15px rgba(72,73,121,.38)!important}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__content{transition:max-height .3s ease-in-out,transform .3s ease-in-out,opacity .3s ease-in-out;transform:translateY(0);opacity:1;will-change:max-height;overflow:hidden}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .ugb-accordion__content-inner{padding:35px 35px 0}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .ugb-accordion__content-inner>:first-child{margin-top:0!important}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .ugb-accordion__content-inner>:last-child{margin-bottom:0!important}.ugb-accordion.ugb-accordion--v2 .ugb-accordion__content .wp-block-image.wp-block-image.wp-block-image>img{max-width:100%}.ugb-accordion.ugb-accordion--v2:not(.ugb-accordion--open) .ugb-accordion__heading{margin-bottom:0}.ugb-accordion.ugb-accordion--v2:not(.ugb-accordion--open) .ugb-accordion__content{max-height:0;transform:translateY(25px);opacity:0}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__item{border-bottom:1px solid rgba(0,0,0,.1)}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__heading{box-shadow:none;border-radius:0;padding:0;margin-bottom:35px}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__heading:focus{outline-offset:10px}.ugb-accordion.ugb-accordion--v2.ugb-accordion--design-plain .ugb-accordion__content .ugb-accordion__content-inner{padding:0 0 35px}.ugb-blockquote.ugb-blockquote--v3{border:0!important;padding:0!important;font-style:italic;text-align:inherit;background-color:transparent;position:relative;overflow:visible}.ugb-blockquote.ugb-blockquote--v3:after,.ugb-blockquote.ugb-blockquote--v3:not(.ugb--has-block-background):before{content:"";display:none!important}.ugb-blockquote.ugb-blockquote--v3 .ugb-blockquote__item{position:relative;padding:60px 35px}.ugb-blockquote.ugb-blockquote--v3 .ugb-blockquote__quote{position:absolute;fill:rgba(129,141,165,.32);width:70px;height:70px;transform:translateX(-50%) translateY(-30%);top:0;left:0;z-index:5}.ugb-blockquote.ugb-blockquote--v3 .ugb-blockquote__content{position:relative;z-index:6}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--small-quote .ugb-blockquote__quote{top:60px;left:35px;transform:translateX(-100%) translateY(-80%)}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;padding:60px 35px;overflow:hidden}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__quote{transform:translateX(-30%) translateY(-30%);top:21px;left:35px}.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic.ugb-blockquote--small-quote .ugb-blockquote__quote{top:60px;left:35px;transform:translateX(-100%) translateY(-80%)}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-block-content{display:grid;grid-column-gap:35px;grid-row-gap:60px}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-block-content>:last-child{margin-bottom:0}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-1 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-2 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__item{display:flex;flex-direction:column;overflow:hidden}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__content{flex:1;display:flex;flex-direction:column;background-size:cover;background-position:50%}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__excerpt,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__featured-image,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__readmore,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__title{margin:0 0 16px}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__featured-image{border-radius:12px;overflow:hidden}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__featured-image img{-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;width:100%;display:block}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category{font-size:11px;text-transform:uppercase}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category a,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__category a:hover,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__title a,.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__title a:hover{text-decoration:none;box-shadow:none}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta{font-size:11px;text-transform:uppercase;color:var(--s-primary-color,#2091e1)}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta>:not(.ugb-blog-posts__sep){margin:0}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__meta>.ugb-blog-posts__sep{margin:0 .25em}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--cat-highlighted .ugb-blog-posts__category{color:transparent!important;margin-left:-3px;margin-right:-3px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--cat-highlighted .ugb-blog-posts__category a{background-color:var(--s-primary-color,#2091e1);color:#fff;display:inline-block;padding:3px 10px;border-radius:4px;margin:0 3px 3px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__item{overflow:visible}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__category{order:1}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__featured-image{order:2}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__excerpt,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__featured-image,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__meta,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__readmore,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-basic .ugb-blog-posts__title{order:3}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item{overflow:visible;display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1fr);align-items:flex-start;grid-gap:35px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item>:first-child:last-child{grid-column:1/3}.ugb-button-wrapper .ugb-block-content{display:flex!important;justify-content:center;flex-wrap:wrap;align-items:center;margin-left:-.5em;margin-right:-.5em;width:calc(100% + 1em)}.ugb-button-wrapper .ugb-block-content .ugb-button{margin:0 .5em .5em;display:block}.ugb-button-wrapper .ugb-block-content .ugb-button.ugb-button--has-icon,.ugb-button-wrapper .ugb-block-content .ugb-button.ugb-has-icon{display:flex}.ugb-button-wrapper.ugb-button--design-spread .ugb-block-content{justify-content:space-between}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content{justify-content:space-evenly}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:auto}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3){margin-left:auto}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content{justify-content:space-evenly}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:auto}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:auto}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content{flex-wrap:nowrap}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content>*{width:100%}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content .ugb-button{text-align:center}.ugb-button-wrapper .ugb-button.ugb-button--design-link,.ugb-button-wrapper .ugb-button.ugb-button--design-plain,.ugb-button-wrapper .ugb-button.ugb-link-button,.ugb-button-wrapper .ugb-button.ugb-plain-button{margin-left:.75em;margin-right:.75em}.ugb-cta.ugb-cta--v2 .ugb-cta__item{text-align:center;display:flex;flex-direction:column;justify-content:center}.ugb-cta.ugb-cta--v2 .ugb-cta__description,.ugb-cta.ugb-cta--v2 .ugb-cta__title{margin:0 0 16px}.ugb-cta.ugb-cta--v2:not(.ugb-cta--design-plain) .ugb-cta__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-cta.ugb-cta--v2.ugb-cta--design-plain .ugb-cta__item{padding:0 35px}.ugb-cta.ugb-main-block.alignfull.ugb-main-block--inner-full,.ugb-cta.ugb-main-block.alignfull:not(.ugb--has-block-background){padding:0}.ugb-cta.ugb-main-block.alignfull.ugb-main-block--inner-full .ugb-cta__item,.ugb-cta.ugb-main-block.alignfull:not(.ugb--has-block-background) .ugb-cta__item{border-radius:0}.ugb-card.ugb-card--v2 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-card.ugb-card--v2 .ugb-block-content>:last-child{margin-bottom:0}.ugb-card.ugb-card--v2 .ugb-card__item{display:flex;flex-direction:column}.ugb-card.ugb-card--v2 .ugb-card__content{flex:1;display:flex;flex-direction:column;background-size:cover;background-position:50%;padding:60px 35px}.ugb-card.ugb-card--v2 .ugb-card__description,.ugb-card.ugb-card--v2 .ugb-card__subtitle{margin:0 0 16px}.ugb-card.ugb-card--v2 .ugb-card__image{height:300px;width:100%;background-size:cover;background-position:50%}.ugb-card.ugb-card--v2 .ugb-card__title{margin:0 0 8px}.ugb-card.ugb-card--v2 .ugb-card__subtitle{font-size:.85em}.ugb-card.ugb-card--v2:not(.ugb-card--design-plain) .ugb-card__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden}.ugb-card.ugb-card--v2.ugb-card--design-plain .ugb-card__image{margin-bottom:0 0 16px 0}.ugb-card.ugb-card--v2.ugb-card--design-plain .ugb-card__content{padding:0}.ugb-card.ugb-card--v2.ugb-card--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-card.ugb-card--v2.ugb-card--columns-3 .ugb-card__item:nth-child(2){-ms-grid-column:3}.ugb-card.ugb-card--v2.ugb-card--columns-3 .ugb-card__item:nth-child(3){-ms-grid-column:5}.ugb-card.ugb-card--v2.ugb-card--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-card.ugb-card--v2.ugb-card--columns-2 .ugb-card__item:nth-child(2){-ms-grid-column:3}.ugb-column .ugb-column__item>:first-child{margin-top:0}.ugb-column .ugb-column__item>:last-child{margin-bottom:0}.ugb-column.ugb-main-block{margin-top:0;margin-bottom:0}.ugb-column,.ugb-column .ugb-column__item,.ugb-column>.ugb-inner-block,.ugb-column>.ugb-inner-block>.ugb-block-content{height:100%}.ugb-column .ugb-column__item{display:flex;flex-direction:column}.ugb-columns .ugb-column{align-items:flex-start}.ugb-column.ugb-column--design-basic>.ugb-inner-block>.ugb-block-content>.ugb-column__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:35px}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:first-child{grid-area:one}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(2){grid-area:two}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(3){grid-area:three}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(4){grid-area:four}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(5){grid-area:five}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(6){grid-area:six}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(7){grid-area:seven}.ugb-columns:not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>:nth-child(8){grid-area:eight}.ugb-columns:not(.ugb-columns--design-plain):not(.ugb-columns--design-plain)>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-columns:auto;grid-auto-flow:row}.ugb-columns .ugb-columns__item{align-items:stretch}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>div{margin-left:0;margin-right:0}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-2>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two";grid-template-columns:1fr 1fr;grid-template-rows:auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-3>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three three";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four";grid-template-columns:1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-5>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two" "three four" "five five";grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-7>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three" "four five six" "seven seven seven";grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto auto}.ugb-columns.ugb-columns--design-grid.ugb-columns--columns-8>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:"one two three four" "five six seven eight";grid-template-columns:1fr 1fr 1fr 1fr;grid-template-rows:auto auto}.ugb-container.ugb-container--v2.alignfull:not(.ugb-container--design-plain):not(.ugb--has-block-background){padding-left:0;padding-right:0}.ugb-container.ugb-container--v2.alignfull:not(.ugb-container--design-plain):not(.ugb--has-block-background)>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{border-radius:0!important}.ugb-container.ugb-container--v2>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px;display:flex;flex-direction:column;justify-content:center}.ugb-container.ugb-container--v2 .ugb-container__side{display:flex;flex-direction:column;align-items:center;justify-content:center}.ugb-container.ugb-container--v2 .ugb-container__content-wrapper,.ugb-container.ugb-container--v2 .ugb-container__side{width:100%}.ugb-container.ugb-container--v2 .ugb-container__content-wrapper>:first-child{margin-top:0}.ugb-container.ugb-container--v2 .ugb-container__content-wrapper>:last-child{margin-bottom:0}.ugb-container.ugb-container--v2 .ugb--has-block-background,.ugb-container.ugb-container--v2 .ugb-main-block.alignfull{width:auto!important;margin-left:0;margin-right:0}.ugb-container.ugb-container--v2.ugb-container--design-plain>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{background:none;padding-left:0;padding-right:0;box-shadow:none;border-radius:0;overflow:visible}.ugb-count-up.ugb-countup--v4{text-align:center}.ugb-count-up.ugb-countup--v4 .ugb-countup__item{display:flex;flex-direction:column}.ugb-count-up.ugb-countup--v4 .ugb-countup__item>*{z-index:2}.ugb-count-up.ugb-countup--v4 .ugb-countup--hide,.ugb-count-up.ugb-countup--v4 .ugb-countup-hide{visibility:hidden}.ugb-count-up.ugb-countup--v4 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-count-up.ugb-countup--v4 .ugb-countup__counter{font-size:40px;line-height:1em;white-space:nowrap}.ugb-count-up.ugb-countup--v4 .ugb-countup__icon{z-index:1}.ugb-count-up.ugb-countup--v4 .ugb-countup__icon svg{margin:0 auto;height:50px;width:50px}.ugb-count-up.ugb-countup--v4 .ugb-countup__icon.ugb-countup__icon--v2{display:flex;flex-direction:column;align-items:center}.ugb-count-up.ugb-countup--v4 .ugb-countup__counter,.ugb-count-up.ugb-countup--v4 .ugb-countup__icon,.ugb-count-up.ugb-countup--v4 .ugb-countup__title{margin:0 0 16px}.ugb-count-up.ugb-countup--v4 .ugb-countup__description{margin-bottom:0}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-countup__item:nth-child(2){-ms-grid-column:3}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-countup__item:nth-child(3){-ms-grid-column:5}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-countup__item:nth-child(4){-ms-grid-column:7}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-countup__item:nth-child(2){-ms-grid-column:3}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-countup__item:nth-child(3){-ms-grid-column:5}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-2 .ugb-countup__item:nth-child(2){-ms-grid-column:3}.ugb-divider.ugb-divider--v2{padding-left:0!important;padding-right:0!important}.ugb-divider.ugb-divider--v2 hr{background:none;background-color:#ddd!important;border:0!important;padding:0!important;max-width:none!important;margin:0 auto!important;width:50%;height:1px}.ugb-divider.ugb-divider--v2 hr:after,.ugb-divider.ugb-divider--v2 hr:before{display:none}.ugb-divider.ugb-divider--v2 .ugb-divider__dots{margin:0 auto;display:flex;flex-direction:row;justify-content:space-between;overflow:hidden}.ugb-divider.ugb-divider--v2 .ugb-divider__dot{flex-shrink:0}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks hr,.ugb-divider.ugb-divider--v2.ugb-divider--design-dots hr{background-color:transparent!important;height:0!important}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks .ugb-divider__dot,.ugb-divider.ugb-divider--v2.ugb-divider--design-dots .ugb-divider__dot{border-radius:100%;background-color:#ddd}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks .ugb-divider__dot{background:transparent;position:relative}.ugb-divider.ugb-divider--v2.ugb-divider--design-asterisks .ugb-divider__dot:before{content:"*";font-family:Georgia,Times,Times New Roman,serif;line-height:1;vertical-align:middle;position:absolute;top:0;left:0}.ugb-expand.ugb-expand--v2 .ugb-expand__less-text,.ugb-expand.ugb-expand--v2 .ugb-expand__more-text,.ugb-expand.ugb-expand--v2 .ugb-expand__title{margin:0 0 16px}.ugb-expand.ugb-expand--v2 .ugb-expand__less-toggle-text,.ugb-expand.ugb-expand--v2 .ugb-expand__more-toggle-text{display:inline-block}.ugb-expand.ugb-expand--more .ugb-expand__less-text,.ugb-expand.ugb-expand--more .ugb-expand__more-toggle-text{display:none}.ugb-expand.ugb-expand--more .ugb-expand__more-text{display:block!important}.ugb-expand.ugb-expand--more .ugb-expand__less-toggle-text{display:inline-block!important}.ugb-feature.ugb-feature--v2{text-align:left}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-feature.ugb-feature--v2 .ugb-feature__item{display:grid;justify-content:center;align-items:center;grid-template-columns:1fr 1fr;grid-gap:35px}.ugb-feature.ugb-feature--v2 .ugb-feature__image-side{display:flex;justify-content:center;align-items:center}.ugb-feature.ugb-feature--v2 .ugb-feature__image.ugb-feature__image-has-shape{box-shadow:none!important;border-radius:0!important}.ugb-feature.ugb-feature--v2 .ugb-feature__description,.ugb-feature.ugb-feature--v2 .ugb-feature__title{margin:0 0 16px}.ugb-feature.ugb-feature--v2 .ugb-feature__content,.ugb-feature.ugb-feature--v2 .ugb-feature__item{background-size:cover;background-position:50%}.ugb-feature.ugb-feature--v2.ugb-feature--invert .ugb-feature__content{grid-column:2;grid-row:1}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px;text-align:center}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content>:last-child{margin-bottom:0}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__content{z-index:2}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__item{display:flex;flex-direction:column;background-position:50%}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image{margin-left:auto;margin-right:auto}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image img{margin:0 auto;height:auto;max-width:100%;position:relative}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__description,.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image,.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__title{margin:0 0 16px}.ugb-feature-grid.ugb-feature-grid--v2:not(.ugb-feature-grid--design-plain) .ugb-feature-grid__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__image{min-height:1px}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-feature-grid__item:nth-child(2){-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-feature-grid__item:nth-child(3){-ms-grid-column:5}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-feature-grid__item:nth-child(4){-ms-grid-column:7}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-3 .ugb-feature-grid__item:nth-child(2){-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-3 .ugb-feature-grid__item:nth-child(3){-ms-grid-column:5}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-2 .ugb-feature-grid__item:nth-child(2){-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--design-horizontal .ugb-feature-grid__item{display:-ms-grid;-ms-grid-columns:1fr 35px 1fr}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--design-horizontal .ugb-feature-grid__content{-ms-grid-column:3}.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--design-horizontal .ugb-feature-grid__item>:first-child:last-child{-ms-grid-column:1!important;-ms-grid-column-span:3}.ugb-header.ugb-header--v3{text-align:center}.ugb-header.ugb-header--v3:not(.ugb-header--design-plain) .ugb-header__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:150px 60px}.ugb-header.ugb-header--v3 .ugb-header__item{padding:150px 60px;justify-content:center;display:flex;flex-direction:column}.ugb-header.ugb-header--v3 .ugb-button{position:relative;margin-top:0;margin-bottom:0}.ugb-header.ugb-header--v3 .ugb-header__subtitle,.ugb-header.ugb-header--v3 .ugb-header__title{margin:0 0 16px}.ugb-header.ugb-header--v3 .ugb-header__buttons{display:flex;align-items:center;justify-content:center;margin-left:-.5em;margin-right:-.5em}.ugb-header.ugb-header--v3 .ugb-header__buttons>*{margin:0 .5em .5em}.ugb-header.ugb-header--v3.ugb-main-block.alignfull:not(.ugb-main-block--inner-center):not(.ugb-main-block--inner-wide){padding:0}.ugb-header.ugb-header--v3.ugb-main-block.alignfull:not(.ugb-main-block--inner-center):not(.ugb-main-block--inner-wide) .ugb-header__item{border-radius:0}.ugb-heading__bottom-line,.ugb-heading__top-line{height:4px;width:100px;background:#333}.ugb-heading .ugb-heading__subtitle,.ugb-heading .ugb-heading__top-line{margin-bottom:16px}.ugb-heading .ugb-heading__title{margin-top:0!important;margin-bottom:8px}.ugb-icon .ugb-inner-block{width:auto}.ugb-icon .ugb-icon__content-wrapper{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-icon .ugb-icon__item{text-align:center;display:flex;flex-direction:column;align-items:center}.ugb-icon.ugb-main-block .ugb-icon-inner-svg svg{height:50px;width:50px}.ugb-icon .ugb-icon__icon{display:inline-block}.ugb-icon .ugb-icon__title{width:100%;margin:0!important}.ugb-icon .ugb-icon__icon:first-child,.ugb-icon .ugb-icon__title:first-child{margin-bottom:16px}.ugb-icon-list.ugb-icon-list--v2 ul{margin:0!important;padding:0!important;list-style:none!important}.ugb-icon-list.ugb-icon-list--v2 li:before{content:"";display:inline-block;vertical-align:middle;height:20px;width:20px;margin-right:1em;background-size:contain!important;background-repeat:no-repeat;background-position:50%;margin-bottom:5px}.ugb-icon-list.ugb-icon-list--v2 li{margin-top:0!important;margin-bottom:16px;list-style:none!important;text-indent:calc(var(--icon-size, 20px)*-1 - 1em)!important;padding-left:calc(var(--icon-size, 20px) + 1em)!important}.ugb-icon-list.ugb-icon-list--v2 li:last-child{margin-bottom:0!important}.ugb-icon-list.ugb-icon-list--v2 li ul{column-count:1;margin-top:16px;list-style:none;margin-left:0}.ugb-icon-list.ugb-icon-list--v2.ugb-icon-list--display-grid ul{display:grid;grid-column-gap:20px}.ugb-icon-list.ugb-icon-list--v2 li{page-break-inside:avoid;break-inside:avoid}.ugb-image-box.ugb-image-box--v4{text-align:center}.ugb-image-box.ugb-image-box--v4 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item{position:relative;height:350px;box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:35px;display:flex;flex-direction:column;justify-content:center}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image-wrapper,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-link{position:absolute;top:0;left:0;right:0;bottom:0}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image-wrapper{height:auto;z-index:1;-webkit-mask-image:-webkit-radial-gradient(#fff,#000);transform:translateZ(0)}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image{height:100%;background-size:cover;background-position:50%;will-change:filter,transform}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover{pointer-events:none;z-index:2;background-color:#000;opacity:.7}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover{z-index:3}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-link{z-index:5}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item:hover .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item:not(:hover) .ugb-image-box__overlay-hover{opacity:0!important}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content{z-index:4}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content>:first-child{margin-top:0}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content>:last-child{margin-bottom:0}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__description,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__line,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__subtitle,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__title{color:#fff;margin:0 0 16px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__subtitle{font-size:.8em;margin-bottom:5.33333px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__box{border-radius:12px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__arrow{pointer-events:none;z-index:4;position:absolute;bottom:35px;left:35px;right:35px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__arrow svg{display:inline-block;fill:#fff;width:30px}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__arrow,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__content,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__description,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__header,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__image-wrapper,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__line,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-hover,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__overlay-link,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__subtitle,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__title{transition:all .4s ease-in-out}.ugb-image-box.ugb-image-box--v4.ugb-image-box--effect-zoom-in .ugb-image-box__item:hover .ugb-image-box__image,.ugb-image-box.ugb-image-box--v4.ugb-image-box--effect-zoom-out .ugb-image-box__item .ugb-image-box__image{transform:scale(1.1)}.ugb-image-box.ugb-image-box--v4.ugb-image-box--effect-zoom-out .ugb-image-box__item:hover .ugb-image-box__image{transform:scale(1)}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__description{margin-bottom:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic.ugb-image-box--with-arrow .ugb-image-box__item{padding-bottom:70px}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__subtitle{opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__description{transform:translateY(-30px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__arrow{transform:translateY(30px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__item:hover .ugb-image-box__arrow,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__item:hover .ugb-image-box__description,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-basic .ugb-image-box__item:hover .ugb-image-box__subtitle{transform:translateY(0);opacity:1}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain{text-align:left}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item{justify-content:flex-end}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__arrow{position:relative;bottom:auto;left:auto;right:auto}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__content{transform:translateY(30px);margin-bottom:10px}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__description{transform:translateY(-30px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__arrow{transform:translateY(-60px);opacity:0}.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item:hover .ugb-image-box__arrow,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item:hover .ugb-image-box__content,.ugb-image-box.ugb-image-box--v4.ugb-image-box--design-plain .ugb-image-box__item:hover .ugb-image-box__description{transform:translateY(0);opacity:1}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-image-box__item:nth-child(2){-ms-grid-column:3}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-image-box__item:nth-child(3){-ms-grid-column:5}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-image-box__item:nth-child(4){-ms-grid-column:7}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-3 .ugb-image-box__item:nth-child(2){-ms-grid-column:3}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-3 .ugb-image-box__item:nth-child(3){-ms-grid-column:5}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-2 .ugb-image-box__item:nth-child(2){-ms-grid-column:3}.ugb-notification.ugb-notification--v2 .ugb-notification__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:35px;display:flex;flex-direction:column}.ugb-notification.ugb-notification--v2 .ugb-notification__item>:last-child{margin-bottom:0}.ugb-notification.ugb-notification--v2 .ugb-notification__description,.ugb-notification.ugb-notification--v2 .ugb-notification__icon,.ugb-notification.ugb-notification--v2 .ugb-notification__title{margin:0 0 16px}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__item{background-color:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__title,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__title{color:#fff}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon .ugb-notification__icon{fill:#fff}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-error .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-error .ugb-notification__item{background-color:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-info .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-info .ugb-notification__item{background-color:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__item,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__item{background-color:#ffdd57}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__title,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__title{color:#424242}.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-basic.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-large-icon.ugb-notification--type-warning .ugb-notification__icon{fill:#424242}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__item{background:none;border-radius:0;box-shadow:none}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__title{color:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-notification__icon{fill:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain .ugb-button{border-color:#40ba7b}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__title{color:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-notification__icon{fill:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-error .ugb-button{border-color:#d9534f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__title{color:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-notification__icon{fill:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-info .ugb-button{border-color:#2091e1}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-button--inner,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__description,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__icon,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__title{color:#ff6f2f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__close-button svg,.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-notification__icon{fill:#ff6f2f}.ugb-notification.ugb-notification--v2.ugb-notification--design-plain.ugb-notification--type-warning .ugb-button{border-color:#ff6f2f}.ugb-notification.ugb-notification--v2.ugb-notification--dismissible{display:none}.ugb-notification.ugb-notification--v2.ugb-notification--dismissible .ugb-notification__item{position:relative;padding-right:60px}.ugb-notification__icon,.ugb-notification__icon svg{width:30px;height:30px}.ugb-notification__close-button{position:absolute!important;top:0;right:0;z-index:2;margin-right:30px;margin-top:30px;font-size:8px;cursor:pointer;width:16px;height:16px;padding:.3rem 0 0;display:flex;justify-content:center;align-items:center}.ugb-notification__close-button svg{width:100%;height:auto}.ugb-number-box.ugb-number-box--v3{text-align:center}.ugb-number-box.ugb-number-box--v3 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-1 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item{margin-bottom:0!important}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item .ugb-number-box__content{z-index:4}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item{display:flex;flex-direction:column;box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-number-box.ugb-number-box--v3 .ugb-number-box .ugb-inner-block{text-align:center}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__number{background-color:#ddd;background-color:var(--s-primary-color,#ddd);color:#fff;border-radius:100%;font-size:3em;display:block;padding:0;overflow:visible;margin:0 auto;height:2.5em;width:2.5em;line-height:2.5em;box-sizing:content-box;white-space:nowrap!important;text-align:center;z-index:3}.ugb-number-box.ugb-number-box--v3.ugb-number-box--number-style-square .ugb-number-box__number{border-radius:0}.ugb-number-box.ugb-number-box--v3.ugb-number-box--number-style-none .ugb-number-box__number{display:block;background:none;border-radius:0;color:#222;color:var(--s-primary-color,#222);line-height:1em;height:auto;width:100%}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__number{margin:0 auto 16px}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__description,.ugb-number-box.ugb-number-box--v3 .ugb-number-box__title{margin:0 0 16px}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__title{line-height:1.1em}.ugb-number-box.ugb-number-box--v3.ugb-number-box--design-plain .ugb-number-box__item{box-shadow:none;border-radius:0;padding:0;background:none}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-number-box__item:nth-child(2){-ms-grid-column:3}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-number-box__item:nth-child(3){-ms-grid-column:5}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-number-box__item:nth-child(2){-ms-grid-column:3}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-block-content{text-align:center;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px;align-items:center}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px;display:flex;flex-direction:column}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__feature-list{display:flex;flex-direction:column;justify-content:center;align-items:center}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-line{display:flex;justify-content:center}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-prefix{align-self:flex-start;font-size:1.2em}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-suffix{align-self:flex-end;font-size:1.5em}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price{font-size:3.5em;line-height:100%!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__subprice{font-size:.75em;color:#ddd;text-transform:uppercase;line-height:100%!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image{margin-left:auto;margin-right:auto;width:100%}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image .ugb-img{margin:0 auto;display:block}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__description,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__price-wrapper,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__subprice,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__title{margin:0 0 16px}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__button{margin-top:32px;margin-bottom:32px}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--design-plain .ugb-pricing-box__item{background:none;padding:0;box-shadow:none;border-radius:0}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__image{min-height:1px}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-pricing-box__item:nth-child(2){-ms-grid-column:3}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-pricing-box__item:nth-child(3){-ms-grid-column:5}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-2 .ugb-pricing-box__item:nth-child(2){-ms-grid-column:3}.ugb-separator .ugb-block-content .ugb-separator__svg-wrapper{height:200px}.ugb-separator{box-sizing:content-box;position:relative}.ugb-separator.ugb-separator.ugb-separator.ugb-separator{z-index:2}.ugb-separator.ugb-separator--flip-vertical{transform:scaleY(-1)}.ugb-separator.ugb-separator--flip-horizontal{transform:scaleX(-1)}.ugb-separator.ugb-separator--flip-vertical.ugb-separator--flip-horizontal{transform:scaleY(-1) scaleX(-1)}.ugb-separator .ugb-separator__svg-wrapper{position:relative;display:flex;align-items:flex-end;overflow-x:hidden;overflow-y:visible;box-sizing:content-box}.ugb-separator.alignfull,.ugb-separator.alignfull .ugb-separator__svg-wrapper{overflow:visible}.ugb-separator .ugb-separator__svg-inner{position:relative;height:100%;width:100%}.ugb-separator svg{height:100%;width:100%;display:block;fill:#abb8c3;position:absolute;top:0;left:0;right:0;bottom:0;z-index:3;transform-origin:bottom}.ugb-separator svg.ugb-separator--no-shadow :not(:last-child){display:none}.ugb-separator .ugb-separator__bottom-pad,.ugb-separator .ugb-separator__top-pad{height:0;width:100%;z-index:2;position:relative}.ugb-separator .ugb-separator__top-pad{margin-bottom:-1px}.ugb-separator .ugb-separator__bottom-pad{margin-top:-1px;background:#abb8c3}.ugb-spacer.ugb-spacer--v2{height:50px;margin-top:0!important;margin-bottom:0!important;background-size:cover;background-position:50%;padding:0!important}.ugb-spacer.ugb-spacer--v2 .ugb-block-content,.ugb-spacer.ugb-spacer--v2 .ugb-inner-block,.ugb-spacer.ugb-spacer--v2 .ugb-spacer--inner{height:100%}.ugb-spacer.ugb-spacer--v2 .ugb-bottom-separator,.ugb-spacer.ugb-spacer--v2 .ugb-top-separator{z-index:6}.ugb-spacer.ugb-spacer--v2.ugb--has-bottom-separator,.ugb-spacer.ugb-spacer--v2.ugb--has-top-separator{padding:0!important}.ugb-team-member.ugb-team-member--v3 .ugb-block-content{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-team-member.ugb-team-member--v3 .ugb-block-content>:last-child{margin-bottom:0}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__item{display:flex;flex-direction:column;text-align:center}.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-half .ugb-team-member__content,.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-horizontal .ugb-team-member__content{flex:1}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__content{display:flex;flex-direction:column;background-size:cover;background-position:50%}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__image{width:300px;height:auto;margin:0 auto;background-size:cover;background-position:50%}.ugb-team-member.ugb-team-member--v3 .ugb-img{margin:0 auto}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-2 .ugb-team-member__image{width:220px}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-team-member__image{width:150px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__image{margin-bottom:24px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__buttons,.ugb-team-member.ugb-team-member--v3 .ugb-team-member__description,.ugb-team-member.ugb-team-member--v3 .ugb-team-member__position{margin:0 0 16px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__name{margin-bottom:8px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__position{color:#aaa}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__buttons{margin-left:-4px;margin-right:-4px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__buttons .ugb-button-container{display:inline-block;margin:0 4px 4px}.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-basic .ugb-team-member__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__image{min-height:1px}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-team-member__item:nth-child(2){-ms-grid-column:3}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-team-member__item:nth-child(3){-ms-grid-column:5}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-2 .ugb-team-member__item:nth-child(2){-ms-grid-column:3}.ugb-testimonial--v3.ugb-testimonial .ugb-block-content{text-align:center;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-gap:35px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;border-radius:12px;overflow:hidden;padding:60px 35px;display:flex;flex-direction:column}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__image{height:auto;width:75px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__position{font-size:.75em;text-transform:uppercase;color:#aaa}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__image{margin:0 auto 16px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__body,.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__name{margin:0 0 16px}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__position{margin-bottom:0}.ugb-testimonial.ugb-testimonial--v3.ugb-testimonial--design-plain .ugb-testimonial__item{background:none;padding:0;box-shadow:none;border-radius:0}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-3 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr 35px 1fr;display:-ms-grid}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-3 .ugb-testimonial__item:nth-child(2){-ms-grid-column:3}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-3 .ugb-testimonial__item:nth-child(3){-ms-grid-column:5}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-2 .ugb-block-content{-ms-grid-columns:1fr 35px 1fr;display:-ms-grid}.ugb-testimonial--v3.ugb-testimonial.ugb-testimonial--columns-2 .ugb-testimonial__item:nth-child(2){-ms-grid-column:3}.ugb-text__text-wrapper{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-column-gap:35px}.ugb-text__text{display:flex;flex-direction:column}.ugb-text__text>p{margin-bottom:16px}.ugb-text--has-rule.ugb-text--columns-2 .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr}.ugb-text--has-rule.ugb-text--columns-3 .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr 1px 1fr}.ugb-text--has-rule.ugb-text--columns-4 .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr 1px 1fr 1px 1fr}.ugb-text__rule{width:1px;background:#ddd;height:100%;margin:auto}.ugb-text--design-side-title-1 .ugb-block-content,.ugb-text--design-side-title-2 .ugb-block-content{display:grid;grid-template-columns:1fr 1fr;grid-gap:35px;grid-row-gap:0}.ugb-text--design-side-title-1.ugb-text--columns-2 .ugb-block-content{grid-template-columns:1fr 2fr}.ugb-text--design-side-title-1.ugb-text--columns-3 .ugb-block-content{grid-template-columns:1fr 3fr}.ugb-text--design-side-title-1.ugb-text--columns-4 .ugb-block-content{grid-template-columns:1fr 4fr}.ugb-text--design-side-title-1.ugb-text--reverse-title.ugb-text--columns-2 .ugb-block-content{grid-template-columns:2fr 1fr}.ugb-text--design-side-title-1.ugb-text--reverse-title.ugb-text--columns-3 .ugb-block-content{grid-template-columns:3fr 1fr}.ugb-text--design-side-title-1.ugb-text--reverse-title.ugb-text--columns-4 .ugb-block-content{grid-template-columns:4fr 1fr}.ugb-text--design-side-title-2 .ugb-block-content{grid-template-columns:-webkit-max-content 1fr;grid-template-columns:max-content 1fr;grid-template-columns:fit-content(75%) 1fr}.ugb-text--design-side-title-2.ugb-text--reverse-title .ugb-block-content{grid-template-columns:1fr -webkit-max-content;grid-template-columns:1fr max-content;grid-template-columns:1fr fit-content(75%)}.ugb-text--reverse-title .ugb-text__title-wrapper{grid-column:2/3;grid-row:1}.ugb-text--reverse-title .ugb-text__text-wrapper{grid-column:1/2;grid-row:1}.ugb-text--subtitle-top .ugb-text__subtitle{order:1}.ugb-text--subtitle-top .ugb-text__title{order:2}.ugb-text__title-wrapper{display:flex;flex-direction:column}.ugb-text .ugb-text__title{margin:0 0 8px}.ugb-text .ugb-text__subtitle{margin:0 0 16px;font-size:.85em}.ugb-text--has-rule .ugb-text__text{column-rule:1px solid #ddd;column-gap:52.5px}.ugb-video-popup--v3 .ugb-video-popup__play-button{position:absolute}.ugb-video-popup--v3 .ugb-video-popup__play-button svg{fill:#fff}.ugb-video-popup__wrapper{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2);background-color:#fff;margin-left:auto;margin-right:auto;overflow:hidden;position:relative;width:100%;height:400px;padding:0;background-color:#000;background-size:cover;background-position:50%;border-radius:12px}.ugb-video-popup__wrapper:before{transition:all .3s ease-in-out}.ugb-video-popup.ugb-video-popup--v3.alignfull.ugb-main-block--inner-full.ugb--has-block-background .ugb-video-popup__wrapper,.ugb-video-popup.ugb-video-popup--v3.alignfull:not(.ugb--has-block-background) .ugb-video-popup__wrapper{border-radius:0;margin-left:-35px;margin-right:-35px;width:calc(100% + 70px)}.ugb-video-popup__overlay{position:absolute!important;top:0;left:0;right:0;bottom:0;z-index:6!important}.ugb-video-popup__play-button{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;display:flex;justify-content:center;align-items:center;flex-direction:column}.ugb-video-popup__play-button svg{fill:#fff;width:10%;height:10%;min-width:30px;min-height:30px}.ugb-video-popup--button-circle .ugb-video-popup__play-button svg,.ugb-video-popup--button-outline .ugb-video-popup__play-button svg{min-width:50px;min-height:50px}#bp_container .bp-x,#bp_container .bp-x:hover{background:none!important}#bp_sv{margin:auto!important}.ugb-button{border:none;border-radius:4px;display:inline-block;cursor:pointer;opacity:1;background:#2091e1;background:var(--s-primary-color,#2091e1);padding:8px 26px;line-height:1.5!important;align-items:center;font-size:1em;position:relative}.ugb-button,.ugb-button .ugb-button--inner{transition:all .2s ease-in-out;box-shadow:none!important}.ugb-button .ugb-button--inner{text-decoration:none!important;display:block;color:#fff;margin:0!important;padding:0!important}.ugb-button:hover{opacity:.85;box-shadow:none!important}.ugb-button:not(.ugb-link-button):not(.ugb-button--design-link){text-decoration:none!important}.ugb-button.ugb--shadow-0{box-shadow:none!important}.ugb-button.ugb--shadow-1{box-shadow:0 0 0 1px hsla(0,0%,47.1%,.1)!important}.ugb-button.ugb--shadow-2{box-shadow:0 0 0 2px hsla(0,0%,47.1%,.1)!important}.ugb-button.ugb--shadow-3{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2)!important}.ugb-button.ugb--shadow-4{box-shadow:0 2px 22px hsla(0,0%,60%,.25)!important}.ugb-button.ugb--shadow-5{box-shadow:0 5px 30px -6px rgba(18,63,82,.29)!important}.ugb-button.ugb--shadow-6{box-shadow:0 10px 30px 1px rgba(0,0,0,.07)!important}.ugb-button.ugb--shadow-7{box-shadow:5px 7px 21px 3px rgba(72,73,121,.14)!important}.ugb-button.ugb--shadow-8{box-shadow:0 10px 33px -3px rgba(0,0,0,.12)!important}.ugb-button.ugb--shadow-9{box-shadow:0 10px 34px -3px rgba(72,73,121,.2)!important}.ugb-button:before{position:absolute;z-index:1;border-radius:4px;top:0;left:0;right:0;bottom:0;transition:all .2s ease-in-out;opacity:0}.ugb-button:hover:before{opacity:1}.ugb-button *{position:relative;z-index:2}.ugb-button.ugb-button--design-ghost:before{top:-2px;left:-2px;right:-2px;bottom:-2px}.ugb-button.ugb--hover-effect-lift:hover{transform:translateY(-10%)}.ugb-button.ugb--hover-effect-scale:hover{transform:scale(1.03)}.ugb-button.ugb--hover-effect-lift-scale:hover{transform:scale(1.03) translateY(-10%)}.ugb-button.ugb--hover-effect-scale-more:hover{transform:scale(1.13)}.ugb-button.ugb--hover-effect-lift-scale-more:hover{transform:scale(1.13) translateY(-10%)}.ugb-button .ugb-button--inner:hover{color:#fff}.ugb-button.ugb-button--size-tiny{padding:.3em 1em}.ugb-button.ugb-button--size-tiny .ugb-button--inner{font-size:.7em}.ugb-button.ugb-button--size-small .ugb-button--inner{font-size:.85em}.ugb-button.ugb-button--size-medium{padding:.6em 1.5em}.ugb-button.ugb-button--size-medium .ugb-button--inner{font-size:1.075em}.ugb-button.ugb-button--size-large{padding:.8em 1.75em}.ugb-button.ugb-button--size-large .ugb-button--inner{font-size:1.15em}.ugb-button--align-left{margin-right:auto}.ugb-button--align-center{margin-left:auto;margin-right:auto}.ugb-button--align-right{margin-left:auto}.ugb-button--align-full{text-align:center}.ugb-button.ugb-button--icon-only{padding:.7em}.ugb-button.ugb-button--icon-only svg{margin:0!important}.ugb-button--design-ghost{background-color:transparent;border:2px solid #2091e1;border:2px solid var(--s-primary-color,#2091e1)}.ugb-button--design-ghost .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-ghost:hover{opacity:.85;box-shadow:none!important}.ugb-button--design-ghost:hover .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background-color:#2091e1;background-color:var(--s-primary-color,#2091e1)}.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover .ugb-button--inner,.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg:not(.ugb-custom-icon){color:#fff}.ugb-button--design-plain{background-color:transparent;border:none;padding-left:0;padding-right:0}.ugb-button--design-plain .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-plain:hover{opacity:.85;box-shadow:none!important}.ugb-button--design-plain:hover .ugb-button--inner{color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--design-link{background:transparent;padding:0;border-radius:0!important}.ugb-button.ugb-button--has-icon{display:inline-flex;justify-content:center;align-items:center}.ugb-button.ugb-button--has-icon svg:not(.ugb-custom-icon){color:#fff}.ugb-button.ugb-button--has-icon svg{width:1em;height:1em;margin-bottom:0!important;margin-right:16px}.ugb-button.ugb-button--has-icon.ugb-button--icon-position-right{flex-direction:row-reverse}.ugb-button.ugb-button--has-icon.ugb-button--icon-position-right svg{margin-right:0;margin-left:16px}.ugb-button--has-icon.ugb-button--design-ghost svg:not(.ugb-custom-icon),.ugb-button--has-icon.ugb-button--design-plain svg:not(.ugb-custom-icon){color:#2091e1;color:var(--s-primary-color,#2091e1)}.ugb-button--size-small.ugb-button--has-icon svg,.ugb-button--size-tiny.ugb-button--has-icon svg{width:.75em;height:.75em}.ugb-button--size-medium.ugb-button--has-icon svg{width:1.25em;height:1.25em}.ugb-button--size-large.ugb-button--has-icon svg{width:1.5em;height:1.5em}.ugb--has-background-overlay{position:relative;z-index:1;background-size:cover;background-position:50%}.ugb--has-background-overlay.ugb--has-background-overlay:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:2}.ugb--has-background-overlay>*{position:relative;z-index:3}.ugb-main-block svg .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.ugb-main-block svg .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:1;opacity:var(--fa-primary-opacity,1)}.ugb-img{-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}.ugb-img.ugb-img--shape{mask-mode:alpha;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center;border-radius:none}.ugb-img.ugb-image--shape-stretch{-webkit-mask-size:100% 100%;mask-size:100% 100%}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook{background:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost{border-color:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-facebook.ugb-button--design-plain svg{color:#1877f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter{background:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost{border-color:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-twitter.ugb-button--design-plain svg{color:#1da1f2}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram{background:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost{border-color:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-instagram.ugb-button--design-plain svg{color:#c32aa3}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest{background:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost{border-color:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-pinterest.ugb-button--design-plain svg{color:#bd081c}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin{background:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost{border-color:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-linkedin.ugb-button--design-plain svg{color:#007bb5}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube{background:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost{border-color:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-youtube.ugb-button--design-plain svg{color:red}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email{background:#a6b1b7}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost{border-color:#a6b1b7}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover{background:#a6b1b7}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost.ugb-button--ghost-to-normal-effect:hover svg{color:#fff}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost,.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-plain{background:transparent}.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-ghost svg,.ugb-social-button.ugb-social-button--social-colors.ugb-button-email.ugb-button--design-plain svg{color:#a6b1b7}.ugb-icon__bg-shape-wrapper{position:relative}.ugb-icon__bg-shape-wrapper>:not(.ugb-icon__bg-shape){position:relative;z-index:2}.ugb-icon__bg-shape-wrapper .ugb-icon__bg-shape{position:absolute;z-index:1;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);height:100%;width:100%;color:#cde;fill:#cde}.ugb-icon-inner-svg svg{display:block}.ugb-icon__design-wrapper{padding:20px}.ugb-icon__design-wrapper.ugb--shadow-9{box-shadow:0 25px 60px -15px rgba(72,73,121,.38)!important}.ugb-icon__design-wrapper.ugb-icon__design-shaped{background-color:#ddd}.ugb-icon__design-wrapper.ugb-icon__design-outlined{border:3px solid #ddd}.ugb-icon__gradient{opacity:0!important;height:0!important;width:0!important;visibility:hidden!important;overflow:hidden!important;position:absolute!important;z-index:-99999!important;max-height:0!important;max-width:0!important;min-height:0!important;min-width:0!important}.ugb-highlight[style*=background]{padding:.1em .4em;display:inline}.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull{margin-top:0;margin-bottom:0;padding-top:70px;padding-bottom:70px}.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull.ugb-main-block--inner-full>.ugb-inner-block{width:100%}.ugb-main-block.ugb--has-block-background{background-size:cover;background-position:50%}.ugb-main-block>*{z-index:2}.ugb-main-block .ugb-inner-block{z-index:5}.ugb-main-block.ugb--has-top-separator{padding-top:200px!important}.ugb-main-block.ugb--has-bottom-separator{padding-bottom:200px!important}.ugb-bottom-separator,.ugb-top-separator{pointer-events:none;position:absolute!important;top:-1px;left:-1px;right:-1px;bottom:-1px;overflow:hidden;margin:0}.ugb-bottom-separator .ugb-separator-wrapper,.ugb-top-separator .ugb-separator-wrapper{position:absolute;top:auto;left:0;right:0;bottom:0;height:200px;margin:0}.ugb-bottom-separator .ugb-separator__layer-1,.ugb-bottom-separator .ugb-separator__shadow,.ugb-top-separator .ugb-separator__layer-1,.ugb-top-separator .ugb-separator__shadow{position:absolute;fill:#fff;height:100%;width:100%;z-index:4}.ugb-bottom-separator svg,.ugb-top-separator svg{left:0;right:0}.ugb-bottom-separator .ugb-separator__shadow,.ugb-top-separator .ugb-separator__shadow{z-index:3}.ugb-top-separator{transform:scaleY(-1)}.ugb-bottom-separator .ugb-separator-wrapper{top:auto;bottom:0}.ugb-bottom-separator .ugb-separator__layer-1,.ugb-bottom-separator .ugb-separator__shadow{transform:none}.ugb-main-block .ugb-block-title{margin:0 0 64px}.ugb-main-block .ugb-block-title.ugb-block-title--with-subtitle{margin-bottom:16px}.ugb-main-block .ugb-block-description{margin:0 0 64px}.ugb-main-block,[class*=ugb-]+form[class*=-link],[class*=ugb-] form[class*=-link],form[class*=ugb-][class*=-link]{display:flex;justify-content:center;align-items:center}.ugb-main-block{margin-top:35px;margin-bottom:35px;padding:0}.ugb-main-block.alignfull{padding:0 35px}.ugb-block-content,.ugb-inner-block{margin:0;padding:0;width:100%;position:relative}.ugb--full-height{min-height:700px}.ugb--restrict-content-width .ugb-content-wrapper{max-width:var(--content-width);margin:0 auto}.ugb--shadow-0,.ugb-shadow-0{box-shadow:none!important}.ugb--shadow-1,.ugb-shadow-1{box-shadow:0 0 0 1px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-2,.ugb-shadow-2{box-shadow:0 0 0 2px hsla(0,0%,47.1%,.1)!important}.ugb--shadow-3,.ugb-shadow-3{box-shadow:0 5px 5px 0 rgba(18,63,82,.035),0 0 0 1px rgba(176,181,193,.2)!important}.ugb--shadow-4,.ugb-shadow-4{box-shadow:0 2px 20px hsla(0,0%,60%,.2)!important}.ugb--shadow-5,.ugb-shadow-5{box-shadow:0 5px 30px -10px rgba(18,63,82,.3)!important}.ugb--shadow-6,.ugb-shadow-6{box-shadow:0 10px 30px rgba(0,0,0,.05)!important}.ugb--shadow-7,.ugb-shadow-7{box-shadow:7px 5px 30px rgba(72,73,121,.15)!important}.ugb--shadow-8,.ugb-shadow-8{box-shadow:0 10px 60px rgba(0,0,0,.1)!important}.ugb--shadow-9,.ugb-shadow-9{box-shadow:0 70px 130px -60px rgba(72,73,121,.38)!important}div[class^=wp-block-ugb-]{z-index:1}@supports (-webkit-touch-callout:inherit){[class*=ugb-]{background-attachment:scroll!important}}.ugb-block-content:after,.ugb-block-content:before{content:none!important}.ugb-main-block{position:relative}.ugb-main-block .ugb-video-background{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);width:100%;height:100%;z-index:1;-o-object-fit:cover;object-fit:cover}@media screen and (max-width:600px){.ugb-accordion.ugb-accordion--v2.ugb-accordion.ugb-accordion--design-basic .ugb-accordion__heading,.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__item{padding:35px 17.5px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-2 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item{grid-template-columns:minmax(0,1fr);grid-gap:0}.ugb-button-wrapper.ugb-button--design-spread .ugb-block-content{justify-content:center}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content{justify-content:flex-start}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:0}.ugb-button-wrapper.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3){margin-left:0}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content{justify-content:flex-end}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-button-wrapper.ugb-button--design-fullwidth .ugb-block-content{flex-wrap:wrap}.ugb-cta.ugb-cta--v2:not(.ugb-cta--design-plain) .ugb-cta__item{padding:35px 17.5px}.ugb-card.ugb-card--v2 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-container.ugb-container--v2>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper{padding:35px 17.5px}.ugb-count-up.ugb-countup--v4.ugb-countup--columns-3 .ugb-block-content,.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-feature-grid.ugb-feature-grid--v2:not(.ugb-feature-grid--design-plain) .ugb-feature-grid__item,.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item{padding:35px 17.5px}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-header.ugb-header--v3:not(.ugb-header--design-plain) .ugb-header__item{padding:35px 17.5px}.ugb-header.ugb-header--v3 .ugb-header__buttons{flex-wrap:wrap}.ugb-icon-list.ugb-icon-list--v2.ugb-icon-list.ugb-icon-list--display-grid ul{grid-template-columns:1fr}.ugb-icon-list.ugb-icon-list--v2.ugb-icon-list.ugb-icon-list ul{column-count:1}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item{padding:35px 17.5px}.ugb-image-box.ugb-image-box--v4 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-notification.ugb-notification--v2 .ugb-notification__item{padding:35px 17.5px}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-2 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item{padding:35px 17.5px}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-basic .ugb-team-member__item{padding:35px 17.5px}.ugb-team-member.ugb-team-member--v3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{padding:35px 17.5px}.ugb-testimonial.ugb-testimonial--v3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-3 .ugb-text__text-wrapper{grid-template-columns:1fr;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-3 .ugb-text__rule{display:none!important}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-2 .ugb-block-content{display:block}.ugb-text.ugb-text--design-plain.ugb-text--columns-3 .ugb-text__text-wrapper{grid-template-columns:1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain.ugb-text--columns-3 .ugb-text__rule{display:none!important}.ugb-video-popup__wrapper{padding:35px 17.5px}.ugb--hide-mobile{display:none!important}.ugb-main-block.alignfull{padding-right:17.5px;padding-left:17.5px}}@media screen and (min-width:1025px){.ugb--full-height{min-height:100vh}.ugb-main-block .ugb-video-background.ugb--video-hide-desktop{display:none!important}}@media screen and (max-width:782px){.ugb-accordion.ugb-accordion--v2.ugb-accordion.ugb-accordion--design-basic .ugb-accordion__heading,.ugb-blockquote.ugb-blockquote--v3.ugb-blockquote--design-basic .ugb-blockquote__item{padding:40px 23.33333px}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-container.ugb-container--v2>.ugb-inner-block>.ugb-block-content>.ugb-container__wrapper,.ugb-cta.ugb-cta--v2:not(.ugb-cta--design-plain) .ugb-cta__item,.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item{padding:40px 23.33333px}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__item,.ugb-feature.ugb-feature--v2.ugb-feature--design-plain .ugb-feature__item{grid-template-columns:1fr!important}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__content,.ugb-feature.ugb-feature--v2.ugb-feature--design-plain .ugb-feature__content{grid-row:2;grid-column:1}.ugb-feature.ugb-feature--v2.ugb-feature--design-basic .ugb-feature__image-side,.ugb-feature.ugb-feature--v2.ugb-feature--design-plain .ugb-feature__image-side{grid-row:1;grid-column:1}.ugb-feature-grid.ugb-feature-grid--v2:not(.ugb-feature-grid--design-plain) .ugb-feature-grid__item,.ugb-header.ugb-header--v3:not(.ugb-header--design-plain) .ugb-header__item,.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item,.ugb-notification.ugb-notification--v2 .ugb-notification__item{padding:40px 23.33333px}.ugb-number-box.ugb-number-box--v3.ugb-number-box--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item,.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item,.ugb-team-member.ugb-team-member--v3.ugb-team-member--design-basic .ugb-team-member__item,.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{padding:40px 23.33333px}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4 .ugb-text__text-wrapper{grid-template-columns:1fr 1fr;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4.ugb-text--has-rule .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4.ugb-text--has-rule .ugb-text__rule-2{display:none!important}.ugb-video-popup__wrapper{padding:40px 23.33333px}}@media screen and (min-width:600px) and (max-width:1280px){.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}@media screen and (max-width:1440px){.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-3 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}@media screen and (max-width:960px){.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-2 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-3 .ugb-block-content,.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list.ugb-blog-posts--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr)}.ugb-count-up.ugb-countup--v4 .ugb-countup__counter{font-size:calc(1rem + 4vw)}.ugb-icon .ugb-icon__content-wrapper{display:flex;flex-direction:row;flex-wrap:wrap}.ugb-icon .ugb-icon__item{flex:1;white-space:nowrap;min-width:-webkit-fit-content;min-width:fit-content;flex-shrink:0;margin:16px 17.5px}.ugb-icon .ugb-icon__title{white-space:normal}.ugb-pricing-box.ugb-pricing-box--v3.ugb-pricing-box--columns-3 .ugb-block-content,.ugb-team-member.ugb-team-member--v3.ugb-team-member--columns-3 .ugb-block-content,.ugb-testimonial.ugb-testimonial--v3.ugb-testimonial--columns-3 .ugb-block-content{grid-template-columns:minmax(0,1fr);grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-3 .ugb-block-content,.ugb-text:not(.ugb-text--design-plain).ugb-text--columns-4 .ugb-block-content{display:block}}@media screen and (-ms-high-contrast:active) and (min-width:600px),screen and (-ms-high-contrast:none) and (min-width:600px){.ugb-blog-posts.ugb-blog-posts--v2 .ugb-block-content{display:flex;flex-wrap:wrap}.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__item{margin-left:17.5px;margin-right:17.5px;margin-bottom:35px!important}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-4 .ugb-blog-posts__item{width:calc(25% - 35px)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-3 .ugb-blog-posts__item{width:calc(33.33333% - 35px)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-2 .ugb-blog-posts__item{width:calc(50% - 35px)}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--columns-1 .ugb-blog-posts__item{width:100%}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-portfolio2 .ugb-blog-posts__item{padding:35px 5%!important}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item{display:-ms-grid;-ms-grid-columns:1fr 35px 1fr}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__content{-ms-grid-column:3}.ugb-blog-posts.ugb-blog-posts--v2.ugb-blog-posts--design-list .ugb-blog-posts__item>:first-child:last-child{-ms-grid-column:1!important;-ms-grid-column-span:3}.ugb-blog-posts.ugb-blog-posts--v2:not(.ugb-blog-posts--design-horizontal-card) .ugb-blog-posts__content{flex:1 1 auto}}@media screen and (-ms-high-contrast:active) and (max-width:600px),screen and (-ms-high-contrast:none) and (max-width:600px){.ugb-blog-posts.ugb-blog-posts--v2 .ugb-blog-posts__item{display:block;margin-bottom:35px!important}.ugb-block-content{display:block!important}.ugb-card__item{margin-bottom:35px}}@media screen and (max-width:1025px){.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:0}.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2),.ugb-button-wrapper.ugb-button--tablet-aligned.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-tablet.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}}@media screen and (max-width:768px){.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2){margin-right:0}.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(2),.ugb-button-wrapper.ugb-button--mobile-aligned.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-1 .ugb-block-content>:nth-child(3),.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-2 .ugb-block-content>:nth-child(2){margin-left:0}.ugb-button-wrapper.ugb-button--collapse-mobile.ugb-button--design-grouped-2 .ugb-block-content>:first-child{margin-right:0}.ugb-columns.ugb-columns.ugb-columns.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr!important;grid-template-areas:inherit!important}.ugb-columns>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-4>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr!important}.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-columns:1fr!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-template-areas:inherit!important}.ugb-columns.ugb-columns--design-grid>.ugb-inner-block>.ugb-block-content>.ugb-columns__item>.ugb-column{grid-area:inherit}.ugb-bottom-separator .ugb-separator-wrapper,.ugb-top-separator .ugb-separator-wrapper{height:23vw}.ugb-main-block.ugb--has-top-separator{padding-top:23vw!important}.ugb-main-block.ugb--has-bottom-separator{padding-bottom:23vw!important}.ugb-main-block .ugb-video-background.ugb--video-hide-mobile{display:none!important}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){.ugb-card.ugb-card--v2:not(.ugb-card--design-horizontal) .ugb-card__content{flex:1 1 auto}}@media screen and (min-width:768px) and (max-width:1025px){.ugb-columns.ugb-columns--design-plain.ugb-columns--columns-6>.ugb-inner-block>.ugb-block-content>.ugb-columns__item{grid-auto-flow:row;grid-template-columns:1fr 1fr 1fr!important}.ugb-main-block .ugb-video-background.ugb--video-hide-tablet{display:none!important}}@media screen and (max-width:960px) and (min-width:600px){.ugb-count-up.ugb-countup--v4.ugb-countup--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row}}@media screen and (max-width:600px) and (-ms-high-contrast:active),screen and (max-width:600px) and (-ms-high-contrast:none){.ugb-count-up.ugb-countup--v4 .ugb-block-content{display:block!important}.ugb-count-up.ugb-countup--v4 .ugb-countup__item{margin-bottom:35px}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-block-content{display:block!important}.ugb-feature-grid.ugb-feature-grid--v2 .ugb-feature-grid__item{margin-bottom:35px}.ugb-image-box.ugb-image-box--v4 .ugb-block-content{display:block!important}.ugb-image-box.ugb-image-box--v4 .ugb-image-box__item{margin-bottom:35px}.ugb-number-box.ugb-number-box--v3 .ugb-block-content{display:block!important}.ugb-number-box.ugb-number-box--v3 .ugb-number-box__item{margin-bottom:35px!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-block-content{display:block!important}.ugb-pricing-box.ugb-pricing-box--v3 .ugb-pricing-box__item{margin-bottom:35px}.ugb-team-member.ugb-team-member--v3 .ugb-block-content{display:block!important}.ugb-team-member.ugb-team-member--v3 .ugb-team-member__item{margin-bottom:35px}.ugb-testimonial--v3.ugb-testimonial .ugb-block-content{display:block!important}.ugb-testimonial--v3.ugb-testimonial .ugb-testimonial__item{margin-bottom:35px}}@media (-ms-high-contrast:none){.ugb-feature.ugb-feature--v2 .ugb-feature__image.ugb-feature__image-has-shape.ugb-img.ugb-img--shape,.ugb-img.ugb-img--shape,::-ms-backdrop{border-radius:9999px!important}}@media screen and (min-width:600px) and (max-width:960px){.ugb-feature-grid.ugb-feature-grid--v2.ugb-feature-grid--columns-4 .ugb-block-content,.ugb-image-box.ugb-image-box--v4.ugb-image-box--columns-4 .ugb-block-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row}}@media (max-width:1024px){.ugb-separator .ugb-block-content .ugb-separator__svg-wrapper{height:175px}}@media (max-width:767px){.ugb-separator .ugb-block-content .ugb-separator__svg-wrapper{height:75px}}@media screen and (max-width:480px){.ugb-text:not(.ugb-text--design-plain) .ugb-block-content{display:block}.ugb-text:not(.ugb-text--design-plain) .ugb-text__text-wrapper{grid-template-columns:1fr!important;grid-auto-flow:row}.ugb-text:not(.ugb-text--design-plain) .ugb-text__rule{display:none!important}.ugb-text.ugb-text--design-plain .ugb-text__text-wrapper{grid-template-columns:1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain .ugb-text__rule{display:none!important}}@media screen and (max-width:960px) and (min-width:480px){.ugb-text.ugb-text--design-plain.ugb-text--columns-4 .ugb-text__text-wrapper{grid-template-columns:1fr 1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain.ugb-text--columns-4.ugb-text--has-rule .ugb-text__text-wrapper{grid-template-columns:1fr 1px 1fr;grid-auto-flow:row}.ugb-text.ugb-text--design-plain.ugb-text--columns-4.ugb-text--has-rule .ugb-text__rule-2{display:none!important}}@media screen and (min-width:961px){.ugb--hide-desktop{display:none!important}}@media screen and (min-width:601px) and (max-width:960px){.ugb--hide-tablet{display:none!important}}@media screen and (min-width:960px){.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull.ugb-main-block--inner-center>.ugb-inner-block{max-width:900px;max-width:var(--content-width)}}@media screen and (min-width:1280px){.ugb-main-block.ugb--has-block-background.alignfull.alignfull.alignfull.alignfull.ugb-main-block--inner-wide>.ugb-inner-block{width:75vw;min-width:1200px}} \ No newline at end of file diff --git a/plugins/stackable-ultimate-gutenberg-blocks/dist/frontend_blocks.js b/plugins/stackable-ultimate-gutenberg-blocks/dist/frontend_blocks.js index 1310afdf..1ef59ce6 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/dist/frontend_blocks.js +++ b/plugins/stackable-ultimate-gutenberg-blocks/dist/frontend_blocks.js @@ -5,7 +5,7 @@ var frontend_blocks=function(t){var e={};function n(o){if(e[o])return e[o].expor * @author Feross Aboukhadijeh * @license MIT */ -t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},103:function(t,e,n){"use strict";n.r(e);var o=n(27),r=n.n(o),i=n(11);Object(i.a)(function(){var t=document.querySelectorAll(".ugb-video-popup[data-video], .ugb-video-popup [data-video]");t.forEach(function(t){t.querySelector("a").addEventListener("click",function(e){e.preventDefault(),function(t){if(r.a){var e=t.getAttribute("data-video"),n={el:t,noLoader:!0};e.match(/^\d+$/g)?n.vimeoSrc=e:e.match(/^https?:\/\//g)?n.vidSrc=e:n.ytSrc=e,r()(n)}}(t)})})})},11:function(t,e,n){"use strict";e.a=function(t){if("complete"===document.readyState||"interactive"===document.readyState)return t();document.addEventListener("DOMContentLoaded",t)}},27:function(t,e){!function(){var e,n,o,r,i,a,s,c,l,u,p,f,d,h,g,y,b,m,v,w,x,S,_,A,T,k,E,L,O,H,M,C,q,j=window,z=[],P={},I=document,B="appendChild",D="createElement",W="removeChild",R="innerHTML",N="pointer-events:auto",F="clientHeight",U="clientWidth",Q="addEventListener",V=j.setTimeout,G=j.clearTimeout;function X(){var t=e.getBoundingClientRect();return"transform:translate3D("+(t.left-(o[U]-t.width)/2)+"px, "+(t.top-(o[F]-t.height)/2)+"px, 0) scale3D("+e[U]/r[U]+", "+e[F]/r[F]+", 0)"}function K(t){var e=H.length-1;if(!d){if(t>0&&O===e||t<0&&!O){if(!q.loop)return rt(i,""),void V(rt,9,i,"animation:"+(t>0?"bpl":"bpf")+" .3s;transition:transform .35s");O=t>0?-1:e+1}if([(O=Math.max(0,Math.min(O+t,e)))-1,O,O+1].forEach(function(t){if(t=Math.max(0,Math.min(t,e)),!P[t]){var n=H[t].src,o=I[D]("IMG");o[Q]("load",tt.bind(null,n)),o.src=n,P[t]=o}}),P[O].complete)return Y(t);d=!0,rt(g,"opacity:.4;"),o[B](g),P[O].onload=function(){x&&Y(t)},P[O].onerror=function(){H[O]={error:"Error loading image"},x&&Y(t)}}}function Y(t){d&&(o[W](g),d=!1);var n=H[O];if(n.error)alert(n.error);else{var a=o.querySelector("img:last-of-type");rt(i=r=P[O],"animation:"+(t>0?"bpfl":"bpfr")+" .35s;transition:transform .35s"),rt(a,"animation:"+(t>0?"bpfol":"bpfor")+" .35s both"),o[B](i),n.el&&(e=n.el)}M[R]=O+1+"/"+H.length,J(H[O].caption),k&&k([i,H[O]])}function $(t){~[1,4].indexOf(r.readyState)?(et(),V(function(){r.play()},99)):r.error?et(t):h=V($,35,t)}function Z(t){q.noLoader||(t&&rt(g,"top:"+e.offsetTop+"px;left:"+e.offsetLeft+"px;height:"+e[F]+"px;width:"+e[U]+"px"),e.parentElement[t?B:W](g),d=t)}function J(t){t&&(b[R]=t),rt(y,"opacity:"+(t?"1;"+N:"0"))}function tt(t){!~z.indexOf(t)&&z.push(t)}function et(t){if(d&&Z(),A&&A(),"string"==typeof t)return ot(),q.onError?q.onError():alert("Error: The requested "+t+" could not be loaded.");_&&tt(u),rt(r,X()),rt(o,"opacity:1;"+N),T=V(T,410),w=!0,x=!!H,V(function(){rt(r,"transition:transform .35s;transform:none"),m&&V(J,250,m)},60)}function nt(t){var e=t.target,n=[y,v,a,s,b,L,E,g];e&&e.blur(),S||~n.indexOf(e)||(r.style.cssText+=X(),rt(o,N),V(ot,350),G(T),w=!1,S=!0)}function ot(){if(I.body[W](o),o[W](r),rt(o,""),(r===c?l:r).removeAttribute("src"),J(!1),x){for(var t=o.querySelectorAll("img"),e=0;e',e}function r(t,e){var n=I[D]("button");return n.className="bp-lr",n[R]='',rt(n,e),n.onclick=function(e){e.stopPropagation(),K(t)},n}var u=I[D]("STYLE");u[R]="#bp_caption,#bp_container{bottom:0;left:0;right:0;position:fixed;opacity:0}#bp_container>*,#bp_loader{position:absolute;right:0;z-index:10}#bp_container,#bp_caption,#bp_container svg{pointer-events:none}#bp_container{top:0;z-index:9999;background:rgba(0,0,0,.7);opacity:0;transition:opacity .35s}#bp_loader{top:0;left:0;bottom:0;display:flex;margin:0;cursor:wait;z-index:9;background:0 0}#bp_loader svg{width:50%;max-width:300px;max-height:50%;margin:auto;animation:bpturn 1s infinite linear}#bp_aud,#bp_container img,#bp_sv,#bp_vid{user-select:none;max-height:96%;max-width:96%;top:0;bottom:0;left:0;margin:auto;box-shadow:0 0 3em rgba(0,0,0,.4);z-index:-1}#bp_sv{height:0;padding-bottom:54%;background-color:#000;width:96%}#bp_caption{font-size:.9em;padding:1.3em;background:rgba(15,15,15,.94);color:#fff;text-align:center;transition:opacity .3s}#bp_aud{width:650px;top:calc(50% - 20px);bottom:auto;box-shadow:none}#bp_count{left:0;right:auto;padding:14px;color:rgba(255,255,255,.7);font-size:22px;cursor:default}#bp_container button{position:absolute;border:0;outline:0;background:0 0;cursor:pointer;transition:all .1s}#bp_container>.bp-x{height:41px;width:41px;border-radius:100%;top:8px;right:14px;opacity:.8;line-height:1}#bp_container>.bp-x:focus,#bp_container>.bp-x:hover{background:rgba(255,255,255,.2)}.bp-x svg,.bp-xc svg{height:21px;width:20px;fill:#fff;vertical-align:top;}.bp-xc svg{width:16px}#bp_container .bp-xc{left:2%;bottom:100%;padding:9px 20px 7px;background:#d04444;border-radius:2px 2px 0 0;opacity:.85}#bp_container .bp-xc:focus,#bp_container .bp-xc:hover{opacity:1}.bp-lr{top:50%;top:calc(50% - 130px);padding:99px 0;width:6%;background:0 0;border:0;opacity:.4;transition:opacity .1s}.bp-lr:focus,.bp-lr:hover{opacity:.8}@keyframes bpf{50%{transform:translatex(15px)}100%{transform:none}}@keyframes bpl{50%{transform:translatex(-15px)}100%{transform:none}}@keyframes bpfl{0%{opacity:0;transform:translatex(70px)}100%{opacity:1;transform:none}}@keyframes bpfr{0%{opacity:0;transform:translatex(-70px)}100%{opacity:1;transform:none}}@keyframes bpfol{0%{opacity:1;transform:none}100%{opacity:0;transform:translatex(-70px)}}@keyframes bpfor{0%{opacity:1;transform:none}100%{opacity:0;transform:translatex(70px)}}@keyframes bpturn{0%{transform:none}100%{transform:rotate(360deg)}}@media (max-width:600px){.bp-lr{font-size:15vw}}@media (min-aspect-ratio:9/5){#bp_sv{height:98%;width:170.6vh;padding:0}}",I.head[B](u),(o=I[D]("DIV")).id="bp_container",o.onclick=nt,p=e("bp-x"),o[B](p),"ontouchstart"in j&&(C=!0,o.ontouchstart=function(e){t=e.changedTouches[0].pageX},o.ontouchmove=function(t){t.preventDefault()},o.ontouchend=function(e){if(x){var n=e.changedTouches[0].pageX-t;n<-30&&K(1),n>30&&K(-1)}});i=I[D]("IMG"),(a=I[D]("VIDEO")).id="bp_vid",a.setAttribute("playsinline",!0),a.controls=!0,a.loop=!0,(s=I[D]("audio")).id="bp_aud",s.controls=!0,s.loop=!0,(M=I[D]("span")).id="bp_count",(y=I[D]("DIV")).id="bp_caption",(v=e("bp-xc")).onclick=J.bind(null,!1),y[B](v),b=I[D]("SPAN"),y[B](b),o[B](y),E=r(1,"transform:scalex(-1)"),L=r(-1,"left:0;right:auto"),(g=I[D]("DIV")).id="bp_loader",g[R]='',(c=I[D]("DIV")).id="bp_sv",(l=I[D]("IFRAME")).setAttribute("allowfullscreen",!0),l.allow="autoplay; fullscreen",l.onload=et,rt(l,"border:0;position:absolute;height:100%;width:100%;left:0;top:0"),c[B](l),i.onload=et,i.onerror=et.bind(null,"image"),j[Q]("resize",function(){x||d&&Z(!0)}),I[Q]("keyup",function(t){var e=t.keyCode;27===e&&w&&nt(o),x&&(39===e&&K(1),37===e&&K(-1),38===e&&K(10),40===e&&K(-10))}),I[Q]("keydown",function(t){x&&~[37,38,39,40].indexOf(t.keyCode)&&t.preventDefault()}),I[Q]("focus",function(t){w&&!o.contains(t.target)&&(t.stopPropagation(),p.focus())},!0),n=!0}(),d&&(G(h),ot()),q=t,f=t.ytSrc||t.vimeoSrc,A=t.animationStart,T=t.animationEnd,k=t.onChangeImage,e=t.el,_=!1,m=e.getAttribute("data-caption"),t.gallery?function(t){if(Array.isArray(t))O=0,H=t,m=t[0].caption;else{var n=(H=[].slice.call("string"==typeof t?I.querySelectorAll(t+" [data-bp]"):t)).indexOf(e);O=-1!==n?n:0,H=H.map(function(t){return{el:t,src:t.getAttribute("data-bp"),caption:t.getAttribute("data-caption")}})}_=!0,u=H[O].src,!~z.indexOf(u)&&Z(!0),H.length>1?(o[B](M),M[R]=O+1+"/"+H.length,C||(o[B](E),o[B](L))):H=!1;(r=i).src=u}(t.gallery):f||t.iframeSrc?(Z(!0),r=c,function(){var t;q.ytSrc?t="https://www.youtube.com/embed/"+f+"?html5=1&rel=0&playsinline=1&autoplay=1":q.vimeoSrc?t="https://player.vimeo.com/video/"+f+"?autoplay=1":q.iframeSrc&&(t=q.iframeSrc);l.src=t}()):t.imgSrc?(_=!0,u=t.imgSrc,!~z.indexOf(u)&&Z(!0),(r=i).src=u):t.audio?(Z(!0),(r=s).src=t.audio,$("audio file")):t.vidSrc?(Z(!0),S=t.vidSrc,Array.isArray(S)?(r=a.cloneNode(),S.forEach(function(t){var e=I[D]("SOURCE");e.src=t,e.type="video/"+t.match(/.(\w+)$/)[1],r[B](e)})):(r=a).src=S,$("video")):(r=i).src="IMG"===e.tagName?e.src:j.getComputedStyle(e).backgroundImage.replace(/^url|[(|)|'|"]/g,""),o[B](r),I.body[B](o)}}()},30:function(t,e){var n={utf8:{stringToBytes:function(t){return n.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(n.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.action,i=void 0===n?"start":n,a=e.duration,s=void 0===a?1e3:a,c=e.delay,l=void 0===c?16:c,u=e.lang,p=void 0===u?void 0:u;if("stop"!==i){if(o(t),/[0-9]/.test(t.innerHTML)){var f=r(t.innerHTML,{duration:s||t.getAttribute("data-duration"),lang:p||document.querySelector("html").getAttribute("lang")||void 0,delay:l||t.getAttribute("data-delay")});t._countUpOrigInnerHTML=t.innerHTML,t.innerHTML=f[0],t.style.visibility="visible",t.countUpTimeout=setTimeout(function e(){t.innerHTML=f.shift(),f.length?(clearTimeout(t.countUpTimeout),t.countUpTimeout=setTimeout(e,l)):t._countUpOrigInnerHTML=void 0},l)}}else o(t)};var o=function(t){clearTimeout(t.countUpTimeout),t._countUpOrigInnerHTML&&(t.innerHTML=t._countUpOrigInnerHTML,t._countUpOrigInnerHTML=void 0),t.style.visibility=""},r=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.duration,o=void 0===n?1e3:n,r=e.delay,i=void 0===r?16:r,a=e.lang,s=void 0===a?void 0:a,c=o/i,l=t.toString().split(/(<[^>]+>|[0-9.][,.0-9]*[0-9]*)/),u=[],p=0;p]+>/.test(l[f])){var d=l[f],h=/[0-9]+,[0-9]+/.test(d);d=d.replace(/,/g,"");for(var g=/^[0-9]+\.[0-9]+$/.test(d),y=g?(d.split(".")[1]||[]).length:0,b=u.length-1,m=c;m>=1;m--){var v=parseInt(d/c*m,10);g&&(v=parseFloat(d/c*m).toFixed(y),v=parseFloat(v).toLocaleString(s)),h&&(v=v.toLocaleString(s)),u[b--]+=v}}else for(var w=0;w>>24)|4278255360&(n[d]<<24|n[d]>>>8);n[c>>>5]|=128<>>9<<4)]=c;var h=s._ff,g=s._gg,y=s._hh,b=s._ii;for(d=0;d>>0,u=u+v>>>0,p=p+w>>>0,f=f+x>>>0}return o.endian([l,u,p,f])})._ff=function(t,e,n,o,r,i,a){var s=t+(e&n|~e&o)+(r>>>0)+a;return(s<>>32-i)+e},s._gg=function(t,e,n,o,r,i,a){var s=t+(e&o|n&~o)+(r>>>0)+a;return(s<>>32-i)+e},s._hh=function(t,e,n,o,r,i,a){var s=t+(e^n^o)+(r>>>0)+a;return(s<>>32-i)+e},s._ii=function(t,e,n,o,r,i,a){var s=t+(n^(e|~o))+(r>>>0)+a;return(s<>>32-i)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var n=o.wordsToBytes(s(t,e));return e&&e.asBytes?n:e&&e.asString?a.bytesToString(n):o.bytesToHex(n)}},93:function(t,e,n){"use strict";n.r(e);n(94);var o=n(95);o.keys().forEach(function(t){return o(t)})},94:function(t,e){var n;window.NodeList&&!window.NodeList.prototype.forEach&&(window.NodeList.prototype.forEach=Array.prototype.forEach),(n=window.Node||window.Element)&&n.prototype&&null==n.prototype.firstElementChild&&Object.defineProperty(n.prototype,"firstElementChild",{get:function(){for(var t,e=this.childNodes,n=0;t=e[n++];)if(1===t.nodeType)return t;return null}})},95:function(t,e,n){var o={"./accordion/frontend.js":96,"./count-up/frontend.js":97,"./expand/frontend.js":99,"./notification/frontend.js":100,"./video-popup/frontend.js":103};function r(t){var e=i(t);return n(e)}function i(t){if(!n.o(o,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return o[t]}r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=95},96:function(t,e,n){"use strict";n.r(e),n.d(e,"initAll",function(){return s});var o=n(11),r=function(t){return t.classList.contains("ugb-accordion--open")},i=function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=e.querySelector(".ugb-accordion__text, .ugb-accordion__content");if(clearTimeout(e.aTimeout),r(e)?(e.setAttribute("data-height","".concat(o.clientHeight+50,"px")),o.style.maxHeight=e.getAttribute("data-height"),e.aTimeout=setTimeout(function(){o.style.maxHeight=0},1)):(o.style.maxHeight=e.getAttribute("data-height"),e.aTimeout=setTimeout(function(){o.style.maxHeight=""},350)),e.setAttribute("aria-expanded",r(e)?"false":"true"),e.classList.toggle("ugb-accordion--open"),!n&&e.classList.contains("ugb-accordion--single-open")){for(var i=e.nextElementSibling;i&&i.classList.contains("ugb-accordion");)r(i)&&t(i,!0),i=i.nextElementSibling;for(i=e.previousElementSibling;i&&i.classList.contains("ugb-accordion");)r(i)&&t(i,!0),i=i.previousElementSibling}},a=1,s=function(){document.querySelectorAll(".ugb-accordion").forEach(function(t){return function(t){!function(t){var e=t.classList.contains("ugb-accordion--open"),n=t.querySelector(".ugb-accordion__text, .ugb-accordion__content");e||(t.style.display="none",n.style.maxHeight="none",t.classList.toggle("ugb-accordion--open"),t.style.display="");var o=t.querySelector(".ugb-accordion__text, .ugb-accordion__content").clientHeight;t.setAttribute("data-height","".concat(o+50,"px")),e||(t.style.display="none",t.classList.toggle("ugb-accordion--open"),n.style.maxHeight="",t.style.display="")}(t);var e=t.querySelector(".ugb-accordion__heading");e.addEventListener("click",function(e){e.preventDefault(),i(t)}),e.addEventListener("keypress",function(e){e.preventDefault(),i(t)});var n=t.querySelector(".ugb-accordion__heading h4, .ugb-accordion__title"),o=t.querySelector(".ugb-accordion__text, .ugb-accordion__content");n.setAttribute("id","ugb-accordion-".concat(a,"__heading")),o.setAttribute("id","ugb-accordion-".concat(a,"__content")),n.setAttribute("aria-controls","ugb-accordion-".concat(a,"__content")),o.setAttribute("aria-labelledby","ugb-accordion-".concat(a,"__heading")),a++}(t)})};Object(o.a)(s)},97:function(t,e,n){"use strict";n.r(e);var o=n(33),r=n.n(o),i=n(11);Object(i.a)(function(){n(98),document.querySelectorAll(".ugb-countup .ugb-counter, .ugb-countup__counter").forEach(function(t){t.classList.add("ugb-countup--hide"),new Waypoint({element:t,handler:function(){r()(t),t.classList.remove("ugb-countup--hide"),this.destroy()},offset:"bottom-in-view"})})})},98:function(t,e){ +t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},103:function(t,e,n){"use strict";n.r(e);var o=n(27),r=n.n(o),i=n(11);Object(i.a)(function(){var t=document.querySelectorAll(".ugb-video-popup[data-video], .ugb-video-popup [data-video]");t.forEach(function(t){t.querySelector("a").addEventListener("click",function(e){e.preventDefault(),function(t){if(r.a){var e=t.getAttribute("data-video"),n={el:t,noLoader:!0};e.match(/^\d+$/g)?n.vimeoSrc=e:e.match(/^https?:\/\//g)?n.vidSrc=e:n.ytSrc=e,r()(n)}}(t)})})})},11:function(t,e,n){"use strict";e.a=function(t){if("complete"===document.readyState||"interactive"===document.readyState)return t();document.addEventListener("DOMContentLoaded",t)}},27:function(t,e){!function(){var e,n,o,r,i,a,s,c,l,u,p,f,d,h,g,y,b,m,v,w,x,S,_,A,T,k,E,L,O,H,M,C,q,j=window,z=[],P={},I=document,B="appendChild",D="createElement",W="removeChild",R="innerHTML",N="pointer-events:auto",F="clientHeight",U="clientWidth",Q="addEventListener",V=j.setTimeout,G=j.clearTimeout;function X(){var t=e.getBoundingClientRect();return"transform:translate3D("+(t.left-(o[U]-t.width)/2)+"px, "+(t.top-(o[F]-t.height)/2)+"px, 0) scale3D("+e[U]/r[U]+", "+e[F]/r[F]+", 0)"}function K(t){var e=H.length-1;if(!d){if(t>0&&O===e||t<0&&!O){if(!q.loop)return rt(i,""),void V(rt,9,i,"animation:"+(t>0?"bpl":"bpf")+" .3s;transition:transform .35s");O=t>0?-1:e+1}if([(O=Math.max(0,Math.min(O+t,e)))-1,O,O+1].forEach(function(t){if(t=Math.max(0,Math.min(t,e)),!P[t]){var n=H[t].src,o=I[D]("IMG");o[Q]("load",tt.bind(null,n)),o.src=n,P[t]=o}}),P[O].complete)return Y(t);d=!0,rt(g,"opacity:.4;"),o[B](g),P[O].onload=function(){x&&Y(t)},P[O].onerror=function(){H[O]={error:"Error loading image"},x&&Y(t)}}}function Y(t){d&&(o[W](g),d=!1);var n=H[O];if(n.error)alert(n.error);else{var a=o.querySelector("img:last-of-type");rt(i=r=P[O],"animation:"+(t>0?"bpfl":"bpfr")+" .35s;transition:transform .35s"),rt(a,"animation:"+(t>0?"bpfol":"bpfor")+" .35s both"),o[B](i),n.el&&(e=n.el)}M[R]=O+1+"/"+H.length,J(H[O].caption),k&&k([i,H[O]])}function $(t){~[1,4].indexOf(r.readyState)?(et(),V(function(){r.play()},99)):r.error?et(t):h=V($,35,t)}function Z(t){q.noLoader||(t&&rt(g,"top:"+e.offsetTop+"px;left:"+e.offsetLeft+"px;height:"+e[F]+"px;width:"+e[U]+"px"),e.parentElement[t?B:W](g),d=t)}function J(t){t&&(b[R]=t),rt(y,"opacity:"+(t?"1;"+N:"0"))}function tt(t){!~z.indexOf(t)&&z.push(t)}function et(t){if(d&&Z(),A&&A(),"string"==typeof t)return ot(),q.onError?q.onError():alert("Error: The requested "+t+" could not be loaded.");_&&tt(u),rt(r,X()),rt(o,"opacity:1;"+N),T=V(T,410),w=!0,x=!!H,V(function(){rt(r,"transition:transform .35s;transform:none"),m&&V(J,250,m)},60)}function nt(t){var e=t.target,n=[y,v,a,s,b,L,E,g];e&&e.blur(),S||~n.indexOf(e)||(r.style.cssText+=X(),rt(o,N),V(ot,350),G(T),w=!1,S=!0)}function ot(){if(I.body[W](o),o[W](r),rt(o,""),(r===c?l:r).removeAttribute("src"),J(!1),x){for(var t=o.querySelectorAll("img"),e=0;e',e}function r(t,e){var n=I[D]("button");return n.className="bp-lr",n[R]='',rt(n,e),n.onclick=function(e){e.stopPropagation(),K(t)},n}var u=I[D]("STYLE");u[R]="#bp_caption,#bp_container{bottom:0;left:0;right:0;position:fixed;opacity:0}#bp_container>*,#bp_loader{position:absolute;right:0;z-index:10}#bp_container,#bp_caption,#bp_container svg{pointer-events:none}#bp_container{top:0;z-index:9999;background:rgba(0,0,0,.7);opacity:0;transition:opacity .35s}#bp_loader{top:0;left:0;bottom:0;display:flex;margin:0;cursor:wait;z-index:9;background:0 0}#bp_loader svg{width:50%;max-width:300px;max-height:50%;margin:auto;animation:bpturn 1s infinite linear}#bp_aud,#bp_container img,#bp_sv,#bp_vid{user-select:none;max-height:96%;max-width:96%;top:0;bottom:0;left:0;margin:auto;box-shadow:0 0 3em rgba(0,0,0,.4);z-index:-1}#bp_sv{height:0;padding-bottom:54%;background-color:#000;width:96%}#bp_caption{font-size:.9em;padding:1.3em;background:rgba(15,15,15,.94);color:#fff;text-align:center;transition:opacity .3s}#bp_aud{width:650px;top:calc(50% - 20px);bottom:auto;box-shadow:none}#bp_count{left:0;right:auto;padding:14px;color:rgba(255,255,255,.7);font-size:22px;cursor:default}#bp_container button{position:absolute;border:0;outline:0;background:0 0;cursor:pointer;transition:all .1s}#bp_container>.bp-x{height:41px;width:41px;border-radius:100%;top:8px;right:14px;opacity:.8;line-height:1}#bp_container>.bp-x:focus,#bp_container>.bp-x:hover{background:rgba(255,255,255,.2)}.bp-x svg,.bp-xc svg{height:21px;width:20px;fill:#fff;vertical-align:top;}.bp-xc svg{width:16px}#bp_container .bp-xc{left:2%;bottom:100%;padding:9px 20px 7px;background:#d04444;border-radius:2px 2px 0 0;opacity:.85}#bp_container .bp-xc:focus,#bp_container .bp-xc:hover{opacity:1}.bp-lr{top:50%;top:calc(50% - 130px);padding:99px 0;width:6%;background:0 0;border:0;opacity:.4;transition:opacity .1s}.bp-lr:focus,.bp-lr:hover{opacity:.8}@keyframes bpf{50%{transform:translatex(15px)}100%{transform:none}}@keyframes bpl{50%{transform:translatex(-15px)}100%{transform:none}}@keyframes bpfl{0%{opacity:0;transform:translatex(70px)}100%{opacity:1;transform:none}}@keyframes bpfr{0%{opacity:0;transform:translatex(-70px)}100%{opacity:1;transform:none}}@keyframes bpfol{0%{opacity:1;transform:none}100%{opacity:0;transform:translatex(-70px)}}@keyframes bpfor{0%{opacity:1;transform:none}100%{opacity:0;transform:translatex(70px)}}@keyframes bpturn{0%{transform:none}100%{transform:rotate(360deg)}}@media (max-width:600px){.bp-lr{font-size:15vw}}@media (min-aspect-ratio:9/5){#bp_sv{height:98%;width:170.6vh;padding:0}}",I.head[B](u),(o=I[D]("DIV")).id="bp_container",o.onclick=nt,p=e("bp-x"),o[B](p),"ontouchstart"in j&&(C=!0,o.ontouchstart=function(e){t=e.changedTouches[0].pageX},o.ontouchmove=function(t){t.preventDefault()},o.ontouchend=function(e){if(x){var n=e.changedTouches[0].pageX-t;n<-30&&K(1),n>30&&K(-1)}});i=I[D]("IMG"),(a=I[D]("VIDEO")).id="bp_vid",a.setAttribute("playsinline",!0),a.controls=!0,a.loop=!0,(s=I[D]("audio")).id="bp_aud",s.controls=!0,s.loop=!0,(M=I[D]("span")).id="bp_count",(y=I[D]("DIV")).id="bp_caption",(v=e("bp-xc")).onclick=J.bind(null,!1),y[B](v),b=I[D]("SPAN"),y[B](b),o[B](y),E=r(1,"transform:scalex(-1)"),L=r(-1,"left:0;right:auto"),(g=I[D]("DIV")).id="bp_loader",g[R]='',(c=I[D]("DIV")).id="bp_sv",(l=I[D]("IFRAME")).setAttribute("allowfullscreen",!0),l.allow="autoplay; fullscreen",l.onload=et,rt(l,"border:0;position:absolute;height:100%;width:100%;left:0;top:0"),c[B](l),i.onload=et,i.onerror=et.bind(null,"image"),j[Q]("resize",function(){x||d&&Z(!0)}),I[Q]("keyup",function(t){var e=t.keyCode;27===e&&w&&nt(o),x&&(39===e&&K(1),37===e&&K(-1),38===e&&K(10),40===e&&K(-10))}),I[Q]("keydown",function(t){x&&~[37,38,39,40].indexOf(t.keyCode)&&t.preventDefault()}),I[Q]("focus",function(t){w&&!o.contains(t.target)&&(t.stopPropagation(),p.focus())},!0),n=!0}(),d&&(G(h),ot()),q=t,f=t.ytSrc||t.vimeoSrc,A=t.animationStart,T=t.animationEnd,k=t.onChangeImage,e=t.el,_=!1,m=e.getAttribute("data-caption"),t.gallery?function(t){if(Array.isArray(t))O=0,H=t,m=t[0].caption;else{var n=(H=[].slice.call("string"==typeof t?I.querySelectorAll(t+" [data-bp]"):t)).indexOf(e);O=-1!==n?n:0,H=H.map(function(t){return{el:t,src:t.getAttribute("data-bp"),caption:t.getAttribute("data-caption")}})}_=!0,u=H[O].src,!~z.indexOf(u)&&Z(!0),H.length>1?(o[B](M),M[R]=O+1+"/"+H.length,C||(o[B](E),o[B](L))):H=!1;(r=i).src=u}(t.gallery):f||t.iframeSrc?(Z(!0),r=c,function(){var t;q.ytSrc?t="https://www.youtube.com/embed/"+f+"?html5=1&rel=0&playsinline=1&autoplay=1":q.vimeoSrc?t="https://player.vimeo.com/video/"+f+"?autoplay=1":q.iframeSrc&&(t=q.iframeSrc);l.src=t}()):t.imgSrc?(_=!0,u=t.imgSrc,!~z.indexOf(u)&&Z(!0),(r=i).src=u):t.audio?(Z(!0),(r=s).src=t.audio,$("audio file")):t.vidSrc?(Z(!0),S=t.vidSrc,Array.isArray(S)?(r=a.cloneNode(),S.forEach(function(t){var e=I[D]("SOURCE");e.src=t,e.type="video/"+t.match(/.(\w+)$/)[1],r[B](e)})):(r=a).src=S,$("video")):(r=i).src="IMG"===e.tagName?e.src:j.getComputedStyle(e).backgroundImage.replace(/^url|[(|)|'|"]/g,""),o[B](r),I.body[B](o)}}()},30:function(t,e){var n={utf8:{stringToBytes:function(t){return n.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(n.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.action,i=void 0===n?"start":n,a=e.duration,s=void 0===a?1e3:a,c=e.delay,l=void 0===c?16:c,u=e.lang,p=void 0===u?void 0:u;if("stop"!==i){if(o(t),/[0-9]/.test(t.innerHTML)){var f=r(t.innerHTML,{duration:s||t.getAttribute("data-duration"),lang:p||document.querySelector("html").getAttribute("lang")||void 0,delay:l||t.getAttribute("data-delay")});t._countUpOrigInnerHTML=t.innerHTML,t.innerHTML=f[0],t.style.visibility="visible",t.countUpTimeout=setTimeout(function e(){t.innerHTML=f.shift(),f.length?(clearTimeout(t.countUpTimeout),t.countUpTimeout=setTimeout(e,l)):t._countUpOrigInnerHTML=void 0},l)}}else o(t)};var o=function(t){clearTimeout(t.countUpTimeout),t._countUpOrigInnerHTML&&(t.innerHTML=t._countUpOrigInnerHTML,t._countUpOrigInnerHTML=void 0),t.style.visibility=""},r=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.duration,o=void 0===n?1e3:n,r=e.delay,i=void 0===r?16:r,a=e.lang,s=void 0===a?void 0:a,c=o/i,l=t.toString().split(/(<[^>]+>|[0-9.][,.0-9]*[0-9]*)/),u=[],p=0;p]+>/.test(l[f])){var d=l[f],h=/[0-9]+,[0-9]+/.test(d);d=d.replace(/,/g,"");for(var g=/^[0-9]+\.[0-9]+$/.test(d),y=g?(d.split(".")[1]||[]).length:0,b=u.length-1,m=c;m>=1;m--){var v=parseInt(d/c*m,10);g&&(v=parseFloat(d/c*m).toFixed(y),v=parseFloat(v).toLocaleString(s)),h&&(v=v.toLocaleString(s)),u[b--]+=v}}else for(var w=0;w>>24)|4278255360&(n[d]<<24|n[d]>>>8);n[c>>>5]|=128<>>9<<4)]=c;var h=s._ff,g=s._gg,y=s._hh,b=s._ii;for(d=0;d>>0,u=u+v>>>0,p=p+w>>>0,f=f+x>>>0}return o.endian([l,u,p,f])})._ff=function(t,e,n,o,r,i,a){var s=t+(e&n|~e&o)+(r>>>0)+a;return(s<>>32-i)+e},s._gg=function(t,e,n,o,r,i,a){var s=t+(e&o|n&~o)+(r>>>0)+a;return(s<>>32-i)+e},s._hh=function(t,e,n,o,r,i,a){var s=t+(e^n^o)+(r>>>0)+a;return(s<>>32-i)+e},s._ii=function(t,e,n,o,r,i,a){var s=t+(n^(e|~o))+(r>>>0)+a;return(s<>>32-i)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var n=o.wordsToBytes(s(t,e));return e&&e.asBytes?n:e&&e.asString?a.bytesToString(n):o.bytesToHex(n)}},93:function(t,e,n){"use strict";n.r(e);n(94);var o=n(95);o.keys().forEach(function(t){return o(t)})},94:function(t,e){window.NodeList&&!window.NodeList.prototype.forEach&&(window.NodeList.prototype.forEach=Array.prototype.forEach),function(t){try{t&&t.prototype&&null==t.prototype.firstElementChild&&Object.defineProperty(t.prototype,"firstElementChild",{get:function(){for(var t,e=this.childNodes,n=0;t=e[n++];)if(1===t.nodeType)return t;return null}})}catch(t){}}(window.Node||window.Element)},95:function(t,e,n){var o={"./accordion/frontend.js":96,"./count-up/frontend.js":97,"./expand/frontend.js":99,"./notification/frontend.js":100,"./video-popup/frontend.js":103};function r(t){var e=i(t);return n(e)}function i(t){if(!n.o(o,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return o[t]}r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=95},96:function(t,e,n){"use strict";n.r(e),n.d(e,"initAll",function(){return s});var o=n(11),r=function(t){return t.classList.contains("ugb-accordion--open")},i=function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=e.querySelector(".ugb-accordion__text, .ugb-accordion__content");if(clearTimeout(e.aTimeout),r(e)?(e.setAttribute("data-height","".concat(o.clientHeight+50,"px")),o.style.maxHeight=e.getAttribute("data-height"),e.aTimeout=setTimeout(function(){o.style.maxHeight=0},1)):(o.style.maxHeight=e.getAttribute("data-height"),e.aTimeout=setTimeout(function(){o.style.maxHeight=""},350)),e.setAttribute("aria-expanded",r(e)?"false":"true"),e.classList.toggle("ugb-accordion--open"),!n&&e.classList.contains("ugb-accordion--single-open")){for(var i=e.nextElementSibling;i&&i.classList.contains("ugb-accordion");)r(i)&&t(i,!0),i=i.nextElementSibling;for(i=e.previousElementSibling;i&&i.classList.contains("ugb-accordion");)r(i)&&t(i,!0),i=i.previousElementSibling}},a=1,s=function(){document.querySelectorAll(".ugb-accordion").forEach(function(t){return function(t){!function(t){var e=t.classList.contains("ugb-accordion--open"),n=t.querySelector(".ugb-accordion__text, .ugb-accordion__content");e||(t.style.display="none",n.style.maxHeight="none",t.classList.toggle("ugb-accordion--open"),t.style.display="");var o=t.querySelector(".ugb-accordion__text, .ugb-accordion__content").clientHeight;t.setAttribute("data-height","".concat(o+50,"px")),e||(t.style.display="none",t.classList.toggle("ugb-accordion--open"),n.style.maxHeight="",t.style.display="")}(t);var e=t.querySelector(".ugb-accordion__heading");e.addEventListener("click",function(e){e.preventDefault(),i(t)}),e.addEventListener("keypress",function(e){e.preventDefault(),i(t)});var n=t.querySelector(".ugb-accordion__heading h4, .ugb-accordion__title"),o=t.querySelector(".ugb-accordion__text, .ugb-accordion__content");n.setAttribute("id","ugb-accordion-".concat(a,"__heading")),o.setAttribute("id","ugb-accordion-".concat(a,"__content")),n.setAttribute("aria-controls","ugb-accordion-".concat(a,"__content")),o.setAttribute("aria-labelledby","ugb-accordion-".concat(a,"__heading")),a++}(t)})};Object(o.a)(s)},97:function(t,e,n){"use strict";n.r(e);var o=n(33),r=n.n(o),i=n(11);Object(i.a)(function(){n(98),document.querySelectorAll(".ugb-countup .ugb-counter, .ugb-countup__counter").forEach(function(t){t.classList.add("ugb-countup--hide"),new Waypoint({element:t,handler:function(){r()(t),t.classList.remove("ugb-countup--hide"),this.destroy()},offset:"bottom-in-view"})})})},98:function(t,e){ /*! Waypoints - 4.0.1 Copyright © 2011-2016 Caleb Troughton diff --git a/plugins/stackable-ultimate-gutenberg-blocks/dist/images/block-design-library-preview.a8d74f0.jpg b/plugins/stackable-ultimate-gutenberg-blocks/dist/images/block-design-library-preview.a8d74f0.jpg new file mode 100644 index 0000000000000000000000000000000000000000..72425d23cc8e5df1a58a62573dd951e222415d14 GIT binary patch literal 26856 zcmd432V4|C^Dw>?rKt3x2%HE=l_n}mIeL>`L{K;ZQHlykuL}YqARR;nrFQ`-f)qLF zA|TS0-jQAoxZ~=(_^nU*J#YKHpZ|Y%Z!?=@lgwl?nVDpd^qn*fFlei5sRLwW0H6t- z0BHueq2}#y7XWm10bu|Dr~z^^CV&Eh$en*_v@if< z6i^%m7}OLnJ7V z{DmbWKu!+fNkL9=g!~9OC1p4nL?a3YCLYQ&l1j`+B+g11vM3(Cz-z6{>S`n%Y`_LcR<2dtiy5rEr%*et(&%naS&Cbfo&V82aG}l>SetuzTDQQ*JTO_Cu zvOmk9{68#Y6gW=ti+qd_bD`H>Yj+O5{r&d&)pfnxdEvZsBIyUQ%g7YRA>6%+TF#WlU1;*iHj-xjD4h5r552CNSKtNbz zY?f2nf&L0IzPK1v-{7M7629fTQ9JYY^|0*4s3&5Ip4W@{CY46Lzn96=6>eSfdDgbX zKFq`|6J-$@tBr!|#P+G45){@hNOim|D}VFB;c3GA^ZjMl_Ya`c?ep?Qx3SEjMX|aN zQ(b3^$pXgyHp9y0FcV-o?NxN!OQFTl++!zWB`@~iBle~~4-I!%8{euYDlK@iae8!r z6!{{;BxX6Jz>lR`df#~>*aXcsF2Ck`c94n9srbls*O4UCj~BW>UV^JJ+{q{u&T>SX z+~+fnzO^6mO806r>(#OAf1YLvoFiSkZyHK#mlrAHKAt>ksZwlo8cKiBZp0GLZR3=B zaBOuduJ}RmgM#O*zV*kDSKo){SZvE*q1=vor5S&f?Apq@B}I&lb^oQDNHLB%h15lb zRD@d6os42Nv*BHfT3J6!6Q!SfZoTI{493z8UEZ@F`|Dfg@%=lI1!i@W*iIn7zw4{quVcI!Ipp-|e*F<#&6 z8m~^-2sd7tvRT2b21H%lp2RVmb@;96BDgloFZz2mwhsL*3M-C`%n9LFRWEpbNS=Q_ zi|QJ)iZ8!4jt=?0hnN4_<++;v{+s-bh%8}Sqrv3!35WH6;{^6T3zQFiHQRSJVV!tV zdWXy14Cdj?D(g7*=h-Z{%5W!Bh&Jo;-3i_780)=T>o4q2$XnFSj|(kd>b?|XRCmE` zPGw*v%Imas-({I1hb~XkgBt0&F3}ewECF|$E{RUqmp+f+F=nz8Rb`5+5}ma+k*JGw zN?UpGAFul=(6|WADGFuBzKm}#sm`ekD13#0+SOy}XeWLVV&*%=#;5#>o@BotYQ5o( zZ5YT~K3BVka4a2`>1IJ2^UDrS(0w{vC|vMl{JE^>Smck@(G4C-ubV*>R?#0c+I%Ov zgyj_$b0*F$U9jX{D(9kGDzD?}wRM+Ge|+`S5;yCIr$+Ov{3g0RmrHA0Jx%)_O79JA z$gjKmz2tYl`6qq;qSSBDCmH)hX4A%-%ab?f{T`l??cICwG+N4LADMA4d&NgDKhW$B zjXPyk@iJDzDb{eP#a6o2+NtR4z0tbqq3(yv7ngNk+dY4|$9L*VLzA$Y#*@0V!n}N+ zynLep0hqP!i&`}iqeJm-~!u(5z6~W*^vwEL)iJR8;@6fV^UIn zdNqG5N!$Etm7TJTtxc15Y3#iiE;(8qE;7hJZ(&aEP{KdK{jsp3q`c3!;&|HR-H6EO zU!vnseEj{?TR<%gKD4qP*sxL?*swjFKi*!N?#59U(CxUqlu~oT_Ow_MQDc>enD@JH zd>08HdhmAojpM>-dy?4~ygUwF+gGkzML*s8p1^EuG#gg_7uC=4=nQp}vW} z(h+;k1RjJ>TN~uDtOgzQV(t5nlJh_Zbe&dHt?GLmk}O`tgieCpO=9WL!u8^)BlhujQ86HPnsW4~wg) z_r78rKC>UG7nQ&IgSh?T37U$Z*l~xwN+WQz>d!U@>m)okMRfz5U1w&2t5w z1NG?-sw}JX#skCVdk;$P)?#omnC z_)le$eVYA{&vm!xD3@ocwY-U$utJ?v^w0E_*MI9FYZgYphdxtHepiOtJNoSm)L$Kpa9VbVmO5>K zS;F$NI#wGtu2Z^7>f-C&BB#ZkUE89A`~bnL2grc)#ZX*zY>({n1Nv89 z{iBTzQ`a1!#NXn};^UX~z00>l{SXRuK4%D>1IhVMK>&8{E7Q& z^AYCLyxJ#UGap-2oO9}k_Ki*@6J5i>ec#&TUEkVrkE^xWQ;thl?>Jhi=g$A_X0mRW zZ{jeN<#9MfRoBhygADJUORc@XSo0OG;XkK4mtg8~%fGysr+mo%)r8*Z^_vg$2D^+u zI~3o1h4&Hs31=d?pCu_JWC%n$r#b%Ti~Ap&V5OdQj$Qk8Vg2*3PA--k zWqgx0tn>B5vkfV}gChyfH;3j^hxdHW?R~V;`si%-XM{lRcgH3P2h~#|0_Tz$i`*Sw zbL6WR_WdJ}a)=yt&6K`T&}ERN93YC_8aIO zEV&^q>yPtYq;SIVBz_(f-S?`k!(%2ox(~9dAm9&O#EdiwP(xZb*%5LQVE7O*%afb? z%Lin9fHzI2(V zgjPlEyv-mQs=(k^1vVz91yyvD%+*8N)9W6bH46AL{vun|cB7ZYIO)e&*s*H{@R#|% zSFZ;2^b+!Ob?$z1&w9=BoTdMUC{%h8x_Hw4`SmCFn9hdY-MPc#>``NpGS!S+SM@wE zC#&zw^{M84%-Ckx!a|9U@>J&`6B^S?`6tG(}MK-k*Svx`s9`hELb%2?)IB0t_xeW!yEFM> ze5YJzWr9!kb5<=rPq*%j!bPJK6RpaupFdQ$b@JD^wR#>_Q39$zjJb9V!;l)yD5CxS zCM{Hr{PTCAljB7@-oB-4|85*NItzy5&s~) z&Vp>CIyR9;zh04@g;7!V4R7@_aUkw3OBtJx9;#J+rN2Z6g`XGr8~FkF~)>~n6~`T8iVFi8*Y0W6V|gUM~eC0>(g4~MIS%Umt{Y1hH^4} z>zsP`+XFTqL*ry-M)d>9N*22vTL)!BbS&eTI|*=@au<$fmRYoq&wRi?F&<@alB-#L zL)zihvs-ZQyE8?eCMJH~zt>b9-z%ExVgXk_#q~bDKHV)P87uF+>q0*J!|mk#!Kl!- zXULx3yLS`ES!OCEMf1vzQlT`SuGfK8n~iKLFGx}n1vUT;XuHs*?&{mDg<;Z7I)?JAYxzk;}Ky~S;z zsHnElYhO~*nRVii@+%Q-yFF13Pi_owh}YU(=(Rm7_V@u$!WEv#J-Wryxf6LJ6$4yY z%c6UVL=PQkOmU1v=>#LZwdp5Kg84YZCxqNwv&rK7;|(Yjf0YDLN(f@Fu+}e6i)Kvp zrjuozN`31!8!ebU8<+!gMW!MWKa4jfP7dby?KD4lc;eGqcBI;P4#R?3|NM@R%*BZ8 z@F^76&wuHcKYMDR)?xZXJTKZFc9!FuH1CFAm8cREqQ1py@njU*+x#(;AqVef&`ecy@74U z;Z&-M7do(}rl&J`cQZS73-5XHyk3mmow4;UI32BlOxf(6LNumqhT&!cF^EQX2>21W zkNAl63&aq%TU>k0YzCS)WMAG(a2m{?EW7sJw0Ss8C)BU!+tF*YsqeppDaki)*ziq~ zfTCE&(K)mbTvI+W#=?YUcrgDn5AdyH4IMM}BHcakCt(Ozj5gaSn?Tgn+AN@}2-9m8 z-kuq-&8OSz9z=0=mMw+mBb+hP$psOTxyJ*$xJr;79_~@9yxx`Z_EVxsBOlGr6#JF~ z8`Ygj5BKfZYG~@7tcE)wCh4#rt;)=bhgSA{|0h7%cpag=%xDF{&igF1(2`g9MXaLj z`@ma0s<*OO&1(ipkOm4`QVY3TJIT$4Wwz@M|d{sT(2H})OsnDrKyH@^4^cR6Q|XgCM|F|$dzNT@%k?>OVQIQH_805*a zLqqz#)vSE2)(uTFKUaIp=JSc@vkNG8?nzr*d{&d@{C9Z2Y=qOqW&UJcmx5#;->m47 zN6|tbYL(%d8w#5q@;p?_)P!TXhmeWry^NJdBH8o2=xUUM>8uA6Cadq6tO& zArl9VYwux41FwUX|cJ{JvQy# zm3{^PT=RmMVR-F&1sFwNtMP9S{SQ_+;*cLz(*6FA&GBk1un!3oU*Ppg&VrKbECIPd&HR%uL0&2%LNIIOGD7~0S&iQ+-9YRbdxCxP6C^+t9Zq1Lgzf5k zL(em7sR8X{_ho(dw=dPF|8%%UU=_He`^rB4-1iUWqd8#a9We7;PO8qkyp6$8t+D5k zkG^fGEM!hcPD9XOQg9VmHJm5QCS!6n++c-ErNDzObMT)*4QvojrF?Fzl?1HoJivuZ zUP?{Yx$K}^dhaH>D^IMHiLk#O)s?~bTq`#4(UiRYo9esfp6|vd)B9?IC(XxiYW!A7 z-=CB2KLYR-ijKq5u@3{$?ubUqayJ($RJB=G1(?UOfo7fPIDEYtK6E8_G3Aw&gU`PN zasK+Y9n~}MT0V?}swIeB?IDOr|JR}ATk_$FlGs|ae|P+ou4k#Rl#b23@AZ#}{iO-Q z_F$=MI|+TY+8;h{sQtM1!LQ1*QoGi6oUeUxLvy2Ttyo!nBssS=F?PwMCT< zZgfAOpP@(NDmg>_n+N2sQ@3sgB|r0*-QEhQ>OC=4^(A83wX}Inths|L#DO)>4gZ4# zgkd&!f{7G3s?Q)bh#Xay{pc~)zRL0WBzF1a#$G_>LG0eR>l^b9&MQgLRJhc6_(a*h z*bV*T3$X%Bu}9i^YKx;UfNahkBp``?E3j#V1RNHlA;`%11BR-6gL0?BNTZLAj&bow z!q!5FEDJ2^pHVqdfXE&2D{hW37Q$r9Bgnx+xMxNJ7?~mL<1fS~MJLX`lcv@`f5jT# zDSuooON)R7`N>Qjp z>~Z+77}3nZr_LR)dc4sm52>e8r@>tKR}#SRq21iF{q;*^cID+=yZ-LfnWlj*PBfUk z9hi6Ku-`q9apqKW^!_FP6Yga_g|Ki+fBam;Z~ z7;ODz1O~OKCd0J9*&PHJ6JL}cEHi&VV97P2d1m88_RYyPsGgq*Mss^Sjl-+&kzc>R z{X;N;E5VurMGUJR8#(9i{ggQw{mipn6 zbk@fOJ8vkKhFk36}eo-F}hppN&31B~{ zzumQ!Ub5bcH^RA*0G7sa63`}I1K+;(SJb5bwze(LqJVxp-kSt`8k^7K`_gyHGKGD{ zB~TpY@P2F%^tg0_7cMH31VD9^ zk^onC_y)K)wILQo=q1(@+WJ69W{iLzu;OSqb`#C6MqE1N_Sv6Es5z_1aZC1pUx2Uv zM}f(ddE8FGfdc+T>QixJJRG$=xSKDRrCOA}u?)sAZudjNf&3~B7z6v(h4+GKTZ1m@ zr|6l~uYk|ej36?~#A3d-bc{zBJ#sb8|3m_wUn7>k`I^nSV^))DP2D#5KvG^G!yF}@ zS#7B?5vVNbaq*0AtO8?HG2<9EZmt~QKi|)-S07?M&V1gL2<*XI2qDv87e5KO@ipOsu>6jc zdbUNLR%EPS!0+C{qi}M_J7`4$>i9^&W5NW- zvn1`2fX2WMY{exI)x|?&D}>~-X(Vj96VY3>65% zwe#y58u=F+w-He@9XsjgTu^*OxDUV4Phla;i#~25#>QnF67VvDMgR%m-T|BZXp6N? zi75R?YE##mV3E18g$FrBys)v0$`;3)0`BQ^yLw8PgPtHF)UZ>{nb+SEBj z7EDK*9V64Sh^#7X?T?v_;y3)7bR^Q`SvdL@Bh3l^Tz)&HW@>ruO7Rl6T+ko8OD8opQ0Mk1L zBCEuy&J3G3iE$YANP7xuBjcyj2QvBe>gv3R6`$#}H*)1l+hDyu$F}!vS|90|Zc>_gjMrebDnBV&vX>#{%Zat!qq+2dD4zfS^QDhCGqL8%FvcvU8mwFIFR zhbEkDw9G+;6f38PHJPc*!oE~eS(x`@viwXr%SUuY$#Tlx2hSUlbqrq;yD|*Qvg4^u zO=6u6x>>V#yz`^-=)c?MjcDgf3mcPl$H^> zWP1)p*=w1KxT?sP#U^IxJmgb1H$FhHQ%C)ydfls)rZ07Z4v222#cT6!17CC{PWo~@ zdq0$y$mcZFhi}*&(daKfps!p^o*y<8RCnDOG8xeiZ!5Ji))`c!uvEJ!X702e8tIRO z6sok|tMEzsrlr?@U^ae_1mOL;pkYFM6!Kl4e#!3l0WdL(X%vt8cegoW_8-{vyy#nk zG=F(0=_c)Sn9?^JiMkFq{hx83qG{&z1NiW7*4salz}f_N8_B4yxnZ!Ox^K1WfI+ zAZKD|S5K!@Mp>csRgR>A&i13qPdRB_X3EB{mqV<1_oe@P0=QxcPa7Hx*p1oS-GEQ& zD3T5OkMr@!n{uS9zf0QV=Up(eA5L@7TeXx=O4zw|o7>9YO6ckJ5RCm7@}p55vF+(@ ztQt={mGi&J42KF7a0~Q(F+F)iW&m+rOHcmGM+&Nwdql&vvX%`2!d|}gaN0?%Wd2^= zqZS!HT0-wctcFR3T&+z*;50vliot5v3Dx$Cvsfl7Uv^yi_eE|8iWEzj8jTZE45Tic zWl5TAYFFTDbmYbJARx6rUe_ttm9p*;eDbvqY*SxMA2&egg?=5l0azOem_&X9XQwv7 zpI3K0b~{Isu~U#$ev>e@3f2>x(O?M<_Ma}|=3awqUh*8;fQO&=xo@SB;>BI=0byW7 zsBrfV?%Y$@f^Y4C=I8tuLctlW-<%fv3z7Xp^NRabbGqgR=veRkeiOm$(ZS%YooroO z^Daf7d;81A%h@ZRJ=9B+9FMy5Zn@d;T^WmeMkWv5J6iCykk&|FDFblr?82=n^1c;e zWnNy$$JQa%*h;aU*yHJF?N3z^^4H-GI2|WQA-cD@Ogy+p0z3*=h+JKL z!Ewbx3U32GH4oDiW{|aUuxLM5%#}C)T*xUCbJg@)ViTpm@`Q3{e^vH^2u~@GmFbB` zcU-m0XSRxUmMQrXJErXi4h!Ab_P;iZV8W!dHu7(aNBnO*z-lk=vtagj{7?CA`LNor zbd1x}7(h#6Pnk|A4NU*MttQ7aN_9*MPuj#^lh1$VLlL+G2hrU0?Ts;`><`;gTMC{N)0^L`B>BcWT0d0CBR=nF&| z;wqsVQY64SNEd}qr*9y~docpI|1XkA0PairCUVk*1c1byd}snfC&Q;mKtmxBM_ABD zPi+c=kmJzDn1KE>W58j?&BJ`)AK6I2rm&q$F<*!t*CKa;*_OoDw~rk$@+#jH=)>JIC zT=OKrGkuzCf!OJPY#%{}A0m(1@7nLmFfYVZT#3S4C5UW$EQ)M{AH_$_X0f>RH9}X} z4tzR$^I4dhhksRAeir{7Q^ftMo$DGk@o@5uzO%&mV~pATIsGMWMS(%^dsfn(MJA7~ zYx!st?^Qm_iWF+IdYmKsLZGZK2d2OAj@KyRs5x_4b_BE5t>h-&uEhh@5p6tt5bo?j z0_yd*=yv5`8@wcd5Pu8 zQX%xie~Wj3;s-GB34tx}g9e6YnG&21$AyBAA@c-=;rUg>C{#ohR0Nb&Tk#;^cjN}C z+N@M!vk9{pY{kWqn78w}9QYf#YA4hi?;C34&2Jc0$XzRw3~aFCahkIdwKG=ALw>bI z2Trd3M$HbVuqb36b<$43Ra$Sb+MJfA$T6`@zbYOvJcGC>bnFIgJV%hcnq`%ZYESo# zQ(FZh9qai`-EWJ^nY07%$hvdVS##3m^H>D`Mo>(Hsw!{uf+`$_oR>)xKNH6+@BNJhl`)+aGo=|=^v}~C7{sWkgAwMm^^GTO9Y>`_6HMa%^<;%x zsf}!~E}FP<`F|N~y4nG4?9*>dR(UEj7Y`p&F<9cc)sQT{bkRV{#K$2ohBL-mp@REO z(XyiO$OF;ja}sGC`wrMwk75{Oz*()4h+U$4kx+kZm=^u1b76*%K8qOlh}4W<9)w&T zrL!g8cZxs?9BMwV;J?FD-t_O{QVZ zm~{+nKWo&Vt-U;j&Lr-M2AsLKtdcJcpQJ@j@jqrayGLBb;r|+CD*tF9#A2U8#wm{| z@1(se?ObzRU_RgDWph@3k&71xL1RPpg=AjZRy!lutuJtho!i+l*o(GT+tu@}#PN6a zw_YD9^tdbuh#i`>5PidQn1N1zk(ch=$P)3L?>Y|YG}H9+qK zkDUG_db}e7ni<=33HtvppxGL&0>xZE`gGhHY$YB=0s=zH5e;tkFSQ5q)dlqLg_vaV zrSZnAQgkpYsn`Bw%5X4H4inL-D(+;Ciq^{uQCcumyj5sab!uQOUIjx@b8I15@NC_; zgj^ftKp~V%Ca{yJ=b66zns;k<&cc)dtJxgpXv8{SraY%aGyIBq&{1<>zE=|9G$@g0 zgTH~TltG_ITwpl-`h@)OfIgD|0P!Y537()Nz}u%3Q@ks%LLQx5ZDyDi+}>zy8pY8J}k zBd74q?yH32HW1I^?+ly5uce(n-`+q)A1K_Y5pGS}EuFT%!pLl%G_R z2Ql^1Gf$*4lbghBkt`43m!ZWA07%D7?GO=Lj*?h?_oq5%`IpDy-ykE8YDhBA++dic z0;gAtiVA+bJ8QdxdFx*3&n+S`v}H6;pO)V}^(0qt|5n1?(+7C-JFL887LY?g1~Umi zXoW$WNaCK{rlD)h&41#naQksb51VZiBrmVV-y{FB*JE+7r7bO;L(X;LHDs&KhH!2% zJ?X9Z`N1gqsle=0I%>#2GZS^>aogkOrrYn{y=#yzf%K|p$mzM)I#~4W0Lrx5EX8Xx zYW^_I*{m08dJr$VOTJ#9y!dYll@SV zr`G&B4q|pyiy1RMgZwWQA|ShuJ)wbf?Mvn?c{h6E(T_rcAr{u(@c^0?Tyd`4JQ z9uGO(YdLzQN}M6EzVU9%9S|dIa=&kbzIcLN$cLi>GXGCm+`2@|1m9AH6FC$v$3iO| z?}H5s>;hS9)Gug{EgI%HePK{#f48j~Dn%|F^I=9C^M>ujY12^&jc8h47D3Uw=N?{4 z#N3sx40gjR5`-u!Kj<)m7vs7aVKm)CK9YV`8iW%>7?uQ_U(miF8fW}C5Lb#W&BRp{ z$Zep}#$71OJRcB$S><-xJhliiEp)shy1{+>;lZVr^uQ zv2d+M-9(henPXJR&sV19&-$Abhpay9>%RT+uA0C`5M5zBB@Tlr>O$NXFa(Lcll&Z>GWlfYyf)a;R z#H%PiAtsj$z&AU{^+$TqahkzLp8|$Eq94*hE~^XQUdUo9OwaH@<}2!??fPl&AMq%i zr#l;^YzBypUjc`EY7t@dlN^ z70xTvs^7^z=wzEiYi-!{>iB*2Ql&xbB2!-6dUN3^lH9PJ1f-JyiRqVQ zjPRWt!_av(O?{NFB+m5AGkFql!2f%fl7RVc$@3?fmHAzYq8j`fL1?L=;)hQ~r8LxP z^GE<ULD^JXuWRE^Gm{612J8i$~{pmt0AltQ4Vs9!ijkR~7)ZQ`I zO=+s5zPc)aczSyL$~ji56!|=(@7z z4(k7#7!V7G77~Cq4g8$Ov`GfB#_eg-!W7Q{5luo!BV`yF-m$I>p%G8^+N$_sP=LV60 z@DYd|A$&;yt>}$%o3<#nzXy=yq&k$=KRXR?g(@uLr%=^`DIMQHH=-pJ>?wsekCeXZ9BLBNA5P zZRX)OOlq$cFW7Q(BD0LrcLeB*#fjn=HK@1P5O|0VD9EYY0}Z>&c$?;%DIEkt{tk%Y zhG8{>9G9TzRx%073W%ZZ!P?;STT57Rks0I3VDZ#$*#-p`&E3&H%}bvzvtr#zK-swS zn`g8G>w_--1v=T>o|NVKi@Si}K1%Ma@cYLlUOi%B-LIy%5uBZ+vYZ+v z0mufTKD2e=@9g)F%=qhx1X#?}StxZkM`>tBY!!Oh@Fw2O5=M0$nbVySysVwRt>~{y z0y-qm_!#kZaB311fcTz2q4Q3Kx#;t2{|JCsX0YkN zDo{47R+s!_1Je}iRHB&R_d;Izen#0>O9Uh&^m2?I-!7tkPB@>>Q- z!a^D7v1J%=2<(C~=!mDo@x21so|UJ*K79EJ4wK@nN{op_~|nK3ke8y#z3O~EOOoqzXHtyh#e84 z8u+>FGNsN9h-V~W+mF4$5xiD)^See!B)~4X4Cx2SUq19!5yoaHbDC9YnfM zjaMt~P=|n3d;cpod`4J7TQkbNU%k_PxU@uiY!5-yxN;{gtP*9)p zhO4;x?H3vzjE;OiAIr}6beyKk@8-UKC+xAk4aH(irF82_%#|C;Zxo(QqoFyN08PpC z2-!;zBVAzxuJg8n-x#QZFpy~F1rKgQG@l|u8pxIx)R{#)={G;YBf;$&5|D_*LvPM) zLfZq(7W3&E&re|ysN4hRM7xe{D3S}r_;y@>qY6$z2%ahN5VI0efRUqJ#gXhMU-rhI zN@eS!?utCAmfZ5?83mmJitz14?77^P=#f-q<>UVNp{EgrN{1RT8+`soshf4@B7Dsx z1Nk~U3hKly7x+7f{4d2eV?yJ1UP(=OOx;sF_x*uud*hQ!y#C)$dow@IQOav5W;Tmi z9jQO>UfN?-{(e)B~y5E~f=}8BPr+6&n=sVTyr}sG>t{YHjhN_^g_Y2jVW65~fqWw*@UbK?S`CD#$ z@4z0DtcV3-RE_x!NWce#I3^sLo|*{Z_!vkBg+)M&bqmDvOOGC%32pExP<&0D2u(nr z?$^u3Qx%}@7$x$;p%K$0q51rY)P5vA#6<|UwJ^~w5A)H8tji6eI>@k@j7;|e>U0l` z?Oj>NN+e}$G5@m)|Bwlla=ZC5A>Sz~`y!)7(GWT@$f#oDy8|tCAYP{&%FEzj*%H{S zI3|jC7Gh@P{{|F`dEcdf&;d2nz&_;57q2#Z!c4(B$4E52KGgaqK`}`?%$xf$4+WL| zq1J!mZ?>u1c_F&QbA@BYReJ!%0IkMA`{Yb$LS%PK=r#P4f+{FF58mC{Mj5y`A85lb zsoA`Ij$D>1b`4M6dBWV`zQCMT1n1<3I)louUT+*y93(U#SpeyQvADxl7*VRe5f_8l zvdz&@P6tXp6Nb2wr7R9jVq02)yNE5=3UYT52QEPpAPv&}wgMR^5pG*x@kSv1ouruaNfF+u{e&pf97^HL4fye$)9XIBA@ zK}|!%7%@>byM{o+06pHSnG3x9Ke=q%mwVuw;T!qmkF~r7(y_AbN1y&ox@7#+HJ}5p zM9m)Sah^(WmRi9aj$h``^24#;-l=M2*npveQD%g#;RXl3;JYW^`A z)QfFAymY+fUfn~=<3&}Jp{LS`P884YW$qbzH_*i9EnKD}4+zund6xt_p0gdS!#{Y< z9n^`v_G{bt6f}5I^2)d5&AgCe zQ@-7apUjHWS)|Wzi~c0W$xeOsQ3U@ZjLYhMw~?T<#=z%%#~)m28L2bJZz$WGL2-`E zc10zkVEg7w9n^#RE6$&5+X-co^(+$iId5R)OQz#lS5PWR$70$3I6p)cLX;NDKhci2vn z3u$tw@Fq%{*v-)SyFeZ=9^ajB^V0WH1Uw`o&fdD3^wX7T363X&QO|fQK0Rf!nzogl z{e_Op@P-GaVLQIf#bf}xxkQAN?R60l5)(!MKm|F%1N)#wOu=O@>)SEa=0wld(9WwP z$wvxY&`prqRHuFq;`Ot4?u+kD_2QwqZ$|Q;mCz^{(fiQaBHJwEnN3Dkfg^DWLJSC^ z8TP;HXBq;#g+zrzThDq)K%pX37bScS@g2nK(_^m(3EY>f=DtaPKKyx0m-WKCo$o&X zDFRZKbq_5g3R?lq#RNY8Zz-R@q{W{@^-!VSScE<~%`zu9pTHNvws*%P=nZTa5gDTz z{$0d=^T@^G!S^e#PP}B|Z973uv4f;^I8n>GHrRI>(k_==4?v6pG-0Vj9;(0og@U04 z`X=xhK&E1>MfvH1z03}S9B>w35(EGPpeZJeT9?{2ohd<*N0oxlg&u(LQU-vQqoNcY z$H^60+FJZ}V(h~;4JbYVXPP0L0Wy!}O1`Qs=)Y3P=qiJF!eh_Objoe3Ky@5N zlRnIITw<1t!4{x&>y<+tUZT|O*cSppbM!K(pu<9fsG%`wW-58{)bhO&ud_1T}X&*_hI;8vI~ z4*)hX(!8Gz>t>+;Br3f?$phSYYmT+u>0zKgj6FQ$2EIK{q7NF3Qyl(TtV)4XJbL`M z1VD*p;qo%1A64S_2W;E(Snd*)DUUNmondGpR|MqTdQQGOB-EJ}N`Raa$W&)ggx;ee zV>t5r>j3>Bk+-x3DRgCi5tRkd_>Jsxs9(ejQa%$$cIGfQ86ZIo1VMk&1O1r}aAtX5)6Dk2xIPbeTtgG%T*4h(%_(tn zfAf75@0S1E8lECQv2u$l2=bEb>L&J2y@j0*ODEDpibI#b&g-qk13B}+I1p{FdPnAD zheOJ$j7vQ<5ej&oG+$(c5urJMw+FJ|bSqII2AzYF&?7L_N=`Tbkrj${IV)Y|ZoQ%v ziYMF(3M~6{8h*oE4ey9FhRaY@SSz_vLm$SqXk74~SXdYgh17~yIOa?Hh_0{nJE(W|0|&Zb!Zi>`>-4H$5Q zK+*iZjCSrUx%$q-gP{ZLkCv=Q&g>I}n%}OeG9&`r$3S<_#?5u;!ry~Fgv%{Znj3N} z(=Y3nRK#!MFG4jTcZ`J&lyxK1J#pg8ZeVK){D;R6;(eWyfiCB{WKr15I6TJ{HlpeY zxv!A9`vr~lW@)fuvxw#0u<{n!qqKqYcwEyk{v z<)NH7GCzJf%B67njwVHHIuG(B)sS;Kj=?08KIdDb!Zyc+8~C>*;9~4Nh~b3XmxOed z6X|C~Z|Q6$oE88TE_{93#6IZnQ=C8U2F~jwTkt-e!YvDk7$^G&6^>osL|3IlDoKz~ z9M{|`xH*NZA+AG)8@P4|K|Nf4NX5&g=?~}Y5QXELLkc$8mbJle zyY)$cKF4>z+MzF_^F5m&A^Dfj{ctNX#CVH$Z#-Oz4epTIgmfYAbg*}NDBKuB=J*O8 zDq6W6`$B^WvI(wWIv{g?{pLUXxjbN^U$=2YCG@T83@_# z^)~0y5IHJW2yyAC6C=Af!H#rIxX$Hnw-bG5gxx{RhDy&=x|ZruKb-gH*HTBR`T}AR z&=iN6A$p;oj2-d5MzyrK(0h;RghC3M+Z6+Y(x44^pO9PPc<0k3fCI9dkvo~YRO8!$ zDBLI3F&FiD6#*6rso}8IrwguoXN~n#4_+>q2QP6p!Un#we!a%UfYcy5L&c=-f{Qb& zdqlG>BqA3(g$h6n;1T(dLeM7;r4V2TjeP-GIHxuC@8T5*E9TV79d8$M`%j` z8fP|2{MPgUr)>{oz!j*!m0Ua3nFFI{V^;_a+k;c|1f_Z0o7~En_wxC$+$ST`#ePd( zlB-S|n=dIq5wd_6y+ibLh+AH~68QY`0p#5Li7;+HGSPA3Ge8f&NuRKWegadzT{1J& z9#<}feA<6$=>!t(Y8N~XE=BGvl-dS#aQd=n4NuoS!W*oRBQHQy^uH;_CFzNS*Aty< za1g^lYxNLaAa5qoxg3XF#KDojC*TkeMCd(eoPu~Mb)5(?PUr@L?~^L#0SV|oGaryG zX6ZwDbmmbi#L@W+kh@tF1;;;H#h`jtoT&%)q2XJB{Bu2s0gE(SAs~wP0?UT}03luF z(MHc{Z_nAwkztS7IN2v&huMS|pS%0{t&7hF_x;Qo`34rL?sffFB3`2E zD>wz+|7alCKz+1m`=I!1(dbo>^WZYWg}JtHe9b3F)f<7BB?TYLb8?tJg#JNTsQDE? zC9-F4Y~J}OGQ1=^9%tmxuFI?exdp`@8B$Rv@YX$Zy~7ye?SeHlQ7k$YYOR388xJ0h zqOqeCE-a+!Zv7nJic)4`Qs=zkQ;xD-?C1$krN6{|-~YSMyT2ao;maz1#W}j1pS9wX z1XqflDIGmV`{?zsl-99;Z#u2a&!e_1d7nLEd6j4#C3>NzDw=3L=0Z*e(`j%$2f#f=@dmIvWd(Tk0in_(qxN1p?Yak|C%?gY1hQ>WiH?UsO37q znp(DX2tAZgrHF(QI!XtXNRTSMD&WD;i^7qjB3K9@9fi;lM5HUIH1&X>p(7w70wO9c zR8cS?Dglzs8_#*~eCK=Lz4zUF-+Qw&*<~i#d-kkZ^RIucy%jz1kQ7|umv*j$VWh$^ ze$MMS3HSE|3JZYdH@$n3(pH|QA@_gBca2|lnYenMJT8N=@gUFlUg{Ef(~IUcF)^4a z?1YCVx+KN7DA{R-sn{y|n;Z1CmfJ-?%x!xY`~ykb2@bchHJ0i5lx|$J@KST?^ZNvx zM2d%sTe-e(fv*FnrQys-`3>RM684@)azn>20R2hEF6%%)nfb72MR`Al`#Y1&k0x}W z42H8hyKqwFX&au)7hawVFC4}~=(GsYyz*B)=#^_~z$A)2%kwmC4J!myQJ||1x7N3t zBBQ@zaHN6jKo;T6Qz9xhvS;Spm=dMnVPxu2U9J6n+3&Y%6|#9cF=g#B8%a@sg5{8}fipdjFv8$6hdg})IR~6sD{j3Ma z$`mE9+mMVFtjVLw=c-NB*Q4(99x{YWacnqUS6f(@L7(ccnMJ?QgsR488+iAh)Cf&udgexLpO?ul%(n-1!PDE#bMk1% znzx<P$VfF`S=+1}SzG$9G{>e_TCwt4ZSp7hi{?v&vx! ztAkM&$+hQ|ISx7;+BZaN_>d|#w7l@Fzd_;w0+S3YQ{^YO7_Yb`7nCQ2Y4^zI>e`yw zcs;6*f@iKRoUzg**(_DKKNv7p)?*-%Att_72|;Va^HAR(7iR zO;m|{@C1JjwbfWVOJHdV zBxj!Ddj1vgFp0t*{(7sF^G!Xw`chzgyy@*a`AVn9^Ru%}{w;g2Ah#OSsQAM9Uq7X! z&dT42)v10F;|t#9Rqjo-h~s9n7%Ut!-ZT5o=Ed<_^|dl=flQ(|{CjBeX@-0$v*e28 zkEy5m^Iwn(J-6jNtEhL6xYcTS!EE3-+b@?7q))wkMMpuNis*eF7w{W+U6JI=&U}%w zVhsE3M;0+@{gIpA)%w74Pkr=fLkRaBWgZ2wMo2f!6)qVH<2WAhI`Br=bLjxaW;m6d zM|pER+`rHbc(`e(jUWX2b`iuxB%!|JUt$4an*7tB25?F(1SHahZVc7Yk{BKof6O zsc0;H%(;2*E^ILt&ceYbWf%*`(_Y_mthCHk1Mtx@SJ`f-(l+NBF2)G%8Nv*yI=|a# z07JZwUWD2R#`piL+okarEd5j#rMJ#dkQ8XUbP!QOO7J#$qj=b`%a7E2>wMLSsTgP? zR|mNbL9qiPB4kTp-!80Q28S7uR94C+oFAJ3C%vW{p~%EyA!q__58y25da-~at~2r| z0fsmJuLdQc#-SfvVy_#I)XeKvxlpy^)6dl0F!Hnz=pHQ#2W)lUllS}r5($OiIe2%o6bj@lCn$-GHaw=d96E+Ot|={G9gA4BUbz7 z#46`3ZeVM;1um};<~qy^?j4{QslwO_`OPvT)zK~@ogsW9=Sv@T81A@vaMwC%Nyts? z!iu*6E@{Kh57JAPA&W_|*#g80oV5!y0nwq0is#4xu25H%*qeuFmBu4zEF?t<)%pO{ zq*|6IvI8{b(ix~Q_3~mQfA=WH36dBs0C%NO)8mM0DUO7%^U!_4J(j%PM_>UHsWt-ZhfNLVGju)L1@pY54$Ac6 zkk;SO9Jf)M-_r?sooC$gSk^ilZP1zog&NN9Lx&K*MI|@$1qnzr7kskCX}17BITtA% zKOxe!)rMFr`R=#cTT1EzC;_=gQWfJGSx@o$JG+X!wJG`=Z-m<>w(vvN65k$EBHWqt zc{2)Xx#=7hTF=jd$2s|rU_Vt$C6m)lolUGv!Y3{LBbiE@D0>tV*sc))zRhxu67#rN zsPe9hi~Uhyps4)Q0MhWBI>6DhCEJ2~*y96Xu}r+|Q|t*aMT$@Sv~d2x292YKSn{G* zg!s7AGr9z+Mli%NJMB#Of@#HmGyH6iI1ZUGiyzzj6S`r3LN~9auKz@Ge`mMDr;i@; z2RK<7X%I>9Kh-odE=cH9YSP9vVoa^cOA;_Ka`fQdJq|r*8`Q8HOjCU8JFTSpPiB{b z%I6|c8+#Pe03_bK6ir-SzJmQq#V#-VEYSzSddcHvbO5~%n0#Vjtlan=)iIPg3ueIl zn=-L8%}OelQLpbhyy~4mv1*fVy*A_ogz`5qeGM5TT>7oo>VVc1-r}s8eeeN-WROKhi?F?sbFPF_qwo`w zlYW?c<9Q>Q&mAw$xVolFn9CNt(W{S@>EuY0S5^0_Kb4ij5%VgD?Wzqd?}xr=>itOc zTo<2nB?Y+D@DHG0+H14@4Y2vv=P6tQgi3F7LJPaGyPR2adn1ndo#^_DbpKO0cN~#& zP0&%N2ZT*PU(!pKm$p$EJJ0Lpp|9mobkHo2)51s*ax`|mB1q3}{h5n$QbQlaUB*sd zhD@b6?(i$A6xU%P4qz9wa&Y9XZTdVUGE_D3>1U1FOt&+)iUV(_2MnF)JBAZiY!&Y0 zXO4TB(M78cmvnczVltnV-j0mGM<#f1=pGjeGWwAe%veU zFqQ{9Cd+g)%y*^%lVjV_Hd&Dv=ylNFZ@^TXyEsuRN&B3%2tQu8ZtZhJl#4weYvt8o zvY{cnFjM>v=#Y;d5O8R0iU7wFkpY^y4m5n&|3`@vky`trY+2t3OL9Axv~0}6^8z)* zjqoK1$GM_;(pe?>-L!lsP9xnl*7I0W=TOWw?Y$i4XWM3u7~N}b0*`NRy@>RQw-rns zGO;vC;dQo*EWb4xjzG(0eRH1UD1sYV6RhtKNNQ%nS;Tyr!Zr%WfB7^hre?s=<7jyF*ecFpDCeo7D(48F4 zi-_ELiq(OS@~d+ zas9sccfN=HoCiS{-ry4UX`LU>IB~@FyU#e7Gc%$4_;>a1==fn>?DEg!PIPnH^Zc#t z=Sj5f=fth;x)jKut{UWfAlE^Xb+sV>+kaw?YOEYh7N zSlZrtAy!XOjQFNnB#Z~mwnvVtHw;C zbyH}tEcuBr+D`FOX-}4>5Ny@wD`ZooM_(UYVvJ-!kNwMMs9x0QnW-YZ_2H-DM4jv1 z*tAbJ6Uw0~J%*o|l)Pmz<3QW0jK>adJo9)%g18_%h9f7K2Y^fbjB`*B#YJ^K zj4O+?jF_rn6M8hTx33NW{d^aR<)OH)RyE`WMbH<_BR>bRM!&#QAgH04&v{4!hCrD6M~|4eSVP3$ZZ zoR*pa?kUeK{#DQp3PKJ6`YTQyN6YG8ytGyyTDm!0L{I<77!g+;#!fjk6+f7r*qFTI zB1Y785J*n`@Fh&*`IqMWZty=|l<30C=2*m$ZT=~hFQJIjG3@;wBHwsrZExMDuMsj; z+D|Bjit%+Go@nt;bjW!8kw1asXy)tXAv3zxQtS`aI0cI5TI*7m#8|YOAsF@S+7DSH zOF`roXYW{vq``fD{=9=R!xMBpCg z*kD5mAb9e z!;!}@_AG=pR~5t4Fh#F1qt?}9Xf&&u%tL~DHJ7wvWkNLBJJBcIGS2nG2unD4g{q)4Xp%z05yMLzw+yH9pZ+eqZ(smy}ziF z{FP>7mPF<9fdhlA?n$r}&tf^+wrBp%N1lSOP$qioy%$0{!*f7JO6oH!*OAx4Se4v@ zl6d^vnEL{`A{n^u&p*}E^scwRe^&lFtBxX!*2@CU+8uksPk=p7V`Y6h#{-#-&&R zt4JU?SoLouCEj~T+BA^Q&7Nhy91D`Aja;W*PRl-}F5oC2!>m#ezqE)Li5$T4B>@I3 z%1_r`*6SXQ5VjzoOH?VZ}X55>!LQ8NjK*yWUlAk&R?Q1A+d)n zg$$|700EAbUZ78IVT*dZZ-+GQsOH(SM%J6o;@@^Tb*bIhg`uIZTNgJk6MMIab0t$n z^bkPUD??vtE}Qs%Z0pZ=azh&cKk>`HG6g0raDZU#=z0NkP5X-HUw?+l zZPfxJ$^$wB6u1kZEQoYKeJz1mQRDBH==`KZM_`4HUCRmHR{D~HCKsQ#UOk)23PXeHcI4*9NiDUq99yo2k4 zOp%ZjS3Pg8$5Z|@jveiG42lsuA8OKEfTcT5eLbEp1mL!))a&s_k?ks0 zI{ZKEYWH8E(~3QdAlX4Enn(*lZpkS)_R&$Ff#Al#VBrAz?Vop7qlI8M`LjxDMyC;F z$C}Ew6gdbs-PKViWe6tXy@eqtC<11oM8YYC?5Oz1FLz(WcSqre-{8S){1)T-x6;4O z3jWS5p75YQk;(D~+CPIljsH9=kjEW?-$s8Lt+p*beE!eXjbPIlVGuXNP#{mUGc3Fo z{s~?Hum)UzO$gvidV*q7Ihtzavly+Dm-I&e+^aeYl>aQ)lg^^yN* z0rLWK3yk;9BZ4eLLZaEYyG%N#4Xu-J9_^mU5fx8S+&4*5{h(KgysEWNkninOK9hd^ zisVoO4wlj=^CGMH`*GES{*6y9?^=3YNsNVscOAN9e@Eg3TPsE9L-6D^2Qd~reI6@9 a13aUYa_$y{2mTV80?<49D9B@X@;?CW8B%5d literal 0 HcmV?d00001 diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/common.css b/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/common.css index a2dd8790..d96aa2f7 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/common.css +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/common.css @@ -1,2 +1,2 @@ .fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3)}.theme-browser .theme .fs-premium-theme-badge-container{position:absolute;right:0;top:0}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge{position:relative;top:0;margin-top:10px;text-align:center}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-premium-theme-badge{font-size:1.1em}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-beta-theme-badge{background:#00a0d2}.fs-switch{position:relative;display:inline-block;color:#ccc;text-shadow:0 1px 1px rgba(255,255,255,0.8);height:18px;padding:6px 6px 5px 6px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);background:#ececec;box-shadow:0 0 4px rgba(0,0,0,0.1),inset 0 1px 3px 0 rgba(0,0,0,0.1);cursor:pointer}.fs-switch span{display:inline-block;width:35px;text-transform:uppercase}.fs-switch .fs-toggle{position:absolute;top:1px;width:37px;height:25px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.3);border-radius:4px;background:#fff;background-color:#fff;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #ececec), color-stop(1, #fff));background-image:-webkit-linear-gradient(top, #ececec, #fff);background-image:-moz-linear-gradient(top, #ececec, #fff);background-image:-ms-linear-gradient(top, #ececec, #fff);background-image:-o-linear-gradient(top, #ececec, #fff);background-image:linear-gradient(top, bottom, #ececec, #fff);box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.5);z-index:999;-moz-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-o-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-ms-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-webkit-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1)}.fs-switch.fs-off .fs-toggle{left:2%}.fs-switch.fs-on .fs-toggle{left:54%}.fs-switch.fs-round{top:8px;padding:4px 25px;-moz-border-radius:24px;-webkit-border-radius:24px;border-radius:24px}.fs-switch.fs-round .fs-toggle{top:0;width:24px;height:24px;-moz-border-radius:24px;-webkit-border-radius:24px;border-radius:24px}.fs-switch.fs-round.fs-off .fs-toggle{left:-1px}.fs-switch.fs-round.fs-on{background:#0085ba}.fs-switch.fs-round.fs-on .fs-toggle{left:25px}.fs-switch.fs-small.fs-round{padding:1px 19px}.fs-switch.fs-small.fs-round .fs-toggle{top:0;width:18px;height:18px;-moz-border-radius:18px;-webkit-border-radius:18px;border-radius:18px}.fs-switch.fs-small.fs-round.fs-on .fs-toggle{left:19px}.fs-switch-feedback{margin-left:10px}.fs-switch-feedback.success{color:#71ae00}.rtl .fs-switch-feedback{margin-left:0;margin-right:10px}#fs_frame{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}} -.fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("/wp-admin/images/wpspin_light-2x.gif");background-size:contain;margin-bottom:-2px}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{border:0;background-color:#d54e21;padding:10px;color:#f9f9f9;margin-top:10px} +.fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 1250px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("/wp-admin/images/wpspin_light-2x.gif");background-size:contain;margin-bottom:-2px}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{border:0;background-color:#d54e21;padding:10px;color:#f9f9f9;margin-top:10px} diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/connect.css b/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/connect.css index 43ac76c3..dff7c49c 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/connect.css +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/assets/css/admin/connect.css @@ -1 +1 @@ -#fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect.require-license-key .fs-sites-list-container td{cursor:pointer}#fs_connect #delegate_to_site_admins{margin-right:15px;float:right;height:26px;vertical-align:middle;line-height:37px;font-weight:bold;border-bottom:1px dashed;text-decoration:none}#fs_connect #delegate_to_site_admins.rtl{margin-left:15px;margin-right:0}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li .fs-switch{float:right}#fs_connect .fs-permissions ul li .fs-permission-description{margin-left:55px}#fs_connect .fs-permissions ul li .fs-permission-description span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li .fs-permission-description p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.fs-multisite-options-container{margin-top:10px;border:1px solid #ccc;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:bold}.fs-multisite-options-container.fs-apply-on-all-sites{border:0 none;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .fs-tooltip{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:rgba(0,0,0,0.8);color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl .fs-tooltip-trigger .fs-tooltip{text-align:right}.fs-tooltip-trigger .fs-tooltip::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:rgba(0,0,0,0.8) transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl .fs-tooltip-trigger .fs-tooltip::after{right:21px;left:auto}.fs-tooltip-trigger:hover .fs-tooltip{visibility:visible;opacity:1}#fs_marketing_optin{display:none;margin-top:10px;border:1px solid #ccc;padding:10px;line-height:1.5em}#fs_marketing_optin .fs-message{display:block;margin-bottom:5px;font-size:1.05em;font-weight:600}#fs_marketing_optin.error{border:1px solid #d3135a;background:#fee}#fs_marketing_optin.error .fs-message{color:#d3135a}#fs_marketing_optin .fs-input-container{margin-top:5px}#fs_marketing_optin .fs-input-container label{margin-top:5px;display:block}#fs_marketing_optin .fs-input-container label input{float:left;margin:1px 0 0 0}#fs_marketing_optin .fs-input-container label:first-child{display:block;margin-bottom:2px}#fs_marketing_optin .fs-input-label{display:block;margin-left:20px}#fs_marketing_optin .fs-input-label .underlined{text-decoration:underline}.rtl #fs_marketing_optin .fs-input-container label input{float:right}.rtl #fs_marketing_optin .fs-input-label{margin-left:0;margin-right:20px}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li .fs-permission-description{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li .fs-switch{float:left}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa} +#fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect.require-license-key .fs-sites-list-container td{cursor:pointer}#fs_connect #delegate_to_site_admins{margin-right:15px;float:right;height:26px;vertical-align:middle;line-height:37px;font-weight:bold;border-bottom:1px dashed;text-decoration:none}#fs_connect #delegate_to_site_admins.rtl{margin-left:15px;margin-right:0}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions>.fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li>i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li .fs-switch{float:right}#fs_connect .fs-permissions ul li .fs-permission-description{margin-left:55px}#fs_connect .fs-permissions ul li .fs-permission-description span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li .fs-permission-description p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{overflow:initial;height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.fs-multisite-options-container{margin-top:10px;border:1px solid #ccc;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:bold}.fs-multisite-options-container.fs-apply-on-all-sites{border:0 none;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .fs-tooltip{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:rgba(0,0,0,0.8);color:#fff !important;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:-17px;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left;text-transform:none !important}.rtl .fs-tooltip-trigger .fs-tooltip{text-align:right;left:auto;right:-17px}.fs-tooltip-trigger .fs-tooltip::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:rgba(0,0,0,0.8) transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl .fs-tooltip-trigger .fs-tooltip::after{right:21px;left:auto}.fs-tooltip-trigger:hover .fs-tooltip{visibility:visible;opacity:1}#fs_marketing_optin{display:none;margin-top:10px;border:1px solid #ccc;padding:10px;line-height:1.5em}#fs_marketing_optin .fs-message{display:block;margin-bottom:5px;font-size:1.05em;font-weight:600}#fs_marketing_optin.error{border:1px solid #d3135a;background:#fee}#fs_marketing_optin.error .fs-message{color:#d3135a}#fs_marketing_optin .fs-input-container{margin-top:5px}#fs_marketing_optin .fs-input-container label{margin-top:5px;display:block}#fs_marketing_optin .fs-input-container label input{float:left;margin:1px 0 0 0}#fs_marketing_optin .fs-input-container label:first-child{display:block;margin-bottom:2px}#fs_marketing_optin .fs-input-label{display:block;margin-left:20px}#fs_marketing_optin .fs-input-label .underlined{text-decoration:underline}.rtl #fs_marketing_optin .fs-input-container label input{float:right}.rtl #fs_marketing_optin .fs-input-label{margin-left:0;margin-right:20px}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li .fs-permission-description{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li .fs-switch{float:left}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}#license_issues_link{display:block;text-align:center;font-size:0.9em;margin-top:10px} diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-freemius.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-freemius.php index 07793601..dc03551f 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-freemius.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-freemius.php @@ -1,25326 +1,25364 @@ -store_id_slug_type_path_map( $module_id, $slug ); - } - - $this->_module_id = $module_id; - $this->_slug = $this->get_slug(); - $this->_module_type = $this->get_module_type(); - - $this->_blog_id = is_multisite() ? get_current_blog_id() : null; - - $this->_storage = FS_Storage::instance( $this->_module_type, $this->_slug ); - - $this->_cache = FS_Cache_Manager::get_manager( WP_FS___OPTION_PREFIX . "cache_{$module_id}" ); - - $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $this->get_unique_affix(), WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); - - $this->_plugin_main_file_path = $this->_find_caller_plugin_file( $is_init ); - $this->_plugin_dir_path = plugin_dir_path( $this->_plugin_main_file_path ); - $this->_plugin_basename = $this->get_plugin_basename(); - $this->_free_plugin_basename = str_replace( '-premium/', '/', $this->_plugin_basename ); - - $this->_is_multisite_integrated = ( - defined( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) && - ( true === constant( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) ) - ); - - $this->_is_network_active = ( - is_multisite() && - $this->_is_multisite_integrated && - // Themes are always network activated, but the ACTUAL activation is per site. - $this->is_plugin() && - ( - is_plugin_active_for_network( $this->_plugin_basename ) || - // Plugin network level activation or uninstall. - ( fs_is_network_admin() && is_plugin_inactive( $this->_plugin_basename ) ) - ) - ); - - $this->_storage->set_network_active( - $this->_is_network_active, - $this->is_delegated_connection() - ); - - if ( ! isset( $this->_storage->is_network_activated ) ) { - $this->_storage->is_network_activated = $this->_is_network_active; - } - - if ( $this->_storage->is_network_activated != $this->_is_network_active ) { - // Update last activation level. - $this->_storage->is_network_activated = $this->_is_network_active; - - $this->maybe_adjust_storage(); - } - - #region Migration - - if ( is_multisite() ) { - /** - * If the install_timestamp exists on the site level but doesn't exist on the - * network level storage, it means that we need to process the storage with migration. - * - * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, install_timestamp will be already set in the network level storage. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - if ( false === $this->_storage->get( 'install_timestamp', false, true ) && - false !== $this->_storage->get( 'install_timestamp', false, false ) - ) { - // Initiate storage migration. - $this->_storage->migrate_to_network(); - - // Migrate module cache to network level storage. - $this->_cache->migrate_to_network(); - } - } - - #endregion - - $base_name_split = explode( '/', $this->_plugin_basename ); - $this->_plugin_dir_name = $base_name_split[0]; - - if ( $this->_logger->is_on() ) { - $this->_logger->info( 'plugin_main_file_path = ' . $this->_plugin_main_file_path ); - $this->_logger->info( 'plugin_dir_path = ' . $this->_plugin_dir_path ); - $this->_logger->info( 'plugin_basename = ' . $this->_plugin_basename ); - $this->_logger->info( 'free_plugin_basename = ' . $this->_free_plugin_basename ); - $this->_logger->info( 'plugin_dir_name = ' . $this->_plugin_dir_name ); - } - - // Remember link between file to slug. - $this->store_file_slug_map(); - - // Store plugin's initial install timestamp. - if ( ! isset( $this->_storage->install_timestamp ) ) { - $this->_storage->install_timestamp = WP_FS__SCRIPT_START_TIME; - } - - if ( ! is_object( $this->_plugin ) ) { - $this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->get(); - } - - $this->_admin_notices = FS_Admin_Notices::instance( - $this->_slug . ( $this->is_theme() ? ':theme' : '' ), - /** - * Ensure that the admin notice will always have a title by using the stored plugin title if available and - * retrieving the title via the "get_plugin_name" method if there is no stored plugin title available. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - ( is_object( $this->_plugin ) ? $this->_plugin->title : $this->get_plugin_name() ), - $this->get_unique_affix() - ); - - if ( 'true' === fs_request_get( 'fs_clear_api_cache' ) || - fs_request_is_action( 'restart_freemius' ) - ) { - FS_Api::clear_cache(); - $this->_cache->clear(); - } - - $this->register_constructor_hooks(); - - /** - * Starting from version 2.0.0, `FS_Site` entities no longer have the `plan` property and have `plan_id` - * instead. This should be called before calling `_load_account()`, otherwise, `$this->_site` will not be - * loaded in `_load_account` for versions of SDK starting from 2.0.0. - * - * @author Leo Fajardo (@leorw) - */ - self::migrate_install_plan_to_plan_id( $this->_storage ); - - $this->_load_account(); - - $this->_version_updates_handler(); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - private function maybe_adjust_storage() { - $install_timestamp = null; - $prev_is_premium = null; - - $options_to_update = array(); - - $is_network_admin = fs_is_network_admin(); - - $network_install_timestamp = $this->_storage->get( 'install_timestamp', null, true ); - - if ( ! $is_network_admin ) { - if ( is_null( $network_install_timestamp ) ) { - // Plugin was not network-activated before. - return; - } - - if ( is_null( $this->_storage->get( 'install_timestamp', null, false ) ) ) { - // Set the `install_timestamp` only if it's not yet set. - $install_timestamp = $network_install_timestamp; - } - - $prev_is_premium = $this->_storage->get( 'prev_is_premium', null, true ); - } else { - $current_wp_user = self::_get_current_wp_user(); - $current_fs_user = self::_get_user_by_email( $current_wp_user->user_email ); - $network_user_info = array(); - - $skips_count = 0; - - $sites = self::get_sites(); - $sites_count = count( $sites ); - - $blog_id_2_install_map = array(); - - $is_first_non_ignored_blog = true; - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - $blog_install_timestamp = $this->_storage->get( 'install_timestamp', null, $blog_id ); - - if ( is_null( $blog_install_timestamp ) ) { - // Plugin has not been installed on this blog. - continue; - } - - $is_earlier_install = ( - ! is_null( $install_timestamp ) && - $blog_install_timestamp < $install_timestamp - ); - - $install = $this->get_install_by_blog_id( $blog_id ); - - $update_network_user_info = false; - - if ( ! is_object( $install ) ) { - if ( ! $this->_storage->get( 'is_anonymous', false, $blog_id ) ) { - // The opt-in decision (whether to skip or opt in) is yet to be made. - continue; - } - - $skips_count ++; - } else { - $blog_id_2_install_map[ $blog_id ] = $install; - - if ( empty( $network_user_info ) ) { - // Set the network user info for the 1st time. Choose any user information whether or not it is for the current WP user. - $update_network_user_info = true; - } - - if ( ! $update_network_user_info && - is_object( $current_fs_user ) && - $network_user_info['user_id'] != $current_fs_user->id && - $install->user_id == $current_fs_user->id - ) { - // If an install that is owned by the current WP user is found, use its user information instead. - $update_network_user_info = true; - } - - if ( ! $update_network_user_info && - $is_earlier_install && - ( ! is_object( $current_fs_user ) || $current_fs_user->id == $install->user_id ) - ) { - // Update to the earliest install info if there's no install found so far that is owned by the current WP user; OR only if the found install is owned by the current WP user. - $update_network_user_info = true; - } - } - - if ( $update_network_user_info ) { - $network_user_info = array( - 'user_id' => $install->user_id, - 'blog_id' => $blog_id - ); - } - - $site_prev_is_premium = $this->_storage->get( 'prev_is_premium', null, $blog_id ); - - if ( $is_first_non_ignored_blog ) { - $prev_is_premium = $site_prev_is_premium; - - if ( is_null( $network_install_timestamp ) ) { - $install_timestamp = $blog_install_timestamp; - } - - $is_first_non_ignored_blog = false; - - continue; - } - - if ( ! is_null( $prev_is_premium ) && $prev_is_premium !== $site_prev_is_premium ) { - // If a different `$site_prev_is_premium` value is found, do not include the option in the collection of options to update. - $prev_is_premium = null; - } - - if ( $is_earlier_install ) { - // If an earlier install timestamp is found. - $install_timestamp = $blog_install_timestamp; - } - } - - $installs_count = count( $blog_id_2_install_map ); - - if ( $sites_count === ( $installs_count + $skips_count ) ) { - if ( ! empty( $network_user_info ) ) { - $options_to_update['network_user_id'] = $network_user_info['user_id']; - $options_to_update['network_install_blog_id'] = $network_user_info['blog_id']; - - foreach ( $blog_id_2_install_map as $blog_id => $install ) { - if ( $install->user_id == $network_user_info['user_id'] ) { - continue; - } - - $this->_storage->store( 'is_delegated_connection', true, $blog_id ); - } - } - - if ( $sites_count === $skips_count ) { - /** - * Assume network-level skipping as the intended action if all actions identified were only - * skipping of the connection (i.e., no opt-ins and delegated connections so far). - */ - $options_to_update['is_anonymous_ms'] = true; - } else if ( $sites_count === $installs_count ) { - /** - * Assume network-level opt-in as the intended action if all actions identified were only opt-ins - * (i.e., no delegation and skipping of the connections so far). - */ - $options_to_update['is_network_connected'] = true; - } - } - } - - if ( ! is_null( $install_timestamp ) ) { - $options_to_update['install_timestamp'] = $install_timestamp; - } - - if ( ! is_null( $prev_is_premium ) ) { - $options_to_update['prev_is_premium'] = $prev_is_premium; - } - - if ( ! empty( $options_to_update ) ) { - $this->adjust_storage( $options_to_update, $is_network_admin ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param array $options - * @param bool $is_network_admin - */ - private function adjust_storage( $options, $is_network_admin ) { - foreach ( $options as $name => $value ) { - $this->_storage->store( $name, $value, $is_network_admin ? true : null ); - } - } - - /** - * Checks whether this module has a settings menu. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return bool - */ - function has_settings_menu() { - return ( $this->_is_network_active && fs_is_network_admin() ) ? - $this->_menu->has_network_menu() : - $this->_menu->has_menu(); - } - - /** - * If `true` the opt-in should be shown as a modal dialog box on the themes.php page. WordPress.org themes guidelines prohibit from redirecting the user from the themes.php page after activating a theme. - * - * @author Vova Feldman (@svovaf) - * @since 2.4.5 - * - * @return bool - */ - function show_opt_in_on_themes_page() { - if ( ! $this->is_free_wp_org_theme() ) { - return false; - } - - if ( ! $this->has_settings_menu() ) { - return true; - } - - return $this->show_settings_with_tabs(); - } - - /** - * If `true` the opt-in should be shown on the product's main setting page. - * - * @author Vova Feldman (@svovaf) - * @since 2.4.5 - * - * @return bool - * - * @uses show_opt_in_on_themes_page(); - */ - function show_opt_in_on_setting_page() { - return ! $this->show_opt_in_on_themes_page(); - } - - /** - * If `true` the settings should be shown using tabs. - * - * @author Vova Feldman (@svovaf) - * @since 2.4.5 - * - * @return bool - */ - function show_settings_with_tabs() { - return ( self::NAVIGATION_TABS === $this->_navigation ); - } - - /** - * Check if the context module is free wp.org theme. - * - * This method is helpful because: - * 1. wp.org themes are limited to a single submenu item, - * and sub-submenu items are most likely not allowed (never verified). - * 2. wp.org themes are not allowed to redirect the user - * after the theme activation, therefore, the agreed UX - * is showing the opt-in as a modal dialog box after - * activation (approved by @otto42, @emiluzelac, @greenshady, @grapplerulrich). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - */ - function is_free_wp_org_theme() { - return ( - $this->is_theme() && - $this->is_org_repo_compliant() && - ! $this->is_premium() - ); - } - - /** - * Checks whether this a submenu item is visible. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.6 - * @since 1.2.2.7 Even if the menu item was specified to be hidden, when it is the context page, then show the submenu item so the user will have the right context page. - * - * @param string $slug - * @param bool $is_tabs_visibility_check This is used to decide if the associated tab should be shown or hidden. - * - * @return bool - */ - function is_submenu_item_visible( $slug, $is_tabs_visibility_check = false ) { - if ( $this->is_admin_page( $slug ) ) { - /** - * It is the current context page, so show the submenu item - * so the user will have the right context page, even if it - * was set to hidden. - */ - return true; - } - - if ( ! $this->has_settings_menu() ) { - // No menu settings at all. - return false; - } - - if ( - ! $is_tabs_visibility_check && - $this->is_org_repo_compliant() && - $this->show_settings_with_tabs() - ) { - /** - * wp.org themes are limited to a single submenu item, and - * sub-submenu items are most likely not allowed (never verified). - */ - return false; - } - - return $this->_menu->is_submenu_item_visible( $slug ); - } - - /** - * Check if a Freemius page should be accessible via the UI. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @param string $slug - * - * @return bool - */ - function is_page_visible( $slug ) { - if ( $this->is_admin_page( $slug ) ) { - return true; - } - - return $this->_menu->is_submenu_item_visible( $slug, true, true ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - private function _version_updates_handler() { - if ( ! isset( $this->_storage->sdk_version ) || $this->_storage->sdk_version != $this->version ) { - // Freemius version upgrade mode. - $this->_storage->sdk_last_version = $this->_storage->sdk_version; - $this->_storage->sdk_version = $this->version; - - if ( empty( $this->_storage->sdk_last_version ) || - version_compare( $this->_storage->sdk_last_version, $this->version, '<' ) - ) { - $this->_storage->sdk_upgrade_mode = true; - $this->_storage->sdk_downgrade_mode = false; - } else { - $this->_storage->sdk_downgrade_mode = true; - $this->_storage->sdk_upgrade_mode = false; - - } - - $this->do_action( 'sdk_version_update', $this->_storage->sdk_last_version, $this->version ); - } - - $plugin_version = $this->get_plugin_version(); - if ( ! isset( $this->_storage->plugin_version ) || $this->_storage->plugin_version != $plugin_version ) { - // Plugin version upgrade mode. - $this->_storage->plugin_last_version = $this->_storage->plugin_version; - $this->_storage->plugin_version = $plugin_version; - - if ( empty( $this->_storage->plugin_last_version ) || - version_compare( $this->_storage->plugin_last_version, $plugin_version, '<' ) - ) { - $this->_storage->plugin_upgrade_mode = true; - $this->_storage->plugin_downgrade_mode = false; - } else { - $this->_storage->plugin_downgrade_mode = true; - $this->_storage->plugin_upgrade_mode = false; - } - - if ( ! empty( $this->_storage->plugin_last_version ) ) { - // Different version of the plugin was installed before, therefore it's an update. - $this->_storage->is_plugin_new_install = false; - } - - $this->do_action( 'plugin_version_update', $this->_storage->plugin_last_version, $plugin_version ); - } - } - - #-------------------------------------------------------------------------------- - #region Data Migration on SDK Update - #-------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.5 - * - * @param string $sdk_prev_version - * @param string $sdk_version - */ - function _sdk_version_update( $sdk_prev_version, $sdk_version ) { - /** - * @since 1.1.7.3 Fixed unwanted connectivity test cleanup. - */ - if ( empty( $sdk_prev_version ) ) { - return; - } - - if ( version_compare( $sdk_prev_version, '2.1.0', '<' ) && - version_compare( $sdk_version, '2.1.0', '>=' ) - ) { - $this->_storage->handle_gdpr_admin_notice = true; - } - - if ( version_compare( $sdk_prev_version, '2.0.0', '<' ) && - version_compare( $sdk_version, '2.0.0', '>=' ) - ) { - $this->migrate_to_subscriptions_collection(); - - $this->consolidate_licenses(); - - // Clear trial_plan since it's now loaded from the plans collection when needed. - $this->_storage->remove( 'trial_plan', true, false ); - } - - if ( version_compare( $sdk_prev_version, '1.2.3', '<' ) && - version_compare( $sdk_version, '1.2.3', '>=' ) - ) { - /** - * Starting from version 1.2.3, paths are stored as relative instead of absolute and some of them can be - * invalid. - * - * @author Leo Fajardo (@leorw) - */ - $this->remove_invalid_paths(); - } - - if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) && - version_compare( $sdk_version, '1.1.5', '>=' ) - ) { - // On version 1.1.5 merged connectivity and is_on data. - if ( isset( $this->_storage->connectivity_test ) ) { - if ( ! isset( $this->_storage->is_on ) ) { - unset( $this->_storage->connectivity_test ); - } else { - $connectivity_data = $this->_storage->connectivity_test; - $connectivity_data['is_active'] = $this->_storage->is_on['is_active']; - $connectivity_data['timestamp'] = $this->_storage->is_on['timestamp']; - - // Override. - $this->_storage->connectivity_test = $connectivity_data; - - // Remove previous structure. - unset( $this->_storage->is_on ); - } - - } - } - - if ( - version_compare( $sdk_prev_version, '2.2.1', '<' ) && - version_compare( $sdk_version, '2.2.1', '>=' ) - ) { - /** - * Clear the file cache without storing the previous path since it could be a wrong path. For example, - * in the versions of the SDK lower than 2.2.1, it's possible for the path of an add-on to be the same - * as the parent plugin's when the add-on was auto-installed since the relevant method names were not - * skipped in the logic that determines the right path in the `get_caller_main_file_and_type` method - * (e.g. `try_activate_plugin`). Since it was an auto-installation, the caller was the parent plugin - * and so its path was used. In case the stored path is wrong, clearing the cache will resolve issues - * related to data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin). - * - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - */ - $this->clear_module_main_file_cache( false ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param \FS_Storage $storage - * @param bool|int|null $blog_id - */ - private static function migrate_install_plan_to_plan_id( FS_Storage $storage, $blog_id = null ) { - if ( empty( $storage->sdk_version ) ) { - // New installation of the plugin, no need to upgrade. - return; - } - - if ( ! version_compare( $storage->sdk_version, '2.0.0', '<' ) ) { - // Previous version is >= 2.0.0, so no need to migrate. - return; - } - - // Alias. - $module_type = $storage->get_module_type(); - $module_slug = $storage->get_module_slug(); - - $installs = self::get_all_sites( $module_type, $blog_id ); - $install = isset( $installs[ $module_slug ] ) ? $installs[ $module_slug ] : null; - - if ( ! is_object( $install ) ) { - return; - } - - if ( isset( $install->plan ) && is_object( $install->plan ) ) { - if ( isset( $install->plan->id ) && ! empty( $install->plan->id ) ) { - $install->plan_id = self::_decrypt( $install->plan->id ); - } - - unset( $install->plan ); - - $installs[ $module_slug ] = clone $install; - - self::set_account_option_by_module( - $module_type, - 'sites', - $installs, - true, - $blog_id - ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - */ - private function migrate_to_subscriptions_collection() { - if ( ! is_object( $this->_site ) ) { - return; - } - - if ( isset( $this->_storage->subscription ) && is_object( $this->_storage->subscription ) ) { - $this->_storage->subscriptions = array( fs_get_entity( $this->_storage->subscription, FS_Subscription::get_class_name() ) ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - */ - private function consolidate_licenses() { - $plugin_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_PLUGIN ); - if ( isset( $plugin_licenses[ $this->_slug ] ) ) { - $plugin_licenses = $plugin_licenses[ $this->_slug ]; - } else { - $plugin_licenses = array(); - } - - $theme_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_THEME ); - if ( isset( $theme_licenses[ $this->_slug ] ) ) { - $theme_licenses = $theme_licenses[ $this->_slug ]; - } else { - $theme_licenses = array(); - } - - if ( empty( $plugin_licenses ) && empty( $theme_licenses ) ) { - return; - } - - $all_licenses = array(); - $user_id_license_ids_map = array(); - - foreach ( $plugin_licenses as $user_id => $user_licenses ) { - if ( is_array( $user_licenses ) ) { - if ( ! isset( $user_license_ids[ $user_id ] ) ) { - $user_id_license_ids_map[ $user_id ] = array(); - } - - foreach ( $user_licenses as $user_license ) { - $all_licenses[] = $user_license; - $user_id_license_ids_map[ $user_id ][] = $user_license->id; - } - } - } - - foreach ( $theme_licenses as $user_id => $user_licenses ) { - if ( is_array( $user_licenses ) ) { - if ( ! isset( $user_license_ids[ $user_id ] ) ) { - $user_id_license_ids_map[ $user_id ] = array(); - } - - foreach ( $user_licenses as $user_license ) { - $all_licenses[] = $user_license; - $user_id_license_ids_map[ $user_id ][] = $user_license->id; - } - } - } - - self::store_user_id_license_ids_map( - $user_id_license_ids_map, - $this->_module_id - ); - - $this->_store_licenses( true, $this->_module_id, $all_licenses ); - } - - /** - * Remove invalid paths. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - */ - private function remove_invalid_paths() { - // Remove invalid path that is still associated with the current slug if there's any. - $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() ); - foreach ( $file_slug_map as $plugin_basename => $slug ) { - if ( $slug === $this->_slug && - $plugin_basename !== $this->_plugin_basename && - ! file_exists( $this->get_absolute_path( $plugin_basename ) ) - ) { - unset( $file_slug_map[ $plugin_basename ] ); - self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true ); - - break; - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @param string $plugin_prev_version - * @param string $plugin_version - */ - function _after_version_update( $plugin_prev_version, $plugin_version ) { - if ( $this->is_theme() ) { - // Expire the cache of the previous tabs since the theme may - // have setting updates. - $this->_cache->expire( 'tabs' ); - $this->_cache->expire( 'tabs_stylesheets' ); - } - } - - /** - * A special migration logic for the $_accounts, executed for all the plugins in the system: - * - Moves some data to the network level storage. - * - If the plugin's connection was skipped for all sites, set the plugin as if it was network skipped. - * - If the plugin's connection was ignored for all sites, don't do anything in terms of the network connection. - * - If the plugin was connected to all sites by the same super-admin, set the plugin as if was network opted-in for all sites. - * - If there's at least one site that was connected by a super-admin, find the "main super-admin" (the one that installed the majority of the plugin installs) and set the plugin as if was network activated with the main super-admin, set all the sites that were skipped or opted-in with a different user to delegated mode. Then, prompt the currently logged super-admin to choose what to do with the ignored sites. - * - If there are any sites in the network which the connection decision was not yet taken for, set this plugin into network activation mode so a super-admin can choose what to do with the rest of the sites. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - private static function migrate_accounts_to_network() { - $sites = self::get_sites(); - $sites_count = count( $sites ); - $connection_status = array(); - $plugin_slugs = array(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - self::$_accounts->migrate_to_network( $blog_id ); - - /** - * Build a list of all Freemius powered plugins slugs. - */ - $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array(), $blog_id ); - foreach ( $id_slug_type_path_map as $module_id => $data ) { - if ( WP_FS__MODULE_TYPE_PLUGIN === $data['type'] ) { - $plugin_slugs[ $data['slug'] ] = true; - } - } - - $installs = self::get_account_option( 'sites', WP_FS__MODULE_TYPE_PLUGIN, $blog_id ); - - if ( is_array( $installs ) ) { - foreach ( $installs as $slug => $install ) { - if ( ! isset( $connection_status[ $slug ] ) ) { - $connection_status[ $slug ] = array(); - } - - if ( is_object( $install ) && - FS_Site::is_valid_id( $install->id ) && - FS_User::is_valid_id( $install->user_id ) - ) { - $connection_status[ $slug ][ $blog_id ] = $install->user_id; - } - } - } - } - - foreach ( $plugin_slugs as $slug => $true ) { - if ( ! isset( $connection_status[ $slug ] ) ) { - $connection_status[ $slug ] = array(); - } - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - if ( isset( $connection_status[ $slug ][ $blog_id ] ) ) { - continue; - } - - $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug ); - - $is_anonymous = $storage->get( 'is_anonymous', null, $blog_id ); - - if ( ! is_null( $is_anonymous ) ) { - // Since 1.1.3 is_anonymous is an array. - if ( is_array( $is_anonymous ) && isset( $is_anonymous['is'] ) ) { - $is_anonymous = $is_anonymous['is']; - } - - if ( is_bool( $is_anonymous ) && true === $is_anonymous ) { - $connection_status[ $slug ][ $blog_id ] = 'skipped'; - } - } - - if ( ! isset( $connection_status[ $slug ][ $blog_id ] ) ) { - $connection_status[ $slug ][ $blog_id ] = 'ignored'; - } - } - } - - $super_admins = array(); - - foreach ( $connection_status as $slug => $blogs_status ) { - $skips = 0; - $ignores = 0; - $connections = 0; - $opted_in_users = array(); - $opted_in_super_admins = array(); - - $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug ); - - foreach ( $blogs_status as $blog_id => $status_or_user_id ) { - if ( 'skipped' === $status_or_user_id ) { - $skips ++; - } else if ( 'ignored' === $status_or_user_id ) { - $ignores ++; - } else if ( FS_User::is_valid_id( $status_or_user_id ) ) { - $connections ++; - - if ( ! isset( $opted_in_users[ $status_or_user_id ] ) ) { - $opted_in_users[ $status_or_user_id ] = array(); - } - - $opted_in_users[ $status_or_user_id ][] = $blog_id; - - if ( isset( $super_admins[ $status_or_user_id ] ) || - self::is_super_admin( $status_or_user_id ) - ) { - // Cache super-admin data. - $super_admins[ $status_or_user_id ] = true; - - // Remember opted-in super-admins for the plugin. - $opted_in_super_admins[ $status_or_user_id ] = true; - } - } - } - - $main_super_admin_user_id = null; - $all_migrated = false; - if ( $sites_count == $skips ) { - // All sites were skipped -> network skip by copying the anonymous mode from any of the sites. - $storage->is_anonymous_ms = $storage->is_anonymous; - - $all_migrated = true; - } else if ( $sites_count == $ignores ) { - // Don't do anything, still in activation mode. - - $all_migrated = true; - } else if ( 0 < count( $opted_in_super_admins ) ) { - // Find the super-admin with the majority of installs. - $max_installs_by_super_admin = 0; - foreach ( $opted_in_super_admins as $user_id => $true ) { - $installs_count = count( $opted_in_users[ $user_id ] ); - - if ( $installs_count > $max_installs_by_super_admin ) { - $max_installs_by_super_admin = $installs_count; - $main_super_admin_user_id = $user_id; - } - } - - if ( $sites_count == $connections && 1 == count( $opted_in_super_admins ) ) { - // Super-admin opted-in for all sites in the network. - $storage->is_network_connected = true; - - $all_migrated = true; - } - - // Store network user. - $storage->network_user_id = $main_super_admin_user_id; - - $storage->network_install_blog_id = ( $sites_count == $connections ) ? - // Since all sites are opted-in, associating with the main site. - get_current_blog_id() : - // Associating with the 1st found opted-in site. - $opted_in_users[ $main_super_admin_user_id ][0]; - - /** - * Make sure we migrate the plan ID of the network install, otherwise, if after the migration - * the 1st page that will be loaded is the network level WP Admin and $storage->network_install_blog_id - * is different than the main site of the network, the $this->_site will not be set since the plan_id - * will be empty. - */ - $storage->migrate_to_network(); - self::migrate_install_plan_to_plan_id( $storage, $storage->network_install_blog_id ); - } else { - // At least one opt-in. All the opt-in were created by a non-super-admin. - if ( 0 == $ignores ) { - // All sites were opted-in or skipped, all by non-super-admin. So delegate all. - $storage->store( 'is_delegated_connection', true, true ); - - $all_migrated = true; - } - } - - if ( ! $all_migrated ) { - /** - * Delegate all sites that were: - * 1) Opted-in by a user that is NOT the main-super-admin. - * 2) Skipped and non of the sites was opted-in by a super-admin. If any site was opted-in by a super-admin, there will be a main-super-admin, and we consider the skip as if it was done by that user. - */ - foreach ( $blogs_status as $blog_id => $status_or_user_id ) { - if ( $status_or_user_id == $main_super_admin_user_id ) { - continue; - } - - if ( FS_User::is_valid_id( $status_or_user_id ) || - ( 'skipped' === $status_or_user_id && is_null( $main_super_admin_user_id ) ) - ) { - $storage->store( 'is_delegated_connection', true, $blog_id ); - } - } - } - - - if ( ( $connections + $skips > 0 ) ) { - if ( $ignores > 0 ) { - /** - * If admin already opted-in or skipped in any of the network sites, and also - * have sites which the connection decision was not yet taken, set this plugin - * into network activation mode so the super-admin can choose what to do with - * the rest of the sites. - */ - self::set_network_upgrade_mode( $storage ); - } - } - } - } - - /** - * Set a module into network upgrade mode. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_Storage $storage - * - * @return bool - */ - private static function set_network_upgrade_mode( FS_Storage $storage ) { - return $storage->is_network_activation = true; - } - - /** - * Will return true after upgrading to the SDK with the network level integration, - * when the super-admin involvement is required regarding the rest of the sites. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return bool - */ - function is_network_upgrade_mode() { - return $this->_storage->get( 'is_network_activation' ); - } - - /** - * Clear flag after the upgrade mode completion. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return bool True if network activation was on and now completed. - */ - private function network_upgrade_mode_completed() { - if ( fs_is_network_admin() && $this->is_network_upgrade_mode() ) { - $this->_storage->remove( 'is_network_activation' ); - - return true; - } - - return false; - } - - #endregion - - /** - * This action is connected to the 'plugins_loaded' hook and helps to determine - * if this is a new plugin installation or a plugin update. - * - * There are 3 different use-cases: - * 1) New plugin installation right with Freemius: - * 1.1 _activate_plugin_event_hook() will be executed first - * 1.2 Since $this->_storage->is_plugin_new_install is not set, - * and $this->_storage->plugin_last_version is not set, - * $this->_storage->is_plugin_new_install will be set to TRUE. - * 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will - * be already set to TRUE. - * - * 2) Plugin update, didn't have Freemius before, and now have the SDK: - * 2.1 _activate_plugin_event_hook() will not be executed, because - * the activation hook do NOT fires on updates since WP 3.1. - * 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will - * be empty, therefore, it will be set to FALSE. - * - * 3) Plugin update, had Freemius in prev version as well: - * 3.1 _version_updates_handler() will be executed 1st, since FS was installed - * before, $this->_storage->plugin_last_version will NOT be empty, - * therefore, $this->_storage->is_plugin_new_install will be set to FALSE. - * 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is - * already set, therefore, it will not be modified. - * - * Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9. - * - * NOTE: - * The only fallback of this mechanism is if an admin updates a plugin based on use-case #2, - * and then, the next immediate PageView is the plugin's main settings page, it will not - * show the opt-in right away. The reason it will happen is because Freemius execution - * will be turned off till the plugin is fully loaded at least once - * (till $this->_storage->was_plugin_loaded is TRUE). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9 - * - */ - function _plugins_loaded() { - // Update flag that plugin was loaded with Freemius at least once. - $this->_storage->was_plugin_loaded = true; - - /** - * Bug fix - only set to false when it's a plugin, due to the - * execution sequence of the theme hooks and our methods, if - * this will be set for themes, Freemius will always assume - * it's a theme update. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.2 - */ - if ( $this->is_plugin() && - ! isset( $this->_storage->is_plugin_new_install ) - ) { - $this->_storage->is_plugin_new_install = ( - ! is_plugin_active( $this->_plugin_basename ) && - empty( $this->_storage->plugin_last_version ) - ); - } - } - - /** - * Add special parameter to WP admin AJAX calls so when we - * process AJAX calls we can identify its source properly. - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - */ - static function _enrich_ajax_url() { - $admin_param = is_network_admin() ? - '_fs_network_admin' : - '_fs_blog_admin'; - ?> - - - - _logger->entrance(); - - if ( is_admin() ) { - add_action( 'admin_init', array( &$this, '_hook_action_links_and_register_account_hooks' ) ); - - if ( $this->is_plugin() ) { - if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) { - /** - * Unless the `fs_allow_updater_and_dialog` URL param exists and its value is `true`, make - * Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) - * so that they won't interfere with the .org plugins' functionalities on that page (e.g. - * updating of a .org plugin). - */ - add_filter( 'site_transient_update_plugins', array( 'Freemius', '_remove_fs_updates_from_plugin_install_page' ), 10, 2 ); - } else if ( self::is_plugins_page() || self::is_updates_page() ) { - /** - * On the "Plugins" and "Updates" admin pages, if there are premium or non–org-compliant plugins, modify their details dialog URLs (add a Freemius-specific param) so that the SDK can determine if the plugin information dialog should show information from Freemius. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - add_action( 'admin_footer', array( 'Freemius', '_prepend_fs_allow_updater_and_dialog_flag_url_param' ) ); - } - - $plugin_dir = dirname( $this->_plugin_dir_path ) . '/'; - - /** - * @since 1.2.2 - * - * Hook to both free and premium version activations to support - * auto deactivation on the other version activation. - */ - register_activation_hook( - $plugin_dir . $this->_free_plugin_basename, - array( &$this, '_activate_plugin_event_hook' ) - ); - - register_activation_hook( - $plugin_dir . $this->premium_plugin_basename(), - array( &$this, '_activate_plugin_event_hook' ) - ); - } else { - add_action( 'after_switch_theme', array( &$this, '_activate_theme_event_hook' ), 10, 2 ); - - add_action( 'admin_footer', array( &$this, '_style_premium_theme' ) ); - } - - /** - * Part of the mechanism to identify new plugin install vs. plugin update. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9 - */ - if ( empty( $this->_storage->was_plugin_loaded ) ) { - /** - * During the plugin activation (not theme), 'plugins_loaded' will be already executed - * when the logic gets here since the activation logic first add the activate plugins, - * then triggers 'plugins_loaded', and only then include the code of the plugin that - * is activated. Which means that _plugins_loaded() will NOT be executed during the - * plugin activation, and that IS intentional. - * - * @author Vova Feldman (@svovaf) - */ - if ( $this->is_plugin() && - $this->is_activation_mode( false ) && - 0 == did_action( 'plugins_loaded' ) - ) { - add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) ); - } else { - // If was activated before, then it was already loaded before. - $this->_plugins_loaded(); - } - } - - if ( ! self::is_ajax() ) { - if ( ! $this->is_addon() ) { - add_action( 'init', array( &$this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY ); - } - } - - if ( $this->_storage->handle_gdpr_admin_notice ) { - add_action( 'init', array( &$this, '_maybe_show_gdpr_admin_notice' ) ); - } - - add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') ); - add_action( 'init', array( &$this, '_maybe_add_pricing_ajax_handler' ) ); - } - - if ( $this->is_plugin() ) { - if ( $this->_is_network_active ) { - add_action( 'wpmu_new_blog', array( $this, '_after_new_blog_callback' ), 10, 6 ); - } - - register_deactivation_hook( $this->_plugin_main_file_path, array( &$this, '_deactivate_plugin_hook' ) ); - } - - if ( is_multisite() ) { - add_action( 'deactivate_blog', array( &$this, '_after_site_deactivated_callback' ) ); - add_action( 'archive_blog', array( &$this, '_after_site_deactivated_callback' ) ); - add_action( 'make_spam_blog', array( &$this, '_after_site_deactivated_callback' ) ); - add_action( 'deleted_blog', array( &$this, '_after_site_deleted_callback' ), 10, 2 ); - - add_action( 'activate_blog', array( &$this, '_after_site_reactivated_callback' ) ); - add_action( 'unarchive_blog', array( &$this, '_after_site_reactivated_callback' ) ); - add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) ); - } - - if ( $this->is_theme() && - self::is_customizer() && - $this->apply_filters( 'show_customizer_upsell', true ) - ) { - // Register customizer upsell. - add_action( 'customize_register', array( &$this, '_customizer_register' ) ); - } - - add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY ); - - if ( $this->is_theme() && ! $this->is_migration() ) { - add_action( 'admin_init', array( &$this, '_add_tracking_links' ) ); - } - - add_action( 'admin_init', array( &$this, '_add_license_activation' ) ); - add_action( 'admin_init', array( &$this, '_add_premium_version_upgrade_selection' ) ); - add_action( 'admin_init', array( &$this, '_add_beta_mode_update_handler' ) ); - add_action( 'admin_init', array( &$this, '_add_user_change_option' ) ); - - $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) ); - $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) ); - $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) ); - $this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) ); - - if ( $this->_is_network_active && fs_is_network_admin() ) { - $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) ); - } - - $this->add_ajax_action( 'install_premium_version', array( - &$this, - '_install_premium_version_ajax_action' - ) ); - - $this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) ); - - $this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) ); - - $this->add_action( 'sdk_version_update', array( &$this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 ); - - $this->add_action( - 'plugin_version_update', - array( &$this, '_after_version_update' ), - WP_FS__DEFAULT_PRIORITY, - 2 - ); - $this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) ); - - add_action( 'admin_init', array( &$this, '_add_trial_notice' ) ); - add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) ); - add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) ); - - /** - * Handle request to reset anonymous mode for `get_reconnect_url()`. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - */ - if ( fs_request_is_action( 'reset_anonymous_mode' ) && - $this->get_unique_affix() === fs_request_get( 'fs_unique_affix' ) - ) { - add_action( 'admin_init', array( &$this, 'connect_again' ) ); - } - } - - /** - * Register the required hooks right after the settings parse is completed. - * - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - */ - private function register_after_settings_parse_hooks() { - if ( is_admin() && - $this->is_theme() && - $this->is_premium() && - ! $this->has_active_valid_license() - ) { - $this->add_ajax_action( - 'delete_theme_update_data', - array( &$this, '_delete_theme_update_data_action' ) - ); - } - - if ( $this->show_settings_with_tabs() ) { - /** - * Include the required hooks to capture the theme settings' page tabs - * and cache them. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - */ - if ( ! $this->_cache->has_valid( 'tabs' ) ) { - add_action( 'admin_footer', array( &$this, '_tabs_capture' ) ); - // Add license activation AJAX callback. - $this->add_ajax_action( 'store_tabs', array( &$this, '_store_tabs_ajax_action' ) ); - - add_action( 'admin_enqueue_scripts', array( &$this, '_store_tabs_styles' ), 9999999 ); - } - - add_action( - 'admin_footer', - array( &$this, '_add_freemius_tabs' ), - /** - * The tabs JS code must be executed after the tabs capture logic (_tabs_capture()). - * That's why the priority is 11 while the tabs capture logic is added - * with priority 10. - * - * @author Vova Feldman (@svovaf) - */ - 11 - ); - } - - if ( ! self::is_ajax() ) { - if ( ! $this->is_addon() || $this->is_only_premium() ) { - add_action( - ( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', - array( &$this, '_prepare_admin_menu' ), - WP_FS__LOWEST_PRIORITY - ); - } - } - } - - /** - * Makes Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) so that - * they won't interfere with the .org plugins' functionalities on that page (e.g. updating of a .org plugin). - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - * - * @param object $updates - * @param string|null $transient - * - * @return object - */ - static function _remove_fs_updates_from_plugin_install_page( $updates, $transient = null ) { - if ( is_object( $updates ) && isset( $updates->response ) ) { - foreach ( $updates->response as $file => $plugin ) { - if ( isset( $plugin->package ) && false !== strpos( $plugin->package, 'api.freemius' ) ) { - unset( $updates->response[ $file ] ); - } - } - } - - return $updates; - } - - /** - * Prepends the `fs_allow_updater_and_dialog` param to the plugin information URLs to tell the SDK to handle - * the information that is shown on the plugin details dialog that is shown when the relevant link is clicked. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - * - * @return string - */ - static function _prepend_fs_allow_updater_and_dialog_flag_url_param() { - $slug_basename_map = array(); - foreach ( self::$_instances as $instance ) { - if ( ! $instance->is_plugin() ) { - continue; - } - - $slug_basename_map[ $instance->get_slug() ] = $instance->premium_plugin_basename(); - } - ?> - - is_beta() ) { - $has_any_beta_version = true; - break; - } - } - - if ( $has_any_beta_version ) { - fs_enqueue_local_style( 'fs_plugins', '/admin/plugins.css' ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - static function _maybe_add_beta_label_to_plugins_and_handle_confirmation() { - $beta_data = array(); - - foreach ( self::$_instances as $instance ) { - if ( ! $instance->is_premium() ) { - continue; - } - - /** - * If there's an available beta version update, a confirmation message will be shown when the - * "Update now" link on the "Plugins" or "Themes" page is clicked. - */ - $has_beta_update = $instance->has_beta_update(); - - $is_beta = ( - // The "Beta" label is added separately for themes. - $instance->is_plugin() && - $instance->is_beta() - ); - - if ( ! $is_beta && ! $has_beta_update ) { - continue; - } - - $beta_data[ $instance->get_plugin_basename() ] = array( 'is_installed_version_beta' => $is_beta ); - - if ( ! $has_beta_update ) { - continue; - } - - $beta_data[ $instance->get_plugin_basename() ]['beta_version_update_confirmation_message'] = sprintf( - '%s %s', - sprintf( - fs_esc_attr_inline( - 'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.', - 'beta-version-update-caution', - $instance->get_slug() - ), - $instance->get_plugin_title() - ), - fs_esc_attr_inline( 'Would you like to proceed with the update?', 'update-confirmation', $instance->get_slug() ) - ); - } - - if ( empty( $beta_data ) ) { - return; - } - ?> - - _free_plugin_basename ] ); - unset( $uninstallable_plugins[ $this->premium_plugin_basename() ] ); - - update_option( 'uninstall_plugins', $uninstallable_plugins ); - } - - /** - * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates. - * - * @param bool $store_prev_path - */ - private function clear_module_main_file_cache( $store_prev_path = true ) { - if ( ! isset( $this->_storage->plugin_main_file ) || - empty( $this->_storage->plugin_main_file->path ) - ) { - return; - } - - if ( ! $store_prev_path ) { - /** - * Storing the previous path is not needed when clearing the cache after an SDK version update since - * the main purpose of the cache clearing in that event is to correct a wrong plugin main file path - * which causes data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin). - * - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - */ - unset( $this->_storage->plugin_main_file->path ); - } else { - $plugin_main_file = clone $this->_storage->plugin_main_file; - - // Store cached path (2nd layer cache). - $plugin_main_file->prev_path = $plugin_main_file->path; - - // Clear cached path. - unset( $plugin_main_file->path ); - - $this->_storage->plugin_main_file = $plugin_main_file; - } - - /** - * Clear global cached path. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map' ); - unset( $id_slug_type_path_map[ $this->_module_id ]['path'] ); - self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - */ - function _hook_action_links_and_register_account_hooks() { - if ( $this->is_migration() ) { - return; - } - - $this->_add_tracking_links(); - - if ( self::is_plugins_page() && $this->is_plugin() ) { - $this->hook_plugin_action_links(); - } - - $this->_register_account_hooks(); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - private function _register_account_hooks() { - if ( ! is_admin() ) { - return; - } - - /** - * Always show the deactivation feedback form since we added - * automatic free version deactivation upon premium code activation. - * - * @since 1.2.1.6 - */ - $this->add_ajax_action( - 'submit_uninstall_reason', - array( &$this, '_submit_uninstall_reason_action' ) - ); - - $this->add_ajax_action( - 'cancel_subscription_or_trial', - array( &$this, 'cancel_subscription_or_trial_ajax_action' ) - ); - - if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) { - if ( ( $this->is_plugin() && self::is_plugins_page() ) || - ( $this->is_theme() && self::is_themes_page() ) - ) { - add_action( 'admin_footer', array( &$this, '_add_deactivation_feedback_dialog_box' ) ); - } - } - } - - /** - * Leverage backtrace to find caller plugin file path. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param bool $is_init Is initiation sequence. - * - * @return string - */ - private function _find_caller_plugin_file( $is_init = false ) { - // Try to load the cached value of the file path. - if ( isset( $this->_storage->plugin_main_file ) ) { - $plugin_main_file = $this->_storage->plugin_main_file; - if ( ! empty( $plugin_main_file->path ) ) { - $absolute_path = $this->get_absolute_path( $plugin_main_file->path ); - if ( file_exists( $absolute_path ) ) { - return $absolute_path; - } - } - } - - /** - * @since 1.2.1 - * - * `clear_module_main_file_cache()` is clearing the plugin's cached path on - * deactivation. Therefore, if any plugin/theme was initiating `Freemius` - * with that plugin's slug, it was overriding the empty plugin path with a wrong path. - * - * So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path` - * when the class instantiator isn't the module. - */ - if ( ! $is_init ) { - // Fetch prev path cache. - if ( isset( $this->_storage->plugin_main_file ) && - ! empty( $this->_storage->plugin_main_file->prev_path ) - ) { - $absolute_path = $this->get_absolute_path( $this->_storage->plugin_main_file->prev_path ); - if ( file_exists( $absolute_path ) ) { - return $absolute_path; - } - } - - wp_die( - $this->get_text_inline( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'failed-finding-main-path' ) . - " Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";", - $this->get_text_inline( 'Error', 'error' ), - array( 'back_link' => true ) - ); - } - - /** - * @since 1.2.1 - * - * Only the original instantiator that calls dynamic_init can modify the module's path. - */ - // Find caller module. - $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); - $this->_storage->plugin_main_file = (object) array( - 'path' => $id_slug_type_path_map[ $this->_module_id ]['path'], - ); - - return $this->get_absolute_path( $id_slug_type_path_map[ $this->_module_id ]['path'] ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - * - * @param string $path - * - * @return string - */ - private function get_relative_path( $path ) { - $module_root_dir = $this->get_module_root_dir_path(); - if ( 0 === strpos( $path, $module_root_dir ) ) { - $path = substr( $path, strlen( $module_root_dir ) ); - } - - return $path; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - * - * @param string $path - * @param string|bool $module_type - * - * @return string - */ - private function get_absolute_path( $path, $module_type = false ) { - $module_root_dir = $this->get_module_root_dir_path( $module_type ); - if ( 0 !== strpos( $path, $module_root_dir ) ) { - $path = fs_normalize_path( $module_root_dir . $path ); - } - - return $path; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - * - * @param string|bool $module_type - * - * @return string - */ - private function get_module_root_dir_path( $module_type = false ) { - $is_plugin = empty( $module_type ) ? - $this->is_plugin() : - ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ); - - return fs_normalize_path( trailingslashit( $is_plugin ? - WP_PLUGIN_DIR : - get_theme_root( get_stylesheet() ) ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * - * @param number $module_id - * @param string $slug - * - * @since 1.2.2 - */ - private function store_id_slug_type_path_map( $module_id, $slug ) { - $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); - - $store_option = false; - - if ( ! isset( $id_slug_type_path_map[ $module_id ] ) ) { - $id_slug_type_path_map[ $module_id ] = array( - 'slug' => $slug - ); - - $store_option = true; - } else if ( - isset( $id_slug_type_path_map[ $module_id ]['slug'] ) && - $slug !== $id_slug_type_path_map[ $module_id ]['slug'] - ) { - $id_slug_type_path_map[ $module_id ]['slug'] = $slug; - $store_option = true; - } - - if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) || - /** - * This verification is for cases when suddenly the same module - * is installed but with a different folder name. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.3 - */ - ! file_exists( $this->get_absolute_path( - $id_slug_type_path_map[ $module_id ]['path'], - $id_slug_type_path_map[ $module_id ]['type'] - ) ) - ) { - $caller_main_file_and_type = $this->get_caller_main_file_and_type(); - - $id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type; - $id_slug_type_path_map[ $module_id ]['path'] = $caller_main_file_and_type->path; - - $store_option = true; - } - - if ( $store_option ) { - self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true ); - } - } - - /** - * Identifies the caller type: plugin or theme. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.3 Find the earliest module in the call stack that calls to the SDK. This fix is for cases when - * add-ons are relying on loading the SDK from the parent module, and also allows themes including the - * SDK an internal file instead of directly from functions.php. - * @since 1.2.1.7 Knows how to handle cases when an add-on includes the parent module logic. - */ - private function get_caller_main_file_and_type() { - self::require_plugin_essentials(); - - $all_plugins = fs_get_plugins( true ); - $all_plugins_paths = array(); - - // Get active plugin's main files real full names (might be symlinks). - foreach ( $all_plugins as $relative_path => $data ) { - if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) { - /** - * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they - * can't really include the SDK. - * - * @author Vova Feldman - * @since 1.2.1.7 - */ - continue; - } - - $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) ); - } - - $caller_file_candidate = false; - $caller_map = array(); - $module_type = WP_FS__MODULE_TYPE_PLUGIN; - $themes_dir = fs_normalize_path( get_theme_root( get_stylesheet() ) ); - $plugin_dir_to_skip = false; - - for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) { - if ( empty( $bt[ $i ]['file'] ) ) { - continue; - } - - if ( $i > 1 && ! empty( $bt[ $i - 1 ]['file'] ) && $bt[ $i ]['file'] === $bt[ $i - 1 ]['file'] ) { - // If file same as the prev file in the stack, skip it. - continue; - } - - if ( ! empty( $bt[ $i ]['function'] ) && in_array( $bt[ $i ]['function'], array( - 'do_action', - 'apply_filter', - // The string split is stupid, but otherwise, theme check - // throws info notices. - 'requir' . 'e_once', - 'requir' . 'e', - 'includ' . 'e_once', - 'includ' . 'e', - 'install_and_activate_plugin', - 'try_activate_plugin', - 'activate_plugin' - ) ) - ) { - if ( 'activate_plugin' === $bt[ $i ]['function'] ) { - /** - * Store the directory of the activator plugin so that any other file that starts with it - * cannot be mistakenly chosen as a candidate caller file. - * - * @author Leo Fajardo - * - * @since 2.3.0 - */ - $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] ); - - foreach ( $all_plugins_paths as $plugin_path ) { - $plugin_dir = fs_normalize_path( dirname( $plugin_path ) . '/' ); - if ( false !== strpos( $caller_file_path, $plugin_dir ) ) { - $plugin_dir_to_skip = $plugin_dir; - - break; - } - } - } - - // Ignore call stack hooks and files inclusion. - continue; - } - - $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] ); - - if ( ! empty( $plugin_dir_to_skip ) ) { - /** - * Skip if it's an activator plugin file to avoid mistakenly choosing it as a candidate caller file. - * - * @author Leo Fajardo - * - * @since 2.3.0 - */ - if ( 0 === strpos( $caller_file_path, $plugin_dir_to_skip ) ) { - continue; - } - } - - if ( 'functions.php' === basename( $caller_file_path ) ) { - /** - * 1. Assumes that theme's starting execution file is functions.php. - * 2. This complex logic fixes symlink issues (e.g. with Vargant). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.5 - */ - - if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) { - $module_type = WP_FS__MODULE_TYPE_THEME; - - /** - * Relative path of the theme, e.g.: - * `my-theme/functions.php` - * - * @author Leo Fajardo (@leorw) - */ - $caller_file_candidate = basename( dirname( $caller_file_path ) ) . - '/' . - basename( $caller_file_path ); - - continue; - } - } - - $caller_file_hash = md5( $caller_file_path ); - - if ( ! isset( $caller_map[ $caller_file_hash ] ) ) { - foreach ( $all_plugins_paths as $plugin_path ) { - if ( empty( $plugin_path ) ) { - continue; - } - - if ( false !== strpos( $caller_file_path, fs_normalize_path( dirname( $plugin_path ) . '/' ) ) ) { - $caller_map[ $caller_file_hash ] = fs_normalize_path( $plugin_path ); - break; - } - } - } - - if ( isset( $caller_map[ $caller_file_hash ] ) ) { - $module_type = WP_FS__MODULE_TYPE_PLUGIN; - $caller_file_candidate = plugin_basename( $caller_map[ $caller_file_hash ] ); - } - } - - return (object) array( - 'module_type' => $module_type, - 'path' => $caller_file_candidate - ); - } - - #---------------------------------------------------------------------------------- - #region Deactivation Feedback Form - #---------------------------------------------------------------------------------- - - /** - * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins - * page. - * - * @author Vova Feldman (@svovaf) - * @author Leo Fajardo (@leorw) - * - * @since 1.1.2 - */ - function _add_deactivation_feedback_dialog_box() { - $subscription_cancellation_dialog_box_template_params = $this->apply_filters( 'show_deactivation_subscription_cancellation', true ) ? - $this->_get_subscription_cancellation_dialog_box_template_params() : - array(); - - /** - * @since 2.3.0 Developers can optionally hide the deactivation feedback form using the 'show_deactivation_feedback_form' filter. - */ - $show_deactivation_feedback_form = true; - if ( $this->has_filter( 'show_deactivation_feedback_form' ) ) { - $show_deactivation_feedback_form = $this->apply_filters( 'show_deactivation_feedback_form', true ); - } else if ( $this->is_addon() ) { - /** - * If the add-on's 'show_deactivation_feedback_form' is not set, try to inherit the value from the parent. - */ - $show_deactivation_feedback_form = $this->get_parent_instance()->apply_filters( 'show_deactivation_feedback_form', true ); - } - - $uninstall_confirmation_message = $this->apply_filters( 'uninstall_confirmation_message', '' ); - - if ( - empty( $subscription_cancellation_dialog_box_template_params ) && - ! $show_deactivation_feedback_form && - empty( $uninstall_confirmation_message ) - ) { - return; - } - - $vars = array( 'id' => $this->_module_id ); - - if ( $show_deactivation_feedback_form ) { - /* Check the type of user: - * 1. Long-term (long-term) - * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term). - * 3. Short-term (short-term) - */ - $is_long_term_user = true; - - // Check if the site is at least 2 days old. - $time_installed = $this->_storage->install_timestamp; - - // Difference in seconds. - $date_diff = time() - $time_installed; - - // Convert seconds to days. - $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) ); - - if ( $date_diff_days < 2 ) { - $is_long_term_user = false; - } - - $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user ); - - if ( $is_long_term_user ) { - $user_type = 'long-term'; - } else { - if ( ! $this->is_registered() && ! $this->is_anonymous() ) { - $user_type = 'non-registered-and-non-anonymous-short-term'; - } else { - $user_type = 'short-term'; - } - } - - $uninstall_reasons = $this->_get_uninstall_reasons( $user_type ); - - $vars['reasons'] = $uninstall_reasons; - } - - $vars['subscription_cancellation_dialog_box_template_params'] = &$subscription_cancellation_dialog_box_template_params; - $vars['show_deactivation_feedback_form'] = $show_deactivation_feedback_form; - $vars['uninstall_confirmation_message'] = $uninstall_confirmation_message; - - /** - * Load the HTML template for the deactivation feedback dialog box. - * - * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin. - */ - fs_require_template( 'forms/deactivation/form.php', $vars ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.1.2 - * - * @param string $user_type - * - * @return array The uninstall reasons for the specified user type. - */ - function _get_uninstall_reasons( $user_type = 'long-term' ) { - $module_type = $this->_module_type; - - $internal_message_template_var = array( - 'id' => $this->_module_id - ); - - $plan = $this->get_plan(); - - if ( $this->is_registered() && is_object( $plan ) && $plan->has_technical_support() ) { - $contact_support_template = fs_get_template( 'forms/deactivation/contact.php', $internal_message_template_var ); - } else { - $contact_support_template = ''; - } - - $reason_found_better_plugin = array( - 'id' => self::REASON_FOUND_A_BETTER_PLUGIN, - 'text' => sprintf( $this->get_text_inline( 'I found a better %s', 'reason-found-a-better-plugin' ), $module_type ), - 'input_type' => 'textfield', - 'input_placeholder' => sprintf( $this->get_text_inline( "What's the %s's name?", 'placeholder-plugin-name' ), $module_type ), - ); - - $reason_temporary_deactivation = array( - 'id' => self::REASON_TEMPORARY_DEACTIVATION, - 'text' => sprintf( - $this->get_text_inline( "It's a temporary %s. I'm just debugging an issue.", 'reason-temporary-x' ), - strtolower( $this->is_plugin() ? - $this->get_text_inline( 'Deactivation', 'deactivation' ) : - $this->get_text_inline( 'Theme Switch', 'theme-switch' ) - ) - ), - 'input_type' => '', - 'input_placeholder' => '' - ); - - $reason_other = array( - 'id' => self::REASON_OTHER, - 'text' => $this->get_text_inline( 'Other', 'reason-other' ), - 'input_type' => 'textfield', - 'input_placeholder' => '' - ); - - $long_term_user_reasons = array( - array( - 'id' => self::REASON_NO_LONGER_NEEDED, - 'text' => sprintf( $this->get_text_inline( 'I no longer need the %s', 'reason-no-longer-needed' ), $module_type ), - 'input_type' => '', - 'input_placeholder' => '' - ), - $reason_found_better_plugin, - array( - 'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD, - 'text' => sprintf( $this->get_text_inline( 'I only needed the %s for a short period', 'reason-needed-for-a-short-period' ), $module_type ), - 'input_type' => '', - 'input_placeholder' => '' - ), - array( - 'id' => self::REASON_BROKE_MY_SITE, - 'text' => sprintf( $this->get_text_inline( 'The %s broke my site', 'reason-broke-my-site' ), $module_type ), - 'input_type' => '', - 'input_placeholder' => '', - 'internal_message' => $contact_support_template - ), - array( - 'id' => self::REASON_SUDDENLY_STOPPED_WORKING, - 'text' => sprintf( $this->get_text_inline( 'The %s suddenly stopped working', 'reason-suddenly-stopped-working' ), $module_type ), - 'input_type' => '', - 'input_placeholder' => '', - 'internal_message' => $contact_support_template - ) - ); - - if ( $this->is_paying() ) { - $long_term_user_reasons[] = array( - 'id' => self::REASON_CANT_PAY_ANYMORE, - 'text' => $this->get_text_inline( "I can't pay for it anymore", 'reason-cant-pay-anymore' ), - 'input_type' => 'textfield', - 'input_placeholder' => $this->get_text_inline( 'What price would you feel comfortable paying?', 'placeholder-comfortable-price' ) - ); - } - - $reason_dont_share_info = array( - 'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION, - 'text' => $this->get_text_inline( "I don't like to share my information with you", 'reason-dont-like-to-share-my-information' ), - 'input_type' => '', - 'input_placeholder' => '' - ); - - /** - * If the current user has selected the "don't share data" reason in the deactivation feedback modal, inform the - * user by showing additional message that he doesn't have to share data and can just choose to skip the opt-in - * (the Skip button is included in the message to show). This message will only be shown if anonymous mode is - * enabled and the user's account is currently not in pending activation state (similar to the way the Skip - * button in the opt-in form is shown/hidden). - */ - if ( $this->is_enable_anonymous() && ! $this->is_pending_activation() ) { - $reason_dont_share_info['internal_message'] = fs_get_template( 'forms/deactivation/retry-skip.php', $internal_message_template_var ); - } - - $uninstall_reasons = array( - 'long-term' => $long_term_user_reasons, - 'non-registered-and-non-anonymous-short-term' => array( - array( - 'id' => self::REASON_DIDNT_WORK, - 'text' => sprintf( $this->get_text_inline( "The %s didn't work", 'reason-didnt-work' ), $module_type ), - 'input_type' => '', - 'input_placeholder' => '' - ), - $reason_dont_share_info, - $reason_found_better_plugin - ), - 'short-term' => array( - array( - 'id' => self::REASON_COULDNT_MAKE_IT_WORK, - 'text' => $this->get_text_inline( "I couldn't understand how to make it work", 'reason-couldnt-make-it-work' ), - 'input_type' => '', - 'input_placeholder' => '', - 'internal_message' => $contact_support_template - ), - $reason_found_better_plugin, - array( - 'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE, - 'text' => sprintf( $this->get_text_inline( "The %s is great, but I need specific feature that you don't support", 'reason-great-but-need-specific-feature' ), $module_type ), - 'input_type' => 'textarea', - 'input_placeholder' => $this->get_text_inline( 'What feature?', 'placeholder-feature' ) - ), - array( - 'id' => self::REASON_NOT_WORKING, - 'text' => sprintf( $this->get_text_inline( 'The %s is not working', 'reason-not-working' ), $module_type ), - 'input_type' => 'textarea', - 'input_placeholder' => $this->get_text_inline( "Kindly share what didn't work so we can fix it for future users...", 'placeholder-share-what-didnt-work' ) - ), - array( - 'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR, - 'text' => $this->get_text_inline( "It's not what I was looking for", 'reason-not-what-i-was-looking-for' ), - 'input_type' => 'textarea', - 'input_placeholder' => $this->get_text_inline( "What you've been looking for?", 'placeholder-what-youve-been-looking-for' ) - ), - array( - 'id' => self::REASON_DIDNT_WORK_AS_EXPECTED, - 'text' => sprintf( $this->get_text_inline( "The %s didn't work as expected", 'reason-didnt-work-as-expected' ), $module_type ), - 'input_type' => 'textarea', - 'input_placeholder' => $this->get_text_inline( 'What did you expect?', 'placeholder-what-did-you-expect' ) - ) - ) - ); - - // Randomize the reasons for the current user type. - shuffle( $uninstall_reasons[ $user_type ] ); - - // Keep the following reasons as the last items in the list. - $uninstall_reasons[ $user_type ][] = $reason_temporary_deactivation; - $uninstall_reasons[ $user_type ][] = $reason_other; - - $uninstall_reasons = $this->apply_filters( 'uninstall_reasons', $uninstall_reasons ); - - return $uninstall_reasons[ $user_type ]; - } - - /** - * Called after the user has submitted his reason for deactivating the plugin. - * - * @author Leo Fajardo (@leorw) - * @since 1.1.2 - */ - function _submit_uninstall_reason_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'submit_uninstall_reason' ); - - $reason_id = fs_request_get( 'reason_id' ); - - // Check if the given reason ID is an unsigned integer. - if ( ! ctype_digit( $reason_id ) ) { - exit; - } - - $reason_info = trim( fs_request_get( 'reason_info', '' ) ); - if ( ! empty( $reason_info ) ) { - $reason_info = substr( $reason_info, 0, 128 ); - } - - $reason = (object) array( - 'id' => $reason_id, - 'info' => $reason_info, - 'is_anonymous' => fs_request_get_bool( 'is_anonymous' ) - ); - - $this->_storage->store( 'uninstall_reason', $reason ); - - /** - * If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do - * not support uninstall hook. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - if ( $this->is_theme() ) { - if ( $this->is_premium() && ! $this->has_active_valid_license() ) { - FS_Plugin_Updater::instance( $this )->delete_update_data(); - } - - $this->_uninstall_plugin_event( false ); - $this->remove_sdk_reference(); - } - - // Print '1' for successful operation. - echo 1; - exit; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.4 - */ - function cancel_subscription_or_trial_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'cancel_subscription_or_trial' ); - - $result = $this->cancel_subscription_or_trial( fs_request_get( 'plugin_id', $this->get_id() ), false ); - - if ( $this->is_api_error( $result ) ) { - $this->shoot_ajax_failure( $result->error->message ); - } - - $this->shoot_ajax_success(); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.4 - * - * @param number $plugin_id - * - * @return object - */ - private function cancel_subscription_or_trial( $plugin_id ) { - $fs = null; - if ( $plugin_id == $this->get_id() ) { - $fs = $this; - } else if ( $this->is_addon_activated( $plugin_id ) ) { - $fs = self::get_instance_by_id( $plugin_id ); - } - - $result = null; - - if ( ! is_null( $fs ) ) { - $result = $fs->is_paid_trial() ? - $fs->_cancel_trial() : - $fs->_downgrade_site(); - } - - return $result; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.2 - */ - function _delete_theme_update_data_action() { - FS_Plugin_Updater::instance( $this )->delete_update_data(); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Instance - #---------------------------------------------------------------------------------- - - /** - * Main singleton instance. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - * - * @param number $module_id - * @param string|bool $slug - * @param bool $is_init Is initiation sequence. - * - * @return Freemius|false - */ - static function instance( $module_id, $slug = false, $is_init = false ) { - if ( empty( $module_id ) ) { - return false; - } - - /** - * Load the essential static data prior to initiating FS_Plugin_Manager since there's an essential MS network migration logic that needs to be executed prior to the initiation. - */ - self::_load_required_static(); - - if ( ! is_numeric( $module_id ) ) { - if ( ! $is_init && true === $slug ) { - $is_init = true; - } - - $slug = $module_id; - - $module = FS_Plugin_Manager::instance( $slug )->get(); - - if ( is_object( $module ) ) { - $module_id = $module->id; - } - } - - $key = 'm_' . $module_id; - - if ( ! isset( self::$_instances[ $key ] ) ) { - self::$_instances[ $key ] = new Freemius( $module_id, $slug, $is_init ); - } - - return self::$_instances[ $key ]; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param number $addon_id - * - * @return bool - */ - private static function has_instance( $addon_id ) { - return isset( self::$_instances[ 'm_' . $addon_id ] ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @param string|number $id_or_slug - * @param string $module_type - * - * @return number|false - */ - private static function get_module_id( $id_or_slug, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) { - if ( is_numeric( $id_or_slug ) ) { - return $id_or_slug; - } - - foreach ( self::$_instances as $instance ) { - // Also check the module type since there can be a plugin and a theme with the same slug. - if ( ( $module_type === $instance->get_module_type() ) && ( $id_or_slug === $instance->get_slug() ) ) { - return $instance->get_id(); - } - } - - return false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param number $id - * - * @return false|Freemius - */ - static function get_instance_by_id( $id ) { - return isset ( self::$_instances[ 'm_' . $id ] ) ? - self::$_instances[ 'm_' . $id ] : - false; - } - - /** - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param string $plugin_file - * @param string $module_type - * - * @return false|Freemius - */ - static function get_instance_by_file( $plugin_file, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) { - $slug = self::find_slug_by_basename( $plugin_file ); - - return ( false !== $slug ) ? - self::instance( self::get_module_id( $slug, $module_type ) ) : - false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return false|Freemius - */ - function get_parent_instance() { - return self::get_instance_by_id( $this->_plugin->parent_plugin_id ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param string|number $id_or_slug - * - * @return false|Freemius - */ - function get_addon_instance( $id_or_slug ) { - $addon_id = self::get_module_id( $id_or_slug ); - - return self::instance( $addon_id ); - } - - #endregion ------------------------------------------------------------------ - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return bool - */ - function is_parent_plugin_installed() { - $is_active = self::has_instance( $this->_plugin->parent_plugin_id ); - - if ( $is_active ) { - return true; - } - - /** - * Parent module might be a theme. If that's the case, the add-on's FS - * instance will be loaded prior to the theme's FS instance, therefore, - * we need to check if it's active with a "look ahead". - * - * @author Vova Feldman - * @since 1.2.2.3 - */ - global $fs_active_plugins; - if ( is_object( $fs_active_plugins ) && is_array( $fs_active_plugins->plugins ) ) { - $active_theme = wp_get_theme(); - - foreach ( $fs_active_plugins->plugins as $sdk => $module ) { - if ( WP_FS__MODULE_TYPE_THEME === $module->type ) { - if ( $module->plugin_path == $active_theme->get_stylesheet() ) { - // Parent module is a theme and it's currently active. - return true; - } - } - } - } - - return false; - } - - /** - * Check if add-on parent plugin in activation mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return bool - */ - function is_parent_in_activation() { - $parent_fs = $this->get_parent_instance(); - if ( ! is_object( $parent_fs ) ) { - return false; - } - - return ( $parent_fs->is_activation_mode() ); - } - - /** - * Is plugin in activation mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @param bool $and_on - * - * @return bool - */ - function is_activation_mode( $and_on = true ) { - return fs_is_network_admin() ? - $this->is_network_activation_mode( $and_on ) : - $this->is_site_activation_mode( $and_on ); - } - - /** - * Is plugin in activation mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @param bool $and_on - * - * @return bool - */ - function is_site_activation_mode( $and_on = true ) { - return ( - ( $this->is_on() || ! $and_on ) && - ( - ( $this->is_premium() && true === $this->_storage->require_license_activation ) || - ( - ( ! $this->is_registered() || - ( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) && - ( ! $this->is_enable_anonymous() || - ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) ) - ) - ) - ); - } - - /** - * Checks if the SDK in network activation mode. - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param bool $and_on - * - * @return bool - */ - private function is_network_activation_mode( $and_on = true ) { - if ( ! $this->_is_network_active ) { - // Not network activated. - return false; - } - - if ( $this->is_network_upgrade_mode() ) { - // Special flag to enforce network activation mode to decide what to do with the sites that are not yet opted-in nor skipped. - return true; - } - - if ( ! $this->is_site_activation_mode( $and_on ) ) { - // Whether the context is single site or the network, if the plugin is no longer in activation mode then it is not in network activation mode as well. - return false; - } - - if ( $this->is_network_delegated_connection() ) { - // Super-admin delegated the connection to the site admins -> not activation mode. - return false; - } - - if ( $this->is_network_anonymous() && true !== $this->_storage->require_license_activation ) { - // Super-admin skipped the connection network wide -> not activation mode. - return false; - } - - if ( $this->is_network_registered() ) { - // Super-admin connected at least one site -> not activation mode. - return false; - } - - return true; - } - - /** - * Check if current page is the opt-in/pending-activation page. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @return bool - */ - function is_activation_page() { - if ( $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) { - return true; - } - - if ( ! $this->is_activation_mode() ) { - return false; - } - - // Check if current page is matching the activation page. - return $this->is_matching_url( $this->get_activation_url() ); - } - - /** - * Check if URL path's are matching and that all querystring - * arguments of the $sub_url exist in the $url with the same values. - * - * WARNING: - * 1. This method doesn't check if the sub/domain are matching. - * 2. Ignore case sensitivity. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @param string $sub_url - * @param string $url If argument is not set, check if the sub_url matching the current's page URL. - * - * @return bool - */ - private function is_matching_url( $sub_url, $url = '' ) { - if ( empty( $url ) ) { - $url = $_SERVER['REQUEST_URI']; - } - - $url = strtolower( $url ); - $sub_url = strtolower( $sub_url ); - - if ( parse_url( $sub_url, PHP_URL_PATH ) !== parse_url( $url, PHP_URL_PATH ) ) { - // Different path - DO NOT OVERRIDE PAGE. - return false; - } - - $url_params = array(); - parse_str( parse_url( $url, PHP_URL_QUERY ), $url_params ); - - $sub_url_params = array(); - parse_str( parse_url( $sub_url, PHP_URL_QUERY ), $sub_url_params ); - - foreach ( $sub_url_params as $key => $val ) { - if ( ! isset( $url_params[ $key ] ) || $val != $url_params[ $key ] ) { - // Not matching query string - DO NOT OVERRIDE PAGE. - return false; - } - } - - return true; - } - - /** - * Get the basenames of all active plugins for specific blog. Including network activated plugins. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id - * - * @return string[] - */ - private static function get_active_plugins_basenames( $blog_id = 0 ) { - if ( is_multisite() && $blog_id > 0 ) { - $active_basenames = get_blog_option( $blog_id, 'active_plugins' ); - } else { - $active_basenames = get_option( 'active_plugins' ); - } - - if ( ! is_array( $active_basenames ) ) { - $active_basenames = array(); - } - - if ( is_multisite() ) { - $network_active_basenames = get_site_option( 'active_sitewide_plugins' ); - - if ( is_array( $network_active_basenames ) && ! empty( $network_active_basenames ) ) { - $active_basenames = array_merge( $active_basenames, array_keys( $network_active_basenames ) ); - } - } - - return $active_basenames; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param int $blog_id - * - * @return array - */ - static function get_active_plugins_directories_map( $blog_id = 0 ) { - $active_basenames = self::get_active_plugins_basenames( $blog_id ); - - $map = array(); - - foreach ( $active_basenames as $active_basename ) { - $active_basename = fs_normalize_path( $active_basename ); - - if ( false === strpos( $active_basename, '/' ) ) { - continue; - } - - $map[ dirname( $active_basename ) ] = true; - } - - return $map; - } - - /** - * Get collection of all active plugins. Including network activated plugins. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param int $blog_id Since 2.0.0 - * - * @return array[string]array - */ - private static function get_active_plugins( $blog_id = 0 ) { - self::require_plugin_essentials(); - - $active_plugin = array(); - $all_plugins = fs_get_plugins(); - $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id ); - - foreach ( $active_plugins_basenames as $plugin_basename ) { - $active_plugin[ $plugin_basename ] = $all_plugins[ $plugin_basename ]; - } - - return $active_plugin; - } - - /** - * Get collection of all site active plugins for a specified blog. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id - * - * @return array[string]array - */ - private static function get_site_active_plugins( $blog_id = 0 ) { - $active_basenames = ( is_multisite() && $blog_id > 0 ) ? - get_blog_option( $blog_id, 'active_plugins' ) : - get_option( 'active_plugins' ); - - $active = array(); - - if ( ! is_array( $active_basenames ) ) { - return $active; - } - - foreach ( $active_basenames as $basename ) { - $active[ $basename ] = array( - 'is_active' => true, - 'Version' => '1.0', // Dummy version. - 'slug' => self::get_plugin_slug( $basename ), - ); - } - - return $active; - } - - /** - * Get collection of all plugins with their activation status for a specified blog. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.8 - * - * @param int $blog_id Since 2.0.0 - * - * @return array Key is the plugin file path and the value is an array of the plugin data. - */ - private static function get_all_plugins( $blog_id = 0 ) { - self::require_plugin_essentials(); - - $all_plugins = fs_get_plugins(); - - $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id ); - - foreach ( $all_plugins as $basename => &$data ) { - // By default set to inactive (next foreach update the active plugins). - $data['is_active'] = false; - // Enrich with plugin slug. - $data['slug'] = self::get_plugin_slug( $basename ); - } - - // Flag active plugins. - foreach ( $active_plugins_basenames as $basename ) { - if ( isset( $all_plugins[ $basename ] ) ) { - $all_plugins[ $basename ]['is_active'] = true; - } - } - - return $all_plugins; - } - - /** - * Get collection of all plugins and if they are network level activated. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return array Key is the plugin basename and the value is an array of the plugin data. - */ - private static function get_network_plugins() { - self::require_plugin_essentials(); - - $all_plugins = fs_get_plugins(); - - $network_active_basenames = is_multisite() ? - get_site_option( 'active_sitewide_plugins' ) : - array(); - - foreach ( $all_plugins as $basename => &$data ) { - // By default set to inactive (next foreach update the active plugins). - $data['is_active'] = false; - // Enrich with plugin slug. - $data['slug'] = self::get_plugin_slug( $basename ); - } - - // Flag active plugins. - foreach ( $network_active_basenames as $basename ) { - if ( isset( $all_plugins[ $basename ] ) ) { - $all_plugins[ $basename ]['is_active'] = true; - } - } - - return $all_plugins; - } - - /** - * Cached result of get_site_transient( 'update_plugins' ) - * - * @author Vova Feldman (@svovaf) - * @since 1.1.8 - * - * @var object - */ - private static $_plugins_info; - - /** - * Helper function to get specified plugin's slug. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.8 - * - * @param $basename - * - * @return string - */ - private static function get_plugin_slug( $basename ) { - if ( ! isset( self::$_plugins_info ) ) { - self::$_plugins_info = get_site_transient( 'update_plugins' ); - } - - $slug = ''; - - if ( is_object( self::$_plugins_info ) ) { - if ( isset( self::$_plugins_info->no_update ) && - isset( self::$_plugins_info->no_update[ $basename ] ) && - ! empty( self::$_plugins_info->no_update[ $basename ]->slug ) - ) { - $slug = self::$_plugins_info->no_update[ $basename ]->slug; - } else if ( isset( self::$_plugins_info->response ) && - isset( self::$_plugins_info->response[ $basename ] ) && - ! empty( self::$_plugins_info->response[ $basename ]->slug ) - ) { - $slug = self::$_plugins_info->response[ $basename ]->slug; - } - } - - if ( empty( $slug ) ) { - // Try to find slug from FS data. - $slug = self::find_slug_by_basename( $basename ); - } - - if ( empty( $slug ) ) { - // Fallback to plugin's folder name. - $slug = dirname( $basename ); - } - - return $slug; - } - - private static $_statics_loaded = false; - - /** - * Load static resources. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - */ - private static function _load_required_static() { - if ( self::$_statics_loaded ) { - return; - } - - self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); - - self::$_static_logger->entrance(); - - self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true ); - - if ( is_multisite() ) { - $has_skipped_migration = ( - // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level. - null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) && - // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network. - null !== self::$_accounts->get_option( 'file_slug_map', null, false ) - ); - - /** - * If the file_slug_map exists on the site level but doesn't exist on the - * network level storage, it means that we need to process the storage with migration. - * - * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - if ( - ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) || - ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) && - null !== self::$_accounts->get_option( 'file_slug_map', null, false ) ) - ) { - self::migrate_options_to_network(); - } - } - - self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' ); - - if ( ! WP_FS__DEMO_MODE ) { - add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array( - 'Freemius', - '_add_debug_section' - ) ); - } - - add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) ); - - self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) ); - - self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) ); - - self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) ); - - if ( 0 == did_action( 'plugins_loaded' ) ) { - add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 ); - } - - add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) ); - add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) ); - - if ( self::is_plugins_page() || self::is_themes_page() ) { - add_action( 'admin_print_footer_scripts', array( 'Freemius', '_maybe_add_beta_label_styles' ), 9 ); - - /** - * Specifically use this hook so that the JS event handlers will work properly on the "Themes" - * page. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - add_action( 'admin_footer-' . self::get_current_page(), array( 'Freemius', '_maybe_add_beta_label_to_plugins_and_handle_confirmation') ); - } - - self::$_statics_loaded = true; - } - - /** - * @author Leo Fajardo (@leorw) - * - * @since 2.1.3 - */ - private static function migrate_options_to_network() { - self::migrate_accounts_to_network(); - - // Migrate API options from site level to network level. - $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true ); - $api_network_options->migrate_to_network(); - - // Migrate API cache to network level storage. - FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network(); - - self::$_accounts->set_option( 'ms_migration_complete', true, true ); - } - - #---------------------------------------------------------------------------------- - #region Localization - #---------------------------------------------------------------------------------- - - /** - * Load framework's text domain. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1 - */ - static function _load_textdomain() { - if ( ! is_admin() ) { - return; - } - - global $fs_active_plugins; - - // Works both for plugins and themes. - load_plugin_textdomain( - 'freemius', - false, - $fs_active_plugins->newest->sdk_path . '/languages/' - ); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Debugging - #---------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.8 - */ - static function _add_debug_section() { - if ( ! is_super_admin() ) { - // Add debug page only for super-admins. - return; - } - - self::$_static_logger->entrance(); - - $title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION ); - - if ( WP_FS__DEV_MODE ) { - // Add top-level debug menu item. - $hook = FS_Admin_Menu_Manager::add_page( - $title, - $title, - 'manage_options', - 'freemius', - array( 'Freemius', '_debug_page_render' ) - ); - } else { - // Add hidden debug page. - $hook = FS_Admin_Menu_Manager::add_subpage( - null, - $title, - $title, - 'manage_options', - 'freemius', - array( 'Freemius', '_debug_page_render' ) - ); - } - - if ( ! empty( $hook ) ) { - add_action( "load-$hook", array( 'Freemius', '_debug_page_actions' ) ); - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - */ - static function _toggle_debug_mode() { - if ( ! is_super_admin() ) { - return; - } - - $is_on = fs_request_get( 'is_on', false, 'post' ); - - if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) { - update_option( 'fs_debug_mode', $is_on ); - - // Turn on/off storage logging. - FS_Logger::_set_storage_logging( ( 1 == $is_on ) ); - } - - exit; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - */ - static function _get_debug_log() { - $logs = FS_Logger::load_db_logs( - fs_request_get( 'filters', false, 'post' ), - ! empty( $_POST['limit'] ) && is_numeric( $_POST['limit'] ) ? $_POST['limit'] : 200, - ! empty( $_POST['offset'] ) && is_numeric( $_POST['offset'] ) ? $_POST['offset'] : 0 - ); - - self::shoot_ajax_success( $logs ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - */ - static function _get_db_option() { - check_admin_referer( 'fs_get_db_option' ); - - $option_name = fs_request_get( 'option_name' ); - - if ( ! is_super_admin() || - ! fs_starts_with( $option_name, 'fs_' ) - ) { - self::shoot_ajax_failure(); - } - - $value = get_option( $option_name ); - - $result = array( - 'name' => $option_name, - ); - - if ( false !== $value ) { - if ( ! is_string( $value ) ) { - $value = json_encode( $value ); - } - - $result['value'] = $value; - } - - self::shoot_ajax_success( $result ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - */ - static function _set_db_option() { - check_admin_referer( 'fs_set_db_option' ); - - $option_name = fs_request_get( 'option_name' ); - - if ( ! is_super_admin() || - ! fs_starts_with( $option_name, 'fs_' ) - ) { - self::shoot_ajax_failure(); - } - - $option_value = fs_request_get( 'option_value' ); - - if ( ! empty( $option_value ) ) { - update_option( $option_name, $option_value ); - } - - self::shoot_ajax_success(); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.8 - */ - static function _debug_page_actions() { - self::_clean_admin_content_section(); - - if ( fs_request_is_action( 'restart_freemius' ) ) { - check_admin_referer( 'restart_freemius' ); - - if ( ! is_multisite() ) { - // Clear accounts data. - self::$_accounts->clear( null, true ); - } else { - $sites = self::get_sites(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - self::$_accounts->clear( $blog_id, true ); - } - - // Clear network level storage. - self::$_accounts->clear( true, true ); - } - - // Clear SDK reference cache. - delete_option( 'fs_active_plugins' ); - } else if ( fs_request_is_action( 'clear_updates_data' ) ) { - check_admin_referer( 'clear_updates_data' ); - - if ( ! is_multisite() ) { - set_site_transient( 'update_plugins', null ); - set_site_transient( 'update_themes', null ); - } else { - $current_blog_id = get_current_blog_id(); - - $sites = self::get_sites(); - foreach ( $sites as $site ) { - switch_to_blog( self::get_site_blog_id( $site ) ); - - set_site_transient( 'update_plugins', null ); - set_site_transient( 'update_themes', null ); - } - - switch_to_blog( $current_blog_id ); - } - } else if ( fs_request_is_action( 'simulate_trial' ) ) { - check_admin_referer( 'simulate_trial' ); - - $fs = freemius( fs_request_get( 'module_id' ) ); - - // Update SDK install to at least 24 hours before. - $fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC ); - // Unset the trial shown timestamp. - unset( $fs->_storage->trial_promotion_shown ); - } else if ( fs_request_is_action( 'simulate_network_upgrade' ) ) { - check_admin_referer( 'simulate_network_upgrade' ); - - $fs = freemius( fs_request_get( 'module_id' ) ); - - self::set_network_upgrade_mode( $fs->_storage ); - } else if ( fs_request_is_action( 'delete_install' ) ) { - check_admin_referer( 'delete_install' ); - - self::_delete_site_by_slug( - fs_request_get( 'slug' ), - fs_request_get( 'module_type' ), - true, - fs_request_get( 'blog_id', null ) - ); - } else if ( fs_request_is_action( 'delete_user' ) ) { - check_admin_referer( 'delete_user' ); - - self::delete_user( fs_request_get( 'user_id' ) ); - } else if ( fs_request_is_action( 'download_logs' ) ) { - check_admin_referer( 'download_logs' ); - - $download_url = FS_Logger::download_db_logs( - fs_request_get( 'filters', false, 'post' ) - ); - - if ( false === $download_url ) { - wp_die( 'Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.' ); - } - - fs_redirect( $download_url ); - } else if ( fs_request_is_action( 'migrate_options_to_network' ) ) { - check_admin_referer( 'migrate_options_to_network' ); - - self::migrate_options_to_network(); - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.8 - */ - static function _debug_page_render() { - self::$_static_logger->entrance(); - - if ( ! is_multisite() ) { - $all_plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ); - $all_themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME ); - } else { - $sites = self::get_sites(); - - $all_plugins_installs = array(); - $all_themes_installs = array(); - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - $plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id ); - - foreach ( $plugins_installs as $slug => $install ) { - if ( ! isset( $all_plugins_installs[ $slug ] ) ) { - $all_plugins_installs[ $slug ] = array(); - } - - $install->blog_id = $blog_id; - - $all_plugins_installs[ $slug ][] = $install; - } - - $themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id ); - - foreach ( $themes_installs as $slug => $install ) { - if ( ! isset( $all_themes_installs[ $slug ] ) ) { - $all_themes_installs[ $slug ] = array(); - } - - $install->blog_id = $blog_id; - - $all_themes_installs[ $slug ][] = $install; - } - } - } - - $licenses_by_module_type = self::get_all_licenses_by_module_type(); - - $vars = array( - 'plugin_sites' => $all_plugins_installs, - 'theme_sites' => $all_themes_installs, - 'users' => self::get_all_users(), - 'addons' => self::get_all_addons(), - 'account_addons' => self::get_all_account_addons(), - 'plugin_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_PLUGIN ], - 'theme_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_THEME ] - ); - - fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' ); - fs_require_once_template( 'debug.php', $vars ); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Connectivity Issues - #---------------------------------------------------------------------------------- - - /** - * Check if Freemius should be turned on for the current plugin install. - * - * Note: - * $this->_is_on is updated in has_api_connectivity() - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function is_on() { - self::$_static_logger->entrance(); - - if ( isset( $this->_is_on ) ) { - return $this->_is_on; - } - - // If already installed or pending then sure it's on :) - if ( $this->is_registered() || $this->is_pending_activation() ) { - $this->_is_on = true; - - return true; - } - - return false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param bool $flush_if_no_connectivity - * - * @return bool - */ - private function should_run_connectivity_test( $flush_if_no_connectivity = false ) { - if ( ! isset( $this->_storage->connectivity_test ) ) { - // Connectivity test was never executed, or cache was cleared. - return true; - } - - if ( WP_FS__PING_API_ON_IP_OR_HOST_CHANGES ) { - if ( WP_FS__IS_HTTP_REQUEST ) { - if ( $_SERVER['HTTP_HOST'] != $this->_storage->connectivity_test['host'] ) { - // Domain changed. - return true; - } - - if ( WP_FS__REMOTE_ADDR != $this->_storage->connectivity_test['server_ip'] ) { - // Server IP changed. - return true; - } - } - } - - if ( $this->_storage->connectivity_test['is_connected'] && - $this->_storage->connectivity_test['is_active'] - ) { - // API connected and Freemius is active - no need to run connectivity check. - return false; - } - - if ( $flush_if_no_connectivity ) { - /** - * If explicitly asked to flush when no connectivity - do it only - * if at least 10 sec passed from the last API connectivity test. - */ - return ( isset( $this->_storage->connectivity_test['timestamp'] ) && - ( WP_FS__SCRIPT_START_TIME - $this->_storage->connectivity_test['timestamp'] ) > 10 ); - } - - /** - * @since 1.1.7 Don't check for connectivity on plugin downgrade. - */ - $version = $this->get_plugin_version(); - if ( version_compare( $version, $this->_storage->connectivity_test['version'], '>' ) ) { - // If it's a plugin version upgrade and Freemius is off or no connectivity, run connectivity test. - return true; - } - - return false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @param int|null $blog_id Since 2.0.0. - * @param bool $is_gdpr_test Since 2.0.2. Perform only the GDPR test. - * - * @return object|false - */ - private function ping( $blog_id = null, $is_gdpr_test = false ) { - if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY ) { - return false; - } - - $version = $this->get_plugin_version(); - - $is_update = $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() ); - - return $this->get_api_plugin_scope()->ping( - $this->get_anonymous_id( $blog_id ), - array( - 'is_update' => json_encode( $is_update ), - 'version' => $version, - 'sdk' => $this->version, - 'is_admin' => json_encode( is_admin() ), - 'is_ajax' => json_encode( self::is_ajax() ), - 'is_cron' => json_encode( self::is_cron() ), - 'is_gdpr_test' => $is_gdpr_test, - 'is_http' => json_encode( WP_FS__IS_HTTP_REQUEST ), - ) - ); - } - - /** - * Check if there's any connectivity issue to Freemius API. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param bool $flush_if_no_connectivity - * - * @return bool - */ - function has_api_connectivity( $flush_if_no_connectivity = false ) { - $this->_logger->entrance(); - - if ( isset( $this->_has_api_connection ) && ( $this->_has_api_connection || ! $flush_if_no_connectivity ) ) { - return $this->_has_api_connection; - } - - if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY && - isset( $this->_storage->connectivity_test ) && - true === $this->_storage->connectivity_test['is_connected'] - ) { - unset( $this->_storage->connectivity_test ); - } - - if ( ! $this->should_run_connectivity_test( $flush_if_no_connectivity ) ) { - $this->_has_api_connection = $this->_storage->connectivity_test['is_connected']; - /** - * @since 1.1.6 During dev mode, if there's connectivity - turn Freemius on regardless the configuration. - * - * @since 1.2.1.5 If the user running the premium version then ignore the 'is_active' flag and turn Freemius on to enable license key activation. - */ - $this->_is_on = $this->_storage->connectivity_test['is_active'] || - $this->is_premium() || - ( WP_FS__DEV_MODE && $this->_has_api_connection && ! WP_FS__SIMULATE_FREEMIUS_OFF ); - - return $this->_has_api_connection; - } - - $pong = $this->ping(); - $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong ); - - if ( ! $is_connected ) { - // API failure. - $this->_add_connectivity_issue_message( $pong ); - } - - if ( $is_connected ) { - FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); - } - - $this->store_connectivity_info( $pong, $is_connected ); - - return $this->_has_api_connection; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @param object $pong - * @param bool $is_connected - */ - private function store_connectivity_info( $pong, $is_connected ) { - $this->_logger->entrance(); - - $version = $this->get_plugin_version(); - - if ( ! $is_connected || WP_FS__SIMULATE_FREEMIUS_OFF ) { - $is_active = false; - } else { - $is_active = ( isset( $pong->is_active ) && true == $pong->is_active ); - } - - $is_active = $this->apply_filters( - 'is_on', - $is_active, - $this->is_plugin_update(), - $version - ); - - $this->_storage->connectivity_test = array( - 'is_connected' => $is_connected, - 'host' => $_SERVER['HTTP_HOST'], - 'server_ip' => WP_FS__REMOTE_ADDR, - 'is_active' => $is_active, - 'timestamp' => WP_FS__SCRIPT_START_TIME, - // Last version with connectivity attempt. - 'version' => $version, - ); - - $this->_has_api_connection = $is_connected; - $this->_is_on = $is_active || ( WP_FS__DEV_MODE && $is_connected && ! WP_FS__SIMULATE_FREEMIUS_OFF ); - } - - /** - * Force turning Freemius on. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.8.1 - * - * @return bool TRUE if successfully turned on. - */ - private function turn_on() { - $this->_logger->entrance(); - - if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) { - return false; - } - - $updated_connectivity = $this->_storage->connectivity_test; - $updated_connectivity['is_active'] = true; - $updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME; - $this->_storage->connectivity_test = $updated_connectivity; - - $this->_is_on = true; - - return true; - } - - /** - * Anonymous and unique site identifier (Hash). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.0 - * - * @param null|int $blog_id Since 2.0.0 - * - * @return string - */ - function get_anonymous_id( $blog_id = null ) { - $unique_id = self::$_accounts->get_option( 'unique_id', null, $blog_id ); - - if ( empty( $unique_id ) || ! is_string( $unique_id ) ) { - $key = fs_strip_url_protocol( get_site_url( $blog_id ) ); - - $secure_auth = SECURE_AUTH_KEY; - if ( empty( $secure_auth ) || - false !== strpos( $secure_auth, ' ' ) || - 'put your unique phrase here' === $secure_auth - ) { - // Protect against default auth key. - $secure_auth = md5( microtime() ); - } - - /** - * Base the unique identifier on the WP secure authentication key. Which - * turns the key into a secret anonymous identifier. This will help us - * to avoid duplicate installs generation on the backend upon opt-in. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.3 - */ - $unique_id = md5( $key . $secure_auth ); - - self::$_accounts->set_option( 'unique_id', $unique_id, true, $blog_id ); - } - - $this->_logger->departure( $unique_id ); - - return $unique_id; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @return \WP_User - */ - static function _get_current_wp_user() { - self::require_pluggable_essentials(); - self::wp_cookie_constants(); - - return wp_get_current_user(); - } - - /** - * Define cookie constants which are required by Freemius::_get_current_wp_user() since - * it uses wp_get_current_user() which needs the cookie constants set. When a plugin - * is network activated the cookie constants are only configured after the network - * plugins activation, therefore, if we don't define those constants WP will throw - * PHP warnings/notices. - * - * @author Vova Feldman (@svovaf) - * @since 2.1.1 - */ - private static function wp_cookie_constants() { - if ( defined( 'LOGGED_IN_COOKIE' ) && - ( defined( 'AUTH_COOKIE' ) || defined( 'SECURE_AUTH_COOKIE' ) ) - ) { - return; - } - - /** - * Used to guarantee unique hash cookies - * - * @since 1.5.0 - */ - if ( ! defined( 'COOKIEHASH' ) ) { - $siteurl = get_site_option( 'siteurl' ); - if ( $siteurl ) { - define( 'COOKIEHASH', md5( $siteurl ) ); - } else { - define( 'COOKIEHASH', '' ); - } - } - - if ( ! defined( 'LOGGED_IN_COOKIE' ) ) { - define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH ); - } - - /** - * @since 2.5.0 - */ - if ( ! defined( 'AUTH_COOKIE' ) ) { - define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH ); - } - - /** - * @since 2.6.0 - */ - if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) { - define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH ); - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.1.0 - * - * @return int - */ - static function get_current_wp_user_id() { - $wp_user = self::_get_current_wp_user(); - - return $wp_user->ID; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @param string $email - * - * @return bool - */ - static function is_valid_email( $email ) { - if ( false === filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { - return false; - } - - $parts = explode( '@', $email ); - - if ( 2 !== count( $parts ) || empty( $parts[1] ) ) { - return false; - } - - $blacklist = array( - 'admin.', - 'webmaster.', - 'localhost.', - 'dev.', - 'development.', - 'test.', - 'stage.', - 'staging.', - ); - - // Make sure domain is not one of the blacklisted. - foreach ( $blacklist as $invalid ) { - if ( 0 === strpos( $parts[1], $invalid ) ) { - return false; - } - } - - // Get the UTF encoded domain name. - $domain = idn_to_ascii( $parts[1] ) . '.'; - - return ( checkdnsrr( $domain, 'MX' ) || checkdnsrr( $domain, 'A' ) ); - } - - /** - * Generate API connectivity issue message. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param mixed $api_result - * @param bool $is_first_failure - */ - function _add_connectivity_issue_message( $api_result, $is_first_failure = true ) { - if ( ! $this->is_premium() && $this->_enable_anonymous ) { - // Don't add message if it's the free version and can run anonymously. - return; - } - - if ( ! function_exists( 'wp_nonce_url' ) ) { - require_once ABSPATH . 'wp-includes/functions.php'; - } - - $current_user = self::_get_current_wp_user(); -// $admin_email = get_option( 'admin_email' ); - $admin_email = $current_user->user_email; - - // Aliases. - $deactivate_plugin_title = $this->esc_html_inline( 'That\'s exhausting, please deactivate', 'deactivate-plugin-title' ); - $deactivate_plugin_desc = $this->esc_html_inline( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'deactivate-plugin-desc' ); - $install_previous_title = $this->esc_html_inline( 'Let\'s try your previous version', 'install-previous-title' ); - $install_previous_desc = $this->esc_html_inline( 'Uninstall this version and install the previous one.', 'install-previous-desc' ); - $fix_issue_title = $this->esc_html_inline( 'Yes - I\'m giving you a chance to fix it', 'fix-issue-title' ); - $fix_issue_desc = $this->esc_html_inline( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.', 'fix-issue-desc' ); - /* translators: %s: product title (e.g. "Awesome Plugin" requires an access to...) */ - $x_requires_access_to_api = $this->esc_html_inline( '%s requires an access to our API.', 'x-requires-access-to-api' ); - $sysadmin_title = $this->esc_html_inline( 'I\'m a system administrator', 'sysadmin-title' ); - $happy_to_resolve_issue_asap = $this->esc_html_inline( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.', 'happy-to-resolve-issue-asap' ); - - $message = false; - if ( is_object( $api_result ) && - isset( $api_result->error ) && - isset( $api_result->error->code ) - ) { - switch ( $api_result->error->code ) { - case 'curl_missing': - $missing_methods = ''; - if ( is_array( $api_result->missing_methods ) && - ! empty( $api_result->missing_methods ) - ) { - foreach ( $api_result->missing_methods as $m ) { - if ( 'curl_version' === $m ) { - continue; - } - - if ( ! empty( $missing_methods ) ) { - $missing_methods .= ', '; - } - - $missing_methods .= sprintf( '%s', $m ); - } - - if ( ! empty( $missing_methods ) ) { - $missing_methods = sprintf( - '

    %s %s', - $this->esc_html_inline( 'Disabled method(s):', 'curl-disabled-methods' ), - $missing_methods - ); - } - } - - $message = sprintf( - $x_requires_access_to_api . ' ' . - $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . ' ' . - $missing_methods . - ' %s', - '' . $this->get_plugin_name() . '', - sprintf( - '

    1. %s
    2. %s
    3. %s
    ', - sprintf( - '%s%s', - $this->get_text_inline( 'I don\'t know what is cURL or how to install it, help me!', 'curl-missing-no-clue-title' ), - ' - ' . sprintf( - $this->get_text_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'curl-missing-no-clue-desc' ), - '' . $admin_email . '' - ) - ), - sprintf( - '%s - %s', - $sysadmin_title, - esc_html( sprintf( $this->get_text_inline( 'Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the %s and reactivate it back again.', 'curl-missing-sysadmin-desc' ), $this->get_module_label( true ) ) ) - ), - sprintf( - '%s - %s', - wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), - $deactivate_plugin_title, - $deactivate_plugin_desc - ) - ) - ); - break; - case 'cloudflare_ddos_protection': - $message = sprintf( - $x_requires_access_to_api . ' ' . - $this->esc_html_inline( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'cloudflare-blocks-connection-message' ) . ' ' . - $happy_to_resolve_issue_asap . - ' %s', - '' . $this->get_plugin_name() . '', - sprintf( - '
    1. %s
    2. %s
    3. %s
    ', - sprintf( - '%s%s', - $fix_issue_title, - ' - ' . sprintf( - $fix_issue_desc, - '' . $admin_email . '' - ) - ), - sprintf( - '%s - %s', - sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ), - $install_previous_title, - $install_previous_desc - ), - sprintf( - '%s - %s', - wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=' . '', 'deactivate-plugin_' . $this->_plugin_basename ), - $deactivate_plugin_title, - $deactivate_plugin_desc - ) - ) - ); - break; - case 'squid_cache_block': - $message = sprintf( - $x_requires_access_to_api . ' ' . - $this->esc_html_inline( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'squid-blocks-connection-message' ) . - ' %s', - '' . $this->get_plugin_name() . '', - sprintf( - '
    1. %s
    2. %s
    3. %s
    ', - sprintf( - '%s - %s', - $this->esc_html_inline( 'I don\'t know what is Squid or ACL, help me!', 'squid-no-clue-title' ), - sprintf( - $this->esc_html_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'squid-no-clue-desc' ), - '' . $admin_email . '' - ) - ), - sprintf( - '%s - %s', - $sysadmin_title, - sprintf( - $this->esc_html_inline( 'Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again.', 'squid-sysadmin-desc' ), - // We use a filter since the plugin might require additional API connectivity. - '' . implode( ', ', $this->apply_filters( 'api_domains', array( - 'api.freemius.com', - 'wp.freemius.com' - ) ) ) . '', - $this->_module_type - ) - ), - sprintf( - '%s - %s', - wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), - $deactivate_plugin_title, - $deactivate_plugin_desc - ) - ) - ); - break; -// default: -// $message = $this->get_text_inline( 'connectivity-test-fails-message' ); -// break; - } - } - - $message_id = 'failed_connect_api'; - $type = 'error'; - - $connectivity_test_fails_message = $this->esc_html_inline( 'From unknown reason, the API connectivity test failed.', 'connectivity-test-fails-message' ); - - if ( false === $message ) { - if ( $is_first_failure ) { - // First attempt failed. - $message = sprintf( - $x_requires_access_to_api . ' ' . - $connectivity_test_fails_message . ' ' . - $this->esc_html_inline( 'It\'s probably a temporary issue on our end. Just to be sure, with your permission, would it be o.k to run another connectivity test?', 'connectivity-test-maybe-temporary' ) . '

    ' . - '%s', - '' . $this->get_plugin_name() . '', - sprintf( - '
    %s %s
    ', - sprintf( - '%s', - $this->get_text_inline( 'Yes - do your thing', 'yes-do-your-thing' ) - ), - sprintf( - '%s', - wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), - $this->get_text_inline( 'No - just deactivate', 'no-deactivate' ) - ) - ) - ); - - $message_id = 'failed_connect_api_first'; - $type = 'promotion'; - } else { - // Second connectivity attempt failed. - $message = sprintf( - $x_requires_access_to_api . ' ' . - $connectivity_test_fails_message . ' ' . - $happy_to_resolve_issue_asap . - ' %s', - '' . $this->get_plugin_name() . '', - sprintf( - '
    1. %s
    2. %s
    3. %s
    ', - sprintf( - '%s%s', - $fix_issue_title, - ' - ' . sprintf( - $fix_issue_desc, - '' . $admin_email . '' - ) - ), - sprintf( - '%s - %s', - sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ), - $install_previous_title, - $install_previous_desc - ), - sprintf( - '%s - %s', - wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), - $deactivate_plugin_title, - $deactivate_plugin_desc - ) - ) - ); - } - } - - $this->_admin_notices->add_sticky( - $message, - $message_id, - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - $type - ); - } - - /** - * Handle user request to resolve connectivity issue. - * This method will send an email to Freemius API technical staff for resolution. - * The email will contain server's info and installed plugins (might be caching issue). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - function _email_about_firewall_issue() { - $this->_admin_notices->remove_sticky( 'failed_connect_api' ); - - $pong = $this->ping(); - - $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong ); - - if ( $is_connected ) { - FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); - - $this->store_connectivity_info( $pong, $is_connected ); - - echo $this->get_after_plugin_activation_redirect_url(); - exit; - } - - $current_user = self::_get_current_wp_user(); - $admin_email = $current_user->user_email; - - $error_type = fs_request_get( 'error_type', 'general' ); - - switch ( $error_type ) { - case 'squid': - $title = 'Squid ACL Blocking Issue'; - break; - case 'cloudflare': - $title = 'CloudFlare Blocking Issue'; - break; - default: - $title = 'API Connectivity Issue'; - break; - } - - $custom_email_sections = array(); - - // Add 'API Error' custom email section. - $custom_email_sections['api_error'] = array( - 'title' => 'API Error', - 'rows' => array( - 'ping' => array( - 'API Error', - is_string( $pong ) ? htmlentities( $pong ) : json_encode( $pong ) - ), - ) - ); - - // Send email with technical details to resolve API connectivity issues. - $this->send_email( - 'api@freemius.com', // recipient - $title . ' [' . $this->get_plugin_name() . ']', // subject - $custom_email_sections, - array( "Reply-To: $admin_email <$admin_email>" ) // headers - ); - - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( 'Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience.', 'fix-request-sent-message' ), - '' . $admin_email . '' - ), - 'server_details_sent' - ); - - // Action was taken, tell that API connectivity troubleshooting should be off now. - - echo "1"; - exit; - } - - /** - * Handle connectivity test retry approved by the user. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - */ - function _retry_connectivity_test() { - $this->_admin_notices->remove_sticky( 'failed_connect_api_first' ); - - $pong = $this->ping(); - - $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong ); - - if ( $is_connected ) { - FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); - - $this->store_connectivity_info( $pong, $is_connected ); - - echo $this->get_after_plugin_activation_redirect_url(); - } else { - // Add connectivity issue message after 2nd failed attempt. - $this->_add_connectivity_issue_message( $pong, false ); - - echo "1"; - } - - exit; - } - - static function _add_firewall_issues_javascript() { - $params = array(); - fs_require_once_template( 'firewall-issues-js.php', $params ); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Email - #---------------------------------------------------------------------------------- - - /** - * Generates and sends an HTML email with customizable sections. - * - * @author Leo Fajardo (@leorw) - * @since 1.1.2 - * - * @param string $to_address - * @param string $subject - * @param array $sections - * @param array $headers - * - * @return bool Whether the email contents were sent successfully. - */ - private function send_email( - $to_address, - $subject, - $sections = array(), - $headers = array() - ) { - $default_sections = $this->get_email_sections(); - - // Insert new sections or replace the default email sections. - if ( is_array( $sections ) && ! empty( $sections ) ) { - foreach ( $sections as $section_id => $custom_section ) { - if ( ! isset( $default_sections[ $section_id ] ) ) { - // If the section does not exist, add it. - $default_sections[ $section_id ] = $custom_section; - } else { - // If the section already exists, override it. - $current_section = $default_sections[ $section_id ]; - - // Replace the current section's title if a custom section title exists. - if ( isset( $custom_section['title'] ) ) { - $current_section['title'] = $custom_section['title']; - } - - // Insert new rows under the current section or replace the default rows. - if ( isset( $custom_section['rows'] ) && is_array( $custom_section['rows'] ) && ! empty( $custom_section['rows'] ) ) { - foreach ( $custom_section['rows'] as $row_id => $row ) { - $current_section['rows'][ $row_id ] = $row; - } - } - - $default_sections[ $section_id ] = $current_section; - } - } - } - - $vars = array( 'sections' => $default_sections ); - $message = fs_get_template( 'email.php', $vars ); - - // Set the type of email to HTML. - $headers[] = 'Content-type: text/html; charset=UTF-8'; - - $header_string = implode( "\r\n", $headers ); - - return wp_mail( - $to_address, - $subject, - $message, - $header_string - ); - } - - /** - * Generates the data for the sections of the email content. - * - * @author Leo Fajardo (@leorw) - * @since 1.1.2 - * - * @return array - */ - private function get_email_sections() { - // Retrieve the current user's information so that we can get the user's email, first name, and last name below. - $current_user = self::_get_current_wp_user(); - - // Retrieve the cURL version information so that we can get the version number below. - $curl_version_information = curl_version(); - - $active_plugin = self::get_active_plugins(); - - // Generate the list of active plugins separated by new line. - $active_plugin_string = ''; - foreach ( $active_plugin as $plugin ) { - $active_plugin_string .= sprintf( - '%s [v%s]
    ', - $plugin['PluginURI'], - $plugin['Name'], - $plugin['Version'] - ); - } - - $server_ip = WP_FS__REMOTE_ADDR; - - // Add PHP info for deeper investigation. - ob_start(); - phpinfo(); - $php_info = ob_get_clean(); - - $api_domain = substr( FS_API__ADDRESS, strpos( FS_API__ADDRESS, ':' ) + 3 ); - - // Generate the default email sections. - $sections = array( - 'sdk' => array( - 'title' => 'SDK', - 'rows' => array( - 'fs_version' => array( 'FS Version', $this->version ), - 'curl_version' => array( 'cURL Version', $curl_version_information['version'] ) - ) - ), - 'plugin' => array( - 'title' => ucfirst( $this->get_module_type() ), - 'rows' => array( - 'name' => array( 'Name', $this->get_plugin_name() ), - 'version' => array( 'Version', $this->get_plugin_version() ) - ) - ), - 'api' => array( - 'title' => 'API Subdomain', - 'rows' => array( - 'dns' => array( - 'DNS_CNAME', - function_exists( 'dns_get_record' ) ? - var_export( dns_get_record( $api_domain, DNS_CNAME ), true ) : - 'dns_get_record() disabled/blocked' - ), - 'ip' => array( - 'IP', - function_exists( 'gethostbyname' ) ? - gethostbyname( $api_domain ) : - 'gethostbyname() disabled/blocked' - ), - ), - ), - 'site' => array( - 'title' => 'Site', - 'rows' => array( - 'unique_id' => array( 'Unique ID', $this->get_anonymous_id() ), - 'address' => array( 'Address', site_url() ), - 'host' => array( - 'HTTP_HOST', - ( ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '' ) - ), - 'hosting' => array( - 'Hosting Company' => fs_request_has( 'hosting_company' ) ? - fs_request_get( 'hosting_company' ) : - 'Unknown', - ), - 'server_addr' => array( - 'SERVER_ADDR', - '' . $server_ip . '' - ) - ) - ), - 'user' => array( - 'title' => 'User', - 'rows' => array( - 'email' => array( 'Email', $current_user->user_email ), - 'first' => array( 'First', $current_user->user_firstname ), - 'last' => array( 'Last', $current_user->user_lastname ) - ) - ), - 'plugins' => array( - 'title' => 'Plugins', - 'rows' => array( - 'active_plugins' => array( 'Active Plugins', $active_plugin_string ) - ) - ), - 'php_info' => array( - 'title' => 'PHP Info', - 'rows' => array( - 'info' => array( $php_info ) - ), - ) - ); - - // Allow the sections to be modified by other code. - $sections = $this->apply_filters( 'email_template_sections', $sections ); - - return $sections; - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Initialization - #---------------------------------------------------------------------------------- - - /** - * Init plugin's Freemius instance. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param number $id - * @param string $public_key - * @param bool $is_live - * @param bool $is_premium - */ - function init( $id, $public_key, $is_live = true, $is_premium = true ) { - $this->_logger->entrance(); - - $this->dynamic_init( array( - 'id' => $id, - 'public_key' => $public_key, - 'is_live' => $is_live, - 'is_premium' => $is_premium, - ) ); - } - - /** - * Dynamic initiator, originally created to support initiation - * with parent_id for add-ons. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param array $plugin_info - * - * @throws Freemius_Exception - */ - function dynamic_init( array $plugin_info ) { - $this->_logger->entrance(); - - $this->parse_settings( $plugin_info ); - - $this->register_after_settings_parse_hooks(); - - if ( $this->should_stop_execution() ) { - return; - } - - if ( ! $this->is_registered() ) { - if ( $this->is_anonymous() ) { - // If user skipped, no need to test connectivity. - $this->_has_api_connection = true; - $this->_is_on = true; - } else { - if ( ! $this->has_api_connectivity() ) { - if ( $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) || - $this->_admin_notices->has_sticky( 'failed_connect_api' ) - ) { - if ( ! $this->_enable_anonymous || $this->is_premium() ) { - // If anonymous mode is disabled, add firewall admin-notice message. - add_action( 'admin_footer', array( 'Freemius', '_add_firewall_issues_javascript' ) ); - - $ajax_action_suffix = $this->_slug . ( $this->is_theme() ? ':theme' : '' ); - add_action( "wp_ajax_fs_resolve_firewall_issues_{$ajax_action_suffix}", array( - &$this, - '_email_about_firewall_issue' - ) ); - - add_action( "wp_ajax_fs_retry_connectivity_test_{$ajax_action_suffix}", array( - &$this, - '_retry_connectivity_test' - ) ); - - /** - * Currently the admin notice manager relies on the module's type and slug. The new AJAX actions manager uses module IDs, hence, consider to replace the if block above with the commented code below after adjusting the admin notices manager to work with module IDs. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - /*$this->add_ajax_action( 'resolve_firewall_issues', array( - &$this, - '_email_about_firewall_issue' - ) ); - - $this->add_ajax_action( 'retry_connectivity_test', array( - &$this, - '_retry_connectivity_test' - ) );*/ - } - } - - return; - } else { - $this->_admin_notices->remove_sticky( array( - 'failed_connect_api_first', - 'failed_connect_api', - ) ); - - if ( $this->_anonymous_mode ) { - // Simulate anonymous mode. - $this->_is_anonymous = true; - } - } - } - } - - /** - * This should be executed even if Freemius is off for the core module, - * otherwise, the add-ons dialogbox won't work properly. This is esepcially - * relevant when the developer decided to turn FS off for existing users. - * - * @author Vova Feldman (@svovaf) - */ - if ( $this->is_user_in_admin() && - 'plugin-information' === fs_request_get( 'tab', false ) && - $this->should_use_freemius_updater_and_dialog() && - ( - ( $this->is_addon() && $this->get_slug() == fs_request_get( 'plugin', false ) ) || - ( $this->has_addons() && $this->get_id() == fs_request_get( 'parent_plugin_id', false ) ) - ) - ) { - require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php'; - - new FS_Plugin_Info_Dialog( $this->is_addon() ? $this->get_parent_instance() : $this ); - } - - // Check if Freemius is on for the current plugin. - // This MUST be executed after all the plugin variables has been loaded. - if ( ! $this->is_registered() && ! $this->is_on() ) { - return; - } - - if ( $this->has_api_connectivity() ) { - if ( self::is_cron() ) { - $this->hook_callback_to_sync_cron(); - } else if ( $this->is_user_in_admin() ) { - /** - * Schedule daily data sync cron if: - * - * 1. User opted-in (for tracking). - * 2. If skipped, but later upgraded (opted-in via upgrade). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - */ - if ( $this->is_registered() ) { - if ( ! $this->is_sync_cron_on() && $this->is_tracking_allowed() ) { - $this->schedule_sync_cron(); - } - } - - /** - * Check if requested for manual blocking background sync. - */ - if ( fs_request_has( 'background_sync' ) ) { - $this->run_manual_sync(); - } - } - } - - if ( $this->is_registered() ) { - $this->hook_callback_to_install_sync(); - } - - if ( $this->is_addon() ) { - if ( $this->is_parent_plugin_installed() ) { - // Link to parent FS. - $this->_parent = self::get_instance_by_id( $this->_plugin->parent_plugin_id ); - - // Get parent plugin reference. - $this->_parent_plugin = $this->_parent->get_plugin(); - } - } - - if ( $this->is_user_in_admin() ) { - if ( $this->is_addon() ) { - if ( ! $this->is_parent_plugin_installed() ) { - $parent_name = $this->get_option( $plugin_info, 'parent_name', null ); - - if ( isset( $plugin_info['parent'] ) ) { - $parent_name = $this->get_option( $plugin_info['parent'], 'name', null ); - } - - $this->_admin_notices->add( - ( ! empty( $parent_name ) ? - sprintf( $this->get_text_x_inline( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'addon-x-cannot-run-without-y' ), $this->get_plugin_name(), $parent_name ) : - sprintf( $this->get_text_x_inline( '%s cannot run without the plugin.', 'addonX cannot run...', 'addon-x-cannot-run-without-parent' ), $this->get_plugin_name() ) - ), - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error' - ); - - return; - } else { - $is_network_admin = fs_is_network_admin(); - - if ( ! $this->_parent->is_registered() && $this->is_registered() ) { - // If add-on activated and parent not, automatically install parent for the user. - $this->activate_parent_account( $this->_parent ); - } else if ( - $this->_parent->is_registered() && - ! $this->is_registered() && - /** - * If not registered for add-on and the following conditions for the add-on are met, activate add-on account. - * * Network active and in network admin - network activate add-on account. - * * Network active and not in network admin - activate add-on account for the current blog. - * * Not network active and not in network admin - activate add-on account for the current blog. - * - * If not registered for add-on, not network active, and in network admin, do not handle the add-on activation. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - ( $this->is_network_active() || ! $is_network_admin ) - ) { - $premium_license = null; - - if ( - ! $this->has_free_plan() && - $this->is_bundle_license_auto_activation_enabled() && - $this->_parent->is_activated_with_bundle_license() - ) { - /** - * If the add-on has no free plan, try to activate the account only when there's a bundle license. - * - * @author Leo Fajardo (@leorw) - * @since 2.4.0 - */ - $bundle_license = $this->get_active_parent_license( $this->_parent->_get_license()->secret_key, false ); - - if ( - is_object( $bundle_license ) && - ! empty( $bundle_license->products ) && - in_array( $this->get_id(), $bundle_license->products ) - ) { - $premium_license = $bundle_license; - } - } - - if ( $this->has_free_plan() || is_object( $premium_license) ) { - // If parent plugin activated, automatically install add-on for the user. - $this->_activate_addon_account( - $this->_parent, - ( $this->is_network_active() && $is_network_admin ) ? - true : - get_current_blog_id(), - $premium_license - ); - } - } - - // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic. - if ( $this->is_premium() ) { - // Remove add-on download admin-notice. - $this->_parent->_admin_notices->remove_sticky( array( - 'addon_plan_upgraded_' . $this->_slug, - 'no_addon_license_' . $this->_slug, - ) ); - } - -// $this->deactivate_premium_only_addon_without_license(); - } - } - - add_action( 'admin_init', array( &$this, '_admin_init_action' ) ); - -// if ( $this->is_registered() || -// $this->is_anonymous() || -// $this->is_pending_activation() -// ) { -// $this->_init_admin(); -// } - } - - /** - * Should be called outside `$this->is_user_in_admin()` scope - * because the updater has some logic that needs to be executed - * during AJAX calls. - * - * Currently we need to hook to the `http_request_host_is_external` filter. - * In the future, there might be additional logic added. - * - * @author Vova Feldman - * @since 1.2.1.6 - */ - if ( - $this->should_use_freemius_updater_and_dialog() && - ( - $this->is_premium() || - /** - * If not premium but the premium version is installed, also instantiate the updater so that the - * plugin information dialog of the premium version will have the information from the server. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->premium_plugin_basename() ) ) ) - ) && - $this->has_release_on_freemius() - ) { - FS_Plugin_Updater::instance( $this ); - } - - $this->do_action( 'initiated' ); - - if ( $this->_storage->prev_is_premium !== $this->_plugin->is_premium ) { - if ( isset( $this->_storage->prev_is_premium ) ) { - $this->apply_filters( - 'after_code_type_change', - // New code type. - $this->_plugin->is_premium - ); - } else { - // Set for code type for the first time. - $this->_storage->prev_is_premium = $this->_plugin->is_premium; - } - } - - if ( ! $this->is_addon() ) { - if ( $this->is_registered() ) { - // Fix for upgrade from versions < 1.0.9. - if ( ! isset( $this->_storage->activation_timestamp ) ) { - $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME; - } - - $this->do_action( 'after_init_plugin_registered' ); - } else if ( $this->is_anonymous() ) { - $this->do_action( 'after_init_plugin_anonymous' ); - } else if ( $this->is_pending_activation() ) { - $this->do_action( 'after_init_plugin_pending_activations' ); - } - } else { - if ( $this->is_registered() ) { - $this->do_action( 'after_init_addon_registered' ); - } else if ( $this->is_anonymous() ) { - $this->do_action( 'after_init_addon_anonymous' ); - } else if ( $this->is_pending_activation() ) { - $this->do_action( 'after_init_addon_pending_activations' ); - } - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - * - * @return bool - */ - private function should_use_freemius_updater_and_dialog() { - return ( - /** - * Allow updater and dialog when the `fs_allow_updater_and_dialog` URL query param exists and has `true` - * value, or when the current page is not the "Add Plugins" page (/plugin-install.php) and the `action` - * URL query param doesn't exist or its value is not `install-plugin` so that there will be no conflicts - * with the .org plugins' functionalities (e.g. installation from the "Add Plugins" page and viewing - * plugin details from .org). - */ - ( true === fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) || - ( - ! self::is_plugin_install_page() && - // Disallow updater and dialog when installing a plugin, otherwise .org "add-on" plugins will be affected. - ( 'install-plugin' !== fs_request_get( 'action' ) ) - ) - ); - } - - /** - * @author Leo Fajardo (@leorw) - * - * @since 1.2.1.5 - */ - function _stop_tracking_callback() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'stop_tracking' ); - - $result = $this->stop_tracking( fs_is_network_admin() ); - - if ( true === $result ) { - self::shoot_ajax_success(); - } - - $this->_logger->api_error( $result ); - - self::shoot_ajax_failure( - sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) . - ( $this->is_api_error( $result ) && isset( $result->error ) ? - $result->error->message : - var_export( $result, true ) ) - ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - */ - function _allow_tracking_callback() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'allow_tracking' ); - - $result = $this->allow_tracking( fs_is_network_admin() ); - - if ( true === $result ) { - self::shoot_ajax_success(); - } - - $this->_logger->api_error( $result ); - - self::shoot_ajax_failure( - sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) . - ( $this->is_api_error( $result ) && isset( $result->error ) ? - $result->error->message : - var_export( $result, true ) ) - ); - } - - /** - * Opt-out from usage tracking. - * - * Note: This will not delete the account information but will stop all tracking. - * - * Returns: - * 1. FALSE - If the user never opted-in. - * 2. TRUE - If successfully opted-out. - * 3. object - API result on failure. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @return bool|object - */ - function stop_site_tracking() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - // User never opted-in. - return false; - } - - if ( $this->is_tracking_prohibited() ) { - // Already disconnected. - return true; - } - - // Send update to FS. - $result = $this->get_api_site_scope()->call( '/?fields=is_disconnected', 'put', array( - 'is_disconnected' => true - ) ); - - if ( ! $this->is_api_result_entity( $result ) || - ! isset( $result->is_disconnected ) || - ! $result->is_disconnected - ) { - $this->_logger->api_error( $result ); - - return $result; - } - - $this->_site->is_disconnected = $result->is_disconnected; - $this->_store_site(); - - $this->clear_sync_cron(); - - // Successfully disconnected. - return true; - } - - /** - * Opt-out network from usage tracking. - * - * Note: This will not delete the account information but will stop all tracking. - * - * Returns: - * 1. FALSE - If the user never opted-in. - * 2. TRUE - If successfully opted-out. - * 3. object - API result on failure. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @return bool|object - */ - function stop_network_tracking() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - // User never opted-in. - return false; - } - - $install_id_2_blog_id = array(); - $installs_map = $this->get_blog_install_map(); - - $opt_out_all = true; - - $params = array(); - foreach ( $installs_map as $blog_id => $install ) { - if ( $install->is_tracking_prohibited() ) { - // Already opted-out. - continue; - } - - if ( $this->is_site_delegated_connection( $blog_id ) ) { - // Opt-out only from non-delegated installs. - $opt_out_all = false; - continue; - } - - $params[] = array( 'id' => $install->id ); - - $install_id_2_blog_id[ $install->id ] = $blog_id; - } - - if ( empty( $install_id_2_blog_id ) ) { - return true; - } - - $params[] = array( 'is_disconnected' => true ); - - // Send update to FS. - $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params ); - - if ( ! $this->is_api_result_object( $result, 'installs' ) ) { - $this->_logger->api_error( $result ); - - return $result; - } - - foreach ( $result->installs as $r_install ) { - $blog_id = $install_id_2_blog_id[ $r_install->id ]; - $install = $installs_map[ $blog_id ]; - $install->is_disconnected = $r_install->is_disconnected; - $this->_store_site( true, $blog_id, $install ); - } - - $this->clear_sync_cron( $opt_out_all ); - - // Successfully disconnected. - return true; - } - - /** - * Opt-out from usage tracking. - * - * Note: This will not delete the account information but will stop all tracking. - * - * Returns: - * 1. FALSE - If the user never opted-in. - * 2. TRUE - If successfully opted-out. - * 3. object - API result on failure. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @param bool $is_network_action - * - * @return bool|object - */ - function stop_tracking( $is_network_action = false ) { - $this->_logger->entrance(); - - return $is_network_action ? - $this->stop_network_tracking() : - $this->stop_site_tracking(); - } - - /** - * Opt-in back into usage tracking. - * - * Note: This will only work if the user opted-in previously. - * - * Returns: - * 1. FALSE - If the user never opted-in. - * 2. TRUE - If successfully opted-in back to usage tracking. - * 3. object - API result on failure. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @return bool|object - */ - function allow_site_tracking() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - // User never opted-in. - return false; - } - - if ( $this->is_tracking_allowed() ) { - // Tracking already allowed. - return true; - } - - $result = $this->get_api_site_scope()->call( '/?is_disconnected', 'put', array( - 'is_disconnected' => false - ) ); - - if ( ! $this->is_api_result_entity( $result ) || - ! isset( $result->is_disconnected ) || - $result->is_disconnected - ) { - $this->_logger->api_error( $result ); - - return $result; - } - - $this->_site->is_disconnected = $result->is_disconnected; - $this->_store_site(); - - $this->schedule_sync_cron(); - - // Successfully reconnected. - return true; - } - - /** - * Opt-in network back into usage tracking. - * - * Note: This will only work if the user opted-in previously. - * - * Returns: - * 1. FALSE - If the user never opted-in. - * 2. TRUE - If successfully opted-in back to usage tracking. - * 3. object - API result on failure. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @return bool|object - */ - function allow_network_tracking() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - // User never opted-in. - return false; - } - - $install_id_2_blog_id = array(); - $installs_map = $this->get_blog_install_map(); - - $params = array(); - foreach ( $installs_map as $blog_id => $install ) { - if ( $install->is_tracking_allowed() ) { - continue; - } - - $params[] = array( 'id' => $install->id ); - - $install_id_2_blog_id[ $install->id ] = $blog_id; - } - - if ( empty( $install_id_2_blog_id ) ) { - return true; - } - - $params[] = array( 'is_disconnected' => false ); - - // Send update to FS. - $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params ); - - - if ( ! $this->is_api_result_object( $result, 'installs' ) ) { - $this->_logger->api_error( $result ); - - return $result; - } - - foreach ( $result->installs as $r_install ) { - $blog_id = $install_id_2_blog_id[ $r_install->id ]; - $install = $installs_map[ $blog_id ]; - $install->is_disconnected = $r_install->is_disconnected; - $this->_store_site( true, $blog_id, $install ); - } - - $this->schedule_sync_cron(); - - // Successfully reconnected. - return true; - } - - /** - * Opt-in back into usage tracking. - * - * Note: This will only work if the user opted-in previously. - * - * Returns: - * 1. FALSE - If the user never opted-in. - * 2. TRUE - If successfully opted-in back to usage tracking. - * 3. object - API result on failure. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @param bool $is_network_action - * - * @return bool|object - */ - function allow_tracking( $is_network_action = false ) { - $this->_logger->entrance(); - - return $is_network_action ? - $this->allow_network_tracking() : - $this->allow_site_tracking(); - } - - /** - * If user opted-in and later disabled usage-tracking, - * re-allow tracking for licensing and updates. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @param bool $is_context_single_site - */ - private function reconnect_locally( $is_context_single_site = false ) { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - return; - } - - if ( ! fs_is_network_admin() || $is_context_single_site ) { - if ( $this->is_tracking_prohibited() ) { - $this->_site->is_disconnected = false; - $this->_store_site(); - } - } else { - $installs_map = $this->get_blog_install_map(); - foreach ( $installs_map as $blog_id => $install ) { - /** - * @var FS_Site $install - */ - if ( $install->is_tracking_prohibited() ) { - $install->is_disconnected = false; - $this->_store_site( true, $blog_id, $install ); - } - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.2 - * - * @return bool - */ - function is_extensions_tracking_allowed() { - return ( true === $this->apply_filters( - 'is_extensions_tracking_allowed', - $this->_storage->get( 'is_extensions_tracking_allowed', true ) - ) ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.2 - */ - function _update_tracking_permission_callback() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'update_tracking_permission' ); - - $is_enabled = fs_request_get_bool( 'is_enabled', null ); - - if ( ! is_bool( $is_enabled ) ) { - self::shoot_ajax_failure(); - } - - $permission = fs_request_get( 'permission' ); - - switch ( $permission ) { - case 'extensions': - $this->update_extensions_tracking_flag( $is_enabled ); - break; - default: - $permission = 'no_match'; - } - - if ( 'no_match' === $permission ) { - self::shoot_ajax_failure(); - } - - self::shoot_ajax_success( array( - 'permissions' => array( - $permission => $is_enabled, - ) - ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - * - * @param bool $is_enabled - */ - private function update_extensions_tracking_flag( $is_enabled ) { - $this->_storage->store( 'is_extensions_tracking_allowed', $is_enabled ); - } - - /** - * Parse plugin's settings (as defined by the plugin dev). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param array $plugin_info - * - * @throws \Freemius_Exception - */ - private function parse_settings( &$plugin_info ) { - $this->_logger->entrance(); - - $id = $this->get_numeric_option( $plugin_info, 'id', false ); - $public_key = $this->get_option( $plugin_info, 'public_key', false ); - $secret_key = $this->get_option( $plugin_info, 'secret_key', null ); - $parent_id = $this->get_numeric_option( $plugin_info, 'parent_id', null ); - $parent_name = $this->get_option( $plugin_info, 'parent_name', null ); - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.9 Try to pull secret key from external config. - */ - if ( is_null( $secret_key ) && defined( "WP_FS__{$this->_slug}_SECRET_KEY" ) ) { - $secret_key = constant( "WP_FS__{$this->_slug}_SECRET_KEY" ); - } - - if ( isset( $plugin_info['parent'] ) ) { - $parent_id = $this->get_numeric_option( $plugin_info['parent'], 'id', null ); -// $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null ); -// $parent_public_key = $this->get_option( $plugin_info['parent'], 'public_key', null ); -// $parent_name = $this->get_option( $plugin_info['parent'], 'name', null ); - } - - if ( false === $id ) { - throw new Freemius_Exception( array( - 'error' => array( - 'type' => 'ParameterNotSet', - 'message' => 'Plugin id parameter is not set.', - 'code' => 'plugin_id_not_set', - 'http' => 500, - ) - ) ); - } - if ( false === $public_key ) { - throw new Freemius_Exception( array( - 'error' => array( - 'type' => 'ParameterNotSet', - 'message' => 'Plugin public_key parameter is not set.', - 'code' => 'plugin_public_key_not_set', - 'http' => 500, - ) - ) ); - } - - $plugin = ( $this->_plugin instanceof FS_Plugin ) ? - $this->_plugin : - new FS_Plugin(); - - $premium_suffix = $this->get_option( $plugin_info, 'premium_suffix', '(Premium)' ); - - $plugin->update( array( - 'id' => $id, - 'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ), - 'public_key' => $public_key, - 'slug' => $this->_slug, - 'premium_slug' => $this->get_option( $plugin_info, 'premium_slug', "{$this->_slug}-premium" ), - 'parent_plugin_id' => $parent_id, - 'version' => $this->get_plugin_version(), - 'title' => $this->get_plugin_name( $premium_suffix ), - 'file' => $this->_plugin_basename, - 'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ), - 'premium_suffix' => $premium_suffix, - 'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ), - 'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ), - 'bundle_id' => $this->get_option( $plugin_info, 'bundle_id', null ), - 'bundle_public_key' => $this->get_option( $plugin_info, 'bundle_public_key', null ), - ) ); - - if ( $plugin->is_updated() ) { - // Update plugin details. - $this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->store( $plugin ); - } - // Set the secret key after storing the plugin, we don't want to store the key in the storage. - $this->_plugin->secret_key = $secret_key; - - /** - * If the product is network integrated and activated and the current view is in the network level Admin dashboard, if the product's network-level menu located differently from the sub-site level, then use the network menu details (when set). - * - * @author Vova Feldman - * @since 2.4.5 - */ - if ( $this->is_network_active() && fs_is_network_admin() ) { - if ( isset( $plugin_info['menu_network'] ) && - is_array( $plugin_info['menu_network'] ) && - ! empty( $plugin_info['menu_network'] ) - ) { - $plugin_info['menu'] = $plugin_info['menu_network']; - } - } - - if ( ! isset( $plugin_info['menu'] ) ) { - $plugin_info['menu'] = array(); - - if ( ! empty( $this->_storage->sdk_last_version ) && - version_compare( $this->_storage->sdk_last_version, '1.1.2', '<=' ) - ) { - // Backward compatibility to 1.1.2 - $plugin_info['menu']['slug'] = isset( $plugin_info['menu_slug'] ) ? - $plugin_info['menu_slug'] : - $this->_slug; - } - } - - $this->_menu = FS_Admin_Menu_Manager::instance( - $this->_module_id, - $this->_module_type, - $this->get_unique_affix() - ); - - $this->_menu->init( $plugin_info['menu'], $this->is_addon() ); - - $this->_has_addons = $this->get_bool_option( $plugin_info, 'has_addons', false ); - $this->_has_paid_plans = $this->get_bool_option( $plugin_info, 'has_paid_plans', true ); - $this->_has_premium_version = $this->get_bool_option( $plugin_info, 'has_premium_version', $this->_has_paid_plans ); - $this->_ignore_pending_mode = $this->get_bool_option( $plugin_info, 'ignore_pending_mode', false ); - $this->_is_org_compliant = $this->get_bool_option( $plugin_info, 'is_org_compliant', true ); - $this->_is_premium_only = $this->get_bool_option( $plugin_info, 'is_premium_only', false ); - if ( $this->_is_premium_only ) { - // If premium only plugin, disable anonymous mode. - $this->_enable_anonymous = false; - $this->_anonymous_mode = false; - } else { - $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true ); - $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false ); - } - $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() ); - $this->_is_bundle_license_auto_activation_enabled = $this->get_option( $plugin_info, 'bundle_license_auto_activation', false ); - - if ( ! empty( $plugin_info['trial'] ) ) { - $this->_trial_days = $this->get_numeric_option( - $plugin_info['trial'], - 'days', - // Default to 0 - trial without days specification. - 0 - ); - - $this->_is_trial_require_payment = $this->get_bool_option( $plugin_info['trial'], 'is_require_payment', false ); - } - - $this->_navigation = $this->get_option( - $plugin_info, - 'navigation', - $this->is_free_wp_org_theme() ? - self::NAVIGATION_TABS : - self::NAVIGATION_MENU - ); - } - - /** - * @param string[] $options - * @param string $key - * @param mixed $default - * - * @return bool - */ - private function get_option( &$options, $key, $default = false ) { - return ! empty( $options[ $key ] ) ? $options[ $key ] : $default; - } - - private function get_bool_option( &$options, $key, $default = false ) { - return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default; - } - - private function get_numeric_option( &$options, $key, $default = false ) { - return isset( $options[ $key ] ) && is_numeric( $options[ $key ] ) ? $options[ $key ] : $default; - } - - /** - * Gate keeper. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @return bool - */ - private function should_stop_execution() { - if ( empty( $this->_storage->was_plugin_loaded ) ) { - /** - * Don't execute Freemius until plugin was fully loaded at least once, - * to give the opportunity for the activation hook to run before pinging - * the API for connectivity test. This logic is relevant for the - * identification of new plugin install vs. plugin update. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9 - */ - return true; - } - - if ( $this->is_activation_mode() ) { - if ( ! is_admin() ) { - /** - * If in activation mode, don't execute Freemius outside of the - * admin dashboard. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - */ - return true; - } - - if ( ! WP_FS__IS_HTTP_REQUEST ) { - /** - * If in activation and executed without HTTP context (e.g. CLI, Cronjob), - * then don't start Freemius. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.6.3 - * - * @link https://wordpress.org/support/topic/errors-in-the-freemius-class-when-running-in-wordpress-in-cli - */ - return true; - } - - if ( self::is_cron() ) { - /** - * If in activation mode, don't execute Freemius during wp crons - * (wp crons have HTTP context - called as HTTP request). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - */ - return true; - } - - if ( self::is_ajax() && - ! $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) && - ! $this->_admin_notices->has_sticky( 'failed_connect_api' ) - ) { - /** - * During activation, if running in AJAX mode, unless there's a sticky - * connectivity issue notice, don't run Freemius. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - */ - return true; - } - } - - return false; - } - - /** - * Triggered after code type has changed. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9.1 - */ - function _after_code_type_change() { - $this->_logger->entrance(); - - if ( $this->is_theme() ) { - // Expire the cache of the previous tabs since the theme may - // have setting updates after code type has changed. - $this->_cache->expire( 'tabs' ); - $this->_cache->expire( 'tabs_stylesheets' ); - } - - if ( $this->is_registered() ) { - if ( ! $this->is_addon() ) { - add_action( - is_admin() ? 'admin_init' : 'init', - array( &$this, '_plugin_code_type_changed' ) - ); - } - - if ( $this->is_premium() ) { - // Purge cached payments after switching to the premium version. - // @todo This logic doesn't handle purging the cache for serviceware module upgrade. - $this->get_api_user_scope()->purge_cache( "/plugins/{$this->_module_id}/payments.json?include_addons=true" ); - } - } - } - - /** - * Handles plugin's code type change (free <--> premium). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - function _plugin_code_type_changed() { - $this->_logger->entrance(); - - if ( $this->is_premium() ) { - $this->reconnect_locally(); - - // Activated premium code. - $this->do_action( 'after_premium_version_activation' ); - - // Remove all sticky messages related to download of the premium version. - $this->_admin_notices->remove_sticky( array( - 'trial_started', - 'plan_upgraded', - 'plan_changed', - 'license_activated', - ) ); - - $notice = ''; - if ( ! $this->is_only_premium() ) { - $notice = sprintf( $this->get_text_inline( 'Premium %s version was successfully activated.', 'premium-activated-message' ), $this->_module_type ); - } - - $license_notice = $this->get_license_network_activation_notice(); - if ( ! empty( $license_notice ) ) { - $notice .= ' ' . $license_notice; - } - - if ( ! empty( $notice ) ) { - $this->_admin_notices->add_sticky( - trim( $notice ), - 'premium_activated', - $this->get_text_x_inline( 'W00t', - 'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!' - ); - } - } else { - // Remove sticky message related to premium code activation. - $this->_admin_notices->remove_sticky( 'premium_activated' ); - - // Activated free code (after had the premium before). - $this->do_action( 'after_free_version_reactivation' ); - - if ( $this->is_paying() && ! $this->is_premium() ) { - $this->_admin_notices->add_sticky( - sprintf( - /* translators: %s: License type (e.g. you have a professional license) */ - $this->get_text_inline( 'You have a %s license.', 'you-have-x-license' ), - $this->get_plan_title() - ) . $this->get_complete_upgrade_instructions(), - 'plan_upgraded', - $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' - ); - } - } - - // Schedule code type changes event. - $this->schedule_install_sync(); - - /** - * Unregister the uninstall hook for the other version of the plugin (with different code type) to avoid - * triggering a fatal error when uninstalling that plugin. For example, after deactivating the "free" version - * of a specific plugin, its uninstall hook should be unregistered after the "premium" version has been - * activated. If we don't do that, a fatal error will occur when we try to uninstall the "free" version since - * the main file of the "free" version will be loaded first before calling the hooked callback. Since the - * free and premium versions are almost identical (same class or have same functions), a fatal error like - * "Cannot redeclare class MyClass" or "Cannot redeclare my_function()" will occur. - */ - $this->unregister_uninstall_hook(); - - $this->clear_module_main_file_cache(); - - // Update is_premium of latest version. - $this->_storage->prev_is_premium = $this->_plugin->is_premium; - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Add-ons - #---------------------------------------------------------------------------------- - - /** - * Check if add-on installed and activated on site. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param string|number $id_or_slug - * @param bool|null $is_premium Since 1.2.1.7 can check for specified add-on version. - * - * @return bool - */ - function is_addon_activated( $id_or_slug, $is_premium = null ) { - $this->_logger->entrance(); - - $addon_id = self::get_module_id( $id_or_slug ); - $is_activated = self::has_instance( $addon_id ); - - if ( ! $is_activated ) { - return false; - } - - if ( is_bool( $is_premium ) ) { - // Check if the specified code version is activate. - $addon = $this->get_addon_instance( $addon_id ); - $is_activated = ( $is_premium === $addon->is_premium() ); - } - - return $is_activated; - } - - /** - * Check if add-on was connected to install - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - * - * @param string|number $id_or_slug - * - * @return bool - */ - function is_addon_connected( $id_or_slug ) { - $this->_logger->entrance(); - - $sites = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ); - - $addon_id = self::get_module_id( $id_or_slug ); - $addon = $this->get_addon( $addon_id ); - $slug = $addon->slug; - if ( ! isset( $sites[ $slug ] ) ) { - return false; - } - - $site = $sites[ $slug ]; - - $plugin = FS_Plugin_Manager::instance( $addon_id )->get(); - - if ( $plugin->parent_plugin_id != $this->_plugin->id ) { - // The given slug do NOT belong to any of the plugin's add-ons. - return false; - } - - return ( is_object( $site ) && - is_numeric( $site->id ) && - is_numeric( $site->user_id ) && - FS_Plugin_Plan::is_valid_id( $site->plan_id ) - ); - } - - /** - * Determines if add-on installed. - * - * NOTE: This is a heuristic and only works if the folder/file named as the slug. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param string|number $id_or_slug - * - * @return bool - */ - function is_addon_installed( $id_or_slug ) { - $this->_logger->entrance(); - - $addon_id = self::get_module_id( $id_or_slug ); - - return file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->get_addon_basename( $addon_id ) ) ); - } - - /** - * Get add-on basename. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param string|number $id_or_slug - * - * @return string - */ - function get_addon_basename( $id_or_slug ) { - $addon_id = self::get_module_id( $id_or_slug ); - - if ( $this->is_addon_activated( $addon_id ) ) { - return self::instance( $addon_id )->get_plugin_basename(); - } - - $addon = $this->get_addon( $addon_id ); - $premium_basename = "{$addon->premium_slug}/{$addon->slug}.php"; - - if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) { - return $premium_basename; - } - - $all_plugins = $this->get_all_plugins(); - - foreach ( $all_plugins as $basename => $data ) { - if ( $addon->slug === $data['slug'] || - $addon->premium_slug === $data['slug'] - ) { - return $basename; - } - } - - $free_basename = "{$addon->slug}/{$addon->slug}.php"; - - return $free_basename; - } - - /** - * Get installed add-ons instances. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return Freemius[] - */ - function get_installed_addons() { - if ( $this->is_addon() ) { - // Add-on cannot have add-ons. - return array(); - } - - $installed_addons = array(); - - foreach ( self::$_instances as $instance ) { - if ( $instance->is_addon_of( $this->_plugin->id ) ) { - $installed_addons[] = $instance; - } - } - - return $installed_addons; - } - - /** - * Check if any add-ons of the plugin are installed. - * - * @author Leo Fajardo (@leorw) - * @since 1.1.1 - * - * @return bool - */ - function has_installed_addons() { - if ( ! $this->has_addons() ) { - return false; - } - - foreach ( self::$_instances as $instance ) { - if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) { - if ( $this->_plugin->id == $instance->_parent_plugin->id ) { - return true; - } - } - } - - return false; - } - - /** - * Tell Freemius that the current plugin is an add-on. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param number $parent_plugin_id The parent plugin ID - */ - function init_addon( $parent_plugin_id ) { - $this->_plugin->parent_plugin_id = $parent_plugin_id; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return bool - */ - function is_addon() { - return ( - isset( $this->_plugin->parent_plugin_id ) && - is_numeric( $this->_plugin->parent_plugin_id ) - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.2 - * - * @param number $parent_product_id - * - * @return bool - */ - function is_addon_of( $parent_product_id ) { - return ( - $this->is_addon() && - $parent_product_id == $this->_plugin->parent_plugin_id - ); - } - - /** - * Deactivate add-on if it's premium only and the user does't have a valid license. - * - * @param bool $is_after_trial_cancel - * - * @return bool If add-on was deactivated. - */ - private function deactivate_premium_only_addon_without_license( $is_after_trial_cancel = false ) { - if ( ! $this->has_free_plan() && - ! $this->has_features_enabled_license() && - ! $this->_has_premium_license() - ) { - if ( $this->is_registered() ) { - // IF wrapper is turned off because activation_timestamp is currently only stored for plugins (not addons). - // if (empty($this->_storage->activation_timestamp) || - // (WP_FS__SCRIPT_START_TIME - $this->_storage->activation_timestamp) > 30 - // ) { - /** - * @todo When it's first fail, there's no reason to try and re-sync because the licenses were just synced after initial activation. - * - * Retry syncing the user add-on licenses. - */ - // Sync licenses. - $this->_sync_licenses(); - // } - - // Try to activate premium license. - $this->_activate_license( true ); - } - - if ( ! $this->has_free_plan() && - ! $this->has_features_enabled_license() && - ! $this->_has_premium_license() - ) { - // @todo Check if deactivate plugins also call the deactivation hook. - - $this->_parent->_admin_notices->add_sticky( - sprintf( - ( $is_after_trial_cancel ? - $this->_parent->get_text_inline( - '%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you\'ll have to purchase a license.', - 'addon-trial-cancelled-message' - ) : - $this->_parent->get_text_inline( - '%s is a premium only add-on. You have to purchase a license first before activating the plugin.', - 'addon-no-license-message' - ) - ), - '' . $this->_plugin->title . '' - ) . ' ' . sprintf( - '%s  ➜', - $this->_parent->addon_url( $this->_slug ), - esc_attr( sprintf( $this->_parent->get_text_inline( 'More information about %s', 'more-information-about-x' ), $this->_plugin->title ) ), - $this->_parent->get_text_inline( 'Purchase License', 'purchase-license' ) - ), - 'no_addon_license_' . $this->_slug, - ( $is_after_trial_cancel ? '' : $this->_parent->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...' ), - ( $is_after_trial_cancel ? 'success' : 'error' ) - ); - - deactivate_plugins( array( $this->_plugin_basename ), true ); - - return true; - } - } - - return false; - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Sandbox - #---------------------------------------------------------------------------------- - - /** - * Set Freemius into sandbox mode for debugging. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param string $secret_key - */ - function init_sandbox( $secret_key ) { - $this->_plugin->secret_key = $secret_key; - - // Update plugin details. - FS_Plugin_Manager::instance( $this->_module_id )->update( $this->_plugin, true ); - } - - /** - * Check if running payments in sandbox mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @return bool - */ - function is_payments_sandbox() { - return ( ! $this->is_live() ) || isset( $this->_plugin->secret_key ); - } - - #endregion - - /** - * Check if running test vs. live plugin. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @return bool - */ - function is_live() { - return $this->_plugin->is_live; - } - - /** - * Check if super-admin skipped connection for all sites in the network. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - function is_network_anonymous() { - if ( ! $this->_is_network_active ) { - return false; - } - - $is_anonymous_ms = $this->_storage->get( 'is_anonymous_ms' ); - - if ( empty( $is_anonymous_ms ) ) { - return false; - } - - return $is_anonymous_ms['is']; - } - - /** - * Check if super-admin opted-in for all sites in the network. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - function is_network_connected() { - if ( ! $this->_is_network_active ) { - return false; - } - - return $this->_storage->get( 'is_network_connected' ); - } - - /** - * Check if the user skipped connecting the account with Freemius. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return bool - */ - function is_anonymous() { - if ( ! isset( $this->_is_anonymous ) ) { - if ( $this->is_network_anonymous() ) { - $this->_is_anonymous = true; - } else if ( ! fs_is_network_admin() ) { - if ( ! isset( $this->_storage->is_anonymous ) ) { - // Not skipped. - $this->_is_anonymous = false; - } else if ( is_bool( $this->_storage->is_anonymous ) ) { - // For back compatibility, since the variable was boolean before. - $this->_is_anonymous = $this->_storage->is_anonymous; - - // Upgrade stored data format to 1.1.3 format. - $this->set_anonymous_mode( $this->_storage->is_anonymous ); - } else { - // Version 1.1.3 and later. - $this->_is_anonymous = $this->_storage->is_anonymous['is']; - } - } - } - - return $this->_is_anonymous; - } - - /** - * Check if the user skipped the connection of a specified site. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id - * - * @return bool - */ - function is_anonymous_site( $blog_id = 0 ) { - if ( $this->is_network_anonymous() ) { - return true; - } - - $is_anonymous = $this->_storage->get( 'is_anonymous', false, $blog_id ); - - if ( empty( $is_anonymous ) ) { - return false; - } - - return $is_anonymous['is']; - } - - /** - * Check if user connected his account and install pending email activation. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return bool - */ - function is_pending_activation() { - return $this->_storage->get( 'is_pending_activation', false ); - } - - /** - * Check if plugin must be WordPress.org compliant. - * - * @since 1.0.7 - * - * @return bool - */ - function is_org_repo_compliant() { - return $this->_is_org_compliant; - } - - #-------------------------------------------------------------------------------- - #region WP Cron Common - #-------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * - * @return object - */ - private function get_cron_data( $name ) { - $this->_logger->entrance( $name ); - - /** - * @var object $cron_data - */ - return $this->_storage->get( "{$name}_cron", null ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - */ - private function clear_cron_data( $name ) { - $this->_logger->entrance( $name ); - - $this->_storage->remove( "{$name}_cron" ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * @param int $cron_blog_id The cron executing blog ID. - */ - private function set_cron_data( $name, $cron_blog_id = 0 ) { - $this->_logger->entrance( $name ); - - $this->_storage->store( "{$name}_cron", (object) array( - 'version' => $this->get_plugin_version(), - 'blog_id' => $cron_blog_id, - 'sdk_version' => $this->version, - 'timestamp' => WP_FS__SCRIPT_START_TIME, - 'on' => true, - ) ); - } - - /** - * Get the cron's executing blog ID. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * - * @return int - */ - private function get_cron_blog_id( $name ) { - $this->_logger->entrance( $name ); - - /** - * @var object $cron_data - */ - $cron_data = $this->get_cron_data( $name ); - - return ( is_object( $cron_data ) && is_numeric( $cron_data->blog_id ) ) ? - $cron_data->blog_id : - 0; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * - * @return bool - */ - private function is_cron_on( $name ) { - $this->_logger->entrance( $name ); - - /** - * @var object $cron_data - */ - $cron_data = $this->get_cron_data( $name ); - - return ( ! is_null( $cron_data ) && true === $cron_data->on ); - } - - /** - * Unix timestamp for previous cron execution or false if never executed. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * - * @return int|false - */ - private function cron_last_execution( $name ) { - $this->_logger->entrance( $name ); - - return $this->_storage->get( "{$name}_timestamp" ); - } - - /** - * Set cron execution time to now. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - */ - private function set_cron_execution_timestamp( $name ) { - $this->_logger->entrance( $name ); - - $this->_storage->store( "{$name}_timestamp", time() ); - } - - /** - * Sets the keepalive time to now. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - * - * @param bool|null $use_network_level_storage - */ - private function set_keepalive_timestamp( $use_network_level_storage = null ) { - $this->_logger->entrance(); - - $this->_storage->store( 'keepalive_timestamp', time(), $use_network_level_storage ); - } - - /** - * Check if cron was executed in the last $period of seconds. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * @param int $period In seconds - * - * @return bool - */ - private function is_cron_executed( $name, $period = WP_FS__TIME_24_HOURS_IN_SEC ) { - $this->_logger->entrance( $name ); - - $last_execution = $this->cron_last_execution( $name ); - - if ( ! is_numeric( $last_execution ) ) { - return false; - } - - return ( $last_execution > ( WP_FS__SCRIPT_START_TIME - $period ) ); - } - - /** - * WP Cron is executed on a site level. When running in a multisite network environment - * with the network integration activated, for optimization reasons, we are consolidating - * the installs data sync cron to be executed only from a single site. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $except_blog_id Target any except the excluded blog ID. - * - * @return int - */ - private function get_cron_target_blog_id( $except_blog_id = 0 ) { - if ( ! is_multisite() ) { - return 0; - } - - if ( $this->_is_network_active && - is_numeric( $this->_storage->network_install_blog_id ) && - $except_blog_id != $this->_storage->network_install_blog_id && - self::is_site_active( $this->_storage->network_install_blog_id ) - ) { - // Try to run cron from the main network blog. - $install = $this->get_install_by_blog_id( $this->_storage->network_install_blog_id ); - - if ( is_object( $install ) && - ( $this->is_premium() || $install->is_tracking_allowed() ) - ) { - return $this->_storage->network_install_blog_id; - } - } - - // Get first opted-in blog ID with active tracking. - $installs = $this->get_blog_install_map(); - foreach ( $installs as $blog_id => $install ) { - if ( $except_blog_id != $blog_id && - self::is_site_active( $blog_id ) && - ( $this->is_premium() || $install->is_tracking_allowed() ) - ) { - return $blog_id; - } - } - - return 0; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * @param string $action_tag Callback action tag. - * @param bool $is_network_clear If set to TRUE, clear sync cron even if there are installs that are still connected. - */ - private function clear_cron( $name, $action_tag = '', $is_network_clear = false ) { - $this->_logger->entrance( $name ); - - if ( ! $this->is_cron_on( $name ) ) { - return; - } - - $clear_cron = true; - if ( ! $is_network_clear && $this->_is_network_active ) { - $installs = $this->get_blog_install_map(); - - foreach ( $installs as $blog_id => $install ) { - /** - * @var FS_Site $install - */ - if ( $install->is_tracking_allowed() ) { - $clear_cron = false; - break; - } - } - } - - if ( ! $clear_cron ) { - return; - } - - /** - * @var object $cron_data - */ - $cron_data = $this->get_cron_data( $name ); - - $cron_blog_id = is_object( $cron_data ) && isset( $cron_data->blog_id ) ? - $cron_data->blog_id : - 0; - - $this->clear_cron_data( $name ); - - if ( 0 < $cron_blog_id ) { - switch_to_blog( $cron_blog_id ); - } - - if ( empty( $action_tag ) ) { - $action_tag = $name; - } - - wp_clear_scheduled_hook( $this->get_action_tag( $action_tag ) ); - - if ( 0 < $cron_blog_id ) { - restore_current_blog(); - } - } - - /** - * Unix timestamp for next cron execution or false if not scheduled. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * @param string $action_tag Callback action tag. - * - * @return int|false - */ - private function get_next_scheduled_cron( $name, $action_tag = '' ) { - $this->_logger->entrance( $name ); - - if ( ! $this->is_cron_on( $name ) ) { - return false; - } - - /** - * @var object $cron_data - */ - $cron_data = $this->get_cron_data( $name ); - - $cron_blog_id = is_object( $cron_data ) && isset( $cron_data->blog_id ) ? - $cron_data->blog_id : - 0; - - if ( 0 < $cron_blog_id ) { - switch_to_blog( $cron_blog_id ); - } - - if ( empty( $action_tag ) ) { - $action_tag = $name; - } - - $next_scheduled = wp_next_scheduled( $this->get_action_tag( $action_tag ) ); - - if ( 0 < $cron_blog_id ) { - restore_current_blog(); - } - - return $next_scheduled; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * @param string $action_tag Callback action tag. - * @param string $recurrence 'single' or 'daily'. - * @param int $start_at Defaults to now. - * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise, schedule job to start right away. - * @param int $except_blog_id Target any except the excluded blog ID. - */ - private function schedule_cron( - $name, - $action_tag = '', - $recurrence = 'single', - $start_at = WP_FS__SCRIPT_START_TIME, - $randomize_start = true, - $except_blog_id = 0 - ) { - $this->_logger->entrance( $name ); - - $this->clear_cron( $name, $action_tag, true ); - - $cron_blog_id = $this->get_cron_target_blog_id( $except_blog_id ); - - if ( is_multisite() && 0 == $cron_blog_id ) { - // Don't schedule cron since couldn't find a target blog. - return; - } - - if ( 0 < $cron_blog_id ) { - switch_to_blog( $cron_blog_id ); - } - - if ( 'daily' === $recurrence ) { - if ( $randomize_start ) { - // Schedule first sync with a random 12 hour time range from now. - $start_at += rand( 0, ( WP_FS__TIME_24_HOURS_IN_SEC / 2 ) ); - } - - // Schedule daily WP cron. - wp_schedule_event( - $start_at, - 'daily', - $this->get_action_tag( $action_tag ) - ); - } else if ( 'single' === $recurrence ) { - // Schedule single cron. - wp_schedule_single_event( - $start_at, - $this->get_action_tag( $action_tag ) - ); - } - - $this->set_cron_data( $name, $cron_blog_id ); - - if ( 0 < $cron_blog_id ) { - restore_current_blog(); - } - } - - /** - * Consolidated cron execution for performance optimization. The max number of API requests is based on the number of unique opted-in users. - * that doesn't halt page loading. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string $name Cron name. - * @param callable $callable The function that should be executed. - */ - private function execute_cron( $name, $callable ) { - $this->_logger->entrance( $name ); - - // Store the last time data sync was executed. - $this->set_cron_execution_timestamp( $name ); - - // Check if API is temporary down. - if ( FS_Api::is_temporary_down() ) { - return; - } - - // @todo Add logic that identifies API latency, and reschedule the next background sync randomly between 8-16 hours. - - $users_2_blog_ids = array(); - - if ( ! is_multisite() ) { - // Add dummy blog. - $users_2_blog_ids[0] = array( 0 ); - } else { - $installs = $this->get_blog_install_map(); - foreach ( $installs as $blog_id => $install ) { - if ( $this->is_premium() || $install->is_tracking_allowed() ) { - if ( ! isset( $users_2_blog_ids[ $install->user_id ] ) ) { - $users_2_blog_ids[ $install->user_id ] = array(); - } - - $users_2_blog_ids[ $install->user_id ][] = $blog_id; - } - } - } - - $current_blog_id = get_current_blog_id(); - - foreach ( $users_2_blog_ids as $user_id => $blog_ids ) { - if ( 0 < $blog_ids[0] ) { - $this->switch_to_blog( $blog_ids[0] ); - } - - call_user_func_array( $callable, array( $blog_ids, ( is_multisite() ? $current_blog_id : null ) ) ); - - foreach ( $blog_ids as $blog_id ) { - $this->do_action( "after_{$name}_cron", $blog_id ); - } - } - - if ( is_multisite() ) { - $this->switch_to_blog( $current_blog_id, fs_is_network_admin() ? $this->get_network_install() : null ); - - $this->do_action( "after_{$name}_cron_multisite" ); - } - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Daily Sync Cron - #---------------------------------------------------------------------------------- - - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return bool - */ - private function is_sync_cron_scheduled() { - return $this->is_cron_on( 'sync' ); - } - - /** - * Get the sync cron's executing blog ID. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return int - */ - private function get_sync_cron_blog_id() { - return $this->get_cron_blog_id( 'sync' ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - */ - private function run_manual_sync() { - self::require_pluggable_essentials(); - - if ( ! $this->is_user_admin() ) { - return; - } - - // Run manual sync. - $this->_sync_cron(); - - // Reschedule next cron to run 24 hours from now (performance optimization). - $this->schedule_sync_cron( time() + WP_FS__TIME_24_HOURS_IN_SEC, false ); - } - - /** - * Data sync cron job. Replaces the background sync non blocking HTTP request - * that doesn't halt page loading. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * @since 2.0.0 Consolidate all the data sync into the same cron for performance optimization. The max number of API requests is based on the number of unique opted-in users. - */ - function _sync_cron() { - $this->_logger->entrance(); - - $this->execute_cron( 'sync', array( &$this, '_sync_cron_method' ) ); - } - - /** - * The actual data sync cron logic. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int[] $blog_ids - * @param int|null $current_blog_id @since 2.2.3. This is passed from the `execute_cron` method and used by the - * `_sync_plugin_license` method in order to switch to the previous blog when sending - * updates for a single site in case `execute_cron` has switched to a different blog. - */ - function _sync_cron_method( array $blog_ids, $current_blog_id = null ) { - if ( $this->is_registered() ) { - $this->sync_user_beta_mode(); - - if ( $this->has_paid_plan() ) { - // Initiate background plan sync. - $this->_sync_license( true, false, $current_blog_id ); - - if ( $this->is_paying() ) { - // Check for premium plugin updates. - $this->check_updates( true ); - } - } else { - // Sync install(s) (only if something changed locally). - if ( 1 < count( $blog_ids ) ) { - $this->sync_installs(); - } else { - $this->sync_install(); - } - - $this->maybe_sync_install_user(); - } - } - } - - /** - * Check if sync was executed in the last $period of seconds. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param int $period In seconds - * - * @return bool - */ - private function is_sync_executed( $period = WP_FS__TIME_24_HOURS_IN_SEC ) { - return $this->is_cron_executed( 'sync', $period ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @return bool - */ - private function is_sync_cron_on() { - return $this->is_cron_on( 'sync' ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param int $start_at Defaults to now. - * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise, schedule job to start right away. - * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor. - */ - private function schedule_sync_cron( - $start_at = WP_FS__SCRIPT_START_TIME, - $randomize_start = true, - $except_blog_id = 0 - ) { - $this->schedule_cron( - 'sync', - 'data_sync', - 'daily', - $start_at, - $randomize_start, - $except_blog_id - ); - } - - /** - * Add the actual sync function to the cron job hook. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - */ - private function hook_callback_to_sync_cron() { - $this->add_action( 'data_sync', array( &$this, '_sync_cron' ) ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param bool $is_network_clear Since 2.0.0 If set to TRUE, clear sync cron even if there are installs that are still connected. - */ - private function clear_sync_cron( $is_network_clear = false ) { - $this->_logger->entrance(); - - $this->clear_cron( 'sync', 'data_sync', $is_network_clear ); - } - - /** - * Unix timestamp for next sync cron execution or false if not scheduled. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @return int|false - */ - function next_sync_cron() { - return $this->get_next_scheduled_cron( 'sync', 'data_sync' ); - } - - /** - * Unix timestamp for previous sync cron execution or false if never executed. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @return int|false - */ - function last_sync_cron() { - return $this->cron_last_execution( 'sync' ); - } - - #endregion Daily Sync Cron ------------------------------------------------------------------ - - #---------------------------------------------------------------------------------- - #region Async Install Sync - #---------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @return bool - */ - private function is_install_sync_scheduled() { - return $this->is_cron_on( 'install_sync' ); - } - - /** - * Get the sync cron's executing blog ID. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return int - */ - private function get_install_sync_cron_blog_id() { - return $this->get_cron_blog_id( 'install_sync' ); - } - - /** - * Instead of running blocking install sync event, execute non blocking scheduled wp-cron. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor. - */ - private function schedule_install_sync( $except_blog_id = 0 ) { - $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id ); - } - - /** - * Unix timestamp for previous install sync cron execution or false if never executed. - * - * @todo There's some very strange bug that $this->_storage->install_sync_timestamp value is not being updated. But for sure the sync event is working. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @return int|false - */ - function last_install_sync() { - return $this->cron_last_execution( 'install_sync' ); - } - - /** - * Unix timestamp for next install sync cron execution or false if not scheduled. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @return int|false - */ - function next_install_sync() { - return $this->get_next_scheduled_cron( 'install_sync', 'install_sync' ); - } - - /** - * Add the actual install sync function to the cron job hook. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - */ - private function hook_callback_to_install_sync() { - $this->add_action( 'install_sync', array( &$this, '_run_sync_install' ) ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param bool $is_network_clear Since 2.0.0 If set to TRUE, clear sync cron even if there are installs that are still connected. - */ - private function clear_install_sync_cron( $is_network_clear = false ) { - $this->_logger->entrance(); - - $this->clear_cron( 'install_sync', 'install_sync', $is_network_clear ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * @since 2.0.0 Consolidate all the data sync into the same cron for performance optimization. The max number of API requests is based on the number of unique opted-in users. - */ - public function _run_sync_install() { - $this->_logger->entrance(); - - $this->execute_cron( 'sync', array( &$this, '_sync_install_cron_method' ) ); - } - - /** - * The actual install(s) sync cron logic. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int[] $blog_ids - * @param int|null $current_blog_id - */ - function _sync_install_cron_method( array $blog_ids, $current_blog_id = null ) { - if ( $this->is_registered() ) { - if ( 1 < count( $blog_ids ) ) { - $this->sync_installs( array(), true ); - } else { - $this->sync_install( array(), true ); - } - - $this->maybe_sync_install_user(); - } - } - - #endregion Async Install Sync ------------------------------------------------------------------ - - /** - * Show a notice that activation is currently pending. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @param bool|string $email - * @param bool $is_pending_trial Since 1.2.1.5 - */ - function _add_pending_activation_notice( $email = false, $is_pending_trial = false ) { - if ( ! is_string( $email ) ) { - $current_user = self::_get_current_wp_user(); - $email = $current_user->user_email; - } - - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( 'You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.', 'pending-activation-message' ), - '' . $this->get_plugin_name() . '', - '' . $email . '', - ( $is_pending_trial ? - $this->get_text_inline( 'start the trial', 'start-the-trial' ) : - $this->get_text_inline( 'complete the install', 'complete-the-install' ) ) - ), - 'activation_pending', - 'Thanks!' - ); - } - - /** - * Check if currently in plugin activation. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.4 - * - * @return bool - */ - function is_plugin_activation() { - $result = get_transient( "fs_{$this->_module_type}_{$this->_slug}_activated" ); - - return !empty($result); - } - - /** - * - * NOTE: admin_menu action executed before admin_init. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - */ - function _admin_init_action() { - $is_migration = $this->is_migration(); - - /** - * Automatically redirect to connect/activation page after plugin activation. - * - * @since 1.1.7 Do NOT redirect to opt-in when running in network admin mode. - */ - if ( $this->is_plugin_activation() ) { - delete_transient( "fs_{$this->_module_type}_{$this->_slug}_activated" ); - - if ( isset( $_GET['activate-multi'] ) ) { - /** - * Don't redirect if activating multiple plugins at once (bulk activation). - */ - } else if ( ! $is_migration ) { - $this->_redirect_on_activation_hook(); - return; - } - } - - if ( $is_migration ) { - return; - } - - if ( fs_request_is_action( $this->get_unique_affix() . '_skip_activation' ) ) { - check_admin_referer( $this->get_unique_affix() . '_skip_activation' ); - - $this->skip_connection( null, fs_is_network_admin() ); - - fs_redirect( $this->get_after_activation_url( 'after_skip_url' ) ); - } - - if ( $this->is_network_activation_mode() && - fs_request_is_action( $this->get_unique_affix() . '_delegate_activation' ) - ) { - check_admin_referer( $this->get_unique_affix() . '_delegate_activation' ); - - $this->delegate_connection(); - - fs_redirect( $this->get_after_activation_url( 'after_delegation_url' ) ); - } - - $this->_add_upgrade_action_link(); - - if ( ! ( ! $this->_is_network_active && fs_is_network_admin() ) && - ( - ( true === $this->_storage->require_license_activation ) || - // Not registered nor anonymous. - ( ! $this->is_registered() && ! $this->is_anonymous() ) || - // OR, network level and in network upgrade mode. - ( fs_is_network_admin() && $this->_is_network_active && $this->is_network_upgrade_mode() ) - ) - ) { - if ( ! $this->is_pending_activation() ) { - if ( ! $this->is_activation_page() ) { - /** - * If a user visits any other admin page before activating the premium-only theme with a valid - * license, reactivate the previous theme. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - if ( $this->is_theme() && - ! $this->has_settings_menu() && - ! isset( $_REQUEST['fs_action'] ) && - $this->can_activate_previous_theme() - ) { - if ( $this->is_only_premium() ) { - $this->activate_previous_theme(); - return; - } - - if ( true === $this->_storage->require_license_activation ) { - $this->_storage->require_license_activation = false; - } - } - - if ( ! fs_is_network_admin() && - $this->is_network_activation_mode() && - ! $this->is_delegated_connection() - ) { - return; - } - - if ( $this->is_plugin_new_install() || $this->is_only_premium() ) { - if ( ! $this->_anonymous_mode ) { - // Show notice for new plugin installations. - $this->_admin_notices->add( - sprintf( - $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ), - sprintf( '%s', - $this->get_activation_url( array(), ! $this->is_delegated_connection() ), - sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now', - '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() ) - ) - ), - '', - 'update-nag' - ); - } - } else { - if ( $this->should_add_sticky_optin_notice() ) { - $this->add_sticky_optin_admin_notice(); - } - - if ( $this->has_filter( 'optin_pointer_element' ) ) { - // Don't show admin nag if plugin update. - wp_enqueue_script( 'wp-pointer' ); - wp_enqueue_style( 'wp-pointer' ); - - $this->_enqueue_connect_essentials(); - - add_action( 'admin_print_footer_scripts', array( - $this, - '_add_connect_pointer_script' - ) ); - } - } - } - } - - if ( $this->show_opt_in_on_themes_page() && - $this->is_activation_page() - ) { - $this->_show_theme_activation_optin_dialog(); - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return bool - */ - private function should_add_sticky_optin_notice() { - if ( fs_is_network_admin() ) { - if ( ! $this->_is_network_active ) { - return false; - } - - if ( ! $this->is_network_activation_mode() ) { - return false; - } - - return ! isset( $this->_storage->sticky_optin_added_ms ); - } - - if ( ! $this->is_activation_mode() ) { - return false; - } - - // If running from a blog admin and delegated the connection. - return ! isset( $this->_storage->sticky_optin_added ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - */ - private function add_sticky_optin_admin_notice() { - if ( ! $this->_is_network_active || ! fs_is_network_admin() ) { - $this->_storage->sticky_optin_added = true; - } else { - $this->_storage->sticky_optin_added_ms = true; - } - - // Show notice for new plugin installations. - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( 'We made a few tweaks to the %s, %s', 'few-plugin-tweaks' ), - $this->_module_type, - sprintf( '%s', - $this->get_activation_url(), - sprintf( $this->get_text_inline( 'Opt in to make "%s" better!', 'optin-x-now' ), $this->get_plugin_name() ) - ) - ), - 'connect_account', - '', - 'update-nag' - ); - } - - /** - * Enqueue connect requires scripts and styles. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.4 - */ - function _enqueue_connect_essentials() { - wp_enqueue_script( 'jquery' ); - wp_enqueue_script( 'json2' ); - - fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' ); - fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' ); - - fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' ); - } - - /** - * Add connect / opt-in pointer. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.4 - */ - function _add_connect_pointer_script() { - $vars = array( 'id' => $this->_module_id ); - $pointer_content = fs_get_template( 'connect.php', $vars ); - ?> - - _menu->get_raw_slug() ) || - fs_is_plugin_page( $this->_slug ); - } - - /* Events - ------------------------------------------------------------------------------------------------------------------*/ - /** - * Delete site install from Database. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param bool $store - * @param int|null $blog_id Since 2.0.0 - * - * @return false|int The install ID if deleted. Otherwise, FALSE (when install not exist). - */ - function _delete_site( $store = true, $blog_id = null ) { - return self::_delete_site_by_slug( $this->_slug, $this->_module_type, $store, $blog_id ); - } - - /** - * Delete site install from Database. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @param string $slug - * @param string $module_type - * @param bool $store - * @param int|null $blog_id Since 2.0.0 - * - * @return false|int The install ID if deleted. Otherwise, FALSE (when install not exist). - */ - static function _delete_site_by_slug( $slug, $module_type, $store = true, $blog_id = null ) { - $sites = self::get_all_sites( $module_type, $blog_id ); - - $install_id = false; - - if ( isset( $sites[ $slug ] ) ) { - if ( is_object( $sites[ $slug ] ) ) { - $install_id = $sites[ $slug ]->id; - } - - unset( $sites[ $slug ] ); - - self::set_account_option_by_module( $module_type, 'sites', $sites, $store, $blog_id ); - } - - return $install_id; - } - - /** - * Delete user. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $user_id - * @param bool $store - * - * @return false|int The user ID if deleted. Otherwise, FALSE (when install not exist). - */ - private static function delete_user( $user_id, $store = true ) { - $users = self::get_all_users(); - - if ( ! is_array( $users ) || ! isset( $users[ $user_id ] ) ) { - return false; - } - - unset( $users[ $user_id ] ); - - self::$_accounts->set_option( 'users', $users, $store ); - - return $user_id; - } - - /** - * Delete plugin's plans information. - * - * @param bool $store Flush to Database if true. - * @param bool $keep_associated_plans If set to false, delete all plans, even if a plan is associated with an install. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - private function _delete_plans( $store = true, $keep_associated_plans = true ) { - $this->_logger->entrance(); - - $plans = self::get_all_plans( $this->_module_type ); - - $plans_to_keep = array(); - - if ( $keep_associated_plans ) { - $plans_ids_to_keep = $this->get_plans_ids_associated_with_installs(); - foreach ( $plans_ids_to_keep as $plan_id ) { - $plan = self::_get_plan_by_id( $plan_id ); - if ( is_object( $plan ) ) { - $plans_to_keep[] = self::_encrypt_entity( $plan ); - } - } - } - - if ( ! empty( $plans_to_keep ) ) { - $plans[ $this->_slug ] = $plans_to_keep; - } else { - unset( $plans[ $this->_slug ] ); - } - - $this->set_account_option( 'plans', $plans, $store ); - } - - /** - * Delete all plugin licenses. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param bool $store - */ - private function _delete_licenses( $store = true ) { - $this->_logger->entrance(); - - $all_licenses = self::get_all_licenses(); - - unset( $all_licenses[ $this->_module_id ] ); - - self::$_accounts->set_option( 'all_licenses', $all_licenses, $store ); - } - - /** - * Check if Freemius was added on new plugin installation. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.5 - * - * @return bool - */ - function is_plugin_new_install() { - return isset( $this->_storage->is_plugin_new_install ) && - $this->_storage->is_plugin_new_install; - } - - /** - * Check if it's the first plugin release that is running Freemius. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @return bool - */ - function is_first_freemius_powered_version() { - return empty( $this->_storage->plugin_last_version ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return bool|string - */ - private function get_previous_theme_slug() { - return isset( $this->_storage->previous_theme ) ? - $this->_storage->previous_theme : - false; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return string - */ - private function can_activate_previous_theme() { - $slug = $this->get_previous_theme_slug(); - if ( false !== $slug && current_user_can( 'switch_themes' ) ) { - $theme_instance = wp_get_theme( $slug ); - - return $theme_instance->exists(); - } - - return false; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - private function activate_previous_theme() { - switch_theme( $this->get_previous_theme_slug() ); - unset( $this->_storage->previous_theme ); - - global $pagenow; - if ( 'themes.php' === $pagenow ) { - /** - * Refresh the active theme information. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - fs_redirect( $this->admin_url( $pagenow ) ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return string - */ - function get_previous_theme_activation_url() { - if ( ! $this->can_activate_previous_theme() ) { - return ''; - } - - /** - * Activation URL - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - return wp_nonce_url( - $this->admin_url( 'themes.php?action=activate&stylesheet=' . urlencode( $this->get_previous_theme_slug() ) ), - 'switch-theme_' . $this->get_previous_theme_slug() - ); - } - - /** - * Saves the slug of the previous theme if it still exists so that it can be used by the logic in the opt-in - * form that decides whether to add a close button to the opt-in dialog or not. So after a premium-only theme is - * activated, the close button will appear and will reactivate the previous theme if clicked. If the previous - * theme doesn't exist, then there will be no close button. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @param string $slug_or_name Old theme's slug or name. - * @param bool|WP_Theme $old_theme WP_Theme instance of the old theme if it still exists. - */ - function _activate_theme_event_hook( $slug_or_name, $old_theme = false ) { - $this->_storage->previous_theme = ( false !== $old_theme ) ? - $old_theme->get_stylesheet() : - $slug_or_name; - - $this->_activate_plugin_event_hook(); - } - - /** - * Plugin activated hook. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @uses FS_Api - */ - function _activate_plugin_event_hook() { - $this->_logger->entrance( 'slug = ' . $this->_slug ); - - if ( ! $this->is_user_admin() ) { - return; - } - - $this->unregister_uninstall_hook(); - - // Clear API cache on activation. - FS_Api::clear_cache(); - - $is_premium_version_activation = $this->is_plugin() ? - ( current_filter() !== ( 'activate_' . $this->_free_plugin_basename ) ) : - $this->is_premium(); - - $this->_logger->info( 'Activating ' . ( $is_premium_version_activation ? 'premium' : 'free' ) . ' plugin version.' ); - - if ( $this->is_plugin() ) { - // This logic is relevant only to plugins since both the free and premium versions of a plugin can be active at the same time. - // 1. If running in the activation of the FREE module, get the basename of the PREMIUM. - // 2. If running in the activation of the PREMIUM module, get the basename of the FREE. - $other_version_basename = $is_premium_version_activation ? - $this->_free_plugin_basename : - $this->premium_plugin_basename(); - - if ( ! $this->_is_network_active ) { - /** - * Themes are always network activated, but the ACTUAL activation is per site. - * - * During the activation, the plugin isn't yet active, therefore, - * _is_network_active will be set to false even if it's a network level - * activation. So we need to fix that by looking at the is_network_admin() value. - * - * @author Vova Feldman - */ - $this->_is_network_active = ( - $this->_is_multisite_integrated && - fs_is_network_admin() - ); - } - - /** - * If the other module version is active, deactivate it. - * - * is_plugin_active() checks if the plugin is active on the site or the network level and - * deactivate_plugins() deactivates the plugin whether it's activated on the site or network level. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - if ( - is_plugin_active( $other_version_basename ) && - $this->apply_filters( 'deactivate_on_activation', true ) - ) { - deactivate_plugins( $other_version_basename ); - } - } - - if ( $this->is_registered() ) { - if ( $is_premium_version_activation ) { - $this->reconnect_locally(); - } - - - // Schedule re-activation event and sync. -// $this->sync_install( array(), true ); - $this->schedule_install_sync(); - - // If activating the premium module version, add an admin notice to congratulate for an upgrade completion. - if ( $is_premium_version_activation ) { - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'The upgrade of %s was successfully completed.', 'successful-version-upgrade-message' ), sprintf( '%s', $this->_plugin->title ) ), - $this->get_text_x_inline( 'W00t', - 'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!' - ); - } - } else if ( $this->is_anonymous() ) { - if ( isset( $this->_storage->is_anonymous_ms ) && $this->_storage->is_anonymous_ms['is'] ) { - $plugin_version = $this->_storage->is_anonymous_ms['version']; - $network = true; - } else { - $plugin_version = $this->_storage->is_anonymous['version']; - $network = false; - } - - /** - * Reset "skipped" click cache on the following: - * 1. Freemius DEV mode. - * 2. WordPress DEBUG mode. - * 3. If a plugin and the user skipped the exact same version before. - * - * @since 1.2.2.7 Ulrich Pogson (@grapplerulrich) asked to not reset the SKIPPED flag if the exact same THEME version was activated before unless the developer is running with WP_DEBUG on, or Freemius debug mode on (WP_FS__DEV_MODE). - * - * @todo 4. If explicitly asked to retry after every activation. - */ - if ( WP_FS__DEV_MODE || - ( - ( $this->is_plugin() || ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ) && - $this->get_plugin_version() == $plugin_version - ) - ) { - $this->reset_anonymous_mode( $network ); - } - } - - $is_trial_or_has_features_enabled_license = ( $this->is_trial() || $this->has_features_enabled_license() ); - - if ( $this->is_addon() && ! $is_trial_or_has_features_enabled_license ) { - /** - * When activating an add-on, try to also activate a license. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - if ( ! $this->_is_network_active ) { - $this->maybe_activate_addon_license(); - } else { - $this->maybe_network_activate_addon_license(); - } - - /** - * Avoid redirecting to the license activation screen after automatically activating an add-on license. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - $is_trial_or_has_features_enabled_license = ( $this->is_trial() || $this->has_features_enabled_license() ); - - if ( $is_trial_or_has_features_enabled_license && true === $this->_storage->require_license_activation ) { - $this->_storage->require_license_activation = false; - } - } - - if ( - $is_premium_version_activation && - ( - ( ! $this->is_registered() && $this->is_anonymous() ) || - ( - $this->is_registered() && - ! $is_trial_or_has_features_enabled_license - ) - ) - ) { - $this->_storage->require_license_activation = true; - } - - if ( ! isset( $this->_storage->is_plugin_new_install ) ) { - /** - * If no previous version of plugin's version exist, it means that it's either - * the first time that the plugin installed on the site, or the plugin was installed - * before but didn't have Freemius integrated. - * - * Since register_activation_hook() do NOT fires on updates since 3.1, and only fires - * on manual activation via the dashboard, is_plugin_activation() is TRUE - * only after immediate activation. - * - * @since 1.1.4 - * @link https://make.wordpress.org/core/2010/10/27/plugin-activation-hooks-no-longer-fire-for-updates/ - */ - $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version ); - } - - /** - * Also flush when activating the premium version so that even if Freemius was off before, the API - * connectivity test can be run again. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3.1 - */ - $has_api_connectivity = $this->has_api_connectivity( WP_FS__DEV_MODE || $is_premium_version_activation ); - - if ( ! $this->_anonymous_mode && - $has_api_connectivity && - ! $this->_isAutoInstall - ) { - // Store hint that the plugin was just activated to enable auto-redirection to settings. - set_transient( "fs_{$this->_module_type}_{$this->_slug}_activated", true, 60 ); - } - - /** - * Activation hook is executed after the plugin's main file is loaded, therefore, - * after the plugin was loaded. The logic is located at activate_plugin() - * ./wp-admin/includes/plugin.php. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9 - */ - $this->_storage->was_plugin_loaded = true; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - private function maybe_activate_addon_license() { - $parent_fs = $this->get_parent_instance(); - - if ( - ! is_object( $parent_fs ) || - ( ! $parent_fs->is_registered() && ! $parent_fs->is_network_registered() ) - ) { - // Try to activate a license only if the parent plugin is active and has a valid `install`. - return; - } - - $license = $this->get_active_parent_license(); - if ( ! is_object( $license ) ) { - return; - } - - if ( - $this->is_bundle_license_auto_activation_enabled() && - ! empty( $license->products ) - ) { - $this->activate_bundle_license( $license ); - - return; - } - - if ( ! $this->is_registered() ) { - // Opt in with a license key. - $this->opt_in( - $parent_fs->get_current_or_network_user()->email, - false, - false, - $license->secret_key - ); - } else { - // Activate the license. - $install = $this->get_api_site_scope()->call( - '/', - 'put', - array( 'license_key' => $this->apply_filters( 'license_key', $license->secret_key ) ) - ); - - if ( ! FS_Api::is_api_error( $install ) ) { - $this->_sync_addon_license( $this->get_id(), true ); - } - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param FS_Plugin_License $license - */ - private function maybe_network_activate_addon_license( $license = null ) { - $parent_fs = $this->get_parent_instance(); - if ( ! is_object( $parent_fs ) || ( ! $parent_fs->is_registered() && ! $parent_fs->is_network_registered() ) ) { - // Try to activate a license only if the parent plugin is active and has a valid `install`. - return; - } - - $license = ( ! is_null( $license ) ) ? - $license : - $this->get_active_parent_license(); - - if ( ! is_object( $license ) ) { - return; - } - - if ( - $this->is_bundle_license_auto_activation_enabled() && - ! empty( $license->products ) - ) { - $this->activate_bundle_license( $license ); - - return; - } - - if ( ! $this->is_network_registered() ) { - $sites = $this->get_sites_for_network_level_optin(); - - if ( count( $sites ) > $license->left() ) { - // If the add-on is network active, try to activate the license only if it can be activated on all sites. - return; - } - - // Opt in with a license key. - $this->opt_in( - $parent_fs->get_user()->email, - false, - false, - $license->secret_key, - false, - false, - false, - null, - $sites - ); - } else { - $blog_2_install_map = array(); - $site_ids = array(); - - $all_sites = Freemius::get_sites(); - - foreach ( $all_sites as $site ) { - $blog_id = Freemius::get_site_blog_id( $site ); - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( is_object( $install ) && FS_Plugin_License::is_valid_id( $install->license_id ) ) { - // Skip license activation for installs that are already associated with a license. - continue; - } - - if ( is_object( $install ) ) { - $blog_2_install_map[ $blog_id ] = $install; - } else { - $site_ids[] = $blog_id; - } - } - - if ( ( count( $blog_2_install_map ) + count( $site_ids ) ) > $license->left() ) { - return; - } - - $user = $this->get_current_or_network_user(); - - if ( ! empty( $blog_2_install_map ) ) { - $result = $this->activate_license_on_many_installs( $user, $license->secret_key, $blog_2_install_map ); - - if ( true !== $result ) { - return; - } - } - - if ( ! empty( $site_ids ) ) { - $this->activate_license_on_many_sites( $user, $license->secret_key, $site_ids ); - } - } - } - - /** - * Tries to activate a bundle license for all supported products if the current product is activated with a bundle license. This is called after activating an available license (not via the license activation dialog but by clicking on a license activation button) for a product via its "Account" page. - * - * @author Leo Fajardo (@leorw) - * @since 2.4.0 - * - * @param FS_Plugin_License $license - * @param array $sites - * @param int $blog_id - */ - private function maybe_activate_bundle_license( FS_Plugin_License $license = null, $sites = array(), $blog_id = 0 ) { - if ( ! is_object( $license ) && $this->has_active_valid_license() ) { - $license = $this->_license; - } - - if ( ! is_object( $license ) ) { - return; - } - - $parent_license = ( ! empty( $license->products ) ) ? - $license : - $this->get_active_parent_license( $license->secret_key ); - - if ( is_object( $parent_license ) ) { - $this->activate_bundle_license( $parent_license, $sites, $blog_id ); - } - } - - /** - * Try to activate a bundle license for all the bundle products installed on the site. - * (1) If a child product install already has a license, the bundle license won't be activated. - * (2) On multi-site networks, if the attempt to activate the bundle license is triggered from the network admin, the bundle license activation will only work for non-delegated sites and only if none of them is associated with a license. Even if one of the sites has the product installed with a license key, skip the bundle license activation for the product. - * (3) On multi-site networks, if the attempt to activate the bundle license is triggered from a site-level admin, only activate the license if the product is site-level activated or delegated, and the product installation is not yet associated with a license. - * - * @author Leo Fajardo (@leorw) - * @since 2.4.0 - * - * @param FS_Plugin_License $license - * @param array $sites - * @param int $current_blog_id - */ - private function activate_bundle_license( $license, $sites = array(), $current_blog_id = 0 ) { - $is_network_admin = fs_is_network_admin(); - - $installs_by_blog_map = array(); - $site_info_by_blog_map = array(); - - /** - * Try to activate the license for all supported products. - * - * @author Leo Fajardo - */ - foreach ( $license->products as $product_id ) { - $fs = self::get_instance_by_id( $product_id ); - - if ( ! is_object( $fs ) ) { - continue; - } - - if ( ! $fs->has_paid_plan() ) { - continue; - } - - if ( - ! $fs->is_addon() && - ! FS_Plan_Manager::instance()->has_paid_plan( $fs->_plans ) - ) { - /** - * The parent product can be free-only but can have its `has_paid_plan` flag set to `true` when - * there is a context bundle. - */ - continue; - } - - if ( $current_blog_id > 0 ) { - $fs->switch_to_blog( $current_blog_id ); - } - - if ( $fs->has_active_valid_license() ) { - continue; - } - - if ( ! $is_network_admin || $current_blog_id > 0 ) { - if ( $fs->is_network_active() && ! $fs->is_delegated_connection( $current_blog_id ) ) { - // Do not try to activate the license in the site level if the product is network active and the connection was not delegated. - continue; - } - } else { - if ( ! $fs->is_network_active() ) { - // Do not try to activate the license in the network level if the product is not network active. - continue; - } - - if ( $fs->is_network_delegated_connection() ) { - // Do not try to activate the license in the network level if the activation has been delegated to site admins. - continue; - } - - $has_install_with_license = false; - - // Collection of sites that have an install entity that is not activated with a license or non-delegated sites that have no install entity, or both types of site. - $filtered_sites = array(); - - if ( empty( $sites ) ) { - $all_sites = self::get_sites(); - - foreach ( $all_sites as $site ) { - $sites[] = array( 'blog_id' => self::get_site_blog_id( $site ) ); - } - } else { - // Populate the map here to avoid calling `$fs->get_site_info( $site );` in the other `for` loop below. - foreach ( $sites as $site ) { - if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) { - continue; - } - - $site_info_by_blog_map[ $site['blog_id'] ] = $site; - } - } - - foreach ( $sites as $site ) { - if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) { - continue; - } - - $blog_id = $site['blog_id']; - - if ( ! isset( $installs_by_blog_map[ $blog_id ] ) ) { - $installs_by_blog_map[ $blog_id ] = self::get_all_sites( $fs->get_module_type(), $blog_id ); - } - - $installs = $installs_by_blog_map[ $blog_id ]; - $install = null; - - if ( isset( $installs[ $fs->get_slug() ] ) ) { - $install = $installs[ $fs->get_slug() ]; - - if ( - is_object( $install ) && - ( - ! FS_Site::is_valid_id( $install->id ) || - ! FS_User::is_valid_id( $install->user_id ) || - ! FS_Plugin_Plan::is_valid_id( $install->plan_id ) - ) - ) { - $install = null; - } - } - - if ( - is_object( $install ) && - FS_Plugin_License::is_valid_id( $install->license_id ) - ) { - $has_install_with_license = true; - break; - } - - if ( $fs->is_site_delegated_connection( $blog_id ) ) { - // Site activation delegated, don't activate bundle license on the site in the network admin. - continue; - } - - if ( ! isset( $site_info_by_blog_map[ $blog_id ] ) ) { - $site_info_by_blog_map[ $blog_id ] = $fs->get_site_info( $site ); - } - - $filtered_sites[] = $site_info_by_blog_map[ $blog_id ]; - } - - if ( $has_install_with_license || empty( $filtered_sites ) ) { - // Do not try to activate the license at the network level if there's any install with a license or there's no site to activate the license on. - continue; - } - - $sites = $filtered_sites; - } - - $fs->activate_migrated_license( - $license->secret_key, - null, - null, - $sites, - ( $current_blog_id > 0 ? $current_blog_id : null ) - ); - } - } - - /** - * Returns a parent license that can be activated for the context product. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param string|null $license_key - * @param bool $flush - * - * @return FS_Plugin_License - */ - function get_active_parent_license( $license_key = null, $flush = true ) { - $parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable"; - - $fs = $this; - - if ( $this->is_addon() ) { - $parent_instance = $this->get_parent_instance(); - - if ( is_object( $parent_instance ) && $parent_instance->is_registered() ) { - $fs = $parent_instance; - } - } - - $foreign_licenses = $fs->get_foreign_licenses_info( - self::get_all_licenses( $this->get_parent_id() ) - ); - - if ( ! empty ( $foreign_licenses ) ) { - $foreign_licenses = array( - // Prefix with `+` to tell the server to include foreign licenses in the licenses collection. - 'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ), - 'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) ) - ); - - $parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint ); - } - - $result = $fs->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, $flush ); - - if ( - ! $this->is_api_result_object( $result, 'licenses' ) || - ! is_array( $result->licenses ) || - empty( $result->licenses ) - ) { - return null; - } - - $parent_license = null; - - if ( empty( $license_key ) ) { - $parent_license = $result->licenses[0]; - } else { - foreach ( $result->licenses as $license ) { - if ( $license_key === $license->secret_key ) { - $parent_license = $license; - break; - } - } - } - - if ( ! is_null( $parent_license ) ) { - $parent_license = new FS_Plugin_License( $parent_license ); - } - - return $parent_license; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @return array - */ - function get_sites_for_network_level_optin() { - $sites = array(); - $all_sites = self::get_sites(); - - foreach ( $all_sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - if ( ! $this->is_site_delegated_connection( $blog_id ) && - ! $this->is_installed_on_site( $blog_id ) - ) { - $sites[] = $this->get_site_info( $site ); - } - } - - return $sites; - } - - /** - * Delete account. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * - * @param bool $check_user Enforce checking if user have plugins activation privileges. - */ - function delete_account_event( $check_user = true ) { - $this->_logger->entrance( 'slug = ' . $this->_slug ); - - if ( $check_user && ! $this->is_user_admin() ) { - return; - } - - $this->do_action( 'before_account_delete' ); - - // Clear all admin notices. - $this->_admin_notices->clear_all_sticky( false ); - - $this->_delete_site( false ); - - $delete_network_common_data = true; - - if ( $this->_is_network_active ) { - $installs = $this->get_blog_install_map(); - - // Don't delete common network data unless no other installs left. - $delete_network_common_data = empty( $installs ); - } - - if ( $delete_network_common_data ) { - $this->_delete_plans( false ); - - $this->_delete_licenses( false ); - - // Delete add-ons related to plugin's account. - $this->_delete_account_addons( false ); - } - - // @todo Delete plans and licenses of add-ons. - - self::$_accounts->store(); - - /** - * IMPORTANT: - * Clear crons must be executed before clearing all storage. - * Otherwise, the cron will not be cleared. - */ - if ( $delete_network_common_data ) { - $this->clear_sync_cron(); - } - - $this->clear_install_sync_cron(); - - // Clear all storage data. - $this->_storage->clear_all( true, array( - 'is_delegated_connection', - 'connectivity_test', - 'is_on', - ), false ); - - // Send delete event. - $this->get_api_site_scope()->call( '/', 'delete' ); - - $this->do_action( 'after_account_delete' ); - } - - /** - * Delete network level account. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param bool $check_user Enforce checking if user have plugins activation privileges. - */ - function delete_network_account_event( $check_user = true ) { - $this->_logger->entrance( 'slug = ' . $this->_slug ); - - if ( $check_user && ! $this->is_user_admin() ) { - return; - } - - $this->do_action( 'before_network_account_delete' ); - - // Clear all admin notices. - $this->_admin_notices->clear_all_sticky(); - - $this->_delete_plans( false, false ); - - $this->_delete_licenses( false ); - - // Delete add-ons related to plugin's account. - $this->_delete_account_addons( false ); - - // @todo Delete plans and licenses of add-ons. - - self::$_accounts->store( true ); - - /** - * IMPORTANT: - * Clear crons must be executed before clearing all storage. - * Otherwise, the cron will not be cleared. - */ - $this->clear_sync_cron( true ); - $this->clear_install_sync_cron( true ); - - $sites = self::get_sites(); - - $install_ids = array(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - if ( $this->is_site_delegated_connection( $blog_id ) ) { - continue; - } - - $install_id = $this->_delete_site( true, $blog_id ); - - // Clear all storage data. - $this->_storage->clear_all( true, array( 'connectivity_test' ), $blog_id ); - - if ( FS_Site::is_valid_id( $install_id ) ) { - $install_ids[] = $install_id; - } - - switch_to_blog( $blog_id ); - - $this->do_action( 'after_account_delete' ); - - restore_current_blog(); - } - - $this->_storage->clear_all( true, array( - 'connectivity_test', - 'is_on', - ), true ); - - // Send delete event. - if ( ! empty( $install_ids ) ) { - $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', $install_ids ), 'delete' ); - } - - $this->do_action( 'after_network_account_delete' ); - } - - /** - * Plugin deactivation hook. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - */ - function _deactivate_plugin_hook() { - $this->_logger->entrance( 'slug = ' . $this->_slug ); - - if ( ! $this->is_user_admin() ) { - return; - } - - $is_network_deactivation = fs_is_network_admin(); - $storage_keys_for_removal = array(); - - $this->_admin_notices->clear_all_sticky(); - - $storage_keys_for_removal[] = 'sticky_optin_added'; - if ( isset( $this->_storage->sticky_optin_added ) ) { - unset( $this->_storage->sticky_optin_added ); - } - - if ( ! isset( $this->_storage->is_plugin_new_install ) ) { - // Remember that plugin was already installed. - $this->_storage->is_plugin_new_install = false; - } - - // Hook to plugin uninstall. - register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) ); - - $this->clear_module_main_file_cache(); - $this->clear_sync_cron( $this->_is_network_active ); - $this->clear_install_sync_cron(); - - if ( $this->is_registered() ) { - if ( $this->is_premium() && ! $this->has_active_valid_license() ) { - FS_Plugin_Updater::instance( $this )->delete_update_data(); - } - - if ( $is_network_deactivation ) { - // Send deactivation event. - $this->sync_installs( array( - 'is_active' => false, - ) ); - } else { - // Send deactivation event. - $this->sync_install( array( - 'is_active' => false, - ) ); - } - } else { - if ( ! $this->has_api_connectivity() ) { - // Reset connectivity test cache. - unset( $this->_storage->connectivity_test ); - - $storage_keys_for_removal[] = 'connectivity_test'; - } - } - - if ( $is_network_deactivation ) { - if ( isset( $this->_storage->sticky_optin_added_ms ) ) { - unset( $this->_storage->sticky_optin_added_ms ); - } - - if ( ! empty( $storage_keys_for_removal ) ) { - $sites = self::get_sites(); - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - foreach ( $storage_keys_for_removal as $key ) { - $this->_storage->remove( $key, false, $blog_id ); - } - - $this->_storage->save( $blog_id ); - } - } - } - - // Clear API cache on deactivation. - FS_Api::clear_cache(); - - $this->remove_sdk_reference(); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.6 - */ - private function remove_sdk_reference() { - global $fs_active_plugins; - - foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) { - if ( $this->_plugin_basename == $data->plugin_path ) { - unset( $fs_active_plugins->plugins[ $sdk_path ] ); - break; - } - } - - fs_fallback_to_newest_active_sdk(); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.3 - * - * @param bool $is_anonymous - * @param bool|int $network_or_blog_id Since 2.0.0 - */ - private function set_anonymous_mode( $is_anonymous = true, $network_or_blog_id = 0 ) { - // Store information regarding skip to try and opt-in the user - // again in the future. - $skip_info = array( - 'is' => $is_anonymous, - 'timestamp' => WP_FS__SCRIPT_START_TIME, - 'version' => $this->get_plugin_version(), - ); - - if ( true === $network_or_blog_id ) { - $this->_storage->is_anonymous_ms = $skip_info; - } else { - $this->_storage->store( 'is_anonymous', $skip_info, $network_or_blog_id ); - } - - $this->network_upgrade_mode_completed(); - - // Update anonymous mode cache. - $this->_is_anonymous = $is_anonymous; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id Site ID. - * @param int $user_id User ID. - * @param string $domain Site domain. - * @param string $path Site path. - * @param int $network_id Network ID. Only relevant on multi-network installations. - * @param array $meta Metadata. Used to set initial site options. - * - * @uses Freemius::is_license_network_active() to check if the context license was network activated by the super-admin. - * @uses Freemius::is_network_connected() to check if the super-admin network opted-in. - * @uses Freemius::is_network_anonymous() to check if the super-admin network skipped. - * @uses Freemius::is_network_delegated_connection() to check if the super-admin network delegated the connection to the site admins. - */ - function _after_new_blog_callback( $blog_id, $user_id, $domain, $path, $network_id, $meta ) { - $this->_logger->entrance(); - - if ( $this->is_premium() && - $this->is_network_connected() && - is_object( $this->_license ) && - $this->_license->can_activate( FS_Site::is_localhost_by_address( $domain ) ) && - $this->is_license_network_active( $blog_id ) - ) { - /** - * Running the premium version, the license was network activated, and the license can also be activated on the current site -> so try to opt-in with the license key. - */ - $current_blog_id = get_current_blog_id(); - $license = clone $this->_license; - - $this->switch_to_blog( $blog_id ); - - // Opt-in with network user. - $this->install_with_user( - $this->get_network_user(), - $license->secret_key, - false, - false, - false - ); - - if ( is_object( $this->_site ) ) { - if ( $this->_site->license_id == $license->id ) { - /** - * If the license was activated successfully, sync the license data from the remote server. - */ - $this->_license = $license; - $this->sync_site_license(); - } - } - - $this->switch_to_blog( $current_blog_id ); - - if ( is_object( $this->_site ) ) { - // Already connected (with or without a license), so no need to continue. - return; - } - } - - if ( $this->is_network_anonymous() ) { - /** - * Opt-in was network skipped so automatically skip the opt-in for the new site. - */ - $this->skip_site_connection( $blog_id ); - } else if ( $this->is_network_delegated_connection() ) { - /** - * Opt-in was network delegated so automatically delegate the opt-in for the new site's admin. - */ - $this->delegate_site_connection( $blog_id ); - } else if ( $this->is_network_connected() ) { - /** - * Opt-in was network activated so automatically opt-in with the network user and new site admin. - */ - $current_blog_id = get_current_blog_id(); - - $this->switch_to_blog( $blog_id ); - - // Opt-in with network user. - $this->install_with_user( - $this->get_network_user(), - false, - false, - false, - false - ); - - $this->switch_to_blog( $current_blog_id ); - } else { - /** - * If the super-admin mixed different options (connect, skip, delegated): - * a) If at least one site connection was delegated, then automatically delegate connection. - * b) Otherwise, it means that at least one site was skipped and at least one site was connected. For a simplified UX in the initial release of the multisite network integration, skip the connection for the newly created site. If the super-admin will want to opt-in they can still do that from the network level Account page. - */ - $has_delegated_site = false; - - $sites = self::get_sites(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - if ( $this->is_site_delegated_connection( $blog_id ) ) { - $has_delegated_site = true; - break; - } - } - - if ( $has_delegated_site ) { - $this->delegate_site_connection( $blog_id ); - } else { - $this->skip_site_connection( $blog_id ); - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.3 - * - * @param bool|int $network_or_blog_id Since 2.0.0. - */ - private function reset_anonymous_mode( $network_or_blog_id = 0 ) { - if ( true === $network_or_blog_id ) { - unset( $this->_storage->is_anonymous_ms ); - } else { - $this->_storage->remove( 'is_anonymous', true, $network_or_blog_id ); - } - - /** - * Ensure that this field is also "false", otherwise, if the current module's type is "theme" and the module - * has no menus, the opt-in popup will not be shown immediately (in this case, the user will have to click - * on the admin notice that contains the opt-in link in order to trigger the opt-in popup). - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - if ( ! $this->_is_network_active || - 0 === $network_or_blog_id || - get_current_blog_id() == $network_or_blog_id || - ( true === $network_or_blog_id && fs_is_network_admin() ) - ) { - $this->_is_anonymous = null; - } - } - - /** - * This is used to ensure that before redirecting to the opt-in page after resetting the anonymous mode or - * deleting the account in the network level, the URL of the page to redirect to is correct. - * - * @author Leo Fajardo (@leorw) - * - * @since 2.1.3 - */ - private function maybe_set_slug_and_network_menu_exists_flag() { - if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) { - $this->_menu->set_slug_and_network_menu_exists_flag( $this->_menu->has_menu() ? - $this->_menu->get_slug() : - $this->_slug - ); - } - } - - /** - * Clears the anonymous mode and redirects to the opt-in screen. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - */ - function connect_again() { - if ( ! $this->is_anonymous() ) { - return; - } - - $this->reset_anonymous_mode( fs_is_network_admin() ); - - $this->maybe_set_slug_and_network_menu_exists_flag(); - - fs_redirect( $this->get_activation_url() ); - } - - /** - * Skip account connect, and set anonymous mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.1 - * - * @param array|null $sites Since 2.0.0. Specific sites. - * @param bool $skip_all_network Since 2.0.0. If true, skip connection for all sites. - */ - function skip_connection( $sites = null, $skip_all_network = false ) { - $this->_logger->entrance(); - - $this->_admin_notices->remove_sticky( 'connect_account' ); - - if ( $skip_all_network ) { - $this->set_anonymous_mode( true, true ); - } - - if ( ! $skip_all_network && empty( $sites ) ) { - $this->skip_site_connection(); - } else { - $uids = array(); - - if ( $skip_all_network ) { - $this->set_anonymous_mode( true, true ); - - $sites = self::get_sites(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $this->skip_site_connection( $blog_id, false ); - $uids[] = $this->get_anonymous_id( $blog_id ); - } - } else if ( ! empty( $sites ) ) { - foreach ( $sites as $site ) { - $uids[] = $site['uid']; - $this->skip_site_connection( $site['blog_id'], false ); - } - } - - // Send anonymous skip event. - // No user identified info nor any tracking will be sent after the user skips the opt-in. - $this->get_api_plugin_scope()->call( 'skip.json', 'put', array( - 'uids' => $uids, - ) ); - } - - $this->network_upgrade_mode_completed(); - } - - /** - * Skip connection for specific site in the network. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int|null $blog_id - * @param bool $send_skip - */ - private function skip_site_connection( $blog_id = null, $send_skip = true ) { - $this->_logger->entrance(); - - $this->_admin_notices->remove_sticky( 'connect_account', $blog_id ); - - $this->set_anonymous_mode( true, $blog_id ); - - if ( $send_skip ) { - $this->get_api_plugin_scope()->call( 'skip.json', 'put', array( - 'uids' => array( $this->get_anonymous_id( $blog_id ) ), - ) ); - } - } - - /** - * Plugin version update hook. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - */ - private function update_plugin_version_event() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - return; - } - - $this->schedule_install_sync(); -// $this->sync_install( array(), true ); - } - - /** - * Generate an MD5 signature of a plugins collection. - * This helper methods used to identify changes in a plugins collection. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param array [string]array $plugins - * - * @return string - */ - private function get_plugins_thumbprint( $plugins ) { - ksort( $plugins ); - - $thumbprint = ''; - foreach ( $plugins as $basename => $data ) { - $thumbprint .= $data['slug'] . ',' . - $data['Version'] . ',' . - ( $data['is_active'] ? '1' : '0' ) . ';'; - } - - return md5( $thumbprint ); - } - - /** - * Return a list of modified plugins since the last sync. - * - * Note: - * There's no point to store a plugins counter since even if the number of - * plugins didn't change, we still need to check if the versions are all the - * same and the activity state is similar. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.8 - * - * @return array|false - */ - private function get_plugins_data_for_api() { - // Alias. - $site_active_plugins_option_name = 'active_plugins'; - $network_plugins_option_name = 'all_plugins'; - - /** - * Collection of all site level active plugins. - */ - $site_active_plugins_cache = self::$_accounts->get_option( $site_active_plugins_option_name ); - - if ( ! is_object( $site_active_plugins_cache ) ) { - $site_active_plugins_cache = (object) array( - 'timestamp' => '', - 'md5' => '', - 'plugins' => array(), - ); - } - - $time = time(); - - if ( ! empty( $site_active_plugins_cache->timestamp ) && - ( $time - $site_active_plugins_cache->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC - ) { - // Don't send plugin updates if last update was in the past 5 min. - return false; - } - - // Write timestamp to lock the logic. - $site_active_plugins_cache->timestamp = $time; - self::$_accounts->set_option( $site_active_plugins_option_name, $site_active_plugins_cache, true ); - - // Reload options from DB. - self::$_accounts->load( true ); - $site_active_plugins_cache = self::$_accounts->get_option( $site_active_plugins_option_name ); - - if ( $time != $site_active_plugins_cache->timestamp ) { - // If timestamp is different, then another thread captured the lock. - return false; - } - - /** - * Collection of all plugins (network level). - */ - $network_plugins_cache = self::$_accounts->get_option( $network_plugins_option_name ); - - if ( ! is_object( $network_plugins_cache ) ) { - $network_plugins_cache = (object) array( - 'timestamp' => '', - 'md5' => '', - 'plugins' => array(), - ); - } - - // Check if there's a change in plugins. - $network_plugins = self::get_network_plugins(); - $site_active_plugins = self::get_site_active_plugins(); - - $network_plugins_thumbprint = $this->get_plugins_thumbprint( $network_plugins ); - $site_active_plugins_thumbprint = $this->get_plugins_thumbprint( $site_active_plugins ); - - // Check if plugins status changed (version or active/inactive). - $network_plugins_changed = ( $network_plugins_cache->md5 !== $network_plugins_thumbprint ); - $site_active_plugins_changed = ( $site_active_plugins_cache->md5 !== $site_active_plugins_thumbprint ); - - if ( ! $network_plugins_changed && - ! $site_active_plugins_changed - ) { - // No changes. - return array(); - } - - $plugins_update_data = array(); - - foreach ( $network_plugins_cache->plugins as $basename => $data ) { - if ( ! isset( $network_plugins[ $basename ] ) ) { - // Plugin uninstalled. - $uninstalled_plugin_data = $data; - $uninstalled_plugin_data['is_active'] = false; - $uninstalled_plugin_data['is_uninstalled'] = true; - $plugins_update_data[] = $uninstalled_plugin_data; - - unset( $network_plugins[ $basename ] ); - - unset( $network_plugins_cache->plugins[ $basename ] ); - unset( $site_active_plugins_cache->plugins[ $basename ] ); - - continue; - } - - $was_active = $data['is_active'] || - ( isset( $site_active_plugins_cache->plugins[ $basename ] ) && - true === $site_active_plugins_cache->plugins[ $basename ]['is_active'] ); - $is_active = $network_plugins[ $basename ]['is_active'] || - ( isset( $site_active_plugins[ $basename ] ) && - $site_active_plugins[ $basename ]['is_active'] ); - - if ( ! isset( $site_active_plugins_cache->plugins[ $basename ] ) && - isset( $site_active_plugins[ $basename ] ) - ) { - // Plugin was site level activated. - $site_active_plugins_cache->plugins[ $basename ] = $network_plugins[ $basename ]; - $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true; - } else if ( isset( $site_active_plugins_cache->plugins[ $basename ] ) && - ! isset( $site_active_plugins[ $basename ] ) - ) { - // Plugin was site level deactivated. - unset( $site_active_plugins_cache->plugins[ $basename ] ); - } - - $prev_version = $data['version']; - $current_version = $network_plugins[ $basename ]['Version']; - - if ( $was_active !== $is_active || $prev_version !== $current_version ) { - // Plugin activated or deactivated, or version changed. - - if ( $was_active !== $is_active ) { - if ( $data['is_active'] != $network_plugins[ $basename ]['is_active'] ) { - $network_plugins_cache->plugins[ $basename ]['is_active'] = $data['is_active']; - } - } - - if ( $prev_version !== $current_version ) { - $network_plugins_cache->plugins[ $basename ]['Version'] = $current_version; - } - - $updated_plugin_data = $data; - $updated_plugin_data['is_active'] = $is_active; - $updated_plugin_data['version'] = $current_version; - $updated_plugin_data['title'] = $network_plugins[ $basename ]['Name']; - $plugins_update_data[] = $updated_plugin_data; - } - } - - // Find new plugins that weren't yet seen before. - foreach ( $network_plugins as $basename => $data ) { - if ( ! isset( $network_plugins_cache->plugins[ $basename ] ) ) { - // New plugin. - $new_plugin = array( - 'slug' => $data['slug'], - 'version' => $data['Version'], - 'title' => $data['Name'], - 'is_active' => $data['is_active'], - 'is_uninstalled' => false, - ); - - $network_plugins_cache->plugins[ $basename ] = $new_plugin; - - $is_site_level_active = ( - isset( $site_active_plugins[ $basename ] ) && - $site_active_plugins[ $basename ]['is_active'] - ); - - /** - * If not network active, set the activity status based on the site-level plugin status. - */ - if ( ! $new_plugin['is_active'] ) { - $new_plugin['is_active'] = $is_site_level_active; - } - - $plugins_update_data[] = $new_plugin; - - if ( isset( $site_active_plugins[ $basename ] ) ) { - $site_active_plugins_cache->plugins[ $basename ] = $new_plugin; - $site_active_plugins_cache->plugins[ $basename ]['is_active'] = $is_site_level_active; - } - } - } - - $site_active_plugins_cache->md5 = $site_active_plugins_thumbprint; - $site_active_plugins_cache->timestamp = $time; - self::$_accounts->set_option( $site_active_plugins_option_name, $site_active_plugins_cache, true ); - - $network_plugins_cache->md5 = $network_plugins_thumbprint; - $network_plugins_cache->timestamp = $time; - self::$_accounts->set_option( $network_plugins_option_name, $network_plugins_cache, true ); - - return $plugins_update_data; - } - - /** - * Return a list of modified themes since the last sync. - * - * Note: - * There's no point to store a themes counter since even if the number of - * themes didn't change, we still need to check if the versions are all the - * same and the activity state is similar. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.8 - * - * @return array|false - */ - private function get_themes_data_for_api() { - // Alias. - $option_name = 'all_themes'; - - $all_cached_themes = self::$_accounts->get_option( $option_name ); - - if ( ! is_object( $all_cached_themes ) ) { - $all_cached_themes = (object) array( - 'timestamp' => '', - 'md5' => '', - 'themes' => array(), - ); - } - - $time = time(); - - if ( ! empty( $all_cached_themes->timestamp ) && - ( $time - $all_cached_themes->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC - ) { - // Don't send theme updates if last update was in the past 5 min. - return false; - } - - // Write timestamp to lock the logic. - $all_cached_themes->timestamp = $time; - self::$_accounts->set_option( $option_name, $all_cached_themes, true ); - - // Reload options from DB. - self::$_accounts->load( true ); - $all_cached_themes = self::$_accounts->get_option( $option_name ); - - if ( $time != $all_cached_themes->timestamp ) { - // If timestamp is different, then another thread captured the lock. - return false; - } - - // Get active theme. - $active_theme = wp_get_theme(); - $active_theme_stylesheet = $active_theme->get_stylesheet(); - - // Check if there's a change in themes. - $all_themes = wp_get_themes(); - - // Check if themes changed. - ksort( $all_themes ); - - $themes_signature = ''; - foreach ( $all_themes as $slug => $data ) { - $is_active = ( $slug === $active_theme_stylesheet ); - $themes_signature .= $slug . ',' . - $data->version . ',' . - ( $is_active ? '1' : '0' ) . ';'; - } - - // Check if themes status changed (version or active/inactive). - $themes_changed = ( $all_cached_themes->md5 !== md5( $themes_signature ) ); - - $themes_update_data = array(); - - if ( $themes_changed ) { - // Change in themes, report changes. - - // Update existing themes info. - foreach ( $all_cached_themes->themes as $slug => $data ) { - $is_active = ( $slug === $active_theme_stylesheet ); - - if ( ! isset( $all_themes[ $slug ] ) ) { - // Plugin uninstalled. - $uninstalled_theme_data = $data; - $uninstalled_theme_data['is_active'] = false; - $uninstalled_theme_data['is_uninstalled'] = true; - $themes_update_data[] = $uninstalled_theme_data; - - unset( $all_themes[ $slug ] ); - unset( $all_cached_themes->themes[ $slug ] ); - } else if ( $data['is_active'] !== $is_active || - $data['version'] !== $all_themes[ $slug ]->version - ) { - // Plugin activated or deactivated, or version changed. - - $all_cached_themes->themes[ $slug ]['is_active'] = $is_active; - $all_cached_themes->themes[ $slug ]['version'] = $all_themes[ $slug ]->version; - - $themes_update_data[] = $all_cached_themes->themes[ $slug ]; - } - } - - // Find new themes that weren't yet seen before. - foreach ( $all_themes as $slug => $data ) { - if ( ! isset( $all_cached_themes->themes[ $slug ] ) ) { - $is_active = ( $slug === $active_theme_stylesheet ); - - // New plugin. - $new_plugin = array( - 'slug' => $slug, - 'version' => $data->version, - 'title' => $data->name, - 'is_active' => $is_active, - 'is_uninstalled' => false, - ); - - $themes_update_data[] = $new_plugin; - $all_cached_themes->themes[ $slug ] = $new_plugin; - } - } - - $all_cached_themes->md5 = md5( $themes_signature ); - $all_cached_themes->timestamp = time(); - self::$_accounts->set_option( $option_name, $all_cached_themes, true ); - } - - return $themes_update_data; - } - - /** - * Get site data for API install request. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.2 - * - * @param string[] $override - * @param bool $include_plugins Since 1.1.8 by default include plugin changes. - * @param bool $include_themes Since 1.1.8 by default include plugin changes. - * @param bool $include_blog_data Since 2.3.0 by default include the current blog's data (language, charset, title, and URL). - * - * @return array - */ - private function get_install_data_for_api( - array $override, - $include_plugins = true, - $include_themes = true, - $include_blog_data = true - ) { - if ( $this->is_extensions_tracking_allowed() ) { - if ( ! defined( 'WP_FS__TRACK_PLUGINS' ) || false !== WP_FS__TRACK_PLUGINS ) { - /** - * @since 1.1.8 Also send plugin updates. - */ - if ( $include_plugins && ! isset( $override['plugins'] ) ) { - $plugins = $this->get_plugins_data_for_api(); - if ( ! empty( $plugins ) ) { - $override['plugins'] = $plugins; - } - } - } - - if ( ! defined( 'WP_FS__TRACK_THEMES' ) || false !== WP_FS__TRACK_THEMES ) { - /** - * @since 1.1.8 Also send themes updates. - */ - if ( $include_themes && ! isset( $override['themes'] ) ) { - $themes = $this->get_themes_data_for_api(); - if ( ! empty( $themes ) ) { - $override['themes'] = $themes; - } - } - } - } - - $versions = $this->get_versions(); - - $blog_data = $include_blog_data ? - array( - 'language' => get_bloginfo( 'language' ), - 'charset' => get_bloginfo( 'charset' ), - 'title' => get_bloginfo( 'name' ), - 'url' => get_site_url(), - ) : - array(); - - return array_merge( $versions, $blog_data, array( - 'version' => $this->get_plugin_version(), - 'is_premium' => $this->is_premium(), - // Special params. - 'is_active' => true, - 'is_disconnected' => $this->is_tracking_prohibited(), - 'is_uninstalled' => false, - ), $override ); - } - - /** - * Update installs details. - * - * @todo V1 of multiste network support doesn't support plugin and theme data sending. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string[] string $override - * @param bool $only_diff - * @param bool $include_plugins Since 1.1.8 by default include plugin changes. - * @param bool $include_themes Since 1.1.8 by default include plugin changes. - * - * @return array - */ - private function get_installs_data_for_api( - array $override, - $only_diff = false, - $include_plugins = true, - $include_themes = true - ) { - /** - * @since 1.1.8 Also send plugin updates. - */ -// if ( $include_plugins && ! isset( $override['plugins'] ) ) { -// $plugins = $this->get_plugins_data_for_api(); -// if ( ! empty( $plugins ) ) { -// $override['plugins'] = $plugins; -// } -// } - /** - * @since 1.1.8 Also send themes updates. - */ -// if ( $include_themes && ! isset( $override['themes'] ) ) { -// $themes = $this->get_themes_data_for_api(); -// if ( ! empty( $themes ) ) { -// $override['themes'] = $themes; -// } -// } - - // Common properties. - $versions = $this->get_versions(); - $common = array_merge( $versions, array( - 'version' => $this->get_plugin_version(), - 'is_premium' => $this->is_premium(), - ), $override ); - - - $is_common_diff_for_any_site = false; - $common_diff_union = array(); - - $installs_data = array(); - - $sites = self::get_sites(); - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( is_object( $install ) ) { - if ( $install->user_id != $this->_user->id ) { - // Install belongs to a different owner. - continue; - } - - if ( ! $this->is_premium() && $install->is_tracking_prohibited() ) { - // Don't send updates regarding opted-out installs. - continue; - } - - $install_data = $this->get_site_info( $site ); - - $uid = $install_data['uid']; - - unset( $install_data['blog_id'] ); - unset( $install_data['uid'] ); - - $install_data['is_disconnected'] = $install->is_disconnected; - $install_data['is_active'] = $this->is_active_for_site( $blog_id ); - $install_data['is_uninstalled'] = $install->is_uninstalled; - - $common_diff = null; - $is_common_diff = false; - if ( $only_diff ) { - $install_data = $this->get_install_diff_for_api( $install_data, $install, $override ); - $common_diff = $this->get_install_diff_for_api( $common, $install, $override ); - - $is_common_diff = ! empty( $common_diff ); - - if ( $is_common_diff ) { - foreach ( $common_diff as $k => $v ) { - if ( ! isset( $common_diff_union[ $k ] ) ) { - $common_diff_union[ $k ] = $v; - } - } - } - - $is_common_diff_for_any_site = $is_common_diff_for_any_site || $is_common_diff; - } - - if ( ! empty( $install_data ) || $is_common_diff ) { - // Add install ID and site unique ID. - $install_data['id'] = $install->id; - $install_data['uid'] = $uid; - - $installs_data[] = $install_data; - } - } - } - - restore_current_blog(); - - if ( 0 < count( $installs_data ) && ( $is_common_diff_for_any_site || ! $only_diff ) ) { - if ( ! $only_diff ) { - $installs_data[] = $common; - } else if ( ! empty( $common_diff_union ) ) { - $installs_data[] = $common_diff_union; - } - } - - foreach ( $installs_data as &$data ) { - $data = (object) $data; - } - - return $installs_data; - } - - /** - * Compare site actual data to the stored install data and return the differences for an API data sync. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param array $site - * @param FS_Site $install - * @param string[] string $override - * - * @return array - */ - private function get_install_diff_for_api( $site, $install, $override = array() ) { - $diff = array(); - $special = array(); - $special_override = false; - - foreach ( $site as $p => $v ) { - if ( property_exists( $install, $p ) ) { - if ( ( is_bool( $install->{$p} ) || ! empty( $install->{$p} ) ) && - $install->{$p} != $v - ) { - $install->{$p} = $v; - $diff[ $p ] = $v; - } - } else { - $special[ $p ] = $v; - - if ( isset( $override[ $p ] ) || - 'plugins' === $p || - 'themes' === $p - ) { - $special_override = true; - } - } - } - - if ( $special_override || 0 < count( $diff ) ) { - // Add special params only if has at least one - // standard param, or if explicitly requested to - // override a special param or a param which is not exist - // in the install object. - $diff = array_merge( $diff, $special ); - } - - return $diff; - } - - /** - * Update install only if changed. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string[] string $override - * @param bool $flush - * - * @return false|object|string - */ - private function send_install_update( $override = array(), $flush = false ) { - $this->_logger->entrance(); - - $check_properties = $this->get_install_data_for_api( $override ); - - if ( $flush ) { - $params = $check_properties; - } else { - $params = $this->get_install_diff_for_api( $check_properties, $this->_site, $override ); - } - - $keepalive_only_update = false; - if ( empty( $params ) ) { - $keepalive_only_update = $this->should_send_keepalive_update(); - - if ( ! $keepalive_only_update ) { - /** - * There are no updates to send including keepalive. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - return false; - } - } - - if ( ! $keepalive_only_update ) { - /** - * Do not update the last install sync timestamp after a keepalive-only call since there were no actual - * updates sent. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - if ( ! is_multisite() ) { - // Update last install sync timestamp. - $this->set_cron_execution_timestamp( 'install_sync' ); - } - - $params['uid'] = $this->get_anonymous_id(); - } - - $this->set_keepalive_timestamp(); - - // Send updated values to FS. - $site = $this->get_api_site_scope()->call( '/', 'put', $params ); - - if ( ! $keepalive_only_update && $this->is_api_result_entity( $site ) ) { - /** - * Do not clear scheduled sync after a keepalive-only call since there were no actual updates sent. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - if ( ! is_multisite() ) { - // I successfully sent install update, clear scheduled sync if exist. - $this->clear_install_sync_cron(); - } - } - - return $site; - } - - /** - * Update installs only if changed. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param string[] string $override - * @param bool $flush - * - * @return false|object|string - */ - private function send_installs_update( $override = array(), $flush = false ) { - $this->_logger->entrance(); - - $installs_data = $this->get_installs_data_for_api( $override, ! $flush ); - - $keepalive_only_update = false; - if ( empty( $installs_data ) ) { - /** - * Pass `true` to use the network level storage since the update is for many installs. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - $keepalive_only_update = $this->should_send_keepalive_update( true ); - - if ( ! $keepalive_only_update ) { - /** - * There are no updates to send including keepalive. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - return false; - } - } - - if ( ! $keepalive_only_update ) { - // Update last install sync timestamp if there were actual updates sent (i.e., not a keepalive-only call). - $this->set_cron_execution_timestamp( 'install_sync' ); - } - - /** - * Pass `true` to use the network level storage since the update is for many installs. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - $this->set_keepalive_timestamp( true ); - - // Send updated values to FS. - $result = $this->get_api_user_scope()->call( "/plugins/{$this->_plugin->id}/installs.json", 'put', $installs_data ); - - if ( ! $keepalive_only_update && $this->is_api_result_object( $result, 'installs' ) ) { - // I successfully sent installs update (there was an actual update sent and it's not just a keepalive-only call), clear scheduled sync if exist. - $this->clear_install_sync_cron(); - } - - return $result; - } - - /** - * @author Leo Fajardo (@leorw) - * - * @param bool|null $use_network_level_storage - * - * @return bool - */ - private function should_send_keepalive_update( $use_network_level_storage = null ) { - $keepalive_timestamp = $this->_storage->get( 'keepalive_timestamp', 0, $use_network_level_storage ); - - if ( $keepalive_timestamp < ( time() - WP_FS__TIME_WEEK_IN_SEC ) ) { - // If updated more than 7 days ago, trigger a keepalive and update the time it was triggered. - return true; - } else { - // If updated 7 days ago or less, "flip a coin", if the value is 7 trigger a keepalive and update the last time it was triggered. - return ( 7 == rand( 1, 7 ) ); - } - } - - /** - * Syncs the install owner's data if needed (i.e., if the install owner is different from the loaded user). - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - */ - private function maybe_sync_install_user() { - if ( $this->_user->id == $this->_site->user_id ) { - return; - } - - // Fetch user data and store if found. - $this->sync_user_by_current_install(); - } - - /** - * Update install only if changed. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string[] string $override - * @param bool $flush - */ - private function sync_install( $override = array(), $flush = false ) { - $this->_logger->entrance(); - - $site = $this->send_install_update( $override, $flush ); - - if ( false === $site ) { - // No sync required. - return; - } - - if ( ! $this->is_api_result_entity( $site ) ) { - // Failed to sync, don't update locally. - return; - } - - $this->_site = new FS_Site( $site ); - - $this->_store_site( true ); - } - - /** - * Update install only if changed. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string[] string $override - * @param bool $flush - */ - private function sync_installs( $override = array(), $flush = false ) { - $this->_logger->entrance(); - - $result = $this->send_installs_update( $override, $flush ); - - if ( false === $result ) { - // No sync required. - return; - } - - if ( ! $this->is_api_result_object( $result, 'installs' ) ) { - // Failed to sync, don't update locally. - return; - } - - $address_to_blog_map = $this->get_address_to_blog_map(); - - foreach ( $result->installs as $install ) { - $this->_site = new FS_Site( $install ); - - $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); - $blog_id = $address_to_blog_map[ $address ]; - - $this->_store_site( true, $blog_id ); - } - } - - /** - * Track install's custom event. - * - * IMPORTANT: - * Custom event tracking is currently only supported for specific clients. - * If you are not one of them, please don't use this method. If you will, - * the API will simply ignore your request based on the plugin ID. - * - * Need custom tracking for your plugin or theme? - * If you are interested in custom event tracking please contact yo@freemius.com - * for further details. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1 - * - * @param string $name Event name. - * @param array $properties Associative key/value array with primitive values only - * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s. - * @param bool $once If true, event will be tracked only once. IMPORTANT: Still trigger the API call. - * - * @return object|false Event data or FALSE on failure. - * - * @throws \Freemius_InvalidArgumentException - */ - public function track_event( $name, $properties = array(), $process_at = false, $once = false ) { - $this->_logger->entrance( http_build_query( array( 'name' => $name, 'once' => $once ) ) ); - - if ( ! $this->is_registered() ) { - return false; - } - - $event = array( 'type' => $name ); - - if ( is_numeric( $process_at ) && $process_at > time() ) { - $event['process_at'] = $process_at; - } - - if ( $once ) { - $event['once'] = true; - } - - if ( ! empty( $properties ) ) { - // Verify associative array values are primitive. - foreach ( $properties as $k => $v ) { - if ( ! is_scalar( $v ) ) { - throw new Freemius_InvalidArgumentException( 'The $properties argument must be an associative key/value array with primitive values only.' ); - } - } - - $event['properties'] = $properties; - } - - $result = $this->get_api_site_scope()->call( 'events.json', 'post', $event ); - - return $this->is_api_error( $result ) ? - false : - $result; - } - - /** - * Track install's custom event only once, but it still triggers the API call. - * - * IMPORTANT: - * Custom event tracking is currently only supported for specific clients. - * If you are not one of them, please don't use this method. If you will, - * the API will simply ignore your request based on the plugin ID. - * - * Need custom tracking for your plugin or theme? - * If you are interested in custom event tracking please contact yo@freemius.com - * for further details. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1 - * - * @param string $name Event name. - * @param array $properties Associative key/value array with primitive values only - * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s. - * - * @return object|false Event data or FALSE on failure. - * - * @throws \Freemius_InvalidArgumentException - * - * @user Freemius::track_event() - */ - public function track_event_once( $name, $properties = array(), $process_at = false ) { - return $this->track_event( $name, $properties, $process_at, true ); - } - - /** - * Plugin uninstall hook. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param bool $check_user Enforce checking if user have plugins activation privileges. - */ - function _uninstall_plugin_event( $check_user = true ) { - $this->_logger->entrance( 'slug = ' . $this->_slug ); - - if ( $check_user && ! current_user_can( 'activate_plugins' ) ) { - return; - } - - $params = array(); - $uninstall_reason = null; - if ( isset( $this->_storage->uninstall_reason ) ) { - $uninstall_reason = $this->_storage->uninstall_reason; - $params['reason_id'] = $uninstall_reason->id; - $params['reason_info'] = $uninstall_reason->info; - } - - if ( ! $this->is_registered() ) { - // Send anonymous uninstall event only if user submitted a feedback. - if ( isset( $uninstall_reason ) ) { - if ( isset( $uninstall_reason->is_anonymous ) && ! $uninstall_reason->is_anonymous ) { - $this->opt_in( false, false, false, false, true ); - } else { - $params['uid'] = $this->get_anonymous_id(); - $this->get_api_plugin_scope()->call( 'uninstall.json', 'put', $params ); - } - } - } else { - $params = array_merge( $params, array( - 'is_active' => false, - 'is_uninstalled' => true, - ) ); - - if ( $this->_is_network_active ) { - // Send uninstall event. - $this->send_installs_update( $params ); - } else { - // Send uninstall event. - $this->send_install_update( $params ); - } - } - - // @todo Decide if we want to delete plugin information from db. - } - - /** - * Set the basename of the current product and hook _activate_plugin_event_hook() to the activation action. - * - * @author Vova Feldman (@svovaf) - * @since 2.2.1 - * - * @param string $is_premium - * @param string $caller - * - * @return string - */ - function set_basename( $is_premium, $caller ) { - $basename = plugin_basename( $caller ); - - $current_basename = $is_premium ? - $this->_premium_plugin_basename : - $this->_free_plugin_basename; - - if ( $current_basename == $basename ) { - // Basename value set correctly. - return; - } - - if ( $is_premium ) { - $this->_premium_plugin_basename = $basename; - } else { - $this->_free_plugin_basename = $basename; - } - - $plugin_dir = dirname( $this->_plugin_dir_path ) . '/'; - - register_activation_hook( - $plugin_dir . $basename, - array( &$this, '_activate_plugin_event_hook' ) - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.1 - * @since 2.2.1 If the context product is in its premium version, use the current module's basename, even if it was renamed. - * - * @return string - */ - function premium_plugin_basename() { - if ( ! isset( $this->_premium_plugin_basename ) ) { - $this->_premium_plugin_basename = $this->is_premium() ? - // The product is premium, so use the current basename. - $this->_plugin_basename : - $this->get_premium_slug() . '/' . basename( $this->_free_plugin_basename ); - } - - return $this->_premium_plugin_basename; - } - - /** - * Uninstall plugin hook. Called only when connected his account with Freemius for active sites tracking. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - */ - public static function _uninstall_plugin_hook() { - self::_load_required_static(); - - self::$_static_logger->entrance(); - - if ( ! current_user_can( 'activate_plugins' ) ) { - return; - } - - $plugin_file = substr( current_filter(), strlen( 'uninstall_' ) ); - - self::$_static_logger->info( 'plugin = ' . $plugin_file ); - - define( 'WP_FS__UNINSTALL_MODE', true ); - - $fs = self::get_instance_by_file( $plugin_file ); - - if ( is_object( $fs ) ) { - $fs->remove_sdk_reference(); - - self::require_plugin_essentials(); - - if ( is_plugin_active( $fs->_free_plugin_basename ) || - is_plugin_active( $fs->premium_plugin_basename() ) - ) { - // Deleting Free or Premium plugin version while the other version still installed. - return; - } - - $fs->_uninstall_plugin_event(); - - $fs->do_action( 'after_uninstall' ); - } - } - - #---------------------------------------------------------------------------------- - #region Plugin Information - #---------------------------------------------------------------------------------- - - /** - * Load WordPress core plugin.php essential module. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.1 - */ - private static function require_plugin_essentials() { - if ( ! function_exists( 'get_plugins' ) ) { - self::$_static_logger->log( 'Including wp-admin/includes/plugin.php...' ); - - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - } - - /** - * Load WordPress core pluggable.php module. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.2 - */ - private static function require_pluggable_essentials() { - if ( ! function_exists( 'wp_get_current_user' ) ) { - require_once ABSPATH . 'wp-includes/pluggable.php'; - } - } - - /** - * Return plugin data. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param bool $reparse_plugin_metadata - * - * @return array - */ - function get_plugin_data( $reparse_plugin_metadata = false ) { - if ( ! isset( $this->_plugin_data ) || $reparse_plugin_metadata ) { - self::require_plugin_essentials(); - - if ( $this->is_plugin() ) { - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.0 When using get_plugin_data() do NOT translate plugin data. - * - * @link https://github.com/Freemius/wordpress-sdk/issues/77 - */ - $plugin_data = get_plugin_data( - $this->_plugin_main_file_path, - false, - false - ); - } else { - $theme_data = wp_get_theme(); - - if ( $this->_plugin_basename !== $theme_data->get_stylesheet() && is_child_theme() ) { - $parent_theme = $theme_data->parent(); - - if ( ( $parent_theme instanceof WP_Theme ) && $this->_plugin_basename === $parent_theme->get_stylesheet() ) { - $theme_data = $parent_theme; - } - } - - $plugin_data = array( - 'Name' => $theme_data->get( 'Name' ), - 'Version' => $theme_data->get( 'Version' ), - 'Author' => $theme_data->get( 'Author' ), - 'Description' => $theme_data->get( 'Description' ), - 'PluginURI' => $theme_data->get( 'ThemeURI' ), - ); - } - - $this->_plugin_data = $plugin_data; - } - - return $this->_plugin_data; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * @since 1.2.2.5 If slug not set load slug by module ID. - * - * @return string Plugin slug. - */ - function get_slug() { - if ( ! isset( $this->_slug ) ) { - $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); - $this->_slug = $id_slug_type_path_map[ $this->_module_id ]['slug']; - } - - return $this->_slug; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - * - * @return string - */ - function get_premium_slug() { - return is_object( $this->_plugin ) ? - $this->_plugin->premium_slug : - "{$this->_slug}-premium"; - } - - /** - * Retrieve the desired folder name for the product. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @return string Plugin slug. - */ - function get_target_folder_name() { - return $this->can_use_premium_code() ? - $this->_plugin->premium_slug : - $this->_slug; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @return number Plugin ID. - */ - function get_id() { - return $this->_plugin->id; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.2.4 - * - * @return number|null Bundle ID. - */ - function get_bundle_id() { - return ( isset( $this->_plugin->bundle_id ) && FS_Plugin::is_valid_id( $this->_plugin->bundle_id ) ) ? - $this->_plugin->bundle_id : - null; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @return string|null Bundle public key. - */ - function get_bundle_public_key() { - return isset( $this->_plugin->bundle_public_key ) ? - $this->_plugin->bundle_public_key : - null; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @return string Freemius SDK version - */ - function get_sdk_version() { - return $this->version; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @return number Parent plugin ID (if parent exist). - */ - function get_parent_id() { - return $this->is_addon() ? - $this->get_parent_instance()->get_id() : - $this->_plugin->id; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @return string - */ - function get_usage_tracking_terms_url() { - return $this->apply_filters( - 'usage_tracking_terms_url', - "https://freemius.com/wordpress/usage-tracking/{$this->_plugin->id}/{$this->_slug}/" - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @return string - */ - function get_eula_url() { - return $this->apply_filters( - 'eula_url', - "https://freemius.com/terms/{$this->_plugin->id}/{$this->_slug}/" - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @return string Plugin public key. - */ - function get_public_key() { - return $this->_plugin->public_key; - } - - /** - * Will be available only on sandbox mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @return mixed Plugin secret key. - */ - function get_secret_key() { - return $this->_plugin->secret_key; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.1 - * - * @return bool - */ - function has_secret_key() { - return ! empty( $this->_plugin->secret_key ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string|bool $premium_suffix - * - * @return string - */ - function get_plugin_name( $premium_suffix = false ) { - $this->_logger->entrance(); - - /** - * This `if-else` can be squeezed into a single `if` but I intentionally split it for code readability. - * - * @author Vova Feldman - */ - if ( ! isset( $this->_plugin_name ) ) { - // Name is not yet set. - $this->set_name( $premium_suffix ); - } else if ( - ! empty( $premium_suffix ) && - ( ! is_object( $this->_plugin ) || $this->_plugin->premium_suffix !== $premium_suffix ) - ) { - // Name is already set, but there's a change in the premium suffix. - $this->set_name( $premium_suffix ); - } - - return $this->_plugin_name; - } - - /** - * Calculates and stores the product's name. This helper function was created specifically for get_plugin_name() just to make the code clearer. - * - * @author Vova Feldman (@svovaf) - * @since 2.2.1 - * - * @param string $premium_suffix - */ - private function set_name( $premium_suffix = '' ) { - $plugin_data = $this->get_plugin_data(); - - // Get name. - $this->_plugin_name = $plugin_data['Name']; - - if ( is_string( $premium_suffix ) ) { - $premium_suffix = trim( $premium_suffix ); - - if ( ! empty( $premium_suffix ) ) { - // Check if plugin name contains " (premium)" or a custom suffix and remove it. - $suffix = ( ' ' . strtolower( $premium_suffix ) ); - $suffix_len = strlen( $suffix ); - - if ( strlen( $plugin_data['Name'] ) > $suffix_len && - $suffix === substr( strtolower( $plugin_data['Name'] ), - $suffix_len ) - ) { - $this->_plugin_name = substr( $plugin_data['Name'], 0, - $suffix_len ); - } - } - } - - $this->_logger->departure( 'Name = ' . $this->_plugin_name ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - * - * @param bool $reparse_plugin_metadata - * - * @return string - */ - function get_plugin_version( $reparse_plugin_metadata = false ) { - $this->_logger->entrance(); - - $plugin_data = $this->get_plugin_data( $reparse_plugin_metadata ); - - $this->_logger->departure( 'Version = ' . $plugin_data['Version'] ); - - return $this->apply_filters( 'plugin_version', $plugin_data['Version'] ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @return string - */ - function get_plugin_title() { - $this->_logger->entrance(); - - $title = $this->_plugin->title; - - return $this->apply_filters( 'plugin_title', $title ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @param bool $lowercase - * - * @return string - */ - function get_module_label( $lowercase = false ) { - $label = $this->is_addon() ? - $this->get_text_inline( 'Add-On', 'addon' ) : - ( $this->is_plugin() ? - $this->get_text_inline( 'Plugin', 'plugin' ) : - $this->get_text_inline( 'Theme', 'theme' ) ); - - if ( $lowercase ) { - $label = strtolower( $label ); - } - - return $label; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @return string - */ - function get_plugin_basename() { - if ( ! isset( $this->_plugin_basename ) ) { - if ( $this->is_plugin() ) { - $this->_plugin_basename = plugin_basename( $this->_plugin_main_file_path ); - } else { - $this->_plugin_basename = basename( dirname( $this->_plugin_main_file_path ) ); - } - } - - return $this->_plugin_basename; - } - - function get_plugin_folder_name() { - $this->_logger->entrance(); - - $plugin_folder = $this->_plugin_basename; - - while ( '.' !== dirname( $plugin_folder ) ) { - $plugin_folder = dirname( $plugin_folder ); - } - - $this->_logger->departure( 'Folder Name = ' . $plugin_folder ); - - return $plugin_folder; - } - - #endregion ------------------------------------------------------------------ - - /* Account - ------------------------------------------------------------------------------------------------------------------*/ - - /** - * Find plugin's slug by plugin's basename. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string $plugin_base_name - * - * @return false|string - */ - private static function find_slug_by_basename( $plugin_base_name ) { - $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() ); - - if ( ! array( $file_slug_map ) || ! isset( $file_slug_map[ $plugin_base_name ] ) ) { - return false; - } - - return $file_slug_map[ $plugin_base_name ]; - } - - /** - * Store the map between the plugin's basename to the slug. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - private function store_file_slug_map() { - $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() ); - - if ( ! array( $file_slug_map ) ) { - $file_slug_map = array(); - } - - if ( ! isset( $file_slug_map[ $this->_plugin_basename ] ) || - $file_slug_map[ $this->_plugin_basename ] !== $this->_slug - ) { - $file_slug_map[ $this->_plugin_basename ] = $this->_slug; - self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true ); - } - } - - /** - * @return array[number]FS_User - */ - static function get_all_users() { - $users = self::maybe_get_entities_account_option( 'users', array() ); - - if ( ! is_array( $users ) ) { - $users = array(); - } - - return $users; - } - - /** - * @param string $module_type - * @param null|int $blog_id Since 2.0.0 - * - * @return array[string]FS_Site - */ - private static function get_all_sites( - $module_type = WP_FS__MODULE_TYPE_PLUGIN, - $blog_id = null - ) { - $sites = self::get_account_option( 'sites', $module_type, $blog_id ); - - if ( ! is_array( $sites ) ) { - $sites = array(); - } - - return $sites; - } - - /** - * @author Leo Fajardo (@leorw) - * - * @since 1.2.2 - * - * @param string $option_name - * @param string $module_type - * @param null|int $network_level_or_blog_id Since 2.0.0 - * - * @return mixed - */ - private static function get_account_option( $option_name, $module_type = null, $network_level_or_blog_id = null ) { - if ( ! is_null( $module_type ) && WP_FS__MODULE_TYPE_PLUGIN !== $module_type ) { - $option_name = $module_type . '_' . $option_name; - } - - return self::maybe_get_entities_account_option( $option_name, array(), $network_level_or_blog_id ); - } - - /** - * @author Leo Fajardo (@leorw) - * - * @since 1.2.2 - * - * @param string $option_name - * @param mixed $option_value - * @param bool $store - * @param null|int $network_level_or_blog_id Since 2.0.0 - */ - private function set_account_option( $option_name, $option_value, $store, $network_level_or_blog_id = null ) { - self::set_account_option_by_module( - $this->_module_type, - $option_name, - $option_value, - $store, - $network_level_or_blog_id - ); - } - - /** - * @author Vova Feldman (@svovaf) - * - * @since 1.2.2.7 - * - * @param string $module_type - * @param string $option_name - * @param mixed $option_value - * @param bool $store - * @param null|int $network_level_or_blog_id Since 2.0.0 - */ - private static function set_account_option_by_module( - $module_type, - $option_name, - $option_value, - $store, - $network_level_or_blog_id = null - ) { - if ( WP_FS__MODULE_TYPE_PLUGIN != $module_type ) { - $option_name = $module_type . '_' . $option_name; - } - - self::$_accounts->set_option( $option_name, $option_value, $store, $network_level_or_blog_id ); - } - - /** - * This method can also return non-entity or non-entities collection option like the `user_id_license_ids_map` option. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @param string $option_name - * @param mixed $default - * @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_SITE_LEVEL_PARAMS). - * - * @return mixed|FS_Plugin[]|FS_User[]|FS_Site[]|FS_Plugin_License[]|FS_Plugin_Plan[]|FS_Plugin_Tag[] - */ - private static function maybe_get_entities_account_option( $option_name, $default = null, $network_level_or_blog_id = null ) { - $option = self::$_accounts->get_option( $option_name, $default, $network_level_or_blog_id ); - - $class_name = ''; - - if ( fs_starts_with( $option_name, WP_FS__MODULE_TYPE_THEME . '_' ) ) { - $option_name = str_replace( WP_FS__MODULE_TYPE_THEME . '_', '', $option_name ); - } - - switch ( $option_name ) { - case 'plugins': - case 'themes': - case 'addons': - $class_name = FS_Plugin::get_class_name(); - break; - case 'users': - $class_name = FS_User::get_class_name(); - break; - case 'sites': - $class_name = FS_Site::get_class_name(); - break; - case 'licenses': - case 'all_licenses': - $class_name = FS_Plugin_License::get_class_name(); - break; - case 'plans': - $class_name = FS_Plugin_Plan::get_class_name(); - break; - case 'updates': - $class_name = FS_Plugin_Tag::get_class_name(); - break; - } - - if ( empty( $class_name ) ) { - return $option; - } - - return fs_get_entities( $option, $class_name ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param number|null $module_id - * - * @return FS_Plugin_License[] - */ - private static function get_all_licenses( $module_id = null ) { - $licenses = self::get_account_option( 'all_licenses' ); - - if ( ! is_array( $licenses ) ) { - $licenses = array(); - } - - if ( is_null( $module_id ) ) { - return $licenses; - } - - $licenses = isset( $licenses[ $module_id ] ) ? - $licenses[ $module_id ] : - array(); - - return $licenses; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @return array - */ - private static function get_all_licenses_by_module_type() { - $licenses = self::get_account_option( 'all_licenses' ); - - $licenses_by_module_type = array( - WP_FS__MODULE_TYPE_PLUGIN => array(), - WP_FS__MODULE_TYPE_THEME => array() - ); - - if ( ! is_array( $licenses ) ) { - return $licenses_by_module_type; - } - - foreach ( $licenses as $module_id => $module_licenses ) { - $fs = self::get_instance_by_id( $module_id ); - if ( false === $fs ) { - continue; - } - - $licenses_by_module_type[ $fs->_module_type ] = array_merge( $licenses_by_module_type[ $fs->_module_type ], $module_licenses ); - } - - return $licenses_by_module_type; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param number $module_id - * @param number|null $user_id - * - * @return array - */ - private static function get_user_id_license_ids_map( $module_id, $user_id = null ) { - $all_modules_user_id_license_ids_map = self::get_account_option( 'user_id_license_ids_map' ); - - if ( ! is_array( $all_modules_user_id_license_ids_map ) ) { - $all_modules_user_id_license_ids_map = array(); - } - - $user_id_license_ids_map = isset( $all_modules_user_id_license_ids_map[ $module_id ] ) ? - $all_modules_user_id_license_ids_map[ $module_id ] : - array(); - - if ( FS_User::is_valid_id( $user_id ) ) { - $user_id_license_ids_map = isset( $user_id_license_ids_map[ $user_id ] ) ? - $user_id_license_ids_map[ $user_id ] : - array(); - } - - return $user_id_license_ids_map; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param array $new_user_id_license_ids_map - * @param number $module_id - * @param number|null $user_id - */ - private static function store_user_id_license_ids_map( $new_user_id_license_ids_map, $module_id, $user_id = null ) { - $all_modules_user_id_license_ids_map = self::get_account_option( 'user_id_license_ids_map' ); - if ( ! is_array( $all_modules_user_id_license_ids_map ) ) { - $all_modules_user_id_license_ids_map = array(); - } - - if ( ! isset( $all_modules_user_id_license_ids_map[ $module_id ] ) ) { - $all_modules_user_id_license_ids_map[ $module_id ] = array(); - } - - if ( FS_User::is_valid_id( $user_id ) ) { - $all_modules_user_id_license_ids_map[ $module_id ][ $user_id ] = $new_user_id_license_ids_map; - } else { - $all_modules_user_id_license_ids_map[ $module_id ] = $new_user_id_license_ids_map; - } - - self::$_accounts->set_option( 'user_id_license_ids_map', $all_modules_user_id_license_ids_map, true ); - } - - /** - * Get a collection of the user's linked license IDs. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $user_id - * - * @return number[] - */ - private function get_user_linked_license_ids( $user_id ) { - return self::get_user_id_license_ids_map( $this->_module_id, $user_id ); - } - - /** - * Override the user's linked license IDs with a new IDs collection. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $user_id - * @param number[] $license_ids - */ - private function set_user_linked_license_ids( $user_id, array $license_ids ) { - self::store_user_id_license_ids_map( $license_ids, $this->_module_id, $user_id ); - } - - /** - * Link a specified license ID to a given user. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $license_id - * @param number $user_id - */ - private function link_license_2_user( $license_id, $user_id ) { - $license_ids = $this->get_user_linked_license_ids( $user_id ); - - if ( in_array( $license_id, $license_ids ) ) { - // License already linked. - return; - } - - $license_ids[] = $license_id; - - $this->set_user_linked_license_ids( $user_id, $license_ids ); - } - - /** - * @param string|bool $module_type - * - * @return FS_Plugin_Plan[] - */ - private static function get_all_plans( $module_type = false ) { - $plans = self::get_account_option( 'plans', $module_type ); - - if ( ! is_array( $plans ) ) { - $plans = array(); - } - - return $plans; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @return FS_Plugin_Tag[] - */ - private static function get_all_updates() { - $updates = self::maybe_get_entities_account_option( 'updates', array() ); - - if ( ! is_array( $updates ) ) { - $updates = array(); - } - - return $updates; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return array|false - */ - private static function get_all_addons() { - $addons = self::maybe_get_entities_account_option( 'addons', array() ); - - if ( ! is_array( $addons ) ) { - $addons = array(); - } - - return $addons; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return number[]|false - */ - private static function get_all_account_addons() { - $addons = self::$_accounts->get_option( 'account_addons', array() ); - - if ( ! is_array( $addons ) ) { - $addons = array(); - } - - return $addons; - } - - /** - * Check if user has connected his account (opted-in). - * - * Note: - * If the user opted-in and opted-out on a later stage, - * this will still return true. If you want to check if the - * user is currently opted-in, use: - * `$fs->is_registered() && $fs->is_tracking_allowed()` - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * @return bool - */ - function is_registered() { - return is_object( $this->_user ); - } - - /** - * Returns TRUE if the user opted-in and didn't disconnect (opt-out). - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - * - * @return bool - */ - function is_tracking_allowed() { - return ( is_object( $this->_site ) && $this->_site->is_tracking_allowed() ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.4.0 - * - * @return bool - */ - function is_bundle_license_auto_activation_enabled() { - return $this->is_addon() ? - ( is_object( $this->_parent ) && $this->_parent->is_bundle_license_auto_activation_enabled() ) : - $this->_is_bundle_license_auto_activation_enabled; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @return FS_Plugin - */ - function get_plugin() { - return $this->_plugin; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * - * @return FS_User - */ - function get_user() { - return $this->_user; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * - * @return FS_Site - */ - function get_site() { - return $this->_site; - } - - /** - * Get plugin add-ons. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @since 1.1.7.3 If not yet loaded, fetch data from the API. - * - * @param bool $flush - * - * @return FS_Plugin[]|false - */ - function get_addons( $flush = false ) { - $this->_logger->entrance(); - - if ( ! $this->_has_addons ) { - return false; - } - - $addons = $this->sync_addons( $flush ); - - return ( ! is_array( $addons ) || empty( $addons ) ) ? - false : - $addons; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return number[]|false - */ - function get_account_addons() { - $this->_logger->entrance(); - - $addons = self::get_all_account_addons(); - - if ( ! is_array( $addons ) || - ! isset( $addons[ $this->_plugin->id ] ) || - ! is_array( $addons[ $this->_plugin->id ] ) || - 0 === count( $addons[ $this->_plugin->id ] ) - ) { - return false; - } - - return $addons[ $this->_plugin->id ]; - } - - /** - * Check if user has any - * - * @author Vova Feldman (@svovaf) - * @since 1.1.6 - * - * @return bool - */ - function has_account_addons() { - $addons = $this->get_account_addons(); - - return is_array( $addons ) && ( 0 < count( $addons ) ); - } - - - /** - * Get add-on by ID (from local data). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param number $id - * - * @return FS_Plugin|false - */ - function get_addon( $id ) { - $this->_logger->entrance(); - - $addons = $this->get_addons(); - - if ( is_array( $addons ) ) { - foreach ( $addons as $addon ) { - if ( $id == $addon->id ) { - return $addon; - } - } - } - - return false; - } - - /** - * Get add-on by slug (from local data). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param string $slug - * - * @param bool $flush - * - * @return FS_Plugin|false - */ - function get_addon_by_slug( $slug, $flush = false ) { - $this->_logger->entrance(); - - $addons = $this->get_addons( $flush ); - - if ( is_array( $addons ) ) { - foreach ( $addons as $addon ) { - if ( $slug === $addon->slug ) { - return $addon; - } - } - } - - return false; - } - - /** - * @var array { - * @key number Add-on ID. - * @val object[] The add-on's plans and prices object. - * } - */ - private $plans_and_pricing_by_addon_id; - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @return array { - * @key number Add-on ID. - * @val object[] The add-on's plans and prices object. - * } - */ - function _get_addons_plans_and_pricing_map_by_id() { - if ( ! isset( $this->plans_and_pricing_by_addon_id ) ) { - $result = $this->get_api_plugin_scope()->get( $this->add_show_pending( "/addons/pricing.json?type=visible" ) ); - - $plans_and_pricing_by_addon_id = array(); - if ( $this->is_api_result_object( $result, 'addons' ) ) { - foreach ( $result->addons as $addon ) { - $plans_and_pricing_by_addon_id[ $addon->id ] = $addon->plans; - } - } - - $this->plans_and_pricing_by_addon_id = $plans_and_pricing_by_addon_id; - } - - return $this->plans_and_pricing_by_addon_id; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param number $addon_id - * @param bool $is_installed - * - * @return array - */ - function _get_addon_info( $addon_id, $is_installed ) { - $addon = $this->get_addon( $addon_id ); - - if ( ! is_object( $addon ) ) { - // Unexpected call. - return array(); - } - - $slug = $addon->slug; - - $addon_storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug ); - - if ( ! fs_is_network_admin() ) { - // Get blog-level activated installations. - $sites = self::maybe_get_entities_account_option( 'sites', array() ); - } else { - $sites = null; - - if ( $this->is_addon_activated( $addon_id ) && - $this->get_addon_instance( $addon_id )->is_network_active() - ) { - if ( FS_Site::is_valid_id( $addon_storage->network_install_blog_id ) ) { - // Get network-level activated installations. - $sites = self::maybe_get_entities_account_option( - 'sites', - array(), - $addon_storage->network_install_blog_id - ); - } - } - } - - $addon_info = array( - 'is_connected' => false, - 'slug' => $slug, - 'title' => $addon->title, - 'is_whitelabeled' => $addon_storage->is_whitelabeled - ); - - if ( ! $is_installed ) { - $plans_and_pricing_by_addon_id = $this->_get_addons_plans_and_pricing_map_by_id(); - - if ( isset( $plans_and_pricing_by_addon_id[ $addon_id ] ) ) { - $has_paid_plan = false; - $plans = $plans_and_pricing_by_addon_id[ $addon_id ]; - - if ( is_array( $plans ) && count( $plans ) > 0 ) { - foreach ( $plans as $plan ) { - if ( isset( $plan->pricing ) && - is_array( $plan->pricing ) && - count( $plan->pricing ) > 0 - ) { - $has_paid_plan = true; - break; - } - } - } - - $addon_info['has_paid_plan'] = $has_paid_plan; - } - } - - if ( ! is_array( $sites ) || ! isset( $sites[ $slug ] ) ) { - return $addon_info; - } - - $site = $sites[ $slug ]; - - $addon_info['is_connected'] = ( - ( $addon->parent_plugin_id == $this->get_id() ) && - is_object( $site ) && - FS_Site::is_valid_id( $site->id ) && - FS_User::is_valid_id( $site->user_id ) && - FS_Plugin_Plan::is_valid_id( $site->plan_id ) - ); - - if ( $addon_info['is_connected'] && $is_installed ) { - return $addon_info; - } - - $addon_info['site'] = $site; - - $plugins_data = self::maybe_get_entities_account_option( WP_FS__MODULE_TYPE_PLUGIN . 's', array() ); - if ( isset( $plugins_data[ $slug ] ) ) { - $plugin_data = $plugins_data[ $slug ]; - - $addon_info['version'] = $plugin_data->version; - } - - $all_plans = self::maybe_get_entities_account_option( 'plans', array() ); - if ( isset( $all_plans[ $slug ] ) ) { - $plans = $all_plans[ $slug ]; - - foreach ( $plans as $plan ) { - if ( $site->plan_id == Freemius::_decrypt( $plan->id ) ) { - $addon_info['plan_name'] = Freemius::_decrypt( $plan->name ); - $addon_info['plan_title'] = Freemius::_decrypt( $plan->title ); - break; - } - } - } - - $licenses = self::maybe_get_entities_account_option( 'all_licenses', array() ); - if ( is_array( $licenses ) && isset( $licenses[ $addon_id ] ) ) { - foreach ( $licenses[ $addon_id ] as $license ) { - if ( $license->id == $site->license_id ) { - $addon_info['license'] = $license; - break; - } - } - } - - if ( isset( $addon_info['license'] ) ) { - if ( isset( $addon_storage->subscriptions ) && - ! empty( $addon_storage->subscriptions ) - ) { - $addon_subscriptions = fs_get_entities( $addon_storage->subscriptions, FS_Subscription::get_class_name() ); - - foreach ( $addon_subscriptions as $subscription ) { - if ( $subscription->license_id == $site->license_id ) { - $addon_info['subscription'] = $subscription; - break; - } - } - } - } - - return $addon_info; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $user_id - * - * @return FS_User - */ - static function _get_user_by_id( $user_id ) { - self::$_static_logger->entrance( "user_id = {$user_id}" ); - - $users = self::get_all_users(); - - if ( is_array( $users ) ) { - if ( isset( $users[ $user_id ] ) && - $users[ $user_id ] instanceof FS_User && - $user_id == $users[ $user_id ]->id - ) { - return $users[ $user_id ]; - } - - // If user wasn't found by the key, iterate over all the users collection. - foreach ( $users as $user ) { - /** - * @var FS_User $user - */ - if ( $user_id == $user->id ) { - return $user; - } - } - } - - return null; - } - - /** - * Checks if a Freemius user_id is associated with a super-admin. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $user_id - * - * @return bool - */ - private static function is_super_admin( $user_id ) { - $is_super_admin = false; - - $user = self::_get_user_by_id( $user_id ); - - if ( $user instanceof FS_User && ! empty( $user->email ) ) { - self::require_pluggable_essentials(); - - $wp_user = get_user_by( 'email', $user->email ); - - if ( $wp_user instanceof WP_User ) { - $super_admins = get_super_admins(); - $is_super_admin = ( is_array( $super_admins ) && in_array( $wp_user->user_login, $super_admins ) ); - } - } - - return $is_super_admin; - } - - #---------------------------------------------------------------------------------- - #region Plans & Licensing - #---------------------------------------------------------------------------------- - - /** - * Check if running premium plugin code. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @return bool - */ - function is_premium() { - /** - * `$this->_plugin` will be `false` when `is_activation_mode` calls this method directly from the - * `register_constructor_hooks` method. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - return is_object( $this->_plugin ) ? - $this->_plugin->is_premium : - false; - } - - /** - * Get site's plan ID. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @return number - */ - function get_plan_id() { - return $this->_site->plan_id; - } - - /** - * Get site's plan title. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @return string - */ - function get_plan_title() { - $plan = $this->get_plan(); - - return is_object( $plan ) ? $plan->title : 'PLAN_TITLE'; - } - - /** - * Get site's plan name. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return string - */ - function get_plan_name() { - $plan = $this->get_plan(); - - return is_object( $plan ) ? $plan->name : 'PLAN_NAME'; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return FS_Plugin_Plan|false - */ - function get_plan() { - if ( ! is_object( $this->_site ) ) { - return false; - } - - return FS_Plugin_Plan::is_valid_id( $this->_site->plan_id ) ? - $this->_get_plan_by_id( $this->_site->plan_id ) : - false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * - * @return bool - */ - function is_trial() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() || ! is_object( $this->_site ) ) { - return false; - } - - return $this->_site->is_trial(); - } - - /** - * Check if currently in a trial with payment method (credit card or paypal). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - * - * @return bool - */ - function is_paid_trial() { - $this->_logger->entrance(); - - if ( ! $this->is_trial() ) { - return false; - } - - if ( ! $this->has_active_valid_license() ) { - return false; - } - - if ( $this->_site->trial_plan_id != $this->_license->plan_id ) { - return false; - } - - /** - * @var FS_Subscription $subscription - */ - $subscription = $this->_get_subscription( $this->_license->id ); - - return ( is_object( $subscription ) && $subscription->is_active() ); - } - - /** - * Check if trial already utilized. - * - * @since 1.0.9 - * - * @return bool - */ - function is_trial_utilized() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - return false; - } - - return $this->_site->is_trial_utilized(); - } - - /** - * Get trial plan information (if in trial). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool|FS_Plugin_Plan - */ - function get_trial_plan() { - $this->_logger->entrance(); - - if ( ! $this->is_trial() ) { - return false; - } - - // Try to load plan from local cache. - $trial_plan = $this->_get_plan_by_id( $this->_site->trial_plan_id ); - - if ( ! is_object( $trial_plan ) ) { - $trial_plan = $this->_fetch_site_plan( $this->_site->trial_plan_id ); - - /** - * If managed to fetch the plan, add it to the plans collection. - */ - if ( $trial_plan instanceof FS_Plugin_Plan ) { - if ( ! is_array( $this->_plans ) ) { - $this->_plans = array(); - } - - $this->_plans[] = $trial_plan; - $this->_store_plans(); - } - } - - if ( $trial_plan instanceof FS_Plugin_Plan ) { - return $trial_plan; - } - - /** - * If for some reason failed to get the trial plan, fallback to a dummy name and title. - */ - $trial_plan = new FS_Plugin_Plan(); - $trial_plan->id = $this->_site->trial_plan_id; - $trial_plan->name = 'pro'; - $trial_plan->title = 'Pro'; - - return $trial_plan; - } - - /** - * Check if the user has an activate, non-expired license on current plugin's install. - * - * @since 1.0.9 - * - * @return bool - */ - function is_paying() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - return false; - } - - if ( ! $this->has_paid_plan() ) { - return false; - } - - return ( - ! $this->is_trial() && - 'free' !== $this->get_plan_name() && - $this->has_active_valid_license() - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @return bool - */ - function is_free_plan() { - if ( ! $this->is_registered() ) { - return true; - } - - if ( ! $this->has_paid_plan() ) { - return true; - } - - return ( - 'free' === $this->get_plan_name() || - ! $this->has_features_enabled_license() - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @return bool - */ - function _has_premium_license() { - $this->_logger->entrance(); - - $premium_license = $this->_get_available_premium_license(); - - return ( false !== $premium_license ); - } - - /** - * Check if user has any licenses associated with the plugin (including expired or blocking). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.3 - * - * @param bool $including_foreign - * - * @return bool - */ - function has_any_license( $including_foreign = true ) { - if ( ! is_array( $this->_licenses ) || 0 === count( $this->_licenses ) ) { - return false; - } - - if ( $including_foreign ) { - return true; - } - - foreach ( $this->_licenses as $license ) { - if ( $this->_user->id == $license->user_id ) { - return true; - } - } - - return false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param bool|null $is_localhost - * - * @return FS_Plugin_License|false - */ - function _get_available_premium_license( $is_localhost = null ) { - $this->_logger->entrance(); - - $licenses = $this->get_available_premium_licenses( $is_localhost ); - if ( ! empty( $licenses ) ) { - return $licenses[0]; - } - - return false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param bool|null $is_localhost - * - * @return FS_Plugin_License[] - */ - function get_available_premium_licenses( $is_localhost = null ) { - $this->_logger->entrance(); - - $licenses = array(); - if ( ! $this->has_paid_plan() ) { - return $licenses; - } - - if ( is_array( $this->_licenses ) ) { - foreach ( $this->_licenses as $license ) { - if ( ! $license->can_activate( $is_localhost ) ) { - continue; - } - - $licenses[] = $license; - } - } - - return $licenses; - } - - /** - * Sync local plugin plans with remote server. - * - * IMPORTANT: If for some reason a site is associated with deleted plan, we'll preserve the plan's information and append it as the last plan. This means that if plan is deleted, the is_plan() method will ALWAYS return true for any given argument (it becomes the most inclusive plan). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @return FS_Plugin_Plan[]|object - */ - function _sync_plans() { - $plans = $this->_fetch_plugin_plans(); - - if ( $this->is_array_instanceof( $plans, 'FS_Plugin_Plan' ) ) { - $plans_map = array(); - foreach ( $plans as $plan ) { - $plans_map[ $plan->id ] = true; - } - - $plans_ids_to_keep = $this->get_plans_ids_associated_with_installs(); - - foreach ( $plans_ids_to_keep as $plan_id ) { - if ( isset( $plans_map[ $plan_id ] ) ) { - continue; - } - - $missing_plan = self::_get_plan_by_id( $plan_id ); - - if ( is_object( $missing_plan ) ) { - $plans[] = $missing_plan; - } - } - - $this->_plans = $plans; - $this->_store_plans(); - } - - $this->do_action( 'after_plans_sync', $plans ); - - return $this->_plans; - } - - /** - * Check if specified plan exists locally. If not, fetch it and store it. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $plan_id - * - * @return \FS_Plugin_Plan|object The plan entity or the API error object on failure. - */ - private function sync_plan_if_not_exist( $plan_id ) { - $plan = self::_get_plan_by_id( $plan_id ); - - if ( is_object( $plan ) ) { - // Plan already exists. - return $plan; - } - - $plan = $this->fetch_plan_by_id( $plan_id ); - - if ( $plan instanceof FS_Plugin_Plan ) { - $this->_plans[] = $plan; - $this->_store_plans(); - - return $plan; - } - - return $plan; - } - - /** - * Check if specified license exists locally. If not, fetch it and store it. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $license_id - * @param string $license_key - * - * @return \FS_Plugin_Plan|object The plan entity or the API error object on failure. - */ - private function sync_license_if_not_exist( $license_id, $license_key ) { - $license = $this->_get_license_by_id( $license_id ); - - if ( is_object( $license ) ) { - // License already exists. - return $license; - } - - $license = $this->fetch_license_by_key( $license_id, $license_key ); - - if ( $license instanceof FS_Plugin_License ) { - $this->_licenses[] = $license; - - $this->set_license( $license ); - - $this->_store_licenses(); - - return $license; - } - - return $license; - } - - /** - * Get a collection of unique plan IDs that are associated with any installs in the network. - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @return number[] - */ - private function get_plans_ids_associated_with_installs() { - if ( ! is_multisite() ) { - if ( ! is_object( $this->_site ) || - ! FS_Plugin_Plan::is_valid_id( $this->_site->plan_id ) - ) { - return array(); - } - - return array( $this->_site->plan_id ); - } - - $plan_ids = array(); - $sites = self::get_sites(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( ! is_object( $install ) || - ! FS_Plugin_Plan::is_valid_id( $install->plan_id ) - ) { - continue; - } - - $plan_ids[ $install->plan_id ] = true; - } - - return array_keys( $plan_ids ); - } - - /** - * Get a collection of unique license IDs that are associated with any installs in the network. - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @return number[] - */ - private function get_license_ids_associated_with_installs() { - if ( ! $this->_is_network_active ) { - if ( ! is_object( $this->_site ) || - ! FS_Plugin_License::is_valid_id( $this->_site->license_id ) - ) { - return array(); - } - - return array( $this->_site->license_id ); - } - - $license_ids = array(); - $sites = self::get_sites(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( ! is_object( $install ) || - ! FS_Plugin_License::is_valid_id( $install->license_id ) - ) { - continue; - } - - $license_ids[ $install->license_id ] = true; - } - - return array_keys( $license_ids ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param number $id - * - * @return FS_Plugin_Plan|false - */ - function _get_plan_by_id( $id ) { - $this->_logger->entrance(); - - if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) { - $this->_sync_plans(); - } - - foreach ( $this->_plans as $plan ) { - if ( $id == $plan->id ) { - return $plan; - } - } - - return false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.8.1 - * - * @param string $name - * - * @return FS_Plugin_Plan|false - */ - private function get_plan_by_name( $name ) { - $this->_logger->entrance(); - - if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) { - $this->_sync_plans(); - } - - foreach ( $this->_plans as $plan ) { - if ( $name == $plan->name ) { - return $plan; - } - } - - return false; - } - - /** - * Sync local licenses with remote server. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param number|bool $site_license_id - * @param number|null $blog_id - * - * @return FS_Plugin_License[]|object - */ - function _sync_licenses( $site_license_id = false, $blog_id = null ) { - $this->_logger->entrance(); - - $is_network_admin = fs_is_network_admin(); - - if ( $is_network_admin && is_null( $blog_id ) ) { - $all_licenses = self::get_all_licenses( $this->_module_id ); - } else { - $all_licenses = $this->get_user_licenses( $this->_user->id ); - } - - $foreign_licenses = $this->get_foreign_licenses_info( $all_licenses, $site_license_id ); - - $all_licenses_map = array(); - foreach ( $all_licenses as $license ) { - $all_licenses_map[ $license->id ] = true; - } - - $licenses = $this->_fetch_licenses( false, $site_license_id, $foreign_licenses, $blog_id ); - - if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) { - $licenses_map = array(); - foreach ( $licenses as $license ) { - $licenses_map[ $license->id ] = true; - } - -// $license_ids_to_keep = $this->get_license_ids_associated_with_installs(); -// foreach ( $license_ids_to_keep as $license_id ) { -// if ( isset( $licenses_map[ $license_id ] ) ) { -// continue; -// } -// -// $missing_license = self::_get_license_by_id( $license_id, false ); -// if ( is_object( $missing_license ) ) { -// $licenses[] = $missing_license; -// $licenses_map[ $missing_license->id ] = true; -// } -// } - - $user_license_ids = $this->get_user_linked_license_ids( $this->_user->id ); - - foreach ( $user_license_ids as $key => $license_id ) { - if ( ! isset( $licenses_map[ $license_id ] ) ) { - // Remove access to licenses that no longer exist. - unset( $user_license_ids[ $key ] ); - } - } - - if ( ! empty( $user_license_ids ) ) { - foreach ( $licenses_map as $license_id => $value ) { - if ( ! isset( $all_licenses_map[ $license_id ] ) ) { - // Associate new licenses with the user who triggered the license syncing. - $user_license_ids[] = $license_id; - } - } - - $user_license_ids = array_unique( $user_license_ids ); - } else { - $user_license_ids = array_keys( $licenses_map ); - } - - if ( ! $is_network_admin || ! is_null( $blog_id ) ) { - $user_licenses = array(); - foreach ( $licenses as $license ) { - if ( ! in_array( $license->id, $user_license_ids ) ) { - continue; - } - - $user_licenses[] = $license; - } - - $this->_licenses = $user_licenses; - } else { - $this->_licenses = $licenses; - } - - $this->set_user_linked_license_ids( $this->_user->id, $user_license_ids ); - - $this->_store_licenses( true, $this->_module_id, $licenses ); - } - - // Update current license. - if ( is_object( $this->_license ) ) { - $license = $this->_get_license_by_id( $this->_license->id ); - - if ( is_object( $license ) ) { - /** - * `$license` can be `false` in case a user change action has just been completed and this method - * has synced the `$this->_licenses` collection for the new user. In this case, the - * `$this->_licenses` collection may have only the newly activated license that is associated with - * the new user. `set_license` will eventually be called in the same request by the logic that - * follows outside this method which will detect that the install's license has been updated, and - * then `_update_site_license` will be called which in turn will call `set_license`. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - */ - $this->set_license( $license ); - } - } - - return $this->_licenses; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param number $id - * @param bool $sync_licenses - * - * @return FS_Plugin_License|false - */ - function _get_license_by_id( $id, $sync_licenses = true ) { - $this->_logger->entrance(); - - if ( ! FS_Plugin_License::is_valid_id( $id ) ) { - return false; - } - - /** - * When running from the network level admin and opted-in from the network, - * check if the license exists in the network user licenses collection. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - if ( fs_is_network_admin() && - $this->is_network_registered() && - ( ! is_object( $this->_user ) || $this->_storage->network_user_id != $this->_user->id ) - ) { - $licenses = $this->get_user_licenses( $this->_storage->network_user_id ); - - foreach ( $licenses as $license ) { - if ( $id == $license->id ) { - return $license; - } - } - } - - if ( ! $this->has_any_license() && $sync_licenses ) { - $this->_sync_licenses( $id ); - } - - if ( is_array( $this->_licenses ) ) { - foreach ( $this->_licenses as $license ) { - if ( $id == $license->id ) { - return $license; - } - } - } - - return false; - } - - /** - * Get license by ID. Unlike _get_license_by_id(), this method only checks the local storage and return any license, whether it's associated with the current context user/install or not. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $id - * - * @return FS_Plugin_License - */ - private function get_license_by_id( $id ) { - $licenses = self::get_all_licenses( $this->_module_id ); - - if ( is_array( $licenses ) && ! empty( $licenses ) ) { - foreach ( $licenses as $license ) { - if ( $id == $license->id ) { - return $license; - } - } - } - - return null; - } - - /** - * Synchronize the site's context license by fetching the license form the API and updating the local data with it. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return \FS_Plugin_License|mixed - */ - private function sync_site_license() { - $api = $this->get_api_user_scope(); - - $result = $api->get( "/licenses/{$this->_license->id}.json?license_key=" . urlencode( $this->_license->secret_key ), true ); - - if ( ! $this->is_api_result_entity( $result ) ) { - return $result; - } - - $license = $this->_update_site_license( new FS_Plugin_License( $result ) ); - $this->_store_licenses(); - - return $license; - } - - /** - * Get all user's available licenses for the current module. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $user_id - * - * @return FS_Plugin_License[] - */ - private function get_user_licenses( $user_id ) { - $all_licenses = self::get_all_licenses( $this->_module_id ); - if ( empty( $all_licenses ) ) { - return array(); - } - - $user_license_ids = $this->get_user_linked_license_ids( $user_id ); - if ( empty( $user_license_ids ) ) { - return array(); - } - - $licenses = array(); - foreach ( $all_licenses as $license ) { - if ( in_array( $license->id, $user_license_ids ) ) { - $licenses[] = $license; - } - } - - return $licenses; - } - - /** - * Checks if the context license is network activated except on the given blog ID. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $except_blog_id - * - * @return bool - */ - private function is_license_network_active( $except_blog_id = 0 ) { - $this->_logger->entrance(); - - if ( ! is_object( $this->_license ) ) { - return false; - } - - $sites = self::get_sites(); - - if ( $this->_license->total_activations() < ( count( $sites ) - 1 ) ) { - // There are more sites than the number of activations, so license cannot be network activated. - return false; - } - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - if ( $except_blog_id == $blog_id ) { - // Skip excluded blog. - continue; - } - - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( is_object( $install ) && $install->license_id != $this->_license->id ) { - return false; - } - } - - return true; - } - - /** - * Checks if license can be activated on all the network sites (opted-in or skipped) that are not yet associated with a license. If possible, try to make the activation, if not return false. - * - * Notice: On success, this method will also update the license activations counters (without updating the license in the storage). - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_User $user - * @param \FS_Plugin_License $license - * - * @return bool - */ - private function try_activate_license_on_network( FS_User $user, FS_Plugin_License $license ) { - $this->_logger->entrance(); - - $result = $this->can_activate_license_on_network( $license ); - - if ( false === $result ) { - return false; - } - - $installs_without_license = $result['installs']; - if ( ! empty( $installs_without_license ) ) { - $this->activate_license_on_many_installs( $user, $license->secret_key, $installs_without_license ); - } - - $disconnected_site_ids = $result['sites']; - if ( ! empty( $disconnected_site_ids ) ) { - $this->activate_license_on_many_sites( $user, $license->secret_key, $disconnected_site_ids ); - } - - $this->link_license_2_user( $license->id, $user->id ); - - // Sync license after activations. - $license->activated += $result['production_count']; - $license->activated_local += $result['localhost_count']; - -// $this->_store_licenses() - - return true; - } - - /** - * Checks if the given license can be activated on the whole network. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_Plugin_License $license - * - * @return false|array { - * @type array[int]FS_Site $installs Blog ID to install map. - * @type int[] $sites Non-connected blog IDs. - * @type int $production_count Production sites count. - * @type int $localhost_count Production sites count. - * } - */ - private function can_activate_license_on_network( FS_Plugin_License $license ) { - $sites = self::get_sites(); - - $production_count = 0; - $localhost_count = 0; - - $installs_without_license = array(); - $disconnected_site_ids = array(); - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( is_object( $install ) ) { - if ( FS_Plugin_License::is_valid_id( $install->license_id ) ) { - // License already activated on the install. - continue; - } - - $url = $install->url; - - $installs_without_license[ $blog_id ] = $install; - } else { - $url = is_object( $site ) ? - $site->siteurl : - get_site_url( $blog_id ); - - $disconnected_site_ids[] = $blog_id; - } - - if ( FS_Site::is_localhost_by_address( $url ) ) { - $localhost_count ++; - } else { - $production_count ++; - } - } - - if ( ! $license->can_activate_bulk( $production_count, $localhost_count ) ) { - return false; - } - - return array( - 'installs' => $installs_without_license, - 'sites' => $disconnected_site_ids, - 'production_count' => $production_count, - 'localhost_count' => $localhost_count, - ); - } - - /** - * Activate a given license on a collection of installs. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_User $user - * @param string $license_key - * @param array $blog_2_install_map { - * @key int Blog ID. - * @value FS_Site Blog's associated install. - * } - * - * @return mixed|true - */ - private function activate_license_on_many_installs( - FS_User $user, - $license_key, - array $blog_2_install_map - ) { - $params = array( - array( 'license_key' => $this->apply_filters( 'license_key', $license_key ) ) - ); - - $install_2_blog_map = array(); - foreach ( $blog_2_install_map as $blog_id => $install ) { - $params[] = array( 'id' => $install->id ); - - $install_2_blog_map[ $install->id ] = $blog_id; - } - - $result = $this->get_api_user_scope_by_user( $user )->call( - "plugins/{$this->_plugin->id}/installs.json", - 'PUT', - $params - ); - - if ( ! $this->is_api_result_object( $result, 'installs' ) ) { - return $result; - } - - foreach ( $result->installs as $r_install ) { - $install = new FS_Site( $r_install ); - $install->is_disconnected = false; - - // Update install. - $this->_store_site( - true, - $install_2_blog_map[ $r_install->id ], - $install - ); - } - - return true; - } - - /** - * Activate a given license on a collection of blogs/sites that are not yet opted-in. - * - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @param \FS_User $user - * @param string $license_key - * - * @return true|mixed True if successful, otherwise, the API result. - */ - private function activate_license_on_site( FS_User $user, $license_key ) { - return $this->activate_license_on_many_sites( $user, $license_key ); - } - - /** - * Activate a given license on a collection of blogs/sites that are not yet opted-in. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_User $user - * @param string $license_key - * @param int[] $site_ids - * - * @return true|mixed True if successful, otherwise, the API result. - */ - private function activate_license_on_many_sites( - FS_User $user, - $license_key, - array $site_ids = array() - ) { - $sites = array(); - foreach ( $site_ids as $site_id ) { - $sites[] = $this->get_site_info( array( 'blog_id' => $site_id ) ); - } - - // Install the plugin. - $result = $this->create_installs_with_user( - $user, - $license_key, - false, - $sites, - false, - true - ); - - if ( ! $this->is_api_result_entity( $result ) && - ! $this->is_api_result_object( $result, 'installs' ) - ) { - return $result; - } - - $installs = array(); - - if ( $this->is_api_result_entity( $result ) ) { - $install = new FS_Site( $result ); - - $this->_user = $user; - - $this->_store_site( true, null, $install ); - - $this->_site = $install; - - $this->reset_anonymous_mode(); - } else { - foreach ( $result->installs as $install ) { - $installs[] = new FS_Site( $install ); - } - - // Map site addresses to their blog IDs. - $address_to_blog_map = $this->get_address_to_blog_map(); - - $first_blog_id = null; - - foreach ( $installs as $install ) { - $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); - $blog_id = $address_to_blog_map[ $address ]; - - $this->_store_site( true, $blog_id, $install ); - - $this->reset_anonymous_mode( $blog_id ); - - if ( is_null( $first_blog_id ) ) { - $first_blog_id = $blog_id; - } - } - - if ( ! FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ) { - $this->_storage->network_install_blog_id = $first_blog_id; - } - } - - return true; - } - - /** - * Sync site's license with user licenses. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param FS_Plugin_License|null $new_license - * - * @return FS_Plugin_License|null - */ - function _update_site_license( $new_license ) { - $this->_logger->entrance(); - - /** - * In case this call will be removed in the future, the `_sync_licenses()` method needs to be updated - * accordingly so that it will also handle the case when an ownership change is done via license - * activation. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - */ - $this->set_license( $new_license ); - - if ( ! is_object( $new_license ) ) { - $this->_site->license_id = null; - $this->_sync_site_subscription( null ); - - return $this->_license; - } - - $this->_site->license_id = $this->_license->id; - - if ( ! is_array( $this->_licenses ) ) { - $this->_licenses = array(); - } - - $is_license_found = false; - for ( $i = 0, $len = count( $this->_licenses ); $i < $len; $i ++ ) { - if ( $new_license->id == $this->_licenses[ $i ]->id ) { - $this->_licenses[ $i ] = $new_license; - - $is_license_found = true; - break; - } - } - - // If new license just append. - if ( ! $is_license_found ) { - $this->_licenses[] = $new_license; - } - - $this->_sync_site_subscription( $new_license ); - - return $this->_license; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @param \FS_Plugin_License $license - */ - private function set_license( FS_Plugin_License $license = null ) { - $this->_license = $license; - - $this->maybe_update_whitelabel_flag( $license ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @param FS_Plugin_License $license - */ - private function maybe_update_whitelabel_flag( $license ) { - $is_whitelabeled = isset( $this->_storage->is_whitelabeled ) ? - $this->_storage->is_whitelabeled : - false; - - if ( is_object( $license ) ) { - $license_user = self::_get_user_by_id( $license->user_id ); - - if ( ! is_object( $license_user ) ) { - // If foreign license, do not update the `is_whitelabeled` flag. - return; - } - - if ( $this->is_addon() ) { - /** - * Store the last license data to the parent's storage since it's needed only when showing the - * "Start Debug" dialog which is triggered from the "Account" page. This way, there's no need to - * iterate over the add-ons just to get the last license data. - */ - $this->get_parent_instance()->store_last_activated_license_data( $license, $license_user ); - } else { - $this->store_last_activated_license_data( $license ); - } - - if ( $license->is_whitelabeled ) { - // Activated a developer license, data should be hidden. - $is_whitelabeled = true; - } else if ( $this->is_registered() && $this->_user->id == $license->user_id ) { - // The account owner activated a regular license key, no need to hide the data. - $is_whitelabeled = false; - } - } - - $this->_storage->is_whitelabeled = $is_whitelabeled; - - // Reset the whitelabeled status after update. - $this->is_whitelabeled = null; - if ( $this->is_addon() ) { - $parent_fs = $this->get_parent_instance(); - - if ( is_object( $parent_fs ) ) { - $parent_fs->is_whitelabeled = null; - } - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @param FS_Plugin_License $license - * @param FS_User $license_user - */ - private function store_last_activated_license_data( FS_Plugin_License $license, $license_user = null ) { - if ( ! is_object( $license_user ) ) { - $this->_storage->last_license_key = md5( $license->secret_key ); - $this->_storage->last_license_user_id = null; - } else { - $this->_storage->last_license_user_key = md5( $license_user->secret_key ); - $this->_storage->last_license_user_id = $license_user->id; - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @param bool $ignore_data_debug_mode - * - * @return bool - */ - function is_whitelabeled_by_flag( $ignore_data_debug_mode = false ) { - if ( true !== $this->_storage->is_whitelabeled ) { - return false; - } else if ( $ignore_data_debug_mode ) { - return true; - } - - $fs = $this->is_addon() ? - $this->get_parent_instance() : - $this; - - return ! $fs->is_data_debug_mode(); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @return number - */ - function get_last_license_user_id() { - return ( FS_User::is_valid_id( $this->_storage->last_license_user_id ) ) ? - $this->_storage->last_license_user_id : - null; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @param int $blog_id - * @param bool $ignore_data_debug_mode - * - * @return bool - */ - function is_whitelabeled( $ignore_data_debug_mode = false, $blog_id = null ) { - if ( ! is_null( $blog_id ) ) { - $this->switch_to_blog( $blog_id ); - } - - if ( ! is_null( $this->is_whitelabeled ) ) { - $is_whitelabeled = $this->is_whitelabeled; - } else { - $is_whitelabeled = false; - - $is_whitelabeled_flag = $this->is_whitelabeled_by_flag( true ); - - if ( ! $this->has_addons() ) { - $is_whitelabeled = $is_whitelabeled_flag; - } else if ( $is_whitelabeled_flag ) { - $is_whitelabeled = true; - } else { - $addon_ids = $this->get_updated_account_addons(); - $installed_addons = $this->get_installed_addons(); - foreach ( $installed_addons as $fs_addon ) { - $addon_ids[] = $fs_addon->get_id(); - } - - if ( ! empty( $addon_ids ) ) { - $addon_ids = array_unique( $addon_ids ); - - $is_network_level = ( - fs_is_network_admin() && - $this->is_network_active() - ); - - foreach ( $addon_ids as $addon_id ) { - $addon = $this->get_addon( $addon_id ); - - if ( ! is_object( $addon ) ) { - continue; - } - - $addon_storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $addon->slug ); - $fs_addon = $this->is_addon_activated( $addon_id ) ? - self::get_addon_instance( $addon_id ) : - null; - - $was_addon_network_activated = false; - - if ( is_object( $fs_addon ) ) { - $was_addon_network_activated = $fs_addon->is_network_active(); - } else if ( $is_network_level ) { - $was_addon_network_activated = $addon_storage->get( 'was_plugin_loaded', false, true ); - } - - $network_delegated_connection = ( - $was_addon_network_activated && - $addon_storage->get( 'is_delegated_connection', false, true ) - ); - - if ( - $is_network_level && - ( ! $was_addon_network_activated || $network_delegated_connection ) - ) { - $sites = self::get_sites(); - - /** - * If in network admin area and the add-on was not network-activated or network-activated - * and network-delegated, find any add-on whose is_whitelabeled flag is true. - */ - foreach ( $sites as $site ) { - $site_info = $this->get_site_info( $site ); - - if ( $addon_storage->get( 'is_whitelabeled', false, $site_info['blog_id'] ) ) { - $is_whitelabeled = true; - break; - } - } - - if ( $is_whitelabeled ) { - break; - } - } else { - /** - * This will be executed when any of the following is met: - * 1. Add-on was network-activated, not network-delegated, and in network admin area. - * 2. Add-on was network-activated, network-delegated, and in site admin area. - * 3. Add-on was not network-activated and in site admin area. - */ - if ( true === $addon_storage->is_whitelabeled ) { - $is_whitelabeled = true; - break; - } - } - } - } - } - - $this->is_whitelabeled = $is_whitelabeled; - - if ( ! $is_whitelabeled || ! $this->is_data_debug_mode() ) { - $this->_admin_notices->remove_sticky( 'data_debug_mode_enabled' ); - } - - if ( ! is_null( $blog_id ) ) { - $this->restore_current_blog(); - } - } - - return ( - $is_whitelabeled && - ( $ignore_data_debug_mode || ! $this->is_data_debug_mode() ) - ); - } - - /** - * Sync site's subscription. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param FS_Plugin_License|null $license - * - * @return bool|\FS_Subscription - */ - private function _sync_site_subscription( $license ) { - if ( ! is_object( $license ) ) { - $this->delete_unused_subscriptions(); - - return false; - } - - // Load subscription details if not lifetime. - $subscription = $license->is_lifetime() ? - false : - $this->_fetch_site_license_subscription(); - - if ( is_object( $subscription ) && ! isset( $subscription->error ) ) { - $this->store_subscription( $subscription ); - } else { - $this->delete_unused_subscriptions(); - } - - return $subscription; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return bool|\FS_Plugin_License - */ - function _get_license() { - if ( ! fs_is_network_admin() || is_object( $this->_license ) ) { - return $this->_license; - } - - return $this->_get_available_premium_license(); - } - - /** - * @param number $license_id - * - * @return null|\FS_Subscription - */ - function _get_subscription( $license_id ) { - if ( ! isset( $this->_storage->subscriptions ) || - empty( $this->_storage->subscriptions ) - ) { - return null; - } - - foreach ( fs_get_entities( $this->_storage->subscriptions, FS_Subscription::get_class_name() ) as $subscription ) { - if ( $subscription->license_id == $license_id ) { - return $subscription; - } - } - - return null; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param FS_Subscription $subscription - */ - function store_subscription( FS_Subscription $subscription ) { - if ( ! isset( $this->_storage->subscriptions ) ) { - $this->_storage->subscriptions = array(); - } - - if ( empty( $this->_storage->subscriptions ) || ! is_multisite() ) { - $this->_storage->subscriptions = array( $subscription ); - - return; - } - - $subscriptions = fs_get_entities( $this->_storage->subscriptions, FS_Subscription::get_class_name() ); - - $updated_subscription = false; - foreach ( $subscriptions as $key => $existing_subscription ) { - if ( $existing_subscription->id == $subscription->id ) { - $subscriptions[ $key ] = $subscription; - $updated_subscription = true; - break; - } - } - - if ( ! $updated_subscription ) { - $subscriptions[] = $subscription; - } - - $this->_storage->subscriptions = $subscriptions; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - */ - function delete_unused_subscriptions() { - if ( ! isset( $this->_storage->subscriptions ) || - empty( $this->_storage->subscriptions ) || - // Clean up only if there are already at least 3 subscriptions. - ( count( $this->_storage->subscriptions ) < 3 ) - ) { - return; - } - - if ( ! is_multisite() ) { - // If not multisite, there should only be 1 subscription, so just clear the array. - $this->_storage->subscriptions = array(); - - return; - } - - $subscriptions_to_keep_by_license_id_map = array(); - $sites = self::get_sites(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( ! is_object( $install ) || - ! FS_Plugin_License::is_valid_id( $install->license_id ) - ) { - continue; - } - - $subscriptions_to_keep_by_license_id_map[ $install->license_id ] = true; - } - - if ( empty( $subscriptions_to_keep_by_license_id_map ) ) { - $this->_storage->subscriptions = array(); - - return; - } - - foreach ( $this->_storage->subscriptions as $key => $subscription ) { - if ( ! isset( $subscriptions_to_keep_by_license_id_map[ $subscription->license_id ] ) ) { - unset( $this->_storage->subscriptions[ $key ] ); - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @param string $plan Plan name - * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans. - * - * @return bool - */ - function is_plan( $plan, $exact = false ) { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - return false; - } - - $plan = strtolower( $plan ); - - $current_plan_name = $this->get_plan_name(); - - if ( $current_plan_name === $plan ) { - // Exact plan. - return true; - } else if ( $exact ) { - // Required exact, but plans are different. - return false; - } - - $current_plan_order = - 1; - $required_plan_order = PHP_INT_MAX; - for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { - if ( $plan === $this->_plans[ $i ]->name ) { - $required_plan_order = $i; - } else if ( $current_plan_name === $this->_plans[ $i ]->name ) { - $current_plan_order = $i; - } - } - - return ( $current_plan_order > $required_plan_order ); - } - - /** - * Check if module has only one plan. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @param bool $double_check In some cases developers prefer to release their paid offering as premium-only, even though there is a free version. For those cases, looking at the 'is_premium_only' value isn't enough because the result will return false even when the product has only signle paid plan. - * - * @return bool - */ - function is_single_plan( $double_check = false ) { - $this->_logger->entrance(); - - if ( ! $this->is_registered() || - ! is_array( $this->_plans ) || - 0 === count( $this->_plans ) - ) { - return true; - } - - $has_free_plan = $this->has_free_plan(); - - if ( ! $has_free_plan && $double_check ) { - foreach ( $this->_plans as $plan ) { - if ( $plan->is_free() ) { - $has_free_plan = true; - break; - } - } - } - - return ( 1 === ( count( $this->_plans ) - ( $has_free_plan ? 1 : 0 ) ) ); - } - - /** - * Check if plan based on trial. If not in trial mode, should return false. - * - * @since 1.0.9 - * - * @param string $plan Plan name - * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans. - * - * @return bool - */ - function is_trial_plan( $plan, $exact = false ) { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - return false; - } - - if ( ! $this->is_trial() ) { - return false; - } - - $trial_plan = $this->get_trial_plan(); - - if ( $trial_plan->name === $plan ) { - // Exact plan. - return true; - } else if ( $exact ) { - // Required exact, but plans are different. - return false; - } - - $current_plan_order = - 1; - $required_plan_order = - 1; - for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { - if ( $plan === $this->_plans[ $i ]->name ) { - $required_plan_order = $i; - } else if ( $trial_plan->name === $this->_plans[ $i ]->name ) { - $current_plan_order = $i; - } - } - - return ( $current_plan_order > $required_plan_order ); - } - - /** - * Check if plugin has any paid plans. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return bool - */ - function has_paid_plan() { - return $this->_has_paid_plans || - FS_Plan_Manager::instance()->has_paid_plan( $this->_plans ); - } - - /** - * Check if plugin has any plan with a trail. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function has_trial_plan() { - /** - * @author Vova Feldman(@svovaf) - * @since 1.2.1.5 - * - * Allow setting a trial from the SDK without calling the API. - * But, if the user did opt-in, continue using the real data from the API. - */ - if ( $this->_trial_days >= 0 ) { - return true; - } - - return $this->_storage->get( 'has_trial_plan', false ); - } - - /** - * Check if plugin has any free plan, or is it premium only. - * - * Note: If no plans configured, assume plugin is free. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return bool - */ - function has_free_plan() { - return ! $this->is_only_premium(); - } - - /** - * Displays a license activation dialog box when the user clicks on the "Activate License" - * or "Change License" link on the plugins - * page. - * - * @author Leo Fajardo (@leorw) - * @since 1.1.9 - */ - function _add_license_activation_dialog_box() { - $vars = array( - 'id' => $this->_module_id, - ); - - fs_require_template( 'forms/license-activation.php', $vars ); - fs_require_template( 'forms/resend-key.php', $vars ); - } - - /** - * Returns a collection of IDs of installs that are associated with the context product and its add-ons, and activated with foreign licenses. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - * - * @return number[] - */ - function get_installs_ids_with_foreign_licenses() { - $installs = array(); - - if ( - is_object( $this->_license ) && - $this->_site->user_id != $this->_license->user_id - ) { - $installs[] = $this->_site->id; - } - - /** - * Also try to get foreign licenses for the context product's add-ons. - */ - $installs_by_slug_map = $this->get_parent_and_addons_installs_info(); - - foreach ( $installs_by_slug_map as $slug => $install_info ) { - if ( $slug == $this->get_slug() ) { - continue; - } - - $install = $install_info['install']; - $license = $install_info['license']; - - if ( - is_object( $license ) && - $install->user_id != $license->user_id - ) { - $installs[] = $install->id; - } - } - - return $installs; - } - - /** - * Displays the "Change User" dialog box when the user clicks on the "Change User" button on the "Account" page. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - * - * @param number[] $install_ids - */ - function _add_user_change_dialog_box( $install_ids ) { - $vars = array( - 'id' => $this->_module_id, - 'license_owners' => $this->fetch_installs_licenses_owners_data( $install_ids ) - ); - - fs_require_template( 'forms/user-change.php', $vars ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - */ - function _add_data_debug_mode_dialog_box() { - $vars = array( - 'id' => $this->_module_id, - ); - - fs_require_template( 'forms/data-debug-mode.php', $vars ); - } - - /** - * Displays a subscription cancellation dialog box when the user clicks on the "Deactivate License" - * link on the "Account" page or deactivates a plugin and there's an active subscription that is - * either associated with a non-lifetime single-site license or non-lifetime multisite license that - * is only activated on a single production site. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - * - * @param bool $is_license_deactivation - * - * @return array - */ - function _get_subscription_cancellation_dialog_box_template_params( $is_license_deactivation = false ) { - if ( fs_is_network_admin() ) { - // Subscription cancellation dialog box is currently not supported for multisite networks. - return array(); - } - - if ( $this->is_whitelabeled() ) { - return array(); - } - - $license = $this->_get_license(); - - /** - * If the installation is associated with a non-lifetime license, which is either a single-site or only activated on a single production site (or zero), and connected to an active subscription, suggest the customer to cancel the subscription upon deactivation. - * - * @author Leo Fajardo (@leorw) (Comment added by Vova Feldman @svovaf) - * @since 2.2.1 - */ - if ( ! is_object( $license ) || - $license->is_lifetime() || - ( ! $license->is_single_site() && $license->activated > 1 ) - ) { - return array(); - } - - /** - * @var FS_Subscription $subscription - */ - $subscription = $this->_get_subscription( $license->id ); - if ( ! is_object( $subscription ) || ! $subscription->is_active() ) { - return array(); - } - - return array( - 'id' => $this->_module_id, - 'license' => $license, - 'has_trial' => $this->is_paid_trial(), - 'is_license_deactivation' => $is_license_deactivation, - ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.2 - */ - function _add_premium_version_upgrade_selection_dialog_box() { - $modules_update = get_site_transient( $this->is_theme() ? 'update_themes' : 'update_plugins' ); - if ( ! isset( $modules_update->response[ $this->_plugin_basename ] ) ) { - return; - } - - $vars = array( - 'id' => $this->_module_id, - 'new_version' => is_object( $modules_update->response[ $this->_plugin_basename ] ) ? - $modules_update->response[ $this->_plugin_basename ]->new_version : - $modules_update->response[ $this->_plugin_basename ]['new_version'] - ); - - fs_require_template( 'forms/premium-versions-upgrade-metadata.php', $vars ); - fs_require_once_template( 'forms/premium-versions-upgrade-handler.php', $vars ); - } - - /** - * Displays the opt-out dialog box when the user clicks on the "Opt Out" link on the "Plugins" - * page. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - */ - function _add_optout_dialog() { - if ( $this->is_theme() ) { - $vars = null; - fs_require_once_template( '/js/jquery.content-change.php', $vars ); - } - - $vars = array( 'id' => $this->_module_id ); - fs_require_template( 'forms/optout.php', $vars ); - } - - /** - * Prepare page to include all required UI and logic for the license activation dialog. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.0 - */ - function _add_license_activation() { - if ( $this->is_migration() ) { - return; - } - - if ( ! $this->is_user_admin() ) { - // Only admins can activate a license. - return; - } - - if ( ! $this->has_paid_plan() ) { - // Module doesn't have any paid plans. - return; - } - - if ( - $this->has_premium_version() && - ! $this->is_premium() && - /** - * Also handle the case when an upgrade was made using the free version. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - */ - ! is_object( $this->_get_license() ) - ) { - // Only add license activation logic to the premium version, or in case of a serviceware plugin, also in the free version. - return; - } - - // Add license activation link and AJAX request handler. - if ( self::is_plugins_page() ) { - $is_network_admin = fs_is_network_admin(); - - if ( - ( $is_network_admin && $this->is_network_active() && ! $this->is_network_delegated_connection() ) || - ( ! $is_network_admin && ( ! $this->is_network_active() || $this->is_delegated_connection() ) ) - ) { - /** - * @since 1.2.0 Add license action link only on plugins page. - */ - $this->_add_license_action_link(); - } - } - - // Add license activation AJAX callback. - $this->add_ajax_action( 'activate_license', array( &$this, '_activate_license_ajax_action' ) ); - - // Add resend license AJAX callback. - $this->add_ajax_action( 'resend_license_key', array( &$this, '_resend_license_key_ajax_action' ) ); - } - - /** - * Prepares page to include all required UI and logic for the "Change User" dialog. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - */ - function _add_user_change_option() { - if ( ! $this->should_handle_user_change() ) { - return; - } - - $installs_ids_with_foreign_licenses = $this->get_installs_ids_with_foreign_licenses(); - - if ( empty( $installs_ids_with_foreign_licenses ) ) { - // Handle user change only when the parent product or one of its add-ons is activated with a foreign license. - return; - } - - // Add user change AJAX handler. - $this->add_ajax_action( 'change_user', array( &$this, '_user_change_ajax_action' ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - */ - function should_handle_user_change() { - if ( ! $this->is_user_admin() ) { - // Only admins can change user. - return false; - } - - if ( $this->is_addon() ) { - return false; - } - - if ( ! $this->is_registered() ) { - return false; - } - - if ( - $this->is_network_active() && - ( fs_is_network_admin() || ! $this->is_site_delegated_connection() ) - ) { - // Handle only on site-level "Account" section for now. - return false; - } - - return true; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.2 - */ - function _add_premium_version_upgrade_selection() { - if ( ! $this->is_user_admin() ) { - return; - } - - if ( ! $this->is_premium() || $this->has_any_active_valid_license() ) { - // This is relevant only to the free versions and premium versions without an active license. - return; - } - - if ( self::is_updates_page() || ( $this->is_plugin() && self::is_plugins_page() ) ) { - $this->_add_premium_version_upgrade_selection_action(); - } - } - - /** - * @author Edgar Melkonyan - * @since 2.4.1 - * - * @throws Freemius_Exception - */ - function _toggle_whitelabel_mode_ajax_handler() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'toggle_whitelabel_mode' ); - - if ( ! $this->is_user_admin() ) { - // Only for admins. - self::shoot_ajax_failure(); - } - - $license = $this->get_api_user_scope()->call( - "/licenses/{$this->_site->license_id}.json", - 'put', - array( 'is_whitelabeled' => ! $this->_license->is_whitelabeled ) - ); - - if ( ! $this->is_api_result_entity( $license ) ) { - self::shoot_ajax_failure( - FS_Api::is_api_error_object( $license ) ? - $license->error->message : - fs_text_inline( "An unknown error has occurred while trying to toggle the license's white-label mode.", 'unknown-error-occurred', $this->get_slug() ) - ); - } - - $this->_license->is_whitelabeled = $license->is_whitelabeled; - $this->_store_licenses(); - - $this->_sync_license(); - - if ( ! $license->is_whitelabeled ) { - $this->_admin_notices->remove_sticky( 'license_whitelabeled' ); - } else { - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( - 'Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s.', - 'license_whitelabeled' - ), - "{$this->get_plugin_title()}", - sprintf( '%s', $this->get_text_inline( 'User Dashboard', 'user-dashboard' ) ), - sprintf( '%s', $this->get_text_inline( 'revert it now', 'revert-it-now' ) ) - ), - 'license_whitelabeled' - ); - } - - self::shoot_ajax_response( array( 'success' => true ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - function _add_beta_mode_update_handler() { - if ( ! $this->is_user_admin() ) { - return; - } - - if ( ! $this->is_premium() ) { - return; - } - - $this->add_ajax_action( 'set_beta_mode', array( &$this, '_set_beta_mode_ajax_handler' ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - function _set_beta_mode_ajax_handler() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'set_beta_mode' ); - - if ( ! $this->is_user_admin() ) { - // Only for admins. - self::shoot_ajax_failure(); - } - - $is_beta = trim( fs_request_get( 'is_beta', '', 'post' ) ); - - if ( empty( $is_beta ) || ! in_array( $is_beta, array( 'true', 'false' ) ) ) { - self::shoot_ajax_failure(); - } - - $user = $this->get_api_user_scope()->call( - '', - 'put', - array( - 'plugin_id' => $this->get_id(), - 'is_beta' => ( 'true' == $is_beta ), - 'fields' => 'is_beta' - ) - ); - - if ( ! $this->is_api_result_entity( $user ) ) { - self::shoot_ajax_failure( - FS_Api::is_api_error_object( $user ) ? - $user->error->message : - fs_text_inline( "An unknown error has occurred while trying to set the user's beta mode.", 'unknown-error-occurred', $this->get_slug() ) - ); - } - - $this->_user->is_beta = $user->is_beta; - $this->_store_user(); - - self::shoot_ajax_response( array( 'success' => true ) ); - } - - /** - * License activation WP AJAX handler. - * - * @author Leo Fajardo (@leorw) - * @since 1.1.9 - * - * @uses Freemius::activate_license() - */ - function _activate_license_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'activate_license' ); - - $license_key = trim( fs_request_get( 'license_key' ) ); - - if ( empty( $license_key ) ) { - exit; - } - - $sites = fs_is_network_admin() ? - fs_request_get( 'sites', array(), 'post' ) : - array(); - - $result = $this->activate_license( - $license_key, - $sites, - fs_request_get_bool( 'is_marketing_allowed', null ), - fs_request_get( 'blog_id', null ), - fs_request_get( 'module_id', null, 'post' ), - fs_request_get( 'user_id', null ), - fs_request_get_bool( 'is_extensions_tracking_allowed', true ) - ); - - if ( - $result['success'] && - $this->is_bundle_license_auto_activation_enabled() - ) { - $license = new FS_Plugin_License(); - $license->secret_key = $license_key; - - $this->maybe_activate_bundle_license( $license, $sites ); - } - - echo json_encode( $result ); - - exit; - } - - /** - * User change WP AJAX handler. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - */ - function _user_change_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'change_user' ); - - $new_email_address = trim( fs_request_get( 'email_address', '' ) ); - $new_user_id = fs_request_get( 'user_id' ); - - if ( empty( $new_email_address ) && ! FS_User::is_valid_id( $new_user_id ) ) { - self::shoot_ajax_failure( fs_text_inline( 'Invalid new user ID or email address.', 'invalid-new-user-id-or-email', $this->get_slug() ) ); - } - - $params = array(); - - if ( ! empty( $new_email_address ) ) { - $params['user_email'] = $new_email_address; - } else { - $params['user_id'] = $new_user_id; - } - - $installs_info_by_slug_map = $this->get_parent_and_addons_installs_info(); - $install_ids = array(); - - foreach ( $installs_info_by_slug_map as $slug => $install_info ) { - $install_ids[ $slug ] = $install_info['install']->id; - } - - $params['install_ids'] = implode( ',', array_values( $install_ids ) ); - - $install = $this->get_api_site_scope()->call( $this->add_show_pending( '/' ), 'put', $params ); - - if ( FS_Api::is_api_error( $install ) ) { - $error = ''; - - if ( is_object( $install ) ) { - switch ( $install->error->code ) { - case 'user_exist': - $error = ( - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...' . - $this->get_text_inline( 'Sorry, we could not complete the email update. Another user with the same email is already registered.', 'user-exist-message' ) . ' ' . - sprintf( $this->get_text_inline( 'If you would like to give up the ownership of the %s\'s account to %s click the Change Ownership button.', 'user-exist-message_ownership' ), $this->_module_type, '' . $new_email_address . '' ) . - sprintf( - '', - $this->get_account_url( 'change_owner', array( - 'state' => 'init', - 'candidate_email' => $new_email_address - ) ), - $this->get_text_inline( 'Change Ownership', 'change-ownership' ) - ) - ); - break; - } - } - - if ( empty( $error ) ) { - $error = FS_Api::is_api_error_object( $install ) ? - $install->error->message : - var_export( $install->error, true ); - } - - self::shoot_ajax_failure( $error ); - } else { - if ( - // If successful ownership change. - $this->get_user()->id != $install->user_id || - ! empty( $new_email_address ) - ) { - $this->complete_ownership_change_by_license( $install->user_id, $install_ids ); - } - } - - self::shoot_ajax_success(); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.2.14 - */ - function starting_migration() { - if ( ! empty( $this->_storage->license_migration ) ) { - // Do not overwrite the data if already set. - return; - } - - $this->_storage->license_migration = array( - 'is_migrating' => true, - 'start_timestamp' => time() - ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.2.14 - */ - function is_migration() { - if ( $this->is_addon() ) { - return $this->get_parent_instance()->is_migration(); - } - - if ( empty( $this->_storage->license_migration ) ) { - return false; - } - - if ( ! $this->_storage->license_migration['is_migrating'] ) { - return false; - } - - return ( - // Return `true` if the migration is within 5 minutes from the starting time. - ( time() - $this->_storage->license_migration['start_timestamp'] ) <= WP_FS__TIME_5_MIN_IN_SEC - ); - } - - /** - * - * A helper method to activate migrated licenses. If the product is network activated and integrated, the method will network activate the license. - * - * @author Vova Feldman (@svovaf) - * @since 2.3.0 - * - * @param string $license_key - * @param null|bool $is_marketing_allowed - * @param null|number $plugin_id - * @param array $sites - * @param int $blog_id - * - * @return array { - * @var bool $success - * @var string $error - * @var string $next_page - * } - * - * @uses Freemius::activate_license() - */ - function activate_migrated_license( - $license_key, - $is_marketing_allowed = null, - $plugin_id = null, - $sites = array(), - $blog_id = null - ) { - $this->_logger->entrance(); - - $result = $this->activate_license( - $license_key, - ( empty( $sites ) && is_null( $blog_id ) && $this->is_network_active() ) ? - $this->get_sites_for_network_level_optin() : - $sites, - $is_marketing_allowed, - $blog_id, - $plugin_id - ); - - // No need to show the sticky after license activation notice after migrating a license. - $this->_admin_notices->remove_sticky( 'plan_upgraded' ); - - return $result; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @return string - */ - function get_pricing_js_path() { - return $this->apply_filters( 'freemius_pricing_js_path', WP_FS__DIR_INCLUDES . '/freemius-pricing/freemius-pricing.js' ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - * - * @return bool - */ - function should_use_external_pricing() { - if ( is_null( $this->_use_external_pricing ) ) { - $pricing_js_path = $this->get_pricing_js_path(); - - $this->_use_external_pricing = ( empty( $pricing_js_path ) || ! file_exists( $pricing_js_path ) ); - } - - return $this->_use_external_pricing; - } - - /** - * The implementation of this method was previously in `_activate_license_ajax_action()`. - * - * @author Vova Feldman (@svovaf) - * @since 2.2.4 - * @since 2.0.0 When a super-admin that hasn't connected before is network activating a license and excluding some of the sites for the license activation, go over the unselected sites in the network and if a site is not connected, skipped, nor delegated, if it's a freemium product then just skip the connection for the site, if it's a premium only product, delegate the connection and license activation to the site admin (Vova Feldman @svovaf). - * @param string $license_key - * @param array $sites - * @param null|bool $is_marketing_allowed - * @param null|int $blog_id - * @param null|number $plugin_id - * @param null|number $license_owner_id - * - * @return array { - * @var bool $success - * @var string $error - * @var string $next_page - * } - */ - private function activate_license( - $license_key, - $sites = array(), - $is_marketing_allowed = null, - $blog_id = null, - $plugin_id = null, - $license_owner_id = null, - $is_extensions_tracking_allowed = true - ) { - $this->_logger->entrance(); - - $license_key = trim( $license_key ); - - $is_network_activation_or_migration = ( - fs_is_network_admin() || - ( ! empty( $sites ) && $this->is_migration() ) - ); - - if ( ! $is_network_activation_or_migration ) { - // If the license activation is executed outside the context of a network admin, ignore the sites collection. - $sites = array(); - } - - $fs = ( empty($plugin_id) || $plugin_id == $this->_module_id ) ? - $this : - $this->get_addon_instance( $plugin_id ); - - $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); - - $error = false; - $next_page = false; - - $has_valid_blog_id = is_numeric( $blog_id ); - - $user = null; - - if ( $fs->is_addon() && $fs->get_parent_instance()->is_registered() ) { - /** - * When activating an add-on's license and the parent is opted-in, activate the license with the parent's opted-in user context. - * - * @author Vova Feldman (@svovaf) - */ - $user = $fs->get_parent_instance()->get_current_or_network_user(); - } else if ( $fs->is_registered() ) { - $user = $fs->get_current_or_network_user(); - } - - if ( $has_valid_blog_id ) { - /** - * If a specific blog ID was provided, activate the license only on the specific blog that is associated with the given blog ID. - * - * @author Leo Fajardo (@leorw) - */ - $fs->switch_to_blog( $blog_id ); - } - - if ( is_object( $user ) ) { - if ( $is_network_activation_or_migration && ! $has_valid_blog_id ) { - // If no specific blog ID was provided, activate the license for all sites in the network. - $blog_2_install_map = array(); - $site_ids = array(); - - foreach ( $sites as $site ) { - if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) { - continue; - } - - $install = $fs->get_install_by_blog_id( $site['blog_id'] ); - - if ( is_object( $install ) ) { - $blog_2_install_map[ $site['blog_id'] ] = $install; - } else { - $site_ids[] = $site['blog_id']; - } - } - - if ( ! empty( $blog_2_install_map ) ) { - $result = $fs->activate_license_on_many_installs( $user, $license_key, $blog_2_install_map ); - - if ( true !== $result ) { - $error = FS_Api::is_api_error_object( $result ) ? - $result->error->message : - var_export( $result, true ); - } - } - - if ( empty( $error ) && ! empty( $site_ids ) ) { - $result = $fs->activate_license_on_many_sites( $user, $license_key, $site_ids ); - - if ( true !== $result ) { - $error = FS_Api::is_api_error_object( $result ) ? - $result->error->message : - var_export( $result, true ); - } - } - } else { - if ( $fs->is_registered() ) { - $params = array( - 'license_key' => $fs->apply_filters( 'license_key', $license_key ) - ); - - $install_ids = array(); - - $change_owner = FS_User::is_valid_id( $license_owner_id ); - - if ( $change_owner ) { - $params['user_id'] = $license_owner_id; - - $installs_info_by_slug_map = $fs->get_parent_and_addons_installs_info(); - - foreach ( $installs_info_by_slug_map as $slug => $install_info ) { - $install_ids[ $slug ] = $install_info['install']->id; - } - - $params['install_ids'] = implode( ',', array_values( $install_ids ) ); - } - - $api = $fs->get_api_site_scope(); - - $install = $api->call( $fs->add_show_pending( '/' ), 'put', $params ); - - if ( FS_Api::is_api_error( $install ) ) { - $error = FS_Api::is_api_error_object( $install ) ? - $install->error->message : - var_export( $install->error, true ); - } else { - $fs->reconnect_locally( $has_valid_blog_id ); - - if ( - $change_owner && - // If successful ownership change. - $fs->get_user()->id != $install->user_id - ) { - $fs->complete_ownership_change_by_license( $install->user_id, $install_ids ); - } - } - } else /* ( $fs->is_addon() && $fs->get_parent_instance()->is_registered() ) */ { - $result = $fs->activate_license_on_site( $user, $license_key ); - - if ( true !== $result ) { - $error = FS_Api::is_api_error_object( $result ) ? - $result->error->message : - var_export( $result, true ); - } - } - } - - if ( empty( $error ) ) { - $fs->network_upgrade_mode_completed(); - - $fs->_user = $user; - - if ( fs_is_network_admin() && ! $has_valid_blog_id ) { - $fs->_site = $fs->get_network_install(); - } - - $fs->_sync_license( true, $has_valid_blog_id ); - - $this->maybe_sync_install_user(); - - $next_page = $fs->is_addon() ? - $fs->get_parent_instance()->get_account_url() : - $fs->get_after_activation_url( 'after_connect_url' ); - } - } else { - $next_page = $fs->opt_in( - false, - false, - false, - $license_key, - false, - false, - false, - $is_marketing_allowed, - $sites - ); - - if ( isset( $next_page->error ) ) { - $error = $next_page->error; - } else { - if ( $is_network_activation_or_migration ) { - /** - * Get the list of sites that were just opted-in (and license activated). - * This is an optimization for the next part below saving some DB queries. - */ - $connected_sites = array(); - foreach ( $sites as $site ) { - if ( isset( $site['blog_id'] ) && is_numeric( $site['blog_id'] ) ) { - $connected_sites[ $site['blog_id'] ] = true; - } - } - - $all_sites = self::get_sites(); - $pending_sites = array(); - - /** - * Check if there are any sites that are not connected, skipped, nor delegated. For every site that falls into that category, if the product is freemium, skip the connection. If the product is premium only, delegate the connection to the site administrator. - * - * @author Vova Feldman (@svovaf) - */ - foreach ( $all_sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - if ( isset( $connected_sites[ $blog_id ] ) ) { - // Site was just connected. - continue; - } - - if ( $fs->is_installed_on_site( $blog_id ) ) { - // Site was already connected before. - continue; - } - - if ( $fs->is_site_delegated_connection( $blog_id ) ) { - // Site's connection was delegated. - continue; - } - - if ( $fs->is_anonymous_site( $blog_id ) ) { - // Site connection was already skipped. - continue; - } - - $pending_sites[] = self::get_site_info( $site ); - } - - if ( ! empty( $pending_sites ) ) { - if ( $fs->is_freemium() && $fs->is_enable_anonymous() ) { - $fs->skip_connection( $pending_sites ); - } else { - $fs->delegate_connection( $pending_sites ); - } - } - } - } - } - - if ( false === $error && true === $fs->_storage->require_license_activation ) { - $fs->_storage->require_license_activation = false; - } - - $result = array( - 'success' => ( false === $error ) - ); - - if ( false !== $error ) { - $result['error'] = $fs->apply_filters( 'opt_in_error_message', $error ); - } else { - if ( $fs->is_addon() || $fs->has_addons() ) { - /** - * Purge the valid user licenses cache so that when the "Account" or the "Add-Ons" page is loaded, - * an updated valid user licenses collection will be fetched from the server which is used to also - * update the account add-ons (add-ons the user has licenses for). - * - * @author Leo Fajardo (@leorw) - * @since 2.2.4 - */ - $fs->purge_valid_user_licenses_cache(); - } - - $result['next_page'] = $next_page; - } - - return $result; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - * - * @return array { - * @key string Product slug. - * @value array { - * @property FS_Site $site - * @property FS_Plugin_License $license - * } - * } - */ - private function get_parent_and_addons_installs_info() { - $fs = $this->is_addon() ? - $this->get_parent_instance() : - $this; - - $installed_addons_ids = array(); - - $installed_addons_instances = $fs->get_installed_addons(); - foreach ( $installed_addons_instances as $instance ) { - $installed_addons_ids[] = $instance->get_id(); - } - - $addons_ids = array_unique( array_merge( - $installed_addons_ids, - $fs->get_updated_account_addons() - ) ); - - // Add parent product info. - $installs_info_by_slug_map = array( - $fs->get_slug() => array( - 'install' => $fs->get_site(), - 'license' => $fs->_get_license() - ) - ); - - foreach ( $addons_ids as $addon_id ) { - $is_installed = isset( $installed_addons_ids_map[ $addon_id ] ); - - $addon_info = $fs->_get_addon_info( $addon_id, $is_installed ); - - if ( ! $addon_info['is_connected'] ) { - // Add-on is not associated with an install entity. - continue; - } - - $installs_info_by_slug_map[ $addon_info['slug'] ] = array( - 'install' => $addon_info['site'], - 'license' => isset( $addon_info['license'] ) ? - $addon_info['license'] : - null - ); - } - - return $installs_info_by_slug_map; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3.1 - */ - function _network_activate_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'network_activate' ); - - $plugin_id = fs_request_get( 'module_id', '', 'post' ); - $fs = ( $plugin_id == $this->_module_id ) ? - $this : - $this->get_addon_instance( $plugin_id ); - - $error = false; - - $sites = fs_request_get( 'sites', array(), 'post' ); - if ( is_array( $sites ) && ! empty( $sites ) ) { - $sites_by_action = array( - 'allow' => array(), - 'delegate' => array(), - 'skip' => array() - ); - - foreach ( $sites as $site ) { - $sites_by_action[ $site['action'] ][] = $site; - } - - $total_sites = count( $sites ); - $total_sites_to_delegate = count( $sites_by_action['delegate'] ); - - $next_page = ''; - - $has_any_install = fs_request_get_bool( 'has_any_install' ); - - if ( $total_sites === $total_sites_to_delegate && - ! $this->is_network_upgrade_mode() && - ! $has_any_install - ) { - $this->delegate_connection(); - } else { - if ( ! empty( $sites_by_action['delegate'] ) ) { - $this->delegate_connection( $sites_by_action['delegate'] ); - } - - if ( ! empty( $sites_by_action['skip'] ) ) { - $this->skip_connection( $sites_by_action['skip'] ); - } - - if ( empty( $sites_by_action['allow'] ) ) { - if ( $has_any_install ) { - $first_install = $fs->find_first_install(); - - if ( ! is_null( $first_install ) ) { - $fs->_site = $first_install['install']; - $fs->_storage->network_install_blog_id = $first_install['blog_id']; - - $fs->_user = self::_get_user_by_id( $fs->_site->user_id ); - $fs->_storage->network_user_id = $fs->_user->id; - } - } - } else { - if ( ! $fs->is_registered() || ! $this->_is_network_active ) { - $next_page = $fs->opt_in( - false, - false, - false, - false, - false, - false, - false, - fs_request_get_bool( 'is_marketing_allowed', null ), - $sites_by_action['allow'] - ); - } else { - $next_page = $fs->install_with_user( - $this->get_network_user(), - false, - false, - false, - true, - $sites_by_action['allow'] - ); - } - - if ( is_object( $next_page ) && isset( $next_page->error ) ) { - $error = $next_page->error; - } - } - } - - if ( empty( $next_page ) ) { - $next_page = $this->get_after_activation_url( 'after_network_activation_url' ); - } - } else { - $error = $this->get_text_inline( 'Invalid site details collection.', 'invalid_site_details_collection' ); - } - - $result = array( - 'success' => ( false === $error ) - ); - - if ( false !== $error ) { - $result['error'] = $error; - } else { - $result['next_page'] = $next_page; - } - - echo json_encode( $result ); - - exit; - } - - /** - * Billing update AJAX callback. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - */ - function _update_billing_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'update_billing' ); - - if ( ! $this->is_user_admin() ) { - // Only for admins. - self::shoot_ajax_failure(); - } - - $billing = fs_request_get( 'billing' ); - - $api = $this->get_api_user_scope(); - $result = $api->call( '/billing.json', 'put', array_merge( $billing, array( - 'plugin_id' => $this->get_parent_id(), - ) ) ); - - if ( ! $this->is_api_result_entity( $result ) ) { - self::shoot_ajax_failure(); - } - - // Purge cached billing. - $this->get_api_user_scope()->purge_cache( 'billing.json' ); - - self::shoot_ajax_success(); - } - - /** - * Trial start for anonymous users (AJAX callback). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - */ - function _start_trial_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'start_trial' ); - - if ( ! $this->is_user_admin() ) { - // Only for admins. - self::shoot_ajax_failure(); - } - - $trial_data = fs_request_get( 'trial' ); - - $next_page = $this->opt_in( - false, - false, - false, - false, - false, - $trial_data['plan_id'] - ); - - if ( is_object( $next_page ) && $this->is_api_error( $next_page ) ) { - self::shoot_ajax_failure( - isset( $next_page->error ) ? - $next_page->error->message : - var_export( $next_page, true ) - ); - } - - $this->shoot_ajax_success( array( - 'next_page' => $next_page, - ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.0 - */ - function _resend_license_key_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'resend_license_key' ); - - $email_address = sanitize_email( trim( fs_request_get( 'email', '', 'post' ) ) ); - - if ( empty( $email_address ) ) { - exit; - } - - $error = false; - - $api = $this->get_api_plugin_scope(); - $result = $api->call( '/licenses/resend.json', 'post', - array( - 'email' => $email_address, - 'url' => home_url(), - ) - ); - - if ( is_object( $result ) && isset( $result->error ) ) { - $error = $result->error; - - if ( in_array( $error->code, array( 'invalid_email', 'no_user' ) ) ) { - $error = $this->get_text_inline( "We couldn't find your email address in the system, are you sure it's the right address?", 'email-not-found' ); - } else if ( 'no_license' === $error->code ) { - $error = $this->get_text_inline( "We can't see any active licenses associated with that email address, are you sure it's the right address?", 'no-active-licenses' ); - } else { - $error = $error->message; - } - } - - $licenses = array( - 'success' => ( false === $error ) - ); - - if ( false !== $error ) { - $licenses['error'] = sprintf( '%s... %s', $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ), strtolower( $error ) ); - } - - echo json_encode( $licenses ); - - exit; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.8 - * - * @var string - */ - private static $_pagenow; - - /** - * Get current page or the referer if executing a WP AJAX request. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.8 - * - * @return string - */ - static function get_current_page() { - if ( ! isset( self::$_pagenow ) ) { - global $pagenow; - if ( empty( $pagenow ) && is_admin() && is_multisite() ) { - /** - * It appears that `$pagenow` is not yet initialized in some network admin pages when this method - * is called, so initialize it here using some pieces of code from `wp-includes/vars.php`. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - if ( is_network_admin() ) { - preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); - } else if ( is_user_admin() ) { - preg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); - } else { - preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); - } - - $pagenow = $self_matches[1]; - $pagenow = trim( $pagenow, '/' ); - $pagenow = preg_replace( '#\?.*?$#', '', $pagenow ); - if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) { - $pagenow = 'index.php'; - } else { - preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches ); - $pagenow = strtolower( $self_matches[1] ); - if ( '.php' !== substr($pagenow, -4, 4) ) - $pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried) - } - } - - self::$_pagenow = $pagenow; - - if ( self::is_ajax() && - 'admin-ajax.php' === $pagenow - ) { - $referer = fs_get_raw_referer(); - - if ( is_string( $referer ) ) { - $parts = explode( '?', $referer ); - - self::$_pagenow = basename( $parts[0] ); - } - } - } - - return self::$_pagenow; - } - - /** - * Helper method to check if user in the plugins page. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @return bool - */ - static function is_plugins_page() { - return ( 'plugins.php' === self::get_current_page() ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - * - * @return bool - */ - static function is_plugin_install_page() { - return ( 'plugin-install.php' === self::get_current_page() ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.2 - * - * @return bool - */ - static function is_updates_page() { - return ( 'update-core.php' === self::get_current_page() ); - } - - /** - * Helper method to check if user in the themes page. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.6 - * - * @return bool - */ - static function is_themes_page() { - return ( 'themes.php' === self::get_current_page() ); - } - - #---------------------------------------------------------------------------------- - #region Affiliation - #---------------------------------------------------------------------------------- - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - * - * @return bool - */ - function has_affiliate_program() { - if ( ! is_object( $this->_plugin ) ) { - return false; - } - - return $this->_plugin->has_affiliate_program(); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.4 - */ - private function fetch_affiliate_terms() { - if ( ! is_object( $this->plugin_affiliate_terms ) ) { - $plugins_api = $this->get_api_plugin_scope(); - $affiliate_terms = $plugins_api->get( '/aff.json?type=affiliation', false ); - - if ( ! $this->is_api_result_entity( $affiliate_terms ) ) { - return; - } - - $this->plugin_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.4 - */ - private function fetch_affiliate_and_custom_terms() { - if ( ! empty( $this->_storage->affiliate_application_data ) ) { - $application_data = $this->_storage->affiliate_application_data; - $flush = ( ! isset( $application_data['status'] ) || 'pending' === $application_data['status'] ); - - $users_api = $this->get_api_user_scope(); - $result = $users_api->get( "/plugins/{$this->_plugin->id}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json", $flush ); - if ( $this->is_api_result_object( $result, 'affiliates' ) ) { - if ( ! empty( $result->affiliates ) ) { - $affiliate = new FS_Affiliate( $result->affiliates[0] ); - - if ( ! isset( $application_data['status'] ) || $application_data['status'] !== $affiliate->status ) { - $application_data['status'] = $affiliate->status; - $this->_storage->affiliate_application_data = $application_data; - } - - if ( $affiliate->is_using_custom_terms ) { - $affiliate_terms = $users_api->get( "/plugins/{$this->_plugin->id}/affiliates/{$affiliate->id}/aff/{$affiliate->custom_affiliate_terms_id}.json", $flush ); - if ( $this->is_api_result_entity( $affiliate_terms ) ) { - $this->custom_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms ); - } - } - - $this->affiliate = $affiliate; - } - } - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - */ - private function fetch_affiliate_and_terms() { - $this->_logger->entrance(); - - $this->fetch_affiliate_terms(); - $this->fetch_affiliate_and_custom_terms(); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - * - * @return FS_Affiliate - */ - function get_affiliate() { - return $this->affiliate; - } - - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - * - * @return FS_AffiliateTerms - */ - function get_affiliate_terms() { - return is_object( $this->custom_affiliate_terms ) ? - $this->custom_affiliate_terms : - $this->plugin_affiliate_terms; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - */ - function _submit_affiliate_application() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'submit_affiliate_application' ); - - if ( ! $this->is_user_admin() ) { - // Only for admins. - self::shoot_ajax_failure(); - } - - $affiliate = fs_request_get( 'affiliate' ); - - if ( empty( $affiliate['promotion_methods'] ) ) { - unset( $affiliate['promotion_methods'] ); - } - - if ( ! empty( $affiliate['additional_domains'] ) ) { - $affiliate['additional_domains'] = array_unique( $affiliate['additional_domains'] ); - } - - if ( ! $this->is_registered() ) { - // Opt in but don't track usage. - $next_page = $this->opt_in( - false, - false, - false, - false, - false, - false, - true - ); - - if ( is_object( $next_page ) && $this->is_api_error( $next_page ) ) { - self::shoot_ajax_failure( - isset( $next_page->error ) ? - $next_page->error->message : - var_export( $next_page, true ) - ); - } else if ( $this->is_pending_activation() ) { - self::shoot_ajax_failure( $this->get_text_inline( 'Account is pending activation.', 'account-is-pending-activation' ) ); - } - } - - $this->fetch_affiliate_terms(); - - $api = $this->get_api_user_scope(); - $result = $api->call( - ( "/plugins/{$this->_plugin->id}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json" ), - 'post', - $affiliate - ); - - if ( $this->is_api_error( $result ) ) { - self::shoot_ajax_failure( - isset( $result->error ) ? - $result->error->message : - var_export( $result, true ) - ); - } else { - if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) { - $this->_admin_notices->remove_sticky( 'affiliate_program' ); - } - - $affiliate_application_data = array( - 'status' => 'pending', - 'stats_description' => $affiliate['stats_description'], - 'promotion_method_description' => $affiliate['promotion_method_description'], - ); - - if ( ! empty( $affiliate['promotion_methods'] ) ) { - $affiliate_application_data['promotion_methods'] = $affiliate['promotion_methods']; - } - - if ( ! empty( $affiliate['domain'] ) ) { - $affiliate_application_data['domain'] = $affiliate['domain']; - } - - if ( ! empty( $affiliate['additional_domains'] ) ) { - $affiliate_application_data['additional_domains'] = $affiliate['additional_domains']; - } - - $this->_storage->affiliate_application_data = $affiliate_application_data; - } - - // Purge cached affiliate. - $api->purge_cache( 'affiliate.json' ); - - self::shoot_ajax_success( $result ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - * - * @return array|null - */ - function get_affiliate_application_data() { - if ( empty( $this->_storage->affiliate_application_data ) ) { - return null; - } - - return $this->_storage->affiliate_application_data; - } - - #endregion Affiliation ------------------------------------------------------------ - - #---------------------------------------------------------------------------------- - #region URL Generators - #---------------------------------------------------------------------------------- - - /** - * Alias to pricing_url(). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @uses pricing_url() - * - * @param string $period Billing cycle - * @param bool $is_trial - * - * @return string - */ - function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) { - return $this->pricing_url( $period, $is_trial ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @uses get_upgrade_url() - * - * @return string - */ - function get_trial_url() { - return $this->get_upgrade_url( WP_FS__PERIOD_ANNUALLY, true ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.4 - * - * @param string $new_version - * - * @return string - */ - function version_upgrade_checkout_link( $new_version ) { - if ( ! is_object( $this->_license ) ) { - $url = $this->pricing_url(); - - $purchase_license_text = $this->get_text_inline( 'Buy a license now', 'buy-license-now' ); - } else { - $subscription = $this->_get_subscription( $this->_license->id ); - - $url = $this->checkout_url( - is_object( $subscription ) ? - ( 1 == $subscription->billing_cycle ? WP_FS__PERIOD_MONTHLY : WP_FS__PERIOD_ANNUALLY ) : - WP_FS__PERIOD_LIFETIME, - false, - array( 'licenses' => $this->_license->quota ) - ); - - $purchase_license_text = $this->get_text_inline( 'Renew your license now', 'renew-license-now' ); - } - - return sprintf( - $this->get_text_inline( '%s to access version %s security & feature updates, and support.', 'x-for-updates-and-support' ), - sprintf( '%s', $url, $purchase_license_text ), - $new_version - ); - } - - /** - * Plugin's pricing URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param string $billing_cycle Billing cycle - * - * @param bool $is_trial - * - * @return string - */ - function pricing_url( $billing_cycle = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) { - $this->_logger->entrance(); - - $params = array( - 'billing_cycle' => $billing_cycle - ); - - if ( $is_trial ) { - $params['trial'] = 'true'; - } - - $url = $this->is_addon() ? - $this->_parent->addon_url( $this->_slug ) : - $this->_get_admin_page_url( 'pricing', $params ); - - return $this->apply_filters( 'pricing_url', $url ); - } - - /** - * Checkout page URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param string $billing_cycle Billing cycle - * @param bool $is_trial - * @param array $extra (optional) Extra parameters, override other query params. - * @param bool|null $network - * - * @return string - */ - function checkout_url( - $billing_cycle = WP_FS__PERIOD_ANNUALLY, - $is_trial = false, - $extra = array(), - $network = null - ) { - $this->_logger->entrance(); - - $params = array( - 'checkout' => 'true', - 'billing_cycle' => $billing_cycle, - ); - - if ( $is_trial ) { - $params['trial'] = 'true'; - } - - /** - * Params in extra override other params. - */ - $params = array_merge( $params, $extra ); - - return $this->_get_admin_page_url( 'pricing', $params, $network ); - } - - /** - * Add-on checkout URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - * - * @param number $addon_id - * @param number $pricing_id - * @param string $billing_cycle - * @param bool $is_trial - * @param bool|null $network - * - * @return string - */ - function addon_checkout_url( - $addon_id, - $pricing_id, - $billing_cycle = WP_FS__PERIOD_ANNUALLY, - $is_trial = false, - $network = null - ) { - return $this->checkout_url( $billing_cycle, $is_trial, array( - 'plugin_id' => $addon_id, - 'pricing_id' => $pricing_id, - ), $network ); - } - - #endregion - - #endregion ------------------------------------------------------------------ - - /** - * Check if plugin has any add-ons. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @since 1.1.7.3 Base logic only on the parameter provided by the developer in the init function. - * - * @return bool - */ - function has_addons() { - $this->_logger->entrance(); - - return $this->_has_addons; - } - - /** - * Check if plugin can work in anonymous mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - * - * @deprecated Please use is_enable_anonymous() instead. - */ - function enable_anonymous() { - return $this->_enable_anonymous; - } - - /** - * Check if plugin can work in anonymous mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9 - * - * @return bool - */ - function is_enable_anonymous() { - return $this->_enable_anonymous; - } - - /** - * Check if plugin is premium only (no free plans). - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9 - * - * @return bool - */ - function is_only_premium() { - return $this->_is_premium_only; - } - - /** - * Checks if the plugin's type is "plugin". The other type is "theme". - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return bool - */ - function is_plugin() { - return ( WP_FS__MODULE_TYPE_PLUGIN === $this->_module_type ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return string - */ - function get_module_type() { - if ( ! isset( $this->_module_type ) ) { - $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); - $this->_module_type = $id_slug_type_path_map[ $this->_module_id ]['type']; - } - - return $this->_module_type; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return string - */ - function get_plugin_main_file_path() { - return $this->_plugin_main_file_path; - } - - /** - * Check if module has a premium code version. - * - * Serviceware module might be freemium without any - * premium code version, where the paid features - * are all part of the service. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - * - * @return bool - */ - function has_premium_version() { - return $this->_has_premium_version; - } - - /** - * Check if feature supported with current site's plan. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @todo IMPLEMENT - * - * @param number $feature_id - * - * @throws Exception - */ - function is_feature_supported( $feature_id ) { - throw new Exception( 'not implemented' ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @return bool Is running in SSL/HTTPS - */ - function is_ssl() { - return WP_FS__IS_HTTPS; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool Is running in AJAX call. - * - * @link http://wordpress.stackexchange.com/questions/70676/how-to-check-if-i-am-in-admin-ajax - */ - static function is_ajax() { - return ( defined( 'DOING_AJAX' ) && DOING_AJAX ); - } - - /** - * Check if it's an AJAX call targeted for the current module. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.0 - * - * @param array|string $actions Collection of AJAX actions. - * - * @return bool - */ - function is_ajax_action( $actions ) { - // Verify it's an ajax call. - if ( ! self::is_ajax() ) { - return false; - } - - // Verify the call is relevant for the plugin. - if ( $this->_module_id != fs_request_get( 'module_id' ) ) { - return false; - } - - // Verify it's one of the specified actions. - if ( is_string( $actions ) ) { - $actions = explode( ',', $actions ); - } - - if ( is_array( $actions ) && 0 < count( $actions ) ) { - $ajax_action = fs_request_get( 'action' ); - - foreach ( $actions as $action ) { - if ( $ajax_action === $this->get_action_tag( $action ) ) { - return true; - } - } - } - - return false; - } - - /** - * Check if it's an AJAX call targeted for current request. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.0 - * - * @param array|string $actions Collection of AJAX actions. - * @param number|null $module_id - * - * @return bool - */ - static function is_ajax_action_static( $actions, $module_id = null ) { - // Verify it's an ajax call. - if ( ! self::is_ajax() ) { - return false; - } - - - if ( ! empty( $module_id ) ) { - // Verify the call is relevant for the plugin. - if ( $module_id != fs_request_get( 'module_id' ) ) { - return false; - } - } - - // Verify it's one of the specified actions. - if ( is_string( $actions ) ) { - $actions = explode( ',', $actions ); - } - - if ( is_array( $actions ) && 0 < count( $actions ) ) { - $ajax_action = fs_request_get( 'action' ); - - foreach ( $actions as $action ) { - if ( $ajax_action === self::get_ajax_action_static( $action, $module_id ) ) { - return true; - } - } - } - - return false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - * - * @return bool - */ - static function is_cron() { - return ( defined( 'DOING_CRON' ) && DOING_CRON ); - } - - /** - * Check if a real user is visiting the admin dashboard. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - * - * @return bool - */ - function is_user_in_admin() { - return ( - is_admin() && - ! self::is_ajax() && - ! self::is_cron() && - ( 'admin-post.php' !== self::get_current_page() ) - ); - } - - /** - * Check if a real user is in the customizer view. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - */ - static function is_customizer() { - return is_customize_preview(); - } - - /** - * Check if running in HTTPS and if site's plan matching the specified plan. - * - * @param string $plan - * @param bool $exact - * - * @return bool - */ - function is_ssl_and_plan( $plan, $exact = false ) { - return ( $this->is_ssl() && $this->is_plan( $plan, $exact ) ); - } - - /** - * Construct plugin's settings page URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param string $page - * @param array $params - * @param bool|null $network - * - * @return string - */ - function _get_admin_page_url( $page = '', $params = array(), $network = null ) { - if ( is_null( $network ) ) { - $network = ( - $this->_is_network_active && - ( fs_is_network_admin() || ! $this->is_delegated_connection() ) - ); - } - - if ( 0 < count( $params ) ) { - foreach ( $params as $k => $v ) { - $params[ $k ] = urlencode( $v ); - } - } - - $page_param = $this->_menu->get_slug( $page ); - - if ( empty( $page ) && - // Show the opt-in as an overlay for free wp.org themes or themes without any settings page. - $this->show_opt_in_on_themes_page() - ) { - $params[ $this->get_unique_affix() . '_show_optin' ] = 'true'; - - return add_query_arg( - $params, - $this->admin_url( 'themes.php', 'admin', $network ) - ); - } - - if ( ! $this->has_settings_menu() ) { - if ( ! empty( $page ) ) { - // Module doesn't have a setting page, but since the request is for - // a specific Freemius page, use the admin.php path. - return add_query_arg( array_merge( $params, array( - 'page' => $page_param, - ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); - } else { - if ( $this->is_activation_mode() ) { - /** - * @author Vova Feldman - * @since 1.2.1.6 - * - * If plugin doesn't have a settings page, create one for the opt-in screen. - */ - return add_query_arg( array_merge( $params, array( - 'page' => $this->_slug, - ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); - } else { - // Plugin without a settings page. - return add_query_arg( - $params, - $this->admin_url( 'plugins.php', 'admin', $network ) - ); - } - } - } - - // Module has a submenu settings page. - if ( ! $this->_menu->is_top_level() ) { - $parent_slug = $this->_menu->get_parent_slug(); - $menu_file = ( false !== strpos( $parent_slug, '.php' ) ) ? - $parent_slug : - 'admin.php'; - - return add_query_arg( array_merge( $params, array( - 'page' => $page_param, - ) ), $this->admin_url( $menu_file, 'admin', $network ) ); - } - - // Module has a top level CPT settings page. - if ( $this->_menu->is_cpt() ) { - if ( empty( $page ) && $this->is_activation_mode() ) { - return add_query_arg( array_merge( $params, array( - 'page' => $page_param - ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); - } else { - if ( ! empty( $page ) ) { - $params['page'] = $page_param; - } - - return add_query_arg( - $params, - $this->admin_url( $this->_menu->get_raw_slug(), 'admin', $network ) - ); - } - } - - // Module has a custom top level settings page. - return add_query_arg( array_merge( $params, array( - 'page' => $page_param, - ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); - } - - #-------------------------------------------------------------------------------- - #region Multisite - #-------------------------------------------------------------------------------- - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @return bool - */ - function is_network_active() { - return $this->_is_network_active; - } - - /** - * Delegate activation for the given sites in the network (or all sites if `null`) to site admins. - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param array|null $sites - */ - private function delegate_connection( $sites = null ) { - $this->_logger->entrance(); - - $this->_admin_notices->remove_sticky( 'connect_account' ); - - if ( is_null( $sites ) ) { - // All sites delegation. - $this->_storage->store( 'is_delegated_connection', true, true, true ); - } else { - // Specified sites delegation. - foreach ( $sites as $site ) { - $this->delegate_site_connection( $site['blog_id'] ); - } - } - - $this->network_upgrade_mode_completed(); - } - - /** - * Delegate specific network site conncetion to the site admin. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id - */ - private function delegate_site_connection( $blog_id ) { - $this->_storage->store( 'is_delegated_connection', true, $blog_id, true ); - } - - /** - * Check if super-admin delegated the connection of ALL sites to the site admins. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return bool - */ - function is_network_delegated_connection() { - if ( ! $this->_is_network_active ) { - return false; - } - - return $this->_storage->get( 'is_delegated_connection', false, true ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param int $blog_id - * - * @return bool - */ - function is_site_delegated_connection( $blog_id = 0 ) { - if ( ! $this->_is_network_active ) { - return false; - } - - if ( 0 == $blog_id ) { - $blog_id = get_current_blog_id(); - } - - return $this->_storage->get( 'is_delegated_connection', false, $blog_id ); - } - - /** - * Check if delegated the connection. When running within the the network admin, - * and haven't specified the blog ID, checks if network level delegated. If running - * within a site admin or specified a blog ID, check if delegated the connection for - * the current context site. - * - * If executed outside the the admin, check if delegated the connection - * for the current context site OR the whole network. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id If set, checks if network delegated or blog specific delegated. - * - * @return bool - */ - function is_delegated_connection( $blog_id = 0 ) { - if ( ! $this->_is_network_active ) { - return false; - } - - if ( fs_is_network_admin() && 0 == $blog_id ) { - return $this->is_network_delegated_connection(); - } - - return ( - $this->is_network_delegated_connection() || - $this->is_site_delegated_connection( $blog_id ) - ); - } - - /** - * Check if the current module is active for the site. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id - * - * @return bool - */ - function is_active_for_site( $blog_id ) { - if ( ! is_multisite() ) { - // Not a multisite and this code is executed, means that the plugin is active. - return true; - } - - if ( $this->is_theme() ) { - // All themes are site level activated. - return true; - } - - if ( $this->_is_network_active ) { - // Plugin was network activated so it's active. - return true; - } - - return in_array( $this->_plugin_basename, (array) get_blog_option( $blog_id, 'active_plugins', array() ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @return array Active & public sites collection. - */ - static function get_sites() { - if ( ! is_multisite() ) { - return array(); - } - - /** - * For consistency with get_blog_list() which only return active public sites. - * - * @author Vova Feldman (@svovaf) - */ - $args = array( - /** - * Commented out in order to handle the migration of site options whether the site is public or not. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - */ - // 'public' => 1, - 'archived' => 0, - 'mature' => 0, - 'spam' => 0, - 'deleted' => 0, - ); - - if ( function_exists( 'get_sites' ) ) { - // For WP 4.6 and above. - return get_sites( $args ); - } else if ( function_exists( 'wp_' . 'get_sites' ) ) { - // For WP 3.7 to WP 4.5. - /** - * This is a hack suggested previously proposed by the TRT. Our SDK is compliant with older WP versions and we'd like to keep it that way. - * - * @todo Remove this hack once this false-positive error is removed from the Theme Sniffer. - * - * @since 2.3.3 - * @author Vova Feldman (@svovaf) - */ - $fn = 'wp_' . 'get_sites'; - return $fn( $args ); - } else { - // For WP 3.6 and below. - return get_blog_list( 0, 'all' ); - } - } - - /** - * Checks if a given blog is active. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param $blog_id - * - * @return bool - */ - private static function is_site_active( $blog_id ) { - global $wpdb; - - $blog_info = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d", $blog_id ) ); - - if ( ! is_object( $blog_info ) ) { - return false; - } - - return ( - true == $blog_info->public && - false == $blog_info->archived && - false == $blog_info->mature && - false == $blog_info->spam && - false == $blog_info->deleted - ); - } - - /** - * Get a mapping between the site addresses to their blog IDs. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return array { - * @key string Site address without protocol with a trailing slash. - * @value int Site's blog ID. - * } - */ - private function get_address_to_blog_map() { - $sites = self::get_sites(); - - // Map site addresses to their blog IDs. - $address_to_blog_map = array(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $address = trailingslashit( fs_strip_url_protocol( get_site_url( $blog_id ) ) ); - $address_to_blog_map[ $address ] = $blog_id; - } - - return $address_to_blog_map; - } - - /** - * Get a mapping between the site addresses to their blog IDs. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return array { - * @key int Site's blog ID. - * @value FS_Site Associated install. - * } - */ - function get_blog_install_map() { - $sites = self::get_sites(); - - // Map site blog ID to its install. - $install_map = array(); - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( is_object( $install ) ) { - $install_map[ $blog_id ] = $install; - } - } - - return $install_map; - } - - /** - * Gets a map of module IDs that the given user has opted-in to. - * - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - * - * @param number $fs_user_id - * - * @return array { - * @key number $plugin_id - * @value bool Always true. - * } - */ - private static function get_user_opted_in_module_ids_map( $fs_user_id ) { - self::$_static_logger->entrance(); - - if ( ! is_multisite() ) { - $installs = array_merge( - self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ), - self::get_all_sites( WP_FS__MODULE_TYPE_THEME ) - ); - } else { - $sites = self::get_sites(); - - $installs = array(); - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - - $installs = array_merge( - $installs, - self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id ), - self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id ) - ); - } - } - - $module_ids_map = array(); - foreach ( $installs as $install ) { - if ( is_object( $install ) && - FS_Site::is_valid_id( $install->id ) && - FS_User::is_valid_id( $install->user_id ) && - ( $install->user_id == $fs_user_id ) - ) { - $module_ids_map[ $install->plugin_id ] = true; - } - } - - return $module_ids_map; - } - - /** - * @author Leo Fajardo (@leorw) - * - * @return null|array { - * 'install' => FS_Site Module's install, - * 'blog_id' => string The associated blog ID. - * } - */ - function find_first_install() { - $sites = self::get_sites(); - - foreach ( $sites as $site ) { - $blog_id = self::get_site_blog_id( $site ); - $install = $this->get_install_by_blog_id( $blog_id ); - - if ( is_object( $install ) ) { - return array( - 'install' => $install, - 'blog_id' => $blog_id - ); - } - } - - return null; - } - - /** - * Switches the Freemius site level context to a specified blog. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $blog_id - * @param FS_Site $install - * - * @return bool Since 2.3.1 returns if a switch was made. - */ - function switch_to_blog( $blog_id, FS_Site $install = null ) { - if ( ! is_numeric( $blog_id ) || $blog_id == $this->_context_is_network_or_blog_id ) { - return false; - } - - switch_to_blog( $blog_id ); - $this->_context_is_network_or_blog_id = $blog_id; - - self::$_accounts->set_site_blog_context( $blog_id ); - $this->_storage->set_site_blog_context( $blog_id ); - $this->_storage->set_network_active( $this->_is_network_active, $this->is_delegated_connection( $blog_id ) ); - - $this->_site = is_object( $install ) ? - $install : - $this->get_install_by_blog_id( $blog_id ); - - $this->_user = false; - $this->_licenses = false; - $this->_license = null; - $this->is_whitelabeled = null; - - if ( is_object( $this->_site ) ) { - // Try to fetch user from install. - $this->_user = self::_get_user_by_id( $this->_site->user_id ); - - if ( ! is_object( $this->_user ) && - FS_User::is_valid_id( $this->_storage->prev_user_id ) - ) { - // Try to fetch previously saved user. - $this->_user = self::_get_user_by_id( $this->_storage->prev_user_id ); - - if ( ! is_object( $this->_user ) ) { - // Fallback to network's user. - $this->_user = $this->get_network_user(); - } - } - - $all_plugin_licenses = self::get_all_licenses( $this->_module_id ); - - if ( ! empty( $all_plugin_licenses ) ) { - if ( ! FS_Plugin_License::is_valid_id( $this->_site->license_id ) ) { - $this->_license = null; - } else { - $license_found = false; - foreach ( $all_plugin_licenses as $license ) { - if ( $license->id == $this->_site->license_id ) { - // License found. - $this->_license = $license; - $license_found = true; - break; - } - } - - if ( $license_found ) { - $this->link_license_2_user( $this->_license->id, $this->_user->id ); - } - } - - $this->_licenses = $this->get_user_licenses( $this->_user->id ); - } - } - - unset( $this->_site_api ); - unset( $this->_user_api ); - - return false; - } - - /** - * Restore the blog context to the blog that originally loaded the module. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - function restore_current_blog() { - $this->switch_to_blog( $this->_blog_id ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param array|WP_Site $site - * - * @return int - */ - static function get_site_blog_id( &$site ) { - return ( $site instanceof WP_Site ) ? - $site->blog_id : - ( is_object( $site ) && isset( $site->userblog_id ) ? - $site->userblog_id : - $site['blog_id'] ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param array|WP_Site|null $site - * - * @return array - */ - function get_site_info( $site = null ) { - $this->_logger->entrance(); - - $switched = false; - - if ( is_null( $site ) ) { - $url = get_site_url(); - $name = get_bloginfo( 'name' ); - $blog_id = null; - } else { - $blog_id = self::get_site_blog_id( $site ); - - if ( get_current_blog_id() != $blog_id ) { - switch_to_blog( $blog_id ); - $switched = true; - } - - if ( $site instanceof WP_Site ) { - $url = $site->siteurl; - $name = $site->blogname; - } else { - $url = get_site_url( $blog_id ); - $name = get_bloginfo( 'name' ); - } - } - - $info = array( - 'uid' => $this->get_anonymous_id( $blog_id ), - 'url' => $url, - 'title' => $name, - 'language' => get_bloginfo( 'language' ), - 'charset' => get_bloginfo( 'charset' ), - ); - - if ( is_numeric( $blog_id ) ) { - $info['blog_id'] = $blog_id; - } - - if ( $switched ) { - restore_current_blog(); - } - - return $info; - } - - /** - * Load the module's install based on the blog ID. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int|null $blog_id - * - * @return FS_Site - */ - function get_install_by_blog_id( $blog_id = null ) { - $installs = self::get_all_sites( $this->_module_type, $blog_id ); - $install = isset( $installs[ $this->_slug ] ) ? $installs[ $this->_slug ] : null; - - if ( is_object( $install ) && - is_numeric( $install->id ) && - is_numeric( $install->user_id ) && - FS_Plugin_Plan::is_valid_id( $install->plan_id ) - ) { - // Load site. - $install = clone $install; - } - - return $install; - } - - /** - * Check if module is installed on a specified site. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int|null $blog_id - * - * @return bool - */ - function is_installed_on_site( $blog_id = null ) { - $installs = self::get_all_sites( $this->_module_type, $blog_id ); - $install = isset( $installs[ $this->_slug ] ) ? $installs[ $this->_slug ] : null; - - return ( - is_object( $install ) && - is_numeric( $install->id ) && - is_numeric( $install->user_id ) && - FS_Plugin_Plan::is_valid_id( $install->plan_id ) - ); - } - - /** - * Check if super-admin connected at least one site via the network opt-in. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return bool - */ - function is_network_registered() { - if ( ! $this->_is_network_active ) { - return false; - } - - return FS_User::is_valid_id( $this->_storage->network_user_id ); - } - - /** - * Returns the main user associated with the network. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return FS_User - */ - function get_network_user() { - if ( ! $this->_is_network_active ) { - return null; - } - - return FS_User::is_valid_id( $this->_storage->network_user_id ) ? - self::_get_user_by_id( $this->_storage->network_user_id ) : - null; - } - - /** - * Returns the current context user or the network's main user. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return FS_User - */ - function get_current_or_network_user() { - return ( $this->_user instanceof FS_User ) ? - $this->_user : - $this->get_network_user(); - } - - /** - * Returns the main install associated with the network. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return FS_Site - */ - function get_network_install() { - if ( ! $this->_is_network_active ) { - return null; - } - - return FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ? - $this->get_install_by_blog_id( $this->_storage->network_install_blog_id ) : - null; - } - - /** - * Returns the blog ID that is associated with the main install. - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @return int|null - */ - function get_network_install_blog_id() { - if ( ! $this->_is_network_active ) { - return null; - } - - return FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ? - $this->_storage->network_install_blog_id : - null; - } - - /** - * Returns the current context install or the network's main install. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return FS_Site - */ - function get_current_or_network_install() { - return ( $this->_site instanceof FS_Site ) ? - $this->_site : - $this->get_network_install(); - } - - /** - * Check if executing a site level action from the network level admin. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return false|int If yes, return the requested blog ID. - */ - private function is_network_level_site_specific_action() { - if ( ! $this->_is_network_active ) { - return false; - } - - if ( ! fs_is_network_admin() ) { - return false; - } - - $blog_id = fs_request_get( 'blog_id', '' ); - - return is_numeric( $blog_id ) ? $blog_id : false; - } - - /** - * Check if executing an action from the network level admin. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return bool - */ - private function is_network_level_action() { - return ( $this->_is_network_active && fs_is_network_admin() ); - } - - /** - * Needs to be executed after site deactivation, archive, deletion, or flag as spam. - * The logic updates the network level user and blog, and reschedule the crons if the cron executing site matching the site that is no longer publicly active. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $context_blog_id - */ - private function update_multisite_data_after_site_deactivation( $context_blog_id = 0 ) { - $this->_logger->entrance(); - - if ( $this->_is_network_active ) { - if ( $context_blog_id == $this->_storage->network_install_blog_id ) { - $installs_map = $this->get_blog_install_map(); - - foreach ( $installs_map as $blog_id => $install ) { - /** - * @var FS_Site $install - */ - if ( $context_blog_id == $blog_id ) { - continue; - } - - if ( $install->user_id != $this->_storage->network_user_id ) { - continue; - } - - // Switch reference to a blog that is opted-in and belong to the same super-admin. - $this->_storage->network_install_blog_id = $blog_id; - break; - } - } - } - - if ( $this->is_sync_cron_scheduled() && - $context_blog_id == $this->get_sync_cron_blog_id() - ) { - $this->schedule_sync_cron( WP_FS__SCRIPT_START_TIME, true, $context_blog_id ); - } - - if ( $this->is_install_sync_scheduled() && - $context_blog_id == $this->get_install_sync_cron_blog_id() - ) { - $this->schedule_install_sync( $context_blog_id ); - } - } - - /** - * Executed after site deactivation, archive, or flag as spam. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $context_blog_id - */ - public function _after_site_deactivated_callback( $context_blog_id = 0 ) { - $this->_logger->entrance(); - - $install = $this->get_install_by_blog_id( $context_blog_id ); - - if ( ! is_object( $install ) ) { - // Site not connected. - return; - } - - $this->update_multisite_data_after_site_deactivation( $context_blog_id ); - - $current_blog_id = get_current_blog_id(); - - $this->switch_to_blog( $context_blog_id ); - - // Send deactivation event. - $this->sync_install( array( - 'is_active' => false, - ) ); - - $this->switch_to_blog( $current_blog_id ); - } - - /** - * Executed after site deletion. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $context_blog_id - * @param bool $drop True if site's database tables should be dropped. Default is false. - */ - public function _after_site_deleted_callback( $context_blog_id = 0, $drop = false ) { - $this->_logger->entrance(); - - $install = $this->get_install_by_blog_id( $context_blog_id ); - - if ( ! is_object( $install ) ) { - // Site not connected. - return; - } - - $this->update_multisite_data_after_site_deactivation( $context_blog_id ); - - $current_blog_id = get_current_blog_id(); - - $this->switch_to_blog( $context_blog_id ); - - if ( $drop ) { - // Delete install if dropping site DB. - $this->delete_account_event(); - } else { - // Send deactivation event. - $this->sync_install( array( - 'is_active' => false, - ) ); - } - - $this->switch_to_blog( $current_blog_id ); - } - - /** - * Executed after site re-activation. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param int $context_blog_id - */ - public function _after_site_reactivated_callback( $context_blog_id = 0 ) { - $this->_logger->entrance(); - - $install = $this->get_install_by_blog_id( $context_blog_id ); - - if ( ! is_object( $install ) ) { - // Site not connected. - return; - } - - if ( ! self::is_site_active( $context_blog_id ) ) { - // Site not yet active (can be in spam mode, archived, deleted...). - return; - } - - $current_blog_id = get_current_blog_id(); - - $this->switch_to_blog( $context_blog_id ); - - // Send re-activation event. - $this->sync_install( array( - 'is_active' => true, - ) ); - - $this->switch_to_blog( $current_blog_id ); - } - - #endregion Multisite - - /** - * @author Leo Fajardo (@leorw) - * - * @param string $path - * @param string $scheme - * @param bool $network - * - * @return string - */ - private function admin_url( $path = '', $scheme = 'admin', $network = true ) { - return ( $this->_is_network_active && $network ) ? - network_admin_url( $path, $scheme ) : - admin_url( $path, $scheme ); - } - - /** - * Check if currently in a specified admin page. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @param string $page - * - * @return bool - */ - function is_admin_page( $page ) { - return ( $this->_menu->get_slug( $page ) === fs_request_get( 'page', '', 'get' ) ); - } - - /** - * Check if currently in the product's main admin page. - * - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @return bool - */ - function is_main_admin_page() { - return $this->is_admin_page( '' ); - } - - /** - * Get module's main admin setting page URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return string - */ - function main_menu_url() { - return $this->_menu->main_menu_url(); - } - - /** - * Check if currently on the theme's setting page or - * on any of the Freemius added pages (via tabs). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - * - * @deprecated Please use is_product_settings_page() instead; - */ - function is_theme_settings_page() { - return $this->is_product_settings_page(); - } - - /** - * Check if currently on the product's main setting page or on any of the Freemius added pages (via tabs). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - */ - function is_product_settings_page() { - return fs_starts_with( - fs_request_get( 'page', '', 'get' ), - $this->_menu->get_slug() - ); - } - - /** - * Plugin's account page + sync license URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.9.1 - * - * @param bool|number $plugin_id - * @param bool $add_action_nonce - * @param array $params - * - * @return string - */ - function _get_sync_license_url( $plugin_id = false, $add_action_nonce = true, $params = array() ) { - if ( is_numeric( $plugin_id ) ) { - $params['plugin_id'] = $plugin_id; - } - - return $this->get_account_url( - $this->get_unique_affix() . '_sync_license', - $params, - $add_action_nonce - ); - } - - /** - * Plugin's account URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param bool|string $action - * @param array $params - * - * @param bool $add_action_nonce - * - * @return string - */ - function get_account_url( $action = false, $params = array(), $add_action_nonce = true ) { - if ( is_string( $action ) ) { - $params['fs_action'] = $action; - } - - self::require_pluggable_essentials(); - - return ( $add_action_nonce && is_string( $action ) ) ? - fs_nonce_url( $this->_get_admin_page_url( 'account', $params ), $action ) : - $this->_get_admin_page_url( 'account', $params ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.0 - * - * @param string $tab - * @param bool $action - * @param array $params - * @param bool $add_action_nonce - * - * @return string - * - * @uses get_account_url() - */ - function get_account_tab_url( $tab, $action = false, $params = array(), $add_action_nonce = true ) { - $params['tab'] = $tab; - - return $this->get_account_url( $action, $params, $add_action_nonce ); - } - - /** - * Plugin's account URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param bool|string $topic - * @param bool|string $message - * - * @return string - */ - function contact_url( $topic = false, $message = false ) { - $params = array(); - if ( is_string( $topic ) ) { - $params['topic'] = $topic; - } - if ( is_string( $message ) ) { - $params['message'] = $message; - } - - if ( $this->is_addon() ) { - $params['addon_id'] = $this->get_id(); - - return $this->get_parent_instance()->_get_admin_page_url( 'contact', $params ); - } else { - return $this->_get_admin_page_url( 'contact', $params ); - } - } - - /** - * Add-on direct info URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.0 - * - * @param string $slug - * - * @return string - */ - function addon_url( $slug ) { - return $this->_get_admin_page_url( 'addons', array( - 'slug' => $slug - ) ); - } - - /** - * Add-ons URL. - * - * @author Vova Feldman (@svovaf) - * @since 2.4.5 - * - * @return string - */ - function get_addons_url() { - return $this->_get_admin_page_url( 'addons' ); - } - - /* Logger - ------------------------------------------------------------------------------------------------------------------*/ - /** - * @param string $id - * @param bool $prefix_slug - * - * @return FS_Logger - */ - function get_logger( $id = '', $prefix_slug = true ) { - return FS_Logger::get_logger( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id ); - } - - /** - * Note: This method is used externally so don't delete it. - * - * @param $id - * @param bool $load_options - * @param bool $prefix_slug - * - * @return FS_Option_Manager - */ - function get_options_manager( $id, $load_options = false, $prefix_slug = true ) { - return FS_Option_Manager::get_manager( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id, $load_options ); - } - - /* Security - ------------------------------------------------------------------------------------------------------------------*/ - private static function _encrypt( $str ) { - if ( is_null( $str ) ) { - return null; - } - - /** - * The encrypt/decrypt functions are used to protect - * the user from messing up with some of the sensitive - * data stored for the module as a JSON in the database. - * - * I used the same suggested hack by the theme review team. - * For more details, look at the function `Base64UrlDecode()` - * in `./sdk/FreemiusBase.php`. - * - * @todo Remove this hack once the base64 error is removed from the Theme Check. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2 - */ - $fn = 'base64' . '_encode'; - - return $fn( $str ); - } - - static function _decrypt( $str ) { - if ( is_null( $str ) ) { - return null; - } - - /** - * The encrypt/decrypt functions are used to protect - * the user from messing up with some of the sensitive - * data stored for the module as a JSON in the database. - * - * I used the same suggested hack by the theme review team. - * For more details, look at the function `Base64UrlDecode()` - * in `./sdk/FreemiusBase.php`. - * - * @todo Remove this hack once the base64 error is removed from the Theme Check. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2 - */ - $fn = 'base64' . '_decode'; - - return $fn( $str ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param FS_Entity $entity - * - * @return FS_Entity Return an encrypted clone entity. - */ - private static function _encrypt_entity( FS_Entity $entity ) { - $clone = clone $entity; - $props = get_object_vars( $entity ); - - foreach ( $props as $key => $val ) { - $clone->{$key} = self::_encrypt( $val ); - } - - return $clone; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param FS_Entity $entity - * - * @return FS_Entity Return an decrypted clone entity. - */ - private static function decrypt_entity( FS_Entity $entity ) { - $clone = clone $entity; - $props = get_object_vars( $entity ); - - foreach ( $props as $key => $val ) { - $clone->{$key} = self::_decrypt( $val ); - } - - return $clone; - } - - /** - * Tries to activate account based on POST params. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @deprecated Not in use, outdated. - */ - function _activate_account() { - if ( $this->is_registered() ) { - // Already activated. - return; - } - - self::_clean_admin_content_section(); - - if ( fs_request_is_action( 'activate' ) && fs_request_is_post() ) { -// check_admin_referer( 'activate_' . $this->_plugin->public_key ); - - // Verify matching plugin details. - if ( $this->_plugin->id != fs_request_get( 'plugin_id' ) || $this->_slug != fs_request_get( 'plugin_slug' ) ) { - return; - } - - $user = new FS_User(); - $user->id = fs_request_get( 'user_id' ); - $user->public_key = fs_request_get( 'user_public_key' ); - $user->secret_key = fs_request_get( 'user_secret_key' ); - $user->email = fs_request_get( 'user_email' ); - $user->first = fs_request_get( 'user_first' ); - $user->last = fs_request_get( 'user_last' ); - $user->is_verified = fs_request_get_bool( 'user_is_verified' ); - - $site = new FS_Site(); - $site->id = fs_request_get( 'install_id' ); - $site->public_key = fs_request_get( 'install_public_key' ); - $site->secret_key = fs_request_get( 'install_secret_key' ); - $site->plan_id = fs_request_get( 'plan_id' ); - - $plans = array(); - $plans_data = json_decode( urldecode( fs_request_get( 'plans' ) ) ); - foreach ( $plans_data as $p ) { - $plan = new FS_Plugin_Plan( $p ); - if ( $site->plan_id == $plan->id ) { - $plan->title = fs_request_get( 'plan_title' ); - $plan->name = fs_request_get( 'plan_name' ); - } - - $plans[] = $plan; - } - - $this->_set_account( $user, $site, $plans ); - - // Reload the page with the keys. - fs_redirect( $this->_get_admin_page_url() ); - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @param string $email - * - * @return FS_User|false - */ - static function _get_user_by_email( $email ) { - self::$_static_logger->entrance(); - - $email = trim( strtolower( $email ) ); - - $users = self::get_all_users(); - - if ( is_array( $users ) ) { - foreach ( $users as $user ) { - if ( $email === trim( strtolower( $user->email ) ) ) { - return $user; - } - } - } - - return false; - } - - #---------------------------------------------------------------------------------- - #region Account (Loading, Updates & Activation) - #---------------------------------------------------------------------------------- - - /*** - * Load account information (user + site). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - */ - private function _load_account() { - $this->_logger->entrance(); - - $this->do_action( 'before_account_load' ); - - $users = self::get_all_users(); - $plans = self::get_all_plans( $this->_module_type ); - - if ( $this->_logger->is_on() && is_admin() ) { - $this->_logger->log( 'users = ' . var_export( $users, true ) ); - $this->_logger->log( 'plans = ' . var_export( $plans, true ) ); - } - - $site = fs_is_network_admin() ? - $this->get_network_install() : - $this->get_install_by_blog_id(); - - if ( fs_is_network_admin() && - $this->is_network_active() && - ! is_object( $site ) && - FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) - ) { - $first_install = $this->find_first_install(); - - if ( is_null( $first_install ) ) { - unset( $this->_storage->network_install_blog_id ); - } else { - $site = $first_install['install']; - $this->_storage->network_install_blog_id = $first_install['blog_id']; - } - } - - if ( is_object( $site ) && - is_numeric( $site->id ) && - is_numeric( $site->user_id ) && - FS_Plugin_Plan::is_valid_id( $site->plan_id ) - ) { - // Load site. - $this->_site = $site; - - // Load plans. - $this->_plans = $plans[ $this->_slug ]; - if ( ! is_array( $this->_plans ) || empty( $this->_plans ) ) { - $this->_sync_plans(); - } else { - for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { - if ( $this->_plans[ $i ] instanceof FS_Plugin_Plan ) { - $this->_plans[ $i ] = self::decrypt_entity( $this->_plans[ $i ] ); - } else { - unset( $this->_plans[ $i ] ); - } - } - } - } - - $user = null; - if ( fs_is_network_admin() && $this->_is_network_active ) { - $user = $this->get_network_user(); - } - - if ( is_object( $user ) ) { - $this->_user = clone $user; - } else if ( $this->_site ) { - $user = self::_get_user_by_id( $this->_site->user_id ); - - if ( ! is_object( $user ) && FS_User::is_valid_id( $this->_storage->prev_user_id ) ) { - /** - * Try to load the previous owner. This recovery is used for the following use-case: - * 1. Opt-in - * 2. Cloning site1 to site2 - * 3. Ownership switch in site1 (same applies for site2) - * 4. Install data sync on site2 - * 5. Now site2's install is associated with the new owner which does not exists locally. - */ - $user = self::_get_user_by_id( $this->_storage->prev_user_id ); - } - - if ( ! is_object( $user ) ) { - /** - * This is a special fault tolerance mechanism to handle a scenario that the user data is missing. - */ - $user = $this->sync_user_by_current_install(); - } - - $this->_user = ( $user instanceof FS_User ) ? - clone $user : - null; - } - - if ( is_object( $this->_user ) ) { - // Load licenses. - $this->_licenses = $this->get_user_licenses( $this->_user->id ); - } - - if ( is_object( $this->_site ) ) { - $this->_license = $this->_get_license_by_id( $this->_site->license_id ); - - if ( $this->_site->version != $this->get_plugin_version() ) { - // If stored install version is different than current installed plugin version, - // then update plugin version event. - $this->update_plugin_version_event(); - } - } - - if ( true === $this->_storage->require_license_activation && - ! fs_request_get_bool( 'require_license', true ) - ) { - $this->_storage->require_license_activation = false; - } - - if ( $this->is_theme() ) { - $this->_register_account_hooks(); - } - } - - /** - * Special user recovery mechanism. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number|null $site_user_id - * - * @return \FS_User|mixed - */ - private function sync_user_by_current_install( $site_user_id = null ) { - $site_user_id = FS_Site::is_valid_id( $site_user_id ) ? - $site_user_id : - $this->_site->user_id; - - $api = $this->get_api_site_scope(); - - $uid = $this->get_anonymous_id(); - $request_path = "/users/{$site_user_id}.json?uid={$uid}"; - - $result = $api->get( $request_path, false, WP_FS__TIME_10_MIN_IN_SEC ); - - if ( $this->is_api_result_entity( $result ) ) { - $user = new FS_User( $result ); - $this->_user = $user; - $this->_store_user(); - - return $user; - } - - $error_code = FS_Api::get_error_code( $result ); - - if ( in_array( $error_code, array( 'invalid_unique_id', 'user_cannot_be_recovered' ) ) ) { - /** - * Those API errors will continue coming and are not recoverable with the - * current site's data. Therefore, extend the API call's cached result to 7 days. - */ - $api->update_cache_expiration( $request_path, WP_FS__TIME_WEEK_IN_SEC ); - } - - return $result; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param FS_User $user - * @param FS_Site $site - * @param bool|array $plans - */ - private function _set_account( FS_User $user, FS_Site $site, $plans = false ) { - $site->user_id = $user->id; - - $this->_site = $site; - $this->_user = $user; - if ( false !== $plans ) { - $this->_plans = $plans; - } - - $this->send_install_update(); - - $this->_store_account(); - - } - - /** - * Get a sanitized array with the WordPress version, SDK version, and PHP version. - * Each version is trimmed after the 16th char. - * - * @author Vova Feldman (@svovaf) - * @since 2.2.1 - * - * @return array - */ - private function get_versions() { - $versions = array(); - $versions['platform_version'] = get_bloginfo( 'version' ); - $versions['sdk_version'] = $this->version; - $versions['programming_language_version'] = phpversion(); - - foreach ( $versions as $k => $version ) { - if ( is_string( $versions[ $k ] ) && ! empty( $versions[ $k ] ) ) { - $versions[ $k ] = substr( $versions[ $k ], 0, 16 ); - } - } - - return $versions; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @return bool - */ - function has_beta_update() { - return ( - ! empty( $this->_storage->beta_data ) && - ( true === $this->_storage->beta_data['is_beta'] ) && - version_compare( $this->_storage->beta_data['version'], $this->get_plugin_version(), '>' ) - ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @return bool - */ - function is_beta() { - return ( - ! empty( $this->_storage->beta_data ) && - ( true === $this->_storage->beta_data['is_beta'] ) && - ( $this->get_plugin_version() === $this->_storage->beta_data['version'] ) - ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - private function sync_user_beta_mode() { - $user = $this->get_api_user_scope()->get( '/?plugin_id=' . $this->get_id() . '&fields=is_beta' ); - - if ( $this->is_api_result_entity( $user ) ) { - $this->_user->is_beta = $user->is_beta; - $this->_store_user(); - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @param array $override_with - * @param bool|int|null $network_level_or_blog_id If true, return params for network level opt-in. If integer, get params for specified blog in the network. - * - * @return array - */ - function get_opt_in_params( $override_with = array(), $network_level_or_blog_id = null ) { - $this->_logger->entrance(); - - $current_user = self::_get_current_wp_user(); - - $activation_action = $this->get_unique_affix() . '_activate_new'; - $return_url = $this->is_anonymous() ? - // If skipped already, then return to the account page. - $this->get_account_url( $activation_action, array(), false ) : - // Return to the module's main page. - $this->get_after_activation_url( 'after_connect_url', array( 'fs_action' => $activation_action ) ); - - $versions = $this->get_versions(); - - $params = array_merge( $versions, array( - 'user_firstname' => $current_user->user_firstname, - 'user_lastname' => $current_user->user_lastname, - 'user_nickname' => $current_user->user_nicename, - 'user_email' => $current_user->user_email, - 'user_ip' => WP_FS__REMOTE_ADDR, - 'plugin_slug' => $this->_slug, - 'plugin_id' => $this->get_id(), - 'plugin_public_key' => $this->get_public_key(), - 'plugin_version' => $this->get_plugin_version(), - 'return_url' => fs_nonce_url( $return_url, $activation_action ), - 'account_url' => fs_nonce_url( $this->_get_admin_page_url( - 'account', - array( 'fs_action' => 'sync_user' ) - ), 'sync_user' ), - 'is_premium' => $this->is_premium(), - 'is_active' => true, - 'is_uninstalled' => false, - ) ); - - if ( $this->is_addon() ) { - $parent_fs = $this->get_parent_instance(); - - $params['parent_plugin_slug'] = $parent_fs->_slug; - $params['parent_plugin_id'] = $parent_fs->get_id(); - } - - if ( true === $network_level_or_blog_id ) { - if ( ! isset( $override_with['sites'] ) ) { - $params['sites'] = $this->get_sites_for_network_level_optin(); - } - } else { - $site = is_numeric( $network_level_or_blog_id ) ? - array( 'blog_id' => $network_level_or_blog_id ) : - null; - - $site = $this->get_site_info( $site ); - - $params = array_merge( $params, array( - 'site_uid' => $site['uid'], - 'site_url' => $site['url'], - 'site_name' => $site['title'], - 'language' => $site['language'], - 'charset' => $site['charset'], - ) ); - } - - if ( $this->is_pending_activation() && - ! empty( $this->_storage->pending_license_key ) - ) { - $params['license_key'] = $this->_storage->pending_license_key; - } - - if ( WP_FS__SKIP_EMAIL_ACTIVATION && $this->has_secret_key() ) { - // Even though rand() is known for its security issues, - // the timestamp adds another layer of protection. - // It would be very hard for an attacker to get the secret key form here. - // Plus, this should never run in production since the secret should never - // be included in the production version. - $params['ts'] = WP_FS__SCRIPT_START_TIME; - $params['salt'] = md5( uniqid( rand() ) ); - $params['secure'] = md5( - $params['ts'] . - $params['salt'] . - $this->get_secret_key() - ); - } - - return array_merge( $params, $override_with ); - } - - /** - * 1. If successful opt-in or pending activation returns the next page that the user should be redirected to. - * 2. If there was an API error, return the API result. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @param string|bool $email - * @param string|bool $first - * @param string|bool $last - * @param string|bool $license_key - * @param bool $is_uninstall If "true", this means that the module is currently being uninstalled. - * In this case, the user and site info will be sent to the server but no - * data will be saved to the WP installation's database. - * @param number|bool $trial_plan_id - * @param bool $is_disconnected Whether or not to opt in without tracking. - * @param null|bool $is_marketing_allowed - * @param array $sites If network-level opt-in, an array of containing details of sites. - * - * @return string|object - * @use WP_Error - */ - function opt_in( - $email = false, - $first = false, - $last = false, - $license_key = false, - $is_uninstall = false, - $trial_plan_id = false, - $is_disconnected = false, - $is_marketing_allowed = null, - $sites = array() - ) { - $this->_logger->entrance(); - - if ( false === $email ) { - $current_user = self::_get_current_wp_user(); - $email = $current_user->user_email; - } - - /** - * @since 1.2.1 If activating with license key, ignore the context-user - * since the user will be automatically loaded from the license. - */ - if ( empty( $license_key ) ) { - // Clean up pending license if opt-ing in again. - $this->_storage->remove( 'pending_license_key' ); - - if ( ! $is_uninstall ) { - $fs_user = Freemius::_get_user_by_email( $email ); - if ( is_object( $fs_user ) && ! $this->is_pending_activation() ) { - return $this->install_with_user( - $fs_user, - false, - $trial_plan_id, - true, - true, - $sites - ); - } - } - } - - $user_info = array(); - if ( ! empty( $email ) ) { - $user_info['user_email'] = $email; - } - if ( ! empty( $first ) ) { - $user_info['user_firstname'] = $first; - } - if ( ! empty( $last ) ) { - $user_info['user_lastname'] = $last; - } - - if ( ! empty( $sites ) ) { - $is_network = true; - - $user_info['sites'] = $sites; - } else { - $is_network = false; - } - - $params = $this->get_opt_in_params( $user_info, $is_network ); - - $filtered_license_key = false; - if ( is_string( $license_key ) ) { - $filtered_license_key = $this->apply_filters( 'license_key', $license_key ); - $params['license_key'] = $filtered_license_key; - } else if ( FS_Plugin_Plan::is_valid_id( $trial_plan_id ) ) { - $params['trial_plan_id'] = $trial_plan_id; - } - - if ( $is_uninstall ) { - $params['uninstall_params'] = array( - 'reason_id' => $this->_storage->uninstall_reason->id, - 'reason_info' => $this->_storage->uninstall_reason->info - ); - } - - if ( isset( $params['license_key'] ) ) { - $fs_user = Freemius::_get_user_by_email( $email ); - - if ( is_object( $fs_user ) ) { - /** - * If opting in with a context license and the context WP Admin user already opted in - * before from the current site, add the user context security params to avoid the - * unnecessary email activation when the context license is owned by the same context user. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - */ - $params = array_merge( $params, FS_Security::instance()->get_context_params( - $fs_user, - false, - 'install_with_existing_user' - ) ); - } - } - - if ( is_bool( $is_marketing_allowed ) ) { - $params['is_marketing_allowed'] = $is_marketing_allowed; - } - - $params['is_disconnected'] = $is_disconnected; - $params['format'] = 'json'; - - $request = array( - 'method' => 'POST', - 'body' => $params, - 'timeout' => WP_FS__DEBUG_SDK ? 60 : 30, - ); - - $url = $this->add_show_pending( WP_FS__ADDRESS . '/action/service/user/install/' ); - $response = self::safe_remote_post( $url, $request ); - - if ( is_wp_error( $response ) ) { - /** - * @var WP_Error $response - */ - $result = new stdClass(); - - $error_code = $response->get_error_code(); - $error_type = str_replace( ' ', '', ucwords( str_replace( '_', ' ', $error_code ) ) ); - - $result->error = (object) array( - 'type' => $error_type, - 'message' => $response->get_error_message(), - 'code' => $error_code, - 'http' => 402 - ); - - $this->maybe_modify_api_curl_error_message( $result ); - - return $result; - } - - // Module is being uninstalled, don't handle the returned data. - if ( $is_uninstall ) { - return true; - } - - /** - * When json_decode() executed on PHP 5.2 with an invalid JSON, it will throw a PHP warning. Unfortunately, the new Theme Check doesn't allow PHP silencing and the theme review team isn't open to change that, therefore, instead of using `@json_decode()` we had to use the method without the `@` directive. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.3 - * @link https://themes.trac.wordpress.org/ticket/46134#comment:5 - * @link https://themes.trac.wordpress.org/ticket/46134#comment:9 - * @link https://themes.trac.wordpress.org/ticket/46134#comment:12 - * @link https://themes.trac.wordpress.org/ticket/46134#comment:14 - */ - $decoded = is_string( $response['body'] ) ? - json_decode( $response['body'] ) : - null; - - if ( empty( $decoded ) ) { - return false; - } - - if ( ! $this->is_api_result_object( $decoded ) ) { - if ( ! empty( $params['license_key'] ) ) { - // Pass the fully entered license key to the failure handler. - $params['license_key'] = $license_key; - } - - return $is_uninstall ? - $decoded : - $this->apply_filters( 'after_install_failure', $decoded, $params ); - } else if ( isset( $decoded->pending_activation ) && $decoded->pending_activation ) { - if ( $is_network ) { - $site_ids = array(); - foreach ( $sites as $site ) { - $site_ids[] = $site['blog_id']; - } - - /** - * Store the sites so that they can be installed once the user has clicked on the activation link - * in the email. - * - * @author Leo Fajardo (@leorw) - */ - $this->_storage->pending_sites_info = array( - 'blog_ids' => $site_ids, - 'license_key' => $license_key, - 'trial_plan_id' => $trial_plan_id - ); - } - - // Pending activation, add message. - return $this->set_pending_confirmation( - ( isset( $decoded->email ) ? - $decoded->email : - true ), - false, - $filtered_license_key, - ! empty( $params['trial_plan_id'] ) - ); - } else if ( isset( $decoded->install_secret_key ) ) { - return $this->install_with_new_user( - $decoded->user_id, - $decoded->user_public_key, - $decoded->user_secret_key, - ( isset( $decoded->is_marketing_allowed ) && ! is_null( $decoded->is_marketing_allowed ) ? - $decoded->is_marketing_allowed : - null ), - ( isset( $decoded->is_extensions_tracking_allowed ) && ! is_null( $decoded->is_extensions_tracking_allowed ) ? - $decoded->is_extensions_tracking_allowed : - null ), - $decoded->install_id, - $decoded->install_public_key, - $decoded->install_secret_key, - false - ); - } else if ( is_array( $decoded->installs ) ) { - return $this->install_many_with_new_user( - $decoded->user_id, - $decoded->user_public_key, - $decoded->user_secret_key, - ( isset( $decoded->is_marketing_allowed ) && ! is_null( $decoded->is_marketing_allowed ) ? - $decoded->is_marketing_allowed : - null ), - ( isset( $decoded->is_extensions_tracking_allowed ) && ! is_null( $decoded->is_extensions_tracking_allowed ) ? - $decoded->is_extensions_tracking_allowed : - null ), - $decoded->installs, - false - ); - } - - return $decoded; - } - - /** - * Set user and site identities. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param FS_User $user - * @param FS_Site $site - * @param bool $redirect - * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will - * redirect (or return a URL) to the account page with a special parameter to - * trigger the auto installation processes. - * - * @return string If redirect is `false`, returns the next page the user should be redirected to. - */ - function setup_account( - FS_User $user, - FS_Site $site, - $redirect = true, - $auto_install = false - ) { - return $this->setup_network_account( - $user, - array( $site ), - $redirect, - $auto_install, - false - ); - } - - /** - * Set user and site identities. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param FS_User $user - * @param FS_Site[] $installs - * @param bool $redirect - * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes. - * @param bool $is_network_level_opt_in - * - * @return string If redirect is `false`, returns the next page the user should be redirected to. - */ - function setup_network_account( - FS_User $user, - array $installs, - $redirect = true, - $auto_install = false, - $is_network_level_opt_in = true - ) { - $first_install = $installs[0]; - - $this->_user = $user; - $this->_site = $first_install; - - $this->_sync_plans(); - - if ( $this->_storage->handle_gdpr_admin_notice && - $this->should_handle_gdpr_admin_notice() && - FS_GDPR_Manager::instance()->should_show_opt_in_notice() - ) { - /** - * Clear user lock after an opt-in. - */ - require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; - FS_User_Lock::instance()->unlock(); - } - - if ( 1 < count( $installs ) ) { - // Only network level opt-in can have more than one install. - $is_network_level_opt_in = true; - } -// $is_network_level_opt_in = self::is_ajax_action_static( 'network_activate', $this->_module_id ); - // If Freemius was OFF before, turn it on. - $this->turn_on(); - - $this->handle_account_connection( - $installs, - ( ! $this->_is_network_active || ! $is_network_level_opt_in ) - ); - - if ( is_numeric( $first_install->license_id ) ) { - $this->set_license( $this->_get_license_by_id( $first_install->license_id ) ); - } - - $this->_admin_notices->remove_sticky( 'connect_account' ); - - if ( $this->is_pending_activation() || ! $this->has_settings_menu() ) { - // Remove pending activation sticky notice (if still exist). - $this->_admin_notices->remove_sticky( 'activation_pending' ); - - // Remove plugin from pending activation mode. - unset( $this->_storage->is_pending_activation ); - - if ( ! $this->is_paying_or_trial() ) { - $this->_admin_notices->add_sticky( - sprintf( $this->get_text_inline( '%s activation was successfully completed.', 'plugin-x-activation-message' ), '' . $this->get_plugin_name() . '' ), - 'activation_complete' - ); - } - } - - if ( $this->is_paying_or_trial() ) { - if ( ! $this->is_premium() || - ! $this->has_premium_version() || - ! $this->has_settings_menu() - ) { - if ( $this->is_paying() ) { - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( 'Your account was successfully activated with the %s plan.', 'activation-with-plan-x-message' ), - $this->get_plan_title() - ) . $this->get_complete_upgrade_instructions(), - 'plan_upgraded', - $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' - ); - } else { - $trial_plan = $this->get_trial_plan(); - - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( 'Your trial has been successfully started.', 'trial-started-message' ), - '' . $this->get_plugin_name() . '' - ) . $this->get_complete_upgrade_instructions( $trial_plan->title ), - 'trial_started', - $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' - ); - } - } - - $this->_admin_notices->remove_sticky( array( - 'trial_promotion', - ) ); - } - - $plugin_id = fs_request_get( 'plugin_id', false ); - - // Store activation time ONLY for plugins & themes (not add-ons). - if ( ! is_numeric( $plugin_id ) || ( $plugin_id == $this->_plugin->id ) ) { - if ( empty( $this->_storage->activation_timestamp ) ) { - $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME; - } - } - - $next_page = ''; - - $extra = array(); - if ( $auto_install ) { - $extra['auto_install'] = 'true'; - } - - if ( is_numeric( $plugin_id ) ) { - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.1.6 - * - * Also sync the license after an anonymous user subscribes. - */ - if ( $this->is_anonymous() || $plugin_id != $this->_plugin->id ) { - // Add-on was installed - sync license right after install. - $next_page = $this->_get_sync_license_url( $plugin_id, true, $extra ); - } - } else { - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.9 If site installed with a valid license, sync license. - */ - if ( $this->is_paying() ) { - $this->_sync_plugin_license( - true, - // Installs data is already synced in the beginning of this method directly or via _set_account(). - false - ); - } - - // Reload the page with the keys. - $next_page = $this->is_anonymous() ? - // If user previously skipped, redirect to account page. - $this->get_account_url( false, $extra ) : - $this->get_after_activation_url( 'after_connect_url', array(), $is_network_level_opt_in ); - } - - if ( ! empty( $next_page ) && $redirect ) { - fs_redirect( $next_page ); - } - - return $next_page; - } - - /** - * Install plugin with new user information after approval. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - */ - function _install_with_new_user() { - $this->_logger->entrance(); - - if ( $this->is_registered() ) { - return; - } - - if ( ( $this->is_plugin() && fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) || - // @todo This logic should be improved because it's executed on every load of a theme. - $this->is_theme() - ) { -// check_admin_referer( $this->_slug . '_activate_new' ); - - if ( fs_request_has( 'user_secret_key' ) ) { - if ( fs_is_network_admin() && isset( $this->_storage->pending_sites_info ) ) { - $pending_sites_info = $this->_storage->pending_sites_info; - - $this->install_many_pending_with_user( - fs_request_get( 'user_id' ), - fs_request_get( 'user_public_key' ), - fs_request_get( 'user_secret_key' ), - fs_request_get_bool( 'is_marketing_allowed', null ), - fs_request_get_bool( 'is_extensions_tracking_allowed', null ), - $pending_sites_info['blog_ids'], - $pending_sites_info['license_key'], - $pending_sites_info['trial_plan_id'] - ); - } else { - $this->install_with_new_user( - fs_request_get( 'user_id' ), - fs_request_get( 'user_public_key' ), - fs_request_get( 'user_secret_key' ), - fs_request_get_bool( 'is_marketing_allowed', null ), - fs_request_get_bool( 'is_extensions_tracking_allowed', null ), - fs_request_get( 'install_id' ), - fs_request_get( 'install_public_key' ), - fs_request_get( 'install_secret_key' ), - true, - fs_request_get_bool( 'auto_install' ) - ); - } - } else if ( fs_request_has( 'pending_activation' ) ) { - $this->set_pending_confirmation( fs_request_get( 'user_email' ), true ); - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $id - * @param string $public_key - * @param string $secret_key - * - * @return \FS_User - */ - private function setup_user( $id, $public_key, $secret_key ) { - $user = self::_get_user_by_id( $id ); - - if ( is_object( $user ) ) { - $this->_user = $user; - } else { - $user = new FS_User(); - $user->id = $id; - $user->public_key = $public_key; - $user->secret_key = $secret_key; - - $this->_user = $user; - $user_result = $this->get_api_user_scope()->get(); - $user = new FS_User( $user_result ); - - $this->_user = $user; - $this->_store_user(); - } - - return $user; - } - - /** - * Install plugin with new user. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @param number $user_id - * @param string $user_public_key - * @param string $user_secret_key - * @param bool|null $is_marketing_allowed - * @param bool|null $is_extensions_tracking_allowed Since 2.3.2 - * @param number $install_id - * @param string $install_public_key - * @param string $install_secret_key - * @param bool $redirect - * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes. - * - * @return string If redirect is `false`, returns the next page the user should be redirected to. - */ - private function install_with_new_user( - $user_id, - $user_public_key, - $user_secret_key, - $is_marketing_allowed, - $is_extensions_tracking_allowed, - $install_id, - $install_public_key, - $install_secret_key, - $redirect = true, - $auto_install = false - ) { - /** - * This method is also executed after opting in with a license key since the - * license can be potentially associated with a different owner. - * - * @since 2.0.0 - */ - $user = self::_get_user_by_id( $user_id ); - - if ( ! is_object( $user ) ) { - $user = new FS_User(); - $user->id = $user_id; - $user->public_key = $user_public_key; - $user->secret_key = $user_secret_key; - - $this->_user = $user; - $user_result = $this->get_api_user_scope()->get(); - $user = new FS_User( $user_result ); - } - - $this->_user = $user; - - $site = new FS_Site(); - $site->id = $install_id; - $site->public_key = $install_public_key; - $site->secret_key = $install_secret_key; - - $this->_site = $site; - $site_result = $this->get_api_site_scope()->get(); - $site = new FS_Site( $site_result ); - $this->_site = $site; - - if ( ! is_null( $is_marketing_allowed ) ) { - $this->disable_opt_in_notice_and_lock_user(); - } - - if ( ! is_null( $is_extensions_tracking_allowed ) ) { - $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); - } - - return $this->setup_account( - $this->_user, - $this->_site, - $redirect, - $auto_install - ); - } - - /** - * Install plugin with user. - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param number $user_id - * @param string $user_public_key - * @param string $user_secret_key - * @param bool|null $is_marketing_allowed - * @param bool|null $is_extensions_tracking_allowed Since 2.3.2 - * @param array $site_ids - * @param bool $license_key - * @param bool $trial_plan_id - * @param bool $redirect - * - * @return string If redirect is `false`, returns the next page the user should be redirected to. - */ - private function install_many_pending_with_user( - $user_id, - $user_public_key, - $user_secret_key, - $is_marketing_allowed, - $is_extensions_tracking_allowed, - $site_ids, - $license_key = false, - $trial_plan_id = false, - $redirect = true - ) { - $user = $this->setup_user( $user_id, $user_public_key, $user_secret_key ); - - if ( ! is_null( $is_marketing_allowed ) ) { - $this->disable_opt_in_notice_and_lock_user(); - } - - if ( ! is_null( $is_extensions_tracking_allowed ) ) { - $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); - } - - $sites = array(); - foreach ( $site_ids as $site_id ) { - $sites[] = $this->get_site_info( array( 'blog_id' => $site_id ) ); - } - - $this->install_with_user( $user, $license_key, $trial_plan_id, $redirect, true, $sites ); - } - - /** - * Multi-site install with a new user. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $user_id - * @param string $user_public_key - * @param string $user_secret_key - * @param bool|null $is_marketing_allowed - * @param bool|null $is_extensions_tracking_allowed Since 2.3.2 - * @param object[] $installs - * @param bool $redirect - * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes. - * - * @return string If redirect is `false`, returns the next page the user should be redirected to. - */ - private function install_many_with_new_user( - $user_id, - $user_public_key, - $user_secret_key, - $is_marketing_allowed, - $is_extensions_tracking_allowed, - array $installs, - $redirect = true, - $auto_install = false - ) { - $this->setup_user( $user_id, $user_public_key, $user_secret_key ); - - if ( ! is_null( $is_marketing_allowed ) ) { - $this->disable_opt_in_notice_and_lock_user(); - } - - if ( ! is_null( $is_extensions_tracking_allowed ) ) { - $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); - } - - $install_ids = array(); - - foreach ( $installs as $install ) { - $install_ids[] = $install->id; - } - - $left = count( $install_ids ); - $offset = 0; - - $installs = array(); - while ( $left > 0 ) { - $result = $this->get_api_user_scope()->get( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', array_slice( $install_ids, $offset, 25 ) ) ); - - if ( ! $this->is_api_result_object( $result, 'installs' ) ) { - // @todo Handle API error. - } - - $installs = array_merge( $installs, $result->installs ); - - $left -= 25; - } - - foreach ( $installs as &$install ) { - $install = new FS_Site( $install ); - } - - return $this->setup_network_account( - $this->_user, - $installs, - $redirect, - $auto_install - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @param string|bool $email - * @param bool $redirect - * @param string|bool $license_key Since 1.2.1.5 - * @param bool $is_pending_trial Since 1.2.1.5 - * - * @return string Since 1.2.1.5 if $redirect is `false`, return the pending activation page. - */ - private function set_pending_confirmation( - $email = false, - $redirect = true, - $license_key = false, - $is_pending_trial = false - ) { - if ( $this->_ignore_pending_mode ) { - /** - * If explicitly asked to ignore pending mode, set to anonymous mode - * if require confirmation before finalizing the opt-in. - * - * @author Vova Feldman - * @since 1.2.1.6 - */ - $this->skip_connection( null, fs_is_network_admin() ); - } else { - // Install must be activated via email since - // user with the same email already exist. - $this->_storage->is_pending_activation = true; - $this->_add_pending_activation_notice( $email, $is_pending_trial ); - } - - if ( ! empty( $license_key ) ) { - $this->_storage->pending_license_key = $license_key; - } - - // Remove the opt-in sticky notice. - $this->_admin_notices->remove_sticky( array( - 'connect_account', - 'trial_promotion', - ) ); - - $next_page = $this->get_after_activation_url( 'after_pending_connect_url' ); - - // Reload the page with with pending activation message. - if ( $redirect ) { - fs_redirect( $next_page ); - } - - return $next_page; - } - - /** - * Install plugin with current logged WP user info. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - */ - function _install_with_current_user() { - $this->_logger->entrance(); - - if ( $this->is_registered() ) { - return; - } - - if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) && fs_request_is_post() ) { -// check_admin_referer( 'activate_existing_' . $this->_plugin->public_key ); - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.9 Add license key if given. - */ - $license_key = fs_request_get( 'license_secret_key' ); - - $this->update_extensions_tracking_flag( fs_request_get_bool( 'is_extensions_tracking_allowed', true ) ); - - $this->install_with_current_user( $license_key ); - } - } - - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @param string|bool $license_key - * @param number|bool $trial_plan_id - * @param array $sites Since 2.0.0 - * @param bool $redirect - * - * @return object|string If redirect is `false`, returns the next page the user should be redirected to, or the API error object if failed to install. - */ - private function install_with_current_user( - $license_key = false, - $trial_plan_id = false, - $sites = array(), - $redirect = true - ) { - // Get current logged WP user. - $current_user = self::_get_current_wp_user(); - - // Find the relevant FS user by the email. - $user = self::_get_user_by_email( $current_user->user_email ); - - return $this->install_with_user( $user, $license_key, $trial_plan_id, $redirect, true, $sites ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_User $user - * @param string|bool $license_key - * @param number|bool $trial_plan_id - * @param bool $redirect - * @param bool $setup_account Since 2.0.0. When set to FALSE, executes a light installation without setting up the account as if it's the first opt-in. - * @param array $sites Since 2.0.0. If not empty, should be a collection of site details for the bulk install API request. - * - * @return \FS_Site|object|string If redirect is `false`, returns the next page the user should be redirected to, or the API error object if failed to install. If $setup_account is set to `false`, return the newly created install. - */ - function install_with_user( - FS_User $user, - $license_key = false, - $trial_plan_id = false, - $redirect = true, - $setup_account = true, - $sites = array() - ) { - // We have to set the user before getting user scope API handler. - $this->_user = $user; - - // Install the plugin. - $result = $this->create_installs_with_user( - $user, - $license_key, - $trial_plan_id, - $sites, - $redirect - ); - - if ( ! $this->is_api_result_entity( $result ) && - ! $this->is_api_result_object( $result, 'installs' ) - ) { - // @todo Handler potential API error of the $result - } - - if ( empty( $sites ) ) { - $site = new FS_Site( $result ); - $this->_site = $site; - - if ( ! $setup_account ) { - $this->_store_site(); - - $this->sync_plan_if_not_exist( $site->plan_id ); - - if ( ! empty( $license_key ) && FS_Plugin_License::is_valid_id( $site->license_id ) ) { - $this->sync_license_if_not_exist( $site->license_id, $license_key ); - } - - $this->_admin_notices->remove_sticky( 'connect_account', false ); - - return $site; - } - - return $this->setup_account( $this->_user, $this->_site, $redirect ); - } else { - $installs = array(); - foreach ( $result->installs as $install ) { - $installs[] = new FS_Site( $install ); - } - - return $this->setup_network_account( - $user, - $installs, - $redirect - ); - } - } - - /** - * Initiate an API request to create a collection of installs. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_User $user - * @param bool $license_key - * @param bool $trial_plan_id - * @param array $sites - * @param bool $redirect - * @param bool $silent - * - * @return object|mixed - */ - private function create_installs_with_user( - FS_User $user, - $license_key = false, - $trial_plan_id = false, - $sites = array(), - $redirect = false, - $silent = false - ) { - $extra_install_params = array( - 'uid' => $this->get_anonymous_id(), - 'is_disconnected' => false, - ); - - if ( ! empty( $license_key ) ) { - $extra_install_params['license_key'] = $this->apply_filters( 'license_key', $license_key ); - - if ( $silent ) { - $extra_install_params['ignore_license_owner'] = true; - } - } else if ( FS_Plugin_Plan::is_valid_id( $trial_plan_id ) ) { - $extra_install_params['trial_plan_id'] = $trial_plan_id; - } - - if ( ! empty( $sites ) ) { - $extra_install_params['sites'] = $sites; - } - - $args = $this->get_install_data_for_api( $extra_install_params, false, false ); - - // Install the plugin. - $result = $this->get_api_user_scope_by_user( $user )->call( - "/plugins/{$this->get_id()}/installs.json", - 'post', - $args - ); - - if ( ! $this->is_api_result_entity( $result ) && - ! $this->is_api_result_object( $result, 'installs' ) - ) { - if ( ! empty( $args['license_key'] ) ) { - // Pass the fully entered license key to the failure handler. - $args['license_key'] = $license_key; - } - - $result = $this->apply_filters( 'after_install_failure', $result, $args ); - - if ( ! $silent ) { - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' . - $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '' . $result->error->message . '', - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error' - ); - } - - if ( $redirect ) { - /** - * We set the user before getting the user scope API handler, so the user became temporarily - * registered (`is_registered() = true`). Since the API returned an error and we will redirect, - * we have to set the user to `null`, otherwise, the user will be redirected to the wrong - * activation page based on the return value of `is_registered()`. In addition, in case the - * context plugin doesn't have a settings menu and the default page is the `Plugins` page, - * misleading plugin activation errors will be shown on the `Plugins` page. - * - * @author Leo Fajardo (@leorw) - */ - $this->_user = null; - - fs_redirect( $this->get_activation_url( array( 'error' => $result->error->message ) ) ); - } - } - - return $result; - } - - /** - * Tries to activate add-on account based on parent plugin info. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param Freemius $parent_fs - * @param bool|int|null $network_level_or_blog_id True for network level opt-in and integer for opt-in for specified blog in the network. - * @param FS_Plugin_License $bundle_license Since 2.4.0. If provided, this license will be activated for the add-on. - */ - private function _activate_addon_account( - Freemius $parent_fs, - $network_level_or_blog_id = null, - FS_Plugin_License $bundle_license = null - ) { - if ( $this->is_registered() ) { - // Already activated. - return; - } - - /** - * Do not override the `uid` if network-level opt-in since the call to `get_sites_for_network_level_optin()` - * already returns the data for the current blog. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - $uid_param_to_override = ( true === $network_level_or_blog_id ) ? - array() : - array( 'uid' => $this->get_anonymous_id() ); - - $params = $this->get_install_data_for_api( - $uid_param_to_override, - false, - false, - /** - * Do not include the data for the current blog if network-level opt-in since the call to `get_sites_for_network_level_optin` - * already includes the data for it. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - ( true !== $network_level_or_blog_id ) - ); - - if ( true === $network_level_or_blog_id ) { - $params['sites'] = $this->get_sites_for_network_level_optin(); - - if ( empty( $params['sites'] ) ) { - return; - } - } - - if ( is_object( $bundle_license ) ) { - $params['license_key'] = $bundle_license->secret_key; - } - - // Activate add-on with parent plugin credentials. - $result = $parent_fs->get_api_site_scope()->call( - "/addons/{$this->_plugin->id}/installs.json", - 'post', - $params - ); - - if ( ! $this->is_api_result_object( $result, 'installs' ) ) { - if ( is_object( $bundle_license ) ) { - /** - * When a license object is provided, it's an attempt by the SDK to activate a bundle license and not a user-initiated action, therefore, do not show any admin notice to avoid confusion (e.g.: the notice will show up just above the opt-in link). If the license activation fails, the admin will see an opt-in link instead. - * - * @author Leo Fajardo (@leorw) - * @since 2.4.0 - */ - } else { - $error_message = FS_Api::is_api_error_object( $result ) ? - $result->error->message : - $this->get_text_inline( 'An unknown error has occurred.', 'unknown-error' ); - - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' . - $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '' . $error_message . '', - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error' - ); - } - - return; - } - - $addon_installs = $result->installs; - foreach ( $addon_installs as $key => $addon_install ) { - $addon_installs[ $key ] = new FS_Site( $addon_install ); - } - - $first_install = $addon_installs[0]; - - // Get user information based on parent's plugin. - $user = $parent_fs->get_user(); - - // First of all, set site and user info - otherwise we won't - // be able to invoke API calls. - $this->_site = $first_install; - $this->_user = $user; - - // Sync add-on plans. - $this->_sync_plans(); - - $this->handle_account_connection( $addon_installs, ! fs_is_network_admin() ); - - // Get site's current plan. - //$this->_site->plan = $this->_get_plan_by_id( $this->_site->plan->id ); - - // Sync licenses. - $this->_sync_licenses(); - - if ( ! fs_is_network_admin() ) { - // Try to activate premium license. - $this->_activate_license( true, $bundle_license ); - - if ( is_object( $bundle_license ) ) { - $this->maybe_activate_bundle_license( $bundle_license ); - } - } else { - if ( is_object( $bundle_license ) ) { - $premium_license = $bundle_license; - } else { - $license_id = fs_request_get( 'license_id' ); - - if ( is_object( $this->_site ) && - FS_Plugin_License::is_valid_id( $license_id ) && - $license_id == $this->_site->license_id - ) { - // License is already activated. - return; - } - - $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ? - $this->_get_license_by_id( $license_id ) : - $this->_get_available_premium_license(); - } - - if ( is_object( $premium_license ) ) { - $this->maybe_network_activate_addon_license( $premium_license ); - } - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param FS_Site[] $installs - * @param bool $is_site_level - */ - private function handle_account_connection( $installs, $is_site_level ) { - $first_install = $installs[0]; - - if ( $is_site_level ) { - $this->_set_account( $this->_user, $first_install ); - - $this->do_action( 'after_account_connection', $this->_user, $first_install ); - } else { - $this->_store_user(); - - // Map site addresses to their blog IDs. - $address_to_blog_map = $this->get_address_to_blog_map(); - - $first_blog_id = null; - $blog_2_install_map = array(); - foreach ( $installs as $install ) { - $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); - $blog_id = $address_to_blog_map[ $address ]; - - $this->_store_site( true, $blog_id, $install ); - - if ( is_null( $first_blog_id ) ) { - $first_blog_id = $blog_id; - } - - $blog_2_install_map[ $blog_id ] = $install; - } - - if ( ! FS_User::is_valid_id( $this->_storage->network_user_id ) || - ! is_object( self::_get_user_by_id( $this->_storage->network_user_id ) ) - ) { - // Store network user. - $this->_storage->network_user_id = $this->_user->id; - } - - if ( ! FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ) { - $this->_storage->network_install_blog_id = $first_blog_id; - } - - if ( count( $installs ) === count( $address_to_blog_map ) ) { - // Super admin opted in for all sites in the network. - $this->_storage->is_network_connected = true; - } - - $this->_store_licenses( false ); - - self::$_accounts->store(); - - // Don't sync the installs data on network upgrade - if ( ! $this->network_upgrade_mode_completed() ) { - $this->send_installs_update(); - } - - // Switch install context back to the first install. - $this->_site = $first_install; - - $current_blog = get_current_blog_id(); - - foreach ( $blog_2_install_map as $blog_id => $install ) { - $this->switch_to_blog( $blog_id ); - - $this->do_action( 'after_account_connection', $this->_user, $install ); - } - - $this->switch_to_blog( $current_blog ); - - $this->do_action( 'after_network_account_connection', $this->_user, $blog_2_install_map ); - } - } - - /** - * Tries to activate parent account based on add-on's info. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @param Freemius $parent_fs - */ - private function activate_parent_account( Freemius $parent_fs ) { - if ( ! $this->is_addon() ) { - // This is not an add-on. - return; - } - - if ( $parent_fs->is_registered() ) { - // Already activated. - return; - } - - // Activate parent with add-on's user credentials. - $parent_install = $this->get_api_user_scope()->call( - "/plugins/{$parent_fs->_plugin->id}/installs.json", - 'post', - $parent_fs->get_install_data_for_api( array( - 'uid' => $parent_fs->get_anonymous_id(), - ), false, false ) - ); - - if ( isset( $parent_install->error ) ) { - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' . - $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '' . $parent_install->error->message . '', - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error' - ); - - return; - } - - $parent_fs->_admin_notices->remove_sticky( 'connect_account' ); - - if ( $parent_fs->is_pending_activation() ) { - $parent_fs->_admin_notices->remove_sticky( 'activation_pending' ); - - unset( $parent_fs->_storage->is_pending_activation ); - } - - // Get user information based on parent's plugin. - $user = $this->get_user(); - - // First of all, set site info - otherwise we won't - // be able to invoke API calls. - $parent_fs->_site = new FS_Site( $parent_install ); - $parent_fs->_user = $user; - - // Sync add-on plans. - $parent_fs->_sync_plans(); - - $parent_fs->_set_account( $user, $parent_fs->_site ); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Admin Menu Items - #---------------------------------------------------------------------------------- - - private $_menu_items = array(); - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.8 - * - * @return array - */ - function get_menu_items() { - return $this->_menu_items; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return string - */ - function get_menu_slug() { - return $this->_menu->get_slug(); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - function _prepare_admin_menu() { -// if ( ! $this->is_on() ) { -// return; -// } - - /** - * When running from a site admin with a network activated module and the connection - * was NOT delegated and the user still haven't skipped or opted-in, then hide the - * site level settings. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - $should_hide_site_admin_settings = ( - $this->_is_network_active && - ! fs_is_network_admin() && - ! $this->is_delegated_connection() && - ! $this->is_anonymous() && - ! $this->is_registered() - ); - - $should_hide_site_admin_settings = $this->apply_filters( 'should_hide_site_admin_settings_on_network_activation_mode', $should_hide_site_admin_settings ); - - if ( ( ! $this->has_api_connectivity() && ! $this->is_enable_anonymous() ) || - $should_hide_site_admin_settings - ) { - $this->_menu->remove_menu_item( $should_hide_site_admin_settings ); - } else { - $this->do_action( fs_is_network_admin() ? - 'before_network_admin_menu_init' : - 'before_admin_menu_init' - ); - - $this->add_menu_action(); - - $this->add_network_menu_when_missing(); - - $this->add_submenu_items(); - } - } - - /** - * Admin dashboard menu items modifications. - * - * NOTE: admin_menu action executed before admin_init. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - */ - private function add_menu_action() { - if ( $this->is_activation_mode() ) { - if ( $this->show_opt_in_on_setting_page() ) { - $this->override_plugin_menu_with_activation(); - } else { - /** - * Handle theme opt-in when the opt-in form shows as a dialog box in the themes page. - */ - if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) { - add_action( 'load-themes.php', array( &$this, '_install_with_current_user' ) ); - } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) || - fs_request_get_bool( 'pending_activation' ) - ) { - add_action( 'load-themes.php', array( &$this, '_install_with_new_user' ) ); - } - } - } else { - if ( ! $this->is_registered() ) { - // If not registered try to install user. - if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) { - $this->_install_with_new_user(); - } - } else if ( - fs_request_is_action( 'sync_user' ) && - ( ! $this->has_settings_menu() || $this->show_opt_in_on_themes_page() ) - ) { - $this->_handle_account_user_sync(); - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - */ - function _redirect_on_clicked_menu_link() { - $this->_logger->entrance(); - - $page = fs_request_get('page'); - $page = is_string($page) ? strtolower($page) : ''; - - $this->_logger->log( 'page = ' . $page ); - - foreach ( $this->_menu_items as $priority => $items ) { - foreach ( $items as $item ) { - if ( isset( $item['url'] ) ) { - if ( $page === $this->_menu->get_slug( strtolower( $item['menu_slug'] ) ) ) { - $this->_logger->log( 'Redirecting to ' . $item['url'] ); - - fs_redirect( $item['url'] ); - } - } - } - } - } - - /** - * Remove plugin's all admin menu items & pages, and replace with activation page. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - */ - private function override_plugin_menu_with_activation() { - $this->_logger->entrance(); - - $hook = false; - - if ( ! $this->has_settings_menu() ) { - // Add the opt-in page without a menu item. - $hook = FS_Admin_Menu_Manager::add_subpage( - null, - $this->get_plugin_name(), - $this->get_plugin_name(), - 'manage_options', - $this->_slug, - array( &$this, '_connect_page_render' ) - ); - } else if ( $this->_menu->is_top_level() ) { - if ( $this->_menu->is_override_exact() ) { - // Make sure the current page is matching the activation page. - if ( ! $this->is_matching_url( $this->get_activation_url() ) ) { - return; - } - } - - $hook = $this->_menu->override_menu_item( array( &$this, '_connect_page_render' ) ); - - if ( false === $hook ) { - // Create new menu item just for the opt-in. - $hook = FS_Admin_Menu_Manager::add_page( - $this->get_plugin_name(), - $this->get_plugin_name(), - 'manage_options', - $this->_menu->get_slug(), - array( &$this, '_connect_page_render' ) - ); - } - } else { - $menus = array( $this->_menu->get_parent_slug() ); - - if ( $this->_menu->is_override_exact() ) { - // Make sure the current page is matching the activation page. - if ( ! $this->is_matching_url( $this->get_activation_url() ) ) { - return; - } - } - - foreach ( $menus as $parent_slug ) { - $hook = $this->_menu->override_submenu_action( - $parent_slug, - $this->_menu->get_raw_slug(), - array( &$this, '_connect_page_render' ) - ); - - if ( false !== $hook ) { - // Found plugin's submenu item. - break; - } - } - } - - if ( $this->is_activation_page() ) { - // Clean admin page from distracting content. - self::_clean_admin_content_section(); - } - - if ( false !== $hook ) { - if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) { - $this->_install_with_current_user(); - } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) { - $this->_install_with_new_user(); - } - } - } - - /** - * If a plugin was network activated and connected but don't have a network - * level settings, then add an artificial menu item for the Account and other - * Freemius settings. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - private function add_network_menu_when_missing() { - $this->_logger->entrance(); - - if ( ! $this->_is_network_active ) { - // Plugin wasn't activated on the network level. - return; - } - - if ( ! fs_is_network_admin() ) { - // The context is not the network admin. - return; - } - - if ( $this->_menu->has_network_menu() ) { - // Plugin already has a network level menu. - return; - } - - if ( $this->is_network_activation_mode() ) { - /** - * Do not add during activation mode, otherwise, there will be duplicate menus while the opt-in - * screen is being shown. - * - * @author Leo Fajardo (@leorw) - */ - return; - } - - if ( ! WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED ) { - if ( $this->is_network_delegated_connection() ) { - // Super-admin delegated the connection to the site admins. - return; - } - } - - if ( ! $this->_menu->has_menu() || $this->_menu->is_top_level() ) { - - if ( $this->_menu->has_menu() || - ! $this->is_addon() || - $this->is_activation_mode() - ) { - $this->_dynamically_added_top_level_page_hook_name = $this->_menu->add_page_and_update( - $this->get_plugin_name(), - $this->get_plugin_name(), - 'manage_options', - $this->_menu->has_menu() ? $this->_menu->get_slug() : $this->_slug - ); - } - } else { - $this->_menu->add_subpage_and_update( - $this->_menu->get_parent_slug(), - $this->get_plugin_name(), - $this->get_plugin_name(), - 'manage_options', - $this->_menu->get_slug() - ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.1 - * - * return string - */ - function get_top_level_menu_capability() { - global $menu; - - $top_level_menu_slug = $this->get_top_level_menu_slug(); - - foreach ( $menu as $menu_info ) { - /** - * The second element in the menu info array is the capability/role that has access to the menu and the - * third element is the menu slug. - */ - if ( $menu_info[2] === $top_level_menu_slug ) { - return $menu_info[1]; - } - } - - return 'read'; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - * - * @return string - */ - private function get_top_level_menu_slug() { - return ( $this->is_addon() ? - $this->get_parent_instance()->_menu->get_top_level_menu_slug() : - $this->_menu->get_top_level_menu_slug() ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return string - */ - function get_pricing_cta_label() { - $label = $this->get_text_inline( 'Upgrade', 'upgrade' ); - - if ( $this->is_in_trial_promotion() && - ! $this->is_paying_or_trial() - ) { - // If running a trial promotion, modify the pricing to load the trial. - $label = $this->get_text_inline( 'Start Trial', 'start-trial' ); - } else if ( $this->is_paying() ) { - $label = $this->get_text_inline( 'Pricing', 'pricing' ); - } - - return $label; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - */ - function is_pricing_page_visible() { - return ( - // Has at least one paid plan. - $this->has_paid_plan() && - // Didn't ask to hide the pricing page. - $this->is_page_visible( 'pricing' ) && - // Don't have a valid active license or has more than one plan. - ( ! $this->is_paying() || ! $this->is_single_plan( true ) ) - ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param bool $is_activation_mode - * - * @return bool - */ - private function should_add_submenu_or_action_links( $is_activation_mode ) { - if ( $this->is_addon() ) { - // No submenu items or action links for add-ons. - return false; - } - - if ( $this->show_opt_in_on_themes_page() ) { - if ( ! fs_is_network_admin() ) { - // Also add action links or submenu items when running in a free .org theme so the tabs will be visible. - return true; - } - } else if ( $is_activation_mode ) { - // Don't show submenu-items/tabs in activation mode, unless it's a wp.org theme. - return false; - } - - if ( fs_is_network_admin() ) { - /** - * Add submenu items or action links to network level when plugin was network activated and the super - * admin did NOT delegate the connection of all sites to site admins. - */ - return ( - $this->_is_network_active && - ( WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED || - ! $this->is_network_delegated_connection() ) - ); - } - - return ( ! $this->_is_network_active || $this->is_delegated_connection() ); - } - - /** - * Add default Freemius menu items. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - * @since 1.2.2.7 Also add submenu items when running in a free .org theme so the tabs will be visible. - */ - private function add_submenu_items() { - $this->_logger->entrance(); - - $is_activation_mode = $this->is_activation_mode(); - - $add_submenu_items = $this->should_add_submenu_or_action_links( $is_activation_mode ); - - if ( $add_submenu_items ) { - if ( $this->has_affiliate_program() ) { - // Add affiliation page. - $this->add_submenu_item( - $this->get_text_inline( 'Affiliation', 'affiliation' ), - array( &$this, '_affiliation_page_render' ), - $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Affiliation', 'affiliation' ), - 'manage_options', - 'affiliation', - 'Freemius::_clean_admin_content_section', - WP_FS__DEFAULT_PRIORITY, - $this->is_submenu_item_visible( 'affiliation' ) - ); - } - } - - if ( $add_submenu_items || - ( $is_activation_mode && - $this->is_only_premium() && - $this->is_admin_page( 'account' ) && - fs_request_is_action( $this->get_unique_affix() . '_sync_license' ) - ) - ) { - if ( ! WP_FS__DEMO_MODE && $this->is_registered() ) { - $show_account = ( - $this->is_submenu_item_visible( 'account' ) && - /** - * @since 1.2.2.7 Don't show the Account for free WP.org themes without any paid plans. - */ - ( ! $this->is_free_wp_org_theme() || $this->has_paid_plan() ) - ); - - // Add user account page. - $this->add_submenu_item( - $this->get_text_inline( 'Account', 'account' ), - array( &$this, '_account_page_render' ), - $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Account', 'account' ), - 'manage_options', - 'account', - array( &$this, '_account_page_load' ), - WP_FS__DEFAULT_PRIORITY, - ( $add_submenu_items && $show_account ) - ); - } - } - - if ( $add_submenu_items ) { - if (! WP_FS__DEMO_MODE && ! $this->is_whitelabeled() ) { - // Add contact page. - $this->add_submenu_item( - $this->get_text_inline( 'Contact Us', 'contact-us' ), - array( &$this, '_contact_page_render' ), - $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Contact Us', 'contact-us' ), - 'manage_options', - 'contact', - 'Freemius::_clean_admin_content_section', - WP_FS__DEFAULT_PRIORITY, - $this->is_submenu_item_visible( 'contact' ) - ); - } - - if ( $this->has_addons() ) { - $this->add_submenu_item( - $this->get_text_inline( 'Add-Ons', 'add-ons' ), - array( &$this, '_addons_page_render' ), - $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Add-Ons', 'add-ons' ), - 'manage_options', - 'addons', - array( &$this, '_addons_page_load' ), - WP_FS__LOWEST_PRIORITY - 1, - $this->is_submenu_item_visible( 'addons' ) - ); - } - } - - if ( $add_submenu_items || - ( $is_activation_mode && $this->is_only_premium() && $this->is_admin_page( 'pricing' ) ) - ) { - if (! WP_FS__DEMO_MODE && ! $this->is_whitelabeled() ) { - $show_pricing = ( - $this->is_submenu_item_visible( 'pricing' ) && - $this->is_pricing_page_visible() - ); - - $pricing_cta_text = $this->get_pricing_cta_label(); - $pricing_class = 'upgrade-mode'; - if ( $show_pricing ) { - if ( $this->is_in_trial_promotion() && - ! $this->is_paying_or_trial() - ) { - // If running a trial promotion, modify the pricing to load the trial. - $pricing_class = 'trial-mode'; - } else if ( $this->is_paying() ) { - $pricing_class = ''; - } - } - - // Add upgrade/pricing page. - $this->add_submenu_item( - $pricing_cta_text . '  ' . ( is_rtl() ? $this->get_text_x_inline( '←', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '➤', 'ASCII arrow right icon', 'symbol_arrow-right' ) ), - array( &$this, '_pricing_page_render' ), - $this->get_plugin_name() . ' – ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ), - 'manage_options', - 'pricing', - 'Freemius::_clean_admin_content_section', - WP_FS__LOWEST_PRIORITY, - ( $add_submenu_items && $show_pricing ), - $pricing_class - ); - } - } - - if ( ! $is_activation_mode || ( true !== $this->_storage->require_license_activation ) ) { - /** - * Add the other menu items if there are any when not in activation mode or license activation is not - * required (license activation is required for registered or anonymous users after activating the - * premium version when the site is not in trial mode or there's no active valid license). - * - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - */ - if ( 0 < count( $this->_menu_items ) ) { - if ( ! $this->_menu->is_top_level() ) { - fs_enqueue_local_style( 'fs_common', '/admin/common.css' ); - - // Append submenu items right after the plugin's submenu item. - $this->order_sub_submenu_items(); - } else { - // Append submenu items. - $this->embed_submenu_items(); - } - } - } - } - - /** - * Moved the actual submenu item additions to a separated function, - * in order to support sub-submenu items when the plugin's settings - * only have a submenu and not top-level menu item. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.4 - */ - private function embed_submenu_items() { - $item_template = $this->_menu->is_top_level() ? - '%s' : - '%s'; - - $top_level_menu_capability = $this->get_top_level_menu_capability(); - - ksort( $this->_menu_items ); - - $is_first_submenu_item = true; - - foreach ( $this->_menu_items as $priority => $items ) { - foreach ( $items as $item ) { - $capability = ( ! empty( $item['capability'] ) ? $item['capability'] : $top_level_menu_capability ); - - $menu_item = sprintf( - $item_template, - $this->get_unique_affix(), - $item['menu_slug'], - ! empty( $item['class'] ) ? $item['class'] : '', - $item['menu_title'] - ); - - $top_level_menu_slug = $this->get_top_level_menu_slug(); - $menu_slug = $this->_menu->get_slug( $item['menu_slug'] ); - - if ( ! isset( $item['url'] ) ) { - $hook = FS_Admin_Menu_Manager::add_subpage( - $item['show_submenu'] ? - $top_level_menu_slug : - null, - $item['page_title'], - $menu_item, - $capability, - $menu_slug, - $item['render_function'] - ); - - if ( false !== $item['before_render_function'] ) { - add_action( "load-$hook", $item['before_render_function'] ); - } - } else { - FS_Admin_Menu_Manager::add_subpage( - $item['show_submenu'] ? - $top_level_menu_slug : - null, - $item['page_title'], - $menu_item, - $capability, - $menu_slug, - array( $this, '' ) - ); - } - - if ( $item['show_submenu'] && $is_first_submenu_item ) { - if ( $this->_is_network_active && ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) { - /** - * If the top-level menu has been dynamically created, remove the first submenu item that - * WordPress automatically creates when there's no submenu item whose slug matches the - * parent's. In the following example, the `Awesome Plugin` submenu item will be removed. - * - * Awesome Plugin - * - Awesome Plugin <-- we want to remove this since there's no real setting page for the top-level - * - * @author Leo Fajardo (@leorw) - */ - remove_submenu_page( $top_level_menu_slug, $top_level_menu_slug ); - } - - $is_first_submenu_item = false; - } - } - } - } - - /** - * Re-order the submenu items so all Freemius added new submenu items - * are added right after the plugin's settings submenu item. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.4 - */ - private function order_sub_submenu_items() { - global $submenu; - - $menu_slug = $this->_menu->get_top_level_menu_slug(); - - /** - * Before "admin_menu" fires, WordPress will loop over the default submenus and remove pages for which the user - * does not have permissions. So in case a plugin does not have top-level menu but does have submenus under any - * of the default menus, only users that have the right role can access its sub-submenus (Account, Contact Us, - * Support Forum, etc.) since $submenu[ $menu_slug ] will be empty if the user doesn't have permission. - * - * In case a plugin does not have submenus under any of the default menus but does have submenus under the menu - * of another plugin, only users that have the right role can access its sub-submenus since we will use the - * capability needed to access the parent menu as the capability for the submenus that we will add. - */ - if ( empty( $submenu[ $menu_slug ] ) ) { - return; - } - - $top_level_menu = &$submenu[ $menu_slug ]; - - $all_submenu_items_after = array(); - - $found_submenu_item = false; - - foreach ( $top_level_menu as $submenu_id => $meta ) { - if ( $found_submenu_item ) { - // Remove all submenu items after the plugin's submenu item. - $all_submenu_items_after[] = $meta; - unset( $top_level_menu[ $submenu_id ] ); - } - - if ( $this->_menu->get_raw_slug() === $meta[2] ) { - // Found the submenu item, put all below. - $found_submenu_item = true; - continue; - } - } - - // Embed all plugin's new submenu items. - $this->embed_submenu_items(); - - // Start with specially high number to make sure it's appended. - $i = max( 10000, max( array_keys( $top_level_menu ) ) + 1 ); - foreach ( $all_submenu_items_after as $meta ) { - $top_level_menu[ $i ] = $meta; - $i ++; - } - - // Sort submenu items. - ksort( $top_level_menu ); - } - - /** - * Helper method to return the module's support forum URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return string - */ - function get_support_forum_url() { - return $this->apply_filters( 'support_forum_url', "https://wordpress.org/support/{$this->_module_type}/{$this->_slug}" ); - } - - /** - * Displays the Support Forum link when enabled. - * - * Can be filtered like so: - * - * function _fs_show_support_menu( $is_visible, $menu_id ) { - * if ( 'support' === $menu_id ) { - * return _fs->is_registered(); - * } - * return $is_visible; - * } - * _fs()->add_filter('is_submenu_visible', '_fs_show_support_menu', 10, 2); - * - */ - function _add_default_submenu_items() { - if ( ! $this->is_on() ) { - return; - } - - if ( ! $this->is_activation_mode() && - ( ( $this->_is_network_active && fs_is_network_admin() ) || - ( ! $this->_is_network_active && is_admin() ) ) - ) { - $this->add_submenu_link_item( - $this->apply_filters( 'support_forum_submenu', $this->get_text_inline( 'Support Forum', 'support-forum' ) ), - $this->get_support_forum_url(), - 'wp-support-forum', - null, - 50, - $this->is_submenu_item_visible( 'support' ) - ); - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param string $menu_title - * @param callable $render_function - * @param bool|string $page_title - * @param string $capability - * @param bool|string $menu_slug - * @param bool|callable $before_render_function - * @param int $priority - * @param bool $show_submenu - * @param string $class Since 1.2.1.5 can add custom classes to menu items. - */ - function add_submenu_item( - $menu_title, - $render_function, - $page_title = false, - $capability = 'manage_options', - $menu_slug = false, - $before_render_function = false, - $priority = WP_FS__DEFAULT_PRIORITY, - $show_submenu = true, - $class = '' - ) { - $this->_logger->entrance( 'Title = ' . $menu_title ); - - if ( $this->is_addon() ) { - $parent_fs = $this->get_parent_instance(); - - if ( is_object( $parent_fs ) ) { - $parent_fs->add_submenu_item( - $menu_title, - $render_function, - $page_title, - $capability, - $menu_slug, - $before_render_function, - $priority, - $show_submenu, - $class - ); - - return; - } - } - - if ( ! isset( $this->_menu_items[ $priority ] ) ) { - $this->_menu_items[ $priority ] = array(); - } - - $this->_menu_items[ $priority ][] = array( - 'page_title' => is_string( $page_title ) ? $page_title : $menu_title, - 'menu_title' => $menu_title, - 'capability' => $capability, - 'menu_slug' => is_string( $menu_slug ) ? $menu_slug : strtolower( $menu_title ), - 'render_function' => $render_function, - 'before_render_function' => $before_render_function, - 'show_submenu' => $show_submenu, - 'class' => $class, - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param string $menu_title - * @param string $url - * @param bool $menu_slug - * @param string $capability - * @param int $priority - * @param bool $show_submenu - */ - function add_submenu_link_item( - $menu_title, - $url, - $menu_slug = false, - $capability = 'read', - $priority = WP_FS__DEFAULT_PRIORITY, - $show_submenu = true - ) { - $this->_logger->entrance( 'Title = ' . $menu_title . '; Url = ' . $url ); - - if ( $this->is_addon() ) { - $parent_fs = $this->get_parent_instance(); - - if ( is_object( $parent_fs ) ) { - $parent_fs->add_submenu_link_item( - $menu_title, - $url, - $menu_slug, - $capability, - $priority, - $show_submenu - ); - - return; - } - } - - if ( ! isset( $this->_menu_items[ $priority ] ) ) { - $this->_menu_items[ $priority ] = array(); - } - - $this->_menu_items[ $priority ][] = array( - 'menu_title' => $menu_title, - 'capability' => $capability, - 'menu_slug' => is_string( $menu_slug ) ? $menu_slug : strtolower( $menu_title ), - 'url' => $url, - 'page_title' => $menu_title, - 'render_function' => 'fs_dummy', - 'before_render_function' => '', - 'show_submenu' => $show_submenu, - ); - } - - #endregion ------------------------------------------------------------------ - - #-------------------------------------------------------------------------------- - #region Admin Notices - #-------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @param string|string[] $ids - * @param int|null $network_level_or_blog_id - * - * @uses FS_Admin_Notices::remove_sticky() - */ - function remove_sticky( $ids, $network_level_or_blog_id = null ) { - $this->_admin_notices->remove_sticky( $ids, $network_level_or_blog_id ); - } - - #endregion - - #-------------------------------------------------------------------------------- - #region Actions / Hooks / Filters - #-------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - * - * @param string $tag - * - * @return string - */ - public function get_action_tag( $tag ) { - return self::get_action_tag_static( $tag, $this->_slug, $this->is_plugin() ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - * - * @param string $tag - * @param string $slug - * @param bool $is_plugin - * - * @return string - */ - static function get_action_tag_static( $tag, $slug = '', $is_plugin = true ) { - $action = "fs_{$tag}"; - - if ( ! empty( $slug ) ) { - $action .= '_' . self::get_module_unique_affix( $slug, $is_plugin ); - } - - return $action; - } - - /** - * Returns a string that can be used to generate a unique action name, - * option name, HTML element ID, or HTML element class. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return string - */ - public function get_unique_affix() { - return self::get_module_unique_affix( $this->_slug, $this->is_plugin() ); - } - - /** - * Returns a string that can be used to generate a unique action name, - * option name, HTML element ID, or HTML element class. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.5 - * - * @param string $slug - * @param bool $is_plugin - * - * @return string - */ - static function get_module_unique_affix( $slug, $is_plugin = true ) { - $affix = $slug; - - if ( ! $is_plugin ) { - $affix .= '-' . WP_FS__MODULE_TYPE_THEME; - } - - return $affix; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1 - * @since 1.2.2.5 The AJAX action names are based on the module ID, not like the non-AJAX actions that are - * based on the slug for backward compatibility. - * - * @param string $tag - * - * @return string - */ - function get_ajax_action( $tag ) { - return self::get_ajax_action_static( $tag, $this->_module_id ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @param string $tag - * - * @return string - */ - function get_ajax_security( $tag ) { - return wp_create_nonce( $this->get_ajax_action( $tag ) ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @param string $tag - */ - function check_ajax_referer( $tag ) { - check_ajax_referer( $this->get_ajax_action( $tag ), 'security' ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - * @since 1.2.2.5 The AJAX action names are based on the module ID, not like the non-AJAX actions that are - * based on the slug for backward compatibility. - * - * @param string $tag - * @param number|null $module_id - * - * @return string - */ - private static function get_ajax_action_static( $tag, $module_id = null ) { - $action = "fs_{$tag}"; - - if ( ! empty( $module_id ) ) { - $action .= "_{$module_id}"; - } - - return $action; - } - - /** - * Do action, specific for the current context plugin. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param string $tag The name of the action to be executed. - * @param mixed $arg,... Optional. Additional arguments which are passed on to the - * functions hooked to the action. Default empty. - * - * @uses do_action() - */ - function do_action( $tag, $arg = '' ) { - $this->_logger->entrance( $tag ); - - $args = func_get_args(); - - call_user_func_array( 'do_action', array_merge( - array( $this->get_action_tag( $tag ) ), - array_slice( $args, 1 ) ) - ); - } - - /** - * Add action, specific for the current context plugin. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param string $tag - * @param callable $function_to_add - * @param int $priority - * @param int $accepted_args - * - * @uses add_action() - */ - function add_action( - $tag, - $function_to_add, - $priority = WP_FS__DEFAULT_PRIORITY, - $accepted_args = 1 - ) { - $this->_logger->entrance( $tag ); - - add_action( $this->get_action_tag( $tag ), $function_to_add, $priority, $accepted_args ); - } - - /** - * Add AJAX action, specific for the current context plugin. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1 - * - * @param string $tag - * @param callable $function_to_add - * @param int $priority - * - * @uses add_action() - * - * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching. - */ - function add_ajax_action( - $tag, - $function_to_add, - $priority = WP_FS__DEFAULT_PRIORITY - ) { - $this->_logger->entrance( $tag ); - - return self::add_ajax_action_static( - $tag, - $function_to_add, - $priority, - $this->_module_id - ); - } - - /** - * Add AJAX action. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - * - * @param string $tag - * @param callable $function_to_add - * @param int $priority - * @param number|null $module_id - * - * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching. - * @uses add_action() - * - */ - static function add_ajax_action_static( - $tag, - $function_to_add, - $priority = WP_FS__DEFAULT_PRIORITY, - $module_id = null - ) { - self::$_static_logger->entrance( $tag ); - - if ( ! self::is_ajax_action_static( $tag, $module_id ) ) { - return false; - } - - add_action( - 'wp_ajax_' . self::get_ajax_action_static( $tag, $module_id ), - $function_to_add, - $priority, - 0 - ); - - self::$_static_logger->info( "$tag AJAX callback action added." ); - - return true; - } - - /** - * Send a JSON response back to an Ajax request. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @param mixed $response - */ - static function shoot_ajax_response( $response ) { - wp_send_json( $response ); - } - - /** - * Send a JSON response back to an Ajax request, indicating success. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @param mixed $data Data to encode as JSON, then print and exit. - */ - static function shoot_ajax_success( $data = null ) { - wp_send_json_success( $data ); - } - - /** - * Send a JSON response back to an Ajax request, indicating failure. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @param mixed $error Optional error message. - */ - static function shoot_ajax_failure( $error = '' ) { - $result = array( 'success' => false ); - if ( ! empty( $error ) ) { - $result['error'] = $error; - } - - wp_send_json( $result ); - } - - /** - * Apply filter, specific for the current context plugin. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string $tag The name of the filter hook. - * @param mixed $value The value on which the filters hooked to `$tag` are applied on. - * - * @return mixed The filtered value after all hooked functions are applied to it. - * - * @uses apply_filters() - */ - function apply_filters( $tag, $value ) { - $this->_logger->entrance( $tag ); - - $args = func_get_args(); - array_unshift( $args, $this->get_unique_affix() ); - - return call_user_func_array( 'fs_apply_filter', $args ); - } - - /** - * Add filter, specific for the current context plugin. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string $tag - * @param callable $function_to_add - * @param int $priority - * @param int $accepted_args - * - * @uses add_filter() - */ - function add_filter( $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $accepted_args = 1 ) { - $this->_logger->entrance( $tag ); - - add_filter( $this->get_action_tag( $tag ), $function_to_add, $priority, $accepted_args ); - } - - /** - * Check if has filter. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.4 - * - * @param string $tag - * @param callable|bool $function_to_check Optional. The callback to check for. Default false. - * - * @return false|int - * - * @uses has_filter() - */ - function has_filter( $tag, $function_to_check = false ) { - $this->_logger->entrance( $tag ); - - return has_filter( $this->get_action_tag( $tag ), $function_to_check ); - } - - #endregion - - /** - * Override default i18n text phrases. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.6 - * - * @param string[] string $key_value - * - * @uses fs_override_i18n() - */ - function override_i18n( $key_value ) { - fs_override_i18n( $key_value, $this->_slug ); - } - - /* Account Page - ------------------------------------------------------------------------------------------------------------------*/ - /** - * Update site information. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param bool $store Flush to Database if true. - * @param null|int $network_level_or_blog_id Since 2.0.0 - * @param \FS_Site $site Since 2.0.0 - */ - private function _store_site( $store = true, $network_level_or_blog_id = null, FS_Site $site = null ) { - $this->_logger->entrance(); - - if ( is_null( $site ) ) { - $site = $this->_site; - } - - if ( !isset( $site ) || !is_object($site) || empty( $site->id ) ) { - $this->_logger->error( "Empty install ID, can't store site." ); - - return; - } - - $site_clone = clone $site; - - $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id ); - - if ( is_object( $this->_user ) && $this->_user->id != $site->user_id ) { - $this->sync_user_by_current_install( $site->user_id ); - - $prev_stored_user_id = $this->_storage->get( 'prev_user_id', false, $network_level_or_blog_id ); - - if ( empty( $prev_stored_user_id ) && - is_object($this->_user) && $this->_user->id != $site->user_id - ) { - /** - * Store the current user ID as the previous user ID so that the previous user can be used - * as the install's owner while the new owner's details are not yet available. - * - * This will be executed only in the `replica` site. For example, there are 2 sites, namely `original` - * and `replica`, then an ownership change was initiated and completed in the `original`, the `replica` - * will be using the previous user until it is updated again (e.g.: until the next clone of `original` - * into `replica`. - * - * @author Leo Fajardo (@leorw) - */ - $this->_storage->store( 'prev_user_id', $sites[ $this->_slug ]->user_id, $network_level_or_blog_id ); - } - } - - $sites[ $this->_slug ] = $site_clone; - - $this->set_account_option( 'sites', $sites, $store, $network_level_or_blog_id ); - } - - /** - * Update plugin's plans information. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @param bool $store Flush to Database if true. - */ - private function _store_plans( $store = true ) { - $this->_logger->entrance(); - - $plans = self::get_all_plans( $this->_module_type ); - - // Copy plans. - $encrypted_plans = array(); - for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { - $encrypted_plans[] = self::_encrypt_entity( $this->_plans[ $i ] ); - } - - $plans[ $this->_slug ] = $encrypted_plans; - - $this->set_account_option( 'plans', $plans, $store ); - } - - /** - * Update user's plugin licenses. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param bool $store - * @param number|bool $module_id - * @param FS_Plugin_License[] $licenses - */ - private function _store_licenses( $store = true, $module_id = false, $licenses = array() ) { - $this->_logger->entrance(); - - $all_licenses = self::get_all_licenses(); - - if ( ! FS_Plugin::is_valid_id( $module_id ) ) { - $module_id = $this->_module_id; - - $user_licenses = is_array( $this->_licenses ) ? - $this->_licenses : - array(); - - if ( empty( $user_licenses ) ) { - // If the context user doesn't have any license, don't update the licenses collection. - return; - } - - $new_user_licenses_map = array(); - foreach ( $user_licenses as $user_license ) { - $new_user_licenses_map[ $user_license->id ] = $user_license; - } - - self::store_user_id_license_ids_map( array_keys( $new_user_licenses_map ), $this->_module_id, $this->_user->id ); - - // Update user licenses. - $licenses_to_update_count = count( $new_user_licenses_map ); - foreach ( $all_licenses[ $module_id ] as $key => $license ) { - if ( 0 === $licenses_to_update_count ) { - break; - } - - if ( isset( $new_user_licenses_map[ $license->id ] ) ) { - // Update license. - $all_licenses[ $module_id ][ $key ] = $new_user_licenses_map[ $license->id ]; - unset( $new_user_licenses_map[ $license->id ] ); - - $licenses_to_update_count --; - } - } - - if ( ! empty( $new_user_licenses_map ) ) { - // Add new licenses. - $all_licenses[ $module_id ] = array_merge( array_values( $new_user_licenses_map ), $all_licenses[ $module_id ] ); - } - - $licenses = $all_licenses[ $module_id ]; - } - - if ( ! isset( $all_licenses[ $module_id ] ) ) { - $all_licenses[ $module_id ] = array(); - } - - $all_licenses[ $module_id ] = $licenses; - - self::$_accounts->set_option( 'all_licenses', $all_licenses, $store ); - } - - /** - * Update user information. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param bool $store Flush to Database if true. - */ - private function _store_user( $store = true ) { - $this->_logger->entrance(); - - if ( empty( $this->_user->id ) ) { - $this->_logger->error( "Empty user ID, can't store user." ); - - return; - } - - $users = self::get_all_users(); - $users[ $this->_user->id ] = $this->_user; - self::$_accounts->set_option( 'users', $users, $store ); - } - - /** - * Update new updates information. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param FS_Plugin_Tag|null $update - * @param bool $store Flush to Database if true. - * @param bool|number $plugin_id - */ - private function _store_update( $update, $store = true, $plugin_id = false ) { - $this->_logger->entrance(); - - if ( $update instanceof FS_Plugin_Tag ) { - $update->updated = time(); - } - - if ( ! is_numeric( $plugin_id ) ) { - $plugin_id = $this->_plugin->id; - } - - $updates = self::get_all_updates(); - $updates[ $plugin_id ] = $update; - self::$_accounts->set_option( 'updates', $updates, $store ); - } - - /** - * Update new updates information. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param FS_Plugin[] $plugin_addons - * @param bool $store Flush to Database if true. - */ - private function _store_addons( $plugin_addons, $store = true ) { - $this->_logger->entrance(); - - $addons = self::get_all_addons(); - $addons[ $this->_plugin->id ] = $plugin_addons; - self::$_accounts->set_option( 'addons', $addons, $store ); - } - - /** - * Delete plugin's associated add-ons. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.8 - * - * @param bool $store - * - * @return bool - */ - private function _delete_account_addons( $store = true ) { - $all_addons = self::get_all_account_addons(); - - if ( ! isset( $all_addons[ $this->_plugin->id ] ) ) { - return false; - } - - unset( $all_addons[ $this->_plugin->id ] ); - - self::$_accounts->set_option( 'account_addons', $all_addons, $store ); - - return true; - } - - /** - * Update account add-ons list. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param FS_Plugin[] $addons - * @param bool $store Flush to Database if true. - */ - private function _store_account_addons( $addons, $store = true ) { - $this->_logger->entrance(); - - $all_addons = self::get_all_account_addons(); - $all_addons[ $this->_plugin->id ] = $addons; - self::$_accounts->set_option( 'account_addons', $all_addons, $store ); - } - - /** - * Purges the cache for the valid user licenses API call so that when the `Account` or `Add-Ons` page is loaded, - * the valid user licenses will be fetched again and the account add-ons may be updated. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.4 - */ - private function purge_valid_user_licenses_cache() { - if ( ! $this->is_registered() ) { - return; - } - - $this->get_api_user_scope()->purge_cache( $this->get_valid_user_licenses_endpoint() ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @param array $all_licenses - * @param number|null $site_license_id - * @param bool $include_parent_licenses - * - * @return array - */ - private function get_foreign_licenses_info( $all_licenses, $site_license_id = null, $include_parent_licenses = false ) { - $foreign_licenses = array( - 'ids' => array(), - 'license_keys' => array() - ); - - $parent_license_ids_map = array(); - - foreach ( $all_licenses as $license ) { - if ( $license->user_id == $this->_user->id || $license->id == $site_license_id ) { - continue; - } - - $foreign_licenses['ids'][] = $license->id; - $foreign_licenses['license_keys'][] = $license->secret_key; - - if ( - $include_parent_licenses && - is_object( $this->_license ) && - FS_Plugin_License::is_valid_id( $this->_license->parent_license_id ) && - ! isset( $parent_license_ids_map[ $this->_license->parent_license_id ] ) - ) { - /** - * Include the parent license's info only if it has not been included before since child licenses - * can have the same parent license. - */ - $foreign_licenses['ids'][] = $this->_license->parent_license_id; - $foreign_licenses['license_keys'][] = $license->secret_key; - - $parent_license_ids_map[ $this->_license->parent_license_id ] = true; - } - } - - if ( empty( $foreign_licenses['ids'] ) ) { - $foreign_licenses = array(); - } - - return $foreign_licenses; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @return string - */ - private function get_valid_user_licenses_endpoint() { - $user_licenses_endpoint = '/licenses.json?type=active' . - ( FS_Plugin::is_valid_id( $this->get_bundle_id() ) ? '&is_enriched=true' : '' ); - - $foreign_licenses = $this->get_foreign_licenses_info( self::get_all_licenses( $this->_module_id ), null, true ); - - if ( ! empty ( $foreign_licenses ) ) { - $foreign_licenses = array( - // Prefix with `+` to tell the server to include foreign licenses in the licenses collection. - 'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ), - 'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) ) - ); - - $user_licenses_endpoint = add_query_arg( $foreign_licenses, $user_licenses_endpoint ); - } - - return $user_licenses_endpoint; - } - - /** - * Fetches active licenses that are enriched with product type if there's a context `bundle_id` and bundle - * licenses enriched with product IDs if there are any. From the licenses, the `get_updated_account_addons` - * method filters out non–add-on product IDs and stores the add-on IDs. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.4 - * - * @return stdClass[] array - */ - private function fetch_valid_user_licenses() { - $this->_logger->entrance(); - - $result = $this->get_api_user_scope()->get( $this->get_valid_user_licenses_endpoint() ); - - if ( ! $this->is_api_result_object( $result, 'licenses' ) || - ! is_array( $result->licenses ) - ) { - return array(); - } - - return $result->licenses; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.2.4 - * - * @return number[] Account add-on IDs. - */ - function get_updated_account_addons() { - $addons = $this->get_addons(); - if ( empty( $addons ) ) { - return array(); - } - - $account_addons = $this->get_account_addons(); - if ( ! is_array( $account_addons ) ) { - $account_addons = array(); - } - - $user_licenses = $this->is_registered() ? - $this->fetch_valid_user_licenses() : - array(); - - if ( empty( $user_licenses ) ) { - return $account_addons; - } - - $addon_ids = array(); - foreach ( $addons as $addon ) { - $addon_ids[] = $addon->id; - } - - $license_product_ids = array(); - - foreach ( $user_licenses as $license ) { - if ( isset( $license->plugin_type ) && 'bundle' === $license->plugin_type ) { - $license_product_ids = array_merge( $license_product_ids, $license->products ); - } else { - $license_product_ids[] = $license->plugin_id; - } - } - - // Filter out non–add-on IDs. - $new_account_addons = array_intersect( $addon_ids, $license_product_ids ); - if ( count( $new_account_addons ) !== count( $account_addons ) ) { - $this->_store_account_addons( array_unique( $new_account_addons ) ); - } - - return $new_account_addons; - } - - /** - * Store account params in the Database. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.1 - * - * @param null|int $blog_id Since 2.0.0 - */ - private function _store_account( $blog_id = null ) { - $this->_logger->entrance(); - - $this->_store_site( false, $blog_id ); - $this->_store_user( false ); - $this->_store_plans( false ); - $this->_store_licenses( false ); - - self::$_accounts->store( $blog_id ); - } - - /** - * Sync user's information. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * @uses FS_Api - */ - private function _handle_account_user_sync() { - $this->_logger->entrance(); - - $api = $this->get_api_user_scope(); - - // Get user's information. - $user = $api->get( '/', true ); - - if ( isset( $user->id ) ) { - $this->_user->first = $user->first; - $this->_user->last = $user->last; - $this->_user->email = $user->email; - - $is_menu_item_account_visible = $this->is_submenu_item_visible( 'account' ); - - if ( $user->is_verified && - ( ! isset( $this->_user->is_verified ) || false === $this->_user->is_verified ) - ) { - $this->_user->is_verified = true; - - $this->do_action( 'account_email_verified', $user->email ); - - $this->_admin_notices->add( - $this->get_text_inline( 'Your email has been successfully verified - you are AWESOME!', 'email-verified-message' ), - $this->get_text_x_inline( 'Right on', 'a positive response', 'right-on' ) . '!', - 'success', - // Make admin sticky if account menu item is invisible, - // since the page will be auto redirected to the plugin's - // main settings page, and the non-sticky message - // will disappear. - ! $is_menu_item_account_visible, - 'email_verified' - ); - } - - // Flush user details to DB. - $this->_store_user(); - - $this->do_action( 'after_account_user_sync', $user ); - - /** - * If account menu item is hidden, redirect to plugin's main settings page. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.6 - * - * @link https://github.com/Freemius/wordpress-sdk/issues/6 - */ - if ( ! $is_menu_item_account_visible ) { - fs_redirect( $this->_get_admin_page_url() ); - } - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * @uses FS_Api - * - * @param number|bool $license_id - * - * @return FS_Subscription|object|bool - */ - private function _fetch_site_license_subscription( $license_id = false ) { - $this->_logger->entrance(); - $api = $this->get_api_site_scope(); - - if ( ! is_numeric( $license_id ) ) { - $license_id = FS_Plugin_License::is_valid_id( $this->_license->parent_license_id ) ? - $this->_license->parent_license_id : - $this->_license->id; - } - - $result = $api->get( "/licenses/{$license_id}/subscriptions.json", true ); - - return ! isset( $result->error ) ? - ( ( is_array( $result->subscriptions ) && 0 < count( $result->subscriptions ) ) ? - new FS_Subscription( $result->subscriptions[0] ) : - false - ) : - $result; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * @uses FS_Api - * - * @param number|bool $plan_id - * - * @return FS_Plugin_Plan|object - */ - private function _fetch_site_plan( $plan_id = false ) { - $this->_logger->entrance(); - $api = $this->get_api_site_scope(); - - if ( ! is_numeric( $plan_id ) ) { - $plan_id = $this->_site->plan_id; - } - - $plan = $api->get( "/plans/{$plan_id}.json", true ); - - return ! isset( $plan->error ) ? new FS_Plugin_Plan( $plan ) : $plan; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * @uses FS_Api - * - * @return FS_Plugin_Plan[]|object - */ - private function _fetch_plugin_plans() { - $this->_logger->entrance(); - $api = $this->get_current_or_network_user_api_scope(); - - /** - * @since 1.2.3 When running in DEV mode, retrieve pending plans as well. - */ - $result = $api->get( $this->add_show_pending( "/plugins/{$this->_module_id}/plans.json" ), true ); - - if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) { - for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) { - $result->plans[ $i ] = new FS_Plugin_Plan( $result->plans[ $i ] ); - } - - $result = $result->plans; - } - - return $result; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $plan_id - * - * @return \FS_Plugin_Plan|object - */ - private function fetch_plan_by_id( $plan_id ) { - $this->_logger->entrance(); - $api = $this->get_current_or_network_user_api_scope(); - - $result = $api->get( "/plugins/{$this->_module_id}/plans/{$plan_id}.json", true ); - - return $this->is_api_result_entity( $result ) ? - new FS_Plugin_Plan( $result ) : - $result; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * @uses FS_Api - * - * @param number|bool $plugin_id - * @param number|bool $site_license_id - * @param array $foreign_licenses @since 2.0.0. This is used by network-activated plugins. - * @param number|null $blog_id - * - * @return FS_Plugin_License[]|object - */ - private function _fetch_licenses( - $plugin_id = false, - $site_license_id = false, - $foreign_licenses = array(), - $blog_id = null - ) { - $this->_logger->entrance(); - - $api = $this->get_api_user_scope(); - - if ( ! is_numeric( $plugin_id ) ) { - $plugin_id = $this->_plugin->id; - } - - $user_licenses_endpoint = "/plugins/{$plugin_id}/licenses.json?is_enriched=true"; - if ( ! empty ( $foreign_licenses ) ) { - $foreign_licenses = array( - // Prefix with `+` to tell the server to include foreign licenses in the licenses collection. - 'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ), - 'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) ) - ); - - $user_licenses_endpoint = add_query_arg( $foreign_licenses, $user_licenses_endpoint ); - } - - $result = $api->get( $user_licenses_endpoint, true ); - - $is_site_license_synced = false; - - $api_errors = array(); - - if ( $this->is_api_result_object( $result, 'licenses' ) && - is_array( $result->licenses ) - ) { - for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) { - $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] ); - - if ( ( ! $is_site_license_synced ) && is_numeric( $site_license_id ) ) { - $is_site_license_synced = ( $site_license_id == $result->licenses[ $i ]->id ); - } - } - - $result = $result->licenses; - } else { - $api_errors[] = $result; - $result = array(); - } - - if ( ! $is_site_license_synced ) { - if ( ! is_null( $blog_id ) ) { - /** - * If blog ID is not null, the request is for syncing of the license of a single site via the - * network-level "Account" page. - * - * @author Leo Fajardo (@leorw) - */ - $this->switch_to_blog( $blog_id ); - } - - $api = $this->get_api_site_scope(); - - if ( is_numeric( $site_license_id ) ) { - // Try to retrieve a foreign license that is linked to the install. - $api_result = $api->call( '/licenses.json?is_enriched=true' ); - - if ( $this->is_api_result_object( $api_result, 'licenses' ) && - is_array( $api_result->licenses ) - ) { - $licenses = $api_result->licenses; - - if ( ! empty( $licenses ) ) { - $result[] = new FS_Plugin_License( $licenses[0] ); - } - } else { - $api_errors[] = $api_result; - } - } else if ( - is_object( $this->_license ) && - /** - * Sync only if the license belongs to the context plugin. `$plugin_id` can be an add-on ID while - * the FS instance that does the syncing is the parent FS instance. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - $this->_license->plugin_id == $plugin_id - ) { - $is_license_in_result = false; - if ( ! empty( $result ) ) { - foreach ( $result as $license ) { - if ( $license->id == $this->_license->id ) { - $is_license_in_result = true; - break; - } - } - } - - if ( ! $is_license_in_result ) { - // Fetch foreign license by ID and license key. - $license = $api->get( "/licenses/{$this->_license->id}.json?license_key=" . - urlencode( $this->_license->secret_key ) . '&is_enriched=true' ); - - if ( $this->is_api_result_entity( $license ) ) { - $result[] = new FS_Plugin_License( $license ); - } else { - $api_errors[] = $license; - } - } - } - - if ( ! is_null( $blog_id ) ) { - $this->switch_to_blog( $this->_storage->network_install_blog_id ); - } - } - - if ( is_array( $result ) && 0 < count( $result ) ) { - // If found at least one license, return license collection even if there are errors. - return $result; - } - - if ( ! empty( $api_errors ) ) { - // If found any errors and no licenses, return first error. - return $api_errors[0]; - } - - // Fallback to empty licenses list. - return $result; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param number $license_id - * @param string $license_key - * - * @return \FS_Plugin_License|object - */ - private function fetch_license_by_key( $license_id, $license_key ) { - $this->_logger->entrance(); - - $api = $this->get_current_or_network_user_api_scope(); - - $result = $api->get( "/licenses/{$license_id}.json?license_key=" . urlencode( $license_key ) ); - - return $this->is_api_result_entity( $result ) ? - new FS_Plugin_License( $result ) : - $result; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.0 - * @uses FS_Api - * - * @param number|bool $plugin_id - * @param bool $flush - * - * @return FS_Payment[]|object - */ - function _fetch_payments( $plugin_id = false, $flush = false ) { - $this->_logger->entrance(); - - $api = $this->get_api_user_scope(); - - if ( ! is_numeric( $plugin_id ) ) { - $plugin_id = $this->_plugin->id; - } - - $include_bundles = ( - is_object( $this->_plugin ) && - FS_Plugin::is_valid_id( $this->_plugin->bundle_id ) - ); - - $result = $api->get( - "/plugins/{$plugin_id}/payments.json?include_addons=true" . ($include_bundles ? '&include_bundles=true' : ''), - $flush - ); - - if ( ! isset( $result->error ) ) { - for ( $i = 0, $len = count( $result->payments ); $i < $len; $i ++ ) { - $result->payments[ $i ] = new FS_Payment( $result->payments[ $i ] ); - } - $result = $result->payments; - } - - return $result; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * @uses FS_Api - * - * @param bool $flush - * - * @return \FS_Billing|mixed - */ - function _fetch_billing( $flush = false ) { - require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-billing.php'; - - $billing = $this->get_api_user_scope()->get( 'billing.json', $flush ); - - if ( $this->is_api_result_entity( $billing ) ) { - $billing = new FS_Billing( $billing ); - } - - return $billing; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param FS_Plugin_License[] $licenses - * @param number $module_id - */ - private function _update_licenses( $licenses, $module_id ) { - $this->_logger->entrance(); - - if ( is_array( $licenses ) ) { - for ( $i = 0, $len = count( $licenses ); $i < $len; $i ++ ) { - $licenses[ $i ]->updated = time(); - } - } - - $this->_store_licenses( true, $module_id, $licenses ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param bool|number $plugin_id - * @param bool $flush Since 1.1.7.3 - * @param int $expiration Since 1.2.2.7 - * @param bool|string $newer_than Since 2.2.1 - * - * @return object|false New plugin tag info if exist. - */ - private function _fetch_newer_version( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $newer_than = false ) { - $latest_tag = $this->_fetch_latest_version( $plugin_id, $flush, $expiration, $newer_than ); - - if ( ! is_object( $latest_tag ) ) { - return false; - } - - $plugin_version = $this->get_plugin_version(); - - // Check if version is actually newer. - $has_new_version = - // If it's an non-installed add-on then always return latest. - ( $this->_is_addon_id( $plugin_id ) && ! $this->is_addon_activated( $plugin_id ) ) || - // Compare versions. - version_compare( $plugin_version, $latest_tag->version, '<' ); - - $this->_logger->departure( $has_new_version ? 'Found newer plugin version ' . $latest_tag->version : 'No new version' ); - - $is_latest_version_beta = ( 'beta' === $latest_tag->release_mode ); - - $this->_storage->beta_data = array( - 'is_beta' => $is_latest_version_beta, - 'version' => $latest_tag->version - ); - - return $has_new_version ? $latest_tag : false; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param bool|number $plugin_id - * @param bool $flush Since 1.1.7.3 - * @param int $expiration Since 1.2.2.7 - * @param bool|string $newer_than Since 2.2.1 - * - * @return bool|FS_Plugin_Tag - */ - function get_update( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $newer_than = false ) { - $this->_logger->entrance(); - - if ( ! is_numeric( $plugin_id ) ) { - $plugin_id = $this->_plugin->id; - } - - $this->check_updates( true, $plugin_id, $flush, $expiration, $newer_than ); - $updates = $this->get_all_updates(); - - return isset( $updates[ $plugin_id ] ) && is_object( $updates[ $plugin_id ] ) ? $updates[ $plugin_id ] : false; - } - - /** - * Check if site assigned with active license. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @deprecated Please use has_active_valid_license() instead because license can be cancelled. - */ - function has_active_license() { - return ( - is_object( $this->_license ) && - is_numeric( $this->_license->id ) && - ! $this->_license->is_expired() - ); - } - - /** - * Check if site assigned with active & valid (not expired) license. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1 - * - * @param bool $check_expiration - */ - function has_active_valid_license( $check_expiration = true ) { - return self::is_active_valid_license( $this->_license, $check_expiration ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - */ - function is_data_debug_mode() { - if ( is_null( $this->is_whitelabeled ) || ! $this->is_whitelabeled ) { - return false; - } - - $fs = $this->is_addon() ? - $this->get_parent_instance() : - $this; - - if ( $fs->is_network_active() && fs_is_network_admin() ) { - $is_developer_license_debug_mode = get_site_transient( "fs_{$this->get_id()}_data_debug_mode" ); - } else { - $is_developer_license_debug_mode = get_transient( "fs_{$this->get_id()}_data_debug_mode" ); - } - - return ( 'true' === $is_developer_license_debug_mode ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - */ - function _set_data_debug_mode() { - if ( ! $this->is_whitelabeled( true ) ) { - return; - } - - $license_or_user_key = fs_request_get( 'license_or_user_key' ); - - $transient_value = ( ! empty( $license_or_user_key ) ) ? - 'true' : - 'false'; - - if ( 'true' === $transient_value ) { - $stored_key = $this->_storage->get( ! FS_User::is_valid_id( $this->_storage->last_license_user_id ) ? - 'last_license_key' : - 'last_license_user_key' - ); - - if ( md5( $license_or_user_key ) !== $stored_key ) { - $this->shoot_ajax_failure( sprintf( - '%s... %s', - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ), - $this->get_text_inline( - 'seems like the key you entered doesn\'t match our records.', - 'developer-or-license-not-found' - ) - ) ); - } - } - - if ( $this->is_network_active() && fs_is_network_admin() ) { - set_site_transient( - "fs_{$this->get_id()}_data_debug_mode", - $transient_value, - WP_FS__TIME_24_HOURS_IN_SEC / 24 - ); - } else { - set_transient( - "fs_{$this->get_id()}_data_debug_mode", - $transient_value, - WP_FS__TIME_24_HOURS_IN_SEC / 24 - ); - } - - if ( 'true' === $transient_value ) { - $this->_admin_notices->add_sticky( - $this->get_text_inline( - 'Debug mode was successfully enabled and will be automatically disabled in 60 min. You can also disable it earlier by clicking the "Stop Debug" link.', - 'data_debug_mode_enabled' - ), - 'data_debug_mode_enabled' - ); - } - - $this->shoot_ajax_success(); - } - - /** - * Check if a given license is active & valid (not expired). - * - * @author Vova Feldman (@svovaf) - * @since 2.1.3 - * - * @param FS_Plugin_License $license - * @param bool $check_expiration - * - * @return bool - */ - private static function is_active_valid_license( $license, $check_expiration = true ) { - return ( - is_object( $license ) && - FS_Plugin_License::is_valid_id( $license->id ) && - $license->is_active() && - ( ! $check_expiration || $license->is_valid() ) - ); - } - - /** - * Checks if there's any site that is associated with an active & valid license. - * This logic is used to determine if the admin can download the premium code base from a network level admin. - * - * @author Vova Feldman (@svovaf) - * @since 2.1.3 - * - * @return bool - */ - function has_any_active_valid_license() { - if ( ! fs_is_network_admin() ) { - return $this->has_active_valid_license(); - } - - $installs = $this->get_blog_install_map(); - $all_plugin_licenses = self::get_all_licenses( $this->_module_id ); - - foreach ( $installs as $blog_id => $install ) { - if ( ! FS_Plugin_License::is_valid_id( $install->license_id ) ) { - continue; - } - - foreach ( $all_plugin_licenses as $license ) { - if ( $license->id == $install->license_id ) { - if ( self::is_active_valid_license( $license ) ) { - return true; - } - } - } - } - - return false; - } - - /** - * Check if site assigned with license with enabled features. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return bool - */ - function has_features_enabled_license() { - return ( - is_object( $this->_license ) && - is_numeric( $this->_license->id ) && - $this->_license->is_features_enabled() - ); - } - - /** - * Checks if the product is activated with a bundle license. - * - * @author Leo Fajardo (@leorw) - * @since 2.4.0 - * - * @return bool - */ - function is_activated_with_bundle_license() { - if ( ! $this->has_features_enabled_license() ) { - return false; - } - - return FS_Plugin_License::is_valid_id( $this->_license->parent_license_id ); - } - - /** - * Check if user is a trial or have feature enabled license. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7 - * - * @return bool - */ - function can_use_premium_code() { - return $this->is_trial() || $this->has_features_enabled_license(); - } - - /** - * Checks if the current user can activate plugins or switch themes. Note that this method should only be used - * after the `init` action is triggered because it is using `current_user_can()` which is only functional after - * the context user is authenticated. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - * - * @return bool - */ - function is_user_admin() { - /** - * Require a super-admin when network activated, running from the network level OR if - * running from the site level but not delegated the opt-in. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - if ( $this->_is_network_active && - ( fs_is_network_admin() || ! $this->is_delegated_connection() ) - ) { - return is_super_admin(); - } - - return ( $this->is_plugin() && current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) - || ( $this->is_theme() && current_user_can( 'switch_themes' ) ); - } - - /** - * Sync site's plan. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * - * @uses FS_Api - * - * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by - * the admin. - * @param bool $is_context_single_site @since 2.0.0. This is used when syncing a license for a single install from the - * network-level "Account" page. - * @param int|null $current_blog_id @since 2.2.3. This is passed from the `execute_cron` method and used by the - * `_sync_plugin_license` method in order to switch to the previous blog when sending - * updates for a single site in case `execute_cron` has switched to a different blog. - */ - private function _sync_license( $background = false, $is_context_single_site = false, $current_blog_id = null ) { - $this->_logger->entrance(); - - $plugin_id = fs_request_get( 'plugin_id', $this->get_id() ); - - $is_addon_sync = ( ! $this->_plugin->is_addon() && $plugin_id != $this->get_id() ); - - if ( $is_addon_sync ) { - $this->_sync_addon_license( $plugin_id, $background ); - } else { - $this->_sync_plugin_license( $background, true, $is_context_single_site, $current_blog_id ); - } - - $this->do_action( 'after_account_plan_sync', $this->get_plan_name() ); - } - - /** - * Sync plugin's add-on license. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * @uses FS_Api - * - * @param number $addon_id - * @param bool $background - */ - private function _sync_addon_license( $addon_id, $background ) { - $this->_logger->entrance(); - - if ( $this->is_addon_activated( $addon_id ) ) { - // If already installed, use add-on sync. - $fs_addon = self::get_instance_by_id( $addon_id ); - - if ( - // Add-on is network activated and network integrated. - $fs_addon->is_network_active() || - // Background sync cron. - self::is_cron() || - // Add-on is not network activated or not network integrated. - ! fs_is_network_admin() - ) { - $fs_addon->_sync_license( $background ); - - return; - } - } - - // Validate add-on exists. - $addon = $this->get_addon( $addon_id ); - - if ( ! is_object( $addon ) ) { - return; - } - - // Add add-on into account add-ons. - $account_addons = $this->get_account_addons(); - if ( ! is_array( $account_addons ) ) { - $account_addons = array(); - } - $account_addons[] = $addon->id; - $account_addons = array_unique( $account_addons ); - $this->_store_account_addons( $account_addons ); - - // Load add-on licenses. - $licenses = $this->_fetch_licenses( $addon->id ); - - // Sync add-on licenses. - if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) { - $this->_update_licenses( $licenses, $addon->id ); - - if ( ! $this->is_addon_installed( $addon->id ) && FS_License_Manager::has_premium_license( $licenses ) ) { - $plans_result = $this->get_api_site_or_plugin_scope()->get( $this->add_show_pending( "/addons/{$addon_id}/plans.json" ) ); - - if ( ! isset( $plans_result->error ) ) { - $plans = array(); - foreach ( $plans_result->plans as $plan ) { - $plans[] = new FS_Plugin_Plan( $plan ); - } - - $this->_admin_notices->add_sticky( - sprintf( - ( FS_Plan_Manager::instance()->has_free_plan( $plans ) ? - $this->get_text_inline( 'Your %s Add-on plan was successfully upgraded.', 'addon-successfully-upgraded-message' ) : - /* translators: %s:product name, e.g. Facebook add-on was successfully... */ - $this->get_text_inline( '%s Add-on was successfully purchased.', 'addon-successfully-purchased-message' ) ), - $addon->title - ) . ' ' . $this->get_latest_download_link( - $this->get_text_inline( 'Download the latest version', 'download-latest-version' ), - $addon_id - ), - 'addon_plan_upgraded_' . $addon->slug, - $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' - ); - } - } - } - } - - /** - * Sync site's plugin plan. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * @uses FS_Api - * - * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by the admin. - * @param bool $send_installs_update Since 2.0.0 - * @param bool $is_context_single_site Since 2.0.0. This is used when sending an update for a single install and - * syncing its license from the network-level "Account" page (e.g.: after - * activating a license only for the single install). - * @param int|null $current_blog_id Since 2.2.3. This is passed from the `execute_cron` method so that it - * can be used here to switch to the previous blog in case `execute_cron` - * has switched to a different blog. - */ - private function _sync_plugin_license( - $background = false, - $send_installs_update = true, - $is_context_single_site = false, - $current_blog_id = null - ) { - $this->_logger->entrance(); - - $plan_change = 'none'; - - $is_site_level_sync = ( $is_context_single_site || fs_is_blog_admin() || ! $this->_is_network_active ); - - if ( ! $send_installs_update ) { - $site = $this->_site; - } else { - /** - * Sync site info. - * - * @todo This line will execute install sync on a daily basis, even if running the free version (for opted-in users). The reason we want to keep it that way is for cases when the user was a paying customer, then there was a failure in subscription payment, and then after some time the payment was successful. This could be heavily optimized. For example, we can skip the $flush if the current install was never associated with a paid version. - */ - if ( $is_site_level_sync ) { - /** - * Switch to the previous blog since `execute_cron` may have switched to a different blog. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - if ( is_numeric( $current_blog_id ) ) { - $this->switch_to_blog( $current_blog_id ); - } - - $result = $this->send_install_update( array(), true ); - $is_valid = $this->is_api_result_entity( $result ); - } else { - $result = $this->send_installs_update( array(), true ); - $is_valid = $this->is_api_result_object( $result, 'installs' ); - } - - if ( ! $is_valid ) { - if ( $is_context_single_site ) { - // Switch back to the main blog so that the following logic will have the right entities. - $this->switch_to_blog( $this->_storage->network_install_blog_id ); - } - - // Show API messages only if not background sync or if paying customer. - if ( ! $background || $this->is_paying() ) { - // Try to ping API to see if not blocked. - if ( ! FS_Api::test() ) { - /** - * Failed to ping API - blocked! - * - * @author Vova Feldman (@svovaf) - * @since 1.1.6 Only show message related to one of the Freemius powered plugins. Once it will be resolved it will fix the issue for all plugins anyways. There's no point to scare users with multiple error messages. - */ - $api = $this->get_api_site_scope(); - - if ( ! self::$_global_admin_notices->has_sticky( 'api_blocked' ) ) { - self::$_global_admin_notices->add( - sprintf( - $this->get_text_inline( 'Your server is blocking the access to Freemius\' API, which is crucial for %1$s synchronization. Please contact your host to whitelist %2$s', 'server-blocking-access' ), - $this->get_plugin_name(), - '' . implode( ', ', $this->apply_filters( 'api_domains', array( - 'api.freemius.com', - 'wp.freemius.com' - ) ) ) . '' - ) . '
    ' . $this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . var_export( $result->error, true ), - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error', - $background, - 'api_blocked' - ); - } - } else { - // Authentication params are broken. - $this->_admin_notices->add( - $this->get_text_inline( 'It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again.', 'wrong-authentication-param-message' ) . '
    ' . $this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . var_export( $result->error, true ), - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error' - ); - } - } - - // No reason to continue with license sync while there are API issues. - return; - } - - if ( $is_site_level_sync ) { - $site = new FS_Site( $result ); - } else { - // Map site addresses to their blog IDs. - $address_to_blog_map = $this->get_address_to_blog_map(); - - // Find the current context install. - $site = null; - foreach ( $result->installs as $install ) { - if ( $install->id == $this->_site->id ) { - $site = new FS_Site( $install ); - } else { - $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); - $blog_id = $address_to_blog_map[ $address ]; - - $this->_store_site( true, $blog_id, new FS_Site( $install ) ); - } - } - } - - // Sync plans. - $this->_sync_plans(); - } - - // Remove sticky API connectivity message. - self::$_global_admin_notices->remove_sticky( 'api_blocked' ); - - if ( ! $this->has_paid_plan() ) { - $this->_site = $site; - $this->_store_site( - true, - $is_site_level_sync ? - null : - $this->get_network_install_blog_id() - ); - } else { - $context_blog_id = 0; - - if ( $is_context_single_site ) { - $context_blog_id = get_current_blog_id(); - - // Switch back to the main blog in order to properly sync the license. - $this->switch_to_blog( $this->_storage->network_install_blog_id ); - } - - /** - * Sync licenses. Pass the site's license ID so that the foreign licenses will be fetched if the license - * associated with that ID is not included in the user's licenses collection. - */ - $this->_sync_licenses( - $site->license_id, - ( $is_context_single_site ? - $context_blog_id : - null - ) - ); - - if ( $is_context_single_site ) { - $this->switch_to_blog( $context_blog_id ); - } - - // Check if plan / license changed. - if ( $site->plan_id != $this->_site->plan_id || - // Check if trial started. - $site->trial_plan_id != $this->_site->trial_plan_id || - $site->trial_ends != $this->_site->trial_ends || - // Check if license changed. - $site->license_id != $this->_site->license_id - ) { - if ( $site->is_trial() && ( ! $this->_site->is_trial() || $site->trial_ends != $this->_site->trial_ends ) ) { - // New trial started. - $this->_site = $site; - $plan_change = 'trial_started'; - - // For trial with subscription use-case. - $new_license = is_null( $site->license_id ) ? null : $this->_get_license_by_id( $site->license_id ); - - if ( is_object( $new_license ) && $new_license->is_valid() ) { - $this->_site = $site; - $this->_update_site_license( $new_license ); - $this->_store_licenses(); - - $this->_sync_site_subscription( $this->_license ); - } - } else if ( $this->_site->is_trial() && ! $site->is_trial() && ! is_numeric( $site->license_id ) ) { - // Was in trial, but now trial expired and no license ID. - // New trial started. - $this->_site = $site; - $plan_change = 'trial_expired'; - } else { - $is_free = $this->is_free_plan(); - - // Make sure license exist and not expired. - $new_license = is_null( $site->license_id ) ? - null : - $this->_get_license_by_id( $site->license_id ); - - if ( $is_free && is_null( $new_license ) && $this->has_any_license() && $this->_license->is_cancelled ) { - // License cancelled. - $this->_site = $site; - $this->_update_site_license( $new_license ); - $this->_store_licenses(); - - $plan_change = 'cancelled'; - } else if ( $is_free && ( ( ! is_object( $new_license ) || $new_license->is_expired() ) ) ) { - // The license is expired, so ignore upgrade method. - $this->_site = $site; - } else { - // License changed. - $this->_site = $site; - - /** - * IMPORTANT: - * The line below should be executed before trying to activate the license on the rest of the network, otherwise, the license' activation counters may be out of sync + there's no need to activate the license on the context site since it's already activated on it. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - $this->_update_site_license( $new_license ); - - if ( ! $is_context_single_site && - fs_is_network_admin() && - $this->_is_network_active && - $new_license->quota > 1 && - get_blog_count() > 1 - ) { - // See if license can activated on all sites. - if ( ! $this->try_activate_license_on_network( $this->_user, $new_license ) ) { - if ( ! fs_request_get_bool( 'auto_install' ) ) { - // Open the license activation dialog box on the account page. - add_action( 'admin_footer', array( - &$this, - '_open_license_activation_dialog_box' - ) ); - } - } - } - - $this->_store_licenses(); - - $plan_change = $is_free ? - ( $this->is_only_premium() ? 'activated' : 'upgraded' ) : - ( is_object( $new_license ) ? - 'changed' : - 'downgraded' ); - } - } - - // Store updated site info. - $this->_store_site( - true, - $is_site_level_sync ? - null : - $this->get_network_install_blog_id() - ); - } else { - if ( ! is_object( $this->_license ) ) { - $this->maybe_update_whitelabel_flag( - FS_Plugin_License::is_valid_id( $site->license_id ) ? - $this->get_license_by_id( $site->license_id ) : - null - ); - } else { - $this->maybe_update_whitelabel_flag( $this->_license ); - - if ( $this->_license->is_expired() ) { - if ( ! $this->has_features_enabled_license() ) { - $this->_deactivate_license(); - $plan_change = 'downgraded'; - } else { - $last_time_expired_license_notice_was_shown = $this->_storage->get( 'expired_license_notice_shown', 0 ); - - if ( time() - ( 14 * WP_FS__TIME_24_HOURS_IN_SEC ) >= $last_time_expired_license_notice_was_shown ) { - /** - * Show the expired license notice every 14 days. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - */ - $plan_change = 'expired'; - } - } - } - } - - if ( is_numeric( $site->license_id ) && is_object( $this->_license ) ) { - $this->_sync_site_subscription( $this->_license ); - } - } - - if ( $this->is_addon() || $this->has_addons() ) { - /** - * Purge the valid user licenses cache so that when the "Account" or the "Add-Ons" page is loaded, - * an updated valid user licenses collection will be fetched from the server which is used to also - * update the account add-ons (add-ons the user has licenses for). - * - * @author Leo Fajardo (@leorw) - * @since 2.2.4 - */ - $this->purge_valid_user_licenses_cache(); - } - } - - $hmm_text = $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...'; - - if ( $this->apply_filters( 'has_paid_plan_account', $this->has_paid_plan() ) ) { - switch ( $plan_change ) { - case 'none': - if ( ! $background && is_admin() ) { - $plan = $this->is_trial() ? - $this->get_trial_plan() : - $this->get_plan(); - - if ( $plan->is_free() ) { - $this->_admin_notices->add( - sprintf( - $this->get_text_inline( 'It looks like you are still on the %s plan. If you did upgrade or change your plan, it\'s probably an issue on our side - sorry.', 'plan-did-not-change-message' ), - '' . $plan->title . ( $this->is_trial() ? ' ' . $this->get_text_x_inline( 'Trial', 'trial period', 'trial' ) : '' ) . '' - ) . ' ' . sprintf( - '%s', - $this->contact_url( - 'bug', - sprintf( $this->get_text_inline( 'I have upgraded my account but when I try to Sync the License, the plan remains %s.', 'plan-did-not-change-email-message' ), - strtoupper( $plan->name ) - ) - ), - $this->get_text_inline( 'Please contact us here', 'contact-us-here' ) - ), - $hmm_text - ); - } - } - break; - case 'upgraded': - case 'activated': - $this->_admin_notices->add_sticky( - ( 'activated' === $plan_change ) ? - $this->get_text_inline( 'Your plan was successfully activated.', 'plan-activated-message' ) : - $this->get_text_inline( 'Your plan was successfully upgraded.', 'plan-upgraded-message' ) . - $this->get_complete_upgrade_instructions(), - 'plan_upgraded', - $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' - ); - - $this->_admin_notices->remove_sticky( array( - 'trial_started', - 'trial_promotion', - 'trial_expired', - 'activation_complete', - 'license_expired', - ) ); - break; - case 'changed': - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( 'Your plan was successfully changed to %s.', 'plan-changed-to-x-message' ), - $this->get_plan_title() - ), - 'plan_changed' - ); - - $this->_admin_notices->remove_sticky( array( - 'trial_started', - 'trial_promotion', - 'trial_expired', - 'activation_complete', - ) ); - break; - case 'downgraded': - $this->_admin_notices->add_sticky( - ($this->has_free_plan() ? - sprintf( $this->get_text_inline( 'Your license has expired. You can still continue using the free %s forever.', 'license-expired-blocking-message' ), $this->_module_type ) : - /* translators: %1$s: product title; %2$s, %3$s: wrapping HTML anchor element; %4$s: 'plugin', 'theme', or 'add-on'. */ - sprintf( $this->get_text_inline( 'Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions.', 'license-expired-blocking-message_premium-only' ), sprintf('', $this->pricing_url()), '', $this->get_module_label(true) ) ), - 'license_expired', - $hmm_text - ); - $this->_admin_notices->remove_sticky( 'plan_upgraded' ); - break; - case 'cancelled': - $this->_admin_notices->add( - $this->get_text_inline( 'Your license has been cancelled. If you think it\'s a mistake, please contact support.', 'license-cancelled' ) . ' ' . - sprintf( - '%s', - $this->contact_url( 'bug' ), - $this->get_text_inline( 'Please contact us here', 'contact-us-here' ) - ), - $hmm_text, - 'error' - ); - $this->_admin_notices->remove_sticky( 'plan_upgraded' ); - break; - case 'expired': - $this->_admin_notices->add_sticky( - sprintf( $this->get_text_inline( 'Your license has expired. You can still continue using all the %s features, but you\'ll need to renew your license to continue getting updates and support.', 'license-expired-non-blocking-message' ), $this->get_plan()->title ), - 'license_expired', - $hmm_text - ); - - $this->_storage->expired_license_notice_shown = WP_FS__SCRIPT_START_TIME; - - $this->_admin_notices->remove_sticky( 'plan_upgraded' ); - break; - case 'trial_started': - $this->_admin_notices->add_sticky( - sprintf( - $this->get_text_inline( 'Your trial has been successfully started.', 'trial-started-message' ), - '' . $this->get_plugin_name() . '' - ) . $this->get_complete_upgrade_instructions( $this->get_trial_plan()->title ), - 'trial_started', - $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' - ); - - $this->_admin_notices->remove_sticky( array( - 'trial_promotion', - ) ); - break; - case 'trial_expired': - $this->_admin_notices->add_sticky( - ($this->has_free_plan() ? - $this->get_text_inline( 'Your free trial has expired. You can still continue using all our free features.', 'trial-expired-message' ) : - /* translators: %1$s: product title; %2$s, %3$s: wrapping HTML anchor element; %4$s: 'plugin', 'theme', or 'add-on'. */ - sprintf( $this->get_text_inline( 'Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions.', 'trial-expired-message_premium-only' ), sprintf('', $this->pricing_url()), '', $this->get_module_label(true))), - 'trial_expired', - $hmm_text - ); - $this->_admin_notices->remove_sticky( array( - 'trial_started', - 'trial_promotion', - 'plan_upgraded', - ) ); - break; - } - } - - if ( 'none' !== $plan_change ) { - if ( - ! is_object( $this->_license ) || - ! $this->_license->is_whitelabeled - ) { - $this->_admin_notices->remove_sticky( 'license_whitelabeled' ); - } - - $this->do_action( 'after_license_change', $plan_change, $this->get_plan() ); - } - } - - /** - * Include the required JS at the footer of the admin to trigger the license activation dialog box. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - */ - public function _open_license_activation_dialog_box() { - $vars = array( 'license_id' => $this->_site->license_id ); - fs_require_once_template( 'js/open-license-activation.php', $vars ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param bool $background - * @param FS_Plugin_License|null $premium_license - */ - protected function _activate_license( $background = false, $premium_license = null ) { - $this->_logger->entrance(); - - if ( is_null( $premium_license ) ) { - $license_id = fs_request_get( 'license_id' ); - - if ( is_object( $this->_site ) && - FS_Plugin_License::is_valid_id( $license_id ) && - $license_id == $this->_site->license_id - ) { - // License is already activated. - return; - } - - $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ? - $this->_get_license_by_id( $license_id ) : - $this->_get_available_premium_license(); - } - - if ( ! is_object( $premium_license ) ) { - return; - } - - if ( ! is_object( $this->_site ) ) { - // Not yet opted-in. - $user = $this->get_current_or_network_user(); - if ( ! is_object( $user ) ) { - $user = self::_get_user_by_id( $premium_license->user_id ); - } - - if ( is_object( $user ) ) { - $this->install_with_user( $user, $premium_license->secret_key, false, false, false ); - } else { - $this->opt_in( - false, - false, - false, - $premium_license->secret_key - ); - - return; - } - } - - - /** - * If the premium license is already associated with the install, just - * update the license reference (activation is not required). - * - * @since 1.1.9 - */ - if ( $premium_license->id == $this->_site->license_id ) { - // License is already activated. - $this->_update_site_license( $premium_license ); - $this->_store_account(); - - return; - } - - if ( $this->_site->user_id != $premium_license->user_id ) { - $api_request_params = array( 'license_key' => $premium_license->secret_key ); - } else { - $api_request_params = array(); - } - - $api = $this->get_api_site_scope(); - $license = $api->call( "/licenses/{$premium_license->id}.json?is_enriched=true", 'put', $api_request_params ); - - if ( ! $this->is_api_result_entity( $license ) ) { - if ( ! $background ) { - $this->_admin_notices->add( sprintf( - '%s %s', - $this->get_text_inline( 'It looks like the license could not be activated.', 'license-activation-failed-message' ), - ( is_object( $license ) && isset( $license->error ) ? - $license->error->message : - sprintf( '%s
    %s', - $this->get_text_inline( 'Error received from the server:', 'server-error-message' ), - var_export( $license, true ) - ) - ) - ), - $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...', - 'error' - ); - } - - return; - } - - $premium_license = new FS_Plugin_License( $license ); - - // Updated site plan. - $site = $this->get_api_site_scope()->get( '/', true ); - if ( $this->is_api_result_entity( $site ) ) { - $this->_site = new FS_Site( $site ); - } - $this->_update_site_license( $premium_license ); - - $this->_store_account(); - - if ( $this->is_addon() || $this->has_addons() ) { - /** - * Purge the valid user licenses cache so that when the "Account" or the "Add-Ons" page is loaded, - * an updated valid user licenses collection will be fetched from the server which is used to also - * update the account add-ons (add-ons the user has licenses for). - * - * @author Leo Fajardo (@leorw) - * @since 2.2.4 - */ - $this->purge_valid_user_licenses_cache(); - } - - if ( ! $background ) { - $this->_admin_notices->add_sticky( - $this->get_text_inline( 'Your license was successfully activated.', 'license-activated-message' ) . - $this->get_complete_upgrade_instructions(), - 'license_activated', - $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' - ); - } - - $this->_admin_notices->remove_sticky( array( - 'trial_promotion', - 'license_expired', - ) ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.5 - * - * @param bool $show_notice - */ - protected function _deactivate_license( $show_notice = true ) { - $this->_logger->entrance(); - - $hmm_text = $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...'; - - if ( ! FS_Plugin_License::is_valid_id( $this->_site->license_id ) ) { - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'It looks like your site currently doesn\'t have an active license.', 'no-active-license-message' ), $this->get_plan_title() ), - $hmm_text - ); - - return; - } - - $api = $this->get_api_site_scope(); - $license = $api->call( "/licenses/{$this->_site->license_id}.json", 'delete' ); - - $this->handle_license_deactivation_result( $license, $hmm_text, $show_notice ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - * - * @param FS_Plugin_License $license - * @param bool|string $hmm_text - * @param bool $show_notice - */ - private function handle_license_deactivation_result( $license, $hmm_text = false, $show_notice = true ) { - if ( isset( $license->error ) ) { - $this->_admin_notices->add( - $this->get_text_inline( 'It looks like the license deactivation failed.', 'license-deactivation-failed-message' ) . '
    ' . - $this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . ' ' . var_export( $license->error, true ), - $hmm_text, - 'error' - ); - - return; - } - - // Update license cache. - if ( is_array( $this->_licenses ) ) { - for ( $i = 0, $len = count( $this->_licenses ); $i < $len; $i ++ ) { - if ( $license->id == $this->_licenses[ $i ]->id ) { - $this->_licenses[ $i ] = new FS_Plugin_License( $license ); - } - } - } - - // Update site plan to default. - $this->_sync_plans(); - $this->_site->plan_id = $this->_plans[0]->id; - // Unlink license from site. - $this->_update_site_license( null ); - - $this->_store_account(); - - if ( $show_notice ) { - $this->_admin_notices->add( - sprintf( $this->is_only_premium() ? - $this->get_text_inline( 'Your %s license was successfully deactivated.', 'license-deactivation-message_premium-only' ) : - $this->get_text_inline( 'Your license was successfully deactivated, you are back to the %s plan.', 'license-deactivation-message' ), - $this->get_plan_title() - ), - $this->get_text_inline( 'O.K', 'ok' ) - ); - } - - $this->_admin_notices->remove_sticky( array( - 'plan_upgraded', - 'license_activated', - ) ); - } - - /** - * Site plan downgrade. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @return object - * - * @uses FS_Api - */ - private function _downgrade_site() { - $this->_logger->entrance(); - - $deactivate_license = fs_request_get_bool( 'deactivate_license' ); - - $api = $this->get_api_site_scope(); - $site = $api->call( 'downgrade.json', 'put', array( 'deactivate_license' => $deactivate_license ) ); - - $plan_downgraded = false; - $plan = false; - if ( $this->is_api_result_entity( $site ) ) { - $prev_plan_id = $this->_site->plan_id; - - // Update new site plan id. - $this->_site->plan_id = $site->plan_id; - - $plan = $this->get_plan(); - $subscription = $this->_sync_site_subscription( $this->_license ); - - // Plan downgraded if plan was changed or subscription was cancelled. - $plan_downgraded = ( $plan instanceof FS_Plugin_Plan && $prev_plan_id != $plan->id ) || - ( is_object( $subscription ) && ! isset( $subscription->error ) && ! $subscription->is_active() ); - } else { - // handle different error cases. - $this->handle_license_deactivation_result( - $site, - $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...' - ); - } - - if ( ! $plan_downgraded ) { - return (object) array( - 'error' => (object) array( - 'message' => $this->get_text_inline( 'Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes.', 'subscription-cancellation-failure-message' ) - ) - ); - } - - // Remove previous sticky message about upgrade (if exist). - $this->_admin_notices->remove_sticky( 'plan_upgraded' ); - - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Your subscription was successfully cancelled. Your %s plan license will expire in %s.', 'plan-x-downgraded-message' ), - $plan->title, - human_time_diff( time(), strtotime( $this->_license->expiration ) ) - ) - ); - - // Store site updates. - $this->_store_site(); - - if ( $deactivate_license && - ! FS_Plugin_License::is_valid_id( $site->license_id ) - ) { - if ( $this->_site->is_localhost() ) { - $this->_license->activated_local = max( 0, $this->_license->activated_local - 1 ); - } else { - $this->_license->activated = max( 0, $this->_license->activated - 1 ); - } - - // Handle successful license deactivation result. - $this->handle_license_deactivation_result( $this->_license ); - } - - return $site; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.8.1 - * - * @param bool|string $plan_name - * - * @return bool If trial was successfully started. - */ - function start_trial( $plan_name = false ) { - $this->_logger->entrance(); - - // Alias. - $oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...'; - - if ( $this->is_trial() ) { - // Already in trial mode. - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'You are already running the %s in a trial mode.', 'in-trial-mode' ), $this->_module_type ), - $oops_text, - 'error' - ); - - return false; - } - - if ( $this->_site->is_trial_utilized() ) { - // Trial was already utilized. - $this->_admin_notices->add( - $this->get_text_inline( 'You already utilized a trial before.', 'trial-utilized' ), - $oops_text, - 'error' - ); - - return false; - } - - if ( false !== $plan_name ) { - $plan = $this->get_plan_by_name( $plan_name ); - - if ( false === $plan ) { - // Plan doesn't exist. - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Plan %s do not exist, therefore, can\'t start a trial.', 'trial-plan-x-not-exist' ), $plan_name ), - $oops_text, - 'error' - ); - - return false; - } - - if ( ! $plan->has_trial() ) { - // Plan doesn't exist. - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Plan %s does not support a trial period.', 'plan-x-no-trial' ), $plan_name ), - $oops_text, - 'error' - ); - - return false; - } - } else { - if ( ! $this->has_trial_plan() ) { - // None of the plans have a trial. - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'None of the %s\'s plans supports a trial period.', 'no-trials' ), $this->_module_type ), - $oops_text, - 'error' - ); - - return false; - } - - $plans_with_trial = FS_Plan_Manager::instance()->get_trial_plans( $this->_plans ); - - $plan = $plans_with_trial[0]; - } - - $api = $this->get_api_site_scope(); - $plan = $api->call( "plans/{$plan->id}/trials.json", 'post' ); - - if ( ! $this->is_api_result_entity( $plan ) ) { - // Some API error while trying to start the trial. - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) - . ' ' . var_export( $plan, true ), - $oops_text, - 'error' - ); - - return false; - } - - // Sync license. - $this->_sync_license(); - - return $this->is_trial(); - } - - /** - * Cancel site trial. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return object - * - * @uses FS_Api - */ - private function _cancel_trial() { - $this->_logger->entrance(); - - if ( ! $this->is_trial() ) { - return (object) array( - 'error' => (object) array( - 'message' => $this->get_text_inline( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'trial-cancel-no-trial-message' ) - ) - ); - } - - $trial_plan = $this->get_trial_plan(); - - $api = $this->get_api_site_scope(); - $site = $api->call( 'trials.json', 'delete' ); - - $trial_cancelled = false; - - if ( $this->is_api_result_entity( $site ) ) { - $prev_trial_ends = $this->_site->trial_ends; - - if ( $this->is_paid_trial() ) { - $this->_license->expiration = $site->trial_ends; - $this->_license->is_cancelled = true; - $this->_update_site_license( $this->_license ); - $this->_store_licenses(); - - // Clear subscription reference. - $this->_sync_site_subscription( null ); - } - - // Update site info. - $this->_site = new FS_Site( $site ); - - $trial_cancelled = ( $prev_trial_ends != $site->trial_ends ); - } else { - // @todo handle different error cases. - } - - if ( ! $trial_cancelled ) { - return (object) array( - 'error' => (object) array( - 'message' => $this->get_text_inline( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'trial-cancel-failure-message' ) - ) - ); - } - - // Remove previous sticky messages about upgrade or trial (if exist). - $this->_admin_notices->remove_sticky( array( - 'trial_started', - 'trial_promotion', - 'plan_upgraded', - ) ); - - // Store site updates. - $this->_store_site(); - - if ( ! $this->is_addon() || - ! $this->deactivate_premium_only_addon_without_license( true ) - ) { - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Your %s free trial was successfully cancelled.', 'trial-cancel-message' ), $trial_plan->title ) - ); - } - - return $site; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param bool|number $plugin_id - * - * @return bool - */ - private function _is_addon_id( $plugin_id ) { - return is_numeric( $plugin_id ) && ( $this->get_id() != $plugin_id ); - } - - /** - * Check if user eligible to download premium version updates. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @return bool - */ - private function _can_download_premium() { - return $this->has_any_active_valid_license() || - ( $this->is_trial() && ! $this->get_trial_plan()->is_free() ); - } - - /** - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - * - * @param bool|number $addon_id - * @param string $type "json" or "zip" - * - * @return string - */ - private function _get_latest_version_endpoint( $addon_id = false, $type = 'json' ) { - - $is_addon = $this->_is_addon_id( $addon_id ); - - $is_premium = null; - if ( ! $is_addon ) { - $is_premium = ( $this->is_premium() || $this->_can_download_premium() ); - } else if ( $this->is_addon_activated( $addon_id ) ) { - $fs_addon = self::get_instance_by_id( $addon_id ); - $is_premium = ( $fs_addon->is_premium() || $fs_addon->_can_download_premium() ); - } - - // If add-on, then append add-on ID. - $endpoint = ( $is_addon ? "/addons/$addon_id" : '' ) . - '/updates/latest.' . $type; - - // If add-on and not yet activated, try to fetch based on server licensing. - if ( is_bool( $is_premium ) ) { - $endpoint = add_query_arg( 'is_premium', json_encode( $is_premium ), $endpoint ); - } - - if ( $this->has_secret_key() ) { - $endpoint = add_query_arg( 'type', 'all', $endpoint ); - } else if ( $this->is_registered() && $this->_user->is_beta() ) { - $endpoint = add_query_arg( 'type', 'beta', $endpoint ); - } - - return $endpoint; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param bool|number $addon_id - * @param bool $flush Since 1.1.7.3 - * @param int $expiration Since 1.2.2.7 - * @param bool|string $newer_than Since 2.2.1 - * @param bool|string $fetch_readme Since 2.2.1 - * - * @return object|false Plugin latest tag info. - */ - function _fetch_latest_version( - $addon_id = false, - $flush = true, - $expiration = WP_FS__TIME_24_HOURS_IN_SEC, - $newer_than = false, - $fetch_readme = true - ) { - $this->_logger->entrance(); - - $switch_to_blog_id = null; - - /** - * @since 1.1.7.3 Check for plugin updates from Freemius only if opted-in. - * @since 1.1.7.4 Also check updates for add-ons. - */ - if ( ! $this->is_registered() && - ! $this->_is_addon_id( $addon_id ) - ) { - if ( ! is_multisite() ) { - return false; - } - - $installs_map = $this->get_blog_install_map(); - - foreach ( $installs_map as $blog_id => $install ) { - /** - * @var FS_Site $install - */ - if ( $install->is_trial() ) { - $switch_to_blog_id = $blog_id; - break; - } - - if ( FS_Plugin_License::is_valid_id( $install->license_id ) ) { - $license = $this->get_license_by_id( $install->license_id ); - - if ( is_object( $license ) && $license->is_features_enabled() ) { - $switch_to_blog_id = $blog_id; - break; - } - } - } - - if ( is_null( $switch_to_blog_id ) ) { - return false; - } - } - - $current_blog_id = is_numeric( $switch_to_blog_id ) ? - get_current_blog_id() : - 0; - - if ( is_numeric( $switch_to_blog_id ) ) { - $this->switch_to_blog( $switch_to_blog_id ); - } - - $latest_version_endpoint = $this->_get_latest_version_endpoint( $addon_id, 'json' ); - - if ( ! empty( $newer_than ) ) { - $latest_version_endpoint = add_query_arg( 'newer_than', $newer_than, $latest_version_endpoint ); - } - - if ( true === $fetch_readme ) { - $latest_version_endpoint = add_query_arg( 'readme', 'true', $latest_version_endpoint ); - } - - $tag = $this->get_api_site_or_plugin_scope()->get( - $latest_version_endpoint, - $flush, - $expiration - ); - - if ( is_numeric( $switch_to_blog_id ) ) { - $this->switch_to_blog( $current_blog_id ); - } - - $latest_version = ( is_object( $tag ) && isset( $tag->version ) ) ? $tag->version : 'couldn\'t get'; - - $this->_logger->departure( 'Latest version ' . $latest_version ); - - return ( is_object( $tag ) && isset( $tag->version ) ) ? $tag : false; - } - - #---------------------------------------------------------------------------------- - #region Download Plugin - #---------------------------------------------------------------------------------- - - /** - * Download latest plugin version, based on plan. - * - * Not like _download_latest(), this will redirect the page - * to secure download url to prevent dual download (from FS to WP server, - * and then from WP server to the client / browser). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param bool|number $plugin_id - * - * @uses FS_Api - * @uses wp_redirect() - */ - private function download_latest_directly( $plugin_id = false ) { - $this->_logger->entrance(); - - wp_redirect( $this->get_latest_download_api_url( $plugin_id ) ); - } - - /** - * Get latest plugin FS API download URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param bool|number $plugin_id - * - * @return string - */ - private function get_latest_download_api_url( $plugin_id = false ) { - $this->_logger->entrance(); - - return $this->get_api_site_scope()->get_signed_url( - $this->_get_latest_version_endpoint( $plugin_id, 'zip' ) - ); - } - - /** - * Get payment invoice URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.0 - * - * @param bool|number $payment_id - * - * @return string - */ - function _get_invoice_api_url( $payment_id = false ) { - $this->_logger->entrance(); - - $url = $this->get_api_user_scope()->get_signed_url( - "/payments/{$payment_id}/invoice.pdf" - ); - - if ( ! fs_starts_with( $url, 'https://' ) ) { - // Always use HTTPS for invoices. - $url = 'https' . substr( $url, 4 ); - } - - return $url; - } - - /** - * Get latest plugin download link. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param string $label - * @param bool|number $plugin_id - * - * @return string - */ - private function get_latest_download_link( $label, $plugin_id = false ) { - return sprintf( - '%s', - $this->_get_latest_download_local_url( $plugin_id ), - $label - ); - } - - /** - * Get latest plugin download local URL. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param bool|number $plugin_id - * - * @return string - */ - function _get_latest_download_local_url( $plugin_id = false ) { - // Add timestamp to protect from caching. - $params = array( 'ts' => WP_FS__SCRIPT_START_TIME ); - - if ( ! empty( $plugin_id ) ) { - $params['plugin_id'] = $plugin_id; - } else if ( $this->is_addon() ) { - $params['plugin_id'] = $this->get_id(); - } - - $fs = $this->is_addon() ? - $this->get_parent_instance() : - $this; - - return $this->apply_filters( 'download_latest_url', $fs->get_account_url( 'download_latest', $params ) ); - } - - #endregion Download Plugin ------------------------------------------------------------------ - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @uses FS_Api - * - * @param bool $background Hints the method if it's a background updates check. If false, it means that - * was initiated by the admin. - * @param bool|number $plugin_id - * @param bool $flush Since 1.1.7.3 - * @param int $expiration Since 1.2.2.7 - * @param bool|string $newer_than Since 2.2.1 - */ - private function check_updates( - $background = false, - $plugin_id = false, - $flush = true, - $expiration = WP_FS__TIME_24_HOURS_IN_SEC, - $newer_than = false - ) { - $this->_logger->entrance(); - - // Check if there's a newer version for download. - $new_version = $this->_fetch_newer_version( $plugin_id, $flush, $expiration, $newer_than ); - - $update = null; - if ( is_object( $new_version ) ) { - $update = new FS_Plugin_Tag( $new_version ); - - if ( ! $background ) { - $this->_admin_notices->add( - sprintf( - /* translators: %s: Numeric version number (e.g. '2.1.9' */ - $this->get_text_inline( 'Version %s was released.', 'version-x-released' ) . ' ' . $this->get_text_inline( 'Please download %s.', 'please-download-x' ), - $update->version, - sprintf( - '%s', - $this->get_account_url( 'download_latest' ), - sprintf( - /* translators: %s: plan name (e.g. latest "Professional" version) */ - $this->get_text_inline( 'the latest %s version here', 'latest-x-version' ), - $this->get_plan_title() - ) - ) - ), - $this->get_text_inline( 'New', 'new' ) . '!' - ); - } - } else if ( false === $new_version && ! $background ) { - $this->_admin_notices->add( - $this->get_text_inline( 'Seems like you got the latest release.', 'you-have-latest' ), - $this->get_text_inline( 'You are all good!', 'you-are-good' ) - ); - } - - $this->_store_update( $update, true, $plugin_id ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param bool $flush Since 1.1.7.3 add 24 hour cache by default. - * - * @return FS_Plugin[] - * - * @uses FS_Api - */ - private function sync_addons( $flush = false ) { - $this->_logger->entrance(); - - $api = $this->get_api_site_or_plugin_scope(); - - $path = $this->add_show_pending( '/addons.json?enriched=true&count=50' ); - - /** - * @since 1.2.1 - * - * If there's a cached version of the add-ons and not asking - * for a flush, just use the currently stored add-ons. - */ - if ( ! $flush && $api->is_cached( $path ) ) { - $addons = self::get_all_addons(); - - return isset( $addons[ $this->_plugin->id ] ) ? - $addons[ $this->_plugin->id ] : - array(); - } - - $result = $api->get( $path, $flush ); - - $addons = array(); - if ( $this->is_api_result_object( $result, 'plugins' ) && - is_array( $result->plugins ) - ) { - for ( $i = 0, $len = count( $result->plugins ); $i < $len; $i ++ ) { - $addons[ $i ] = new FS_Plugin( $result->plugins[ $i ] ); - } - - $this->_store_addons( $addons, true ); - } - - return $addons; - } - - /** - * Handle user email update. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * @uses FS_Api - * - * @param string $new_email - * - * @return object - */ - private function update_email( $new_email ) { - $this->_logger->entrance(); - - - $api = $this->get_api_user_scope(); - $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,email,is_verified", 'put', array( - 'email' => $new_email, - 'after_email_confirm_url' => $this->_get_admin_page_url( - 'account', - array( 'fs_action' => 'sync_user' ) - ), - ) ); - - if ( ! isset( $user->error ) ) { - $this->_user->email = $user->email; - $this->_user->is_verified = $user->is_verified; - $this->_store_user(); - } else { - // handle different error cases. - - } - - return $user; - } - - #---------------------------------------------------------------------------------- - #region API Error Handling - #---------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.1 - * - * @param mixed $result - * - * @return bool Is API result contains an error. - */ - private function is_api_error( $result ) { - return FS_Api::is_api_error( $result ); - } - - /** - * Checks if given API result is a non-empty and not an error object. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @param mixed $result - * @param string|null $required_property Optional property we want to verify that is set. - * - * @return bool - */ - function is_api_result_object( $result, $required_property = null ) { - return FS_Api::is_api_result_object( $result, $required_property ); - } - - /** - * Checks if given API result is a non-empty entity object with non-empty ID. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @param mixed $result - * - * @return bool - */ - private function is_api_result_entity( $result ) { - return FS_Api::is_api_result_entity( $result ); - } - - #endregion - - /** - * Make sure a given argument is an array of a specific type. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @param mixed $array - * @param string $class - * - * @return bool - */ - private function is_array_instanceof( $array, $class ) { - return ( is_array( $array ) && ( empty( $array ) || $array[0] instanceof $class ) ); - } - - /** - * Start install ownership change. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.1 - * @uses FS_Api - * - * @param string $candidate_email - * - * @return bool Is ownership change successfully initiated. - */ - private function init_change_owner( $candidate_email ) { - $this->_logger->entrance(); - - $api = $this->get_api_site_scope(); - $result = $api->call( "/users/{$this->_user->id}.json", 'put', array( - 'email' => $candidate_email, - 'after_confirm_url' => $this->_get_admin_page_url( - 'account', - array( 'fs_action' => 'change_owner' ) - ), - ) ); - - return ! $this->is_api_error( $result ); - } - - /** - * Handle install ownership change. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.1 - * @uses FS_Api - * - * @return bool Was ownership change successfully complete. - */ - private function complete_change_owner() { - $this->_logger->entrance(); - - $site_result = $this->get_api_site_scope( true )->get(); - $site = new FS_Site( $site_result ); - $this->_site = $site; - - $user = new FS_User(); - $user->id = fs_request_get( 'user_id' ); - - // Validate install's user and given user. - if ( $user->id != $this->_site->user_id ) { - return false; - } - - $user->public_key = fs_request_get( 'user_public_key' ); - $user->secret_key = fs_request_get( 'user_secret_key' ); - - // Fetch new user information. - $this->_user = $user; - $user_result = $this->get_api_user_scope( true )->get(); - $user = new FS_User( $user_result ); - $this->_user = $user; - - $this->_set_account( $user, $site ); - - return true; - } - - /** - * Completes ownership change by license. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - * - * @param number $user_id - * @param array[string]number $install_ids_by_slug_map - * - */ - private function complete_ownership_change_by_license( $user_id, $install_ids_by_slug_map ) { - $this->_logger->entrance(); - - $this->sync_user_by_current_install( $user_id ); - - $result = $this->get_api_user_scope( true )->get( - "/installs.json?install_ids=" . implode( ',', $install_ids_by_slug_map ) - ); - - if ( $this->is_api_result_object( $result, 'installs' ) ) { - $sites = self::get_all_sites( $this->get_module_type() ); - $install_ids_by_slug_map = array_flip( $install_ids_by_slug_map ); - - foreach ( $result->installs as $install ) { - $site = new FS_Site( $install ); - - $sites[ $install_ids_by_slug_map[ $site->id ] ] = clone $site; - } - - $this->set_account_option( 'sites', $sites, true ); - } - } - - /** - * Handle user name update. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * @uses FS_Api - * - * @return object - */ - private function update_user_name() { - $this->_logger->entrance(); - $name = fs_request_get( 'fs_user_name_' . $this->get_unique_affix(), '' ); - - $api = $this->get_api_user_scope(); - $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,first,last", 'put', array( - 'name' => $name, - ) ); - - if ( ! isset( $user->error ) ) { - $this->_user->first = $user->first; - $this->_user->last = $user->last; - $this->_store_user(); - } else { - // handle different error cases. - - } - - return $user; - } - - /** - * Verify user email. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * @uses FS_Api - */ - private function verify_email() { - $this->_handle_account_user_sync(); - - if ( $this->_user->is_verified() ) { - return; - } - - $api = $this->get_api_site_scope(); - $result = $api->call( "/users/{$this->_user->id}/verify.json", 'put', array( - 'after_email_confirm_url' => $this->_get_admin_page_url( - 'account', - array( 'fs_action' => 'sync_user' ) - ) - ) ); - - if ( ! isset( $result->error ) ) { - $this->_admin_notices->add( sprintf( - $this->get_text_inline( 'Verification mail was just sent to %s. If you can\'t find it after 5 min, please check your spam box.', 'verification-email-sent-message' ), - sprintf( '%2$s', esc_url( $this->_user->email ), $this->_user->email ) - ) ); - } else { - // handle different error cases. - - } - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.1.2 - * - * @param array $params - * @param bool|null $network - * - * @return string - */ - function get_activation_url( $params = array(), $network = null ) { - if ( $this->is_addon() && $this->has_free_plan() ) { - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 Add-on's activation is the parent's module activation. - */ - return $this->get_parent_instance()->get_activation_url( $params ); - } - - return $this->apply_filters( 'connect_url', $this->_get_admin_page_url( '', $params, $network ) ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - * - * @param array $params - * - * @return string - */ - function get_reconnect_url( $params = array() ) { - $params['fs_action'] = 'reset_anonymous_mode'; - $params['fs_unique_affix'] = $this->get_unique_affix(); - - return $this->get_activation_url( $params ); - } - - /** - * Get the URL of the page that should be loaded after the user connect - * or skip in the opt-in screen. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.3 - * - * @param string $filter Filter name. - * @param array $params Since 1.2.2.7 - * @param bool|null $network - * - * @return string - */ - function get_after_activation_url( $filter, $params = array(), $network = null ) { - if ( $this->show_opt_in_on_themes_page() && - ( fs_request_has( 'pending_activation' ) || - // For cases when the first time path is set, even though it's a WP.org theme. - fs_request_get_bool( $this->get_unique_affix() . '_show_optin' ) ) - ) { - $first_time_path = ''; - } else { - $first_time_path = $this->_menu->get_first_time_path( - fs_is_network_admin() && $this->_is_network_active - ); - } - - if ( $this->_is_network_active && - fs_is_network_admin() && - ! $this->_menu->has_network_menu() && - $this->is_network_registered() - ) { - $target_url = $this->get_account_url(); - } else { - // Default plugin's page. - $target_url = $this->_get_admin_page_url( '', array(), $network ); - } - - return add_query_arg( $params, $this->apply_filters( - $filter, - empty( $first_time_path ) ? - $target_url : - $first_time_path - ) ); - } - - /** - * Handle account page updates / edits / actions. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - */ - private function _handle_account_edits() { - if ( ! $this->is_user_admin() ) { - return; - } - - $action = fs_get_action(); - - if ( empty( $action ) ) { - return; - } - - $plugin_id = fs_request_get( 'plugin_id', $this->get_id() ); - $install_id = fs_request_get( 'install_id', '' ); - - // Alias. - $oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...'; - - $is_network_action = $this->is_network_level_action(); - $blog_id = $this->is_network_level_site_specific_action(); - $is_parent_plugin_action = ( $plugin_id == $this->get_id() ); - - if ( is_numeric( $blog_id ) ) { - $this->switch_to_blog( $blog_id ); - } else { - $blog_id = ''; - } - - switch ( $action ) { - case 'opt_in': - check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); - - if ( $is_parent_plugin_action ) { - if ( $is_network_action && ! empty( $blog_id ) ) { - if ( ! $this->is_registered() ) { - $this->install_with_user( - $this->get_network_user(), - false, - false, - false, - false - ); - - $this->_admin_notices->add( - $this->get_text_inline( 'Site successfully opted in.', 'successful-opt-in' ), - $this->get_text_inline( 'Awesome', 'awesome' ) - ); - } - } - } - break; - - case 'toggle_tracking': - check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); - - if ( $is_parent_plugin_action ) { - if ( $is_network_action && ! empty( $blog_id ) ) { - if ( $this->is_registered() ) { - if ( $this->is_tracking_prohibited() ) { - if ( $this->allow_site_tracking() ) { - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'We appreciate your help in making the %s better by letting us track some usage data.', 'opt-out-message-appreciation' ), $this->_module_type ), - $this->get_text_inline( 'Thank you!', 'thank-you' ) - ); - } - } else { - if ( $this->stop_site_tracking() ) { - $this->_admin_notices->add( - sprintf( - $this->get_text_inline( 'We will no longer be sending any usage data of %s on %s to %s.', 'opted-out-successfully' ), - $this->get_plugin_title(), - fs_strip_url_protocol( get_site_url( $blog_id ) ), - sprintf( - '%s', - 'https://freemius.com', - 'freemius.com' - ) - ) - ); - } - } - } - } - } - - break; - - case 'delete_account': - check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); - - $is_network_deletion = $is_network_action && empty( $blog_id ); - - if ( $is_parent_plugin_action ) { - // Delete add-on installs if have any. - $installed_addons = $this->get_installed_addons(); - foreach ( $installed_addons as $fs_addon ) { - if ( $is_network_deletion ) { - $fs_addon->delete_network_account_event(); - } else { - $fs_addon->delete_account_event(); - } - } - - if ( $is_network_deletion ) { - $this->delete_network_account_event(); - } else { - $this->delete_account_event(); - } - - // Clear user and site. - $this->_site = null; - $this->_user = null; - - $this->maybe_set_slug_and_network_menu_exists_flag(); - - fs_redirect( $this->get_activation_url() ); - } else { - if ( $this->is_addon_activated( $plugin_id ) ) { - $fs_addon = self::get_instance_by_id( $plugin_id ); - - if ( $is_network_deletion ) { - $fs_addon->delete_network_account_event(); - } else { - $fs_addon->delete_account_event(); - } - - fs_redirect( $this->_get_admin_page_url( 'account' ) ); - } - } - - return; - - case 'downgrade_account': - if ( is_numeric( $blog_id ) ) { - check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); - } else { - check_admin_referer( $action ); - } - - $switch_to_network_install_blog_after_cancellation = ( - is_numeric( $blog_id ) && - $plugin_id == $this->get_id() && - ! $this->is_trial() - ); - - $result = $this->cancel_subscription_or_trial( $plugin_id ); - if ( $this->is_api_error( $result ) ) { - $this->_admin_notices->add( - $result->error->message, - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error' - ); - } - - if ( $switch_to_network_install_blog_after_cancellation ) { - $this->switch_to_blog( $this->_storage->network_install_blog_id ); - } - - return; - - case 'activate_license': - check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); - - $fs = $this; - if ( $plugin_id != $this->get_id() ) { - $fs = $this->is_addon_activated( $plugin_id ) ? - self::get_instance_by_id( $plugin_id ) : - null; - } - - if ( is_object( $fs ) ) { - $fs->_activate_license(); - - /** - * Remove the product ID from `$_REQUEST` so that the syncing of the license for the other products will work properly. - * - * @author Leo Fajardo (@leorw) - * @since 2.4.0 - */ - unset( $_REQUEST['plugin_id'] ); - - if ( $this->is_bundle_license_auto_activation_enabled() ) { - $fs->maybe_activate_bundle_license( null, array(), is_numeric( $blog_id ) ? $blog_id : 0 ); - } - } - - return; - - case 'deactivate_license': - check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); - - if ( $plugin_id == $this->get_id() ) { - $this->_deactivate_license(); - - if ( $this->is_only_premium() ) { - // Clear user and site. - $this->_site = null; - $this->_user = null; - - if ( ! $is_network_action ) { - fs_redirect( $this->get_activation_url() ); - } else if ( is_numeric( $blog_id ) ) { - $this->switch_to_blog( $this->_storage->network_install_blog_id ); - } - } - } else { - if ( $this->is_addon_activated( $plugin_id ) ) { - $fs_addon = self::get_instance_by_id( $plugin_id ); - $fs_addon->_deactivate_license(); - } - } - - return; - - case 'check_updates': - check_admin_referer( $action ); - $this->check_updates(); - - return; - - case 'change_owner': - $state = fs_request_get( 'state', 'init' ); - switch ( $state ) { - case 'init': - $candidate_email = fs_request_get( 'candidate_email', '' ); - - if ( $this->init_change_owner( $candidate_email ) ) { - $this->_admin_notices->add( sprintf( $this->get_text_inline( 'Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder.', 'change-owner-request-sent-x' ), '' . $this->_user->email . '' ) ); - } - break; - case 'owner_confirmed': - $candidate_email = fs_request_get( 'candidate_email', '' ); - - $this->_admin_notices->add( sprintf( $this->get_text_inline( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.', 'change-owner-request_owner-confirmed' ), '' . $candidate_email . '' ) ); - break; - case 'candidate_confirmed': - if ( $this->complete_change_owner() ) { - $this->_admin_notices->add_sticky( - sprintf( $this->get_text_inline( '%s is the new owner of the account.', 'change-owner-request_candidate-confirmed' ), '' . $this->_user->email . '' ), - 'ownership_changed', - $this->get_text_x_inline( 'Congrats', 'as congratulations', 'congrats' ) . '!' - ); - } else { - // @todo Handle failed ownership change message. - } - break; - } - - return; - - case 'update_email': - check_admin_referer( 'update_email' ); - - $new_email = fs_request_get( 'fs_email_' . $this->get_unique_affix(), '' ); - $result = $this->update_email( $new_email ); - - if ( isset( $result->error ) ) { - switch ( $result->error->code ) { - case 'user_exist': - $this->_admin_notices->add( - $this->get_text_inline( 'Sorry, we could not complete the email update. Another user with the same email is already registered.', 'user-exist-message' ) . ' ' . - sprintf( $this->get_text_inline( 'If you would like to give up the ownership of the %s\'s account to %s click the Change Ownership button.', 'user-exist-message_ownership' ), $this->_module_type, '' . $new_email . '' ) . - sprintf( - '', - $this->get_account_url( 'change_owner', array( - 'state' => 'init', - 'candidate_email' => $new_email - ) ), - $this->get_text_inline( 'Change Ownership', 'change-ownership' ) - ), - $oops_text, - 'error' - ); - break; - } - } else { - $this->_admin_notices->add( $this->get_text_inline( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.', 'email-updated-message' ) ); - } - - return; - - case 'update_user_name': - check_admin_referer( 'update_user_name' ); - - $result = $this->update_user_name(); - - if ( isset( $result->error ) ) { - $this->_admin_notices->add( - $this->get_text_inline( 'Please provide your full name.', 'name-update-failed-message' ), - $oops_text, - 'error' - ); - } else { - $this->_admin_notices->add( $this->get_text_inline( 'Your name was successfully updated.', 'name-updated-message' ) ); - } - - return; - - #region Actions that might be called from external links (e.g. email) - - case 'cancel_trial': - $result = $this->cancel_subscription_or_trial( $plugin_id ); - if ( $this->is_api_error( $result ) ) { - $this->_admin_notices->add( - $result->error->message, - $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', - 'error' - ); - } - - return; - - case 'verify_email': - $this->verify_email(); - - return; - - case 'sync_user': - $this->_handle_account_user_sync(); - - return; - - case $this->get_unique_affix() . '_sync_license': - $this->_sync_license(); - - return; - - case 'download_latest': - $this->download_latest_directly( $plugin_id ); - - return; - - #endregion - } - - if ( WP_FS__IS_POST_REQUEST ) { - $properties = array( 'site_secret_key', 'site_id', 'site_public_key' ); - foreach ( $properties as $p ) { - if ( 'update_' . $p === $action ) { - check_admin_referer( $action ); - - $this->_logger->log( $action ); - - $site_property = substr( $p, strlen( 'site_' ) ); - $site_property_value = fs_request_get( 'fs_' . $p . '_' . $this->get_unique_affix(), '' ); - $this->get_site()->{$site_property} = $site_property_value; - - // Store account after modification. - $this->_store_site(); - - $this->do_action( 'account_property_edit', 'site', $site_property, $site_property_value ); - - $this->_admin_notices->add( sprintf( - /* translators: %s: User's account property (e.g. email address, name) */ - $this->get_text_inline( 'You have successfully updated your %s.', 'x-updated' ), - '' . str_replace( '_', ' ', $p ) . '' - ) ); - - return; - } - } - } - } - - /** - * Account page resources load. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - */ - function _account_page_load() { - $this->_logger->entrance(); - - $this->_logger->info( var_export( $_REQUEST, true ) ); - - fs_enqueue_local_style( 'fs_account', '/admin/account.css' ); - - if ( $this->has_addons() ) { - wp_enqueue_script( 'plugin-install' ); - add_thickbox(); - - function fs_addons_body_class( $classes ) { - $classes .= ' plugins-php'; - - return $classes; - } - - add_filter( 'admin_body_class', 'fs_addons_body_class' ); - } - - if ( $this->has_paid_plan() && - ! $this->has_any_license() && - ! $this->is_sync_executed() && - $this->is_tracking_allowed() - ) { - /** - * If no licenses found and no sync job was executed during the last 24 hours, - * just execute the sync job right away (blocking execution). - * - * @since 1.1.7.3 - */ - $this->run_manual_sync(); - } - - $this->_handle_account_edits(); - - if ( - is_object( $this->_license ) && - $this->_license->user_id == $this->_user->id && - ! $this->is_whitelabeled( true ) - ) { - $this->_admin_notices->add( - sprintf( - $this->get_text_inline( "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin.", 'license_not_whitelabeled' ), - sprintf( - '%s', - $this->get_text_inline( 'Click here', 'click-here' ) - ) - ), - '', - 'success', - false, - 'license_not_whitelabeled' - ); - } - - $this->do_action( 'account_page_load_before_departure' ); - } - - /** - * Renders the "Affiliation" page. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.3 - */ - function _affiliation_page_render() { - $this->_logger->entrance(); - - $this->fetch_affiliate_and_terms(); - - fs_enqueue_local_style( 'fs_affiliation', '/admin/affiliation.css' ); - - $vars = array( 'id' => $this->_module_id ); - echo $this->apply_filters( "/forms/affiliation.php", fs_get_template( '/forms/affiliation.php', $vars ) ); - } - - - /** - * Render account page. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - */ - function _account_page_render() { - $this->_logger->entrance(); - - $template = 'account.php'; - $vars = array( 'id' => $this->_module_id ); - - /** - * Added filter to the template to allow developers wrapping the template - * in custom HTML (e.g. within a wizard/tabs). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - */ - echo $this->apply_filters( "templates/{$template}", fs_get_template( $template, $vars ) ); - } - - /** - * Render account connect page. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - */ - function _connect_page_render() { - $this->_logger->entrance(); - - $vars = array( 'id' => $this->_module_id ); - - /** - * Added filter to the template to allow developers wrapping the template - * in custom HTML (e.g. within a wizard/tabs). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - */ - echo $this->apply_filters( 'templates/connect.php', fs_get_template( 'connect.php', $vars ) ); - } - - /** - * Load required resources before add-ons page render. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - */ - function _addons_page_load() { - $this->_logger->entrance(); - - fs_enqueue_local_style( 'fs_addons', '/admin/add-ons.css' ); - - wp_enqueue_script( 'plugin-install' ); - add_thickbox(); - - function fs_addons_body_class( $classes ) { - $classes .= ' plugins-php'; - - return $classes; - } - - add_filter( 'admin_body_class', 'fs_addons_body_class' ); - - if ( ! $this->is_registered() && $this->is_org_repo_compliant() ) { - $this->_admin_notices->add( - sprintf( $this->get_text_inline( 'Just letting you know that the add-ons information of %s is being pulled from an external server.', 'addons-info-external-message' ), '' . $this->get_plugin_name() . '' ), - $this->get_text_x_inline( 'Heads up', 'advance notice of something that will need attention.', 'heads-up' ), - 'update-nag' - ); - } - } - - /** - * Render add-ons page. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.6 - */ - function _addons_page_render() { - $this->_logger->entrance(); - - $vars = array( 'id' => $this->_module_id ); - - /** - * Added filter to the template to allow developers wrapping the template - * in custom HTML (e.g. within a wizard/tabs). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.6 - */ - echo $this->apply_filters( 'templates/add-ons.php', fs_get_template( 'add-ons.php', $vars ) ); - } - - /* Pricing & Upgrade - ------------------------------------------------------------------------------------------------------------------*/ - /** - * Render pricing page. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - */ - function _pricing_page_render() { - $this->_logger->entrance(); - - $vars = array( 'id' => $this->_module_id ); - - if ( 'true' === fs_request_get( 'checkout', false ) ) { - echo $this->apply_filters( 'templates/checkout.php', fs_get_template( 'checkout.php', $vars ) ); - } else { - echo $this->apply_filters( 'templates/pricing.php', fs_get_template( 'pricing.php', $vars ) ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - */ - function _maybe_add_pricing_ajax_handler() { - if ( ! $this->should_use_external_pricing() ) { - $this->add_ajax_action( 'pricing_ajax_action', array( &$this, '_fs_pricing_ajax_action_handler' ) ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.1 - */ - function _fs_pricing_ajax_action_handler() { - $this->check_ajax_referer( 'pricing_ajax_action' ); - - $result = null; - $pricing_action = fs_request_get( 'pricing_action' ); - - switch ( $pricing_action ) { - case 'fetch_pricing_data': - $params = array( - 'is_enriched' => true, - 'trial' => fs_request_get_bool( 'trial' ), - 'sandbox' => fs_request_get( 'sandbox' ), - 's_ctx_type' => fs_request_get( 's_ctx_type' ), - 's_ctx_id' => fs_request_get( 's_ctx_id' ), - 's_ctx_ts' => fs_request_get( 's_ctx_ts' ), - 's_ctx_secure' => fs_request_get( 's_ctx_secure' ), - ); - - $bundle_id = $this->get_bundle_id(); - $bundle_public_key = $this->get_bundle_public_key(); - - $has_bundle_context = ( FS_Plugin::is_valid_id( $bundle_id ) && ! empty( $bundle_public_key ) ); - - if ( ! $has_bundle_context ) { - $api = $this->get_api_plugin_scope(); - } else { - $api = FS_Api::instance( - $bundle_id, - 'plugin', - $bundle_id, - $bundle_public_key, - ! $this->is_live(), - false, - $this->get_sdk_version() - ); - - $params['plugin_id'] = $this->get_id(); - $params['plugin_public_key'] = $this->get_public_key(); - } - - $result = $api->get( 'pricing.json?' . http_build_query( $params ) ); - break; - case 'start_trial': - $result = $this->opt_in( - false, - false, - false, - false, - false, - fs_request_get( 'plan_id' ) - ); - } - - if ( is_object( $result ) && $this->is_api_error( $result ) ) { - $this->_logger->api_error( $result ); - - self::shoot_ajax_failure( - isset( $result->error ) ? - ( is_string( $result->error ) ? $result->error : $result->error->message ) : - var_export( $result, true ) - ); - } - - $this->shoot_ajax_success( $result ); - } - - #---------------------------------------------------------------------------------- - #region Contact Us - #---------------------------------------------------------------------------------- - - /** - * Render contact-us page. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - */ - function _contact_page_render() { - $this->_logger->entrance(); - - $vars = array( 'id' => $this->_module_id ); - - /** - * Added filter to the template to allow developers wrapping the template - * in custom HTML (e.g. within a wizard/tabs). - * - * @author Vova Feldman (@svovaf) - * @since 2.1.3 - */ - echo $this->apply_filters( 'templates/contact.php', fs_get_template( 'contact.php', $vars ) ); - } - - #endregion ------------------------------------------------------------------------ - - /** - * Hide all admin notices to prevent distractions. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - * - * @uses remove_all_actions() - */ - private static function _hide_admin_notices() { - remove_all_actions( 'admin_notices' ); - remove_all_actions( 'network_admin_notices' ); - remove_all_actions( 'all_admin_notices' ); - remove_all_actions( 'user_admin_notices' ); - } - - static function _clean_admin_content_section_hook() { - self::_hide_admin_notices(); - - // Hide footer. - echo ''; - } - - /** - * Attach to admin_head hook to hide all admin notices. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - */ - static function _clean_admin_content_section() { - add_action( 'admin_head', 'Freemius::_clean_admin_content_section_hook' ); - } - - /* CSS & JavaScript - ------------------------------------------------------------------------------------------------------------------*/ - /* function _enqueue_script($handle, $src) { - $url = plugins_url( substr( WP_FS__DIR_JS, strlen( $this->_plugin_dir_path ) ) . '/assets/js/' . $src ); - - $this->_logger->entrance( 'script = ' . $url ); - - wp_enqueue_script( $handle, $url ); - }*/ - - /* SDK - ------------------------------------------------------------------------------------------------------------------*/ - private $_user_api; - - /** - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @param bool $flush - * - * @return FS_Api - */ - private function get_api_user_scope( $flush = false ) { - if ( ! isset( $this->_user_api ) || $flush ) { - $this->_user_api = $this->get_api_user_scope_by_user( $this->_user ); - } - - return $this->_user_api; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @param \FS_User $user - * - * @return \FS_Api - */ - private function get_api_user_scope_by_user( FS_User $user ) { - return FS_Api::instance( - $this->_module_id, - 'user', - $user->id, - $user->public_key, - ! $this->is_live(), - $user->secret_key, - $this->get_sdk_version() - ); - } - - /** - * - * @author Leo Fajardo (@leorw) - * @since 2.0.0 - * - * @param bool $flush - * - * @return FS_Api - */ - private function get_current_or_network_user_api_scope( $flush = false ) { - if ( ! $this->_is_network_active || - ( isset( $this->_user ) && $this->_user instanceof FS_User ) - ) { - return $this->get_api_user_scope( $flush ); - } - - $user = $this->get_current_or_network_user(); - - $this->_user_api = FS_Api::instance( - $this->_module_id, - 'user', - $user->id, - $user->public_key, - ! $this->is_live(), - $user->secret_key, - $this->get_sdk_version() - ); - - return $this->_user_api; - } - - private $_site_api; - - /** - * - * @author Vova Feldman (@svovaf) - * @since 1.0.2 - * - * @param bool $flush - * - * @return FS_Api - */ - private function get_api_site_scope( $flush = false ) { - if ( ! isset( $this->_site_api ) || $flush ) { - $this->_site_api = FS_Api::instance( - $this->_module_id, - 'install', - $this->_site->id, - $this->_site->public_key, - ! $this->is_live(), - $this->_site->secret_key, - $this->get_sdk_version() - ); - } - - return $this->_site_api; - } - - private $_plugin_api; - - /** - * Get plugin public API scope. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return FS_Api - */ - function get_api_plugin_scope() { - if ( ! isset( $this->_plugin_api ) ) { - $this->_plugin_api = FS_Api::instance( - $this->_module_id, - 'plugin', - $this->_plugin->id, - $this->_plugin->public_key, - ! $this->is_live(), - false, - $this->get_sdk_version() - ); - } - - return $this->_plugin_api; - } - - /** - * Get bundle public API scope. - * - * @author Vova Feldman (@svovaf) - * @since 2.3.1 - * - * @return FS_Api - */ - function get_api_bundle_scope() { - return FS_Api::instance( - $this->get_bundle_id(), - 'plugin', - $this->get_bundle_id(), - $this->get_bundle_public_key(), - ! $this->is_live(), - false, - $this->get_sdk_version() - ); - } - - /** - * Get site API scope object (fallback to public plugin scope when not registered). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.7 - * - * @return FS_Api - */ - function get_api_site_or_plugin_scope() { - return $this->is_registered() ? - $this->get_api_site_scope() : - $this->get_api_plugin_scope(); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.2.3.1 - * - * @param object $result - */ - private function maybe_modify_api_curl_error_message( $result ) { - if ( - 'cUrlMissing' !== $result->error->type && - ( 'CurlException' !== $result->error->type || CURLE_COULDNT_CONNECT != $result->error->code ) && - ( 'HttpRequestFailed' !== $result->error->type || false === strpos( $result->error->message, 'cURL error ' . CURLE_COULDNT_CONNECT ) ) - ) { - return; - } - - $result->error->message = $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . - ' ' . - $this->esc_html_inline( - sprintf( - 'Please contact your hosting provider and ask them to whitelist %s for external connection.', - implode( - ', ', - $this->apply_filters( 'api_domains', array( - 'api.freemius.com', - 'wp.freemius.com' - ) ) - ) - ), - 'connectivity-whitelist' - ) . - ' ' . - sprintf( - $this->esc_html_inline( 'Once you are done, deactivate the %s and activate it again.', 'connectivity-reactivate-module' ), - $this->get_module_type() - ); - } - - /** - * Show trial promotional notice (if any trial exist). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @param FS_Plugin_Plan[] $plans - */ - function _check_for_trial_plans( $plans ) { - /** - * For some reason core's do_action() flattens arrays when it has a single object item. Therefore, we need to restructure the array as expected. - * - * @author Vova Feldman (@svovaf) - * @since 2.1.2 - */ - if ( ! is_array( $plans ) && is_object( $plans ) ) { - $plans = array( $plans ); - } - - if ( ! $this->is_array_instanceof( $plans, 'FS_Plugin_Plan' ) ) { - $plans = array(); - } - - $this->_storage->has_trial_plan = FS_Plan_Manager::instance()->has_trial_plan( $plans ); - } - - /** - * During trial promotion the "upgrade" submenu item turns to - * "start trial" to encourage the trial. Since we want to keep - * the same menu item handler and there's no robust way to - * add new arguments to the menu item link's querystring, - * use JavaScript to find the menu item and update the href of - * the link. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - */ - function _fix_start_trial_menu_item_url() { - $template_args = array( 'id' => $this->_module_id ); - fs_require_template( 'add-trial-to-pricing.php', $template_args ); - } - - /** - * Check if module is currently in a trial promotion mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - */ - function is_in_trial_promotion() { - return $this->_admin_notices->has_sticky( 'trial_promotion' ); - } - - /** - * Show trial promotional notice (if any trial exist). - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool If trial notice added. - */ - function _add_trial_notice() { - if ( ! $this->is_user_admin() ) { - return false; - } - - if ( ! $this->is_user_in_admin() ) { - return false; - } - - if ( $this->_is_network_active ) { - if ( fs_is_network_admin() ) { - // Network level trial is disabled at the moment. - return false; - } - - if ( ! $this->is_delegated_connection() ) { - // Only delegated sites should support trials. - return false; - } - } - - // Check if trial message is already shown. - if ( $this->is_in_trial_promotion() ) { - add_action( 'admin_footer', array( &$this, '_fix_start_trial_menu_item_url' ) ); - - $this->_menu->add_counter_to_menu_item( 1, 'fs-trial' ); - - return false; - } - - if ( $this->is_premium() && ! WP_FS__DEV_MODE ) { - // Don't show trial if running the premium code, unless running in DEV mode. - return false; - } - - if ( ! $this->has_trial_plan() ) { - // No plans with trial. - return false; - } - - if ( ! $this->apply_filters( 'show_trial', true ) ) { - // Developer explicitly asked not to show the trial promo. - return false; - } - - if ( $this->is_registered() ) { - // Check if trial already utilized. - if ( $this->_site->is_trial_utilized() ) { - return false; - } - - if ( $this->is_paying_or_trial() ) { - // Don't show trial if paying or already in trial. - return false; - } - } - - if ( $this->is_activation_mode() || $this->is_pending_activation() ) { - // If not yet opted-in/skipped, or pending activation, don't show trial. - return false; - } - - $last_time_trial_promotion_shown = $this->_storage->get( 'trial_promotion_shown', false ); - $was_promotion_shown_before = ( false !== $last_time_trial_promotion_shown ); - - // Show promotion if never shown before and 24 hours after initial activation with FS. - if ( ! $was_promotion_shown_before && - $this->_storage->install_timestamp > ( time() - $this->apply_filters( 'show_first_trial_after_n_sec', WP_FS__TIME_24_HOURS_IN_SEC ) ) - ) { - return false; - } - - // OR if promotion was shown before, try showing it every 30 days. - if ( $was_promotion_shown_before && - $this->apply_filters( 'reshow_trial_after_every_n_sec', 30 * WP_FS__TIME_24_HOURS_IN_SEC ) > time() - $last_time_trial_promotion_shown - ) { - return false; - } - - $trial_period = $this->_trial_days; - $require_payment = $this->_is_trial_require_payment; - $trial_url = $this->get_trial_url(); - $plans_string = strtolower( $this->get_text_inline( 'Awesome', 'awesome' ) ); - - if ( $this->is_registered() ) { - // If opted-in, override trial with up to date data from API. - $trial_plans = FS_Plan_Manager::instance()->get_trial_plans( $this->_plans ); - $trial_plans_count = count( $trial_plans ); - - if ( 0 === $trial_plans_count ) { - // If there's no plans with a trial just exit. - return false; - } - - /** - * @var FS_Plugin_Plan $paid_plan - */ - $paid_plan = $trial_plans[0]; - $require_payment = $paid_plan->is_require_subscription; - $trial_period = $paid_plan->trial_period; - - $total_paid_plans = count( $this->_plans ) - ( FS_Plan_Manager::instance()->has_free_plan( $this->_plans ) ? 1 : 0 ); - - if ( $total_paid_plans !== $trial_plans_count ) { - // Not all paid plans have a trial - generate a string of those that have it. - for ( $i = 0; $i < $trial_plans_count; $i ++ ) { - $plans_string .= sprintf( - ' %s', - $trial_url, - $trial_plans[ $i ]->title - ); - - if ( $i < $trial_plans_count - 2 ) { - $plans_string .= ', '; - } else if ( $i == $trial_plans_count - 2 ) { - $plans_string .= ' and '; - } - } - } - } - - $message = sprintf( - $this->get_text_x_inline( 'Hey', 'exclamation', 'hey' ) . '! ' . $this->get_text_inline( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.', 'trial-x-promotion-message' ), - sprintf( '%s', $this->get_plugin_name() ), - $plans_string, - $trial_period - ); - - // "No Credit-Card Required" or "No Commitment for N Days". - $cc_string = $require_payment ? - sprintf( $this->get_text_inline( 'No commitment for %s days - cancel anytime!', 'no-commitment-for-x-days' ), $trial_period ) : - $this->get_text_inline( 'No credit card required', 'no-cc-required' ) . '!'; - - - // Start trial button. - $button = ' ' . sprintf( - '', - $trial_url, - $this->get_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial' ) - ); - - $this->_admin_notices->add_sticky( - $this->apply_filters( 'trial_promotion_message', "{$message} {$cc_string} {$button}" ), - 'trial_promotion', - '', - 'promotion' - ); - - $this->_storage->trial_promotion_shown = WP_FS__SCRIPT_START_TIME; - - return true; - } - - /** - * Lets users/customers know that the product has an affiliate program. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2.11 - * - * @return bool Returns true if the notice has been added. - */ - function _add_affiliate_program_notice() { - if ( ! $this->is_user_admin() ) { - return false; - } - - if ( ! $this->is_user_in_admin() ) { - return false; - } - - // Check if the notice is already shown. - if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) { - return false; - } - - if ( - // Product has no affiliate program. - ! $this->has_affiliate_program() || - // User has applied for an affiliate account. - ! empty( $this->_storage->affiliate_application_data ) - ) { - return false; - } - - if ( ! $this->apply_filters( 'show_affiliate_program_notice', true ) ) { - // Developer explicitly asked not to show the notice about the affiliate program. - return false; - } - - if ( $this->is_activation_mode() || $this->is_pending_activation() ) { - // If not yet opted in/skipped, or pending activation, don't show the notice. - return false; - } - - $last_time_notice_was_shown = $this->_storage->get( 'affiliate_program_notice_shown', false ); - $was_notice_shown_before = ( false !== $last_time_notice_was_shown ); - - /** - * Do not show the notice if it was already shown before or less than 30 days have passed since the initial - * activation with FS. - */ - if ( $was_notice_shown_before || - $this->_storage->install_timestamp > ( time() - ( WP_FS__TIME_24_HOURS_IN_SEC * 30 ) ) - ) { - return false; - } - - if ( ! $this->is_paying() && - FS_Plugin::AFFILIATE_MODERATION_CUSTOMERS == $this->_plugin->affiliate_moderation - ) { - // If the user is not a customer and the affiliate program is only for customers, don't show the notice. - return false; - } - - $message = sprintf( - $this->get_text_inline( 'Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!', 'become-an-ambassador-admin-notice' ), - sprintf( '%s', $this->get_plugin_name() ), - $this->get_module_label( true ) - ); - - // HTML code for the "Learn more..." button. - $button = ' ' . sprintf( - '', - $this->_get_admin_page_url( 'affiliation' ), - $this->get_text_inline( 'Learn more', 'learn-more' ) . '...' - ); - - $this->_admin_notices->add_sticky( - $this->apply_filters( 'affiliate_program_notice', "{$message} {$button}" ), - 'affiliate_program', - '', - 'promotion' - ); - - $this->_storage->affiliate_program_notice_shown = WP_FS__SCRIPT_START_TIME; - - return true; - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.5 - */ - function _enqueue_common_css() { - if ( $this->has_paid_plan() && ! $this->is_paying() ) { - // Add basic CSS for admin-notices and menu-item colors. - fs_enqueue_local_style( 'fs_common', '/admin/common.css' ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - function _show_theme_activation_optin_dialog() { - fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' ); - - add_action( 'admin_footer', array( &$this, '_add_fs_theme_activation_dialog' ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - function _add_fs_theme_activation_dialog() { - global $pagenow; - - if ( 'themes.php' !== $pagenow ) { - return; - } - - $vars = array( 'id' => $this->_module_id ); - fs_require_once_template( 'connect.php', $vars ); - } - - /* Action Links - ------------------------------------------------------------------------------------------------------------------*/ - private $_action_links_hooked = false; - private $_action_links = array(); - - /** - * Hook to plugin action links filter. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - */ - private function hook_plugin_action_links() { - $this->_logger->entrance(); - - $this->_action_links_hooked = true; - - $this->_logger->log( 'Adding action links hooks.' ); - - // Add action link to settings page. - add_filter( 'plugin_action_links_' . $this->_plugin_basename, array( - &$this, - '_modify_plugin_action_links_hook' - ), WP_FS__DEFAULT_PRIORITY, 2 ); - add_filter( 'network_admin_plugin_action_links_' . $this->_plugin_basename, array( - &$this, - '_modify_plugin_action_links_hook' - ), WP_FS__DEFAULT_PRIORITY, 2 ); - } - - /** - * Add plugin action link. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - * - * @param $label - * @param $url - * @param bool $external - * @param int $priority - * @param bool $key - */ - function add_plugin_action_link( $label, $url, $external = false, $priority = WP_FS__DEFAULT_PRIORITY, $key = false ) { - $this->_logger->entrance(); - - if ( ! isset( $this->_action_links[ $priority ] ) ) { - $this->_action_links[ $priority ] = array(); - } - - if ( false === $key ) { - $key = preg_replace( "/[^A-Za-z0-9 ]/", '', strtolower( $label ) ); - } - - $this->_action_links[ $priority ][] = array( - 'label' => $label, - 'href' => $url, - 'key' => $key, - 'external' => $external - ); - } - - /** - * Adds Upgrade and Add-Ons links to the main Plugins page link actions collection. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - */ - function _add_upgrade_action_link() { - $this->_logger->entrance(); - - $is_activation_mode = $this->is_activation_mode(); - - $add_action_links = $this->should_add_submenu_or_action_links( $is_activation_mode ); - - /** - * The following logic is based on the logic in `add_submenu_items()` method that decides when the "Upgrade" - * and "Add-Ons" menus should be added. - * - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - */ - $add_upgrade_link = ( - $add_action_links || - ( $is_activation_mode && $this->is_only_premium() ) - ) && ! WP_FS__DEMO_MODE && ( ! $this->is_whitelabeled() ); - - $add_addons_link = ( $add_action_links && $this->has_addons() ); - - if ( ! $add_upgrade_link && ! $add_addons_link ) { - return; - } - - if ( - $add_upgrade_link && - $this->is_pricing_page_visible() && - $this->is_submenu_item_visible( 'pricing' ) - ) { - $this->add_plugin_action_link( - $this->get_text_inline( 'Upgrade', 'upgrade' ), - $this->get_upgrade_url(), - false, - 7, - 'upgrade' - ); - } - - if ( - $add_addons_link && - $this->has_addons() && - $this->is_submenu_item_visible( 'addons' ) - ) { - $this->add_plugin_action_link( - $this->get_text_inline( 'Add-Ons', 'add-ons' ), - $this->_get_admin_page_url( 'addons' ), - false, - 9, - 'addons' - ); - } - } - - /** - * Adds "Activate License" or "Change License" link to the main Plugins page link actions collection. - * - * @author Leo Fajardo (@leorw) - * @since 1.1.9 - */ - function _add_license_action_link() { - $this->_logger->entrance(); - - if ( ! self::is_ajax() ) { - // Inject license activation dialog UI and client side code. - add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) ); - } - - $link_text = $this->is_free_plan() ? - $this->get_text_inline( 'Activate License', 'activate-license' ) : - $this->get_text_inline( 'Change License', 'change-license' ); - - $this->add_plugin_action_link( - $link_text, - '#', - false, - 11, - ( 'activate-license ' . $this->get_unique_affix() ) - ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.0.2 - */ - function _add_premium_version_upgrade_selection_action() { - $this->_logger->entrance(); - - if ( ! self::is_ajax() ) { - add_action( 'admin_footer', array( &$this, '_add_premium_version_upgrade_selection_dialog_box' ) ); - } - } - - /** - * Adds "Opt In" or "Opt Out" link to the main "Plugins" page link actions collection. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.1.5 - */ - function _add_tracking_links() { - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $this->_logger->entrance(); - - /** - * @author Vova Feldman (@svovaf) - * @since 2.3.2 Allow opting out from usage-tracking for paid products too by giving the appropriate warning letting the user know the automatic updates mechanism cannot function without an ongoing connection to the licensing and updates engine. - */ - /*if ( $this->is_premium() ) { - // Don't add opt-in/out for premium code base. - return; - }*/ - - if ( $this->is_only_premium() && $this->is_free_plan() ) { - // Don't add tracking links for premium-only products that were opted-in by relation (add-on or a parent product) before activating any license. - return; - } - - if ( fs_is_network_admin() ) { - if ( ! $this->_is_network_active ) { - // Don't add tracking links when browsing the network WP Admin and the plugin is not network active. - return; - } else if ( $this->is_network_delegated_connection() ) { - // Don't add tracking links when browsing the network WP Admin and the activation has been delegated to site admins. - return; - } - } else { - if ( $this->_is_network_active && ! $this->is_delegated_connection() ) { - // Don't add tracking links when browsing the sub-site WP Admin, the plugin is network active, and the connection was not delegated. - return; - } - } - - if ( fs_request_is_action_secure( $this->get_unique_affix() . '_reconnect' ) ) { - if ( ! $this->is_registered() && $this->is_anonymous() ) { - $this->connect_again(); - - return; - } - } - - if ( ( $this->is_plugin() && ! self::is_plugins_page() ) || - ( $this->is_theme() && ! self::is_themes_page() ) - ) { - // Only show tracking links on the plugins and themes pages. - return; - } - - if ( - $this->is_activation_mode() && - $this->is_premium() && - ! $this->is_registered() - ) { - // If not yet registered and running the premium code base, a license activation link will already be shown. - return; - } - - if ( $this->is_registered() && $this->is_tracking_allowed() ) { - if ( ! $this->is_premium() && ! $this->is_enable_anonymous() ) { - // If opted in and tracking is allowed, don't allow to opt out if not premium and anonymous mode is disabled. - return; - } - } - - if ( $this->add_ajax_action( 'stop_tracking', array( &$this, '_stop_tracking_callback' ) ) ) { - return; - } - - if ( $this->add_ajax_action( 'allow_tracking', array( &$this, '_allow_tracking_callback' ) ) ) { - return; - } - - if ( $this->add_ajax_action( 'update_tracking_permission', array( &$this, '_update_tracking_permission_callback' ) ) ) { - return; - } - - $link_text_id = ''; - $url = '#'; - - if ( $this->is_registered() ) { - if ( $this->is_tracking_allowed() ) { - $link_text_id = $this->get_text_inline( 'Opt Out', 'opt-out' ); - } else { - $link_text_id = $this->get_text_inline( 'Opt In', 'opt-in' ); - } - } else if ( $this->is_anonymous() || $this->is_activation_mode() ) { - /** - * Show opt-in link only if skipped or in activation mode. - */ - $link_text_id = $this->get_text_inline( 'Opt In', 'opt-in' ); - - $params = ! $this->is_anonymous() ? - array() : - array( - 'nonce' => wp_create_nonce( $this->get_unique_affix() . '_reconnect' ), - 'fs_action' => ( $this->get_unique_affix() . '_reconnect' ), - ); - - $url = $this->get_activation_url( $params ); - } - - add_action( 'admin_footer', array( &$this, '_add_optout_dialog' ) ); - - if ( ! empty( $link_text_id ) && $this->is_plugin() && self::is_plugins_page() ) { - $this->add_plugin_action_link( - $link_text_id, - $url, - false, - 13, - "opt-in-or-opt-out {$this->_slug}" - ); - } - } - - /** - * Get the URL of the page that should be loaded right after the plugin activation. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.7.4 - * - * @return string - */ - function get_after_plugin_activation_redirect_url() { - $url = false; - - if ( ! $this->is_addon() || ! $this->has_free_plan() ) { - $first_time_path = $this->_menu->get_first_time_path( - fs_is_network_admin() && $this->_is_network_active - ); - - if ( $this->is_activation_mode() ) { - $url = $this->get_activation_url(); - } else if ( ! empty( $first_time_path ) ) { - $url = $first_time_path; - } else { - $page = ''; - if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) { - if ( $this->is_network_registered() ) { - $page = 'account'; - } else if ( $this->is_pending_activation() || $this->is_network_anonymous() ) { - $this->maybe_set_slug_and_network_menu_exists_flag(); - } - } - - $url = $this->_get_admin_page_url( $page ); - } - } else { - $plugin_fs = false; - - if ( $this->is_parent_plugin_installed() ) { - $plugin_fs = self::get_parent_instance(); - } - - if ( is_object( $plugin_fs ) ) { - if ( ! $plugin_fs->is_registered() ) { - // Forward to parent plugin connect when parent not registered. - $url = $plugin_fs->get_activation_url(); - } else { - // Forward to account page. - $url = $plugin_fs->_get_admin_page_url( 'account' ); - } - } - } - - return $url; - } - - /** - * Forward page to activation page. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.3 - */ - function _redirect_on_activation_hook() { - if ( $this->apply_filters( 'redirect_on_activation', true ) ) { - $url = $this->get_after_plugin_activation_redirect_url(); - - if ( is_string( $url ) ) { - fs_redirect( $url ); - } - } - } - - /** - * Modify plugin's page action links collection. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.0 - * - * @param array $links - * @param $file - * - * @return array - */ - function _modify_plugin_action_links_hook( $links, $file ) { - $this->_logger->entrance(); - - $passed_deactivate = false; - $deactivate_link = ''; - $before_deactivate = array(); - $after_deactivate = array(); - foreach ( $links as $key => $link ) { - if ( 'deactivate' === $key ) { - $deactivate_link = $link; - $passed_deactivate = true; - continue; - } - - if ( ! $passed_deactivate ) { - $before_deactivate[ $key ] = $link; - } else { - $after_deactivate[ $key ] = $link; - } - } - - ksort( $this->_action_links ); - - foreach ( $this->_action_links as $new_links ) { - foreach ( $new_links as $link ) { - $before_deactivate[ $link['key'] ] = '' . $link['label'] . ''; - } - } - - if ( ! empty( $deactivate_link ) ) { - /** - * This HTML element is used to identify the correct plugin when attaching an event to its Deactivate link. - * - * @since 1.2.1.6 Always show the deactivation feedback form since we added automatic free version deactivation upon premium code activation. - */ - $deactivate_link .= ''; - - // Append deactivation link. - $before_deactivate['deactivate'] = $deactivate_link; - } - - return array_merge( $before_deactivate, $after_deactivate ); - } - - /** - * Adds admin message. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.4 - * - * @param string $message - * @param string $title - * @param string $type - */ - function add_admin_message( $message, $title = '', $type = 'success' ) { - $this->_admin_notices->add( $message, $title, $type ); - } - - /** - * Adds sticky admin message. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.0 - * - * @param string $message - * @param string $id - * @param string $title - * @param string $type - */ - function add_sticky_admin_message( $message, $id, $title = '', $type = 'success' ) { - $this->_admin_notices->add_sticky( $message, $id, $title, $type ); - } - - /** - * Check if the paid version of the module is installed. - * - * @author Vova Feldman (@svovaf) - * @since 2.2.0 - * - * @return bool - */ - private function is_premium_version_installed() { - $premium_plugin_basename = $this->premium_plugin_basename(); - $premium_plugin = get_plugins( '/' . dirname( $premium_plugin_basename ) ); - - return ! empty( $premium_plugin ); - } - - /** - * Helper function that returns the final steps for the upgrade completion. - * - * If the module is already running the premium code, returns an empty string. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1 - * - * @param string $plan_title - * - * @return string - */ - private function get_complete_upgrade_instructions( $plan_title = '' ) { - $this->_logger->entrance(); - - $activate_license_string = $this->get_license_network_activation_notice(); - - if ( ! $this->has_premium_version() || $this->is_premium() ) { - return '' . $activate_license_string; - } - - if ( empty( $plan_title ) ) { - $plan_title = $this->get_plan_title(); - } - - if ( $this->is_premium_version_installed() ) { - /** - * If the premium version is already installed, instead of showing the installation instructions, - * tell the current user to activate it. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.1 - */ - $premium_plugin_basename = $this->premium_plugin_basename(); - - return sprintf( - /* translators: %1$s: Product title; %2$s: Plan title */ - $this->get_text_inline( ' The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s', 'activate-premium-version' ), - sprintf( '%s', esc_html( $this->get_plugin_title() ) ), - $plan_title, - sprintf( - '', - wp_nonce_url( 'plugins.php?action=activate&plugin=' . $premium_plugin_basename, 'activate-plugin_' . $premium_plugin_basename ), - esc_html( sprintf( - /* translators: %s: Plan title */ - $this->get_text_inline( 'Activate %s features', 'activate-x-features' ), - $plan_title - ) ) - ) - ); - } else { - // @since 1.2.1.5 The free version is auto deactivated. - $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ? - ( '
  • ' . $this->esc_html_inline( 'Deactivate the free version', 'deactivate-free-version' ) . '.
  • ' ) : - ''; - - return sprintf( - ' %s:
    1. %s.
    2. %s
    3. %s (%s).
    ', - $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ), - ( empty( $activate_license_string ) ? '' : $activate_license_string . '
  • ' ) . - $this->get_latest_download_link( sprintf( - /* translators: %s: Plan title */ - $this->get_text_inline( 'Download the latest %s version', 'download-latest-x-version' ), - $plan_title - ) ), - $deactivation_step, - $this->get_text_inline( 'Upload and activate the downloaded version', 'upload-and-activate' ), - $this->apply_filters( 'upload_and_install_video_url', '//bit.ly/upload-wp-' . $this->_module_type . 's' ), - $this->get_text_inline( 'How to upload and activate?', 'howto-upload-activate' ) - ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - * - * @param string $url - * @param array $request - */ - private static function enrich_request_for_debug( &$url, &$request ) { - if ( WP_FS__DEBUG_SDK || isset( $_COOKIE['XDEBUG_SESSION'] ) ) { - $url = add_query_arg( 'XDEBUG_SESSION_START', rand( 0, 9999999 ), $url ); - $url = add_query_arg( 'XDEBUG_SESSION', 'PHPSTORM', $url ); - - $request['cookies'] = array( - new WP_Http_Cookie( array( - 'name' => 'XDEBUG_SESSION', - 'value' => 'PHPSTORM', - ) ) - ); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - * - * @param string $url - * @param array $request - * @param int $success_cache_expiration - * @param int $failure_cache_expiration - * @param bool $maybe_enrich_request_for_debug - * - * @return WP_Error|array - */ - static function safe_remote_post( - &$url, - $request, - $success_cache_expiration = 0, - $failure_cache_expiration = 0, - $maybe_enrich_request_for_debug = true - ) { - $should_cache = ($success_cache_expiration + $failure_cache_expiration > 0); - - $cache_key = $should_cache ? md5( fs_strip_url_protocol($url) . json_encode( $request ) ) : false; - - $response = (!WP_FS__DEBUG_SDK && ( false !== $cache_key )) ? - get_transient( $cache_key ) : - false; - - if ( false === $response ) { - if ( $maybe_enrich_request_for_debug ) { - self::enrich_request_for_debug( $url, $request ); - } - - $response = wp_remote_post( $url, $request ); - - if ( $response instanceof WP_Error ) { - if ( 'https://' === substr( $url, 0, 8 ) && - isset( $response->errors ) && - isset( $response->errors['http_request_failed'] ) - ) { - $http_error = strtolower( $response->errors['http_request_failed'][0] ); - - if ( false !== strpos( $http_error, 'ssl' ) || - false !== strpos( $http_error, 'curl error 35' ) - ) { - // Failed due to old version of cURL or Open SSL (SSLv3 is not supported by CloudFlare). - $url = 'http://' . substr( $url, 8 ); - - $request['timeout'] = 15; - $response = wp_remote_post( $url, $request ); - } - } - } - - if ( false !== $cache_key ) { - set_transient( - $cache_key, - $response, - ( ( $response instanceof WP_Error ) ? - $failure_cache_expiration : - $success_cache_expiration ) - ); - } - } - - return $response; - } - - /** - * This method is used to enrich the after upgrade notice instructions when the upgraded - * license cannot be activated network wide (license quota isn't large enough). - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return string - */ - private function get_license_network_activation_notice() { - if ( ! $this->_is_network_active ) { - // Module isn't network level activated. - return ''; - } - - if ( ! fs_is_network_admin() ) { - // Not network level admin. - return ''; - } - - if ( get_blog_count() == 1 ) { - // There's only a single site in the network so if there's a context license it was already activated. - return ''; - } - - if ( ! is_object( $this->_license ) ) { - // No context license. - return ''; - } - - if ( $this->_license->is_single_site() && 0 < $this->_license->activated ) { - // License was already utilized (this is not 100% the case if all the network is localhost sites and the license can be utilized on unlimited localhost sites). - return ''; - } - - if ( $this->can_activate_license_on_network( $this->_license ) ) { - // License can be activated on all the network, so probably, the license is already activate on all the network (that's how the after upgrade sync works). - return ''; - } - - return sprintf( - $this->get_text_inline( '%sClick here%s to choose the sites where you\'d like to activate the license on.', 'network-choose-sites-for-license' ), - '', - '' - ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - * - * @param string $key - * - * @return string - */ - function get_text( $key ) { - return fs_text( $key, $this->_slug ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.3 - * - * @param string $text Translatable string. - * @param string $key String key for overrides. - * - * @return string - */ - function get_text_inline( $text, $key = '' ) { - return _fs_text_inline( $text, $key, $this->_slug ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.3 - * - * @param string $text Translatable string. - * @param string $context Context information for the translators. - * @param string $key String key for overrides. - * - * @return string - */ - function get_text_x_inline( $text, $context, $key ) { - return _fs_text_x_inline( $text, $context, $key, $this->_slug ); - } - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.3 - * - * @param string $text Translatable string. - * @param string $key String key for overrides. - * - * @return string - */ - function esc_html_inline( $text, $key ) { - return esc_html( _fs_text_inline( $text, $key, $this->_slug ) ); - } - - #---------------------------------------------------------------------------------- - #region Versioning - #---------------------------------------------------------------------------------- - - /** - * Check if Freemius in SDK upgrade mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function is_sdk_upgrade_mode() { - return isset( $this->_storage->sdk_upgrade_mode ) ? - $this->_storage->sdk_upgrade_mode : - false; - } - - /** - * Turn SDK upgrade mode off. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - function set_sdk_upgrade_complete() { - $this->_storage->sdk_upgrade_mode = false; - } - - /** - * Check if plugin upgrade mode. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function is_plugin_upgrade_mode() { - return isset( $this->_storage->plugin_upgrade_mode ) ? - $this->_storage->plugin_upgrade_mode : - false; - } - - /** - * Turn plugin upgrade mode off. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - */ - function set_plugin_upgrade_complete() { - $this->_storage->plugin_upgrade_mode = false; - - $license_migration = ! empty( $this->_storage->license_migration ) ? - $this->_storage->license_migration : - array(); - - $license_migration['is_migrating'] = false; - - $this->_storage->license_migration = $license_migration; - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Permissions - #---------------------------------------------------------------------------------- - - /** - * Check if specific permission requested. - * - * @author Vova Feldman (@svovaf) - * @since 1.1.6 - * - * @param string $permission - * - * @return bool - */ - function is_permission_requested( $permission ) { - return isset( $this->_permissions[ $permission ] ) && ( true === $this->_permissions[ $permission ] ); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Auto Activation - #---------------------------------------------------------------------------------- - - /** - * Hints the SDK if running an auto-installation. - * - * @var bool - */ - private $_isAutoInstall = false; - - /** - * After upgrade callback to install and auto activate a plugin. - * This code will only be executed on explicit request from the user, - * following the practice Jetpack are using with their theme installations. - * - * @link https://make.wordpress.org/plugins/2017/03/16/clarification-of-guideline-8-executable-code-and-installs/ - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - */ - function _install_premium_version_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'install_premium_version' ); - - if ( ! $this->is_registered() ) { - // Not registered. - self::shoot_ajax_failure( array( - 'message' => $this->get_text_inline( 'Auto installation only works for opted-in users.', 'auto-install-error-not-opted-in' ), - 'code' => 'premium_installed', - ) ); - } - - $plugin_id = fs_request_get( 'target_module_id', $this->get_id() ); - - if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) { - // Invalid ID. - self::shoot_ajax_failure( array( - 'message' => $this->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ), - 'code' => 'invalid_module_id', - ) ); - } - - if ( $plugin_id == $this->get_id() ) { - if ( $this->is_premium() ) { - // Already using the premium code version. - self::shoot_ajax_failure( array( - 'message' => $this->get_text_inline( 'Premium version already active.', 'auto-install-error-premium-activated' ), - 'code' => 'premium_installed', - ) ); - } - if ( ! $this->can_use_premium_code() ) { - // Don't have access to the premium code. - self::shoot_ajax_failure( array( - 'message' => $this->get_text_inline( 'You do not have a valid license to access the premium version.', 'auto-install-error-invalid-license' ), - 'code' => 'invalid_license', - ) ); - } - if ( ! $this->has_release_on_freemius() ) { - // Plugin is a serviceware, no premium code version. - self::shoot_ajax_failure( array( - 'message' => $this->get_text_inline( 'Plugin is a "Serviceware" which means it does not have a premium code version.', 'auto-install-error-serviceware' ), - 'code' => 'premium_version_missing', - ) ); - } - } else { - $addon = $this->get_addon( $plugin_id ); - - if ( ! is_object( $addon ) ) { - // Invalid add-on ID. - self::shoot_ajax_failure( array( - 'message' => $this->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ), - 'code' => 'invalid_module_id', - ) ); - } - - if ( $this->is_addon_activated( $plugin_id, true ) ) { - // Premium add-on version is already activated. - self::shoot_ajax_failure( array( - 'message' => $this->get_text_inline( 'Premium add-on version already installed.', 'auto-install-error-premium-addon-activated' ), - 'code' => 'premium_installed', - ) ); - } - } - - $this->_isAutoInstall = true; - - // Try to install and activate. - $updater = FS_Plugin_Updater::instance( $this ); - $result = $updater->install_and_activate_plugin( $plugin_id ); - - if ( is_array( $result ) && ! empty( $result['message'] ) ) { - self::shoot_ajax_failure( array( - 'message' => $result['message'], - 'code' => $result['code'], - ) ); - } - - self::shoot_ajax_success( $result ); - } - - /** - * Displays module activation dialog box after a successful upgrade - * where the user explicitly requested to auto download and install - * the premium version. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.1.7 - */ - function _add_auto_installation_dialog_box() { - $this->_logger->entrance(); - - if ( ! $this->is_registered() ) { - // Not registered. - return; - } - - $plugin_id = fs_request_get( 'plugin_id', $this->get_id() ); - - if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) { - // Invalid module ID. - return; - } - - if ( $plugin_id == $this->get_id() ) { - if ( $this->is_premium() ) { - // Already using the premium code version. - return; - } - if ( ! $this->can_use_premium_code() ) { - // Don't have access to the premium code. - return; - } - if ( ! $this->has_release_on_freemius() ) { - // Plugin is a serviceware, no premium code version. - return; - } - } else { - $addon = $this->get_addon( $plugin_id ); - - if ( ! is_object( $addon ) ) { - // Invalid add-on ID. - return; - } - - if ( $this->is_addon_activated( $plugin_id, true ) ) { - // Premium add-on version is already activated. - return; - } - } - - $vars = array( - 'id' => $this->_module_id, - 'target_module_id' => $plugin_id, - 'slug' => $this->_slug, - ); - - fs_require_template( 'auto-installation.php', $vars ); - } - - #endregion - - #-------------------------------------------------------------------------------- - #region Tabs Integration - #-------------------------------------------------------------------------------- - - #region Module's Original Tabs - - /** - * Inject a JavaScript logic to capture the theme tabs HTML. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - */ - function _tabs_capture() { - $this->_logger->entrance(); - - if ( ! $this->is_product_settings_page() || - ! $this->is_matching_url( $this->main_menu_url() ) - ) { - return; - } - - $params = array( - 'id' => $this->_module_id, - ); - - fs_require_once_template( 'tabs-capture-js.php', $params ); - } - - /** - * Cache theme's tabs HTML for a week. The cache will also be set as expired - * after version and type (free/premium) changes, in addition to the week period. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - */ - function _store_tabs_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'store_tabs' ); - - // Init filesystem if not yet initiated. - WP_Filesystem(); - - // Get POST body HTML data. - global $wp_filesystem; - $tabs_html = $wp_filesystem->get_contents( "php://input" ); - - if ( is_string( $tabs_html ) ) { - $tabs_html = trim( $tabs_html ); - } - - if ( ! is_string( $tabs_html ) || empty( $tabs_html ) ) { - self::shoot_ajax_failure(); - } - - $this->_cache->set( 'tabs', $tabs_html, 7 * WP_FS__TIME_24_HOURS_IN_SEC ); - - self::shoot_ajax_success(); - } - - /** - * Cache theme's settings page custom styles. The cache will also be set as expired - * after version and type (free/premium) changes, in addition to the week period. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - */ - function _store_tabs_styles() { - $this->_logger->entrance(); - - if ( ! $this->is_product_settings_page() || - ! $this->is_matching_url( $this->main_menu_url() ) - ) { - return; - } - - $wp_styles = wp_styles(); - - $theme_styles_url = get_template_directory_uri(); - - $stylesheets = array(); - foreach ( $wp_styles->queue as $handler ) { - if ( fs_starts_with( $handler, 'fs_' ) ) { - // Assume that stylesheets that their handler starts with "fs_" belong to the SDK. - continue; - } - - /** - * @var _WP_Dependency $stylesheet - */ - $stylesheet = $wp_styles->registered[ $handler ]; - - if ( fs_starts_with( $stylesheet->src, $theme_styles_url ) ) { - $stylesheets[] = $stylesheet->src; - } - } - - if ( ! empty( $stylesheets ) ) { - $this->_cache->set( 'tabs_stylesheets', $stylesheets, 7 * WP_FS__TIME_24_HOURS_IN_SEC ); - } - } - - /** - * Check if module's original settings page has any tabs. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - */ - private function has_tabs() { - return $this->_cache->has( 'tabs' ); - } - - /** - * Get module's settings page HTML content, starting - * from the beginning of the
    element, - * until the tabs HTML (including). - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return string - */ - private function get_tabs_html() { - $this->_logger->entrance(); - - return $this->_cache->get( 'tabs' ); - } - - /** - * Check if page should include tabs. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool - */ - private function should_page_include_tabs() { - if ( ! $this->has_settings_menu() ) { - // Don't add tabs if no settings at all. - return false; - } - - if ( self::NAVIGATION_TABS !== $this->_navigation ) { - // Only add tabs to themes for now. - return false; - } - - if ( $this->is_theme() && ! $this->has_paid_plan() && ! $this->has_addons() ) { - // Only add tabs to monetizing themes. - return false; - } - - if ( ! $this->is_product_settings_page() ) { - // Only add tabs if browsing one of the product's setting pages. - return false; - } - - if ( $this->is_activation_mode() && $this->is_activation_page() ) { - // Don't include tabs in the activation page. - return false; - } - - if ( $this->is_admin_page( 'pricing' ) && fs_request_get_bool( 'checkout' ) ) { - // Don't add tabs on checkout page, we want to reduce distractions - // as much as possible. - return false; - } - - return true; - } - - /** - * Add the tabs HTML before the setting's page content and - * enqueue any required stylesheets. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool If tabs were included. - */ - function _add_tabs_before_content() { - $this->_logger->entrance(); - - if ( ! $this->should_page_include_tabs() ) { - return false; - } - - /** - * Enqueue the original stylesheets that are included in the - * theme settings page. That way, if the theme settings has - * some custom _styled_ content above the tabs UI, this - * will make sure that the styling is preserved. - */ - $stylesheets = $this->_cache->get( 'tabs_stylesheets', array() ); - if ( is_array( $stylesheets ) ) { - for ( $i = 0, $len = count( $stylesheets ); $i < $len; $i ++ ) { - wp_enqueue_style( "fs_{$this->_module_id}_tabs_{$i}", $stylesheets[ $i ] ); - } - } - - // Cut closing
    tag. - echo substr( trim( $this->get_tabs_html() ), 0, - 6 ); - - return true; - } - - /** - * Add the tabs closing HTML after the setting's page content. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @return bool If tabs closing HTML was included. - */ - function _add_tabs_after_content() { - $this->_logger->entrance(); - - if ( ! $this->should_page_include_tabs() ) { - return false; - } - - echo ''; - - return true; - } - - #endregion - - /** - * Add in-page JavaScript to inject the Freemius tabs into - * the module's setting tabs section. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - */ - function _add_freemius_tabs() { - $this->_logger->entrance(); - - if ( ! $this->should_page_include_tabs() ) { - return; - } - - $params = array( 'id' => $this->_module_id ); - fs_require_once_template( 'tabs.php', $params ); - } - - #endregion - - #-------------------------------------------------------------------------------- - #region Customizer Integration for Themes - #-------------------------------------------------------------------------------- - - /** - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - * - * @param WP_Customize_Manager $customizer - */ - function _customizer_register( $customizer ) { - $this->_logger->entrance(); - - if ( $this->is_pricing_page_visible() ) { - require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-upsell-control.php'; - - $customizer->add_section( 'freemius_upsell', array( - 'title' => '★ ' . $this->get_text_inline( 'View paid features', 'view-paid-features' ), - 'priority' => 1, - ) ); - $customizer->add_setting( 'freemius_upsell', array( - 'sanitize_callback' => 'esc_html', - ) ); - - $customizer->add_control( new FS_Customizer_Upsell_Control( $customizer, 'freemius_upsell', array( - 'fs' => $this, - 'section' => 'freemius_upsell', - 'priority' => 100, - ) ) ); - } - - if ( $this->is_page_visible( 'contact' ) || $this->is_page_visible( 'support' ) ) { - require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-support-section.php'; - - // Main Documentation Link In Customizer Root. - $customizer->add_section( new FS_Customizer_Support_Section( $customizer, 'freemius_support', array( - 'fs' => $this, - 'priority' => 1000, - ) ) ); - } - } - - #endregion - - /** - * If the theme has a paid version, add some custom - * styling to the theme's premium version (if exists) - * to highlight that it's the premium version of the - * same theme, making it easier for identification - * after the user upgrades and upload it to the site. - * - * @author Vova Feldman (@svovaf) - * @since 1.2.2.7 - */ - function _style_premium_theme() { - $this->_logger->entrance(); - - if ( ! self::is_themes_page() ) { - // Only include in the themes page. - return; - } - - if ( ! $this->has_paid_plan() ) { - // Only include if has any paid plans. - return; - } - - $params = null; - fs_require_once_template( '/js/jquery.content-change.php', $params ); - - $params = array( - 'slug' => $this->_slug, - 'id' => $this->_module_id, - ); - - fs_require_template( '/js/style-premium-theme.php', $params ); - } - - /** - * This method will return the absolute URL of the module's local icon. - * - * When you are running your plugin or theme on a **localhost** environment, if the icon - * is not found in the local assets folder, try to fetch the icon URL from Freemius. If not set and - * it's a plugin hosted on WordPress.org, try fetching the icon URL from wordpress.org. - * If an icon is found, this method will automatically attempt to download the icon and store it - * in /freemius/assets/img/{slug}.{png|jpg|gif|svg}. - * - * It's important to mention that this method is NOT phoning home since the developer will deploy - * the product with the local icon in the assets folder. The download process just simplifies - * the process for the developer. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return string - */ - function get_local_icon_url() { - global $fs_active_plugins; - - /** - * @since 1.1.7.5 - */ - $local_path = $this->apply_filters( 'plugin_icon', false ); - - if ( is_string( $local_path ) ) { - $icons = array( $local_path ); - } else { - $img_dir = WP_FS__DIR_IMG; - - // Locate the main assets folder. - if ( 1 < count( $fs_active_plugins->plugins ) ) { - $plugin_or_theme_img_dir = ( $this->is_plugin() ? WP_PLUGIN_DIR : get_theme_root( get_stylesheet() ) ); - - foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) { - if ( $data->plugin_path == $this->get_plugin_basename() ) { - $img_dir = $plugin_or_theme_img_dir - . '/' - /** - * The basename will be `themes` or the basename of a custom themes directory. - * - * @author Leo Fajardo (@leorw) - * @since 2.2.3 - */ - . str_replace( '../' . basename( $plugin_or_theme_img_dir ) . '/', '', $sdk_path ) - . '/assets/img'; - - break; - } - } - } - - // Try to locate the icon in the assets folder. - $icons = glob( fs_normalize_path( $img_dir . "/{$this->_slug}.*" ) ); - - if ( ! is_array( $icons ) || 0 === count( $icons ) ) { - if ( ! WP_FS__IS_LOCALHOST && $this->is_theme() ) { - $icons = array( - fs_normalize_path( $img_dir . '/theme-icon.png' ) - ); - } else { - $icon_found = false; - $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.png" ); - - if ( ! function_exists( 'get_filesystem_method' ) ) { - require_once ABSPATH . 'wp-admin/includes/file.php'; - } - - $have_write_permissions = ( 'direct' === get_filesystem_method( array(), fs_normalize_path( $img_dir ) ) ); - - /** - * IMPORTANT: THIS CODE WILL NEVER RUN AFTER THE PLUGIN IS IN THE REPO. - * - * This code will only be executed once during the testing - * of the plugin in a local environment. The plugin icon file WILL - * already exist in the assets folder when the plugin is deployed to - * the repository. - */ - if ( WP_FS__IS_LOCALHOST && $have_write_permissions ) { - // Fetch icon from Freemius. - $icon = $this->fetch_remote_icon_url(); - - // Fetch icon from WordPress.org. - if ( empty( $icon ) && $this->is_plugin() && $this->is_org_repo_compliant() ) { - if ( ! function_exists( 'plugins_api' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - } - - $plugin_information = plugins_api( 'plugin_information', array( - 'slug' => $this->_slug, - 'fields' => array( - 'sections' => false, - 'tags' => false, - 'icons' => true - ) - ) ); - - if ( - ! is_wp_error( $plugin_information ) - && isset( $plugin_information->icons ) - && ! empty( $plugin_information->icons ) - ) { - /** - * Get the smallest icon. - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - $icon = end( $plugin_information->icons ); - } - } - - if ( ! empty( $icon ) ) { - if ( 0 !== strpos( $icon, 'http' ) ) { - $icon = 'http:' . $icon; - } - - /** - * Get a clean file extension, e.g.: "jpg" and not "jpg?rev=1305765". - * - * @author Leo Fajardo (@leorw) - * @since 1.2.2 - */ - $ext = pathinfo( strtok( $icon, '?' ), PATHINFO_EXTENSION ); - - $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.{$ext}" ); - - // Try to download the icon. - $icon_found = fs_download_image( $icon, $local_path ); - } - } - - if ( ! $icon_found ) { - // No icons found, fallback to default icon. - if ( $have_write_permissions ) { - // If have write permissions, copy default icon. - copy( fs_normalize_path( $img_dir . "/{$this->_module_type}-icon.png" ), $local_path ); - } else { - // If doesn't have write permissions, use default icon path. - $local_path = fs_normalize_path( $img_dir . "/{$this->_module_type}-icon.png" ); - } - } - - $icons = array( $local_path ); - } - } - } - - $icon_dir = dirname( $icons[0] ); - - return fs_img_url( substr( $icons[0], strlen( $icon_dir ) ), $icon_dir ); - } - - /** - * Fetch module's extended info. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return object|mixed - */ - private function fetch_module_info() { - return $this->get_api_plugin_scope()->get( 'info.json', false, WP_FS__TIME_WEEK_IN_SEC ); - } - - /** - * Fetch module's remote icon URL. - * - * @author Vova Feldman (@svovaf) - * @since 2.0.0 - * - * @return string - */ - function fetch_remote_icon_url() { - $info = $this->fetch_module_info(); - - return ( $this->is_api_result_object( $info, 'icon' ) && is_string( $info->icon ) ) ? - $info->icon : - ''; - } - - #-------------------------------------------------------------------------------- - #region GDPR - #-------------------------------------------------------------------------------- - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - * - * @return bool - */ - function fetch_and_store_current_user_gdpr_anonymously() { - $pong = $this->ping( null, true ); - - if ( ! $this->get_api_plugin_scope()->is_valid_ping( $pong ) ) { - return false; - } else { - FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); - - return $pong->is_gdpr_required; - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - * - * @param array $user_plugins - * - * @return string - */ - private function get_gdpr_admin_notice_string( $user_plugins ) { - $this->_logger->entrance(); - - $addons = self::get_all_addons(); - - foreach ( $user_plugins as $user_plugin ) { - $has_addons = isset( $addons[ $user_plugin->id ] ); - - if ( WP_FS__MODULE_TYPE_PLUGIN === $user_plugin->type && ! $has_addons ) { - if ( $this->_module_id == $user_plugin->id ) { - $addons = $this->get_addons(); - $has_addons = ( ! empty( $addons ) ); - } else { - $plugin_api = FS_Api::instance( - $user_plugin->id, - 'plugin', - $user_plugin->id, - $user_plugin->public_key, - ! $user_plugin->is_live, - false, - $this->get_sdk_version() - ); - - $addons_result = $plugin_api->get( '/addons.json?enriched=true', true ); - - if ( $this->is_api_result_object( $addons_result, 'plugins' ) && - is_array( $addons_result->plugins ) && - ! empty( $addons_result->plugins ) - ) { - $has_addons = true; - } - } - } - - $user_plugin->has_addons = $has_addons; - } - - $is_single_parent_product = ( 1 === count( $user_plugins ) ); - - $multiple_products_text = ''; - - if ( $is_single_parent_product ) { - $single_parent_product = reset( $user_plugins ); - - $thank_you = sprintf( - "%s", - $single_parent_product->id, - sprintf( - $single_parent_product->has_addons ? - $this->get_text_inline( 'Thank you so much for using %s and its add-ons!', 'thank-you-for-using-product-and-its-addons' ) : - $this->get_text_inline( 'Thank you so much for using %s!', 'thank-you-for-using-product' ), - sprintf('%s', $single_parent_product->title) - ) - ); - - $already_opted_in = sprintf( - $this->get_text_inline( "You've already opted-in to our usage-tracking, which helps us keep improving the %s.", 'already-opted-in-to-product-usage-tracking' ), - ( WP_FS__MODULE_TYPE_THEME === $single_parent_product->type ) ? WP_FS__MODULE_TYPE_THEME : WP_FS__MODULE_TYPE_PLUGIN - ); - } else { - $thank_you = $this->get_text_inline( 'Thank you so much for using our products!', 'thank-you-for-using-products' ); - $already_opted_in = $this->get_text_inline( "You've already opted-in to our usage-tracking, which helps us keep improving them.", 'already-opted-in-to-products-usage-tracking' ); - - $products_and_add_ons = ''; - foreach ( $user_plugins as $user_plugin ) { - if ( ! empty( $products_and_add_ons ) ) { - $products_and_add_ons .= ', '; - } - - if ( ! $user_plugin->has_addons ) { - $products_and_add_ons .= sprintf( - "%s", - $user_plugin->id, - $user_plugin->title - ); - } else { - $products_and_add_ons .= sprintf( - "%s", - $user_plugin->id, - sprintf( - $this->get_text_inline( '%s and its add-ons', 'product-and-its-addons' ), - $user_plugin->title - ) - ); - } - } - - $multiple_products_text = sprintf( - "%s: %s", - $this->get_text_inline( 'Products', 'products' ), - $products_and_add_ons - ); - } - - $actions = sprintf( - '
    • %s - %s
    • %s - %s
    ', - sprintf('', $this->get_text_inline( 'Yes', 'yes' ) ), - $this->get_text_inline( 'send me security & feature updates, educational content and offers.', 'send-updates' ), - sprintf('', $this->get_text_inline( 'No', 'no' ) ), - sprintf( - $this->get_text_inline( 'do %sNOT%s send me security & feature updates, educational content and offers.', 'do-not-send-updates' ), - '', - '' - ) - ); - - return sprintf( - '%s %s %s', - $thank_you, - $already_opted_in, - sprintf( $this->get_text_inline( 'Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)', 'due-to-gdpr-compliance-requirements' ), '', '' ) . - '

    ' . - '' . $this->get_text_inline( "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:", 'contact-for-updates' ) . '' . - $actions . - ( $is_single_parent_product ? '' : $multiple_products_text ) - ); - } - - /** - * This method is called for opted-in users to fetch the is_marketing_allowed flag of the user for all the - * plugins and themes they've opted in to. - * - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - * - * @param string $user_email - * @param string $license_key - * @param array $plugin_ids - * @param string|null $license_key - * - * @return array|false - */ - private function fetch_user_marketing_flag_status_by_plugins( $user_email, $license_key, $plugin_ids ) { - $request = array( - 'method' => 'POST', - 'body' => array(), - 'timeout' => WP_FS__DEBUG_SDK ? 60 : 30, - ); - - if ( is_string( $user_email ) ) { - $request['body']['email'] = $user_email; - } else { - $request['body']['license_key'] = $license_key; - } - - $result = array(); - - $url = WP_FS__ADDRESS . '/action/service/user_plugin/'; - $total_plugin_ids = count( $plugin_ids ); - - $plugin_ids_count_per_request = 10; - for ( $i = 1; $i <= $total_plugin_ids; $i += $plugin_ids_count_per_request ) { - $plugin_ids_set = array_slice( $plugin_ids, $i - 1, $plugin_ids_count_per_request ); - - $request['body']['plugin_ids'] = $plugin_ids_set; - - $response = self::safe_remote_post( - $url, - $request, - WP_FS__TIME_24_HOURS_IN_SEC, - WP_FS__TIME_12_HOURS_IN_SEC - ); - - if ( ! is_wp_error( $response ) ) { - $decoded = is_string( $response['body'] ) ? - json_decode( $response['body'] ) : - null; - - if ( - !is_object($decoded) || - !isset($decoded->success) || - true !== $decoded->success || - !isset( $decoded->data ) || - !is_array( $decoded->data ) - ) { - return false; - } - - $result = array_merge( $result, $decoded->data ); - } - } - - return $result; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - function _maybe_show_gdpr_admin_notice() { - if ( ! $this->is_user_in_admin() ) { - return; - } - - if ( ! $this->should_handle_gdpr_admin_notice() ) { - return; - } - - if ( ! $this->is_user_admin() ) { - return; - } - - require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; - - $lock = FS_User_Lock::instance(); - - /** - * Try to acquire a 60-sec lock based on the WP user and thread/process ID. - */ - if ( ! $lock->try_lock( 60 ) ) { - return; - } - - /** - * @var $current_wp_user WP_User - */ - $current_wp_user = self::_get_current_wp_user(); - - /** - * @var FS_User $current_fs_user - */ - $current_fs_user = Freemius::_get_user_by_email( $current_wp_user->user_email ); - - $ten_years_in_sec = 10 * 365 * WP_FS__TIME_24_HOURS_IN_SEC; - - if ( ! is_object( $current_fs_user ) ) { - // 10-year lock. - $lock->lock( $ten_years_in_sec ); - - return; - } - - $gdpr = FS_GDPR_Manager::instance(); - - if ( $gdpr->is_opt_in_notice_shown() ) { - // 30-day lock. - $lock->lock( 30 * WP_FS__TIME_24_HOURS_IN_SEC ); - - return; - } - - if ( ! $gdpr->should_show_opt_in_notice() ) { - // 10-year lock. - $lock->lock( $ten_years_in_sec ); - - return; - } - - $last_time_notice_shown = $gdpr->last_time_notice_was_shown(); - $was_notice_shown_before = ( false !== $last_time_notice_shown ); - - if ( $was_notice_shown_before && - 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_notice_shown - ) { - // If the notice was shown before, show it again after 30 days from the last time it was shown. - return; - } - - /** - * Find all plugin IDs that were installed by the current admin. - */ - $plugin_ids_map = self::get_user_opted_in_module_ids_map( $current_fs_user->id ); - - if ( empty( $plugin_ids_map )) { - $lock->lock( $ten_years_in_sec ); - - return; - } - - $user_plugins = $this->fetch_user_marketing_flag_status_by_plugins( - $current_fs_user->email, - null, - array_keys( $plugin_ids_map ) - ); - - if ( empty( $user_plugins ) ) { - $lock->lock( - is_array($user_plugins) ? - $ten_years_in_sec : - // Lock for 24-hours on errors. - WP_FS__TIME_24_HOURS_IN_SEC - ); - - return; - } - - $has_unset_marketing_optin = false; - - foreach ( $user_plugins as $user_plugin ) { - if ( true == $user_plugin->is_marketing_allowed ) { - unset( $plugin_ids_map[ $user_plugin->plugin_id ] ); - } - - if ( ! $has_unset_marketing_optin && is_null( $user_plugin->is_marketing_allowed ) ) { - $has_unset_marketing_optin = true; - } - } - - if ( empty( $plugin_ids_map ) || - ( $was_notice_shown_before && ! $has_unset_marketing_optin ) - ) { - $lock->lock( $ten_years_in_sec ); - - return; - } - - $modules = array_merge( - array_values( self::maybe_get_entities_account_option( 'plugins', array() ) ), - array_values( self::maybe_get_entities_account_option( 'themes', array() ) ) - ); - - foreach ( $modules as $module ) { - if ( ! FS_Plugin::is_valid_id( $module->parent_plugin_id ) && isset( $plugin_ids_map[ $module->id ] ) ) { - $plugin_ids_map[ $module->id ] = $module; - } - } - - $plugin_title = null; - if ( 1 === count( $plugin_ids_map ) ) { - $module = reset( $plugin_ids_map ); - $plugin_title = $module->title; - } - - $gdpr->add_opt_in_sticky_notice( - $this->get_gdpr_admin_notice_string( $plugin_ids_map ), - $plugin_title - ); - - $this->add_gdpr_optin_ajax_handler_and_style(); - - $gdpr->notice_was_just_shown(); - - // 30-day lock. - $lock->lock( 30 * WP_FS__TIME_24_HOURS_IN_SEC ); - } - - /** - * Prevents the GDPR opt-in admin notice from being added if the user has already chosen to allow or not allow - * marketing. - * - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - private function disable_opt_in_notice_and_lock_user() { - FS_GDPR_Manager::instance()->disable_opt_in_notice(); - - require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; - - // 10-year lock. - FS_User_Lock::instance()->lock( 10 * 365 * WP_FS__TIME_24_HOURS_IN_SEC ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - function _add_gdpr_optin_js() { - $vars = array( 'id' => $this->_module_id ); - - fs_require_once_template( 'gdpr-optin-js.php', $vars ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - function enqueue_gdpr_optin_notice_style() { - fs_enqueue_local_style( 'fs_gdpr_optin_notice', '/admin/gdpr-optin-notice.css' ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - function _maybe_add_gdpr_optin_ajax_handler() { - $this->add_ajax_action( 'fetch_is_marketing_required_flag_value', array( &$this, '_fetch_is_marketing_required_flag_value_ajax_action' ) ); - - if ( FS_GDPR_Manager::instance()->is_opt_in_notice_shown() ) { - $this->add_gdpr_optin_ajax_handler_and_style(); - } - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - function _fetch_is_marketing_required_flag_value_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'fetch_is_marketing_required_flag_value' ); - - $license_key = fs_request_get( 'license_key' ); - - if ( empty($license_key) ) { - self::shoot_ajax_failure( $this->get_text_inline( 'License key is empty.', 'empty-license-key' ) ); - } - - $user_plugins = $this->fetch_user_marketing_flag_status_by_plugins( - null, - $license_key, - array( $this->_module_id ) - ); - - if ( ! is_array( $user_plugins ) || - empty($user_plugins) || - !isset($user_plugins[0]->plugin_id) || - $user_plugins[0]->plugin_id != $this->_module_id - ) { - /** - * If faced an error or if the module ID do not match to the current module, ask for GDPR opt-in. - * - * @author Vova Feldman (@svovaf) - */ - self::shoot_ajax_success( array( - 'is_marketing_allowed' => null, - 'license_owner_id' => null - ) ); - } - - self::shoot_ajax_success( array( - 'is_marketing_allowed' => $user_plugins[0]->is_marketing_allowed, - 'license_owner_id' => ( isset( $user_plugins[0]->license_owner_id ) ? $user_plugins[0]->license_owner_id : null ) - ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.2 - * - * @param number[] $install_ids - * - * @return array { - * An array of objects containing the installs' licenses owners data. - * - * @property number $id User ID. - * @property string $email User email (can be masked email). - * } - */ - private function fetch_installs_licenses_owners_data( $install_ids ) { - $this->_logger->entrance(); - - $response = $this->get_api_user_scope()->get( - '/licenses_owners.json?install_ids=' . implode( ',', $install_ids ) - ); - - $license_owners = null; - - if ( $this->is_api_result_object( $response, 'owners' ) ) { - $license_owners = $response->owners; - } - - return $license_owners; - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - private function add_gdpr_optin_ajax_handler_and_style() { - // Add GDPR action AJAX callback. - $this->add_ajax_action( 'gdpr_optin_action', array( &$this, '_gdpr_optin_ajax_action' ) ); - - add_action( 'admin_footer', array( &$this, '_add_gdpr_optin_js' ) ); - add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_gdpr_optin_notice_style' ) ); - } - - /** - * @author Leo Fajardo (@leorw) - * @since 2.1.0 - */ - function _gdpr_optin_ajax_action() { - $this->_logger->entrance(); - - $this->check_ajax_referer( 'gdpr_optin_action' ); - - if ( ! fs_request_has( 'is_marketing_allowed' ) || ! fs_request_has( 'plugin_ids' ) ) { - self::shoot_ajax_failure(); - } - - $current_wp_user = self::_get_current_wp_user(); - - $plugin_ids = fs_request_get( 'plugin_ids', array() ); - if ( ! is_array( $plugin_ids ) || empty( $plugin_ids ) ) { - self::shoot_ajax_failure(); - } - - $modules = array_merge( - array_values( self::maybe_get_entities_account_option( 'plugins', array() ) ), - array_values( self::maybe_get_entities_account_option( 'themes', array() ) ) - ); - - foreach ( $modules as $key => $module ) { - if ( ! in_array( $module->id, $plugin_ids ) ) { - unset( $modules[ $key ] ); - } - } - - if ( empty( $modules ) ) { - self::shoot_ajax_failure(); - } - - $user_api = $this->get_api_user_scope_by_user( Freemius::_get_user_by_email( $current_wp_user->user_email ) ); - - foreach ( $modules as $module ) { - $user_api->call( "?plugin_id={$module->id}", 'put', array( - 'is_marketing_allowed' => ( true == fs_request_get_bool( 'is_marketing_allowed' ) ) - ) ); - } - - FS_GDPR_Manager::instance()->remove_opt_in_notice(); - - require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; - - // 10-year lock. - FS_User_Lock::instance()->lock( 10 * 365 * WP_FS__TIME_24_HOURS_IN_SEC ); - - self::shoot_ajax_success(); - } - - /** - * Checks if the GDPR admin notice should be handled. By default, this logic is off, unless the integrator adds the special 'handle_gdpr_admin_notice' filter. - * - * @author Vova Feldman (@svovaf) - * @since 2.1.0 - * - * @return bool - */ - private function should_handle_gdpr_admin_notice() { - return $this->apply_filters( - 'handle_gdpr_admin_notice', - // Default to false. - false - ); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Marketing - #---------------------------------------------------------------------------------- - - /** - * Check if current user purchased any other plugins before. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function has_purchased_before() { - // TODO: Implement has_purchased_before() method. - throw new Exception( 'not implemented' ); - } - - /** - * Check if current user classified as an agency. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function is_agency() { - // TODO: Implement is_agency() method. - throw new Exception( 'not implemented' ); - } - - /** - * Check if current user classified as a developer. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function is_developer() { - // TODO: Implement is_developer() method. - throw new Exception( 'not implemented' ); - } - - /** - * Check if current user classified as a business. - * - * @author Vova Feldman (@svovaf) - * @since 1.0.9 - * - * @return bool - */ - function is_business() { - // TODO: Implement is_business() method. - throw new Exception( 'not implemented' ); - } - - #endregion - - #---------------------------------------------------------------------------------- - #region Helper - #---------------------------------------------------------------------------------- - - /** - * If running with a secret key, assume it's the developer and show pending plans as well. - * - * @author Vova Feldman (@svovaf) - * @since 2.1.2 - * - * @param string $path - * - * @return string - */ - function add_show_pending( $path ) { - if ( ! $this->has_secret_key() ) { - return $path; - } - - return $path . ( false !== strpos( $path, '?' ) ? '&' : '?' ) . 'show_pending=true'; - } - - #endregion - } +store_id_slug_type_path_map( $module_id, $slug ); + } + + $this->_module_id = $module_id; + $this->_slug = $this->get_slug(); + $this->_module_type = $this->get_module_type(); + + $this->_blog_id = is_multisite() ? get_current_blog_id() : null; + + $this->_storage = FS_Storage::instance( $this->_module_type, $this->_slug ); + + $this->_cache = FS_Cache_Manager::get_manager( WP_FS___OPTION_PREFIX . "cache_{$module_id}" ); + + $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $this->get_unique_affix(), WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); + + $this->_plugin_main_file_path = $this->_find_caller_plugin_file( $is_init ); + $this->_plugin_dir_path = plugin_dir_path( $this->_plugin_main_file_path ); + $this->_plugin_basename = $this->get_plugin_basename(); + $this->_free_plugin_basename = str_replace( '-premium/', '/', $this->_plugin_basename ); + + $this->_is_multisite_integrated = ( + defined( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) && + ( true === constant( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) ) + ); + + $this->_is_network_active = ( + is_multisite() && + $this->_is_multisite_integrated && + // Themes are always network activated, but the ACTUAL activation is per site. + $this->is_plugin() && + ( + is_plugin_active_for_network( $this->_plugin_basename ) || + // Plugin network level activation or uninstall. + ( fs_is_network_admin() && is_plugin_inactive( $this->_plugin_basename ) ) + ) + ); + + $this->_storage->set_network_active( + $this->_is_network_active, + $this->is_delegated_connection() + ); + + if ( ! isset( $this->_storage->is_network_activated ) ) { + $this->_storage->is_network_activated = $this->_is_network_active; + } + + if ( $this->_storage->is_network_activated != $this->_is_network_active ) { + // Update last activation level. + $this->_storage->is_network_activated = $this->_is_network_active; + + $this->maybe_adjust_storage(); + } + + #region Migration + + if ( is_multisite() ) { + /** + * If the install_timestamp exists on the site level but doesn't exist on the + * network level storage, it means that we need to process the storage with migration. + * + * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, install_timestamp will be already set in the network level storage. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + if ( false === $this->_storage->get( 'install_timestamp', false, true ) && + false !== $this->_storage->get( 'install_timestamp', false, false ) + ) { + // Initiate storage migration. + $this->_storage->migrate_to_network(); + + // Migrate module cache to network level storage. + $this->_cache->migrate_to_network(); + } + } + + #endregion + + $base_name_split = explode( '/', $this->_plugin_basename ); + $this->_plugin_dir_name = $base_name_split[0]; + + if ( $this->_logger->is_on() ) { + $this->_logger->info( 'plugin_main_file_path = ' . $this->_plugin_main_file_path ); + $this->_logger->info( 'plugin_dir_path = ' . $this->_plugin_dir_path ); + $this->_logger->info( 'plugin_basename = ' . $this->_plugin_basename ); + $this->_logger->info( 'free_plugin_basename = ' . $this->_free_plugin_basename ); + $this->_logger->info( 'plugin_dir_name = ' . $this->_plugin_dir_name ); + } + + // Remember link between file to slug. + $this->store_file_slug_map(); + + // Store plugin's initial install timestamp. + if ( ! isset( $this->_storage->install_timestamp ) ) { + $this->_storage->install_timestamp = WP_FS__SCRIPT_START_TIME; + } + + if ( ! is_object( $this->_plugin ) ) { + $this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->get(); + } + + $this->_admin_notices = FS_Admin_Notices::instance( + $this->_slug . ( $this->is_theme() ? ':theme' : '' ), + /** + * Ensure that the admin notice will always have a title by using the stored plugin title if available and + * retrieving the title via the "get_plugin_name" method if there is no stored plugin title available. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + ( is_object( $this->_plugin ) ? $this->_plugin->title : $this->get_plugin_name() ), + $this->get_unique_affix() + ); + + if ( 'true' === fs_request_get( 'fs_clear_api_cache' ) || + fs_request_is_action( 'restart_freemius' ) + ) { + FS_Api::clear_cache(); + $this->_cache->clear(); + } + + $this->register_constructor_hooks(); + + /** + * Starting from version 2.0.0, `FS_Site` entities no longer have the `plan` property and have `plan_id` + * instead. This should be called before calling `_load_account()`, otherwise, `$this->_site` will not be + * loaded in `_load_account` for versions of SDK starting from 2.0.0. + * + * @author Leo Fajardo (@leorw) + */ + self::migrate_install_plan_to_plan_id( $this->_storage ); + + $this->_load_account(); + + $this->_version_updates_handler(); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + private function maybe_adjust_storage() { + $install_timestamp = null; + $prev_is_premium = null; + + $options_to_update = array(); + + $is_network_admin = fs_is_network_admin(); + + $network_install_timestamp = $this->_storage->get( 'install_timestamp', null, true ); + + if ( ! $is_network_admin ) { + if ( is_null( $network_install_timestamp ) ) { + // Plugin was not network-activated before. + return; + } + + if ( is_null( $this->_storage->get( 'install_timestamp', null, false ) ) ) { + // Set the `install_timestamp` only if it's not yet set. + $install_timestamp = $network_install_timestamp; + } + + $prev_is_premium = $this->_storage->get( 'prev_is_premium', null, true ); + } else { + $current_wp_user = self::_get_current_wp_user(); + $current_fs_user = self::_get_user_by_email( $current_wp_user->user_email ); + $network_user_info = array(); + + $skips_count = 0; + + $sites = self::get_sites(); + $sites_count = count( $sites ); + + $blog_id_2_install_map = array(); + + $is_first_non_ignored_blog = true; + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + $blog_install_timestamp = $this->_storage->get( 'install_timestamp', null, $blog_id ); + + if ( is_null( $blog_install_timestamp ) ) { + // Plugin has not been installed on this blog. + continue; + } + + $is_earlier_install = ( + ! is_null( $install_timestamp ) && + $blog_install_timestamp < $install_timestamp + ); + + $install = $this->get_install_by_blog_id( $blog_id ); + + $update_network_user_info = false; + + if ( ! is_object( $install ) ) { + if ( ! $this->_storage->get( 'is_anonymous', false, $blog_id ) ) { + // The opt-in decision (whether to skip or opt in) is yet to be made. + continue; + } + + $skips_count ++; + } else { + $blog_id_2_install_map[ $blog_id ] = $install; + + if ( empty( $network_user_info ) ) { + // Set the network user info for the 1st time. Choose any user information whether or not it is for the current WP user. + $update_network_user_info = true; + } + + if ( ! $update_network_user_info && + is_object( $current_fs_user ) && + $network_user_info['user_id'] != $current_fs_user->id && + $install->user_id == $current_fs_user->id + ) { + // If an install that is owned by the current WP user is found, use its user information instead. + $update_network_user_info = true; + } + + if ( ! $update_network_user_info && + $is_earlier_install && + ( ! is_object( $current_fs_user ) || $current_fs_user->id == $install->user_id ) + ) { + // Update to the earliest install info if there's no install found so far that is owned by the current WP user; OR only if the found install is owned by the current WP user. + $update_network_user_info = true; + } + } + + if ( $update_network_user_info ) { + $network_user_info = array( + 'user_id' => $install->user_id, + 'blog_id' => $blog_id + ); + } + + $site_prev_is_premium = $this->_storage->get( 'prev_is_premium', null, $blog_id ); + + if ( $is_first_non_ignored_blog ) { + $prev_is_premium = $site_prev_is_premium; + + if ( is_null( $network_install_timestamp ) ) { + $install_timestamp = $blog_install_timestamp; + } + + $is_first_non_ignored_blog = false; + + continue; + } + + if ( ! is_null( $prev_is_premium ) && $prev_is_premium !== $site_prev_is_premium ) { + // If a different `$site_prev_is_premium` value is found, do not include the option in the collection of options to update. + $prev_is_premium = null; + } + + if ( $is_earlier_install ) { + // If an earlier install timestamp is found. + $install_timestamp = $blog_install_timestamp; + } + } + + $installs_count = count( $blog_id_2_install_map ); + + if ( $sites_count === ( $installs_count + $skips_count ) ) { + if ( ! empty( $network_user_info ) ) { + $options_to_update['network_user_id'] = $network_user_info['user_id']; + $options_to_update['network_install_blog_id'] = $network_user_info['blog_id']; + + foreach ( $blog_id_2_install_map as $blog_id => $install ) { + if ( $install->user_id == $network_user_info['user_id'] ) { + continue; + } + + $this->_storage->store( 'is_delegated_connection', true, $blog_id ); + } + } + + if ( $sites_count === $skips_count ) { + /** + * Assume network-level skipping as the intended action if all actions identified were only + * skipping of the connection (i.e., no opt-ins and delegated connections so far). + */ + $options_to_update['is_anonymous_ms'] = true; + } else if ( $sites_count === $installs_count ) { + /** + * Assume network-level opt-in as the intended action if all actions identified were only opt-ins + * (i.e., no delegation and skipping of the connections so far). + */ + $options_to_update['is_network_connected'] = true; + } + } + } + + if ( ! is_null( $install_timestamp ) ) { + $options_to_update['install_timestamp'] = $install_timestamp; + } + + if ( ! is_null( $prev_is_premium ) ) { + $options_to_update['prev_is_premium'] = $prev_is_premium; + } + + if ( ! empty( $options_to_update ) ) { + $this->adjust_storage( $options_to_update, $is_network_admin ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param array $options + * @param bool $is_network_admin + */ + private function adjust_storage( $options, $is_network_admin ) { + foreach ( $options as $name => $value ) { + $this->_storage->store( $name, $value, $is_network_admin ? true : null ); + } + } + + /** + * Checks whether this module has a settings menu. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return bool + */ + function has_settings_menu() { + return ( $this->_is_network_active && fs_is_network_admin() ) ? + $this->_menu->has_network_menu() : + $this->_menu->has_menu(); + } + + /** + * If `true` the opt-in should be shown as a modal dialog box on the themes.php page. WordPress.org themes guidelines prohibit from redirecting the user from the themes.php page after activating a theme. + * + * @author Vova Feldman (@svovaf) + * @since 2.4.5 + * + * @return bool + */ + function show_opt_in_on_themes_page() { + if ( ! $this->is_free_wp_org_theme() ) { + return false; + } + + if ( ! $this->has_settings_menu() ) { + return true; + } + + return $this->show_settings_with_tabs(); + } + + /** + * If `true` the opt-in should be shown on the product's main setting page. + * + * @author Vova Feldman (@svovaf) + * @since 2.4.5 + * + * @return bool + * + * @uses show_opt_in_on_themes_page(); + */ + function show_opt_in_on_setting_page() { + return ! $this->show_opt_in_on_themes_page(); + } + + /** + * If `true` the settings should be shown using tabs. + * + * @author Vova Feldman (@svovaf) + * @since 2.4.5 + * + * @return bool + */ + function show_settings_with_tabs() { + return ( self::NAVIGATION_TABS === $this->_navigation ); + } + + /** + * Check if the context module is free wp.org theme. + * + * This method is helpful because: + * 1. wp.org themes are limited to a single submenu item, + * and sub-submenu items are most likely not allowed (never verified). + * 2. wp.org themes are not allowed to redirect the user + * after the theme activation, therefore, the agreed UX + * is showing the opt-in as a modal dialog box after + * activation (approved by @otto42, @emiluzelac, @greenshady, @grapplerulrich). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + */ + function is_free_wp_org_theme() { + return ( + $this->is_theme() && + $this->is_org_repo_compliant() && + ! $this->is_premium() + ); + } + + /** + * Checks whether this a submenu item is visible. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.6 + * @since 1.2.2.7 Even if the menu item was specified to be hidden, when it is the context page, then show the submenu item so the user will have the right context page. + * + * @param string $slug + * @param bool $is_tabs_visibility_check This is used to decide if the associated tab should be shown or hidden. + * + * @return bool + */ + function is_submenu_item_visible( $slug, $is_tabs_visibility_check = false ) { + if ( $this->is_admin_page( $slug ) ) { + /** + * It is the current context page, so show the submenu item + * so the user will have the right context page, even if it + * was set to hidden. + */ + return true; + } + + if ( ! $this->has_settings_menu() ) { + // No menu settings at all. + return false; + } + + if ( + ! $is_tabs_visibility_check && + $this->is_org_repo_compliant() && + $this->show_settings_with_tabs() + ) { + /** + * wp.org themes are limited to a single submenu item, and + * sub-submenu items are most likely not allowed (never verified). + */ + return false; + } + + return $this->_menu->is_submenu_item_visible( $slug ); + } + + /** + * Check if a Freemius page should be accessible via the UI. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @param string $slug + * + * @return bool + */ + function is_page_visible( $slug ) { + if ( $this->is_admin_page( $slug ) ) { + return true; + } + + return $this->_menu->is_submenu_item_visible( $slug, true, true ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + private function _version_updates_handler() { + if ( ! isset( $this->_storage->sdk_version ) || $this->_storage->sdk_version != $this->version ) { + // Freemius version upgrade mode. + $this->_storage->sdk_last_version = $this->_storage->sdk_version; + $this->_storage->sdk_version = $this->version; + + if ( empty( $this->_storage->sdk_last_version ) || + version_compare( $this->_storage->sdk_last_version, $this->version, '<' ) + ) { + $this->_storage->sdk_upgrade_mode = true; + $this->_storage->sdk_downgrade_mode = false; + } else { + $this->_storage->sdk_downgrade_mode = true; + $this->_storage->sdk_upgrade_mode = false; + + } + + $this->do_action( 'sdk_version_update', $this->_storage->sdk_last_version, $this->version ); + } + + $plugin_version = $this->get_plugin_version(); + if ( ! isset( $this->_storage->plugin_version ) || $this->_storage->plugin_version != $plugin_version ) { + // Plugin version upgrade mode. + $this->_storage->plugin_last_version = $this->_storage->plugin_version; + $this->_storage->plugin_version = $plugin_version; + + if ( empty( $this->_storage->plugin_last_version ) || + version_compare( $this->_storage->plugin_last_version, $plugin_version, '<' ) + ) { + $this->_storage->plugin_upgrade_mode = true; + $this->_storage->plugin_downgrade_mode = false; + } else { + $this->_storage->plugin_downgrade_mode = true; + $this->_storage->plugin_upgrade_mode = false; + } + + if ( ! empty( $this->_storage->plugin_last_version ) ) { + // Different version of the plugin was installed before, therefore it's an update. + $this->_storage->is_plugin_new_install = false; + } + + $this->do_action( 'plugin_version_update', $this->_storage->plugin_last_version, $plugin_version ); + } + } + + #-------------------------------------------------------------------------------- + #region Data Migration on SDK Update + #-------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.5 + * + * @param string $sdk_prev_version + * @param string $sdk_version + */ + function _sdk_version_update( $sdk_prev_version, $sdk_version ) { + /** + * @since 1.1.7.3 Fixed unwanted connectivity test cleanup. + */ + if ( empty( $sdk_prev_version ) ) { + return; + } + + if ( version_compare( $sdk_prev_version, '2.1.0', '<' ) && + version_compare( $sdk_version, '2.1.0', '>=' ) + ) { + $this->_storage->handle_gdpr_admin_notice = true; + } + + if ( version_compare( $sdk_prev_version, '2.0.0', '<' ) && + version_compare( $sdk_version, '2.0.0', '>=' ) + ) { + $this->migrate_to_subscriptions_collection(); + + $this->consolidate_licenses(); + + // Clear trial_plan since it's now loaded from the plans collection when needed. + $this->_storage->remove( 'trial_plan', true, false ); + } + + if ( version_compare( $sdk_prev_version, '1.2.3', '<' ) && + version_compare( $sdk_version, '1.2.3', '>=' ) + ) { + /** + * Starting from version 1.2.3, paths are stored as relative instead of absolute and some of them can be + * invalid. + * + * @author Leo Fajardo (@leorw) + */ + $this->remove_invalid_paths(); + } + + if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) && + version_compare( $sdk_version, '1.1.5', '>=' ) + ) { + // On version 1.1.5 merged connectivity and is_on data. + if ( isset( $this->_storage->connectivity_test ) ) { + if ( ! isset( $this->_storage->is_on ) ) { + unset( $this->_storage->connectivity_test ); + } else { + $connectivity_data = $this->_storage->connectivity_test; + $connectivity_data['is_active'] = $this->_storage->is_on['is_active']; + $connectivity_data['timestamp'] = $this->_storage->is_on['timestamp']; + + // Override. + $this->_storage->connectivity_test = $connectivity_data; + + // Remove previous structure. + unset( $this->_storage->is_on ); + } + + } + } + + if ( + version_compare( $sdk_prev_version, '2.2.1', '<' ) && + version_compare( $sdk_version, '2.2.1', '>=' ) + ) { + /** + * Clear the file cache without storing the previous path since it could be a wrong path. For example, + * in the versions of the SDK lower than 2.2.1, it's possible for the path of an add-on to be the same + * as the parent plugin's when the add-on was auto-installed since the relevant method names were not + * skipped in the logic that determines the right path in the `get_caller_main_file_and_type` method + * (e.g. `try_activate_plugin`). Since it was an auto-installation, the caller was the parent plugin + * and so its path was used. In case the stored path is wrong, clearing the cache will resolve issues + * related to data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin). + * + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + */ + $this->clear_module_main_file_cache( false ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param \FS_Storage $storage + * @param bool|int|null $blog_id + */ + private static function migrate_install_plan_to_plan_id( FS_Storage $storage, $blog_id = null ) { + if ( empty( $storage->sdk_version ) ) { + // New installation of the plugin, no need to upgrade. + return; + } + + if ( ! version_compare( $storage->sdk_version, '2.0.0', '<' ) ) { + // Previous version is >= 2.0.0, so no need to migrate. + return; + } + + // Alias. + $module_type = $storage->get_module_type(); + $module_slug = $storage->get_module_slug(); + + $installs = self::get_all_sites( $module_type, $blog_id ); + $install = isset( $installs[ $module_slug ] ) ? $installs[ $module_slug ] : null; + + if ( ! is_object( $install ) ) { + return; + } + + if ( isset( $install->plan ) && is_object( $install->plan ) ) { + if ( isset( $install->plan->id ) && ! empty( $install->plan->id ) ) { + $install->plan_id = self::_decrypt( $install->plan->id ); + } + + unset( $install->plan ); + + $installs[ $module_slug ] = clone $install; + + self::set_account_option_by_module( + $module_type, + 'sites', + $installs, + true, + $blog_id + ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + */ + private function migrate_to_subscriptions_collection() { + if ( ! is_object( $this->_site ) ) { + return; + } + + if ( isset( $this->_storage->subscription ) && is_object( $this->_storage->subscription ) ) { + $this->_storage->subscriptions = array( fs_get_entity( $this->_storage->subscription, FS_Subscription::get_class_name() ) ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + */ + private function consolidate_licenses() { + $plugin_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_PLUGIN ); + if ( isset( $plugin_licenses[ $this->_slug ] ) ) { + $plugin_licenses = $plugin_licenses[ $this->_slug ]; + } else { + $plugin_licenses = array(); + } + + $theme_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_THEME ); + if ( isset( $theme_licenses[ $this->_slug ] ) ) { + $theme_licenses = $theme_licenses[ $this->_slug ]; + } else { + $theme_licenses = array(); + } + + if ( empty( $plugin_licenses ) && empty( $theme_licenses ) ) { + return; + } + + $all_licenses = array(); + $user_id_license_ids_map = array(); + + foreach ( $plugin_licenses as $user_id => $user_licenses ) { + if ( is_array( $user_licenses ) ) { + if ( ! isset( $user_license_ids[ $user_id ] ) ) { + $user_id_license_ids_map[ $user_id ] = array(); + } + + foreach ( $user_licenses as $user_license ) { + $all_licenses[] = $user_license; + $user_id_license_ids_map[ $user_id ][] = $user_license->id; + } + } + } + + foreach ( $theme_licenses as $user_id => $user_licenses ) { + if ( is_array( $user_licenses ) ) { + if ( ! isset( $user_license_ids[ $user_id ] ) ) { + $user_id_license_ids_map[ $user_id ] = array(); + } + + foreach ( $user_licenses as $user_license ) { + $all_licenses[] = $user_license; + $user_id_license_ids_map[ $user_id ][] = $user_license->id; + } + } + } + + self::store_user_id_license_ids_map( + $user_id_license_ids_map, + $this->_module_id + ); + + $this->_store_licenses( true, $this->_module_id, $all_licenses ); + } + + /** + * Remove invalid paths. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + */ + private function remove_invalid_paths() { + // Remove invalid path that is still associated with the current slug if there's any. + $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() ); + foreach ( $file_slug_map as $plugin_basename => $slug ) { + if ( $slug === $this->_slug && + $plugin_basename !== $this->_plugin_basename && + ! file_exists( $this->get_absolute_path( $plugin_basename ) ) + ) { + unset( $file_slug_map[ $plugin_basename ] ); + self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true ); + + break; + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @param string $plugin_prev_version + * @param string $plugin_version + */ + function _after_version_update( $plugin_prev_version, $plugin_version ) { + if ( $this->is_theme() ) { + // Expire the cache of the previous tabs since the theme may + // have setting updates. + $this->_cache->expire( 'tabs' ); + $this->_cache->expire( 'tabs_stylesheets' ); + } + } + + /** + * A special migration logic for the $_accounts, executed for all the plugins in the system: + * - Moves some data to the network level storage. + * - If the plugin's connection was skipped for all sites, set the plugin as if it was network skipped. + * - If the plugin's connection was ignored for all sites, don't do anything in terms of the network connection. + * - If the plugin was connected to all sites by the same super-admin, set the plugin as if was network opted-in for all sites. + * - If there's at least one site that was connected by a super-admin, find the "main super-admin" (the one that installed the majority of the plugin installs) and set the plugin as if was network activated with the main super-admin, set all the sites that were skipped or opted-in with a different user to delegated mode. Then, prompt the currently logged super-admin to choose what to do with the ignored sites. + * - If there are any sites in the network which the connection decision was not yet taken for, set this plugin into network activation mode so a super-admin can choose what to do with the rest of the sites. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + private static function migrate_accounts_to_network() { + $sites = self::get_sites(); + $sites_count = count( $sites ); + $connection_status = array(); + $plugin_slugs = array(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + self::$_accounts->migrate_to_network( $blog_id ); + + /** + * Build a list of all Freemius powered plugins slugs. + */ + $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array(), $blog_id ); + foreach ( $id_slug_type_path_map as $module_id => $data ) { + if ( WP_FS__MODULE_TYPE_PLUGIN === $data['type'] ) { + $plugin_slugs[ $data['slug'] ] = true; + } + } + + $installs = self::get_account_option( 'sites', WP_FS__MODULE_TYPE_PLUGIN, $blog_id ); + + if ( is_array( $installs ) ) { + foreach ( $installs as $slug => $install ) { + if ( ! isset( $connection_status[ $slug ] ) ) { + $connection_status[ $slug ] = array(); + } + + if ( is_object( $install ) && + FS_Site::is_valid_id( $install->id ) && + FS_User::is_valid_id( $install->user_id ) + ) { + $connection_status[ $slug ][ $blog_id ] = $install->user_id; + } + } + } + } + + foreach ( $plugin_slugs as $slug => $true ) { + if ( ! isset( $connection_status[ $slug ] ) ) { + $connection_status[ $slug ] = array(); + } + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + if ( isset( $connection_status[ $slug ][ $blog_id ] ) ) { + continue; + } + + $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug ); + + $is_anonymous = $storage->get( 'is_anonymous', null, $blog_id ); + + if ( ! is_null( $is_anonymous ) ) { + // Since 1.1.3 is_anonymous is an array. + if ( is_array( $is_anonymous ) && isset( $is_anonymous['is'] ) ) { + $is_anonymous = $is_anonymous['is']; + } + + if ( is_bool( $is_anonymous ) && true === $is_anonymous ) { + $connection_status[ $slug ][ $blog_id ] = 'skipped'; + } + } + + if ( ! isset( $connection_status[ $slug ][ $blog_id ] ) ) { + $connection_status[ $slug ][ $blog_id ] = 'ignored'; + } + } + } + + $super_admins = array(); + + foreach ( $connection_status as $slug => $blogs_status ) { + $skips = 0; + $ignores = 0; + $connections = 0; + $opted_in_users = array(); + $opted_in_super_admins = array(); + + $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug ); + + foreach ( $blogs_status as $blog_id => $status_or_user_id ) { + if ( 'skipped' === $status_or_user_id ) { + $skips ++; + } else if ( 'ignored' === $status_or_user_id ) { + $ignores ++; + } else if ( FS_User::is_valid_id( $status_or_user_id ) ) { + $connections ++; + + if ( ! isset( $opted_in_users[ $status_or_user_id ] ) ) { + $opted_in_users[ $status_or_user_id ] = array(); + } + + $opted_in_users[ $status_or_user_id ][] = $blog_id; + + if ( isset( $super_admins[ $status_or_user_id ] ) || + self::is_super_admin( $status_or_user_id ) + ) { + // Cache super-admin data. + $super_admins[ $status_or_user_id ] = true; + + // Remember opted-in super-admins for the plugin. + $opted_in_super_admins[ $status_or_user_id ] = true; + } + } + } + + $main_super_admin_user_id = null; + $all_migrated = false; + if ( $sites_count == $skips ) { + // All sites were skipped -> network skip by copying the anonymous mode from any of the sites. + $storage->is_anonymous_ms = $storage->is_anonymous; + + $all_migrated = true; + } else if ( $sites_count == $ignores ) { + // Don't do anything, still in activation mode. + + $all_migrated = true; + } else if ( 0 < count( $opted_in_super_admins ) ) { + // Find the super-admin with the majority of installs. + $max_installs_by_super_admin = 0; + foreach ( $opted_in_super_admins as $user_id => $true ) { + $installs_count = count( $opted_in_users[ $user_id ] ); + + if ( $installs_count > $max_installs_by_super_admin ) { + $max_installs_by_super_admin = $installs_count; + $main_super_admin_user_id = $user_id; + } + } + + if ( $sites_count == $connections && 1 == count( $opted_in_super_admins ) ) { + // Super-admin opted-in for all sites in the network. + $storage->is_network_connected = true; + + $all_migrated = true; + } + + // Store network user. + $storage->network_user_id = $main_super_admin_user_id; + + $storage->network_install_blog_id = ( $sites_count == $connections ) ? + // Since all sites are opted-in, associating with the main site. + get_current_blog_id() : + // Associating with the 1st found opted-in site. + $opted_in_users[ $main_super_admin_user_id ][0]; + + /** + * Make sure we migrate the plan ID of the network install, otherwise, if after the migration + * the 1st page that will be loaded is the network level WP Admin and $storage->network_install_blog_id + * is different than the main site of the network, the $this->_site will not be set since the plan_id + * will be empty. + */ + $storage->migrate_to_network(); + self::migrate_install_plan_to_plan_id( $storage, $storage->network_install_blog_id ); + } else { + // At least one opt-in. All the opt-in were created by a non-super-admin. + if ( 0 == $ignores ) { + // All sites were opted-in or skipped, all by non-super-admin. So delegate all. + $storage->store( 'is_delegated_connection', true, true ); + + $all_migrated = true; + } + } + + if ( ! $all_migrated ) { + /** + * Delegate all sites that were: + * 1) Opted-in by a user that is NOT the main-super-admin. + * 2) Skipped and non of the sites was opted-in by a super-admin. If any site was opted-in by a super-admin, there will be a main-super-admin, and we consider the skip as if it was done by that user. + */ + foreach ( $blogs_status as $blog_id => $status_or_user_id ) { + if ( $status_or_user_id == $main_super_admin_user_id ) { + continue; + } + + if ( FS_User::is_valid_id( $status_or_user_id ) || + ( 'skipped' === $status_or_user_id && is_null( $main_super_admin_user_id ) ) + ) { + $storage->store( 'is_delegated_connection', true, $blog_id ); + } + } + } + + + if ( ( $connections + $skips > 0 ) ) { + if ( $ignores > 0 ) { + /** + * If admin already opted-in or skipped in any of the network sites, and also + * have sites which the connection decision was not yet taken, set this plugin + * into network activation mode so the super-admin can choose what to do with + * the rest of the sites. + */ + self::set_network_upgrade_mode( $storage ); + } + } + } + } + + /** + * Set a module into network upgrade mode. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_Storage $storage + * + * @return bool + */ + private static function set_network_upgrade_mode( FS_Storage $storage ) { + return $storage->is_network_activation = true; + } + + /** + * Will return true after upgrading to the SDK with the network level integration, + * when the super-admin involvement is required regarding the rest of the sites. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return bool + */ + function is_network_upgrade_mode() { + return $this->_storage->get( 'is_network_activation' ); + } + + /** + * Clear flag after the upgrade mode completion. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return bool True if network activation was on and now completed. + */ + private function network_upgrade_mode_completed() { + if ( fs_is_network_admin() && $this->is_network_upgrade_mode() ) { + $this->_storage->remove( 'is_network_activation' ); + + return true; + } + + return false; + } + + #endregion + + /** + * This action is connected to the 'plugins_loaded' hook and helps to determine + * if this is a new plugin installation or a plugin update. + * + * There are 3 different use-cases: + * 1) New plugin installation right with Freemius: + * 1.1 _activate_plugin_event_hook() will be executed first + * 1.2 Since $this->_storage->is_plugin_new_install is not set, + * and $this->_storage->plugin_last_version is not set, + * $this->_storage->is_plugin_new_install will be set to TRUE. + * 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will + * be already set to TRUE. + * + * 2) Plugin update, didn't have Freemius before, and now have the SDK: + * 2.1 _activate_plugin_event_hook() will not be executed, because + * the activation hook do NOT fires on updates since WP 3.1. + * 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will + * be empty, therefore, it will be set to FALSE. + * + * 3) Plugin update, had Freemius in prev version as well: + * 3.1 _version_updates_handler() will be executed 1st, since FS was installed + * before, $this->_storage->plugin_last_version will NOT be empty, + * therefore, $this->_storage->is_plugin_new_install will be set to FALSE. + * 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is + * already set, therefore, it will not be modified. + * + * Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9. + * + * NOTE: + * The only fallback of this mechanism is if an admin updates a plugin based on use-case #2, + * and then, the next immediate PageView is the plugin's main settings page, it will not + * show the opt-in right away. The reason it will happen is because Freemius execution + * will be turned off till the plugin is fully loaded at least once + * (till $this->_storage->was_plugin_loaded is TRUE). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9 + * + */ + function _plugins_loaded() { + // Update flag that plugin was loaded with Freemius at least once. + $this->_storage->was_plugin_loaded = true; + + /** + * Bug fix - only set to false when it's a plugin, due to the + * execution sequence of the theme hooks and our methods, if + * this will be set for themes, Freemius will always assume + * it's a theme update. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.2 + */ + if ( $this->is_plugin() && + ! isset( $this->_storage->is_plugin_new_install ) + ) { + $this->_storage->is_plugin_new_install = ( + ! is_plugin_active( $this->_plugin_basename ) && + empty( $this->_storage->plugin_last_version ) + ); + } + } + + /** + * Add special parameter to WP admin AJAX calls so when we + * process AJAX calls we can identify its source properly. + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + */ + static function _enrich_ajax_url() { + $admin_param = is_network_admin() ? + '_fs_network_admin' : + '_fs_blog_admin'; + ?> + + + + _logger->entrance(); + + if ( is_admin() ) { + add_action( 'admin_init', array( &$this, '_hook_action_links_and_register_account_hooks' ) ); + + if ( $this->is_plugin() ) { + if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) { + /** + * Unless the `fs_allow_updater_and_dialog` URL param exists and its value is `true`, make + * Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) + * so that they won't interfere with the .org plugins' functionalities on that page (e.g. + * updating of a .org plugin). + */ + add_filter( 'site_transient_update_plugins', array( 'Freemius', '_remove_fs_updates_from_plugin_install_page' ), 10, 2 ); + } else if ( self::is_plugins_page() || self::is_updates_page() ) { + /** + * On the "Plugins" and "Updates" admin pages, if there are premium or non–org-compliant plugins, modify their details dialog URLs (add a Freemius-specific param) so that the SDK can determine if the plugin information dialog should show information from Freemius. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + add_action( 'admin_footer', array( 'Freemius', '_prepend_fs_allow_updater_and_dialog_flag_url_param' ) ); + } + + $plugin_dir = dirname( $this->_plugin_dir_path ) . '/'; + + /** + * @since 1.2.2 + * + * Hook to both free and premium version activations to support + * auto deactivation on the other version activation. + */ + register_activation_hook( + $plugin_dir . $this->_free_plugin_basename, + array( &$this, '_activate_plugin_event_hook' ) + ); + + register_activation_hook( + $plugin_dir . $this->premium_plugin_basename(), + array( &$this, '_activate_plugin_event_hook' ) + ); + } else { + add_action( 'after_switch_theme', array( &$this, '_activate_theme_event_hook' ), 10, 2 ); + + add_action( 'admin_footer', array( &$this, '_style_premium_theme' ) ); + } + + /** + * Part of the mechanism to identify new plugin install vs. plugin update. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9 + */ + if ( empty( $this->_storage->was_plugin_loaded ) ) { + /** + * During the plugin activation (not theme), 'plugins_loaded' will be already executed + * when the logic gets here since the activation logic first add the activate plugins, + * then triggers 'plugins_loaded', and only then include the code of the plugin that + * is activated. Which means that _plugins_loaded() will NOT be executed during the + * plugin activation, and that IS intentional. + * + * @author Vova Feldman (@svovaf) + */ + if ( $this->is_plugin() && + $this->is_activation_mode( false ) && + 0 == did_action( 'plugins_loaded' ) + ) { + add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) ); + } else { + // If was activated before, then it was already loaded before. + $this->_plugins_loaded(); + } + } + + if ( ! self::is_ajax() ) { + if ( ! $this->is_addon() ) { + add_action( 'init', array( &$this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY ); + } + } + + if ( $this->_storage->handle_gdpr_admin_notice ) { + add_action( 'init', array( &$this, '_maybe_show_gdpr_admin_notice' ) ); + } + + add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') ); + add_action( 'init', array( &$this, '_maybe_add_pricing_ajax_handler' ) ); + } + + if ( $this->is_plugin() ) { + if ( $this->_is_network_active ) { + add_action( 'wpmu_new_blog', array( $this, '_after_new_blog_callback' ), 10, 6 ); + } + + register_deactivation_hook( $this->_plugin_main_file_path, array( &$this, '_deactivate_plugin_hook' ) ); + } + + if ( is_multisite() ) { + add_action( 'deactivate_blog', array( &$this, '_after_site_deactivated_callback' ) ); + add_action( 'archive_blog', array( &$this, '_after_site_deactivated_callback' ) ); + add_action( 'make_spam_blog', array( &$this, '_after_site_deactivated_callback' ) ); + add_action( 'deleted_blog', array( &$this, '_after_site_deleted_callback' ), 10, 2 ); + + add_action( 'activate_blog', array( &$this, '_after_site_reactivated_callback' ) ); + add_action( 'unarchive_blog', array( &$this, '_after_site_reactivated_callback' ) ); + add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) ); + } + + if ( $this->is_theme() && + self::is_customizer() && + $this->apply_filters( 'show_customizer_upsell', true ) + ) { + // Register customizer upsell. + add_action( 'customize_register', array( &$this, '_customizer_register' ) ); + } + + add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY ); + + if ( $this->is_theme() && ! $this->is_migration() ) { + add_action( 'admin_init', array( &$this, '_add_tracking_links' ) ); + } + + add_action( 'admin_init', array( &$this, '_add_license_activation' ) ); + add_action( 'admin_init', array( &$this, '_add_premium_version_upgrade_selection' ) ); + add_action( 'admin_init', array( &$this, '_add_beta_mode_update_handler' ) ); + add_action( 'admin_init', array( &$this, '_add_user_change_option' ) ); + + $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) ); + $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) ); + $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) ); + $this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) ); + + if ( $this->_is_network_active && fs_is_network_admin() ) { + $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) ); + } + + $this->add_ajax_action( 'install_premium_version', array( + &$this, + '_install_premium_version_ajax_action' + ) ); + + $this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) ); + + $this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) ); + + $this->add_action( 'sdk_version_update', array( &$this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 ); + + $this->add_action( + 'plugin_version_update', + array( &$this, '_after_version_update' ), + WP_FS__DEFAULT_PRIORITY, + 2 + ); + $this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) ); + + add_action( 'admin_init', array( &$this, '_add_trial_notice' ) ); + add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) ); + add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) ); + + /** + * Handle request to reset anonymous mode for `get_reconnect_url()`. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + */ + if ( fs_request_is_action( 'reset_anonymous_mode' ) && + $this->get_unique_affix() === fs_request_get( 'fs_unique_affix' ) + ) { + add_action( 'admin_init', array( &$this, 'connect_again' ) ); + } + } + + /** + * Register the required hooks right after the settings parse is completed. + * + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + */ + private function register_after_settings_parse_hooks() { + if ( is_admin() && + $this->is_theme() && + $this->is_premium() && + ! $this->has_active_valid_license() + ) { + $this->add_ajax_action( + 'delete_theme_update_data', + array( &$this, '_delete_theme_update_data_action' ) + ); + } + + if ( $this->show_settings_with_tabs() ) { + /** + * Include the required hooks to capture the theme settings' page tabs + * and cache them. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + */ + if ( ! $this->_cache->has_valid( 'tabs' ) ) { + add_action( 'admin_footer', array( &$this, '_tabs_capture' ) ); + // Add license activation AJAX callback. + $this->add_ajax_action( 'store_tabs', array( &$this, '_store_tabs_ajax_action' ) ); + + add_action( 'admin_enqueue_scripts', array( &$this, '_store_tabs_styles' ), 9999999 ); + } + + add_action( + 'admin_footer', + array( &$this, '_add_freemius_tabs' ), + /** + * The tabs JS code must be executed after the tabs capture logic (_tabs_capture()). + * That's why the priority is 11 while the tabs capture logic is added + * with priority 10. + * + * @author Vova Feldman (@svovaf) + */ + 11 + ); + } + + if ( ! self::is_ajax() ) { + if ( ! $this->is_addon() || $this->is_only_premium() ) { + add_action( + ( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', + array( &$this, '_prepare_admin_menu' ), + WP_FS__LOWEST_PRIORITY + ); + } + } + } + + /** + * Makes Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) so that + * they won't interfere with the .org plugins' functionalities on that page (e.g. updating of a .org plugin). + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + * + * @param object $updates + * @param string|null $transient + * + * @return object + */ + static function _remove_fs_updates_from_plugin_install_page( $updates, $transient = null ) { + if ( is_object( $updates ) && isset( $updates->response ) ) { + foreach ( $updates->response as $file => $plugin ) { + if ( isset( $plugin->package ) && false !== strpos( $plugin->package, 'api.freemius' ) ) { + unset( $updates->response[ $file ] ); + } + } + } + + return $updates; + } + + /** + * Prepends the `fs_allow_updater_and_dialog` param to the plugin information URLs to tell the SDK to handle + * the information that is shown on the plugin details dialog that is shown when the relevant link is clicked. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + * + * @return string + */ + static function _prepend_fs_allow_updater_and_dialog_flag_url_param() { + $slug_basename_map = array(); + foreach ( self::$_instances as $instance ) { + if ( ! $instance->is_plugin() ) { + continue; + } + + $slug_basename_map[ $instance->get_slug() ] = $instance->premium_plugin_basename(); + } + ?> + + is_beta() ) { + $has_any_beta_version = true; + break; + } + } + + if ( $has_any_beta_version ) { + fs_enqueue_local_style( 'fs_plugins', '/admin/plugins.css' ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + static function _maybe_add_beta_label_to_plugins_and_handle_confirmation() { + $beta_data = array(); + + foreach ( self::$_instances as $instance ) { + if ( ! $instance->is_premium() ) { + continue; + } + + /** + * If there's an available beta version update, a confirmation message will be shown when the + * "Update now" link on the "Plugins" or "Themes" page is clicked. + */ + $has_beta_update = $instance->has_beta_update(); + + $is_beta = ( + // The "Beta" label is added separately for themes. + $instance->is_plugin() && + $instance->is_beta() + ); + + if ( ! $is_beta && ! $has_beta_update ) { + continue; + } + + $beta_data[ $instance->get_plugin_basename() ] = array( 'is_installed_version_beta' => $is_beta ); + + if ( ! $has_beta_update ) { + continue; + } + + $beta_data[ $instance->get_plugin_basename() ]['beta_version_update_confirmation_message'] = sprintf( + '%s %s', + sprintf( + fs_esc_attr_inline( + 'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.', + 'beta-version-update-caution', + $instance->get_slug() + ), + $instance->get_plugin_title() + ), + fs_esc_attr_inline( 'Would you like to proceed with the update?', 'update-confirmation', $instance->get_slug() ) + ); + } + + if ( empty( $beta_data ) ) { + return; + } + ?> + + _free_plugin_basename ] ); + unset( $uninstallable_plugins[ $this->premium_plugin_basename() ] ); + + update_option( 'uninstall_plugins', $uninstallable_plugins ); + } + + /** + * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates. + * + * @param bool $store_prev_path + */ + private function clear_module_main_file_cache( $store_prev_path = true ) { + if ( ! isset( $this->_storage->plugin_main_file ) || + empty( $this->_storage->plugin_main_file->path ) + ) { + return; + } + + if ( ! $store_prev_path ) { + /** + * Storing the previous path is not needed when clearing the cache after an SDK version update since + * the main purpose of the cache clearing in that event is to correct a wrong plugin main file path + * which causes data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin). + * + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + */ + unset( $this->_storage->plugin_main_file->path ); + } else { + $plugin_main_file = clone $this->_storage->plugin_main_file; + + // Store cached path (2nd layer cache). + $plugin_main_file->prev_path = $plugin_main_file->path; + + // Clear cached path. + unset( $plugin_main_file->path ); + + $this->_storage->plugin_main_file = $plugin_main_file; + } + + /** + * Clear global cached path. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map' ); + unset( $id_slug_type_path_map[ $this->_module_id ]['path'] ); + self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + */ + function _hook_action_links_and_register_account_hooks() { + if ( $this->is_migration() ) { + return; + } + + $this->_add_tracking_links(); + + if ( self::is_plugins_page() && $this->is_plugin() ) { + $this->hook_plugin_action_links(); + } + + $this->_register_account_hooks(); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + private function _register_account_hooks() { + if ( ! is_admin() ) { + return; + } + + /** + * Always show the deactivation feedback form since we added + * automatic free version deactivation upon premium code activation. + * + * @since 1.2.1.6 + */ + $this->add_ajax_action( + 'submit_uninstall_reason', + array( &$this, '_submit_uninstall_reason_action' ) + ); + + $this->add_ajax_action( + 'cancel_subscription_or_trial', + array( &$this, 'cancel_subscription_or_trial_ajax_action' ) + ); + + if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) { + if ( ( $this->is_plugin() && self::is_plugins_page() ) || + ( $this->is_theme() && self::is_themes_page() ) + ) { + add_action( 'admin_footer', array( &$this, '_add_deactivation_feedback_dialog_box' ) ); + } + } + } + + /** + * Leverage backtrace to find caller plugin file path. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param bool $is_init Is initiation sequence. + * + * @return string + */ + private function _find_caller_plugin_file( $is_init = false ) { + // Try to load the cached value of the file path. + if ( isset( $this->_storage->plugin_main_file ) ) { + $plugin_main_file = $this->_storage->plugin_main_file; + if ( ! empty( $plugin_main_file->path ) ) { + $absolute_path = $this->get_absolute_path( $plugin_main_file->path ); + if ( file_exists( $absolute_path ) ) { + return $absolute_path; + } + } + } + + /** + * @since 1.2.1 + * + * `clear_module_main_file_cache()` is clearing the plugin's cached path on + * deactivation. Therefore, if any plugin/theme was initiating `Freemius` + * with that plugin's slug, it was overriding the empty plugin path with a wrong path. + * + * So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path` + * when the class instantiator isn't the module. + */ + if ( ! $is_init ) { + // Fetch prev path cache. + if ( isset( $this->_storage->plugin_main_file ) && + ! empty( $this->_storage->plugin_main_file->prev_path ) + ) { + $absolute_path = $this->get_absolute_path( $this->_storage->plugin_main_file->prev_path ); + if ( file_exists( $absolute_path ) ) { + return $absolute_path; + } + } + + wp_die( + $this->get_text_inline( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'failed-finding-main-path' ) . + " Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";", + $this->get_text_inline( 'Error', 'error' ), + array( 'back_link' => true ) + ); + } + + /** + * @since 1.2.1 + * + * Only the original instantiator that calls dynamic_init can modify the module's path. + */ + // Find caller module. + $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); + $this->_storage->plugin_main_file = (object) array( + 'path' => $id_slug_type_path_map[ $this->_module_id ]['path'], + ); + + return $this->get_absolute_path( $id_slug_type_path_map[ $this->_module_id ]['path'] ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + * + * @param string $path + * + * @return string + */ + private function get_relative_path( $path ) { + $module_root_dir = $this->get_module_root_dir_path(); + if ( 0 === strpos( $path, $module_root_dir ) ) { + $path = substr( $path, strlen( $module_root_dir ) ); + } + + return $path; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + * + * @param string $path + * @param string|bool $module_type + * + * @return string + */ + private function get_absolute_path( $path, $module_type = false ) { + $module_root_dir = $this->get_module_root_dir_path( $module_type ); + if ( 0 !== strpos( $path, $module_root_dir ) ) { + $path = fs_normalize_path( $module_root_dir . $path ); + } + + return $path; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + * + * @param string|bool $module_type + * + * @return string + */ + private function get_module_root_dir_path( $module_type = false ) { + $is_plugin = empty( $module_type ) ? + $this->is_plugin() : + ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ); + + return fs_normalize_path( trailingslashit( $is_plugin ? + WP_PLUGIN_DIR : + get_theme_root( get_stylesheet() ) ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * + * @param number $module_id + * @param string $slug + * + * @since 1.2.2 + */ + private function store_id_slug_type_path_map( $module_id, $slug ) { + $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); + + $store_option = false; + + if ( ! isset( $id_slug_type_path_map[ $module_id ] ) ) { + $id_slug_type_path_map[ $module_id ] = array( + 'slug' => $slug + ); + + $store_option = true; + } else if ( + isset( $id_slug_type_path_map[ $module_id ]['slug'] ) && + $slug !== $id_slug_type_path_map[ $module_id ]['slug'] + ) { + $id_slug_type_path_map[ $module_id ]['slug'] = $slug; + $store_option = true; + } + + if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) || + /** + * This verification is for cases when suddenly the same module + * is installed but with a different folder name. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.3 + */ + ! file_exists( $this->get_absolute_path( + $id_slug_type_path_map[ $module_id ]['path'], + $id_slug_type_path_map[ $module_id ]['type'] + ) ) + ) { + $caller_main_file_and_type = $this->get_caller_main_file_and_type(); + + $id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type; + $id_slug_type_path_map[ $module_id ]['path'] = $caller_main_file_and_type->path; + + $store_option = true; + } + + if ( $store_option ) { + self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true ); + } + } + + /** + * Identifies the caller type: plugin or theme. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.3 Find the earliest module in the call stack that calls to the SDK. This fix is for cases when + * add-ons are relying on loading the SDK from the parent module, and also allows themes including the + * SDK an internal file instead of directly from functions.php. + * @since 1.2.1.7 Knows how to handle cases when an add-on includes the parent module logic. + */ + private function get_caller_main_file_and_type() { + self::require_plugin_essentials(); + + $all_plugins = fs_get_plugins( true ); + $all_plugins_paths = array(); + + // Get active plugin's main files real full names (might be symlinks). + foreach ( $all_plugins as $relative_path => $data ) { + if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) { + /** + * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they + * can't really include the SDK. + * + * @author Vova Feldman + * @since 1.2.1.7 + */ + continue; + } + + $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) ); + } + + $caller_file_candidate = false; + $caller_map = array(); + $module_type = WP_FS__MODULE_TYPE_PLUGIN; + $themes_dir = fs_normalize_path( get_theme_root( get_stylesheet() ) ); + $plugin_dir_to_skip = false; + + for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) { + if ( empty( $bt[ $i ]['file'] ) ) { + continue; + } + + if ( $i > 1 && ! empty( $bt[ $i - 1 ]['file'] ) && $bt[ $i ]['file'] === $bt[ $i - 1 ]['file'] ) { + // If file same as the prev file in the stack, skip it. + continue; + } + + if ( ! empty( $bt[ $i ]['function'] ) && in_array( $bt[ $i ]['function'], array( + 'do_action', + 'apply_filter', + // The string split is stupid, but otherwise, theme check + // throws info notices. + 'requir' . 'e_once', + 'requir' . 'e', + 'includ' . 'e_once', + 'includ' . 'e', + 'install_and_activate_plugin', + 'try_activate_plugin', + 'activate_plugin' + ) ) + ) { + if ( 'activate_plugin' === $bt[ $i ]['function'] ) { + /** + * Store the directory of the activator plugin so that any other file that starts with it + * cannot be mistakenly chosen as a candidate caller file. + * + * @author Leo Fajardo + * + * @since 2.3.0 + */ + $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] ); + + foreach ( $all_plugins_paths as $plugin_path ) { + $plugin_dir = fs_normalize_path( dirname( $plugin_path ) . '/' ); + if ( false !== strpos( $caller_file_path, $plugin_dir ) ) { + $plugin_dir_to_skip = $plugin_dir; + + break; + } + } + } + + // Ignore call stack hooks and files inclusion. + continue; + } + + $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] ); + + if ( ! empty( $plugin_dir_to_skip ) ) { + /** + * Skip if it's an activator plugin file to avoid mistakenly choosing it as a candidate caller file. + * + * @author Leo Fajardo + * + * @since 2.3.0 + */ + if ( 0 === strpos( $caller_file_path, $plugin_dir_to_skip ) ) { + continue; + } + } + + if ( 'functions.php' === basename( $caller_file_path ) ) { + /** + * 1. Assumes that theme's starting execution file is functions.php. + * 2. This complex logic fixes symlink issues (e.g. with Vargant). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.5 + */ + + if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) { + $module_type = WP_FS__MODULE_TYPE_THEME; + + /** + * Relative path of the theme, e.g.: + * `my-theme/functions.php` + * + * @author Leo Fajardo (@leorw) + */ + $caller_file_candidate = basename( dirname( $caller_file_path ) ) . + '/' . + basename( $caller_file_path ); + + continue; + } + } + + $caller_file_hash = md5( $caller_file_path ); + + if ( ! isset( $caller_map[ $caller_file_hash ] ) ) { + foreach ( $all_plugins_paths as $plugin_path ) { + if ( empty( $plugin_path ) ) { + continue; + } + + if ( false !== strpos( $caller_file_path, fs_normalize_path( dirname( $plugin_path ) . '/' ) ) ) { + $caller_map[ $caller_file_hash ] = fs_normalize_path( $plugin_path ); + break; + } + } + } + + if ( isset( $caller_map[ $caller_file_hash ] ) ) { + $module_type = WP_FS__MODULE_TYPE_PLUGIN; + $caller_file_candidate = plugin_basename( $caller_map[ $caller_file_hash ] ); + } + } + + return (object) array( + 'module_type' => $module_type, + 'path' => $caller_file_candidate + ); + } + + #---------------------------------------------------------------------------------- + #region Deactivation Feedback Form + #---------------------------------------------------------------------------------- + + /** + * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins + * page. + * + * @author Vova Feldman (@svovaf) + * @author Leo Fajardo (@leorw) + * + * @since 1.1.2 + */ + function _add_deactivation_feedback_dialog_box() { + $subscription_cancellation_dialog_box_template_params = $this->apply_filters( 'show_deactivation_subscription_cancellation', true ) ? + $this->_get_subscription_cancellation_dialog_box_template_params() : + array(); + + /** + * @since 2.3.0 Developers can optionally hide the deactivation feedback form using the 'show_deactivation_feedback_form' filter. + */ + $show_deactivation_feedback_form = true; + if ( $this->has_filter( 'show_deactivation_feedback_form' ) ) { + $show_deactivation_feedback_form = $this->apply_filters( 'show_deactivation_feedback_form', true ); + } else if ( $this->is_addon() ) { + /** + * If the add-on's 'show_deactivation_feedback_form' is not set, try to inherit the value from the parent. + */ + $show_deactivation_feedback_form = $this->get_parent_instance()->apply_filters( 'show_deactivation_feedback_form', true ); + } + + $uninstall_confirmation_message = $this->apply_filters( 'uninstall_confirmation_message', '' ); + + if ( + empty( $subscription_cancellation_dialog_box_template_params ) && + ! $show_deactivation_feedback_form && + empty( $uninstall_confirmation_message ) + ) { + return; + } + + $vars = array( 'id' => $this->_module_id ); + + if ( $show_deactivation_feedback_form ) { + /* Check the type of user: + * 1. Long-term (long-term) + * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term). + * 3. Short-term (short-term) + */ + $is_long_term_user = true; + + // Check if the site is at least 2 days old. + $time_installed = $this->_storage->install_timestamp; + + // Difference in seconds. + $date_diff = time() - $time_installed; + + // Convert seconds to days. + $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) ); + + if ( $date_diff_days < 2 ) { + $is_long_term_user = false; + } + + $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user ); + + if ( $is_long_term_user ) { + $user_type = 'long-term'; + } else { + if ( ! $this->is_registered() && ! $this->is_anonymous() ) { + $user_type = 'non-registered-and-non-anonymous-short-term'; + } else { + $user_type = 'short-term'; + } + } + + $uninstall_reasons = $this->_get_uninstall_reasons( $user_type ); + + $vars['reasons'] = $uninstall_reasons; + } + + $vars['subscription_cancellation_dialog_box_template_params'] = &$subscription_cancellation_dialog_box_template_params; + $vars['show_deactivation_feedback_form'] = $show_deactivation_feedback_form; + $vars['uninstall_confirmation_message'] = $uninstall_confirmation_message; + + /** + * Load the HTML template for the deactivation feedback dialog box. + * + * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin. + */ + fs_require_template( 'forms/deactivation/form.php', $vars ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.1.2 + * + * @param string $user_type + * + * @return array The uninstall reasons for the specified user type. + */ + function _get_uninstall_reasons( $user_type = 'long-term' ) { + $module_type = $this->_module_type; + + $internal_message_template_var = array( + 'id' => $this->_module_id + ); + + $plan = $this->get_plan(); + + if ( $this->is_registered() && is_object( $plan ) && $plan->has_technical_support() ) { + $contact_support_template = fs_get_template( 'forms/deactivation/contact.php', $internal_message_template_var ); + } else { + $contact_support_template = ''; + } + + $reason_found_better_plugin = array( + 'id' => self::REASON_FOUND_A_BETTER_PLUGIN, + 'text' => sprintf( $this->get_text_inline( 'I found a better %s', 'reason-found-a-better-plugin' ), $module_type ), + 'input_type' => 'textfield', + 'input_placeholder' => sprintf( $this->get_text_inline( "What's the %s's name?", 'placeholder-plugin-name' ), $module_type ), + ); + + $reason_temporary_deactivation = array( + 'id' => self::REASON_TEMPORARY_DEACTIVATION, + 'text' => sprintf( + $this->get_text_inline( "It's a temporary %s. I'm just debugging an issue.", 'reason-temporary-x' ), + strtolower( $this->is_plugin() ? + $this->get_text_inline( 'Deactivation', 'deactivation' ) : + $this->get_text_inline( 'Theme Switch', 'theme-switch' ) + ) + ), + 'input_type' => '', + 'input_placeholder' => '' + ); + + $reason_other = array( + 'id' => self::REASON_OTHER, + 'text' => $this->get_text_inline( 'Other', 'reason-other' ), + 'input_type' => 'textfield', + 'input_placeholder' => '' + ); + + $long_term_user_reasons = array( + array( + 'id' => self::REASON_NO_LONGER_NEEDED, + 'text' => sprintf( $this->get_text_inline( 'I no longer need the %s', 'reason-no-longer-needed' ), $module_type ), + 'input_type' => '', + 'input_placeholder' => '' + ), + $reason_found_better_plugin, + array( + 'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD, + 'text' => sprintf( $this->get_text_inline( 'I only needed the %s for a short period', 'reason-needed-for-a-short-period' ), $module_type ), + 'input_type' => '', + 'input_placeholder' => '' + ), + array( + 'id' => self::REASON_BROKE_MY_SITE, + 'text' => sprintf( $this->get_text_inline( 'The %s broke my site', 'reason-broke-my-site' ), $module_type ), + 'input_type' => '', + 'input_placeholder' => '', + 'internal_message' => $contact_support_template + ), + array( + 'id' => self::REASON_SUDDENLY_STOPPED_WORKING, + 'text' => sprintf( $this->get_text_inline( 'The %s suddenly stopped working', 'reason-suddenly-stopped-working' ), $module_type ), + 'input_type' => '', + 'input_placeholder' => '', + 'internal_message' => $contact_support_template + ) + ); + + if ( $this->is_paying() ) { + $long_term_user_reasons[] = array( + 'id' => self::REASON_CANT_PAY_ANYMORE, + 'text' => $this->get_text_inline( "I can't pay for it anymore", 'reason-cant-pay-anymore' ), + 'input_type' => 'textfield', + 'input_placeholder' => $this->get_text_inline( 'What price would you feel comfortable paying?', 'placeholder-comfortable-price' ) + ); + } + + $reason_dont_share_info = array( + 'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION, + 'text' => $this->get_text_inline( "I don't like to share my information with you", 'reason-dont-like-to-share-my-information' ), + 'input_type' => '', + 'input_placeholder' => '' + ); + + /** + * If the current user has selected the "don't share data" reason in the deactivation feedback modal, inform the + * user by showing additional message that he doesn't have to share data and can just choose to skip the opt-in + * (the Skip button is included in the message to show). This message will only be shown if anonymous mode is + * enabled and the user's account is currently not in pending activation state (similar to the way the Skip + * button in the opt-in form is shown/hidden). + */ + if ( $this->is_enable_anonymous() && ! $this->is_pending_activation() ) { + $reason_dont_share_info['internal_message'] = fs_get_template( 'forms/deactivation/retry-skip.php', $internal_message_template_var ); + } + + $uninstall_reasons = array( + 'long-term' => $long_term_user_reasons, + 'non-registered-and-non-anonymous-short-term' => array( + array( + 'id' => self::REASON_DIDNT_WORK, + 'text' => sprintf( $this->get_text_inline( "The %s didn't work", 'reason-didnt-work' ), $module_type ), + 'input_type' => '', + 'input_placeholder' => '' + ), + $reason_dont_share_info, + $reason_found_better_plugin + ), + 'short-term' => array( + array( + 'id' => self::REASON_COULDNT_MAKE_IT_WORK, + 'text' => $this->get_text_inline( "I couldn't understand how to make it work", 'reason-couldnt-make-it-work' ), + 'input_type' => '', + 'input_placeholder' => '', + 'internal_message' => $contact_support_template + ), + $reason_found_better_plugin, + array( + 'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE, + 'text' => sprintf( $this->get_text_inline( "The %s is great, but I need specific feature that you don't support", 'reason-great-but-need-specific-feature' ), $module_type ), + 'input_type' => 'textarea', + 'input_placeholder' => $this->get_text_inline( 'What feature?', 'placeholder-feature' ) + ), + array( + 'id' => self::REASON_NOT_WORKING, + 'text' => sprintf( $this->get_text_inline( 'The %s is not working', 'reason-not-working' ), $module_type ), + 'input_type' => 'textarea', + 'input_placeholder' => $this->get_text_inline( "Kindly share what didn't work so we can fix it for future users...", 'placeholder-share-what-didnt-work' ) + ), + array( + 'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR, + 'text' => $this->get_text_inline( "It's not what I was looking for", 'reason-not-what-i-was-looking-for' ), + 'input_type' => 'textarea', + 'input_placeholder' => $this->get_text_inline( "What you've been looking for?", 'placeholder-what-youve-been-looking-for' ) + ), + array( + 'id' => self::REASON_DIDNT_WORK_AS_EXPECTED, + 'text' => sprintf( $this->get_text_inline( "The %s didn't work as expected", 'reason-didnt-work-as-expected' ), $module_type ), + 'input_type' => 'textarea', + 'input_placeholder' => $this->get_text_inline( 'What did you expect?', 'placeholder-what-did-you-expect' ) + ) + ) + ); + + // Randomize the reasons for the current user type. + shuffle( $uninstall_reasons[ $user_type ] ); + + // Keep the following reasons as the last items in the list. + $uninstall_reasons[ $user_type ][] = $reason_temporary_deactivation; + $uninstall_reasons[ $user_type ][] = $reason_other; + + $uninstall_reasons = $this->apply_filters( 'uninstall_reasons', $uninstall_reasons ); + + return $uninstall_reasons[ $user_type ]; + } + + /** + * Called after the user has submitted his reason for deactivating the plugin. + * + * @author Leo Fajardo (@leorw) + * @since 1.1.2 + */ + function _submit_uninstall_reason_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'submit_uninstall_reason' ); + + $reason_id = fs_request_get( 'reason_id' ); + + // Check if the given reason ID is an unsigned integer. + if ( ! ctype_digit( $reason_id ) ) { + exit; + } + + $reason_info = trim( fs_request_get( 'reason_info', '' ) ); + if ( ! empty( $reason_info ) ) { + $reason_info = substr( $reason_info, 0, 128 ); + } + + $reason = (object) array( + 'id' => $reason_id, + 'info' => $reason_info, + 'is_anonymous' => fs_request_get_bool( 'is_anonymous' ) + ); + + $this->_storage->store( 'uninstall_reason', $reason ); + + /** + * If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do + * not support uninstall hook. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + if ( $this->is_theme() ) { + if ( $this->is_premium() && ! $this->has_active_valid_license() ) { + FS_Plugin_Updater::instance( $this )->delete_update_data(); + } + + $this->_uninstall_plugin_event( false ); + $this->remove_sdk_reference(); + } + + // Print '1' for successful operation. + echo 1; + exit; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.4 + */ + function cancel_subscription_or_trial_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'cancel_subscription_or_trial' ); + + $result = $this->cancel_subscription_or_trial( fs_request_get( 'plugin_id', $this->get_id() ), false ); + + if ( $this->is_api_error( $result ) ) { + $this->shoot_ajax_failure( $result->error->message ); + } + + $this->shoot_ajax_success(); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.4 + * + * @param number $plugin_id + * + * @return object + */ + private function cancel_subscription_or_trial( $plugin_id ) { + $fs = null; + if ( $plugin_id == $this->get_id() ) { + $fs = $this; + } else if ( $this->is_addon_activated( $plugin_id ) ) { + $fs = self::get_instance_by_id( $plugin_id ); + } + + $result = null; + + if ( ! is_null( $fs ) ) { + $result = $fs->is_paid_trial() ? + $fs->_cancel_trial() : + $fs->_downgrade_site(); + } + + return $result; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.2 + */ + function _delete_theme_update_data_action() { + FS_Plugin_Updater::instance( $this )->delete_update_data(); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Instance + #---------------------------------------------------------------------------------- + + /** + * Main singleton instance. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + * + * @param number $module_id + * @param string|bool $slug + * @param bool $is_init Is initiation sequence. + * + * @return Freemius|false + */ + static function instance( $module_id, $slug = false, $is_init = false ) { + if ( empty( $module_id ) ) { + return false; + } + + /** + * Load the essential static data prior to initiating FS_Plugin_Manager since there's an essential MS network migration logic that needs to be executed prior to the initiation. + */ + self::_load_required_static(); + + if ( ! is_numeric( $module_id ) ) { + if ( ! $is_init && true === $slug ) { + $is_init = true; + } + + $slug = $module_id; + + $module = FS_Plugin_Manager::instance( $slug )->get(); + + if ( is_object( $module ) ) { + $module_id = $module->id; + } + } + + $key = 'm_' . $module_id; + + if ( ! isset( self::$_instances[ $key ] ) ) { + self::$_instances[ $key ] = new Freemius( $module_id, $slug, $is_init ); + } + + return self::$_instances[ $key ]; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param number $addon_id + * + * @return bool + */ + private static function has_instance( $addon_id ) { + return isset( self::$_instances[ 'm_' . $addon_id ] ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @param string|number $id_or_slug + * @param string $module_type + * + * @return number|false + */ + private static function get_module_id( $id_or_slug, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) { + if ( is_numeric( $id_or_slug ) ) { + return $id_or_slug; + } + + foreach ( self::$_instances as $instance ) { + // Also check the module type since there can be a plugin and a theme with the same slug. + if ( ( $module_type === $instance->get_module_type() ) && ( $id_or_slug === $instance->get_slug() ) ) { + return $instance->get_id(); + } + } + + return false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param number $id + * + * @return false|Freemius + */ + static function get_instance_by_id( $id ) { + return isset ( self::$_instances[ 'm_' . $id ] ) ? + self::$_instances[ 'm_' . $id ] : + false; + } + + /** + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param string $plugin_file + * @param string $module_type + * + * @return false|Freemius + */ + static function get_instance_by_file( $plugin_file, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) { + $slug = self::find_slug_by_basename( $plugin_file ); + + return ( false !== $slug ) ? + self::instance( self::get_module_id( $slug, $module_type ) ) : + false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return false|Freemius + */ + function get_parent_instance() { + return self::get_instance_by_id( $this->_plugin->parent_plugin_id ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param string|number $id_or_slug + * + * @return false|Freemius + */ + function get_addon_instance( $id_or_slug ) { + $addon_id = self::get_module_id( $id_or_slug ); + + return self::instance( $addon_id ); + } + + #endregion ------------------------------------------------------------------ + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return bool + */ + function is_parent_plugin_installed() { + $is_active = self::has_instance( $this->_plugin->parent_plugin_id ); + + if ( $is_active ) { + return true; + } + + /** + * Parent module might be a theme. If that's the case, the add-on's FS + * instance will be loaded prior to the theme's FS instance, therefore, + * we need to check if it's active with a "look ahead". + * + * @author Vova Feldman + * @since 1.2.2.3 + */ + global $fs_active_plugins; + if ( is_object( $fs_active_plugins ) && is_array( $fs_active_plugins->plugins ) ) { + $active_theme = wp_get_theme(); + + foreach ( $fs_active_plugins->plugins as $sdk => $module ) { + if ( WP_FS__MODULE_TYPE_THEME === $module->type ) { + if ( $module->plugin_path == $active_theme->get_stylesheet() ) { + // Parent module is a theme and it's currently active. + return true; + } + } + } + } + + return false; + } + + /** + * Check if add-on parent plugin in activation mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return bool + */ + function is_parent_in_activation() { + $parent_fs = $this->get_parent_instance(); + if ( ! is_object( $parent_fs ) ) { + return false; + } + + return ( $parent_fs->is_activation_mode() ); + } + + /** + * Is plugin in activation mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @param bool $and_on + * + * @return bool + */ + function is_activation_mode( $and_on = true ) { + return fs_is_network_admin() ? + $this->is_network_activation_mode( $and_on ) : + $this->is_site_activation_mode( $and_on ); + } + + /** + * Is plugin in activation mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @param bool $and_on + * + * @return bool + */ + function is_site_activation_mode( $and_on = true ) { + return ( + ( $this->is_on() || ! $and_on ) && + ( + ( $this->is_premium() && true === $this->_storage->require_license_activation ) || + ( + ( ! $this->is_registered() || + ( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) && + ( ! $this->is_enable_anonymous() || + ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) ) + ) + ) + ); + } + + /** + * Checks if the SDK in network activation mode. + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param bool $and_on + * + * @return bool + */ + private function is_network_activation_mode( $and_on = true ) { + if ( ! $this->_is_network_active ) { + // Not network activated. + return false; + } + + if ( $this->is_network_upgrade_mode() ) { + // Special flag to enforce network activation mode to decide what to do with the sites that are not yet opted-in nor skipped. + return true; + } + + if ( ! $this->is_site_activation_mode( $and_on ) ) { + // Whether the context is single site or the network, if the plugin is no longer in activation mode then it is not in network activation mode as well. + return false; + } + + if ( $this->is_network_delegated_connection() ) { + // Super-admin delegated the connection to the site admins -> not activation mode. + return false; + } + + if ( $this->is_network_anonymous() && true !== $this->_storage->require_license_activation ) { + // Super-admin skipped the connection network wide -> not activation mode. + return false; + } + + if ( $this->is_network_registered() ) { + // Super-admin connected at least one site -> not activation mode. + return false; + } + + return true; + } + + /** + * Check if current page is the opt-in/pending-activation page. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @return bool + */ + function is_activation_page() { + if ( $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) { + return true; + } + + if ( ! $this->is_activation_mode() ) { + return false; + } + + // Check if current page is matching the activation page. + return $this->is_matching_url( $this->get_activation_url() ); + } + + /** + * Check if URL path's are matching and that all querystring + * arguments of the $sub_url exist in the $url with the same values. + * + * WARNING: + * 1. This method doesn't check if the sub/domain are matching. + * 2. Ignore case sensitivity. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @param string $sub_url + * @param string $url If argument is not set, check if the sub_url matching the current's page URL. + * + * @return bool + */ + private function is_matching_url( $sub_url, $url = '' ) { + if ( empty( $url ) ) { + $url = $_SERVER['REQUEST_URI']; + } + + $url = strtolower( $url ); + $sub_url = strtolower( $sub_url ); + + if ( parse_url( $sub_url, PHP_URL_PATH ) !== parse_url( $url, PHP_URL_PATH ) ) { + // Different path - DO NOT OVERRIDE PAGE. + return false; + } + + $url_params = array(); + parse_str( parse_url( $url, PHP_URL_QUERY ), $url_params ); + + $sub_url_params = array(); + parse_str( parse_url( $sub_url, PHP_URL_QUERY ), $sub_url_params ); + + foreach ( $sub_url_params as $key => $val ) { + if ( ! isset( $url_params[ $key ] ) || $val != $url_params[ $key ] ) { + // Not matching query string - DO NOT OVERRIDE PAGE. + return false; + } + } + + return true; + } + + /** + * Get the basenames of all active plugins for specific blog. Including network activated plugins. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id + * + * @return string[] + */ + private static function get_active_plugins_basenames( $blog_id = 0 ) { + if ( is_multisite() && $blog_id > 0 ) { + $active_basenames = get_blog_option( $blog_id, 'active_plugins' ); + } else { + $active_basenames = get_option( 'active_plugins' ); + } + + if ( ! is_array( $active_basenames ) ) { + $active_basenames = array(); + } + + if ( is_multisite() ) { + $network_active_basenames = get_site_option( 'active_sitewide_plugins' ); + + if ( is_array( $network_active_basenames ) && ! empty( $network_active_basenames ) ) { + $active_basenames = array_merge( $active_basenames, array_keys( $network_active_basenames ) ); + } + } + + return $active_basenames; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param int $blog_id + * + * @return array + */ + static function get_active_plugins_directories_map( $blog_id = 0 ) { + $active_basenames = self::get_active_plugins_basenames( $blog_id ); + + $map = array(); + + foreach ( $active_basenames as $active_basename ) { + $active_basename = fs_normalize_path( $active_basename ); + + if ( false === strpos( $active_basename, '/' ) ) { + continue; + } + + $map[ dirname( $active_basename ) ] = true; + } + + return $map; + } + + /** + * Get collection of all active plugins. Including network activated plugins. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param int $blog_id Since 2.0.0 + * + * @return array[string]array + */ + private static function get_active_plugins( $blog_id = 0 ) { + self::require_plugin_essentials(); + + $active_plugin = array(); + $all_plugins = fs_get_plugins(); + $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id ); + + foreach ( $active_plugins_basenames as $plugin_basename ) { + $active_plugin[ $plugin_basename ] = $all_plugins[ $plugin_basename ]; + } + + return $active_plugin; + } + + /** + * Get collection of all site active plugins for a specified blog. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id + * + * @return array[string]array + */ + private static function get_site_active_plugins( $blog_id = 0 ) { + $active_basenames = ( is_multisite() && $blog_id > 0 ) ? + get_blog_option( $blog_id, 'active_plugins' ) : + get_option( 'active_plugins' ); + + $active = array(); + + if ( ! is_array( $active_basenames ) ) { + return $active; + } + + foreach ( $active_basenames as $basename ) { + $active[ $basename ] = array( + 'is_active' => true, + 'Version' => '1.0', // Dummy version. + 'slug' => self::get_plugin_slug( $basename ), + ); + } + + return $active; + } + + /** + * Get collection of all plugins with their activation status for a specified blog. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.8 + * + * @param int $blog_id Since 2.0.0 + * + * @return array Key is the plugin file path and the value is an array of the plugin data. + */ + private static function get_all_plugins( $blog_id = 0 ) { + self::require_plugin_essentials(); + + $all_plugins = fs_get_plugins(); + + $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id ); + + foreach ( $all_plugins as $basename => &$data ) { + // By default set to inactive (next foreach update the active plugins). + $data['is_active'] = false; + // Enrich with plugin slug. + $data['slug'] = self::get_plugin_slug( $basename ); + } + + // Flag active plugins. + foreach ( $active_plugins_basenames as $basename ) { + if ( isset( $all_plugins[ $basename ] ) ) { + $all_plugins[ $basename ]['is_active'] = true; + } + } + + return $all_plugins; + } + + /** + * Get collection of all plugins and if they are network level activated. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return array Key is the plugin basename and the value is an array of the plugin data. + */ + private static function get_network_plugins() { + self::require_plugin_essentials(); + + $all_plugins = fs_get_plugins(); + + $network_active_basenames = is_multisite() ? + get_site_option( 'active_sitewide_plugins' ) : + array(); + + foreach ( $all_plugins as $basename => &$data ) { + // By default set to inactive (next foreach update the active plugins). + $data['is_active'] = false; + // Enrich with plugin slug. + $data['slug'] = self::get_plugin_slug( $basename ); + } + + // Flag active plugins. + foreach ( $network_active_basenames as $basename ) { + if ( isset( $all_plugins[ $basename ] ) ) { + $all_plugins[ $basename ]['is_active'] = true; + } + } + + return $all_plugins; + } + + /** + * Cached result of get_site_transient( 'update_plugins' ) + * + * @author Vova Feldman (@svovaf) + * @since 1.1.8 + * + * @var object + */ + private static $_plugins_info; + + /** + * Helper function to get specified plugin's slug. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.8 + * + * @param $basename + * + * @return string + */ + private static function get_plugin_slug( $basename ) { + if ( ! isset( self::$_plugins_info ) ) { + self::$_plugins_info = get_site_transient( 'update_plugins' ); + } + + $slug = ''; + + if ( is_object( self::$_plugins_info ) ) { + if ( isset( self::$_plugins_info->no_update ) && + isset( self::$_plugins_info->no_update[ $basename ] ) && + ! empty( self::$_plugins_info->no_update[ $basename ]->slug ) + ) { + $slug = self::$_plugins_info->no_update[ $basename ]->slug; + } else if ( isset( self::$_plugins_info->response ) && + isset( self::$_plugins_info->response[ $basename ] ) && + ! empty( self::$_plugins_info->response[ $basename ]->slug ) + ) { + $slug = self::$_plugins_info->response[ $basename ]->slug; + } + } + + if ( empty( $slug ) ) { + // Try to find slug from FS data. + $slug = self::find_slug_by_basename( $basename ); + } + + if ( empty( $slug ) ) { + // Fallback to plugin's folder name. + $slug = dirname( $basename ); + } + + return $slug; + } + + private static $_statics_loaded = false; + + /** + * Load static resources. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + */ + private static function _load_required_static() { + if ( self::$_statics_loaded ) { + return; + } + + self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK ); + + self::$_static_logger->entrance(); + + self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true ); + + if ( is_multisite() ) { + $has_skipped_migration = ( + // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level. + null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) && + // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network. + null !== self::$_accounts->get_option( 'file_slug_map', null, false ) + ); + + /** + * If the file_slug_map exists on the site level but doesn't exist on the + * network level storage, it means that we need to process the storage with migration. + * + * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + if ( + ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) || + ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) && + null !== self::$_accounts->get_option( 'file_slug_map', null, false ) ) + ) { + self::migrate_options_to_network(); + } + } + + self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' ); + + if ( ! WP_FS__DEMO_MODE ) { + add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array( + 'Freemius', + '_add_debug_section' + ) ); + } + + add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) ); + + self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) ); + + self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) ); + + self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) ); + + if ( 0 == did_action( 'plugins_loaded' ) ) { + add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 ); + } + + add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) ); + add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) ); + + if ( self::is_plugins_page() || self::is_themes_page() ) { + add_action( 'admin_print_footer_scripts', array( 'Freemius', '_maybe_add_beta_label_styles' ), 9 ); + + /** + * Specifically use this hook so that the JS event handlers will work properly on the "Themes" + * page. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + add_action( 'admin_footer-' . self::get_current_page(), array( 'Freemius', '_maybe_add_beta_label_to_plugins_and_handle_confirmation') ); + } + + self::$_statics_loaded = true; + } + + /** + * @author Leo Fajardo (@leorw) + * + * @since 2.1.3 + */ + private static function migrate_options_to_network() { + self::migrate_accounts_to_network(); + + // Migrate API options from site level to network level. + $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true ); + $api_network_options->migrate_to_network(); + + // Migrate API cache to network level storage. + FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network(); + + self::$_accounts->set_option( 'ms_migration_complete', true, true ); + } + + #---------------------------------------------------------------------------------- + #region Localization + #---------------------------------------------------------------------------------- + + /** + * Load framework's text domain. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1 + */ + static function _load_textdomain() { + if ( ! is_admin() ) { + return; + } + + global $fs_active_plugins; + + // Works both for plugins and themes. + load_plugin_textdomain( + 'freemius', + false, + $fs_active_plugins->newest->sdk_path . '/languages/' + ); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Debugging + #---------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.8 + */ + static function _add_debug_section() { + if ( ! is_super_admin() ) { + // Add debug page only for super-admins. + return; + } + + self::$_static_logger->entrance(); + + $title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION ); + + if ( WP_FS__DEV_MODE ) { + // Add top-level debug menu item. + $hook = FS_Admin_Menu_Manager::add_page( + $title, + $title, + 'manage_options', + 'freemius', + array( 'Freemius', '_debug_page_render' ) + ); + } else { + // Add hidden debug page. + $hook = FS_Admin_Menu_Manager::add_subpage( + null, + $title, + $title, + 'manage_options', + 'freemius', + array( 'Freemius', '_debug_page_render' ) + ); + } + + if ( ! empty( $hook ) ) { + add_action( "load-$hook", array( 'Freemius', '_debug_page_actions' ) ); + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + */ + static function _toggle_debug_mode() { + if ( ! is_super_admin() ) { + return; + } + + $is_on = fs_request_get( 'is_on', false, 'post' ); + + if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) { + update_option( 'fs_debug_mode', $is_on ); + + // Turn on/off storage logging. + FS_Logger::_set_storage_logging( ( 1 == $is_on ) ); + } + + exit; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + */ + static function _get_debug_log() { + $logs = FS_Logger::load_db_logs( + fs_request_get( 'filters', false, 'post' ), + ! empty( $_POST['limit'] ) && is_numeric( $_POST['limit'] ) ? $_POST['limit'] : 200, + ! empty( $_POST['offset'] ) && is_numeric( $_POST['offset'] ) ? $_POST['offset'] : 0 + ); + + self::shoot_ajax_success( $logs ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + */ + static function _get_db_option() { + check_admin_referer( 'fs_get_db_option' ); + + $option_name = fs_request_get( 'option_name' ); + + if ( ! is_super_admin() || + ! fs_starts_with( $option_name, 'fs_' ) + ) { + self::shoot_ajax_failure(); + } + + $value = get_option( $option_name ); + + $result = array( + 'name' => $option_name, + ); + + if ( false !== $value ) { + if ( ! is_string( $value ) ) { + $value = json_encode( $value ); + } + + $result['value'] = $value; + } + + self::shoot_ajax_success( $result ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + */ + static function _set_db_option() { + check_admin_referer( 'fs_set_db_option' ); + + $option_name = fs_request_get( 'option_name' ); + + if ( ! is_super_admin() || + ! fs_starts_with( $option_name, 'fs_' ) + ) { + self::shoot_ajax_failure(); + } + + $option_value = fs_request_get( 'option_value' ); + + if ( ! empty( $option_value ) ) { + update_option( $option_name, $option_value ); + } + + self::shoot_ajax_success(); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.8 + */ + static function _debug_page_actions() { + self::_clean_admin_content_section(); + + if ( fs_request_is_action( 'restart_freemius' ) ) { + check_admin_referer( 'restart_freemius' ); + + if ( ! is_multisite() ) { + // Clear accounts data. + self::$_accounts->clear( null, true ); + } else { + $sites = self::get_sites(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + self::$_accounts->clear( $blog_id, true ); + } + + // Clear network level storage. + self::$_accounts->clear( true, true ); + } + + // Clear SDK reference cache. + delete_option( 'fs_active_plugins' ); + } else if ( fs_request_is_action( 'clear_updates_data' ) ) { + check_admin_referer( 'clear_updates_data' ); + + if ( ! is_multisite() ) { + set_site_transient( 'update_plugins', null ); + set_site_transient( 'update_themes', null ); + } else { + $current_blog_id = get_current_blog_id(); + + $sites = self::get_sites(); + foreach ( $sites as $site ) { + switch_to_blog( self::get_site_blog_id( $site ) ); + + set_site_transient( 'update_plugins', null ); + set_site_transient( 'update_themes', null ); + } + + switch_to_blog( $current_blog_id ); + } + } else if ( fs_request_is_action( 'simulate_trial' ) ) { + check_admin_referer( 'simulate_trial' ); + + $fs = freemius( fs_request_get( 'module_id' ) ); + + // Update SDK install to at least 24 hours before. + $fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC ); + // Unset the trial shown timestamp. + unset( $fs->_storage->trial_promotion_shown ); + } else if ( fs_request_is_action( 'simulate_network_upgrade' ) ) { + check_admin_referer( 'simulate_network_upgrade' ); + + $fs = freemius( fs_request_get( 'module_id' ) ); + + self::set_network_upgrade_mode( $fs->_storage ); + } else if ( fs_request_is_action( 'delete_install' ) ) { + check_admin_referer( 'delete_install' ); + + self::_delete_site_by_slug( + fs_request_get( 'slug' ), + fs_request_get( 'module_type' ), + true, + fs_request_get( 'blog_id', null ) + ); + } else if ( fs_request_is_action( 'delete_user' ) ) { + check_admin_referer( 'delete_user' ); + + self::delete_user( fs_request_get( 'user_id' ) ); + } else if ( fs_request_is_action( 'download_logs' ) ) { + check_admin_referer( 'download_logs' ); + + $download_url = FS_Logger::download_db_logs( + fs_request_get( 'filters', false, 'post' ) + ); + + if ( false === $download_url ) { + wp_die( 'Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.' ); + } + + fs_redirect( $download_url ); + } else if ( fs_request_is_action( 'migrate_options_to_network' ) ) { + check_admin_referer( 'migrate_options_to_network' ); + + self::migrate_options_to_network(); + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.8 + */ + static function _debug_page_render() { + self::$_static_logger->entrance(); + + if ( ! is_multisite() ) { + $all_plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ); + $all_themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME ); + } else { + $sites = self::get_sites(); + + $all_plugins_installs = array(); + $all_themes_installs = array(); + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + $plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id ); + + foreach ( $plugins_installs as $slug => $install ) { + if ( ! isset( $all_plugins_installs[ $slug ] ) ) { + $all_plugins_installs[ $slug ] = array(); + } + + $install->blog_id = $blog_id; + + $all_plugins_installs[ $slug ][] = $install; + } + + $themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id ); + + foreach ( $themes_installs as $slug => $install ) { + if ( ! isset( $all_themes_installs[ $slug ] ) ) { + $all_themes_installs[ $slug ] = array(); + } + + $install->blog_id = $blog_id; + + $all_themes_installs[ $slug ][] = $install; + } + } + } + + $licenses_by_module_type = self::get_all_licenses_by_module_type(); + + $vars = array( + 'plugin_sites' => $all_plugins_installs, + 'theme_sites' => $all_themes_installs, + 'users' => self::get_all_users(), + 'addons' => self::get_all_addons(), + 'account_addons' => self::get_all_account_addons(), + 'plugin_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_PLUGIN ], + 'theme_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_THEME ] + ); + + fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' ); + fs_require_once_template( 'debug.php', $vars ); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Connectivity Issues + #---------------------------------------------------------------------------------- + + /** + * Check if Freemius should be turned on for the current plugin install. + * + * Note: + * $this->_is_on is updated in has_api_connectivity() + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function is_on() { + self::$_static_logger->entrance(); + + if ( isset( $this->_is_on ) ) { + return $this->_is_on; + } + + // If already installed or pending then sure it's on :) + if ( $this->is_registered() || $this->is_pending_activation() ) { + $this->_is_on = true; + + return true; + } + + return false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param bool $flush_if_no_connectivity + * + * @return bool + */ + private function should_run_connectivity_test( $flush_if_no_connectivity = false ) { + if ( ! isset( $this->_storage->connectivity_test ) ) { + // Connectivity test was never executed, or cache was cleared. + return true; + } + + if ( WP_FS__PING_API_ON_IP_OR_HOST_CHANGES ) { + if ( WP_FS__IS_HTTP_REQUEST ) { + if ( $_SERVER['HTTP_HOST'] != $this->_storage->connectivity_test['host'] ) { + // Domain changed. + return true; + } + + if ( WP_FS__REMOTE_ADDR != $this->_storage->connectivity_test['server_ip'] ) { + // Server IP changed. + return true; + } + } + } + + if ( $this->_storage->connectivity_test['is_connected'] && + $this->_storage->connectivity_test['is_active'] + ) { + // API connected and Freemius is active - no need to run connectivity check. + return false; + } + + if ( $flush_if_no_connectivity ) { + /** + * If explicitly asked to flush when no connectivity - do it only + * if at least 10 sec passed from the last API connectivity test. + */ + return ( isset( $this->_storage->connectivity_test['timestamp'] ) && + ( WP_FS__SCRIPT_START_TIME - $this->_storage->connectivity_test['timestamp'] ) > 10 ); + } + + /** + * @since 1.1.7 Don't check for connectivity on plugin downgrade. + */ + $version = $this->get_plugin_version(); + if ( version_compare( $version, $this->_storage->connectivity_test['version'], '>' ) ) { + // If it's a plugin version upgrade and Freemius is off or no connectivity, run connectivity test. + return true; + } + + return false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @param int|null $blog_id Since 2.0.0. + * @param bool $is_gdpr_test Since 2.0.2. Perform only the GDPR test. + * + * @return object|false + */ + private function ping( $blog_id = null, $is_gdpr_test = false ) { + if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY ) { + return false; + } + + $version = $this->get_plugin_version(); + + $is_update = $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() ); + + return $this->get_api_plugin_scope()->ping( + $this->get_anonymous_id( $blog_id ), + array( + 'is_update' => json_encode( $is_update ), + 'version' => $version, + 'sdk' => $this->version, + 'is_admin' => json_encode( is_admin() ), + 'is_ajax' => json_encode( self::is_ajax() ), + 'is_cron' => json_encode( self::is_cron() ), + 'is_gdpr_test' => $is_gdpr_test, + 'is_http' => json_encode( WP_FS__IS_HTTP_REQUEST ), + ) + ); + } + + /** + * Check if there's any connectivity issue to Freemius API. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param bool $flush_if_no_connectivity + * + * @return bool + */ + function has_api_connectivity( $flush_if_no_connectivity = false ) { + $this->_logger->entrance(); + + if ( isset( $this->_has_api_connection ) && ( $this->_has_api_connection || ! $flush_if_no_connectivity ) ) { + return $this->_has_api_connection; + } + + if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY && + isset( $this->_storage->connectivity_test ) && + true === $this->_storage->connectivity_test['is_connected'] + ) { + unset( $this->_storage->connectivity_test ); + } + + if ( ! $this->should_run_connectivity_test( $flush_if_no_connectivity ) ) { + $this->_has_api_connection = $this->_storage->connectivity_test['is_connected']; + /** + * @since 1.1.6 During dev mode, if there's connectivity - turn Freemius on regardless the configuration. + * + * @since 1.2.1.5 If the user running the premium version then ignore the 'is_active' flag and turn Freemius on to enable license key activation. + */ + $this->_is_on = $this->_storage->connectivity_test['is_active'] || + $this->is_premium() || + ( WP_FS__DEV_MODE && $this->_has_api_connection && ! WP_FS__SIMULATE_FREEMIUS_OFF ); + + return $this->_has_api_connection; + } + + $pong = $this->ping(); + $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong ); + + if ( ! $is_connected ) { + // API failure. + $this->_add_connectivity_issue_message( $pong ); + } + + if ( $is_connected ) { + FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); + } + + $this->store_connectivity_info( $pong, $is_connected ); + + return $this->_has_api_connection; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @param object $pong + * @param bool $is_connected + */ + private function store_connectivity_info( $pong, $is_connected ) { + $this->_logger->entrance(); + + $version = $this->get_plugin_version(); + + if ( ! $is_connected || WP_FS__SIMULATE_FREEMIUS_OFF ) { + $is_active = false; + } else { + $is_active = ( isset( $pong->is_active ) && true == $pong->is_active ); + } + + $is_active = $this->apply_filters( + 'is_on', + $is_active, + $this->is_plugin_update(), + $version + ); + + $this->_storage->connectivity_test = array( + 'is_connected' => $is_connected, + 'host' => $_SERVER['HTTP_HOST'], + 'server_ip' => WP_FS__REMOTE_ADDR, + 'is_active' => $is_active, + 'timestamp' => WP_FS__SCRIPT_START_TIME, + // Last version with connectivity attempt. + 'version' => $version, + ); + + $this->_has_api_connection = $is_connected; + $this->_is_on = $is_active || ( WP_FS__DEV_MODE && $is_connected && ! WP_FS__SIMULATE_FREEMIUS_OFF ); + } + + /** + * Force turning Freemius on. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.8.1 + * + * @return bool TRUE if successfully turned on. + */ + private function turn_on() { + $this->_logger->entrance(); + + if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) { + return false; + } + + $updated_connectivity = $this->_storage->connectivity_test; + $updated_connectivity['is_active'] = true; + $updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME; + $this->_storage->connectivity_test = $updated_connectivity; + + $this->_is_on = true; + + return true; + } + + /** + * Anonymous and unique site identifier (Hash). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.0 + * + * @param null|int $blog_id Since 2.0.0 + * + * @return string + */ + function get_anonymous_id( $blog_id = null ) { + $unique_id = self::$_accounts->get_option( 'unique_id', null, $blog_id ); + + if ( empty( $unique_id ) || ! is_string( $unique_id ) ) { + $key = fs_strip_url_protocol( get_site_url( $blog_id ) ); + + $secure_auth = SECURE_AUTH_KEY; + if ( empty( $secure_auth ) || + false !== strpos( $secure_auth, ' ' ) || + 'put your unique phrase here' === $secure_auth + ) { + // Protect against default auth key. + $secure_auth = md5( microtime() ); + } + + /** + * Base the unique identifier on the WP secure authentication key. Which + * turns the key into a secret anonymous identifier. This will help us + * to avoid duplicate installs generation on the backend upon opt-in. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.3 + */ + $unique_id = md5( $key . $secure_auth ); + + self::$_accounts->set_option( 'unique_id', $unique_id, true, $blog_id ); + } + + $this->_logger->departure( $unique_id ); + + return $unique_id; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @return \WP_User + */ + static function _get_current_wp_user() { + self::require_pluggable_essentials(); + self::wp_cookie_constants(); + + return wp_get_current_user(); + } + + /** + * Define cookie constants which are required by Freemius::_get_current_wp_user() since + * it uses wp_get_current_user() which needs the cookie constants set. When a plugin + * is network activated the cookie constants are only configured after the network + * plugins activation, therefore, if we don't define those constants WP will throw + * PHP warnings/notices. + * + * @author Vova Feldman (@svovaf) + * @since 2.1.1 + */ + private static function wp_cookie_constants() { + if ( defined( 'LOGGED_IN_COOKIE' ) && + ( defined( 'AUTH_COOKIE' ) || defined( 'SECURE_AUTH_COOKIE' ) ) + ) { + return; + } + + /** + * Used to guarantee unique hash cookies + * + * @since 1.5.0 + */ + if ( ! defined( 'COOKIEHASH' ) ) { + $siteurl = get_site_option( 'siteurl' ); + if ( $siteurl ) { + define( 'COOKIEHASH', md5( $siteurl ) ); + } else { + define( 'COOKIEHASH', '' ); + } + } + + if ( ! defined( 'LOGGED_IN_COOKIE' ) ) { + define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH ); + } + + /** + * @since 2.5.0 + */ + if ( ! defined( 'AUTH_COOKIE' ) ) { + define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH ); + } + + /** + * @since 2.6.0 + */ + if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) { + define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH ); + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.1.0 + * + * @return int + */ + static function get_current_wp_user_id() { + $wp_user = self::_get_current_wp_user(); + + return $wp_user->ID; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @param string $email + * + * @return bool + */ + static function is_valid_email( $email ) { + if ( false === filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { + return false; + } + + $parts = explode( '@', $email ); + + if ( 2 !== count( $parts ) || empty( $parts[1] ) ) { + return false; + } + + $blacklist = array( + 'admin.', + 'webmaster.', + 'localhost.', + 'dev.', + 'development.', + 'test.', + 'stage.', + 'staging.', + ); + + // Make sure domain is not one of the blacklisted. + foreach ( $blacklist as $invalid ) { + if ( 0 === strpos( $parts[1], $invalid ) ) { + return false; + } + } + + // Get the UTF encoded domain name. + $domain = idn_to_ascii( $parts[1] ) . '.'; + + return ( checkdnsrr( $domain, 'MX' ) || checkdnsrr( $domain, 'A' ) ); + } + + /** + * Generate API connectivity issue message. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param mixed $api_result + * @param bool $is_first_failure + */ + function _add_connectivity_issue_message( $api_result, $is_first_failure = true ) { + if ( ! $this->is_premium() && $this->_enable_anonymous ) { + // Don't add message if it's the free version and can run anonymously. + return; + } + + if ( ! function_exists( 'wp_nonce_url' ) ) { + require_once ABSPATH . 'wp-includes/functions.php'; + } + + $current_user = self::_get_current_wp_user(); +// $admin_email = get_option( 'admin_email' ); + $admin_email = $current_user->user_email; + + // Aliases. + $deactivate_plugin_title = $this->esc_html_inline( 'That\'s exhausting, please deactivate', 'deactivate-plugin-title' ); + $deactivate_plugin_desc = $this->esc_html_inline( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'deactivate-plugin-desc' ); + $install_previous_title = $this->esc_html_inline( 'Let\'s try your previous version', 'install-previous-title' ); + $install_previous_desc = $this->esc_html_inline( 'Uninstall this version and install the previous one.', 'install-previous-desc' ); + $fix_issue_title = $this->esc_html_inline( 'Yes - I\'m giving you a chance to fix it', 'fix-issue-title' ); + $fix_issue_desc = $this->esc_html_inline( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.', 'fix-issue-desc' ); + /* translators: %s: product title (e.g. "Awesome Plugin" requires an access to...) */ + $x_requires_access_to_api = $this->esc_html_inline( '%s requires an access to our API.', 'x-requires-access-to-api' ); + $sysadmin_title = $this->esc_html_inline( 'I\'m a system administrator', 'sysadmin-title' ); + $happy_to_resolve_issue_asap = $this->esc_html_inline( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.', 'happy-to-resolve-issue-asap' ); + + $message = false; + if ( is_object( $api_result ) && + isset( $api_result->error ) && + isset( $api_result->error->code ) + ) { + switch ( $api_result->error->code ) { + case 'curl_missing': + $missing_methods = ''; + if ( is_array( $api_result->missing_methods ) && + ! empty( $api_result->missing_methods ) + ) { + foreach ( $api_result->missing_methods as $m ) { + if ( 'curl_version' === $m ) { + continue; + } + + if ( ! empty( $missing_methods ) ) { + $missing_methods .= ', '; + } + + $missing_methods .= sprintf( '%s', $m ); + } + + if ( ! empty( $missing_methods ) ) { + $missing_methods = sprintf( + '

    %s %s', + $this->esc_html_inline( 'Disabled method(s):', 'curl-disabled-methods' ), + $missing_methods + ); + } + } + + $message = sprintf( + $x_requires_access_to_api . ' ' . + $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . ' ' . + $missing_methods . + ' %s', + '' . $this->get_plugin_name() . '', + sprintf( + '
    1. %s
    2. %s
    3. %s
    ', + sprintf( + '%s%s', + $this->get_text_inline( 'I don\'t know what is cURL or how to install it, help me!', 'curl-missing-no-clue-title' ), + ' - ' . sprintf( + $this->get_text_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'curl-missing-no-clue-desc' ), + '' . $admin_email . '' + ) + ), + sprintf( + '%s - %s', + $sysadmin_title, + esc_html( sprintf( $this->get_text_inline( 'Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the %s and reactivate it back again.', 'curl-missing-sysadmin-desc' ), $this->get_module_label( true ) ) ) + ), + sprintf( + '%s - %s', + wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), + $deactivate_plugin_title, + $deactivate_plugin_desc + ) + ) + ); + break; + case 'cloudflare_ddos_protection': + $message = sprintf( + $x_requires_access_to_api . ' ' . + $this->esc_html_inline( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'cloudflare-blocks-connection-message' ) . ' ' . + $happy_to_resolve_issue_asap . + ' %s', + '' . $this->get_plugin_name() . '', + sprintf( + '
    1. %s
    2. %s
    3. %s
    ', + sprintf( + '%s%s', + $fix_issue_title, + ' - ' . sprintf( + $fix_issue_desc, + '' . $admin_email . '' + ) + ), + sprintf( + '%s - %s', + sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ), + $install_previous_title, + $install_previous_desc + ), + sprintf( + '%s - %s', + wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=' . '', 'deactivate-plugin_' . $this->_plugin_basename ), + $deactivate_plugin_title, + $deactivate_plugin_desc + ) + ) + ); + break; + case 'squid_cache_block': + $message = sprintf( + $x_requires_access_to_api . ' ' . + $this->esc_html_inline( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'squid-blocks-connection-message' ) . + ' %s', + '' . $this->get_plugin_name() . '', + sprintf( + '
    1. %s
    2. %s
    3. %s
    ', + sprintf( + '%s - %s', + $this->esc_html_inline( 'I don\'t know what is Squid or ACL, help me!', 'squid-no-clue-title' ), + sprintf( + $this->esc_html_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'squid-no-clue-desc' ), + '' . $admin_email . '' + ) + ), + sprintf( + '%s - %s', + $sysadmin_title, + sprintf( + $this->esc_html_inline( 'Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again.', 'squid-sysadmin-desc' ), + // We use a filter since the plugin might require additional API connectivity. + '' . implode( ', ', $this->apply_filters( 'api_domains', array( + 'api.freemius.com', + 'wp.freemius.com' + ) ) ) . '', + $this->_module_type + ) + ), + sprintf( + '%s - %s', + wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), + $deactivate_plugin_title, + $deactivate_plugin_desc + ) + ) + ); + break; +// default: +// $message = $this->get_text_inline( 'connectivity-test-fails-message' ); +// break; + } + } + + $message_id = 'failed_connect_api'; + $type = 'error'; + + $connectivity_test_fails_message = $this->esc_html_inline( 'From unknown reason, the API connectivity test failed.', 'connectivity-test-fails-message' ); + + if ( false === $message ) { + if ( $is_first_failure ) { + // First attempt failed. + $message = sprintf( + $x_requires_access_to_api . ' ' . + $connectivity_test_fails_message . ' ' . + $this->esc_html_inline( 'It\'s probably a temporary issue on our end. Just to be sure, with your permission, would it be o.k to run another connectivity test?', 'connectivity-test-maybe-temporary' ) . '

    ' . + '%s', + '' . $this->get_plugin_name() . '', + sprintf( + '
    %s %s
    ', + sprintf( + '%s', + $this->get_text_inline( 'Yes - do your thing', 'yes-do-your-thing' ) + ), + sprintf( + '%s', + wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), + $this->get_text_inline( 'No - just deactivate', 'no-deactivate' ) + ) + ) + ); + + $message_id = 'failed_connect_api_first'; + $type = 'promotion'; + } else { + // Second connectivity attempt failed. + $message = sprintf( + $x_requires_access_to_api . ' ' . + $connectivity_test_fails_message . ' ' . + $happy_to_resolve_issue_asap . + ' %s', + '' . $this->get_plugin_name() . '', + sprintf( + '
    1. %s
    2. %s
    3. %s
    ', + sprintf( + '%s%s', + $fix_issue_title, + ' - ' . sprintf( + $fix_issue_desc, + '' . $admin_email . '' + ) + ), + sprintf( + '%s - %s', + sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ), + $install_previous_title, + $install_previous_desc + ), + sprintf( + '%s - %s', + wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ), + $deactivate_plugin_title, + $deactivate_plugin_desc + ) + ) + ); + } + } + + $this->_admin_notices->add_sticky( + $message, + $message_id, + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + $type + ); + } + + /** + * Handle user request to resolve connectivity issue. + * This method will send an email to Freemius API technical staff for resolution. + * The email will contain server's info and installed plugins (might be caching issue). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + function _email_about_firewall_issue() { + $this->_admin_notices->remove_sticky( 'failed_connect_api' ); + + $pong = $this->ping(); + + $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong ); + + if ( $is_connected ) { + FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); + + $this->store_connectivity_info( $pong, $is_connected ); + + echo $this->get_after_plugin_activation_redirect_url(); + exit; + } + + $current_user = self::_get_current_wp_user(); + $admin_email = $current_user->user_email; + + $error_type = fs_request_get( 'error_type', 'general' ); + + switch ( $error_type ) { + case 'squid': + $title = 'Squid ACL Blocking Issue'; + break; + case 'cloudflare': + $title = 'CloudFlare Blocking Issue'; + break; + default: + $title = 'API Connectivity Issue'; + break; + } + + $custom_email_sections = array(); + + // Add 'API Error' custom email section. + $custom_email_sections['api_error'] = array( + 'title' => 'API Error', + 'rows' => array( + 'ping' => array( + 'API Error', + is_string( $pong ) ? htmlentities( $pong ) : json_encode( $pong ) + ), + ) + ); + + // Send email with technical details to resolve API connectivity issues. + $this->send_email( + 'api@freemius.com', // recipient + $title . ' [' . $this->get_plugin_name() . ']', // subject + $custom_email_sections, + array( "Reply-To: $admin_email <$admin_email>" ) // headers + ); + + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( 'Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience.', 'fix-request-sent-message' ), + '' . $admin_email . '' + ), + 'server_details_sent' + ); + + // Action was taken, tell that API connectivity troubleshooting should be off now. + + echo "1"; + exit; + } + + /** + * Handle connectivity test retry approved by the user. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + */ + function _retry_connectivity_test() { + $this->_admin_notices->remove_sticky( 'failed_connect_api_first' ); + + $pong = $this->ping(); + + $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong ); + + if ( $is_connected ) { + FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); + + $this->store_connectivity_info( $pong, $is_connected ); + + echo $this->get_after_plugin_activation_redirect_url(); + } else { + // Add connectivity issue message after 2nd failed attempt. + $this->_add_connectivity_issue_message( $pong, false ); + + echo "1"; + } + + exit; + } + + static function _add_firewall_issues_javascript() { + $params = array(); + fs_require_once_template( 'firewall-issues-js.php', $params ); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Email + #---------------------------------------------------------------------------------- + + /** + * Generates and sends an HTML email with customizable sections. + * + * @author Leo Fajardo (@leorw) + * @since 1.1.2 + * + * @param string $to_address + * @param string $subject + * @param array $sections + * @param array $headers + * + * @return bool Whether the email contents were sent successfully. + */ + private function send_email( + $to_address, + $subject, + $sections = array(), + $headers = array() + ) { + $default_sections = $this->get_email_sections(); + + // Insert new sections or replace the default email sections. + if ( is_array( $sections ) && ! empty( $sections ) ) { + foreach ( $sections as $section_id => $custom_section ) { + if ( ! isset( $default_sections[ $section_id ] ) ) { + // If the section does not exist, add it. + $default_sections[ $section_id ] = $custom_section; + } else { + // If the section already exists, override it. + $current_section = $default_sections[ $section_id ]; + + // Replace the current section's title if a custom section title exists. + if ( isset( $custom_section['title'] ) ) { + $current_section['title'] = $custom_section['title']; + } + + // Insert new rows under the current section or replace the default rows. + if ( isset( $custom_section['rows'] ) && is_array( $custom_section['rows'] ) && ! empty( $custom_section['rows'] ) ) { + foreach ( $custom_section['rows'] as $row_id => $row ) { + $current_section['rows'][ $row_id ] = $row; + } + } + + $default_sections[ $section_id ] = $current_section; + } + } + } + + $vars = array( 'sections' => $default_sections ); + $message = fs_get_template( 'email.php', $vars ); + + // Set the type of email to HTML. + $headers[] = 'Content-type: text/html; charset=UTF-8'; + + $header_string = implode( "\r\n", $headers ); + + return wp_mail( + $to_address, + $subject, + $message, + $header_string + ); + } + + /** + * Generates the data for the sections of the email content. + * + * @author Leo Fajardo (@leorw) + * @since 1.1.2 + * + * @return array + */ + private function get_email_sections() { + // Retrieve the current user's information so that we can get the user's email, first name, and last name below. + $current_user = self::_get_current_wp_user(); + + // Retrieve the cURL version information so that we can get the version number below. + $curl_version_information = curl_version(); + + $active_plugin = self::get_active_plugins(); + + // Generate the list of active plugins separated by new line. + $active_plugin_string = ''; + foreach ( $active_plugin as $plugin ) { + $active_plugin_string .= sprintf( + '%s [v%s]
    ', + $plugin['PluginURI'], + $plugin['Name'], + $plugin['Version'] + ); + } + + $server_ip = WP_FS__REMOTE_ADDR; + + // Add PHP info for deeper investigation. + ob_start(); + phpinfo(); + $php_info = ob_get_clean(); + + $api_domain = substr( FS_API__ADDRESS, strpos( FS_API__ADDRESS, ':' ) + 3 ); + + // Generate the default email sections. + $sections = array( + 'sdk' => array( + 'title' => 'SDK', + 'rows' => array( + 'fs_version' => array( 'FS Version', $this->version ), + 'curl_version' => array( 'cURL Version', $curl_version_information['version'] ) + ) + ), + 'plugin' => array( + 'title' => ucfirst( $this->get_module_type() ), + 'rows' => array( + 'name' => array( 'Name', $this->get_plugin_name() ), + 'version' => array( 'Version', $this->get_plugin_version() ) + ) + ), + 'api' => array( + 'title' => 'API Subdomain', + 'rows' => array( + 'dns' => array( + 'DNS_CNAME', + function_exists( 'dns_get_record' ) ? + var_export( dns_get_record( $api_domain, DNS_CNAME ), true ) : + 'dns_get_record() disabled/blocked' + ), + 'ip' => array( + 'IP', + function_exists( 'gethostbyname' ) ? + gethostbyname( $api_domain ) : + 'gethostbyname() disabled/blocked' + ), + ), + ), + 'site' => array( + 'title' => 'Site', + 'rows' => array( + 'unique_id' => array( 'Unique ID', $this->get_anonymous_id() ), + 'address' => array( 'Address', site_url() ), + 'host' => array( + 'HTTP_HOST', + ( ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '' ) + ), + 'hosting' => array( + 'Hosting Company' => fs_request_has( 'hosting_company' ) ? + fs_request_get( 'hosting_company' ) : + 'Unknown', + ), + 'server_addr' => array( + 'SERVER_ADDR', + '' . $server_ip . '' + ) + ) + ), + 'user' => array( + 'title' => 'User', + 'rows' => array( + 'email' => array( 'Email', $current_user->user_email ), + 'first' => array( 'First', $current_user->user_firstname ), + 'last' => array( 'Last', $current_user->user_lastname ) + ) + ), + 'plugins' => array( + 'title' => 'Plugins', + 'rows' => array( + 'active_plugins' => array( 'Active Plugins', $active_plugin_string ) + ) + ), + 'php_info' => array( + 'title' => 'PHP Info', + 'rows' => array( + 'info' => array( $php_info ) + ), + ) + ); + + // Allow the sections to be modified by other code. + $sections = $this->apply_filters( 'email_template_sections', $sections ); + + return $sections; + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Initialization + #---------------------------------------------------------------------------------- + + /** + * Init plugin's Freemius instance. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param number $id + * @param string $public_key + * @param bool $is_live + * @param bool $is_premium + */ + function init( $id, $public_key, $is_live = true, $is_premium = true ) { + $this->_logger->entrance(); + + $this->dynamic_init( array( + 'id' => $id, + 'public_key' => $public_key, + 'is_live' => $is_live, + 'is_premium' => $is_premium, + ) ); + } + + /** + * Dynamic initiator, originally created to support initiation + * with parent_id for add-ons. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param array $plugin_info + * + * @throws Freemius_Exception + */ + function dynamic_init( array $plugin_info ) { + $this->_logger->entrance(); + + $this->parse_settings( $plugin_info ); + + $this->register_after_settings_parse_hooks(); + + if ( $this->should_stop_execution() ) { + return; + } + + if ( ! $this->is_registered() ) { + if ( $this->is_anonymous() ) { + // If user skipped, no need to test connectivity. + $this->_has_api_connection = true; + $this->_is_on = true; + } else { + if ( ! $this->has_api_connectivity() ) { + if ( $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) || + $this->_admin_notices->has_sticky( 'failed_connect_api' ) + ) { + if ( ! $this->_enable_anonymous || $this->is_premium() ) { + // If anonymous mode is disabled, add firewall admin-notice message. + add_action( 'admin_footer', array( 'Freemius', '_add_firewall_issues_javascript' ) ); + + $ajax_action_suffix = $this->_slug . ( $this->is_theme() ? ':theme' : '' ); + add_action( "wp_ajax_fs_resolve_firewall_issues_{$ajax_action_suffix}", array( + &$this, + '_email_about_firewall_issue' + ) ); + + add_action( "wp_ajax_fs_retry_connectivity_test_{$ajax_action_suffix}", array( + &$this, + '_retry_connectivity_test' + ) ); + + /** + * Currently the admin notice manager relies on the module's type and slug. The new AJAX actions manager uses module IDs, hence, consider to replace the if block above with the commented code below after adjusting the admin notices manager to work with module IDs. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + /*$this->add_ajax_action( 'resolve_firewall_issues', array( + &$this, + '_email_about_firewall_issue' + ) ); + + $this->add_ajax_action( 'retry_connectivity_test', array( + &$this, + '_retry_connectivity_test' + ) );*/ + } + } + + return; + } else { + $this->_admin_notices->remove_sticky( array( + 'failed_connect_api_first', + 'failed_connect_api', + ) ); + + if ( $this->_anonymous_mode ) { + // Simulate anonymous mode. + $this->_is_anonymous = true; + } + } + } + } + + /** + * This should be executed even if Freemius is off for the core module, + * otherwise, the add-ons dialogbox won't work properly. This is esepcially + * relevant when the developer decided to turn FS off for existing users. + * + * @author Vova Feldman (@svovaf) + */ + if ( $this->is_user_in_admin() && + 'plugin-information' === fs_request_get( 'tab', false ) && + $this->should_use_freemius_updater_and_dialog() && + ( + ( $this->is_addon() && $this->get_slug() == fs_request_get( 'plugin', false ) ) || + ( $this->has_addons() && $this->get_id() == fs_request_get( 'parent_plugin_id', false ) ) + ) + ) { + require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php'; + + new FS_Plugin_Info_Dialog( $this->is_addon() ? $this->get_parent_instance() : $this ); + } + + // Check if Freemius is on for the current plugin. + // This MUST be executed after all the plugin variables has been loaded. + if ( ! $this->is_registered() && ! $this->is_on() ) { + return; + } + + if ( $this->has_api_connectivity() ) { + if ( self::is_cron() ) { + $this->hook_callback_to_sync_cron(); + } else if ( $this->is_user_in_admin() ) { + /** + * Schedule daily data sync cron if: + * + * 1. User opted-in (for tracking). + * 2. If skipped, but later upgraded (opted-in via upgrade). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + */ + if ( $this->is_registered() ) { + if ( ! $this->is_sync_cron_on() && $this->is_tracking_allowed() ) { + $this->schedule_sync_cron(); + } + } + + /** + * Check if requested for manual blocking background sync. + */ + if ( fs_request_has( 'background_sync' ) ) { + $this->run_manual_sync(); + } + } + } + + if ( $this->is_registered() ) { + $this->hook_callback_to_install_sync(); + } + + if ( $this->is_addon() ) { + if ( $this->is_parent_plugin_installed() ) { + // Link to parent FS. + $this->_parent = self::get_instance_by_id( $this->_plugin->parent_plugin_id ); + + // Get parent plugin reference. + $this->_parent_plugin = $this->_parent->get_plugin(); + } + } + + if ( $this->is_user_in_admin() ) { + if ( $this->is_addon() ) { + if ( ! $this->is_parent_plugin_installed() ) { + $parent_name = $this->get_option( $plugin_info, 'parent_name', null ); + + if ( isset( $plugin_info['parent'] ) ) { + $parent_name = $this->get_option( $plugin_info['parent'], 'name', null ); + } + + $this->_admin_notices->add( + ( ! empty( $parent_name ) ? + sprintf( $this->get_text_x_inline( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'addon-x-cannot-run-without-y' ), $this->get_plugin_name(), $parent_name ) : + sprintf( $this->get_text_x_inline( '%s cannot run without the plugin.', 'addonX cannot run...', 'addon-x-cannot-run-without-parent' ), $this->get_plugin_name() ) + ), + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error' + ); + + return; + } else { + $is_network_admin = fs_is_network_admin(); + + if ( ! $this->_parent->is_registered() && $this->is_registered() ) { + // If add-on activated and parent not, automatically install parent for the user. + $this->activate_parent_account( $this->_parent ); + } else if ( + $this->_parent->is_registered() && + ! $this->is_registered() && + /** + * If not registered for add-on and the following conditions for the add-on are met, activate add-on account. + * * Network active and in network admin - network activate add-on account. + * * Network active and not in network admin - activate add-on account for the current blog. + * * Not network active and not in network admin - activate add-on account for the current blog. + * + * If not registered for add-on, not network active, and in network admin, do not handle the add-on activation. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + ( $this->is_network_active() || ! $is_network_admin ) + ) { + $premium_license = null; + + if ( + ! $this->has_free_plan() && + $this->is_bundle_license_auto_activation_enabled() && + $this->_parent->is_activated_with_bundle_license() + ) { + /** + * If the add-on has no free plan, try to activate the account only when there's a bundle license. + * + * @author Leo Fajardo (@leorw) + * @since 2.4.0 + */ + $bundle_license = $this->get_active_parent_license( $this->_parent->_get_license()->secret_key, false ); + + if ( + is_object( $bundle_license ) && + ! empty( $bundle_license->products ) && + in_array( $this->get_id(), $bundle_license->products ) + ) { + $premium_license = $bundle_license; + } + } + + if ( $this->has_free_plan() || is_object( $premium_license) ) { + // If parent plugin activated, automatically install add-on for the user. + $this->_activate_addon_account( + $this->_parent, + ( $this->is_network_active() && $is_network_admin ) ? + true : + get_current_blog_id(), + $premium_license + ); + } + } + + // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic. + if ( $this->is_premium() ) { + // Remove add-on download admin-notice. + $this->_parent->_admin_notices->remove_sticky( array( + 'addon_plan_upgraded_' . $this->_slug, + 'no_addon_license_' . $this->_slug, + ) ); + } + +// $this->deactivate_premium_only_addon_without_license(); + } + } + + add_action( 'admin_init', array( &$this, '_admin_init_action' ) ); + +// if ( $this->is_registered() || +// $this->is_anonymous() || +// $this->is_pending_activation() +// ) { +// $this->_init_admin(); +// } + } + + /** + * Should be called outside `$this->is_user_in_admin()` scope + * because the updater has some logic that needs to be executed + * during AJAX calls. + * + * Currently we need to hook to the `http_request_host_is_external` filter. + * In the future, there might be additional logic added. + * + * @author Vova Feldman + * @since 1.2.1.6 + */ + if ( + $this->should_use_freemius_updater_and_dialog() && + ( + $this->is_premium() || + /** + * If not premium but the premium version is installed, also instantiate the updater so that the + * plugin information dialog of the premium version will have the information from the server. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->premium_plugin_basename() ) ) ) + ) && + $this->has_release_on_freemius() + ) { + FS_Plugin_Updater::instance( $this ); + } + + $this->do_action( 'initiated' ); + + if ( $this->_storage->prev_is_premium !== $this->_plugin->is_premium ) { + if ( isset( $this->_storage->prev_is_premium ) ) { + $this->apply_filters( + 'after_code_type_change', + // New code type. + $this->_plugin->is_premium + ); + } else { + // Set for code type for the first time. + $this->_storage->prev_is_premium = $this->_plugin->is_premium; + } + } + + if ( ! $this->is_addon() ) { + if ( $this->is_registered() ) { + // Fix for upgrade from versions < 1.0.9. + if ( ! isset( $this->_storage->activation_timestamp ) ) { + $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME; + } + + $this->do_action( 'after_init_plugin_registered' ); + } else if ( $this->is_anonymous() ) { + $this->do_action( 'after_init_plugin_anonymous' ); + } else if ( $this->is_pending_activation() ) { + $this->do_action( 'after_init_plugin_pending_activations' ); + } + } else { + if ( $this->is_registered() ) { + $this->do_action( 'after_init_addon_registered' ); + } else if ( $this->is_anonymous() ) { + $this->do_action( 'after_init_addon_anonymous' ); + } else if ( $this->is_pending_activation() ) { + $this->do_action( 'after_init_addon_pending_activations' ); + } + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + * + * @return bool + */ + private function should_use_freemius_updater_and_dialog() { + return ( + /** + * Allow updater and dialog when the `fs_allow_updater_and_dialog` URL query param exists and has `true` + * value, or when the current page is not the "Add Plugins" page (/plugin-install.php) and the `action` + * URL query param doesn't exist or its value is not `install-plugin` so that there will be no conflicts + * with the .org plugins' functionalities (e.g. installation from the "Add Plugins" page and viewing + * plugin details from .org). + */ + ( true === fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) || + ( + ! self::is_plugin_install_page() && + // Disallow updater and dialog when installing a plugin, otherwise .org "add-on" plugins will be affected. + ( 'install-plugin' !== fs_request_get( 'action' ) ) + ) + ); + } + + /** + * @author Leo Fajardo (@leorw) + * + * @since 1.2.1.5 + */ + function _stop_tracking_callback() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'stop_tracking' ); + + $result = $this->stop_tracking( fs_is_network_admin() ); + + if ( true === $result ) { + self::shoot_ajax_success(); + } + + $this->_logger->api_error( $result ); + + self::shoot_ajax_failure( + sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) . + ( $this->is_api_error( $result ) && isset( $result->error ) ? + $result->error->message : + var_export( $result, true ) ) + ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + */ + function _allow_tracking_callback() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'allow_tracking' ); + + $result = $this->allow_tracking( fs_is_network_admin() ); + + if ( true === $result ) { + self::shoot_ajax_success(); + } + + $this->_logger->api_error( $result ); + + self::shoot_ajax_failure( + sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) . + ( $this->is_api_error( $result ) && isset( $result->error ) ? + $result->error->message : + var_export( $result, true ) ) + ); + } + + /** + * Opt-out from usage tracking. + * + * Note: This will not delete the account information but will stop all tracking. + * + * Returns: + * 1. FALSE - If the user never opted-in. + * 2. TRUE - If successfully opted-out. + * 3. object - API result on failure. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @return bool|object + */ + function stop_site_tracking() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + // User never opted-in. + return false; + } + + if ( $this->is_tracking_prohibited() ) { + // Already disconnected. + return true; + } + + // Send update to FS. + $result = $this->get_api_site_scope()->call( '/?fields=is_disconnected', 'put', array( + 'is_disconnected' => true + ) ); + + if ( ! $this->is_api_result_entity( $result ) || + ! isset( $result->is_disconnected ) || + ! $result->is_disconnected + ) { + $this->_logger->api_error( $result ); + + return $result; + } + + $this->_site->is_disconnected = $result->is_disconnected; + $this->_store_site(); + + $this->clear_sync_cron(); + + // Successfully disconnected. + return true; + } + + /** + * Opt-out network from usage tracking. + * + * Note: This will not delete the account information but will stop all tracking. + * + * Returns: + * 1. FALSE - If the user never opted-in. + * 2. TRUE - If successfully opted-out. + * 3. object - API result on failure. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @return bool|object + */ + function stop_network_tracking() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + // User never opted-in. + return false; + } + + $install_id_2_blog_id = array(); + $installs_map = $this->get_blog_install_map(); + + $opt_out_all = true; + + $params = array(); + foreach ( $installs_map as $blog_id => $install ) { + if ( $install->is_tracking_prohibited() ) { + // Already opted-out. + continue; + } + + if ( $this->is_site_delegated_connection( $blog_id ) ) { + // Opt-out only from non-delegated installs. + $opt_out_all = false; + continue; + } + + $params[] = array( 'id' => $install->id ); + + $install_id_2_blog_id[ $install->id ] = $blog_id; + } + + if ( empty( $install_id_2_blog_id ) ) { + return true; + } + + $params[] = array( 'is_disconnected' => true ); + + // Send update to FS. + $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params ); + + if ( ! $this->is_api_result_object( $result, 'installs' ) ) { + $this->_logger->api_error( $result ); + + return $result; + } + + foreach ( $result->installs as $r_install ) { + $blog_id = $install_id_2_blog_id[ $r_install->id ]; + $install = $installs_map[ $blog_id ]; + $install->is_disconnected = $r_install->is_disconnected; + $this->_store_site( true, $blog_id, $install ); + } + + $this->clear_sync_cron( $opt_out_all ); + + // Successfully disconnected. + return true; + } + + /** + * Opt-out from usage tracking. + * + * Note: This will not delete the account information but will stop all tracking. + * + * Returns: + * 1. FALSE - If the user never opted-in. + * 2. TRUE - If successfully opted-out. + * 3. object - API result on failure. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @param bool $is_network_action + * + * @return bool|object + */ + function stop_tracking( $is_network_action = false ) { + $this->_logger->entrance(); + + return $is_network_action ? + $this->stop_network_tracking() : + $this->stop_site_tracking(); + } + + /** + * Opt-in back into usage tracking. + * + * Note: This will only work if the user opted-in previously. + * + * Returns: + * 1. FALSE - If the user never opted-in. + * 2. TRUE - If successfully opted-in back to usage tracking. + * 3. object - API result on failure. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @return bool|object + */ + function allow_site_tracking() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + // User never opted-in. + return false; + } + + if ( $this->is_tracking_allowed() ) { + // Tracking already allowed. + return true; + } + + $result = $this->get_api_site_scope()->call( '/?is_disconnected', 'put', array( + 'is_disconnected' => false + ) ); + + if ( ! $this->is_api_result_entity( $result ) || + ! isset( $result->is_disconnected ) || + $result->is_disconnected + ) { + $this->_logger->api_error( $result ); + + return $result; + } + + $this->_site->is_disconnected = $result->is_disconnected; + $this->_store_site(); + + $this->schedule_sync_cron(); + + // Successfully reconnected. + return true; + } + + /** + * Opt-in network back into usage tracking. + * + * Note: This will only work if the user opted-in previously. + * + * Returns: + * 1. FALSE - If the user never opted-in. + * 2. TRUE - If successfully opted-in back to usage tracking. + * 3. object - API result on failure. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @return bool|object + */ + function allow_network_tracking() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + // User never opted-in. + return false; + } + + $install_id_2_blog_id = array(); + $installs_map = $this->get_blog_install_map(); + + $params = array(); + foreach ( $installs_map as $blog_id => $install ) { + if ( $install->is_tracking_allowed() ) { + continue; + } + + $params[] = array( 'id' => $install->id ); + + $install_id_2_blog_id[ $install->id ] = $blog_id; + } + + if ( empty( $install_id_2_blog_id ) ) { + return true; + } + + $params[] = array( 'is_disconnected' => false ); + + // Send update to FS. + $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params ); + + + if ( ! $this->is_api_result_object( $result, 'installs' ) ) { + $this->_logger->api_error( $result ); + + return $result; + } + + foreach ( $result->installs as $r_install ) { + $blog_id = $install_id_2_blog_id[ $r_install->id ]; + $install = $installs_map[ $blog_id ]; + $install->is_disconnected = $r_install->is_disconnected; + $this->_store_site( true, $blog_id, $install ); + } + + $this->schedule_sync_cron(); + + // Successfully reconnected. + return true; + } + + /** + * Opt-in back into usage tracking. + * + * Note: This will only work if the user opted-in previously. + * + * Returns: + * 1. FALSE - If the user never opted-in. + * 2. TRUE - If successfully opted-in back to usage tracking. + * 3. object - API result on failure. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @param bool $is_network_action + * + * @return bool|object + */ + function allow_tracking( $is_network_action = false ) { + $this->_logger->entrance(); + + return $is_network_action ? + $this->allow_network_tracking() : + $this->allow_site_tracking(); + } + + /** + * If user opted-in and later disabled usage-tracking, + * re-allow tracking for licensing and updates. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @param bool $is_context_single_site + */ + private function reconnect_locally( $is_context_single_site = false ) { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + return; + } + + if ( ! fs_is_network_admin() || $is_context_single_site ) { + if ( $this->is_tracking_prohibited() ) { + $this->_site->is_disconnected = false; + $this->_store_site(); + } + } else { + $installs_map = $this->get_blog_install_map(); + foreach ( $installs_map as $blog_id => $install ) { + /** + * @var FS_Site $install + */ + if ( $install->is_tracking_prohibited() ) { + $install->is_disconnected = false; + $this->_store_site( true, $blog_id, $install ); + } + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.2 + * + * @return bool + */ + function is_extensions_tracking_allowed() { + return ( true === $this->apply_filters( + 'is_extensions_tracking_allowed', + $this->_storage->get( 'is_extensions_tracking_allowed', null ) + ) ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.2 + */ + function _update_tracking_permission_callback() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'update_tracking_permission' ); + + $is_enabled = fs_request_get_bool( 'is_enabled', null ); + + if ( ! is_bool( $is_enabled ) ) { + self::shoot_ajax_failure(); + } + + $permission = fs_request_get( 'permission' ); + + switch ( $permission ) { + case 'extensions': + $this->update_extensions_tracking_flag( $is_enabled ); + break; + default: + $permission = 'no_match'; + } + + if ( 'no_match' === $permission ) { + self::shoot_ajax_failure(); + } + + self::shoot_ajax_success( array( + 'permissions' => array( + $permission => $is_enabled, + ) + ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + * + * @param bool|null $is_enabled + */ + function update_extensions_tracking_flag( $is_enabled ) { + if ( is_bool( $is_enabled ) ) { + $this->_storage->store( 'is_extensions_tracking_allowed', $is_enabled ); + } + } + + /** + * Parse plugin's settings (as defined by the plugin dev). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param array $plugin_info + * + * @throws \Freemius_Exception + */ + private function parse_settings( &$plugin_info ) { + $this->_logger->entrance(); + + $id = $this->get_numeric_option( $plugin_info, 'id', false ); + $public_key = $this->get_option( $plugin_info, 'public_key', false ); + $secret_key = $this->get_option( $plugin_info, 'secret_key', null ); + $parent_id = $this->get_numeric_option( $plugin_info, 'parent_id', null ); + $parent_name = $this->get_option( $plugin_info, 'parent_name', null ); + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.9 Try to pull secret key from external config. + */ + if ( is_null( $secret_key ) && defined( "WP_FS__{$this->_slug}_SECRET_KEY" ) ) { + $secret_key = constant( "WP_FS__{$this->_slug}_SECRET_KEY" ); + } + + if ( isset( $plugin_info['parent'] ) ) { + $parent_id = $this->get_numeric_option( $plugin_info['parent'], 'id', null ); +// $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null ); +// $parent_public_key = $this->get_option( $plugin_info['parent'], 'public_key', null ); +// $parent_name = $this->get_option( $plugin_info['parent'], 'name', null ); + } + + if ( false === $id ) { + throw new Freemius_Exception( array( + 'error' => array( + 'type' => 'ParameterNotSet', + 'message' => 'Plugin id parameter is not set.', + 'code' => 'plugin_id_not_set', + 'http' => 500, + ) + ) ); + } + if ( false === $public_key ) { + throw new Freemius_Exception( array( + 'error' => array( + 'type' => 'ParameterNotSet', + 'message' => 'Plugin public_key parameter is not set.', + 'code' => 'plugin_public_key_not_set', + 'http' => 500, + ) + ) ); + } + + $plugin = ( $this->_plugin instanceof FS_Plugin ) ? + $this->_plugin : + new FS_Plugin(); + + $premium_suffix = $this->get_option( $plugin_info, 'premium_suffix', '(Premium)' ); + + $plugin->update( array( + 'id' => $id, + 'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ), + 'public_key' => $public_key, + 'slug' => $this->_slug, + 'premium_slug' => $this->get_option( $plugin_info, 'premium_slug', "{$this->_slug}-premium" ), + 'parent_plugin_id' => $parent_id, + 'version' => $this->get_plugin_version(), + 'title' => $this->get_plugin_name( $premium_suffix ), + 'file' => $this->_plugin_basename, + 'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ), + 'premium_suffix' => $premium_suffix, + 'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ), + 'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ), + 'bundle_id' => $this->get_option( $plugin_info, 'bundle_id', null ), + 'bundle_public_key' => $this->get_option( $plugin_info, 'bundle_public_key', null ), + ) ); + + if ( $plugin->is_updated() ) { + // Update plugin details. + $this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->store( $plugin ); + } + // Set the secret key after storing the plugin, we don't want to store the key in the storage. + $this->_plugin->secret_key = $secret_key; + + /** + * If the product is network integrated and activated and the current view is in the network level Admin dashboard, if the product's network-level menu located differently from the sub-site level, then use the network menu details (when set). + * + * @author Vova Feldman + * @since 2.4.5 + */ + if ( $this->is_network_active() && fs_is_network_admin() ) { + if ( isset( $plugin_info['menu_network'] ) && + is_array( $plugin_info['menu_network'] ) && + ! empty( $plugin_info['menu_network'] ) + ) { + $plugin_info['menu'] = $plugin_info['menu_network']; + } + } + + if ( ! isset( $plugin_info['menu'] ) ) { + $plugin_info['menu'] = array(); + + if ( ! empty( $this->_storage->sdk_last_version ) && + version_compare( $this->_storage->sdk_last_version, '1.1.2', '<=' ) + ) { + // Backward compatibility to 1.1.2 + $plugin_info['menu']['slug'] = isset( $plugin_info['menu_slug'] ) ? + $plugin_info['menu_slug'] : + $this->_slug; + } + } + + $this->_menu = FS_Admin_Menu_Manager::instance( + $this->_module_id, + $this->_module_type, + $this->get_unique_affix() + ); + + $this->_menu->init( $plugin_info['menu'], $this->is_addon() ); + + $this->_has_addons = $this->get_bool_option( $plugin_info, 'has_addons', false ); + $this->_has_paid_plans = $this->get_bool_option( $plugin_info, 'has_paid_plans', true ); + $this->_has_premium_version = $this->get_bool_option( $plugin_info, 'has_premium_version', $this->_has_paid_plans ); + $this->_ignore_pending_mode = $this->get_bool_option( $plugin_info, 'ignore_pending_mode', false ); + $this->_is_org_compliant = $this->get_bool_option( $plugin_info, 'is_org_compliant', true ); + $this->_is_premium_only = $this->get_bool_option( $plugin_info, 'is_premium_only', false ); + if ( $this->_is_premium_only ) { + // If premium only plugin, disable anonymous mode. + $this->_enable_anonymous = false; + $this->_anonymous_mode = false; + } else { + $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true ); + $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false ); + } + $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() ); + $this->_is_bundle_license_auto_activation_enabled = $this->get_option( $plugin_info, 'bundle_license_auto_activation', false ); + + if ( ! empty( $plugin_info['trial'] ) ) { + $this->_trial_days = $this->get_numeric_option( + $plugin_info['trial'], + 'days', + // Default to 0 - trial without days specification. + 0 + ); + + $this->_is_trial_require_payment = $this->get_bool_option( $plugin_info['trial'], 'is_require_payment', false ); + } + + $this->_navigation = $this->get_option( + $plugin_info, + 'navigation', + $this->is_free_wp_org_theme() ? + self::NAVIGATION_TABS : + self::NAVIGATION_MENU + ); + } + + /** + * @param string[] $options + * @param string $key + * @param mixed $default + * + * @return bool + */ + private function get_option( &$options, $key, $default = false ) { + return ! empty( $options[ $key ] ) ? $options[ $key ] : $default; + } + + private function get_bool_option( &$options, $key, $default = false ) { + return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default; + } + + private function get_numeric_option( &$options, $key, $default = false ) { + return isset( $options[ $key ] ) && is_numeric( $options[ $key ] ) ? $options[ $key ] : $default; + } + + /** + * Gate keeper. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @return bool + */ + private function should_stop_execution() { + if ( empty( $this->_storage->was_plugin_loaded ) ) { + /** + * Don't execute Freemius until plugin was fully loaded at least once, + * to give the opportunity for the activation hook to run before pinging + * the API for connectivity test. This logic is relevant for the + * identification of new plugin install vs. plugin update. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9 + */ + return true; + } + + if ( $this->is_activation_mode() ) { + if ( ! is_admin() ) { + /** + * If in activation mode, don't execute Freemius outside of the + * admin dashboard. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + */ + return true; + } + + if ( ! WP_FS__IS_HTTP_REQUEST ) { + /** + * If in activation and executed without HTTP context (e.g. CLI, Cronjob), + * then don't start Freemius. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.6.3 + * + * @link https://wordpress.org/support/topic/errors-in-the-freemius-class-when-running-in-wordpress-in-cli + */ + return true; + } + + if ( self::is_cron() ) { + /** + * If in activation mode, don't execute Freemius during wp crons + * (wp crons have HTTP context - called as HTTP request). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + */ + return true; + } + + if ( self::is_ajax() && + ! $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) && + ! $this->_admin_notices->has_sticky( 'failed_connect_api' ) + ) { + /** + * During activation, if running in AJAX mode, unless there's a sticky + * connectivity issue notice, don't run Freemius. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + */ + return true; + } + } + + return false; + } + + /** + * Triggered after code type has changed. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9.1 + */ + function _after_code_type_change() { + $this->_logger->entrance(); + + if ( $this->is_theme() ) { + // Expire the cache of the previous tabs since the theme may + // have setting updates after code type has changed. + $this->_cache->expire( 'tabs' ); + $this->_cache->expire( 'tabs_stylesheets' ); + } + + if ( $this->is_registered() ) { + if ( ! $this->is_addon() ) { + add_action( + is_admin() ? 'admin_init' : 'init', + array( &$this, '_plugin_code_type_changed' ) + ); + } + + if ( $this->is_premium() ) { + // Purge cached payments after switching to the premium version. + // @todo This logic doesn't handle purging the cache for serviceware module upgrade. + $this->get_api_user_scope()->purge_cache( "/plugins/{$this->_module_id}/payments.json?include_addons=true" ); + } + } + } + + /** + * Handles plugin's code type change (free <--> premium). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + function _plugin_code_type_changed() { + $this->_logger->entrance(); + + if ( $this->is_premium() ) { + $this->reconnect_locally(); + + // Activated premium code. + $this->do_action( 'after_premium_version_activation' ); + + // Remove all sticky messages related to download of the premium version. + $this->_admin_notices->remove_sticky( array( + 'trial_started', + 'plan_upgraded', + 'plan_changed', + 'license_activated', + ) ); + + $notice = ''; + if ( ! $this->is_only_premium() ) { + $notice = sprintf( $this->get_text_inline( 'Premium %s version was successfully activated.', 'premium-activated-message' ), $this->_module_type ); + } + + $license_notice = $this->get_license_network_activation_notice(); + if ( ! empty( $license_notice ) ) { + $notice .= ' ' . $license_notice; + } + + if ( ! empty( $notice ) ) { + $this->_admin_notices->add_sticky( + trim( $notice ), + 'premium_activated', + $this->get_text_x_inline( 'W00t', + 'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!' + ); + } + } else { + // Remove sticky message related to premium code activation. + $this->_admin_notices->remove_sticky( 'premium_activated' ); + + // Activated free code (after had the premium before). + $this->do_action( 'after_free_version_reactivation' ); + + if ( $this->is_paying() && ! $this->is_premium() ) { + $this->_admin_notices->add_sticky( + sprintf( + /* translators: %s: License type (e.g. you have a professional license) */ + $this->get_text_inline( 'You have a %s license.', 'you-have-x-license' ), + $this->get_plan_title() + ) . $this->get_complete_upgrade_instructions(), + 'plan_upgraded', + $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' + ); + } + } + + // Schedule code type changes event. + $this->schedule_install_sync(); + + /** + * Unregister the uninstall hook for the other version of the plugin (with different code type) to avoid + * triggering a fatal error when uninstalling that plugin. For example, after deactivating the "free" version + * of a specific plugin, its uninstall hook should be unregistered after the "premium" version has been + * activated. If we don't do that, a fatal error will occur when we try to uninstall the "free" version since + * the main file of the "free" version will be loaded first before calling the hooked callback. Since the + * free and premium versions are almost identical (same class or have same functions), a fatal error like + * "Cannot redeclare class MyClass" or "Cannot redeclare my_function()" will occur. + */ + $this->unregister_uninstall_hook(); + + $this->clear_module_main_file_cache(); + + // Update is_premium of latest version. + $this->_storage->prev_is_premium = $this->_plugin->is_premium; + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Add-ons + #---------------------------------------------------------------------------------- + + /** + * Check if add-on installed and activated on site. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param string|number $id_or_slug + * @param bool|null $is_premium Since 1.2.1.7 can check for specified add-on version. + * + * @return bool + */ + function is_addon_activated( $id_or_slug, $is_premium = null ) { + $this->_logger->entrance(); + + $addon_id = self::get_module_id( $id_or_slug ); + $is_activated = self::has_instance( $addon_id ); + + if ( ! $is_activated ) { + return false; + } + + if ( is_bool( $is_premium ) ) { + // Check if the specified code version is activate. + $addon = $this->get_addon_instance( $addon_id ); + $is_activated = ( $is_premium === $addon->is_premium() ); + } + + return $is_activated; + } + + /** + * Check if add-on was connected to install + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + * + * @param string|number $id_or_slug + * + * @return bool + */ + function is_addon_connected( $id_or_slug ) { + $this->_logger->entrance(); + + $sites = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ); + + $addon_id = self::get_module_id( $id_or_slug ); + $addon = $this->get_addon( $addon_id ); + $slug = $addon->slug; + if ( ! isset( $sites[ $slug ] ) ) { + return false; + } + + $site = $sites[ $slug ]; + + $plugin = FS_Plugin_Manager::instance( $addon_id )->get(); + + if ( $plugin->parent_plugin_id != $this->_plugin->id ) { + // The given slug do NOT belong to any of the plugin's add-ons. + return false; + } + + return ( is_object( $site ) && + is_numeric( $site->id ) && + is_numeric( $site->user_id ) && + FS_Plugin_Plan::is_valid_id( $site->plan_id ) + ); + } + + /** + * Determines if add-on installed. + * + * NOTE: This is a heuristic and only works if the folder/file named as the slug. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param string|number $id_or_slug + * + * @return bool + */ + function is_addon_installed( $id_or_slug ) { + $this->_logger->entrance(); + + $addon_id = self::get_module_id( $id_or_slug ); + + return file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->get_addon_basename( $addon_id ) ) ); + } + + /** + * Get add-on basename. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param string|number $id_or_slug + * + * @return string + */ + function get_addon_basename( $id_or_slug ) { + $addon_id = self::get_module_id( $id_or_slug ); + + if ( $this->is_addon_activated( $addon_id ) ) { + return self::instance( $addon_id )->get_plugin_basename(); + } + + $addon = $this->get_addon( $addon_id ); + $premium_basename = "{$addon->premium_slug}/{$addon->slug}.php"; + + if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) { + return $premium_basename; + } + + $all_plugins = $this->get_all_plugins(); + + foreach ( $all_plugins as $basename => $data ) { + if ( $addon->slug === $data['slug'] || + $addon->premium_slug === $data['slug'] + ) { + return $basename; + } + } + + $free_basename = "{$addon->slug}/{$addon->slug}.php"; + + return $free_basename; + } + + /** + * Get installed add-ons instances. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return Freemius[] + */ + function get_installed_addons() { + if ( $this->is_addon() ) { + // Add-on cannot have add-ons. + return array(); + } + + $installed_addons = array(); + + foreach ( self::$_instances as $instance ) { + if ( $instance->is_addon_of( $this->_plugin->id ) ) { + $installed_addons[] = $instance; + } + } + + return $installed_addons; + } + + /** + * Check if any add-ons of the plugin are installed. + * + * @author Leo Fajardo (@leorw) + * @since 1.1.1 + * + * @return bool + */ + function has_installed_addons() { + if ( ! $this->has_addons() ) { + return false; + } + + foreach ( self::$_instances as $instance ) { + if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) { + if ( $this->_plugin->id == $instance->_parent_plugin->id ) { + return true; + } + } + } + + return false; + } + + /** + * Tell Freemius that the current plugin is an add-on. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param number $parent_plugin_id The parent plugin ID + */ + function init_addon( $parent_plugin_id ) { + $this->_plugin->parent_plugin_id = $parent_plugin_id; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return bool + */ + function is_addon() { + return ( + isset( $this->_plugin->parent_plugin_id ) && + is_numeric( $this->_plugin->parent_plugin_id ) + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.2 + * + * @param number $parent_product_id + * + * @return bool + */ + function is_addon_of( $parent_product_id ) { + return ( + $this->is_addon() && + $parent_product_id == $this->_plugin->parent_plugin_id + ); + } + + /** + * Deactivate add-on if it's premium only and the user does't have a valid license. + * + * @param bool $is_after_trial_cancel + * + * @return bool If add-on was deactivated. + */ + private function deactivate_premium_only_addon_without_license( $is_after_trial_cancel = false ) { + if ( ! $this->has_free_plan() && + ! $this->has_features_enabled_license() && + ! $this->_has_premium_license() + ) { + if ( $this->is_registered() ) { + // IF wrapper is turned off because activation_timestamp is currently only stored for plugins (not addons). + // if (empty($this->_storage->activation_timestamp) || + // (WP_FS__SCRIPT_START_TIME - $this->_storage->activation_timestamp) > 30 + // ) { + /** + * @todo When it's first fail, there's no reason to try and re-sync because the licenses were just synced after initial activation. + * + * Retry syncing the user add-on licenses. + */ + // Sync licenses. + $this->_sync_licenses(); + // } + + // Try to activate premium license. + $this->_activate_license( true ); + } + + if ( ! $this->has_free_plan() && + ! $this->has_features_enabled_license() && + ! $this->_has_premium_license() + ) { + // @todo Check if deactivate plugins also call the deactivation hook. + + $this->_parent->_admin_notices->add_sticky( + sprintf( + ( $is_after_trial_cancel ? + $this->_parent->get_text_inline( + '%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you\'ll have to purchase a license.', + 'addon-trial-cancelled-message' + ) : + $this->_parent->get_text_inline( + '%s is a premium only add-on. You have to purchase a license first before activating the plugin.', + 'addon-no-license-message' + ) + ), + '' . $this->_plugin->title . '' + ) . ' ' . sprintf( + '%s  ➜', + $this->_parent->addon_url( $this->_slug ), + esc_attr( sprintf( $this->_parent->get_text_inline( 'More information about %s', 'more-information-about-x' ), $this->_plugin->title ) ), + $this->_parent->get_text_inline( 'Purchase License', 'purchase-license' ) + ), + 'no_addon_license_' . $this->_slug, + ( $is_after_trial_cancel ? '' : $this->_parent->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...' ), + ( $is_after_trial_cancel ? 'success' : 'error' ) + ); + + deactivate_plugins( array( $this->_plugin_basename ), true ); + + return true; + } + } + + return false; + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Sandbox + #---------------------------------------------------------------------------------- + + /** + * Set Freemius into sandbox mode for debugging. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param string $secret_key + */ + function init_sandbox( $secret_key ) { + $this->_plugin->secret_key = $secret_key; + + // Update plugin details. + FS_Plugin_Manager::instance( $this->_module_id )->update( $this->_plugin, true ); + } + + /** + * Check if running payments in sandbox mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @return bool + */ + function is_payments_sandbox() { + return ( ! $this->is_live() ) || isset( $this->_plugin->secret_key ); + } + + #endregion + + /** + * Check if running test vs. live plugin. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @return bool + */ + function is_live() { + return $this->_plugin->is_live; + } + + /** + * Check if super-admin skipped connection for all sites in the network. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + function is_network_anonymous() { + if ( ! $this->_is_network_active ) { + return false; + } + + $is_anonymous_ms = $this->_storage->get( 'is_anonymous_ms' ); + + if ( empty( $is_anonymous_ms ) ) { + return false; + } + + return $is_anonymous_ms['is']; + } + + /** + * Check if super-admin opted-in for all sites in the network. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + function is_network_connected() { + if ( ! $this->_is_network_active ) { + return false; + } + + return $this->_storage->get( 'is_network_connected' ); + } + + /** + * Check if the user skipped connecting the account with Freemius. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return bool + */ + function is_anonymous() { + if ( ! isset( $this->_is_anonymous ) ) { + if ( $this->is_network_anonymous() ) { + $this->_is_anonymous = true; + } else if ( ! fs_is_network_admin() ) { + if ( ! isset( $this->_storage->is_anonymous ) ) { + // Not skipped. + $this->_is_anonymous = false; + } else if ( is_bool( $this->_storage->is_anonymous ) ) { + // For back compatibility, since the variable was boolean before. + $this->_is_anonymous = $this->_storage->is_anonymous; + + // Upgrade stored data format to 1.1.3 format. + $this->set_anonymous_mode( $this->_storage->is_anonymous ); + } else { + // Version 1.1.3 and later. + $this->_is_anonymous = $this->_storage->is_anonymous['is']; + } + } + } + + return $this->_is_anonymous; + } + + /** + * Check if the user skipped the connection of a specified site. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id + * + * @return bool + */ + function is_anonymous_site( $blog_id = 0 ) { + if ( $this->is_network_anonymous() ) { + return true; + } + + $is_anonymous = $this->_storage->get( 'is_anonymous', false, $blog_id ); + + if ( empty( $is_anonymous ) ) { + return false; + } + + return $is_anonymous['is']; + } + + /** + * Check if user connected his account and install pending email activation. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return bool + */ + function is_pending_activation() { + return $this->_storage->get( 'is_pending_activation', false ); + } + + /** + * Check if plugin must be WordPress.org compliant. + * + * @since 1.0.7 + * + * @return bool + */ + function is_org_repo_compliant() { + return $this->_is_org_compliant; + } + + #-------------------------------------------------------------------------------- + #region WP Cron Common + #-------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * + * @return object + */ + private function get_cron_data( $name ) { + $this->_logger->entrance( $name ); + + /** + * @var object $cron_data + */ + return $this->_storage->get( "{$name}_cron", null ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + */ + private function clear_cron_data( $name ) { + $this->_logger->entrance( $name ); + + $this->_storage->remove( "{$name}_cron" ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * @param int $cron_blog_id The cron executing blog ID. + */ + private function set_cron_data( $name, $cron_blog_id = 0 ) { + $this->_logger->entrance( $name ); + + $this->_storage->store( "{$name}_cron", (object) array( + 'version' => $this->get_plugin_version(), + 'blog_id' => $cron_blog_id, + 'sdk_version' => $this->version, + 'timestamp' => WP_FS__SCRIPT_START_TIME, + 'on' => true, + ) ); + } + + /** + * Get the cron's executing blog ID. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * + * @return int + */ + private function get_cron_blog_id( $name ) { + $this->_logger->entrance( $name ); + + /** + * @var object $cron_data + */ + $cron_data = $this->get_cron_data( $name ); + + return ( is_object( $cron_data ) && is_numeric( $cron_data->blog_id ) ) ? + $cron_data->blog_id : + 0; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * + * @return bool + */ + private function is_cron_on( $name ) { + $this->_logger->entrance( $name ); + + /** + * @var object $cron_data + */ + $cron_data = $this->get_cron_data( $name ); + + return ( ! is_null( $cron_data ) && true === $cron_data->on ); + } + + /** + * Unix timestamp for previous cron execution or false if never executed. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * + * @return int|false + */ + private function cron_last_execution( $name ) { + $this->_logger->entrance( $name ); + + return $this->_storage->get( "{$name}_timestamp" ); + } + + /** + * Set cron execution time to now. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + */ + private function set_cron_execution_timestamp( $name ) { + $this->_logger->entrance( $name ); + + $this->_storage->store( "{$name}_timestamp", time() ); + } + + /** + * Sets the keepalive time to now. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + * + * @param bool|null $use_network_level_storage + */ + private function set_keepalive_timestamp( $use_network_level_storage = null ) { + $this->_logger->entrance(); + + $this->_storage->store( 'keepalive_timestamp', time(), $use_network_level_storage ); + } + + /** + * Check if cron was executed in the last $period of seconds. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * @param int $period In seconds + * + * @return bool + */ + private function is_cron_executed( $name, $period = WP_FS__TIME_24_HOURS_IN_SEC ) { + $this->_logger->entrance( $name ); + + $last_execution = $this->cron_last_execution( $name ); + + if ( ! is_numeric( $last_execution ) ) { + return false; + } + + return ( $last_execution > ( WP_FS__SCRIPT_START_TIME - $period ) ); + } + + /** + * WP Cron is executed on a site level. When running in a multisite network environment + * with the network integration activated, for optimization reasons, we are consolidating + * the installs data sync cron to be executed only from a single site. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $except_blog_id Target any except the excluded blog ID. + * + * @return int + */ + private function get_cron_target_blog_id( $except_blog_id = 0 ) { + if ( ! is_multisite() ) { + return 0; + } + + if ( $this->_is_network_active && + is_numeric( $this->_storage->network_install_blog_id ) && + $except_blog_id != $this->_storage->network_install_blog_id && + self::is_site_active( $this->_storage->network_install_blog_id ) + ) { + // Try to run cron from the main network blog. + $install = $this->get_install_by_blog_id( $this->_storage->network_install_blog_id ); + + if ( is_object( $install ) && + ( $this->is_premium() || $install->is_tracking_allowed() ) + ) { + return $this->_storage->network_install_blog_id; + } + } + + // Get first opted-in blog ID with active tracking. + $installs = $this->get_blog_install_map(); + foreach ( $installs as $blog_id => $install ) { + if ( $except_blog_id != $blog_id && + self::is_site_active( $blog_id ) && + ( $this->is_premium() || $install->is_tracking_allowed() ) + ) { + return $blog_id; + } + } + + return 0; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * @param string $action_tag Callback action tag. + * @param bool $is_network_clear If set to TRUE, clear sync cron even if there are installs that are still connected. + */ + private function clear_cron( $name, $action_tag = '', $is_network_clear = false ) { + $this->_logger->entrance( $name ); + + if ( ! $this->is_cron_on( $name ) ) { + return; + } + + $clear_cron = true; + if ( ! $is_network_clear && $this->_is_network_active ) { + $installs = $this->get_blog_install_map(); + + foreach ( $installs as $blog_id => $install ) { + /** + * @var FS_Site $install + */ + if ( $install->is_tracking_allowed() ) { + $clear_cron = false; + break; + } + } + } + + if ( ! $clear_cron ) { + return; + } + + /** + * @var object $cron_data + */ + $cron_data = $this->get_cron_data( $name ); + + $cron_blog_id = is_object( $cron_data ) && isset( $cron_data->blog_id ) ? + $cron_data->blog_id : + 0; + + $this->clear_cron_data( $name ); + + if ( 0 < $cron_blog_id ) { + switch_to_blog( $cron_blog_id ); + } + + if ( empty( $action_tag ) ) { + $action_tag = $name; + } + + wp_clear_scheduled_hook( $this->get_action_tag( $action_tag ) ); + + if ( 0 < $cron_blog_id ) { + restore_current_blog(); + } + } + + /** + * Unix timestamp for next cron execution or false if not scheduled. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * @param string $action_tag Callback action tag. + * + * @return int|false + */ + private function get_next_scheduled_cron( $name, $action_tag = '' ) { + $this->_logger->entrance( $name ); + + if ( ! $this->is_cron_on( $name ) ) { + return false; + } + + /** + * @var object $cron_data + */ + $cron_data = $this->get_cron_data( $name ); + + $cron_blog_id = is_object( $cron_data ) && isset( $cron_data->blog_id ) ? + $cron_data->blog_id : + 0; + + if ( 0 < $cron_blog_id ) { + switch_to_blog( $cron_blog_id ); + } + + if ( empty( $action_tag ) ) { + $action_tag = $name; + } + + $next_scheduled = wp_next_scheduled( $this->get_action_tag( $action_tag ) ); + + if ( 0 < $cron_blog_id ) { + restore_current_blog(); + } + + return $next_scheduled; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * @param string $action_tag Callback action tag. + * @param string $recurrence 'single' or 'daily'. + * @param int $start_at Defaults to now. + * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise, schedule job to start right away. + * @param int $except_blog_id Target any except the excluded blog ID. + */ + private function schedule_cron( + $name, + $action_tag = '', + $recurrence = 'single', + $start_at = WP_FS__SCRIPT_START_TIME, + $randomize_start = true, + $except_blog_id = 0 + ) { + $this->_logger->entrance( $name ); + + $this->clear_cron( $name, $action_tag, true ); + + $cron_blog_id = $this->get_cron_target_blog_id( $except_blog_id ); + + if ( is_multisite() && 0 == $cron_blog_id ) { + // Don't schedule cron since couldn't find a target blog. + return; + } + + if ( 0 < $cron_blog_id ) { + switch_to_blog( $cron_blog_id ); + } + + if ( 'daily' === $recurrence ) { + if ( $randomize_start ) { + // Schedule first sync with a random 12 hour time range from now. + $start_at += rand( 0, ( WP_FS__TIME_24_HOURS_IN_SEC / 2 ) ); + } + + // Schedule daily WP cron. + wp_schedule_event( + $start_at, + 'daily', + $this->get_action_tag( $action_tag ) + ); + } else if ( 'single' === $recurrence ) { + // Schedule single cron. + wp_schedule_single_event( + $start_at, + $this->get_action_tag( $action_tag ) + ); + } + + $this->set_cron_data( $name, $cron_blog_id ); + + if ( 0 < $cron_blog_id ) { + restore_current_blog(); + } + } + + /** + * Consolidated cron execution for performance optimization. The max number of API requests is based on the number of unique opted-in users. + * that doesn't halt page loading. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string $name Cron name. + * @param callable $callable The function that should be executed. + */ + private function execute_cron( $name, $callable ) { + $this->_logger->entrance( $name ); + + // Store the last time data sync was executed. + $this->set_cron_execution_timestamp( $name ); + + // Check if API is temporary down. + if ( FS_Api::is_temporary_down() ) { + return; + } + + // @todo Add logic that identifies API latency, and reschedule the next background sync randomly between 8-16 hours. + + $users_2_blog_ids = array(); + + if ( ! is_multisite() ) { + // Add dummy blog. + $users_2_blog_ids[0] = array( 0 ); + } else { + $installs = $this->get_blog_install_map(); + foreach ( $installs as $blog_id => $install ) { + if ( $this->is_premium() || $install->is_tracking_allowed() ) { + if ( ! isset( $users_2_blog_ids[ $install->user_id ] ) ) { + $users_2_blog_ids[ $install->user_id ] = array(); + } + + $users_2_blog_ids[ $install->user_id ][] = $blog_id; + } + } + } + + $current_blog_id = get_current_blog_id(); + + foreach ( $users_2_blog_ids as $user_id => $blog_ids ) { + if ( 0 < $blog_ids[0] ) { + $this->switch_to_blog( $blog_ids[0] ); + } + + call_user_func_array( $callable, array( $blog_ids, ( is_multisite() ? $current_blog_id : null ) ) ); + + foreach ( $blog_ids as $blog_id ) { + $this->do_action( "after_{$name}_cron", $blog_id ); + } + } + + if ( is_multisite() ) { + $this->switch_to_blog( $current_blog_id, fs_is_network_admin() ? $this->get_network_install() : null ); + + $this->do_action( "after_{$name}_cron_multisite" ); + } + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Daily Sync Cron + #---------------------------------------------------------------------------------- + + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return bool + */ + private function is_sync_cron_scheduled() { + return $this->is_cron_on( 'sync' ); + } + + /** + * Get the sync cron's executing blog ID. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return int + */ + private function get_sync_cron_blog_id() { + return $this->get_cron_blog_id( 'sync' ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + */ + private function run_manual_sync() { + self::require_pluggable_essentials(); + + if ( ! $this->is_user_admin() ) { + return; + } + + // Run manual sync. + $this->_sync_cron(); + + // Reschedule next cron to run 24 hours from now (performance optimization). + $this->schedule_sync_cron( time() + WP_FS__TIME_24_HOURS_IN_SEC, false ); + } + + /** + * Data sync cron job. Replaces the background sync non blocking HTTP request + * that doesn't halt page loading. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * @since 2.0.0 Consolidate all the data sync into the same cron for performance optimization. The max number of API requests is based on the number of unique opted-in users. + */ + function _sync_cron() { + $this->_logger->entrance(); + + $this->execute_cron( 'sync', array( &$this, '_sync_cron_method' ) ); + } + + /** + * The actual data sync cron logic. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int[] $blog_ids + * @param int|null $current_blog_id @since 2.2.3. This is passed from the `execute_cron` method and used by the + * `_sync_plugin_license` method in order to switch to the previous blog when sending + * updates for a single site in case `execute_cron` has switched to a different blog. + */ + function _sync_cron_method( array $blog_ids, $current_blog_id = null ) { + if ( $this->is_registered() ) { + if ( $this->has_paid_plan() ) { + // Initiate background plan sync. + $this->_sync_license( true, false, $current_blog_id ); + + if ( $this->is_paying() ) { + // Check for premium plugin updates. + $this->check_updates( true ); + } + } else { + // Sync install(s) (only if something changed locally). + if ( 1 < count( $blog_ids ) ) { + $this->sync_installs(); + } else { + $this->sync_install(); + } + + $this->maybe_sync_install_user(); + } + } + } + + /** + * Check if sync was executed in the last $period of seconds. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param int $period In seconds + * + * @return bool + */ + private function is_sync_executed( $period = WP_FS__TIME_24_HOURS_IN_SEC ) { + return $this->is_cron_executed( 'sync', $period ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @return bool + */ + private function is_sync_cron_on() { + return $this->is_cron_on( 'sync' ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param int $start_at Defaults to now. + * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise, schedule job to start right away. + * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor. + */ + private function schedule_sync_cron( + $start_at = WP_FS__SCRIPT_START_TIME, + $randomize_start = true, + $except_blog_id = 0 + ) { + $this->schedule_cron( + 'sync', + 'data_sync', + 'daily', + $start_at, + $randomize_start, + $except_blog_id + ); + } + + /** + * Add the actual sync function to the cron job hook. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + */ + private function hook_callback_to_sync_cron() { + $this->add_action( 'data_sync', array( &$this, '_sync_cron' ) ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param bool $is_network_clear Since 2.0.0 If set to TRUE, clear sync cron even if there are installs that are still connected. + */ + private function clear_sync_cron( $is_network_clear = false ) { + $this->_logger->entrance(); + + $this->clear_cron( 'sync', 'data_sync', $is_network_clear ); + } + + /** + * Unix timestamp for next sync cron execution or false if not scheduled. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @return int|false + */ + function next_sync_cron() { + return $this->get_next_scheduled_cron( 'sync', 'data_sync' ); + } + + /** + * Unix timestamp for previous sync cron execution or false if never executed. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @return int|false + */ + function last_sync_cron() { + return $this->cron_last_execution( 'sync' ); + } + + #endregion Daily Sync Cron ------------------------------------------------------------------ + + #---------------------------------------------------------------------------------- + #region Async Install Sync + #---------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @return bool + */ + private function is_install_sync_scheduled() { + return $this->is_cron_on( 'install_sync' ); + } + + /** + * Get the sync cron's executing blog ID. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return int + */ + private function get_install_sync_cron_blog_id() { + return $this->get_cron_blog_id( 'install_sync' ); + } + + /** + * Instead of running blocking install sync event, execute non blocking scheduled wp-cron. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor. + */ + private function schedule_install_sync( $except_blog_id = 0 ) { + $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id ); + } + + /** + * Unix timestamp for previous install sync cron execution or false if never executed. + * + * @todo There's some very strange bug that $this->_storage->install_sync_timestamp value is not being updated. But for sure the sync event is working. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @return int|false + */ + function last_install_sync() { + return $this->cron_last_execution( 'install_sync' ); + } + + /** + * Unix timestamp for next install sync cron execution or false if not scheduled. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @return int|false + */ + function next_install_sync() { + return $this->get_next_scheduled_cron( 'install_sync', 'install_sync' ); + } + + /** + * Add the actual install sync function to the cron job hook. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + */ + private function hook_callback_to_install_sync() { + $this->add_action( 'install_sync', array( &$this, '_run_sync_install' ) ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param bool $is_network_clear Since 2.0.0 If set to TRUE, clear sync cron even if there are installs that are still connected. + */ + private function clear_install_sync_cron( $is_network_clear = false ) { + $this->_logger->entrance(); + + $this->clear_cron( 'install_sync', 'install_sync', $is_network_clear ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * @since 2.0.0 Consolidate all the data sync into the same cron for performance optimization. The max number of API requests is based on the number of unique opted-in users. + */ + public function _run_sync_install() { + $this->_logger->entrance(); + + $this->execute_cron( 'sync', array( &$this, '_sync_install_cron_method' ) ); + } + + /** + * The actual install(s) sync cron logic. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int[] $blog_ids + * @param int|null $current_blog_id + */ + function _sync_install_cron_method( array $blog_ids, $current_blog_id = null ) { + if ( $this->is_registered() ) { + if ( 1 < count( $blog_ids ) ) { + $this->sync_installs( array(), true ); + } else { + $this->sync_install( array(), true ); + } + + $this->maybe_sync_install_user(); + } + } + + #endregion Async Install Sync ------------------------------------------------------------------ + + /** + * Show a notice that activation is currently pending. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @param bool|string $email + * @param bool $is_pending_trial Since 1.2.1.5 + */ + function _add_pending_activation_notice( $email = false, $is_pending_trial = false ) { + if ( ! is_string( $email ) ) { + $current_user = self::_get_current_wp_user(); + $email = $current_user->user_email; + } + + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( 'You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.', 'pending-activation-message' ), + '' . $this->get_plugin_name() . '', + '' . $email . '', + ( $is_pending_trial ? + $this->get_text_inline( 'start the trial', 'start-the-trial' ) : + $this->get_text_inline( 'complete the install', 'complete-the-install' ) ) + ), + 'activation_pending', + 'Thanks!' + ); + } + + /** + * Check if currently in plugin activation. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.4 + * + * @return bool + */ + function is_plugin_activation() { + $result = get_transient( "fs_{$this->_module_type}_{$this->_slug}_activated" ); + + return !empty($result); + } + + /** + * + * NOTE: admin_menu action executed before admin_init. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + */ + function _admin_init_action() { + $is_migration = $this->is_migration(); + + /** + * Automatically redirect to connect/activation page after plugin activation. + * + * @since 1.1.7 Do NOT redirect to opt-in when running in network admin mode. + */ + if ( $this->is_plugin_activation() ) { + delete_transient( "fs_{$this->_module_type}_{$this->_slug}_activated" ); + + if ( isset( $_GET['activate-multi'] ) ) { + /** + * Don't redirect if activating multiple plugins at once (bulk activation). + */ + } else if ( ! $is_migration ) { + $this->_redirect_on_activation_hook(); + return; + } + } + + if ( $is_migration ) { + return; + } + + if ( fs_request_is_action( $this->get_unique_affix() . '_skip_activation' ) ) { + check_admin_referer( $this->get_unique_affix() . '_skip_activation' ); + + $this->skip_connection( null, fs_is_network_admin() ); + + fs_redirect( $this->get_after_activation_url( 'after_skip_url' ) ); + } + + if ( $this->is_network_activation_mode() && + fs_request_is_action( $this->get_unique_affix() . '_delegate_activation' ) + ) { + check_admin_referer( $this->get_unique_affix() . '_delegate_activation' ); + + $this->delegate_connection(); + + fs_redirect( $this->get_after_activation_url( 'after_delegation_url' ) ); + } + + $this->_add_upgrade_action_link(); + + if ( ! ( ! $this->_is_network_active && fs_is_network_admin() ) && + ( + ( true === $this->_storage->require_license_activation ) || + // Not registered nor anonymous. + ( ! $this->is_registered() && ! $this->is_anonymous() ) || + // OR, network level and in network upgrade mode. + ( fs_is_network_admin() && $this->_is_network_active && $this->is_network_upgrade_mode() ) + ) + ) { + if ( ! $this->is_pending_activation() ) { + if ( ! $this->is_activation_page() ) { + /** + * If a user visits any other admin page before activating the premium-only theme with a valid + * license, reactivate the previous theme. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + if ( $this->is_theme() && + ! $this->has_settings_menu() && + ! isset( $_REQUEST['fs_action'] ) && + $this->can_activate_previous_theme() + ) { + if ( $this->is_only_premium() ) { + $this->activate_previous_theme(); + return; + } + + if ( true === $this->_storage->require_license_activation ) { + $this->_storage->require_license_activation = false; + } + } + + if ( ! fs_is_network_admin() && + $this->is_network_activation_mode() && + ! $this->is_delegated_connection() + ) { + return; + } + + if ( $this->is_plugin_new_install() || $this->is_only_premium() ) { + if ( ! $this->_anonymous_mode && + ( ! $this->is_addon() || ! $this->_parent->is_anonymous() ) ) { + // Show notice for new plugin installations. + $this->_admin_notices->add( + sprintf( + $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ), + sprintf( '%s', + $this->get_activation_url( array(), ! $this->is_delegated_connection() ), + sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now', + '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() ) + ) + ), + '', + 'update-nag' + ); + } + } else { + if ( $this->should_add_sticky_optin_notice() ) { + $this->add_sticky_optin_admin_notice(); + } + + if ( $this->has_filter( 'optin_pointer_element' ) ) { + // Don't show admin nag if plugin update. + wp_enqueue_script( 'wp-pointer' ); + wp_enqueue_style( 'wp-pointer' ); + + $this->_enqueue_connect_essentials(); + + add_action( 'admin_print_footer_scripts', array( + $this, + '_add_connect_pointer_script' + ) ); + } + } + } + } + + if ( $this->show_opt_in_on_themes_page() && + $this->is_activation_page() + ) { + $this->_show_theme_activation_optin_dialog(); + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return bool + */ + private function should_add_sticky_optin_notice() { + if ( $this->is_addon() && $this->_parent->is_anonymous() ) { + return false; + } + + if ( fs_is_network_admin() ) { + if ( ! $this->_is_network_active ) { + return false; + } + + if ( ! $this->is_network_activation_mode() ) { + return false; + } + + return ! isset( $this->_storage->sticky_optin_added_ms ); + } + + if ( ! $this->is_activation_mode() ) { + return false; + } + + // If running from a blog admin and delegated the connection. + return ! isset( $this->_storage->sticky_optin_added ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + */ + private function add_sticky_optin_admin_notice() { + if ( ! $this->_is_network_active || ! fs_is_network_admin() ) { + $this->_storage->sticky_optin_added = true; + } else { + $this->_storage->sticky_optin_added_ms = true; + } + + // Show notice for new plugin installations. + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( 'We made a few tweaks to the %s, %s', 'few-plugin-tweaks' ), + $this->_module_type, + sprintf( '%s', + $this->get_activation_url(), + sprintf( $this->get_text_inline( 'Opt in to make "%s" better!', 'optin-x-now' ), $this->get_plugin_name() ) + ) + ), + 'connect_account', + '', + 'update-nag' + ); + } + + /** + * Enqueue connect requires scripts and styles. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.4 + */ + function _enqueue_connect_essentials() { + wp_enqueue_script( 'jquery' ); + wp_enqueue_script( 'json2' ); + + fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' ); + fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' ); + + fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' ); + } + + /** + * Add connect / opt-in pointer. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.4 + */ + function _add_connect_pointer_script() { + $vars = array( 'id' => $this->_module_id ); + $pointer_content = fs_get_template( 'connect.php', $vars ); + ?> + + _menu->get_raw_slug() ) || + fs_is_plugin_page( $this->_slug ); + } + + /* Events + ------------------------------------------------------------------------------------------------------------------*/ + /** + * Delete site install from Database. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param bool $store + * @param int|null $blog_id Since 2.0.0 + * + * @return false|int The install ID if deleted. Otherwise, FALSE (when install not exist). + */ + function _delete_site( $store = true, $blog_id = null ) { + return self::_delete_site_by_slug( $this->_slug, $this->_module_type, $store, $blog_id ); + } + + /** + * Delete site install from Database. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @param string $slug + * @param string $module_type + * @param bool $store + * @param int|null $blog_id Since 2.0.0 + * + * @return false|int The install ID if deleted. Otherwise, FALSE (when install not exist). + */ + static function _delete_site_by_slug( $slug, $module_type, $store = true, $blog_id = null ) { + $sites = self::get_all_sites( $module_type, $blog_id ); + + $install_id = false; + + if ( isset( $sites[ $slug ] ) ) { + if ( is_object( $sites[ $slug ] ) ) { + $install_id = $sites[ $slug ]->id; + } + + unset( $sites[ $slug ] ); + + self::set_account_option_by_module( $module_type, 'sites', $sites, $store, $blog_id ); + } + + return $install_id; + } + + /** + * Delete user. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $user_id + * @param bool $store + * + * @return false|int The user ID if deleted. Otherwise, FALSE (when install not exist). + */ + private static function delete_user( $user_id, $store = true ) { + $users = self::get_all_users(); + + if ( ! is_array( $users ) || ! isset( $users[ $user_id ] ) ) { + return false; + } + + unset( $users[ $user_id ] ); + + self::$_accounts->set_option( 'users', $users, $store ); + + return $user_id; + } + + /** + * Delete plugin's plans information. + * + * @param bool $store Flush to Database if true. + * @param bool $keep_associated_plans If set to false, delete all plans, even if a plan is associated with an install. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + private function _delete_plans( $store = true, $keep_associated_plans = true ) { + $this->_logger->entrance(); + + $plans = self::get_all_plans( $this->_module_type ); + + $plans_to_keep = array(); + + if ( $keep_associated_plans ) { + $plans_ids_to_keep = $this->get_plans_ids_associated_with_installs(); + foreach ( $plans_ids_to_keep as $plan_id ) { + $plan = self::_get_plan_by_id( $plan_id ); + if ( is_object( $plan ) ) { + $plans_to_keep[] = self::_encrypt_entity( $plan ); + } + } + } + + if ( ! empty( $plans_to_keep ) ) { + $plans[ $this->_slug ] = $plans_to_keep; + } else { + unset( $plans[ $this->_slug ] ); + } + + $this->set_account_option( 'plans', $plans, $store ); + } + + /** + * Delete all plugin licenses. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param bool $store + */ + private function _delete_licenses( $store = true ) { + $this->_logger->entrance(); + + $all_licenses = self::get_all_licenses(); + + unset( $all_licenses[ $this->_module_id ] ); + + self::$_accounts->set_option( 'all_licenses', $all_licenses, $store ); + } + + /** + * Check if Freemius was added on new plugin installation. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.5 + * + * @return bool + */ + function is_plugin_new_install() { + return isset( $this->_storage->is_plugin_new_install ) && + $this->_storage->is_plugin_new_install; + } + + /** + * Check if it's the first plugin release that is running Freemius. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @return bool + */ + function is_first_freemius_powered_version() { + return empty( $this->_storage->plugin_last_version ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return bool|string + */ + private function get_previous_theme_slug() { + return isset( $this->_storage->previous_theme ) ? + $this->_storage->previous_theme : + false; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return string + */ + private function can_activate_previous_theme() { + $slug = $this->get_previous_theme_slug(); + if ( false !== $slug && current_user_can( 'switch_themes' ) ) { + $theme_instance = wp_get_theme( $slug ); + + return $theme_instance->exists(); + } + + return false; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + private function activate_previous_theme() { + switch_theme( $this->get_previous_theme_slug() ); + unset( $this->_storage->previous_theme ); + + global $pagenow; + if ( 'themes.php' === $pagenow ) { + /** + * Refresh the active theme information. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + fs_redirect( $this->admin_url( $pagenow ) ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return string + */ + function get_previous_theme_activation_url() { + if ( ! $this->can_activate_previous_theme() ) { + return ''; + } + + /** + * Activation URL + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + return wp_nonce_url( + $this->admin_url( 'themes.php?action=activate&stylesheet=' . urlencode( $this->get_previous_theme_slug() ) ), + 'switch-theme_' . $this->get_previous_theme_slug() + ); + } + + /** + * Saves the slug of the previous theme if it still exists so that it can be used by the logic in the opt-in + * form that decides whether to add a close button to the opt-in dialog or not. So after a premium-only theme is + * activated, the close button will appear and will reactivate the previous theme if clicked. If the previous + * theme doesn't exist, then there will be no close button. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @param string $slug_or_name Old theme's slug or name. + * @param bool|WP_Theme $old_theme WP_Theme instance of the old theme if it still exists. + */ + function _activate_theme_event_hook( $slug_or_name, $old_theme = false ) { + $this->_storage->previous_theme = ( false !== $old_theme ) ? + $old_theme->get_stylesheet() : + $slug_or_name; + + $this->_activate_plugin_event_hook(); + } + + /** + * Plugin activated hook. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @uses FS_Api + */ + function _activate_plugin_event_hook() { + $this->_logger->entrance( 'slug = ' . $this->_slug ); + + if ( ! $this->is_user_admin() ) { + return; + } + + $this->unregister_uninstall_hook(); + + // Clear API cache on activation. + FS_Api::clear_cache(); + + $is_premium_version_activation = $this->is_plugin() ? + ( current_filter() !== ( 'activate_' . $this->_free_plugin_basename ) ) : + $this->is_premium(); + + $this->_logger->info( 'Activating ' . ( $is_premium_version_activation ? 'premium' : 'free' ) . ' plugin version.' ); + + if ( $this->is_plugin() ) { + // This logic is relevant only to plugins since both the free and premium versions of a plugin can be active at the same time. + // 1. If running in the activation of the FREE module, get the basename of the PREMIUM. + // 2. If running in the activation of the PREMIUM module, get the basename of the FREE. + $other_version_basename = $is_premium_version_activation ? + $this->_free_plugin_basename : + $this->premium_plugin_basename(); + + if ( ! $this->_is_network_active ) { + /** + * Themes are always network activated, but the ACTUAL activation is per site. + * + * During the activation, the plugin isn't yet active, therefore, + * _is_network_active will be set to false even if it's a network level + * activation. So we need to fix that by looking at the is_network_admin() value. + * + * @author Vova Feldman + */ + $this->_is_network_active = ( + $this->_is_multisite_integrated && + fs_is_network_admin() + ); + } + + /** + * If the other module version is active, deactivate it. + * + * is_plugin_active() checks if the plugin is active on the site or the network level and + * deactivate_plugins() deactivates the plugin whether it's activated on the site or network level. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + if ( + is_plugin_active( $other_version_basename ) && + $this->apply_filters( 'deactivate_on_activation', true ) + ) { + deactivate_plugins( $other_version_basename ); + } + } + + if ( $this->is_registered() ) { + if ( $is_premium_version_activation ) { + $this->reconnect_locally(); + } + + + // Schedule re-activation event and sync. +// $this->sync_install( array(), true ); + $this->schedule_install_sync(); + + // If activating the premium module version, add an admin notice to congratulate for an upgrade completion. + if ( $is_premium_version_activation ) { + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'The upgrade of %s was successfully completed.', 'successful-version-upgrade-message' ), sprintf( '%s', $this->_plugin->title ) ), + $this->get_text_x_inline( 'W00t', + 'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!' + ); + } + } else if ( $this->is_anonymous() ) { + if ( isset( $this->_storage->is_anonymous_ms ) && $this->_storage->is_anonymous_ms['is'] ) { + $plugin_version = $this->_storage->is_anonymous_ms['version']; + $network = true; + } else { + $plugin_version = $this->_storage->is_anonymous['version']; + $network = false; + } + + /** + * Reset "skipped" click cache on the following: + * 1. Freemius DEV mode. + * 2. WordPress DEBUG mode. + * 3. If a plugin and the user skipped the exact same version before. + * + * @since 1.2.2.7 Ulrich Pogson (@grapplerulrich) asked to not reset the SKIPPED flag if the exact same THEME version was activated before unless the developer is running with WP_DEBUG on, or Freemius debug mode on (WP_FS__DEV_MODE). + * + * @todo 4. If explicitly asked to retry after every activation. + */ + if ( WP_FS__DEV_MODE || + ( + ( $this->is_plugin() || ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ) && + $this->get_plugin_version() == $plugin_version + ) + ) { + $this->reset_anonymous_mode( $network ); + } + } + + $is_trial_or_has_features_enabled_license = ( $this->is_trial() || $this->has_features_enabled_license() ); + + if ( $this->is_addon() && ! $is_trial_or_has_features_enabled_license ) { + /** + * When activating an add-on, try to also activate a license. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + if ( ! $this->_is_network_active ) { + $this->maybe_activate_addon_license(); + } else { + $this->maybe_network_activate_addon_license(); + } + + /** + * Avoid redirecting to the license activation screen after automatically activating an add-on license. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + $is_trial_or_has_features_enabled_license = ( $this->is_trial() || $this->has_features_enabled_license() ); + + if ( $is_trial_or_has_features_enabled_license && true === $this->_storage->require_license_activation ) { + $this->_storage->require_license_activation = false; + } + } + + if ( + $is_premium_version_activation && + ( + ( ! $this->is_registered() && $this->is_anonymous() ) || + ( + $this->is_registered() && + ! $is_trial_or_has_features_enabled_license + ) + ) + ) { + $this->_storage->require_license_activation = true; + } + + if ( ! isset( $this->_storage->is_plugin_new_install ) ) { + /** + * If no previous version of plugin's version exist, it means that it's either + * the first time that the plugin installed on the site, or the plugin was installed + * before but didn't have Freemius integrated. + * + * Since register_activation_hook() do NOT fires on updates since 3.1, and only fires + * on manual activation via the dashboard, is_plugin_activation() is TRUE + * only after immediate activation. + * + * @since 1.1.4 + * @link https://make.wordpress.org/core/2010/10/27/plugin-activation-hooks-no-longer-fire-for-updates/ + */ + $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version ); + } + + /** + * Also flush when activating the premium version so that even if Freemius was off before, the API + * connectivity test can be run again. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3.1 + */ + $has_api_connectivity = $this->has_api_connectivity( WP_FS__DEV_MODE || $is_premium_version_activation ); + + if ( ! $this->_anonymous_mode && + $has_api_connectivity && + ! $this->_isAutoInstall + ) { + // Store hint that the plugin was just activated to enable auto-redirection to settings. + set_transient( "fs_{$this->_module_type}_{$this->_slug}_activated", true, 60 ); + } + + /** + * Activation hook is executed after the plugin's main file is loaded, therefore, + * after the plugin was loaded. The logic is located at activate_plugin() + * ./wp-admin/includes/plugin.php. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9 + */ + $this->_storage->was_plugin_loaded = true; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + private function maybe_activate_addon_license() { + $parent_fs = $this->get_parent_instance(); + + if ( + ! is_object( $parent_fs ) || + ( ! $parent_fs->is_registered() && ! $parent_fs->is_network_registered() ) + ) { + // Try to activate a license only if the parent plugin is active and has a valid `install`. + return; + } + + $license = $this->get_active_parent_license(); + if ( ! is_object( $license ) ) { + return; + } + + if ( + $this->is_bundle_license_auto_activation_enabled() && + ! empty( $license->products ) + ) { + $this->activate_bundle_license( $license ); + + return; + } + + if ( ! $this->is_registered() ) { + // Opt in with a license key. + $this->opt_in( + $parent_fs->get_current_or_network_user()->email, + false, + false, + $license->secret_key + ); + } else { + // Activate the license. + $install = $this->get_api_site_scope()->call( + '/', + 'put', + array( 'license_key' => $this->apply_filters( 'license_key', $license->secret_key ) ) + ); + + if ( ! FS_Api::is_api_error( $install ) ) { + $this->_sync_addon_license( $this->get_id(), true ); + } + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param FS_Plugin_License $license + */ + private function maybe_network_activate_addon_license( $license = null ) { + $parent_fs = $this->get_parent_instance(); + if ( ! is_object( $parent_fs ) || ( ! $parent_fs->is_registered() && ! $parent_fs->is_network_registered() ) ) { + // Try to activate a license only if the parent plugin is active and has a valid `install`. + return; + } + + $license = ( ! is_null( $license ) ) ? + $license : + $this->get_active_parent_license(); + + if ( ! is_object( $license ) ) { + return; + } + + if ( + $this->is_bundle_license_auto_activation_enabled() && + ! empty( $license->products ) + ) { + $this->activate_bundle_license( $license ); + + return; + } + + if ( ! $this->is_network_registered() ) { + $sites = $this->get_sites_for_network_level_optin(); + + if ( count( $sites ) > $license->left() ) { + // If the add-on is network active, try to activate the license only if it can be activated on all sites. + return; + } + + // Opt in with a license key. + $this->opt_in( + $parent_fs->get_user()->email, + false, + false, + $license->secret_key, + false, + false, + false, + null, + $sites + ); + } else { + $blog_2_install_map = array(); + $site_ids = array(); + + $all_sites = Freemius::get_sites(); + + foreach ( $all_sites as $site ) { + $blog_id = Freemius::get_site_blog_id( $site ); + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( is_object( $install ) && FS_Plugin_License::is_valid_id( $install->license_id ) ) { + // Skip license activation for installs that are already associated with a license. + continue; + } + + if ( is_object( $install ) ) { + $blog_2_install_map[ $blog_id ] = $install; + } else { + $site_ids[] = $blog_id; + } + } + + if ( ( count( $blog_2_install_map ) + count( $site_ids ) ) > $license->left() ) { + return; + } + + $user = $this->get_current_or_network_user(); + + if ( ! empty( $blog_2_install_map ) ) { + $result = $this->activate_license_on_many_installs( $user, $license->secret_key, $blog_2_install_map ); + + if ( true !== $result ) { + return; + } + } + + if ( ! empty( $site_ids ) ) { + $this->activate_license_on_many_sites( $user, $license->secret_key, $site_ids ); + } + } + } + + /** + * Tries to activate a bundle license for all supported products if the current product is activated with a bundle license. This is called after activating an available license (not via the license activation dialog but by clicking on a license activation button) for a product via its "Account" page. + * + * @author Leo Fajardo (@leorw) + * @since 2.4.0 + * + * @param FS_Plugin_License $license + * @param array $sites + * @param int $blog_id + */ + private function maybe_activate_bundle_license( FS_Plugin_License $license = null, $sites = array(), $blog_id = 0 ) { + if ( ! is_object( $license ) && $this->has_active_valid_license() ) { + $license = $this->_license; + } + + if ( ! is_object( $license ) ) { + return; + } + + $parent_license = ( ! empty( $license->products ) ) ? + $license : + $this->get_active_parent_license( $license->secret_key ); + + if ( is_object( $parent_license ) ) { + $this->activate_bundle_license( $parent_license, $sites, $blog_id ); + } + } + + /** + * Try to activate a bundle license for all the bundle products installed on the site. + * (1) If a child product install already has a license, the bundle license won't be activated. + * (2) On multi-site networks, if the attempt to activate the bundle license is triggered from the network admin, the bundle license activation will only work for non-delegated sites and only if none of them is associated with a license. Even if one of the sites has the product installed with a license key, skip the bundle license activation for the product. + * (3) On multi-site networks, if the attempt to activate the bundle license is triggered from a site-level admin, only activate the license if the product is site-level activated or delegated, and the product installation is not yet associated with a license. + * + * @author Leo Fajardo (@leorw) + * @since 2.4.0 + * + * @param FS_Plugin_License $license + * @param array $sites + * @param int $current_blog_id + */ + private function activate_bundle_license( $license, $sites = array(), $current_blog_id = 0 ) { + $is_network_admin = fs_is_network_admin(); + + $installs_by_blog_map = array(); + $site_info_by_blog_map = array(); + + /** + * Try to activate the license for all supported products. + * + * @author Leo Fajardo + */ + foreach ( $license->products as $product_id ) { + $fs = self::get_instance_by_id( $product_id ); + + if ( ! is_object( $fs ) ) { + continue; + } + + if ( ! $fs->has_paid_plan() ) { + continue; + } + + if ( + ! $fs->is_addon() && + ! FS_Plan_Manager::instance()->has_paid_plan( $fs->_plans ) + ) { + /** + * The parent product can be free-only but can have its `has_paid_plan` flag set to `true` when + * there is a context bundle. + */ + continue; + } + + if ( $current_blog_id > 0 ) { + $fs->switch_to_blog( $current_blog_id ); + } + + if ( $fs->has_active_valid_license() ) { + continue; + } + + if ( ! $is_network_admin || $current_blog_id > 0 ) { + if ( $fs->is_network_active() && ! $fs->is_delegated_connection( $current_blog_id ) ) { + // Do not try to activate the license in the site level if the product is network active and the connection was not delegated. + continue; + } + } else { + if ( ! $fs->is_network_active() ) { + // Do not try to activate the license in the network level if the product is not network active. + continue; + } + + if ( $fs->is_network_delegated_connection() ) { + // Do not try to activate the license in the network level if the activation has been delegated to site admins. + continue; + } + + $has_install_with_license = false; + + // Collection of sites that have an install entity that is not activated with a license or non-delegated sites that have no install entity, or both types of site. + $filtered_sites = array(); + + if ( empty( $sites ) ) { + $all_sites = self::get_sites(); + + foreach ( $all_sites as $site ) { + $sites[] = array( 'blog_id' => self::get_site_blog_id( $site ) ); + } + } else { + // Populate the map here to avoid calling `$fs->get_site_info( $site );` in the other `for` loop below. + foreach ( $sites as $site ) { + if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) { + continue; + } + + $site_info_by_blog_map[ $site['blog_id'] ] = $site; + } + } + + foreach ( $sites as $site ) { + if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) { + continue; + } + + $blog_id = $site['blog_id']; + + if ( ! isset( $installs_by_blog_map[ $blog_id ] ) ) { + $installs_by_blog_map[ $blog_id ] = self::get_all_sites( $fs->get_module_type(), $blog_id ); + } + + $installs = $installs_by_blog_map[ $blog_id ]; + $install = null; + + if ( isset( $installs[ $fs->get_slug() ] ) ) { + $install = $installs[ $fs->get_slug() ]; + + if ( + is_object( $install ) && + ( + ! FS_Site::is_valid_id( $install->id ) || + ! FS_User::is_valid_id( $install->user_id ) || + ! FS_Plugin_Plan::is_valid_id( $install->plan_id ) + ) + ) { + $install = null; + } + } + + if ( + is_object( $install ) && + FS_Plugin_License::is_valid_id( $install->license_id ) + ) { + $has_install_with_license = true; + break; + } + + if ( $fs->is_site_delegated_connection( $blog_id ) ) { + // Site activation delegated, don't activate bundle license on the site in the network admin. + continue; + } + + if ( ! isset( $site_info_by_blog_map[ $blog_id ] ) ) { + $site_info_by_blog_map[ $blog_id ] = $fs->get_site_info( $site ); + } + + $filtered_sites[] = $site_info_by_blog_map[ $blog_id ]; + } + + if ( $has_install_with_license || empty( $filtered_sites ) ) { + // Do not try to activate the license at the network level if there's any install with a license or there's no site to activate the license on. + continue; + } + + $sites = $filtered_sites; + } + + $fs->activate_migrated_license( + $license->secret_key, + null, + null, + $sites, + ( $current_blog_id > 0 ? $current_blog_id : null ) + ); + } + } + + /** + * Returns a parent license that can be activated for the context product. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param string|null $license_key + * @param bool $flush + * + * @return FS_Plugin_License + */ + function get_active_parent_license( $license_key = null, $flush = true ) { + $parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable"; + + $fs = $this; + + if ( $this->is_addon() ) { + $parent_instance = $this->get_parent_instance(); + + if ( is_object( $parent_instance ) && $parent_instance->is_registered() ) { + $fs = $parent_instance; + } + } + + $foreign_licenses = $fs->get_foreign_licenses_info( + self::get_all_licenses( $this->get_parent_id() ) + ); + + if ( ! empty ( $foreign_licenses ) ) { + $foreign_licenses = array( + // Prefix with `+` to tell the server to include foreign licenses in the licenses collection. + 'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ), + 'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) ) + ); + + $parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint ); + } + + $result = $fs->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, $flush ); + + if ( + ! $this->is_api_result_object( $result, 'licenses' ) || + ! is_array( $result->licenses ) || + empty( $result->licenses ) + ) { + return null; + } + + $parent_license = null; + + if ( empty( $license_key ) ) { + $parent_license = $result->licenses[0]; + } else { + foreach ( $result->licenses as $license ) { + if ( $license_key === $license->secret_key ) { + $parent_license = $license; + break; + } + } + } + + if ( ! is_null( $parent_license ) ) { + $parent_license = new FS_Plugin_License( $parent_license ); + } + + return $parent_license; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @return array + */ + function get_sites_for_network_level_optin() { + $sites = array(); + $all_sites = self::get_sites(); + + foreach ( $all_sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + if ( ! $this->is_site_delegated_connection( $blog_id ) && + ! $this->is_installed_on_site( $blog_id ) + ) { + $sites[] = $this->get_site_info( $site ); + } + } + + return $sites; + } + + /** + * Delete account. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * + * @param bool $check_user Enforce checking if user have plugins activation privileges. + */ + function delete_account_event( $check_user = true ) { + $this->_logger->entrance( 'slug = ' . $this->_slug ); + + if ( $check_user && ! $this->is_user_admin() ) { + return; + } + + $this->do_action( 'before_account_delete' ); + + // Clear all admin notices. + $this->_admin_notices->clear_all_sticky( false ); + + $this->_delete_site( false ); + + $delete_network_common_data = true; + + if ( $this->_is_network_active ) { + $installs = $this->get_blog_install_map(); + + // Don't delete common network data unless no other installs left. + $delete_network_common_data = empty( $installs ); + } + + if ( $delete_network_common_data ) { + $this->_delete_plans( false ); + + $this->_delete_licenses( false ); + + // Delete add-ons related to plugin's account. + $this->_delete_account_addons( false ); + } + + // @todo Delete plans and licenses of add-ons. + + self::$_accounts->store(); + + /** + * IMPORTANT: + * Clear crons must be executed before clearing all storage. + * Otherwise, the cron will not be cleared. + */ + if ( $delete_network_common_data ) { + $this->clear_sync_cron(); + } + + $this->clear_install_sync_cron(); + + // Clear all storage data. + $this->_storage->clear_all( true, array( + 'is_delegated_connection', + 'connectivity_test', + 'is_on', + ), false ); + + // Send delete event. + $this->get_api_site_scope()->call( '/', 'delete' ); + + $this->do_action( 'after_account_delete' ); + } + + /** + * Delete network level account. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param bool $check_user Enforce checking if user have plugins activation privileges. + */ + function delete_network_account_event( $check_user = true ) { + $this->_logger->entrance( 'slug = ' . $this->_slug ); + + if ( $check_user && ! $this->is_user_admin() ) { + return; + } + + $this->do_action( 'before_network_account_delete' ); + + // Clear all admin notices. + $this->_admin_notices->clear_all_sticky(); + + $this->_delete_plans( false, false ); + + $this->_delete_licenses( false ); + + // Delete add-ons related to plugin's account. + $this->_delete_account_addons( false ); + + // @todo Delete plans and licenses of add-ons. + + self::$_accounts->store( true ); + + /** + * IMPORTANT: + * Clear crons must be executed before clearing all storage. + * Otherwise, the cron will not be cleared. + */ + $this->clear_sync_cron( true ); + $this->clear_install_sync_cron( true ); + + $sites = self::get_sites(); + + $install_ids = array(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + if ( $this->is_site_delegated_connection( $blog_id ) ) { + continue; + } + + $install_id = $this->_delete_site( true, $blog_id ); + + // Clear all storage data. + $this->_storage->clear_all( true, array( 'connectivity_test' ), $blog_id ); + + if ( FS_Site::is_valid_id( $install_id ) ) { + $install_ids[] = $install_id; + } + + switch_to_blog( $blog_id ); + + $this->do_action( 'after_account_delete' ); + + restore_current_blog(); + } + + $this->_storage->clear_all( true, array( + 'connectivity_test', + 'is_on', + ), true ); + + // Send delete event. + if ( ! empty( $install_ids ) ) { + $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', $install_ids ), 'delete' ); + } + + $this->do_action( 'after_network_account_delete' ); + } + + /** + * Plugin deactivation hook. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + */ + function _deactivate_plugin_hook() { + $this->_logger->entrance( 'slug = ' . $this->_slug ); + + if ( ! $this->is_user_admin() ) { + return; + } + + $is_network_deactivation = fs_is_network_admin(); + $storage_keys_for_removal = array(); + + $this->_admin_notices->clear_all_sticky(); + + $storage_keys_for_removal[] = 'sticky_optin_added'; + if ( isset( $this->_storage->sticky_optin_added ) ) { + unset( $this->_storage->sticky_optin_added ); + } + + if ( ! isset( $this->_storage->is_plugin_new_install ) ) { + // Remember that plugin was already installed. + $this->_storage->is_plugin_new_install = false; + } + + // Hook to plugin uninstall. + register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) ); + + $this->clear_module_main_file_cache(); + $this->clear_sync_cron( $this->_is_network_active ); + $this->clear_install_sync_cron(); + + if ( $this->is_registered() ) { + if ( $this->is_premium() && ! $this->has_active_valid_license() ) { + FS_Plugin_Updater::instance( $this )->delete_update_data(); + } + + if ( $is_network_deactivation ) { + // Send deactivation event. + $this->sync_installs( array( + 'is_active' => false, + ) ); + } else { + // Send deactivation event. + $this->sync_install( array( + 'is_active' => false, + ) ); + } + } else { + if ( ! $this->has_api_connectivity() ) { + // Reset connectivity test cache. + unset( $this->_storage->connectivity_test ); + + $storage_keys_for_removal[] = 'connectivity_test'; + } + } + + if ( $is_network_deactivation ) { + if ( isset( $this->_storage->sticky_optin_added_ms ) ) { + unset( $this->_storage->sticky_optin_added_ms ); + } + + if ( ! empty( $storage_keys_for_removal ) ) { + $sites = self::get_sites(); + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + foreach ( $storage_keys_for_removal as $key ) { + $this->_storage->remove( $key, false, $blog_id ); + } + + $this->_storage->save( $blog_id ); + } + } + } + + // Clear API cache on deactivation. + FS_Api::clear_cache(); + + $this->remove_sdk_reference(); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.6 + */ + private function remove_sdk_reference() { + global $fs_active_plugins; + + foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) { + if ( $this->_plugin_basename == $data->plugin_path ) { + unset( $fs_active_plugins->plugins[ $sdk_path ] ); + break; + } + } + + fs_fallback_to_newest_active_sdk(); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.3 + * + * @param bool $is_anonymous + * @param bool|int $network_or_blog_id Since 2.0.0 + */ + private function set_anonymous_mode( $is_anonymous = true, $network_or_blog_id = 0 ) { + // Store information regarding skip to try and opt-in the user + // again in the future. + $skip_info = array( + 'is' => $is_anonymous, + 'timestamp' => WP_FS__SCRIPT_START_TIME, + 'version' => $this->get_plugin_version(), + ); + + if ( true === $network_or_blog_id ) { + $this->_storage->is_anonymous_ms = $skip_info; + } else { + $this->_storage->store( 'is_anonymous', $skip_info, $network_or_blog_id ); + } + + $this->network_upgrade_mode_completed(); + + // Update anonymous mode cache. + $this->_is_anonymous = $is_anonymous; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id Site ID. + * @param int $user_id User ID. + * @param string $domain Site domain. + * @param string $path Site path. + * @param int $network_id Network ID. Only relevant on multi-network installations. + * @param array $meta Metadata. Used to set initial site options. + * + * @uses Freemius::is_license_network_active() to check if the context license was network activated by the super-admin. + * @uses Freemius::is_network_connected() to check if the super-admin network opted-in. + * @uses Freemius::is_network_anonymous() to check if the super-admin network skipped. + * @uses Freemius::is_network_delegated_connection() to check if the super-admin network delegated the connection to the site admins. + */ + function _after_new_blog_callback( $blog_id, $user_id, $domain, $path, $network_id, $meta ) { + $this->_logger->entrance(); + + if ( $this->is_premium() && + $this->is_network_connected() && + is_object( $this->_license ) && + $this->_license->can_activate( FS_Site::is_localhost_by_address( $domain ) ) && + $this->is_license_network_active( $blog_id ) + ) { + /** + * Running the premium version, the license was network activated, and the license can also be activated on the current site -> so try to opt-in with the license key. + */ + $current_blog_id = get_current_blog_id(); + $license = clone $this->_license; + + $this->switch_to_blog( $blog_id ); + + // Opt-in with network user. + $this->install_with_user( + $this->get_network_user(), + $license->secret_key, + false, + false, + false + ); + + if ( is_object( $this->_site ) ) { + if ( $this->_site->license_id == $license->id ) { + /** + * If the license was activated successfully, sync the license data from the remote server. + */ + $this->_license = $license; + $this->sync_site_license(); + } + } + + $this->switch_to_blog( $current_blog_id ); + + if ( is_object( $this->_site ) ) { + // Already connected (with or without a license), so no need to continue. + return; + } + } + + if ( $this->is_network_anonymous() ) { + /** + * Opt-in was network skipped so automatically skip the opt-in for the new site. + */ + $this->skip_site_connection( $blog_id ); + } else if ( $this->is_network_delegated_connection() ) { + /** + * Opt-in was network delegated so automatically delegate the opt-in for the new site's admin. + */ + $this->delegate_site_connection( $blog_id ); + } else if ( $this->is_network_connected() ) { + /** + * Opt-in was network activated so automatically opt-in with the network user and new site admin. + */ + $current_blog_id = get_current_blog_id(); + + $this->switch_to_blog( $blog_id ); + + // Opt-in with network user. + $this->install_with_user( + $this->get_network_user(), + false, + false, + false, + false + ); + + $this->switch_to_blog( $current_blog_id ); + } else { + /** + * If the super-admin mixed different options (connect, skip, delegated): + * a) If at least one site connection was delegated, then automatically delegate connection. + * b) Otherwise, it means that at least one site was skipped and at least one site was connected. For a simplified UX in the initial release of the multisite network integration, skip the connection for the newly created site. If the super-admin will want to opt-in they can still do that from the network level Account page. + */ + $has_delegated_site = false; + + $sites = self::get_sites(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + if ( $this->is_site_delegated_connection( $blog_id ) ) { + $has_delegated_site = true; + break; + } + } + + if ( $has_delegated_site ) { + $this->delegate_site_connection( $blog_id ); + } else { + $this->skip_site_connection( $blog_id ); + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.3 + * + * @param bool|int $network_or_blog_id Since 2.0.0. + */ + private function reset_anonymous_mode( $network_or_blog_id = 0 ) { + if ( true === $network_or_blog_id ) { + unset( $this->_storage->is_anonymous_ms ); + } else { + $this->_storage->remove( 'is_anonymous', true, $network_or_blog_id ); + } + + /** + * Ensure that this field is also "false", otherwise, if the current module's type is "theme" and the module + * has no menus, the opt-in popup will not be shown immediately (in this case, the user will have to click + * on the admin notice that contains the opt-in link in order to trigger the opt-in popup). + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + if ( ! $this->_is_network_active || + 0 === $network_or_blog_id || + get_current_blog_id() == $network_or_blog_id || + ( true === $network_or_blog_id && fs_is_network_admin() ) + ) { + $this->_is_anonymous = null; + } + } + + /** + * This is used to ensure that before redirecting to the opt-in page after resetting the anonymous mode or + * deleting the account in the network level, the URL of the page to redirect to is correct. + * + * @author Leo Fajardo (@leorw) + * + * @since 2.1.3 + */ + private function maybe_set_slug_and_network_menu_exists_flag() { + if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) { + $this->_menu->set_slug_and_network_menu_exists_flag( $this->_menu->has_menu() ? + $this->_menu->get_slug() : + $this->_slug + ); + } + } + + /** + * Clears the anonymous mode and redirects to the opt-in screen. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + */ + function connect_again() { + if ( ! $this->is_anonymous() ) { + return; + } + + $this->reset_anonymous_mode( fs_is_network_admin() ); + + $this->maybe_set_slug_and_network_menu_exists_flag(); + + fs_redirect( $this->get_activation_url() ); + } + + /** + * Skip account connect, and set anonymous mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.1 + * + * @param array|null $sites Since 2.0.0. Specific sites. + * @param bool $skip_all_network Since 2.0.0. If true, skip connection for all sites. + */ + function skip_connection( $sites = null, $skip_all_network = false ) { + $this->_logger->entrance(); + + $this->_admin_notices->remove_sticky( 'connect_account' ); + + if ( $skip_all_network ) { + $this->set_anonymous_mode( true, true ); + } + + if ( ! $skip_all_network && empty( $sites ) ) { + $this->skip_site_connection(); + } else { + $uids = array(); + + if ( $skip_all_network ) { + $this->set_anonymous_mode( true, true ); + + $sites = self::get_sites(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $this->skip_site_connection( $blog_id, false ); + $uids[] = $this->get_anonymous_id( $blog_id ); + } + } else if ( ! empty( $sites ) ) { + foreach ( $sites as $site ) { + $uids[] = $site['uid']; + $this->skip_site_connection( $site['blog_id'], false ); + } + } + + // Send anonymous skip event. + // No user identified info nor any tracking will be sent after the user skips the opt-in. + $this->get_api_plugin_scope()->call( 'skip.json', 'put', array( + 'uids' => $uids, + ) ); + } + + $this->network_upgrade_mode_completed(); + } + + /** + * Skip connection for specific site in the network. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int|null $blog_id + * @param bool $send_skip + */ + private function skip_site_connection( $blog_id = null, $send_skip = true ) { + $this->_logger->entrance(); + + $this->_admin_notices->remove_sticky( 'connect_account', $blog_id ); + + $this->set_anonymous_mode( true, $blog_id ); + + if ( $send_skip ) { + $this->get_api_plugin_scope()->call( 'skip.json', 'put', array( + 'uids' => array( $this->get_anonymous_id( $blog_id ) ), + ) ); + } + } + + /** + * Plugin version update hook. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + */ + private function update_plugin_version_event() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + return; + } + + $this->schedule_install_sync(); +// $this->sync_install( array(), true ); + } + + /** + * Generate an MD5 signature of a plugins collection. + * This helper methods used to identify changes in a plugins collection. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param array [string]array $plugins + * + * @return string + */ + private function get_plugins_thumbprint( $plugins ) { + ksort( $plugins ); + + $thumbprint = ''; + foreach ( $plugins as $basename => $data ) { + $thumbprint .= $data['slug'] . ',' . + $data['Version'] . ',' . + ( $data['is_active'] ? '1' : '0' ) . ';'; + } + + return md5( $thumbprint ); + } + + /** + * Return a list of modified plugins since the last sync. + * + * Note: + * There's no point to store a plugins counter since even if the number of + * plugins didn't change, we still need to check if the versions are all the + * same and the activity state is similar. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.8 + * + * @return array|false + */ + private function get_plugins_data_for_api() { + // Alias. + $site_active_plugins_option_name = 'active_plugins'; + $network_plugins_option_name = 'all_plugins'; + + /** + * Collection of all site level active plugins. + */ + $site_active_plugins_cache = self::$_accounts->get_option( $site_active_plugins_option_name ); + + if ( ! is_object( $site_active_plugins_cache ) ) { + $site_active_plugins_cache = (object) array( + 'timestamp' => '', + 'md5' => '', + 'plugins' => array(), + ); + } + + $time = time(); + + if ( ! empty( $site_active_plugins_cache->timestamp ) && + ( $time - $site_active_plugins_cache->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC + ) { + // Don't send plugin updates if last update was in the past 5 min. + return false; + } + + // Write timestamp to lock the logic. + $site_active_plugins_cache->timestamp = $time; + self::$_accounts->set_option( $site_active_plugins_option_name, $site_active_plugins_cache, true ); + + // Reload options from DB. + self::$_accounts->load( true ); + $site_active_plugins_cache = self::$_accounts->get_option( $site_active_plugins_option_name ); + + if ( $time != $site_active_plugins_cache->timestamp ) { + // If timestamp is different, then another thread captured the lock. + return false; + } + + /** + * Collection of all plugins (network level). + */ + $network_plugins_cache = self::$_accounts->get_option( $network_plugins_option_name ); + + if ( ! is_object( $network_plugins_cache ) ) { + $network_plugins_cache = (object) array( + 'timestamp' => '', + 'md5' => '', + 'plugins' => array(), + ); + } + + // Check if there's a change in plugins. + $network_plugins = self::get_network_plugins(); + $site_active_plugins = self::get_site_active_plugins(); + + $network_plugins_thumbprint = $this->get_plugins_thumbprint( $network_plugins ); + $site_active_plugins_thumbprint = $this->get_plugins_thumbprint( $site_active_plugins ); + + // Check if plugins status changed (version or active/inactive). + $network_plugins_changed = ( $network_plugins_cache->md5 !== $network_plugins_thumbprint ); + $site_active_plugins_changed = ( $site_active_plugins_cache->md5 !== $site_active_plugins_thumbprint ); + + if ( ! $network_plugins_changed && + ! $site_active_plugins_changed + ) { + // No changes. + return array(); + } + + $plugins_update_data = array(); + + foreach ( $network_plugins_cache->plugins as $basename => $data ) { + if ( ! isset( $network_plugins[ $basename ] ) ) { + // Plugin uninstalled. + $uninstalled_plugin_data = $data; + $uninstalled_plugin_data['is_active'] = false; + $uninstalled_plugin_data['is_uninstalled'] = true; + $plugins_update_data[] = $uninstalled_plugin_data; + + unset( $network_plugins[ $basename ] ); + + unset( $network_plugins_cache->plugins[ $basename ] ); + unset( $site_active_plugins_cache->plugins[ $basename ] ); + + continue; + } + + $was_active = $data['is_active'] || + ( isset( $site_active_plugins_cache->plugins[ $basename ] ) && + true === $site_active_plugins_cache->plugins[ $basename ]['is_active'] ); + $is_active = $network_plugins[ $basename ]['is_active'] || + ( isset( $site_active_plugins[ $basename ] ) && + $site_active_plugins[ $basename ]['is_active'] ); + + if ( ! isset( $site_active_plugins_cache->plugins[ $basename ] ) && + isset( $site_active_plugins[ $basename ] ) + ) { + // Plugin was site level activated. + $site_active_plugins_cache->plugins[ $basename ] = $network_plugins[ $basename ]; + $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true; + } else if ( isset( $site_active_plugins_cache->plugins[ $basename ] ) && + ! isset( $site_active_plugins[ $basename ] ) + ) { + // Plugin was site level deactivated. + unset( $site_active_plugins_cache->plugins[ $basename ] ); + } + + $prev_version = $data['version']; + $current_version = $network_plugins[ $basename ]['Version']; + + if ( $was_active !== $is_active || $prev_version !== $current_version ) { + // Plugin activated or deactivated, or version changed. + + if ( $was_active !== $is_active ) { + if ( $data['is_active'] != $network_plugins[ $basename ]['is_active'] ) { + $network_plugins_cache->plugins[ $basename ]['is_active'] = $data['is_active']; + } + } + + if ( $prev_version !== $current_version ) { + $network_plugins_cache->plugins[ $basename ]['Version'] = $current_version; + } + + $updated_plugin_data = $data; + $updated_plugin_data['is_active'] = $is_active; + $updated_plugin_data['version'] = $current_version; + $updated_plugin_data['title'] = $network_plugins[ $basename ]['Name']; + $plugins_update_data[] = $updated_plugin_data; + } + } + + // Find new plugins that weren't yet seen before. + foreach ( $network_plugins as $basename => $data ) { + if ( ! isset( $network_plugins_cache->plugins[ $basename ] ) ) { + // New plugin. + $new_plugin = array( + 'slug' => $data['slug'], + 'version' => $data['Version'], + 'title' => $data['Name'], + 'is_active' => $data['is_active'], + 'is_uninstalled' => false, + ); + + $network_plugins_cache->plugins[ $basename ] = $new_plugin; + + $is_site_level_active = ( + isset( $site_active_plugins[ $basename ] ) && + $site_active_plugins[ $basename ]['is_active'] + ); + + /** + * If not network active, set the activity status based on the site-level plugin status. + */ + if ( ! $new_plugin['is_active'] ) { + $new_plugin['is_active'] = $is_site_level_active; + } + + $plugins_update_data[] = $new_plugin; + + if ( isset( $site_active_plugins[ $basename ] ) ) { + $site_active_plugins_cache->plugins[ $basename ] = $new_plugin; + $site_active_plugins_cache->plugins[ $basename ]['is_active'] = $is_site_level_active; + } + } + } + + $site_active_plugins_cache->md5 = $site_active_plugins_thumbprint; + $site_active_plugins_cache->timestamp = $time; + self::$_accounts->set_option( $site_active_plugins_option_name, $site_active_plugins_cache, true ); + + $network_plugins_cache->md5 = $network_plugins_thumbprint; + $network_plugins_cache->timestamp = $time; + self::$_accounts->set_option( $network_plugins_option_name, $network_plugins_cache, true ); + + return $plugins_update_data; + } + + /** + * Return a list of modified themes since the last sync. + * + * Note: + * There's no point to store a themes counter since even if the number of + * themes didn't change, we still need to check if the versions are all the + * same and the activity state is similar. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.8 + * + * @return array|false + */ + private function get_themes_data_for_api() { + // Alias. + $option_name = 'all_themes'; + + $all_cached_themes = self::$_accounts->get_option( $option_name ); + + if ( ! is_object( $all_cached_themes ) ) { + $all_cached_themes = (object) array( + 'timestamp' => '', + 'md5' => '', + 'themes' => array(), + ); + } + + $time = time(); + + if ( ! empty( $all_cached_themes->timestamp ) && + ( $time - $all_cached_themes->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC + ) { + // Don't send theme updates if last update was in the past 5 min. + return false; + } + + // Write timestamp to lock the logic. + $all_cached_themes->timestamp = $time; + self::$_accounts->set_option( $option_name, $all_cached_themes, true ); + + // Reload options from DB. + self::$_accounts->load( true ); + $all_cached_themes = self::$_accounts->get_option( $option_name ); + + if ( $time != $all_cached_themes->timestamp ) { + // If timestamp is different, then another thread captured the lock. + return false; + } + + // Get active theme. + $active_theme = wp_get_theme(); + $active_theme_stylesheet = $active_theme->get_stylesheet(); + + // Check if there's a change in themes. + $all_themes = wp_get_themes(); + + // Check if themes changed. + ksort( $all_themes ); + + $themes_signature = ''; + foreach ( $all_themes as $slug => $data ) { + $is_active = ( $slug === $active_theme_stylesheet ); + $themes_signature .= $slug . ',' . + $data->version . ',' . + ( $is_active ? '1' : '0' ) . ';'; + } + + // Check if themes status changed (version or active/inactive). + $themes_changed = ( $all_cached_themes->md5 !== md5( $themes_signature ) ); + + $themes_update_data = array(); + + if ( $themes_changed ) { + // Change in themes, report changes. + + // Update existing themes info. + foreach ( $all_cached_themes->themes as $slug => $data ) { + $is_active = ( $slug === $active_theme_stylesheet ); + + if ( ! isset( $all_themes[ $slug ] ) ) { + // Plugin uninstalled. + $uninstalled_theme_data = $data; + $uninstalled_theme_data['is_active'] = false; + $uninstalled_theme_data['is_uninstalled'] = true; + $themes_update_data[] = $uninstalled_theme_data; + + unset( $all_themes[ $slug ] ); + unset( $all_cached_themes->themes[ $slug ] ); + } else if ( $data['is_active'] !== $is_active || + $data['version'] !== $all_themes[ $slug ]->version + ) { + // Plugin activated or deactivated, or version changed. + + $all_cached_themes->themes[ $slug ]['is_active'] = $is_active; + $all_cached_themes->themes[ $slug ]['version'] = $all_themes[ $slug ]->version; + + $themes_update_data[] = $all_cached_themes->themes[ $slug ]; + } + } + + // Find new themes that weren't yet seen before. + foreach ( $all_themes as $slug => $data ) { + if ( ! isset( $all_cached_themes->themes[ $slug ] ) ) { + $is_active = ( $slug === $active_theme_stylesheet ); + + // New plugin. + $new_plugin = array( + 'slug' => $slug, + 'version' => $data->version, + 'title' => $data->name, + 'is_active' => $is_active, + 'is_uninstalled' => false, + ); + + $themes_update_data[] = $new_plugin; + $all_cached_themes->themes[ $slug ] = $new_plugin; + } + } + + $all_cached_themes->md5 = md5( $themes_signature ); + $all_cached_themes->timestamp = time(); + self::$_accounts->set_option( $option_name, $all_cached_themes, true ); + } + + return $themes_update_data; + } + + /** + * Get site data for API install request. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.2 + * + * @param string[] $override + * @param bool $include_plugins Since 1.1.8 by default include plugin changes. + * @param bool $include_themes Since 1.1.8 by default include plugin changes. + * @param bool $include_blog_data Since 2.3.0 by default include the current blog's data (language, charset, title, and URL). + * + * @return array + */ + private function get_install_data_for_api( + array $override, + $include_plugins = true, + $include_themes = true, + $include_blog_data = true + ) { + if ( $this->is_extensions_tracking_allowed() ) { + if ( ! defined( 'WP_FS__TRACK_PLUGINS' ) || false !== WP_FS__TRACK_PLUGINS ) { + /** + * @since 1.1.8 Also send plugin updates. + */ + if ( $include_plugins && ! isset( $override['plugins'] ) ) { + $plugins = $this->get_plugins_data_for_api(); + if ( ! empty( $plugins ) ) { + $override['plugins'] = $plugins; + } + } + } + + if ( ! defined( 'WP_FS__TRACK_THEMES' ) || false !== WP_FS__TRACK_THEMES ) { + /** + * @since 1.1.8 Also send themes updates. + */ + if ( $include_themes && ! isset( $override['themes'] ) ) { + $themes = $this->get_themes_data_for_api(); + if ( ! empty( $themes ) ) { + $override['themes'] = $themes; + } + } + } + } + + $versions = $this->get_versions(); + + $blog_data = $include_blog_data ? + array( + 'language' => get_bloginfo( 'language' ), + 'charset' => get_bloginfo( 'charset' ), + 'title' => get_bloginfo( 'name' ), + 'url' => get_site_url(), + ) : + array(); + + return array_merge( $versions, $blog_data, array( + 'version' => $this->get_plugin_version(), + 'is_premium' => $this->is_premium(), + // Special params. + 'is_active' => true, + 'is_disconnected' => $this->is_tracking_prohibited(), + 'is_uninstalled' => false, + ), $override ); + } + + /** + * Update installs details. + * + * @todo V1 of multiste network support doesn't support plugin and theme data sending. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string[] string $override + * @param bool $only_diff + * @param bool $include_plugins Since 1.1.8 by default include plugin changes. + * @param bool $include_themes Since 1.1.8 by default include plugin changes. + * + * @return array + */ + private function get_installs_data_for_api( + array $override, + $only_diff = false, + $include_plugins = true, + $include_themes = true + ) { + /** + * @since 1.1.8 Also send plugin updates. + */ +// if ( $include_plugins && ! isset( $override['plugins'] ) ) { +// $plugins = $this->get_plugins_data_for_api(); +// if ( ! empty( $plugins ) ) { +// $override['plugins'] = $plugins; +// } +// } + /** + * @since 1.1.8 Also send themes updates. + */ +// if ( $include_themes && ! isset( $override['themes'] ) ) { +// $themes = $this->get_themes_data_for_api(); +// if ( ! empty( $themes ) ) { +// $override['themes'] = $themes; +// } +// } + + // Common properties. + $versions = $this->get_versions(); + $common = array_merge( $versions, array( + 'version' => $this->get_plugin_version(), + 'is_premium' => $this->is_premium(), + ), $override ); + + + $is_common_diff_for_any_site = false; + $common_diff_union = array(); + + $installs_data = array(); + + $sites = self::get_sites(); + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( is_object( $install ) ) { + if ( $install->user_id != $this->_user->id ) { + // Install belongs to a different owner. + continue; + } + + if ( ! $this->is_premium() && $install->is_tracking_prohibited() ) { + // Don't send updates regarding opted-out installs. + continue; + } + + $install_data = $this->get_site_info( $site ); + + $uid = $install_data['uid']; + + unset( $install_data['blog_id'] ); + unset( $install_data['uid'] ); + + $install_data['is_disconnected'] = $install->is_disconnected; + $install_data['is_active'] = $this->is_active_for_site( $blog_id ); + $install_data['is_uninstalled'] = $install->is_uninstalled; + + $common_diff = null; + $is_common_diff = false; + if ( $only_diff ) { + $install_data = $this->get_install_diff_for_api( $install_data, $install, $override ); + $common_diff = $this->get_install_diff_for_api( $common, $install, $override ); + + $is_common_diff = ! empty( $common_diff ); + + if ( $is_common_diff ) { + foreach ( $common_diff as $k => $v ) { + if ( ! isset( $common_diff_union[ $k ] ) ) { + $common_diff_union[ $k ] = $v; + } + } + } + + $is_common_diff_for_any_site = $is_common_diff_for_any_site || $is_common_diff; + } + + if ( ! empty( $install_data ) || $is_common_diff ) { + // Add install ID and site unique ID. + $install_data['id'] = $install->id; + $install_data['uid'] = $uid; + + $installs_data[] = $install_data; + } + } + } + + restore_current_blog(); + + if ( 0 < count( $installs_data ) && ( $is_common_diff_for_any_site || ! $only_diff ) ) { + if ( ! $only_diff ) { + $installs_data[] = $common; + } else if ( ! empty( $common_diff_union ) ) { + $installs_data[] = $common_diff_union; + } + } + + foreach ( $installs_data as &$data ) { + $data = (object) $data; + } + + return $installs_data; + } + + /** + * Compare site actual data to the stored install data and return the differences for an API data sync. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param array $site + * @param FS_Site $install + * @param string[] string $override + * + * @return array + */ + private function get_install_diff_for_api( $site, $install, $override = array() ) { + $diff = array(); + $special = array(); + $special_override = false; + + foreach ( $site as $p => $v ) { + if ( property_exists( $install, $p ) ) { + if ( ( is_bool( $install->{$p} ) || ! empty( $install->{$p} ) ) && + $install->{$p} != $v + ) { + $install->{$p} = $v; + $diff[ $p ] = $v; + } + } else { + $special[ $p ] = $v; + + if ( isset( $override[ $p ] ) || + 'plugins' === $p || + 'themes' === $p + ) { + $special_override = true; + } + } + } + + if ( $special_override || 0 < count( $diff ) ) { + // Add special params only if has at least one + // standard param, or if explicitly requested to + // override a special param or a param which is not exist + // in the install object. + $diff = array_merge( $diff, $special ); + } + + return $diff; + } + + /** + * Update install only if changed. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string[] string $override + * @param bool $flush + * + * @return false|object|string + */ + private function send_install_update( $override = array(), $flush = false ) { + $this->_logger->entrance(); + + $check_properties = $this->get_install_data_for_api( $override ); + + if ( $flush ) { + $params = $check_properties; + } else { + $params = $this->get_install_diff_for_api( $check_properties, $this->_site, $override ); + } + + $keepalive_only_update = false; + if ( empty( $params ) ) { + $keepalive_only_update = $this->should_send_keepalive_update(); + + if ( ! $keepalive_only_update ) { + /** + * There are no updates to send including keepalive. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + return false; + } + } + + if ( ! $keepalive_only_update ) { + /** + * Do not update the last install sync timestamp after a keepalive-only call since there were no actual + * updates sent. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + if ( ! is_multisite() ) { + // Update last install sync timestamp. + $this->set_cron_execution_timestamp( 'install_sync' ); + } + + $params['uid'] = $this->get_anonymous_id(); + } + + $this->set_keepalive_timestamp(); + + // Send updated values to FS. + $site = $this->get_api_site_scope()->call( '/', 'put', $params ); + + if ( ! $keepalive_only_update && $this->is_api_result_entity( $site ) ) { + /** + * Do not clear scheduled sync after a keepalive-only call since there were no actual updates sent. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + if ( ! is_multisite() ) { + // I successfully sent install update, clear scheduled sync if exist. + $this->clear_install_sync_cron(); + } + } + + return $site; + } + + /** + * Update installs only if changed. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param string[] string $override + * @param bool $flush + * + * @return false|object|string + */ + private function send_installs_update( $override = array(), $flush = false ) { + $this->_logger->entrance(); + + $installs_data = $this->get_installs_data_for_api( $override, ! $flush ); + + $keepalive_only_update = false; + if ( empty( $installs_data ) ) { + /** + * Pass `true` to use the network level storage since the update is for many installs. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + $keepalive_only_update = $this->should_send_keepalive_update( true ); + + if ( ! $keepalive_only_update ) { + /** + * There are no updates to send including keepalive. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + return false; + } + } + + if ( ! $keepalive_only_update ) { + // Update last install sync timestamp if there were actual updates sent (i.e., not a keepalive-only call). + $this->set_cron_execution_timestamp( 'install_sync' ); + } + + /** + * Pass `true` to use the network level storage since the update is for many installs. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + $this->set_keepalive_timestamp( true ); + + // Send updated values to FS. + $result = $this->get_api_user_scope()->call( "/plugins/{$this->_plugin->id}/installs.json", 'put', $installs_data ); + + if ( ! $keepalive_only_update && $this->is_api_result_object( $result, 'installs' ) ) { + // I successfully sent installs update (there was an actual update sent and it's not just a keepalive-only call), clear scheduled sync if exist. + $this->clear_install_sync_cron(); + } + + return $result; + } + + /** + * @author Leo Fajardo (@leorw) + * + * @param bool|null $use_network_level_storage + * + * @return bool + */ + private function should_send_keepalive_update( $use_network_level_storage = null ) { + $keepalive_timestamp = $this->_storage->get( 'keepalive_timestamp', 0, $use_network_level_storage ); + + if ( $keepalive_timestamp < ( time() - WP_FS__TIME_WEEK_IN_SEC ) ) { + // If updated more than 7 days ago, trigger a keepalive and update the time it was triggered. + return true; + } else { + // If updated 7 days ago or less, "flip a coin", if the value is 7 trigger a keepalive and update the last time it was triggered. + return ( 7 == rand( 1, 7 ) ); + } + } + + /** + * Syncs the install owner's data if needed (i.e., if the install owner is different from the loaded user). + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + */ + private function maybe_sync_install_user() { + if ( $this->_user->id == $this->_site->user_id ) { + return; + } + + // Fetch user data and store if found. + $this->sync_user_by_current_install(); + } + + /** + * Update install only if changed. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string[] string $override + * @param bool $flush + */ + private function sync_install( $override = array(), $flush = false ) { + $this->_logger->entrance(); + + $site = $this->send_install_update( $override, $flush ); + + if ( false === $site ) { + // No sync required. + return; + } + + if ( ! $this->is_api_result_entity( $site ) ) { + // Failed to sync, don't update locally. + return; + } + + $this->_site = new FS_Site( $site ); + + $this->_store_site( true ); + } + + /** + * Update install only if changed. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string[] string $override + * @param bool $flush + */ + private function sync_installs( $override = array(), $flush = false ) { + $this->_logger->entrance(); + + $result = $this->send_installs_update( $override, $flush ); + + if ( false === $result ) { + // No sync required. + return; + } + + if ( ! $this->is_api_result_object( $result, 'installs' ) ) { + // Failed to sync, don't update locally. + return; + } + + $address_to_blog_map = $this->get_address_to_blog_map(); + + foreach ( $result->installs as $install ) { + $this->_site = new FS_Site( $install ); + + $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); + $blog_id = $address_to_blog_map[ $address ]; + + $this->_store_site( true, $blog_id ); + } + } + + /** + * Track install's custom event. + * + * IMPORTANT: + * Custom event tracking is currently only supported for specific clients. + * If you are not one of them, please don't use this method. If you will, + * the API will simply ignore your request based on the plugin ID. + * + * Need custom tracking for your plugin or theme? + * If you are interested in custom event tracking please contact yo@freemius.com + * for further details. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1 + * + * @param string $name Event name. + * @param array $properties Associative key/value array with primitive values only + * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s. + * @param bool $once If true, event will be tracked only once. IMPORTANT: Still trigger the API call. + * + * @return object|false Event data or FALSE on failure. + * + * @throws \Freemius_InvalidArgumentException + */ + public function track_event( $name, $properties = array(), $process_at = false, $once = false ) { + $this->_logger->entrance( http_build_query( array( 'name' => $name, 'once' => $once ) ) ); + + if ( ! $this->is_registered() ) { + return false; + } + + $event = array( 'type' => $name ); + + if ( is_numeric( $process_at ) && $process_at > time() ) { + $event['process_at'] = $process_at; + } + + if ( $once ) { + $event['once'] = true; + } + + if ( ! empty( $properties ) ) { + // Verify associative array values are primitive. + foreach ( $properties as $k => $v ) { + if ( ! is_scalar( $v ) ) { + throw new Freemius_InvalidArgumentException( 'The $properties argument must be an associative key/value array with primitive values only.' ); + } + } + + $event['properties'] = $properties; + } + + $result = $this->get_api_site_scope()->call( 'events.json', 'post', $event ); + + return $this->is_api_error( $result ) ? + false : + $result; + } + + /** + * Track install's custom event only once, but it still triggers the API call. + * + * IMPORTANT: + * Custom event tracking is currently only supported for specific clients. + * If you are not one of them, please don't use this method. If you will, + * the API will simply ignore your request based on the plugin ID. + * + * Need custom tracking for your plugin or theme? + * If you are interested in custom event tracking please contact yo@freemius.com + * for further details. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1 + * + * @param string $name Event name. + * @param array $properties Associative key/value array with primitive values only + * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s. + * + * @return object|false Event data or FALSE on failure. + * + * @throws \Freemius_InvalidArgumentException + * + * @user Freemius::track_event() + */ + public function track_event_once( $name, $properties = array(), $process_at = false ) { + return $this->track_event( $name, $properties, $process_at, true ); + } + + /** + * Plugin uninstall hook. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param bool $check_user Enforce checking if user have plugins activation privileges. + */ + function _uninstall_plugin_event( $check_user = true ) { + $this->_logger->entrance( 'slug = ' . $this->_slug ); + + if ( $check_user && ! current_user_can( 'activate_plugins' ) ) { + return; + } + + $params = array(); + $uninstall_reason = null; + if ( isset( $this->_storage->uninstall_reason ) ) { + $uninstall_reason = $this->_storage->uninstall_reason; + $params['reason_id'] = $uninstall_reason->id; + $params['reason_info'] = $uninstall_reason->info; + } + + if ( ! $this->is_registered() ) { + // Send anonymous uninstall event only if user submitted a feedback. + if ( isset( $uninstall_reason ) ) { + if ( isset( $uninstall_reason->is_anonymous ) && ! $uninstall_reason->is_anonymous ) { + $this->opt_in( false, false, false, false, true ); + } else { + $params['uid'] = $this->get_anonymous_id(); + $this->get_api_plugin_scope()->call( 'uninstall.json', 'put', $params ); + } + } + } else { + $params = array_merge( $params, array( + 'is_active' => false, + 'is_uninstalled' => true, + ) ); + + if ( $this->_is_network_active ) { + // Send uninstall event. + $this->send_installs_update( $params ); + } else { + // Send uninstall event. + $this->send_install_update( $params ); + } + } + + // @todo Decide if we want to delete plugin information from db. + } + + /** + * Set the basename of the current product and hook _activate_plugin_event_hook() to the activation action. + * + * @author Vova Feldman (@svovaf) + * @since 2.2.1 + * + * @param string $is_premium + * @param string $caller + * + * @return string + */ + function set_basename( $is_premium, $caller ) { + $basename = plugin_basename( $caller ); + + $current_basename = $is_premium ? + $this->_premium_plugin_basename : + $this->_free_plugin_basename; + + if ( $current_basename == $basename ) { + // Basename value set correctly. + return; + } + + if ( $is_premium ) { + $this->_premium_plugin_basename = $basename; + } else { + $this->_free_plugin_basename = $basename; + } + + $plugin_dir = dirname( $this->_plugin_dir_path ) . '/'; + + register_activation_hook( + $plugin_dir . $basename, + array( &$this, '_activate_plugin_event_hook' ) + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.1 + * @since 2.2.1 If the context product is in its premium version, use the current module's basename, even if it was renamed. + * + * @return string + */ + function premium_plugin_basename() { + if ( ! isset( $this->_premium_plugin_basename ) ) { + $this->_premium_plugin_basename = $this->is_premium() ? + // The product is premium, so use the current basename. + $this->_plugin_basename : + $this->get_premium_slug() . '/' . basename( $this->_free_plugin_basename ); + } + + return $this->_premium_plugin_basename; + } + + /** + * Uninstall plugin hook. Called only when connected his account with Freemius for active sites tracking. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + */ + public static function _uninstall_plugin_hook() { + self::_load_required_static(); + + self::$_static_logger->entrance(); + + if ( ! current_user_can( 'activate_plugins' ) ) { + return; + } + + $plugin_file = substr( current_filter(), strlen( 'uninstall_' ) ); + + self::$_static_logger->info( 'plugin = ' . $plugin_file ); + + define( 'WP_FS__UNINSTALL_MODE', true ); + + $fs = self::get_instance_by_file( $plugin_file ); + + if ( is_object( $fs ) ) { + $fs->remove_sdk_reference(); + + self::require_plugin_essentials(); + + if ( is_plugin_active( $fs->_free_plugin_basename ) || + is_plugin_active( $fs->premium_plugin_basename() ) + ) { + // Deleting Free or Premium plugin version while the other version still installed. + return; + } + + $fs->_uninstall_plugin_event(); + + $fs->do_action( 'after_uninstall' ); + } + } + + #---------------------------------------------------------------------------------- + #region Plugin Information + #---------------------------------------------------------------------------------- + + /** + * Load WordPress core plugin.php essential module. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.1 + */ + private static function require_plugin_essentials() { + if ( ! function_exists( 'get_plugins' ) ) { + self::$_static_logger->log( 'Including wp-admin/includes/plugin.php...' ); + + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + } + + /** + * Load WordPress core pluggable.php module. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.2 + */ + private static function require_pluggable_essentials() { + if ( ! function_exists( 'wp_get_current_user' ) ) { + require_once ABSPATH . 'wp-includes/pluggable.php'; + } + } + + /** + * Return plugin data. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param bool $reparse_plugin_metadata + * + * @return array + */ + function get_plugin_data( $reparse_plugin_metadata = false ) { + if ( ! isset( $this->_plugin_data ) || $reparse_plugin_metadata ) { + self::require_plugin_essentials(); + + if ( $this->is_plugin() ) { + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.0 When using get_plugin_data() do NOT translate plugin data. + * + * @link https://github.com/Freemius/wordpress-sdk/issues/77 + */ + $plugin_data = get_plugin_data( + $this->_plugin_main_file_path, + false, + false + ); + } else { + $theme_data = wp_get_theme(); + + if ( $this->_plugin_basename !== $theme_data->get_stylesheet() && is_child_theme() ) { + $parent_theme = $theme_data->parent(); + + if ( ( $parent_theme instanceof WP_Theme ) && $this->_plugin_basename === $parent_theme->get_stylesheet() ) { + $theme_data = $parent_theme; + } + } + + $plugin_data = array( + 'Name' => $theme_data->get( 'Name' ), + 'Version' => $theme_data->get( 'Version' ), + 'Author' => $theme_data->get( 'Author' ), + 'Description' => $theme_data->get( 'Description' ), + 'PluginURI' => $theme_data->get( 'ThemeURI' ), + ); + } + + $this->_plugin_data = $plugin_data; + } + + return $this->_plugin_data; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * @since 1.2.2.5 If slug not set load slug by module ID. + * + * @return string Plugin slug. + */ + function get_slug() { + if ( ! isset( $this->_slug ) ) { + $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); + $this->_slug = $id_slug_type_path_map[ $this->_module_id ]['slug']; + } + + return $this->_slug; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + * + * @return string + */ + function get_premium_slug() { + return is_object( $this->_plugin ) ? + $this->_plugin->premium_slug : + "{$this->_slug}-premium"; + } + + /** + * Retrieve the desired folder name for the product. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @return string Plugin slug. + */ + function get_target_folder_name() { + return $this->can_use_premium_code() ? + $this->_plugin->premium_slug : + $this->_slug; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @return number Plugin ID. + */ + function get_id() { + return $this->_plugin->id; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.2.4 + * + * @return number|null Bundle ID. + */ + function get_bundle_id() { + return ( isset( $this->_plugin->bundle_id ) && FS_Plugin::is_valid_id( $this->_plugin->bundle_id ) ) ? + $this->_plugin->bundle_id : + null; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @return string|null Bundle public key. + */ + function get_bundle_public_key() { + return isset( $this->_plugin->bundle_public_key ) ? + $this->_plugin->bundle_public_key : + null; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @return string Freemius SDK version + */ + function get_sdk_version() { + return $this->version; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @return number Parent plugin ID (if parent exist). + */ + function get_parent_id() { + return $this->is_addon() ? + $this->get_parent_instance()->get_id() : + $this->_plugin->id; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @return string + */ + function get_usage_tracking_terms_url() { + return $this->apply_filters( + 'usage_tracking_terms_url', + "https://freemius.com/wordpress/usage-tracking/{$this->_plugin->id}/{$this->_slug}/" + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @return string + */ + function get_eula_url() { + return $this->apply_filters( + 'eula_url', + "https://freemius.com/terms/{$this->_plugin->id}/{$this->_slug}/" + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @return string Plugin public key. + */ + function get_public_key() { + return $this->_plugin->public_key; + } + + /** + * Will be available only on sandbox mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @return mixed Plugin secret key. + */ + function get_secret_key() { + return $this->_plugin->secret_key; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.1 + * + * @return bool + */ + function has_secret_key() { + return ! empty( $this->_plugin->secret_key ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string|bool $premium_suffix + * + * @return string + */ + function get_plugin_name( $premium_suffix = false ) { + $this->_logger->entrance(); + + /** + * This `if-else` can be squeezed into a single `if` but I intentionally split it for code readability. + * + * @author Vova Feldman + */ + if ( ! isset( $this->_plugin_name ) ) { + // Name is not yet set. + $this->set_name( $premium_suffix ); + } else if ( + ! empty( $premium_suffix ) && + ( ! is_object( $this->_plugin ) || $this->_plugin->premium_suffix !== $premium_suffix ) + ) { + // Name is already set, but there's a change in the premium suffix. + $this->set_name( $premium_suffix ); + } + + return $this->_plugin_name; + } + + /** + * Calculates and stores the product's name. This helper function was created specifically for get_plugin_name() just to make the code clearer. + * + * @author Vova Feldman (@svovaf) + * @since 2.2.1 + * + * @param string $premium_suffix + */ + private function set_name( $premium_suffix = '' ) { + $plugin_data = $this->get_plugin_data(); + + // Get name. + $this->_plugin_name = $plugin_data['Name']; + + if ( is_string( $premium_suffix ) ) { + $premium_suffix = trim( $premium_suffix ); + + if ( ! empty( $premium_suffix ) ) { + // Check if plugin name contains " (premium)" or a custom suffix and remove it. + $suffix = ( ' ' . strtolower( $premium_suffix ) ); + $suffix_len = strlen( $suffix ); + + if ( strlen( $plugin_data['Name'] ) > $suffix_len && + $suffix === substr( strtolower( $plugin_data['Name'] ), - $suffix_len ) + ) { + $this->_plugin_name = substr( $plugin_data['Name'], 0, - $suffix_len ); + } + } + } + + $this->_logger->departure( 'Name = ' . $this->_plugin_name ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + * + * @param bool $reparse_plugin_metadata + * + * @return string + */ + function get_plugin_version( $reparse_plugin_metadata = false ) { + $this->_logger->entrance(); + + $plugin_data = $this->get_plugin_data( $reparse_plugin_metadata ); + + $this->_logger->departure( 'Version = ' . $plugin_data['Version'] ); + + return $this->apply_filters( 'plugin_version', $plugin_data['Version'] ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @return string + */ + function get_plugin_title() { + $this->_logger->entrance(); + + $title = $this->_plugin->title; + + return $this->apply_filters( 'plugin_title', $title ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @param bool $lowercase + * + * @return string + */ + function get_module_label( $lowercase = false ) { + $label = $this->is_addon() ? + $this->get_text_inline( 'Add-On', 'addon' ) : + ( $this->is_plugin() ? + $this->get_text_inline( 'Plugin', 'plugin' ) : + $this->get_text_inline( 'Theme', 'theme' ) ); + + if ( $lowercase ) { + $label = strtolower( $label ); + } + + return $label; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @return string + */ + function get_plugin_basename() { + if ( ! isset( $this->_plugin_basename ) ) { + if ( $this->is_plugin() ) { + $this->_plugin_basename = plugin_basename( $this->_plugin_main_file_path ); + } else { + $this->_plugin_basename = basename( dirname( $this->_plugin_main_file_path ) ); + } + } + + return $this->_plugin_basename; + } + + function get_plugin_folder_name() { + $this->_logger->entrance(); + + $plugin_folder = $this->_plugin_basename; + + while ( '.' !== dirname( $plugin_folder ) ) { + $plugin_folder = dirname( $plugin_folder ); + } + + $this->_logger->departure( 'Folder Name = ' . $plugin_folder ); + + return $plugin_folder; + } + + #endregion ------------------------------------------------------------------ + + /* Account + ------------------------------------------------------------------------------------------------------------------*/ + + /** + * Find plugin's slug by plugin's basename. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string $plugin_base_name + * + * @return false|string + */ + private static function find_slug_by_basename( $plugin_base_name ) { + $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() ); + + if ( ! array( $file_slug_map ) || ! isset( $file_slug_map[ $plugin_base_name ] ) ) { + return false; + } + + return $file_slug_map[ $plugin_base_name ]; + } + + /** + * Store the map between the plugin's basename to the slug. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + private function store_file_slug_map() { + $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() ); + + if ( ! array( $file_slug_map ) ) { + $file_slug_map = array(); + } + + if ( ! isset( $file_slug_map[ $this->_plugin_basename ] ) || + $file_slug_map[ $this->_plugin_basename ] !== $this->_slug + ) { + $file_slug_map[ $this->_plugin_basename ] = $this->_slug; + self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true ); + } + } + + /** + * @return array[number]FS_User + */ + static function get_all_users() { + $users = self::maybe_get_entities_account_option( 'users', array() ); + + if ( ! is_array( $users ) ) { + $users = array(); + } + + return $users; + } + + /** + * @param string $module_type + * @param null|int $blog_id Since 2.0.0 + * + * @return array[string]FS_Site + */ + private static function get_all_sites( + $module_type = WP_FS__MODULE_TYPE_PLUGIN, + $blog_id = null + ) { + $sites = self::get_account_option( 'sites', $module_type, $blog_id ); + + if ( ! is_array( $sites ) ) { + $sites = array(); + } + + return $sites; + } + + /** + * @author Leo Fajardo (@leorw) + * + * @since 1.2.2 + * + * @param string $option_name + * @param string $module_type + * @param null|int $network_level_or_blog_id Since 2.0.0 + * + * @return mixed + */ + private static function get_account_option( $option_name, $module_type = null, $network_level_or_blog_id = null ) { + if ( ! is_null( $module_type ) && WP_FS__MODULE_TYPE_PLUGIN !== $module_type ) { + $option_name = $module_type . '_' . $option_name; + } + + return self::maybe_get_entities_account_option( $option_name, array(), $network_level_or_blog_id ); + } + + /** + * @author Leo Fajardo (@leorw) + * + * @since 1.2.2 + * + * @param string $option_name + * @param mixed $option_value + * @param bool $store + * @param null|int $network_level_or_blog_id Since 2.0.0 + */ + private function set_account_option( $option_name, $option_value, $store, $network_level_or_blog_id = null ) { + self::set_account_option_by_module( + $this->_module_type, + $option_name, + $option_value, + $store, + $network_level_or_blog_id + ); + } + + /** + * @author Vova Feldman (@svovaf) + * + * @since 1.2.2.7 + * + * @param string $module_type + * @param string $option_name + * @param mixed $option_value + * @param bool $store + * @param null|int $network_level_or_blog_id Since 2.0.0 + */ + private static function set_account_option_by_module( + $module_type, + $option_name, + $option_value, + $store, + $network_level_or_blog_id = null + ) { + if ( WP_FS__MODULE_TYPE_PLUGIN != $module_type ) { + $option_name = $module_type . '_' . $option_name; + } + + self::$_accounts->set_option( $option_name, $option_value, $store, $network_level_or_blog_id ); + } + + /** + * This method can also return non-entity or non-entities collection option like the `user_id_license_ids_map` option. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @param string $option_name + * @param mixed $default + * @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_SITE_LEVEL_PARAMS). + * + * @return mixed|FS_Plugin[]|FS_User[]|FS_Site[]|FS_Plugin_License[]|FS_Plugin_Plan[]|FS_Plugin_Tag[] + */ + private static function maybe_get_entities_account_option( $option_name, $default = null, $network_level_or_blog_id = null ) { + $option = self::$_accounts->get_option( $option_name, $default, $network_level_or_blog_id ); + + $class_name = ''; + + if ( fs_starts_with( $option_name, WP_FS__MODULE_TYPE_THEME . '_' ) ) { + $option_name = str_replace( WP_FS__MODULE_TYPE_THEME . '_', '', $option_name ); + } + + switch ( $option_name ) { + case 'plugins': + case 'themes': + case 'addons': + $class_name = FS_Plugin::get_class_name(); + break; + case 'users': + $class_name = FS_User::get_class_name(); + break; + case 'sites': + $class_name = FS_Site::get_class_name(); + break; + case 'licenses': + case 'all_licenses': + $class_name = FS_Plugin_License::get_class_name(); + break; + case 'plans': + $class_name = FS_Plugin_Plan::get_class_name(); + break; + case 'updates': + $class_name = FS_Plugin_Tag::get_class_name(); + break; + } + + if ( empty( $class_name ) ) { + return $option; + } + + return fs_get_entities( $option, $class_name ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param number|null $module_id + * + * @return FS_Plugin_License[] + */ + private static function get_all_licenses( $module_id = null ) { + $licenses = self::get_account_option( 'all_licenses' ); + + if ( ! is_array( $licenses ) ) { + $licenses = array(); + } + + if ( is_null( $module_id ) ) { + return $licenses; + } + + $licenses = isset( $licenses[ $module_id ] ) ? + $licenses[ $module_id ] : + array(); + + return $licenses; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @return array + */ + private static function get_all_licenses_by_module_type() { + $licenses = self::get_account_option( 'all_licenses' ); + + $licenses_by_module_type = array( + WP_FS__MODULE_TYPE_PLUGIN => array(), + WP_FS__MODULE_TYPE_THEME => array() + ); + + if ( ! is_array( $licenses ) ) { + return $licenses_by_module_type; + } + + foreach ( $licenses as $module_id => $module_licenses ) { + $fs = self::get_instance_by_id( $module_id ); + if ( false === $fs ) { + continue; + } + + $licenses_by_module_type[ $fs->_module_type ] = array_merge( $licenses_by_module_type[ $fs->_module_type ], $module_licenses ); + } + + return $licenses_by_module_type; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param number $module_id + * @param number|null $user_id + * + * @return array + */ + private static function get_user_id_license_ids_map( $module_id, $user_id = null ) { + $all_modules_user_id_license_ids_map = self::get_account_option( 'user_id_license_ids_map' ); + + if ( ! is_array( $all_modules_user_id_license_ids_map ) ) { + $all_modules_user_id_license_ids_map = array(); + } + + $user_id_license_ids_map = isset( $all_modules_user_id_license_ids_map[ $module_id ] ) ? + $all_modules_user_id_license_ids_map[ $module_id ] : + array(); + + if ( FS_User::is_valid_id( $user_id ) ) { + $user_id_license_ids_map = isset( $user_id_license_ids_map[ $user_id ] ) ? + $user_id_license_ids_map[ $user_id ] : + array(); + } + + return $user_id_license_ids_map; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param array $new_user_id_license_ids_map + * @param number $module_id + * @param number|null $user_id + */ + private static function store_user_id_license_ids_map( $new_user_id_license_ids_map, $module_id, $user_id = null ) { + $all_modules_user_id_license_ids_map = self::get_account_option( 'user_id_license_ids_map' ); + if ( ! is_array( $all_modules_user_id_license_ids_map ) ) { + $all_modules_user_id_license_ids_map = array(); + } + + if ( ! isset( $all_modules_user_id_license_ids_map[ $module_id ] ) ) { + $all_modules_user_id_license_ids_map[ $module_id ] = array(); + } + + if ( FS_User::is_valid_id( $user_id ) ) { + $all_modules_user_id_license_ids_map[ $module_id ][ $user_id ] = $new_user_id_license_ids_map; + } else { + $all_modules_user_id_license_ids_map[ $module_id ] = $new_user_id_license_ids_map; + } + + self::$_accounts->set_option( 'user_id_license_ids_map', $all_modules_user_id_license_ids_map, true ); + } + + /** + * Get a collection of the user's linked license IDs. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $user_id + * + * @return number[] + */ + private function get_user_linked_license_ids( $user_id ) { + return self::get_user_id_license_ids_map( $this->_module_id, $user_id ); + } + + /** + * Override the user's linked license IDs with a new IDs collection. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $user_id + * @param number[] $license_ids + */ + private function set_user_linked_license_ids( $user_id, array $license_ids ) { + self::store_user_id_license_ids_map( $license_ids, $this->_module_id, $user_id ); + } + + /** + * Link a specified license ID to a given user. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $license_id + * @param number $user_id + */ + private function link_license_2_user( $license_id, $user_id ) { + $license_ids = $this->get_user_linked_license_ids( $user_id ); + + if ( in_array( $license_id, $license_ids ) ) { + // License already linked. + return; + } + + $license_ids[] = $license_id; + + $this->set_user_linked_license_ids( $user_id, $license_ids ); + } + + /** + * @param string|bool $module_type + * + * @return FS_Plugin_Plan[] + */ + private static function get_all_plans( $module_type = false ) { + $plans = self::get_account_option( 'plans', $module_type ); + + if ( ! is_array( $plans ) ) { + $plans = array(); + } + + return $plans; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @return FS_Plugin_Tag[] + */ + private static function get_all_updates() { + $updates = self::maybe_get_entities_account_option( 'updates', array() ); + + if ( ! is_array( $updates ) ) { + $updates = array(); + } + + return $updates; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return array|false + */ + private static function get_all_addons() { + $addons = self::maybe_get_entities_account_option( 'addons', array() ); + + if ( ! is_array( $addons ) ) { + $addons = array(); + } + + return $addons; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return number[]|false + */ + private static function get_all_account_addons() { + $addons = self::$_accounts->get_option( 'account_addons', array() ); + + if ( ! is_array( $addons ) ) { + $addons = array(); + } + + return $addons; + } + + /** + * Check if user has connected his account (opted-in). + * + * Note: + * If the user opted-in and opted-out on a later stage, + * this will still return true. If you want to check if the + * user is currently opted-in, use: + * `$fs->is_registered() && $fs->is_tracking_allowed()` + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * @return bool + */ + function is_registered() { + return is_object( $this->_user ); + } + + /** + * Returns TRUE if the user opted-in and didn't disconnect (opt-out). + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + * + * @return bool + */ + function is_tracking_allowed() { + return ( is_object( $this->_site ) && $this->_site->is_tracking_allowed() ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.4.0 + * + * @return bool + */ + function is_bundle_license_auto_activation_enabled() { + return $this->is_addon() ? + ( is_object( $this->_parent ) && $this->_parent->is_bundle_license_auto_activation_enabled() ) : + $this->_is_bundle_license_auto_activation_enabled; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @return FS_Plugin + */ + function get_plugin() { + return $this->_plugin; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * + * @return FS_User + */ + function get_user() { + return $this->_user; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * + * @return FS_Site + */ + function get_site() { + return $this->_site; + } + + /** + * Get plugin add-ons. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @since 1.1.7.3 If not yet loaded, fetch data from the API. + * + * @param bool $flush + * + * @return FS_Plugin[]|false + */ + function get_addons( $flush = false ) { + $this->_logger->entrance(); + + if ( ! $this->_has_addons ) { + return false; + } + + $addons = $this->sync_addons( $flush ); + + return ( ! is_array( $addons ) || empty( $addons ) ) ? + false : + $addons; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return number[]|false + */ + function get_account_addons() { + $this->_logger->entrance(); + + $addons = self::get_all_account_addons(); + + if ( ! is_array( $addons ) || + ! isset( $addons[ $this->_plugin->id ] ) || + ! is_array( $addons[ $this->_plugin->id ] ) || + 0 === count( $addons[ $this->_plugin->id ] ) + ) { + return false; + } + + return $addons[ $this->_plugin->id ]; + } + + /** + * Check if user has any + * + * @author Vova Feldman (@svovaf) + * @since 1.1.6 + * + * @return bool + */ + function has_account_addons() { + $addons = $this->get_account_addons(); + + return is_array( $addons ) && ( 0 < count( $addons ) ); + } + + + /** + * Get add-on by ID (from local data). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param number $id + * + * @return FS_Plugin|false + */ + function get_addon( $id ) { + $this->_logger->entrance(); + + $addons = $this->get_addons(); + + if ( is_array( $addons ) ) { + foreach ( $addons as $addon ) { + if ( $id == $addon->id ) { + return $addon; + } + } + } + + return false; + } + + /** + * Get add-on by slug (from local data). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param string $slug + * + * @param bool $flush + * + * @return FS_Plugin|false + */ + function get_addon_by_slug( $slug, $flush = false ) { + $this->_logger->entrance(); + + $addons = $this->get_addons( $flush ); + + if ( is_array( $addons ) ) { + foreach ( $addons as $addon ) { + if ( $slug === $addon->slug ) { + return $addon; + } + } + } + + return false; + } + + /** + * @var array { + * @key number Add-on ID. + * @val object[] The add-on's plans and prices object. + * } + */ + private $plans_and_pricing_by_addon_id; + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @return array { + * @key number Add-on ID. + * @val object[] The add-on's plans and prices object. + * } + */ + function _get_addons_plans_and_pricing_map_by_id() { + if ( ! isset( $this->plans_and_pricing_by_addon_id ) ) { + $result = $this->get_api_plugin_scope()->get( $this->add_show_pending( "/addons/pricing.json?type=visible" ) ); + + $plans_and_pricing_by_addon_id = array(); + if ( $this->is_api_result_object( $result, 'addons' ) ) { + foreach ( $result->addons as $addon ) { + $plans_and_pricing_by_addon_id[ $addon->id ] = $addon->plans; + } + } + + $this->plans_and_pricing_by_addon_id = $plans_and_pricing_by_addon_id; + } + + return $this->plans_and_pricing_by_addon_id; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param number $addon_id + * @param bool $is_installed + * + * @return array + */ + function _get_addon_info( $addon_id, $is_installed ) { + $addon = $this->get_addon( $addon_id ); + + if ( ! is_object( $addon ) ) { + // Unexpected call. + return array(); + } + + $slug = $addon->slug; + + $addon_storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug ); + + if ( ! fs_is_network_admin() ) { + // Get blog-level activated installations. + $sites = self::maybe_get_entities_account_option( 'sites', array() ); + } else { + $sites = null; + + if ( $this->is_addon_activated( $addon_id ) && + $this->get_addon_instance( $addon_id )->is_network_active() + ) { + if ( FS_Site::is_valid_id( $addon_storage->network_install_blog_id ) ) { + // Get network-level activated installations. + $sites = self::maybe_get_entities_account_option( + 'sites', + array(), + $addon_storage->network_install_blog_id + ); + } + } + } + + $addon_info = array( + 'is_connected' => false, + 'slug' => $slug, + 'title' => $addon->title, + 'is_whitelabeled' => $addon_storage->is_whitelabeled + ); + + if ( ! $is_installed ) { + $plans_and_pricing_by_addon_id = $this->_get_addons_plans_and_pricing_map_by_id(); + + if ( isset( $plans_and_pricing_by_addon_id[ $addon_id ] ) ) { + $has_paid_plan = false; + $plans = $plans_and_pricing_by_addon_id[ $addon_id ]; + + if ( is_array( $plans ) && count( $plans ) > 0 ) { + foreach ( $plans as $plan ) { + if ( isset( $plan->pricing ) && + is_array( $plan->pricing ) && + count( $plan->pricing ) > 0 + ) { + $has_paid_plan = true; + break; + } + } + } + + $addon_info['has_paid_plan'] = $has_paid_plan; + } + } + + if ( ! is_array( $sites ) || ! isset( $sites[ $slug ] ) ) { + return $addon_info; + } + + $site = $sites[ $slug ]; + + $addon_info['is_connected'] = ( + ( $addon->parent_plugin_id == $this->get_id() ) && + is_object( $site ) && + FS_Site::is_valid_id( $site->id ) && + FS_User::is_valid_id( $site->user_id ) && + FS_Plugin_Plan::is_valid_id( $site->plan_id ) + ); + + if ( $addon_info['is_connected'] && $is_installed ) { + return $addon_info; + } + + $addon_info['site'] = $site; + + $plugins_data = self::maybe_get_entities_account_option( WP_FS__MODULE_TYPE_PLUGIN . 's', array() ); + if ( isset( $plugins_data[ $slug ] ) ) { + $plugin_data = $plugins_data[ $slug ]; + + $addon_info['version'] = $plugin_data->version; + } + + $all_plans = self::maybe_get_entities_account_option( 'plans', array() ); + if ( isset( $all_plans[ $slug ] ) ) { + $plans = $all_plans[ $slug ]; + + foreach ( $plans as $plan ) { + if ( $site->plan_id == Freemius::_decrypt( $plan->id ) ) { + $addon_info['plan_name'] = Freemius::_decrypt( $plan->name ); + $addon_info['plan_title'] = Freemius::_decrypt( $plan->title ); + break; + } + } + } + + $licenses = self::maybe_get_entities_account_option( 'all_licenses', array() ); + if ( is_array( $licenses ) && isset( $licenses[ $addon_id ] ) ) { + foreach ( $licenses[ $addon_id ] as $license ) { + if ( $license->id == $site->license_id ) { + $addon_info['license'] = $license; + break; + } + } + } + + if ( isset( $addon_info['license'] ) ) { + if ( isset( $addon_storage->subscriptions ) && + ! empty( $addon_storage->subscriptions ) + ) { + $addon_subscriptions = fs_get_entities( $addon_storage->subscriptions, FS_Subscription::get_class_name() ); + + foreach ( $addon_subscriptions as $subscription ) { + if ( $subscription->license_id == $site->license_id ) { + $addon_info['subscription'] = $subscription; + break; + } + } + } + } + + return $addon_info; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $user_id + * + * @return FS_User + */ + static function _get_user_by_id( $user_id ) { + self::$_static_logger->entrance( "user_id = {$user_id}" ); + + $users = self::get_all_users(); + + if ( is_array( $users ) ) { + if ( isset( $users[ $user_id ] ) && + $users[ $user_id ] instanceof FS_User && + $user_id == $users[ $user_id ]->id + ) { + return $users[ $user_id ]; + } + + // If user wasn't found by the key, iterate over all the users collection. + foreach ( $users as $user ) { + /** + * @var FS_User $user + */ + if ( $user_id == $user->id ) { + return $user; + } + } + } + + return null; + } + + /** + * Checks if a Freemius user_id is associated with a super-admin. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $user_id + * + * @return bool + */ + private static function is_super_admin( $user_id ) { + $is_super_admin = false; + + $user = self::_get_user_by_id( $user_id ); + + if ( $user instanceof FS_User && ! empty( $user->email ) ) { + self::require_pluggable_essentials(); + + $wp_user = get_user_by( 'email', $user->email ); + + if ( $wp_user instanceof WP_User ) { + $super_admins = get_super_admins(); + $is_super_admin = ( is_array( $super_admins ) && in_array( $wp_user->user_login, $super_admins ) ); + } + } + + return $is_super_admin; + } + + #---------------------------------------------------------------------------------- + #region Plans & Licensing + #---------------------------------------------------------------------------------- + + /** + * Check if running premium plugin code. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @return bool + */ + function is_premium() { + /** + * `$this->_plugin` will be `false` when `is_activation_mode` calls this method directly from the + * `register_constructor_hooks` method. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + return is_object( $this->_plugin ) ? + $this->_plugin->is_premium : + false; + } + + /** + * Get site's plan ID. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @return number + */ + function get_plan_id() { + return $this->_site->plan_id; + } + + /** + * Get site's plan title. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @return string + */ + function get_plan_title() { + $plan = $this->get_plan(); + + return is_object( $plan ) ? $plan->title : 'PLAN_TITLE'; + } + + /** + * Get site's plan name. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return string + */ + function get_plan_name() { + $plan = $this->get_plan(); + + return is_object( $plan ) ? $plan->name : 'PLAN_NAME'; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return FS_Plugin_Plan|false + */ + function get_plan() { + if ( ! is_object( $this->_site ) ) { + return false; + } + + return FS_Plugin_Plan::is_valid_id( $this->_site->plan_id ) ? + $this->_get_plan_by_id( $this->_site->plan_id ) : + false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * + * @return bool + */ + function is_trial() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() || ! is_object( $this->_site ) ) { + return false; + } + + return $this->_site->is_trial(); + } + + /** + * Check if currently in a trial with payment method (credit card or paypal). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + * + * @return bool + */ + function is_paid_trial() { + $this->_logger->entrance(); + + if ( ! $this->is_trial() ) { + return false; + } + + if ( ! $this->has_active_valid_license() ) { + return false; + } + + if ( $this->_site->trial_plan_id != $this->_license->plan_id ) { + return false; + } + + /** + * @var FS_Subscription $subscription + */ + $subscription = $this->_get_subscription( $this->_license->id ); + + return ( is_object( $subscription ) && $subscription->is_active() ); + } + + /** + * Check if trial already utilized. + * + * @since 1.0.9 + * + * @return bool + */ + function is_trial_utilized() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + return false; + } + + return $this->_site->is_trial_utilized(); + } + + /** + * Get trial plan information (if in trial). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool|FS_Plugin_Plan + */ + function get_trial_plan() { + $this->_logger->entrance(); + + if ( ! $this->is_trial() ) { + return false; + } + + // Try to load plan from local cache. + $trial_plan = $this->_get_plan_by_id( $this->_site->trial_plan_id ); + + if ( ! is_object( $trial_plan ) ) { + $trial_plan = $this->_fetch_site_plan( $this->_site->trial_plan_id ); + + /** + * If managed to fetch the plan, add it to the plans collection. + */ + if ( $trial_plan instanceof FS_Plugin_Plan ) { + if ( ! is_array( $this->_plans ) ) { + $this->_plans = array(); + } + + $this->_plans[] = $trial_plan; + $this->_store_plans(); + } + } + + if ( $trial_plan instanceof FS_Plugin_Plan ) { + return $trial_plan; + } + + /** + * If for some reason failed to get the trial plan, fallback to a dummy name and title. + */ + $trial_plan = new FS_Plugin_Plan(); + $trial_plan->id = $this->_site->trial_plan_id; + $trial_plan->name = 'pro'; + $trial_plan->title = 'Pro'; + + return $trial_plan; + } + + /** + * Check if the user has an activate, non-expired license on current plugin's install. + * + * @since 1.0.9 + * + * @return bool + */ + function is_paying() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + return false; + } + + if ( ! $this->has_paid_plan() ) { + return false; + } + + return ( + ! $this->is_trial() && + 'free' !== $this->get_plan_name() && + $this->has_active_valid_license() + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @return bool + */ + function is_free_plan() { + if ( ! $this->is_registered() ) { + return true; + } + + if ( ! $this->has_paid_plan() ) { + return true; + } + + return ( + 'free' === $this->get_plan_name() || + ! $this->has_features_enabled_license() + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @return bool + */ + function _has_premium_license() { + $this->_logger->entrance(); + + $premium_license = $this->_get_available_premium_license(); + + return ( false !== $premium_license ); + } + + /** + * Check if user has any licenses associated with the plugin (including expired or blocking). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.3 + * + * @param bool $including_foreign + * + * @return bool + */ + function has_any_license( $including_foreign = true ) { + if ( ! is_array( $this->_licenses ) || 0 === count( $this->_licenses ) ) { + return false; + } + + if ( $including_foreign ) { + return true; + } + + foreach ( $this->_licenses as $license ) { + if ( $this->_user->id == $license->user_id ) { + return true; + } + } + + return false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param bool|null $is_localhost + * + * @return FS_Plugin_License|false + */ + function _get_available_premium_license( $is_localhost = null ) { + $this->_logger->entrance(); + + $licenses = $this->get_available_premium_licenses( $is_localhost ); + if ( ! empty( $licenses ) ) { + return $licenses[0]; + } + + return false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param bool|null $is_localhost + * + * @return FS_Plugin_License[] + */ + function get_available_premium_licenses( $is_localhost = null ) { + $this->_logger->entrance(); + + $licenses = array(); + if ( ! $this->has_paid_plan() ) { + return $licenses; + } + + if ( is_array( $this->_licenses ) ) { + foreach ( $this->_licenses as $license ) { + if ( ! $license->can_activate( $is_localhost ) ) { + continue; + } + + $licenses[] = $license; + } + } + + return $licenses; + } + + /** + * Sync local plugin plans with remote server. + * + * IMPORTANT: If for some reason a site is associated with deleted plan, we'll preserve the plan's information and append it as the last plan. This means that if plan is deleted, the is_plan() method will ALWAYS return true for any given argument (it becomes the most inclusive plan). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @return FS_Plugin_Plan[]|object + */ + function _sync_plans() { + $plans = $this->_fetch_plugin_plans(); + + if ( $this->is_array_instanceof( $plans, 'FS_Plugin_Plan' ) ) { + $plans_map = array(); + foreach ( $plans as $plan ) { + $plans_map[ $plan->id ] = true; + } + + $plans_ids_to_keep = $this->get_plans_ids_associated_with_installs(); + + foreach ( $plans_ids_to_keep as $plan_id ) { + if ( isset( $plans_map[ $plan_id ] ) ) { + continue; + } + + $missing_plan = self::_get_plan_by_id( $plan_id ); + + if ( is_object( $missing_plan ) ) { + $plans[] = $missing_plan; + } + } + + $this->_plans = $plans; + $this->_store_plans(); + } + + $this->do_action( 'after_plans_sync', $plans ); + + return $this->_plans; + } + + /** + * Check if specified plan exists locally. If not, fetch it and store it. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $plan_id + * + * @return \FS_Plugin_Plan|object The plan entity or the API error object on failure. + */ + private function sync_plan_if_not_exist( $plan_id ) { + $plan = self::_get_plan_by_id( $plan_id ); + + if ( is_object( $plan ) ) { + // Plan already exists. + return $plan; + } + + $plan = $this->fetch_plan_by_id( $plan_id ); + + if ( $plan instanceof FS_Plugin_Plan ) { + $this->_plans[] = $plan; + $this->_store_plans(); + + return $plan; + } + + return $plan; + } + + /** + * Check if specified license exists locally. If not, fetch it and store it. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $license_id + * @param string $license_key + * + * @return \FS_Plugin_Plan|object The plan entity or the API error object on failure. + */ + private function sync_license_if_not_exist( $license_id, $license_key ) { + $license = $this->_get_license_by_id( $license_id ); + + if ( is_object( $license ) ) { + // License already exists. + return $license; + } + + $license = $this->fetch_license_by_key( $license_id, $license_key ); + + if ( $license instanceof FS_Plugin_License ) { + $this->_licenses[] = $license; + + $this->set_license( $license ); + + $this->_store_licenses(); + + return $license; + } + + return $license; + } + + /** + * Get a collection of unique plan IDs that are associated with any installs in the network. + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @return number[] + */ + private function get_plans_ids_associated_with_installs() { + if ( ! is_multisite() ) { + if ( ! is_object( $this->_site ) || + ! FS_Plugin_Plan::is_valid_id( $this->_site->plan_id ) + ) { + return array(); + } + + return array( $this->_site->plan_id ); + } + + $plan_ids = array(); + $sites = self::get_sites(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( ! is_object( $install ) || + ! FS_Plugin_Plan::is_valid_id( $install->plan_id ) + ) { + continue; + } + + $plan_ids[ $install->plan_id ] = true; + } + + return array_keys( $plan_ids ); + } + + /** + * Get a collection of unique license IDs that are associated with any installs in the network. + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @return number[] + */ + private function get_license_ids_associated_with_installs() { + if ( ! $this->_is_network_active ) { + if ( ! is_object( $this->_site ) || + ! FS_Plugin_License::is_valid_id( $this->_site->license_id ) + ) { + return array(); + } + + return array( $this->_site->license_id ); + } + + $license_ids = array(); + $sites = self::get_sites(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( ! is_object( $install ) || + ! FS_Plugin_License::is_valid_id( $install->license_id ) + ) { + continue; + } + + $license_ids[ $install->license_id ] = true; + } + + return array_keys( $license_ids ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param number $id + * + * @return FS_Plugin_Plan|false + */ + function _get_plan_by_id( $id ) { + $this->_logger->entrance(); + + if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) { + $this->_sync_plans(); + } + + foreach ( $this->_plans as $plan ) { + if ( $id == $plan->id ) { + return $plan; + } + } + + return false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.8.1 + * + * @param string $name + * + * @return FS_Plugin_Plan|false + */ + private function get_plan_by_name( $name ) { + $this->_logger->entrance(); + + if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) { + $this->_sync_plans(); + } + + foreach ( $this->_plans as $plan ) { + if ( $name == $plan->name ) { + return $plan; + } + } + + return false; + } + + /** + * Sync local licenses with remote server. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param number|bool $site_license_id + * @param number|null $blog_id + * + * @return FS_Plugin_License[]|object + */ + function _sync_licenses( $site_license_id = false, $blog_id = null ) { + $this->_logger->entrance(); + + $is_network_admin = fs_is_network_admin(); + + if ( $is_network_admin && is_null( $blog_id ) ) { + $all_licenses = self::get_all_licenses( $this->_module_id ); + } else { + $all_licenses = $this->get_user_licenses( $this->_user->id ); + } + + $foreign_licenses = $this->get_foreign_licenses_info( $all_licenses, $site_license_id ); + + $all_licenses_map = array(); + foreach ( $all_licenses as $license ) { + $all_licenses_map[ $license->id ] = true; + } + + $licenses = $this->_fetch_licenses( false, $site_license_id, $foreign_licenses, $blog_id ); + + if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) { + $licenses_map = array(); + foreach ( $licenses as $license ) { + $licenses_map[ $license->id ] = true; + } + +// $license_ids_to_keep = $this->get_license_ids_associated_with_installs(); +// foreach ( $license_ids_to_keep as $license_id ) { +// if ( isset( $licenses_map[ $license_id ] ) ) { +// continue; +// } +// +// $missing_license = self::_get_license_by_id( $license_id, false ); +// if ( is_object( $missing_license ) ) { +// $licenses[] = $missing_license; +// $licenses_map[ $missing_license->id ] = true; +// } +// } + + $user_license_ids = $this->get_user_linked_license_ids( $this->_user->id ); + + foreach ( $user_license_ids as $key => $license_id ) { + if ( ! isset( $licenses_map[ $license_id ] ) ) { + // Remove access to licenses that no longer exist. + unset( $user_license_ids[ $key ] ); + } + } + + if ( ! empty( $user_license_ids ) ) { + foreach ( $licenses_map as $license_id => $value ) { + if ( ! isset( $all_licenses_map[ $license_id ] ) ) { + // Associate new licenses with the user who triggered the license syncing. + $user_license_ids[] = $license_id; + } + } + + $user_license_ids = array_unique( $user_license_ids ); + } else { + $user_license_ids = array_keys( $licenses_map ); + } + + if ( ! $is_network_admin || ! is_null( $blog_id ) ) { + $user_licenses = array(); + foreach ( $licenses as $license ) { + if ( ! in_array( $license->id, $user_license_ids ) ) { + continue; + } + + $user_licenses[] = $license; + } + + $this->_licenses = $user_licenses; + } else { + $this->_licenses = $licenses; + } + + $this->set_user_linked_license_ids( $this->_user->id, $user_license_ids ); + + $this->_store_licenses( true, $this->_module_id, $licenses ); + } + + // Update current license. + if ( is_object( $this->_license ) ) { + $license = $this->_get_license_by_id( $this->_license->id ); + + if ( is_object( $license ) ) { + /** + * `$license` can be `false` in case a user change action has just been completed and this method + * has synced the `$this->_licenses` collection for the new user. In this case, the + * `$this->_licenses` collection may have only the newly activated license that is associated with + * the new user. `set_license` will eventually be called in the same request by the logic that + * follows outside this method which will detect that the install's license has been updated, and + * then `_update_site_license` will be called which in turn will call `set_license`. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + */ + $this->set_license( $license ); + } + } + + return $this->_licenses; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param number $id + * @param bool $sync_licenses + * + * @return FS_Plugin_License|false + */ + function _get_license_by_id( $id, $sync_licenses = true ) { + $this->_logger->entrance(); + + if ( ! FS_Plugin_License::is_valid_id( $id ) ) { + return false; + } + + /** + * When running from the network level admin and opted-in from the network, + * check if the license exists in the network user licenses collection. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + if ( fs_is_network_admin() && + $this->is_network_registered() && + ( ! is_object( $this->_user ) || $this->_storage->network_user_id != $this->_user->id ) + ) { + $licenses = $this->get_user_licenses( $this->_storage->network_user_id ); + + foreach ( $licenses as $license ) { + if ( $id == $license->id ) { + return $license; + } + } + } + + if ( ! $this->has_any_license() && $sync_licenses ) { + $this->_sync_licenses( $id ); + } + + if ( is_array( $this->_licenses ) ) { + foreach ( $this->_licenses as $license ) { + if ( $id == $license->id ) { + return $license; + } + } + } + + return false; + } + + /** + * Get license by ID. Unlike _get_license_by_id(), this method only checks the local storage and return any license, whether it's associated with the current context user/install or not. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $id + * + * @return FS_Plugin_License + */ + private function get_license_by_id( $id ) { + $licenses = self::get_all_licenses( $this->_module_id ); + + if ( is_array( $licenses ) && ! empty( $licenses ) ) { + foreach ( $licenses as $license ) { + if ( $id == $license->id ) { + return $license; + } + } + } + + return null; + } + + /** + * Synchronize the site's context license by fetching the license form the API and updating the local data with it. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return \FS_Plugin_License|mixed + */ + private function sync_site_license() { + $api = $this->get_api_user_scope(); + + $result = $api->get( "/licenses/{$this->_license->id}.json?license_key=" . urlencode( $this->_license->secret_key ), true ); + + if ( ! $this->is_api_result_entity( $result ) ) { + return $result; + } + + $license = $this->_update_site_license( new FS_Plugin_License( $result ) ); + $this->_store_licenses(); + + return $license; + } + + /** + * Get all user's available licenses for the current module. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $user_id + * + * @return FS_Plugin_License[] + */ + private function get_user_licenses( $user_id ) { + $all_licenses = self::get_all_licenses( $this->_module_id ); + if ( empty( $all_licenses ) ) { + return array(); + } + + $user_license_ids = $this->get_user_linked_license_ids( $user_id ); + if ( empty( $user_license_ids ) ) { + return array(); + } + + $licenses = array(); + foreach ( $all_licenses as $license ) { + if ( in_array( $license->id, $user_license_ids ) ) { + $licenses[] = $license; + } + } + + return $licenses; + } + + /** + * Checks if the context license is network activated except on the given blog ID. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $except_blog_id + * + * @return bool + */ + private function is_license_network_active( $except_blog_id = 0 ) { + $this->_logger->entrance(); + + if ( ! is_object( $this->_license ) ) { + return false; + } + + $sites = self::get_sites(); + + if ( $this->_license->total_activations() < ( count( $sites ) - 1 ) ) { + // There are more sites than the number of activations, so license cannot be network activated. + return false; + } + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + if ( $except_blog_id == $blog_id ) { + // Skip excluded blog. + continue; + } + + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( is_object( $install ) && $install->license_id != $this->_license->id ) { + return false; + } + } + + return true; + } + + /** + * Checks if license can be activated on all the network sites (opted-in or skipped) that are not yet associated with a license. If possible, try to make the activation, if not return false. + * + * Notice: On success, this method will also update the license activations counters (without updating the license in the storage). + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_User $user + * @param \FS_Plugin_License $license + * + * @return bool + */ + private function try_activate_license_on_network( FS_User $user, FS_Plugin_License $license ) { + $this->_logger->entrance(); + + $result = $this->can_activate_license_on_network( $license ); + + if ( false === $result ) { + return false; + } + + $installs_without_license = $result['installs']; + if ( ! empty( $installs_without_license ) ) { + $this->activate_license_on_many_installs( $user, $license->secret_key, $installs_without_license ); + } + + $disconnected_site_ids = $result['sites']; + if ( ! empty( $disconnected_site_ids ) ) { + $this->activate_license_on_many_sites( $user, $license->secret_key, $disconnected_site_ids ); + } + + $this->link_license_2_user( $license->id, $user->id ); + + // Sync license after activations. + $license->activated += $result['production_count']; + $license->activated_local += $result['localhost_count']; + +// $this->_store_licenses() + + return true; + } + + /** + * Checks if the given license can be activated on the whole network. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_Plugin_License $license + * + * @return false|array { + * @type array[int]FS_Site $installs Blog ID to install map. + * @type int[] $sites Non-connected blog IDs. + * @type int $production_count Production sites count. + * @type int $localhost_count Production sites count. + * } + */ + private function can_activate_license_on_network( FS_Plugin_License $license ) { + $sites = self::get_sites(); + + $production_count = 0; + $localhost_count = 0; + + $installs_without_license = array(); + $disconnected_site_ids = array(); + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( is_object( $install ) ) { + if ( FS_Plugin_License::is_valid_id( $install->license_id ) ) { + // License already activated on the install. + continue; + } + + $url = $install->url; + + $installs_without_license[ $blog_id ] = $install; + } else { + $url = is_object( $site ) ? + $site->siteurl : + get_site_url( $blog_id ); + + $disconnected_site_ids[] = $blog_id; + } + + if ( FS_Site::is_localhost_by_address( $url ) ) { + $localhost_count ++; + } else { + $production_count ++; + } + } + + if ( ! $license->can_activate_bulk( $production_count, $localhost_count ) ) { + return false; + } + + return array( + 'installs' => $installs_without_license, + 'sites' => $disconnected_site_ids, + 'production_count' => $production_count, + 'localhost_count' => $localhost_count, + ); + } + + /** + * Activate a given license on a collection of installs. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_User $user + * @param string $license_key + * @param array $blog_2_install_map { + * @key int Blog ID. + * @value FS_Site Blog's associated install. + * } + * + * @return mixed|true + */ + private function activate_license_on_many_installs( + FS_User $user, + $license_key, + array $blog_2_install_map + ) { + $params = array( + array( 'license_key' => $this->apply_filters( 'license_key', $license_key ) ) + ); + + $install_2_blog_map = array(); + foreach ( $blog_2_install_map as $blog_id => $install ) { + $params[] = array( 'id' => $install->id ); + + $install_2_blog_map[ $install->id ] = $blog_id; + } + + $result = $this->get_api_user_scope_by_user( $user )->call( + "plugins/{$this->_plugin->id}/installs.json", + 'PUT', + $params + ); + + if ( ! $this->is_api_result_object( $result, 'installs' ) ) { + return $result; + } + + foreach ( $result->installs as $r_install ) { + $install = new FS_Site( $r_install ); + $install->is_disconnected = false; + + // Update install. + $this->_store_site( + true, + $install_2_blog_map[ $r_install->id ], + $install + ); + } + + return true; + } + + /** + * Activate a given license on a collection of blogs/sites that are not yet opted-in. + * + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @param \FS_User $user + * @param string $license_key + * + * @return true|mixed True if successful, otherwise, the API result. + */ + private function activate_license_on_site( FS_User $user, $license_key ) { + return $this->activate_license_on_many_sites( $user, $license_key ); + } + + /** + * Activate a given license on a collection of blogs/sites that are not yet opted-in. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_User $user + * @param string $license_key + * @param int[] $site_ids + * + * @return true|mixed True if successful, otherwise, the API result. + */ + private function activate_license_on_many_sites( + FS_User $user, + $license_key, + array $site_ids = array() + ) { + $sites = array(); + foreach ( $site_ids as $site_id ) { + $sites[] = $this->get_site_info( array( 'blog_id' => $site_id ) ); + } + + // Install the plugin. + $result = $this->create_installs_with_user( + $user, + $license_key, + false, + $sites, + false, + true + ); + + if ( ! $this->is_api_result_entity( $result ) && + ! $this->is_api_result_object( $result, 'installs' ) + ) { + return $result; + } + + $installs = array(); + + if ( $this->is_api_result_entity( $result ) ) { + $install = new FS_Site( $result ); + + $this->_user = $user; + + $this->_store_site( true, null, $install ); + + $this->_site = $install; + + $this->reset_anonymous_mode(); + } else { + foreach ( $result->installs as $install ) { + $installs[] = new FS_Site( $install ); + } + + // Map site addresses to their blog IDs. + $address_to_blog_map = $this->get_address_to_blog_map(); + + $first_blog_id = null; + + foreach ( $installs as $install ) { + $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); + $blog_id = $address_to_blog_map[ $address ]; + + $this->_store_site( true, $blog_id, $install ); + + $this->reset_anonymous_mode( $blog_id ); + + if ( is_null( $first_blog_id ) ) { + $first_blog_id = $blog_id; + } + } + + if ( ! FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ) { + $this->_storage->network_install_blog_id = $first_blog_id; + } + } + + return true; + } + + /** + * Sync site's license with user licenses. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param FS_Plugin_License|null $new_license + * + * @return FS_Plugin_License|null + */ + function _update_site_license( $new_license ) { + $this->_logger->entrance(); + + /** + * In case this call will be removed in the future, the `_sync_licenses()` method needs to be updated + * accordingly so that it will also handle the case when an ownership change is done via license + * activation. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + */ + $this->set_license( $new_license ); + + if ( ! is_object( $new_license ) ) { + $this->_site->license_id = null; + $this->_sync_site_subscription( null ); + + return $this->_license; + } + + $this->_site->license_id = $this->_license->id; + + if ( ! is_array( $this->_licenses ) ) { + $this->_licenses = array(); + } + + $is_license_found = false; + for ( $i = 0, $len = count( $this->_licenses ); $i < $len; $i ++ ) { + if ( $new_license->id == $this->_licenses[ $i ]->id ) { + $this->_licenses[ $i ] = $new_license; + + $is_license_found = true; + break; + } + } + + // If new license just append. + if ( ! $is_license_found ) { + $this->_licenses[] = $new_license; + } + + $this->_sync_site_subscription( $new_license ); + + return $this->_license; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @param \FS_Plugin_License $license + */ + private function set_license( FS_Plugin_License $license = null ) { + $this->_license = $license; + + $this->maybe_update_whitelabel_flag( $license ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @param FS_Plugin_License $license + */ + private function maybe_update_whitelabel_flag( $license ) { + $is_whitelabeled = isset( $this->_storage->is_whitelabeled ) ? + $this->_storage->is_whitelabeled : + false; + + if ( is_object( $license ) ) { + $license_user = self::_get_user_by_id( $license->user_id ); + + if ( ! is_object( $license_user ) ) { + // If foreign license, do not update the `is_whitelabeled` flag. + return; + } + + if ( $this->is_addon() ) { + /** + * Store the last license data to the parent's storage since it's needed only when showing the + * "Start Debug" dialog which is triggered from the "Account" page. This way, there's no need to + * iterate over the add-ons just to get the last license data. + */ + $this->get_parent_instance()->store_last_activated_license_data( $license, $license_user ); + } else { + $this->store_last_activated_license_data( $license ); + } + + if ( $license->is_whitelabeled ) { + // Activated a developer license, data should be hidden. + $is_whitelabeled = true; + } else if ( $this->is_registered() && $this->_user->id == $license->user_id ) { + // The account owner activated a regular license key, no need to hide the data. + $is_whitelabeled = false; + } + } + + $this->_storage->is_whitelabeled = $is_whitelabeled; + + // Reset the whitelabeled status after update. + $this->is_whitelabeled = null; + if ( $this->is_addon() ) { + $parent_fs = $this->get_parent_instance(); + + if ( is_object( $parent_fs ) ) { + $parent_fs->is_whitelabeled = null; + } + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @param FS_Plugin_License $license + * @param FS_User $license_user + */ + private function store_last_activated_license_data( FS_Plugin_License $license, $license_user = null ) { + if ( ! is_object( $license_user ) ) { + $this->_storage->last_license_key = md5( $license->secret_key ); + $this->_storage->last_license_user_id = null; + } else { + $this->_storage->last_license_user_key = md5( $license_user->secret_key ); + $this->_storage->last_license_user_id = $license_user->id; + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @param bool $ignore_data_debug_mode + * + * @return bool + */ + function is_whitelabeled_by_flag( $ignore_data_debug_mode = false ) { + if ( true !== $this->_storage->is_whitelabeled ) { + return false; + } else if ( $ignore_data_debug_mode ) { + return true; + } + + $fs = $this->is_addon() ? + $this->get_parent_instance() : + $this; + + return ! $fs->is_data_debug_mode(); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @return number + */ + function get_last_license_user_id() { + return ( FS_User::is_valid_id( $this->_storage->last_license_user_id ) ) ? + $this->_storage->last_license_user_id : + null; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @param int $blog_id + * @param bool $ignore_data_debug_mode + * + * @return bool + */ + function is_whitelabeled( $ignore_data_debug_mode = false, $blog_id = null ) { + if ( ! is_null( $blog_id ) ) { + $this->switch_to_blog( $blog_id ); + } + + if ( ! is_null( $this->is_whitelabeled ) ) { + $is_whitelabeled = $this->is_whitelabeled; + } else { + $is_whitelabeled = false; + + $is_whitelabeled_flag = $this->is_whitelabeled_by_flag( true ); + + if ( ! $this->has_addons() ) { + $is_whitelabeled = $is_whitelabeled_flag; + } else if ( $is_whitelabeled_flag ) { + $is_whitelabeled = true; + } else { + $addon_ids = $this->get_updated_account_addons(); + $installed_addons = $this->get_installed_addons(); + foreach ( $installed_addons as $fs_addon ) { + $addon_ids[] = $fs_addon->get_id(); + } + + if ( ! empty( $addon_ids ) ) { + $addon_ids = array_unique( $addon_ids ); + + $is_network_level = ( + fs_is_network_admin() && + $this->is_network_active() + ); + + foreach ( $addon_ids as $addon_id ) { + $addon = $this->get_addon( $addon_id ); + + if ( ! is_object( $addon ) ) { + continue; + } + + $addon_storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $addon->slug ); + $fs_addon = $this->is_addon_activated( $addon_id ) ? + self::get_addon_instance( $addon_id ) : + null; + + $was_addon_network_activated = false; + + if ( is_object( $fs_addon ) ) { + $was_addon_network_activated = $fs_addon->is_network_active(); + } else if ( $is_network_level ) { + $was_addon_network_activated = $addon_storage->get( 'was_plugin_loaded', false, true ); + } + + $network_delegated_connection = ( + $was_addon_network_activated && + $addon_storage->get( 'is_delegated_connection', false, true ) + ); + + if ( + $is_network_level && + ( ! $was_addon_network_activated || $network_delegated_connection ) + ) { + $sites = self::get_sites(); + + /** + * If in network admin area and the add-on was not network-activated or network-activated + * and network-delegated, find any add-on whose is_whitelabeled flag is true. + */ + foreach ( $sites as $site ) { + $site_info = $this->get_site_info( $site ); + + if ( $addon_storage->get( 'is_whitelabeled', false, $site_info['blog_id'] ) ) { + $is_whitelabeled = true; + break; + } + } + + if ( $is_whitelabeled ) { + break; + } + } else { + /** + * This will be executed when any of the following is met: + * 1. Add-on was network-activated, not network-delegated, and in network admin area. + * 2. Add-on was network-activated, network-delegated, and in site admin area. + * 3. Add-on was not network-activated and in site admin area. + */ + if ( true === $addon_storage->is_whitelabeled ) { + $is_whitelabeled = true; + break; + } + } + } + } + } + + $this->is_whitelabeled = $is_whitelabeled; + + if ( ! $is_whitelabeled || ! $this->is_data_debug_mode() ) { + $this->_admin_notices->remove_sticky( 'data_debug_mode_enabled' ); + } + + if ( ! is_null( $blog_id ) ) { + $this->restore_current_blog(); + } + } + + return ( + $is_whitelabeled && + ( $ignore_data_debug_mode || ! $this->is_data_debug_mode() ) + ); + } + + /** + * Sync site's subscription. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param FS_Plugin_License|null $license + * + * @return bool|\FS_Subscription + */ + private function _sync_site_subscription( $license ) { + if ( ! is_object( $license ) ) { + $this->delete_unused_subscriptions(); + + return false; + } + + // Load subscription details if not lifetime. + $subscription = $license->is_lifetime() ? + false : + $this->_fetch_site_license_subscription(); + + if ( is_object( $subscription ) && ! isset( $subscription->error ) ) { + $this->store_subscription( $subscription ); + } else { + $this->delete_unused_subscriptions(); + } + + return $subscription; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return bool|\FS_Plugin_License + */ + function _get_license() { + if ( ! fs_is_network_admin() || is_object( $this->_license ) ) { + return $this->_license; + } + + return $this->_get_available_premium_license(); + } + + /** + * @param number $license_id + * + * @return null|\FS_Subscription + */ + function _get_subscription( $license_id ) { + if ( ! isset( $this->_storage->subscriptions ) || + empty( $this->_storage->subscriptions ) + ) { + return null; + } + + foreach ( fs_get_entities( $this->_storage->subscriptions, FS_Subscription::get_class_name() ) as $subscription ) { + if ( $subscription->license_id == $license_id ) { + return $subscription; + } + } + + return null; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param FS_Subscription $subscription + */ + function store_subscription( FS_Subscription $subscription ) { + if ( ! isset( $this->_storage->subscriptions ) ) { + $this->_storage->subscriptions = array(); + } + + if ( empty( $this->_storage->subscriptions ) || ! is_multisite() ) { + $this->_storage->subscriptions = array( $subscription ); + + return; + } + + $subscriptions = fs_get_entities( $this->_storage->subscriptions, FS_Subscription::get_class_name() ); + + $updated_subscription = false; + foreach ( $subscriptions as $key => $existing_subscription ) { + if ( $existing_subscription->id == $subscription->id ) { + $subscriptions[ $key ] = $subscription; + $updated_subscription = true; + break; + } + } + + if ( ! $updated_subscription ) { + $subscriptions[] = $subscription; + } + + $this->_storage->subscriptions = $subscriptions; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + */ + function delete_unused_subscriptions() { + if ( ! isset( $this->_storage->subscriptions ) || + empty( $this->_storage->subscriptions ) || + // Clean up only if there are already at least 3 subscriptions. + ( count( $this->_storage->subscriptions ) < 3 ) + ) { + return; + } + + if ( ! is_multisite() ) { + // If not multisite, there should only be 1 subscription, so just clear the array. + $this->_storage->subscriptions = array(); + + return; + } + + $subscriptions_to_keep_by_license_id_map = array(); + $sites = self::get_sites(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( ! is_object( $install ) || + ! FS_Plugin_License::is_valid_id( $install->license_id ) + ) { + continue; + } + + $subscriptions_to_keep_by_license_id_map[ $install->license_id ] = true; + } + + if ( empty( $subscriptions_to_keep_by_license_id_map ) ) { + $this->_storage->subscriptions = array(); + + return; + } + + foreach ( $this->_storage->subscriptions as $key => $subscription ) { + if ( ! isset( $subscriptions_to_keep_by_license_id_map[ $subscription->license_id ] ) ) { + unset( $this->_storage->subscriptions[ $key ] ); + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @param string $plan Plan name + * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans. + * + * @return bool + */ + function is_plan( $plan, $exact = false ) { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + return false; + } + + $plan = strtolower( $plan ); + + $current_plan_name = $this->get_plan_name(); + + if ( $current_plan_name === $plan ) { + // Exact plan. + return true; + } else if ( $exact ) { + // Required exact, but plans are different. + return false; + } + + $current_plan_order = - 1; + $required_plan_order = PHP_INT_MAX; + for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { + if ( $plan === $this->_plans[ $i ]->name ) { + $required_plan_order = $i; + } else if ( $current_plan_name === $this->_plans[ $i ]->name ) { + $current_plan_order = $i; + } + } + + return ( $current_plan_order > $required_plan_order ); + } + + /** + * Check if module has only one plan. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @param bool $double_check In some cases developers prefer to release their paid offering as premium-only, even though there is a free version. For those cases, looking at the 'is_premium_only' value isn't enough because the result will return false even when the product has only signle paid plan. + * + * @return bool + */ + function is_single_plan( $double_check = false ) { + $this->_logger->entrance(); + + if ( ! $this->is_registered() || + ! is_array( $this->_plans ) || + 0 === count( $this->_plans ) + ) { + return true; + } + + $has_free_plan = $this->has_free_plan(); + + if ( ! $has_free_plan && $double_check ) { + foreach ( $this->_plans as $plan ) { + if ( $plan->is_free() ) { + $has_free_plan = true; + break; + } + } + } + + return ( 1 === ( count( $this->_plans ) - ( $has_free_plan ? 1 : 0 ) ) ); + } + + /** + * Check if plan based on trial. If not in trial mode, should return false. + * + * @since 1.0.9 + * + * @param string $plan Plan name + * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans. + * + * @return bool + */ + function is_trial_plan( $plan, $exact = false ) { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + return false; + } + + if ( ! $this->is_trial() ) { + return false; + } + + $trial_plan = $this->get_trial_plan(); + + if ( $trial_plan->name === $plan ) { + // Exact plan. + return true; + } else if ( $exact ) { + // Required exact, but plans are different. + return false; + } + + $current_plan_order = - 1; + $required_plan_order = - 1; + for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { + if ( $plan === $this->_plans[ $i ]->name ) { + $required_plan_order = $i; + } else if ( $trial_plan->name === $this->_plans[ $i ]->name ) { + $current_plan_order = $i; + } + } + + return ( $current_plan_order > $required_plan_order ); + } + + /** + * Check if plugin has any paid plans. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return bool + */ + function has_paid_plan() { + return $this->_has_paid_plans || + FS_Plan_Manager::instance()->has_paid_plan( $this->_plans ); + } + + /** + * Check if plugin has any plan with a trail. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function has_trial_plan() { + /** + * @author Vova Feldman(@svovaf) + * @since 1.2.1.5 + * + * Allow setting a trial from the SDK without calling the API. + * But, if the user did opt-in, continue using the real data from the API. + */ + if ( $this->_trial_days >= 0 ) { + return true; + } + + return $this->_storage->get( 'has_trial_plan', false ); + } + + /** + * Check if plugin has any free plan, or is it premium only. + * + * Note: If no plans configured, assume plugin is free. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return bool + */ + function has_free_plan() { + return ! $this->is_only_premium(); + } + + /** + * Displays a license activation dialog box when the user clicks on the "Activate License" + * or "Change License" link on the plugins + * page. + * + * @author Leo Fajardo (@leorw) + * @since 1.1.9 + */ + function _add_license_activation_dialog_box() { + $vars = array( + 'id' => $this->_module_id, + ); + + fs_require_template( 'forms/license-activation.php', $vars ); + fs_require_template( 'forms/resend-key.php', $vars ); + } + + /** + * Returns a collection of IDs of installs that are associated with the context product and its add-ons, and activated with foreign licenses. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + * + * @return number[] + */ + function get_installs_ids_with_foreign_licenses() { + $installs = array(); + + if ( + is_object( $this->_license ) && + $this->_site->user_id != $this->_license->user_id + ) { + $installs[] = $this->_site->id; + } + + /** + * Also try to get foreign licenses for the context product's add-ons. + */ + $installs_by_slug_map = $this->get_parent_and_addons_installs_info(); + + foreach ( $installs_by_slug_map as $slug => $install_info ) { + if ( $slug == $this->get_slug() ) { + continue; + } + + $install = $install_info['install']; + $license = $install_info['license']; + + if ( + is_object( $license ) && + $install->user_id != $license->user_id + ) { + $installs[] = $install->id; + } + } + + return $installs; + } + + /** + * Displays the "Change User" dialog box when the user clicks on the "Change User" button on the "Account" page. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + * + * @param number[] $install_ids + */ + function _add_user_change_dialog_box( $install_ids ) { + $vars = array( + 'id' => $this->_module_id, + 'license_owners' => $this->fetch_installs_licenses_owners_data( $install_ids ) + ); + + fs_require_template( 'forms/user-change.php', $vars ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + */ + function _add_data_debug_mode_dialog_box() { + $vars = array( + 'id' => $this->_module_id, + ); + + fs_require_template( 'forms/data-debug-mode.php', $vars ); + } + + /** + * Displays a subscription cancellation dialog box when the user clicks on the "Deactivate License" + * link on the "Account" page or deactivates a plugin and there's an active subscription that is + * either associated with a non-lifetime single-site license or non-lifetime multisite license that + * is only activated on a single production site. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + * + * @param bool $is_license_deactivation + * + * @return array + */ + function _get_subscription_cancellation_dialog_box_template_params( $is_license_deactivation = false ) { + if ( fs_is_network_admin() ) { + // Subscription cancellation dialog box is currently not supported for multisite networks. + return array(); + } + + if ( $this->is_whitelabeled() ) { + return array(); + } + + $license = $this->_get_license(); + + /** + * If the installation is associated with a non-lifetime license, which is either a single-site or only activated on a single production site (or zero), and connected to an active subscription, suggest the customer to cancel the subscription upon deactivation. + * + * @author Leo Fajardo (@leorw) (Comment added by Vova Feldman @svovaf) + * @since 2.2.1 + */ + if ( ! is_object( $license ) || + $license->is_lifetime() || + ( ! $license->is_single_site() && $license->activated > 1 ) + ) { + return array(); + } + + /** + * @var FS_Subscription $subscription + */ + $subscription = $this->_get_subscription( $license->id ); + if ( ! is_object( $subscription ) || ! $subscription->is_active() ) { + return array(); + } + + return array( + 'id' => $this->_module_id, + 'license' => $license, + 'has_trial' => $this->is_paid_trial(), + 'is_license_deactivation' => $is_license_deactivation, + ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.2 + */ + function _add_premium_version_upgrade_selection_dialog_box() { + $modules_update = get_site_transient( $this->is_theme() ? 'update_themes' : 'update_plugins' ); + if ( ! isset( $modules_update->response[ $this->_plugin_basename ] ) ) { + return; + } + + $vars = array( + 'id' => $this->_module_id, + 'new_version' => is_object( $modules_update->response[ $this->_plugin_basename ] ) ? + $modules_update->response[ $this->_plugin_basename ]->new_version : + $modules_update->response[ $this->_plugin_basename ]['new_version'] + ); + + fs_require_template( 'forms/premium-versions-upgrade-metadata.php', $vars ); + fs_require_once_template( 'forms/premium-versions-upgrade-handler.php', $vars ); + } + + /** + * Displays the opt-out dialog box when the user clicks on the "Opt Out" link on the "Plugins" + * page. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + */ + function _add_optout_dialog() { + if ( $this->is_theme() ) { + $vars = null; + fs_require_once_template( '/js/jquery.content-change.php', $vars ); + } + + $vars = array( 'id' => $this->_module_id ); + fs_require_template( 'forms/optout.php', $vars ); + } + + /** + * Prepare page to include all required UI and logic for the license activation dialog. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.0 + */ + function _add_license_activation() { + if ( $this->is_migration() ) { + return; + } + + if ( ! $this->is_user_admin() ) { + // Only admins can activate a license. + return; + } + + if ( ! $this->has_paid_plan() ) { + // Module doesn't have any paid plans. + return; + } + + if ( + $this->has_premium_version() && + ! $this->is_premium() && + /** + * Also handle the case when an upgrade was made using the free version. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + */ + ! is_object( $this->_get_license() ) + ) { + // Only add license activation logic to the premium version, or in case of a serviceware plugin, also in the free version. + return; + } + + // Add license activation link and AJAX request handler. + if ( self::is_plugins_page() ) { + $is_network_admin = fs_is_network_admin(); + + if ( + ( $is_network_admin && $this->is_network_active() && ! $this->is_network_delegated_connection() ) || + ( ! $is_network_admin && ( ! $this->is_network_active() || $this->is_delegated_connection() ) ) + ) { + /** + * @since 1.2.0 Add license action link only on plugins page. + */ + $this->_add_license_action_link(); + } + } + + // Add license activation AJAX callback. + $this->add_ajax_action( 'activate_license', array( &$this, '_activate_license_ajax_action' ) ); + + // Add resend license AJAX callback. + $this->add_ajax_action( 'resend_license_key', array( &$this, '_resend_license_key_ajax_action' ) ); + } + + /** + * Prepares page to include all required UI and logic for the "Change User" dialog. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + */ + function _add_user_change_option() { + if ( ! $this->should_handle_user_change() ) { + return; + } + + $installs_ids_with_foreign_licenses = $this->get_installs_ids_with_foreign_licenses(); + + if ( empty( $installs_ids_with_foreign_licenses ) ) { + // Handle user change only when the parent product or one of its add-ons is activated with a foreign license. + return; + } + + // Add user change AJAX handler. + $this->add_ajax_action( 'change_user', array( &$this, '_user_change_ajax_action' ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + */ + function should_handle_user_change() { + if ( ! $this->is_user_admin() ) { + // Only admins can change user. + return false; + } + + if ( $this->is_addon() ) { + return false; + } + + if ( ! $this->is_registered() ) { + return false; + } + + if ( + $this->is_network_active() && + ( fs_is_network_admin() || ! $this->is_site_delegated_connection() ) + ) { + // Handle only on site-level "Account" section for now. + return false; + } + + return true; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.2 + */ + function _add_premium_version_upgrade_selection() { + if ( ! $this->is_user_admin() ) { + return; + } + + if ( ! $this->is_premium() || $this->has_any_active_valid_license() ) { + // This is relevant only to the free versions and premium versions without an active license. + return; + } + + if ( self::is_updates_page() || ( $this->is_plugin() && self::is_plugins_page() ) ) { + $this->_add_premium_version_upgrade_selection_action(); + } + } + + /** + * @author Edgar Melkonyan + * @since 2.4.1 + * + * @throws Freemius_Exception + */ + function _toggle_whitelabel_mode_ajax_handler() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'toggle_whitelabel_mode' ); + + if ( ! $this->is_user_admin() ) { + // Only for admins. + self::shoot_ajax_failure(); + } + + $license = $this->get_api_user_scope()->call( + "/licenses/{$this->_site->license_id}.json", + 'put', + array( 'is_whitelabeled' => ! $this->_license->is_whitelabeled ) + ); + + if ( ! $this->is_api_result_entity( $license ) ) { + self::shoot_ajax_failure( + FS_Api::is_api_error_object( $license ) ? + $license->error->message : + fs_text_inline( "An unknown error has occurred while trying to toggle the license's white-label mode.", 'unknown-error-occurred', $this->get_slug() ) + ); + } + + $this->_license->is_whitelabeled = $license->is_whitelabeled; + $this->_store_licenses(); + + $this->_sync_license(); + + if ( ! $license->is_whitelabeled ) { + $this->_admin_notices->remove_sticky( 'license_whitelabeled' ); + } else { + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( + 'Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s.', + 'license_whitelabeled' + ), + "{$this->get_plugin_title()}", + sprintf( '%s', $this->get_text_inline( 'User Dashboard', 'user-dashboard' ) ), + sprintf( '%s', $this->get_text_inline( 'revert it now', 'revert-it-now' ) ) + ), + 'license_whitelabeled' + ); + } + + self::shoot_ajax_response( array( 'success' => true ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + function _add_beta_mode_update_handler() { + if ( ! $this->is_user_admin() ) { + return; + } + + if ( ! $this->is_premium() ) { + return; + } + + $this->add_ajax_action( 'set_beta_mode', array( &$this, '_set_beta_mode_ajax_handler' ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + function _set_beta_mode_ajax_handler() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'set_beta_mode' ); + + if ( ! $this->is_user_admin() ) { + // Only for admins. + self::shoot_ajax_failure(); + } + + $is_beta = trim( fs_request_get( 'is_beta', '', 'post' ) ); + + if ( empty( $is_beta ) || ! in_array( $is_beta, array( 'true', 'false' ) ) ) { + self::shoot_ajax_failure(); + } + + $site = $this->get_api_site_scope()->call( + '', + 'put', + array( + 'is_beta' => ( 'true' == $is_beta ), + 'fields' => 'is_beta' + ) + ); + + if ( ! $this->is_api_result_entity( $site ) ) { + self::shoot_ajax_failure( + FS_Api::is_api_error_object( $site ) ? + $site->error->message : + fs_text_inline( "An unknown error has occurred while trying to set the user's beta mode.", 'unknown-error-occurred', $this->get_slug() ) + ); + } + + $this->_site->is_beta = $site->is_beta; + $this->_store_site(); + + self::shoot_ajax_response( array( 'success' => true ) ); + } + + /** + * License activation WP AJAX handler. + * + * @author Leo Fajardo (@leorw) + * @since 1.1.9 + * + * @uses Freemius::activate_license() + */ + function _activate_license_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'activate_license' ); + + $license_key = trim( fs_request_get( 'license_key' ) ); + + if ( empty( $license_key ) ) { + exit; + } + + $sites = fs_is_network_admin() ? + fs_request_get( 'sites', array(), 'post' ) : + array(); + + $result = $this->activate_license( + $license_key, + $sites, + fs_request_get_bool( 'is_marketing_allowed', null ), + fs_request_get( 'blog_id', null ), + fs_request_get( 'module_id', null, 'post' ), + fs_request_get( 'user_id', null ), + fs_request_get_bool( 'is_extensions_tracking_allowed', null ) + ); + + if ( + $result['success'] && + $this->is_bundle_license_auto_activation_enabled() + ) { + $license = new FS_Plugin_License(); + $license->secret_key = $license_key; + + $this->maybe_activate_bundle_license( $license, $sites ); + } + + echo json_encode( $result ); + + exit; + } + + /** + * User change WP AJAX handler. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + */ + function _user_change_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'change_user' ); + + $new_email_address = trim( fs_request_get( 'email_address', '' ) ); + $new_user_id = fs_request_get( 'user_id' ); + + if ( empty( $new_email_address ) && ! FS_User::is_valid_id( $new_user_id ) ) { + self::shoot_ajax_failure( fs_text_inline( 'Invalid new user ID or email address.', 'invalid-new-user-id-or-email', $this->get_slug() ) ); + } + + $params = array(); + + if ( ! empty( $new_email_address ) ) { + $params['user_email'] = $new_email_address; + } else { + $params['user_id'] = $new_user_id; + } + + $installs_info_by_slug_map = $this->get_parent_and_addons_installs_info(); + $install_ids = array(); + + foreach ( $installs_info_by_slug_map as $slug => $install_info ) { + $install_ids[ $slug ] = $install_info['install']->id; + } + + $params['install_ids'] = implode( ',', array_values( $install_ids ) ); + + $install = $this->get_api_site_scope()->call( $this->add_show_pending( '/' ), 'put', $params ); + + if ( FS_Api::is_api_error( $install ) ) { + $error = ''; + + if ( is_object( $install ) ) { + switch ( $install->error->code ) { + case 'user_exist': + $error = ( + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...' . + $this->get_text_inline( 'Sorry, we could not complete the email update. Another user with the same email is already registered.', 'user-exist-message' ) . ' ' . + sprintf( $this->get_text_inline( 'If you would like to give up the ownership of the %s\'s account to %s click the Change Ownership button.', 'user-exist-message_ownership' ), $this->_module_type, '' . $new_email_address . '' ) . + sprintf( + '', + $this->get_account_url( 'change_owner', array( + 'state' => 'init', + 'candidate_email' => $new_email_address + ) ), + $this->get_text_inline( 'Change Ownership', 'change-ownership' ) + ) + ); + break; + } + } + + if ( empty( $error ) ) { + $error = FS_Api::is_api_error_object( $install ) ? + $install->error->message : + var_export( $install->error, true ); + } + + self::shoot_ajax_failure( $error ); + } else { + if ( + // If successful ownership change. + $this->get_user()->id != $install->user_id || + ! empty( $new_email_address ) + ) { + $this->complete_ownership_change_by_license( $install->user_id, $install_ids ); + } + } + + self::shoot_ajax_success(); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.2.14 + */ + function starting_migration() { + if ( ! empty( $this->_storage->license_migration ) ) { + // Do not overwrite the data if already set. + return; + } + + $this->_storage->license_migration = array( + 'is_migrating' => true, + 'start_timestamp' => time() + ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.2.14 + */ + function is_migration() { + if ( $this->is_addon() ) { + return $this->get_parent_instance()->is_migration(); + } + + if ( empty( $this->_storage->license_migration ) ) { + return false; + } + + if ( ! $this->_storage->license_migration['is_migrating'] ) { + return false; + } + + return ( + // Return `true` if the migration is within 5 minutes from the starting time. + ( time() - $this->_storage->license_migration['start_timestamp'] ) <= WP_FS__TIME_5_MIN_IN_SEC + ); + } + + /** + * + * A helper method to activate migrated licenses. If the product is network activated and integrated, the method will network activate the license. + * + * @author Vova Feldman (@svovaf) + * @since 2.3.0 + * + * @param string $license_key + * @param null|bool $is_marketing_allowed + * @param null|number $plugin_id + * @param array $sites + * @param int $blog_id + * + * @return array { + * @var bool $success + * @var string $error + * @var string $next_page + * } + * + * @uses Freemius::activate_license() + */ + function activate_migrated_license( + $license_key, + $is_marketing_allowed = null, + $plugin_id = null, + $sites = array(), + $blog_id = null + ) { + $this->_logger->entrance(); + + $result = $this->activate_license( + $license_key, + ( empty( $sites ) && is_null( $blog_id ) && $this->is_network_active() ) ? + $this->get_sites_for_network_level_optin() : + $sites, + $is_marketing_allowed, + $blog_id, + $plugin_id + ); + + // No need to show the sticky after license activation notice after migrating a license. + $this->_admin_notices->remove_sticky( 'plan_upgraded' ); + + return $result; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @return string + */ + function get_pricing_js_path() { + if ( ! isset( $this->_pricing_js_path ) ) { + $pricing_js_path = $this->apply_filters( 'freemius_pricing_js_path', '' ); + + if ( empty( $pricing_js_path ) ) { + global $fs_active_plugins; + + foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) { + if ( $data->plugin_path == $this->get_plugin_basename() ) { + $plugin_or_theme_root_dir = ( $this->is_plugin() ? WP_PLUGIN_DIR : get_theme_root( get_stylesheet() ) ); + + $pricing_js_path = $plugin_or_theme_root_dir + . '/' + // The basename will be `plugins`, `themes`, or the basename of a custom plugins or themes directory. + . str_replace( '../' . basename( $plugin_or_theme_root_dir ) . '/', '', $sdk_path ) + . '/includes/freemius-pricing/freemius-pricing.js'; + + break; + } + } + } + + $this->_pricing_js_path = $pricing_js_path; + } + + return $this->_pricing_js_path; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + * + * @return bool + */ + function should_use_external_pricing() { + if ( is_null( $this->_use_external_pricing ) ) { + $pricing_js_path = $this->get_pricing_js_path(); + + $this->_use_external_pricing = ( empty( $pricing_js_path ) || ! file_exists( $pricing_js_path ) ); + } + + return $this->_use_external_pricing; + } + + /** + * The implementation of this method was previously in `_activate_license_ajax_action()`. + * + * @author Vova Feldman (@svovaf) + * @since 2.2.4 + * @since 2.0.0 When a super-admin that hasn't connected before is network activating a license and excluding some of the sites for the license activation, go over the unselected sites in the network and if a site is not connected, skipped, nor delegated, if it's a freemium product then just skip the connection for the site, if it's a premium only product, delegate the connection and license activation to the site admin (Vova Feldman @svovaf). + * @param string $license_key + * @param array $sites + * @param null|bool $is_marketing_allowed + * @param null|int $blog_id + * @param null|number $plugin_id + * @param null|number $license_owner_id + * + * @return array { + * @var bool $success + * @var string $error + * @var string $next_page + * } + */ + private function activate_license( + $license_key, + $sites = array(), + $is_marketing_allowed = null, + $blog_id = null, + $plugin_id = null, + $license_owner_id = null, + $is_extensions_tracking_allowed = null + ) { + $this->_logger->entrance(); + + $license_key = trim( $license_key ); + + $is_network_activation_or_migration = ( + fs_is_network_admin() || + ( ! empty( $sites ) && $this->is_migration() ) + ); + + if ( ! $is_network_activation_or_migration ) { + // If the license activation is executed outside the context of a network admin, ignore the sites collection. + $sites = array(); + } + + $fs = ( empty($plugin_id) || $plugin_id == $this->_module_id ) ? + $this : + $this->get_addon_instance( $plugin_id ); + + $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); + + $error = false; + $next_page = false; + + $has_valid_blog_id = is_numeric( $blog_id ); + + $user = null; + + if ( $fs->is_addon() && $fs->get_parent_instance()->is_registered() ) { + /** + * When activating an add-on's license and the parent is opted-in, activate the license with the parent's opted-in user context. + * + * @author Vova Feldman (@svovaf) + */ + $user = $fs->get_parent_instance()->get_current_or_network_user(); + } else if ( $fs->is_registered() ) { + $user = $fs->get_current_or_network_user(); + } + + if ( $has_valid_blog_id ) { + /** + * If a specific blog ID was provided, activate the license only on the specific blog that is associated with the given blog ID. + * + * @author Leo Fajardo (@leorw) + */ + $fs->switch_to_blog( $blog_id ); + } + + if ( is_object( $user ) ) { + if ( $is_network_activation_or_migration && ! $has_valid_blog_id ) { + // If no specific blog ID was provided, activate the license for all sites in the network. + $blog_2_install_map = array(); + $site_ids = array(); + + foreach ( $sites as $site ) { + if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) { + continue; + } + + $install = $fs->get_install_by_blog_id( $site['blog_id'] ); + + if ( is_object( $install ) ) { + $blog_2_install_map[ $site['blog_id'] ] = $install; + } else { + $site_ids[] = $site['blog_id']; + } + } + + if ( ! empty( $blog_2_install_map ) ) { + $result = $fs->activate_license_on_many_installs( $user, $license_key, $blog_2_install_map ); + + if ( true !== $result ) { + $error = FS_Api::is_api_error_object( $result ) ? + $result->error->message : + var_export( $result, true ); + } + } + + if ( empty( $error ) && ! empty( $site_ids ) ) { + $result = $fs->activate_license_on_many_sites( $user, $license_key, $site_ids ); + + if ( true !== $result ) { + $error = FS_Api::is_api_error_object( $result ) ? + $result->error->message : + var_export( $result, true ); + } + } + } else { + if ( $fs->is_registered() ) { + $params = array( + 'license_key' => $fs->apply_filters( 'license_key', $license_key ) + ); + + $install_ids = array(); + + $change_owner = FS_User::is_valid_id( $license_owner_id ); + + if ( $change_owner ) { + $params['user_id'] = $license_owner_id; + + $installs_info_by_slug_map = $fs->get_parent_and_addons_installs_info(); + + foreach ( $installs_info_by_slug_map as $slug => $install_info ) { + $install_ids[ $slug ] = $install_info['install']->id; + } + + $params['install_ids'] = implode( ',', array_values( $install_ids ) ); + } + + $api = $fs->get_api_site_scope(); + + $install = $api->call( $fs->add_show_pending( '/' ), 'put', $params ); + + if ( FS_Api::is_api_error( $install ) ) { + $error = FS_Api::is_api_error_object( $install ) ? + $install->error->message : + var_export( $install->error, true ); + } else { + $fs->reconnect_locally( $has_valid_blog_id ); + + if ( + $change_owner && + // If successful ownership change. + $fs->get_user()->id != $install->user_id + ) { + $fs->complete_ownership_change_by_license( $install->user_id, $install_ids ); + } + } + } else /* ( $fs->is_addon() && $fs->get_parent_instance()->is_registered() ) */ { + $result = $fs->activate_license_on_site( $user, $license_key ); + + if ( true !== $result ) { + $error = FS_Api::is_api_error_object( $result ) ? + $result->error->message : + var_export( $result, true ); + } + } + } + + if ( empty( $error ) ) { + $fs->network_upgrade_mode_completed(); + + $fs->_user = $user; + + if ( fs_is_network_admin() && ! $has_valid_blog_id ) { + $fs->_site = $fs->get_network_install(); + } + + $fs->_sync_license( true, $has_valid_blog_id ); + + $this->maybe_sync_install_user(); + + $next_page = $fs->is_addon() ? + $fs->get_parent_instance()->get_account_url() : + $fs->get_after_activation_url( 'after_connect_url' ); + } + } else { + $next_page = $fs->opt_in( + false, + false, + false, + $license_key, + false, + false, + false, + $is_marketing_allowed, + $sites + ); + + if ( isset( $next_page->error ) ) { + $error = $next_page->error; + } else { + if ( $is_network_activation_or_migration ) { + /** + * Get the list of sites that were just opted-in (and license activated). + * This is an optimization for the next part below saving some DB queries. + */ + $connected_sites = array(); + foreach ( $sites as $site ) { + if ( isset( $site['blog_id'] ) && is_numeric( $site['blog_id'] ) ) { + $connected_sites[ $site['blog_id'] ] = true; + } + } + + $all_sites = self::get_sites(); + $pending_sites = array(); + + /** + * Check if there are any sites that are not connected, skipped, nor delegated. For every site that falls into that category, if the product is freemium, skip the connection. If the product is premium only, delegate the connection to the site administrator. + * + * @author Vova Feldman (@svovaf) + */ + foreach ( $all_sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + if ( isset( $connected_sites[ $blog_id ] ) ) { + // Site was just connected. + continue; + } + + if ( $fs->is_installed_on_site( $blog_id ) ) { + // Site was already connected before. + continue; + } + + if ( $fs->is_site_delegated_connection( $blog_id ) ) { + // Site's connection was delegated. + continue; + } + + if ( $fs->is_anonymous_site( $blog_id ) ) { + // Site connection was already skipped. + continue; + } + + $pending_sites[] = self::get_site_info( $site ); + } + + if ( ! empty( $pending_sites ) ) { + if ( $fs->is_freemium() && $fs->is_enable_anonymous() ) { + $fs->skip_connection( $pending_sites ); + } else { + $fs->delegate_connection( $pending_sites ); + } + } + } + } + } + + if ( false === $error && true === $fs->_storage->require_license_activation ) { + $fs->_storage->require_license_activation = false; + } + + $result = array( + 'success' => ( false === $error ) + ); + + if ( false !== $error ) { + $result['error'] = $fs->apply_filters( 'opt_in_error_message', $error ); + } else { + if ( $fs->is_addon() || $fs->has_addons() ) { + /** + * Purge the valid user licenses cache so that when the "Account" or the "Add-Ons" page is loaded, + * an updated valid user licenses collection will be fetched from the server which is used to also + * update the account add-ons (add-ons the user has licenses for). + * + * @author Leo Fajardo (@leorw) + * @since 2.2.4 + */ + $fs->purge_valid_user_licenses_cache(); + } + + $result['next_page'] = $next_page; + } + + return $result; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + * + * @return array { + * @key string Product slug. + * @value array { + * @property FS_Site $site + * @property FS_Plugin_License $license + * } + * } + */ + private function get_parent_and_addons_installs_info() { + $fs = $this->is_addon() ? + $this->get_parent_instance() : + $this; + + $installed_addons_ids = array(); + + $installed_addons_instances = $fs->get_installed_addons(); + foreach ( $installed_addons_instances as $instance ) { + $installed_addons_ids[] = $instance->get_id(); + } + + $addons_ids = array_unique( array_merge( + $installed_addons_ids, + $fs->get_updated_account_addons() + ) ); + + // Add parent product info. + $installs_info_by_slug_map = array( + $fs->get_slug() => array( + 'install' => $fs->get_site(), + 'license' => $fs->_get_license() + ) + ); + + foreach ( $addons_ids as $addon_id ) { + $is_installed = isset( $installed_addons_ids_map[ $addon_id ] ); + + $addon_info = $fs->_get_addon_info( $addon_id, $is_installed ); + + if ( ! $addon_info['is_connected'] ) { + // Add-on is not associated with an install entity. + continue; + } + + $installs_info_by_slug_map[ $addon_info['slug'] ] = array( + 'install' => $addon_info['site'], + 'license' => isset( $addon_info['license'] ) ? + $addon_info['license'] : + null + ); + } + + return $installs_info_by_slug_map; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3.1 + */ + function _network_activate_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'network_activate' ); + + $plugin_id = fs_request_get( 'module_id', '', 'post' ); + $fs = ( $plugin_id == $this->_module_id ) ? + $this : + $this->get_addon_instance( $plugin_id ); + + $error = false; + + $sites = fs_request_get( 'sites', array(), 'post' ); + if ( is_array( $sites ) && ! empty( $sites ) ) { + $sites_by_action = array( + 'allow' => array(), + 'delegate' => array(), + 'skip' => array() + ); + + foreach ( $sites as $site ) { + $sites_by_action[ $site['action'] ][] = $site; + } + + $total_sites = count( $sites ); + $total_sites_to_delegate = count( $sites_by_action['delegate'] ); + + $next_page = ''; + + $has_any_install = fs_request_get_bool( 'has_any_install' ); + + if ( $total_sites === $total_sites_to_delegate && + ! $this->is_network_upgrade_mode() && + ! $has_any_install + ) { + $this->delegate_connection(); + } else { + if ( ! empty( $sites_by_action['delegate'] ) ) { + $this->delegate_connection( $sites_by_action['delegate'] ); + } + + if ( ! empty( $sites_by_action['skip'] ) ) { + $this->skip_connection( $sites_by_action['skip'] ); + } + + if ( empty( $sites_by_action['allow'] ) ) { + if ( $has_any_install ) { + $first_install = $fs->find_first_install(); + + if ( ! is_null( $first_install ) ) { + $fs->_site = $first_install['install']; + $fs->_storage->network_install_blog_id = $first_install['blog_id']; + + $fs->_user = self::_get_user_by_id( $fs->_site->user_id ); + $fs->_storage->network_user_id = $fs->_user->id; + } + } + } else { + if ( ! $fs->is_registered() || ! $this->_is_network_active ) { + $next_page = $fs->opt_in( + false, + false, + false, + false, + false, + false, + false, + fs_request_get_bool( 'is_marketing_allowed', null ), + $sites_by_action['allow'] + ); + } else { + $next_page = $fs->install_with_user( + $this->get_network_user(), + false, + false, + false, + true, + $sites_by_action['allow'] + ); + } + + if ( is_object( $next_page ) && isset( $next_page->error ) ) { + $error = $next_page->error; + } + } + } + + if ( empty( $next_page ) ) { + $next_page = $this->get_after_activation_url( 'after_network_activation_url' ); + } + } else { + $error = $this->get_text_inline( 'Invalid site details collection.', 'invalid_site_details_collection' ); + } + + $result = array( + 'success' => ( false === $error ) + ); + + if ( false !== $error ) { + $result['error'] = $error; + } else { + $result['next_page'] = $next_page; + } + + echo json_encode( $result ); + + exit; + } + + /** + * Billing update AJAX callback. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + */ + function _update_billing_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'update_billing' ); + + if ( ! $this->is_user_admin() ) { + // Only for admins. + self::shoot_ajax_failure(); + } + + $billing = fs_request_get( 'billing' ); + + $api = $this->get_api_user_scope(); + $result = $api->call( '/billing.json', 'put', array_merge( $billing, array( + 'plugin_id' => $this->get_parent_id(), + ) ) ); + + if ( ! $this->is_api_result_entity( $result ) ) { + self::shoot_ajax_failure(); + } + + // Purge cached billing. + $this->get_api_user_scope()->purge_cache( 'billing.json' ); + + self::shoot_ajax_success(); + } + + /** + * Trial start for anonymous users (AJAX callback). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + */ + function _start_trial_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'start_trial' ); + + if ( ! $this->is_user_admin() ) { + // Only for admins. + self::shoot_ajax_failure(); + } + + $trial_data = fs_request_get( 'trial' ); + + $next_page = $this->opt_in( + false, + false, + false, + false, + false, + $trial_data['plan_id'] + ); + + if ( is_object( $next_page ) && $this->is_api_error( $next_page ) ) { + self::shoot_ajax_failure( + isset( $next_page->error ) ? + $next_page->error->message : + var_export( $next_page, true ) + ); + } + + $this->shoot_ajax_success( array( + 'next_page' => $next_page, + ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.0 + */ + function _resend_license_key_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'resend_license_key' ); + + $email_address = sanitize_email( trim( fs_request_get( 'email', '', 'post' ) ) ); + + if ( empty( $email_address ) ) { + exit; + } + + $error = false; + + $api = $this->get_api_plugin_scope(); + $result = $api->call( '/licenses/resend.json', 'post', + array( + 'email' => $email_address, + 'url' => home_url(), + ) + ); + + if ( is_object( $result ) && isset( $result->error ) ) { + $error = $result->error; + + if ( in_array( $error->code, array( 'invalid_email', 'no_user' ) ) ) { + $error = $this->get_text_inline( "We couldn't find your email address in the system, are you sure it's the right address?", 'email-not-found' ); + } else if ( 'no_license' === $error->code ) { + $error = $this->get_text_inline( "We can't see any active licenses associated with that email address, are you sure it's the right address?", 'no-active-licenses' ); + } else { + $error = $error->message; + } + } + + $licenses = array( + 'success' => ( false === $error ) + ); + + if ( false !== $error ) { + $licenses['error'] = sprintf( '%s... %s', $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ), strtolower( $error ) ); + } + + echo json_encode( $licenses ); + + exit; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.8 + * + * @var string + */ + private static $_pagenow; + + /** + * Get current page or the referer if executing a WP AJAX request. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.8 + * + * @return string + */ + static function get_current_page() { + if ( ! isset( self::$_pagenow ) ) { + global $pagenow; + if ( empty( $pagenow ) && is_admin() && is_multisite() ) { + /** + * It appears that `$pagenow` is not yet initialized in some network admin pages when this method + * is called, so initialize it here using some pieces of code from `wp-includes/vars.php`. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + if ( is_network_admin() ) { + preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); + } else if ( is_user_admin() ) { + preg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); + } else { + preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); + } + + $pagenow = $self_matches[1]; + $pagenow = trim( $pagenow, '/' ); + $pagenow = preg_replace( '#\?.*?$#', '', $pagenow ); + if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) { + $pagenow = 'index.php'; + } else { + preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches ); + $pagenow = strtolower( $self_matches[1] ); + if ( '.php' !== substr($pagenow, -4, 4) ) + $pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried) + } + } + + self::$_pagenow = $pagenow; + + if ( self::is_ajax() && + 'admin-ajax.php' === $pagenow + ) { + $referer = fs_get_raw_referer(); + + if ( is_string( $referer ) ) { + $parts = explode( '?', $referer ); + + self::$_pagenow = basename( $parts[0] ); + } + } + } + + return self::$_pagenow; + } + + /** + * Helper method to check if user in the plugins page. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @return bool + */ + static function is_plugins_page() { + return ( 'plugins.php' === self::get_current_page() ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + * + * @return bool + */ + static function is_plugin_install_page() { + return ( 'plugin-install.php' === self::get_current_page() ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.2 + * + * @return bool + */ + static function is_updates_page() { + return ( 'update-core.php' === self::get_current_page() ); + } + + /** + * Helper method to check if user in the themes page. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.6 + * + * @return bool + */ + static function is_themes_page() { + return ( 'themes.php' === self::get_current_page() ); + } + + #---------------------------------------------------------------------------------- + #region Affiliation + #---------------------------------------------------------------------------------- + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + * + * @return bool + */ + function has_affiliate_program() { + if ( ! is_object( $this->_plugin ) ) { + return false; + } + + return $this->_plugin->has_affiliate_program(); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.4 + */ + private function fetch_affiliate_terms() { + if ( ! is_object( $this->plugin_affiliate_terms ) ) { + $plugins_api = $this->get_api_plugin_scope(); + $affiliate_terms = $plugins_api->get( '/aff.json?type=affiliation', false ); + + if ( ! $this->is_api_result_entity( $affiliate_terms ) ) { + return; + } + + $this->plugin_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.4 + */ + private function fetch_affiliate_and_custom_terms() { + if ( ! empty( $this->_storage->affiliate_application_data ) ) { + $application_data = $this->_storage->affiliate_application_data; + $flush = ( ! isset( $application_data['status'] ) || 'pending' === $application_data['status'] ); + + $users_api = $this->get_api_user_scope(); + $result = $users_api->get( "/plugins/{$this->_plugin->id}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json", $flush ); + if ( $this->is_api_result_object( $result, 'affiliates' ) ) { + if ( ! empty( $result->affiliates ) ) { + $affiliate = new FS_Affiliate( $result->affiliates[0] ); + + if ( ! isset( $application_data['status'] ) || $application_data['status'] !== $affiliate->status ) { + $application_data['status'] = $affiliate->status; + $this->_storage->affiliate_application_data = $application_data; + } + + if ( $affiliate->is_using_custom_terms ) { + $affiliate_terms = $users_api->get( "/plugins/{$this->_plugin->id}/affiliates/{$affiliate->id}/aff/{$affiliate->custom_affiliate_terms_id}.json", $flush ); + if ( $this->is_api_result_entity( $affiliate_terms ) ) { + $this->custom_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms ); + } + } + + $this->affiliate = $affiliate; + } + } + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + */ + private function fetch_affiliate_and_terms() { + $this->_logger->entrance(); + + $this->fetch_affiliate_terms(); + $this->fetch_affiliate_and_custom_terms(); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + * + * @return FS_Affiliate + */ + function get_affiliate() { + return $this->affiliate; + } + + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + * + * @return FS_AffiliateTerms + */ + function get_affiliate_terms() { + return is_object( $this->custom_affiliate_terms ) ? + $this->custom_affiliate_terms : + $this->plugin_affiliate_terms; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + */ + function _submit_affiliate_application() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'submit_affiliate_application' ); + + if ( ! $this->is_user_admin() ) { + // Only for admins. + self::shoot_ajax_failure(); + } + + $affiliate = fs_request_get( 'affiliate' ); + + if ( empty( $affiliate['promotion_methods'] ) ) { + unset( $affiliate['promotion_methods'] ); + } + + if ( ! empty( $affiliate['additional_domains'] ) ) { + $affiliate['additional_domains'] = array_unique( $affiliate['additional_domains'] ); + } + + if ( ! $this->is_registered() ) { + // Opt in but don't track usage. + $next_page = $this->opt_in( + false, + false, + false, + false, + false, + false, + true + ); + + if ( is_object( $next_page ) && $this->is_api_error( $next_page ) ) { + self::shoot_ajax_failure( + isset( $next_page->error ) ? + $next_page->error->message : + var_export( $next_page, true ) + ); + } else if ( $this->is_pending_activation() ) { + self::shoot_ajax_failure( $this->get_text_inline( 'Account is pending activation.', 'account-is-pending-activation' ) ); + } + } + + $this->fetch_affiliate_terms(); + + $api = $this->get_api_user_scope(); + $result = $api->call( + ( "/plugins/{$this->_plugin->id}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json" ), + 'post', + $affiliate + ); + + if ( $this->is_api_error( $result ) ) { + self::shoot_ajax_failure( + isset( $result->error ) ? + $result->error->message : + var_export( $result, true ) + ); + } else { + if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) { + $this->_admin_notices->remove_sticky( 'affiliate_program' ); + } + + $affiliate_application_data = array( + 'status' => 'pending', + 'stats_description' => $affiliate['stats_description'], + 'promotion_method_description' => $affiliate['promotion_method_description'], + ); + + if ( ! empty( $affiliate['promotion_methods'] ) ) { + $affiliate_application_data['promotion_methods'] = $affiliate['promotion_methods']; + } + + if ( ! empty( $affiliate['domain'] ) ) { + $affiliate_application_data['domain'] = $affiliate['domain']; + } + + if ( ! empty( $affiliate['additional_domains'] ) ) { + $affiliate_application_data['additional_domains'] = $affiliate['additional_domains']; + } + + $this->_storage->affiliate_application_data = $affiliate_application_data; + } + + // Purge cached affiliate. + $api->purge_cache( 'affiliate.json' ); + + self::shoot_ajax_success( $result ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + * + * @return array|null + */ + function get_affiliate_application_data() { + if ( empty( $this->_storage->affiliate_application_data ) ) { + return null; + } + + return $this->_storage->affiliate_application_data; + } + + #endregion Affiliation ------------------------------------------------------------ + + #---------------------------------------------------------------------------------- + #region URL Generators + #---------------------------------------------------------------------------------- + + /** + * Alias to pricing_url(). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @uses pricing_url() + * + * @param string $period Billing cycle + * @param bool $is_trial + * + * @return string + */ + function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) { + return $this->pricing_url( $period, $is_trial ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @uses get_upgrade_url() + * + * @return string + */ + function get_trial_url() { + return $this->get_upgrade_url( WP_FS__PERIOD_ANNUALLY, true ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.4 + * + * @param string $new_version + * + * @return string + */ + function version_upgrade_checkout_link( $new_version ) { + if ( ! is_object( $this->_license ) ) { + $url = $this->pricing_url(); + + $purchase_license_text = $this->get_text_inline( 'Buy a license now', 'buy-license-now' ); + } else { + $subscription = $this->_get_subscription( $this->_license->id ); + + $url = $this->checkout_url( + is_object( $subscription ) ? + ( 1 == $subscription->billing_cycle ? WP_FS__PERIOD_MONTHLY : WP_FS__PERIOD_ANNUALLY ) : + WP_FS__PERIOD_LIFETIME, + false, + array( 'licenses' => $this->_license->quota ) + ); + + $purchase_license_text = $this->get_text_inline( 'Renew your license now', 'renew-license-now' ); + } + + return sprintf( + $this->get_text_inline( '%s to access version %s security & feature updates, and support.', 'x-for-updates-and-support' ), + sprintf( '%s', $url, $purchase_license_text ), + $new_version + ); + } + + /** + * Plugin's pricing URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param string $billing_cycle Billing cycle + * + * @param bool $is_trial + * + * @return string + */ + function pricing_url( $billing_cycle = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) { + $this->_logger->entrance(); + + $params = array( + 'billing_cycle' => $billing_cycle + ); + + if ( $is_trial ) { + $params['trial'] = 'true'; + } + + $url = $this->is_addon() ? + $this->_parent->addon_url( $this->_slug ) : + $this->_get_admin_page_url( 'pricing', $params ); + + return $this->apply_filters( 'pricing_url', $url ); + } + + /** + * Checkout page URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param string $billing_cycle Billing cycle + * @param bool $is_trial + * @param array $extra (optional) Extra parameters, override other query params. + * @param bool|null $network + * + * @return string + */ + function checkout_url( + $billing_cycle = WP_FS__PERIOD_ANNUALLY, + $is_trial = false, + $extra = array(), + $network = null + ) { + $this->_logger->entrance(); + + $params = array( + 'checkout' => 'true', + 'billing_cycle' => $billing_cycle, + ); + + if ( $is_trial ) { + $params['trial'] = 'true'; + } + + /** + * Params in extra override other params. + */ + $params = array_merge( $params, $extra ); + + return $this->_get_admin_page_url( 'pricing', $params, $network ); + } + + /** + * Add-on checkout URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + * + * @param number $addon_id + * @param number $pricing_id + * @param string $billing_cycle + * @param bool $is_trial + * @param bool|null $network + * + * @return string + */ + function addon_checkout_url( + $addon_id, + $pricing_id, + $billing_cycle = WP_FS__PERIOD_ANNUALLY, + $is_trial = false, + $network = null + ) { + return $this->checkout_url( $billing_cycle, $is_trial, array( + 'plugin_id' => $addon_id, + 'pricing_id' => $pricing_id, + ), $network ); + } + + #endregion + + #endregion ------------------------------------------------------------------ + + /** + * Check if plugin has any add-ons. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @since 1.1.7.3 Base logic only on the parameter provided by the developer in the init function. + * + * @return bool + */ + function has_addons() { + $this->_logger->entrance(); + + return $this->_has_addons; + } + + /** + * Check if plugin can work in anonymous mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + * + * @deprecated Please use is_enable_anonymous() instead. + */ + function enable_anonymous() { + return $this->_enable_anonymous; + } + + /** + * Check if plugin can work in anonymous mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9 + * + * @return bool + */ + function is_enable_anonymous() { + return $this->_enable_anonymous; + } + + /** + * Check if plugin is premium only (no free plans). + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9 + * + * @return bool + */ + function is_only_premium() { + return $this->_is_premium_only; + } + + /** + * Checks if the plugin's type is "plugin". The other type is "theme". + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return bool + */ + function is_plugin() { + return ( WP_FS__MODULE_TYPE_PLUGIN === $this->_module_type ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return string + */ + function get_module_type() { + if ( ! isset( $this->_module_type ) ) { + $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() ); + $this->_module_type = $id_slug_type_path_map[ $this->_module_id ]['type']; + } + + return $this->_module_type; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return string + */ + function get_plugin_main_file_path() { + return $this->_plugin_main_file_path; + } + + /** + * Check if module has a premium code version. + * + * Serviceware module might be freemium without any + * premium code version, where the paid features + * are all part of the service. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + * + * @return bool + */ + function has_premium_version() { + return $this->_has_premium_version; + } + + /** + * Check if feature supported with current site's plan. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @todo IMPLEMENT + * + * @param number $feature_id + * + * @throws Exception + */ + function is_feature_supported( $feature_id ) { + throw new Exception( 'not implemented' ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @return bool Is running in SSL/HTTPS + */ + function is_ssl() { + return WP_FS__IS_HTTPS; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool Is running in AJAX call. + * + * @link http://wordpress.stackexchange.com/questions/70676/how-to-check-if-i-am-in-admin-ajax + */ + static function is_ajax() { + return ( defined( 'DOING_AJAX' ) && DOING_AJAX ); + } + + /** + * Check if it's an AJAX call targeted for the current module. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.0 + * + * @param array|string $actions Collection of AJAX actions. + * + * @return bool + */ + function is_ajax_action( $actions ) { + // Verify it's an ajax call. + if ( ! self::is_ajax() ) { + return false; + } + + // Verify the call is relevant for the plugin. + if ( $this->_module_id != fs_request_get( 'module_id' ) ) { + return false; + } + + // Verify it's one of the specified actions. + if ( is_string( $actions ) ) { + $actions = explode( ',', $actions ); + } + + if ( is_array( $actions ) && 0 < count( $actions ) ) { + $ajax_action = fs_request_get( 'action' ); + + foreach ( $actions as $action ) { + if ( $ajax_action === $this->get_action_tag( $action ) ) { + return true; + } + } + } + + return false; + } + + /** + * Check if it's an AJAX call targeted for current request. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.0 + * + * @param array|string $actions Collection of AJAX actions. + * @param number|null $module_id + * + * @return bool + */ + static function is_ajax_action_static( $actions, $module_id = null ) { + // Verify it's an ajax call. + if ( ! self::is_ajax() ) { + return false; + } + + + if ( ! empty( $module_id ) ) { + // Verify the call is relevant for the plugin. + if ( $module_id != fs_request_get( 'module_id' ) ) { + return false; + } + } + + // Verify it's one of the specified actions. + if ( is_string( $actions ) ) { + $actions = explode( ',', $actions ); + } + + if ( is_array( $actions ) && 0 < count( $actions ) ) { + $ajax_action = fs_request_get( 'action' ); + + foreach ( $actions as $action ) { + if ( $ajax_action === self::get_ajax_action_static( $action, $module_id ) ) { + return true; + } + } + } + + return false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + * + * @return bool + */ + static function is_cron() { + return ( defined( 'DOING_CRON' ) && DOING_CRON ); + } + + /** + * Check if a real user is visiting the admin dashboard. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + * + * @return bool + */ + function is_user_in_admin() { + return ( + is_admin() && + ! self::is_ajax() && + ! self::is_cron() && + ( 'admin-post.php' !== self::get_current_page() ) + ); + } + + /** + * Check if a real user is in the customizer view. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + */ + static function is_customizer() { + return is_customize_preview(); + } + + /** + * Check if running in HTTPS and if site's plan matching the specified plan. + * + * @param string $plan + * @param bool $exact + * + * @return bool + */ + function is_ssl_and_plan( $plan, $exact = false ) { + return ( $this->is_ssl() && $this->is_plan( $plan, $exact ) ); + } + + /** + * Construct plugin's settings page URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param string $page + * @param array $params + * @param bool|null $network + * + * @return string + */ + function _get_admin_page_url( $page = '', $params = array(), $network = null ) { + if ( is_null( $network ) ) { + $network = ( + $this->_is_network_active && + ( fs_is_network_admin() || ! $this->is_delegated_connection() ) + ); + } + + if ( 0 < count( $params ) ) { + foreach ( $params as $k => $v ) { + $params[ $k ] = urlencode( $v ); + } + } + + $page_param = $this->_menu->get_slug( $page ); + + if ( empty( $page ) && + // Show the opt-in as an overlay for free wp.org themes or themes without any settings page. + $this->show_opt_in_on_themes_page() + ) { + $params[ $this->get_unique_affix() . '_show_optin' ] = 'true'; + + return add_query_arg( + $params, + $this->admin_url( 'themes.php', 'admin', $network ) + ); + } + + if ( ! $this->has_settings_menu() ) { + if ( ! empty( $page ) ) { + // Module doesn't have a setting page, but since the request is for + // a specific Freemius page, use the admin.php path. + return add_query_arg( array_merge( $params, array( + 'page' => $page_param, + ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); + } else { + if ( $this->is_activation_mode() ) { + /** + * @author Vova Feldman + * @since 1.2.1.6 + * + * If plugin doesn't have a settings page, create one for the opt-in screen. + */ + return add_query_arg( array_merge( $params, array( + 'page' => $this->_slug, + ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); + } else { + // Plugin without a settings page. + return add_query_arg( + $params, + $this->admin_url( 'plugins.php', 'admin', $network ) + ); + } + } + } + + // Module has a submenu settings page. + if ( ! $this->_menu->is_top_level() ) { + $parent_slug = $this->_menu->get_parent_slug(); + $menu_file = ( false !== strpos( $parent_slug, '.php' ) ) ? + $parent_slug : + 'admin.php'; + + return add_query_arg( array_merge( $params, array( + 'page' => $page_param, + ) ), $this->admin_url( $menu_file, 'admin', $network ) ); + } + + // Module has a top level CPT settings page. + if ( $this->_menu->is_cpt() ) { + if ( empty( $page ) && $this->is_activation_mode() ) { + return add_query_arg( array_merge( $params, array( + 'page' => $page_param + ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); + } else { + if ( ! empty( $page ) ) { + $params['page'] = $page_param; + } + + return add_query_arg( + $params, + $this->admin_url( $this->_menu->get_raw_slug(), 'admin', $network ) + ); + } + } + + // Module has a custom top level settings page. + return add_query_arg( array_merge( $params, array( + 'page' => $page_param, + ) ), $this->admin_url( 'admin.php', 'admin', $network ) ); + } + + #-------------------------------------------------------------------------------- + #region Multisite + #-------------------------------------------------------------------------------- + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @return bool + */ + function is_network_active() { + return $this->_is_network_active; + } + + /** + * Delegate activation for the given sites in the network (or all sites if `null`) to site admins. + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param array|null $sites + */ + private function delegate_connection( $sites = null ) { + $this->_logger->entrance(); + + $this->_admin_notices->remove_sticky( 'connect_account' ); + + if ( is_null( $sites ) ) { + // All sites delegation. + $this->_storage->store( 'is_delegated_connection', true, true, true ); + } else { + // Specified sites delegation. + foreach ( $sites as $site ) { + $this->delegate_site_connection( $site['blog_id'] ); + } + } + + $this->network_upgrade_mode_completed(); + } + + /** + * Delegate specific network site conncetion to the site admin. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id + */ + private function delegate_site_connection( $blog_id ) { + $this->_storage->store( 'is_delegated_connection', true, $blog_id, true ); + } + + /** + * Check if super-admin delegated the connection of ALL sites to the site admins. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return bool + */ + function is_network_delegated_connection() { + if ( ! $this->_is_network_active ) { + return false; + } + + return $this->_storage->get( 'is_delegated_connection', false, true ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param int $blog_id + * + * @return bool + */ + function is_site_delegated_connection( $blog_id = 0 ) { + if ( ! $this->_is_network_active ) { + return false; + } + + if ( 0 == $blog_id ) { + $blog_id = get_current_blog_id(); + } + + return $this->_storage->get( 'is_delegated_connection', false, $blog_id ); + } + + /** + * Check if delegated the connection. When running within the the network admin, + * and haven't specified the blog ID, checks if network level delegated. If running + * within a site admin or specified a blog ID, check if delegated the connection for + * the current context site. + * + * If executed outside the the admin, check if delegated the connection + * for the current context site OR the whole network. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id If set, checks if network delegated or blog specific delegated. + * + * @return bool + */ + function is_delegated_connection( $blog_id = 0 ) { + if ( ! $this->_is_network_active ) { + return false; + } + + if ( fs_is_network_admin() && 0 == $blog_id ) { + return $this->is_network_delegated_connection(); + } + + return ( + $this->is_network_delegated_connection() || + $this->is_site_delegated_connection( $blog_id ) + ); + } + + /** + * Check if the current module is active for the site. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id + * + * @return bool + */ + function is_active_for_site( $blog_id ) { + if ( ! is_multisite() ) { + // Not a multisite and this code is executed, means that the plugin is active. + return true; + } + + if ( $this->is_theme() ) { + // All themes are site level activated. + return true; + } + + if ( $this->_is_network_active ) { + // Plugin was network activated so it's active. + return true; + } + + return in_array( $this->_plugin_basename, (array) get_blog_option( $blog_id, 'active_plugins', array() ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @return array Active & public sites collection. + */ + static function get_sites() { + if ( ! is_multisite() ) { + return array(); + } + + /** + * For consistency with get_blog_list() which only return active public sites. + * + * @author Vova Feldman (@svovaf) + */ + $args = array( + /** + * Commented out in order to handle the migration of site options whether the site is public or not. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + */ + // 'public' => 1, + 'archived' => 0, + 'mature' => 0, + 'spam' => 0, + 'deleted' => 0, + ); + + if ( function_exists( 'get_sites' ) ) { + // For WP 4.6 and above. + return get_sites( $args ); + } else if ( function_exists( 'wp_' . 'get_sites' ) ) { + // For WP 3.7 to WP 4.5. + /** + * This is a hack suggested previously proposed by the TRT. Our SDK is compliant with older WP versions and we'd like to keep it that way. + * + * @todo Remove this hack once this false-positive error is removed from the Theme Sniffer. + * + * @since 2.3.3 + * @author Vova Feldman (@svovaf) + */ + $fn = 'wp_' . 'get_sites'; + return $fn( $args ); + } else { + // For WP 3.6 and below. + return get_blog_list( 0, 'all' ); + } + } + + /** + * Checks if a given blog is active. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param $blog_id + * + * @return bool + */ + private static function is_site_active( $blog_id ) { + global $wpdb; + + $blog_info = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d", $blog_id ) ); + + if ( ! is_object( $blog_info ) ) { + return false; + } + + return ( + true == $blog_info->public && + false == $blog_info->archived && + false == $blog_info->mature && + false == $blog_info->spam && + false == $blog_info->deleted + ); + } + + /** + * Get a mapping between the site addresses to their blog IDs. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return array { + * @key string Site address without protocol with a trailing slash. + * @value int Site's blog ID. + * } + */ + private function get_address_to_blog_map() { + $sites = self::get_sites(); + + // Map site addresses to their blog IDs. + $address_to_blog_map = array(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $address = trailingslashit( fs_strip_url_protocol( get_site_url( $blog_id ) ) ); + $address_to_blog_map[ $address ] = $blog_id; + } + + return $address_to_blog_map; + } + + /** + * Get a mapping between the site addresses to their blog IDs. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return array { + * @key int Site's blog ID. + * @value FS_Site Associated install. + * } + */ + function get_blog_install_map() { + $sites = self::get_sites(); + + // Map site blog ID to its install. + $install_map = array(); + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( is_object( $install ) ) { + $install_map[ $blog_id ] = $install; + } + } + + return $install_map; + } + + /** + * Gets a map of module IDs that the given user has opted-in to. + * + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + * + * @param number $fs_user_id + * + * @return array { + * @key number $plugin_id + * @value bool Always true. + * } + */ + private static function get_user_opted_in_module_ids_map( $fs_user_id ) { + self::$_static_logger->entrance(); + + if ( ! is_multisite() ) { + $installs = array_merge( + self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ), + self::get_all_sites( WP_FS__MODULE_TYPE_THEME ) + ); + } else { + $sites = self::get_sites(); + + $installs = array(); + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + + $installs = array_merge( + $installs, + self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id ), + self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id ) + ); + } + } + + $module_ids_map = array(); + foreach ( $installs as $install ) { + if ( is_object( $install ) && + FS_Site::is_valid_id( $install->id ) && + FS_User::is_valid_id( $install->user_id ) && + ( $install->user_id == $fs_user_id ) + ) { + $module_ids_map[ $install->plugin_id ] = true; + } + } + + return $module_ids_map; + } + + /** + * @author Leo Fajardo (@leorw) + * + * @return null|array { + * 'install' => FS_Site Module's install, + * 'blog_id' => string The associated blog ID. + * } + */ + function find_first_install() { + $sites = self::get_sites(); + + foreach ( $sites as $site ) { + $blog_id = self::get_site_blog_id( $site ); + $install = $this->get_install_by_blog_id( $blog_id ); + + if ( is_object( $install ) ) { + return array( + 'install' => $install, + 'blog_id' => $blog_id + ); + } + } + + return null; + } + + /** + * Switches the Freemius site level context to a specified blog. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $blog_id + * @param FS_Site $install + * + * @return bool Since 2.3.1 returns if a switch was made. + */ + function switch_to_blog( $blog_id, FS_Site $install = null ) { + if ( ! is_numeric( $blog_id ) || $blog_id == $this->_context_is_network_or_blog_id ) { + return false; + } + + switch_to_blog( $blog_id ); + $this->_context_is_network_or_blog_id = $blog_id; + + self::$_accounts->set_site_blog_context( $blog_id ); + $this->_storage->set_site_blog_context( $blog_id ); + $this->_storage->set_network_active( $this->_is_network_active, $this->is_delegated_connection( $blog_id ) ); + + $this->_site = is_object( $install ) ? + $install : + $this->get_install_by_blog_id( $blog_id ); + + $this->_user = false; + $this->_licenses = false; + $this->_license = null; + $this->is_whitelabeled = null; + + if ( is_object( $this->_site ) ) { + // Try to fetch user from install. + $this->_user = self::_get_user_by_id( $this->_site->user_id ); + + if ( ! is_object( $this->_user ) && + FS_User::is_valid_id( $this->_storage->prev_user_id ) + ) { + // Try to fetch previously saved user. + $this->_user = self::_get_user_by_id( $this->_storage->prev_user_id ); + + if ( ! is_object( $this->_user ) ) { + // Fallback to network's user. + $this->_user = $this->get_network_user(); + } + } + + $all_plugin_licenses = self::get_all_licenses( $this->_module_id ); + + if ( ! empty( $all_plugin_licenses ) ) { + if ( ! FS_Plugin_License::is_valid_id( $this->_site->license_id ) ) { + $this->_license = null; + } else { + $license_found = false; + foreach ( $all_plugin_licenses as $license ) { + if ( $license->id == $this->_site->license_id ) { + // License found. + $this->_license = $license; + $license_found = true; + break; + } + } + + if ( $license_found ) { + $this->link_license_2_user( $this->_license->id, $this->_user->id ); + } + } + + $this->_licenses = $this->get_user_licenses( $this->_user->id ); + } + } + + unset( $this->_site_api ); + unset( $this->_user_api ); + + return false; + } + + /** + * Restore the blog context to the blog that originally loaded the module. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + function restore_current_blog() { + $this->switch_to_blog( $this->_blog_id ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param array|WP_Site $site + * + * @return int + */ + static function get_site_blog_id( &$site ) { + return ( $site instanceof WP_Site ) ? + $site->blog_id : + ( is_object( $site ) && isset( $site->userblog_id ) ? + $site->userblog_id : + $site['blog_id'] ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param array|WP_Site|null $site + * + * @return array + */ + function get_site_info( $site = null ) { + $this->_logger->entrance(); + + $switched = false; + + if ( is_null( $site ) ) { + $url = get_site_url(); + $name = get_bloginfo( 'name' ); + $blog_id = null; + } else { + $blog_id = self::get_site_blog_id( $site ); + + if ( get_current_blog_id() != $blog_id ) { + switch_to_blog( $blog_id ); + $switched = true; + } + + if ( $site instanceof WP_Site ) { + $url = $site->siteurl; + $name = $site->blogname; + } else { + $url = get_site_url( $blog_id ); + $name = get_bloginfo( 'name' ); + } + } + + $info = array( + 'uid' => $this->get_anonymous_id( $blog_id ), + 'url' => $url, + 'title' => $name, + 'language' => get_bloginfo( 'language' ), + 'charset' => get_bloginfo( 'charset' ), + ); + + if ( is_numeric( $blog_id ) ) { + $info['blog_id'] = $blog_id; + } + + if ( $switched ) { + restore_current_blog(); + } + + return $info; + } + + /** + * Load the module's install based on the blog ID. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int|null $blog_id + * + * @return FS_Site + */ + function get_install_by_blog_id( $blog_id = null ) { + $installs = self::get_all_sites( $this->_module_type, $blog_id ); + $install = isset( $installs[ $this->_slug ] ) ? $installs[ $this->_slug ] : null; + + if ( is_object( $install ) && + is_numeric( $install->id ) && + is_numeric( $install->user_id ) && + FS_Plugin_Plan::is_valid_id( $install->plan_id ) + ) { + // Load site. + $install = clone $install; + } + + return $install; + } + + /** + * Check if module is installed on a specified site. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int|null $blog_id + * + * @return bool + */ + function is_installed_on_site( $blog_id = null ) { + $installs = self::get_all_sites( $this->_module_type, $blog_id ); + $install = isset( $installs[ $this->_slug ] ) ? $installs[ $this->_slug ] : null; + + return ( + is_object( $install ) && + is_numeric( $install->id ) && + is_numeric( $install->user_id ) && + FS_Plugin_Plan::is_valid_id( $install->plan_id ) + ); + } + + /** + * Check if super-admin connected at least one site via the network opt-in. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return bool + */ + function is_network_registered() { + if ( ! $this->_is_network_active ) { + return false; + } + + return FS_User::is_valid_id( $this->_storage->network_user_id ); + } + + /** + * Returns the main user associated with the network. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return FS_User + */ + function get_network_user() { + if ( ! $this->_is_network_active ) { + return null; + } + + return FS_User::is_valid_id( $this->_storage->network_user_id ) ? + self::_get_user_by_id( $this->_storage->network_user_id ) : + null; + } + + /** + * Returns the current context user or the network's main user. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return FS_User + */ + function get_current_or_network_user() { + return ( $this->_user instanceof FS_User ) ? + $this->_user : + $this->get_network_user(); + } + + /** + * Returns the main install associated with the network. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return FS_Site + */ + function get_network_install() { + if ( ! $this->_is_network_active ) { + return null; + } + + return FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ? + $this->get_install_by_blog_id( $this->_storage->network_install_blog_id ) : + null; + } + + /** + * Returns the blog ID that is associated with the main install. + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @return int|null + */ + function get_network_install_blog_id() { + if ( ! $this->_is_network_active ) { + return null; + } + + return FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ? + $this->_storage->network_install_blog_id : + null; + } + + /** + * Returns the current context install or the network's main install. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return FS_Site + */ + function get_current_or_network_install() { + return ( $this->_site instanceof FS_Site ) ? + $this->_site : + $this->get_network_install(); + } + + /** + * Check if executing a site level action from the network level admin. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return false|int If yes, return the requested blog ID. + */ + private function is_network_level_site_specific_action() { + if ( ! $this->_is_network_active ) { + return false; + } + + if ( ! fs_is_network_admin() ) { + return false; + } + + $blog_id = fs_request_get( 'blog_id', '' ); + + return is_numeric( $blog_id ) ? $blog_id : false; + } + + /** + * Check if executing an action from the network level admin. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return bool + */ + private function is_network_level_action() { + return ( $this->_is_network_active && fs_is_network_admin() ); + } + + /** + * Needs to be executed after site deactivation, archive, deletion, or flag as spam. + * The logic updates the network level user and blog, and reschedule the crons if the cron executing site matching the site that is no longer publicly active. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $context_blog_id + */ + private function update_multisite_data_after_site_deactivation( $context_blog_id = 0 ) { + $this->_logger->entrance(); + + if ( $this->_is_network_active ) { + if ( $context_blog_id == $this->_storage->network_install_blog_id ) { + $installs_map = $this->get_blog_install_map(); + + foreach ( $installs_map as $blog_id => $install ) { + /** + * @var FS_Site $install + */ + if ( $context_blog_id == $blog_id ) { + continue; + } + + if ( $install->user_id != $this->_storage->network_user_id ) { + continue; + } + + // Switch reference to a blog that is opted-in and belong to the same super-admin. + $this->_storage->network_install_blog_id = $blog_id; + break; + } + } + } + + if ( $this->is_sync_cron_scheduled() && + $context_blog_id == $this->get_sync_cron_blog_id() + ) { + $this->schedule_sync_cron( WP_FS__SCRIPT_START_TIME, true, $context_blog_id ); + } + + if ( $this->is_install_sync_scheduled() && + $context_blog_id == $this->get_install_sync_cron_blog_id() + ) { + $this->schedule_install_sync( $context_blog_id ); + } + } + + /** + * Executed after site deactivation, archive, or flag as spam. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $context_blog_id + */ + public function _after_site_deactivated_callback( $context_blog_id = 0 ) { + $this->_logger->entrance(); + + $install = $this->get_install_by_blog_id( $context_blog_id ); + + if ( ! is_object( $install ) ) { + // Site not connected. + return; + } + + $this->update_multisite_data_after_site_deactivation( $context_blog_id ); + + $current_blog_id = get_current_blog_id(); + + $this->switch_to_blog( $context_blog_id ); + + // Send deactivation event. + $this->sync_install( array( + 'is_active' => false, + ) ); + + $this->switch_to_blog( $current_blog_id ); + } + + /** + * Executed after site deletion. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $context_blog_id + * @param bool $drop True if site's database tables should be dropped. Default is false. + */ + public function _after_site_deleted_callback( $context_blog_id = 0, $drop = false ) { + $this->_logger->entrance(); + + $install = $this->get_install_by_blog_id( $context_blog_id ); + + if ( ! is_object( $install ) ) { + // Site not connected. + return; + } + + $this->update_multisite_data_after_site_deactivation( $context_blog_id ); + + $current_blog_id = get_current_blog_id(); + + $this->switch_to_blog( $context_blog_id ); + + if ( $drop ) { + // Delete install if dropping site DB. + $this->delete_account_event(); + } else { + // Send deactivation event. + $this->sync_install( array( + 'is_active' => false, + ) ); + } + + $this->switch_to_blog( $current_blog_id ); + } + + /** + * Executed after site re-activation. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param int $context_blog_id + */ + public function _after_site_reactivated_callback( $context_blog_id = 0 ) { + $this->_logger->entrance(); + + $install = $this->get_install_by_blog_id( $context_blog_id ); + + if ( ! is_object( $install ) ) { + // Site not connected. + return; + } + + if ( ! self::is_site_active( $context_blog_id ) ) { + // Site not yet active (can be in spam mode, archived, deleted...). + return; + } + + $current_blog_id = get_current_blog_id(); + + $this->switch_to_blog( $context_blog_id ); + + // Send re-activation event. + $this->sync_install( array( + 'is_active' => true, + ) ); + + $this->switch_to_blog( $current_blog_id ); + } + + #endregion Multisite + + /** + * @author Leo Fajardo (@leorw) + * + * @param string $path + * @param string $scheme + * @param bool $network + * + * @return string + */ + private function admin_url( $path = '', $scheme = 'admin', $network = true ) { + return ( $this->_is_network_active && $network ) ? + network_admin_url( $path, $scheme ) : + admin_url( $path, $scheme ); + } + + /** + * Check if currently in a specified admin page. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @param string $page + * + * @return bool + */ + function is_admin_page( $page ) { + return ( $this->_menu->get_slug( $page ) === fs_request_get( 'page', '', 'get' ) ); + } + + /** + * Check if currently in the product's main admin page. + * + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @return bool + */ + function is_main_admin_page() { + return $this->is_admin_page( '' ); + } + + /** + * Get module's main admin setting page URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return string + */ + function main_menu_url() { + return $this->_menu->main_menu_url(); + } + + /** + * Check if currently on the theme's setting page or + * on any of the Freemius added pages (via tabs). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + * + * @deprecated Please use is_product_settings_page() instead; + */ + function is_theme_settings_page() { + return $this->is_product_settings_page(); + } + + /** + * Check if currently on the product's main setting page or on any of the Freemius added pages (via tabs). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + */ + function is_product_settings_page() { + return fs_starts_with( + fs_request_get( 'page', '', 'get' ), + $this->_menu->get_slug() + ); + } + + /** + * Plugin's account page + sync license URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.9.1 + * + * @param bool|number $plugin_id + * @param bool $add_action_nonce + * @param array $params + * + * @return string + */ + function _get_sync_license_url( $plugin_id = false, $add_action_nonce = true, $params = array() ) { + if ( is_numeric( $plugin_id ) ) { + $params['plugin_id'] = $plugin_id; + } + + return $this->get_account_url( + $this->get_unique_affix() . '_sync_license', + $params, + $add_action_nonce + ); + } + + /** + * Plugin's account URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param bool|string $action + * @param array $params + * + * @param bool $add_action_nonce + * + * @return string + */ + function get_account_url( $action = false, $params = array(), $add_action_nonce = true ) { + if ( is_string( $action ) ) { + $params['fs_action'] = $action; + } + + self::require_pluggable_essentials(); + + return ( $add_action_nonce && is_string( $action ) ) ? + fs_nonce_url( $this->_get_admin_page_url( 'account', $params ), $action ) : + $this->_get_admin_page_url( 'account', $params ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.0 + * + * @param string $tab + * @param bool $action + * @param array $params + * @param bool $add_action_nonce + * + * @return string + * + * @uses get_account_url() + */ + function get_account_tab_url( $tab, $action = false, $params = array(), $add_action_nonce = true ) { + $params['tab'] = $tab; + + return $this->get_account_url( $action, $params, $add_action_nonce ); + } + + /** + * Plugin's account URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param bool|string $topic + * @param bool|string $message + * + * @return string + */ + function contact_url( $topic = false, $message = false ) { + $params = array(); + if ( is_string( $topic ) ) { + $params['topic'] = $topic; + } + if ( is_string( $message ) ) { + $params['message'] = $message; + } + + if ( $this->is_addon() ) { + $params['addon_id'] = $this->get_id(); + + return $this->get_parent_instance()->_get_admin_page_url( 'contact', $params ); + } else { + return $this->_get_admin_page_url( 'contact', $params ); + } + } + + /** + * Add-on direct info URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.0 + * + * @param string $slug + * + * @return string + */ + function addon_url( $slug ) { + return $this->_get_admin_page_url( 'addons', array( + 'slug' => $slug + ) ); + } + + /** + * Add-ons URL. + * + * @author Vova Feldman (@svovaf) + * @since 2.4.5 + * + * @return string + */ + function get_addons_url() { + return $this->_get_admin_page_url( 'addons' ); + } + + /* Logger + ------------------------------------------------------------------------------------------------------------------*/ + /** + * @param string $id + * @param bool $prefix_slug + * + * @return FS_Logger + */ + function get_logger( $id = '', $prefix_slug = true ) { + return FS_Logger::get_logger( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id ); + } + + /** + * Note: This method is used externally so don't delete it. + * + * @param $id + * @param bool $load_options + * @param bool $prefix_slug + * + * @return FS_Option_Manager + */ + function get_options_manager( $id, $load_options = false, $prefix_slug = true ) { + return FS_Option_Manager::get_manager( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id, $load_options ); + } + + /* Security + ------------------------------------------------------------------------------------------------------------------*/ + private static function _encrypt( $str ) { + if ( is_null( $str ) ) { + return null; + } + + /** + * The encrypt/decrypt functions are used to protect + * the user from messing up with some of the sensitive + * data stored for the module as a JSON in the database. + * + * I used the same suggested hack by the theme review team. + * For more details, look at the function `Base64UrlDecode()` + * in `./sdk/FreemiusBase.php`. + * + * @todo Remove this hack once the base64 error is removed from the Theme Check. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2 + */ + $fn = 'base64' . '_encode'; + + return $fn( $str ); + } + + static function _decrypt( $str ) { + if ( is_null( $str ) ) { + return null; + } + + /** + * The encrypt/decrypt functions are used to protect + * the user from messing up with some of the sensitive + * data stored for the module as a JSON in the database. + * + * I used the same suggested hack by the theme review team. + * For more details, look at the function `Base64UrlDecode()` + * in `./sdk/FreemiusBase.php`. + * + * @todo Remove this hack once the base64 error is removed from the Theme Check. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2 + */ + $fn = 'base64' . '_decode'; + + return $fn( $str ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param FS_Entity $entity + * + * @return FS_Entity Return an encrypted clone entity. + */ + private static function _encrypt_entity( FS_Entity $entity ) { + $clone = clone $entity; + $props = get_object_vars( $entity ); + + foreach ( $props as $key => $val ) { + $clone->{$key} = self::_encrypt( $val ); + } + + return $clone; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param FS_Entity $entity + * + * @return FS_Entity Return an decrypted clone entity. + */ + private static function decrypt_entity( FS_Entity $entity ) { + $clone = clone $entity; + $props = get_object_vars( $entity ); + + foreach ( $props as $key => $val ) { + $clone->{$key} = self::_decrypt( $val ); + } + + return $clone; + } + + /** + * Tries to activate account based on POST params. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @deprecated Not in use, outdated. + */ + function _activate_account() { + if ( $this->is_registered() ) { + // Already activated. + return; + } + + self::_clean_admin_content_section(); + + if ( fs_request_is_action( 'activate' ) && fs_request_is_post() ) { +// check_admin_referer( 'activate_' . $this->_plugin->public_key ); + + // Verify matching plugin details. + if ( $this->_plugin->id != fs_request_get( 'plugin_id' ) || $this->_slug != fs_request_get( 'plugin_slug' ) ) { + return; + } + + $user = new FS_User(); + $user->id = fs_request_get( 'user_id' ); + $user->public_key = fs_request_get( 'user_public_key' ); + $user->secret_key = fs_request_get( 'user_secret_key' ); + $user->email = fs_request_get( 'user_email' ); + $user->first = fs_request_get( 'user_first' ); + $user->last = fs_request_get( 'user_last' ); + $user->is_verified = fs_request_get_bool( 'user_is_verified' ); + + $site = new FS_Site(); + $site->id = fs_request_get( 'install_id' ); + $site->public_key = fs_request_get( 'install_public_key' ); + $site->secret_key = fs_request_get( 'install_secret_key' ); + $site->plan_id = fs_request_get( 'plan_id' ); + + $plans = array(); + $plans_data = json_decode( urldecode( fs_request_get( 'plans' ) ) ); + foreach ( $plans_data as $p ) { + $plan = new FS_Plugin_Plan( $p ); + if ( $site->plan_id == $plan->id ) { + $plan->title = fs_request_get( 'plan_title' ); + $plan->name = fs_request_get( 'plan_name' ); + } + + $plans[] = $plan; + } + + $this->_set_account( $user, $site, $plans ); + + // Reload the page with the keys. + fs_redirect( $this->_get_admin_page_url() ); + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @param string $email + * + * @return FS_User|false + */ + static function _get_user_by_email( $email ) { + self::$_static_logger->entrance(); + + $email = trim( strtolower( $email ) ); + + $users = self::get_all_users(); + + if ( is_array( $users ) ) { + foreach ( $users as $user ) { + if ( $email === trim( strtolower( $user->email ) ) ) { + return $user; + } + } + } + + return false; + } + + #---------------------------------------------------------------------------------- + #region Account (Loading, Updates & Activation) + #---------------------------------------------------------------------------------- + + /*** + * Load account information (user + site). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + */ + private function _load_account() { + $this->_logger->entrance(); + + $this->do_action( 'before_account_load' ); + + $users = self::get_all_users(); + $plans = self::get_all_plans( $this->_module_type ); + + if ( $this->_logger->is_on() && is_admin() ) { + $this->_logger->log( 'users = ' . var_export( $users, true ) ); + $this->_logger->log( 'plans = ' . var_export( $plans, true ) ); + } + + $site = fs_is_network_admin() ? + $this->get_network_install() : + $this->get_install_by_blog_id(); + + if ( fs_is_network_admin() && + $this->is_network_active() && + ! is_object( $site ) && + FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) + ) { + $first_install = $this->find_first_install(); + + if ( is_null( $first_install ) ) { + unset( $this->_storage->network_install_blog_id ); + } else { + $site = $first_install['install']; + $this->_storage->network_install_blog_id = $first_install['blog_id']; + } + } + + if ( is_object( $site ) && + is_numeric( $site->id ) && + is_numeric( $site->user_id ) && + FS_Plugin_Plan::is_valid_id( $site->plan_id ) + ) { + // Load site. + $this->_site = $site; + + // Load plans. + $this->_plans = $plans[ $this->_slug ]; + if ( ! is_array( $this->_plans ) || empty( $this->_plans ) ) { + $this->_sync_plans(); + } else { + for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { + if ( $this->_plans[ $i ] instanceof FS_Plugin_Plan ) { + $this->_plans[ $i ] = self::decrypt_entity( $this->_plans[ $i ] ); + } else { + unset( $this->_plans[ $i ] ); + } + } + } + } + + $user = null; + if ( fs_is_network_admin() && $this->_is_network_active ) { + $user = $this->get_network_user(); + } + + if ( is_object( $user ) ) { + $this->_user = clone $user; + } else if ( $this->_site ) { + $user = self::_get_user_by_id( $this->_site->user_id ); + + if ( ! is_object( $user ) && FS_User::is_valid_id( $this->_storage->prev_user_id ) ) { + /** + * Try to load the previous owner. This recovery is used for the following use-case: + * 1. Opt-in + * 2. Cloning site1 to site2 + * 3. Ownership switch in site1 (same applies for site2) + * 4. Install data sync on site2 + * 5. Now site2's install is associated with the new owner which does not exists locally. + */ + $user = self::_get_user_by_id( $this->_storage->prev_user_id ); + } + + if ( ! is_object( $user ) ) { + /** + * This is a special fault tolerance mechanism to handle a scenario that the user data is missing. + */ + $user = $this->sync_user_by_current_install(); + } + + $this->_user = ( $user instanceof FS_User ) ? + clone $user : + null; + } + + if ( is_object( $this->_user ) ) { + // Load licenses. + $this->_licenses = $this->get_user_licenses( $this->_user->id ); + } + + if ( is_object( $this->_site ) ) { + $this->_license = $this->_get_license_by_id( $this->_site->license_id ); + + if ( $this->_site->version != $this->get_plugin_version() ) { + // If stored install version is different than current installed plugin version, + // then update plugin version event. + $this->update_plugin_version_event(); + } + } + + if ( true === $this->_storage->require_license_activation && + ! fs_request_get_bool( 'require_license', true ) + ) { + $this->_storage->require_license_activation = false; + } + + if ( $this->is_theme() ) { + $this->_register_account_hooks(); + } + } + + /** + * Special user recovery mechanism. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number|null $site_user_id + * + * @return \FS_User|mixed + */ + private function sync_user_by_current_install( $site_user_id = null ) { + $site_user_id = FS_Site::is_valid_id( $site_user_id ) ? + $site_user_id : + $this->_site->user_id; + + $api = $this->get_api_site_scope(); + + $uid = $this->get_anonymous_id(); + $request_path = "/users/{$site_user_id}.json?uid={$uid}"; + + $result = $api->get( $request_path, false, WP_FS__TIME_10_MIN_IN_SEC ); + + if ( $this->is_api_result_entity( $result ) ) { + $user = new FS_User( $result ); + $this->_user = $user; + $this->_store_user(); + + return $user; + } + + $error_code = FS_Api::get_error_code( $result ); + + if ( in_array( $error_code, array( 'invalid_unique_id', 'user_cannot_be_recovered' ) ) ) { + /** + * Those API errors will continue coming and are not recoverable with the + * current site's data. Therefore, extend the API call's cached result to 7 days. + */ + $api->update_cache_expiration( $request_path, WP_FS__TIME_WEEK_IN_SEC ); + } + + return $result; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param FS_User $user + * @param FS_Site $site + * @param bool|array $plans + */ + private function _set_account( FS_User $user, FS_Site $site, $plans = false ) { + $site->user_id = $user->id; + + $this->_site = $site; + $this->_user = $user; + if ( false !== $plans ) { + $this->_plans = $plans; + } + + $this->send_install_update(); + + $this->_store_account(); + + } + + /** + * Get a sanitized array with the WordPress version, SDK version, and PHP version. + * Each version is trimmed after the 16th char. + * + * @author Vova Feldman (@svovaf) + * @since 2.2.1 + * + * @return array + */ + private function get_versions() { + $versions = array(); + $versions['platform_version'] = get_bloginfo( 'version' ); + $versions['sdk_version'] = $this->version; + $versions['programming_language_version'] = phpversion(); + + foreach ( $versions as $k => $version ) { + if ( is_string( $versions[ $k ] ) && ! empty( $versions[ $k ] ) ) { + $versions[ $k ] = substr( $versions[ $k ], 0, 16 ); + } + } + + return $versions; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @return bool + */ + function has_beta_update() { + return ( + ! empty( $this->_storage->beta_data ) && + ( true === $this->_storage->beta_data['is_beta'] ) && + version_compare( $this->_storage->beta_data['version'], $this->get_plugin_version(), '>' ) + ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @return bool + */ + function is_beta() { + return ( + ! empty( $this->_storage->beta_data ) && + ( true === $this->_storage->beta_data['is_beta'] ) && + ( $this->get_plugin_version() === $this->_storage->beta_data['version'] ) + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @param array $override_with + * @param bool|int|null $network_level_or_blog_id If true, return params for network level opt-in. If integer, get params for specified blog in the network. + * + * @return array + */ + function get_opt_in_params( $override_with = array(), $network_level_or_blog_id = null ) { + $this->_logger->entrance(); + + $current_user = self::_get_current_wp_user(); + + $activation_action = $this->get_unique_affix() . '_activate_new'; + $return_url = $this->is_anonymous() ? + // If skipped already, then return to the account page. + $this->get_account_url( $activation_action, array(), false ) : + // Return to the module's main page. + $this->get_after_activation_url( 'after_connect_url', array( 'fs_action' => $activation_action ) ); + + $versions = $this->get_versions(); + + $params = array_merge( $versions, array( + 'user_firstname' => $current_user->user_firstname, + 'user_lastname' => $current_user->user_lastname, + 'user_nickname' => $current_user->user_nicename, + 'user_email' => $current_user->user_email, + 'user_ip' => WP_FS__REMOTE_ADDR, + 'plugin_slug' => $this->_slug, + 'plugin_id' => $this->get_id(), + 'plugin_public_key' => $this->get_public_key(), + 'plugin_version' => $this->get_plugin_version(), + 'return_url' => fs_nonce_url( $return_url, $activation_action ), + 'account_url' => fs_nonce_url( $this->_get_admin_page_url( + 'account', + array( 'fs_action' => 'sync_user' ) + ), 'sync_user' ), + 'is_premium' => $this->is_premium(), + 'is_active' => true, + 'is_uninstalled' => false, + ) ); + + if ( $this->is_addon() ) { + $parent_fs = $this->get_parent_instance(); + + $params['parent_plugin_slug'] = $parent_fs->_slug; + $params['parent_plugin_id'] = $parent_fs->get_id(); + } + + if ( true === $network_level_or_blog_id ) { + if ( ! isset( $override_with['sites'] ) ) { + $params['sites'] = $this->get_sites_for_network_level_optin(); + } + } else { + $site = is_numeric( $network_level_or_blog_id ) ? + array( 'blog_id' => $network_level_or_blog_id ) : + null; + + $site = $this->get_site_info( $site ); + + $params = array_merge( $params, array( + 'site_uid' => $site['uid'], + 'site_url' => $site['url'], + 'site_name' => $site['title'], + 'language' => $site['language'], + 'charset' => $site['charset'], + ) ); + } + + if ( $this->is_pending_activation() && + ! empty( $this->_storage->pending_license_key ) + ) { + $params['license_key'] = $this->_storage->pending_license_key; + } + + if ( WP_FS__SKIP_EMAIL_ACTIVATION && $this->has_secret_key() ) { + // Even though rand() is known for its security issues, + // the timestamp adds another layer of protection. + // It would be very hard for an attacker to get the secret key form here. + // Plus, this should never run in production since the secret should never + // be included in the production version. + $params['ts'] = WP_FS__SCRIPT_START_TIME; + $params['salt'] = md5( uniqid( rand() ) ); + $params['secure'] = md5( + $params['ts'] . + $params['salt'] . + $this->get_secret_key() + ); + } + + return array_merge( $params, $override_with ); + } + + /** + * 1. If successful opt-in or pending activation returns the next page that the user should be redirected to. + * 2. If there was an API error, return the API result. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @param string|bool $email + * @param string|bool $first + * @param string|bool $last + * @param string|bool $license_key + * @param bool $is_uninstall If "true", this means that the module is currently being uninstalled. + * In this case, the user and site info will be sent to the server but no + * data will be saved to the WP installation's database. + * @param number|bool $trial_plan_id + * @param bool $is_disconnected Whether or not to opt in without tracking. + * @param null|bool $is_marketing_allowed + * @param array $sites If network-level opt-in, an array of containing details of sites. + * + * @return string|object + * @use WP_Error + */ + function opt_in( + $email = false, + $first = false, + $last = false, + $license_key = false, + $is_uninstall = false, + $trial_plan_id = false, + $is_disconnected = false, + $is_marketing_allowed = null, + $sites = array() + ) { + $this->_logger->entrance(); + + if ( false === $email ) { + $current_user = self::_get_current_wp_user(); + $email = $current_user->user_email; + } + + /** + * @since 1.2.1 If activating with license key, ignore the context-user + * since the user will be automatically loaded from the license. + */ + if ( empty( $license_key ) ) { + // Clean up pending license if opt-ing in again. + $this->_storage->remove( 'pending_license_key' ); + + if ( ! $is_uninstall ) { + $fs_user = Freemius::_get_user_by_email( $email ); + if ( is_object( $fs_user ) && ! $this->is_pending_activation() ) { + return $this->install_with_user( + $fs_user, + false, + $trial_plan_id, + true, + true, + $sites + ); + } + } + } + + $user_info = array(); + if ( ! empty( $email ) ) { + $user_info['user_email'] = $email; + } + if ( ! empty( $first ) ) { + $user_info['user_firstname'] = $first; + } + if ( ! empty( $last ) ) { + $user_info['user_lastname'] = $last; + } + + if ( ! empty( $sites ) ) { + $is_network = true; + + $user_info['sites'] = $sites; + } else { + $is_network = false; + } + + $params = $this->get_opt_in_params( $user_info, $is_network ); + + $filtered_license_key = false; + if ( is_string( $license_key ) ) { + $filtered_license_key = $this->apply_filters( 'license_key', $license_key ); + $params['license_key'] = $filtered_license_key; + } else if ( FS_Plugin_Plan::is_valid_id( $trial_plan_id ) ) { + $params['trial_plan_id'] = $trial_plan_id; + } + + if ( $is_uninstall ) { + $params['uninstall_params'] = array( + 'reason_id' => $this->_storage->uninstall_reason->id, + 'reason_info' => $this->_storage->uninstall_reason->info + ); + } + + if ( isset( $params['license_key'] ) ) { + $fs_user = Freemius::_get_user_by_email( $email ); + + if ( is_object( $fs_user ) ) { + /** + * If opting in with a context license and the context WP Admin user already opted in + * before from the current site, add the user context security params to avoid the + * unnecessary email activation when the context license is owned by the same context user. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + */ + $params = array_merge( $params, FS_Security::instance()->get_context_params( + $fs_user, + false, + 'install_with_existing_user' + ) ); + } + } + + if ( is_bool( $is_marketing_allowed ) ) { + $params['is_marketing_allowed'] = $is_marketing_allowed; + } + + $params['is_disconnected'] = $is_disconnected; + $params['format'] = 'json'; + + $request = array( + 'method' => 'POST', + 'body' => $params, + 'timeout' => WP_FS__DEBUG_SDK ? 60 : 30, + ); + + $url = $this->add_show_pending( WP_FS__ADDRESS . '/action/service/user/install/' ); + $response = self::safe_remote_post( $url, $request ); + + if ( is_wp_error( $response ) ) { + /** + * @var WP_Error $response + */ + $result = new stdClass(); + + $error_code = $response->get_error_code(); + $error_type = str_replace( ' ', '', ucwords( str_replace( '_', ' ', $error_code ) ) ); + + $result->error = (object) array( + 'type' => $error_type, + 'message' => $response->get_error_message(), + 'code' => $error_code, + 'http' => 402 + ); + + $this->maybe_modify_api_curl_error_message( $result ); + + return $result; + } + + // Module is being uninstalled, don't handle the returned data. + if ( $is_uninstall ) { + return true; + } + + /** + * When json_decode() executed on PHP 5.2 with an invalid JSON, it will throw a PHP warning. Unfortunately, the new Theme Check doesn't allow PHP silencing and the theme review team isn't open to change that, therefore, instead of using `@json_decode()` we had to use the method without the `@` directive. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.3 + * @link https://themes.trac.wordpress.org/ticket/46134#comment:5 + * @link https://themes.trac.wordpress.org/ticket/46134#comment:9 + * @link https://themes.trac.wordpress.org/ticket/46134#comment:12 + * @link https://themes.trac.wordpress.org/ticket/46134#comment:14 + */ + $decoded = is_string( $response['body'] ) ? + json_decode( $response['body'] ) : + null; + + if ( empty( $decoded ) ) { + return false; + } + + if ( ! $this->is_api_result_object( $decoded ) ) { + if ( ! empty( $params['license_key'] ) ) { + // Pass the fully entered license key to the failure handler. + $params['license_key'] = $license_key; + } + + return $is_uninstall ? + $decoded : + $this->apply_filters( 'after_install_failure', $decoded, $params ); + } else if ( isset( $decoded->pending_activation ) && $decoded->pending_activation ) { + if ( $is_network ) { + $site_ids = array(); + foreach ( $sites as $site ) { + $site_ids[] = $site['blog_id']; + } + + /** + * Store the sites so that they can be installed once the user has clicked on the activation link + * in the email. + * + * @author Leo Fajardo (@leorw) + */ + $this->_storage->pending_sites_info = array( + 'blog_ids' => $site_ids, + 'license_key' => $license_key, + 'trial_plan_id' => $trial_plan_id + ); + } + + // Pending activation, add message. + return $this->set_pending_confirmation( + ( isset( $decoded->email ) ? + $decoded->email : + true ), + false, + $filtered_license_key, + ! empty( $params['trial_plan_id'] ) + ); + } else if ( isset( $decoded->install_secret_key ) ) { + return $this->install_with_new_user( + $decoded->user_id, + $decoded->user_public_key, + $decoded->user_secret_key, + ( isset( $decoded->is_marketing_allowed ) && ! is_null( $decoded->is_marketing_allowed ) ? + $decoded->is_marketing_allowed : + null ), + ( isset( $decoded->is_extensions_tracking_allowed ) && ! is_null( $decoded->is_extensions_tracking_allowed ) ? + $decoded->is_extensions_tracking_allowed : + null ), + $decoded->install_id, + $decoded->install_public_key, + $decoded->install_secret_key, + false + ); + } else if ( is_array( $decoded->installs ) ) { + return $this->install_many_with_new_user( + $decoded->user_id, + $decoded->user_public_key, + $decoded->user_secret_key, + ( isset( $decoded->is_marketing_allowed ) && ! is_null( $decoded->is_marketing_allowed ) ? + $decoded->is_marketing_allowed : + null ), + ( isset( $decoded->is_extensions_tracking_allowed ) && ! is_null( $decoded->is_extensions_tracking_allowed ) ? + $decoded->is_extensions_tracking_allowed : + null ), + $decoded->installs, + false + ); + } + + return $decoded; + } + + /** + * Set user and site identities. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param FS_User $user + * @param FS_Site $site + * @param bool $redirect + * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will + * redirect (or return a URL) to the account page with a special parameter to + * trigger the auto installation processes. + * + * @return string If redirect is `false`, returns the next page the user should be redirected to. + */ + function setup_account( + FS_User $user, + FS_Site $site, + $redirect = true, + $auto_install = false + ) { + return $this->setup_network_account( + $user, + array( $site ), + $redirect, + $auto_install, + false + ); + } + + /** + * Set user and site identities. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param FS_User $user + * @param FS_Site[] $installs + * @param bool $redirect + * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes. + * @param bool $is_network_level_opt_in + * + * @return string If redirect is `false`, returns the next page the user should be redirected to. + */ + function setup_network_account( + FS_User $user, + array $installs, + $redirect = true, + $auto_install = false, + $is_network_level_opt_in = true + ) { + $first_install = $installs[0]; + + $this->_user = $user; + $this->_site = $first_install; + + $this->_sync_plans(); + + if ( $this->_storage->handle_gdpr_admin_notice && + $this->should_handle_gdpr_admin_notice() && + FS_GDPR_Manager::instance()->should_show_opt_in_notice() + ) { + /** + * Clear user lock after an opt-in. + */ + require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; + FS_User_Lock::instance()->unlock(); + } + + if ( 1 < count( $installs ) ) { + // Only network level opt-in can have more than one install. + $is_network_level_opt_in = true; + } +// $is_network_level_opt_in = self::is_ajax_action_static( 'network_activate', $this->_module_id ); + // If Freemius was OFF before, turn it on. + $this->turn_on(); + + $this->handle_account_connection( + $installs, + ( ! $this->_is_network_active || ! $is_network_level_opt_in ) + ); + + if ( is_numeric( $first_install->license_id ) ) { + $this->set_license( $this->_get_license_by_id( $first_install->license_id ) ); + } + + $this->_admin_notices->remove_sticky( 'connect_account' ); + + if ( $this->is_pending_activation() || ! $this->has_settings_menu() ) { + // Remove pending activation sticky notice (if still exist). + $this->_admin_notices->remove_sticky( 'activation_pending' ); + + // Remove plugin from pending activation mode. + unset( $this->_storage->is_pending_activation ); + + if ( ! $this->is_paying_or_trial() ) { + $this->_admin_notices->add_sticky( + sprintf( $this->get_text_inline( '%s activation was successfully completed.', 'plugin-x-activation-message' ), '' . $this->get_plugin_name() . '' ), + 'activation_complete' + ); + } + } + + if ( $this->is_paying_or_trial() ) { + if ( ! $this->is_premium() || + ! $this->has_premium_version() || + ! $this->has_settings_menu() + ) { + if ( $this->is_paying() ) { + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( 'Your account was successfully activated with the %s plan.', 'activation-with-plan-x-message' ), + $this->get_plan_title() + ) . $this->get_complete_upgrade_instructions(), + 'plan_upgraded', + $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' + ); + } else { + $trial_plan = $this->get_trial_plan(); + + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( 'Your trial has been successfully started.', 'trial-started-message' ), + '' . $this->get_plugin_name() . '' + ) . $this->get_complete_upgrade_instructions( $trial_plan->title ), + 'trial_started', + $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' + ); + } + } + + $this->_admin_notices->remove_sticky( array( + 'trial_promotion', + ) ); + } + + $plugin_id = fs_request_get( 'plugin_id', false ); + + // Store activation time ONLY for plugins & themes (not add-ons). + if ( ! is_numeric( $plugin_id ) || ( $plugin_id == $this->_plugin->id ) ) { + if ( empty( $this->_storage->activation_timestamp ) ) { + $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME; + } + } + + $next_page = ''; + + $extra = array(); + if ( $auto_install ) { + $extra['auto_install'] = 'true'; + } + + if ( is_numeric( $plugin_id ) ) { + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.1.6 + * + * Also sync the license after an anonymous user subscribes. + */ + if ( $this->is_anonymous() || $plugin_id != $this->_plugin->id ) { + // Add-on was installed - sync license right after install. + $next_page = $this->_get_sync_license_url( $plugin_id, true, $extra ); + } + } else { + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.9 If site installed with a valid license, sync license. + */ + if ( $this->is_paying() ) { + $this->_sync_plugin_license( + true, + // Installs data is already synced in the beginning of this method directly or via _set_account(). + false + ); + } + + // Reload the page with the keys. + $next_page = $this->is_anonymous() ? + // If user previously skipped, redirect to account page. + $this->get_account_url( false, $extra ) : + $this->get_after_activation_url( 'after_connect_url', array(), $is_network_level_opt_in ); + } + + if ( ! empty( $next_page ) && $redirect ) { + fs_redirect( $next_page ); + } + + return $next_page; + } + + /** + * Install plugin with new user information after approval. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + */ + function _install_with_new_user() { + $this->_logger->entrance(); + + if ( $this->is_registered() ) { + return; + } + + if ( ( $this->is_plugin() && fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) || + // @todo This logic should be improved because it's executed on every load of a theme. + $this->is_theme() + ) { +// check_admin_referer( $this->_slug . '_activate_new' ); + + if ( fs_request_has( 'user_secret_key' ) ) { + if ( fs_is_network_admin() && isset( $this->_storage->pending_sites_info ) ) { + $pending_sites_info = $this->_storage->pending_sites_info; + + $this->install_many_pending_with_user( + fs_request_get( 'user_id' ), + fs_request_get( 'user_public_key' ), + fs_request_get( 'user_secret_key' ), + fs_request_get_bool( 'is_marketing_allowed', null ), + fs_request_get_bool( 'is_extensions_tracking_allowed', null ), + $pending_sites_info['blog_ids'], + $pending_sites_info['license_key'], + $pending_sites_info['trial_plan_id'] + ); + } else { + $this->install_with_new_user( + fs_request_get( 'user_id' ), + fs_request_get( 'user_public_key' ), + fs_request_get( 'user_secret_key' ), + fs_request_get_bool( 'is_marketing_allowed', null ), + fs_request_get_bool( 'is_extensions_tracking_allowed', null ), + fs_request_get( 'install_id' ), + fs_request_get( 'install_public_key' ), + fs_request_get( 'install_secret_key' ), + true, + fs_request_get_bool( 'auto_install' ) + ); + } + } else if ( fs_request_has( 'pending_activation' ) ) { + $this->set_pending_confirmation( fs_request_get( 'user_email' ), true ); + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $id + * @param string $public_key + * @param string $secret_key + * + * @return \FS_User + */ + private function setup_user( $id, $public_key, $secret_key ) { + $user = self::_get_user_by_id( $id ); + + if ( is_object( $user ) ) { + $this->_user = $user; + } else { + $user = new FS_User(); + $user->id = $id; + $user->public_key = $public_key; + $user->secret_key = $secret_key; + + $this->_user = $user; + $user_result = $this->get_api_user_scope()->get(); + $user = new FS_User( $user_result ); + + $this->_user = $user; + $this->_store_user(); + } + + return $user; + } + + /** + * Install plugin with new user. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @param number $user_id + * @param string $user_public_key + * @param string $user_secret_key + * @param bool|null $is_marketing_allowed + * @param bool|null $is_extensions_tracking_allowed Since 2.3.2 + * @param number $install_id + * @param string $install_public_key + * @param string $install_secret_key + * @param bool $redirect + * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes. + * + * @return string If redirect is `false`, returns the next page the user should be redirected to. + */ + private function install_with_new_user( + $user_id, + $user_public_key, + $user_secret_key, + $is_marketing_allowed, + $is_extensions_tracking_allowed, + $install_id, + $install_public_key, + $install_secret_key, + $redirect = true, + $auto_install = false + ) { + /** + * This method is also executed after opting in with a license key since the + * license can be potentially associated with a different owner. + * + * @since 2.0.0 + */ + $user = self::_get_user_by_id( $user_id ); + + if ( ! is_object( $user ) ) { + $user = new FS_User(); + $user->id = $user_id; + $user->public_key = $user_public_key; + $user->secret_key = $user_secret_key; + + $this->_user = $user; + $user_result = $this->get_api_user_scope()->get(); + $user = new FS_User( $user_result ); + } + + $this->_user = $user; + + $site = new FS_Site(); + $site->id = $install_id; + $site->public_key = $install_public_key; + $site->secret_key = $install_secret_key; + + $this->_site = $site; + $site_result = $this->get_api_site_scope()->get(); + $site = new FS_Site( $site_result ); + $this->_site = $site; + + if ( ! is_null( $is_marketing_allowed ) ) { + $this->disable_opt_in_notice_and_lock_user(); + } + + $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); + + return $this->setup_account( + $this->_user, + $this->_site, + $redirect, + $auto_install + ); + } + + /** + * Install plugin with user. + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param number $user_id + * @param string $user_public_key + * @param string $user_secret_key + * @param bool|null $is_marketing_allowed + * @param bool|null $is_extensions_tracking_allowed Since 2.3.2 + * @param array $site_ids + * @param bool $license_key + * @param bool $trial_plan_id + * @param bool $redirect + * + * @return string If redirect is `false`, returns the next page the user should be redirected to. + */ + private function install_many_pending_with_user( + $user_id, + $user_public_key, + $user_secret_key, + $is_marketing_allowed, + $is_extensions_tracking_allowed, + $site_ids, + $license_key = false, + $trial_plan_id = false, + $redirect = true + ) { + $user = $this->setup_user( $user_id, $user_public_key, $user_secret_key ); + + if ( ! is_null( $is_marketing_allowed ) ) { + $this->disable_opt_in_notice_and_lock_user(); + } + + $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); + + $sites = array(); + foreach ( $site_ids as $site_id ) { + $sites[] = $this->get_site_info( array( 'blog_id' => $site_id ) ); + } + + $this->install_with_user( $user, $license_key, $trial_plan_id, $redirect, true, $sites ); + } + + /** + * Multi-site install with a new user. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $user_id + * @param string $user_public_key + * @param string $user_secret_key + * @param bool|null $is_marketing_allowed + * @param bool|null $is_extensions_tracking_allowed Since 2.3.2 + * @param object[] $installs + * @param bool $redirect + * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes. + * + * @return string If redirect is `false`, returns the next page the user should be redirected to. + */ + private function install_many_with_new_user( + $user_id, + $user_public_key, + $user_secret_key, + $is_marketing_allowed, + $is_extensions_tracking_allowed, + array $installs, + $redirect = true, + $auto_install = false + ) { + $this->setup_user( $user_id, $user_public_key, $user_secret_key ); + + if ( ! is_null( $is_marketing_allowed ) ) { + $this->disable_opt_in_notice_and_lock_user(); + } + + $this->update_extensions_tracking_flag( $is_extensions_tracking_allowed ); + + $install_ids = array(); + + foreach ( $installs as $install ) { + $install_ids[] = $install->id; + } + + $left = count( $install_ids ); + $offset = 0; + + $installs = array(); + while ( $left > 0 ) { + $result = $this->get_api_user_scope()->get( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', array_slice( $install_ids, $offset, 25 ) ) ); + + if ( ! $this->is_api_result_object( $result, 'installs' ) ) { + // @todo Handle API error. + } + + $installs = array_merge( $installs, $result->installs ); + + $left -= 25; + } + + foreach ( $installs as &$install ) { + $install = new FS_Site( $install ); + } + + return $this->setup_network_account( + $this->_user, + $installs, + $redirect, + $auto_install + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @param string|bool $email + * @param bool $redirect + * @param string|bool $license_key Since 1.2.1.5 + * @param bool $is_pending_trial Since 1.2.1.5 + * + * @return string Since 1.2.1.5 if $redirect is `false`, return the pending activation page. + */ + private function set_pending_confirmation( + $email = false, + $redirect = true, + $license_key = false, + $is_pending_trial = false + ) { + if ( $this->_ignore_pending_mode ) { + /** + * If explicitly asked to ignore pending mode, set to anonymous mode + * if require confirmation before finalizing the opt-in. + * + * @author Vova Feldman + * @since 1.2.1.6 + */ + $this->skip_connection( null, fs_is_network_admin() ); + } else { + // Install must be activated via email since + // user with the same email already exist. + $this->_storage->is_pending_activation = true; + $this->_add_pending_activation_notice( $email, $is_pending_trial ); + } + + if ( ! empty( $license_key ) ) { + $this->_storage->pending_license_key = $license_key; + } + + // Remove the opt-in sticky notice. + $this->_admin_notices->remove_sticky( array( + 'connect_account', + 'trial_promotion', + ) ); + + $next_page = $this->get_after_activation_url( 'after_pending_connect_url' ); + + // Reload the page with with pending activation message. + if ( $redirect ) { + fs_redirect( $next_page ); + } + + return $next_page; + } + + /** + * Install plugin with current logged WP user info. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + */ + function _install_with_current_user() { + $this->_logger->entrance(); + + if ( $this->is_registered() ) { + return; + } + + if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) && fs_request_is_post() ) { +// check_admin_referer( 'activate_existing_' . $this->_plugin->public_key ); + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.9 Add license key if given. + */ + $license_key = fs_request_get( 'license_secret_key' ); + + $this->update_extensions_tracking_flag( fs_request_get_bool( 'is_extensions_tracking_allowed', null ) ); + + $this->install_with_current_user( $license_key ); + } + } + + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @param string|bool $license_key + * @param number|bool $trial_plan_id + * @param array $sites Since 2.0.0 + * @param bool $redirect + * + * @return object|string If redirect is `false`, returns the next page the user should be redirected to, or the API error object if failed to install. + */ + private function install_with_current_user( + $license_key = false, + $trial_plan_id = false, + $sites = array(), + $redirect = true + ) { + // Get current logged WP user. + $current_user = self::_get_current_wp_user(); + + // Find the relevant FS user by the email. + $user = self::_get_user_by_email( $current_user->user_email ); + + return $this->install_with_user( $user, $license_key, $trial_plan_id, $redirect, true, $sites ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_User $user + * @param string|bool $license_key + * @param number|bool $trial_plan_id + * @param bool $redirect + * @param bool $setup_account Since 2.0.0. When set to FALSE, executes a light installation without setting up the account as if it's the first opt-in. + * @param array $sites Since 2.0.0. If not empty, should be a collection of site details for the bulk install API request. + * + * @return \FS_Site|object|string If redirect is `false`, returns the next page the user should be redirected to, or the API error object if failed to install. If $setup_account is set to `false`, return the newly created install. + */ + function install_with_user( + FS_User $user, + $license_key = false, + $trial_plan_id = false, + $redirect = true, + $setup_account = true, + $sites = array() + ) { + // We have to set the user before getting user scope API handler. + $this->_user = $user; + + // Install the plugin. + $result = $this->create_installs_with_user( + $user, + $license_key, + $trial_plan_id, + $sites, + $redirect + ); + + if ( ! $this->is_api_result_entity( $result ) && + ! $this->is_api_result_object( $result, 'installs' ) + ) { + // @todo Handler potential API error of the $result + } + + if ( empty( $sites ) ) { + $site = new FS_Site( $result ); + $this->_site = $site; + + if ( ! $setup_account ) { + $this->_store_site(); + + $this->sync_plan_if_not_exist( $site->plan_id ); + + if ( ! empty( $license_key ) && FS_Plugin_License::is_valid_id( $site->license_id ) ) { + $this->sync_license_if_not_exist( $site->license_id, $license_key ); + } + + $this->_admin_notices->remove_sticky( 'connect_account', false ); + + return $site; + } + + return $this->setup_account( $this->_user, $this->_site, $redirect ); + } else { + $installs = array(); + foreach ( $result->installs as $install ) { + $installs[] = new FS_Site( $install ); + } + + return $this->setup_network_account( + $user, + $installs, + $redirect + ); + } + } + + /** + * Initiate an API request to create a collection of installs. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_User $user + * @param bool $license_key + * @param bool $trial_plan_id + * @param array $sites + * @param bool $redirect + * @param bool $silent + * + * @return object|mixed + */ + private function create_installs_with_user( + FS_User $user, + $license_key = false, + $trial_plan_id = false, + $sites = array(), + $redirect = false, + $silent = false + ) { + $extra_install_params = array( + 'uid' => $this->get_anonymous_id(), + 'is_disconnected' => false, + ); + + if ( ! empty( $license_key ) ) { + $extra_install_params['license_key'] = $this->apply_filters( 'license_key', $license_key ); + + if ( $silent ) { + $extra_install_params['ignore_license_owner'] = true; + } + } else if ( FS_Plugin_Plan::is_valid_id( $trial_plan_id ) ) { + $extra_install_params['trial_plan_id'] = $trial_plan_id; + } + + if ( ! empty( $sites ) ) { + $extra_install_params['sites'] = $sites; + } + + $args = $this->get_install_data_for_api( $extra_install_params, false, false ); + + // Install the plugin. + $result = $this->get_api_user_scope_by_user( $user )->call( + "/plugins/{$this->get_id()}/installs.json", + 'post', + $args + ); + + if ( ! $this->is_api_result_entity( $result ) && + ! $this->is_api_result_object( $result, 'installs' ) + ) { + if ( ! empty( $args['license_key'] ) ) { + // Pass the fully entered license key to the failure handler. + $args['license_key'] = $license_key; + } + + $result = $this->apply_filters( 'after_install_failure', $result, $args ); + + if ( ! $silent ) { + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' . + $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '' . $result->error->message . '', + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error' + ); + } + + if ( $redirect ) { + /** + * We set the user before getting the user scope API handler, so the user became temporarily + * registered (`is_registered() = true`). Since the API returned an error and we will redirect, + * we have to set the user to `null`, otherwise, the user will be redirected to the wrong + * activation page based on the return value of `is_registered()`. In addition, in case the + * context plugin doesn't have a settings menu and the default page is the `Plugins` page, + * misleading plugin activation errors will be shown on the `Plugins` page. + * + * @author Leo Fajardo (@leorw) + */ + $this->_user = null; + + fs_redirect( $this->get_activation_url( array( 'error' => $result->error->message ) ) ); + } + } + + return $result; + } + + /** + * Tries to activate add-on account based on parent plugin info. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param Freemius $parent_fs + * @param bool|int|null $network_level_or_blog_id True for network level opt-in and integer for opt-in for specified blog in the network. + * @param FS_Plugin_License $bundle_license Since 2.4.0. If provided, this license will be activated for the add-on. + */ + private function _activate_addon_account( + Freemius $parent_fs, + $network_level_or_blog_id = null, + FS_Plugin_License $bundle_license = null + ) { + if ( $this->is_registered() ) { + // Already activated. + return; + } + + /** + * Do not override the `uid` if network-level opt-in since the call to `get_sites_for_network_level_optin()` + * already returns the data for the current blog. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + $uid_param_to_override = ( true === $network_level_or_blog_id ) ? + array() : + array( 'uid' => $this->get_anonymous_id() ); + + $params = $this->get_install_data_for_api( + $uid_param_to_override, + false, + false, + /** + * Do not include the data for the current blog if network-level opt-in since the call to `get_sites_for_network_level_optin` + * already includes the data for it. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + ( true !== $network_level_or_blog_id ) + ); + + if ( true === $network_level_or_blog_id ) { + $params['sites'] = $this->get_sites_for_network_level_optin(); + + if ( empty( $params['sites'] ) ) { + return; + } + } + + if ( is_object( $bundle_license ) ) { + $params['license_key'] = $bundle_license->secret_key; + } + + // Activate add-on with parent plugin credentials. + $result = $parent_fs->get_api_site_scope()->call( + "/addons/{$this->_plugin->id}/installs.json", + 'post', + $params + ); + + if ( ! $this->is_api_result_object( $result, 'installs' ) ) { + if ( is_object( $bundle_license ) ) { + /** + * When a license object is provided, it's an attempt by the SDK to activate a bundle license and not a user-initiated action, therefore, do not show any admin notice to avoid confusion (e.g.: the notice will show up just above the opt-in link). If the license activation fails, the admin will see an opt-in link instead. + * + * @author Leo Fajardo (@leorw) + * @since 2.4.0 + */ + } else { + $error_message = FS_Api::is_api_error_object( $result ) ? + $result->error->message : + $this->get_text_inline( 'An unknown error has occurred.', 'unknown-error' ); + + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' . + $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '' . $error_message . '', + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error' + ); + } + + return; + } + + $addon_installs = $result->installs; + foreach ( $addon_installs as $key => $addon_install ) { + $addon_installs[ $key ] = new FS_Site( $addon_install ); + } + + $first_install = $addon_installs[0]; + + // Get user information based on parent's plugin. + $user = $parent_fs->get_user(); + + // First of all, set site and user info - otherwise we won't + // be able to invoke API calls. + $this->_site = $first_install; + $this->_user = $user; + + // Sync add-on plans. + $this->_sync_plans(); + + $this->handle_account_connection( $addon_installs, ! fs_is_network_admin() ); + + // Get site's current plan. + //$this->_site->plan = $this->_get_plan_by_id( $this->_site->plan->id ); + + // Sync licenses. + $this->_sync_licenses(); + + if ( ! fs_is_network_admin() ) { + // Try to activate premium license. + $this->_activate_license( true, $bundle_license ); + + if ( is_object( $bundle_license ) ) { + $this->maybe_activate_bundle_license( $bundle_license ); + } + } else { + if ( is_object( $bundle_license ) ) { + $premium_license = $bundle_license; + } else { + $license_id = fs_request_get( 'license_id' ); + + if ( is_object( $this->_site ) && + FS_Plugin_License::is_valid_id( $license_id ) && + $license_id == $this->_site->license_id + ) { + // License is already activated. + return; + } + + $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ? + $this->_get_license_by_id( $license_id ) : + $this->_get_available_premium_license(); + } + + if ( is_object( $premium_license ) ) { + $this->maybe_network_activate_addon_license( $premium_license ); + } + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param FS_Site[] $installs + * @param bool $is_site_level + */ + private function handle_account_connection( $installs, $is_site_level ) { + $first_install = $installs[0]; + + if ( $is_site_level ) { + $this->_set_account( $this->_user, $first_install ); + + $this->do_action( 'after_account_connection', $this->_user, $first_install ); + } else { + $this->_store_user(); + + // Map site addresses to their blog IDs. + $address_to_blog_map = $this->get_address_to_blog_map(); + + $first_blog_id = null; + $blog_2_install_map = array(); + foreach ( $installs as $install ) { + $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); + $blog_id = $address_to_blog_map[ $address ]; + + $this->_store_site( true, $blog_id, $install ); + + if ( is_null( $first_blog_id ) ) { + $first_blog_id = $blog_id; + } + + $blog_2_install_map[ $blog_id ] = $install; + } + + if ( ! FS_User::is_valid_id( $this->_storage->network_user_id ) || + ! is_object( self::_get_user_by_id( $this->_storage->network_user_id ) ) + ) { + // Store network user. + $this->_storage->network_user_id = $this->_user->id; + } + + if ( ! FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ) { + $this->_storage->network_install_blog_id = $first_blog_id; + } + + if ( count( $installs ) === count( $address_to_blog_map ) ) { + // Super admin opted in for all sites in the network. + $this->_storage->is_network_connected = true; + } + + $this->_store_licenses( false ); + + self::$_accounts->store(); + + // Don't sync the installs data on network upgrade + if ( ! $this->network_upgrade_mode_completed() ) { + $this->send_installs_update(); + } + + // Switch install context back to the first install. + $this->_site = $first_install; + + $current_blog = get_current_blog_id(); + + foreach ( $blog_2_install_map as $blog_id => $install ) { + $this->switch_to_blog( $blog_id ); + + $this->do_action( 'after_account_connection', $this->_user, $install ); + } + + $this->switch_to_blog( $current_blog ); + + $this->do_action( 'after_network_account_connection', $this->_user, $blog_2_install_map ); + } + } + + /** + * Tries to activate parent account based on add-on's info. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @param Freemius $parent_fs + */ + private function activate_parent_account( Freemius $parent_fs ) { + if ( ! $this->is_addon() ) { + // This is not an add-on. + return; + } + + if ( $parent_fs->is_registered() ) { + // Already activated. + return; + } + + // Activate parent with add-on's user credentials. + $parent_install = $this->get_api_user_scope()->call( + "/plugins/{$parent_fs->_plugin->id}/installs.json", + 'post', + $parent_fs->get_install_data_for_api( array( + 'uid' => $parent_fs->get_anonymous_id(), + ), false, false ) + ); + + if ( isset( $parent_install->error ) ) { + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' . + $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '' . $parent_install->error->message . '', + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error' + ); + + return; + } + + $parent_fs->_admin_notices->remove_sticky( 'connect_account' ); + + if ( $parent_fs->is_pending_activation() ) { + $parent_fs->_admin_notices->remove_sticky( 'activation_pending' ); + + unset( $parent_fs->_storage->is_pending_activation ); + } + + // Get user information based on parent's plugin. + $user = $this->get_user(); + + // First of all, set site info - otherwise we won't + // be able to invoke API calls. + $parent_fs->_site = new FS_Site( $parent_install ); + $parent_fs->_user = $user; + + // Sync add-on plans. + $parent_fs->_sync_plans(); + + $parent_fs->_set_account( $user, $parent_fs->_site ); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Admin Menu Items + #---------------------------------------------------------------------------------- + + private $_menu_items = array(); + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.8 + * + * @return array + */ + function get_menu_items() { + return $this->_menu_items; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return string + */ + function get_menu_slug() { + return $this->_menu->get_slug(); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + function _prepare_admin_menu() { +// if ( ! $this->is_on() ) { +// return; +// } + + /** + * When running from a site admin with a network activated module and the connection + * was NOT delegated and the user still haven't skipped or opted-in, then hide the + * site level settings. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + $should_hide_site_admin_settings = ( + $this->_is_network_active && + ! fs_is_network_admin() && + ! $this->is_delegated_connection() && + ! $this->is_anonymous() && + ! $this->is_registered() + ); + + $should_hide_site_admin_settings = $this->apply_filters( 'should_hide_site_admin_settings_on_network_activation_mode', $should_hide_site_admin_settings ); + + if ( ( ! $this->has_api_connectivity() && ! $this->is_enable_anonymous() ) || + $should_hide_site_admin_settings + ) { + $this->_menu->remove_menu_item( $should_hide_site_admin_settings ); + } else { + $this->do_action( fs_is_network_admin() ? + 'before_network_admin_menu_init' : + 'before_admin_menu_init' + ); + + $this->add_menu_action(); + + $this->add_network_menu_when_missing(); + + $this->add_submenu_items(); + } + } + + /** + * Admin dashboard menu items modifications. + * + * NOTE: admin_menu action executed before admin_init. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + */ + private function add_menu_action() { + if ( $this->is_activation_mode() ) { + if ( $this->show_opt_in_on_setting_page() ) { + $this->override_plugin_menu_with_activation(); + } else { + /** + * Handle theme opt-in when the opt-in form shows as a dialog box in the themes page. + */ + if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) { + add_action( 'load-themes.php', array( &$this, '_install_with_current_user' ) ); + } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) || + fs_request_get_bool( 'pending_activation' ) + ) { + add_action( 'load-themes.php', array( &$this, '_install_with_new_user' ) ); + } + } + } else { + if ( ! $this->is_registered() ) { + // If not registered try to install user. + if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) { + $this->_install_with_new_user(); + } + } else if ( + fs_request_is_action( 'sync_user' ) && + ( ! $this->has_settings_menu() || $this->show_opt_in_on_themes_page() ) + ) { + $this->_handle_account_user_sync(); + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + */ + function _redirect_on_clicked_menu_link() { + $this->_logger->entrance(); + + $page = fs_request_get('page'); + $page = is_string($page) ? strtolower($page) : ''; + + $this->_logger->log( 'page = ' . $page ); + + foreach ( $this->_menu_items as $priority => $items ) { + foreach ( $items as $item ) { + if ( isset( $item['url'] ) ) { + if ( $page === $this->_menu->get_slug( strtolower( $item['menu_slug'] ) ) ) { + $this->_logger->log( 'Redirecting to ' . $item['url'] ); + + fs_redirect( $item['url'] ); + } + } + } + } + } + + /** + * Remove plugin's all admin menu items & pages, and replace with activation page. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + */ + private function override_plugin_menu_with_activation() { + $this->_logger->entrance(); + + $hook = false; + + if ( ! $this->has_settings_menu() ) { + // Add the opt-in page without a menu item. + $hook = FS_Admin_Menu_Manager::add_subpage( + null, + $this->get_plugin_name(), + $this->get_plugin_name(), + 'manage_options', + $this->_slug, + array( &$this, '_connect_page_render' ) + ); + } else if ( $this->_menu->is_top_level() ) { + if ( $this->_menu->is_override_exact() ) { + // Make sure the current page is matching the activation page. + if ( ! $this->is_matching_url( $this->get_activation_url() ) ) { + return; + } + } + + $hook = $this->_menu->override_menu_item( array( &$this, '_connect_page_render' ) ); + + if ( false === $hook ) { + // Create new menu item just for the opt-in. + $hook = FS_Admin_Menu_Manager::add_page( + $this->get_plugin_name(), + $this->get_plugin_name(), + 'manage_options', + $this->_menu->get_slug(), + array( &$this, '_connect_page_render' ) + ); + } + } else { + $menus = array( $this->_menu->get_parent_slug() ); + + if ( $this->_menu->is_override_exact() ) { + // Make sure the current page is matching the activation page. + if ( ! $this->is_matching_url( $this->get_activation_url() ) ) { + return; + } + } + + foreach ( $menus as $parent_slug ) { + $hook = $this->_menu->override_submenu_action( + $parent_slug, + $this->_menu->get_raw_slug(), + array( &$this, '_connect_page_render' ) + ); + + if ( false !== $hook ) { + // Found plugin's submenu item. + break; + } + } + } + + if ( $this->is_activation_page() ) { + // Clean admin page from distracting content. + self::_clean_admin_content_section(); + } + + if ( false !== $hook ) { + if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) { + $this->_install_with_current_user(); + } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) { + $this->_install_with_new_user(); + } + } + } + + /** + * If a plugin was network activated and connected but don't have a network + * level settings, then add an artificial menu item for the Account and other + * Freemius settings. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + private function add_network_menu_when_missing() { + $this->_logger->entrance(); + + if ( ! $this->_is_network_active ) { + // Plugin wasn't activated on the network level. + return; + } + + if ( ! fs_is_network_admin() ) { + // The context is not the network admin. + return; + } + + if ( $this->_menu->has_network_menu() ) { + // Plugin already has a network level menu. + return; + } + + if ( $this->is_network_activation_mode() ) { + /** + * Do not add during activation mode, otherwise, there will be duplicate menus while the opt-in + * screen is being shown. + * + * @author Leo Fajardo (@leorw) + */ + return; + } + + if ( ! WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED ) { + if ( $this->is_network_delegated_connection() ) { + // Super-admin delegated the connection to the site admins. + return; + } + } + + if ( ! $this->_menu->has_menu() || $this->_menu->is_top_level() ) { + + if ( $this->_menu->has_menu() || + ! $this->is_addon() || + $this->is_activation_mode() + ) { + $this->_dynamically_added_top_level_page_hook_name = $this->_menu->add_page_and_update( + $this->get_plugin_name(), + $this->get_plugin_name(), + 'manage_options', + $this->_menu->has_menu() ? $this->_menu->get_slug() : $this->_slug + ); + } + } else { + $this->_menu->add_subpage_and_update( + $this->_menu->get_parent_slug(), + $this->get_plugin_name(), + $this->get_plugin_name(), + 'manage_options', + $this->_menu->get_slug() + ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.1 + * + * return string + */ + function get_top_level_menu_capability() { + global $menu; + + $top_level_menu_slug = $this->get_top_level_menu_slug(); + + foreach ( $menu as $menu_info ) { + /** + * The second element in the menu info array is the capability/role that has access to the menu and the + * third element is the menu slug. + */ + if ( $menu_info[2] === $top_level_menu_slug ) { + return $menu_info[1]; + } + } + + return 'read'; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + * + * @return string + */ + private function get_top_level_menu_slug() { + return ( $this->is_addon() ? + $this->get_parent_instance()->_menu->get_top_level_menu_slug() : + $this->_menu->get_top_level_menu_slug() ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return string + */ + function get_pricing_cta_label() { + $label = $this->get_text_inline( 'Upgrade', 'upgrade' ); + + if ( $this->is_in_trial_promotion() && + ! $this->is_paying_or_trial() + ) { + // If running a trial promotion, modify the pricing to load the trial. + $label = $this->get_text_inline( 'Start Trial', 'start-trial' ); + } else if ( $this->is_paying() ) { + $label = $this->get_text_inline( 'Pricing', 'pricing' ); + } + + return $label; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + */ + function is_pricing_page_visible() { + return ( + // Has at least one paid plan. + $this->has_paid_plan() && + // Didn't ask to hide the pricing page. + $this->is_page_visible( 'pricing' ) && + // Don't have a valid active license or has more than one plan. + ( ! $this->is_paying() || ! $this->is_single_plan( true ) ) + ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param bool $is_activation_mode + * + * @return bool + */ + private function should_add_submenu_or_action_links( $is_activation_mode ) { + if ( $this->is_addon() ) { + // No submenu items or action links for add-ons. + return false; + } + + if ( $this->show_opt_in_on_themes_page() ) { + if ( ! fs_is_network_admin() ) { + // Also add action links or submenu items when running in a free .org theme so the tabs will be visible. + return true; + } + } else if ( $is_activation_mode ) { + // Don't show submenu-items/tabs in activation mode, unless it's a wp.org theme. + return false; + } + + if ( fs_is_network_admin() ) { + /** + * Add submenu items or action links to network level when plugin was network activated and the super + * admin did NOT delegate the connection of all sites to site admins. + */ + return ( + $this->_is_network_active && + ( WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED || + ! $this->is_network_delegated_connection() ) + ); + } + + return ( ! $this->_is_network_active || $this->is_delegated_connection() ); + } + + /** + * Add default Freemius menu items. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + * @since 1.2.2.7 Also add submenu items when running in a free .org theme so the tabs will be visible. + */ + private function add_submenu_items() { + $this->_logger->entrance(); + + $is_activation_mode = $this->is_activation_mode(); + + $add_submenu_items = $this->should_add_submenu_or_action_links( $is_activation_mode ); + + if ( $add_submenu_items ) { + if ( $this->has_affiliate_program() ) { + // Add affiliation page. + $this->add_submenu_item( + $this->get_text_inline( 'Affiliation', 'affiliation' ), + array( &$this, '_affiliation_page_render' ), + $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Affiliation', 'affiliation' ), + 'manage_options', + 'affiliation', + 'Freemius::_clean_admin_content_section', + WP_FS__DEFAULT_PRIORITY, + $this->is_submenu_item_visible( 'affiliation' ) + ); + } + } + + if ( $add_submenu_items || + ( $is_activation_mode && + $this->is_only_premium() && + $this->is_admin_page( 'account' ) && + fs_request_is_action( $this->get_unique_affix() . '_sync_license' ) + ) + ) { + if ( ! WP_FS__DEMO_MODE && $this->is_registered() ) { + $show_account = ( + $this->is_submenu_item_visible( 'account' ) && + /** + * @since 1.2.2.7 Don't show the Account for free WP.org themes without any paid plans. + */ + ( ! $this->is_free_wp_org_theme() || $this->has_paid_plan() ) + ); + + // Add user account page. + $this->add_submenu_item( + $this->get_text_inline( 'Account', 'account' ), + array( &$this, '_account_page_render' ), + $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Account', 'account' ), + 'manage_options', + 'account', + array( &$this, '_account_page_load' ), + WP_FS__DEFAULT_PRIORITY, + ( $add_submenu_items && $show_account ) + ); + } + } + + if ( $add_submenu_items ) { + if (! WP_FS__DEMO_MODE && ! $this->is_whitelabeled() ) { + // Add contact page. + $this->add_submenu_item( + $this->get_text_inline( 'Contact Us', 'contact-us' ), + array( &$this, '_contact_page_render' ), + $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Contact Us', 'contact-us' ), + 'manage_options', + 'contact', + 'Freemius::_clean_admin_content_section', + WP_FS__DEFAULT_PRIORITY, + $this->is_submenu_item_visible( 'contact' ) + ); + } + + if ( $this->has_addons() ) { + $this->add_submenu_item( + $this->get_text_inline( 'Add-Ons', 'add-ons' ), + array( &$this, '_addons_page_render' ), + $this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Add-Ons', 'add-ons' ), + 'manage_options', + 'addons', + array( &$this, '_addons_page_load' ), + WP_FS__LOWEST_PRIORITY - 1, + $this->is_submenu_item_visible( 'addons' ) + ); + } + } + + if ( $add_submenu_items || + ( $is_activation_mode && $this->is_only_premium() && $this->is_admin_page( 'pricing' ) ) + ) { + if (! WP_FS__DEMO_MODE && ! $this->is_whitelabeled() ) { + $show_pricing = ( + $this->is_submenu_item_visible( 'pricing' ) && + $this->is_pricing_page_visible() + ); + + $pricing_cta_text = $this->get_pricing_cta_label(); + $pricing_class = 'upgrade-mode'; + if ( $show_pricing ) { + if ( $this->is_in_trial_promotion() && + ! $this->is_paying_or_trial() + ) { + // If running a trial promotion, modify the pricing to load the trial. + $pricing_class = 'trial-mode'; + } else if ( $this->is_paying() ) { + $pricing_class = ''; + } + } + + // Add upgrade/pricing page. + $this->add_submenu_item( + $pricing_cta_text . '  ' . ( is_rtl() ? $this->get_text_x_inline( '←', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '➤', 'ASCII arrow right icon', 'symbol_arrow-right' ) ), + array( &$this, '_pricing_page_render' ), + $this->get_plugin_name() . ' – ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ), + 'manage_options', + 'pricing', + 'Freemius::_clean_admin_content_section', + WP_FS__LOWEST_PRIORITY, + ( $add_submenu_items && $show_pricing ), + $pricing_class + ); + } + } + + if ( ! $is_activation_mode || ( true !== $this->_storage->require_license_activation ) ) { + /** + * Add the other menu items if there are any when not in activation mode or license activation is not + * required (license activation is required for registered or anonymous users after activating the + * premium version when the site is not in trial mode or there's no active valid license). + * + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + */ + if ( 0 < count( $this->_menu_items ) ) { + if ( ! $this->_menu->is_top_level() ) { + fs_enqueue_local_style( 'fs_common', '/admin/common.css' ); + + // Append submenu items right after the plugin's submenu item. + $this->order_sub_submenu_items(); + } else { + // Append submenu items. + $this->embed_submenu_items(); + } + } + } + } + + /** + * Moved the actual submenu item additions to a separated function, + * in order to support sub-submenu items when the plugin's settings + * only have a submenu and not top-level menu item. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.4 + */ + private function embed_submenu_items() { + $item_template = $this->_menu->is_top_level() ? + '%s' : + '%s'; + + $top_level_menu_capability = $this->get_top_level_menu_capability(); + + ksort( $this->_menu_items ); + + $is_first_submenu_item = true; + + foreach ( $this->_menu_items as $priority => $items ) { + foreach ( $items as $item ) { + $capability = ( ! empty( $item['capability'] ) ? $item['capability'] : $top_level_menu_capability ); + + $menu_item = sprintf( + $item_template, + $this->get_unique_affix(), + $item['menu_slug'], + ! empty( $item['class'] ) ? $item['class'] : '', + $item['menu_title'] + ); + + $top_level_menu_slug = $this->get_top_level_menu_slug(); + $menu_slug = $this->_menu->get_slug( $item['menu_slug'] ); + + if ( ! isset( $item['url'] ) ) { + $hook = FS_Admin_Menu_Manager::add_subpage( + $item['show_submenu'] ? + $top_level_menu_slug : + null, + $item['page_title'], + $menu_item, + $capability, + $menu_slug, + $item['render_function'] + ); + + if ( false !== $item['before_render_function'] ) { + add_action( "load-$hook", $item['before_render_function'] ); + } + } else { + FS_Admin_Menu_Manager::add_subpage( + $item['show_submenu'] ? + $top_level_menu_slug : + null, + $item['page_title'], + $menu_item, + $capability, + $menu_slug, + array( $this, '' ) + ); + } + + if ( $item['show_submenu'] && $is_first_submenu_item ) { + if ( $this->_is_network_active && ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) { + /** + * If the top-level menu has been dynamically created, remove the first submenu item that + * WordPress automatically creates when there's no submenu item whose slug matches the + * parent's. In the following example, the `Awesome Plugin` submenu item will be removed. + * + * Awesome Plugin + * - Awesome Plugin <-- we want to remove this since there's no real setting page for the top-level + * + * @author Leo Fajardo (@leorw) + */ + remove_submenu_page( $top_level_menu_slug, $top_level_menu_slug ); + } + + $is_first_submenu_item = false; + } + } + } + } + + /** + * Re-order the submenu items so all Freemius added new submenu items + * are added right after the plugin's settings submenu item. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.4 + */ + private function order_sub_submenu_items() { + global $submenu; + + $menu_slug = $this->_menu->get_top_level_menu_slug(); + + /** + * Before "admin_menu" fires, WordPress will loop over the default submenus and remove pages for which the user + * does not have permissions. So in case a plugin does not have top-level menu but does have submenus under any + * of the default menus, only users that have the right role can access its sub-submenus (Account, Contact Us, + * Support Forum, etc.) since $submenu[ $menu_slug ] will be empty if the user doesn't have permission. + * + * In case a plugin does not have submenus under any of the default menus but does have submenus under the menu + * of another plugin, only users that have the right role can access its sub-submenus since we will use the + * capability needed to access the parent menu as the capability for the submenus that we will add. + */ + if ( empty( $submenu[ $menu_slug ] ) ) { + return; + } + + $top_level_menu = &$submenu[ $menu_slug ]; + + $all_submenu_items_after = array(); + + $found_submenu_item = false; + + foreach ( $top_level_menu as $submenu_id => $meta ) { + if ( $found_submenu_item ) { + // Remove all submenu items after the plugin's submenu item. + $all_submenu_items_after[] = $meta; + unset( $top_level_menu[ $submenu_id ] ); + } + + if ( $this->_menu->get_raw_slug() === $meta[2] ) { + // Found the submenu item, put all below. + $found_submenu_item = true; + continue; + } + } + + // Embed all plugin's new submenu items. + $this->embed_submenu_items(); + + // Start with specially high number to make sure it's appended. + $i = max( 10000, max( array_keys( $top_level_menu ) ) + 1 ); + foreach ( $all_submenu_items_after as $meta ) { + $top_level_menu[ $i ] = $meta; + $i ++; + } + + // Sort submenu items. + ksort( $top_level_menu ); + } + + /** + * Helper method to return the module's support forum URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return string + */ + function get_support_forum_url() { + return $this->apply_filters( 'support_forum_url', "https://wordpress.org/support/{$this->_module_type}/{$this->_slug}" ); + } + + /** + * Displays the Support Forum link when enabled. + * + * Can be filtered like so: + * + * function _fs_show_support_menu( $is_visible, $menu_id ) { + * if ( 'support' === $menu_id ) { + * return _fs->is_registered(); + * } + * return $is_visible; + * } + * _fs()->add_filter('is_submenu_visible', '_fs_show_support_menu', 10, 2); + * + */ + function _add_default_submenu_items() { + if ( ! $this->is_on() ) { + return; + } + + if ( ! $this->is_activation_mode() && + ( ( $this->_is_network_active && fs_is_network_admin() ) || + ( ! $this->_is_network_active && is_admin() ) ) + ) { + $this->add_submenu_link_item( + $this->apply_filters( 'support_forum_submenu', $this->get_text_inline( 'Support Forum', 'support-forum' ) ), + $this->get_support_forum_url(), + 'wp-support-forum', + null, + 50, + $this->is_submenu_item_visible( 'support' ) + ); + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param string $menu_title + * @param callable $render_function + * @param bool|string $page_title + * @param string $capability + * @param bool|string $menu_slug + * @param bool|callable $before_render_function + * @param int $priority + * @param bool $show_submenu + * @param string $class Since 1.2.1.5 can add custom classes to menu items. + */ + function add_submenu_item( + $menu_title, + $render_function, + $page_title = false, + $capability = 'manage_options', + $menu_slug = false, + $before_render_function = false, + $priority = WP_FS__DEFAULT_PRIORITY, + $show_submenu = true, + $class = '' + ) { + $this->_logger->entrance( 'Title = ' . $menu_title ); + + if ( $this->is_addon() ) { + $parent_fs = $this->get_parent_instance(); + + if ( is_object( $parent_fs ) ) { + $parent_fs->add_submenu_item( + $menu_title, + $render_function, + $page_title, + $capability, + $menu_slug, + $before_render_function, + $priority, + $show_submenu, + $class + ); + + return; + } + } + + if ( ! isset( $this->_menu_items[ $priority ] ) ) { + $this->_menu_items[ $priority ] = array(); + } + + $this->_menu_items[ $priority ][] = array( + 'page_title' => is_string( $page_title ) ? $page_title : $menu_title, + 'menu_title' => $menu_title, + 'capability' => $capability, + 'menu_slug' => is_string( $menu_slug ) ? $menu_slug : strtolower( $menu_title ), + 'render_function' => $render_function, + 'before_render_function' => $before_render_function, + 'show_submenu' => $show_submenu, + 'class' => $class, + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param string $menu_title + * @param string $url + * @param bool $menu_slug + * @param string $capability + * @param int $priority + * @param bool $show_submenu + */ + function add_submenu_link_item( + $menu_title, + $url, + $menu_slug = false, + $capability = 'read', + $priority = WP_FS__DEFAULT_PRIORITY, + $show_submenu = true + ) { + $this->_logger->entrance( 'Title = ' . $menu_title . '; Url = ' . $url ); + + if ( $this->is_addon() ) { + $parent_fs = $this->get_parent_instance(); + + if ( is_object( $parent_fs ) ) { + $parent_fs->add_submenu_link_item( + $menu_title, + $url, + $menu_slug, + $capability, + $priority, + $show_submenu + ); + + return; + } + } + + if ( ! isset( $this->_menu_items[ $priority ] ) ) { + $this->_menu_items[ $priority ] = array(); + } + + $this->_menu_items[ $priority ][] = array( + 'menu_title' => $menu_title, + 'capability' => $capability, + 'menu_slug' => is_string( $menu_slug ) ? $menu_slug : strtolower( $menu_title ), + 'url' => $url, + 'page_title' => $menu_title, + 'render_function' => 'fs_dummy', + 'before_render_function' => '', + 'show_submenu' => $show_submenu, + ); + } + + #endregion ------------------------------------------------------------------ + + #-------------------------------------------------------------------------------- + #region Admin Notices + #-------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @param string|string[] $ids + * @param int|null $network_level_or_blog_id + * + * @uses FS_Admin_Notices::remove_sticky() + */ + function remove_sticky( $ids, $network_level_or_blog_id = null ) { + $this->_admin_notices->remove_sticky( $ids, $network_level_or_blog_id ); + } + + #endregion + + #-------------------------------------------------------------------------------- + #region Actions / Hooks / Filters + #-------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + * + * @param string $tag + * + * @return string + */ + public function get_action_tag( $tag ) { + return self::get_action_tag_static( $tag, $this->_slug, $this->is_plugin() ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + * + * @param string $tag + * @param string $slug + * @param bool $is_plugin + * + * @return string + */ + static function get_action_tag_static( $tag, $slug = '', $is_plugin = true ) { + $action = "fs_{$tag}"; + + if ( ! empty( $slug ) ) { + $action .= '_' . self::get_module_unique_affix( $slug, $is_plugin ); + } + + return $action; + } + + /** + * Returns a string that can be used to generate a unique action name, + * option name, HTML element ID, or HTML element class. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return string + */ + public function get_unique_affix() { + return self::get_module_unique_affix( $this->_slug, $this->is_plugin() ); + } + + /** + * Returns a string that can be used to generate a unique action name, + * option name, HTML element ID, or HTML element class. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.5 + * + * @param string $slug + * @param bool $is_plugin + * + * @return string + */ + static function get_module_unique_affix( $slug, $is_plugin = true ) { + $affix = $slug; + + if ( ! $is_plugin ) { + $affix .= '-' . WP_FS__MODULE_TYPE_THEME; + } + + return $affix; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1 + * @since 1.2.2.5 The AJAX action names are based on the module ID, not like the non-AJAX actions that are + * based on the slug for backward compatibility. + * + * @param string $tag + * + * @return string + */ + function get_ajax_action( $tag ) { + return self::get_ajax_action_static( $tag, $this->_module_id ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @param string $tag + * + * @return string + */ + function get_ajax_security( $tag ) { + return wp_create_nonce( $this->get_ajax_action( $tag ) ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @param string $tag + */ + function check_ajax_referer( $tag ) { + check_ajax_referer( $this->get_ajax_action( $tag ), 'security' ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + * @since 1.2.2.5 The AJAX action names are based on the module ID, not like the non-AJAX actions that are + * based on the slug for backward compatibility. + * + * @param string $tag + * @param number|null $module_id + * + * @return string + */ + private static function get_ajax_action_static( $tag, $module_id = null ) { + $action = "fs_{$tag}"; + + if ( ! empty( $module_id ) ) { + $action .= "_{$module_id}"; + } + + return $action; + } + + /** + * Do action, specific for the current context plugin. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param string $tag The name of the action to be executed. + * @param mixed $arg,... Optional. Additional arguments which are passed on to the + * functions hooked to the action. Default empty. + * + * @uses do_action() + */ + function do_action( $tag, $arg = '' ) { + $this->_logger->entrance( $tag ); + + $args = func_get_args(); + + call_user_func_array( 'do_action', array_merge( + array( $this->get_action_tag( $tag ) ), + array_slice( $args, 1 ) ) + ); + } + + /** + * Add action, specific for the current context plugin. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param string $tag + * @param callable $function_to_add + * @param int $priority + * @param int $accepted_args + * + * @uses add_action() + */ + function add_action( + $tag, + $function_to_add, + $priority = WP_FS__DEFAULT_PRIORITY, + $accepted_args = 1 + ) { + $this->_logger->entrance( $tag ); + + add_action( $this->get_action_tag( $tag ), $function_to_add, $priority, $accepted_args ); + } + + /** + * Add AJAX action, specific for the current context plugin. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1 + * + * @param string $tag + * @param callable $function_to_add + * @param int $priority + * + * @uses add_action() + * + * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching. + */ + function add_ajax_action( + $tag, + $function_to_add, + $priority = WP_FS__DEFAULT_PRIORITY + ) { + $this->_logger->entrance( $tag ); + + return self::add_ajax_action_static( + $tag, + $function_to_add, + $priority, + $this->_module_id + ); + } + + /** + * Add AJAX action. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + * + * @param string $tag + * @param callable $function_to_add + * @param int $priority + * @param number|null $module_id + * + * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching. + * @uses add_action() + * + */ + static function add_ajax_action_static( + $tag, + $function_to_add, + $priority = WP_FS__DEFAULT_PRIORITY, + $module_id = null + ) { + self::$_static_logger->entrance( $tag ); + + if ( ! self::is_ajax_action_static( $tag, $module_id ) ) { + return false; + } + + add_action( + 'wp_ajax_' . self::get_ajax_action_static( $tag, $module_id ), + $function_to_add, + $priority, + 0 + ); + + self::$_static_logger->info( "$tag AJAX callback action added." ); + + return true; + } + + /** + * Send a JSON response back to an Ajax request. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @param mixed $response + */ + static function shoot_ajax_response( $response ) { + wp_send_json( $response ); + } + + /** + * Send a JSON response back to an Ajax request, indicating success. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @param mixed $data Data to encode as JSON, then print and exit. + */ + static function shoot_ajax_success( $data = null ) { + wp_send_json_success( $data ); + } + + /** + * Send a JSON response back to an Ajax request, indicating failure. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @param mixed $error Optional error message. + */ + static function shoot_ajax_failure( $error = '' ) { + $result = array( 'success' => false ); + if ( ! empty( $error ) ) { + $result['error'] = $error; + } + + wp_send_json( $result ); + } + + /** + * Apply filter, specific for the current context plugin. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string $tag The name of the filter hook. + * @param mixed $value The value on which the filters hooked to `$tag` are applied on. + * + * @return mixed The filtered value after all hooked functions are applied to it. + * + * @uses apply_filters() + */ + function apply_filters( $tag, $value ) { + $this->_logger->entrance( $tag ); + + $args = func_get_args(); + array_unshift( $args, $this->get_unique_affix() ); + + return call_user_func_array( 'fs_apply_filter', $args ); + } + + /** + * Add filter, specific for the current context plugin. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string $tag + * @param callable $function_to_add + * @param int $priority + * @param int $accepted_args + * + * @uses add_filter() + */ + function add_filter( $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $accepted_args = 1 ) { + $this->_logger->entrance( $tag ); + + add_filter( $this->get_action_tag( $tag ), $function_to_add, $priority, $accepted_args ); + } + + /** + * Check if has filter. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.4 + * + * @param string $tag + * @param callable|bool $function_to_check Optional. The callback to check for. Default false. + * + * @return false|int + * + * @uses has_filter() + */ + function has_filter( $tag, $function_to_check = false ) { + $this->_logger->entrance( $tag ); + + return has_filter( $this->get_action_tag( $tag ), $function_to_check ); + } + + #endregion + + /** + * Override default i18n text phrases. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.6 + * + * @param string[] string $key_value + * + * @uses fs_override_i18n() + */ + function override_i18n( $key_value ) { + fs_override_i18n( $key_value, $this->_slug ); + } + + /* Account Page + ------------------------------------------------------------------------------------------------------------------*/ + /** + * Update site information. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param bool $store Flush to Database if true. + * @param null|int $network_level_or_blog_id Since 2.0.0 + * @param \FS_Site $site Since 2.0.0 + */ + private function _store_site( $store = true, $network_level_or_blog_id = null, FS_Site $site = null ) { + $this->_logger->entrance(); + + if ( is_null( $site ) ) { + $site = $this->_site; + } + + if ( !isset( $site ) || !is_object($site) || empty( $site->id ) ) { + $this->_logger->error( "Empty install ID, can't store site." ); + + return; + } + + $site_clone = clone $site; + + $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id ); + + if ( is_object( $this->_user ) && $this->_user->id != $site->user_id ) { + $this->sync_user_by_current_install( $site->user_id ); + + $prev_stored_user_id = $this->_storage->get( 'prev_user_id', false, $network_level_or_blog_id ); + + if ( empty( $prev_stored_user_id ) && + is_object($this->_user) && $this->_user->id != $site->user_id + ) { + /** + * Store the current user ID as the previous user ID so that the previous user can be used + * as the install's owner while the new owner's details are not yet available. + * + * This will be executed only in the `replica` site. For example, there are 2 sites, namely `original` + * and `replica`, then an ownership change was initiated and completed in the `original`, the `replica` + * will be using the previous user until it is updated again (e.g.: until the next clone of `original` + * into `replica`. + * + * @author Leo Fajardo (@leorw) + */ + $this->_storage->store( 'prev_user_id', $sites[ $this->_slug ]->user_id, $network_level_or_blog_id ); + } + } + + $sites[ $this->_slug ] = $site_clone; + + $this->set_account_option( 'sites', $sites, $store, $network_level_or_blog_id ); + } + + /** + * Update plugin's plans information. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @param bool $store Flush to Database if true. + */ + private function _store_plans( $store = true ) { + $this->_logger->entrance(); + + $plans = self::get_all_plans( $this->_module_type ); + + // Copy plans. + $encrypted_plans = array(); + for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { + $encrypted_plans[] = self::_encrypt_entity( $this->_plans[ $i ] ); + } + + $plans[ $this->_slug ] = $encrypted_plans; + + $this->set_account_option( 'plans', $plans, $store ); + } + + /** + * Update user's plugin licenses. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param bool $store + * @param number|bool $module_id + * @param FS_Plugin_License[] $licenses + */ + private function _store_licenses( $store = true, $module_id = false, $licenses = array() ) { + $this->_logger->entrance(); + + $all_licenses = self::get_all_licenses(); + + if ( ! FS_Plugin::is_valid_id( $module_id ) ) { + $module_id = $this->_module_id; + + $user_licenses = is_array( $this->_licenses ) ? + $this->_licenses : + array(); + + if ( empty( $user_licenses ) ) { + // If the context user doesn't have any license, don't update the licenses collection. + return; + } + + $new_user_licenses_map = array(); + foreach ( $user_licenses as $user_license ) { + $new_user_licenses_map[ $user_license->id ] = $user_license; + } + + self::store_user_id_license_ids_map( array_keys( $new_user_licenses_map ), $this->_module_id, $this->_user->id ); + + // Update user licenses. + $licenses_to_update_count = count( $new_user_licenses_map ); + foreach ( $all_licenses[ $module_id ] as $key => $license ) { + if ( 0 === $licenses_to_update_count ) { + break; + } + + if ( isset( $new_user_licenses_map[ $license->id ] ) ) { + // Update license. + $all_licenses[ $module_id ][ $key ] = $new_user_licenses_map[ $license->id ]; + unset( $new_user_licenses_map[ $license->id ] ); + + $licenses_to_update_count --; + } + } + + if ( ! empty( $new_user_licenses_map ) ) { + // Add new licenses. + $all_licenses[ $module_id ] = array_merge( array_values( $new_user_licenses_map ), $all_licenses[ $module_id ] ); + } + + $licenses = $all_licenses[ $module_id ]; + } + + if ( ! isset( $all_licenses[ $module_id ] ) ) { + $all_licenses[ $module_id ] = array(); + } + + $all_licenses[ $module_id ] = $licenses; + + self::$_accounts->set_option( 'all_licenses', $all_licenses, $store ); + } + + /** + * Update user information. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param bool $store Flush to Database if true. + */ + private function _store_user( $store = true ) { + $this->_logger->entrance(); + + if ( empty( $this->_user->id ) ) { + $this->_logger->error( "Empty user ID, can't store user." ); + + return; + } + + $users = self::get_all_users(); + $users[ $this->_user->id ] = $this->_user; + self::$_accounts->set_option( 'users', $users, $store ); + } + + /** + * Update new updates information. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param FS_Plugin_Tag|null $update + * @param bool $store Flush to Database if true. + * @param bool|number $plugin_id + */ + private function _store_update( $update, $store = true, $plugin_id = false ) { + $this->_logger->entrance(); + + if ( $update instanceof FS_Plugin_Tag ) { + $update->updated = time(); + } + + if ( ! is_numeric( $plugin_id ) ) { + $plugin_id = $this->_plugin->id; + } + + $updates = self::get_all_updates(); + $updates[ $plugin_id ] = $update; + self::$_accounts->set_option( 'updates', $updates, $store ); + } + + /** + * Update new updates information. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param FS_Plugin[] $plugin_addons + * @param bool $store Flush to Database if true. + */ + private function _store_addons( $plugin_addons, $store = true ) { + $this->_logger->entrance(); + + $addons = self::get_all_addons(); + $addons[ $this->_plugin->id ] = $plugin_addons; + self::$_accounts->set_option( 'addons', $addons, $store ); + } + + /** + * Delete plugin's associated add-ons. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.8 + * + * @param bool $store + * + * @return bool + */ + private function _delete_account_addons( $store = true ) { + $all_addons = self::get_all_account_addons(); + + if ( ! isset( $all_addons[ $this->_plugin->id ] ) ) { + return false; + } + + unset( $all_addons[ $this->_plugin->id ] ); + + self::$_accounts->set_option( 'account_addons', $all_addons, $store ); + + return true; + } + + /** + * Update account add-ons list. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param FS_Plugin[] $addons + * @param bool $store Flush to Database if true. + */ + private function _store_account_addons( $addons, $store = true ) { + $this->_logger->entrance(); + + $all_addons = self::get_all_account_addons(); + $all_addons[ $this->_plugin->id ] = $addons; + self::$_accounts->set_option( 'account_addons', $all_addons, $store ); + } + + /** + * Purges the cache for the valid user licenses API call so that when the `Account` or `Add-Ons` page is loaded, + * the valid user licenses will be fetched again and the account add-ons may be updated. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.4 + */ + private function purge_valid_user_licenses_cache() { + if ( ! $this->is_registered() ) { + return; + } + + $this->get_api_user_scope()->purge_cache( $this->get_valid_user_licenses_endpoint() ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @param array $all_licenses + * @param number|null $site_license_id + * @param bool $include_parent_licenses + * + * @return array + */ + private function get_foreign_licenses_info( $all_licenses, $site_license_id = null, $include_parent_licenses = false ) { + $foreign_licenses = array( + 'ids' => array(), + 'license_keys' => array() + ); + + $parent_license_ids_map = array(); + + foreach ( $all_licenses as $license ) { + if ( $license->user_id == $this->_user->id || $license->id == $site_license_id ) { + continue; + } + + $foreign_licenses['ids'][] = $license->id; + $foreign_licenses['license_keys'][] = $license->secret_key; + + if ( + $include_parent_licenses && + is_object( $this->_license ) && + FS_Plugin_License::is_valid_id( $this->_license->parent_license_id ) && + ! isset( $parent_license_ids_map[ $this->_license->parent_license_id ] ) + ) { + /** + * Include the parent license's info only if it has not been included before since child licenses + * can have the same parent license. + */ + $foreign_licenses['ids'][] = $this->_license->parent_license_id; + $foreign_licenses['license_keys'][] = $license->secret_key; + + $parent_license_ids_map[ $this->_license->parent_license_id ] = true; + } + } + + if ( empty( $foreign_licenses['ids'] ) ) { + $foreign_licenses = array(); + } + + return $foreign_licenses; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + * + * @return string + */ + private function get_valid_user_licenses_endpoint() { + $user_licenses_endpoint = '/licenses.json?type=active' . + ( FS_Plugin::is_valid_id( $this->get_bundle_id() ) ? '&is_enriched=true' : '' ); + + $foreign_licenses = $this->get_foreign_licenses_info( self::get_all_licenses( $this->_module_id ), null, true ); + + if ( ! empty ( $foreign_licenses ) ) { + $foreign_licenses = array( + // Prefix with `+` to tell the server to include foreign licenses in the licenses collection. + 'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ), + 'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) ) + ); + + $user_licenses_endpoint = add_query_arg( $foreign_licenses, $user_licenses_endpoint ); + } + + return $user_licenses_endpoint; + } + + /** + * Fetches active licenses that are enriched with product type if there's a context `bundle_id` and bundle + * licenses enriched with product IDs if there are any. From the licenses, the `get_updated_account_addons` + * method filters out non–add-on product IDs and stores the add-on IDs. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.4 + * + * @return stdClass[] array + */ + private function fetch_valid_user_licenses() { + $this->_logger->entrance(); + + $result = $this->get_api_user_scope()->get( $this->get_valid_user_licenses_endpoint() ); + + if ( ! $this->is_api_result_object( $result, 'licenses' ) || + ! is_array( $result->licenses ) + ) { + return array(); + } + + return $result->licenses; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.2.4 + * + * @return number[] Account add-on IDs. + */ + function get_updated_account_addons() { + $addons = $this->get_addons(); + if ( empty( $addons ) ) { + return array(); + } + + $account_addons = $this->get_account_addons(); + if ( ! is_array( $account_addons ) ) { + $account_addons = array(); + } + + $user_licenses = $this->is_registered() ? + $this->fetch_valid_user_licenses() : + array(); + + if ( empty( $user_licenses ) ) { + return $account_addons; + } + + $addon_ids = array(); + foreach ( $addons as $addon ) { + $addon_ids[] = $addon->id; + } + + $license_product_ids = array(); + + foreach ( $user_licenses as $license ) { + if ( isset( $license->plugin_type ) && 'bundle' === $license->plugin_type ) { + $license_product_ids = array_merge( $license_product_ids, $license->products ); + } else { + $license_product_ids[] = $license->plugin_id; + } + } + + // Filter out non–add-on IDs. + $new_account_addons = array_intersect( $addon_ids, $license_product_ids ); + if ( count( $new_account_addons ) !== count( $account_addons ) ) { + $this->_store_account_addons( array_unique( $new_account_addons ) ); + } + + return $new_account_addons; + } + + /** + * Store account params in the Database. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.1 + * + * @param null|int $blog_id Since 2.0.0 + */ + private function _store_account( $blog_id = null ) { + $this->_logger->entrance(); + + $this->_store_site( false, $blog_id ); + $this->_store_user( false ); + $this->_store_plans( false ); + $this->_store_licenses( false ); + + self::$_accounts->store( $blog_id ); + } + + /** + * Sync user's information. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * @uses FS_Api + */ + private function _handle_account_user_sync() { + $this->_logger->entrance(); + + $api = $this->get_api_user_scope(); + + // Get user's information. + $user = $api->get( '/', true ); + + if ( isset( $user->id ) ) { + $this->_user->first = $user->first; + $this->_user->last = $user->last; + $this->_user->email = $user->email; + + $is_menu_item_account_visible = $this->is_submenu_item_visible( 'account' ); + + if ( $user->is_verified && + ( ! isset( $this->_user->is_verified ) || false === $this->_user->is_verified ) + ) { + $this->_user->is_verified = true; + + $this->do_action( 'account_email_verified', $user->email ); + + $this->_admin_notices->add( + $this->get_text_inline( 'Your email has been successfully verified - you are AWESOME!', 'email-verified-message' ), + $this->get_text_x_inline( 'Right on', 'a positive response', 'right-on' ) . '!', + 'success', + // Make admin sticky if account menu item is invisible, + // since the page will be auto redirected to the plugin's + // main settings page, and the non-sticky message + // will disappear. + ! $is_menu_item_account_visible, + 'email_verified' + ); + } + + // Flush user details to DB. + $this->_store_user(); + + $this->do_action( 'after_account_user_sync', $user ); + + /** + * If account menu item is hidden, redirect to plugin's main settings page. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.6 + * + * @link https://github.com/Freemius/wordpress-sdk/issues/6 + */ + if ( ! $is_menu_item_account_visible ) { + fs_redirect( $this->_get_admin_page_url() ); + } + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * @uses FS_Api + * + * @param number|bool $license_id + * + * @return FS_Subscription|object|bool + */ + private function _fetch_site_license_subscription( $license_id = false ) { + $this->_logger->entrance(); + $api = $this->get_api_site_scope(); + + if ( ! is_numeric( $license_id ) ) { + $license_id = FS_Plugin_License::is_valid_id( $this->_license->parent_license_id ) ? + $this->_license->parent_license_id : + $this->_license->id; + } + + $result = $api->get( "/licenses/{$license_id}/subscriptions.json", true ); + + return ! isset( $result->error ) ? + ( ( is_array( $result->subscriptions ) && 0 < count( $result->subscriptions ) ) ? + new FS_Subscription( $result->subscriptions[0] ) : + false + ) : + $result; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * @uses FS_Api + * + * @param number|bool $plan_id + * + * @return FS_Plugin_Plan|object + */ + private function _fetch_site_plan( $plan_id = false ) { + $this->_logger->entrance(); + $api = $this->get_api_site_scope(); + + if ( ! is_numeric( $plan_id ) ) { + $plan_id = $this->_site->plan_id; + } + + $plan = $api->get( "/plans/{$plan_id}.json", true ); + + return ! isset( $plan->error ) ? new FS_Plugin_Plan( $plan ) : $plan; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * @uses FS_Api + * + * @return FS_Plugin_Plan[]|object + */ + private function _fetch_plugin_plans() { + $this->_logger->entrance(); + $api = $this->get_current_or_network_user_api_scope(); + + /** + * @since 1.2.3 When running in DEV mode, retrieve pending plans as well. + */ + $result = $api->get( $this->add_show_pending( "/plugins/{$this->_module_id}/plans.json" ), true ); + + if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) { + for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) { + $result->plans[ $i ] = new FS_Plugin_Plan( $result->plans[ $i ] ); + } + + $result = $result->plans; + } + + return $result; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $plan_id + * + * @return \FS_Plugin_Plan|object + */ + private function fetch_plan_by_id( $plan_id ) { + $this->_logger->entrance(); + $api = $this->get_current_or_network_user_api_scope(); + + $result = $api->get( "/plugins/{$this->_module_id}/plans/{$plan_id}.json", true ); + + return $this->is_api_result_entity( $result ) ? + new FS_Plugin_Plan( $result ) : + $result; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * @uses FS_Api + * + * @param number|bool $plugin_id + * @param number|bool $site_license_id + * @param array $foreign_licenses @since 2.0.0. This is used by network-activated plugins. + * @param number|null $blog_id + * + * @return FS_Plugin_License[]|object + */ + private function _fetch_licenses( + $plugin_id = false, + $site_license_id = false, + $foreign_licenses = array(), + $blog_id = null + ) { + $this->_logger->entrance(); + + $api = $this->get_api_user_scope(); + + if ( ! is_numeric( $plugin_id ) ) { + $plugin_id = $this->_plugin->id; + } + + $user_licenses_endpoint = "/plugins/{$plugin_id}/licenses.json?is_enriched=true"; + if ( ! empty ( $foreign_licenses ) ) { + $foreign_licenses = array( + // Prefix with `+` to tell the server to include foreign licenses in the licenses collection. + 'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ), + 'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) ) + ); + + $user_licenses_endpoint = add_query_arg( $foreign_licenses, $user_licenses_endpoint ); + } + + $result = $api->get( $user_licenses_endpoint, true ); + + $is_site_license_synced = false; + + $api_errors = array(); + + if ( $this->is_api_result_object( $result, 'licenses' ) && + is_array( $result->licenses ) + ) { + for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) { + $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] ); + + if ( ( ! $is_site_license_synced ) && is_numeric( $site_license_id ) ) { + $is_site_license_synced = ( $site_license_id == $result->licenses[ $i ]->id ); + } + } + + $result = $result->licenses; + } else { + $api_errors[] = $result; + $result = array(); + } + + if ( ! $is_site_license_synced ) { + if ( ! is_null( $blog_id ) ) { + /** + * If blog ID is not null, the request is for syncing of the license of a single site via the + * network-level "Account" page. + * + * @author Leo Fajardo (@leorw) + */ + $this->switch_to_blog( $blog_id ); + } + + $api = $this->get_api_site_scope(); + + if ( is_numeric( $site_license_id ) ) { + // Try to retrieve a foreign license that is linked to the install. + $api_result = $api->call( '/licenses.json?is_enriched=true' ); + + if ( $this->is_api_result_object( $api_result, 'licenses' ) && + is_array( $api_result->licenses ) + ) { + $licenses = $api_result->licenses; + + if ( ! empty( $licenses ) ) { + $result[] = new FS_Plugin_License( $licenses[0] ); + } + } else { + $api_errors[] = $api_result; + } + } else if ( + is_object( $this->_license ) && + /** + * Sync only if the license belongs to the context plugin. `$plugin_id` can be an add-on ID while + * the FS instance that does the syncing is the parent FS instance. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + $this->_license->plugin_id == $plugin_id + ) { + $is_license_in_result = false; + if ( ! empty( $result ) ) { + foreach ( $result as $license ) { + if ( $license->id == $this->_license->id ) { + $is_license_in_result = true; + break; + } + } + } + + if ( ! $is_license_in_result ) { + // Fetch foreign license by ID and license key. + $license = $api->get( "/licenses/{$this->_license->id}.json?license_key=" . + urlencode( $this->_license->secret_key ) . '&is_enriched=true' ); + + if ( $this->is_api_result_entity( $license ) ) { + $result[] = new FS_Plugin_License( $license ); + } else { + $api_errors[] = $license; + } + } + } + + if ( ! is_null( $blog_id ) ) { + $this->switch_to_blog( $this->_storage->network_install_blog_id ); + } + } + + if ( is_array( $result ) && 0 < count( $result ) ) { + // If found at least one license, return license collection even if there are errors. + return $result; + } + + if ( ! empty( $api_errors ) ) { + // If found any errors and no licenses, return first error. + return $api_errors[0]; + } + + // Fallback to empty licenses list. + return $result; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param number $license_id + * @param string $license_key + * + * @return \FS_Plugin_License|object + */ + private function fetch_license_by_key( $license_id, $license_key ) { + $this->_logger->entrance(); + + $api = $this->get_current_or_network_user_api_scope(); + + $result = $api->get( "/licenses/{$license_id}.json?license_key=" . urlencode( $license_key ) ); + + return $this->is_api_result_entity( $result ) ? + new FS_Plugin_License( $result ) : + $result; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.0 + * @uses FS_Api + * + * @param number|bool $plugin_id + * @param bool $flush + * + * @return FS_Payment[]|object + */ + function _fetch_payments( $plugin_id = false, $flush = false ) { + $this->_logger->entrance(); + + $api = $this->get_api_user_scope(); + + if ( ! is_numeric( $plugin_id ) ) { + $plugin_id = $this->_plugin->id; + } + + $include_bundles = ( + is_object( $this->_plugin ) && + FS_Plugin::is_valid_id( $this->_plugin->bundle_id ) + ); + + $result = $api->get( + "/plugins/{$plugin_id}/payments.json?include_addons=true" . ($include_bundles ? '&include_bundles=true' : ''), + $flush + ); + + if ( ! isset( $result->error ) ) { + for ( $i = 0, $len = count( $result->payments ); $i < $len; $i ++ ) { + $result->payments[ $i ] = new FS_Payment( $result->payments[ $i ] ); + } + $result = $result->payments; + } + + return $result; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * @uses FS_Api + * + * @param bool $flush + * + * @return \FS_Billing|mixed + */ + function _fetch_billing( $flush = false ) { + require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-billing.php'; + + $billing = $this->get_api_user_scope()->get( 'billing.json', $flush ); + + if ( $this->is_api_result_entity( $billing ) ) { + $billing = new FS_Billing( $billing ); + } + + return $billing; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param FS_Plugin_License[] $licenses + * @param number $module_id + */ + private function _update_licenses( $licenses, $module_id ) { + $this->_logger->entrance(); + + if ( is_array( $licenses ) ) { + for ( $i = 0, $len = count( $licenses ); $i < $len; $i ++ ) { + $licenses[ $i ]->updated = time(); + } + } + + $this->_store_licenses( true, $module_id, $licenses ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param bool|number $plugin_id + * @param bool $flush Since 1.1.7.3 + * @param int $expiration Since 1.2.2.7 + * @param bool|string $newer_than Since 2.2.1 + * + * @return object|false New plugin tag info if exist. + */ + private function _fetch_newer_version( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $newer_than = false ) { + $latest_tag = $this->_fetch_latest_version( $plugin_id, $flush, $expiration, $newer_than ); + + if ( ! is_object( $latest_tag ) ) { + return false; + } + + $plugin_version = $this->get_plugin_version(); + + // Check if version is actually newer. + $has_new_version = + // If it's an non-installed add-on then always return latest. + ( $this->_is_addon_id( $plugin_id ) && ! $this->is_addon_activated( $plugin_id ) ) || + // Compare versions. + version_compare( $plugin_version, $latest_tag->version, '<' ); + + $this->_logger->departure( $has_new_version ? 'Found newer plugin version ' . $latest_tag->version : 'No new version' ); + + $is_latest_version_beta = ( 'beta' === $latest_tag->release_mode ); + + $this->_storage->beta_data = array( + 'is_beta' => $is_latest_version_beta, + 'version' => $latest_tag->version + ); + + return $has_new_version ? $latest_tag : false; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param bool|number $plugin_id + * @param bool $flush Since 1.1.7.3 + * @param int $expiration Since 1.2.2.7 + * @param bool|string $newer_than Since 2.2.1 + * + * @return bool|FS_Plugin_Tag + */ + function get_update( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $newer_than = false ) { + $this->_logger->entrance(); + + if ( ! is_numeric( $plugin_id ) ) { + $plugin_id = $this->_plugin->id; + } + + $this->check_updates( true, $plugin_id, $flush, $expiration, $newer_than ); + $updates = $this->get_all_updates(); + + return isset( $updates[ $plugin_id ] ) && is_object( $updates[ $plugin_id ] ) ? $updates[ $plugin_id ] : false; + } + + /** + * Check if site assigned with active license. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @deprecated Please use has_active_valid_license() instead because license can be cancelled. + */ + function has_active_license() { + return ( + is_object( $this->_license ) && + is_numeric( $this->_license->id ) && + ! $this->_license->is_expired() + ); + } + + /** + * Check if site assigned with active & valid (not expired) license. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1 + * + * @param bool $check_expiration + */ + function has_active_valid_license( $check_expiration = true ) { + return self::is_active_valid_license( $this->_license, $check_expiration ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + */ + function is_data_debug_mode() { + if ( is_null( $this->is_whitelabeled ) || ! $this->is_whitelabeled ) { + return false; + } + + $fs = $this->is_addon() ? + $this->get_parent_instance() : + $this; + + if ( $fs->is_network_active() && fs_is_network_admin() ) { + $is_developer_license_debug_mode = get_site_transient( "fs_{$this->get_id()}_data_debug_mode" ); + } else { + $is_developer_license_debug_mode = get_transient( "fs_{$this->get_id()}_data_debug_mode" ); + } + + return ( 'true' === $is_developer_license_debug_mode ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + */ + function _set_data_debug_mode() { + if ( ! $this->is_whitelabeled( true ) ) { + return; + } + + $license_or_user_key = fs_request_get( 'license_or_user_key' ); + + $transient_value = ( ! empty( $license_or_user_key ) ) ? + 'true' : + 'false'; + + if ( 'true' === $transient_value ) { + $stored_key = $this->_storage->get( ! FS_User::is_valid_id( $this->_storage->last_license_user_id ) ? + 'last_license_key' : + 'last_license_user_key' + ); + + if ( md5( $license_or_user_key ) !== $stored_key ) { + $this->shoot_ajax_failure( sprintf( + '%s... %s', + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ), + $this->get_text_inline( + 'seems like the key you entered doesn\'t match our records.', + 'developer-or-license-not-found' + ) + ) ); + } + } + + if ( $this->is_network_active() && fs_is_network_admin() ) { + set_site_transient( + "fs_{$this->get_id()}_data_debug_mode", + $transient_value, + WP_FS__TIME_24_HOURS_IN_SEC / 24 + ); + } else { + set_transient( + "fs_{$this->get_id()}_data_debug_mode", + $transient_value, + WP_FS__TIME_24_HOURS_IN_SEC / 24 + ); + } + + if ( 'true' === $transient_value ) { + $this->_admin_notices->add_sticky( + $this->get_text_inline( + 'Debug mode was successfully enabled and will be automatically disabled in 60 min. You can also disable it earlier by clicking the "Stop Debug" link.', + 'data_debug_mode_enabled' + ), + 'data_debug_mode_enabled' + ); + } + + $this->shoot_ajax_success(); + } + + /** + * Check if a given license is active & valid (not expired). + * + * @author Vova Feldman (@svovaf) + * @since 2.1.3 + * + * @param FS_Plugin_License $license + * @param bool $check_expiration + * + * @return bool + */ + private static function is_active_valid_license( $license, $check_expiration = true ) { + return ( + is_object( $license ) && + FS_Plugin_License::is_valid_id( $license->id ) && + $license->is_active() && + ( ! $check_expiration || $license->is_valid() ) + ); + } + + /** + * Checks if there's any site that is associated with an active & valid license. + * This logic is used to determine if the admin can download the premium code base from a network level admin. + * + * @author Vova Feldman (@svovaf) + * @since 2.1.3 + * + * @return bool + */ + function has_any_active_valid_license() { + if ( ! fs_is_network_admin() ) { + return $this->has_active_valid_license(); + } + + $installs = $this->get_blog_install_map(); + $all_plugin_licenses = self::get_all_licenses( $this->_module_id ); + + foreach ( $installs as $blog_id => $install ) { + if ( ! FS_Plugin_License::is_valid_id( $install->license_id ) ) { + continue; + } + + foreach ( $all_plugin_licenses as $license ) { + if ( $license->id == $install->license_id ) { + if ( self::is_active_valid_license( $license ) ) { + return true; + } + } + } + } + + return false; + } + + /** + * Check if site assigned with license with enabled features. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return bool + */ + function has_features_enabled_license() { + return ( + is_object( $this->_license ) && + is_numeric( $this->_license->id ) && + $this->_license->is_features_enabled() + ); + } + + /** + * Checks if the product is activated with a bundle license. + * + * @author Leo Fajardo (@leorw) + * @since 2.4.0 + * + * @return bool + */ + function is_activated_with_bundle_license() { + if ( ! $this->has_features_enabled_license() ) { + return false; + } + + return FS_Plugin_License::is_valid_id( $this->_license->parent_license_id ); + } + + /** + * Check if user is a trial or have feature enabled license. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7 + * + * @return bool + */ + function can_use_premium_code() { + return $this->is_trial() || $this->has_features_enabled_license(); + } + + /** + * Checks if the current user can activate plugins or switch themes. Note that this method should only be used + * after the `init` action is triggered because it is using `current_user_can()` which is only functional after + * the context user is authenticated. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + * + * @return bool + */ + function is_user_admin() { + /** + * Require a super-admin when network activated, running from the network level OR if + * running from the site level but not delegated the opt-in. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + if ( $this->_is_network_active && + ( fs_is_network_admin() || ! $this->is_delegated_connection() ) + ) { + return is_super_admin(); + } + + return ( $this->is_plugin() && current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) + || ( $this->is_theme() && current_user_can( 'switch_themes' ) ); + } + + /** + * Sync site's plan. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * + * @uses FS_Api + * + * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by + * the admin. + * @param bool $is_context_single_site @since 2.0.0. This is used when syncing a license for a single install from the + * network-level "Account" page. + * @param int|null $current_blog_id @since 2.2.3. This is passed from the `execute_cron` method and used by the + * `_sync_plugin_license` method in order to switch to the previous blog when sending + * updates for a single site in case `execute_cron` has switched to a different blog. + */ + private function _sync_license( $background = false, $is_context_single_site = false, $current_blog_id = null ) { + $this->_logger->entrance(); + + $plugin_id = fs_request_get( 'plugin_id', $this->get_id() ); + + $is_addon_sync = ( ! $this->_plugin->is_addon() && $plugin_id != $this->get_id() ); + + if ( $is_addon_sync ) { + $this->_sync_addon_license( $plugin_id, $background ); + } else { + $this->_sync_plugin_license( $background, true, $is_context_single_site, $current_blog_id ); + } + + $this->do_action( 'after_account_plan_sync', $this->get_plan_name() ); + } + + /** + * Sync plugin's add-on license. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * @uses FS_Api + * + * @param number $addon_id + * @param bool $background + */ + private function _sync_addon_license( $addon_id, $background ) { + $this->_logger->entrance(); + + if ( $this->is_addon_activated( $addon_id ) ) { + // If already installed, use add-on sync. + $fs_addon = self::get_instance_by_id( $addon_id ); + + if ( + // Add-on is network activated and network integrated. + $fs_addon->is_network_active() || + // Background sync cron. + self::is_cron() || + // Add-on is not network activated or not network integrated. + ! fs_is_network_admin() + ) { + $fs_addon->_sync_license( $background ); + + return; + } + } + + // Validate add-on exists. + $addon = $this->get_addon( $addon_id ); + + if ( ! is_object( $addon ) ) { + return; + } + + // Add add-on into account add-ons. + $account_addons = $this->get_account_addons(); + if ( ! is_array( $account_addons ) ) { + $account_addons = array(); + } + $account_addons[] = $addon->id; + $account_addons = array_unique( $account_addons ); + $this->_store_account_addons( $account_addons ); + + // Load add-on licenses. + $licenses = $this->_fetch_licenses( $addon->id ); + + // Sync add-on licenses. + if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) { + $this->_update_licenses( $licenses, $addon->id ); + + if ( ! $this->is_addon_installed( $addon->id ) && FS_License_Manager::has_premium_license( $licenses ) ) { + $plans_result = $this->get_api_site_or_plugin_scope()->get( $this->add_show_pending( "/addons/{$addon_id}/plans.json" ) ); + + if ( ! isset( $plans_result->error ) ) { + $plans = array(); + foreach ( $plans_result->plans as $plan ) { + $plans[] = new FS_Plugin_Plan( $plan ); + } + + $this->_admin_notices->add_sticky( + sprintf( + ( FS_Plan_Manager::instance()->has_free_plan( $plans ) ? + $this->get_text_inline( 'Your %s Add-on plan was successfully upgraded.', 'addon-successfully-upgraded-message' ) : + /* translators: %s:product name, e.g. Facebook add-on was successfully... */ + $this->get_text_inline( '%s Add-on was successfully purchased.', 'addon-successfully-purchased-message' ) ), + $addon->title + ) . ' ' . $this->get_latest_download_link( + $this->get_text_inline( 'Download the latest version', 'download-latest-version' ), + $addon_id + ), + 'addon_plan_upgraded_' . $addon->slug, + $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' + ); + } + } + } + } + + /** + * Sync site's plugin plan. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * @uses FS_Api + * + * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by the admin. + * @param bool $send_installs_update Since 2.0.0 + * @param bool $is_context_single_site Since 2.0.0. This is used when sending an update for a single install and + * syncing its license from the network-level "Account" page (e.g.: after + * activating a license only for the single install). + * @param int|null $current_blog_id Since 2.2.3. This is passed from the `execute_cron` method so that it + * can be used here to switch to the previous blog in case `execute_cron` + * has switched to a different blog. + */ + private function _sync_plugin_license( + $background = false, + $send_installs_update = true, + $is_context_single_site = false, + $current_blog_id = null + ) { + $this->_logger->entrance(); + + $plan_change = 'none'; + + $is_site_level_sync = ( $is_context_single_site || fs_is_blog_admin() || ! $this->_is_network_active ); + + if ( ! $send_installs_update ) { + $site = $this->_site; + } else { + /** + * Sync site info. + * + * @todo This line will execute install sync on a daily basis, even if running the free version (for opted-in users). The reason we want to keep it that way is for cases when the user was a paying customer, then there was a failure in subscription payment, and then after some time the payment was successful. This could be heavily optimized. For example, we can skip the $flush if the current install was never associated with a paid version. + */ + if ( $is_site_level_sync ) { + /** + * Switch to the previous blog since `execute_cron` may have switched to a different blog. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + if ( is_numeric( $current_blog_id ) ) { + $this->switch_to_blog( $current_blog_id ); + } + + $result = $this->send_install_update( array(), true ); + $is_valid = $this->is_api_result_entity( $result ); + } else { + $result = $this->send_installs_update( array(), true ); + $is_valid = $this->is_api_result_object( $result, 'installs' ); + } + + if ( ! $is_valid ) { + if ( $is_context_single_site ) { + // Switch back to the main blog so that the following logic will have the right entities. + $this->switch_to_blog( $this->_storage->network_install_blog_id ); + } + + // Show API messages only if not background sync or if paying customer. + if ( ! $background || $this->is_paying() ) { + // Try to ping API to see if not blocked. + if ( ! FS_Api::test() ) { + /** + * Failed to ping API - blocked! + * + * @author Vova Feldman (@svovaf) + * @since 1.1.6 Only show message related to one of the Freemius powered plugins. Once it will be resolved it will fix the issue for all plugins anyways. There's no point to scare users with multiple error messages. + */ + $api = $this->get_api_site_scope(); + + if ( ! self::$_global_admin_notices->has_sticky( 'api_blocked' ) ) { + self::$_global_admin_notices->add( + sprintf( + $this->get_text_inline( 'Your server is blocking the access to Freemius\' API, which is crucial for %1$s synchronization. Please contact your host to whitelist %2$s', 'server-blocking-access' ), + $this->get_plugin_name(), + '' . implode( ', ', $this->apply_filters( 'api_domains', array( + 'api.freemius.com', + 'wp.freemius.com' + ) ) ) . '' + ) . '
    ' . $this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . var_export( $result->error, true ), + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error', + $background, + 'api_blocked' + ); + } + } else { + // Authentication params are broken. + $this->_admin_notices->add( + $this->get_text_inline( 'It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again.', 'wrong-authentication-param-message' ) . '
    ' . $this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . var_export( $result->error, true ), + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error' + ); + } + } + + // No reason to continue with license sync while there are API issues. + return; + } + + if ( $is_site_level_sync ) { + $site = new FS_Site( $result ); + } else { + // Map site addresses to their blog IDs. + $address_to_blog_map = $this->get_address_to_blog_map(); + + // Find the current context install. + $site = null; + foreach ( $result->installs as $install ) { + if ( $install->id == $this->_site->id ) { + $site = new FS_Site( $install ); + } else { + $address = trailingslashit( fs_strip_url_protocol( $install->url ) ); + $blog_id = $address_to_blog_map[ $address ]; + + $this->_store_site( true, $blog_id, new FS_Site( $install ) ); + } + } + } + + // Sync plans. + $this->_sync_plans(); + } + + // Remove sticky API connectivity message. + self::$_global_admin_notices->remove_sticky( 'api_blocked' ); + + if ( ! $this->has_paid_plan() ) { + $this->_site = $site; + $this->_store_site( + true, + $is_site_level_sync ? + null : + $this->get_network_install_blog_id() + ); + } else { + $context_blog_id = 0; + + if ( $is_context_single_site ) { + $context_blog_id = get_current_blog_id(); + + // Switch back to the main blog in order to properly sync the license. + $this->switch_to_blog( $this->_storage->network_install_blog_id ); + } + + /** + * Sync licenses. Pass the site's license ID so that the foreign licenses will be fetched if the license + * associated with that ID is not included in the user's licenses collection. + */ + $this->_sync_licenses( + $site->license_id, + ( $is_context_single_site ? + $context_blog_id : + null + ) + ); + + if ( $is_context_single_site ) { + $this->switch_to_blog( $context_blog_id ); + } + + // Check if plan / license changed. + if ( $site->plan_id != $this->_site->plan_id || + // Check if trial started. + $site->trial_plan_id != $this->_site->trial_plan_id || + $site->trial_ends != $this->_site->trial_ends || + // Check if license changed. + $site->license_id != $this->_site->license_id + ) { + if ( $site->is_trial() && ( ! $this->_site->is_trial() || $site->trial_ends != $this->_site->trial_ends ) ) { + // New trial started. + $this->_site = $site; + $plan_change = 'trial_started'; + + // For trial with subscription use-case. + $new_license = is_null( $site->license_id ) ? null : $this->_get_license_by_id( $site->license_id ); + + if ( is_object( $new_license ) && $new_license->is_valid() ) { + $this->_site = $site; + $this->_update_site_license( $new_license ); + $this->_store_licenses(); + + $this->_sync_site_subscription( $this->_license ); + } + } else if ( $this->_site->is_trial() && ! $site->is_trial() && ! is_numeric( $site->license_id ) ) { + // Was in trial, but now trial expired and no license ID. + // New trial started. + $this->_site = $site; + $plan_change = 'trial_expired'; + } else { + $is_free = $this->is_free_plan(); + + // Make sure license exist and not expired. + $new_license = is_null( $site->license_id ) ? + null : + $this->_get_license_by_id( $site->license_id ); + + if ( $is_free && is_null( $new_license ) && $this->has_any_license() && $this->_license->is_cancelled ) { + // License cancelled. + $this->_site = $site; + $this->_update_site_license( $new_license ); + $this->_store_licenses(); + + $plan_change = 'cancelled'; + } else if ( $is_free && ( ( ! is_object( $new_license ) || $new_license->is_expired() ) ) ) { + // The license is expired, so ignore upgrade method. + $this->_site = $site; + } else { + // License changed. + $this->_site = $site; + + /** + * IMPORTANT: + * The line below should be executed before trying to activate the license on the rest of the network, otherwise, the license' activation counters may be out of sync + there's no need to activate the license on the context site since it's already activated on it. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + $this->_update_site_license( $new_license ); + + if ( ! $is_context_single_site && + fs_is_network_admin() && + $this->_is_network_active && + $new_license->quota > 1 && + get_blog_count() > 1 + ) { + // See if license can activated on all sites. + if ( ! $this->try_activate_license_on_network( $this->_user, $new_license ) ) { + if ( ! fs_request_get_bool( 'auto_install' ) ) { + // Open the license activation dialog box on the account page. + add_action( 'admin_footer', array( + &$this, + '_open_license_activation_dialog_box' + ) ); + } + } + } + + $this->_store_licenses(); + + $plan_change = $is_free ? + ( $this->is_only_premium() ? 'activated' : 'upgraded' ) : + ( is_object( $new_license ) ? + 'changed' : + 'downgraded' ); + } + } + + // Store updated site info. + $this->_store_site( + true, + $is_site_level_sync ? + null : + $this->get_network_install_blog_id() + ); + } else { + if ( ! is_object( $this->_license ) ) { + $this->maybe_update_whitelabel_flag( + FS_Plugin_License::is_valid_id( $site->license_id ) ? + $this->get_license_by_id( $site->license_id ) : + null + ); + } else { + $this->maybe_update_whitelabel_flag( $this->_license ); + + if ( $this->_license->is_expired() ) { + if ( ! $this->has_features_enabled_license() ) { + $this->_deactivate_license(); + $plan_change = 'downgraded'; + } else { + $last_time_expired_license_notice_was_shown = $this->_storage->get( 'expired_license_notice_shown', 0 ); + + if ( time() - ( 14 * WP_FS__TIME_24_HOURS_IN_SEC ) >= $last_time_expired_license_notice_was_shown ) { + /** + * Show the expired license notice every 14 days. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + */ + $plan_change = 'expired'; + } + } + } + } + + if ( is_numeric( $site->license_id ) && is_object( $this->_license ) ) { + $this->_sync_site_subscription( $this->_license ); + } + } + + if ( ! $this->is_addon() && + $this->_site->is_beta() !== $site->is_beta + ) { + // Beta flag updated. + $this->_site = $site; + + $this->_store_site( + true, + $is_site_level_sync ? + null : + $this->get_network_install_blog_id() + ); + } + + if ( $this->is_addon() || $this->has_addons() ) { + /** + * Purge the valid user licenses cache so that when the "Account" or the "Add-Ons" page is loaded, + * an updated valid user licenses collection will be fetched from the server which is used to also + * update the account add-ons (add-ons the user has licenses for). + * + * @author Leo Fajardo (@leorw) + * @since 2.2.4 + */ + $this->purge_valid_user_licenses_cache(); + } + } + + $hmm_text = $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...'; + + if ( $this->apply_filters( 'has_paid_plan_account', $this->has_paid_plan() ) ) { + switch ( $plan_change ) { + case 'none': + if ( ! $background && is_admin() ) { + $plan = $this->is_trial() ? + $this->get_trial_plan() : + $this->get_plan(); + + if ( $plan->is_free() ) { + $this->_admin_notices->add( + sprintf( + $this->get_text_inline( 'It looks like you are still on the %s plan. If you did upgrade or change your plan, it\'s probably an issue on our side - sorry.', 'plan-did-not-change-message' ), + '' . $plan->title . ( $this->is_trial() ? ' ' . $this->get_text_x_inline( 'Trial', 'trial period', 'trial' ) : '' ) . '' + ) . ' ' . sprintf( + '%s', + $this->contact_url( + 'bug', + sprintf( $this->get_text_inline( 'I have upgraded my account but when I try to Sync the License, the plan remains %s.', 'plan-did-not-change-email-message' ), + strtoupper( $plan->name ) + ) + ), + $this->get_text_inline( 'Please contact us here', 'contact-us-here' ) + ), + $hmm_text + ); + } + } + break; + case 'upgraded': + case 'activated': + $this->_admin_notices->add_sticky( + ( 'activated' === $plan_change ) ? + $this->get_text_inline( 'Your plan was successfully activated.', 'plan-activated-message' ) : + $this->get_text_inline( 'Your plan was successfully upgraded.', 'plan-upgraded-message' ) . + $this->get_complete_upgrade_instructions(), + 'plan_upgraded', + $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' + ); + + $this->_admin_notices->remove_sticky( array( + 'trial_started', + 'trial_promotion', + 'trial_expired', + 'activation_complete', + 'license_expired', + ) ); + break; + case 'changed': + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( 'Your plan was successfully changed to %s.', 'plan-changed-to-x-message' ), + $this->get_plan_title() + ), + 'plan_changed' + ); + + $this->_admin_notices->remove_sticky( array( + 'trial_started', + 'trial_promotion', + 'trial_expired', + 'activation_complete', + ) ); + break; + case 'downgraded': + $this->_admin_notices->add_sticky( + ($this->has_free_plan() ? + sprintf( $this->get_text_inline( 'Your license has expired. You can still continue using the free %s forever.', 'license-expired-blocking-message' ), $this->_module_type ) : + /* translators: %1$s: product title; %2$s, %3$s: wrapping HTML anchor element; %4$s: 'plugin', 'theme', or 'add-on'. */ + sprintf( $this->get_text_inline( 'Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions.', 'license-expired-blocking-message_premium-only' ), sprintf('', $this->pricing_url()), '', $this->get_module_label(true) ) ), + 'license_expired', + $hmm_text + ); + $this->_admin_notices->remove_sticky( 'plan_upgraded' ); + break; + case 'cancelled': + $this->_admin_notices->add( + $this->get_text_inline( 'Your license has been cancelled. If you think it\'s a mistake, please contact support.', 'license-cancelled' ) . ' ' . + sprintf( + '%s', + $this->contact_url( 'bug' ), + $this->get_text_inline( 'Please contact us here', 'contact-us-here' ) + ), + $hmm_text, + 'error' + ); + $this->_admin_notices->remove_sticky( 'plan_upgraded' ); + break; + case 'expired': + $this->_admin_notices->add_sticky( + sprintf( $this->get_text_inline( 'Your license has expired. You can still continue using all the %s features, but you\'ll need to renew your license to continue getting updates and support.', 'license-expired-non-blocking-message' ), $this->get_plan()->title ), + 'license_expired', + $hmm_text + ); + + $this->_storage->expired_license_notice_shown = WP_FS__SCRIPT_START_TIME; + + $this->_admin_notices->remove_sticky( 'plan_upgraded' ); + break; + case 'trial_started': + $this->_admin_notices->add_sticky( + sprintf( + $this->get_text_inline( 'Your trial has been successfully started.', 'trial-started-message' ), + '' . $this->get_plugin_name() . '' + ) . $this->get_complete_upgrade_instructions( $this->get_trial_plan()->title ), + 'trial_started', + $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' + ); + + $this->_admin_notices->remove_sticky( array( + 'trial_promotion', + ) ); + break; + case 'trial_expired': + $this->_admin_notices->add_sticky( + ($this->has_free_plan() ? + $this->get_text_inline( 'Your free trial has expired. You can still continue using all our free features.', 'trial-expired-message' ) : + /* translators: %1$s: product title; %2$s, %3$s: wrapping HTML anchor element; %4$s: 'plugin', 'theme', or 'add-on'. */ + sprintf( $this->get_text_inline( 'Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions.', 'trial-expired-message_premium-only' ), sprintf('', $this->pricing_url()), '', $this->get_module_label(true))), + 'trial_expired', + $hmm_text + ); + $this->_admin_notices->remove_sticky( array( + 'trial_started', + 'trial_promotion', + 'plan_upgraded', + ) ); + break; + } + } + + if ( 'none' !== $plan_change ) { + if ( + ! is_object( $this->_license ) || + ! $this->_license->is_whitelabeled + ) { + $this->_admin_notices->remove_sticky( 'license_whitelabeled' ); + } + + $this->do_action( 'after_license_change', $plan_change, $this->get_plan() ); + } + } + + /** + * Include the required JS at the footer of the admin to trigger the license activation dialog box. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + */ + public function _open_license_activation_dialog_box() { + $vars = array( 'license_id' => $this->_site->license_id ); + fs_require_once_template( 'js/open-license-activation.php', $vars ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param bool $background + * @param FS_Plugin_License|null $premium_license + */ + protected function _activate_license( $background = false, $premium_license = null ) { + $this->_logger->entrance(); + + if ( is_null( $premium_license ) ) { + $license_id = fs_request_get( 'license_id' ); + + if ( is_object( $this->_site ) && + FS_Plugin_License::is_valid_id( $license_id ) && + $license_id == $this->_site->license_id + ) { + // License is already activated. + return; + } + + $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ? + $this->_get_license_by_id( $license_id ) : + $this->_get_available_premium_license(); + } + + if ( ! is_object( $premium_license ) ) { + return; + } + + if ( ! is_object( $this->_site ) ) { + // Not yet opted-in. + $user = $this->get_current_or_network_user(); + if ( ! is_object( $user ) ) { + $user = self::_get_user_by_id( $premium_license->user_id ); + } + + if ( is_object( $user ) ) { + $this->install_with_user( $user, $premium_license->secret_key, false, false, false ); + } else { + $this->opt_in( + false, + false, + false, + $premium_license->secret_key + ); + + return; + } + } + + + /** + * If the premium license is already associated with the install, just + * update the license reference (activation is not required). + * + * @since 1.1.9 + */ + if ( $premium_license->id == $this->_site->license_id ) { + // License is already activated. + $this->_update_site_license( $premium_license ); + $this->_store_account(); + + return; + } + + if ( $this->_site->user_id != $premium_license->user_id ) { + $api_request_params = array( 'license_key' => $premium_license->secret_key ); + } else { + $api_request_params = array(); + } + + $api = $this->get_api_site_scope(); + $license = $api->call( "/licenses/{$premium_license->id}.json?is_enriched=true", 'put', $api_request_params ); + + if ( ! $this->is_api_result_entity( $license ) ) { + if ( ! $background ) { + $this->_admin_notices->add( sprintf( + '%s %s', + $this->get_text_inline( 'It looks like the license could not be activated.', 'license-activation-failed-message' ), + ( is_object( $license ) && isset( $license->error ) ? + $license->error->message : + sprintf( '%s
    %s', + $this->get_text_inline( 'Error received from the server:', 'server-error-message' ), + var_export( $license, true ) + ) + ) + ), + $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...', + 'error' + ); + } + + return; + } + + $premium_license = new FS_Plugin_License( $license ); + + // Updated site plan. + $site = $this->get_api_site_scope()->get( '/', true ); + if ( $this->is_api_result_entity( $site ) ) { + $this->_site = new FS_Site( $site ); + } + $this->_update_site_license( $premium_license ); + + $this->_store_account(); + + if ( $this->is_addon() || $this->has_addons() ) { + /** + * Purge the valid user licenses cache so that when the "Account" or the "Add-Ons" page is loaded, + * an updated valid user licenses collection will be fetched from the server which is used to also + * update the account add-ons (add-ons the user has licenses for). + * + * @author Leo Fajardo (@leorw) + * @since 2.2.4 + */ + $this->purge_valid_user_licenses_cache(); + } + + if ( ! $background ) { + $this->_admin_notices->add_sticky( + $this->get_text_inline( 'Your license was successfully activated.', 'license-activated-message' ) . + $this->get_complete_upgrade_instructions(), + 'license_activated', + $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!' + ); + } + + $this->_admin_notices->remove_sticky( array( + 'trial_promotion', + 'license_expired', + ) ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.5 + * + * @param bool $show_notice + */ + protected function _deactivate_license( $show_notice = true ) { + $this->_logger->entrance(); + + $hmm_text = $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...'; + + if ( ! FS_Plugin_License::is_valid_id( $this->_site->license_id ) ) { + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'It looks like your site currently doesn\'t have an active license.', 'no-active-license-message' ), $this->get_plan_title() ), + $hmm_text + ); + + return; + } + + $api = $this->get_api_site_scope(); + $license = $api->call( "/licenses/{$this->_site->license_id}.json", 'delete' ); + + $this->handle_license_deactivation_result( $license, $hmm_text, $show_notice ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + * + * @param FS_Plugin_License $license + * @param bool|string $hmm_text + * @param bool $show_notice + */ + private function handle_license_deactivation_result( $license, $hmm_text = false, $show_notice = true ) { + if ( isset( $license->error ) ) { + $this->_admin_notices->add( + $this->get_text_inline( 'It looks like the license deactivation failed.', 'license-deactivation-failed-message' ) . '
    ' . + $this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . ' ' . var_export( $license->error, true ), + $hmm_text, + 'error' + ); + + return; + } + + // Update license cache. + if ( is_array( $this->_licenses ) ) { + for ( $i = 0, $len = count( $this->_licenses ); $i < $len; $i ++ ) { + if ( $license->id == $this->_licenses[ $i ]->id ) { + $this->_licenses[ $i ] = new FS_Plugin_License( $license ); + } + } + } + + // Update site plan to default. + $this->_sync_plans(); + $this->_site->plan_id = $this->_plans[0]->id; + // Unlink license from site. + $this->_update_site_license( null ); + + $this->_store_account(); + + if ( $show_notice ) { + $this->_admin_notices->add( + sprintf( $this->is_only_premium() ? + $this->get_text_inline( 'Your %s license was successfully deactivated.', 'license-deactivation-message_premium-only' ) : + $this->get_text_inline( 'Your license was successfully deactivated, you are back to the %s plan.', 'license-deactivation-message' ), + $this->get_plan_title() + ), + $this->get_text_inline( 'O.K', 'ok' ) + ); + } + + $this->_admin_notices->remove_sticky( array( + 'plan_upgraded', + 'license_activated', + ) ); + } + + /** + * Site plan downgrade. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @return object + * + * @uses FS_Api + */ + private function _downgrade_site() { + $this->_logger->entrance(); + + $deactivate_license = fs_request_get_bool( 'deactivate_license' ); + + $api = $this->get_api_site_scope(); + $site = $api->call( 'downgrade.json', 'put', array( 'deactivate_license' => $deactivate_license ) ); + + $plan_downgraded = false; + $plan = false; + if ( $this->is_api_result_entity( $site ) ) { + $prev_plan_id = $this->_site->plan_id; + + // Update new site plan id. + $this->_site->plan_id = $site->plan_id; + + $plan = $this->get_plan(); + $subscription = $this->_sync_site_subscription( $this->_license ); + + // Plan downgraded if plan was changed or subscription was cancelled. + $plan_downgraded = ( $plan instanceof FS_Plugin_Plan && $prev_plan_id != $plan->id ) || + ( is_object( $subscription ) && ! isset( $subscription->error ) && ! $subscription->is_active() ); + } else { + // handle different error cases. + $this->handle_license_deactivation_result( + $site, + $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...' + ); + } + + if ( ! $plan_downgraded ) { + return (object) array( + 'error' => (object) array( + 'message' => $this->get_text_inline( 'Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes.', 'subscription-cancellation-failure-message' ) + ) + ); + } + + // Remove previous sticky message about upgrade (if exist). + $this->_admin_notices->remove_sticky( 'plan_upgraded' ); + + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Your subscription was successfully cancelled. Your %s plan license will expire in %s.', 'plan-x-downgraded-message' ), + $plan->title, + human_time_diff( time(), strtotime( $this->_license->expiration ) ) + ) + ); + + // Store site updates. + $this->_store_site(); + + if ( $deactivate_license && + ! FS_Plugin_License::is_valid_id( $site->license_id ) + ) { + if ( $this->_site->is_localhost() ) { + $this->_license->activated_local = max( 0, $this->_license->activated_local - 1 ); + } else { + $this->_license->activated = max( 0, $this->_license->activated - 1 ); + } + + // Handle successful license deactivation result. + $this->handle_license_deactivation_result( $this->_license ); + } + + return $site; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.8.1 + * + * @param bool|string $plan_name + * + * @return bool If trial was successfully started. + */ + function start_trial( $plan_name = false ) { + $this->_logger->entrance(); + + // Alias. + $oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...'; + + if ( $this->is_trial() ) { + // Already in trial mode. + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'You are already running the %s in a trial mode.', 'in-trial-mode' ), $this->_module_type ), + $oops_text, + 'error' + ); + + return false; + } + + if ( $this->_site->is_trial_utilized() ) { + // Trial was already utilized. + $this->_admin_notices->add( + $this->get_text_inline( 'You already utilized a trial before.', 'trial-utilized' ), + $oops_text, + 'error' + ); + + return false; + } + + if ( false !== $plan_name ) { + $plan = $this->get_plan_by_name( $plan_name ); + + if ( false === $plan ) { + // Plan doesn't exist. + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Plan %s do not exist, therefore, can\'t start a trial.', 'trial-plan-x-not-exist' ), $plan_name ), + $oops_text, + 'error' + ); + + return false; + } + + if ( ! $plan->has_trial() ) { + // Plan doesn't exist. + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Plan %s does not support a trial period.', 'plan-x-no-trial' ), $plan_name ), + $oops_text, + 'error' + ); + + return false; + } + } else { + if ( ! $this->has_trial_plan() ) { + // None of the plans have a trial. + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'None of the %s\'s plans supports a trial period.', 'no-trials' ), $this->_module_type ), + $oops_text, + 'error' + ); + + return false; + } + + $plans_with_trial = FS_Plan_Manager::instance()->get_trial_plans( $this->_plans ); + + $plan = $plans_with_trial[0]; + } + + $api = $this->get_api_site_scope(); + $plan = $api->call( "plans/{$plan->id}/trials.json", 'post' ); + + if ( ! $this->is_api_result_entity( $plan ) ) { + // Some API error while trying to start the trial. + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) + . ' ' . var_export( $plan, true ), + $oops_text, + 'error' + ); + + return false; + } + + // Sync license. + $this->_sync_license(); + + return $this->is_trial(); + } + + /** + * Cancel site trial. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return object + * + * @uses FS_Api + */ + private function _cancel_trial() { + $this->_logger->entrance(); + + if ( ! $this->is_trial() ) { + return (object) array( + 'error' => (object) array( + 'message' => $this->get_text_inline( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'trial-cancel-no-trial-message' ) + ) + ); + } + + $trial_plan = $this->get_trial_plan(); + + $api = $this->get_api_site_scope(); + $site = $api->call( 'trials.json', 'delete' ); + + $trial_cancelled = false; + + if ( $this->is_api_result_entity( $site ) ) { + $prev_trial_ends = $this->_site->trial_ends; + + if ( $this->is_paid_trial() ) { + $this->_license->expiration = $site->trial_ends; + $this->_license->is_cancelled = true; + $this->_update_site_license( $this->_license ); + $this->_store_licenses(); + + // Clear subscription reference. + $this->_sync_site_subscription( null ); + } + + // Update site info. + $this->_site = new FS_Site( $site ); + + $trial_cancelled = ( $prev_trial_ends != $site->trial_ends ); + } else { + // @todo handle different error cases. + } + + if ( ! $trial_cancelled ) { + return (object) array( + 'error' => (object) array( + 'message' => $this->get_text_inline( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'trial-cancel-failure-message' ) + ) + ); + } + + // Remove previous sticky messages about upgrade or trial (if exist). + $this->_admin_notices->remove_sticky( array( + 'trial_started', + 'trial_promotion', + 'plan_upgraded', + ) ); + + // Store site updates. + $this->_store_site(); + + if ( ! $this->is_addon() || + ! $this->deactivate_premium_only_addon_without_license( true ) + ) { + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Your %s free trial was successfully cancelled.', 'trial-cancel-message' ), $trial_plan->title ) + ); + } + + return $site; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param bool|number $plugin_id + * + * @return bool + */ + private function _is_addon_id( $plugin_id ) { + return is_numeric( $plugin_id ) && ( $this->get_id() != $plugin_id ); + } + + /** + * Check if user eligible to download premium version updates. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @return bool + */ + private function _can_download_premium() { + return $this->has_any_active_valid_license() || + ( $this->is_trial() && ! $this->get_trial_plan()->is_free() ); + } + + /** + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + * + * @param bool|number $addon_id + * @param string $type "json" or "zip" + * + * @return string + */ + private function _get_latest_version_endpoint( $addon_id = false, $type = 'json' ) { + + $is_addon = $this->_is_addon_id( $addon_id ); + + $is_premium = null; + if ( ! $is_addon ) { + $is_premium = ( $this->is_premium() || $this->_can_download_premium() ); + } else if ( $this->is_addon_activated( $addon_id ) ) { + $fs_addon = self::get_instance_by_id( $addon_id ); + $is_premium = ( $fs_addon->is_premium() || $fs_addon->_can_download_premium() ); + } + + // If add-on, then append add-on ID. + $endpoint = ( $is_addon ? "/addons/$addon_id" : '' ) . + '/updates/latest.' . $type; + + // If add-on and not yet activated, try to fetch based on server licensing. + if ( is_bool( $is_premium ) ) { + $endpoint = add_query_arg( 'is_premium', json_encode( $is_premium ), $endpoint ); + } + + if ( $this->has_secret_key() ) { + $endpoint = add_query_arg( 'type', 'all', $endpoint ); + } else if ( is_object( $this->_site ) && $this->_site->is_beta() ) { + $endpoint = add_query_arg( 'type', 'beta', $endpoint ); + } + + return $endpoint; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param bool|number $addon_id + * @param bool $flush Since 1.1.7.3 + * @param int $expiration Since 1.2.2.7 + * @param bool|string $newer_than Since 2.2.1 + * @param bool|string $fetch_readme Since 2.2.1 + * + * @return object|false Plugin latest tag info. + */ + function _fetch_latest_version( + $addon_id = false, + $flush = true, + $expiration = WP_FS__TIME_24_HOURS_IN_SEC, + $newer_than = false, + $fetch_readme = true + ) { + $this->_logger->entrance(); + + $switch_to_blog_id = null; + + /** + * @since 1.1.7.3 Check for plugin updates from Freemius only if opted-in. + * @since 1.1.7.4 Also check updates for add-ons. + */ + if ( ! $this->is_registered() && + ! $this->_is_addon_id( $addon_id ) + ) { + if ( ! is_multisite() ) { + return false; + } + + $installs_map = $this->get_blog_install_map(); + + foreach ( $installs_map as $blog_id => $install ) { + /** + * @var FS_Site $install + */ + if ( $install->is_trial() ) { + $switch_to_blog_id = $blog_id; + break; + } + + if ( FS_Plugin_License::is_valid_id( $install->license_id ) ) { + $license = $this->get_license_by_id( $install->license_id ); + + if ( is_object( $license ) && $license->is_features_enabled() ) { + $switch_to_blog_id = $blog_id; + break; + } + } + } + + if ( is_null( $switch_to_blog_id ) ) { + return false; + } + } + + $current_blog_id = is_numeric( $switch_to_blog_id ) ? + get_current_blog_id() : + 0; + + if ( is_numeric( $switch_to_blog_id ) ) { + $this->switch_to_blog( $switch_to_blog_id ); + } + + $latest_version_endpoint = $this->_get_latest_version_endpoint( $addon_id, 'json' ); + + if ( ! empty( $newer_than ) ) { + $latest_version_endpoint = add_query_arg( 'newer_than', $newer_than, $latest_version_endpoint ); + } + + if ( true === $fetch_readme ) { + $latest_version_endpoint = add_query_arg( 'readme', 'true', $latest_version_endpoint ); + } + + $tag = $this->get_api_site_or_plugin_scope()->get( + $latest_version_endpoint, + $flush, + $expiration + ); + + if ( is_numeric( $switch_to_blog_id ) ) { + $this->switch_to_blog( $current_blog_id ); + } + + $latest_version = ( is_object( $tag ) && isset( $tag->version ) ) ? $tag->version : 'couldn\'t get'; + + $this->_logger->departure( 'Latest version ' . $latest_version ); + + return ( is_object( $tag ) && isset( $tag->version ) ) ? $tag : false; + } + + #---------------------------------------------------------------------------------- + #region Download Plugin + #---------------------------------------------------------------------------------- + + /** + * Download latest plugin version, based on plan. + * + * Not like _download_latest(), this will redirect the page + * to secure download url to prevent dual download (from FS to WP server, + * and then from WP server to the client / browser). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param bool|number $plugin_id + * + * @uses FS_Api + * @uses wp_redirect() + */ + private function download_latest_directly( $plugin_id = false ) { + $this->_logger->entrance(); + + wp_redirect( $this->get_latest_download_api_url( $plugin_id ) ); + } + + /** + * Get latest plugin FS API download URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param bool|number $plugin_id + * + * @return string + */ + private function get_latest_download_api_url( $plugin_id = false ) { + $this->_logger->entrance(); + + return $this->get_api_site_scope()->get_signed_url( + $this->_get_latest_version_endpoint( $plugin_id, 'zip' ) + ); + } + + /** + * Get payment invoice URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.0 + * + * @param bool|number $payment_id + * + * @return string + */ + function _get_invoice_api_url( $payment_id = false ) { + $this->_logger->entrance(); + + $url = $this->get_api_user_scope()->get_signed_url( + "/payments/{$payment_id}/invoice.pdf" + ); + + if ( ! fs_starts_with( $url, 'https://' ) ) { + // Always use HTTPS for invoices. + $url = 'https' . substr( $url, 4 ); + } + + return $url; + } + + /** + * Get latest plugin download link. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param string $label + * @param bool|number $plugin_id + * + * @return string + */ + private function get_latest_download_link( $label, $plugin_id = false ) { + return sprintf( + '%s', + $this->_get_latest_download_local_url( $plugin_id ), + $label + ); + } + + /** + * Get latest plugin download local URL. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param bool|number $plugin_id + * + * @return string + */ + function _get_latest_download_local_url( $plugin_id = false ) { + // Add timestamp to protect from caching. + $params = array( 'ts' => WP_FS__SCRIPT_START_TIME ); + + if ( ! empty( $plugin_id ) ) { + $params['plugin_id'] = $plugin_id; + } else if ( $this->is_addon() ) { + $params['plugin_id'] = $this->get_id(); + } + + $fs = $this->is_addon() ? + $this->get_parent_instance() : + $this; + + return $this->apply_filters( 'download_latest_url', $fs->get_account_url( 'download_latest', $params ) ); + } + + #endregion Download Plugin ------------------------------------------------------------------ + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @uses FS_Api + * + * @param bool $background Hints the method if it's a background updates check. If false, it means that + * was initiated by the admin. + * @param bool|number $plugin_id + * @param bool $flush Since 1.1.7.3 + * @param int $expiration Since 1.2.2.7 + * @param bool|string $newer_than Since 2.2.1 + */ + private function check_updates( + $background = false, + $plugin_id = false, + $flush = true, + $expiration = WP_FS__TIME_24_HOURS_IN_SEC, + $newer_than = false + ) { + $this->_logger->entrance(); + + // Check if there's a newer version for download. + $new_version = $this->_fetch_newer_version( $plugin_id, $flush, $expiration, $newer_than ); + + $update = null; + if ( is_object( $new_version ) ) { + $update = new FS_Plugin_Tag( $new_version ); + + if ( ! $background ) { + $this->_admin_notices->add( + sprintf( + /* translators: %s: Numeric version number (e.g. '2.1.9' */ + $this->get_text_inline( 'Version %s was released.', 'version-x-released' ) . ' ' . $this->get_text_inline( 'Please download %s.', 'please-download-x' ), + $update->version, + sprintf( + '%s', + $this->get_account_url( 'download_latest' ), + sprintf( + /* translators: %s: plan name (e.g. latest "Professional" version) */ + $this->get_text_inline( 'the latest %s version here', 'latest-x-version' ), + $this->get_plan_title() + ) + ) + ), + $this->get_text_inline( 'New', 'new' ) . '!' + ); + } + } else if ( false === $new_version && ! $background ) { + $this->_admin_notices->add( + $this->get_text_inline( 'Seems like you got the latest release.', 'you-have-latest' ), + $this->get_text_inline( 'You are all good!', 'you-are-good' ) + ); + } + + $this->_store_update( $update, true, $plugin_id ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param bool $flush Since 1.1.7.3 add 24 hour cache by default. + * + * @return FS_Plugin[] + * + * @uses FS_Api + */ + private function sync_addons( $flush = false ) { + $this->_logger->entrance(); + + $api = $this->get_api_site_or_plugin_scope(); + + $path = $this->add_show_pending( '/addons.json?enriched=true&count=50' ); + + /** + * @since 1.2.1 + * + * If there's a cached version of the add-ons and not asking + * for a flush, just use the currently stored add-ons. + */ + if ( ! $flush && $api->is_cached( $path ) ) { + $addons = self::get_all_addons(); + + return isset( $addons[ $this->_plugin->id ] ) ? + $addons[ $this->_plugin->id ] : + array(); + } + + $result = $api->get( $path, $flush ); + + $addons = array(); + if ( $this->is_api_result_object( $result, 'plugins' ) && + is_array( $result->plugins ) + ) { + for ( $i = 0, $len = count( $result->plugins ); $i < $len; $i ++ ) { + $addons[ $i ] = new FS_Plugin( $result->plugins[ $i ] ); + } + + $this->_store_addons( $addons, true ); + } + + return $addons; + } + + /** + * Handle user email update. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * @uses FS_Api + * + * @param string $new_email + * + * @return object + */ + private function update_email( $new_email ) { + $this->_logger->entrance(); + + + $api = $this->get_api_user_scope(); + $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,email,is_verified", 'put', array( + 'email' => $new_email, + 'after_email_confirm_url' => $this->_get_admin_page_url( + 'account', + array( 'fs_action' => 'sync_user' ) + ), + ) ); + + if ( ! isset( $user->error ) ) { + $this->_user->email = $user->email; + $this->_user->is_verified = $user->is_verified; + $this->_store_user(); + } else { + // handle different error cases. + + } + + return $user; + } + + #---------------------------------------------------------------------------------- + #region API Error Handling + #---------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.1 + * + * @param mixed $result + * + * @return bool Is API result contains an error. + */ + private function is_api_error( $result ) { + return FS_Api::is_api_error( $result ); + } + + /** + * Checks if given API result is a non-empty and not an error object. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @param mixed $result + * @param string|null $required_property Optional property we want to verify that is set. + * + * @return bool + */ + function is_api_result_object( $result, $required_property = null ) { + return FS_Api::is_api_result_object( $result, $required_property ); + } + + /** + * Checks if given API result is a non-empty entity object with non-empty ID. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @param mixed $result + * + * @return bool + */ + private function is_api_result_entity( $result ) { + return FS_Api::is_api_result_entity( $result ); + } + + #endregion + + /** + * Make sure a given argument is an array of a specific type. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @param mixed $array + * @param string $class + * + * @return bool + */ + private function is_array_instanceof( $array, $class ) { + return ( is_array( $array ) && ( empty( $array ) || $array[0] instanceof $class ) ); + } + + /** + * Start install ownership change. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.1 + * @uses FS_Api + * + * @param string $candidate_email + * + * @return bool Is ownership change successfully initiated. + */ + private function init_change_owner( $candidate_email ) { + $this->_logger->entrance(); + + $api = $this->get_api_site_scope(); + $result = $api->call( "/users/{$this->_user->id}.json", 'put', array( + 'email' => $candidate_email, + 'after_confirm_url' => $this->_get_admin_page_url( + 'account', + array( 'fs_action' => 'change_owner' ) + ), + ) ); + + return ! $this->is_api_error( $result ); + } + + /** + * Handle install ownership change. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.1 + * @uses FS_Api + * + * @return bool Was ownership change successfully complete. + */ + private function complete_change_owner() { + $this->_logger->entrance(); + + $site_result = $this->get_api_site_scope( true )->get(); + $site = new FS_Site( $site_result ); + $this->_site = $site; + + $user = new FS_User(); + $user->id = fs_request_get( 'user_id' ); + + // Validate install's user and given user. + if ( $user->id != $this->_site->user_id ) { + return false; + } + + $user->public_key = fs_request_get( 'user_public_key' ); + $user->secret_key = fs_request_get( 'user_secret_key' ); + + // Fetch new user information. + $this->_user = $user; + $user_result = $this->get_api_user_scope( true )->get(); + $user = new FS_User( $user_result ); + $this->_user = $user; + + $this->_set_account( $user, $site ); + + return true; + } + + /** + * Completes ownership change by license. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + * + * @param number $user_id + * @param array[string]number $install_ids_by_slug_map + * + */ + private function complete_ownership_change_by_license( $user_id, $install_ids_by_slug_map ) { + $this->_logger->entrance(); + + $this->sync_user_by_current_install( $user_id ); + + $result = $this->get_api_user_scope( true )->get( + "/installs.json?install_ids=" . implode( ',', $install_ids_by_slug_map ) + ); + + if ( $this->is_api_result_object( $result, 'installs' ) ) { + $sites = self::get_all_sites( $this->get_module_type() ); + $install_ids_by_slug_map = array_flip( $install_ids_by_slug_map ); + + foreach ( $result->installs as $install ) { + $site = new FS_Site( $install ); + + $sites[ $install_ids_by_slug_map[ $site->id ] ] = clone $site; + } + + $this->set_account_option( 'sites', $sites, true ); + } + } + + /** + * Handle user name update. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * @uses FS_Api + * + * @return object + */ + private function update_user_name() { + $this->_logger->entrance(); + $name = fs_request_get( 'fs_user_name_' . $this->get_unique_affix(), '' ); + + $api = $this->get_api_user_scope(); + $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,first,last", 'put', array( + 'name' => $name, + ) ); + + if ( ! isset( $user->error ) ) { + $this->_user->first = $user->first; + $this->_user->last = $user->last; + $this->_store_user(); + } else { + // handle different error cases. + + } + + return $user; + } + + /** + * Verify user email. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * @uses FS_Api + */ + private function verify_email() { + $this->_handle_account_user_sync(); + + if ( $this->_user->is_verified() ) { + return; + } + + $api = $this->get_api_site_scope(); + $result = $api->call( "/users/{$this->_user->id}/verify.json", 'put', array( + 'after_email_confirm_url' => $this->_get_admin_page_url( + 'account', + array( 'fs_action' => 'sync_user' ) + ) + ) ); + + if ( ! isset( $result->error ) ) { + $this->_admin_notices->add( sprintf( + $this->get_text_inline( 'Verification mail was just sent to %s. If you can\'t find it after 5 min, please check your spam box.', 'verification-email-sent-message' ), + sprintf( '%2$s', esc_url( $this->_user->email ), $this->_user->email ) + ) ); + } else { + // handle different error cases. + + } + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.1.2 + * + * @param array $params + * @param bool|null $network + * + * @return string + */ + function get_activation_url( $params = array(), $network = null ) { + if ( $this->is_addon() && $this->has_free_plan() ) { + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 Add-on's activation is the parent's module activation. + */ + return $this->get_parent_instance()->get_activation_url( $params ); + } + + return $this->apply_filters( 'connect_url', $this->_get_admin_page_url( '', $params, $network ) ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + * + * @param array $params + * + * @return string + */ + function get_reconnect_url( $params = array() ) { + $params['fs_action'] = 'reset_anonymous_mode'; + $params['fs_unique_affix'] = $this->get_unique_affix(); + + return $this->get_activation_url( $params ); + } + + /** + * Get the URL of the page that should be loaded after the user connect + * or skip in the opt-in screen. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.3 + * + * @param string $filter Filter name. + * @param array $params Since 1.2.2.7 + * @param bool|null $network + * + * @return string + */ + function get_after_activation_url( $filter, $params = array(), $network = null ) { + if ( $this->show_opt_in_on_themes_page() && + ( fs_request_has( 'pending_activation' ) || + // For cases when the first time path is set, even though it's a WP.org theme. + fs_request_get_bool( $this->get_unique_affix() . '_show_optin' ) ) + ) { + $first_time_path = ''; + } else { + $first_time_path = $this->_menu->get_first_time_path( + fs_is_network_admin() && $this->_is_network_active + ); + } + + if ( $this->_is_network_active && + fs_is_network_admin() && + ! $this->_menu->has_network_menu() && + $this->is_network_registered() + ) { + $target_url = $this->get_account_url(); + } else { + // Default plugin's page. + $target_url = $this->_get_admin_page_url( '', array(), $network ); + } + + return add_query_arg( $params, $this->apply_filters( + $filter, + empty( $first_time_path ) ? + $target_url : + $first_time_path + ) ); + } + + /** + * Handle account page updates / edits / actions. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + */ + private function _handle_account_edits() { + if ( ! $this->is_user_admin() ) { + return; + } + + $action = fs_get_action(); + + if ( empty( $action ) ) { + return; + } + + $plugin_id = fs_request_get( 'plugin_id', $this->get_id() ); + $install_id = fs_request_get( 'install_id', '' ); + + // Alias. + $oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...'; + + $is_network_action = $this->is_network_level_action(); + $blog_id = $this->is_network_level_site_specific_action(); + $is_parent_plugin_action = ( $plugin_id == $this->get_id() ); + + if ( is_numeric( $blog_id ) ) { + $this->switch_to_blog( $blog_id ); + } else { + $blog_id = ''; + } + + switch ( $action ) { + case 'opt_in': + check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); + + if ( $is_parent_plugin_action ) { + if ( $is_network_action && ! empty( $blog_id ) ) { + if ( ! $this->is_registered() ) { + $this->install_with_user( + $this->get_network_user(), + false, + false, + false, + false + ); + + $this->_admin_notices->add( + $this->get_text_inline( 'Site successfully opted in.', 'successful-opt-in' ), + $this->get_text_inline( 'Awesome', 'awesome' ) + ); + } + } + } + break; + + case 'toggle_tracking': + check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); + + if ( $is_parent_plugin_action ) { + if ( $is_network_action && ! empty( $blog_id ) ) { + if ( $this->is_registered() ) { + if ( $this->is_tracking_prohibited() ) { + if ( $this->allow_site_tracking() ) { + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'We appreciate your help in making the %s better by letting us track some usage data.', 'opt-out-message-appreciation' ), $this->_module_type ), + $this->get_text_inline( 'Thank you!', 'thank-you' ) + ); + } + } else { + if ( $this->stop_site_tracking() ) { + $this->_admin_notices->add( + sprintf( + $this->get_text_inline( 'We will no longer be sending any usage data of %s on %s to %s.', 'opted-out-successfully' ), + $this->get_plugin_title(), + fs_strip_url_protocol( get_site_url( $blog_id ) ), + sprintf( + '%s', + 'https://freemius.com', + 'freemius.com' + ) + ) + ); + } + } + } + } + } + + break; + + case 'delete_account': + check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); + + $is_network_deletion = $is_network_action && empty( $blog_id ); + + if ( $is_parent_plugin_action ) { + // Delete add-on installs if have any. + $installed_addons = $this->get_installed_addons(); + foreach ( $installed_addons as $fs_addon ) { + if ( $is_network_deletion ) { + $fs_addon->delete_network_account_event(); + } else { + $fs_addon->delete_account_event(); + } + } + + if ( $is_network_deletion ) { + $this->delete_network_account_event(); + } else { + $this->delete_account_event(); + } + + // Clear user and site. + $this->_site = null; + $this->_user = null; + + $this->maybe_set_slug_and_network_menu_exists_flag(); + + fs_redirect( $this->get_activation_url() ); + } else { + if ( $this->is_addon_activated( $plugin_id ) ) { + $fs_addon = self::get_instance_by_id( $plugin_id ); + + if ( $is_network_deletion ) { + $fs_addon->delete_network_account_event(); + } else { + $fs_addon->delete_account_event(); + } + + fs_redirect( $this->_get_admin_page_url( 'account' ) ); + } + } + + return; + + case 'downgrade_account': + if ( is_numeric( $blog_id ) ) { + check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); + } else { + check_admin_referer( $action ); + } + + $switch_to_network_install_blog_after_cancellation = ( + is_numeric( $blog_id ) && + $plugin_id == $this->get_id() && + ! $this->is_trial() + ); + + $result = $this->cancel_subscription_or_trial( $plugin_id ); + if ( $this->is_api_error( $result ) ) { + $this->_admin_notices->add( + $result->error->message, + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error' + ); + } + + if ( $switch_to_network_install_blog_after_cancellation ) { + $this->switch_to_blog( $this->_storage->network_install_blog_id ); + } + + return; + + case 'activate_license': + check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); + + $fs = $this; + if ( $plugin_id != $this->get_id() ) { + $fs = $this->is_addon_activated( $plugin_id ) ? + self::get_instance_by_id( $plugin_id ) : + null; + } + + if ( is_object( $fs ) ) { + $fs->_activate_license(); + + /** + * Remove the product ID from `$_REQUEST` so that the syncing of the license for the other products will work properly. + * + * @author Leo Fajardo (@leorw) + * @since 2.4.0 + */ + unset( $_REQUEST['plugin_id'] ); + + if ( $this->is_bundle_license_auto_activation_enabled() ) { + $fs->maybe_activate_bundle_license( null, array(), is_numeric( $blog_id ) ? $blog_id : 0 ); + } + } + + return; + + case 'deactivate_license': + check_admin_referer( trim( "{$action}:{$blog_id}:{$install_id}", ':' ) ); + + if ( $plugin_id == $this->get_id() ) { + $this->_deactivate_license(); + + if ( $this->is_only_premium() ) { + // Clear user and site. + $this->_site = null; + $this->_user = null; + + if ( ! $is_network_action ) { + fs_redirect( $this->get_activation_url() ); + } else if ( is_numeric( $blog_id ) ) { + $this->switch_to_blog( $this->_storage->network_install_blog_id ); + } + } + } else { + if ( $this->is_addon_activated( $plugin_id ) ) { + $fs_addon = self::get_instance_by_id( $plugin_id ); + $fs_addon->_deactivate_license(); + } + } + + return; + + case 'check_updates': + check_admin_referer( $action ); + $this->check_updates(); + + return; + + case 'change_owner': + $state = fs_request_get( 'state', 'init' ); + switch ( $state ) { + case 'init': + $candidate_email = fs_request_get( 'candidate_email', '' ); + + if ( $this->init_change_owner( $candidate_email ) ) { + $this->_admin_notices->add( sprintf( $this->get_text_inline( 'Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder.', 'change-owner-request-sent-x' ), '' . $this->_user->email . '' ) ); + } + break; + case 'owner_confirmed': + $candidate_email = fs_request_get( 'candidate_email', '' ); + + $this->_admin_notices->add( sprintf( $this->get_text_inline( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.', 'change-owner-request_owner-confirmed' ), '' . $candidate_email . '' ) ); + break; + case 'candidate_confirmed': + if ( $this->complete_change_owner() ) { + $this->_admin_notices->add_sticky( + sprintf( $this->get_text_inline( '%s is the new owner of the account.', 'change-owner-request_candidate-confirmed' ), '' . $this->_user->email . '' ), + 'ownership_changed', + $this->get_text_x_inline( 'Congrats', 'as congratulations', 'congrats' ) . '!' + ); + } else { + // @todo Handle failed ownership change message. + } + break; + } + + return; + + case 'update_email': + check_admin_referer( 'update_email' ); + + $new_email = fs_request_get( 'fs_email_' . $this->get_unique_affix(), '' ); + $result = $this->update_email( $new_email ); + + if ( isset( $result->error ) ) { + switch ( $result->error->code ) { + case 'user_exist': + $this->_admin_notices->add( + $this->get_text_inline( 'Sorry, we could not complete the email update. Another user with the same email is already registered.', 'user-exist-message' ) . ' ' . + sprintf( $this->get_text_inline( 'If you would like to give up the ownership of the %s\'s account to %s click the Change Ownership button.', 'user-exist-message_ownership' ), $this->_module_type, '' . $new_email . '' ) . + sprintf( + '', + $this->get_account_url( 'change_owner', array( + 'state' => 'init', + 'candidate_email' => $new_email + ) ), + $this->get_text_inline( 'Change Ownership', 'change-ownership' ) + ), + $oops_text, + 'error' + ); + break; + } + } else { + $this->_admin_notices->add( $this->get_text_inline( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.', 'email-updated-message' ) ); + } + + return; + + case 'update_user_name': + check_admin_referer( 'update_user_name' ); + + $result = $this->update_user_name(); + + if ( isset( $result->error ) ) { + $this->_admin_notices->add( + $this->get_text_inline( 'Please provide your full name.', 'name-update-failed-message' ), + $oops_text, + 'error' + ); + } else { + $this->_admin_notices->add( $this->get_text_inline( 'Your name was successfully updated.', 'name-updated-message' ) ); + } + + return; + + #region Actions that might be called from external links (e.g. email) + + case 'cancel_trial': + $result = $this->cancel_subscription_or_trial( $plugin_id ); + if ( $this->is_api_error( $result ) ) { + $this->_admin_notices->add( + $result->error->message, + $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...', + 'error' + ); + } + + return; + + case 'verify_email': + $this->verify_email(); + + return; + + case 'sync_user': + $this->_handle_account_user_sync(); + + return; + + case $this->get_unique_affix() . '_sync_license': + $this->_sync_license(); + + return; + + case 'download_latest': + $this->download_latest_directly( $plugin_id ); + + return; + + #endregion + } + + if ( WP_FS__IS_POST_REQUEST ) { + $properties = array( 'site_secret_key', 'site_id', 'site_public_key' ); + foreach ( $properties as $p ) { + if ( 'update_' . $p === $action ) { + check_admin_referer( $action ); + + $this->_logger->log( $action ); + + $site_property = substr( $p, strlen( 'site_' ) ); + $site_property_value = fs_request_get( 'fs_' . $p . '_' . $this->get_unique_affix(), '' ); + $this->get_site()->{$site_property} = $site_property_value; + + // Store account after modification. + $this->_store_site(); + + $this->do_action( 'account_property_edit', 'site', $site_property, $site_property_value ); + + $this->_admin_notices->add( sprintf( + /* translators: %s: User's account property (e.g. email address, name) */ + $this->get_text_inline( 'You have successfully updated your %s.', 'x-updated' ), + '' . str_replace( '_', ' ', $p ) . '' + ) ); + + return; + } + } + } + } + + /** + * Account page resources load. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + */ + function _account_page_load() { + $this->_logger->entrance(); + + $this->_logger->info( var_export( $_REQUEST, true ) ); + + fs_enqueue_local_style( 'fs_account', '/admin/account.css' ); + + if ( $this->has_addons() ) { + wp_enqueue_script( 'plugin-install' ); + add_thickbox(); + + function fs_addons_body_class( $classes ) { + $classes .= ' plugins-php'; + + return $classes; + } + + add_filter( 'admin_body_class', 'fs_addons_body_class' ); + } + + if ( $this->has_paid_plan() && + ! $this->has_any_license() && + ! $this->is_sync_executed() && + $this->is_tracking_allowed() + ) { + /** + * If no licenses found and no sync job was executed during the last 24 hours, + * just execute the sync job right away (blocking execution). + * + * @since 1.1.7.3 + */ + $this->run_manual_sync(); + } + + $this->_handle_account_edits(); + + if ( + is_object( $this->_license ) && + $this->_license->user_id == $this->_user->id && + ! $this->is_whitelabeled( true ) + ) { + $this->_admin_notices->add( + sprintf( + $this->get_text_inline( "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin.", 'license_not_whitelabeled' ), + sprintf( + '%s', + $this->get_text_inline( 'Click here', 'click-here' ) + ) + ), + '', + 'success', + false, + 'license_not_whitelabeled' + ); + } + + $this->do_action( 'account_page_load_before_departure' ); + } + + /** + * Renders the "Affiliation" page. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.3 + */ + function _affiliation_page_render() { + $this->_logger->entrance(); + + $this->fetch_affiliate_and_terms(); + + fs_enqueue_local_style( 'fs_affiliation', '/admin/affiliation.css' ); + + $vars = array( 'id' => $this->_module_id ); + echo $this->apply_filters( "/forms/affiliation.php", fs_get_template( '/forms/affiliation.php', $vars ) ); + } + + + /** + * Render account page. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + */ + function _account_page_render() { + $this->_logger->entrance(); + + $template = 'account.php'; + $vars = array( 'id' => $this->_module_id ); + + /** + * Added filter to the template to allow developers wrapping the template + * in custom HTML (e.g. within a wizard/tabs). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + */ + echo $this->apply_filters( "templates/{$template}", fs_get_template( $template, $vars ) ); + } + + /** + * Render account connect page. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + */ + function _connect_page_render() { + $this->_logger->entrance(); + + $vars = array( 'id' => $this->_module_id ); + + /** + * Added filter to the template to allow developers wrapping the template + * in custom HTML (e.g. within a wizard/tabs). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + */ + echo $this->apply_filters( 'templates/connect.php', fs_get_template( 'connect.php', $vars ) ); + } + + /** + * Load required resources before add-ons page render. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + */ + function _addons_page_load() { + $this->_logger->entrance(); + + fs_enqueue_local_style( 'fs_addons', '/admin/add-ons.css' ); + + wp_enqueue_script( 'plugin-install' ); + add_thickbox(); + + function fs_addons_body_class( $classes ) { + $classes .= ' plugins-php'; + + return $classes; + } + + add_filter( 'admin_body_class', 'fs_addons_body_class' ); + + if ( ! $this->is_registered() && $this->is_org_repo_compliant() ) { + $this->_admin_notices->add( + sprintf( $this->get_text_inline( 'Just letting you know that the add-ons information of %s is being pulled from an external server.', 'addons-info-external-message' ), '' . $this->get_plugin_name() . '' ), + $this->get_text_x_inline( 'Heads up', 'advance notice of something that will need attention.', 'heads-up' ), + 'update-nag' + ); + } + } + + /** + * Render add-ons page. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.6 + */ + function _addons_page_render() { + $this->_logger->entrance(); + + $vars = array( 'id' => $this->_module_id ); + + /** + * Added filter to the template to allow developers wrapping the template + * in custom HTML (e.g. within a wizard/tabs). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.6 + */ + echo $this->apply_filters( 'templates/add-ons.php', fs_get_template( 'add-ons.php', $vars ) ); + } + + /* Pricing & Upgrade + ------------------------------------------------------------------------------------------------------------------*/ + /** + * Render pricing page. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + */ + function _pricing_page_render() { + $this->_logger->entrance(); + + $vars = array( 'id' => $this->_module_id ); + + if ( 'true' === fs_request_get( 'checkout', false ) ) { + echo $this->apply_filters( 'templates/checkout.php', fs_get_template( 'checkout.php', $vars ) ); + } else { + echo $this->apply_filters( 'templates/pricing.php', fs_get_template( 'pricing.php', $vars ) ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + */ + function _maybe_add_pricing_ajax_handler() { + if ( ! $this->should_use_external_pricing() ) { + $this->add_ajax_action( 'pricing_ajax_action', array( &$this, '_fs_pricing_ajax_action_handler' ) ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.1 + */ + function _fs_pricing_ajax_action_handler() { + $this->check_ajax_referer( 'pricing_ajax_action' ); + + $result = null; + $pricing_action = fs_request_get( 'pricing_action' ); + + switch ( $pricing_action ) { + case 'fetch_pricing_data': + $params = array( + 'is_enriched' => true, + 'trial' => fs_request_get_bool( 'trial' ), + 'sandbox' => fs_request_get( 'sandbox' ), + 's_ctx_type' => fs_request_get( 's_ctx_type' ), + 's_ctx_id' => fs_request_get( 's_ctx_id' ), + 's_ctx_ts' => fs_request_get( 's_ctx_ts' ), + 's_ctx_secure' => fs_request_get( 's_ctx_secure' ), + ); + + $bundle_id = $this->get_bundle_id(); + $bundle_public_key = $this->get_bundle_public_key(); + + $has_bundle_context = ( FS_Plugin::is_valid_id( $bundle_id ) && ! empty( $bundle_public_key ) ); + + if ( ! $has_bundle_context ) { + $api = $this->get_api_plugin_scope(); + } else { + $api = FS_Api::instance( + $bundle_id, + 'plugin', + $bundle_id, + $bundle_public_key, + ! $this->is_live(), + false, + $this->get_sdk_version() + ); + + $params['plugin_id'] = $this->get_id(); + $params['plugin_public_key'] = $this->get_public_key(); + } + + $result = $api->get( 'pricing.json?' . http_build_query( $params ) ); + break; + case 'start_trial': + $result = $this->opt_in( + false, + false, + false, + false, + false, + fs_request_get( 'plan_id' ) + ); + } + + if ( is_object( $result ) && $this->is_api_error( $result ) ) { + $this->_logger->api_error( $result ); + + self::shoot_ajax_failure( + isset( $result->error ) ? + ( is_string( $result->error ) ? $result->error : $result->error->message ) : + var_export( $result, true ) + ); + } + + $this->shoot_ajax_success( $result ); + } + + #---------------------------------------------------------------------------------- + #region Contact Us + #---------------------------------------------------------------------------------- + + /** + * Render contact-us page. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + */ + function _contact_page_render() { + $this->_logger->entrance(); + + $vars = array( 'id' => $this->_module_id ); + + /** + * Added filter to the template to allow developers wrapping the template + * in custom HTML (e.g. within a wizard/tabs). + * + * @author Vova Feldman (@svovaf) + * @since 2.1.3 + */ + echo $this->apply_filters( 'templates/contact.php', fs_get_template( 'contact.php', $vars ) ); + } + + #endregion ------------------------------------------------------------------------ + + /** + * Hide all admin notices to prevent distractions. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + * + * @uses remove_all_actions() + */ + private static function _hide_admin_notices() { + remove_all_actions( 'admin_notices' ); + remove_all_actions( 'network_admin_notices' ); + remove_all_actions( 'all_admin_notices' ); + remove_all_actions( 'user_admin_notices' ); + } + + static function _clean_admin_content_section_hook() { + self::_hide_admin_notices(); + + // Hide footer. + echo ''; + } + + /** + * Attach to admin_head hook to hide all admin notices. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + */ + static function _clean_admin_content_section() { + add_action( 'admin_head', 'Freemius::_clean_admin_content_section_hook' ); + } + + /* CSS & JavaScript + ------------------------------------------------------------------------------------------------------------------*/ + /* function _enqueue_script($handle, $src) { + $url = plugins_url( substr( WP_FS__DIR_JS, strlen( $this->_plugin_dir_path ) ) . '/assets/js/' . $src ); + + $this->_logger->entrance( 'script = ' . $url ); + + wp_enqueue_script( $handle, $url ); + }*/ + + /* SDK + ------------------------------------------------------------------------------------------------------------------*/ + private $_user_api; + + /** + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @param bool $flush + * + * @return FS_Api + */ + private function get_api_user_scope( $flush = false ) { + if ( ! isset( $this->_user_api ) || $flush ) { + $this->_user_api = $this->get_api_user_scope_by_user( $this->_user ); + } + + return $this->_user_api; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @param \FS_User $user + * + * @return \FS_Api + */ + private function get_api_user_scope_by_user( FS_User $user ) { + return FS_Api::instance( + $this->_module_id, + 'user', + $user->id, + $user->public_key, + ! $this->is_live(), + $user->secret_key, + $this->get_sdk_version() + ); + } + + /** + * + * @author Leo Fajardo (@leorw) + * @since 2.0.0 + * + * @param bool $flush + * + * @return FS_Api + */ + private function get_current_or_network_user_api_scope( $flush = false ) { + if ( ! $this->_is_network_active || + ( isset( $this->_user ) && $this->_user instanceof FS_User ) + ) { + return $this->get_api_user_scope( $flush ); + } + + $user = $this->get_current_or_network_user(); + + $this->_user_api = FS_Api::instance( + $this->_module_id, + 'user', + $user->id, + $user->public_key, + ! $this->is_live(), + $user->secret_key, + $this->get_sdk_version() + ); + + return $this->_user_api; + } + + private $_site_api; + + /** + * + * @author Vova Feldman (@svovaf) + * @since 1.0.2 + * + * @param bool $flush + * + * @return FS_Api + */ + private function get_api_site_scope( $flush = false ) { + if ( ! isset( $this->_site_api ) || $flush ) { + $this->_site_api = FS_Api::instance( + $this->_module_id, + 'install', + $this->_site->id, + $this->_site->public_key, + ! $this->is_live(), + $this->_site->secret_key, + $this->get_sdk_version() + ); + } + + return $this->_site_api; + } + + private $_plugin_api; + + /** + * Get plugin public API scope. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return FS_Api + */ + function get_api_plugin_scope() { + if ( ! isset( $this->_plugin_api ) ) { + $this->_plugin_api = FS_Api::instance( + $this->_module_id, + 'plugin', + $this->_plugin->id, + $this->_plugin->public_key, + ! $this->is_live(), + false, + $this->get_sdk_version() + ); + } + + return $this->_plugin_api; + } + + /** + * Get bundle public API scope. + * + * @author Vova Feldman (@svovaf) + * @since 2.3.1 + * + * @return FS_Api + */ + function get_api_bundle_scope() { + return FS_Api::instance( + $this->get_bundle_id(), + 'plugin', + $this->get_bundle_id(), + $this->get_bundle_public_key(), + ! $this->is_live(), + false, + $this->get_sdk_version() + ); + } + + /** + * Get site API scope object (fallback to public plugin scope when not registered). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.7 + * + * @return FS_Api + */ + function get_api_site_or_plugin_scope() { + return $this->is_registered() ? + $this->get_api_site_scope() : + $this->get_api_plugin_scope(); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.2.3.1 + * + * @param object $result + */ + private function maybe_modify_api_curl_error_message( $result ) { + if ( + 'cUrlMissing' !== $result->error->type && + ( 'CurlException' !== $result->error->type || CURLE_COULDNT_CONNECT != $result->error->code ) && + ( 'HttpRequestFailed' !== $result->error->type || false === strpos( $result->error->message, 'cURL error ' . CURLE_COULDNT_CONNECT ) ) + ) { + return; + } + + $result->error->message = $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . + ' ' . + $this->esc_html_inline( + sprintf( + 'Please contact your hosting provider and ask them to whitelist %s for external connection.', + implode( + ', ', + $this->apply_filters( 'api_domains', array( + 'api.freemius.com', + 'wp.freemius.com' + ) ) + ) + ), + 'connectivity-whitelist' + ) . + ' ' . + sprintf( + $this->esc_html_inline( 'Once you are done, deactivate the %s and activate it again.', 'connectivity-reactivate-module' ), + $this->get_module_type() + ); + } + + /** + * Show trial promotional notice (if any trial exist). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @param FS_Plugin_Plan[] $plans + */ + function _check_for_trial_plans( $plans ) { + /** + * For some reason core's do_action() flattens arrays when it has a single object item. Therefore, we need to restructure the array as expected. + * + * @author Vova Feldman (@svovaf) + * @since 2.1.2 + */ + if ( ! is_array( $plans ) && is_object( $plans ) ) { + $plans = array( $plans ); + } + + if ( ! $this->is_array_instanceof( $plans, 'FS_Plugin_Plan' ) ) { + $plans = array(); + } + + $this->_storage->has_trial_plan = FS_Plan_Manager::instance()->has_trial_plan( $plans ); + } + + /** + * During trial promotion the "upgrade" submenu item turns to + * "start trial" to encourage the trial. Since we want to keep + * the same menu item handler and there's no robust way to + * add new arguments to the menu item link's querystring, + * use JavaScript to find the menu item and update the href of + * the link. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + */ + function _fix_start_trial_menu_item_url() { + $template_args = array( 'id' => $this->_module_id ); + fs_require_template( 'add-trial-to-pricing.php', $template_args ); + } + + /** + * Check if module is currently in a trial promotion mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + */ + function is_in_trial_promotion() { + return $this->_admin_notices->has_sticky( 'trial_promotion' ); + } + + /** + * Show trial promotional notice (if any trial exist). + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool If trial notice added. + */ + function _add_trial_notice() { + if ( ! $this->is_user_admin() ) { + return false; + } + + if ( ! $this->is_user_in_admin() ) { + return false; + } + + if ( $this->_is_network_active ) { + if ( fs_is_network_admin() ) { + // Network level trial is disabled at the moment. + return false; + } + + if ( ! $this->is_delegated_connection() ) { + // Only delegated sites should support trials. + return false; + } + } + + // Check if trial message is already shown. + if ( $this->is_in_trial_promotion() ) { + add_action( 'admin_footer', array( &$this, '_fix_start_trial_menu_item_url' ) ); + + $this->_menu->add_counter_to_menu_item( 1, 'fs-trial' ); + + return false; + } + + if ( $this->is_premium() && ! WP_FS__DEV_MODE ) { + // Don't show trial if running the premium code, unless running in DEV mode. + return false; + } + + if ( ! $this->has_trial_plan() ) { + // No plans with trial. + return false; + } + + if ( ! $this->apply_filters( 'show_trial', true ) ) { + // Developer explicitly asked not to show the trial promo. + return false; + } + + if ( $this->is_registered() ) { + // Check if trial already utilized. + if ( $this->_site->is_trial_utilized() ) { + return false; + } + + if ( $this->is_paying_or_trial() ) { + // Don't show trial if paying or already in trial. + return false; + } + } + + if ( $this->is_activation_mode() || $this->is_pending_activation() ) { + // If not yet opted-in/skipped, or pending activation, don't show trial. + return false; + } + + $last_time_trial_promotion_shown = $this->_storage->get( 'trial_promotion_shown', false ); + $was_promotion_shown_before = ( false !== $last_time_trial_promotion_shown ); + + // Show promotion if never shown before and 24 hours after initial activation with FS. + if ( ! $was_promotion_shown_before && + $this->_storage->install_timestamp > ( time() - $this->apply_filters( 'show_first_trial_after_n_sec', WP_FS__TIME_24_HOURS_IN_SEC ) ) + ) { + return false; + } + + // OR if promotion was shown before, try showing it every 30 days. + if ( $was_promotion_shown_before && + $this->apply_filters( 'reshow_trial_after_every_n_sec', 30 * WP_FS__TIME_24_HOURS_IN_SEC ) > time() - $last_time_trial_promotion_shown + ) { + return false; + } + + $trial_period = $this->_trial_days; + $require_payment = $this->_is_trial_require_payment; + $trial_url = $this->get_trial_url(); + $plans_string = strtolower( $this->get_text_inline( 'Awesome', 'awesome' ) ); + + if ( $this->is_registered() ) { + // If opted-in, override trial with up to date data from API. + $trial_plans = FS_Plan_Manager::instance()->get_trial_plans( $this->_plans ); + $trial_plans_count = count( $trial_plans ); + + if ( 0 === $trial_plans_count ) { + // If there's no plans with a trial just exit. + return false; + } + + /** + * @var FS_Plugin_Plan $paid_plan + */ + $paid_plan = $trial_plans[0]; + $require_payment = $paid_plan->is_require_subscription; + $trial_period = $paid_plan->trial_period; + + $total_paid_plans = count( $this->_plans ) - ( FS_Plan_Manager::instance()->has_free_plan( $this->_plans ) ? 1 : 0 ); + + if ( $total_paid_plans !== $trial_plans_count ) { + // Not all paid plans have a trial - generate a string of those that have it. + for ( $i = 0; $i < $trial_plans_count; $i ++ ) { + $plans_string .= sprintf( + ' %s', + $trial_url, + $trial_plans[ $i ]->title + ); + + if ( $i < $trial_plans_count - 2 ) { + $plans_string .= ', '; + } else if ( $i == $trial_plans_count - 2 ) { + $plans_string .= ' and '; + } + } + } + } + + $message = sprintf( + $this->get_text_x_inline( 'Hey', 'exclamation', 'hey' ) . '! ' . $this->get_text_inline( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.', 'trial-x-promotion-message' ), + sprintf( '%s', $this->get_plugin_name() ), + $plans_string, + $trial_period + ); + + // "No Credit-Card Required" or "No Commitment for N Days". + $cc_string = $require_payment ? + sprintf( $this->get_text_inline( 'No commitment for %s days - cancel anytime!', 'no-commitment-for-x-days' ), $trial_period ) : + $this->get_text_inline( 'No credit card required', 'no-cc-required' ) . '!'; + + + // Start trial button. + $button = ' ' . sprintf( + '', + $trial_url, + $this->get_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial' ) + ); + + $this->_admin_notices->add_sticky( + $this->apply_filters( 'trial_promotion_message', "{$message} {$cc_string} {$button}" ), + 'trial_promotion', + '', + 'promotion' + ); + + $this->_storage->trial_promotion_shown = WP_FS__SCRIPT_START_TIME; + + return true; + } + + /** + * Lets users/customers know that the product has an affiliate program. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2.11 + * + * @return bool Returns true if the notice has been added. + */ + function _add_affiliate_program_notice() { + if ( ! $this->is_user_admin() ) { + return false; + } + + if ( ! $this->is_user_in_admin() ) { + return false; + } + + // Check if the notice is already shown. + if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) { + return false; + } + + if ( + // Product has no affiliate program. + ! $this->has_affiliate_program() || + // User has applied for an affiliate account. + ! empty( $this->_storage->affiliate_application_data ) + ) { + return false; + } + + if ( ! $this->apply_filters( 'show_affiliate_program_notice', true ) ) { + // Developer explicitly asked not to show the notice about the affiliate program. + return false; + } + + if ( $this->is_activation_mode() || $this->is_pending_activation() ) { + // If not yet opted in/skipped, or pending activation, don't show the notice. + return false; + } + + $last_time_notice_was_shown = $this->_storage->get( 'affiliate_program_notice_shown', false ); + $was_notice_shown_before = ( false !== $last_time_notice_was_shown ); + + /** + * Do not show the notice if it was already shown before or less than 30 days have passed since the initial + * activation with FS. + */ + if ( $was_notice_shown_before || + $this->_storage->install_timestamp > ( time() - ( WP_FS__TIME_24_HOURS_IN_SEC * 30 ) ) + ) { + return false; + } + + if ( ! $this->is_paying() && + FS_Plugin::AFFILIATE_MODERATION_CUSTOMERS == $this->_plugin->affiliate_moderation + ) { + // If the user is not a customer and the affiliate program is only for customers, don't show the notice. + return false; + } + + $message = sprintf( + $this->get_text_inline( 'Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!', 'become-an-ambassador-admin-notice' ), + sprintf( '%s', $this->get_plugin_name() ), + $this->get_module_label( true ) + ); + + // HTML code for the "Learn more..." button. + $button = ' ' . sprintf( + '', + $this->_get_admin_page_url( 'affiliation' ), + $this->get_text_inline( 'Learn more', 'learn-more' ) . '...' + ); + + $this->_admin_notices->add_sticky( + $this->apply_filters( 'affiliate_program_notice', "{$message} {$button}" ), + 'affiliate_program', + '', + 'promotion' + ); + + $this->_storage->affiliate_program_notice_shown = WP_FS__SCRIPT_START_TIME; + + return true; + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.5 + */ + function _enqueue_common_css() { + if ( $this->has_paid_plan() && ! $this->is_paying() ) { + // Add basic CSS for admin-notices and menu-item colors. + fs_enqueue_local_style( 'fs_common', '/admin/common.css' ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + function _show_theme_activation_optin_dialog() { + fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' ); + + add_action( 'admin_footer', array( &$this, '_add_fs_theme_activation_dialog' ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + function _add_fs_theme_activation_dialog() { + global $pagenow; + + if ( 'themes.php' !== $pagenow ) { + return; + } + + $vars = array( 'id' => $this->_module_id ); + fs_require_once_template( 'connect.php', $vars ); + } + + /* Action Links + ------------------------------------------------------------------------------------------------------------------*/ + private $_action_links_hooked = false; + private $_action_links = array(); + + /** + * Hook to plugin action links filter. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + */ + private function hook_plugin_action_links() { + $this->_logger->entrance(); + + $this->_action_links_hooked = true; + + $this->_logger->log( 'Adding action links hooks.' ); + + // Add action link to settings page. + add_filter( 'plugin_action_links_' . $this->_plugin_basename, array( + &$this, + '_modify_plugin_action_links_hook' + ), WP_FS__DEFAULT_PRIORITY, 2 ); + add_filter( 'network_admin_plugin_action_links_' . $this->_plugin_basename, array( + &$this, + '_modify_plugin_action_links_hook' + ), WP_FS__DEFAULT_PRIORITY, 2 ); + } + + /** + * Add plugin action link. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + * + * @param $label + * @param $url + * @param bool $external + * @param int $priority + * @param bool $key + */ + function add_plugin_action_link( $label, $url, $external = false, $priority = WP_FS__DEFAULT_PRIORITY, $key = false ) { + $this->_logger->entrance(); + + if ( ! isset( $this->_action_links[ $priority ] ) ) { + $this->_action_links[ $priority ] = array(); + } + + if ( false === $key ) { + $key = preg_replace( "/[^A-Za-z0-9 ]/", '', strtolower( $label ) ); + } + + $this->_action_links[ $priority ][] = array( + 'label' => $label, + 'href' => $url, + 'key' => $key, + 'external' => $external + ); + } + + /** + * Adds Upgrade and Add-Ons links to the main Plugins page link actions collection. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + */ + function _add_upgrade_action_link() { + $this->_logger->entrance(); + + $is_activation_mode = $this->is_activation_mode(); + + $add_action_links = $this->should_add_submenu_or_action_links( $is_activation_mode ); + + /** + * The following logic is based on the logic in `add_submenu_items()` method that decides when the "Upgrade" + * and "Add-Ons" menus should be added. + * + * @author Leo Fajardo (@leorw) + * @since 2.3.0 + */ + $add_upgrade_link = ( + $add_action_links || + ( $is_activation_mode && $this->is_only_premium() ) + ) && ! WP_FS__DEMO_MODE && ( ! $this->is_whitelabeled() ); + + $add_addons_link = ( $add_action_links && $this->has_addons() ); + + if ( ! $add_upgrade_link && ! $add_addons_link ) { + return; + } + + if ( + $add_upgrade_link && + $this->is_pricing_page_visible() && + $this->is_submenu_item_visible( 'pricing' ) + ) { + $this->add_plugin_action_link( + $this->get_text_inline( 'Upgrade', 'upgrade' ), + $this->get_upgrade_url(), + false, + 7, + 'upgrade' + ); + } + + if ( + $add_addons_link && + $this->has_addons() && + $this->is_submenu_item_visible( 'addons' ) + ) { + $this->add_plugin_action_link( + $this->get_text_inline( 'Add-Ons', 'add-ons' ), + $this->_get_admin_page_url( 'addons' ), + false, + 9, + 'addons' + ); + } + } + + /** + * Adds "Activate License" or "Change License" link to the main Plugins page link actions collection. + * + * @author Leo Fajardo (@leorw) + * @since 1.1.9 + */ + function _add_license_action_link() { + $this->_logger->entrance(); + + if ( ! self::is_ajax() ) { + // Inject license activation dialog UI and client side code. + add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) ); + } + + $link_text = $this->is_free_plan() ? + $this->get_text_inline( 'Activate License', 'activate-license' ) : + $this->get_text_inline( 'Change License', 'change-license' ); + + $this->add_plugin_action_link( + $link_text, + '#', + false, + 11, + ( 'activate-license ' . $this->get_unique_affix() ) + ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.0.2 + */ + function _add_premium_version_upgrade_selection_action() { + $this->_logger->entrance(); + + if ( ! self::is_ajax() ) { + add_action( 'admin_footer', array( &$this, '_add_premium_version_upgrade_selection_dialog_box' ) ); + } + } + + /** + * Adds "Opt In" or "Opt Out" link to the main "Plugins" page link actions collection. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.1.5 + */ + function _add_tracking_links() { + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $this->_logger->entrance(); + + /** + * @author Vova Feldman (@svovaf) + * @since 2.3.2 Allow opting out from usage-tracking for paid products too by giving the appropriate warning letting the user know the automatic updates mechanism cannot function without an ongoing connection to the licensing and updates engine. + */ + /*if ( $this->is_premium() ) { + // Don't add opt-in/out for premium code base. + return; + }*/ + + if ( $this->is_only_premium() && $this->is_free_plan() ) { + // Don't add tracking links for premium-only products that were opted-in by relation (add-on or a parent product) before activating any license. + return; + } + + if ( + $this->is_addon() && + ! $this->is_only_premium() && + $this->_parent->is_anonymous() + ) { + return; + } + + if ( fs_is_network_admin() ) { + if ( ! $this->_is_network_active ) { + // Don't add tracking links when browsing the network WP Admin and the plugin is not network active. + return; + } else if ( $this->is_network_delegated_connection() ) { + // Don't add tracking links when browsing the network WP Admin and the activation has been delegated to site admins. + return; + } + } else { + if ( $this->_is_network_active && ! $this->is_delegated_connection() ) { + // Don't add tracking links when browsing the sub-site WP Admin, the plugin is network active, and the connection was not delegated. + return; + } + } + + if ( fs_request_is_action_secure( $this->get_unique_affix() . '_reconnect' ) ) { + if ( ! $this->is_registered() && $this->is_anonymous() ) { + $this->connect_again(); + + return; + } + } + + if ( ( $this->is_plugin() && ! self::is_plugins_page() ) || + ( $this->is_theme() && ! self::is_themes_page() ) + ) { + // Only show tracking links on the plugins and themes pages. + return; + } + + if ( + $this->is_activation_mode() && + $this->is_premium() && + ! $this->is_registered() + ) { + // If not yet registered and running the premium code base, a license activation link will already be shown. + return; + } + + if ( $this->is_registered() && $this->is_tracking_allowed() ) { + if ( ! $this->is_premium() && ! $this->is_enable_anonymous() ) { + // If opted in and tracking is allowed, don't allow to opt out if not premium and anonymous mode is disabled. + return; + } + } + + if ( $this->add_ajax_action( 'stop_tracking', array( &$this, '_stop_tracking_callback' ) ) ) { + return; + } + + if ( $this->add_ajax_action( 'allow_tracking', array( &$this, '_allow_tracking_callback' ) ) ) { + return; + } + + if ( $this->add_ajax_action( 'update_tracking_permission', array( &$this, '_update_tracking_permission_callback' ) ) ) { + return; + } + + $link_text_id = ''; + $url = '#'; + + if ( $this->is_registered() ) { + if ( $this->is_tracking_allowed() ) { + $link_text_id = $this->get_text_inline( 'Opt Out', 'opt-out' ); + } else { + $link_text_id = $this->get_text_inline( 'Opt In', 'opt-in' ); + } + } else if ( $this->is_anonymous() || $this->is_activation_mode() ) { + /** + * Show opt-in link only if skipped or in activation mode. + */ + $link_text_id = $this->get_text_inline( 'Opt In', 'opt-in' ); + + $params = ! $this->is_anonymous() ? + array() : + array( + 'nonce' => wp_create_nonce( $this->get_unique_affix() . '_reconnect' ), + 'fs_action' => ( $this->get_unique_affix() . '_reconnect' ), + ); + + $url = $this->get_activation_url( $params ); + } + + add_action( 'admin_footer', array( &$this, '_add_optout_dialog' ) ); + + if ( ! empty( $link_text_id ) && $this->is_plugin() && self::is_plugins_page() ) { + $this->add_plugin_action_link( + $link_text_id, + $url, + false, + 13, + "opt-in-or-opt-out {$this->_slug}" + ); + } + } + + /** + * Get the URL of the page that should be loaded right after the plugin activation. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.7.4 + * + * @return string + */ + function get_after_plugin_activation_redirect_url() { + $url = false; + + if ( ! $this->is_addon() || ! $this->has_free_plan() ) { + $first_time_path = $this->_menu->get_first_time_path( + fs_is_network_admin() && $this->_is_network_active + ); + + if ( $this->is_activation_mode() ) { + $url = $this->get_activation_url(); + } else if ( ! empty( $first_time_path ) ) { + $url = $first_time_path; + } else { + $page = ''; + if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) { + if ( $this->is_network_registered() ) { + $page = 'account'; + } else if ( $this->is_pending_activation() || $this->is_network_anonymous() ) { + $this->maybe_set_slug_and_network_menu_exists_flag(); + } + } + + $url = $this->_get_admin_page_url( $page ); + } + } else { + $plugin_fs = false; + + if ( $this->is_parent_plugin_installed() ) { + $plugin_fs = self::get_parent_instance(); + } + + if ( is_object( $plugin_fs ) ) { + if ( ! $plugin_fs->is_registered() ) { + // Forward to parent plugin connect when parent not registered. + $url = $plugin_fs->get_activation_url(); + } else { + // Forward to account page. + $url = $plugin_fs->_get_admin_page_url( 'account' ); + } + } + } + + return $url; + } + + /** + * Forward page to activation page. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.3 + */ + function _redirect_on_activation_hook() { + if ( $this->apply_filters( 'redirect_on_activation', true ) ) { + $url = $this->get_after_plugin_activation_redirect_url(); + + if ( is_string( $url ) ) { + fs_redirect( $url ); + } + } + } + + /** + * Modify plugin's page action links collection. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.0 + * + * @param array $links + * @param $file + * + * @return array + */ + function _modify_plugin_action_links_hook( $links, $file ) { + $this->_logger->entrance(); + + $passed_deactivate = false; + $deactivate_link = ''; + $before_deactivate = array(); + $after_deactivate = array(); + foreach ( $links as $key => $link ) { + if ( 'deactivate' === $key ) { + $deactivate_link = $link; + $passed_deactivate = true; + continue; + } + + if ( ! $passed_deactivate ) { + $before_deactivate[ $key ] = $link; + } else { + $after_deactivate[ $key ] = $link; + } + } + + ksort( $this->_action_links ); + + foreach ( $this->_action_links as $new_links ) { + foreach ( $new_links as $link ) { + $before_deactivate[ $link['key'] ] = '' . $link['label'] . ''; + } + } + + if ( ! empty( $deactivate_link ) ) { + /** + * This HTML element is used to identify the correct plugin when attaching an event to its Deactivate link. + * + * @since 1.2.1.6 Always show the deactivation feedback form since we added automatic free version deactivation upon premium code activation. + */ + $deactivate_link .= ''; + + // Append deactivation link. + $before_deactivate['deactivate'] = $deactivate_link; + } + + return array_merge( $before_deactivate, $after_deactivate ); + } + + /** + * Adds admin message. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.4 + * + * @param string $message + * @param string $title + * @param string $type + */ + function add_admin_message( $message, $title = '', $type = 'success' ) { + $this->_admin_notices->add( $message, $title, $type ); + } + + /** + * Adds sticky admin message. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.0 + * + * @param string $message + * @param string $id + * @param string $title + * @param string $type + */ + function add_sticky_admin_message( $message, $id, $title = '', $type = 'success' ) { + $this->_admin_notices->add_sticky( $message, $id, $title, $type ); + } + + /** + * Check if the paid version of the module is installed. + * + * @author Vova Feldman (@svovaf) + * @since 2.2.0 + * + * @return bool + */ + private function is_premium_version_installed() { + $premium_plugin_basename = $this->premium_plugin_basename(); + $premium_plugin = get_plugins( '/' . dirname( $premium_plugin_basename ) ); + + return ! empty( $premium_plugin ); + } + + /** + * Helper function that returns the final steps for the upgrade completion. + * + * If the module is already running the premium code, returns an empty string. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1 + * + * @param string $plan_title + * + * @return string + */ + private function get_complete_upgrade_instructions( $plan_title = '' ) { + $this->_logger->entrance(); + + $activate_license_string = $this->get_license_network_activation_notice(); + + if ( ! $this->has_premium_version() || $this->is_premium() ) { + return '' . $activate_license_string; + } + + if ( empty( $plan_title ) ) { + $plan_title = $this->get_plan_title(); + } + + if ( $this->is_premium_version_installed() ) { + /** + * If the premium version is already installed, instead of showing the installation instructions, + * tell the current user to activate it. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + */ + $premium_plugin_basename = $this->premium_plugin_basename(); + + return sprintf( + /* translators: %1$s: Product title; %2$s: Plan title */ + $this->get_text_inline( ' The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s', 'activate-premium-version' ), + sprintf( '%s', esc_html( $this->get_plugin_title() ) ), + $plan_title, + sprintf( + '', + wp_nonce_url( 'plugins.php?action=activate&plugin=' . $premium_plugin_basename, 'activate-plugin_' . $premium_plugin_basename ), + esc_html( sprintf( + /* translators: %s: Plan title */ + $this->get_text_inline( 'Activate %s features', 'activate-x-features' ), + $plan_title + ) ) + ) + ); + } else { + // @since 1.2.1.5 The free version is auto deactivated. + $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ? + ( '
  • ' . $this->esc_html_inline( 'Deactivate the free version', 'deactivate-free-version' ) . '.
  • ' ) : + ''; + + return sprintf( + ' %s:
    1. %s.
    2. %s
    3. %s (%s).
    ', + $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ), + ( empty( $activate_license_string ) ? '' : $activate_license_string . '
  • ' ) . + $this->get_latest_download_link( sprintf( + /* translators: %s: Plan title */ + $this->get_text_inline( 'Download the latest %s version', 'download-latest-x-version' ), + $plan_title + ) ), + $deactivation_step, + $this->get_text_inline( 'Upload and activate the downloaded version', 'upload-and-activate' ), + $this->apply_filters( 'upload_and_install_video_url', '//bit.ly/upload-wp-' . $this->_module_type . 's' ), + $this->get_text_inline( 'How to upload and activate?', 'howto-upload-activate' ) + ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + * + * @param string $url + * @param array $request + */ + private static function enrich_request_for_debug( &$url, &$request ) { + if ( WP_FS__DEBUG_SDK || isset( $_COOKIE['XDEBUG_SESSION'] ) ) { + $url = add_query_arg( 'XDEBUG_SESSION_START', rand( 0, 9999999 ), $url ); + $url = add_query_arg( 'XDEBUG_SESSION', 'PHPSTORM', $url ); + + $request['cookies'] = array( + new WP_Http_Cookie( array( + 'name' => 'XDEBUG_SESSION', + 'value' => 'PHPSTORM', + ) ) + ); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + * + * @param string $url + * @param array $request + * @param int $success_cache_expiration + * @param int $failure_cache_expiration + * @param bool $maybe_enrich_request_for_debug + * + * @return WP_Error|array + */ + static function safe_remote_post( + &$url, + $request, + $success_cache_expiration = 0, + $failure_cache_expiration = 0, + $maybe_enrich_request_for_debug = true + ) { + $should_cache = ($success_cache_expiration + $failure_cache_expiration > 0); + + $cache_key = $should_cache ? md5( fs_strip_url_protocol($url) . json_encode( $request ) ) : false; + + $response = (!WP_FS__DEBUG_SDK && ( false !== $cache_key )) ? + get_transient( $cache_key ) : + false; + + if ( false === $response ) { + if ( $maybe_enrich_request_for_debug ) { + self::enrich_request_for_debug( $url, $request ); + } + + $response = wp_remote_post( $url, $request ); + + if ( $response instanceof WP_Error ) { + if ( 'https://' === substr( $url, 0, 8 ) && + isset( $response->errors ) && + isset( $response->errors['http_request_failed'] ) + ) { + $http_error = strtolower( $response->errors['http_request_failed'][0] ); + + if ( false !== strpos( $http_error, 'ssl' ) || + false !== strpos( $http_error, 'curl error 35' ) + ) { + // Failed due to old version of cURL or Open SSL (SSLv3 is not supported by CloudFlare). + $url = 'http://' . substr( $url, 8 ); + + $request['timeout'] = 15; + $response = wp_remote_post( $url, $request ); + } + } + } + + if ( false !== $cache_key ) { + set_transient( + $cache_key, + $response, + ( ( $response instanceof WP_Error ) ? + $failure_cache_expiration : + $success_cache_expiration ) + ); + } + } + + return $response; + } + + /** + * This method is used to enrich the after upgrade notice instructions when the upgraded + * license cannot be activated network wide (license quota isn't large enough). + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return string + */ + private function get_license_network_activation_notice() { + if ( ! $this->_is_network_active ) { + // Module isn't network level activated. + return ''; + } + + if ( ! fs_is_network_admin() ) { + // Not network level admin. + return ''; + } + + if ( get_blog_count() == 1 ) { + // There's only a single site in the network so if there's a context license it was already activated. + return ''; + } + + if ( ! is_object( $this->_license ) ) { + // No context license. + return ''; + } + + if ( $this->_license->is_single_site() && 0 < $this->_license->activated ) { + // License was already utilized (this is not 100% the case if all the network is localhost sites and the license can be utilized on unlimited localhost sites). + return ''; + } + + if ( $this->can_activate_license_on_network( $this->_license ) ) { + // License can be activated on all the network, so probably, the license is already activate on all the network (that's how the after upgrade sync works). + return ''; + } + + return sprintf( + $this->get_text_inline( '%sClick here%s to choose the sites where you\'d like to activate the license on.', 'network-choose-sites-for-license' ), + '', + '' + ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + * + * @param string $key + * + * @return string + */ + function get_text( $key ) { + return fs_text( $key, $this->_slug ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.3 + * + * @param string $text Translatable string. + * @param string $key String key for overrides. + * + * @return string + */ + function get_text_inline( $text, $key = '' ) { + return _fs_text_inline( $text, $key, $this->_slug ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.3 + * + * @param string $text Translatable string. + * @param string $context Context information for the translators. + * @param string $key String key for overrides. + * + * @return string + */ + function get_text_x_inline( $text, $context, $key ) { + return _fs_text_x_inline( $text, $context, $key, $this->_slug ); + } + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.3 + * + * @param string $text Translatable string. + * @param string $key String key for overrides. + * + * @return string + */ + function esc_html_inline( $text, $key ) { + return esc_html( _fs_text_inline( $text, $key, $this->_slug ) ); + } + + #---------------------------------------------------------------------------------- + #region Versioning + #---------------------------------------------------------------------------------- + + /** + * Check if Freemius in SDK upgrade mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function is_sdk_upgrade_mode() { + return isset( $this->_storage->sdk_upgrade_mode ) ? + $this->_storage->sdk_upgrade_mode : + false; + } + + /** + * Turn SDK upgrade mode off. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + function set_sdk_upgrade_complete() { + $this->_storage->sdk_upgrade_mode = false; + } + + /** + * Check if plugin upgrade mode. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function is_plugin_upgrade_mode() { + return isset( $this->_storage->plugin_upgrade_mode ) ? + $this->_storage->plugin_upgrade_mode : + false; + } + + /** + * Turn plugin upgrade mode off. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + */ + function set_plugin_upgrade_complete() { + $this->_storage->plugin_upgrade_mode = false; + + $license_migration = ! empty( $this->_storage->license_migration ) ? + $this->_storage->license_migration : + array(); + + $license_migration['is_migrating'] = false; + + $this->_storage->license_migration = $license_migration; + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Permissions + #---------------------------------------------------------------------------------- + + /** + * Check if specific permission requested. + * + * @author Vova Feldman (@svovaf) + * @since 1.1.6 + * + * @param string $permission + * + * @return bool + */ + function is_permission_requested( $permission ) { + return isset( $this->_permissions[ $permission ] ) && ( true === $this->_permissions[ $permission ] ); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Auto Activation + #---------------------------------------------------------------------------------- + + /** + * Hints the SDK if running an auto-installation. + * + * @var bool + */ + private $_isAutoInstall = false; + + /** + * After upgrade callback to install and auto activate a plugin. + * This code will only be executed on explicit request from the user, + * following the practice Jetpack are using with their theme installations. + * + * @link https://make.wordpress.org/plugins/2017/03/16/clarification-of-guideline-8-executable-code-and-installs/ + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + */ + function _install_premium_version_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'install_premium_version' ); + + if ( ! $this->is_registered() ) { + // Not registered. + self::shoot_ajax_failure( array( + 'message' => $this->get_text_inline( 'Auto installation only works for opted-in users.', 'auto-install-error-not-opted-in' ), + 'code' => 'premium_installed', + ) ); + } + + $plugin_id = fs_request_get( 'target_module_id', $this->get_id() ); + + if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) { + // Invalid ID. + self::shoot_ajax_failure( array( + 'message' => $this->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ), + 'code' => 'invalid_module_id', + ) ); + } + + if ( $plugin_id == $this->get_id() ) { + if ( $this->is_premium() ) { + // Already using the premium code version. + self::shoot_ajax_failure( array( + 'message' => $this->get_text_inline( 'Premium version already active.', 'auto-install-error-premium-activated' ), + 'code' => 'premium_installed', + ) ); + } + if ( ! $this->can_use_premium_code() ) { + // Don't have access to the premium code. + self::shoot_ajax_failure( array( + 'message' => $this->get_text_inline( 'You do not have a valid license to access the premium version.', 'auto-install-error-invalid-license' ), + 'code' => 'invalid_license', + ) ); + } + if ( ! $this->has_release_on_freemius() ) { + // Plugin is a serviceware, no premium code version. + self::shoot_ajax_failure( array( + 'message' => $this->get_text_inline( 'Plugin is a "Serviceware" which means it does not have a premium code version.', 'auto-install-error-serviceware' ), + 'code' => 'premium_version_missing', + ) ); + } + } else { + $addon = $this->get_addon( $plugin_id ); + + if ( ! is_object( $addon ) ) { + // Invalid add-on ID. + self::shoot_ajax_failure( array( + 'message' => $this->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ), + 'code' => 'invalid_module_id', + ) ); + } + + if ( $this->is_addon_activated( $plugin_id, true ) ) { + // Premium add-on version is already activated. + self::shoot_ajax_failure( array( + 'message' => $this->get_text_inline( 'Premium add-on version already installed.', 'auto-install-error-premium-addon-activated' ), + 'code' => 'premium_installed', + ) ); + } + } + + $this->_isAutoInstall = true; + + // Try to install and activate. + $updater = FS_Plugin_Updater::instance( $this ); + $result = $updater->install_and_activate_plugin( $plugin_id ); + + if ( is_array( $result ) && ! empty( $result['message'] ) ) { + self::shoot_ajax_failure( array( + 'message' => $result['message'], + 'code' => $result['code'], + ) ); + } + + self::shoot_ajax_success( $result ); + } + + /** + * Displays module activation dialog box after a successful upgrade + * where the user explicitly requested to auto download and install + * the premium version. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.1.7 + */ + function _add_auto_installation_dialog_box() { + $this->_logger->entrance(); + + if ( ! $this->is_registered() ) { + // Not registered. + return; + } + + $plugin_id = fs_request_get( 'plugin_id', $this->get_id() ); + + if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) { + // Invalid module ID. + return; + } + + if ( $plugin_id == $this->get_id() ) { + if ( $this->is_premium() ) { + // Already using the premium code version. + return; + } + if ( ! $this->can_use_premium_code() ) { + // Don't have access to the premium code. + return; + } + if ( ! $this->has_release_on_freemius() ) { + // Plugin is a serviceware, no premium code version. + return; + } + } else { + $addon = $this->get_addon( $plugin_id ); + + if ( ! is_object( $addon ) ) { + // Invalid add-on ID. + return; + } + + if ( $this->is_addon_activated( $plugin_id, true ) ) { + // Premium add-on version is already activated. + return; + } + } + + $vars = array( + 'id' => $this->_module_id, + 'target_module_id' => $plugin_id, + 'slug' => $this->_slug, + ); + + fs_require_template( 'auto-installation.php', $vars ); + } + + #endregion + + #-------------------------------------------------------------------------------- + #region Tabs Integration + #-------------------------------------------------------------------------------- + + #region Module's Original Tabs + + /** + * Inject a JavaScript logic to capture the theme tabs HTML. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + */ + function _tabs_capture() { + $this->_logger->entrance(); + + if ( ! $this->is_product_settings_page() || + ! $this->is_matching_url( $this->main_menu_url() ) + ) { + return; + } + + $params = array( + 'id' => $this->_module_id, + ); + + fs_require_once_template( 'tabs-capture-js.php', $params ); + } + + /** + * Cache theme's tabs HTML for a week. The cache will also be set as expired + * after version and type (free/premium) changes, in addition to the week period. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + */ + function _store_tabs_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'store_tabs' ); + + // Init filesystem if not yet initiated. + WP_Filesystem(); + + // Get POST body HTML data. + global $wp_filesystem; + $tabs_html = $wp_filesystem->get_contents( "php://input" ); + + if ( is_string( $tabs_html ) ) { + $tabs_html = trim( $tabs_html ); + } + + if ( ! is_string( $tabs_html ) || empty( $tabs_html ) ) { + self::shoot_ajax_failure(); + } + + $this->_cache->set( 'tabs', $tabs_html, 7 * WP_FS__TIME_24_HOURS_IN_SEC ); + + self::shoot_ajax_success(); + } + + /** + * Cache theme's settings page custom styles. The cache will also be set as expired + * after version and type (free/premium) changes, in addition to the week period. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + */ + function _store_tabs_styles() { + $this->_logger->entrance(); + + if ( ! $this->is_product_settings_page() || + ! $this->is_matching_url( $this->main_menu_url() ) + ) { + return; + } + + $wp_styles = wp_styles(); + + $theme_styles_url = get_template_directory_uri(); + + $stylesheets = array(); + foreach ( $wp_styles->queue as $handler ) { + if ( fs_starts_with( $handler, 'fs_' ) ) { + // Assume that stylesheets that their handler starts with "fs_" belong to the SDK. + continue; + } + + /** + * @var _WP_Dependency $stylesheet + */ + $stylesheet = $wp_styles->registered[ $handler ]; + + if ( fs_starts_with( $stylesheet->src, $theme_styles_url ) ) { + $stylesheets[] = $stylesheet->src; + } + } + + if ( ! empty( $stylesheets ) ) { + $this->_cache->set( 'tabs_stylesheets', $stylesheets, 7 * WP_FS__TIME_24_HOURS_IN_SEC ); + } + } + + /** + * Check if module's original settings page has any tabs. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + */ + private function has_tabs() { + return $this->_cache->has( 'tabs' ); + } + + /** + * Get module's settings page HTML content, starting + * from the beginning of the
    element, + * until the tabs HTML (including). + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return string + */ + private function get_tabs_html() { + $this->_logger->entrance(); + + return $this->_cache->get( 'tabs' ); + } + + /** + * Check if page should include tabs. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool + */ + private function should_page_include_tabs() { + if ( ! $this->has_settings_menu() ) { + // Don't add tabs if no settings at all. + return false; + } + + if ( self::NAVIGATION_TABS !== $this->_navigation ) { + // Only add tabs to themes for now. + return false; + } + + if ( $this->is_theme() && ! $this->has_paid_plan() && ! $this->has_addons() ) { + // Only add tabs to monetizing themes. + return false; + } + + if ( ! $this->is_product_settings_page() ) { + // Only add tabs if browsing one of the product's setting pages. + return false; + } + + if ( $this->is_activation_mode() && $this->is_activation_page() ) { + // Don't include tabs in the activation page. + return false; + } + + if ( $this->is_admin_page( 'pricing' ) && fs_request_get_bool( 'checkout' ) ) { + // Don't add tabs on checkout page, we want to reduce distractions + // as much as possible. + return false; + } + + return true; + } + + /** + * Add the tabs HTML before the setting's page content and + * enqueue any required stylesheets. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool If tabs were included. + */ + function _add_tabs_before_content() { + $this->_logger->entrance(); + + if ( ! $this->should_page_include_tabs() ) { + return false; + } + + /** + * Enqueue the original stylesheets that are included in the + * theme settings page. That way, if the theme settings has + * some custom _styled_ content above the tabs UI, this + * will make sure that the styling is preserved. + */ + $stylesheets = $this->_cache->get( 'tabs_stylesheets', array() ); + if ( is_array( $stylesheets ) ) { + for ( $i = 0, $len = count( $stylesheets ); $i < $len; $i ++ ) { + wp_enqueue_style( "fs_{$this->_module_id}_tabs_{$i}", $stylesheets[ $i ] ); + } + } + + // Cut closing
    tag. + echo substr( trim( $this->get_tabs_html() ), 0, - 6 ); + + return true; + } + + /** + * Add the tabs closing HTML after the setting's page content. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @return bool If tabs closing HTML was included. + */ + function _add_tabs_after_content() { + $this->_logger->entrance(); + + if ( ! $this->should_page_include_tabs() ) { + return false; + } + + echo ''; + + return true; + } + + #endregion + + /** + * Add in-page JavaScript to inject the Freemius tabs into + * the module's setting tabs section. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + */ + function _add_freemius_tabs() { + $this->_logger->entrance(); + + if ( ! $this->should_page_include_tabs() ) { + return; + } + + $params = array( 'id' => $this->_module_id ); + fs_require_once_template( 'tabs.php', $params ); + } + + #endregion + + #-------------------------------------------------------------------------------- + #region Customizer Integration for Themes + #-------------------------------------------------------------------------------- + + /** + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + * + * @param WP_Customize_Manager $customizer + */ + function _customizer_register( $customizer ) { + $this->_logger->entrance(); + + if ( $this->is_pricing_page_visible() ) { + require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-upsell-control.php'; + + $customizer->add_section( 'freemius_upsell', array( + 'title' => '★ ' . $this->get_text_inline( 'View paid features', 'view-paid-features' ), + 'priority' => 1, + ) ); + $customizer->add_setting( 'freemius_upsell', array( + 'sanitize_callback' => 'esc_html', + ) ); + + $customizer->add_control( new FS_Customizer_Upsell_Control( $customizer, 'freemius_upsell', array( + 'fs' => $this, + 'section' => 'freemius_upsell', + 'priority' => 100, + ) ) ); + } + + if ( $this->is_page_visible( 'contact' ) || $this->is_page_visible( 'support' ) ) { + require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-support-section.php'; + + // Main Documentation Link In Customizer Root. + $customizer->add_section( new FS_Customizer_Support_Section( $customizer, 'freemius_support', array( + 'fs' => $this, + 'priority' => 1000, + ) ) ); + } + } + + #endregion + + /** + * If the theme has a paid version, add some custom + * styling to the theme's premium version (if exists) + * to highlight that it's the premium version of the + * same theme, making it easier for identification + * after the user upgrades and upload it to the site. + * + * @author Vova Feldman (@svovaf) + * @since 1.2.2.7 + */ + function _style_premium_theme() { + $this->_logger->entrance(); + + if ( ! self::is_themes_page() ) { + // Only include in the themes page. + return; + } + + if ( ! $this->has_paid_plan() ) { + // Only include if has any paid plans. + return; + } + + $params = null; + fs_require_once_template( '/js/jquery.content-change.php', $params ); + + $params = array( + 'slug' => $this->_slug, + 'id' => $this->_module_id, + ); + + fs_require_template( '/js/style-premium-theme.php', $params ); + } + + /** + * This method will return the absolute URL of the module's local icon. + * + * When you are running your plugin or theme on a **localhost** environment, if the icon + * is not found in the local assets folder, try to fetch the icon URL from Freemius. If not set and + * it's a plugin hosted on WordPress.org, try fetching the icon URL from wordpress.org. + * If an icon is found, this method will automatically attempt to download the icon and store it + * in /freemius/assets/img/{slug}.{png|jpg|gif|svg}. + * + * It's important to mention that this method is NOT phoning home since the developer will deploy + * the product with the local icon in the assets folder. The download process just simplifies + * the process for the developer. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return string + */ + function get_local_icon_url() { + global $fs_active_plugins; + + /** + * @since 1.1.7.5 + */ + $local_path = $this->apply_filters( 'plugin_icon', false ); + + if ( is_string( $local_path ) ) { + $icons = array( $local_path ); + } else { + $img_dir = WP_FS__DIR_IMG; + + // Locate the main assets folder. + if ( 1 < count( $fs_active_plugins->plugins ) ) { + $plugin_or_theme_img_dir = ( $this->is_plugin() ? WP_PLUGIN_DIR : get_theme_root( get_stylesheet() ) ); + + foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) { + if ( $data->plugin_path == $this->get_plugin_basename() ) { + $img_dir = $plugin_or_theme_img_dir + . '/' + /** + * The basename will be `themes` or the basename of a custom themes directory. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.3 + */ + . str_replace( '../' . basename( $plugin_or_theme_img_dir ) . '/', '', $sdk_path ) + . '/assets/img'; + + break; + } + } + } + + // Try to locate the icon in the assets folder. + $icons = glob( fs_normalize_path( $img_dir . "/{$this->_slug}.*" ) ); + + if ( ! is_array( $icons ) || 0 === count( $icons ) ) { + if ( ! WP_FS__IS_LOCALHOST && $this->is_theme() ) { + $icons = array( + fs_normalize_path( $img_dir . '/theme-icon.png' ) + ); + } else { + $icon_found = false; + $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.png" ); + + if ( ! function_exists( 'get_filesystem_method' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + $have_write_permissions = ( 'direct' === get_filesystem_method( array(), fs_normalize_path( $img_dir ) ) ); + + /** + * IMPORTANT: THIS CODE WILL NEVER RUN AFTER THE PLUGIN IS IN THE REPO. + * + * This code will only be executed once during the testing + * of the plugin in a local environment. The plugin icon file WILL + * already exist in the assets folder when the plugin is deployed to + * the repository. + */ + if ( WP_FS__IS_LOCALHOST && $have_write_permissions ) { + // Fetch icon from Freemius. + $icon = $this->fetch_remote_icon_url(); + + // Fetch icon from WordPress.org. + if ( empty( $icon ) && $this->is_plugin() && $this->is_org_repo_compliant() ) { + if ( ! function_exists( 'plugins_api' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + } + + $plugin_information = plugins_api( 'plugin_information', array( + 'slug' => $this->_slug, + 'fields' => array( + 'sections' => false, + 'tags' => false, + 'icons' => true + ) + ) ); + + if ( + ! is_wp_error( $plugin_information ) + && isset( $plugin_information->icons ) + && ! empty( $plugin_information->icons ) + ) { + /** + * Get the smallest icon. + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + $icon = end( $plugin_information->icons ); + } + } + + if ( ! empty( $icon ) ) { + if ( 0 !== strpos( $icon, 'http' ) ) { + $icon = 'http:' . $icon; + } + + /** + * Get a clean file extension, e.g.: "jpg" and not "jpg?rev=1305765". + * + * @author Leo Fajardo (@leorw) + * @since 1.2.2 + */ + $ext = pathinfo( strtok( $icon, '?' ), PATHINFO_EXTENSION ); + + $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.{$ext}" ); + + // Try to download the icon. + $icon_found = fs_download_image( $icon, $local_path ); + } + } + + if ( ! $icon_found ) { + // No icons found, fallback to default icon. + if ( $have_write_permissions ) { + // If have write permissions, copy default icon. + copy( fs_normalize_path( $img_dir . "/{$this->_module_type}-icon.png" ), $local_path ); + } else { + // If doesn't have write permissions, use default icon path. + $local_path = fs_normalize_path( $img_dir . "/{$this->_module_type}-icon.png" ); + } + } + + $icons = array( $local_path ); + } + } + } + + $icon_dir = dirname( $icons[0] ); + + return fs_img_url( substr( $icons[0], strlen( $icon_dir ) ), $icon_dir ); + } + + /** + * Fetch module's extended info. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return object|mixed + */ + private function fetch_module_info() { + return $this->get_api_plugin_scope()->get( 'info.json', false, WP_FS__TIME_WEEK_IN_SEC ); + } + + /** + * Fetch module's remote icon URL. + * + * @author Vova Feldman (@svovaf) + * @since 2.0.0 + * + * @return string + */ + function fetch_remote_icon_url() { + $info = $this->fetch_module_info(); + + return ( $this->is_api_result_object( $info, 'icon' ) && is_string( $info->icon ) ) ? + $info->icon : + ''; + } + + #-------------------------------------------------------------------------------- + #region GDPR + #-------------------------------------------------------------------------------- + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + * + * @return bool + */ + function fetch_and_store_current_user_gdpr_anonymously() { + $pong = $this->ping( null, true ); + + if ( ! $this->get_api_plugin_scope()->is_valid_ping( $pong ) ) { + return false; + } else { + FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required ); + + return $pong->is_gdpr_required; + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + * + * @param array $user_plugins + * + * @return string + */ + private function get_gdpr_admin_notice_string( $user_plugins ) { + $this->_logger->entrance(); + + $addons = self::get_all_addons(); + + foreach ( $user_plugins as $user_plugin ) { + $has_addons = isset( $addons[ $user_plugin->id ] ); + + if ( WP_FS__MODULE_TYPE_PLUGIN === $user_plugin->type && ! $has_addons ) { + if ( $this->_module_id == $user_plugin->id ) { + $addons = $this->get_addons(); + $has_addons = ( ! empty( $addons ) ); + } else { + $plugin_api = FS_Api::instance( + $user_plugin->id, + 'plugin', + $user_plugin->id, + $user_plugin->public_key, + ! $user_plugin->is_live, + false, + $this->get_sdk_version() + ); + + $addons_result = $plugin_api->get( '/addons.json?enriched=true', true ); + + if ( $this->is_api_result_object( $addons_result, 'plugins' ) && + is_array( $addons_result->plugins ) && + ! empty( $addons_result->plugins ) + ) { + $has_addons = true; + } + } + } + + $user_plugin->has_addons = $has_addons; + } + + $is_single_parent_product = ( 1 === count( $user_plugins ) ); + + $multiple_products_text = ''; + + if ( $is_single_parent_product ) { + $single_parent_product = reset( $user_plugins ); + + $thank_you = sprintf( + "%s", + $single_parent_product->id, + sprintf( + $single_parent_product->has_addons ? + $this->get_text_inline( 'Thank you so much for using %s and its add-ons!', 'thank-you-for-using-product-and-its-addons' ) : + $this->get_text_inline( 'Thank you so much for using %s!', 'thank-you-for-using-product' ), + sprintf('%s', $single_parent_product->title) + ) + ); + + $already_opted_in = sprintf( + $this->get_text_inline( "You've already opted-in to our usage-tracking, which helps us keep improving the %s.", 'already-opted-in-to-product-usage-tracking' ), + ( WP_FS__MODULE_TYPE_THEME === $single_parent_product->type ) ? WP_FS__MODULE_TYPE_THEME : WP_FS__MODULE_TYPE_PLUGIN + ); + } else { + $thank_you = $this->get_text_inline( 'Thank you so much for using our products!', 'thank-you-for-using-products' ); + $already_opted_in = $this->get_text_inline( "You've already opted-in to our usage-tracking, which helps us keep improving them.", 'already-opted-in-to-products-usage-tracking' ); + + $products_and_add_ons = ''; + foreach ( $user_plugins as $user_plugin ) { + if ( ! empty( $products_and_add_ons ) ) { + $products_and_add_ons .= ', '; + } + + if ( ! $user_plugin->has_addons ) { + $products_and_add_ons .= sprintf( + "%s", + $user_plugin->id, + $user_plugin->title + ); + } else { + $products_and_add_ons .= sprintf( + "%s", + $user_plugin->id, + sprintf( + $this->get_text_inline( '%s and its add-ons', 'product-and-its-addons' ), + $user_plugin->title + ) + ); + } + } + + $multiple_products_text = sprintf( + "%s: %s", + $this->get_text_inline( 'Products', 'products' ), + $products_and_add_ons + ); + } + + $actions = sprintf( + '
    • %s - %s
    • %s - %s
    ', + sprintf('', $this->get_text_inline( 'Yes', 'yes' ) ), + $this->get_text_inline( 'send me security & feature updates, educational content and offers.', 'send-updates' ), + sprintf('', $this->get_text_inline( 'No', 'no' ) ), + sprintf( + $this->get_text_inline( 'do %sNOT%s send me security & feature updates, educational content and offers.', 'do-not-send-updates' ), + '', + '' + ) + ); + + return sprintf( + '%s %s %s', + $thank_you, + $already_opted_in, + sprintf( $this->get_text_inline( 'Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)', 'due-to-gdpr-compliance-requirements' ), '', '' ) . + '

    ' . + '' . $this->get_text_inline( "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:", 'contact-for-updates' ) . '' . + $actions . + ( $is_single_parent_product ? '' : $multiple_products_text ) + ); + } + + /** + * This method is called for opted-in users to fetch the is_marketing_allowed flag of the user for all the + * plugins and themes they've opted in to. + * + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + * + * @param string $user_email + * @param string $license_key + * @param array $plugin_ids + * @param string|null $license_key + * + * @return array|false + */ + private function fetch_user_marketing_flag_status_by_plugins( $user_email, $license_key, $plugin_ids ) { + $request = array( + 'method' => 'POST', + 'body' => array(), + 'timeout' => WP_FS__DEBUG_SDK ? 60 : 30, + ); + + if ( is_string( $user_email ) ) { + $request['body']['email'] = $user_email; + } else { + $request['body']['license_key'] = $license_key; + } + + $result = array(); + + $url = WP_FS__ADDRESS . '/action/service/user_plugin/'; + $total_plugin_ids = count( $plugin_ids ); + + $plugin_ids_count_per_request = 10; + for ( $i = 1; $i <= $total_plugin_ids; $i += $plugin_ids_count_per_request ) { + $plugin_ids_set = array_slice( $plugin_ids, $i - 1, $plugin_ids_count_per_request ); + + $request['body']['plugin_ids'] = $plugin_ids_set; + + $response = self::safe_remote_post( + $url, + $request, + WP_FS__TIME_24_HOURS_IN_SEC, + WP_FS__TIME_12_HOURS_IN_SEC + ); + + if ( ! is_wp_error( $response ) ) { + $decoded = is_string( $response['body'] ) ? + json_decode( $response['body'] ) : + null; + + if ( + !is_object($decoded) || + !isset($decoded->success) || + true !== $decoded->success || + !isset( $decoded->data ) || + !is_array( $decoded->data ) + ) { + return false; + } + + $result = array_merge( $result, $decoded->data ); + } + } + + return $result; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + function _maybe_show_gdpr_admin_notice() { + if ( ! $this->is_user_in_admin() ) { + return; + } + + if ( ! $this->should_handle_gdpr_admin_notice() ) { + return; + } + + if ( ! $this->is_user_admin() ) { + return; + } + + require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; + + $lock = FS_User_Lock::instance(); + + /** + * Try to acquire a 60-sec lock based on the WP user and thread/process ID. + */ + if ( ! $lock->try_lock( 60 ) ) { + return; + } + + /** + * @var $current_wp_user WP_User + */ + $current_wp_user = self::_get_current_wp_user(); + + /** + * @var FS_User $current_fs_user + */ + $current_fs_user = Freemius::_get_user_by_email( $current_wp_user->user_email ); + + $ten_years_in_sec = 10 * 365 * WP_FS__TIME_24_HOURS_IN_SEC; + + if ( ! is_object( $current_fs_user ) ) { + // 10-year lock. + $lock->lock( $ten_years_in_sec ); + + return; + } + + $gdpr = FS_GDPR_Manager::instance(); + + if ( $gdpr->is_opt_in_notice_shown() ) { + // 30-day lock. + $lock->lock( 30 * WP_FS__TIME_24_HOURS_IN_SEC ); + + return; + } + + if ( ! $gdpr->should_show_opt_in_notice() ) { + // 10-year lock. + $lock->lock( $ten_years_in_sec ); + + return; + } + + $last_time_notice_shown = $gdpr->last_time_notice_was_shown(); + $was_notice_shown_before = ( false !== $last_time_notice_shown ); + + if ( $was_notice_shown_before && + 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_notice_shown + ) { + // If the notice was shown before, show it again after 30 days from the last time it was shown. + return; + } + + /** + * Find all plugin IDs that were installed by the current admin. + */ + $plugin_ids_map = self::get_user_opted_in_module_ids_map( $current_fs_user->id ); + + if ( empty( $plugin_ids_map )) { + $lock->lock( $ten_years_in_sec ); + + return; + } + + $user_plugins = $this->fetch_user_marketing_flag_status_by_plugins( + $current_fs_user->email, + null, + array_keys( $plugin_ids_map ) + ); + + if ( empty( $user_plugins ) ) { + $lock->lock( + is_array($user_plugins) ? + $ten_years_in_sec : + // Lock for 24-hours on errors. + WP_FS__TIME_24_HOURS_IN_SEC + ); + + return; + } + + $has_unset_marketing_optin = false; + + foreach ( $user_plugins as $user_plugin ) { + if ( true == $user_plugin->is_marketing_allowed ) { + unset( $plugin_ids_map[ $user_plugin->plugin_id ] ); + } + + if ( ! $has_unset_marketing_optin && is_null( $user_plugin->is_marketing_allowed ) ) { + $has_unset_marketing_optin = true; + } + } + + if ( empty( $plugin_ids_map ) || + ( $was_notice_shown_before && ! $has_unset_marketing_optin ) + ) { + $lock->lock( $ten_years_in_sec ); + + return; + } + + $modules = array_merge( + array_values( self::maybe_get_entities_account_option( 'plugins', array() ) ), + array_values( self::maybe_get_entities_account_option( 'themes', array() ) ) + ); + + foreach ( $modules as $module ) { + if ( ! FS_Plugin::is_valid_id( $module->parent_plugin_id ) && isset( $plugin_ids_map[ $module->id ] ) ) { + $plugin_ids_map[ $module->id ] = $module; + } + } + + $plugin_title = null; + if ( 1 === count( $plugin_ids_map ) ) { + $module = reset( $plugin_ids_map ); + $plugin_title = $module->title; + } + + $gdpr->add_opt_in_sticky_notice( + $this->get_gdpr_admin_notice_string( $plugin_ids_map ), + $plugin_title + ); + + $this->add_gdpr_optin_ajax_handler_and_style(); + + $gdpr->notice_was_just_shown(); + + // 30-day lock. + $lock->lock( 30 * WP_FS__TIME_24_HOURS_IN_SEC ); + } + + /** + * Prevents the GDPR opt-in admin notice from being added if the user has already chosen to allow or not allow + * marketing. + * + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + private function disable_opt_in_notice_and_lock_user() { + FS_GDPR_Manager::instance()->disable_opt_in_notice(); + + require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; + + // 10-year lock. + FS_User_Lock::instance()->lock( 10 * 365 * WP_FS__TIME_24_HOURS_IN_SEC ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + function _add_gdpr_optin_js() { + $vars = array( 'id' => $this->_module_id ); + + fs_require_once_template( 'gdpr-optin-js.php', $vars ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + function enqueue_gdpr_optin_notice_style() { + fs_enqueue_local_style( 'fs_gdpr_optin_notice', '/admin/gdpr-optin-notice.css' ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + function _maybe_add_gdpr_optin_ajax_handler() { + $this->add_ajax_action( 'fetch_is_marketing_required_flag_value', array( &$this, '_fetch_is_marketing_required_flag_value_ajax_action' ) ); + + if ( FS_GDPR_Manager::instance()->is_opt_in_notice_shown() ) { + $this->add_gdpr_optin_ajax_handler_and_style(); + } + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + function _fetch_is_marketing_required_flag_value_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'fetch_is_marketing_required_flag_value' ); + + $license_key = fs_request_get( 'license_key' ); + + if ( empty($license_key) ) { + self::shoot_ajax_failure( $this->get_text_inline( 'License key is empty.', 'empty-license-key' ) ); + } + + $user_plugins = $this->fetch_user_marketing_flag_status_by_plugins( + null, + $license_key, + array( $this->_module_id ) + ); + + if ( ! is_array( $user_plugins ) || + empty($user_plugins) || + !isset($user_plugins[0]->plugin_id) || + $user_plugins[0]->plugin_id != $this->_module_id + ) { + /** + * If faced an error or if the module ID do not match to the current module, ask for GDPR opt-in. + * + * @author Vova Feldman (@svovaf) + */ + self::shoot_ajax_success( array( + 'is_marketing_allowed' => null, + 'license_owner_id' => null + ) ); + } + + self::shoot_ajax_success( array( + 'is_marketing_allowed' => $user_plugins[0]->is_marketing_allowed, + 'license_owner_id' => ( isset( $user_plugins[0]->license_owner_id ) ? $user_plugins[0]->license_owner_id : null ) + ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.3.2 + * + * @param number[] $install_ids + * + * @return array { + * An array of objects containing the installs' licenses owners data. + * + * @property number $id User ID. + * @property string $email User email (can be masked email). + * } + */ + private function fetch_installs_licenses_owners_data( $install_ids ) { + $this->_logger->entrance(); + + $response = $this->get_api_user_scope()->get( + '/licenses_owners.json?install_ids=' . implode( ',', $install_ids ) + ); + + $license_owners = null; + + if ( $this->is_api_result_object( $response, 'owners' ) ) { + $license_owners = $response->owners; + } + + return $license_owners; + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + private function add_gdpr_optin_ajax_handler_and_style() { + // Add GDPR action AJAX callback. + $this->add_ajax_action( 'gdpr_optin_action', array( &$this, '_gdpr_optin_ajax_action' ) ); + + add_action( 'admin_footer', array( &$this, '_add_gdpr_optin_js' ) ); + add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_gdpr_optin_notice_style' ) ); + } + + /** + * @author Leo Fajardo (@leorw) + * @since 2.1.0 + */ + function _gdpr_optin_ajax_action() { + $this->_logger->entrance(); + + $this->check_ajax_referer( 'gdpr_optin_action' ); + + if ( ! fs_request_has( 'is_marketing_allowed' ) || ! fs_request_has( 'plugin_ids' ) ) { + self::shoot_ajax_failure(); + } + + $current_wp_user = self::_get_current_wp_user(); + + $plugin_ids = fs_request_get( 'plugin_ids', array() ); + if ( ! is_array( $plugin_ids ) || empty( $plugin_ids ) ) { + self::shoot_ajax_failure(); + } + + $modules = array_merge( + array_values( self::maybe_get_entities_account_option( 'plugins', array() ) ), + array_values( self::maybe_get_entities_account_option( 'themes', array() ) ) + ); + + foreach ( $modules as $key => $module ) { + if ( ! in_array( $module->id, $plugin_ids ) ) { + unset( $modules[ $key ] ); + } + } + + if ( empty( $modules ) ) { + self::shoot_ajax_failure(); + } + + $user_api = $this->get_api_user_scope_by_user( Freemius::_get_user_by_email( $current_wp_user->user_email ) ); + + foreach ( $modules as $module ) { + $user_api->call( "?plugin_id={$module->id}", 'put', array( + 'is_marketing_allowed' => ( true == fs_request_get_bool( 'is_marketing_allowed' ) ) + ) ); + } + + FS_GDPR_Manager::instance()->remove_opt_in_notice(); + + require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php'; + + // 10-year lock. + FS_User_Lock::instance()->lock( 10 * 365 * WP_FS__TIME_24_HOURS_IN_SEC ); + + self::shoot_ajax_success(); + } + + /** + * Checks if the GDPR admin notice should be handled. By default, this logic is off, unless the integrator adds the special 'handle_gdpr_admin_notice' filter. + * + * @author Vova Feldman (@svovaf) + * @since 2.1.0 + * + * @return bool + */ + private function should_handle_gdpr_admin_notice() { + return $this->apply_filters( + 'handle_gdpr_admin_notice', + // Default to false. + false + ); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Marketing + #---------------------------------------------------------------------------------- + + /** + * Check if current user purchased any other plugins before. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function has_purchased_before() { + // TODO: Implement has_purchased_before() method. + throw new Exception( 'not implemented' ); + } + + /** + * Check if current user classified as an agency. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function is_agency() { + // TODO: Implement is_agency() method. + throw new Exception( 'not implemented' ); + } + + /** + * Check if current user classified as a developer. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function is_developer() { + // TODO: Implement is_developer() method. + throw new Exception( 'not implemented' ); + } + + /** + * Check if current user classified as a business. + * + * @author Vova Feldman (@svovaf) + * @since 1.0.9 + * + * @return bool + */ + function is_business() { + // TODO: Implement is_business() method. + throw new Exception( 'not implemented' ); + } + + #endregion + + #---------------------------------------------------------------------------------- + #region Helper + #---------------------------------------------------------------------------------- + + /** + * If running with a secret key, assume it's the developer and show pending plans as well. + * + * @author Vova Feldman (@svovaf) + * @since 2.1.2 + * + * @param string $path + * + * @return string + */ + function add_show_pending( $path ) { + if ( ! $this->has_secret_key() ) { + return $path; + } + + return $path . ( false !== strpos( $path, '?' ) ? '&' : '?' ) . 'show_pending=true'; + } + + #endregion + } diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-fs-logger.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-fs-logger.php index 90e918fe..624c683c 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-fs-logger.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/class-fs-logger.php @@ -142,7 +142,7 @@ function get_file() { return $this->_file_start; } - private function _log( &$message, $type = 'log', $wrapper ) { + private function _log( &$message, $type, $wrapper = false ) { if ( ! $this->is_on() ) { return; } @@ -688,4 +688,4 @@ public static function get_logs_download_url( $filename = '' ) { } #endregion - } \ No newline at end of file + } diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-site.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-site.php index fd974766..984d8f9a 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-site.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-site.php @@ -102,6 +102,14 @@ class FS_Site extends FS_Scope_Entity { * @var bool */ public $is_uninstalled = false; + /** + * @author Edgar Melkonyan + * + * @since 2.4.2 + * + * @var bool + */ + public $is_beta; /** * @param stdClass|bool $site @@ -233,4 +241,13 @@ function is_tracking_allowed() { function is_tracking_prohibited() { return ! $this->is_tracking_allowed(); } + + /** + * @author Edgar Melkonyan + * + * @return bool + */ + function is_beta() { + return ( isset( $this->is_beta ) && true === $this->is_beta ); + } } \ No newline at end of file diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-user.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-user.php index 6ad4e0e2..a329e879 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-user.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/includes/entities/class-fs-user.php @@ -31,13 +31,6 @@ class FS_User extends FS_Scope_Entity { */ public $is_verified; /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @var bool - */ - public $is_beta; - /** * @var string|null */ public $customer_id; @@ -63,16 +56,6 @@ function is_verified() { return ( isset( $this->is_verified ) && true === $this->is_verified ); } - /** - * @author Leo Fajardo (@leorw) - * @since 2.3.0 - * - * @return bool - */ - function is_beta() { - return ( isset( $this->is_beta ) && true === $this->is_beta ); - } - static function get_type() { return 'user'; } diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-cs_CZ.mo b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-cs_CZ.mo index 8452f9fa9ee5001a711e7cb70df10f39ab310da2..f51ed3b6e97f323cca5034d7b26ec7ebb405c9de 100644 GIT binary patch delta 11209 zcmd7Xd3aP+n#b|W5(3!?I|*!+;070}6R1^`= z5LZMNH$b4ZqygEw1q4wL5d{=f1Q8V+w;qIUhxz_;Zg)RDf6O2A%skKd`1m>J+xQo z(kv?#@4{$&$ngp6M12J|zyp|wA7CHL3Rz!Kc$0=!+*N>wF$KGJrVYnn40^B;R$&y* zM|HRuBe4b>;`2`ZWv9Lo2hqL-N8oR$31oG#tkH~btW2mP1uz2ti2Eb1m8z?%Q}HA(dtV4W3Uwk-PjSeg6`s0v4$Dw0pM}cPxmX{UIqlD2BK1|MTzJ!I--)_!A1V?DF&01R zN&Gd?Ip@N^<522#Gc79@N1$fD3~M8SO{j0hC-8lY!h&9=eVXHasK`EnitG!h0oP&z zZb3!pK#0Nw3g=KO9LR?1hEb@QPH~)uTG0&DNVF_E$IxgB3h6~uhrgmas^8bFARe1hPe$F>6SboLsK^aLb$mPOxk;Fa#W)MA za2fuLipYW+%=62T_K>xLLJKZr_A?R4MTK}GCfDJmgG;DC+TTnd=|;F-hk?mx5+qg4@uKPw9r6SPkyQVzdWZRs=3U?d4;r zfuBRYKQ^NV+J+PG5GuK^zu7$Z2)3iX1Qp3m7#pInMFrf4OxF4c71H=YCh3~ue^5_C zwYSbP6K;nJX=lg2s2m!C({QX)--V=sbqKX}^#+^B#A1j9wwhBQ@vR)ps$*IAqE@my z+p_M%k5DTdGsLpS;q91&uVG6(fC~K?)Ye?aPMFA1Vt1_pn1Pk3e%Ihw+%lB-Ywx3n znKx4kwx^zpbSKppcHPCc}df@bskE(thOAW-n$z$yYNb0J58?sp$MI!cNu0mN;kOcI%(%@=Xd7w) zJMlXF2$S(IsK_LaF_CP8%Bl9)6jL!mo7SI#_I?m{!D3WWK7p~g4mGi@*bVogBJmgO zidV24(@1HZmM3vIBQ?u6k(zwFiBu8l)Ob+I`Y=W-X%`PAx<+Us0Y61h;eyXG-4|0}Ce{>HPbnb& z3V9bAWFJ(Bvrrx6U}K!96o(YFqv?n}MPY(*w& zoSYB^9hGw>8t z`-51FN0H}4R=*;%lA9fKQK21=8lV)lGA}AZRj8HEMIFmUs0luUTF5F?j%;$S??d%> z6gS~ntiftGM^)#)6VvHN!=JDn{)kGVgc37wf5)Ln0$aD@L%0FUu~(^ip{&M4>RV8e zI*8f$Eowp;Wv2gZe2{t}7BRl{Erkrsn`Tx#2eq?bZm7xxNnTQ~v{o^uT7PVLJ|`{wLJ&YryifqH(AsD@DCXW}}km zamSU|nffM-#7~|2S9pqgtk>NC9qRfOY>0Jy#9tGL@|l?>AlqX#N8NA_#^3{}KN`v#i5%bv@RjJ|;v#E4>|? zU;%c(0FJ_^QK3JN-S9V5lBQLfuV^Ds3)qU!bEPIiT!XPs^h(wiS1_d_Z^N!qHZlkjy`+GNr6Hfhi_s5 zM$O@a4yR$R&VR(c=0oB(R5s5>h4gJq#q-z+W9~DN>4RF)Bvi-eQP&5sm5Nj`CgUt@ ziZys6uERcf9tUEZxym^zcT#9g!&GdC_hK`A9<>!=Y=tK<34eBsyWi|}XH>{XpiY4g z`{J|M9FJlf{1%nOk@HOCY^?qMpHD#pmSGDFp>p9V)JoQ)IzE6s@E6oXQps4|mxYSh zI8=KTDiSpqkFQ`fZb2<@4{Bm(F{BV(r6A)UFvqO}Dk*!QI_Qsin1gNc8Ptllq9XSR z>b{>)r=re-#zfTh6x75AqK;_=YT~mVB>sAE5e<59IclaGQ0IOdM&Ub7{X^8mK1W6B z8`N>UhI%gcA(N!7Fq`^VtdCEj##xT)_cd&U+a6;7HN!nLMBwMBY(IzU@G{0>y#?lh zM8{;*^^T|xd!i(EoKNDl|VaF#? zp?eXv1#3|udlNO#F30^ip863SfoV(41g7I?>JMN&JcfGigyR`(p!5G71%>!0)K*xJ zn}L&11KOz2bw;hMFDiL*Q1?&4##n_N@lnjcH&CbNOH`zO#}sVzgh}>{TG{`>6x8u} z)C{LN25<=VImk?{KVv)|K%IgU7>Sor16)HJqpQt?(oqv1h>C13>X=VJANsH%<6B=) zSb-N%AzQG_ysM9+R+wHx*l{@O1@bpkPBeSce2Voztu!CI;&jyYmFU79*ah1@Wj-Bq zQ1{=1q2?5xrXV+=LjDfwd>=vOzzn2p-v zJ8&qLU@mTWn*Gb@SRP!B-e zmxDnpKyBSIr~Mr2zAMiXf6X}ZInz-S)Lti}228>B*cUaxM7#mr*aKJKO?U(qskr54 z;3mkwRvQ1&!uFy1JLJ^QpeFQf$hmL@6~fr(%@#Dl#?;%O+Pk49+8fnT7S6(PxC{@Y zCRj)!DfC`c`#snK6J9VYPD4H42lbUMltW<&4J9khOfO?=>eo=AYrV?UmtYe0b&l_# za^)*jPFzG~_cgS!*=mzReNd+=AGhITBz>$FYihqshOA8#ifM>`(X7;u3Djp{D}2Oh zUxS+YTAYA8(T6QwGS4kQP4F?)#MYvcE{qEG+jt`$MQw51%X%)vOewUf!^5Zx{a!I4 z8-xnw9gc2Phkl%f_oI^NBKF3ssQbIWYWleeGpP^3o;VBh8D~8zd98JPyJmc=6$QN_ zpT=@rj=CXgy*aNbsLYgjw+O=jQ}#~ZLK*GHj^ zb1)L0-$eYQDZE4jFE#6Rybg!|!Mw4`Fq?V}DpDsg3n#p8Ch{DnQ*ZW$+55q$9GQYH z^rN=)7*58|a5(l0n;f}6to^6qQ5tmIR$(U$qe68W6+*p#)loCl%#$$@JD^tH7xnyL zjK_SZUWAI!4AerO#9p`>5!f5m(T%8y zX11{XO#BkK^=mnnS0h43EwZEbU&faC7AA@?n02P@fs4c0%SbW8)Z^kCn_oM#*ll2(|?NRJ*6S54viFz;8 zUiwi-@E5!euc8J_-ft$H=9r1dLU$GxSR%c{0eG98yt6|Lir(T&%efj_zMQG=ey>&oR_gP_4I=#8ONh0QiOW$ zKGYU2a(oGssP76<&`dr>t?0aSA>uvr2gP-$h;+nA?29AuW>k_c!j5o^28@NK9qnSh#TDb~jYsE94XO}GMU zFz>K_UgMh-cEfu7|$I>KMB5QnpHE|%jJ)T_4SLv!D3RFXZ6 zgK!;c!r!Ap`Ww#1rbpR-T!LNj2W*I~KQg(Jf(>>4Gbw0A0~{yeDC)CuI37R^kZ{aI zs12r2?|@I^2z22Y=X&F(Pn(>cM8hxwx1Y#V*>S&*c2yY z5A>t9;ziUe_%%F*AELHq<8c$Aov4A|L+$-B)N^0r9K3)!9qtpvKc0e*LURnE27D4* z;(F8`??vUvyVxC%;Vg_eX?|Y252sSUfL_e~)a>zFIE4B+tiev7nIE5aqmnoA6!BN# zR+gcG7o&1vjZ=Re^@4c^Q}J6=Wa3YooUl>ZpNV>LO+@9!Y*fgXqav{qZCs1#co4P4 zmroP_#uSErZnAVdwxqrQeYg?_V!{{ZQ*bnDLM1p67vdxMHRhx5OS8hg*p+&VGsa=4 zU)L%zgZ2eqnPa#)L_t}51iRryRL99@&4Qsd0Q0PVBRqTwXaWyu)K<46l?1{f)YwZ553281i zpq`J4*d*+LLFf827)gCKDtFdlB5uZdc)%F4-lw3Bj$k7^j>_6IsAG2t)xlL%q$0jE zdw3n{zC3J*6Hx;eVq3f$>*7ME{V~THjH3N{jMw>pm4cFQD>lMIsE&@Kj@1{a)A0jF zV8r+4dbDE`)G10rC1)4Zf(AHdqx#Q5EvNuBjtAoz-TovdIL<|q z*IJDIa4BZvK~#rvmrM?{#u)0EsP;jqoEeE)NC~Q6KWe;Lm-zJ74Ivsd^Jkq4t5FeH zi|TMIYGV5w52FS+?p!~Mio}o3^{bb{Q5|PC=n`}}sLx6B&| zx;!3tk(E_cWRLa+>|&q4y7AKV@Tcj&HHsJ;bOkHJ$NS8V%JjS4NNCK1j~G0mnZzz{LH#BJuf z+12`&#>#!WYSY!@w!QADKHFXHD)abe>{(^Iiu~??tNP9nDd7PdcGQm|a!#UEfBAZc zaPv3%HcuL<94&O)6@H&R&0XZJv`xCZ3d^eRI#BxmCmE~br>2E39avJo`rx6eZuum8 z>i>3DW*weW@2-5`|7~7YZ~t(Io#!SgXS=nn_c+xBECxx2xC$>{2i^KPyF<(p9vIh7TAHdGJ4kn_*< KUV33+o&N-XB&+@a delta 10222 zcmYM&33$!N{>Skj*<=$zVhM4A*diejJH4?7O`>*MOGw0;AR@Rp{oCo{R*Ir1N>QqH zC`z@2y0z6_)UKtq6m3;4)%*UKd7l4$`rOyd{C;QVJKtH(iK!R77N7ERUn=Q6-{F7# ziaJgOEL}=9#|f(T|F)nQOg$UZa4_!146I(=ak}7}7>!pj5PfSHOJYsxk?4!bSQ68) zf#bNH0Ti~-un7BMDsNZ8Pp}-Gz#zPX{`eRJ(5sf|usHfr55r< z94df4n8x_dDGFXRRE;4@tbvuV9jfCj48a`x+-=*Jp$1%ofw&1v;7%-!hcOJV+V)3C z(wt(o9VZs+U}?s8`cTl!Mx$Psh{bW0Uck+$h!3DrcpeqlRjiM{*m@;;RiM=|7#pJc zZG(ZBhOCbBDwf5m=nkUrJ_WtF4mAT0=HNcmfQfOAvkaSJJ3NnFv2q=gv3y)deE}-a zq`Hn1fnBgN=Aic0JWRk%7=_pBlK*rH-tmq@cAP=TGiM%#Vj+g(X;en;pl1FQwNJh1 z%^S<0+ACm5tcqHihPFKk^=J{>#aAynjL>e)=725yS; zFbxCnnr**pEs|(9Z5S%El~DuM#uC^Bm7$Jq3cV;~p=P+pzHkf`=~e4p)QldZW>S=e z4?#cFT9!ctQWtArQzS`F2I^QYKz(i(Du6xsKDtj(Q0j6xjOs8S)zM7U-k67BxE%G~ zR@98XL}l&(s^fF0&t1Zj_zRB1XZSAWH8lMNG%}wrgS5MyC<N9GZ|f|nJvd|xC$fiF_y)!)+Xg~s3mEQHL)MEYR+ur3UT(L z`n```(7TOU@}6zTe{~v0(x8jtJ>+}H*@-E*8`(EbP+Lw2w#JdT0hRiS?M!ML;&|%K zQGsp4N_Y%)iteK}E)fON7B%o7Ovj0+%wBR+Xi4E3a*aFDFPpXRj9S|s)(osj zeH3bjb5WaiEozT=P=SAeI+lCw^HUf|{j&8oDv(E54Bf%xIgvs*YV&kNf9#ElFatHf zVAKFPww{k#^U0_I7TNaIw!Xo-9ko>Z&>JsdI9|sfCGUwTIDV;)^Ism6#x-~mf5K_x z`3)S}$prK#Y6ed*3QN3VuIL0*M$%9N^+xTbepng@pbzF_G)}@8E#4{$x`4jJV7!S$ z<~+nYShTYlI056RH^32?i8>`Gu^l6IW@{@`i@TXjtw5cYb*O>&qcU{}mHO{7K%3_Z z1r2-~YvNmhLB>iN;v$bU5ok7;1J9akT_$*=_VdTwinC zYN9gI9u?Rtw%#ALM+RGS`;vdH#bg@P!AuOrg{by*_QlPpfWAa6)lpQ(7f@?^8_VJY zB->6vKl9!I)KZK@^*0lBYW{=Dg3!kGR{|eRd0aRc|P@Cr>D!^Y*GkJ>I z3%>mwCl{OHaQqaN*^1mY3bZw90$orO$Up_`9&HP6pf<^er~tNOBz}z%co`MYQ`DLl z8DKVJAZnlz$erRe#6dU>Ut|Uq_yg^r7xQ#7ry%eHq`WKtUZ= z!Rpu&Q*bD@!|mvg`chX10ayh~;0Ks!+fSqJhaYVHiml(kHniWyRE!^HCh|JEwV4Vi zXqT==ZI)fuLs*OYdGtdcc9!bFcmW%s-VYmLo>xWf^4h3C>syXxRoAM_&1#Oxz4lltv^-+1A}r5XGZ9z5nLsL*i9FPhe6}GL@)^z&?Mx@I(M-Xb{cQK zL{?xw>W^?S_LyM)V)_khP=D#)X7gsDGP(()@g&y7$4F+}PL+vfM#iCVKM*c2C{*777OV*!)RrfZMosi&bbI~2ok4r(brz;d`BU;O^R{GvdLu_6!3 zuqTxA`lz*i4IAQ2)RKIKdhZOD#XnG)3x3@M*a9_RcPxX$u@p{2P2@dPzgsb$&pKBq zL}1DPGcU%WQq~gHJ_xmGreFxZi-GtdR>DtFfgM9-=%)1<>X?O2F`F_HQ>jGH`M2bpguPq72q6H01GexSK0a}sLbq~ z%KGd0ouok@xQdPOF1Etz)66|E3^l+=REMvlKfZ+ud?D(>*^JuV+fn@;!s7Tn>irwm z`}X;hY2;rW`c60ZKq=IVQPvn#NA*$fwXmj2Z+;zNPud61Hm76{W>T-p8RcuknS)xw z2Ur_}-!S7eLG_#Lrl8}}6?Jh;Ld{?XCgLJIhevS$u6@&NzQDK4uiu)ely^jB@-^#F zBtB;xD)p046Ptw^XP(u)ghCG*KEz~vh6bRoIn>|LIv~>D)P{GOll)h=ejoLU`y11 zn{gTL#5C+Z&s@#xQ5pFMw_y1Kb6UKES$I zalUy!6?N{1S*M^313II&hb48KKRH!_!~8I{{<$+;aHq{ z47R~0*b!gHT6h@M&m&ae{~(igA{Ls>_X+Br*ny?-2~<6=uq2jQqc(Q4sb+S{=M71;M!9xtOZ_r%t7mYb!SV_ky^ z)V-I2HpO8K(+AOo53wSKe_&FZh&!k^M^?*ugs*BOUmItJ_fAGR-?M|FG?>*24MfR)#9o*AGUmZiS_BlA~sA$n17xz_x9KwH%F zEvRF91eMX}w!QQ^vnOJ)G3_s7G~+unD1_q%?1F`;O;~2V`N>opD^u@`MKKRka2)Es z_y)7^A?9PBk4@@NqYw3aI9|_fd(H;)yJ0rE19-5G!i&gJ10O-{iE9|G526brHkwV= z3KHCXWokQWDfXfIIfx42oI21Z`4QF8 z6D)^CJZASsSZl~4To`zU=PkF8Lh9wV@-OGq+wy-J;BVA@;kC^yMFdu*-VQb3a8v;K zsJ-N#K|!gSjf!*`YR%W9*76uCrO!|wthC((7Ke4HH$`2fV!sb|rAz0)~v)Mwi z2K6qe{w87w8JmL@s4w2FW6t_-qo9=E#-8Z&mH7*(FaDSM5^R7OUz-^%L0!G&_m~^7 z;a-!m0#raduq=L!FV+~fw|+!r;7`O@q4;+T-uWSL7#Y(9G|m>W^$a^c!=< zMxX+$gbFYQeXs#4pk~%oR3`hQ)_e@Ugi|mV_uzD_f57~3*?EBc2hnhY1`Yf>>Vv^7 zyw)(nnuzK+1rz zsBsRVm(Kqw3TZT)#Z;_u!ptZiwTtIiS6~V1+fg^>w-}F?P)ktaq`7L#;sxr>u{f4L zWinF}HE=`Jk|&{`&i~64CSq6g$K$9B{D2DJHkQVsr_H7;gIe3Vs3oe8bukIGB%^Q$ z-ogRc^^Ez~v2CcOt@ge7%cv8&=hHBsLT8LQYp&ACr~!9jFdnz{%cu+F4~)h#=S)VL zV@c|%sNJ59x|n96_QG29!h@&`97Pv?e~$durtlXHTGQzBX1C^I9qQAuEN;adJc>Hc zFa2P?h3sgVtQOC6x`r=UQC{+LB zFi7YBEeaZFG3xw(h?>FgsPp>_6=2}c#&FcYQK;wDQJ-&sewbuUMsMn!P&4m_3aBS4 zQ$sL>@tr&hdT}}`(mALB-a#F|g~(=gR%2uQ2wUM*R7cUjm^F__El~$ldk-v+15p#0 zjOuqbYMi;)T`w%4pvXV74|bqt_BE=*@30tNu>OP^;8*+n3Hnp_yJg-Bz2%uxE#EgP zeaw)Y?Aor3%=Cd{hKzktbERizxbm`xWao}aA3oeuDYkBaPn)rs*<(Ci8%_xDc(+^` z==nUQQkbXzz%=ht>Dj|_U4wE)yGG`X9ymBXcSv?tLGKHR1sk*8^n5gUm6vD3@K(N_ z*xcfwo{rNBig<2LPbeBxH#VOC8o255xS~C=OOFJ2>aH#3S8z7Dw`b|5UET%% z-V)@=+tNO~AZtMBg7XKn3i=O>_B=Q=*E^;4z9qx*hGve)bWKQiWf!g(mN(KBog3xq zL|5r1gdsf2$Q(K*Q~l=_ZXDst9lL+iP}lGw12ePty_H?K(KT#%;l_P$H7Rf(o8ZYh zKEbP?)#)z^x{WC1i9D0w>v{Xa6yJc6!wXkrXO5tAPxG=iK?{x4?xHG%R{{X?9X43!w diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-da_DK.mo b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-da_DK.mo index fd44d1b7108c9ab874f7f74afe5c37f9a09de764..420c0a4d649886c862c39da081ccbd6152dafa52 100755 GIT binary patch delta 11002 zcmd7WcXX9iy2tSsQh<;`5?ZLo5C|;^5JD4yNbe;9q{ag|DVUrSa!!PRdO(^YN{w_x z5R@(i2XLee(gYC(21TwqNK?3|ND<4Z^ZjMN-dXe4UF)tjYhC~O?B^}JJp0-23Envs zaOix1|BI-=5{v(`%Uf0*OpjJ%S@RnG%T$^#6T9&Y=3u9I%gV$zF%3f-TUJAS5-a0u z+eO%fcnt>Q35>!s*v7K_))gANxe&us8Tb)4z{I9p!yy=oc~}XHF$8CzI(!8yU

    l z)poqmj<;hMuJ6HK_#NV`%8XMyM6EKo6#(2Hc5ja4+`6 z;Ynl-UqfZ=K5oM37G|RRu{QBpjK$li+KOmtS*@@+K7tu7$-k4vbS{up>nifB6~R-H z*afTO5Ddp$)XFEL>U0_g;u8D%a*QH=9aRgv?d$td&mBc&;v|OQ$F0b}2D)b7_yM~U zmru5=zSs*j^Cei835+J*i;M6>48e@n=K2KN=TMnlgv#t|r~x-&72Jc$&oV~-km6q&4b9+lFFE~e}pxh;d#^whjg>7 zp*Rd{<5sMRCs3*X616oCu?a?Tl-OOXBPL)Gs^9gPhI_h`f9-wc9_Gu`0Aq>!VtI69 zf1HTak982U@gWvqMo+T^XEBKQ78c_j)WjzAGAW;dI!)_Q#km7D;lsVizb;(lLPPv- zbYNs}yV_AH>wqQL4Rx$8As<64w2yv7*fyjq>m?-1R%JdOnn-`t^T)A1{)8Ghrk|;e zBtH$Mb|I2=s|1_lMGV9smLG~Cwl%OWaU5!ek7Edq!eGq83Yd>No<;WkIarx^5$c$) zv19*s8k*6&SP{=6-y-W%R567QFd3+enrJ*~pk}CnTG??2)ZV9}1{!T&&#_~V?Np56 z{v2e1e(QA_)w!?{wbK2zC-DUFC%6&UlIQE#a}a69gu!M)`%nwmkB{Jatb-3wnTZ-= zGFcZ@Q?XbT8)A?)tpg41eHUzoS*W61gkiWDHL<;zghx@Ccz}uc6Xs)MN?NDoRqV+~ z)zVF-#tbu=%0!)-JXEp1fR$A=uh3BHSDZ}PYC`W}Q@oC`SY?dqKY0xKSIS*n&;tvx5x$3PyLA=IifpX; z)#`xS>%OQWa-!}}MQz0lRK|9pCiEHV*xg1w7n)%vRuvUD$RPhpc{47^HmDS*qB`h< zkvP)6o`-s_2=y~M4YgGZQ7e88wYS@`ChkVEZ=FUx*YHWR70IY^`uJ(+*rcIS=|&Y- z5$b_r)J&g8bvzd}u?47OwiY$Pt*D6|K-Izr=*8bL54}#4*~_SjRv2d%;IB?YGmA&f zIK_4Vsz|c2EX7!lcm}G9*P$kK0JY~wP{sHW_QUh|7&^wAfybh*&%!J`hrI8%+Gm=T zbhhn_O6_pe06D0YxltJ^My-4r>R8T0O>jACA+MuqWQTqKD5}46xC5_Z2`+YVRCWHF zFr6eW9K!l|2USE>vdzF9Y`Y@`Yz@NMxDE5Mb&mOm$ejELI;T`+JpRqgfA=L2;W_eoCP*joSpgts1P(`%Rb}cp~-hmbHk{w^c z&xpg^=J{Kw`#)htEaxHrnm~xh%&ZEsJyvzp15+^+XQGO8p&f6=vQ(p1auU_?8Ek={ zAYWgrVgdhVz%i&}cpMqqsz1?uh+dgU{yTADCl_Ym9ef;ph31R62UW%2qJA`*bEd*D z6|3MtRH~oE1e}R=aTjXO&tfCIf%;&D`AnwbF@Si8pN3XC45KjvH$i9*5#?%)pRm_@ToI*jML2=vnh4 zF&I_NQ&1^Aj1BPyHo?&6OlI1kRx}FL@eS1dj%=kem4$V1GFHVBd=xih8@z#?u*KRn4OgSKq7-BBBG$&cw&BywUN=Rhycg;ec(5(5!0LDo>*7sR5m$KL zWX^$Q|Nc*>p#gKT2KrI8uoShDEvSx9U`xD*nn*(`R?nrPGBy--y%?2=5{$q%u`=#K zE%1HR#IB-WDf*d)jF@STTO6t=TcSGXfCI1(*2Cqf741c3?qk$*-=j`Nxmm_2)cppi ziFZOB(*o4QC(k1PdT|~X^x`ViOt+!V{XPuAV|M&k)Wp6(W$G)`ar_aZ1RBAxB~ z{cVS%o^zs}%eS3^e+uBQU_XsiZghIde3_?fGVZsA(Fo&#(WtGMfEsWXY61)Fco{|z zuSe~DDXNN3VK`pF=J-7(VZDWBg#%D~or4Xq5LJAymfdInH`CCJkDyj~36+T(n1c6E z6KS%@OrRx35~rd%PD8yn1{-27Dz)=b18qVrXg}(`6X?N97|i%qpT*{XuMNhY#CI?q z+buC2y^NcP-$Z3#aETeniSfj9us-ga5qNbE%YmuztWJ^ zmYU;|fSPG5JMM)xo94zc60sLW)ej+w{4??Yu~8mgbU_VrcRo%k*6f!{7=|FtJ6 z%gg{HumO=O=CVc2ES&u;7hDUd<%UTwATCxO+ig`DOSZDsG2xp$EUFx@fFku z=|`-CwO=;_x5ItJU2!S?ilcP?OV*ix5PXlp+<0QWNqq*!5a**ZFbB2w^Kb;NMK}Iz z-_L!+{Q9|36Pt_L>&2+luS0FwE)2kH7|i(A*ED|P!gpmCsLBmyg%402glsgajX}kY zZ~~^FwrDNtSnWck_-oVz?qM?i16yH>H`$(Y{6&Py+^ z{5C3uXHcoVjd56hv-y)N9(xmKVmsW9dhRP6kH6w0=-gudK$(Hsn$1`qPouv-jk7e` zV!f^Af3FS00^$Rx7m~J_U&kR>O#B4a#&g&dzeN>a%yzS~MyTW23H6~FiYme!bl@wf z@5YYpg%wN9v5P~^I1%+?8`O#)!w~Fa$3s#5 zjI-lH)Ry>B@0Va}T#eCqPB$vixPhvHJE#Hf+x}u(ez!T6l~4o5VGt&v-cPaZj7oiP z48$i<6L4V|PDM@dMSOt% zpmoH2dgD;{J7GNbKxM#!^7@GmvzUk7j+;NvccLbI1(k_!Q2qUmns77)P!n6A z`t9wfp_PutdYFUSyE&-TtwLpFBUZ#c*bfikV;J^<*_ysMh}erccm%begp;QKWYk1D zqxw(7K=kL(2%(XW!8jQ!>4ts%MXW%)1eM}ds4wFtR7Q@XGIbuwx^)Fh@U2t&-)q#) zhvvuW0>%)BpEjqYF^1^;522v}#$YD8a5kRAd>s6dN!dYE4P3;!_%$jM!Dq|_(on@a z4rk$PRDYpo%_n^#YQ;-X3tWz6zyIrLDD|5$4nM%5_$~IuZhti?T!2dHD%3#ha4jA~ z{n%umGxtA0zE9Q}48wD%fiGisypA2Q*?GPbI{!H|l$z&IU#w*qjXN+L-^W&X4pjp| ze={iz$Ipn{p`NRD!K^F}^;{wDUu}xC%2c@)PqX*+gtcd>OUU(2IQku{S=B$5CI#kWblvRdMf6&5Gxs zCbSZxa4S0SAU4O#sELJLGMS3S7~=M}X{fEqM{U7EEGu4Af2*)D?!bX~@e=vhiW~oz z`8z%ZRSPck;7rs^@1q7zCf~8x3rFBnI2Vs%8V>s0WabS_B>o9gu<;jUhfn-iOdu}! zyIH^*KaCn(cn9P0G>*gvn2duio8vPRHKF}D4immK11-P|;_K+b?pMsQ+k#IJKYrDG zqE}*j;y+_ud|>O3zGha`61DPl)QY?~6n{g#kbd24O(Ck7W?&G`MJ-?f>ixG+_mA6t zgq(Bh0_xaZ#sIu!^jqK32;#zBR8{_ns@}jGcG00;td6P;2iC`ysE!Ato*#|s*o8WF zxmX@2p=w}??eq5ixfrP5|7A3yd0@4DVhQK5|A>0t z`r1si0xAQM7=cw$8H+<@G70^GG`i5xi`}sz_CpOY6g81Cs0loUDk2Z+)4K^Zfgez( zqx?-XKn>LUv8dWR zBq+`2^c9tU(q>9Xa-qwWpIhX0?v}Lce)+Jpa>Kp{vO2DtpLG%jKAq z<8qf>XjnF5x5ts^ac8?K6*|gR>`E++7&jzvaf4H{7AIu~HEkK^bxg|5%X1XC3UfV~ zx#P(}vBT?PX$@O(&*yP8OvWtF;?x0k$y;9T)2_ne=4JE$V@$K8e3#o-nvlIYAj6U4 z$}4b?GFDeKF3;u7@pyc^QS2ySX>MPxGmmU4In31QBPGQSXJIZYDO@`}i$ zHit0Z5atrA)!J6g2wkW%{7tO1o`RR;e{K@`lN^hZJ5UcN4* z_5YzDT&45gm>ycmWiPvPY4Fa$|DS3i{n+%t#j&Sm|3_+Kg9hG#msAY<^Bmz9Z!q^ delta 10152 zcmYM(3w+OI|Htt!o1IT)GaB1(80IiD=i|M}VQ8ipkz#CS4jZ!!v0uqj4vAUlb|^}8 zKzrNn0h{D;28V_v$0Vl#~Fb0F&-~rAo?^mhGPQt81%t3 z495&?>o{&_B!%~BSdPQ7A8*&kjaVCxV-Ws~{&*Jy(5s2*Fa&+6N1`9rwe^O!o`@;5 zx5G4?iV9#4W-z{Uf`S(f4Vn@qHpW=&h3YsLL$Sa)*<21(>7{U0?;}kTrLevX0Fa+1?1>Ay)ct0wIXHbD%#y0qat;f=<0&RrB z*bdci4-CW%WOba!uogax?jQ;)DCorvs2O;$06#+w*gDa1R$(XXg=cUe)@xxhR*V~{ zzl;hrCCPE3aRAoC0@U7GjLEnOR+G+UsCAHb5;+JKLUudM^!?iF6FcA<5*wI)z;OU>f$IUW$G3AS&{xRyGr; zfji-1%)kJ=V%vYQR%vZEZ6qqQ^-u#g!!YcK%1~c7g&`DjQ8V0QUpR`2^s@CA)Qs+; zW>S@f4@Fr`=^Tey&VNJkUEDtv(YIxNCHsC%MqClhFY>u6NQW}x~jwe8DM$9xk;>--;~pvZs3 z9e4+q>V?i673|f8jfrcq8U}PVYZ-0;FJTZ;eSD%-v?#RR+twM6e)KSX74KaRyyww{`5Qr;hxk)g;w zbw;6^4el(ZkXprYzC_I+=t0LRK^JOft1%PTVl>{xS{T{gq&yL|B;7Fqha;=zyntLG z&Znq;Z{h&-?qQbv(H`W#5e*Y*&_%Hf`8ni#gz5MRvTvNAo}3WujuY`6RO;*YGO2Bc z)2Mer1@-~P;!)Hox{2D9f1x&WXqu_Vr@77XXitNS2T!0cx>37)4wmC0)NyLm+i?Le!>RkJ=+1RNxt488FJ*2HfyNXffr3XX3-$N7Q>5x5S| z<5iqZp6B7%{wAQ`Q8T!QaTxZnxuTO%8OcBmG!(U$hGPVd#A;ZK@i-HkYVp=m&;|4r z2IF-kGUpDqz^ad!fs-+jdRv@;IjB=ofxQ^%5w^B6^-8A6)N82IvH>;lK2)X-qEi1g z259qKqM(6)!UVjF`k_;Qka;l$wM4y9Gb_P1_$)TY9jK+bg4ggztck}4o8$LA>iE@s z)Ewg`*p~X!=vK- zCRlHnIo9c@{wHEnT!VUkWElBxNZ~FGEVtu&+-@=qqh5@W_&jP8t+LOzqn2VfDq}ZL z0o8uO9Jd5iMtY+Hd)U@Tp!UcZ>*OcMzt*CJ26Zq8tK(8s`v&{s7F0kVqn7Fjs^fF0 zwfzZe;VmTFPQY;U-bmC^OholJ2X$&*LS^!8Hw7KDE%t?NsK|GrI^K^8>@aHcoJR%t z18OGsQG3B>gyT%c&Nv=7qcU5U+eU$QM@?V=Y697)fZc_*Fb}m!UPlG69b<4eM&m_P zK=)B=US*`&jDe_u!jL<~X@{e6HdbZ^75FXd->5+RM^!#|I}cFMOkAjxG(~-oj5>y0 zQ33TuMLqzvC$jAGVpNB-aTAtfIrhlrUp;shTVP?1*&Az6d*)LN(E0zlvcQ#y>_ew2 z;iutnd=A&6E|3QGRJ^|29l!*m>ry>L7FqkgEXg8;0LVfZSxw(TcT_rqCRzhvvzum|lwVLxm+&P?QK zbZaw}QP3`Z1GQOpS`T6q>SxdwtFg0G55{xY9`%0Y1oONBYL_=d1=_~i36+Ud`+Oa0 zX*W$E|JsE+ZNo_nr+x)BlRKz^?_m;F%{RYzv_g{NJdZkVzasy4`V^Q8X9sqreh#0- z=!xd1>}u4_cLlYiwI`APU#hEw| z{hs6p4?d2GxY>FUt5;!prkIJiip>Q2VL0z)V+V8>Q&7k6VJi%p$|Zs+sDNf7N7nfT z`(yuU=7-2@IGp+)_zDi5Zhm9>6&q9U`jpwcxu}e8!g#E}1iXu6#_iOfVP=$unR)^B zLc&awssUJsdJbyMW??5>idxGGRK@~I%%!|4#FrLk2P>MY9h-}{cgpU zeCu4I5RKu_m=_aKDeH!6AC1~HvoI8wU?9GZvA7u(*ilr5u3P^?9kc4Q%%+UNe$*Rb z3{F9}W>QW;Df6HPID%n#!Ft0!*I8;wdo=1;rlV$-iTW-N_1!d7fOAm+yo>?3*48(o zGV{^1tiO(51r7S(GIqdU@Ih=e+uQ@=Py` zLM=sC)PO@!0c6|yc+?UWqt<>7vT5DUY6>AVY{O=_4_n}`s2SEO-Q8QYG`fx24 z;8yg(_(kTgW6iJ^^@FIZxyEAC&luc5eHMmdvobSIXKcjy&PWQeI2T*uTi5{4VHQ?d zV*c4Y3N@pJs6Da|mCA3dH_@BAU%3f17*&r&t#t#`M4Q`s2Xren-6-hAKK6wS^r!w9 zR>vIMUW`4cKZ`x_0M^H_m(2jJQ2}*9ChKIPmg0Mi#5-661DBc$D|RXQS8ChRpiPvD zVVHqYI0A>@R8&XDQG4Yg>bw7-W^~uqt1UCX^M#@MtAVS!e@p!FDqTT$O1MrH0es-JVV{Xe$-H`E0G#;F+M ze#QKGY!0f!I{!8UB_PY`bUvCQ1wIao4rx8)hy*RsHIzu+LXIc zfm}cZ`~zwN?wb^JA>2l-ssA?fi$pkT=BZd0r=S8_VqJqRsc%MgbOk%%HJpI;J}{@` zCDdQXLbscY4*t+M9NFYRcW{r6LdZ;vgpI2Zb>Ss|I@cPv3p(Ko@o`MQ=1Xlk3pG!e&KMfV}EL)#%>*c6p zwi-2)O{hTjq5?UHn$bDbl6;SP|2NdqdhIngqCe_5H$+XeWH0$whx2Gq%2uOhvJn-~ z7wCn@Py?Q{o=0_j74`j3sPF%ay0}68NG zK@Hp+)#2mljfGelAo@_Bg<7H)Y z(+-&bR&x=R`dVL_W0s5>co_O(E@oo^K7=RmIgC4KGPEAG=6g{0#WB=-H&6j|K4dm) zUo53wfb{2f?og;l!_dQK#xt>U6QX83AC>AdY=B!Z6Tim3*!+me;51Z9OR+xA!&h;W zZSVh;xgiH(FzrLoTjxKQLJu0oV`togk$3}@k!nZnzgAI8)D}aq4<_Rf)LPHS1T4pM zxC`~(ieqL%Z=>GZipuCGSo!zA&nYOihcOV7kDE=@6_v^i48jShy)hlVaUrV1C76UO zaUdSSBCKCwerH^U`PBc!rkH!eOtcK$Gif+Vp&Rx)X>PzpsF@zcF#Ha~@eaDs@07V% z5-@`LAk@`84wbQ4))lCw*oIZ{3~J`*QT<&#MgAL8_>+bVjQiTmbP~3pUV>WtjaYz( zu`71@#tb|IwRaZb5PTo!V#sOp9~zhAKB6d4t?t@9FzmC0mhV^gGgB@qh46b7o z^?$Gt)?^`vVpnX1%dtHkMg`<^-u!iJ3TmL!I2;o%aM|FC_%hzcM{(Xoa|M5g9jJS| zFPSy&Y8{4}(R7T#m8co*#7yjU*}T6JwKN~0PRSwE?yo>i;56#{TlRU_74u#c2GAaZ zI%Vzz3SJaiS=*sH>V(>isi;ksZXJaBa5yS}JdDNZsE%Jjz5fQP-;Jo_wgs!=Zqy#w zYjisYDd>d?)ULja+I-h+`#sbQ{k}B;g`zf3G%Aop^uqSm&ZuLTf)8K@YC>bJ6K(qx z4Al8wL_ra+#D{SmD#AZefjQrq07B4b<(COvT%JOH{xePywc3RqTVIn2yTS z;~2*H&KL^bI1Tk-3992#Q~(Q51OFSfX;$Mycp5cu!>i^rB%?a+h5G&xtcycY{Y|8MI`YTvQ7C;s_<{t4q4J*SY5D`WY;nyVn! zl{MOiQu*9dzNq+r1YT;4mzydfY&j$FutrWPz;@|kPmKBS`Dl4+A#SQ+;ZZu1X^Y9#IW9J0R%EHY!6vG=@Ry;m~ z<#Ddo;4qv;7*L@{niy4n%M)?%>Td&=-@65)D)F*Pt=S@ zpb{H{t#OK{NDVH`EJv;dfNs>xr=s@hvlxiW?f%tRiTE|tUf6B-e~7y87^)JdFaj^Op#FN%P5Z(> zF_pM%OUvqqy-}Gj$I?n*W#WCf6i;IqX0$T>6KrRpD!UX_*$t={ZpDhY7geDXJ{svX zZlY$`nFZAi15lZcv7LaL(PY$2d>DyyP;0pymB`!J5ceU)w639!Wo6Eqo@0Q)-zo7;SY-?r^iB*VWQTMe#&8P#aay?N4KZ$y76js7tP{w#u)UY5_C5>4r|s29M%6bab|?Ae@I<%M#R!*P^~3dr&Xh zkLh>@wYd|znCBK?ZQ>=UO76r6AC0|g;4vgw>pZHYkzLKEi^fO9HBtRFx|xJ)qe|My zwk>K8^~4D{)Q&$wwt;m9wR8d9O=Tj`#|E~l(qQ9TeX&~^%bJOr$)O&WH4D$x+YJfyl-IX)Unqz~%;Pp~#VM7_95f3qhV zqxMXRj|SDYUdAN+5(BXe(+|gB+sasr*nyg1XAHv;7>r}F9J*1*a*}<0HkK!T5p}%R z*zq=0LcaHDgwQyRe1ohDs7(|$&{QA>m1#ZHixN;TO19%RsI~8edeKvMf0i9jw4H)6 zT%V1a;Hy|w#e1EGX1d?@IG!LrkDG8Eb-sl?2J;QT#3$_IhMK{Ctb^w;7Vo1fQ(=gC zQ4DHN#bGqoLG76~7_Y@kq0yL*v8Y}7B1YgQRARfaDIP&p;yxzhL(IkcY-yd6rI^N> zqK27Dr9WvZ^$gbJdN%6Cb5NC9h#}fMD`_a>4X77y!$jPNn$dOC5uS4R7OCtcou^Wsc!y)G@q(!|@07wV}}^-IRPXHdj2-%xDto6MPT#C5(95 zd^+8zy)YlOsg__UZomq-6_wCFY=qaaE{2ab<2OZB+&P;1>xL3K8sI);*{!Qsy2-|v zpH^*9Yn_JLM59sHr=XU?hpN~+sDv(|j@|dD`$95IVii$wZB)e*GJK}df)16q6Ka57 z7==&T{n@AoCZT?O&Oj|y32Me`QER&mtK+*!^{tbr`|3PnmZB-@J-tw;W{{7DN;v_w zxhA1*C_-gA3pMauRAP%!n`a#=!7Zr74xskJG4$fUF$Xi`pcaSXyF?(~YQIydIU%0o0lwMxEzV*dNbfCydQBFCK~Ne-6jtS=95bvq~r8 zvpSlFm4+(qP}B`ssF_VbRj3Fx^BEY9^HB+|K+WV;)E?PxUq6Bx?=0@btGEJ}xHxeb zPc}_;{twcqO~+l-CJG;KUfjmE8?u3|{x}!6VlFnzHXoGrSc%w=s?>4pfwxczCA!V{ zUGN3s3?vup7B=DiR^JI`##2!hjgQ(+Img#9mPoOqg7V1MX8MTQ@Y}a8U;_X-tFWT|9 zc$qjfk6&Q%HtM-lkGXFch7dpPq5jI;MTeY-D$OMOhKm?Zd=<4x@7i%tzDckW>c#Qc z44WWdUuz6fUCWO;hP5V{|GXAqUE-VA8Os$=|JgKp6__8xr%+$S2+ojpaZl6_jps1} zS7Akb3svg(u?c>IwJ@a6ta$@$K%9d5U}d5zH4_7H3#tM;d^9T4*n{=)Bo4rzQKe5Q zGCzC;iM`2`i93b8Dpl}U(Vh%qWH#7 zLCs`Av6;bM)E+p4?eRO*z%{1vt2!283T{OubQ?MP)|1mMYcTG|;TSf<{I~uYTtj>q z`{AgWr9UHl)@B;o&7Yx4T78!Jl`I7liN~TUvlum_U8sRmSUO!_imKE>jK#AUjsL)o zXgzC|GzB{odQp4rJ*=VgzmG<3I?iJi{1x@W(C5tBC8NH4y=}8lYyB*$6=*A7J7MU;9*O*P*d$IWv z?n3Q_swL)Bv_uVLiJ17Ca5?3pr4%;xsR)6fjMpk~+~ zRr)7U13IxBW@8BE+i|fSKZjlEUx>Z&Z>R*KUo!tgN~kxnLbdJ#ZQ|;|o|3uc0>W1JrRX_p<4)g$;<4u?Y@G-8UOGu~)DjzK&YbyuvX@34E zU}NG1*i83f6y8Q(RT{t3P)Q91&8A643RsM4mQUN{I< z;?bxtWge#ELevCrqOSjnN;Gf{^;e@JKbkb7Skz47QES}@t78XLB15quj=|ba|^7u>{k_z<;smaaA9twD{m4K;y1J{nbMe2lvB5^6@@p-T57YT!Rm50+t6EkQU= z#oEZWuwFq8*yL67d|p7n_#tVX24V&N}P^b^S3bpkD2T5*kE<~s%j__vFTfz;#aN6>QHh1WZAu-F<%v^KoAL=%!dZ4a4daPR z(1Cu`(tL@bc=>JWzk4Rt*c zRe@F*iCyh@Fe;&^QG1~PTj6xn9(os5fkQqT%Jd}aMQ5DiafpzFF!dP5| zn)zbS)lrPbPf>g3GHUIwV`B{2Yc^#oj3DlhB<8b5(r8M@cvK};VKT18Ts(!d zu-!g>@bIR+s7gIPU@8^-fjKo5P%mzTs#G&n=~GY%r=ngw7!z>}#%g!Xr=c6)Laos| zsF~fs*7!X(#JGdzg=u)3co0^_HXoW}H~=dXPsic71l!;(RLNsMGMn}mYC_cx(dXlX zu#(0oI{b&tr!(@1nPD<&Q?*8ImQ>W{8Dz&}P&3U&Rjv>#;Z)R`FS4({g4$DW;y~PC z$NxrOMLGgLHftS?+C+^|5A;MWMSoPurlS&i3v1&Z)O{CFiCwYdyQq@?X8Rab;jmB4 z^OaGjsNN^kUl&@_p$9sn66%9mtC6UIvr%h11$8`U;s{)cy6{KbAB{L}=#MpVA_n0+)S8!IAg;pxxDGqv57+<`J~jOVaUAhl z)bnLen2ChgMxzpQpsqJZP0ZJpMlg-;sG0XcZJyz%49B8oG6AdLRQvjir~%jFPTYYj z@adE0&ub5`De;0+X0Pl=?V+zxFAn%ysXnU$ji>2|!MQjYbMa5q2W8@Ev#Xy)Rcaab z!1quI{S&nr!_SyMuO(rYu45CdcGk=|6~l@9p(gwk#_9ZL&`6+T77oBon1;WhmLTPv z8K4)|BkqqIF&~{6^_jWuMJ-ja9nZ4kIhacS0vw3vP{%axbDrh>R&yHKy*;o3jMd+zcA13L*4f&hTu8WT3@pL7FC&>_VqsJS$~ye2o3Gh3{*T7 zE8z>M0bjvpxDkip=jg@;Uz%h166O(qk9Bdx1@ottX*ipBKX%7X7tI&(S=1)pdy)D_ z(|AZn1crTOHdS?0sS{CaH~?$mbkv%!#s;_(^})J`s?gQ{k>Y8tv&AiW;~CTjKYag0bJ4gwk;=@ktzvNmtDenVFbDd>+?e z%kRv8tTY zWAF*AgA?uRC8$le618{MVHm!N+N?V<0CywTebzo2p>!NZz2KC&V4b)7|BjLL-@;gY zXkV{%(+pe#HE=v?4>iKF*bbFwN7T68F%bLN4#rTO|KT*W>oZUp=h!zC+Wp0-f#zZW zmY`nnGM2~XSP?g(p5JA=AGNuUpvJ$5O5_G=LU(Z>@3;P-p$GfjGL;yLfyARxFC1&f z<52faL{-dd$1`nTz##fdPzf$WCAJck=w?(Rehk9H=+l75X(+R^sQ4>XDX*du_zAU1 z?_&>aeA^`GL0vCI&1fp>1@ln}uD}|&0fX>>?O_ZiK7N~@;=1t+9h&i1wwLW2uAvh8 z9+lud`})6ZA7L>40e8%OVW_y$9e-GZDZz2BBuAFZnOW$b>@0L;B{@6=j-otwp107M zljF+ruUpbAENEz&_eRaOPz>yq!yz%Zl|G;jql`rS^dW&4%F8=R!Mn?J{j*1EPIf^|+j!b8sBiEVd z9PcU}A=8srSm4RgrN0JuISO34o+ioCAUn@nyl$CPYWUTH^sY1(-nM~)|NyeqW8Q95l`vOnqQkicc1o>-XByuQ~l z#hsJm$afXEJz4HdicswEx|myh3$7J<9PusddzXEeUb_xu%W+S36%;3xX8zaP%w%$1 zd4>MIC$|M;II>+i`3@?^yo$!=xV+gOPa#hfJMx)SUZLBWLornwa_jADngz|9;= zXX|0Q1&;ijA_}RsA5a} f&tKh9=D)4{vZQP0L;qTMYgwH+G5+e;6U+Pun`26L delta 10084 zcmbW*c~sZM{>SkTvM7rJ0s?^`E+8tnf{L1`5u^c@V7ZH$xPl6rdeu)|wN7cd;9BmQ z>AfypzveA9ixx3+sod8zQ(N?A-Q(6`zvs)DbAJE+&hMVneay^fzBBK6&&=m5-{nWV zEBAZ57i;@0cKF|*YK{|&;bE#dPEg|i+J$0G>Lr+uBXA!M!=xm~>4kH#5njST^lNOa zjmgyG&<}I4Hs)ix2d4xT_| z3GrB&t0YYhy#y*0ijDO%FoY>Zk7tqdpJ`!nnodgPzbl8Q; zz!40?3mEI=IKSXL>a{XV0ITp3>Km~fD^c%>^bRJ_p4Q>0j7>w0H`}%^M_u#n7^C}t zgn}af5#Pt#xKtfFa#b+969*I5qb~+LYW6Y&HE|s3{m~9JQAgC4_Cy`-f1o}W)Y-gO zYNImQ3TraIlc56UAagstQ7K)Bx_(RX0j{#`D>F^N>rh*?)w&y%!73buCvCk;7nAay zsEqVQ&Z#pLT@JXjltLFT$2o{vK~OixnSu4N5LaUi-o_{leaxh~32G}cF&XeE`1?ItcJcPPEH&BQ19_kPW=9qc{Hlp4p$7Pii`qEGx|Asoei*Pb}<5}#A7hMXxzMX_8&7S9>_OzFE zFxI6$7PZ1TsKdGebvCx60^fzYj{EHMFENn%IqP*)ApgZ0=uev4pj(@Q4ox=tV{cT1 zgHaOxsjKtl*_#4~sm zUm(wOaClD>(66W!+`$A4ddj?-Q&Ab|ftsi{>MZrca2$xfSccm3DcBTOW283m3ko%9 zxPpr87i^9XP?<=5+U$KR980|jbvuq?HZ$dMw3VqPg(g!gQMctS)WnsjOjV&$e+(7y zd3<>PuTw~-;Wp~aCcd}n*b%iyS*Vpw#WZxWF}{o1nu~Z1uVEcL{EWGN-=VHw?Ptw3 zPQ-NT(@+`rpxaUnysosOZKzjnN?-Hl>(1*hj`oeH6@G@ncnEb?&ZExGHB>;iu?fcY zH{bhDpvE7AO8F|(^Mja(xBHWSw%dsvU=JCFP%py>oP|0>Z`kKMF_rpWRK|Wn1r#yR zT(?H3jAWq#%eD3XsFV-0mZG*|>Ol5i1I(l$6f5k5w`|94sDR!_osom6fls6M_Bux4 zO(ffn-yqX(AZjbdpeCA$x;1lAnS2{{wzj#p!wyvBdr$*^f(q<&)ZsaU3h*jwC3jJ0 zq1s@wh3#+*Zb79snzxMt%|tCAAGLtNsDMkX?#mQ(NYA6OwBAPr;yctluY)Yabz&(fB}u3cq@u221}dOzROI=n zGcmwEFGCIZ0&d3zxEQ+(<0|4QY>p+*nX|D9b!PUVGWh*NU0#V4IFQZ*%)x#v<0agH zdVw@8HeVWpvi0+}{w-$FejW2LWwcqyG}Kv|hptZP zS_(QW?^&y`3H6g$9lbbNs{7-4Y=azlCv>d&+&EM}7j@cSMg=zCx&)Px752GTiOEDj z3Hz_p7-<_?U~TH1Py_bF7Wga{;44TnoQtUImQ!l}C|!f~sRxfEi`WWh;&|+ew^47t zcH_;KmSRonv&NJE5DE)vXn^Z61*@Q?y3%D2h^Dv?NT6kXAUaz-%(qVQEn!D3V9nllkrtNh6OlqqT@V`9!y2Q zNyan`^&;J`%BMnPX0UblGtkZ1@tHq62h<9-i z=1%3cj9ak>=KRfk2P{Gz-Vab2^_^zEc9SugdOj*MQ;-F@&MFETIC;A1;G$Bs8Dnt| zhU01MfHyH6lV_NW4MrWd)%Xa$g-Y#57=f2i6W+mSjA6@TFzuoI-&6comxi&Jh;vYT zy93+e1+0S+FPMJKFp7G2Y>h)v0WL*NxCJBeV+_NysD=CoHE!UG=36lx6^t{2f;!GZ zrEHlV;9gWFPGd0sh=KSU#-rcgO<;+r06JNpM!i9cQHQb|^Kd%G;UUz5e?nI&^Pg!Z zXo$KEZLC?S=e@Bdjz?X~^{9aVi3;pP)aQ<(0=$F@;06ZZeOvdLWik_rx_-&C*nfSX zEe-9l8+OC#=!2E`6z)e&6gArn+!*y{OhX0O8GW%Y>XZ*gja!Db&_(rs-MY*^UpJfl zE7EN=D55>K!{^pxw&Mjtt3M}k3v%-3)ls7?*mxkK1 zj;OQnn62m9x?4yglLrGa2Unv4_#X4|cVwYXkJrrr`POGq0~evTW+duxO|k9EP!q1f zK-`QvBk!UP>we_6xXwBI;1^8fLA812&6SMm_zY_A#-N^0!dke}KHq{0xDvJEc_DFV;7o?jK|H?=c5A6s4&+%7wa>>Gm?T1$y{uOn=t{;V-Y^UrZ{+!`8J%3q0~P> zy_k-oGI9;I^4l1Of1++t=wj1e2NggZYHM1es}E#QP{*#QOk|@{)C)CHk!>%-Eb1=y zz|T;Dhc2<1Kuw&6EY^7fbr{dv_UqQ)QJD>1O8%AF*rjH|L{y5~px%I4*awSHE8JtB zA4COu&UziSqW_{6@&^W^*D|w}q4@AtU}M_Tuq6&$M*ej#=hL7M?m`8y2Up-BRE9<_ zHv^7G4fG;v1#>Y1m!tY^M=j{zsLWNO#yy7m+-cMnT*1kB$ECnFIi+uy0e#*y1B9a5 zV=xlmL1o|oD#fQzf2#e29B`+`N)x~`)EjXPmg63b#ulqgpxv#5Q5kb5QP6;{eNcgM z)Hh=c9zaF@9lno0BiVH}uQq=pc3ETo-M z1`7J1-#YWH7KBP=Gt?n$W9^C^sP{yrbS~=pEx-r3%(gFGZvtL{+M>6uJ5d>|#8LR= z!#exlVS`C|cT`FWur&@qUB?C3#fx9VQ7iD({iivdF{oRSiuJGntK&rU$LYw`cV0$aqq5v-iz#EcJdk13yRoI+nA`WNQ9nM->tQ+_CZSTk6?IxC?KLafgnH#BePG^vkL@#W$~CC7@F51{e$-hxi8?!%Z2f1{ zLhqw8=ldbIP1nSqf>Ilc>X3|zJPq@(ldaFi5bBFC0^h=D++&}gz*OoNP#FvQ$OM#* z@zftjjXN9_SP4G-{+~`kDW7efkJ^eiQ7hVjx;{Hm?fX&vkD>xPi`uH6Py^pbov9j? z=33UmXQ(Hk`njmBc&(EBYrqXO=-O;WrSbqOMMqK3kD($zj~e(pRA4`%GWHuPK);Vo zU{R>E&;ZM@501gZn1~slm_Um@am@R+b3A~nT3y+{unTWpF7M0>osEp*GR+^7GEB#ObjX(uH z4s|AG*yoE-YaeLH&nV5uw zFc)9OY&?PfSoe_md=fUGo`P%eDck-l`cS`T>wnt1_hJ2Gmi@0mLDwt~^=-Hkb(r2k zozjm{r}~Wbdu&4eE>_3-M@+p5o~K@jny}ST^SQRDeve}f%tI~s8Oi+401Cr!sO@k7 zgQ$OnI*b=>{Vpm%pD)dTk=TNIJQiS29EoqCu3PX|=8w{1tWW(UK8p8oCbs*U{CB0W zmxA7Wf1&m?{g^paJurlNA5>~bVG6#E`r6%#+T*jBh__HLq{!nYBQ4RJdVkc)2V)qH z#D+NiIQh?|u#SdMyoJrN+6i-LT45>mr%{oAjM@^flV-vw>`T2fzKU;P0X8~iejS^N zsnic!|3LjZ*7USlNT)O8KY|XU&zRJ{i0!E_LJfQbTVwKB^Xu3ER6uXw5DYj++Houv z;yxUN;T(iFupE0}@CEaw)DLxdXQ48B$feMT!Yxe3Iu}i9GEpmf4mI#C)bq!`F_{{N zO6lKGw`C4S<3dcpE%x~l)L}b?I)oQ60I#ABse6lp_UN|la36K8ye^pu0#P3fN43Xd zFeYLwrlX$sLJiyxHSln(iKDR^PC*4a4HfuIq@U}|H3eq@YJw%G)4v8a@K)4-@1ojw zqXw!%1%3oI!PgjwCs2p>GV1fcT7ScE>eViraU!vX?teoHc|1r#eP9|YkXfjSUq?+; zVe3m#{Z^p*ZLsxi)?KKS??VOlDJq~URDh>Z3;7No-v3`HXu!MHzfh^G{;iof0(B^( zu^aY61-8^aUxC_^HK>8#K?U{!K7v)KfWEbUkILYGu(vwirl0};vie*x9sE&&g`oB< z3e_*cnur>xDXL#9ThF-Sc{TBQzl5Ulk)J59YXlVJ!Ne^rFib{snn^-ckq^!JX z%otC6N{ayBtVz$6lzV=Ab83Lcr|YUf&$B!Hf<5o`kM{HQADZtIR#Y;&tlsd_3H8QJ zoG^4mQQ63n;)=?XZ7Mbw&-JVyvEJLWY0OGL&&;w~p`Nv~D!e?MUK$nn|DXEt@c;9y nk5=<|zV`KD>K;L!E?2gARji$rSJC6@%!=HXqCK~+CVTx4JqZ^& diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-es_ES.mo b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-es_ES.mo index dbcaa7ba5ec26a6e0d11cf16f46ea8ad32b2ccbb..e10ef71aa02158461e55b43881f21c6790851396 100755 GIT binary patch delta 11010 zcmd7Yd3ep&zQ^$&2_l0;5JQknWH3Y!LqpM^sIfKHY?GZqlfB8_K~%fj#?XTzNL8t! zYN(me;Gk|%I#8uYaa0FGZ&h1WL*3KXeSflkz2`Z9-RHT_z0Y&cKd-gcZ~fNrUElSS zq-W99fUmy~@L!G$EVlSxW_io1i-W4EW?A#%|7jYQn1WxEI)Q(uV{@dQTVC)n1q{MI)VcGFOsUSseS#$xj(wBY~@#T=}R1sIHlr~&6= zB`n4ue8aAd*YvAPNCAyoL2~BgWuy)WF|jIR0cme`vSY zZ)PTp#}J+;V+3}<>evTspwn)jf&|Zc8Iy23R%d?e3kurVZPdYmj+5kt+*R% z$3syI8;xx+!>+GDE%Yr6!`-NH-$O0%W8}1~^H>Y5=EOe~Yg16ic+?JBpa;`X6Yj*7 zxEFii&}5>9t56ZUgKuNC7G|LbF`D{mY=}2exfR~hvRYv?Y=C205`QO!7il1>))l0$ z6;7|J_!vgv0IY)9sGUzm<>?C;h)eADWf)0)4JsFQ+wBKY{f?m`@gaucxmLtq6J50* z+{4GImrt>*-q;hh@+DXn39LqaFD}B5F&M|RHtiE^pGQS@5h}8)P!qn55m<_f&ScG!snRfoQ)m5#QZfZEYy)K2^ujx$haxdgS4t(b^=kziV1qpoE&?wa09MUCGH zSD?Q?1%>n`YQQ_Ffdbo^9fV^I>UB~5TA_B-9u>K6sDX!|-W!3Dn1NHV0GHrxR77S! zV%}eZwEL}<6l(GyCDlZrH!8%#v2Hm&I=F!P-1cSx(H$(S4)s{{VJEDOC8&j-w7r6g z*aOsf=U3TgObCh4l?p>9D>of1#966ROr7(9nF1gjFDU=PS<)AlQ17O?php(rH>PToqb4m^JR*~hSYmw zd30l6oP^|$^)6=OeVmA6dYB_PjTNZhzyiF5TG)i1Cgg>v+q4#yoZC?gey=C-SHpQ4 z;_!QPVAUt=Y)6HxJr-j()U~>ZdKLv%h2#LB?jLq;o24V%aABw@YHL)J`MyMTj!C)ML6)^)VVJ_-==G)I_V+i#{ zsB6B`uKTx9(2DkB5S~W9Mb-sWGF9nkB2W*t&;-;(O;HoIvg_?pXP<_eXr$eqW!F8n z&th$!&qg-rx7JXIqG3I1rw466#1qs%$Mv|HIA6maPZDNKdde(lA8G>!u>qdNx_B2A znaBYqlJ!tI)ex&=99GbwwWpx7e+-*q1}Z5RVHj>gEo?6)<1thu?qYL%fVr4RO6#_~ zianUA#vl`^QA13m(owf22bHWZV~CPwJ_UvTb<~R2q9)#kjqw0#N7qsP0*0C+3Pt5e z8n(gin26I+N3#yE<5rBqB~P1cxEXZ~FQ9)gg&!!i#je9l$fsdT)rXrM<)c2ucTiu% zsw2%OG#8Z%^H52(7%Ssitb$un3p#*J@ESJ6h*4(zlu^WAA$QTB4n-J`2asd8u3%Y` zjW+*kwMU(GZ&VUFQO}=69YrB3V!Kcax`euRH&OjU$C!mxN7ZA;5PyZdDGjnMD#U51 z0eWFo9B#Mgp!(&b{uzA%byP*D9j`*2?KZ51yOHQyCsF<4#+su@LCw?4PeIpaAS#q@ zRC48`IuxK*`Vwm3IjDs#L|wDhs0D68E$k2~7d}8QKExdKI!$E1LM^n?II{tN6a}p; z0kz^bw*62^l8I#@#`@F?QCa*ZYC(rkXMPlwjHj>Xx!5|(d{ExRNb04iNPUQ1@jKLllCsVC zU2!J$@tDs1)^`+=u-^o;{ z8u$}z zfuAE^Un^)Lzcb({)HOVg%x%R?G9RM(lZbyO8g|l9h_|o{`tr;du@sfXKcfE8XvUoi z!!(S*{-{uo#Uz}8^>7#J%ui!HUPpbf!h9xD2^c_qfS-bPIs~iX7;J=I?2E6VLVq2T z@mExmCgz)8(R!jbuorbS_fZp8naoEE+u$5rh=VYC3X|eQY>xgTcHuTwEyq8hQ_W6N z3d|0i7)i$|n2K{y10Tf{jG4yIcQ_DK)}csl>k;RNih`(NQX z^N+++sBE5w3h8?ohu5(&hCXj1(-yU(5vYN$qnabu7jXxCz_hb?k)o zUQo_a8A+iI4dXBdpTipX2I?qEur{8@XuNG(;kW@q zuoShyBdCR4LBB%u9~5Nx40GKYp^~yCYJm3G4|`#KT!z}wUR31Hq5A!dx)tSS8Y5B9 zV^It5gu12^Q460sllbe!c{J$76{wYNMcw;-7>w`R^-oa?yNrs|x2Ws*5cOWzER&?Q zu`Bg~7>G+z^Q=IPy9F!bzFC~VR(OPl3V0cn?N?C)-p48!Fx$KkX>ju8t@5YJG|7f5rADGQQusOF=9C4HGf4$aL(0+EF*u0{dV% z4n<{oChA%iVg$Z{$+!*mWxI^JZefeec<~rZJsFkk1F`J)|17&<25P6vP&-|RX}Alu zfIFyMd5D_0&SEogYt(xkF$JGM-Hzu_6D>zAe1}~>jCs`mhC$??)pH4dv%{xwFy6yK z*r(Wh0oPzD_2XCr{jZvwD8@MI2T&7!gZi@RuNP|Xj9KWy)_4kgV8CnU_Vh--LNuO2 zHJpyx=|WUUm!q!F7F0xbVof}R>UR#c^RH34@&oF&+`;M?u*^iN7HYg!*c-c|uIGYf zoPSdaXK7G!Jj5srdfog9CI&TNDQf5M+g`%5PciBqS6ObZUoF%`@mL4j;WQjzx1U69 z^fGEgx0e%toy|iUl-1!Y%uZ^cc3Kx3VQbWmhhZwFV+UMmdl8kaQE!+9)W_4*lTjPf zpHHhoWz@vc7>0>{3Yw@bY61Q14ueoHIPG>XY5@hP9n3(T?Q6Il%dIkz+KHOrFqYy; zRMyX2Z64G;+=w3s<8CD54#I&_$;&fERrlNNCGU{lG zP)WD}9eB*HUq>xGkPQC~n+cX;1L~WxHlD-){1zSfJwA=0 z8}v5Wjf&hgtgGj!g#~Rik*JEwq59Yslduw|V?~XSL!m=Ce&i}^Ae?WTXH-&In@l90#Wqyu+Vy|KAnKoDcf5#Qu)${jC1sv;jG?}23%^}!2k%nQ4m)k- z@4MIqwUd3QEIx-if}gPwR^MjMG!;{*kHRD@LPhLd9D^57*D#d?X@>o<6+VmQaU1#v zP}oT!6$5veUlu!|7Pc8X} zMx#-=F&D>T5w^kGs0AdJvdt(8Ex0QY*aNk*r%|Dwj={JTb*69HZpLcVccXTG0;}TZ z7>?iB^#`b<3)ySNX^zT;RIHBE{S+!wD8c|-jumkgYK7}n@1Q39#BRTgTKIL; z#P?APue8sM(-50bZ;T;02=)G0{0aRY3Pi&iv!4OT&Zxig;}`Y#115BzVQuOcu{qws zIE+1LBJu=k0|QV=H4#VKYpj-WrtyS*WC2it4`+wa}wj6F)-TmMf@a zyNSX053Gz8KQ`GP@iFn&&f;j$gGW&>bVp4v7(+1wbzQtz0bj@_;XMZT7seY+DYQCj_YX9ig%#y@jldqAEC1OD-6SX*b)Oz@gFU*El$O~ z7>_MKG4DT(wWv=(y(3Z9+N#L#Pi!C8G=b-~?0> zm7*rTi%(+RPtBJ!7j+~7XG~;*u|DgZI&;3pcI)bb}8&DI@LM?0&Do0jfIBq}< zP>MRLzoT||1OJZJS^B~yd<&<4WhP zg?JHm#V=9G6MNA_A_*1pHpr*L8i`JfVf#wX7g7CZV>A|_j&3Us!Cg2OD_mWhkxW6omxfB}0jPzIz~|738s|&& z*Q0QQf(-i7geD$qQ%^yyyf2mwgu|(iz`^(qF2~TX*d=bndD#AI6Y}Hu2=!m_Ft+^0 zd`WNP6VxBO!ufZkFz1Td@d>O+{XAC1TNsVyubKhtqaxKG)jk31<1CEDb=Vj`!1DMD zDtYgrBKik5!7A5?3Z`E3o1~gYgF?C*HSh_XgjcZ(4!Ld?whS9l--(%c4%cF*Z%stL zK@I%KzniR|i>;_1M*Vf|7gY9FxM7mEou7hs+6&v_NYpJ@jP0=e_a@8R<9zDVF&9H_ zn!l75U^ey3I39ccVE(TdTd+U%AwQapt;aO#r!WyCeln5sr&5Tg;c0Aue%y|0a2P&C zhPA-WSOqU(Fn*5}@gBzD@2GL={cN(o8wOGDXV-_?Ix&#;XD~qbf1>@sXZt*c(BWmf zzQlGV>XW4LdKycc4GxBL=Es4)IBf4P+X1)xY2GuZF>=Qo35hz{egNvBirlnzIJ1NI7{MRDlQk~ndr;*xScsA`wLUbhqg>=(JHA$ilaqp`!*#HW`+m< zcZtwqVR&dn*ZjOZmhB*%CMO21s1w?z`~M&*TqU_18;6DWDa#+19fZy$#e00U{{Ljh z;_z{aCCyJoRaiXd?CZ&c$iBG$?KEll*?0fSkj0wSC2qT+H@5Zn+@#H37Af<_TXb4hbSL_iS~RMOOIf@xNk;9jG- zWNDV>&0H&&O3gCTw9+uq)Jh%9vBjmC|NF!FJRDDZ3=L7uvi#cqzbO>`sTX1<=HW*;9;2fzYcRfuQFsx3v3`s(7~4^A zf%P#RgE14kS(eipN8x=MR^u2Pz}s!`U2KA<&<}5*H{L}bbZ>7uY=~ae!>|E1x9e@~ zdMx&$JqgqCY19M`VJ72S-%xO;A+iIr#29ReX{e5KF#wC~=T5tQEo#8c=!@Gi5cgv! zet}_FW4Hf_1kGyD(Xu*WXAEV0YZL{otQhseY;1@d^#blh&G;xPgy&EbtHDJ4#jdxc zS4}h;{V@sEZz}p?CbB!$NNkK{==7uT8U?+$1+@Yf7U3tT0lUUp)>=%)G(3k-VC&8% zVx_o+`U=!Ud&OB+1P;d5ScJ;03QWN5*a|Pj5&tX-9`Tk%bgT);GphoF@CY`-GpLB% zK&|{fDo@?%%>%h(fOYU?!$gUx5Aa1Zw8t zUF=Ap22REb%tRl&WVhe6b?a)9HVhTn)~EqHVj%WFMW~;X!jlwoQ7b%TzfgsmX^rho z)Qaw+R#K0R4?r)}UWTJ45{EIEj0DLVk2;nsP@g-1n!q7^4V|YbD0D>}Ms-+<>S!S< zH!3g;*P-6qg<8>vsK^~fb^JZ*a~Cief5E5m0WQPoNv1!a?&kC1NW0T&MIoFQK0rm_ zB!*x$HgmJA-|%JX4SSdgti`6(H{&!sgt{lXC7X#3w4H#8*lbjP3+(pQsAIkzBXs^x zQqatQ#l84DuG9+;b5t=+F384;3&S8QU6)3TXxE_^rhM;##}?U%kwPH=wrY9ov1V2p+|Wc-F3`q?nKo zL`7r-lBZTSI!SPAC503>%laI(0>3_%H5VPIm94`exDg}pE;h!nz9!_cs4eM>?QjgT zYu59~6=EGm^?M5kqerUQ^5Ln(KbnRqH0YvOg?tZL`!NGQLh{D)dyEr;eQ^qILxsM1 znh9+Z&ZPbbYGS*wC03zM(JfR`K0qaNK)R_%r8~{>=uU%!2cyvoov18dh|6&)>NrI| zZdtMTBxd3wqzmgiBzV^Ff0&7^LA@W!C8CKuh8lPRX5nm9WG^@=^rmnLxyG%i{$}q7 zq4su|?RacXeJW~&FQbz7EmV%UP!r#WI+lm+=ii_&^&f4oqbBkvHbAF8aqdc?5h{85 zp*M~|&2T(wfIQRyMRvUuwdZqD1FW{&->~c3Z1J#+93)l!Rqo0Cz&lD`L0hV=) z2cftbtMLk!6XzFj;y^Q@KTs>UhpjO1pXQ2AKt&`IHP8rDE{(xZ9EYA*icvTRJ81JZ zQqTqT75d{fWMky(~zOqP}$63^gzILT%CGsFlsdL@dJ?+>6?pOL!H3#YXt`FmwEV zMjgLK!_6^nkKL%xL#IN%n?k%AxVE&Sov5ofeuTLJ2XGCxpnWT9g~u@ft5CUe5gX#K zs0rQ0_SpIP2@;??4NdhEGkFxY)eKHf9=Iw8q~o;48oPD_AT~{J5dw*5Vch& zQ62w)+S}{c7=J^eZTXBb?~Oxk#S~P33sI-$6;veOc2dwW+iAb>0cz$SqdGo{n%I}9 zfUz5jCOvs6BTZXOhtuHBcaOr&vii0n4#2GN_6FX8Sj4BHr0`&z)9N3R;N+6_O69 z4zSWF^I&6c{*c&r&BBtRU^hSNDs{^juVcL}wnO{Nlme+scvO%gqf3T*~;qII0Kzp$#Mz`nF}?*Nesjbwzc+iouzo%BT&aO1GTatsL$o2J~tCJ!NsTvtUw>! zXxHCGMP`2)`>*47ng)HK1|Pzk*axG_%{?#)HNX^9hx5=IUqVfMCF;W2iOTLhsQyl1 zL;M!?{#Dys_Vat?#9tlOUtsQm5Y&sUY&)PjN<_VvVmknLx%1Nz4y8TldGZ7Ekh{gY zh54ApSye8bKt=90DngMjnEn!-6ryS9jSA^RRPq#~BC!Y$;$fVGWiOiCs6{1H$V(=) zaj1@yQMu9|>*Hwj#T?WErlKd#MO{?Ratd0(OE?05LM7d!OU%_e5?QF_LVaMj?LpK4 z$59imLY@1o_Va+3&4L=E_TGWo!VakZlaXWSw1!d8%%@^!oR6`%6Lq|5Py^q?PU!xM z$?|wqM~~U{aj2D+qE=dlDfkL%0;f>9QjI$Qe_;d0w}O|N4@RKQaWv{wj6@x$nHYde z?D|?PrtU&btZfBH5j*1${04P3x34reo)dRde*+b%QOitDlwg$3{~8J!@F4cY3wnUf zmzzJe_Q9^yw_zIAppH+w6(&L{7(#snYNdr3h%?ax7o#HbGU{`$q27BRoeJ5<6ttHo zupyqpP^>|P>JLlf7ajppZZ(A%B*~o?LO4jRjnfa z-V|=o;E#Wx2J%>K_9_f#QIA8lzl~by0o01BP+L=t%Ice_h5QG@@g7EE@EWt?Bz%Z^ zZ%oG7Yly!JduY({yMr3&0al^^t7c^vFo^m!)WCO96R!W787LGrfsUx>38+XsYPSzX zh5RYh0&+1ApK(&yPT?n1sFwZ9bg&V3Q{RDYFmJ6H@I`D)eGPVUBMI>p>NV@kM2lZH zk$VO?$<_*Njgjlkz-g$6jYMska}tFx3e!+YxELMymR&!Nn)x-X#@o0Tt2UUwbS&P; z-}b0`a0IlnS=b7fU=!Sdx<5Wg2cE>?Sc?STX{EnmLU#^oxuA@SE2NfB&&F1?) z5VcilsJ+g_WH&A`yI%38Nv_qXE!&0a=P0V5Z*Ue~#sE!W^jjt*g{Xn&;$yfFd*ey$ z!2m&9%-3!It>(An0@TW`;|#1tEnvdiW(&$tpUdRSAl^Z(%yX9seLM7_ z-WRo{nYP0*gnAZg;nQ~!uOJHLG{_aGJ$nn)!3k6joW)RV@`3sJAQs)JcSj}R!>Eb% zvF(RCrh`!f71-_1pe9^~0l3Ubp(%w;sE$5Hh4M4>#otgJ{EfBf$E85gdVm2WrE3pi zrhbGosfbP8XSS{sW2rC2C_IRY#8uRdTZ{G3d6z;Mg$Jk!1n)P;tO@p{J`fd=m(d@0 z+8)GY>L*c=@Ht?Tsv*v%-W|(u7w%%Dhdwk5s{PpXb00Ys-2Vs7w^S@@54&J64#P$` z(XKy>Nz|8N2mAuH;=iyj{ue#4&mr@xRyyjv6{tua#uzsyj1koTJgna-+5eCuW}v>9 z$AghL06)Qt81jk9-aA-MJ>gTboQ`&5KJ^=)ne#pLsEOb+sEN-L8v9P)+v5$xm_#9tl!PJ_;?*O#UP2kJ)bh6?QycD)ESk(V$5*Ptf+ zB`Tz~=!<`#lCj=NGmsY!q#ldQ(TRFL%=wiGMKf$cLmaljOwq}7stU^s> z6DlX(!vNfi`uuThh&QqBc;k8M!ByO%_;1{V&Lv-)JG;v%vywbi$QGkQeE|LOC>G)w zOvS#Z$!uJV+RMmqjNQ>ey+5YlWDLgb7>S2bpSy;WbpD?`WB#^t6BV)+XU)pmppqvJ zn_)MM!NJ%cXJa2cj^611t%*c9wx!+@IpWr1sD8Y^Gw%hUPC*m&(D_fKFqDQKI2M;; zDBecxz1R09gsm}vdUsT|r(-NWiHg)BjK)g5h5J!kuA(^*s~e?@g1e2H&1jK$vgI)>wAR8rl?Ty$LKvcg5E zNOb(k^gAEBQa^(U=yQbyxpA#uA^ytt%&R6#pGB>78Fs_XsI0HXBZs~UN>1i0u{P4Y>OMP6&}a!cpaa_ zS8tfm|Bgzowl_`ABw~H)y|5*wq58>1Z(M@Pl~s0qy{+?Y3LZSzh3>e|e(;g)G4!SV zlwH4I`!m*^64XFm|2BIYiyE*Ss^4Cy##S{r@2fdNIv* z0IGu_dI3kH1}?yUI0Z-J0o3Orelxk#8nyBi)Px40LO&dJ1y4tvrbVdFZNi}%=xw{< zebkEfqe6WIHG!|}_G;TJs19x-duZLU{h$5Z=eBEc+tT{2vZm!16?Sxt&&kT3mOrDe z=Ey1>@0ebgUsy6NtDwNuvQwOoXX=cc!fCE2l4kk1JbG{Nb$yW0GR!qLJJTa1t8h|@ zV?t4}W6Jd6?7Xa!{KDMIzlyt7zLWc+>&?84?yhYGed@b9l{5@;^((J*b6s1IP|q)} zQ#}8=IpVta=<14E6yOt+m7RaYRX33mGn2ZyV?l{WuN!%$9$ueTOb=Nljw#GFyJ+&1 z;;dpm+{!U9t2oP%GkHqRtgPaWj+~P0;{0(rj%m{!*#%iMax_Fies)eFpY2f@fA&>Z ek8iKJyUNacHEBVIh0UBDpi7%&>?gPO(_R*k{nEOAO#4DhayFKi;5yu zRJs~4fFcMAT%-w#z*SH{6vPXHTtpq2?=NdRGxx7~o_S`T@t@CHYp=b^yWX{P@X8N9 zYwq}XFNOIQS^Sq#*0O5ipvtOQ)`ABAX)?uy)N}9@W@5XBmX(HY;y?^)WLZ%-8Ut~* z?J{gkeKq>wQ4GUV*wV7R))fjnX$Ys+C_IVvFfN)l9DqTXg%z+618^p4z(wefMOYqR zv+Hlz_3hY!_7d!lzoHh9+{Ci_GQTy5f)5R^V{Lp3Bk>4o;O{X6Z`;ow+3mGs%!Cav zkmvCjifyn8_QI;@wA&{k!L#OKEbhQ6%x`^7K|8yP+W8+?5gqi>K=G&*cSh}a2x?&? zu?42v^;M{azK+4T6E*HZ)B=wqr)8bT>S)Cg{~!#fppFetJ4iqeCZi^N2Up{6?1n?) zi5jj!MeG;cgq0J_Lib?=_0w1vZ=rH4B+;^(Vhq;7QHjLgNntt-MAf>A^tD3hRS7#_ zH5`By(T&>qWK^C`Ltk8Bx39!7>g!Osu+whehwAqUDiX&q7|%5&{+j5T{otS2g?ia$ zmX(6tQ7d18rIEnO)OX`DJdOc4s<~+&XZsu~vdd7BU4xo%6NX|5DnduS6oyf_hT35} z4pbd_qgFc7b{uL)6Hz1t{xEl$k^)2dJR_3nhz1FDl+u05WGuuLco!9sIggw7S0L?P zYc++(c+jl1i9iY}#KW;>89q9=nEL!Avw(;;mQ{m#J>oLg`Tjzii+4n)Ocl| zFwd)@k~Rh-bpKN*XyqBW2XpZyb!f|O@MBCzM?1?ZhjUP8xezt+tElhCF4RPOa2TFI zC3nO2=Dim%lKNs)BzIu2mqLjO_zALD>ntjyAstN8Rlz^0N1)nkB%1|CqCy&N+X|IK zopBrvwCf)tX<(f|9i2}{6PaN2lE79q3M9VO6O+qW)>PC^_II+Z=kP3QhXXoWRw@q0 z2;7R*@hB?v-=dD@0XD`kt`etfJ%O=UfEsrL4#bi!#9wD0*wuWQ>S0~#DOeVBus2RX z^2geb8TbIlNl|v@1PbouDc2OOw?`KfJ)9Cs0APFPW;tyo`xv=5gk~m zhn?-HkR@Rec1B&Ri^#{&3hJppA{-kslrVE_y@gZvB@Lnc2;=L3U z+NDU;ts;!U^XQA^*nSWO*gl4}sMkmBupseqwpM!zam!YotYP;^; zPC+Z$i{}QzB5@z%@F8YnBT`zoMg>gO}W98nM|N0PAxcEv{c zEb3@B;&t4H)o{g7a}BqkuHgmrrc(HcLQCv4%!GUjCaON%?5F_sDgFiZMXdCc`GjVp za$x}~sg`2}+<+Bv8)`uxU^IS*bun~=8Nb;G;;)dqXi$fx*Z@C3j@`P7rAao@{MAZA zoplN-iJYkC&!CQCCMsg@q89WO>e}5x^$Qwh7FGpSuQ!VLE96aRkS$RmPDTyT6D#3x zyFClluK@LDbQzcLwc-}G zeNah~fu$kF+SF&FvUojeK_8;d{9{xyp2S{w7Tcm@teJQus(luw;~C_Auhlxu?4-SI z3M#ZiP!nXLc9w&RP$6pP(@@uP0cwFOQ5#u@%8?!R^G{IYoxvS=6^n4Wi>s>p-Kf%>Bn!<`DoWDLc= zs8El_SbQF9;k&3aKaCCWI_iTJoNpr45Phf*@KVrD2V-R%h4nEHd*jQf&|k-R{1ug? zjS9>^(Ym8Hup4zW4^R_UoXAHDTi`rgf`c$(5|iS1j6?4syKomPmElk5WV4fIg=Pm% z45Q;DY>o3!1AmOoFmejN?{FXzb!!Q7^*K9k3XH{6+=-(w;936A;W$ju{VzAw{E_I7 z%H}DkkRHS+ypD}A=s6RamZ%*)i5mDi>iH8Kr6QG%HE}Xl!6Iyfo3SNc$97n2nsScH zQxs~@Fa{%WDptkUP)AXW;dmY+@UCse>E^7XQ6cY+x&WJcG6H1}cgDXPC%2 zu=L;mgD7Z1H$H}5R4%-P+Q}Bwz(+9=@1YhFMaHUMGAd%JsP;lsB#JNu-^4&HL2d95 zYGGH=s}TK0L54hUu3LRnQYNAXNWwnY6Kms2)Q)zeB6kke?`PDlC^O3#hI(EPweWVR zYdRja@X51?zg}EGgI-*PTIn{_z2AcYc-XFghFaJqRHVK~UB^eL_kw4eBn`(-)CZz3 zzJ!`*6>8kASONFU=KQt7Lo}4bOQ>wWh8pkzRz#mU=7liZnyBXuPy;qaEu_8uytnNT zR6i%GU$*TO-08!wU@wJC9y~GMe3>?)>Qxq)FX2?IOZ^Jg!Ey^tq#B|IejF39GipZ# zsI&K?vV18X$J00lUt45yN&lo)E_j54d0}jR@9D{!7v7b-0pHD}B+85dup_}?^ zI2`?#n1RRO5b86KjanD6^yqBAN5=PBcPJ?24^T-Ju+&V@$Tk7Bz{gRyq!Vi8!>}~l zQSTRFBEDsN(QXe~X2y%edOUB4A((ss9%?HPgvDBBKa^pknir?7vhA;6kquv9X;1L{(_fV1O^)m6-7il~No%su>P``+p zXdUYM>_Y8yFNWb^)LC9YMd}Kw-%V7%+o&D?j{05%tTf{_#xB&`VqcuOlK5+7XKBzt zkFYxWzhYS*p#!zBD_9M0V-@s!)tr3<>b+K|qiK&?ct6xQX_$jkQ47C?5%|ciN30_L zT5;Sev!f)`cc2sMg&tTRpF%}uI>zGyY>FRXYrKt$K;zfU0^*P+t0QWGmr)z|9u=8C zF&KlrtIbLyPy;ka?YK2o!mf7vP}D+4payc|WSoX?;6v2FYuA|Xzz!shtUcHO`>Zt! zE5I7mU%(D!IRDov(8v02or%D#^`^rjB-+*{R0KM2FiGY{4KN=S@;6W+EkR}XS&YIP zSQkTHH#=>Ld#HE7{rDT^>HhECXnsb=u?>ZO6)H6AF&y7UA3TOS+mo1vS8yhFd(&Lo zPcer28C1w0p(5h{mKmoSD(MnX&!?fE?*Cj0g9yc9`@uEtnig;iwZq>~M-sT%ETB3n z^f9O-+K4T%1a(9|VR?LrDOh%k$(24hgn6c8B<&ZrGAHv}4=HGeFKpv{aUs^hA2Aw( zx0}#DjK2)=}g_zvnwu3}mAdz<+8qfmiD8yt=k z@I{=9<=-(s&6c7Aq&^6BrejerW?>lSV*t*<5L{-v-u7Lr zN&7+c!^_wnuVXAW@Ny>VjQ1~rizHSq-0*-gPJ_!_F;yBLmpPzyba_3#R6 zJiooBe*kKMk*Em8W4SU!whM)GG^D)GYG|nY0l!SB_t<9^@F!|OzYk65qtQWqG-~J5 zQ43vwns5cy#+NY=ORyy#!glx@Dk81-m)948lJT-_<^k?J z>H9Nkg4T!3`(02;mWuk0JcByg=~x+GMn!HbDpDU|E8YLo6l&8@{$q0#4Nnnv5q?o)jiYRi`K?q6BN)i< zZ|1L6+A(vD&Z3`QL?zoJ)Q2eSQ?s*3RPMAyMWO@xU@ufo^h5O@hl;=?yFMR>Q-2w~ z+TlG4+R^XW7=w*^KVhHv9s0E(F z1pEngeQSSa7L<&dcchnscAkw2WdSOAR-hKN0|Rjv`r=2}3lC#ktbE4&jp&b0Qhydb zcph~m-Orl$`=U1RB$h@BHNJNS1)bGg)C{3dFF#Tbh3V;mkwh4^=@gT9}e z??wYGrv7)_fs4N|k!gRljVW%(6?}CT;81;Z5QfR=8;XxjhH9!S_+QbP)Y@|G%UVNyBB-&K{u?f#a~?iur(jgX-7!s`kt zdX4zErQzRbsD*95GZ7eum8s`qL!6B|^X;hX_yy|Bf5d3?xo)mi9IBpzJ~$B-i7BY; zpNTr+r8pK3=zj)j!1~{t6(?bB>QCb~oQGZU@gGdP7j=(U<6`^>=VAXF=11vQIEH%i zP4gvv9d&dkQU7=CPmHA=ddqCIotHv28it@Ek%Ld;R&0sYf8wV%_QiBufs62WoP_iK zVSekCy>05_a0~5MP|3FFj`>^i1NNgH{Il7}NQ|QHok}5=!Uk-FpW!_G4Ts>YyQckX z)c3&eo-qvlsMp4N7=_W;1A{Ril`}K2A}+wn_$unX9mo-Rt@rGPy{H#HLcQ=Q`r}2r z{R%4dx3CF@{9>NB!2s%=Py_ctMKl$CG0SeBU^^Mh)9%I6`#+b0l4%Ks;9I2+_`h2i zME!vM`~+%(?@-Bg3(MjiRKI(u>uTLM{c70OLA5tRZLA||!Tm8r_x~vh6EMqua0wOa z8>k)JM@{&fUH=mm8J~Zehy`Lf>Qzzg5q7;EYJrV06k}}LqK>E!mj3_$rzmJ=V^E=S zqXx=Fb)14)z+7yN3($>+QST)@FxR&gYG7tL=($q`919^W77j`L47W zhbPxjkmJtD%XemFxzdW)$0P)l8<_9RFDU-9<&=PCxh_|>yCBcu&U1JQavfRjv96pv zcTR@GnUm(o^Q7lba^|`m1>@5gEzjY~$#CZs_etIu=&$UvJ9C^FuF{vsdUEn}Jz0A6*SIc6t}EM<@5(B4r006F9r>9qM{1rc*U{OTmpR7c z%uS24273Nuuv}L`o~yKzS(eK&Dbtlx+7MN`;vA17%afDgs*vj_-LWgKIAqKK-{qUr z=S3&h&vQ(2XJt9YyK>#0H1}BcU+Bnlv8|}4Jj?euqMBj4XL)j;TEr~NJ<*k07*o3T zzveUB$#&)B7sqC7_8H~KbY+cq5H5CBFeb~Dm+A53^G2a#Jlo32cRRC)qyob#o%w{L z(BaH=vy0OGdf0HTV|-QtQPjau&2~8mR5}yp=fxF&KCY`@1y|Ns56$_W<@xE&i^C^` zRI2E9X5@JC^4(({oP)Et!Hl9ZLOaemR$_y0Ug-nwwxKVZnerpZg+ g)(H(s``0{KUh?yw75+*SYx$=$!;4SeT~X%W0WxTEMF0Q* delta 10167 zcmYk>30RfYzQ^%bnKz(_AWp~zMHB_mR2+(&#Y~|baL5#yL;z^l)7W z_MB_+&)|xdRU1R9s%BXM_5aWI6a%T}V+sz#U6_e6F_zT}-^FOWg#PH=z!;1Tsn^&`_@tQDOs(z^)o*9?#}s6Btbte^C!;HX!Y35;;%d|k+*pA7Q3E!Qx2(n37Q5mv*c+pon2e3V z)zs&q0&SOIS+%eiMqvSJZ_UPLxE>?%N&@*$r{LMtvdE5=jXbkvV-?(o)$m7DM((0! z{us4SJ?PC7!%*$DF&OKimL}0|Z-;s>8I_417>NCwk^d?ba_k3Vu`~6l*c}g}A`g4U z&ID@Uwm2J8(1BO%_ItJ!nww1h7Y@pF$35hI{N6j-w*IYKSu^9KD?unLdO`xf^*{F=Yf$DFn-To2kn6JlLI{!y0 zDDvC59UtI)z3?nY1-m}S#>8dlg^nb%mO-e2>!9wBR;YoVMJ;J6YICnaeJmWK)k$cA4YRiUubSUPT{tp?3LOI2UK3j#ErG z%ZkVTn1a)hF07xCov-U5e z);7&H6T_*GLd|d{YSXSl?GZOB@ExdQxz~Pv3jL{Hw7r80NC!hxS$ZlU@*T1waMJ?5S^u!BT4gZA!O5P(=uzY%2)7WOfj`V@6qR-*>~7L}>P zsMP<24sD)G6g2Q1Y={q0UpjUBnit!lmZ%$QW)rXlPR0hf9kn!9@H*bcYWPE%Ies@$ z$FEvHbBtrLCH0BuQp&ecXsQOTEzM{X>gsJez}$d6xd!Xdz6LeJe_~}kj@m1iuoB)z z1@sVOG3pg_tb3sPABm0dGt~2=uaN)x6duyRa$C+p_9nw1>SHhzr=vE}V*7b1YAL=! zW$ZUpKs8=9$E_hMBi&Gey=2#ip!Ucx+oD&=zt&;`4eH=6tb+4V?W^qVldE!3&`0F}uvToiQ7HrX$1MMb_F)$svTU`J4! z=R7LFTd0{lM(qXfA(mBy&te{KKxH36<#U@yoW%kBrs6De69XkJa%L`nI z$Ud|x5`Hoc#%Z_;b%8X=F<%;;P?<@?j#z>UXa`2%ah!@}$kPuZ6IIu1T;ZkgFxBrN`AI{qKOLqM_cBcIf_Qa+m z%tR)lOPgs91?|!msLk@V?O}|i{tNn`7duP!Ks<-7Q16GnW}eqW?efN`KwH?hMP;JB z{d^^AY1h9-{8t^BdEBY(PEfA7=CBpfb81qwyp*#D_>`TvpvT%#4z; zk6u8%&~Us-RWGbfJqxvFldvt$N3G>aRK^?=%%QSY6`>i7pLbAc00fbCHO_Qf#F!>Tw1HIW6V zez#y#K5Jc~Pz!_KG%v=ZQq}?0o{icxldv*=i2k@7BX9#Mu;Zu<-LQRvI%ZWSnN3*- zds2_VI#_}(&15bGrOb^Q;3x*+1>4{3=Q>MGX|IJkmOW52>x24SF6wh*Q31Y<3Sb^O zaG70Shsw-XlUaWqzmqiR1DCNi-ouUZk?kz4o>}akB?M9pNzAgJzfuXe_FJ z6EpE8&T15H#YjAZ%Fts}zX7gy%*|FEHE=i7TKB>v%);++IS$29@0!hX3bposqXQ$} zGabfa0QHvWjU7?XU$CF|K`mXntt*#8E)An_0G>s4-12>Mwf03OYOO1^&ThYi>hRwfhmWx`HvGWs z_SUHL+!GbhFx2}6*a64b^&J>QeJ|=5odq-0^5k{=RE30yoP)5DJrmU7MKg_2!>FD=Az=bv$j6xd-MV+rV0a^|AS46WBnkNxcBuRp5%nCDae|AFb(#rRI4t zGAC;$Dg&{fnmv|+`ur#iLf5+#YEf8(p|~BR@fhmndVrc~_0P;-$Liy5>X)zxmo78E z4Tmf@sh@;;e>y4y^HBH42Gr7S#!NhjlXd>%R+w|U5gYTM6qWL8sEpi0b@T+a>8g<~ zJvJjK=-g1aG4c*4$_|X%uo7S&dPd+Ka960rtTro6P2%iY=%| zyZIXe4#cMDy_x(wDYV*bQq><*s289o?#3eAk3IC>78AfU)G>M=tKbS$fZMP(-azdg z&#h)jtD*w0jlozC9hkV4{8y&Xfd=_9s)M1Z&E>-9aT>#{#IfO-aCX&)Hjr79Er+AW7K%A<`lF$TcJOuVN1-wBwUEK@eBsx zpQylmcA7s*g`qln5#uoxwFzCezPs4S?AlqV{?B}4K7S3_TQ2JX1uq`d+GEx<601^g zh04T>s8pq6B924_yb84x2QU?XK+P;_ulf3oMQt({D)5b1wE`JKZSvFm^qlp-PeE5= zz5V9v^?6hV7T|3>hHY@ix7=d*00+_0%J0mVljlKmdWukMya2VymS6yG!fLo174T_P zCN7}|<6CzrXj7D-KH&JL$v_yY-UtU^E7T0Ub&Y{I9evMFn~Y z71$+A!e4O`#vQS&iMRpdu<23quNefb+ao z8Eal5|Fb9zq0kHOV=8vJY)->`)XcYFRXmC@cm=h_jw|N4HN`OMT~WJzFxJMm?fU1a zV|)UYfzznXe(?(V*P7m=Ap>jw%XByq73n;zg9mUeUdJx@;Z@Uq7Ne*?!kHL;jX`lO zW@4-B=C|fW*pRw)!z@`W>aSx1Zm|Bk2=Z>4nJz?KG;Vwj58(*(y=A@=im?;*FEAU+ z@O@0X%`cjG9dq#2JEr~}enCCyuGwR^u^#nK_e`d9T@*CK9jLWFgK_vbHo&-F&5ZhD z8uiPl_SV0d^FP!!AH8WGhjsBy)KaX#Ks=6qcmXTnP1KUQ{-U4{`j?qC3P#ndp*|3f z`alf&U`x9_36=U}Y=k51=kw7)eF>_cHK>ekL{B_uw;wUOtWy+xd2kjrz*W>{x{H<3 z^LNu8f;u*}QO_Hq2565Sn2Z(iMbvvKSOZ@{y;ov8-fo|Qm300WQ&7ZfaTJ!?_1OC+ z#Vt^gw?_@s#jd}A3OEIosWkM$bh|yrt{0#J8;wEuy6p@s|Ns9BDd>Z%P?4@fb-YC{ z;7-)Qhp{yt!(8Nx$O=N-XGSuE$hwA?bDu9!yfUja-rRrA-8t^eH0FOV+ z%pIsDsD^r8AGK8RsP__4pHH&wj_SDIAMUs7kMWL7FU~EO3x_HEh(=#)AKW( zqw{m~i;C0p^4t+|2@bE$C0Y5!?%s*x9B$7JpZUAD_J{~|56MXJteT!bqR5$DQ0N>v zx-er{dQonE&Yb@gHlMRL=Uw;b!Skrk{B`)#GE`uf{++us8FOR6+#VlOO;bONscBtBqxZL(^9l(&3e^b zsx`L_LXEdIt5RB&YAMp64vMQqd++V<{mFjrZ~EuA)^Dx5)~~Cpuf6y4JbU==?|x3s z>APPCPAv`ee;pOH(Bhx0a+XyW2UbPWQqn?K+F&jHIvaAez2M1tSW6O%e z5g3Zo9Oq#Z>dUb_9>FL)iES;*Z+%N)D-E@{YdC(24KOKzHtdgKn1hwD2t#lRs>9c@ z0xragxXh`qb?Te33+*M?6YrxYklNI;`ZB&XkU}60YcK}i#aKLy>i9d1#Gjq(e>m+i z&CG!D7|QkLSQ$HDHSCSm(dD#{LxN|$f{C~Vt1-THiGo&k2etCQVFcRTrH-1TX50<6 z;=!niJ%ep9)2S~-O>_;0<5pC^AE74r39?((d8~<667dhiS`>6+JZc3k(2J?40pG{v zxC49O;O0aPSD+$x7uR9c7G|P*unzT8SRa2xa_1c-FFZbiDMX!XIl|}4Rp=9 z@GEwwUM|_P(y%9L<_oYa5?Gb`4xERdUR%2-_cQO^yiw|| zHPB9c3QwStyHRKJ+^ZN%eKsnRTQJ;Dp+p5dh)mWxg9>S67n5|=@E_FcpxSGvnhD3E zLYm;%4wXaQa1;)3>U)tiuuh=1F7QzknQ-)zz*aN`65r~DsR5QX5w((iT`g-8ock-gim4}+=w;t2rBefP+M~kn_v`2iQTn2Vj>oz`dy6!u%tWj*WQOdX5LHNKrJCFd5@gg@#@{MB%t zhB*8IZLIRRlkKRGrQkyBhB{Ukke8tq)=M8EY#Y**H4}-l70Sy)6X}Dx|1iel1JuB^ zdYjy6?x&PAebEyQMc9)mEL<%eO2V-2iFy&-Cak75W8#qyYm6)+cdJPV!c(=n9# zJk&8??$rI8DQHF?VnsZKyo;ftsQQYUR{ZP8t7@KJ=>{! z9iPWqT%V3C&~L4x5KY5c)Jpd_9>XKl&*55JNt~}^kA8$16Q3{>+KF1g9()MTU|swL z6`831CX)3~IaMF4VH^f)(^4pC@4H}A%tR&SJPgP6sEO^s=6DbliC-`YA7CyvCZ%;+ z7GV!Ysy@&}YS@z|QW>aIlY>guS1?pb^Ew5E{!P@3SEB~rj7@MiYDJ}}`vM1>Eeb>B zNGi6$$FMQJfZCe3u@pC9G%om)Ifffh$M8$^52ElBg|^uBDHHMu*i!W&W<`alSMgoc z8?nmM<`tTY%7s~|q?(VFa5YBYCe(y>V**~s`dE3G=|6cG@mI**H0Xx87>~P=ZMUvs zS&}_tKDAO%d!2?#A{XlV^Qf(uf{NG&s0n?AI(9#z?h6}kCRPnqZ!nzrE96aSkZn;R zPDORl3#;G|r#%OCUm@ya^hMNG%|)$v1!`|MV@=$OMBh4rx-V{o*@|S;IKBK7bZiEo zLYaq3u0qreMW~rhMs+*`HL*FUW401C!HuYi?M3CnQ7pheFb4}8K>h!mR?^uq4HeqKr~$H3E6YPgs0g+47g5J@7HWcvQ43jx%8@P3^@FJXPU9B5iVJbR zo1?1p--PKjr(r+F;w@AXRn9U4r#N;;64>g8({K~!V(V=4LU{|LsF$E3bqu@W4b+4Z zJ*NMzIFt_0V-k>u>nrO zmG};_?N-kmbA3GqQGXBpdSIK=unW6W-;X+eJcqn}t%{@h&Va*E$M7&RwiP?Zyog>OL;O3@@IDPw@D@IbzI^jWEJ0=QP1J`* zGtN{vrebC6iwgA!OvIP59)5t@^HUg)rKlHHxX(nY5e8E4@28-ZK8aOvI5xxr?1O(s zg}xM<<9$?;HZC+@(R!j5umiO<_fP{yjOC?;ZEyz8!GTz39E0L$OhW(1PT>w#3E(4i zyje+dky(KYqquP#w#ON$jt^im#!lexI~;&S-I{|OefEx%0wZw{ZpGmk@&X@pI11Br z{(~o)4~ZvG**pOi(vL6>OR))tO)`;bi(1i8RL7;L>mAujMJf~P;&`lv3$X*P$F^9C zov_}E$~h`eQ>abDvlxpLu{th8ZACHG!t+=M?>I)hWcE4%74n{_Q{csR_$Ef|SEP!sza6{+t~$MFx;bK%oW zlGehm)CXV?zJVHNDXQO%SP6GdWB)b7k7)?TuTj~44b|a2jKIL@=7A{3x~S{%s1949 zCeqot-p6q;>OL3hzFfx%Se2Pg_ftsa!jhTh&2$N~srQ~`-h|t*0rlFinN!jUwUR7U z$K#y#DNcPOY5_Y?*?t_iV!7AN@hibL)N9N(N$u}LA)JORRELEai7z?rbDj1TPWuK_ z=yo~R4`LVUXRs$$n`0(04Es_aje)oywRHy^Pas?Cx6V>fGF(9=*Dt70Rhw(}{vp)F znxV4xVN|mA#fF%H%7s@^1Fph{@iuB}6Xux-cSl9CFX|W;U^SipSrnpZScTABHZRg}U!1w!qqdHgDE6 z^y`H&hC+3G4YfzBu_|sv9iRQEEjfr<>1ot`*HJ6HiMr2PY_=-cu?p&XJ*VCryHoFg zY53A&;@_6S2^tjopf}CHp-8l?SXAggKy|bSBk?5a{%=qdDMf9~&sZ7%j#^m65*CFC zSOa&U7JACDbP4fSa{Y}4byRVw>9`6iq&2Z7wn0rK9UJ3Q*b*mW9BxHL-~ws_-yr{5 zxA>28>9u8Mf(ua#S&fS5Ha`VrNF58+GIFPJ8%rbG;_kqP+o*$478KZbzMp zaVyO8vygPM7NL@{=}NQmerQwAM17_6Pp2@OhBd3q0IlCL$EGv-Xdi-F=}A;h1gth4 zRYy&@DQe)hPJ0?E`CO>eFb8$t4%~?!BY9{|TvPU4(r;CN+k7DygIf7{REOW9R(cNu zvC3LAf$I1a^(N@XDX0N%U<161%7vQmnCIhB^)A=}(@|SJ14DHF=TrCx4a=Pi%ic9B zT#K5(Zq#0#MTPPzj>3wZNhMPOw!v3X3)qJdcodWIJhsBH^}Ol{d1rix`b!)5cFp+K zY6|7C{zmf`O%v2g{HWwxjT&e-w!_od1w%G*#xV_h;X15`cX0|vZ8llI2pdt~jP>y> zR>TMB??a*77SnM*%%c7Zj>cQ42)N!er{sAoqCOp)V!-?6LnaZG8yRThc+`X!qawBi z3KaxVi2j)9j3Z_s$g-IA%Y~JZ9s7TE~T@Tr6Cej^SQs0Ml@iuDU zh;8Q0*ASIE(=Zoj;3Ie+gRt#(desU$Y&W4Agz7LC<8cLs;33o&eTHFp9;@JW=lVU= zd!$^6c|k>Bb?Pw~i>*=j55(4(iHg7yKLv$uJ!+SLb@U z9i|?R8lVb@d8g8rEl)>0U_)BL>lJIzk%{=Nr4%%?&Db1wp;rC_DhGZ= z?Oog+^JCO})X!^Cd(8xg>^HAi7uMlE4=RFFQCl#}@h#NKcR2N9*hE=%nL=GIg#5*< zs1a(9+M*`%9FD-T*a^>J1&scP*EPmqJO+PkK9-xIw#tiTNr!Ez-$#YK`2l{aQyt6B zf9HedUAz~Ea^d136QXv9%{d*4%8?Az3ue4ipNv}JBGg1TVht?87(D5;-$W((1JssP zWftjJAItv#-xvy&X_$oSa5n0Jx3L25Lv6)jY=XZ!*X^U`i%AM<3*D$K$VWZ*I%;Bz z99N<4+lb1Iokxkk_T(rHQFsxx(wnH2lsjhL-L+9OZ;Zj%4i(Zza4`B%_kV&)zH3+! ze@AUa&~cL!u^31_9@SsMarQr)LVFt2aSznY`k*E<3~S;T)I?`s8(fM7cpB-#dh8RE zGlx+3{f;(aZK^vE%?%#vz&wq`A2D*>sG4PamAOsb{Xw>ysRBj}oja^Xp zyPWoH+(La4F2tnI*mpdD&2i{y^E<&zOr?GVD=T;*XG~Jm!O2``jMH!f=3=YQP3Tr4 z4_Nz9pK_i>5nnrv4meVC}Q!2Ms@JA)Bx|?!Yi@-lr6_Hy1Guf5RSV zpEKt<8!J)Yfa+iyHo*P360e~Pr=B+<{|*(IpD+yXI`x1r&0oJ2F`f2ww3R%|RKUF$ zjo+YF^efiDN*B!kE_(>IC58AfPQtIS1S4?4MYE@?QTLUg+V`W9`y?tNU!WF}!oy{M z|97XLfn1J7*ogXE48onL^Sl>Z;2|7{_t1mAFPUSw9rLJ1d~N>Fn24RIuf!?%4L*t^ zzcI&m?Ki~#5gIPhpcU7-Z1yGzb&R^9Ch{bh`wH=|O5v|GC`&7RYd${Pp_lq#{1YC=+Gt-j9d*DN)JHh}fQrc2 zYv$**;w)r>n z^V%_do_gX9^SyqZW2NuS&ubn`<9g5!CW8G?TQMGEu>>`){~QIa{O{NZ6Mr--8-#i$EhTsnz5e&0InKRez>^&jxFCdB?nQm9EoZB%k4 zqaN&r5%>fuxkjL7J^?k*OO7*81I|Yq*P>Q>*zq(fB9~D8-bOwD4~%4dtHLew*K7^c z%;uura4Vep9@N0cQ4gL*4R8@FVX4!83oB56;9L*5%_k`JFszJ`7>YJVVl(us!;Ta* zv+k&Rf5)My31uLAW#wag9E*kc9%^Focg)HYQT?Q&CN>mx?A#cPGo0&lP|q#9!#6n% zxP}I~$#J`L!#>oC4xv{3snhG)%ktzEr>DLhTESCLQ0Ok`T>O3S#?}3H zk+;wu>B_TnU3so7ciF=uy?MTTZ;megvtPHJ@6Pr5+&M*dX1+Jq_GP>6K?Ux7yPK;Z z`&q9mKO@N+;Qf!z^4*06?y{TAwA}W%Y$zu{&x0oa2p) z+dZ2QG=F{OjD(gA3+!>8oE&?!JKy8Y@Qfq|MRtLkrNy=4n$K&;C1a*{erkF>;+EqX z>&`D~RyO~Cj%k*Z>(28PCuXe=9Bya3b4J^QjMWuBo8vCX_IiChQDl#1X?Z@6D~D(* zILy@LBP2z(E8oLP%GT^<(fRi1oI)b0&7qp>wh2}y1NsV*ia#IqSouosoRMCdect(h zIn}zj)|kjD5gu1op0~i~8ELZ@uHyK~3j->8NBcb9JXcQfhf|Wvg|$p<(JHY;vfZM6 zN}J*bQxifOq$&^omyGB(XF;fw5to+uLtFnJGQwRv5Tlz49T0|9f5x{_4lb$c+Dy7?1wg@xLU-#Gf_<{5uYp BZHfQ@ delta 10084 zcmaLbd3eoN9>?(?iG=J45k%xlL=Zx3Noh4{q?S}-YG2b3f+DeoPU{*=qe@$mP_0sw zqDr}nQmv(^nyR6dmReg<+n_T>ZGGnbanAG1f78d)*E#3+yXW^k-}61cn`HK7ueE2r z+-JkQ%N+j8sq8p)u|{?E94DaR|4gG9NPjG5;|Tl$^DsW%aeCl9jKlNjk3NlzVc3{{ zJ@moO7>3!{)^Xg<5E@$Va#}A2(qL?!p@Q zcMQi1cKj}qG^c7)$7zPmu?Ej~2GP*U#-na{8G~?@Zon<5h!3GscnTHR1#E*?Y(JV= z6=*yLVlryp4D`orWOtkaSPN&OJAlSg8oF^EY6TuFz^_mbY@O&h%dkCm!c*82W15?c z72!Jii%@~4ws4$C?13>@fU2z$Y>At&K3;4={&Q(~Cpiw;afTz;oDvMh{a6!!KxO1Q zYUK}5b?U`z-WY)zuZv;W0JSyAc03hzUuRS%x?v#pYf1h?Y2@1rQ!#`7Y|O+XsK_H) z*-W4w+#X9X8~yO29lv3%)Y=qnI4ZL-s0TL15NwCaP^OzkKN|U{74Ee+979EV!FmI= zqI;;7RA%FY(HFIs5vV{~U?XggB+1D`9m_?i&wY*xU@tC3_i-9ZT>*zt6BeN+Dn`{t z35Mfx)P0|#R_1}sQG5w@g=BZz6m3B{*Tg7 z5p?DQ0ciL0;*`gJgS8G?FnJ=FUn1@)jOQCr#_Rov@Qp9^@}yjQ|d znQV!HJl|=j26jfC?es>av;=kh7UQ3|%#Od8Y64z~+M` zYsf3a*@v3<7WP2z4725ZGsu5D1BDFeMe#QBJ>=}dZukXKH%`E_oDl4Yg}4Eg`lwDO zwaGY@{!^&HwqrCNL!F{qsG@v`D(2wMrXSbYZH`9@11>HMMqhNJs=OG>Z~^K##dmR> zMC^yzI0u=+`4LH;)3>V$%gHF$|AkY`a39*(*AGAgrY-87z|aS?fqJ8{pMy?-9H zw|%U67)5^^YK3p2igqokMm(s%ccPBvK70Lp^rwH$dJPrGU95`kK=Rz0Mom=lWMVb! zkBTr4^?(tm2Nc+T5o*t;p&qcrj<2@;4b~l~t@;YR@hsNFUob$)yKfqfZtCl;6B#JkiVE$bW2o5vQZD}kE*2{tbs$Y3Kn4;zJdwbyj3*x z0{RXEu>y(Axr5EI^7H1wEisXPTO5PKP^aVscH&9TQ`*YZJH1S%R-jJHI@E&?pfYs? zmHKk@Q}LXqp$A{X#&{3)r4!rR+?a~mqAsYFO~W=g6C2@YsI9q(m+>mr#DDZL$L}}P z@vGU_9OEX~mi}~fE9Kj1Bx!)xmR7U{_3BOPZ{C1eyawwrz8K=AtvBT)b*nS$$vu{_ZVQi9oHaRWEeuf2*Ys>s)&}^>pM_eu?Lm0 zo2YrfGF)AZnP=Wo$_Fq8N$O!9%!Q@|iF^vIDP>i9t7&X4m-na!7&~DUL9Ysz2 zGiqVgJV4cg&kK$-0iVRt_z5brQM_#wXh+lndY~4NhYHv|-ZoxG70Cyv0Cr$K+=G#L z4i(S?)Sg!wVv5lp^`H>so#G_paGZsYGlL5Jw)GJzkZMC8Uw1ooXlNxaR7w(1A83g> zh8<7=WuhYQfvSmId%XxX;Vj&QWmtw8dHmFar?EMXA7*M}C8}ojp`XtG^~VifiAWtf zl?lHy=HRQi7WD#Yo^QT1I-)Yu2h(vfDxjShjmK~{-a?-3Odes5;c2WwzuHK%uweAz z`A%ILnlKjQ@fqxfqp%b1z-p*3bxq)hu^58yV{1G91M2;7+V;=e{$IdS_n1Z@Le2lr?09EBpQGvFxwnt?m&0b%F z+S*NH$iJ%ab35<@hS9%>TFD*MgYRPttUT8I;?W98iZcgw+uf) ziIIioTXs3>&36&CrM1VA|3Dgv<4h4fiArrZY=+}73YVkycsDl06Q~!`eN;wjj5o*l zX;cQ%QK#uSY=AFdH=K>3cmh?Fm)tZ|G~paxf_2)UB43T#l3!5|e1N=-otTM^GZ$aM zo>+AfUpzPn6Y&%4ISj4D_DnVlaTS>bWMLTh<>3?PE~24{H)AUdn8Hg0Q&9oEf*e`r z26o5pQ_Yvi3e2H@7vI4?FPYz%e#b`iJN(rYZ$2ucn=lSfU}L<8WXA2pzHC<18GGpl z)D4YaF{$c-b?Fa7?b!@$kBd=zc>36+KTtFHXgvoKmVV5 z+#tmm#f1oJLMd;9+S`GcjK!!e`4V;CNvwtcMrAH=x(P51^}ya3fupfH&O$BZZPdJ< zViKQq&eMp*u)mob6HzI91~on$RWvg&7)#L~Kfq}G1QpmZRE8?74^hV~bcQL)dYDB& z9_!&`bZaGLG?X$A>H$YF1kYM;+Uq(?NsLFLj%7F0%6g$bHxl)^si*+wq5@ciez?l^ zH=;7LYbN`z<9C7qec%EBB{6rv`aj@58JD)7aq7tR(`b?-pUcLam5 z9CiO?>n(fz{w(sZ34Lap_ds>jjrFYwsEOL3?n|>~VRdhQI>I!@3tlrXpv^dfzKb)O zhp%BQ{u6a7!d^EEX^)yW(@jGc`q+W#s1?jZRrhk-iYGA#U!O-Xcnwv>_2-+w+oM1I zE~rfPvg5<-_yjxdMlJA7d)>W+Mk)gzVrTpf6+qG(<~N*<=taL2tK!?%6{tO3kE(%B zQAKqam8swC^*gA*^gFzYGyqkkvDiT8KZS;hVGw5HBuv2rsJ;CY6>;si%+LF=sAHFb znrJX8;0fr1ucC@`J}OgXs6dZkAf7}W&tI_`&v)+A&;;HK%-3%O5}ETfhGL#|GAiYB zumD%0G7?t8-w-hpJK-(ti75+BM&{!>`WsN6?_FxXj0!P<=Q|!6dNG{CmiQ18v3Z&K zWpOYj(BFeC@H)m})FShKNXKycIjDdpp|)fiQlm}@YD*Sl7=D1dZ#zEz{@+7GHy%gr zRk`&S45fe5_A4zmKS%^(CgVM@EiOl;{v_(bXOJW~w^6B|^|qPkO$?^L0(Jl9x5>XE z*};JJW-o@|cc?etd88hlhZuo#mzb5VwC+F!d=xd$Db&QjpfY+DYoYHuCJ+}kqMv|C z*z+CouT;LufHJTF6~Ja(iu+K-l=H3$FdvnXNvM<-qt16JYNb0+#kwDL-?w)Bob@W! zX8aCL!C*H}*+XLv*1#_BnF$6XW#EiJ72_k+9>*-><$@`wU(xy@2gI4Y+yvnBzBx6a zIFa$DsFkijZOsYPJQb*b-H&MK!Btn73sI=zYlZPR1a;$F{0z&GZFRC&n%@m8a5(++ zRVMKDsQI>{R(cq{@E24771$3S;4q#4ULTkT?7~ce%FD1DE<;Ux9rLll$7BKLp;rC~bvhz8nm?(He;tcJ3fDQ0m#}!d`Rmx29VU=_Sd(#` zRTXOlswkg8EnpDpIis!aaWwRS$*4V@kJ|J1FctTsCh*>A0%?Q_tQ|JTPN9^WV_Z zjm6)XH{cS~19qaesU&JM(-0JWQj17*%Bc$4m{>#ToP)V`toeui_n4CSLxBx&K{^(sfM7 zZ&0-oblkjG>f=WGoiIS8(oew_n2J4d9FD|;*ausjGQXV8!5I2?u>;mQP5x)n=to1TJcDh~Mfh529}LG) z7>d(T0hC}e?!*xM9d)1A8B@Hqu{QlwY=ZsK8)u_3Fc%x(!ZYlDBN{sx=!O@tIyOIR ziZUIe=}*7{T!?+q>zp}`15pzd;aps5jX!TPu?3%J-1mZc5A??_^xs1Lb?npyw<*5s z7tN1Gb$&5L_AI7w<7n)UtFaY2znW9h8cXSp!y)K%i8{iOn1h$B8JEpp$5vw|3n$tOQ>-&lA9w?+;!-=l8tc*j1nc5=cKo{aF6#cu z*Gw(>qmErY)Odo??X;$$2Rwy-n2EKpH>$V_P#>I*IyUoB#kCX__%_spyR8RN#rqw) z@FHqnuj|GjR7PrJfW8fy(a;3#a4M#w0@{sHc*ORvpdNS^b^o8JiG6RF7f={#ye|4; z9O`;Atc)qB1+_gAdV=$E-iu8!n<&as{=L+jjh+)$6ADoS(HiYGrkA zdgeAP@~NLYab&^RrmnnUxkD$8ocy@w${m~MnlyIg*a;JJN00VIH*4WnC1diiu@gN# zlV9@lct5k!-?Ob-boj!Oqj8?uLz{S4&mH^X1lRC_@vg#2Vs^{Q0WF#(@vp6`MM}HYp13(p{OXsNmVZ#b zvV3WIX;WAEyX8yD7nGNkFLCj|(()DMYs*VL<4a2YZ7lxF-2R?D>#_np^|oKB=_xrH lS>^x4QS5pD`wB15l^_4@QUfZOXU{TE8qJ1_tM diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-hu_HU.mo b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-hu_HU.mo index 45f0a636024c3ef84a5b2cf92e064c78bd8e96b3..b4e5ee1af68ff8d0bed9f2da324728fec357a589 100755 GIT binary patch delta 10984 zcmd7WXLOX+zQ^$g0tuu-=ru!0LJNU}B2h{xf|O7KB1OW4OhRIkfy@L5qJvZg1R(^Z z2uSZa5WK*Vwxp^c2nr&KQlxs0hz0SSi|6~xe$GAX-WT`9z3Z-ZdGpzOKYMoh@Be;= z%(kbZCp$6}{w%Syvdn2f+gX;+x=vva4YlZ%f}da`Y}t%99E8D`jTNx~193WP!1)+} zMOXpfvFjV{`cCXZ`(EsYzo8b8*xa)EGru*Mf*%d*u|96b2t0`z_%?>&5BBpv?DqOC z%!E-G#Pe9Jgim8t?2FaVX}3>Af@i&sF<6XMncw=Ff_C;0we!DYC_3n+fnrfB?vC2= zP}IUkVOvbM>nl+UU5_ES2Q}^os0E%zPRsfNYogVX_y=Px3hEez+CeLHVP5Z&G z*n@i6c+2X8y-+J(jHQvlD%AJkB0P;_%IA-pw4nJY9TwY3GPFJXW$Egov;>`pcZ<@_690q zk5S{5ea1Ymj!N1VSV#B24+X6}1NUPdE>(w)>;{ivIyyR8R(YI_I?Fdv6R$wMKi)%4 zv>%7z8B}sdcQ&7U10$#}Kt-|`LwpqWs({Cl#ab6oAr0$dlCCN~pJ&(Pt2ZW=v8-26J2~9VvR=gts2vXK zZdpU{d8~umu_m5Eh5j1qXdYox4Cg9wy4EuogZZd&*I_d5?Lqu?_Ce2@H&Y{QNWBl1 z#a!%%g64PVd@ ziTBZgm7lY-9Tlq~@VLx!^EB2l)2czI|c{ZRc+Vgx=$O1H6EB@fTEN z!Uvg1)voqvq-Dqo8Y(j0$Bg zD!KAe9STq@orW5C4r*a8f|G;eYI89`~MJ+TS)oj35oq|>t zjaqSA+ay$yWMFBCu|Dj4>0BLbcDtbUcrI-e+}4 zGdt;Q+Xofep{NPQqIQ;xickS+=TlMFavo}d%TOD67nLK$_VeSY@y=s0-oPR(ba7R6 z|C_R$SQ?IC1U^6|QKbwsae{3RB!R5~I16`R4z?LN z$8Pn?HqWG%MupaJ4o%uP8!ds{pR*2U`DjNN$5AspaPM^mrn1YSbgZ=PrROoME zEdGW{(kA)lPqbdB4eUc5%_G!=p%Zv%VOyMoZ{c99Gm%Mg9JWN?QM>REE0^IbbduRg ze1X}46T|5^5j)@<)WF9u9wR36|2s@ZqHeu~Tz$@tn*w8S2=2iY44lFj9cE!4-T(5h zm@kQesBE5$3h4(JiMOyR2ES?|(+;(x5vYN0p`Jg(Q7TgDSQjT@RV>1%aVxgNTi6Nf zO;yfO8A+iw4XGG`uV6KN2Xz!BSPQ?vI{45w^fhzV%}^olg}Mc9Y>&&aI-bXRco&t# z0n<$699a7I|6mH5FcWK_50wi`Q9Id&8u%2p#-C6Ni6mpyFA){7A*l8OR3wTp3^!pA z?nQ0zC~9Fh(5DdnPCh~k+R+O1(3`ae0 zgj#qf)HNN4TKJ@y#9tqrM}t1N61CDDsC&O31M!4i{}i>btEfobMqS50P@fB#WsZR?_*N1+CcLoKAU z{k)&;P*guBs$Y)nWZdt^|AKuK5_ym~*Swjg<5=nsF%3t|Gq>XiMpD0v8ZhilV;xlX zN25OuL~Y;&RJOl_dvGnL;L!OdSN5Wk+INM5R`v@jBxM(vkO!j%tbqYo9~Js2EQ_(W zaoB}=TkM4sPzyMW{qa1qQLEuw_UCP5k%;@Orzj{HI-vsxq0Zcc+UctphI3F^yBw9Q zyHH7Z!mi)MDC&~2)Q!>9#+h;F=%fy{3WEi^x`rD9L&Wfq%v^>e7} zwhFi4K~&af6q$SO!-mvXpxzUQFb=O^0}NeazV};UbLxw*mHJ_2`~iI$u*_2P0;+`y zeJm~pt;W!$V3m#N%OhNUVfr`W%_VXfClC8q3xDR{a8SH~q-sb!xD5Sh? z2J)dMo{dDuT7gHo@d%1Z9w?cjX zx#h%PD;`CI2FgNZy%&{qFJn!di(1Hf)QhDUTjNitYZ$av<>z7_fdb+`OZ_|idsLcHaqmKF}Gn3dTHN)b+Gok<}BNx7CZoz1L>#%-FEvd ztWSL@Sx5-hqFxjIFbNOMP>hI zs29gI%)$qDeZ(g7p2$Mw(i+q_+c6&BLtV?es9)FWZZ;7awS|`(^IIMY+TlYSg1@3d z-gm1>zOksCyoQR%Qf!2~@G1NpH9;tepzE24$v7Bw_M0&pkD%Tccd#r5ZRh;^Q3$1= z2}fcEPQr2cEo#DnJIv9%gay>cqi)50jKFd`O{5xQJ?d?3lTiyAkC8Y79k>+(@Z+7t z-=D$-8jA2s)U_H{Y(lpd`%}M&id58}%(vx6)I#oHJ51eW7O)HzsjcY5BUm0A?lw8o z1Qm&Cs2te3n^Bci#WV!tQMu?@bBp?JneK@)t1%7I&`j`vU#{b<)8V{PjCG7o|}sD9CQy`^me>d2l&?Qk?! zK^JO+1-7&B6m?%Ag^d(OzGr@3^ZPgR^V(h1g7Wv8Br3oL)E8o1EJ5x39BQH~sQ%w# z4ZMlE1%F4KeffRnOQ<P)&i>m z$kyR4+<}^C@gegck8P-sU&j9U7i@lXYTq%3hyl_HM<2Ax0Y=u5$p^t)gJ|AOnHEM!0 zsDW>zj^Y6}#fW33|8p2YeK_ixO~$%76?KH~pcb$Jl`FeYkvo9e$cbabUn{*xgC@Fz zTF{SJ6|Lju?5d$6&i^wovOf^SgC_Xw3^{x|YMS z8G7+6T#f2K<#Q9sxmbbvN>uv>)DiAMMdSd6V1tXqzY2v|3d+uIwjI}ZkV6fmSG?2 zZEl(`t*O|B`W9?}_fQ-41%GGmV;nZ7VI4X`r~F)QWm2I z{t)&2K9PXApHm~4Nqt6Pbpbphh*QY)z>6+N>ZSD4ssH5tMb#W+`Loe!@ z71;F|sD5vtA1*^J~}s0D7p(*OVOrl5EBe$>RLF#s>4c6<%B!-sZz@EtR7RV+(; zP1Mfnp!!FnKL3<$7gW;rLXAHfD_{tQzSONX+ zn*PD4_Ufqq^-vLsL@lrtYGLuHg?7ivH~@VLQ7Q$6C>=F$Hfo@J)HQnr)o(6#zy;{U z4^b00zh|;J4zRf>2bL8^BmckV_dnO%-jrzGdIoQai@DH zI`dqP{BdcF=yAAmGct2ak`gxr1!Q_W`7TfAl6!rdRP#9s-1&|%&Rj>1GuN5nD*f;n zcdj?jovlaz9M|Q@bLF_buIvIwdY(JS;T`L84Dq<~9NnFsv8irnURp~l+5I1b<+<`b zuF_6sSuV%Kv98?GhRD(t=eix)?%WJl#XLvpu3arl!cqs7E8Lnsr$Xz-9>>JY?CiqU z>#KxC#!>US9g*>v?k-GBsz;=#ucu|nXIansS9E2MantN|7kbm%l++p@Ryj1&nUU-Ecr(X1h`h5TYFbg53hr^< zOn0s`yX4Q)l@@|Mw|SGGW2Fz{=h7^YU1_gCLe> zf~Vxg#j3%xfS3##a{L(sV-U{|02PubA_#Da2#lRn<_zt4ukn2Z`F&z#=u t=N#<*zs`vpXV3Zv4*kzbvHN0b=zmFy!l-Ej3RAyZ`menB?YojP{{Ty$OdkLM delta 10239 zcmYM&3w(~{AII@~He*NIY;&6J*_dHwbDWS2b4W8eO{p|CHk%C_i?l~rgic07BIlNB z@|3fb5h7$L#Ap2zRmtKiKZX@JWRzb{1`JZCdRS`;{uGvOX!21&5c3Wf_^x9VqXlx zRP1P3PHPm64;fgBBXIzCH^KL@0iHl#{29IQHhQCbOEaNA)}kMRwXw0?Z)W#fV|T_A zu`fP@3gA;r<@wf08tx1X4P(GS#cPT!93r3l7?0`33bDC^v5;20XL%}K7dN$SyW(`u><~O_am59fySU8 zCZgs|MjuQ?cE=il^>G$DeQ7MGp&QFlD{x^x?n6DWeQV2FfnBfls(x3NBk^fD=LjoOl4*aAl)yJo$J zyh5zKsCj?G!RV1}wtRRp`Hx{>0t0$cEJ419teu#GA0u^R`S#|7U@x42@1j!QxQ|I~ zB2K0MAS$q}7=g!8r|36SQQkupbDh4XAKlk!jz=d399(z`YoQZW<#TW`zJ@wZG5sv7 zH9m%^I2W11`Wi`|HT+={$THOZ!MsEiNN?1G$6z{6M`iYclSU63SCH4Z75#|W`$4F^ zO|#9w#`GtmR`?34Xx~QFhzk|?4%D&SYhOQ!KJ+izUPlG;H`Yd{A9-$1BNSCU{m}~_ zM@5){dO#NH0r_^n2({y$Jg2YcWt+!wrU@G-~|lDZ_!uDyJH$wtpS#GkPE@M z9?#=doK2qR>K*#POJkIwe)uhbIl9w3Vr4Lrtbup-xLV>cRU_nL3P0 z{a5I%;<-da55A5q@HXm8r^zsLV|UaR^+TwMeTXO}!$7>jhU#6Mk_ao}~ zg$_5zxFvR^KLedg`BoZjG{9?1E82{D^|pE3ya5OB8VqOr9n=aBVI4e)TLU@d+wp zH&6jJc*-2N7O0H$Lk0Gz-G3TYBU!cuPmzD^MKJ@KU=9Xi8EU-TzHu`upxvmgI*OY3 z8`R!j$NKm?l5NX-q`7YtYAYt7=9_~$HLs#FxzR~O$858G!xmKJdr%V}Kn3;%s(8+$ z0{jWJlDnu{@O;{`3a~5Y;wDsP8}qhNpuJEF7>rs#1}b3ZB)c&mRU~Us0c^u?`~(}} zMN~j{QG4z-$`qpy>Old>JH<-GF*qBmGlL5Jcia1@K)gm*Uw2v!X=o)5R7zq|A83m@ zhTTvB^+!cM7*!ML_VpsvgtM^%7vo|~&fupWJcsc(Dbv)(YE;eaMQ@$|pQ{_Z5|KKz zY7l;39EmUB+o%^v{8;m)(F>KCH0+5}Pyy}02t1A@_#5(UYf6?mhUc&*eXne@usZ0; z^Q|x%ny?ARU=K{eao7j9p%>~)T@!d?6AZw&u)RHg3iW+;Url=}!g$lHTZ5LD~lI-j2 zQCnLvp8Tr{ci97{Fo^yY)Jkrm9()HAutuKw#iJdP6l*T(xc!0rw;s+nFP!bzjs7<{ z3mZ)^-?A%FZ@w$2Ep0H7{QJ>pJ<$|VS5#_KFb*eTV_b>aqE6Ez*c6|}6fD6&tU?v#RVNJwwE2_}4=HYWV z1Zz*`iwB>?*0{;`A_ls#JyXm=97SdU12BmDGVlR(7SYheA7DH5eTJ6^c1H#D9CBo> zUvMA}oNB&AR^dqcf8#Ptn`VAv`U9KO@Aj-I-m$2RR$w$%VGF#CWX5SVnQm6p7l-Nw z)D113GpQPkVe~Umdo~lhU>RyJt56y9E;dEi4;#`?MP+szhTuHZR=kA`a6eZ6{C}~! zL5i_47wSX4* ze;<{ZowL|~9lt6D^nuIx0RDnKF=n=T59FX8Fab5;4D`a6P=S}BUO1ak)x8Zh-(mE} zuTb}YZ~L2l{myLiuL(U%%zL0N>c&XhSky!vQ1>O-4#4g1{B(p#jEB5vUO;J>MgKF* zzg<7|;dIDSbmrcrjQ8f^R z4s3=Bpbz@sAk@}9g(}iKRFRe-wdb^!*#p~9$L+H3D)d0FS4}4TQJ)J%FP?A3(om!wFb0#bDQ2TDzKlxk8>rK=4)d`R zwbFL4nZJ&8!#?!S;}DEqXpY%5ET_K|RrNhf&9NSVQ9R!&qM;YVGHi=mF%qv~I{Gd$ zE6>9O-G_mA7&YN})C=b(Dj=W5CS#$fmA6DKBp!pXD{3oK(W&AXPD3|7jmku(eZxdl zkxj#3T!hJ3j{WflMqroMO=?GAUHYSu#aczEfV|60fFT%4KNdA#k23PF)TS|@y-UXc z%tyWXX5eGE97FIH>Xqxe#7q#43b-?Bp5CacABc4@4eR4rR3I}@@0I!329GTv|2mg$ zOHBr1Pyw{U<@g|K;4;5HADwFL|_jkp5*c%nlQ>X=IqB2l`l!-OZ zNn<08us6&N2T>E8Mz+(sgqmnF(P%|4p(c0}^()$kNP$~lzG+sNzQUY_Tr6aK4mQGj z*Z}LVGy%6o)qt}v4Ndr{eIX0O=@+Al@J-ZS?ZNGM64?do<+sf5hRs%)pZ8~CO~!vh zrTPZyfp<{vkKom&HtOSJ^jl%3&i@NERD3^U1pbanW#AeUX#-TX$72^vLf!uyDz!85 zAAAwDqPc6$gI+^zNqY&{dMdhDihut z%x}pN=uUqH4#m}|RR0fEbir?%1;n8;(G#2Clh_HLNB#ZT+Cf9-@)sP8dRu7EhhPlm zViYdI8n_ixa0lvvwcjy+9czjc=r2G$@IKbWdKB1HY>W!543+6k=v0c1)6kpkvhBa9 zfEvGRPDcVd=nunMScFQw6L|$#FQAT7*n1{(12C2TOwB;IaZp zt}v+@hUxTkQIQ`-70XFfCR%SYdp`{Iq8Wj{n2)+X9aX$*(F-e4^L&8{ybATXbLfpX zHW8j5jXMm;+8>zH5Q=q+?S2nzL4P2sil<=!mZG+3Eoz=K z*a0tLa}3>Sw(KGNo_;?J#e`k@IfMQ0LqjQ_jH&n{cEmHNln3lK)qMuFBA<`Vt9Krb zpub^{IZp1Mn3Xj_&6j{$Krhr553&1ss7x25hmOY_8iBX~RV*t|FPe8y)x8G?;1N_2 zHu}`8yd}ob?}Bm$nXm*~(SI4W zmpjoN_o6cK87jak)WjE2fn7zd@Fr?+J@=XW8>4EWB^Kb*n2RT|87A!~|3Nge_M21i zENTU%s3Kcsy8|_G6)J#h7>>743kdnlWULJ;BVEx0`(ra4h>u_qj=_Cc6JwnR%!F-F zDR~gJlEJ7OGEiGF4n1))D!}QejLgGYScck~mDmhFKn46YD!?09fj$S#D|;utPT%?H zA#;v@L={K<&rQ*ELOo~{DxeAY1U`>T@dCb&&m1;;A9KXm727fXDE7n>)WQy-=D&y~ z_%CMY{Fi)Ts`wgeh4qh`J&iyWSv)G$oiGa1Fa@V!A3TUE(tu+o{%WL)8CBxzyYkTdW@xi3)^AT zSLW0VLj|6PD!%FHz%|$s_n}V14O9mHLd}2wEB3!Bji9g1o+hGJRD$ui7^87N=Hqqj zh9l0HtyzZE)sBxd{xz<~c4ti{PU9f@vFFSivDo%K)L+NGIY<8ExZzheOjR0o-mJJS zK1hEkYT{DVihsoiFzSK{=m{J}{|FAm_>1Oe!5KJ`{%Kr>9WR;Rn7+j3^c!C`zjgO^ z(uibW4r-<4*aDBCGIJZ}VfYm@aXD%W{>1={{nn(kE9&$lV*`8yBXNv})R*;H8I1KgRY*au~P%AD*t?(6lyc{+02Ur6?Lal5Y>i&JG&!4hA zkM-zZMPGgY->0Dfysw(`Ul+CVQK-msQ4>r@51fq(^hMO?UPax%)E-}hy8j*2i)J$_ zu-&MDK0yWeB?j_*>pTsu;0D&jKT#9hMjb1+@6Gi(sN$=O>6n6^Sb-|uEvSqgK?QaO z8{!pIAop!+|6s1y#o_h25Jp2E?0}xw1NGp3_IMg9;tc!x1luBeyco45^X&1p=;}Uy zhMUW``Av_=^up}?yjG5k%=FQP*;A@}j`X|?$K<^1yn@2?++0^gT!MGapUCV!G+!sJP#v(gK)^Tw85KGVMRy|D{i z8?x58yWY+1>FJ6q@DFtLpIz$a`k|z44c~;gHvI4CNa)nLy(@a|V6T=rL{PaZw{lfM zbwK}h9hKz;j-2eA^a-O2@^!s5A}-ps=e3RA^^$T5C-a%?0!MU#BeNiLd}Vpw)XW^$ zv&(OIyWZNc*T*%<)hoo6bZCLci2jvZ3Z_+V$s1R>E2otsD}U@%$N0>#JhGs2)ujB~ z!t@MBx~3_ZmOrL&O6H`>U3oc~g^`XV)|NZ9FujmFv+}1o#^)Cl>XVL~%-mc@dPZJ; zM(Mqe8$_o&?70-8V=}krIfxl^9hu|PvvWsf=5;PT^2JA`8?pji{~mqY-Q`tv)YBDm Wc9ef<|JegdPyJZtn*7sdxBmke5@baH diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-it_IT.mo b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-it_IT.mo index 110d188d7eaa49af8b1f25589f3ef188b2f42e9b..8eadcf8e0fc21d20cab4e551adc8376fcbffad68 100755 GIT binary patch delta 11010 zcmd7XcXX81y2tT1q>vs65D1|Rfh3d!2mzExi+~WC(u~qV2$O=7nV6XXL2!^FHbhD+ zfCwU>bPX6luuz7+_VwHL zc(YXVz+{ZzdIzk7cVT@Tj14f)9-oRN&w2vWa4Xj5`PM}mTG>yimH!Q+(ZOAsr~@kE zzNi)FpaL6@U9iCJuRsO*8b;xE)Vv>}0z8WBmUR{zq1B%JM`An;-I$D8K}Ymp7V3d- z;!50!{V}HlS;JRQ8T$p_zfS6%FlaX1{Ku^6@TX{b7#g+aK~9)AgA>90oB!ghOnFY3Mns7xHeDEzDw`PYN4 z+86$U{pi=qu&hBi02TRCtjPq{qrVdu<53L9+|FivvhAa&%q~V{_7&6v-@rOpjmpqr zKaB@zTt%(0CmX68hM*!HZ#x;aqA94A_%R0OqV{qrDv-_C8h0Yev@WBLWj)TCKGzL3 ze@|S2{(EUCrQf3_`~@{p&>dz4G1!296V!d3P%FwrWv(x3;`>pb8-uY}fYY!7m*P*T zjLg5&e10i1?zdLbXvl?(ZYBeRP$?dbO#*o7;6nOOXPN*K?y{`L^jo42dty9Rp#nW- zdj*xT-%<0`>Ta&bp^7#Y6LkIu(NN@txC_hh1>Mkt)!=?CKu1r@3dZ@Uy3o`-pqYo2exx z(jSDi(2YazVWfVn_plIeVJYVJH(PKLgXw>Z6?hXB*yI5w<#SM{X$`74x1s|6Z~*z& zz*z>8@H=#1-E6zsQ7OyBO6-d|R_BqIp%pn$Um|Q9GL`i-l4UD`mxlrwg1Y|@Hpkyl z4~`#fYNLanhElr-$+}gEsdyHHFqq{>Vz_NXY)ZcsYK3=WIF7*(EWp}Wf;yh%_VxJ~ zL4Pson6I?^{w*{V(QXXIlgPWsI)^Hz=%FS9O;LfSpdQo?^`K66KNGe0S*Qn%wa1I> zzQ^_vjOY4%WPyHbHH|n1)}dCq*Y*e=rhf+4;VSa{752Z6G-KK@6VNWy0`_7HJdI88 zS5#(Vhnq|`Mb%Uy*2g3a)~03B(BAjPc36Na%EcIk8&HAm#141>m5E=mJ^qd**qV~o zX?Y&|^P~nNO{T`(Z!$Frb!uFwVtoQ5R5Z`hQ0kYVB3^@f@D^-?dr&L7hPp2>$81p~ zsz$P~3*LjRaRzE@*5WnXjB&X10dovDqK@G?^pB$PXBu6x&x0oA(=lEB(Pl;Es8{hX zs5fHWvE~(8f~tjQP(`%_!*C5o<7QMqd$28jg^5^aoS8pk9Qjwuoeb!PMVO3xkZrfF zU`>&YH{V*BsJ$M9Dxy5p^+!-!F$a~gw@?9HKpng9QTIjWn!xI#`Ym(Gzf#_g0ofIm z;w;nz1FUDe)O|@4%vNNeo-@!-L&s(W zDwS?jah0QPs6a(J8#VD$sKA~>9kW%a05_omdlyv;AE6g-qYJ%xCbM6l0H$TlmAO$Fsz9xL7V20&g9`8^)IwIHYGkW@{QzpdQ@9ncU?nbb za#VHx+Yn9%2HwZ!coS7bbqdXcGj01J1#I1ikK<-6!OlhIh4L!K(yvBk>InA1Z%_fH z6`T3{;5_>IIEm+5-_S_Ip_9#uXP{O#8$)m*YQpC+1$W>Oyomj=-9u&zyr_)L#FjV* zSK)eO+pPgEbA1B_(cgxCePD+@@DBE)|32#Yg|IxWXcVf*icl|->8K)FWV;I6(%*`; z@x0yt5--q?a+~|VMP2_LLovWZ{uMyD$3#{K*&Ztnb;BbViE~lKxybHsz?xK}R&oS2 z@d@mRXOOqA6=U$L-0jZ z>aSr3{0&v4t;@}?Xai6S*ooSjTc`&{PvND7UGOP<4o70bR33_@*dG1+?8Z-6H-N9u zX=WuE6=nr_7|V@Qu^T>xns`5EVDstxe1{{DtXt0^N1wgpq(DB7!tI!g;WPN6!^t>E z=RbI+`H~ohs^;malzxawcn#ZNUwv!Qkg2iCO8f2V0MWuWI>J)hJ4qS$DcnX{1 zH>e`6J=DV%0wl` z;ChU}YSaSvp#r;tex>NIG-S+NbKF{?iZUHFK_(8xf!GXRLak^gDs!Kq?)wpSDgx#i zV^P;zq5|)UI;N$lz^Bb4|N7uF4CsR^P?2s%o%>xFjtA}j$Ed(Ap)z$HbsTS_J{R@4 zDbjfCLw^JY;R~qetU%4X3Bz#L zn9L-juBW3GFcNirG-l#MxChsvPD}o?=Ctg>B>Mg zV>&7TH`c{zsEMDl$5&w_{SDX-t5L`B3dZ7X)b-dUrs|uckA4Q$=K0p^G+xDRI0Q#5 zHSg-xsJ;CQZpZjav$w}ldBk(tSJZPDju(54AYHJ2yJ>73xfQ{)-M`gGYRU-|SoBLX! z0=;uNSM`8?3~0}Xp^7gD74djX!BSLaUc@w9gW32o_Qr%2=5u3F8OlfgwWjbNWvbrG zCL>Ky^Q5B!==r0DIm7T^qg9W_DHtLAw2#d!J!sFlq^?eUYS zty_i7@om(7pP>S}iRzn6AVRVpa`|cB{&ct z!&!I~wPiz?T`L=j%48{OYp0pUFcsxy;x%3F!MOD7yUMP7Zzh8&smGg@Zk;oki_$?D>MQzccb}V zEBUCJIEp$(H&Lk#-egjpfGy~E!frSc+u*aPjP1nnc*^dlZ#L(D5GFD{6>H%#^k>s} znT95~j^nWI7V}G^2NlQ#3`YI_q=`dN0XR|D=VK&p#3r~C8{wy@z;9p@25mF7)E2cx z+1to}7>!{JRN@%yh(BU?OnlS)vY3m!#H@qZ1IN8({xGo|v*)~xNkf8SBf8DKzsWfYDKT01NWg;b`=%qkEqE1KowQs4s)IxV14=y zjKMCb>-|tgnS)X2MFspAHo$#;8k+bV2I3V|WY_KS8+QLU)I_(j9wxkP?(2YhU{}-v z?m=zAC{&e~VMCmXTF64weJikO0Q5iUIGKAIaLIim(jp==@jG&z+Ur>n7Bz_$}1@2T)t`DQYXOV-KDGUuozKm+`)t za5!euAB&o39X^1YFb#u0Fy}i1&(ZIWN@?7OCNoJGL4OdA!5r*^Rk#UnVHbRDAMX*K zZ=I*%AoaQX&G+-H1Lo)bPf)dR8@1;l2Tg#DQB~f`?)N}Fus;Uk2>W^tYNe&9t$Nh< zNgPFgDf&Zbd`m+&{)o!NZPbgT*&$QyccNaMy-^vMhU}fS4x3^%YMxI~dw&5#@n=+E ze?t{t=wUP70JSyE4wHYaES&)rOFz_J-HUoaF6w%z?OY6||01T~N>qvuqCS`SktxN>ImgE;hi`s4cAa(}@BO(0EC{nj`b(@<~1 z>DU@~;xN373ozrDS@sFgeH@pc$W{|?mg>5ba+ z;iwgqqTYN@;zeAEt8vB&^F80}q}i&2sG7Qg3OMxRn%eSP=`{4fZa5wL;xc>>OK|il zlgh)WJ^lid@g@$yhNsQ=1Z+#c6yLz*SdRTZF~$21DuX|xGV)tZpZyQ|)TBHNH9<0t z!eN+=>oE*}L{<48s8rVa%=|=?jCu5rp{{p0WA5*Y(e!(x9(*tM#*x?`D=}8*{~`^g z@+LOKu(RfaEl_*a5fxY#MxhIna5{$b-dKft&_>=y3UoK>zWu0xPT8KrMfATwWxVV> z=U*S3Nkc1o2J7KAR59*H)x;IlMBiXXyop+Ii$B%;na7%gh4gQu7Yi?#0RM#D=?734 zKJ1A@unO`f9$GxQT^ekp%uk_Wqw#}kHz%e*c;EHsyzOhdErdN zBKn`BQa<3i`J?nUbkdLdnzN2x%)z_9F+cGv!GZMmVS9}J)_g7dd(cosld&znh_CBL z9EYy&%-8Y}45WYCHt>5>6SdL7cr>P92Mos?48@5Ui4UQU-82lsxyXEe>q#0R3@pGf zT#7p9D^U|{v8~2<`tM^Ro<~jipZ4{zKb!kwQR4}y2c=+bOtr^5qn^_nYySQ>kcNum zK8(a%)CXLsiF~Mc_$*YQFQ8Vq((b>3`rI~biF@tw%eG&miu4E6R)^j&^Efbu`m<7K zd_V^jp%0I_icolW5uVXa+VH^H~{rw+L zLo0Kj0!Xp#h*9*rp#tcS_uwELj*C$b{tC77?@$kjxoHAyhE3=vqwed2x}I%cf8ZuH zs=b)NfF3;A){7dSfr|Wbdwdxx&^4$DH`wFbP=W5U#}D1C3QwLI(#)CanB>gM_Z3gc z^EoG_Iy_~La(A)Y>&tVwoRg|vP3;&SJi?dfE3Z1!b$WP4nbTQPT<&!gdmWzgGKZ@; z-|6-iy9*t8?nw@>r@%KgugvKvFP+3}UWe0NSnRGEnzc5fcCpu6?)3Jm`gU;Z27X6{ zr`(aB=XR9jx$_F0H6PCRxP4_FmoEKtUZo|IT@{XkGEa%aSLAez@;b{Lee=9U z6FqrlliFJ&JpVOWnX}yMthvdA<#bFfa=L2G$dmJv0yU-a{=BQb*vwc;}#Nk0p zHWWP7HocYCF}2v`a+EsDianEx^I3m|!|P;ONu9Xn^Ei?+u)wn}zEUQSZ ziT$6?Gs`J)x_wn?g&P8M9Ys!8se^Q}vhs;8r?<%C@$rcYM=8s4`-<~iWKxMC$~+(G zsBq+!6|;((^?F!vnWNNIP8PK>bW5BL5>>zhectv}pG>|dB+Ti`_b}}9Eb$d|u8My+ zrfzg`UZLCL^%dtk*oVBTe^U$}ELtt6a;oBf8x4Kd206)%JC*B4Y;E6p_=;M6aqd zZ+#c{|ENUX`zSPcNy`(nSz2VgK-<^TWy delta 10165 zcmYM(2Uyls|Htv4EM*EP;Pw_mT)0AU3o414qs%=B8A>52q9}^DDW;DNA6IInS(a&K zjyn=fEk~JIW|||-S-CAOt4D48-yhDou76iouXE1tcc1Y+-*axDuP%BoIPL8|7w)sn z;h!`w$EkzWtEuKVK@I=kWQxJm^RPdT!`+yPadD0_5TD0bynun|*T@)-jj7i|KTO4N z?2m07$L)-v@Bs}gF%A3ib_~9cHSs70;Z5|%dl-P;O-zR&SebeRR>8Wq-q6;YV-oF& zn2J+T6WD|O8Q=Mqf;SBhHD#9A2ZHQ+i7#7!8AA7OR;5+m@U zZT}Mqnp35j$5(HDbpSZm@RMq#XdFbz|v&&57?2sQJlhixQK z19!y5*dGJ%l5M|bt(0JrHUbsdXw-nsFcdqWBGkuCVHkz6s1@$9FC0P5^rH0^YDM=@ zEAe9Et72u;UPhrN(h?hCM}{ z@HNzXWvCVHLPhQXs^jlapF4-)cnzoGU$_(}Cz}2O+L_NsA? z<97TVm+OU292M-@nZ(4k=!*ee%wC3~2Cj#?KiZ)N>V(?T0jT7D2lct2uI63|M@6zV z1~b0XK?O`j#&!myLb@1r{FdWCxZ1X_N-`6E1GPmPtvgT=Jb+K(30qH2HX$E?ipX#z zPn`^Oli<#B3dxlm=L^&dg1S4-Omv}E_8JbtwOAYPVGWGvVM5*23-^@knbVqBkYU2k-Tw&9^r&w51fGSp+aA`rwMH$ zPNUu#HL-12ACI6;(QQ;x{)I~Bs;Q8jC#L1mxw0v2x{PLOvf3h$ewdk=tkiZa*aE&kD9%I9JRMY zteIGs`b5+U7ow7OJt{{$sEO}D9m~D;`L`HI{k-)CY9fDP6?6v^=L8CosO0H`{x}>p z!%Wlw<4^0eQtXJl<9yD8>bMTi z;!jvgoS(y|2AB!`fm*?RY=EJUnJcgy?RGYV!f-a!1 zF&M8PGjo2&7U=c38Mrkzr`{IFV;1U^9K)WB^f;-lNWDDBMCx_aY1x1p_)}D*4xvJS z5(AVx7bs}p8`v1{p}urt2Ada?P+QaswX&Jm2IpWS+>Y9sOL!TtViB!q z-rm3(cn68L6Od-!8-v=438?<&p-#{&oK+Dihhjm z)S;jbV=xZ8VPAX-dty2IqrTMDK>)^JD6YW-+kPB%Kb*1k3$}h4Q)s_|{jk;3W+AiC ztz=q4L0S41Dp__~4`CDPr?E2nl3A(;Sgm4!QP!*L9!ehIab-%$hK$Cl`oXMXW`7zv6qA9dV*MgDbq=bH;>J9eS|Jmk1`ICRBnPS?3lG zzyZ_Dm&ogwM*UBG8HW^`-IM%24ZH_1B|712!?i^s4r-a{hec4B6j6{X@Jy?}b5 zafu1lK&(SO3$h?lh;L$j+>Dyo5mbb(SpPyDv#{AFDeGZB>Ty^P zr=VLaSw=x2^PmPejG=hW`ip(8v($?A+NfjM7qzlMsL$n~J~s_D!3C%Zyo3R`*4E!g zMdqV9?7xoRF&gxNi`X7-VRwuxHTS^Nr~xLRI-G_6_yTI;%TX83R#bMEqxw69A$St? z{$=ZJ`}}?>@mGg_bImH|Zq>8OsLLS=gaHo*C) zf#0!iK}ED2m7IG~Id>8{J#OcB3L!LvEHu9X)y3x2d!ss@h8lPwHpUegjC)bZcLa5w ze?$%Z5Bj3-f6YY}h?+nu>J&YW>Nm5Zo&7JS5JW>MHpNA#W48;HOyAk(H&FxL!$J&R zWFjyd-=Mw#`(pfJb2U##ZS4{K0Dr?!T))J$Z^szMcfPj``g@2jni$mi9D!r87&Wm= zI1odYnTuzPbvkNgOHoO+4y)r9^ufq zK@HFWQ}9t7f{QT*ucP`2S#ClbiEmMFhJkq0wx7dD>UXVyE7*VSP4o&A+Gf@y)VY2F z6`_1oj{IVu|AU%n_)0TCebk;eMdd&%)P&n%9QH;i&je2n-uEK4oTo^>9Di&gGEXDSf_%_4Y)K9NA6CL%MiCi|$p#2%t=l?++&$?^O zY3Yhun0pun?a3I7z-d??7h+A^gqqMnT!+W-Z7hDBFA$6-^^0&NY74^Fnu$iCJ|BmQ zKr&XtN3b^z$64ClwN)(S@cG) z4d(xd_+bq7d{nM1K}B>uD#E)_TW}oPf*%*ZLP!nB>n)qrA!*v*d)Qc^!ZY6%w#og3Lmhn02wLj#i9_sD3nZ3S&O42(Rhe73L z3lmT)9&XJ-<&t{>1!dZd*78H!yo9#^1_^=J4UevOLghL05)_P?A$APwhG$#xyJ@<%@5a=``I1{3#~i(@>x z2>q`(koIc(%+K>{Xbx4i2I{ z4mCgt>b+8|hl{Z$Zb4=FA=FKI3>AUEPtDe~$GX&eqxu<#ZtZEY)XWy5lJ6DU zz8Q2fj;dRNp!Qc-(695vyoSREJPSzL#&W9gUX zYuw%NE3-F;QAzX%YQ~|5O)|Ad4Va9@_$X=*58%rf^RYZl~inCR?|lLU;`W@n>7Vj|%a>s1E8JHK(B`_M*ND{qYL=;T=>Y|A*_a z&N0)z5B1&`7=quTkIw%O6q0DTiaoLMwhM`vC!fMz9m2^W2^U z%%4&cFpByx)cX@r5u1Bb!-4jBnsuCQ zpNJZ#1S{ig)9!W_Q1GYWCG^ELsN`6OnrRv81A9>ee1S@~6R3&aLap$wt^bSqoZoem zeAQ6zC0e_nk~9UQbpA)%2U9SO2PLSLo<((Z+17tUMd&Z9bHhx`2LosiLMMv=OS~M^OAoV>A1{#TH&WaHT9J#UX&>+N|j zx4WMweo{!7r%&mUN}eloTYCkyjBmxiZCx$fbx82U&R^r-s8FLbkDN*A6~$tvmF3D( zgPllvMU&^sqE`Y#E2fj}4)N`AvE=m0Pwx{JUt1A5;r_w2fe>ndKm;Vz&?SIM5esb~lQ5Xfgv@~(I9 zBzS&KFTfuSa}83mtX2YaD)n$=J3PeK-u`Fb}I>F~;C5)PPT5 zB`m|r_>7I$*?1H7qJJ9>#H*+UWVUvkTbSP&L8Bra&tXG+0UP0d)WF|i0{&#LU$^}Y zQ_Y0UFqZ4>uo`y7nm8D1q1*OPLz3q_jBRi;)?|L?Bn|ECGHU04U{!Q+mj-HwT5(_0 zjz^&uHWoW#j*Xv2E%Z5z$1SLF_o5c~K5|;l39N%oTk;==b!q6vW~d#cp&v6*6TX5g za61mbQSHbYu0&<*7km+Gq?v{8!X)A&*aR=2YAd0=<8;7OY>eaDlYcjj2k0QH&Kcxh zCxN@FV=t_Y!>}rPQ9GZGs?+;15*OS4rI<*(8dVEhZ2vCQefvMUXegx@Py_yg8Yr@}*+Bxbbiy5p!@l7UN>PjLOK| zo6Pfzk^Ydgg2oM8Nbh1YkcCR|U06SYj}Fc!o|j=3kkr+2>JcYn5PM)Dkkau&!VA~=i&}5#HVyacXoqsV-C7{I8GGKMV;m2sEL=Oz8_mr z6Yan|@er!GoA)%&J%Wvh=c6*Y8RJ7VwyA;pki|O3P$^C5Ws0sQ{z;sK>aUk+7TgGx z(pJ{as2b{vlX19>cOzxs96}vk#oi_}@ff0jo!T@gd}k15MmWw))K1>$<2WUF47I~y zeH~{c-i}GQ0qfuaRO(Nmj^+xs#6(^tPS@#%ZLkP6?iw79+xn4zoqcS7^JPlLCd64- z0ev_Gry%v?yn(rR1q*Q80CNOKFpBs*7ULz7H<1og012!OTirQgsjKRAx8gsA`=A&NEB71!<#u6_= zz2+-y9NI)fD|!tp;}PUr{9n{1ug% z#9=0r4Nx`J1Z!dnM(NNpXz1*FVQb7m73Cs~$MvX%ZO3-F50!~uu`OQ1d~88U>uq@w z2QX8u5hhb(Za10AM!hw8sA7E>V^uUy&`|1^p;o*GHSs2Fi91m{I*Yom;wW=Oai|)} z#E#e>Ti|`Dqgjh*aU<5o#dnz3@Fmo1_$h`)(zr;Y6ZW~&q{0r)f zSbenlgyy4a;W1QEm0}fKgH>@OYC$`(6@H6Nu-X_ie)<^luatY}&9!LI_^44_7PN)=T zq6Qd*)$uOdpNG1y2=!z1e$-JdMD2Jb>TEY*9o&Ls-#LW3FJ-(rigeUGgF-a)+6+gf z(uXRpBGe7VsFgm58u(Gv!WN)jvsI`CZa^(;H>wui#QUdeQRMlM z(Ud@itVZ4q_iXhgwh@ zuNl7&&L*CS+05^pqtOP3PBuHf54E!gF&gKi27D5m<5nDkCvgC_zQ-Iv0F|+sn2fV< z6+Vv~yE8D)Twjlo#4lq=4{Ws^uVX*rH&L%&G~3gTMxu&r66!-T164!|t*fvV@n)=q zpV{~{enA}XGxwiIUB8BvF~U#&wSXAESy?sYc%0g(8}7w8dLB?gxdG@4>QL{Cg1|2^nt)DMkR z-l=%Z#AUuYhQklxZ`ZyhHVi|VD_1Fo| zVh?O^ziN(PG>v+6Ou$As6Kml!sG}&yx_APU@Upe)1Lmw-p;A5&^%nTCGcLp0coZAp zIaCo>deCIfh2g*dN6^rOUc3QAs9JamwUd`n10TTl_%muDDO9ZP%S2^tB&xp{m5DM; zz~?a*x1l!p7HVNY%QAODvH9!Uq#X;B*m!fvG9hJFHQ1|^E^;Sg8 zHYTF3C!-eL1NE8~pcX!THu=|skI|tApGK{8BkH~1fid`wjXy*!>`PRpzC*o^*HO>K z&oM<>7yA$o$4Gn%HP6$iaW`NU+%bpq*9zaFBMQGnRr@!n0k2?HtT@*^kZ7%sy50;m zUvNNTTu(xk8IRQUueefZ0&^!djD^xq3XXA!>^CI;4DL((R$R5 zx1e61cWrzcn-X6^Rek+M=7-l!co%UAs#rfoCUUM~GFC1%N1Tc-z5hLF=*ID=GYVNB zLpSkKRBC^>{S_9Q0TWOQZ)EL={fM(rN3syLupRdL$JQTkHT@A~jLZDa8X5<1Jr2MC z2Q>m;M=h+{Q|6!7+F^J{m`?vyybV*Am`s$QYH1Co;I}v#W0#sgY^I{deHIh(3Wn;? zh*@S4qgaFZG;&R-5^0cXq#i*UXfsOHJ)Y;a0#=L$hSdBOxldvzY!ttn$ zMyxPLRuA=D+6wZo75B0i2BWHV0ye@N?2U6!3wal{gO5VZE|6GW{x4<_Jr;?{TypF>@r z^Q<|d1xTGaYp^liw8muME>s-A2@#xs8I2$vSD!Nz<*zkg#2~7FK4xI#I#XmlQB|Lf zs)ZS-9Y1dSw_+3G_pl-Uh)R9@^SlYz3_r)OaVGOSJ6|xrPG`JmJ~(?&6YR&jcoL)W z3aU2##95fQ-lX_RtU{drlBtdEsG^*LT3`uk0Si&pzusQIjtP4I<2E?X&7`6}YNDKt z=7D_c9Mpg-Q48CE+R0vf{k~1+Pp&dlQN4#6=X2DAr?CTe-c0>4&tz;(eB&#QvxoVe z@ig>6lUMn530q<~rPzshD{A5ks4rfHa`P)!a~wyUjcNEc>iVzvFxJ~*KJ9BTh4^*U z(VW5x7`c`FkDyVB#tTH&wbw&7o{!4NTGTiPaSWcs#@IFVhDpU3tVl<$jqgECRD@dKY^;ZiPy=qX z*N>tWe%ksw>L_ZyX%?J@4T(FW`fs-uVoQoK^aPEwT-d(HbgbOVZ@k3szGViO`L-#> zhcJu&4X6}eMeVrjKC|%KP-i+4HQ_ka^%B%`i&4*gjp>;DPBkD90r*2Q6{>v^aQ+=qIt_F+S8@UiLdhD!NtRR4Uegqu*$ z{|#gC9UFg$wTMrBO#XFdSL}rvpO}G?QB~ari+2C<}aH@ zsGWDhW_U9yLj|Y|O+$@)?{V_40Ux0w3ZKLq@M+Y-wxCve1hvDns4BjM0ZczZ!Qu0$ z%r*GbjMp2rz+12}`cTg;KrQqb>i!EM8d^a0&&&f2F`c+Os(%XVLsMeo1vr@a8SIYd zu`9OtoR1G?<4gDfYR5CaFu&kDfSUMmtc~kXnF#Hop|jb8dft6xC&3B8)toIu78Uai7%rj`VCb((chZ|S3}+J z!#djW5gJ;+In)j-pEGCP3Uy}PunUev72|x&!nK$f!JplzwvR@cVz7Mtd$?My;t%O#U@t_RnU5d(lO_4gGimb8z4AXJJ+U{AaowczEp|2ylCsQZ7#IJ}N3 z#yCC}7;>u7&_Fd&Hzc8ou!W6pve)~e-jc!C3GYD-^epPRb*OR5F%e(0*ALnL53MJx zUttw}an906;(<$81LG>11-MWHrlE?bvyE@HjPk=xdDzDDQANAd#xJ7=ehn+(ej6Xg3dCPvHT(*-&`YRs z|G-Cin&0HH>$r}h1c>+Dl&kt@< zE95Hn7r7?7eXe}B&zY2Lg%SAnO{>(BO1WdFskfQN0Rbl_Uh?@CF>9Dix%&<5lz&pXvq zSezPO`(N{!?c{rW!SXh_>no0PP4eUwxJVZ}E1Hn!2~6_)gFI2}Dqvf_px2#8CY2ag z=?;>PVwbzn%PzwE^|RqZS3zD8S=7N0=6hTuDu)S!fwtuzP3|9E#gjMDPj}E?8qB$| zyzZ2Q>Q%k&T%SJ>^iFhf4({@150*t#_7?=bexEz9{Iyx>72?{rN$b!iE!~yYC8J~c zwb^H4k~38U|E3z^7Ve3!-lwRrkhQzWX}B-~<)>CGiSO9|e^DBq^64A4CL|0FSCPl2 zqG#!;O|?r?ch)YyW9ONq(0@DN|Bq^k&E*LGs+Nos1EQm;lrs-(E?u~%R%wl|X0{ta zQKtOQs;BY4tDd&y^S`PVE^-yEwPGwNR}Xv)Pe5)-ojwS-Df9jdu?d_?j; N%V^t!5fR@<{3kdnNcaE% delta 10137 zcmYM)2Yk*~-^cNPBtiBdf*6SvL}Ewnk*cW1o^3TqYL(bjjSC4vwcLWBYSTecSMAZJ z)oN?pX;HN$X(;LzZE;(Dp3gVuyq@QN^>x3`IsfxN<9Eh&;G*}GJt#Q@TCSoXd z!+6JWIYUT%LBT3a#;(+^jytdd{*3m>dMveG5DufqN1Ixpvc+2Li(y9g;jRDvU z)ow@h!*0mxIIm%OOh=bLi8Ult@e|Yx+&Bi0p*n05=QwMzC3eD#*c+?WHxZkHpO9aH z8fd!)juU~suo{j*?X9KQ2zO!><~JbzgGqQbbR44N3`L$fOECn$!E$&G6_GzsGk=QO zr=GOth2g03N*IbYP)pOymbXLIOGHH?2?KCIBjO)IVwim}6+4oji(T*pYUJUKZ6r_~ zx5TB`4Sg}+mfy8{G%=et3>DdGs1EC4Ft$KNsEdol020GcGt99Sa#17Av))C`=rL+0 zC0O_%EQMOjaMVB=U~O!P1j$K79m^G{_YR{5kb`T`^)m^DZVZP}4NgHdG#|A$mSPyL zL)F`Zn$ZzdfzPGMv=RwCDSRc|RN}cR5ic!l|$q6@k-O2CrZx z568KWi^&JJFaubN70GYKiI{`BC*oV0fp)hJMMZ2ns=c|kd==`L@5Bh5|I;Ki^4oX- zA7HjBwBo2>r`Bvt+=Slf+s3SAFskD!sQcpuR7b5)OWGZ^xj#j{=ik=cE1{@JHo^e< zcUmZciAdj0UsOn!qK;oS{)206`G@VyfH$I+=rijU@Qf?C{`k$L(U;g!lTH(ar|H6gy4%f7Pq59U%8VBZ8Mxo zzBOuK`>-nJqE1l}YEwQ#ZRVgvldqZRGRNZu3L<&%29`n>YM0N)<@hhuaf#~MK?l4q#LTES5bQ@8O!1j^u{Sz6K7zI7H<;?T|ocF z0KAEe%z1$Iu|!YPaU+Z)ACIH)P1GqlgPrK9CtF*QTHVJ)Y6I%De1huuTU4Y@phABh zeYJV6lTgQZuns;(edtv0Ybv%wEm3FG%w}R!Ovl=I0JSvvcmr=^IsB=gIex#Rj$gU{ z<`~z-c=EH*rI7C<(NG0kTbj{s)YaSYRdWM&eMVjMRJ>qgpS#6TVXG1nxyKN*8U0Wl1tWKg(+r1V1{OyKHSqh^=cs}Bq!d4QITcB0CXuL+#GqbiggS<8 zPy_0M8hJ0&o)~POPeC=9fjew(&i7h{ex*smt{B@hZfgLHogI%%VTV^7& z(520kMMArD3u?0*ww}PcG%SSC~g>l3`fJEFlvx!=vLYsuKI1Vf0I@B5;!CH6*bs;@LMWpO_bBx=f zB9MSOO|M`L9E3?Y7enw2YEu@vNNCf9ad;W5(-bxGEvO~=4b|aO~@vI0JiQ z=}CO>;6RMSUDj(D;=%GvHWP`QVkXcPL#daF&CxZ5gc|-F8>9c*Tq4*GHJ};Dk#+83 zckDjZe28qoWb%)2HTHYQ{KfPq)+XO(n%TU=P!ZjUHSrAA!N*8sTu$}rW=4tFM-@;N z>dY{q>V=iazlmD2IoJ}jQEPby6*1qLX47@XisZYYB0Cbpa3N|b)?)?y7K^|CUn@=! zVyw)AaQ1{k-W0XAuVXWuk6My1QT2Yo^7uC@asji<0NbNF?2F+z3d>*yY9cF9?e4*b zyz5*i5rLtzO~p7=$U30PhoUyk91Ox`=!cuJD(*rJEEg4_o7QKjV-_;UY|1Lwm3%Z- z!O7^-OqP>S$lRz7PGc}$wcfMOb(R`Z9)UWRNvN6iLA^Hu_1;v}02iVLumXK?lg;ly zMdnaC>#yT?h625iht2UWCSY`ixd+}tbubpy;4JjP_fP}RMqN0&QM-FTs=X5!i04uD zZ&-`$^Cua^Uk#R=Ywm$EsESe67*s<|QT5teyW$26(7k7BiY{Frv`g2hi z&xh8n=uLhn`r#gHjx9fBb)6y6jtUo0S7^oe&Bzv@2JitgQK!^m(}AD0ENV$Aqjq~N z*2M%{o`#C#Ow^1sQK#iYo8OBybpB6}&@L~+j_AL{Tu41pyYw>*!jsqlFQe8t;9urX zwn$XH_NXNqWF3uz$-jdo@v<#1K($wdVf0`8Lyl%pZmAhSJ=BtnM-6N>>iJ&lN!&m_ zAJuS1mifcwUF<}@_cC)euR#s$K7NA1%T4|uYEN9i9_l}Ug(VbDGHNqrU`_lEN8%qC zgZ;8i!|51G{#R5;@1O?iwbC53NL0r$=!Gw%mZBT#y#dxySp55+i-cyf2(?+VYgc`V|y%*`KYCMih3_(jTvwhsyr68Srbq*Ws(wCd32vd@`wQR3 zAlEu>JrbFy3M1E>HJXU*8)rVMgGw7r1lpkT{cwl}S1nE?e|e+nsK+LABlbs?Prw%V zJ8F+r-)tt5h}sLTH%Ms40YG8fJk z)KYB23Yde6z$Mh)$j5Yih(y@syz{Y{c{pc8nUQdDdf*%G`8Gj?)nr|hpVv$?!s1h4wEtTb1pRccgB-Yg-yuki1R&$V~^eD z9vFdIlEqj8ccTWl2b0j(ZGMpGj~oo=J5=b0d|?JS9jB5{$9Q~>ZL!H7;;-E}k%R`Y z1Z(3SREJlwCVK2OS8X)tB~dE(;QdPq80{95fw_z?tO7Vh6lu%NrdsYuX&OH(o-W>ts}WTQC%JQ3EYN?UmaY zf=^KQf&XFRua3hH8)H$CNI*3(90%ewjKT}32s}kk^gd$pKBx}Lpg&f}ir4_vUKjg( zENZ~BtgBokA}H968tG}&u{&qW|F#AnhQU(Q0W`s>k|glZd6@I=+E{C(SV#jrrs^ zgWVkz#{wH_h%DIMhhTp+db7RevX{{$Xs4muz{^ujYcOgsK;ZEwLqz zz$v&5^H39f&vn6kgIR{78V>1sGiEpqX7NRz*bJeWjEL=(U5$eia za?R8~gt6qW;6U`dZXz`THLy(l3U?uqa5>}hOb9D;*0g3lP$PfM=HEhvdJ-y>%Wxd# z;zaCFVAgyeYNn^KI$p%}_>V1L_nV36c2xVj&_`4HiiAe`BM!#eg=Q%hqB`D$ip19# zg1_1453xDFFY}u{gtQYE8Hv>iN-uQhc(gXnfZ4;^|3kmRMeWT#XeZ) zxvB5MQ1Wi{!S7HZ&c(KP9yQ?be@uCbbtJ0(IMg0;O(Wq+BGbAE)zA`KAsZEu%{Kpq zeV&6=DE}Vg@g}OBD*s~|u7+x-K5C%xsOOz+d6LoP^tJ`Bp++_YBXAU!!A#Tu)}R{P zj@mqKn?GqiW4(xeJkP@@ylcyY9FOAn%c0t@jQ%?R&FzDikSyO!^?-{6)$v8tz;2@k z@VCuBMQv7Z5A(bd>b+W63LD#eODsV?5reS{YJjh!k2)MqLJf~s0Zv7AoQ?sQg$msU z)SlRalkggipUUDej2KsOw|3c6ut2ns@)$^{awVqVI=Zw!6Vd*|DY+DvNsnWEnM?)%?ZWNSE)*Rru+H&l>zP(JH80Y+Hy3^z4_?lh^$#f5$=RbF(v&b zL>A0h`n&sZ;oL1*fqAk11+#Y+%wAbAXLiBtZCUF-D3>*GuYcB;r-QRb=dE&2%n$N* b7vB82wEIEP<0%QXdwYYkx(Ng3{7f~&VigXlXD;i2<;%%0i=aUFN%Pm zfDjNS&O6pZ6eKQiQRY()3H-S%SyrRI0%CpSymK|#Xy{I zy8;^%Z$v*lg%NlT+gO&@x*718j_+b9erw*Nun$&7r+s}gl054fY=(QV660IfX=r8NqgMVqhMUq6a^?j$M`r!g2mY)Sq#&}a6IpRhY| znRv_UjXhB_Ux}rez>36&a0R}P0XU|Wxt?h|6P4K&sLXCc4Y&itumqK%Q(hXwXnclR zVJ9|J5A;RNbhK?IYDJS!EAe6|&PDCzO4LMlVIw?*B-6TyI+hhVYkIF8s{c;79=%V{ zP)hHkI{XpUQQ5X;1)*4(xEAWUmZ%japfcAD)p0WFy%89JsW=4-a3y|^%E*Gp%=;^m z>t1UkjjG&;Z)Y;l8-ZV7xG(3zsxJnOnWHopKQ_<1MvdZBC)LuS|8h9P*`*8p@&|w^g zXHdo6u(NsZuUMCODJqkDFxX3@L=8NNOxC)DN@-{pQ*@Q^5phk_^%{w0!gWz8ZDQLN zRYTn{69?Jx>qr?`XHZ+``?$$WFnTFqs|pPY-|B^lK9)5DwUT39Eo&xTLalIMH_IA= z$ygI#!D@I4mHL~gt@#-nV+2Qu-L*PkGt5Wzy9EbfNq6$Ey$|eRzD$u=pSU-cK{xir ziAeoe$1n|l#tAqk$!x)SEJu6~3-AGIVwpWn%IBa?(-u^5?m5F>)9juGLq6V(s$J9og zmxfZi9Lc&>gfVy(%VIf}AA|w6Rk1d41Jnv1#{e9Gewd2>n2kD~`S$$<7)ZPVb<8)~ zv3EBO&FD2OkLQtZk@XR(m_quQ4Ae$Vv>|Gsrl^5h+HnGE?-Nl2jkK?)+p))X8dm52 z0%U<+>vSHC0!gAWQ1RC1=F4z=PQAN1|gK;NnVuvsePogsM4~)fMF&i6E(mE~AVG<)% z9&9o-D%oTz1$An&P{sNT2C8V5&`|2vqGr4WHSlh1j7Lx_x`TSocc|H-AXJScVr%Sy zjc__@YqsJY+=W$e<&)+ZzKlACAE9>$jjw66!LGwh%BNxr#ly{t@=>4SA5mY#@R8;d znvJT3#i*hx#0t0tLvR;rLPxL(evb7qY?SFgeiZpv%3WO01IsZQk09G_-Nw=)8*P4S zC7|}YH>!x7sQc4UTQLWfv3;lsT|*ta`>5xF#+Zp!LdB6|$iGtFlnb&AD#eMY4tilY z4!5sop`Ob}{TQ8v+N$NK6>mcA?QX1w`;qKhXHd^YjWt^lj~b_!mxhkbAXF;dsN%{; zJy3v}>1WetwKXHYlxb0 zYukRPB1yy26k{FYIjAar0X3o5QG0#@Rg7n`4_?BK=ooJX9*w#_4^#0X^1jzijom zI&oY$j&< zU#t8CerLc@sAKpJGPYHBqWKUlnMnRSabYhP=HLT-9P@I_7qJ9Y#owTQXvA=)f-w=p z@Cj6^$6_;_i?wkdYR}JOG~Pjdu!8eUrW&Fz@jx#Ptuz@c;uvgzx!4z1qf&ndH%Xtb|3_9(Q6Jyn~&v_AJ#L z!AKf4xG)au;tZ^e8&F$OjMecf*2M2^L!LH!-2|2Lo~Tpc!M3;-tKdbfjbEaQ*nhUk zoC8aL{~t_417=`V^rC8E6>23fqdGo?E$|1_M53rzJ(q~e*bvn90#qi7Fci0AAeNvO z_!eqnx6!KWfSUM}dE{R&F6M$>T#uURF4Va{i~;zz9bZ6A>=RU`?xK$4AE@_&=bIv}j$Mfd zVOd;-8fQJK-&e2#9-hzsYld%ep&WjKs`k%N9sZ0V=)1tY5Mf&jbw3)_VN29RI@|aA z+73lM=R`f1Z95eY`|__~FO44DNL*yTOwV9C@z0ooV;7s^JBba5Z=hCE_F2_Ih1+o=E?iXJLj72}3i2gVQHNY%8UW7_v zAtvDl?2DhHPD}hU>IM5E3$<3Gwr;)cR-|9AwVOsLHx8nz_ifa`w@@#9iAv%37>18f zrzLc`sp2RMC+>h+aX*a1d8nd3fO`KlDpMb##(RjRzyAlUFvS#&dax4)V=qj=CsDOg zXkTB05yab38F&qqnG;wa&td6z0@Y7Qp}AiRHKB&+#t!I5{aG*5*n;~|sZ3sJzSSF1 zd-MbDz=$F<(IXf``~gOx&vWKm-VpWSNk*-72~NX(*c4+|QJ^>+tKeGn>Wj43zHl0q z@|#!@@1c&*BUEO5SDTfGqT>3f+K5Fx*T%ly9)pOJP%9pc%0vcs$H_PpkFI9_qiIxL zV+QVk+S~59A4i~G3|nhDs)L$XJnFe5)I>(12F$>!I0>ua63oZ#7>>2qnfK#R?{!^A z{?&Mb3);&OsFk?v2QyKh;F+jBUWZEkHf)WTP${jj-n{o0)G6wR{MQ=A|0qKbF#^kM zF!w8?#%ll9W?bpLPo`_c&E<)xEJ{=Cl^kj&VA%ovyvuQowyAu1N~7ePsU8l z#F=;*mAS#&%)rA?6PtVea62{12xQ zNJA-2#dN%Y(=ma{(q5Nf1-yb&@g~;5k*}H#Cu1=2TGRwyLap#9YRf*tDEu0=fQoxf zhT88X|LV9a7mBbiw#VD3)YaX`4ERm?0wnBYEhodGq6aDZRERRdE60Sy7_bv>@L$;@E zucAIgU!b1zDKWoa1feqagqMZ}7=^x=h8pN8)C_Y_15QO9!#Nm)n^Dj0LUp{~_83+r zK8-pRw@_Pf7xmt6s0EilWd2>?twDnL>fxn9BhS!sF|O_W_SkY<8L?% zXY=*YpVxd}HyP-C+zd1jRqey=cnYfDS*VFFL#2GZ9q+_=o&SS0RL%ELsVw(~`6(5K znn*G}jw3J{H=^?}$1U%@+g8y~~dCphYiZ~2~N z=5(|U#}FTW+jLm{9Wziz4C8ut)C7}Jd+J23FdwzI^X%&@FoJj+mTnR1xs&LRm$4sS zN3ZrS=9GD%HP$2UiTdr^C;vo#dyI2cOCCf>o0 zlduZ$fOpBisxjTZF%`Aaxu^k(PRj)`a(D{s;#thbZ&3Y=JZ-AqjTMOJqZYEv zj(4Ij@qW~V51l6e0W^+tK^?z`8u$V#g`c7(@B=D^KJS^m3&-Wey>Jm;!+1=8-@Lyb zs}jGAn%G;YQ*jyf-T21V*L%jyq#D-Yh69zF&Zr3`V=#_H6=Np$K@WDsBdDT$h=Z`+ zS@VCp<)hyJ1_SX&)Pk&YW&#ya_q~m11ki{@KWvA=*u}oy&yI&-5ZBXCsn4_TuS9jc z2`}J2Jcx78vwCdL#h!QFD}i4Rd39C_6^9+k07)YeVLCviHa;$TIjTNt(-)wTQ4e?FvhSff?|22#~h#%r(n0SNy zccd}(hN;R!s0o}w72!2(i1%zGJ~b0fKz*_Y+j_7T@j_IQZAX4YSQk+lyNv4hIx2Jb zaU52@=`}Z|+%#Xl1*ivh;3~X`tugbKInSF>dw&Rr;x$~0t!|r7_c?SD$9-nDY&o_d zK8E^P@tu9$_l{X`3ongu9_WFs@JSqr&teST!**EpuK9cZ0DOx0B#y-vUobgbfr|f$ zYjE_J=I?yJU=(rhd*+AQM060Bpsstb(r8HI5!S=#ugss23W4qOUU~lOI{Cb|3 z`>52NM?H5LHPCg`b9YfI``V6w!ZO6aqx$;;gE8z|lgT<*`uG3lG}K`mR0o|NdH7lGO;2WpGD*!D%eH~ayINR1ROXh1h=BKdYa z!;a^oR=(JFIclQMq2AwwdT$460(&162SiWytK*7sq_~{p^D-tm^IR!04o{9F-<{#k z&2wgDxl)Q>h-n^BZcv^xFTeOoo2dcuIWAXrMt-g%BiG@{&v9gBjCZ+nGu&wor#r=w z>q*U2jIo;(hy%1G8W4FhV<#DIED&#mySL}){4jnhJY~jw-g-u#C$aPH4 z$jWj|aOGrpQZmM~{sKp?i)BT%l#~THX2`tND^L7cXi+`PWu)=>=2p5-* z3JmX>pOeG19i+3gCUT2=uA3Uzy2t;ZDqO{HY%2*4V5xsrM$Z1VRsR1}Mq%i<*y6VD z`IjqPcYa0OU@9-_f4fAQUO4}MUn0MJ;PC%1B~ta;(vZ-U|6C)5Tkn1G?-E)3)g+&P E0W9HPyZ`_I delta 10178 zcmYk>30RfYzQ^%bnPd_~5J%Xch>D;nf~m)x2t9;QY7WN{wZ5T3Kcebkv+GyVp$Xbnf@(dY|Xs9-rs4*88r#)_?uiuz?O<@|b(p z!*xEybGgNT6B=4pYYc6wnq>vF|3CXv45VIynOK1DVlKwUTGlXp9%Jw#`lELTV+eMn z9)aFC7(*}oxn z6hFl$`BFcTZ&1~tH4sECiDQg{{>*d^?N*X(*E zy(-XH48#;vzp3btnaJu`|G?%r4_yHi)>2TzEvOl|u@sM@224t@tXk}iX?PZgV{{jj zu`1j`eFZAeeqAlA6%NB_EJf|DW!MdOU=-GOCI8tJJQFR8>{xloJ8Ky>!4I$*euc`& zP1MZ)K_pa$-Z%P)LMq40_ln!us4z7(LUr^k zYHuvVFnkr&?j6*O4xuu44At?ssL!3p5WI#@;-B~uPD?TU`SmoP4@aK6tSAcMG^j&m z-~=|s@3D0Q%esv(Qg7VL1W=1Dsc*(gJdC<0l6#v#vuyKF8JmgfZ@&F}HR_n}z*ai{ zCnzZL>$nf^;7T>v$$u;l%6OoQVioc|WF5c^d>7d_R=^{i5FCVMxDA#1 zHfbicDL8}r-%x?=!ALxbIz_*rHsznF%^Wn?)MEy_%<<^S0|zh0qYt`JyZl*Pj!RL; zDRziuCE#ex#OIJMtZ$IyS)=}L0$GD80AqXt-QKi_26x7qGRE!9!<#Piq;f4~4G@4hKmK0__* zBVL5!X8ay6V>NkRghg22fJXy$IZaqFoAk9PC+N?l$^#iMtYpBtxT;MVKVg^>a=V@4g4W0 zQ^!%MKZAbSJQpcw;2YQx@1eeQ+CE_#_Cqbv5Y)_OV-K8%9dI9NY3lI`UdLwm#Yl7f zencI=W~0n8?u5zI=b%d|-$Nl$54g58qg|-0H*t))0f%x8M(}(qYK9+U5S~Qsm5bOI zucHFGhn+BbtU1;hsQ$|^4%egJpBPL2+f%s51D4xzjI%cx22-!XFnkWRiE8cldr?dA zJ}P5BqXKF%-W<1%sEiCj1@@R-pNQHc1-2FA$-mZOHV@Rnv)BYzqMmQD8}32{bO^On zCr}-qL#^!%Y>u~)Y+HU4OuI>_r6@!7_blqvEJ0=RO&0|nvt4$BI#lHEp*lW>3hXn~ z=J_5K;5F1t{y^;o?}?UGfqk$TccL=ehTBGg4nj>}7-|B!sDNGNc3}}}lWar)19gFP$v0mbgHV|ni34#uDxm!si6?PB{(_8cO)oIV@H_OP?ptUk z7KGl6Z?&eN4%=cZ4!{g7!Zh5AzNjyCb>N3>F&NijlKuQE)cx?CUB778uV5VbF;d!pKhO)>A=p>}y^RG>X;?W&RiuD}oxc!R!v;JOcE}VVX zm-;!Jhpo!Yx9qE^o39?Vq%EeB|3C@}Q_UvogGy}%#^Y3MgRi32_znYajLN`3)Mq&Pop;FWfui)nlKJ8!CE~~k#9mR$-hto{(;=aR&=Fh zEyP(k92-sJiwDPH0`9cEfK3{(Jk!lY993olLotMQx%d#eswk-Ax3N10Jjo@3{ZIkT zLXNC;3$rk5hWQeC4JS~)i)(P?Q|33OU$F!AzE7LYn~%!q4vfLm*b(m`nQ>WdXPOxe z#t~|OYS3|(N!2iHP2GuFv$@zCSEAPPG%90$v(2U(f-R|MqB2{AVYm>r6zi}Beuxi# z{=e{`K#H*qFT&XqN_h{|+K$B(d=|AN@1fd#jm`0YP?-yyV*>1t8t@4W$6{=X)u@TA zLiPI&Ch}S9B865M@?WN50xD$#P|x#Fn`SNs;Y;X`8!-}hq5?aK%FtEYKT*f5$y~E3 zBXB77Sd75w=+aDr~yu3FrK&l*?zCHl*sc|sAHLdn%M}{=L%7un}G^&Au50s z=!YBZ`dg^X9GJ)Y>-e4Kfj)2vAHrKW5M!&&Jun$HKpCpTIp~WopaNfsx^Q-(cK2RX zf5)*goax8ViIRnn{73=LpN$7-=O;Y(M6#xg*)hnEf$$IZHL<3gRmZ-#;G{|d2>2WqSo*} z`eTb1%uHiYOOS-#n2K7eM^XI`x9by76LsZNNTVNzQGuO8osJ)nP3yAmQPA!Ve$mW08oN**joQr%P#x4_ z2i%H5cp5d}52(%bA5^>WC1xqxVlV26=!M1h^K#T4nS;KJZ`DvxYF@!;d;`_-aSX(( z_WL`ifUKovt;0|=t;P+w2$jh$%gohWg<7IdaSPr+1-iV({HnJdV|4z{Qb<7kJtPIX zp!P&QK8=eo4t1sb7tlhxz5$i;{itL40ea#YRA$a$2>xi-|3H`4&}W5d z7=&sVirSqH48?d&s{_Ha~Bm@z$(+uv5Nd_ zz+@h1zyTPJnb;ijaT?CSCiokwgGQ@Opsj5?pmuW-YQ}w0?FOQ*+>xjyuEfsh!XCJ7 zHThRc>v^CLMz1l)C>GaJPex_vG%9u9+3$Zs1^#brhQ2SG&pS|o#9#~Tg4%pTPyuA3 z0vm%|s#b}M!VU_zQ60X5FJS~6D}1r{^95`+d#fd?pICevlQBr=f0zB@2&&^RurGd#-LU!V{D{Q> z>DY>T?HlHY%Khj;y)TD54+mfy+=5E=F;qq`U@YFj?$~Cl*>jIc#JN8=S# zNB!P3U$^5in)(uKh;AH%by$Q=wwW)TnK+aBWsJm0+s$5@i%(I19$TW%Tc*EgbSXut z6coTP)C>zyYgLUgxC%9cchLv0pfCP}%kg*Yjf>gI%G@V75q)=>Q&fcgsr$T5UpNE@ zVg1|W-$5aEmr2!N97laTYM_HS7ms2wrn$}Y-KhKEAZm}CKm~dM+oIQQ6JSU5rrsU3 zr+Q&14n#j3wVV70QOMzetia|t&u*|52T*?r*jgDX%o-GKG@4l=g2s*d(-%8Whce?&aK*BrCU zsAG2nJE0e6RvGDv{x}>J;6&5}T!j=g<0+^aJcC_uG3vOzi(&X1Dv*HvCQ}iZL_Gl& zcn-#60X~B(a1ORPz_PJxYf%}v!sVfHZXui8W!{ z?1|1J{Gf@o*oKahKQO-m4L@o++>M&qH>gc{5f$KV)RO**+GD{Vnx%DMQ^vRADTH8u ze6U8Sh7(a8mf=u*618^6Q0-4*6#jrM(CeS3eI&+FkHrKWhK+G9YEv#n_4^h+IRAAN z)bUZ&?*0rF`5C)jkNVQNiP{4m$4t90)J!8$19U|#*~6%eW}p}5U?dje6kLGn=k77` zuifwak?AlBHIq2Io{HL~ndpPVP=Wme)o~tb;9^upo<;?*7?r`bsHNM6OYt%;!m5wW zUh?>a{HueMPs}lV1QpqM)Tt=LP+VYJiweYz5qJQVnX{;XZleOYi=OCp+-yQW97a76 zpTzm7_J6r3_*3xw)XX3lHDFs*gP!PzebF0-pa#gYpO3feg&4r|DpabgQJ>q0%FGV@ z0*@e9hxO8DoEUVapD=&zx{IB7(C>4TvdP$p`bJcM+p!w=;aKc@(xmidjHVt>@5)>j zI&cz>!Fi}XavnMF*3Vdjfu|ny4d z3NZRh^Z5kS`A))hI0}`yd$!hBrhgyw)cFskFp35(Fb~Ty6u(8K?kCh5H~89ousH@% zkHL8CfeJJSHId2a-GCIM_SVa1%#v+IWppoUX%6FqzyEzoVHOWgV*oz(jY-*f)M+S1 zb+o{)uR?9EU8weZuqz(L5qJl4G5uTfquEX@p&oSBTx_#(5cPM^wU)wt3XkB*@66ht zM`a-VoEf+?YSZ<`SR7(I6&2uWY>95$6WE&iHPoK+{@(oHl8DMw5^6$yz9;`mSvn6U zVWs`z3`SAEf_mTRyt#T4u?O{!F&zJcTI=u&<`*n~;A2gl+~?2JQxFn^$!juq5*;$&?1FRp7`f<<`Su8+M; zcBmi1$8qEp^MlG(Or?I(MZrO#*;Vr*1(o7)s0_@O0UI_uBRM zusQXQ(1Djwd!*qt(>@55`sV11u2>456cW(`lkFG1YzLv%ekkggjkTW_pfXjCkyvfN z--sG;C#t_gsPli=uAf3*>R%gO)kE!Ls1i$fK3?RnnFPzbfG$&kDA#FsD>}0240U3;bwdkFQNvH zziGa1Q_zok2I_O8P)n1C0r-q<4eE32@Cg;RQqX|AQ2`vV>mS(lPf#;HWqSrS!*i(5 zUq*fIXH)=pZ@L$@ukwz{t}HAq>FmgLX6IBEPJd8yWS8VRrj-&Ssu-@NYmk}A}o|u#A*)+Rka)l$WwA@iPtvsh7yP~ipzvlPyq?+yd z&%0kQ*x=#bRy@$#9beJ7i95Zzrh)tF{B8{cy2dB+FWJ$xXRjo8%yV_VZ5i45|HE)P zoFzo{!44CJUc2ut9p~R-@U+6*!hEMAroxftoaCHVUg<0;tf+97xbt6m%HJKnr7p1M zR-K>wYTd$SH4}5<+_5Koyv7c2<`QV7V|po(7C0*%+1Vu(gqxSgFw?V3=q}2UImJ=w zbWC#Q7nYPbNy_w6XSpN0xT458skqRYSLrBnI*JQ($V8#DqS!gD(pl^%Ea_Dff4at< d@Z|{)_xNwx__+67SlqZ~?Roy2kNSkU-`@2w+G;3PM7FBn$zR&;k(l^zID7}YTUNmOjK(eo5;!X#-^NtTZqFEwz$h%kaIC=yoP)aI z!`Kj4Vi^9>?r*mH+p!PhbvO`zLQNpAgJs>$^Q}=d>NBtrTjEogf`?Hz{sLq1d;9or z_IS%o^T2eBdT0tlDVjk*& z&*56!jRSCON1}%7P!YR~Ph*o#W}^Erk^XUPjo+YZE4H&`b-_$*h54O{zl+8L3=mc8 z9CEG|%UO-F4>rRQ7=xv#l}|&}>HQdjE9~*r7)SpJR4weX$M>PmJBW(JQH;h9yAXdp z=)8U4D)y&eFUPV5<3QBRS70y_*o6LWT!wF91m<@&<5O&Bp(48s71?#D2R@CBunrZW zBLN!YXq-o_uonr{2}4mcon$)&wW51bD+ypM&PC;N1!^MOFaviZ!L-hzwq+Ccny%}C zx_>WRgMr&=D5T$@Zg?4WqmUcT3SzM-{Up?RT~I5^MMbV3>c(SG*G<4UEW&A6gDdb7 zDk2MRGS{y_#sk(`8qGP7)5AnyFe=33G0DM82ba))FxN~Vv8QFVpr49H>s9ZjTdhp|@ z_s8?72kpUecnnqCZF`&R7GethC8$X5z~}&tIyLYhGFj^cDx|S}Owq;Tuk;g9<1O;c zgi}xs{VZ!Vj=@BH7H_~KsL-E9rREy8!#K7Q*|mO$Sy+X-?*<%+b^VFIavyoCc{8PA zYx;w+9(r&nPDSd+dKruH8dhNb0F#2_7)t*l*5D7QiA@=3LOutzn>L_|a|dd|2L=*< z4V+{k4ZlVwHoncSc2vl6aV7RcZL8DB%g~A%qz@6&hTO_}5Q(xC$;(3%8HzgpFs9&j z)Poa-nA+$VprOz%MWSx4#7sPiAsEW?qcFm@IVRI@gIeJ&7=aV80Ty9HEJtn6D*N~X zjHJH|wawSs{lIn_n$e3GhR2b2k#!1HOfkbu1d>q`ZHszP2h@YQ*!^5o?(VW^UpOGCNugB`F4Rg}vx8n>b*wi`R*K~yBJU^ZUIa?GHl zwOby=0X(VcC=;oPV@#w9QM;xLRjj|qNEOY)G!**BP&3|udhm8^hkH>gx_~;b{#cWu zC{&H)VK=-LGjIkfHJk7PZo_7{;!d*-pFwTIQy3Uc<69ctvF|t&^6A)F{qbf+Rj60- zWz-w7@m=N>T8^rP#i*iMj^VfgV{jX4LVK}2evYlN(L{6qoQcF=A$K#N6P98+?nTmW zox@;}O){Taxu{$ZMir3@b^Jb5D(0Xfwi7j>k5Sw18`ODG`DSAAsD5fb@mI(@Fd)05 zLY#-X!60mm)Ol5?kJ0;4salF!@j6s)x8n`C3yHpU40T@G-6j<|sOJm{(9pIS zi3+6$Ra{l56KYU1osGKjBGkklL2a}3s0lucn%I6+Exds~{0+;{=Q5G~6gAO?lg$DG z&1h(5ZBaAsW;+a3B*hpEF}9>X2UW#Sq9(K-mGjq8#rQT3!4r5hIt$E$C!xmYVG+KE zTpzG{6q=RvwjGQL?O4D5FpdwU*TKWB`ZMhgV!PTgRJb|i_9rp2qsQbN#JMbK? z#N}?bs`h_7rqhvuS1<*CKowD=V)Ni!+x|!aTf=caZo_iyT4G)(PhuSXI#i^NVqg3U zHKD9hbN{|LkA49b@_g$n8d*4Oidpdt)XHXK16+c-;iK3VpU0v22@b#x_m~v;P!XGn zsW=DM;}#_C*1$4zd@F{~{}Tpu!SnXOOW2?OE2!<)faPgLqftdxf_jlmM-|ah+x6I< z{tj%2r|te{_%Z!xk2(J$>iBgGLx-36YXT8oGqXlWdaP!s6Yj$(oQo>XrFMTS21AWn z$x+me-@#7!5%Tu6!YcUAfD=*M@G$ahD`l#A5j{MW`1fMqIR@t74|oguE6p3R4pqh9 zp*}P+*;CP&hmG)dRH*O9ES!tUxD%E0^Ok}#FRx|;1;|r+czay23R1qfOG>pfU*b}#6 zcf5eTF!_Gf9G$ypv|wN|rr=C$iho3Y>BH;E82~U+=r<1enjmG z$2?;k>Ub(@;=NGYv;sBpY4eD`E?mrjE?k3}={D59--8i&$nL+3n%Egsq`p9H$KO!b zMb9@ynt*-jkHipMg?i2!)P0}DaNIMW{A-4M;=y!O;yy6d`wr?P6skxvJDnuh~3s5QX zp&m3BRivvi26v!Rvmg858+ZsKmYMs#i?`E1kM*(Za+A87Z1a#}4OoL{L~}wBDrbId zjJr|W?kK9N&tq%UuLhb>D)z*iQ2XDH>9`iN@E~@>zoH`3Zl&2Jd8i_GV;k-Nxil2w zr-K8Q^(pE>p^x&xff?8k=c5xJMonx7DiUv?9&i#%@ds3@#;-D|T8E143#e^;2)+0t zHs$%2>krI`99820`j4(Q@9HzCndXqVr*QcBiFgXH;}z6(-#=-pK5m2A_P1^b*!zywR8({b*bABTv>Q*~!iHEQUevXPr%4T!_&H)-q!BEr$W}zam7@E|r+c1p&0gTrEf0M>ILU9VUf}A>Y!EM-@{v3?L&6tI?$f?#@RE<2k+q`IY zViWpbq9XGP)?gIN?t=5N9naZ=-RPftiBDdhZzb$C+bDjY`Gq41wLk0aHxucBnwSrJ z;zFE+2T|9zd6_MR8&NfK6?wK5|B6Y$G0dg^GipKIUNygj+=+pq3{0R=iBBWhu#yh2 zweT1wV6WHAr{kSiLw^$9fG05pe?;B5@#`k{T``S*2|Dp%yT8Nke}F3LtFJTv#x$&h zCZ}O>Hv{Ivn77Oe=0;Qq??R_86U^4_-lZMF3fq`glY^b$JMA}s>NXSV+;BxFay8CC~W?Y+4pTQo_MV`MXf06g!x94jfzAWYNE5S z9xlVqxDrG0FjnI+oR0n9H{0?R?4kOt|ABeH&8X0f#1MP|v+*UogcorZe)1uol050I zkIaYCMiQ$~zKYt8S5YgCJ8c$_f?@PKpiFXoMRGpd%Z;abkm{*(_m`p3?)Af9ja z`;3)v;5FPy|I>5kZ^Gs0P0@XT9T`7|aoFT@Q#0x4q<%|NB#S!{x5FbOYV zG{#=w9fHXih^4WGhC)(@eeeh-VE7lNnp5!(`Z+iV=b>(R9DCxosBPBnOY>&S!G`op zQAIfwoj4!Ea0}+(pS~piZD^clKr;>h%H%8=Thecbn(;tXYQ~_d*^PO)442^hsPhUh zn%z)|TG&F=`KwWpJB0P|6skr(xk&u=;EN1|;;+~aL%ue-&qjszHjKmxI2DW0ho_La zTSLDwf9-bv)Wn1LDe^8z#!swt=yS7IVA#c14yO2td43qHUh z_$%IwgTFWb#j+6B(?5W046EP=v%;P~nu!m@_Kc6h4j902`3#K+8qZ?`dxZyIBWxV|rQ;R2TmLvEF!uzQ0)X?Dwrl2pjqCXA?<9(*oefnXJ1 zVW2YuIZ+PFiEdO8&d1)k28ZLvn1)%=j^H02BT>cYLoMKGRBlh9_IXH*BUt5OsPp3R zHXMkmwPi5@6XGecj^J0X#i*6PkE(&_MvmZbwKGw*QJ>Pz#t!&r9FM%Ut?qGV#R*Lu z!JpSWsK~yGcjMnsyW*~RNAPb*PgCQX01a)2qv*%W_ANM8DmhnPC`|6D)z;R7=llrw%umb0^UWvc+OxJ z{)C!Hdb)X!WMT~cLFtaM!Ca4HKr8a2Li&i^e-c$J`%yQ3-#&g8RaAeq`(bU(ja#5n zaZ}sci1g|PE!~;ULbt2HUwW_0?=H-AdMlk(o>Gs`?Gl+tdTNK| zZHjDI>ho2(eZ6Zh4#{X5aMpOMoCPkAv)tuz6}y8M7kEAXN^hAC{qw$VXQjK`>vxyc zIEyO1V~^Ka z=Jgc2!z-P^6}z)*V<(RYS-!PsQTxtqe9r39vNC6dyRy_0na<|7{n^nBEe!jEBT~^^FT&%2Wa+%v#;`REu zqQ+UlvONA$R~eC1V3?)LPdI9vuF6tY5nQjA1y?#N%BqN>5<|D#?Ich|JkamUu6=*X ztqsE6Wd&Y_{odvNqOP?GQ)3&)l)8#NUZ20Tz)2olwdu20I>Nja{!*{URaX1roSb@5 zowGW1$?BBj?9?N-TkZ9ENzti!s)7Hy8kVykmSTC;I zt^bSaaM!;0LcjR9A;Cg&+tKK49e;dz<0~n(DQ`a6D)8@8{Qprek;Nq8pY`&}H(xZY z?Q+HG=s1dEO#7czO{@Q|YO-tZxLOzL8s+`JE}VwHoQ;YY`yVQ&?#nR8jOPETbe5;j V9=>X)({b@%Sk-5fa%*Bw`6U32AH*v6GgdDr#S=s`lDS5=$+;IQIRPQi3W8QCG1ZI-d*T0WL@}It7Pi3wxF7psa!EEPqkJG*!)!|wU#m!h0_hK~uh%tD{ zX@7_W%>-95CIwS5n*Pn36g0D8s0+qo1g_QvxD7Sp!>ACRK@IE@*1{W3J)Wm(pvf4H zbx_Z3ilNvBSsn8RmcYsA38S!#f-YQ-nt>Oy@oQ9vHLDu49MiEGp23com}(<73fEI# zgc@i@HDgL+2Ta6lRBp}3>bMyb@NzZc--|+EnlVJj^g})~^Dz>?!s2)e6_MMhnLk10 zX#t)Vh_R^lIE=#bsHLgnv}d5M%S1(@6^7&M)ro&3h5pV5W3Vapsn`OKphg~B!-)i{ z<8+*lZ7>8cJMDKIT{Uge#-Jjbi0ZHk7RCCg2(|D~c%4Fj)C>_kQ2C>FzC zG0tVoJ)BEDqP`u#ax6uCEsns0sB@xrx*cd+$9|}YjYU0gs?)v%waqtUY3=``6g2Xi zxEt?dt}b|yt%A*7A~A6_7Q~PSb}fsdIxdSkKkA}7dJ(mxZBfbn8S1{UhW1>ELPfGV zhSR^PuL5QweVfjxkj_VKzg+wWmpknrW!M3)LM_oo$33VB9>ziVvr})>$cDTvDk5Ex zJT-mLLxP)J3XNRG{D7K4SQBH$qZ>7|71#+^V`+SZB{1e?8}h2CC3zVuVh?21%uM76 zF^5pk{S!N2U{kx~U78aAWEyg4&_S^nc@LSr*b4U}d1Jy}VTa($n1dTop)b?ShPDol zq5cwTV7o9LeW+dZCn_nQqLR5trmZJsdhGV7OM{yax?>P}P+2}57vlSCh_pd<)D@LWJun)3V?i8+NjMHGYw=c7&;fJ| z!|@t2GIJkOF`&KexH?v)UK@wtTc}-f0-MoOds17GTH47*>SNSyS&!=Y8&sr@phABd zLzFxhDX8OHSP>tgUOMGE+Y2*LOVk`Sv+-C9Cu0TNjar(^colDAam;_sZoliO?N_{u z-Nu!$HuVYUQOI{uNK*sHmS(gKb@ZlnwI^U}j={3De}-5qJ|dphs8< z6T8`M-3s;m9ITA1P@f;|M*Lr(@Q4PM+qmC!k_?MdAB8bE1C>O}ozL@7OYtQtVs}vk zD%ss`w~DBUG)E1rom20L%8>z%!@CoIt;Kj6^nmFYiMgou_0EOcPy^bBTB@U{2cJW& z?JX>U_mF6tkRJBB-l(O>K|OCeYS+v|Me=hG1#Po!&ILPBBR_z8@L|-zenKVBuc!gu zK+WU{Di;d%G-f!yh=XwpDzarbZ8XrAQ4{EZnm}LFfIY*U!faHMe1aN49+t%~u{2&l z4d@AK&0W21GKQi$DvF#brVjSQDd>+3YT)-ApP>d)xR3vHk10h#GjXFrQW)W|!aa-x^>`6$!_r{HE>hzqf4U%vI=Sxm)YZ`s^fh02*j7^3}u+h5>FMDoxC zF#JsHfz$9))B%#(-@Y_nMn&c|Y=R?E1KNY}=)Y%3U^z_2#@Gr6VKdCb!l;+J9uR`%uqdv?noj#E)cJ7Msb6&JSFtJWx3D#)y=^Bl z0X<5l1r(H}Yf#DZh2s&dMEwi~VL>uW^>93gby3&H46&b=M`d{x)Ie)FrlTU!$oYIN zYH2qQA^yt3FPw%`7)AXuY9{wl9Y4lu7?5Ruc+^0GVrHPW+h52(=GAO_;Oxc*)X(8$ zES+QDvMW$0-(}R2mK;j_!zol9YLnLqaqSL%x>d` zs0cJc?WUGk9(!UdoQjcn0+p1%dnhPrV%WS4*3?3cd<|+zenWNm1UZdO;s|4A;W+Gw z!SC?m!8frgZgISTkuH{Jq@9R+l$}6pjN-b!SPwm;DCogku?B{X<`BUQ)PTkzTh`pc zw%B%zeTjUGJ*Yp#rTE&r_7~G%Sb=(jf7#^ikBaDKOu`db5g#Fu@tAUB?Tj+9lP*AA zP;s0MRR@ft{uXM@CSf|}qSo>RDq`uxQA=_Fb=}Wc0{@4KT=)b#z(%MJJ7X*k#$q@HHIc=r=kCBX z?ll)Fl*Xuu_QI;DkTpiN_d_MkBrJj-U?_fq@wf#wFdr&H*BqaswprvPo0Mg-HT7gH zizCsanJlEBkaOr+o*EMo%jTwP_JHke^FPmu(pz}C@dMoy5 zU)+gG($cee1!H^EQsttSYLkaT28FLsAqkvgXApVa$K*%g0=84Dl*To zImRro+1mrlQy-5C@oJ}j2G!AXd=nEtu*o_B-PC8G2DTm}=-+%rK^+{&fp`+!jhTp@P}iTvY8bK1KDZ%jpxsg1Itv4F4#wg87=@d# zBpyVM_VHN?ad-to(R^e>6^4;iQ&8;htdo*0YrJ$*gucW#^N-%*V+fxLGsWHKqcohRPx2Fv%4e% zGXj_~)_3tGb-i8NE1%iOJirlLANjd`c}>H{)c2#3*0sUriYJzWn}%f62bov{yJHoc zkDBoT+>QB|K!>w8+TVs7H`(v|g*V$J%5hwPTH2kcCGw#na}L=!=1;t@{XcDsJzB?Z zwIQ8}sa&uIHR4mK(3jX|L)ISk73&Bp)T@@^*I=Zn=u8y!0mVw z{qO%3JMGB!Vi7(#hGXyoR>#+OvGwR+4%VW+lQ2BS+o;`hZIAs!#a*mT{nTDNfUqy@ zfL_6L+Ph(QT#Tfhd5G;)7`4wP$M={={Tf!mmHSy+{0TLa-~;wA8kMmX^{O}w$09*A zcQFT7erZD=dC;aUHRj4<{FwAxwiv+>UM2-T}{-{m5M@W;oaLjhR(dR@GHKAkp65c~aAT{3( zv=IhS_jIC=MxhH9#925B=i$2;eB5rs$yks2x2Oo26E-r%F_7vQ)X6p;|H6$p9#@{^ zbfl;FQ}!Lx|Fn(d6y%8ZnB5dK(^II>UB+Pi1GPpEu_y-oVw0;FY9IqJ0#{)t+=>c$ z5DD`hCSo78qaqP=hGW;oX^5?J!;v)4yI^M& zbdj0RJ`K0gzWS2=4%qp!O}53T18glu;m??eH_(k?SL{-xU@HBah7_~}*;oue#yH%8 z;dmTp;ziT}HRv}Rk#{kJ`fMzTKcYUritX?LzKWT@+vhDn9YkBOFy2N_EnP?<2&-JR zSy>a^)SIK0Vi4BA;aDEmp$7URYRN8QS-g!JaOgF=G$m2VTmc(lC!CA9sOyri6Mt=o zTG#E!TcU30h6>$GEP%^UIkFPf@kT6&2T@CR7`68IFcQOV*nySBq0}qka9oC5Vv63h zUv3}WB>oC@^IJA6`=Jhy53vLucf5ras0ZG*kxD_$xE7MdrXy-bIjE%=kGg&_*2ROk z5+5V^Y(BhWCp6sihaKqzti%U%urlt#!gvL>3+`Yc{2R6Xo?{rs+_e!&L=C7m*2hj5 zi}O%R{3#A~@%0|{cY(I|*m1Obdb3$mDb)S1eJKpUiqvPII^Ko~=|0rRkKrs__dl-Z zLDlcucSidMb_qtKPRa$i4!=W1GUuW5--M99%^}>V{lEQhd%*O5WJ9vnKY5#YikV`{XT!VjM zRb2eczW)znI`zk>(AWOQ9w;rb1@$b{1NUG{{0}At@HOqZ-32XOF8?li!?7=x13ZqNP}VRq$mRd4RVLVFrt?8hOvCHw#!`h{{+Xv^L+b6YExwOQ zcp2j{IK<^owhE|$cSkMdd#G)^8#O3k-rh7)iX&Ra_ngomwbNPQtH9~El znV5}-a4J?0clmQ654BVm@hldJa2ZZna|<=oqeWc)zmAnFY9l%ld(yrIwF@F6Jud&3 z!g5j8cBt(4;0RogGq7wi`@nTLmikjXgJYsy{_h7JV{Alr;c?o7i@W^ah|Xdr9i_+G z>!*}(`E#U4Ntgdf-{7H8pBrkIvY{M`t*Pf?GrWr0ZdFUW{BOD4sI@D?8%PIEYt%{E z4RtZt4;IB-UD|qL!i_>Ku3vHK29K^LYPL(EI%qs-vq|99^6)YA=Dhp(1KP z=~xBdMD6QYr~xfRUAG=}|6bHm9!E{+sbiSiMmi2-wf`Ga2 zZ-6@Sx}qMO<9t32l|*x$`X{Id??i?EWI6Aw7e*CI=rv+sc2*U4-?w`888L9Azvk|h z)z|$_*1)XcBYF)U?2S*U7E-Y3$hWdacstg4H^dv*cvYx(XRG)aZ_hq$0*m#^dV9FL zU-mF}&O5{U4Cpm{U{?R!=b^5e3pVzj<6Spkbph{&!A%NzQ-()G<{l{LYVBPzrK!t% zZEE#^uxcr3{8QUqt#19A-lQ3E;l+LPe0%aI`SN_*d|UFT`SSATR&o2b=Q4?y(!M;3 zz8!qHFMlEzZSn2(?aiO7%NCqlSjzjag-Ma|zExbYCx3GOOs?DE&Y$Sp@7tO`ThGj& z>rV1+SsM`Ly`I-3I>7hgf_C0`Z?~UTC3t7vy&BZt_p$E)y-wuDt-k$k-!9)4H!b`1 zION~%q~Qr}-v{c|%@g}o-aAQ8MEB8Z5x zi6|h5fU>HA4$z{u$RaI^(bh=2fGD=Kjfe}NPCMVet}Kl8^tGtcy6KcA{P=hmru z>#aIBR}WMN9j*!TeHt0K&f>x2!DOiRl>D z-m>CwI@ZO99am!q>YFhbPhljU!=9Gqvp%PAfQD%9%D}T2i-{d+!|@n~1y~2mF%%c0 zI$Vh%xDIRMCa1o`sqe#qv{&J9yoDM-YA4GY%k!-X6ar{?9$VrI*a}agI{peH@LT8l zZ%%v5&gOyburAk=us-&~MmP!^quXhpiv-VFh6%VI8}WSW6AGHy4b;qk#d_%CE_IZI z8u1X+j3=W8b|3b@Y^S~vHPGiV91o!SeG@gncaYVxYOpCVG#{P z)w+z_YejHZ100A^I3DX^9%|z5yetZ$;(80jK>a>b~QsNSwxS{Gc20 z*Mq)rF8qW;sn<%jtdTezHS)FSj|4WPeh63NI~a-?-A#MG;{&M3u0}=nS=0kx#QIo; ziqI(^g((!iK+Q0P1=S6sQ6s(2F&{OfIjEWVFajS!t>s$OK=xvLJcI<(x`f)64cTk@ zTpv{bDYy}RV<{-4-=I4D0o74pFEfJ(Y)ric>b`EM8TCa)ZV0O5NvO|F!${1=d038X z@dhd)OM9EouSME@)@BM#xRBh(L|`N;#8a__&7p&jQ-8Ft89?)Xmeq`UES6#lMq?#v zpl2K}qat=2)nBdt=6Vz=X**+c?f;P!H1ZrgjK#QKH{8K&@GZK9|>$lQ6TZH5twRQ)&kT_ULR~( z58!*K8IB)fSrc&*Hpe~K6i=Z-e+jiTH?adovXxj}t3M`S8LHoHn2uFLiNDsqZkjon zVzCYNkys0ha5T^{ZHp*HHt@A8tav7`2sPG(5^zFZmq-4Sc8EW#Pq{3)UgT1P;ZNx;UEmfX&8*z7=neU?OEnr zUy609uSRY2%}(97kAg;Y1Z(4YmQ4hMu zY0q`)UdQ_}n(IrE3Hq$96ryO@ftu-2$J2O<`iHm!w-Dzqao9M*j0ty{0Ubt7;3&4n z_pk;2h>A?)coWGOR8Fs#M@90-iICVRn&~GpzaHp zY?detl_ROx1JkfQ&POfHcD#anF$&k-ZMNZV)HeJGeG@7CgF;UnJjH~(0=ud{)y$|2 zbrk=AIuRS(V~)^5R4%MQCDj_NgWIqk?nMpgRqTjgVjHY~ujxPeUgEEiduY%NtFRru ziY&Wz8U0CipLuKbMXmKnR1&#S*Y8Iy#bQ*%UO^4$W7M|$26bOph8b8RR6RC>_$%a{ zXplWoAx=egFajIkRHwZFbzd3kHM$VBRI5-keipU1`>-hNz8P z6tr#9QK2kCC07~hhH}(MA4GM$95t{fP}^(^YJhuC1A7gX3vXiy{)Pou;x>`Jh#F|f z3^M^=6a|ee9yQ_~j$=?sl7s#bV@v9bQCa*PYCx}{*8DA0GM>dz_#WPYu1xdb`%vvm zFdM6p&-<)CS!N~!97m!;I~nzWT-3~pP!TFe&3qwhTdqJ2a06;0TTwZ(-?@Gq)n7I4 z$IG}5*Lc{f+W#FGP7)1oU@N?iN}~EX=D~d(haw4Vjl+j=FBW3=Tyvm2hmq8)P?0)~ zgYj$BfD-ad|ATP}^-Rp-`PSDI5^zkunelwo%pSyGd>qx`lNgT&aWsB{!?4p#vjiom zh%LZaT#Q?AC$j9;@B(vv7Y0&)34Qv&L8sx5IF$MusO=Zb^faT1s3glp9V8W~BwFRT z1v^sTk0E%$seg_iQx7jP_g_U_zm2ug_7Z;$Ak=F{Rv%d&D++bP{TPN1p^|fzQ{RRD zP@`sY8rAVR?1CR6r>|9e7JoC~y{K(?5_z`OYPLCuR?a5=DKxxH!(zOSgRr#NoQPGZ zEWU<%X>?{!g<~q#$FZnTPsap&2xIUS)S92ic6bGKV1<{ONX26S_3=Imn&~8Lh#A-x zOK>zkg$n%@Ou}2JByC@2{zMy&n!q8{(%eKnu-+UFE$o5I@d=!O&FAt^oP~+#JLVK_ zU;~?1=sYu%Uw{cQjyBW7B~+Z;X3Sx zyRau-!4!;HsGOs64~1ql%)nN-02|{b)KXMpG}d5qyx~}Hky-1GsE`jw?E)|M!ly9` zt1$+@MkR5`gC=q=^#A=ofr1{GhfUCj%7yi)ne0Y&dxSg___o)W9yIPa*o5f{b{`Y`3Y((|D2kYSBhgpA(@E8q2_$eyezd&_(6YF8XQuBdG#}=sT z?NA+dLk(nrbA7bqWYm3b)P04H6}UZsZ^1qa+qjVMD6_zKv4@Q-NInc%X+q!masPI) z?#FoUJBeC~Z&4>)y(df#&BNZ*SK<~tiQVZZcNO2NsBc4)n0Nz{Y)qh|a*s^ecBdp*UeNxc}mn z;~i9Qp|Zc{W@9eaXGxyMFrIJiewH7GXgGu?sn6JI&gzcOF$n5DyotB57k)>=%*PJT zn+NVdO`yki^LPJT>`DD|97(^?JIoS$cJg(N_EngM<6fX|b-12_W^@jtF!V+9dTfoF z`4H5aPe$cP4tBxS7=p)82iTucp}mCdF@kl_zX0gfUi*l zx{XU1dDlJWY_HmD+Am=@u1D`P9go7M)K_9_+=H%9Z6ptY3U>!$xl;wWe{1EXy22#&@#Ux`Mk`C5pRAl;9 znkBdkHNgcKj|Y7eMo{ifWD)Y|=c)EqQT$)K6k zAHt?27FoSv)j>fkz86)4||MZuJ9-Q(gmRbA%^*8+m>+mttVdYz9n^dEg zAn>?J!j{;OdRM%GLoteudY>>68hg@wEx!kq1D8<`u6@cRV}JBf_n?;QOAJ=aRSHuA z*jA_+jbzgg#C+_IyHQJU5tZHlKy9n$XUvRq&YFW}0k-CPCDz8j;0yREY8x*-#}QnM zx8r$pj=WaQ8_`EcpHkrYR?Pd1oO)}VPd)7~W=6+QNi>2zGXd*v(Kj<@l#kIh;x{lq!Du@M8j zj!L4S&-`EWtV!6MdNmHjYpA47x@dk)tH3zw&tQN26YBndUL^k7Zp|*4zscI-Q`C>( zW=#LwoLD!oj0eAbnXO2B{Fh`k^|!Htx{Fbd!DnzPUd1R%o;DeYC>}m=W(G1r{GolK<24M$Cf}HIqz&r6M5msDJ*bbs zrnnHF!wpyu`}_W3)?y?o2PR@LPC-3rI%@4puo*sriTFI~zW1;$UchL)g8k6CW(Lw9 zCr}-QVYn5W;6A)S1brtcOr)^&x@oxiovBxUZywzKNAtBj1!wcYhjBdK!j3rdCv)E% z)XZ0)l5QhvK!3$&@JHm3v{v0T0~~zIe_;769|d)^6U(t06^T)|%}mGPIE@sQoacWw zKd&A7#Vn0}8dq|;FbmUAk=u=T;A_|#f5k*>`J4HwHX5JT{+~wSE-tV${qO1VIG@@> z*jTN$Z53k^%*N%Y2YiQ5*5WX!W&1<^OrY)m0`ej1L773ey0=ziPmBzvUnX)V?x%ht z#J0TJ|8r{F)_6L)QpfiH&fh1@_W!8dJKXjs%`!~m16xts=5N>?1MAuT-O~q~QXh

    |iV!hwg_V4RcjAkJ9naxbUdoY~(yQn4l%<&e+Qg7gE zZu|en>wzt47>~noHY#LCFb2TiX8f z;Vkx|{Q{20$X2F*-*gI^*&Nh?vIzCSWvKnU19fox0bAfP)W9w}?LVQiJ-}sKA2Wb% zxB(;D*w#JxVyx}|RXjM(_Wyam1eb9C8LZE)w$j_#{`Yzo_TmHca6G;gZ~K2<3*c*x zw%=@24t#-=F{-2O{~fOgQ>h1bGNDhy%hZ>ml6Gci+qzTN6U;=$pq6$THr57xfP!YQ z7IW|z{uw(Zntgf`^?{v9X6C0+Yj+X1U|<*9|MS{*RAfTBng_*TYw8_Q$u|nuV+J0_ zo7hGN#L;dhYcJve>ha0ufjOudFURHhDyqX_{6V(}^RTcM|I!NUQJ+Hibbl@?yPrlS z-8NKmzlu|Aepx{sNGdCFfS`f^Xni-G`@D?`KV5~{8E0QFaf+x~AfUGFs8XFl3oKaKojy)(kLe&D{SQ4EZF-O;u+ zmwLA`w*OyV@4^PO_Z@5dzeA21XIn$KUg4vVO5t@}f%aXtbrDzMI`py?bkYT-+tvg+ zScH1;2UJedUcSyn>{r|3ZU4{wa*Qn%bI^CRv*`^w5MW#_WuM5dU@Q9TBCUwk2|p=o^$*e6|%S)w*T8~KI&a?7PalJqSoBX zG;hyP)B!ftF(1`$1?v9i{IdTJQSc`VYMvU+dMPi+WF?_ZH)@~3{*smu^-My<-j4w3(oal^X?$kD zD=H~<7ZiB1Dxd4zB{V3#)LmLu`C-qB(Bxu|r!cRq#Fba#@|G353i2{NMJ0JfIWBim zmaD{@T{_oY>~WRN%A&Utm!~Kvuc&fN>h`)Jc_k%fo{|A;#$AoB3>Y2J*yk$umbo(B zMXo}3kvqrZ?;z7#R9fsU(52t|_PB~Yh2Bz6LAfit*jwl-&Gon@mUxO?L);~~GraEN ztVAo_`yZVZd&){Y{+rCuJg&L9o+5ukoPX3sURQy)D92N$*yW$KC$TbO#`wTByRw&e z?Ao@(H8-!Iz%|QLoafET%OnQnt`ZMZi|fXQpdy)w}QMmp5pS({;~i5 zJTsj_Pf=-QLe8#$3|FqFV3v!JF|)E61)h>zueX#>l)Gjzt)kLAcLC80 z+{Jm!!arXx6E1emDkvk8S{$l{9v6Yi=7FUpiIwl?rv=yX6l8j7F7>V{&F)?qJv*X7 zy*zhLk+-BYFVn?ZxGUQ|xX!NaomHCWEpiuB9$B1RE39immu?ANl3iW;^zBi3d&$Dc z*i_}gf1eTSw~nzJS2o-*E4snpvf^SU;3Ba83@NFsdZksf9%=uB9Pw2C<(-FOeovCh zaaaG48Jx}7wE42=6I9saj zPPE6?51srk`LgEv<4vnxPq7=fjmY}ftXcnVob6hll5M|LRh4N6*Q)b-0$FR^-#4zR J_SiE5{vDC$9N+)| delta 10172 zcmYM(33yG%|Htt;kyx@J5fMZZM69vJzBEDX5~V0b>|%>uO4V(P7Hw5U#8OKwEn2Z$ z#8PXu+G_n2)!Kv7)>d7#KhP)7Q+LbLY%_=R0$5Zufl`un&#i&PMag28B)!cd_Cez*o zJL2=G0UX72o^Q@kC_+QkT8t8_V+?jcbvzPF;&}JE$8BGYdf6mAB}U+N zxBX8fXr_2=W9ndCEW`8701BGfB-9NvF%;M92Hc4n@d;E2FQNu^9UI|KZas!xHP8eM z!6vAFQ!xnBk<~HJVL6D|{R<3I!mW`XK zFGUSBxt=i<{20sPH>il*L(TjN zDo=~hn?FXP+ACrhRz)pM6SqAXbzetRB)VY;_H97?OH&x>UYL%l)aPOsJc$~4WJ5O+ zs0X*e#h8wPc*AYK@9HGkq>VsDwleC0wXqa7M@6WMheBTpBT+Lv>fUe~HPY*@_fa!? zjGBob3ttk8q1G}IHIRB(9a|tlGQ&{Yaw+O_AE5?t6yHJ5843#Bcs8Rt%tm$e8Y(vy zV+5{2-M1Sxql2i(oj`Sb0rk177=}OL^Y}L|!KqDbe}PTy=OdAJkBOrY$qjo@5jch6 zcm*pu#{7bBQ4eiy2e2B;Q-2Sq;8D~$(YS>jXm{5UsEEx(^*7gTUyj=5+pvQ6|0xO@ z`5oMck1$U+v}CJbhgKveuEzijY;D)F6zaj1Q0GTe)Pq{0mb5!6xwoJ`7yOhxSHe({ zY=9v=-!xYNJ0j0Ey-^`ujM{#A_z$jj+gByq0k1}s0g0G(Rkjir=-}BcSl8} zACjkLD0)b6lSd)NG3E=@41(JlGYex;Gh2hba6MMQ$5;*{+S!mNqL!o`*1!y8)y#b4 z2r_UsUBhZFEaROq8S*w8k? z>C{`H23CMEcp9~f9-@-+Z&Wgu>}c!p9X)n?G^HVy3j?tjdQe&Z8s_5LsO^-{$(Tg! zi|IHI>B4-61kXI%*$!j{>i#kuA{t10)PqOhV4R7H>{SniHWY3k$GC~_YS+F8YHjxdsgtPC ze~W=io5#EQh}!(Kdk@_P!ygrI>)~?={q}S%iw@2ObLAW;@**_Mk?77}fC!)WE(%CC?Sq z0DnTwj>!Jy8=Fh8nPEl3REkl_VQb1K5j|@Ca7G zYp4M|L9Mwn#3o}9>OrNDGsQH)5jY2ZkwFdo7uWxx22x_E@4Cm7r=Xd{qC!#&^??Sc zZP*$$pf0G9_eAByVE1}9s>3Lo_miIv2n zJl|BLpbo2G0=B_!I2t?PUMzunsjGuPtb(O*Ehf3`-=NNiOK!c;t>4B}+V5f-)*oXh z@)CNKOgR*kr5jPn@{#LFtV#VM7Q+BCOZ5=Ej7?GZM~t)AtD>^JHfo@aTw9Xx| z54E)0#u0yI;YV)6HyB3!25KgcP!IkK>!Dwk{llXn5)?BJwcUP2{xzM)+XH7Gwx)g= zXJds4_AR>xb@JUnEosz5;vYgGaiUG4mZ;En!#X$-qj3#tjSpfqJc~Mz{z65h%p|*w zpF%~TEowJ)#i}?6yWw0cjb~9wdCNmVNfW{5Ww53ZYUCSHOY%MHflrXr*i@ck%mRE7 zpTXi&dGX)?OvLT3*RZt1@=UW6iOseXNW(Dh8-~r$lTAS#@4$u_{5*#UCZh)QBC=)8 zee90ir`wmvyO=@!Ph5e0X4t=&e#Pq4TfbnFcO)vJ+b|x_VhwzZM8;#P%(OG=h`n?J z>V_IG+EDexiqwar*6bB*fqAI4Jd280;4GVTov=LhbW~(VV+1ZhEyY@l!cWlm{r{S; zK!`D#3z6i6Lf#0qw*9dQzJ^+o!>IetV>$dC6}ga?>;O|x5A2PRI2OZk4r(IHQ2p-4 z`h3sytH)@-ee#ItbB}}89 zfR%6>dNh+<3JRGQ^?*}Y3a`5U>|WPis!w|b)VAz~nprQ@=SHDEHyt&=1*icm#Xwx| z*7H%3IWU{`*Y-P0gFbK_o8f(IiwSe=IWPwGfC;D$U&0djCTie$r~_vwD!cch`a6lC z_$})G+pZ7Y>wnE5{_3#kTzd|Lqi&3It%d5S5$e7a*EHN%gl|WNR;Atx>);GjBsZaw*Rz)bTibk%GqH0He~{t{+=YHi z?8#PuI@u1m9>*~1UtuB^Vm~aIYdao|dhl%2j5neBJ?$E_lpUh|-=0De7gizBGG}lL z4$LEzSYnyYiKmcgo9U>T{EM1-o#pmVufC{cT!~S*4Zpusy!|p6&1})Qke& zx931IR;JzuHS-y$HGdP8Bdf3;eukc66dqHEKxdN;Z6sEwo{Ab+7OKPTn2KldJVtG{ zYyS}SfEd=T3D(8A416Tkpnm@Y+aCF${rxW;)$c1G68~}(j?)l_S5QgwFDj|3ZepBmNU8)YxthniZ&I zT!SpHIfshO#2t1CUPH~$iwSraJ7f4xn+pRmlKL1_KeOHTy{P*?LFLqatU-iodA$5+ zK%v(zdqe(iJA?DMgc}R7H%{GSXZ|I2r~WI>^y8E);JZDaKeErhD*_JK6EP0;{%?tj zT-rzWoSBGYs9!=IK%Nc_Q8X(I`v%CZaIYh z*!qM$;o4%~A}j-HMjO7c6Z#mn1pX&&|IJY6Mtjt*nt~DP@yM4p`Oc$~=)XvU8|N## zf4AUAgu3b}dw^U&&BN)y`P!b0$!EAmy&cZvbED4MiQGm-blf@nd*E!GPyGtMk0Za~ zJAr0Y^1S_ZYY7q+^EbA}Bj55H9sY}2!=c~V+;|mtQD20wVCn_l`S=-XNw#0KOSt8d zolxLqz85gSa8&M8zhcY_I2}C|C_JK&jHR#IZ0>=v)K_6V9>SLRJ?j3rYjz;5Fqe7< zT!vS0HBKwE2UWy%5|;;`!*^-#e3N9Reh+6*Z+naQr%^a`%f389ZZm7@nOFpCFs;w9 z4!(nbpbnaxAMM(%M@8m4d>)@*U!3xjU8+;4`yZf^@E@#>rSI7Dp!pq-JwQ@v2;#!i z*a!z;In2Rz_#uX3`dvHofv5pyVo@B6dcb7Vn!k$W@f}RW0@QuCF$nKt6h8J)Xh9+T zo*ijAK0`eNgK-z?KskyR3Ec(kg}WZudf-D_zx9iKaEssU*Y2lrBA;81Juv8Zd-e}R z4RAgxGM+UQT2t7D8qot>iNzoBHvw)y4Y2ng_JCT9HL35%>39njiHtw(Oow832DliN zlsEs&fc*F>_Sh~-_}@0C8saeR=)M#bxfhfuW+?-SL`^8)&*A$9>wkxW)@WK09Y^|J=lEW~@&1mP z$xQm=Hrg))IA%Qc`9&SmgN_~-b9_I`cMWuWzXf**a(p?n65DhCF06o0FbN}r9pB5T zD=N2oV-Y=YJO!P2lTja7hP7~)+g^wZsRx8OzQ`=WQq=cgZ9IWmy5F%FhK4%6?N}BU zQQwC3F}bAU%ZW)CL;ZX7w4&h8*BOPV4F+N_R450b1~v_K-%5NIFQB$j1Ku#Y|2fnQ zN1)nQq8@l0HK9N71q|Z_5=8_Tq9U{@+~NBlg`dM6-|Mk4$5aaSfv5qkMJ1OPi(>(5 zKu0hDZ(#!7#mX2SVI$HQHL#($8nf^MhVaH=Lzo|M9bSs`I3}6Gta7&F!>DBY9<@fl zx&|@qD%7iDMeK-`a5#3vIjD$zh0%Bu{n07!_;y!OB=1ZrvSCd73by}N9)4%lfzTV9 z;1KMFD^MN&h?>biSQJY{+Xs|F?cYQU#@48TbwPbD(`}!HO77S3G6UF;%P}v;G5yg~ zKhE*}=DV=6AJFn%xVPWS1};?_m=@pjX{;Xd2Hhpne9m-QpAMnlHmX)W5)7 ztX$nL>0V5x{ukcF7JU6#ru`pN(=nZB*o&HpUoE?qB~deJfSN%^9EsU@60f1QEt)e>Bbd)@ZFiMIdo7)Sd|4AX{RO(Bnl9ry`$s_PD*p3Tw*_!RBaQAxHB zmED(d0fyGM9WKY0sUN^`ejH{E9N#>Z4AA}$ZRD7~gt81ark>T< z@%<9A5j#+Sg4%v;%)WrK3MkP3Km&gYU2(_4oOjqqmsfQ#Pd0IG%b6j=>!`2&0o7-!CS!a5D9c z*bJjm?7`I&OHjXop?D9qq)$@V|MMu+Y~z@V=tYHgVOz&+$0OJlC$=LQ8R%}DMg7xM z$M>~6wY}Xfi_qcvRqTX?9UQ}Z%+#b(je1OH$7EA)-^KC$zvM&6nPk$sdK}-E!a>~} z(~cV!VhWzcH!vd2F@?AemCdu$?MW8Z-7(M5K`!dScb;~9fBW5IOX&VxJsoonbGd0g z*GKnq%vaQZ?`NlQqeE$n| zGn-c-{2wZ*Y7ej{VI$NzG5~dsT{_5`CzDhs}&n&2iOwzpdP4g*BkZPor)UBTUZPWPy;@Un%EiCz<$K0co*Zb>Tt)T zYX5hppcySfjdT_2g9kAL&!QfD9ks1);Z2MgVFy}dq&-?IqCz|X6~S@X0<%$T?sfgf zz5XZm)|xq)wxeiNy)kMaJy0W^gc{H?)Xefx5ju+M_@e9IsQW67@-C>BT{Ld+lu_fe zYR3*6K6vPqQPX_2*uh!DVy9+}%9=c7@Yu25m^$?W15&3A&zjHuc5}g3_3D!Ycg2+VdQZ)c_O`#bwQk;oqE6X@B^8~DL4NU*bKZU{BJXrHC)SC} zDSM?>&Y;Eha*jOocXA8z6P#X7!NeL)Qn7+!^_{d*IXiBa%Ud1nl*p^u)`=-No8sKB SQgC{>^OIk}u}mks$o~PiDiVSK diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-zh_CN.mo b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius-zh_CN.mo index 7214b03438e1759ea8387048c8f17ad99085a0ca..4cc40abb8a665966c8f71ddfd6b1e62bad8cddc8 100644 GIT binary patch delta 12957 zcmc)P33OCNzQ^&Kgq=VjvdY%%`>v>&Stp@CpXLlz)z9SD#B0Rl-_!@dWS zpdBC(76n0cL~+LjXO!+vM|`fM4x?v$-(RX^7-!DRdGDNe-kdpps_Ncb^{;!MtDDsu9WNWzbWC4(-cQvr<&trw)?vSC@!TQk8k2syuH2SOu}6_3L`r>PFtLS zHF2SJC3d8~5v$-?jK(*ykK=fq&nXns(3rc%;~Ur-yLF-sM`9$#VRcNw8kmOaa2Zy` zT&#v0Y<;J#7vdeXAHpH{7gPWPIy=sA#&59a=km&!G2f|@5lNWW7}sV$#XKWD;8lr#&<4K(9FI=&HNXvjV|s|N8M2o4?@j& z94fHK@kX3%>v^a^w_`0VM)i9V72xa0YB?9M5jx$-e|1lKi(m+<7OUS)W z6nE9dJFo$c#M&5(n)w{mK260+m}A@5Vl?$FsJ&2Z+mE5{JB`Z3Ygh~4??wJKkl$YT z5$~cN-rI5R!y%~1bFd;4cpdc;T#2t^4IF=iX`g0&4wc!JsLXCc4Y&vE;2~6o&Uz_4 zM8S`m;q5G_ZWxM+^l|Gn)Qo1KX5z&toR3<|98@3$*a1tBWICUrj^%ZnH9dC=s{h+D z552=FD5YPbI{Y)Lqe?fK8AM@y>P=Di^+L_4FDi3`P#up&J@*Jk<7AwJDVT%bp)!(w zvw1!TY4JGE%>fzt0H$k;uKfnas z0+rHE)|*g!Xb?`rQMP^@*#^!z)Y3)VX);p_y=-8o0R=X`b1x1EbDU>UGdVHPah}6> zP%|7k$Z^KtSZsp(uo0d`rT#P2()@%SF`A>q>N>Y#S4>9ryA4O-p}WYx*1qQ5=FQX^ zTT#Cc!!aI*;!I@!I45ul{)97d{9v;L=dm*NFE9naK?OE#h)H=G>NIUbZO$T8z$b^0 ze>Gg7p)FoU7uLPU?sinl`eH5)LLIA*ke8tod9OYqEF035vjoYqQUbvG z>*-jN`byL>-)QUJLJErL2v)=M$h*k-5Ve_V4>K8Ph6=PjYM{=jfqL0`U)0(UKn?V$ zZJ%oE9_!QCnCt1t1ij7{3Jqx3iJIv#>uY$H`UkiZH)ILr)3omW~BO~O{N|jYce$nb!y^Jn>7P#YSS#EpwzEJMZ66)a3OZYqo^4LQTIiR zGfNbS+9Lz-M!Xw4;4`SD*?~bUzy_G}pgD$nQOEE@^p2tMUljV_z=urApTeH1KWt`{ zjCvLS8TCf2`>1(^PDky9Ow^{z#_G5YYhwW_prhCc1K0}dJZAdu{TTUI%H1^Rh85Tj zk0Q(NT*8V?_PF_K^+m1qeW*Eq@#J4A z?@WX2gG%uLR0sEBU3}QK$D!^^Mtw$8QA@P~HRDaFwJpR(Sd3)fIfuHh?F6$Fy;0-b z>!qM$GYXZ;c+}=fM%|EtigX^T}9aRK#-IEnF{atd8>*fcZaXHYYnhgEPns>4;-9uMG9yoiIb^OI%? z5>Xj@7F%N)ZpK~6vO7cK%=LV%M14Pc^}qq!P>Od^e-U;3sxUpxXbftTO+~#(oiA9Ufgd1mU#Hp({${|(P{;5UWNfF!O!FdIHk16{PQ&vwq~SMsCnhDB zH{v1GF8&Jj(dfdNs)Ylv4h~19dIEOE`Pd9!K&|{#75 z0F|*ZsP+_8CUP+fcVSIDgqq+fRA86Ts}%i}f{dDPj$0elrtFF8pf3)?d$BpLMa`%L zmAUs(_kD{x6=4gE(WvXKQGwr%I;JyFfzMe${`Fuc4SFyS6=?zL+#kjoc*fS>LIw6I zDpO^sNcTM|JoU*2ai* z^FXw?u$X)H{JRa7Dn(Z*h`@=7y2x5oCk0wPQ+6<9@}S{ z0Mk(^--^n>i>QuYwb$RX?cbo5@(Omq+Dmzd;7#}_o<~i%>oU97hEPyP6Hpn5Lk*B% z>rY$fTGQ?IrC62wR-q=a5pTl}QJb&fa&rngA`^9DQ2n~C@mNLYe>MfB{5jO_U12Ub z1=eEJgQZv-U$(x3dhT*@SIPeC`H!AShj z8brO}zDIS?euc?YH`IN7QSF1R!%)X{4C6fW22WW-7)`xaj``csg?er%4#$bu9(||`eT?<6dM^1_hs`O- z&ZrsPjOwtzZ69eJkD5Uo>b_@COOs~nnW%oUt(&nv^#as$r%)4o2M1yu{r+l6Ve~4~ z;Vi66{aGYC&T`b|Y`NNW+|}CGIv5qmXw;fMf(>yRDv)`27cNHy@SZhbum7-`{OiVW z&WJjSvNk{k(hQY}?x_3jM7;rrqdq$E*ag?1oh?>bOsPp^*#^DX?%=24N1MbFDJb;a`&wA5795taw@gwwl zC_F*o-aOMm0qTZgoPe*OI_R*$tmOdI^>L_xr=e0m)3&E#L+aVKz87`haa@F_QJa1E z#)=;}Ugup3V`*r$$wZif8epMyEvkcksLkZVe)uX*#>$(`^*C(e@XN{8m!tO1Dpabs zqE5j+RDbVQ=;b(2I7`Fls2lfgF@YSgp0vJ+O8qDJ2!3hnL$;bfxgJDyyv&-5+ADe3 z5lgXh7=Hz$GJ1I%UqZ%rDs8ua^IbaSyJ+c_Rw@_G3p%=b|W3bXL$9WPTMy31=>YRUqF&My#0Ct-h zPC#|&MJ-(>Dv(X601jand=(Ywk5~m8?cx0Effjqre?aJkO4%pYpK%!V>+|`G7-O*q z{t*>moxLXTXHbC_q53fkskfOl>EdyJ%B zy}&%s0IO4PhH7t*HSq@2-nhd$!a4z!sTrsN7hxaFLXG!|*Iu}2^`i#3Z0kQ*e?fH= zQD_2git4aCDv&x&pc{WVlZ-#}&LGgJWIqSn6F3+8%vByg{DCk1sh96RDesE*RG zJ*MMBScGn@?&GhZFlL0B`P2i(WNb}+9xCviSRV^e_nkrobRIR{pRkL*|6fqhnm0UX z9_)j?so!SnGqF4MIoJ$$V>LX3@8FxLrP+4K1bh^0Q}<(k{2sMwdzbJpDRB}i6Ri%j zsdfGbQ6T%y5gdWjj+hQhQ8RfLHG_{)1BYz=TkGFY_th*lsf|X>v@NRrM%#X?tq;dx zw2wuvZrDLV5A4JGc+~nfYTyvM@CQ`n4UU==-i(_0ov3~uLEZm^t$R?Zo@MK))^yZ; z%Z`$N71qgWwrV4vFhWmJbhV+RaB&c9T^&elcPhI$$5xyTbHkjB>T7)|?K z)(5RmdMRkY=TN(M88*ikPy@b&3hV+_!p~7NF2mdKh8NAi2{?iJYK+Cdpq_u?B@}IpIQUfFRkBWAMX1r>X`R@m8EBVXC4Jbv{DVY3F~5!t-pl&YQ2RD;1|>$iFl2T zimg!3eQOQ-gXym>>i*`|wm6P@7khm^dbNftC@6K?QT4;t*Rc}yKcYJFqXM~%gRsHt z=EvtF_yF~@_%L37&iw1OWb99U4W{A+?2Zo+wKB2j4c1?~_(d8t@ZV4~sr#l0s3kU` z-Ul_~k*ND-VndvdTH8F-(j7sa|MxHgFQWqg+P43Q>M!!V`F+sgJo#6LGiYdsX{e6# zaSEQq9@yzE6VM~5>oagDX5d_WAIIW@Z<`bsVQcDD`9P@O&R8Ri382~^d)K@<=Xxn9 zfOXgr3vf7ofNik-dz^8+ALDQ?j>fN0YdP?Jlk)ZW0QDbnArAR~pY-@9w#4f%*#8uZ z%4D+Dn?pen`E0`nm`43aya%89&^+)mMpD0oO6fOP9e={681|9*Ml?rV?{B>ut5F|{ zdVVZM;6$U>nLU^x{ zS^ugOG*E4oDsW)C?a*4eYkbt+bT{}U*v z;}lfKskXid^sr;zjnb9++ku zW?JW<2KHJrZTnj5X6r6%q4fZ20!J_UYP6eOrMbI{Ymz%=Vp8m^m?Zb4E-p`kD>*(k zJ~1gKF3vs4x3x=;8kI*S#Uv&BKIrpQjot}v_w?B0L|1I0%afeoii@4-j!%q@pW=#% zpX5sPOir2|li+qG&zMASi7t2il-PLRumL-2R*g+eOm-*s_kD4Hhx%SuiYM7MF(%$M zJtjV8io4?BiJthR1W%kU{noGBmEfN4Npi=fxF#ofrn{1+x?N)u-3hKiF^N;3@Wdoc z>gJ5{TZYj$j0oNI;c1?k+ZniS?+|CE)}u= zHlCTzba#A`uj`cji1Dte?zkB)(#6b@pNMlOPW5<_cp}9$gK5Pl#m2;uNhO9TW0FWm ziYq1|mRVHH*TaMpTr=X5$)Xm9>U6h@L``PEq{ME%ccDEwTNnm+V zsAz84y7^^mj|DfU2X}7?99~nj6esM(Cjv8-vSs1P;9r%*YBX-c+8xG`MPip!7)D-X#Q9 zwrqbOZ#VPwm+mm}jT_-AE8J3+wa{OhAKJ1zxZy;6_yn~AIRGu*pTWAY{&|~@$Ub{>2~{)HZKWp6wFv*mc-T7b#2Cd^|lQN)74;_ z&wpY=FmtZSiOGO(_Vzo%y98Hn4(4W%c5-6Y_?|(*j8$bh2Lc6IMCmU*Xrk1n_+;m8 zUe+$SrbxS>a4S1Pd+peYvb}2qS*yQ3x+$=8UT|Zcu9jp5^Va)ImyH`?RwuAxP5HcS zEPMI7tkCM^!QAD+`J4PFwgl%Ev8(*Ym+P_jR`+x^>HbApb(t{S|LZw>|Rxvm5PoWe?dq zu#&4^*N(oGd#hE74rJ{lfq~`u<$0-riq+4~FWS}KUz$@^x{ws|e@$d-uQeFLpCY=SI7yiw^sbu-$hAa}Jta<3F-1kgfCj?>B2G-N(t~ zB!qU(Wn%o(bi!KrkE}P#shoI=O330rr>!k7ShGP%)i_VWq!9`3MBCy&yrk^;Qf+|T z{lTS${-f&xh3kTOo5*N+>fAua{$SqHz~U`|wYxcS!ELF*O*^ihAaelAQx^r7>?u!8 z4S3U!5C*I7Ke8~iYa4~XZ;$;8{UuB3y<$uJ{=^0rE+8iirq}(|bX*;WdFsuUc1+J7 zJ8^Blg!ac zUvT+Kot%}K{*u!2t!td$)pcA8cKp6IbmCa3B;OZ#*5-`y zPu>@#m_t?ZzM(i`$Ovb8PV8voSkk{@swsrZM(qO^Xe|SGve|2wojdB0* z3nRPu4?joiB{i3GusKw;g969JcjEQI5ngjF+9qB-|DmmW$xo;1eR^0Q_kA8 zpLOPOtTedcc%YCooptqT^ZD_Yr20$p%`X`fr2lXaURnB8Q1R|}{wWz(e^8iLJ01G& ldaF&y}R`?=`^!1k_0HAn`keo{&wZBvIp@dk!qKoesW#u3-S z08GXxOvMh4<90?-*h9r?9D)649gCk}bv%!u_yB|OF$SYwQ`2EM1`@|$MXYV(MmBDN z-KkH&WSoYYz)?(PeCJyVepEDQ#w@W3*2Uhaj>lpI=GfxG`YA_wcakCoWZq$rVpi+1VHL)MDJ>Ii%U3%3- z8)FzIp!!Y15KKjO$9Wa2;T&{_Qdmbp4Y#3I;KdyL5;b7E7LKz4yI^m;gafgDOOvsw zxQ%!PYNFj+IZjO+fb}s4b+!ty4HjWNyxEHUr&I86?Kot|8G}4?3a}D>fmQH3R7M`4 zR{j)qPW|Z3AFHD3Yhe^NKy6Ket?!O%myF6p3Wnj(Hsrq&g|YU*o0vpA5BuUN)Xb~4 zwV6N-+yx6T6@&4nt^e8T)6N{)7*uBKqXvw}NbHQtP+vENp%liVR(RAlIER|)kJg`2 zD|(Dti7y);fq|&KtcsdQD{O*YkR&-7sB5_b^TToKmqxq<_ zQGhYH5!G%lYDI@onLB~%`0uFqu3;43!)f>jF2l(QroZ5h=KZQjz1yirp(+hNLuKGB zM&nhi<>NTN;!@)9&SnA|um!7|L9Z>^yMQv#s>TrLIdN1^O^IeHT zWwH&1F}~AT1x!Z9b_SzTT7bHKEAhX$!Pc+uZYI15wM9Fv2T>V3f#dOe8~5m8Ql5s& z$ScS>bw;C`1MaM((8I@ZzCo=Zw5Q{|g)Y>}HsT=Mj5YBwR>PP?lkyg*ElI>U9D(eb zvk>`&ILA=^{(=M0Kgn$Q%Sq(FF%^@j(1&6b@^i>3#uWSEqiS5I>cn)=oenB0|KTwA`BH6?ZlilWebfm(?gV!(+-KbMOAD82MsO!|Y zkK?q!p_qybkS?4bkmNZp|H({b4XS-*J|db(FVw(eFde6(GJDNU;ROmek)C@CF1B^orkYnSis6BrRHNa|HUufeU*8Qlh`V#%|8dkwu7^>twF$E{EpW~e5 zL1o;6SFsf5lIM4De43fiKT#`qg7q-+CG&}HgUU!MYM@t8XK4gh#!*-Sr(#2#fz7me zn!*hdz2ELDR_!#v=Cw8!D*d4V+eNZcV3)|xyY=Q?+TXPf3@F%Q-e;Z=1 z-(A%8tManB#!ayU@l13p<@+eKRt29et!Ovu)7$zL^9Ah3XRr?SAEQ?IHAdh$)LFTK z;rJ73LXWX2)*oiBbqcEgN!ScGp`M=|M*bU7cuWP`?YM^9Lxz#WQ!xe?pbpUn`+PrY zD~_Nt_7F9p>aUsW7Kh46AJoKNvhhgN85w8IdyV{SFW#a;9n8l{xDr*r%{JVPn$RKC zR-Hw4dl}s0rRft>h`{ECh^noILD`6LA+Rv$gr!XrhUz1q?tfAOkgFcdjkGgE}N1q9(8( z>);WriPupRdWza}pHb#8hM)$DM7}9b0*=ACSe_Zw#DBH^2Q`tP(dEzGP7MlLi3^pI zW~dk1psryz)P(w?W;69| zFYrl3&Y|PW^pkM}zKvT^ACQ(~%@2)4RAz=?Pn?39&_S$==WrhWf{g7<8E3BHWvoCP zlw}qcfdP!~)S{pcW3e&5fGId0d*gl#Lj6!z2f-MNk@!Bgv-RJhz7Lmee8a|Nm_+@3 z?1!xadhpPhnHyOBje1I9ZCr@CtTBwU2q-Ja2$HT1O_=sS4 z)P!arSJwF%(=hE#^F!nV96|gqT!TaYZ2rac2%8Xh`yX?7$D%S?gbncm#^GZmGj1n# zx>->&4pIYDgSZ(cRRgdVaVBcdW@8sziQ3BxsEh@_We!~*tU;WL%ItWI!9}R8cpt0d zaV-D+|9W|W6k}~3ROL)4I}8(WK59!2quPCs)$lh|=E7#03HCq@I2fzqM2yC{ zsD-RT^}82a^R9D)LQRaCWg50XrR)V%{TS4tnT-*+3`6iktc$x)6FY~>&>ia^sB2bf zwmFn_upe<_tbo9pX)BQroJZXTBe{@HVE}z7V5n>Q4?H* zn!pMS#?3bV1eKZMIqbi#-vui4!jISqf5x8Jc&_;lOh64V3Dx0D48kR-iLXR`aCW0k z_kL7=r!X8ZqS}{Pf3eS>%q9QoFkqhf4n(6G*0VN4b<`f!u7|ZBe&WY(N7$MA;D!8> zfk`+TSKZs+QT!bYjhJ=VaPk?htr3s_CAYE z3TvS{YKIlDJ8FPlHcqt;vc77cr=zyeJ)VMAkc-dZPSjz$k2>}LK^E$?Ut;#KlQj_o zs82!jQk1j=N&{K&b0B7{f6K zm8rK-6YyXtZn1h%*YXJJ{ohcTdTO5sE>%7IU%9-%>{0i#K5C%nQ60W)&BO@eTpWtC zQ5|1F&XaQsyW+Ta&8N8#^&NPE?4lF-p6PEbHXz4qOF*W>TtSsA!-FHP%rMl zBrHK)Pv2$cpJ2UE9gf3Fn1igvnT1Mu^m5a0U2D9x({l2!7kg0=jwz@Q!!X+*A2r}C z)C5jgFWTpKPy_si>PNru$w1UZ!cm!UVKBBuefhd!91dSW{+06iROrP$7=*>R4v(WU zGHRtU$2uL=ZXs$Q59<9w)Id8>3)*Mvzp|b|E#zAqhPT}mCQ|6ZC07TZpa$HFGw~Q! z!=9^6{V>#uvhWg4$5A+Bjd}kd)*wELBk>CA{pZ%&A4;hAC!)r4yD4aOT&VKkn{E?9=I{+^FY<@pcHAEEA}zKp{*nO{anqMm<)TF5Po!DrT(&E|PC>`8qh z)?<8U0R^S}W7MHIhB{PrKQzAww8r|xgHUH<8g{~Y*ai>dAbf-qFuBkSya#o?zrl38 zfSO?YEoOoJu>9};uT#*T{TVfpC8!A$Vnf`A_3$bN;4@VFfRD^SwW^~sR%AVk{fK|Y z$=G$P`K0egP4E_K;;Gxnzfv@No9S>B_9otr8t5N51fO72?EkT;pMjddT-5t3Q4`o{ zL}&i~Uil9*P>sW9zqBccD7oXXB&R zlc;|Fikj$MTmKX_G2b1=2sZ_#ycTM}cBsSC#WomX&A_jye*>3e$DLeBJc~21@DuZX zY>`<=Q*1X`529@Z~z{{xu{IM zu+N<43?v!OB}~Ib`%QxSj9}Ln1;$b$< zL0zXQHa?D##HUdiyNcEEAE<%D4w^l$ftq+1R0fA*H5`kYz)UQ^|MP9dGE~F0HZHX8 zKy~c39zpH-8TzYdWf3fGaHANnEq;E6Y67eIKF887#k2*JVgHWVskcH19!Hjp|)U* z^-b$y)PNhY{EKHji(0_Xs0{vw{`gK-U1d~* zIMnl2HhvC6h!bs`W*vfR_Zn)?C!iLv#MZx$Yl(MaKK40c{ipM;f(2Vy#AVPD<U5`J4IGc1aGv!rD&>z+8S^`Cerg8e2I3Z|`ZLyVt(VJn^Fx9{ z2O8W%-DlTVW{=-MO=Omh|AP9dxWUG|uqp8o48Z$X2Or^CtaQSx{05dEQdED>Q0+rc zBI7&J6oz08RD)d9-sx}iN?C!8Ke8S~f9lVmIy#T~VEr8vG5BlqJ7p@qL|lTeVE8xY z_lPWfo_I03XHqy#p(UoAGMSixn!p~^%uk>uauI9d1Jp_@o;K|oqs~BQ)K>OKZPg^y zt$GLj@B`F@3o#mZoM!*k;Snl&;}z7v4bGUKUJ0mrm88r`dQN&LJ+wKKT6i zru{+;CEkik>0S)N60C(^p$l)>=l&N>yAZ5MeH7|_cTEb~ng4(h!H)}_`JsCMgZyvw@J=ypE0700coQ3GATV7!4E@VicLuKkTYNhAw^NTjV zVZDQD|Gzf=xAhrn;DEoI=h0I4zcvMR*x1^_+8)EG?}{4uPuLdwq3-W&)O*KJ9e-`( z?@<%Din@k(Y`yO#(>}-=iG$TaRa;TV+7Q)YytR|9?`2J~4z#{%9fitV)+O(vMpFao zrRQhmWXHQQGSf%rXH6-OTHg6SNA!$lxcD{FD!k>e^{x56_ z@qU(4H^w`1bgF-JdiI1o*O;7K*QCk0qsOJ^Wo3``d~>#)XXn_(-jBv@_VezT*fYS} zJTJVGx9?n!kN3{JHol>)nz!b^4z5-mJGb*TT+ll({9(yjr%~**HVNtND0-(Xt>{y& z?C{L8J;k?X&MKX??#{BUr3H&im+ZfL=#ck=cN2U)8(R+YJS(W;ZRT0v+Ai?rbWJ<9}}y1TNifs@$~H#>s_?vd0)@{urK)yOq)T;}VUc~05V0@g_;Z|^U@w`o=ByNk~_6^sbxf0X!#*NBJ&&?<} zb>DL_r?t1r>5qLq|2_LO^3IyM%}Zykxqaw;O6;3AVeY~^2jSckdxqQ0v dorMd^*6rZ`Ph{fxuB?1lcFt7qx+`%${|9#_319#K diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius.pot b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius.pot index 0d3d49d7..24d1d20e 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius.pot +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/languages/freemius.pot @@ -1,4 +1,4 @@ -# Copyright (C) 2020 freemius +# Copyright (C) 2021 freemius # This file is distributed under the same license as the freemius package. msgid "" msgstr "" @@ -16,795 +16,795 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-freemius.php:1912, templates/account.php:910 +#: includes/class-freemius.php:1919, templates/account.php:912 msgid "An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned." msgstr "" -#: includes/class-freemius.php:1919 +#: includes/class-freemius.php:1926 msgid "Would you like to proceed with the update?" msgstr "" -#: includes/class-freemius.php:2131 +#: includes/class-freemius.php:2138 msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error." msgstr "" -#: includes/class-freemius.php:2133 +#: includes/class-freemius.php:2140 msgid "Error" msgstr "" -#: includes/class-freemius.php:2533 +#: includes/class-freemius.php:2540 msgid "I found a better %s" msgstr "" -#: includes/class-freemius.php:2535 +#: includes/class-freemius.php:2542 msgid "What's the %s's name?" msgstr "" -#: includes/class-freemius.php:2541 +#: includes/class-freemius.php:2548 msgid "It's a temporary %s. I'm just debugging an issue." msgstr "" -#: includes/class-freemius.php:2543 +#: includes/class-freemius.php:2550 msgid "Deactivation" msgstr "" -#: includes/class-freemius.php:2544 +#: includes/class-freemius.php:2551 msgid "Theme Switch" msgstr "" -#: includes/class-freemius.php:2553, templates/forms/resend-key.php:24, templates/forms/user-change.php:29 +#: includes/class-freemius.php:2560, templates/forms/resend-key.php:24, templates/forms/user-change.php:29 msgid "Other" msgstr "" -#: includes/class-freemius.php:2561 +#: includes/class-freemius.php:2568 msgid "I no longer need the %s" msgstr "" -#: includes/class-freemius.php:2568 +#: includes/class-freemius.php:2575 msgid "I only needed the %s for a short period" msgstr "" -#: includes/class-freemius.php:2574 +#: includes/class-freemius.php:2581 msgid "The %s broke my site" msgstr "" -#: includes/class-freemius.php:2581 +#: includes/class-freemius.php:2588 msgid "The %s suddenly stopped working" msgstr "" -#: includes/class-freemius.php:2591 +#: includes/class-freemius.php:2598 msgid "I can't pay for it anymore" msgstr "" -#: includes/class-freemius.php:2593 +#: includes/class-freemius.php:2600 msgid "What price would you feel comfortable paying?" msgstr "" -#: includes/class-freemius.php:2599 +#: includes/class-freemius.php:2606 msgid "I don't like to share my information with you" msgstr "" -#: includes/class-freemius.php:2620 +#: includes/class-freemius.php:2627 msgid "The %s didn't work" msgstr "" -#: includes/class-freemius.php:2630 +#: includes/class-freemius.php:2637 msgid "I couldn't understand how to make it work" msgstr "" -#: includes/class-freemius.php:2638 +#: includes/class-freemius.php:2645 msgid "The %s is great, but I need specific feature that you don't support" msgstr "" -#: includes/class-freemius.php:2640 +#: includes/class-freemius.php:2647 msgid "What feature?" msgstr "" -#: includes/class-freemius.php:2644 +#: includes/class-freemius.php:2651 msgid "The %s is not working" msgstr "" -#: includes/class-freemius.php:2646 +#: includes/class-freemius.php:2653 msgid "Kindly share what didn't work so we can fix it for future users..." msgstr "" -#: includes/class-freemius.php:2650 +#: includes/class-freemius.php:2657 msgid "It's not what I was looking for" msgstr "" -#: includes/class-freemius.php:2652 +#: includes/class-freemius.php:2659 msgid "What you've been looking for?" msgstr "" -#: includes/class-freemius.php:2656 +#: includes/class-freemius.php:2663 msgid "The %s didn't work as expected" msgstr "" -#: includes/class-freemius.php:2658 +#: includes/class-freemius.php:2665 msgid "What did you expect?" msgstr "" -#: includes/class-freemius.php:3513, templates/debug.php:20 +#: includes/class-freemius.php:3520, templates/debug.php:20 msgid "Freemius Debug" msgstr "" -#: includes/class-freemius.php:4265 +#: includes/class-freemius.php:4272 msgid "I don't know what is cURL or how to install it, help me!" msgstr "" -#: includes/class-freemius.php:4267 +#: includes/class-freemius.php:4274 msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update." msgstr "" -#: includes/class-freemius.php:4274 +#: includes/class-freemius.php:4281 msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again." msgstr "" -#: includes/class-freemius.php:4379 +#: includes/class-freemius.php:4386 msgid "Yes - do your thing" msgstr "" -#: includes/class-freemius.php:4384 +#: includes/class-freemius.php:4391 msgid "No - just deactivate" msgstr "" -#: includes/class-freemius.php:4429, includes/class-freemius.php:4923, includes/class-freemius.php:6182, includes/class-freemius.php:13357, includes/class-freemius.php:14075, includes/class-freemius.php:17526, includes/class-freemius.php:17631, includes/class-freemius.php:17806, includes/class-freemius.php:20040, includes/class-freemius.php:20398, includes/class-freemius.php:20408, includes/class-freemius.php:21079, includes/class-freemius.php:21985, includes/class-freemius.php:22118, includes/class-freemius.php:22274, templates/add-ons.php:57 +#: includes/class-freemius.php:4436, includes/class-freemius.php:4930, includes/class-freemius.php:6191, includes/class-freemius.php:13368, includes/class-freemius.php:14110, includes/class-freemius.php:17542, includes/class-freemius.php:17647, includes/class-freemius.php:17822, includes/class-freemius.php:20056, includes/class-freemius.php:20414, includes/class-freemius.php:20424, includes/class-freemius.php:21109, includes/class-freemius.php:22015, includes/class-freemius.php:22148, includes/class-freemius.php:22304, templates/add-ons.php:57 msgctxt "exclamation" msgid "Oops" msgstr "" -#: includes/class-freemius.php:4498 +#: includes/class-freemius.php:4505 msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience." msgstr "" -#: includes/class-freemius.php:4920 +#: includes/class-freemius.php:4927 msgctxt "addonX cannot run without pluginY" msgid "%s cannot run without %s." msgstr "" -#: includes/class-freemius.php:4921 +#: includes/class-freemius.php:4928 msgctxt "addonX cannot run..." msgid "%s cannot run without the plugin." msgstr "" -#: includes/class-freemius.php:5120, includes/class-freemius.php:5145, includes/class-freemius.php:21150 +#: includes/class-freemius.php:5127, includes/class-freemius.php:5152, includes/class-freemius.php:21180 msgid "Unexpected API error. Please contact the %s's author with the following error." msgstr "" -#: includes/class-freemius.php:5848 +#: includes/class-freemius.php:5857 msgid "Premium %s version was successfully activated." msgstr "" -#: includes/class-freemius.php:5860, includes/class-freemius.php:7762 +#: includes/class-freemius.php:5869, includes/class-freemius.php:7774 msgctxt "Used to express elation, enthusiasm, or triumph (especially in electronic communication)." msgid "W00t" msgstr "" -#: includes/class-freemius.php:5875 +#: includes/class-freemius.php:5884 msgid "You have a %s license." msgstr "" -#: includes/class-freemius.php:5879, includes/class-freemius.php:16925, includes/class-freemius.php:16936, includes/class-freemius.php:20309, includes/class-freemius.php:20659, includes/class-freemius.php:20728, includes/class-freemius.php:20900 +#: includes/class-freemius.php:5888, includes/class-freemius.php:16947, includes/class-freemius.php:16958, includes/class-freemius.php:20325, includes/class-freemius.php:20689, includes/class-freemius.php:20758, includes/class-freemius.php:20930 msgctxt "interjection expressing joy or exuberance" msgid "Yee-haw" msgstr "" -#: includes/class-freemius.php:6165 +#: includes/class-freemius.php:6174 msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license." msgstr "" -#: includes/class-freemius.php:6169 +#: includes/class-freemius.php:6178 msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin." msgstr "" -#: includes/class-freemius.php:6178, templates/add-ons.php:186, templates/account/partials/addon.php:381 +#: includes/class-freemius.php:6187, templates/add-ons.php:186, templates/account/partials/addon.php:381 msgid "More information about %s" msgstr "" -#: includes/class-freemius.php:6179 +#: includes/class-freemius.php:6188 msgid "Purchase License" msgstr "" -#: includes/class-freemius.php:7118, templates/connect.php:171 +#: includes/class-freemius.php:7125, templates/connect.php:171 msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s." msgstr "" -#: includes/class-freemius.php:7122 +#: includes/class-freemius.php:7129 msgid "start the trial" msgstr "" -#: includes/class-freemius.php:7123, templates/connect.php:175 +#: includes/class-freemius.php:7130, templates/connect.php:175 msgid "complete the install" msgstr "" -#: includes/class-freemius.php:7241 +#: includes/class-freemius.php:7249 msgid "You are just one step away - %s" msgstr "" -#: includes/class-freemius.php:7244 +#: includes/class-freemius.php:7252 msgctxt "%s - plugin name. As complete \"PluginX\" activation now" msgid "Complete \"%s\" Activation Now" msgstr "" -#: includes/class-freemius.php:7322 +#: includes/class-freemius.php:7334 msgid "We made a few tweaks to the %s, %s" msgstr "" -#: includes/class-freemius.php:7326 +#: includes/class-freemius.php:7338 msgid "Opt in to make \"%s\" better!" msgstr "" -#: includes/class-freemius.php:7761 +#: includes/class-freemius.php:7773 msgid "The upgrade of %s was successfully completed." msgstr "" -#: includes/class-freemius.php:10243, includes/class-fs-plugin-updater.php:1099, includes/class-fs-plugin-updater.php:1294, includes/class-fs-plugin-updater.php:1301, templates/auto-installation.php:32 +#: includes/class-freemius.php:10255, includes/class-fs-plugin-updater.php:1087, includes/class-fs-plugin-updater.php:1282, includes/class-fs-plugin-updater.php:1289, templates/auto-installation.php:32 msgid "Add-On" msgstr "" -#: includes/class-freemius.php:10245, templates/account.php:392, templates/account.php:400, templates/debug.php:358, templates/debug.php:549 +#: includes/class-freemius.php:10257, templates/account.php:394, templates/account.php:402, templates/debug.php:358, templates/debug.php:549 msgid "Plugin" msgstr "" -#: includes/class-freemius.php:10246, templates/account.php:393, templates/account.php:401, templates/debug.php:358, templates/debug.php:549, templates/forms/deactivation/form.php:71 +#: includes/class-freemius.php:10258, templates/account.php:395, templates/account.php:403, templates/debug.php:358, templates/debug.php:549, templates/forms/deactivation/form.php:71 msgid "Theme" msgstr "" -#: includes/class-freemius.php:13176 +#: includes/class-freemius.php:13188 msgid "An unknown error has occurred while trying to toggle the license's white-label mode." msgstr "" -#: includes/class-freemius.php:13190 +#: includes/class-freemius.php:13202 msgid "Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s." msgstr "" -#: includes/class-freemius.php:13195 +#: includes/class-freemius.php:13207 msgid "User Dashboard" msgstr "" -#: includes/class-freemius.php:13196 +#: includes/class-freemius.php:13208 msgid "revert it now" msgstr "" -#: includes/class-freemius.php:13255 +#: includes/class-freemius.php:13266 msgid "An unknown error has occurred while trying to set the user's beta mode." msgstr "" -#: includes/class-freemius.php:13328 +#: includes/class-freemius.php:13339 msgid "Invalid new user ID or email address." msgstr "" -#: includes/class-freemius.php:13358, includes/class-freemius.php:22229 +#: includes/class-freemius.php:13369, includes/class-freemius.php:22259 msgid "Sorry, we could not complete the email update. Another user with the same email is already registered." msgstr "" -#: includes/class-freemius.php:13359, includes/class-freemius.php:22230 +#: includes/class-freemius.php:13370, includes/class-freemius.php:22260 msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button." msgstr "" -#: includes/class-freemius.php:13366, includes/class-freemius.php:22237 +#: includes/class-freemius.php:13377, includes/class-freemius.php:22267 msgid "Change Ownership" msgstr "" -#: includes/class-freemius.php:13942 +#: includes/class-freemius.php:13977 msgid "Invalid site details collection." msgstr "" -#: includes/class-freemius.php:14062 +#: includes/class-freemius.php:14097 msgid "We couldn't find your email address in the system, are you sure it's the right address?" msgstr "" -#: includes/class-freemius.php:14064 +#: includes/class-freemius.php:14099 msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?" msgstr "" -#: includes/class-freemius.php:14338 +#: includes/class-freemius.php:14373 msgid "Account is pending activation." msgstr "" -#: includes/class-freemius.php:14450, templates/forms/premium-versions-upgrade-handler.php:47 +#: includes/class-freemius.php:14485, templates/forms/premium-versions-upgrade-handler.php:47 msgid "Buy a license now" msgstr "" -#: includes/class-freemius.php:14462, templates/forms/premium-versions-upgrade-handler.php:46 +#: includes/class-freemius.php:14497, templates/forms/premium-versions-upgrade-handler.php:46 msgid "Renew your license now" msgstr "" -#: includes/class-freemius.php:14466 +#: includes/class-freemius.php:14501 msgid "%s to access version %s security & feature updates, and support." msgstr "" -#: includes/class-freemius.php:16907 +#: includes/class-freemius.php:16929 msgid "%s activation was successfully completed." msgstr "" -#: includes/class-freemius.php:16921 +#: includes/class-freemius.php:16943 msgid "Your account was successfully activated with the %s plan." msgstr "" -#: includes/class-freemius.php:16932, includes/class-freemius.php:20724 +#: includes/class-freemius.php:16954, includes/class-freemius.php:20754 msgid "Your trial has been successfully started." msgstr "" -#: includes/class-freemius.php:17524, includes/class-freemius.php:17629, includes/class-freemius.php:17804 +#: includes/class-freemius.php:17540, includes/class-freemius.php:17645, includes/class-freemius.php:17820 msgid "Couldn't activate %s." msgstr "" -#: includes/class-freemius.php:17525, includes/class-freemius.php:17630, includes/class-freemius.php:17805 +#: includes/class-freemius.php:17541, includes/class-freemius.php:17646, includes/class-freemius.php:17821 msgid "Please contact us with the following message:" msgstr "" -#: includes/class-freemius.php:17626, templates/forms/data-debug-mode.php:162 +#: includes/class-freemius.php:17642, templates/forms/data-debug-mode.php:162 msgid "An unknown error has occurred." msgstr "" -#: includes/class-freemius.php:18162, includes/class-freemius.php:23310 +#: includes/class-freemius.php:18178, includes/class-freemius.php:23340 msgid "Upgrade" msgstr "" -#: includes/class-freemius.php:18168 +#: includes/class-freemius.php:18184 msgid "Start Trial" msgstr "" -#: includes/class-freemius.php:18170 +#: includes/class-freemius.php:18186 msgid "Pricing" msgstr "" -#: includes/class-freemius.php:18250, includes/class-freemius.php:18252 +#: includes/class-freemius.php:18266, includes/class-freemius.php:18268 msgid "Affiliation" msgstr "" -#: includes/class-freemius.php:18280, includes/class-freemius.php:18282, templates/account.php:240, templates/debug.php:324 +#: includes/class-freemius.php:18296, includes/class-freemius.php:18298, templates/account.php:242, templates/debug.php:324 msgid "Account" msgstr "" -#: includes/class-freemius.php:18296, includes/class-freemius.php:18298, includes/customizer/class-fs-customizer-support-section.php:60 +#: includes/class-freemius.php:18312, includes/class-freemius.php:18314, includes/customizer/class-fs-customizer-support-section.php:60 msgid "Contact Us" msgstr "" -#: includes/class-freemius.php:18309, includes/class-freemius.php:18311, includes/class-freemius.php:23324, templates/account.php:119, templates/account/partials/addon.php:44 +#: includes/class-freemius.php:18325, includes/class-freemius.php:18327, includes/class-freemius.php:23354, templates/account.php:121, templates/account/partials/addon.php:44 msgid "Add-Ons" msgstr "" -#: includes/class-freemius.php:18345 +#: includes/class-freemius.php:18361 msgctxt "ASCII arrow left icon" msgid "←" msgstr "" -#: includes/class-freemius.php:18345 +#: includes/class-freemius.php:18361 msgctxt "ASCII arrow right icon" msgid "➤" msgstr "" -#: includes/class-freemius.php:18347, templates/pricing.php:109 +#: includes/class-freemius.php:18363, templates/pricing.php:109 msgctxt "noun" msgid "Pricing" msgstr "" -#: includes/class-freemius.php:18560, includes/customizer/class-fs-customizer-support-section.php:67 +#: includes/class-freemius.php:18576, includes/customizer/class-fs-customizer-support-section.php:67 msgid "Support Forum" msgstr "" -#: includes/class-freemius.php:19534 +#: includes/class-freemius.php:19550 msgid "Your email has been successfully verified - you are AWESOME!" msgstr "" -#: includes/class-freemius.php:19535 +#: includes/class-freemius.php:19551 msgctxt "a positive response" msgid "Right on" msgstr "" -#: includes/class-freemius.php:20041 +#: includes/class-freemius.php:20057 msgid "seems like the key you entered doesn't match our records." msgstr "" -#: includes/class-freemius.php:20065 +#: includes/class-freemius.php:20081 msgid "Debug mode was successfully enabled and will be automatically disabled in 60 min. You can also disable it earlier by clicking the \"Stop Debug\" link." msgstr "" -#: includes/class-freemius.php:20300 +#: includes/class-freemius.php:20316 msgid "Your %s Add-on plan was successfully upgraded." msgstr "" -#: includes/class-freemius.php:20302 +#: includes/class-freemius.php:20318 msgid "%s Add-on was successfully purchased." msgstr "" -#: includes/class-freemius.php:20305 +#: includes/class-freemius.php:20321 msgid "Download the latest version" msgstr "" -#: includes/class-freemius.php:20391 +#: includes/class-freemius.php:20407 msgid "Your server is blocking the access to Freemius' API, which is crucial for %1$s synchronization. Please contact your host to whitelist %2$s" msgstr "" -#: includes/class-freemius.php:20397, includes/class-freemius.php:20407, includes/class-freemius.php:20859, includes/class-freemius.php:20948 +#: includes/class-freemius.php:20413, includes/class-freemius.php:20423, includes/class-freemius.php:20889, includes/class-freemius.php:20978 msgid "Error received from the server:" msgstr "" -#: includes/class-freemius.php:20407 +#: includes/class-freemius.php:20423 msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again." msgstr "" -#: includes/class-freemius.php:20621, includes/class-freemius.php:20864, includes/class-freemius.php:20919, includes/class-freemius.php:21026 +#: includes/class-freemius.php:20651, includes/class-freemius.php:20894, includes/class-freemius.php:20949, includes/class-freemius.php:21056 msgctxt "something somebody says when they are thinking about what you have just said." msgid "Hmm" msgstr "" -#: includes/class-freemius.php:20634 +#: includes/class-freemius.php:20664 msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry." msgstr "" -#: includes/class-freemius.php:20635, templates/account.php:121, templates/add-ons.php:250, templates/account/partials/addon.php:46 +#: includes/class-freemius.php:20665, templates/account.php:123, templates/add-ons.php:250, templates/account/partials/addon.php:46 msgctxt "trial period" msgid "Trial" msgstr "" -#: includes/class-freemius.php:20640 +#: includes/class-freemius.php:20670 msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s." msgstr "" -#: includes/class-freemius.php:20644, includes/class-freemius.php:20703 +#: includes/class-freemius.php:20674, includes/class-freemius.php:20733 msgid "Please contact us here" msgstr "" -#: includes/class-freemius.php:20655 +#: includes/class-freemius.php:20685 msgid "Your plan was successfully activated." msgstr "" -#: includes/class-freemius.php:20656 +#: includes/class-freemius.php:20686 msgid "Your plan was successfully upgraded." msgstr "" -#: includes/class-freemius.php:20673 +#: includes/class-freemius.php:20703 msgid "Your plan was successfully changed to %s." msgstr "" -#: includes/class-freemius.php:20689 +#: includes/class-freemius.php:20719 msgid "Your license has expired. You can still continue using the free %s forever." msgstr "" -#: includes/class-freemius.php:20691 +#: includes/class-freemius.php:20721 msgid "Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions." msgstr "" -#: includes/class-freemius.php:20699 +#: includes/class-freemius.php:20729 msgid "Your license has been cancelled. If you think it's a mistake, please contact support." msgstr "" -#: includes/class-freemius.php:20712 +#: includes/class-freemius.php:20742 msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support." msgstr "" -#: includes/class-freemius.php:20738 +#: includes/class-freemius.php:20768 msgid "Your free trial has expired. You can still continue using all our free features." msgstr "" -#: includes/class-freemius.php:20740 +#: includes/class-freemius.php:20770 msgid "Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions." msgstr "" -#: includes/class-freemius.php:20855 +#: includes/class-freemius.php:20885 msgid "It looks like the license could not be activated." msgstr "" -#: includes/class-freemius.php:20897 +#: includes/class-freemius.php:20927 msgid "Your license was successfully activated." msgstr "" -#: includes/class-freemius.php:20923 +#: includes/class-freemius.php:20953 msgid "It looks like your site currently doesn't have an active license." msgstr "" -#: includes/class-freemius.php:20947 +#: includes/class-freemius.php:20977 msgid "It looks like the license deactivation failed." msgstr "" -#: includes/class-freemius.php:20976 +#: includes/class-freemius.php:21006 msgid "Your %s license was successfully deactivated." msgstr "" -#: includes/class-freemius.php:20977 +#: includes/class-freemius.php:21007 msgid "Your license was successfully deactivated, you are back to the %s plan." msgstr "" -#: includes/class-freemius.php:20980 +#: includes/class-freemius.php:21010 msgid "O.K" msgstr "" -#: includes/class-freemius.php:21033 +#: includes/class-freemius.php:21063 msgid "Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes." msgstr "" -#: includes/class-freemius.php:21042 +#: includes/class-freemius.php:21072 msgid "Your subscription was successfully cancelled. Your %s plan license will expire in %s." msgstr "" -#: includes/class-freemius.php:21084 +#: includes/class-freemius.php:21114 msgid "You are already running the %s in a trial mode." msgstr "" -#: includes/class-freemius.php:21095 +#: includes/class-freemius.php:21125 msgid "You already utilized a trial before." msgstr "" -#: includes/class-freemius.php:21109 +#: includes/class-freemius.php:21139 msgid "Plan %s do not exist, therefore, can't start a trial." msgstr "" -#: includes/class-freemius.php:21120 +#: includes/class-freemius.php:21150 msgid "Plan %s does not support a trial period." msgstr "" -#: includes/class-freemius.php:21131 +#: includes/class-freemius.php:21161 msgid "None of the %s's plans supports a trial period." msgstr "" -#: includes/class-freemius.php:21181 +#: includes/class-freemius.php:21211 msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)" msgstr "" -#: includes/class-freemius.php:21217 +#: includes/class-freemius.php:21247 msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes." msgstr "" -#: includes/class-freemius.php:21236 +#: includes/class-freemius.php:21266 msgid "Your %s free trial was successfully cancelled." msgstr "" -#: includes/class-freemius.php:21552 +#: includes/class-freemius.php:21582 msgid "Version %s was released." msgstr "" -#: includes/class-freemius.php:21552 +#: includes/class-freemius.php:21582 msgid "Please download %s." msgstr "" -#: includes/class-freemius.php:21559 +#: includes/class-freemius.php:21589 msgid "the latest %s version here" msgstr "" -#: includes/class-freemius.php:21564 +#: includes/class-freemius.php:21594 msgid "New" msgstr "" -#: includes/class-freemius.php:21569 +#: includes/class-freemius.php:21599 msgid "Seems like you got the latest release." msgstr "" -#: includes/class-freemius.php:21570 +#: includes/class-freemius.php:21600 msgid "You are all good!" msgstr "" -#: includes/class-freemius.php:21873 +#: includes/class-freemius.php:21903 msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box." msgstr "" -#: includes/class-freemius.php:22013 +#: includes/class-freemius.php:22043 msgid "Site successfully opted in." msgstr "" -#: includes/class-freemius.php:22014, includes/class-freemius.php:23020 +#: includes/class-freemius.php:22044, includes/class-freemius.php:23050 msgid "Awesome" msgstr "" -#: includes/class-freemius.php:22030, templates/forms/optout.php:41 +#: includes/class-freemius.php:22060, templates/forms/optout.php:41 msgid "We appreciate your help in making the %s better by letting us track some usage data." msgstr "" -#: includes/class-freemius.php:22031 +#: includes/class-freemius.php:22061 msgid "Thank you!" msgstr "" -#: includes/class-freemius.php:22038 +#: includes/class-freemius.php:22068 msgid "We will no longer be sending any usage data of %s on %s to %s." msgstr "" -#: includes/class-freemius.php:22196 +#: includes/class-freemius.php:22226 msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder." msgstr "" -#: includes/class-freemius.php:22202 +#: includes/class-freemius.php:22232 msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval." msgstr "" -#: includes/class-freemius.php:22207 +#: includes/class-freemius.php:22237 msgid "%s is the new owner of the account." msgstr "" -#: includes/class-freemius.php:22209 +#: includes/class-freemius.php:22239 msgctxt "as congratulations" msgid "Congrats" msgstr "" -#: includes/class-freemius.php:22245 +#: includes/class-freemius.php:22275 msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments." msgstr "" -#: includes/class-freemius.php:22257 +#: includes/class-freemius.php:22287 msgid "Please provide your full name." msgstr "" -#: includes/class-freemius.php:22262 +#: includes/class-freemius.php:22292 msgid "Your name was successfully updated." msgstr "" -#: includes/class-freemius.php:22323 +#: includes/class-freemius.php:22353 msgid "You have successfully updated your %s." msgstr "" -#: includes/class-freemius.php:22382 +#: includes/class-freemius.php:22412 msgid "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin." msgstr "" -#: includes/class-freemius.php:22385 +#: includes/class-freemius.php:22415 msgid "Click here" msgstr "" -#: includes/class-freemius.php:22483 +#: includes/class-freemius.php:22513 msgid "Just letting you know that the add-ons information of %s is being pulled from an external server." msgstr "" -#: includes/class-freemius.php:22484 +#: includes/class-freemius.php:22514 msgctxt "advance notice of something that will need attention." msgid "Heads up" msgstr "" -#: includes/class-freemius.php:23060 +#: includes/class-freemius.php:23090 msgctxt "exclamation" msgid "Hey" msgstr "" -#: includes/class-freemius.php:23060 +#: includes/class-freemius.php:23090 msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial." msgstr "" -#: includes/class-freemius.php:23068 +#: includes/class-freemius.php:23098 msgid "No commitment for %s days - cancel anytime!" msgstr "" -#: includes/class-freemius.php:23069 +#: includes/class-freemius.php:23099 msgid "No credit card required" msgstr "" -#: includes/class-freemius.php:23076, templates/forms/trial-start.php:53 +#: includes/class-freemius.php:23106, templates/forms/trial-start.php:53 msgctxt "call to action" msgid "Start free trial" msgstr "" -#: includes/class-freemius.php:23153 +#: includes/class-freemius.php:23183 msgid "Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!" msgstr "" -#: includes/class-freemius.php:23162 +#: includes/class-freemius.php:23192 msgid "Learn more" msgstr "" -#: includes/class-freemius.php:23348, templates/account.php:556, templates/account.php:706, templates/connect.php:179, templates/connect.php:456, templates/forms/license-activation.php:27, templates/account/partials/addon.php:321 +#: includes/class-freemius.php:23378, templates/account.php:558, templates/account.php:708, templates/connect.php:179, templates/connect.php:461, templates/forms/license-activation.php:27, templates/account/partials/addon.php:321 msgid "Activate License" msgstr "" -#: includes/class-freemius.php:23349, templates/account.php:650, templates/account.php:705, templates/account/partials/addon.php:322, templates/account/partials/site.php:271 +#: includes/class-freemius.php:23379, templates/account.php:652, templates/account.php:707, templates/account/partials/addon.php:322, templates/account/partials/site.php:271 msgid "Change License" msgstr "" -#: includes/class-freemius.php:23462, templates/account/partials/site.php:169 +#: includes/class-freemius.php:23500, templates/account/partials/site.php:169 msgid "Opt Out" msgstr "" -#: includes/class-freemius.php:23464, includes/class-freemius.php:23470, templates/account/partials/site.php:49, templates/account/partials/site.php:169 +#: includes/class-freemius.php:23502, includes/class-freemius.php:23508, templates/account/partials/site.php:49, templates/account/partials/site.php:169 msgid "Opt In" msgstr "" -#: includes/class-freemius.php:23700 +#: includes/class-freemius.php:23738 msgid " The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s" msgstr "" -#: includes/class-freemius.php:23708 +#: includes/class-freemius.php:23746 msgid "Activate %s features" msgstr "" -#: includes/class-freemius.php:23721 +#: includes/class-freemius.php:23759 msgid "Please follow these steps to complete the upgrade" msgstr "" -#: includes/class-freemius.php:23725 +#: includes/class-freemius.php:23763 msgid "Download the latest %s version" msgstr "" -#: includes/class-freemius.php:23729 +#: includes/class-freemius.php:23767 msgid "Upload and activate the downloaded version" msgstr "" -#: includes/class-freemius.php:23731 +#: includes/class-freemius.php:23769 msgid "How to upload and activate?" msgstr "" -#: includes/class-freemius.php:23865 +#: includes/class-freemius.php:23903 msgid "%sClick here%s to choose the sites where you'd like to activate the license on." msgstr "" -#: includes/class-freemius.php:24034 +#: includes/class-freemius.php:24072 msgid "Auto installation only works for opted-in users." msgstr "" -#: includes/class-freemius.php:24044, includes/class-freemius.php:24077, includes/class-fs-plugin-updater.php:1273, includes/class-fs-plugin-updater.php:1287 +#: includes/class-freemius.php:24082, includes/class-freemius.php:24115, includes/class-fs-plugin-updater.php:1261, includes/class-fs-plugin-updater.php:1275 msgid "Invalid module ID." msgstr "" -#: includes/class-freemius.php:24053, includes/class-fs-plugin-updater.php:1309 +#: includes/class-freemius.php:24091, includes/class-fs-plugin-updater.php:1297 msgid "Premium version already active." msgstr "" -#: includes/class-freemius.php:24060 +#: includes/class-freemius.php:24098 msgid "You do not have a valid license to access the premium version." msgstr "" -#: includes/class-freemius.php:24067 +#: includes/class-freemius.php:24105 msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version." msgstr "" -#: includes/class-freemius.php:24085, includes/class-fs-plugin-updater.php:1308 +#: includes/class-freemius.php:24123, includes/class-fs-plugin-updater.php:1296 msgid "Premium add-on version already installed." msgstr "" -#: includes/class-freemius.php:24435 +#: includes/class-freemius.php:24473 msgid "View paid features" msgstr "" -#: includes/class-freemius.php:24757 +#: includes/class-freemius.php:24795 msgid "Thank you so much for using %s and its add-ons!" msgstr "" -#: includes/class-freemius.php:24758 +#: includes/class-freemius.php:24796 msgid "Thank you so much for using %s!" msgstr "" -#: includes/class-freemius.php:24764 +#: includes/class-freemius.php:24802 msgid "You've already opted-in to our usage-tracking, which helps us keep improving the %s." msgstr "" -#: includes/class-freemius.php:24768 +#: includes/class-freemius.php:24806 msgid "Thank you so much for using our products!" msgstr "" -#: includes/class-freemius.php:24769 +#: includes/class-freemius.php:24807 msgid "You've already opted-in to our usage-tracking, which helps us keep improving them." msgstr "" -#: includes/class-freemius.php:24788 +#: includes/class-freemius.php:24826 msgid "%s and its add-ons" msgstr "" -#: includes/class-freemius.php:24797 +#: includes/class-freemius.php:24835 msgid "Products" msgstr "" -#: includes/class-freemius.php:24804, templates/connect.php:280 +#: includes/class-freemius.php:24842, templates/connect.php:275 msgid "Yes" msgstr "" -#: includes/class-freemius.php:24805, templates/connect.php:281 +#: includes/class-freemius.php:24843, templates/connect.php:276 msgid "send me security & feature updates, educational content and offers." msgstr "" -#: includes/class-freemius.php:24806, templates/connect.php:286 +#: includes/class-freemius.php:24844, templates/connect.php:281 msgid "No" msgstr "" -#: includes/class-freemius.php:24808, templates/connect.php:288 +#: includes/class-freemius.php:24846, templates/connect.php:283 msgid "do %sNOT%s send me security & feature updates, educational content and offers." msgstr "" -#: includes/class-freemius.php:24818 +#: includes/class-freemius.php:24856 msgid "Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)" msgstr "" -#: includes/class-freemius.php:24820, templates/connect.php:295 +#: includes/class-freemius.php:24858, templates/connect.php:290 msgid "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:" msgstr "" -#: includes/class-freemius.php:25102 +#: includes/class-freemius.php:25140 msgid "License key is empty." msgstr "" @@ -832,15 +832,15 @@ msgstr "" msgid "Important Upgrade Notice:" msgstr "" -#: includes/class-fs-plugin-updater.php:1338 +#: includes/class-fs-plugin-updater.php:1326 msgid "Installing plugin: %s" msgstr "" -#: includes/class-fs-plugin-updater.php:1379 +#: includes/class-fs-plugin-updater.php:1367 msgid "Unable to connect to the filesystem. Please confirm your credentials." msgstr "" -#: includes/class-fs-plugin-updater.php:1561 +#: includes/class-fs-plugin-updater.php:1549 msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work." msgstr "" @@ -861,7 +861,7 @@ msgstr "" msgid "Install Free Version Update Now" msgstr "" -#: includes/fs-plugin-info-dialog.php:745, templates/account.php:639 +#: includes/fs-plugin-info-dialog.php:745, templates/account.php:641 msgid "Install Update Now" msgstr "" @@ -878,7 +878,7 @@ msgctxt "as download latest version" msgid "Download Latest Free Version" msgstr "" -#: includes/fs-plugin-info-dialog.php:772, templates/account.php:99, templates/add-ons.php:37, templates/account/partials/addon.php:25 +#: includes/fs-plugin-info-dialog.php:772, templates/account.php:101, templates/add-ons.php:37, templates/account/partials/addon.php:25 msgctxt "as download latest version" msgid "Download Latest" msgstr "" @@ -887,11 +887,11 @@ msgstr "" msgid "Activate this add-on" msgstr "" -#: includes/fs-plugin-info-dialog.php:789, templates/connect.php:453 +#: includes/fs-plugin-info-dialog.php:789, templates/connect.php:458 msgid "Activate Free Version" msgstr "" -#: includes/fs-plugin-info-dialog.php:790, templates/account.php:123, templates/add-ons.php:330, templates/account/partials/addon.php:48 +#: includes/fs-plugin-info-dialog.php:790, templates/account.php:125, templates/add-ons.php:330, templates/account/partials/addon.php:48 msgid "Activate" msgstr "" @@ -1020,7 +1020,7 @@ msgstr "" msgid "Details" msgstr "" -#: includes/fs-plugin-info-dialog.php:1318, templates/account.php:110, templates/debug.php:201, templates/debug.php:238, templates/debug.php:455, templates/account/partials/addon.php:36 +#: includes/fs-plugin-info-dialog.php:1318, templates/account.php:112, templates/debug.php:201, templates/debug.php:238, templates/debug.php:455, templates/account/partials/addon.php:36 msgctxt "product version" msgid "Version" msgstr "" @@ -1034,7 +1034,7 @@ msgstr "" msgid "Last Updated" msgstr "" -#: includes/fs-plugin-info-dialog.php:1337, templates/account.php:525 +#: includes/fs-plugin-info-dialog.php:1337, templates/account.php:527 msgctxt "x-ago" msgid "%s ago" msgstr "" @@ -1143,293 +1143,293 @@ msgstr "" msgid "Latest Free Version Installed" msgstr "" -#: templates/account.php:100, templates/forms/subscription-cancellation.php:96, templates/account/partials/addon.php:26, templates/account/partials/site.php:311 +#: templates/account.php:102, templates/forms/subscription-cancellation.php:96, templates/account/partials/addon.php:26, templates/account/partials/site.php:311 msgid "Downgrading your plan" msgstr "" -#: templates/account.php:101, templates/forms/subscription-cancellation.php:97, templates/account/partials/addon.php:27, templates/account/partials/site.php:312 +#: templates/account.php:103, templates/forms/subscription-cancellation.php:97, templates/account/partials/addon.php:27, templates/account/partials/site.php:312 msgid "Cancelling the subscription" msgstr "" #. translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' -#: templates/account.php:103, templates/forms/subscription-cancellation.php:99, templates/account/partials/site.php:314 +#: templates/account.php:105, templates/forms/subscription-cancellation.php:99, templates/account/partials/site.php:314 msgid "%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s." msgstr "" -#: templates/account.php:104, templates/forms/subscription-cancellation.php:100, templates/account/partials/addon.php:30, templates/account/partials/site.php:315 +#: templates/account.php:106, templates/forms/subscription-cancellation.php:100, templates/account/partials/addon.php:30, templates/account/partials/site.php:315 msgid "Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price." msgstr "" -#: templates/account.php:105, templates/forms/subscription-cancellation.php:106, templates/account/partials/addon.php:31 +#: templates/account.php:107, templates/forms/subscription-cancellation.php:106, templates/account/partials/addon.php:31 msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?" msgstr "" -#: templates/account.php:106, templates/forms/subscription-cancellation.php:101, templates/account/partials/addon.php:32, templates/account/partials/site.php:316 +#: templates/account.php:108, templates/forms/subscription-cancellation.php:101, templates/account/partials/addon.php:32, templates/account/partials/site.php:316 msgid "You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support." msgstr "" -#: templates/account.php:107, templates/forms/subscription-cancellation.php:102, templates/account/partials/addon.php:33, templates/account/partials/site.php:317 +#: templates/account.php:109, templates/forms/subscription-cancellation.php:102, templates/account/partials/addon.php:33, templates/account/partials/site.php:317 msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features." msgstr "" #. translators: %s: Plan title (e.g. "Professional") -#: templates/account.php:109, templates/account/partials/activate-license-button.php:31, templates/account/partials/addon.php:35 +#: templates/account.php:111, templates/account/partials/activate-license-button.php:31, templates/account/partials/addon.php:35 msgid "Activate %s Plan" msgstr "" #. translators: %s: Time period (e.g. Auto renews in "2 months") -#: templates/account.php:112, templates/account/partials/addon.php:38, templates/account/partials/site.php:291 +#: templates/account.php:114, templates/account/partials/addon.php:38, templates/account/partials/site.php:291 msgid "Auto renews in %s" msgstr "" #. translators: %s: Time period (e.g. Expires in "2 months") -#: templates/account.php:114, templates/account/partials/addon.php:40, templates/account/partials/site.php:293 +#: templates/account.php:116, templates/account/partials/addon.php:40, templates/account/partials/site.php:293 msgid "Expires in %s" msgstr "" -#: templates/account.php:115 +#: templates/account.php:117 msgctxt "as synchronize license" msgid "Sync License" msgstr "" -#: templates/account.php:116, templates/account/partials/addon.php:41 +#: templates/account.php:118, templates/account/partials/addon.php:41 msgid "Cancel Trial" msgstr "" -#: templates/account.php:117, templates/account/partials/addon.php:42 +#: templates/account.php:119, templates/account/partials/addon.php:42 msgid "Change Plan" msgstr "" -#: templates/account.php:118, templates/account/partials/addon.php:43 +#: templates/account.php:120, templates/account/partials/addon.php:43 msgctxt "verb" msgid "Upgrade" msgstr "" -#: templates/account.php:120, templates/account/partials/addon.php:45, templates/account/partials/site.php:318 +#: templates/account.php:122, templates/account/partials/addon.php:45, templates/account/partials/site.php:318 msgctxt "verb" msgid "Downgrade" msgstr "" -#: templates/account.php:122, templates/add-ons.php:246, templates/plugin-info/features.php:72, templates/account/partials/addon.php:47, templates/account/partials/site.php:33 +#: templates/account.php:124, templates/add-ons.php:246, templates/plugin-info/features.php:72, templates/account/partials/addon.php:47, templates/account/partials/site.php:33 msgid "Free" msgstr "" -#: templates/account.php:124, templates/debug.php:371, includes/customizer/class-fs-customizer-upsell-control.php:110, templates/account/partials/addon.php:49 +#: templates/account.php:126, templates/debug.php:371, includes/customizer/class-fs-customizer-upsell-control.php:110, templates/account/partials/addon.php:49 msgctxt "as product pricing plan" msgid "Plan" msgstr "" -#: templates/account.php:125 +#: templates/account.php:127 msgid "Bundle Plan" msgstr "" -#: templates/account.php:248 +#: templates/account.php:250 msgid "Free Trial" msgstr "" -#: templates/account.php:259 +#: templates/account.php:261 msgid "Account Details" msgstr "" -#: templates/account.php:266, templates/forms/data-debug-mode.php:33 +#: templates/account.php:268, templates/forms/data-debug-mode.php:33 msgid "Start Debug" msgstr "" -#: templates/account.php:268 +#: templates/account.php:270 msgid "Stop Debug" msgstr "" -#: templates/account.php:275 +#: templates/account.php:277 msgid "Billing & Invoices" msgstr "" -#: templates/account.php:286 +#: templates/account.php:288 msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?" msgstr "" -#: templates/account.php:288 +#: templates/account.php:290 msgid "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?" msgstr "" -#: templates/account.php:291 +#: templates/account.php:293 msgid "Delete Account" msgstr "" -#: templates/account.php:303, templates/account/partials/addon.php:231, templates/account/partials/deactivate-license-button.php:35 +#: templates/account.php:305, templates/account/partials/addon.php:231, templates/account/partials/deactivate-license-button.php:35 msgid "Deactivate License" msgstr "" -#: templates/account.php:326, templates/forms/subscription-cancellation.php:125 +#: templates/account.php:328, templates/forms/subscription-cancellation.php:125 msgid "Are you sure you want to proceed?" msgstr "" -#: templates/account.php:326, templates/account/partials/addon.php:255 +#: templates/account.php:328, templates/account/partials/addon.php:255 msgid "Cancel Subscription" msgstr "" -#: templates/account.php:355, templates/account/partials/addon.php:340 +#: templates/account.php:357, templates/account/partials/addon.php:340 msgctxt "as synchronize" msgid "Sync" msgstr "" -#: templates/account.php:370, templates/debug.php:505 +#: templates/account.php:372, templates/debug.php:505 msgid "Name" msgstr "" -#: templates/account.php:376, templates/debug.php:506 +#: templates/account.php:378, templates/debug.php:506 msgid "Email" msgstr "" -#: templates/account.php:383, templates/debug.php:369, templates/debug.php:555 +#: templates/account.php:385, templates/debug.php:369, templates/debug.php:555 msgid "User ID" msgstr "" -#: templates/account.php:401, templates/account.php:719, templates/account.php:752, templates/debug.php:236, templates/debug.php:363, templates/debug.php:452, templates/debug.php:504, templates/debug.php:553, templates/debug.php:632, templates/account/payments.php:35, templates/debug/logger.php:21 +#: templates/account.php:403, templates/account.php:721, templates/account.php:754, templates/debug.php:236, templates/debug.php:363, templates/debug.php:452, templates/debug.php:504, templates/debug.php:553, templates/debug.php:632, templates/account/payments.php:35, templates/debug/logger.php:21 msgid "ID" msgstr "" -#: templates/account.php:408 +#: templates/account.php:410 msgid "Site ID" msgstr "" -#: templates/account.php:411 +#: templates/account.php:413 msgid "No ID" msgstr "" -#: templates/account.php:416, templates/debug.php:243, templates/debug.php:372, templates/debug.php:456, templates/debug.php:508, templates/account/partials/site.php:227 +#: templates/account.php:418, templates/debug.php:243, templates/debug.php:372, templates/debug.php:456, templates/debug.php:508, templates/account/partials/site.php:227 msgid "Public Key" msgstr "" -#: templates/account.php:422, templates/debug.php:373, templates/debug.php:457, templates/debug.php:509, templates/account/partials/site.php:239 +#: templates/account.php:424, templates/debug.php:373, templates/debug.php:457, templates/debug.php:509, templates/account/partials/site.php:239 msgid "Secret Key" msgstr "" -#: templates/account.php:425 +#: templates/account.php:427 msgctxt "as secret encryption key missing" msgid "No Secret" msgstr "" -#: templates/account.php:452, templates/account/partials/site.php:120, templates/account/partials/site.php:122 +#: templates/account.php:454, templates/account/partials/site.php:120, templates/account/partials/site.php:122 msgid "Trial" msgstr "" -#: templates/account.php:479, templates/debug.php:561, templates/account/partials/site.php:260 +#: templates/account.php:481, templates/debug.php:561, templates/account/partials/site.php:260 msgid "License Key" msgstr "" -#: templates/account.php:510 +#: templates/account.php:512 msgid "Join the Beta program" msgstr "" -#: templates/account.php:516 +#: templates/account.php:518 msgid "not verified" msgstr "" -#: templates/account.php:525, templates/account/partials/addon.php:190 +#: templates/account.php:527, templates/account/partials/addon.php:190 msgid "Expired" msgstr "" -#: templates/account.php:585 +#: templates/account.php:587 msgid "Premium version" msgstr "" -#: templates/account.php:587 +#: templates/account.php:589 msgid "Free version" msgstr "" -#: templates/account.php:599 +#: templates/account.php:601 msgid "Verify Email" msgstr "" -#: templates/account.php:613 +#: templates/account.php:615 msgid "Download %s Version" msgstr "" -#: templates/account.php:629 +#: templates/account.php:631 msgid "Download Paid Version" msgstr "" -#: templates/account.php:647, templates/account.php:890, templates/account/partials/site.php:248, templates/account/partials/site.php:270 +#: templates/account.php:649, templates/account.php:892, templates/account/partials/site.php:248, templates/account/partials/site.php:270 msgctxt "verb" msgid "Show" msgstr "" -#: templates/account.php:662 +#: templates/account.php:664 msgid "What is your %s?" msgstr "" -#: templates/account.php:670, templates/account/billing.php:21 +#: templates/account.php:672, templates/account/billing.php:21 msgctxt "verb" msgid "Edit" msgstr "" -#: templates/account.php:674, templates/forms/user-change.php:27 +#: templates/account.php:676, templates/forms/user-change.php:27 msgid "Change User" msgstr "" -#: templates/account.php:698 +#: templates/account.php:700 msgid "Sites" msgstr "" -#: templates/account.php:711 +#: templates/account.php:713 msgid "Search by address" msgstr "" -#: templates/account.php:720, templates/debug.php:366 +#: templates/account.php:722, templates/debug.php:366 msgid "Address" msgstr "" -#: templates/account.php:721 +#: templates/account.php:723 msgid "License" msgstr "" -#: templates/account.php:722 +#: templates/account.php:724 msgid "Plan" msgstr "" -#: templates/account.php:755 +#: templates/account.php:757 msgctxt "as software license" msgid "License" msgstr "" -#: templates/account.php:884 +#: templates/account.php:886 msgctxt "verb" msgid "Hide" msgstr "" -#: templates/account.php:906, templates/forms/data-debug-mode.php:31 +#: templates/account.php:908, templates/forms/data-debug-mode.php:31 msgid "Processing" msgstr "" -#: templates/account.php:909 +#: templates/account.php:911 msgid "Get updates for bleeding edge Beta versions of %s." msgstr "" -#: templates/account.php:967 +#: templates/account.php:969 msgid "Cancelling %s" msgstr "" -#: templates/account.php:967, templates/account.php:984, templates/forms/subscription-cancellation.php:27, templates/forms/deactivation/form.php:133 +#: templates/account.php:969, templates/account.php:986, templates/forms/subscription-cancellation.php:27, templates/forms/deactivation/form.php:133 msgid "trial" msgstr "" -#: templates/account.php:982, templates/forms/deactivation/form.php:150 +#: templates/account.php:984, templates/forms/deactivation/form.php:150 msgid "Cancelling %s..." msgstr "" -#: templates/account.php:985, templates/forms/subscription-cancellation.php:28, templates/forms/deactivation/form.php:134 +#: templates/account.php:987, templates/forms/subscription-cancellation.php:28, templates/forms/deactivation/form.php:134 msgid "subscription" msgstr "" -#: templates/account.php:999 +#: templates/account.php:1001 msgid "Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?" msgstr "" -#: templates/account.php:1073 +#: templates/account.php:1075 msgid "Disabling white-label mode" msgstr "" -#: templates/account.php:1074 +#: templates/account.php:1076 msgid "Enabling white-label mode" msgstr "" @@ -1455,7 +1455,7 @@ msgctxt "installed add-on" msgid "Installed" msgstr "" -#: templates/admin-notice.php:13, templates/forms/license-activation.php:220, templates/forms/resend-key.php:77 +#: templates/admin-notice.php:13, templates/forms/license-activation.php:222, templates/forms/resend-key.php:77 msgctxt "as close a window" msgid "Dismiss" msgstr "" @@ -1510,84 +1510,92 @@ msgstr "" msgid "Agree & Activate License" msgstr "" -#: templates/connect.php:189 -msgid "Thanks for purchasing %s! To get started, please enter your license key:" +#: templates/connect.php:184 +msgid "Welcome to %s! To get started, please enter your license key:" msgstr "" -#: templates/connect.php:196 +#: templates/connect.php:191 msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s." msgstr "" -#: templates/connect.php:197 +#: templates/connect.php:192 msgid "Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s." msgstr "" -#: templates/connect.php:203 +#: templates/connect.php:198 msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine." msgstr "" -#: templates/connect.php:204 +#: templates/connect.php:199 msgid "Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine." msgstr "" -#: templates/connect.php:238 +#: templates/connect.php:233 msgid "We're excited to introduce the Freemius network-level integration." msgstr "" -#: templates/connect.php:241 +#: templates/connect.php:236 msgid "During the update process we detected %d site(s) that are still pending license activation." msgstr "" -#: templates/connect.php:243 +#: templates/connect.php:238 msgid "If you'd like to use the %s on those sites, please enter your license key below and click the activation button." msgstr "" -#: templates/connect.php:245 +#: templates/connect.php:240 msgid "%s's paid features" msgstr "" -#: templates/connect.php:250 +#: templates/connect.php:245 msgid "Alternatively, you can skip it for now and activate the license later, in your %s's network-level Account page." msgstr "" -#: templates/connect.php:252 +#: templates/connect.php:247 msgid "During the update process we detected %s site(s) in the network that are still pending your attention." msgstr "" -#: templates/connect.php:261, templates/forms/data-debug-mode.php:35, templates/forms/license-activation.php:49 +#: templates/connect.php:256, templates/forms/data-debug-mode.php:35, templates/forms/license-activation.php:49 msgid "License key" msgstr "" -#: templates/connect.php:264, templates/forms/license-activation.php:22 +#: templates/connect.php:259, templates/forms/license-activation.php:22 msgid "Can't find your license key?" msgstr "" -#: templates/connect.php:323, templates/connect.php:695, templates/forms/deactivation/retry-skip.php:20 +#: templates/connect.php:318, templates/connect.php:700, templates/forms/deactivation/retry-skip.php:20 msgctxt "verb" msgid "Skip" msgstr "" -#: templates/connect.php:326 +#: templates/connect.php:321 msgid "Delegate to Site Admins" msgstr "" -#: templates/connect.php:326 +#: templates/connect.php:321 msgid "If you click it, this decision will be delegated to the sites administrators." msgstr "" -#: templates/connect.php:364 +#: templates/connect.php:346 +msgid "License issues?" +msgstr "" + +#: templates/connect.php:362 msgid "Your Profile Overview" msgstr "" -#: templates/connect.php:365 +#: templates/connect.php:363 msgid "Name and email address" msgstr "" -#: templates/connect.php:372 +#: templates/connect.php:370 +msgid "So you can manage and control your license remotely from the User Dashboard." +msgstr "" + +#: templates/connect.php:371 msgid "Your Site Overview" msgstr "" -#: templates/connect.php:373 +#: templates/connect.php:372 msgid "Site URL, WP version, PHP info" msgstr "" @@ -1595,64 +1603,84 @@ msgstr "" msgid "Admin Notices" msgstr "" -#: templates/connect.php:380, templates/connect.php:396 +#: templates/connect.php:380, templates/connect.php:398 msgid "Updates, announcements, marketing, no spam" msgstr "" -#: templates/connect.php:386 -msgid "Current %s Events" +#: templates/connect.php:387 +msgid "So you can reuse the license when the %s is no longer active." +msgstr "" + +#: templates/connect.php:388 +msgid "Current %s Status" msgstr "" -#: templates/connect.php:387 -msgid "Activation, deactivation and uninstall" +#: templates/connect.php:389 +msgid "Active, deactivated, or uninstalled" msgstr "" -#: templates/connect.php:395 +#: templates/connect.php:397 msgid "Newsletter" msgstr "" -#: templates/connect.php:403 +#: templates/connect.php:405 msgid "Plugins & Themes" msgstr "" -#: templates/connect.php:404 +#: templates/connect.php:405 +msgid "optional" +msgstr "" + +#: templates/connect.php:406 +msgid "To help us troubleshoot any potential issues that may arise from other plugin or theme conflicts." +msgstr "" + +#: templates/connect.php:407 msgid "Title, slug, version, and is active" msgstr "" -#: templates/connect.php:421, templates/forms/license-activation.php:41 -msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license." +#: templates/connect.php:424 +msgid "The %1$s will periodically send %2$s to %3$s for security & feature updates delivery, and license management." msgstr "" #: templates/connect.php:426 +msgid "diagnostic data" +msgstr "" + +#: templates/connect.php:427 +msgid "Freemius is our licensing and software updates engine" +msgstr "" + +#: templates/connect.php:430 msgid "What permissions are being granted?" msgstr "" -#: templates/connect.php:452 +#: templates/connect.php:457 msgid "Don't have a license key?" msgstr "" -#: templates/connect.php:455 +#: templates/connect.php:460 msgid "Have a license key?" msgstr "" -#: templates/connect.php:463 +#: templates/connect.php:468 msgid "Privacy Policy" msgstr "" -#: templates/connect.php:465 +#: templates/connect.php:470 msgid "License Agreement" msgstr "" -#: templates/connect.php:465 +#: templates/connect.php:470 msgid "Terms of Service" msgstr "" -#: templates/connect.php:854 +#: templates/connect.php:866 msgctxt "as in the process of sending an email" msgid "Sending email" msgstr "" -#: templates/connect.php:855 +#: templates/connect.php:867 msgctxt "as activating plugin" msgid "Activating" msgstr "" @@ -2241,7 +2269,11 @@ msgstr "" msgid "Update License" msgstr "" -#: templates/forms/license-activation.php:181 +#: templates/forms/license-activation.php:41 +msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license." +msgstr "" + +#: templates/forms/license-activation.php:183 msgid "Associate with the license owner's account." msgstr "" diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/start.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/start.php index cd70a40f..9cb4f4d0 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/start.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/start.php @@ -15,7 +15,7 @@ * * @var string */ - $this_sdk_version = '2.4.1'; + $this_sdk_version = '2.4.2'; #region SDK Selection Logic -------------------------------------------------------------------- @@ -512,7 +512,7 @@ function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = } /** - * @param array $module Plugin or Theme details. + * @param array $module Plugin or Theme details. * * @return Freemius * @throws Freemius_Exception @@ -527,4 +527,4 @@ function fs_dynamic_init( $module ) { function fs_dump_log() { FS_Logger::dump(); } - } \ No newline at end of file + } diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/account.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/account.php index ca3a6c44..a5d8f7c7 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/account.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/account.php @@ -21,7 +21,9 @@ /** * @var FS_Plugin_Tag $update */ - $update = $fs->get_update( false, false, WP_FS__TIME_24_HOURS_IN_SEC / 24 ); + $update = $fs->has_release_on_freemius() ? + $fs->get_update( false, false, WP_FS__TIME_24_HOURS_IN_SEC / 24 ) : + null; if ( is_object($update) ) { /** @@ -433,11 +435,11 @@ class="dashicons dashicons-image-rotate"> $fs->get_plugin_version() ); - if ( $is_premium && ! $is_whitelabeled ) { + if ( ! fs_is_network_admin() && $is_premium && ! $is_whitelabeled ) { $profile[] = array( 'id' => 'beta_program', 'title' => '', - 'value' => $user->is_beta + 'value' => $site->is_beta ); } diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/connect.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/connect.php index d63b1533..5919ac8b 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/connect.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/connect.php @@ -1,1026 +1,1038 @@ -get_slug(); - - $is_pending_activation = $fs->is_pending_activation(); - $is_premium_only = $fs->is_only_premium(); - $has_paid_plans = $fs->has_paid_plan(); - $is_premium_code = $fs->is_premium(); - $is_freemium = $fs->is_freemium(); - - $fs->_enqueue_connect_essentials(); - - $current_user = Freemius::_get_current_wp_user(); - - $first_name = $current_user->user_firstname; - if ( empty( $first_name ) ) { - $first_name = $current_user->nickname; - } - - $site_url = get_site_url(); - $protocol_pos = strpos( $site_url, '://' ); - if ( false !== $protocol_pos ) { - $site_url = substr( $site_url, $protocol_pos + 3 ); - } - - $freemius_site_www = 'https://freemius.com'; - - $freemius_usage_tracking_url = $fs->get_usage_tracking_terms_url(); - $freemius_plugin_terms_url = $fs->get_eula_url(); - - $freemius_site_url = $fs->is_premium() ? - $freemius_site_www : - $freemius_usage_tracking_url; - - if ( $fs->is_premium() ) { - $freemius_site_url .= '?' . http_build_query( array( - 'id' => $fs->get_id(), - 'slug' => $slug, - ) ); - } - - $freemius_link = 'freemius.com'; - - $error = fs_request_get( 'error' ); - - $require_license_key = $is_premium_only || - ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) ); - - if ( $is_pending_activation ) { - $require_license_key = false; - } - - if ( $require_license_key ) { - $fs->_add_license_activation_dialog_box(); - } - - $is_optin_dialog = ( - $fs->is_theme() && - $fs->is_themes_page() && - $fs->show_opt_in_on_themes_page() - ); - - if ( $is_optin_dialog ) { - $show_close_button = false; - $previous_theme_activation_url = ''; - - if ( ! $is_premium_code ) { - $show_close_button = true; - } else if ( $is_premium_only ) { - $previous_theme_activation_url = $fs->get_previous_theme_activation_url(); - $show_close_button = ( ! empty( $previous_theme_activation_url ) ); - } - } - - $is_network_level_activation = ( - fs_is_network_admin() && - $fs->is_network_active() && - ! $fs->is_network_delegated_connection() - ); - - $fs_user = Freemius::_get_user_by_email( $current_user->user_email ); - - $activate_with_current_user = ( - is_object( $fs_user ) && - ! $is_pending_activation && - // If requires a license for activation, use the user associated with the license for the opt-in. - ! $require_license_key && - ! $is_network_level_activation - ); - - $optin_params = $fs->get_opt_in_params( array(), $is_network_level_activation ); - $sites = isset( $optin_params['sites'] ) ? $optin_params['sites'] : array(); - - $is_network_upgrade_mode = ( fs_is_network_admin() && $fs->is_network_upgrade_mode() ); - - /* translators: %s: name (e.g. Hey John,) */ - $hey_x_text = esc_html( sprintf( fs_text_x_inline( 'Hey %s,', 'greeting', 'hey-x', $slug ), $first_name ) ); - - $is_gdpr_required = ( ! $is_pending_activation && ! $require_license_key ) ? - FS_GDPR_Manager::instance()->is_required() : - false; - - if ( is_null( $is_gdpr_required ) ) { - $is_gdpr_required = $fs->fetch_and_store_current_user_gdpr_anonymously(); - } -?> - -

    - - - - do_action( 'connect/before' ); - ?> -
    -
    - - - $fs->get_id() ); - fs_require_once_template( 'plugin-icon.php', $vars ); - ?> - - -
    -
    - -

    - -

    apply_filters( 'pending_activation_message', sprintf( - /* translators: %s: name (e.g. Thanks John!) */ - fs_text_inline( 'Thanks %s!', 'thanks-x', $slug ) . '
    ' . - fs_text_inline( 'You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.', 'pending-activation-message', $slug ), - $first_name, - '' . $fs->get_plugin_name() . '', - '' . $current_user->user_email . '', - fs_text_inline( 'complete the install', 'complete-the-install', $slug ) - ) ); - } else if ( $require_license_key ) { - $button_label = $is_network_upgrade_mode ? - fs_text_inline( 'Activate License', 'agree-activate-license', $slug ) : - fs_text_inline( 'Agree & Activate License', 'agree-activate-license', $slug ); - - $message = $fs->apply_filters( - 'connect-message_on-premium', - ($is_network_upgrade_mode ? - '' : - /* translators: %s: name (e.g. Hey John,) */ - $hey_x_text . '
    ' - ) . - sprintf( fs_text_inline( 'Thanks for purchasing %s! To get started, please enter your license key:', 'thanks-for-purchasing', $slug ), '' . $fs->get_plugin_name() . '' ), - $first_name, - $fs->get_plugin_name() - ); - } else { - $filter = 'connect_message'; - $default_optin_message = $is_gdpr_required ? - fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug) : - fs_text_inline( 'Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug); - - if ( $fs->is_plugin_update() ) { - // If Freemius was added on a plugin update, set different - // opt-in message. - $default_optin_message = $is_gdpr_required ? - fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ) : - fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ); - - // If user customized the opt-in message on update, use - // that message. Otherwise, fallback to regular opt-in - // custom message if exist. - if ( $fs->has_filter( 'connect_message_on_update' ) ) { - $filter = 'connect_message_on_update'; - } - } - - $message = $fs->apply_filters( - $filter, - ($is_network_upgrade_mode ? - '' : - /* translators: %s: name (e.g. Hey John,) */ - $hey_x_text . '
    ' - ) . - sprintf( - esc_html( $default_optin_message ), - '' . esc_html( $fs->get_plugin_name() ) . '', - '' . $current_user->user_login . '', - '' . $site_url . '', - $freemius_link - ), - $first_name, - $fs->get_plugin_name(), - $current_user->user_login, - '' . $site_url . '', - $freemius_link, - $is_gdpr_required - ); - } - - if ( $is_network_upgrade_mode ) { - $network_integration_text = esc_html( fs_text_inline( 'We\'re excited to introduce the Freemius network-level integration.', 'connect_message_network_upgrade', $slug ) ); - - if ($is_premium_code){ - $message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %d site(s) that are still pending license activation.', 'connect_message_network_upgrade-premium', $slug ), count( $sites ) ); - - $message .= '

    ' . sprintf( fs_text_inline( 'If you\'d like to use the %s on those sites, please enter your license key below and click the activation button.', 'connect_message_network_upgrade-premium-activate-license', $slug ), $is_premium_only ? $fs->get_module_label( true ) : sprintf( - /* translators: %s: module type (plugin, theme, or add-on) */ - fs_text_inline( "%s's paid features", 'x-paid-features', $slug ), - $fs->get_module_label( true ) - ) ); - - /* translators: %s: module type (plugin, theme, or add-on) */ - $message .= ' ' . sprintf( fs_text_inline( 'Alternatively, you can skip it for now and activate the license later, in your %s\'s network-level Account page.', 'connect_message_network_upgrade-premium-skip-license', $slug ), $fs->get_module_label( true ) ); - }else { - $message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %s site(s) in the network that are still pending your attention.', 'connect_message_network_upgrade-free', $slug ), count( $sites ) ) . '

    ' . ( fs_starts_with( $message, $hey_x_text . '
    ' ) ? substr( $message, strlen( $hey_x_text . '
    ' ) ) : $message ); - } - } - - echo $message; - ?>

    - -
    - - - -
    - - do_action( 'connect/after_license_input' ); - ?> - - - %s', - $fs->get_text_inline( 'Yes', 'yes' ), - $fs->get_text_inline( 'send me security & feature updates, educational content and offers.', 'send-updates' ) - ); - - $do_not_send_updates_text = sprintf( - '%s - %s', - $fs->get_text_inline( 'No', 'no' ), - sprintf( - $fs->get_text_inline( 'do %sNOT%s send me security & feature updates, educational content and offers.', 'do-not-send-updates' ), - '', - '' - ) - ); - ?> -
    - -
    - - -
    -
    - - - $fs->get_id(), - 'sites' => $sites, - 'require_license_key' => $require_license_key - ); - - echo fs_get_template( 'partials/network-activation.php', $vars ); - ?> - -
    -
    - is_enable_anonymous() && ! $is_pending_activation && ( ! $require_license_key || $is_network_upgrade_mode ) ) : ?> - - - apply_filters( 'show_delegation_option', true ) ) : ?> - - - -
    - - get_public_key() ) ?> - - -
    - -
    - - $value ) : ?> - - - - -
    - -
    'dashicons dashicons-admin-users', - 'label' => $fs->get_text_inline( 'Your Profile Overview', 'permissions-profile' ), - 'desc' => $fs->get_text_inline( 'Name and email address', 'permissions-profile_desc' ), - 'priority' => 5, - ); - } - - $permissions['site'] = array( - 'icon-class' => 'dashicons dashicons-admin-settings', - 'label' => $fs->get_text_inline( 'Your Site Overview', 'permissions-site' ), - 'desc' => $fs->get_text_inline( 'Site URL, WP version, PHP info', 'permissions-site_desc' ), - 'priority' => 10, - ); - - $permissions['notices'] = array( - 'icon-class' => 'dashicons dashicons-testimonial', - 'label' => $fs->get_text_inline( 'Admin Notices', 'permissions-admin-notices' ), - 'desc' => $fs->get_text_inline( 'Updates, announcements, marketing, no spam', 'permissions-newsletter_desc' ), - 'priority' => 13, - ); - - $permissions['events'] = array( - 'icon-class' => 'dashicons dashicons-admin-' . ( $fs->is_plugin() ? 'plugins' : 'appearance' ), - 'label' => sprintf( $fs->get_text_inline( 'Current %s Events', 'permissions-events' ), ucfirst( $fs->get_module_type() ) ), - 'desc' => $fs->get_text_inline( 'Activation, deactivation and uninstall', 'permissions-events_desc' ), - 'priority' => 20, - ); - - // Add newsletter permissions if enabled. - if ( $is_gdpr_required || $fs->is_permission_requested( 'newsletter' ) ) { - $permissions['newsletter'] = array( - 'icon-class' => 'dashicons dashicons-email-alt', - 'label' => $fs->get_text_inline( 'Newsletter', 'permissions-newsletter' ), - 'desc' => $fs->get_text_inline( 'Updates, announcements, marketing, no spam', 'permissions-newsletter_desc' ), - 'priority' => 15, - ); - } - - $permissions['extensions'] = array( - 'icon-class' => 'dashicons dashicons-menu', - 'label' => $fs->get_text_inline( 'Plugins & Themes', 'permissions-extensions' ), - 'desc' => $fs->get_text_inline( 'Title, slug, version, and is active', 'permissions-extensions_desc' ), - 'priority' => 25, - 'optional' => true, - 'default' => $fs->apply_filters( 'permission_extensions_default', true ) - ); - - // Allow filtering of the permissions list. - $permissions = $fs->apply_filters( 'permission_list', $permissions ); - - // Sort by priority. - uasort( $permissions, 'fs_sort_by_priority' ); - - if ( ! empty( $permissions ) ) : ?> -
    - -

    get_module_label( true ), - $freemius_link - ) ?>

    - - -
      $permission ) : ?> -
    • - - -
      -
      -
      - - -
      - - -

      -
      -
    • - -
    -
    - - -
    -

    - - - - - - - -

    -
    - -
    - -   -   - -
    -
    - do_action( 'connect/after' ); - - if ( $is_optin_dialog ) { ?> -
    - - +get_slug(); + + $is_pending_activation = $fs->is_pending_activation(); + $is_premium_only = $fs->is_only_premium(); + $has_paid_plans = $fs->has_paid_plan(); + $is_premium_code = $fs->is_premium(); + $is_freemium = $fs->is_freemium(); + + $fs->_enqueue_connect_essentials(); + + $current_user = Freemius::_get_current_wp_user(); + + $first_name = $current_user->user_firstname; + if ( empty( $first_name ) ) { + $first_name = $current_user->nickname; + } + + $site_url = get_site_url(); + $protocol_pos = strpos( $site_url, '://' ); + if ( false !== $protocol_pos ) { + $site_url = substr( $site_url, $protocol_pos + 3 ); + } + + $freemius_site_www = 'https://freemius.com'; + + $freemius_usage_tracking_url = $fs->get_usage_tracking_terms_url(); + $freemius_plugin_terms_url = $fs->get_eula_url(); + + $freemius_site_url = $fs->is_premium() ? + $freemius_site_www : + $freemius_usage_tracking_url; + + if ( $fs->is_premium() ) { + $freemius_site_url .= '?' . http_build_query( array( + 'id' => $fs->get_id(), + 'slug' => $slug, + ) ); + } + + $freemius_link = 'freemius.com'; + + $error = fs_request_get( 'error' ); + + $require_license_key = $is_premium_only || + ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) ); + + if ( $is_pending_activation ) { + $require_license_key = false; + } + + if ( $require_license_key ) { + $fs->_add_license_activation_dialog_box(); + } + + $is_optin_dialog = ( + $fs->is_theme() && + $fs->is_themes_page() && + $fs->show_opt_in_on_themes_page() + ); + + if ( $is_optin_dialog ) { + $show_close_button = false; + $previous_theme_activation_url = ''; + + if ( ! $is_premium_code ) { + $show_close_button = true; + } else if ( $is_premium_only ) { + $previous_theme_activation_url = $fs->get_previous_theme_activation_url(); + $show_close_button = ( ! empty( $previous_theme_activation_url ) ); + } + } + + $is_network_level_activation = ( + fs_is_network_admin() && + $fs->is_network_active() && + ! $fs->is_network_delegated_connection() + ); + + $fs_user = Freemius::_get_user_by_email( $current_user->user_email ); + + $activate_with_current_user = ( + is_object( $fs_user ) && + ! $is_pending_activation && + // If requires a license for activation, use the user associated with the license for the opt-in. + ! $require_license_key && + ! $is_network_level_activation + ); + + $optin_params = $fs->get_opt_in_params( array(), $is_network_level_activation ); + $sites = isset( $optin_params['sites'] ) ? $optin_params['sites'] : array(); + + $is_network_upgrade_mode = ( fs_is_network_admin() && $fs->is_network_upgrade_mode() ); + + /* translators: %s: name (e.g. Hey John,) */ + $hey_x_text = esc_html( sprintf( fs_text_x_inline( 'Hey %s,', 'greeting', 'hey-x', $slug ), $first_name ) ); + + $is_gdpr_required = ( ! $is_pending_activation && ! $require_license_key ) ? + FS_GDPR_Manager::instance()->is_required() : + false; + + if ( is_null( $is_gdpr_required ) ) { + $is_gdpr_required = $fs->fetch_and_store_current_user_gdpr_anonymously(); + } +?> + +
    + + + + do_action( 'connect/before' ); + ?> +
    +
    + + + $fs->get_id() ); + fs_require_once_template( 'plugin-icon.php', $vars ); + ?> + + +
    +
    + +

    + +

    apply_filters( 'pending_activation_message', sprintf( + /* translators: %s: name (e.g. Thanks John!) */ + fs_text_inline( 'Thanks %s!', 'thanks-x', $slug ) . '
    ' . + fs_text_inline( 'You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.', 'pending-activation-message', $slug ), + $first_name, + '' . $fs->get_plugin_name() . '', + '' . $current_user->user_email . '', + fs_text_inline( 'complete the install', 'complete-the-install', $slug ) + ) ); + } else if ( $require_license_key ) { + $button_label = $is_network_upgrade_mode ? + fs_text_inline( 'Activate License', 'agree-activate-license', $slug ) : + fs_text_inline( 'Agree & Activate License', 'agree-activate-license', $slug ); + + $message = $fs->apply_filters( + 'connect-message_on-premium', + sprintf( fs_text_inline( 'Welcome to %s! To get started, please enter your license key:', 'thanks-for-purchasing', $slug ), '' . $fs->get_plugin_name() . '' ), + $first_name, + $fs->get_plugin_name() + ); + } else { + $filter = 'connect_message'; + $default_optin_message = $is_gdpr_required ? + fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug) : + fs_text_inline( 'Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug); + + if ( $fs->is_plugin_update() ) { + // If Freemius was added on a plugin update, set different + // opt-in message. + $default_optin_message = $is_gdpr_required ? + fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ) : + fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ); + + // If user customized the opt-in message on update, use + // that message. Otherwise, fallback to regular opt-in + // custom message if exist. + if ( $fs->has_filter( 'connect_message_on_update' ) ) { + $filter = 'connect_message_on_update'; + } + } + + $message = $fs->apply_filters( + $filter, + ($is_network_upgrade_mode ? + '' : + /* translators: %s: name (e.g. Hey John,) */ + $hey_x_text . '
    ' + ) . + sprintf( + esc_html( $default_optin_message ), + '' . esc_html( $fs->get_plugin_name() ) . '', + '' . $current_user->user_login . '', + '' . $site_url . '', + $freemius_link + ), + $first_name, + $fs->get_plugin_name(), + $current_user->user_login, + '' . $site_url . '', + $freemius_link, + $is_gdpr_required + ); + } + + if ( $is_network_upgrade_mode ) { + $network_integration_text = esc_html( fs_text_inline( 'We\'re excited to introduce the Freemius network-level integration.', 'connect_message_network_upgrade', $slug ) ); + + if ($is_premium_code){ + $message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %d site(s) that are still pending license activation.', 'connect_message_network_upgrade-premium', $slug ), count( $sites ) ); + + $message .= '

    ' . sprintf( fs_text_inline( 'If you\'d like to use the %s on those sites, please enter your license key below and click the activation button.', 'connect_message_network_upgrade-premium-activate-license', $slug ), $is_premium_only ? $fs->get_module_label( true ) : sprintf( + /* translators: %s: module type (plugin, theme, or add-on) */ + fs_text_inline( "%s's paid features", 'x-paid-features', $slug ), + $fs->get_module_label( true ) + ) ); + + /* translators: %s: module type (plugin, theme, or add-on) */ + $message .= ' ' . sprintf( fs_text_inline( 'Alternatively, you can skip it for now and activate the license later, in your %s\'s network-level Account page.', 'connect_message_network_upgrade-premium-skip-license', $slug ), $fs->get_module_label( true ) ); + }else { + $message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %s site(s) in the network that are still pending your attention.', 'connect_message_network_upgrade-free', $slug ), count( $sites ) ) . '

    ' . ( fs_starts_with( $message, $hey_x_text . '
    ' ) ? substr( $message, strlen( $hey_x_text . '
    ' ) ) : $message ); + } + } + + echo $message; + ?>

    + +
    + + + +
    + + do_action( 'connect/after_license_input' ); + ?> + + - %s', + $fs->get_text_inline( 'Yes', 'yes' ), + $fs->get_text_inline( 'send me security & feature updates, educational content and offers.', 'send-updates' ) + ); + + $do_not_send_updates_text = sprintf( + '%s - %s', + $fs->get_text_inline( 'No', 'no' ), + sprintf( + $fs->get_text_inline( 'do %sNOT%s send me security & feature updates, educational content and offers.', 'do-not-send-updates' ), + '', + '' + ) + ); + ?> +
    + +
    + + +
    +
    + + + $fs->get_id(), + 'sites' => $sites, + 'require_license_key' => $require_license_key + ); + + echo fs_get_template( 'partials/network-activation.php', $vars ); + ?> + +
    +
    + is_enable_anonymous() && ! $is_pending_activation && ( ! $require_license_key || $is_network_upgrade_mode ) ) : ?> + + + apply_filters( 'show_delegation_option', true ) ) : ?> + + + +
    + + get_public_key() ) ?> + + +
    + +
    + + $value ) : ?> + + + + +
    + + + + +
    'dashicons dashicons-admin-users', + 'label' => $fs->get_text_inline( 'Your Profile Overview', 'permissions-profile' ), + 'desc' => $fs->get_text_inline( 'Name and email address', 'permissions-profile_desc' ), + 'priority' => 5, + ); + } + + $permissions['site'] = array( + 'icon-class' => 'dashicons dashicons-admin-settings', + 'tooltip' => ( $require_license_key ? sprintf( $fs->get_text_inline( 'So you can manage and control your license remotely from the User Dashboard.', 'permissions-site_tooltip' ), $fs->get_module_type() ) : '' ), + 'label' => $fs->get_text_inline( 'Your Site Overview', 'permissions-site' ), + 'desc' => $fs->get_text_inline( 'Site URL, WP version, PHP info', 'permissions-site_desc' ), + 'priority' => 10, + ); + + if ( ! $require_license_key ) { + $permissions['notices'] = array( + 'icon-class' => 'dashicons dashicons-testimonial', + 'label' => $fs->get_text_inline( 'Admin Notices', 'permissions-admin-notices' ), + 'desc' => $fs->get_text_inline( 'Updates, announcements, marketing, no spam', 'permissions-newsletter_desc' ), + 'priority' => 13, + ); + } + + $permissions['events'] = array( + 'icon-class' => 'dashicons dashicons-admin-' . ( $fs->is_plugin() ? 'plugins' : 'appearance' ), + 'tooltip' => ( $require_license_key ? sprintf( $fs->get_text_inline( 'So you can reuse the license when the %s is no longer active.', 'permissions-events_tooltip' ), $fs->get_module_type() ) : '' ), + 'label' => sprintf( $fs->get_text_inline( 'Current %s Status', 'permissions-events' ), ucfirst( $fs->get_module_type() ) ), + 'desc' => $fs->get_text_inline( 'Active, deactivated, or uninstalled', 'permissions-events_desc' ), + 'priority' => 20, + ); + + // Add newsletter permissions if enabled. + if ( $is_gdpr_required || $fs->is_permission_requested( 'newsletter' ) ) { + $permissions['newsletter'] = array( + 'icon-class' => 'dashicons dashicons-email-alt', + 'label' => $fs->get_text_inline( 'Newsletter', 'permissions-newsletter' ), + 'desc' => $fs->get_text_inline( 'Updates, announcements, marketing, no spam', 'permissions-newsletter_desc' ), + 'priority' => 15, + ); + } + + $permissions['extensions'] = array( + 'icon-class' => 'dashicons dashicons-menu', + 'label' => $fs->get_text_inline( 'Plugins & Themes', 'permissions-extensions' ) . ( $require_license_key ? ' (' . $fs->get_text_inline( 'optional' ) . ')' : '' ), + 'tooltip' => $fs->get_text_inline( 'To help us troubleshoot any potential issues that may arise from other plugin or theme conflicts.', 'permissions-events_tooltip' ), + 'desc' => $fs->get_text_inline( 'Title, slug, version, and is active', 'permissions-extensions_desc' ), + 'priority' => 25, + 'optional' => true, + 'default' => $fs->apply_filters( 'permission_extensions_default', ! $require_license_key ) + ); + + // Allow filtering of the permissions list. + $permissions = $fs->apply_filters( 'permission_list', $permissions ); + + // Sort by priority. + uasort( $permissions, 'fs_sort_by_priority' ); + + if ( ! empty( $permissions ) ) : ?> +
    + +

    get_module_label( true ), + sprintf('%s', fs_esc_html_inline('diagnostic data', 'send-data')), + 'freemius.com ' . $fs->get_text_inline( 'Freemius is our licensing and software updates engine', 'permissions-extensions_desc' ) . '' + ) ?>

    + + + +
      $permission ) : ?> +
    • + + +
      +
      +
      + + +
      + class="fs-tooltip-trigger"> + +

      +
      +
    • + +
    +
    + + +
    +

    + + + + + + + +

    +
    + +
    + +   -   + +
    +
    + do_action( 'connect/after' ); + + if ( $is_optin_dialog ) { ?> +
    + + \ No newline at end of file diff --git a/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/forms/license-activation.php b/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/forms/license-activation.php index 87c5bb13..639f433e 100755 --- a/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/forms/license-activation.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/freemius/templates/forms/license-activation.php @@ -115,13 +115,15 @@ * @var FS_Plugin_License $license */ foreach ( $available_licenses as $license ) { + $plan = $fs->_get_plan_by_id( $license->plan_id ); + $label = sprintf( "%s-Site %s License - %s", ( 1 == $license->quota ? 'Single' : ( $license->is_unlimited() ? 'Unlimited' : $license->quota ) ), - $fs->_get_plan_by_id( $license->plan_id )->title, + ( is_object( $plan ) ? $plan->title : '' ), $license->get_html_escaped_masked_secret_key() ); diff --git a/plugins/stackable-ultimate-gutenberg-blocks/plugin.php b/plugins/stackable-ultimate-gutenberg-blocks/plugin.php index d46d6a97..22f385f0 100644 --- a/plugins/stackable-ultimate-gutenberg-blocks/plugin.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/plugin.php @@ -7,7 +7,7 @@ * Author: Gambit Technologies, Inc * Author URI: http://gambit.ph * Text Domain: stackable-ultimate-gutenberg-blocks - * Version: 2.13.2 + * Version: 2.14.1 * * @package Stackable */ @@ -23,7 +23,7 @@ } defined( 'STACKABLE_SHOW_PRO_NOTICES' ) || define( 'STACKABLE_SHOW_PRO_NOTICES', true ); -defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '2.13.2' ); +defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '2.14.1' ); defined( 'STACKABLE_FILE' ) || define( 'STACKABLE_FILE', __FILE__ ); defined( 'STACKABLE_I18N' ) || define( 'STACKABLE_I18N', 'stackable-ultimate-gutenberg-blocks' ); // Plugin slug. diff --git a/plugins/stackable-ultimate-gutenberg-blocks/readme.txt b/plugins/stackable-ultimate-gutenberg-blocks/readme.txt index 831f392b..172f9bcf 100644 --- a/plugins/stackable-ultimate-gutenberg-blocks/readme.txt +++ b/plugins/stackable-ultimate-gutenberg-blocks/readme.txt @@ -2,9 +2,9 @@ Contributors: bfintal, gambitph, freemius Tags: blocks, gutenberg, gutenberg blocks, page builder, WordPress blocks Requires at least: 5.4 -Tested up to: 5.6 +Tested up to: 5.7 Requires PHP: 5.3 -Stable tag: 2.13.2 +Stable tag: 2.14.1 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -110,6 +110,7 @@ Optimize your website’s performance, and get lightning fast page loading and m ### News Article Updates +- [v2.14 Copy and Paste Block Styles](https://wpstackable.com/blog/copy-and-paste-block-styles/?utm_source=wp-repo&utm_campaign=readme&utm_medium=link) - [v2.13 UI Kits, Borders & Improved Performance](https://wpstackable.com/blog/ui-kits-borders/?utm_source=wp-repo&utm_campaign=readme&utm_medium=link) - [v2.12 Better User Interface and User Experience](https://wpstackable.com/blog/better-user-interface-and-user-experience/?utm_source=wp-repo&utm_campaign=readme&utm_medium=link) - [v2.11 Introducing Global Colors and Global Typography](https://wpstackable.com/blog/global-colors-and-global-typography/?utm_source=wp-repo&utm_campaign=readme&utm_medium=link) @@ -193,6 +194,37 @@ Nope. Stackable only works with Gutenberg, the new WordPress editor. == Changelog == += 2.14.1 = +* Fixed: Compatibility adjustments for WordPress 5.7 +* Fixed: Advanced tab can sometimes be visible in the Styles tab + += 2.14.0 = +[Copy and Paste Block Styles](https://wpstackable.com/blog/copy-and-paste-block-styles/?utm_source=wp-repo&utm_campaign=readme&utm_medium=link) + +* New: You can now copy and paste Stackable and native block styles! (premium) +* New: Added block previews +* Fixed: Feature Grid block container image is always set to cover +* Fixed: Removed inapplicable margin/padding unit in separators +* Fixed: Accordion text content can be a bit blurry +* Fixed: Don't enqueue blank Google Fonts in Global Settings +* Fixed: Expand block text color doesn't apply in backend +* Fixed: Icon block, title alignment in tablet and mobile did not apply +* Fixed: Auto block recovery should not affect v1 blocks +* Fixed: Margins of the Icon block title won't apply + += 2.13.4 = +* Fixed: Issue with styling duplicated blocks +* Fixed: Accordion block migration error +* Fixed: Google Fonts possible enqueueing issue + += 2.13.3 = +* New: You can now select titles to use Pargraph tags instead of H1-H6 +* Fixed: Can't convert reusable blocks to regular blocks +* Fixed: Some inspector style conflicts +* Fixed: Nested Accordion block arrows did not rotate when opened +* Fixed: Feature Grid image shape for the column is now working +* Fixed: Clicking on the default quote icon in the Blockquote block + = 2.13.2 = * Fixed: Accordion SEO issue with heading levels * Fixed: Blocks didn't re-render when some props changed diff --git a/plugins/stackable-ultimate-gutenberg-blocks/src/fonts.php b/plugins/stackable-ultimate-gutenberg-blocks/src/fonts.php index df965d9a..508553ea 100644 --- a/plugins/stackable-ultimate-gutenberg-blocks/src/fonts.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/src/fonts.php @@ -89,7 +89,9 @@ public static function enqueue_google_fonts( $google_fonts, $handle = 'stackable } foreach ( $google_fonts as &$font ) { - $font = str_replace( ' ', '+', $font ) . ':100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic'; + if ( ! empty( $font ) ) { + $font = str_replace( ' ', '+', $font ) . ':100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic'; + } } $fonts_url = sprintf( 'https://fonts.googleapis.com/css?family=%s', implode( rawurlencode( '|' ), $google_fonts ) ); diff --git a/plugins/stackable-ultimate-gutenberg-blocks/src/global-settings.php b/plugins/stackable-ultimate-gutenberg-blocks/src/global-settings.php index 7e6f48ae..f52d367a 100644 --- a/plugins/stackable-ultimate-gutenberg-blocks/src/global-settings.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/src/global-settings.php @@ -446,7 +446,7 @@ public function typography_add_global_styles() { // Gather the Google Fonts. if ( array_key_exists( 'fontFamily', $styles ) ) { - if ( Stackable_Google_Fonts::is_web_font( $styles['fontFamily'] ) ) { + if ( Stackable_Google_Fonts::is_web_font( $styles['fontFamily'] ) && ! empty( $styles['fontFamily'] ) ) { if ( ! in_array( $styles['fontFamily'], $google_fonts ) ) { $google_fonts[] = $styles['fontFamily']; } @@ -462,7 +462,9 @@ public function typography_add_global_styles() { } // Load the Google Font. - Stackable_Google_Fonts::enqueue_google_fonts( $google_fonts, 'stackable-global-typography-google-fonts' ); + if ( ! empty( $google_fonts ) ) { + Stackable_Google_Fonts::enqueue_google_fonts( $google_fonts, 'stackable-global-typography-google-fonts' ); + } if ( count( $css ) ) { $this->generated_typography_css = true; diff --git a/plugins/stackable-ultimate-gutenberg-blocks/src/init.php b/plugins/stackable-ultimate-gutenberg-blocks/src/init.php index a1dc5f3f..c557f94b 100644 --- a/plugins/stackable-ultimate-gutenberg-blocks/src/init.php +++ b/plugins/stackable-ultimate-gutenberg-blocks/src/init.php @@ -101,6 +101,7 @@ function stackable_block_editor_assets() { ); global $content_width; + global $wp_version; wp_localize_script( 'ugb-block-js-vendor', 'stackable', array( 'srcUrl' => untrailingslashit( plugins_url( '/', STACKABLE_FILE ) ), 'contentWidth' => isset( $content_width ) ? $content_width : 900, @@ -112,6 +113,7 @@ function stackable_block_editor_assets() { 'displayWelcomeVideo' => function_exists( 'stackable_display_welcome_video' ) ? stackable_display_welcome_video() : false, 'currentTheme' => esc_html( get_template() ), 'settingsUrl' => admin_url( 'options-general.php?page=stackable' ), + 'wpVersion' => $wp_version, // Fonts. 'locale' => get_locale(),