!function(){var e={581(e,t){"use strict";var n,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),p=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");
/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case r:case s:case a:case d:case m:return e;default:switch(e=e&&e.$$typeof){case u:case c:case p:case f:case h:case l:return e;default:return t}}case i:return t}}}n=Symbol.for("react.module.reference")},353(e,t,n){"use strict";n(581)},694(e,t,n){"use strict";var o=n(925);function i(){}function r(){}r.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,r,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:i};return n.PropTypes=n,n}},556(e,t,n){e.exports=n(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},942(e,t){var n;
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)o.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.hooks,o=window.wp.i18n,i=n(942),r=n.n(i);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a.apply(null,arguments)}function s(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var c=n(556),u=n.n(c),p=window.React,d=n.n(p);n(353);const m=e=>"object"==typeof e&&null!=e&&1===e.nodeType,h=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,f=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return h(n.overflowY,t)||h(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},g=(e,t,n,o,i,r,a,s)=>r<e&&a>t||r>e&&a<t?0:r<=e&&s<=n||a>=t&&s>=n?r-e-o:a>t&&s<n||r<e&&s>n?a-t+i:0,v=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var y=function(){return y=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},y.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var b=0;function I(e){return"function"==typeof e?e:_}function _(){}function w(e,t){if(e){var n=((e,t)=>{var n,o,i,r;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,p="function"==typeof c?c:e=>e!==c;if(!m(e))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,h=[];let y=e;for(;m(y)&&p(y);){if(y=v(y),y===d){h.push(y);break}null!=y&&y===document.body&&f(y)&&!f(document.documentElement)||null!=y&&f(y,u)&&h.push(y)}const b=null!=(o=null==(n=window.visualViewport)?void 0:n.width)?o:innerWidth,I=null!=(r=null==(i=window.visualViewport)?void 0:i.height)?r:innerHeight,{scrollX:_,scrollY:w}=window,{height:S,width:k,top:E,right:x,bottom:C,left:O}=e.getBoundingClientRect(),{top:P,right:D,bottom:M,left:H}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let T="start"===s||"nearest"===s?E-P:"end"===s?C+M:E+S/2-P+M,L="center"===l?O+k/2-H+D:"end"===l?x+D:O-H;const A=[];for(let e=0;e<h.length;e++){const t=h[e],{height:n,width:o,top:i,right:r,bottom:c,left:u}=t.getBoundingClientRect();if("if-needed"===a&&E>=0&&O>=0&&C<=I&&x<=b&&(t===d&&!f(t)||E>=i&&C<=c&&O>=u&&x<=r))return A;const p=getComputedStyle(t),m=parseInt(p.borderLeftWidth,10),v=parseInt(p.borderTopWidth,10),y=parseInt(p.borderRightWidth,10),P=parseInt(p.borderBottomWidth,10);let D=0,M=0;const H="offsetWidth"in t?t.offsetWidth-t.clientWidth-m-y:0,R="offsetHeight"in t?t.offsetHeight-t.clientHeight-v-P:0,N="offsetWidth"in t?0===t.offsetWidth?0:o/t.offsetWidth:0,V="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(d===t)D="start"===s?T:"end"===s?T-I:"nearest"===s?g(w,w+I,I,v,P,w+T,w+T+S,S):T-I/2,M="start"===l?L:"center"===l?L-b/2:"end"===l?L-b:g(_,_+b,b,m,y,_+L,_+L+k,k),D=Math.max(0,D+w),M=Math.max(0,M+_);else{D="start"===s?T-i-v:"end"===s?T-c+P+R:"nearest"===s?g(i,c,n,v,P+R,T,T+S,S):T-(i+n/2)+R/2,M="start"===l?L-u-m:"center"===l?L-(u+o/2)+H/2:"end"===l?L-r+y+H:g(u,r,o,m,y+H,L,L+k,k);const{scrollLeft:e,scrollTop:a}=t;D=0===V?0:Math.max(0,Math.min(a+D/V,t.scrollHeight-n/V+R)),M=0===N?0:Math.max(0,Math.min(e+M/N,t.scrollWidth-o/N+H)),T+=a-D,L+=e-M}A.push({el:t,top:D,left:M})}return A})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach(function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o})}}function S(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function k(e,t){var n;function o(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];o(),n=setTimeout(function(){n=null,e.apply(void 0,r)},t)}return i.cancel=o,i}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault})}}function x(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){"function"==typeof t?t(e):t&&(t.current=e)})}}function C(){return String(b++)}function O(e){var t=e.isOpen,n=e.resultCount,o=e.previousResultCount;return t?n?n!==o?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function P(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function D(e){return"string"==typeof e.type}function M(e){return e.props}var H=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function T(e){void 0===e&&(e={});var t={};return H.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function L(e,t){return e&&t?Object.keys(e).reduce(function(n,o){return n[o]=A(t,o)?t[o]:e[o],n},{}):e}function A(e,t){return void 0!==e[t]}function R(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function N(e,t,n,o,i){void 0===i&&(i=!1);var r=n.length;if(0===r)return-1;var a=r-1;("number"!=typeof e||e<0||e>a)&&(e=t>0?-1:a+1);var s=e+t;s<0?s=i?a:0:s>a&&(s=i?0:a);var l=V(s,t<0,n,o,i);return-1===l?e>=r?-1:e:l}function V(e,t,n,o,i){void 0===i&&(i=!1);var r=n.length;if(t){for(var a=e;a>=0;a--)if(!o(n[a],a))return a}else for(var s=e;s<r;s++)if(!o(n[s],s))return s;return i?V(t?r-1:0,t,n,o):-1}function K(e,t,n,o){return void 0===o&&(o=!0),n&&t.some(function(t){return t&&(S(t,e,n)||o&&S(t,n.document.activeElement,n))})}var z=k(function(e){j(e).textContent=""},500);function j(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function B(e,t){e&&t&&(j(t).textContent=e,z(t))}var F=Object.freeze({__proto__:null,blurButton:14,blurInput:10,changeInput:11,clickButton:13,clickItem:9,controlledPropUpdatedSelectedItem:15,itemMouseEnter:2,keyDownArrowDown:4,keyDownArrowUp:3,keyDownEnd:8,keyDownEnter:6,keyDownEscape:5,keyDownHome:7,keyDownSpaceButton:12,mouseUp:1,touchEnd:16,unknown:0}),U=["refKey","ref"],W=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],q=["onKeyDown","onBlur","onChange","onInput","onChangeText"],$=["refKey","ref"],Y=["onMouseMove","onMouseDown","onClick","onPress","index","item"],X=function(){var e=function(e){function t(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+C(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var o=setTimeout(function(){n.timeoutIds=n.timeoutIds.filter(function(e){return e!==o}),e()},t);n.timeoutIds.push(o)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var o=n.getItemNodeFromIndex(t);return o&&o.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=T(t),n.internalSetState(a({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,o){t=T(t),n.internalSetState(a({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),o)},n.selectItemAtIndex=function(e,t,o){var i=n.items[e];null!=i&&n.selectItem(i,t,o)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var o,i,r={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,a({},n.getStateAndHelpers(),e)),n.setState(function(t){var l;t=n.getState(t);var c=s?e(t):e;c=n.props.stateReducer(t,c),o=c.hasOwnProperty("selectedItem");var u={};return o&&c.selectedItem!==t.selectedItem&&(i=c.selectedItem),(l=c).type||(l.type=0),Object.keys(c).forEach(function(e){t[e]!==c[e]&&(r[e]=c[e]),"type"!==e&&(c[e],A(n.props,e)||(u[e]=c[e]))}),s&&c.hasOwnProperty("inputValue")&&n.props.onInputValueChange(c.inputValue,a({},n.getStateAndHelpers(),c)),u},function(){I(t)(),Object.keys(r).length>1&&n.props.onStateChange(r,n.getStateAndHelpers()),o&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==i&&n.props.onChange(i,n.getStateAndHelpers()),n.props.onUserAction(r,n.getStateAndHelpers())})},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var o,i=void 0===e?{}:e,r=i.refKey,l=void 0===r?"ref":r,c=i.ref,u=s(i,U),p=(void 0===t?{}:t).suppressRefError,d=void 0!==p&&p;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=d;var m=n.getState().isOpen;return a(((o={})[l]=x(c,n.rootRef),o.role="combobox",o["aria-expanded"]=m,o["aria-haspopup"]="listbox",o["aria-owns"]=m?n.menuId:void 0,o["aria-labelledby"]=n.labelId,o),u)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},function(){var e=t.getItemCount();if(e>0){var n=N(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}})},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},function(){var e=t.getItemCount();if(e>0){var n=N(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}})},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var i=this.items[o],r=this.getItemNodeFromIndex(o);if(null==i||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(a({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=a({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=a({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var o=V(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var o=V(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,o=t.onClick;t.onPress;var i=t.onKeyDown,r=t.onKeyUp,l=t.onBlur,c=s(t,W),u=n.getState().isOpen,p={onClick:E(o,n.buttonHandleClick),onKeyDown:E(i,n.buttonHandleKeyDown),onKeyUp:E(r,n.buttonHandleKeyUp),onBlur:E(l,n.buttonHandleBlur)};return a({type:"button",role:"button","aria-label":u?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},c.disabled?{}:p,c)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=R(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(n,e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,o=t.body,i=t.activeElement;o&&o===i&&e.target.focus()}n.internalSetTimeout(function(){return n.toggleMenu({type:13})})},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout(function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}})},n.getLabelProps=function(e){return a({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,o=t.onKeyDown,i=t.onBlur,r=t.onChange,l=t.onInput;t.onChangeText;var c=s(t,q),u={};var p,d=n.getState(),m=d.inputValue,h=d.isOpen,f=d.highlightedIndex;c.disabled||((p={}).onChange=E(r,l,n.inputHandleChange),p.onKeyDown=E(o,n.inputHandleKeyDown),p.onBlur=E(i,n.inputHandleBlur),u=p);return a({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof f&&f>=0?n.getItemId(f):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":c&&c["aria-label"]?void 0:n.labelId,autoComplete:"off",value:m,id:n.inputId},u,c)},n.inputHandleKeyDown=function(e){var t=R(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(n,e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout(function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}})},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var o,i=void 0===e?{}:e,r=i.refKey,l=void 0===r?"ref":r,c=i.ref,u=s(i,$),p=(void 0===t?{}:t).suppressRefError,d=void 0!==p&&p;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=d,a(((o={})[l]=x(c,n.menuRef),o.role="listbox",o["aria-labelledby"]=u&&u["aria-label"]?void 0:n.labelId,o.id=n.menuId,o),u)},n.getItemProps=function(e){var t,o=void 0===e?{}:e,i=o.onMouseMove,r=o.onMouseDown,l=o.onClick;o.onPress;var c=o.index,u=o.item,p=void 0===u?void 0:u,d=s(o,Y);void 0===c?(n.items.push(p),c=n.items.indexOf(p)):n.items[c]=p;var m=l,h=((t={onMouseMove:E(i,function(){c!==n.getState().highlightedIndex&&(n.setHighlightedIndex(c,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout(function(){return n.avoidScrolling=!1},250))}),onMouseDown:E(r,function(e){e.preventDefault()})}).onClick=E(m,function(){n.selectItemAtIndex(c,{type:9})}),t),f=d.disabled?{onMouseDown:h.onMouseDown}:h;return a({id:n.getItemId(c),role:"option","aria-selected":n.getState().highlightedIndex===c},f,d)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=T(e),n.internalSetState(function(t){var o=t.selectedItem;return a({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(o)},e)},t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=T(e),n.internalSetState(function(t){var o=t.isOpen;return a({isOpen:!o},o&&{highlightedIndex:n.props.defaultHighlightedIndex},e)},function(){var o=n.getState(),i=o.isOpen,r=o.highlightedIndex;i&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),I(t)()})},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=k(function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),o=n.items[t.highlightedIndex],i=n.getItemCount(),r=n.props.getA11yStatusMessage(a({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:i,highlightedItem:o},t));n.previousResultCount=i,B(r,n.props.environment.document)}},200);var o=n.props,i=o.defaultHighlightedIndex,r=o.initialHighlightedIndex,l=void 0===r?i:r,c=o.defaultIsOpen,u=o.initialIsOpen,p=void 0===u?c:u,d=o.initialInputValue,m=void 0===d?"":d,h=o.initialSelectedItem,f=void 0===h?null:h,g=n.getState({highlightedIndex:l,isOpen:p,inputValue:m,selectedItem:f});return null!=g.selectedItem&&void 0===n.props.initialInputValue&&(g.inputValue=n.props.itemToString(g.selectedItem)),n.state=g,n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l(e,t)}(t,e);var n=t.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach(function(e){clearTimeout(e)}),this.timeoutIds=[]},n.getState=function(e){return void 0===e&&(e=this.state),L(e,this.props)},n.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},n.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},n.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},n.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),o=this.getState().highlightedIndex;if(n>0){var i=N(o,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(i,t)}},n.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props.itemToString,a=this.id,s=this.getRootProps,l=this.getToggleButtonProps,c=this.getLabelProps,u=this.getMenuProps,p=this.getInputProps,d=this.getItemProps,m=this.openMenu,h=this.closeMenu,f=this.toggleMenu,g=this.selectItem,v=this.selectItemAtIndex,y=this.selectHighlightedItem,b=this.setHighlightedIndex,I=this.clearSelection,_=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:c,getMenuProps:u,getInputProps:p,getItemProps:d,reset:this.reset,openMenu:m,closeMenu:h,toggleMenu:f,selectItem:g,selectItemAtIndex:v,selectHighlightedItem:y,setHighlightedIndex:b,clearSelection:I,clearItems:_,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:a,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}},n.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!K(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},function(){return e.props.onOuterClick(e.getStateAndHelpers())})},o=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},r=function(t){var n=K(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},function(){return e.props.onOuterClick(e.getStateAndHelpers())})},a=this.props.environment;a.addEventListener("mousedown",t),a.addEventListener("mouseup",n),a.addEventListener("touchstart",o),a.addEventListener("touchmove",i),a.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),a.removeEventListener("mousedown",t),a.removeEventListener("mouseup",n),a.removeEventListener("touchstart",o),a.removeEventListener("touchmove",i),a.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},n.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,o=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==o},n.componentDidUpdate=function(e,t){A(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var e=P(this.props.children,_);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=P(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:D(t)?(0,p.cloneElement)(t,this.getRootProps(M(t))):void 0:null},t}(p.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:O,itemToString:function(e){return null==e?"":String(e)},onStateChange:_,onInputValueChange:_,onUserAction:_,onChange:_,onSelect:_,onOuterClick:_,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:w},e.stateChangeTypes=F,e}();k(function(e,t){B(e,t)},200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?p.useLayoutEffect:p.useEffect,d();var G={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:w,environment:"undefined"==typeof window?void 0:window};var J={environment:u().shape({addEventListener:u().func.isRequired,removeEventListener:u().func.isRequired,document:u().shape({createElement:u().func.isRequired,getElementById:u().func.isRequired,activeElement:u().any.isRequired,body:u().any.isRequired}).isRequired,Node:u().func.isRequired}),itemToString:u().func,itemToKey:u().func,stateReducer:u().func},Q=a({},J,{getA11yStatusMessage:u().func,highlightedIndex:u().number,defaultHighlightedIndex:u().number,initialHighlightedIndex:u().number,isOpen:u().bool,defaultIsOpen:u().bool,initialIsOpen:u().bool,selectedItem:u().any,initialSelectedItem:u().any,defaultSelectedItem:u().any,id:u().string,labelId:u().string,menuId:u().string,getItemId:u().func,toggleButtonId:u().string,onSelectedItemChange:u().func,onHighlightedIndexChange:u().func,onStateChange:u().func,onIsOpenChange:u().func,scrollIntoView:u().func});y(y({},Q),{items:u().array.isRequired,isItemDisabled:u().func}),y(y({},G),{isItemDisabled:function(){return!1}});a({},Q,{items:u().array.isRequired,isItemDisabled:u().func,inputValue:u().string,defaultInputValue:u().string,initialInputValue:u().string,inputId:u().string,onInputValueChange:u().func});a({},G,{isItemDisabled:function(){return!1}});u().array,u().array,u().array,u().func,u().number,u().number,u().number,u().func,u().func,u().string,u().string;var Z=function({listId:t,provider:n,apiKey:i,apiUrl:s,onChange:l,onListsLoading:c}){const[u,p]=(0,e.useState)([]),[d,m]=(0,e.useState)(!1);let[{controller:h},f]=(0,e.useState)({controller:null});const g=function(e){p(e),c(e.length)};return(0,e.useEffect)(function(){i||["mailpoet","fluentcrm"].includes(n)?async function(){h&&h.abort(),m(!0),"AbortController"in window&&(h=new AbortController,f({controller:h}));const e=new FormData;e.append("api_key",i),e.append("api_url",s),e.append("provider",n),e.append("action","blocksy_ext_newsletter_subscribe_maybe_get_lists"),e.append("nonce",ctDashboardLocalizations.dashboard_actions_nonce);try{const t=await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",signal:h.signal,body:e});if(200===t.status){const e=await t.json();if(e.success&&"api_key_invalid"!==e.data.result)return m(!1),void g(e.data.result.map(function(e){return{...e,id:e.id.toString()}}))}}catch(e){}g([]),m(!1)}():g([])},[n,i,s]),0===u.length?(0,e.createElement)("div",{className:r()("ct-select-input","ct-no-results")},(0,e.createElement)("input",{disabled:!0,placeholder:d?(0,o.__)("Fetching...","blocksy-companion"):""})):(0,e.createElement)(X,{selectedItem:u.find(function({id:e}){return e===t})?t:"",onChange:function(e){return l(e)},itemToString:function(e){return e?(u.find(function({id:t}){return t===e})||{}).name:""}},function({getInputProps:t,getItemProps:n,getLabelProps:i,getMenuProps:s,isOpen:l,inputValue:c,highlightedIndex:p,selectedItem:d,openMenu:m}){return(0,e.createElement)("div",{className:"ct-select-input"},(0,e.createElement)("input",a({},t({onFocus:function(){return m()},onClick:function(){return m()}}),{placeholder:(0,o.__)("Select list...","blocksy-companion"),readOnly:!0})),l&&(0,e.createElement)("div",s({className:"ct-select-dropdown"}),u.map(function(t,o){return(0,e.createElement)("div",n({key:t.id,index:o,item:t.id,className:r()("ct-select-dropdown-item",{active:p===o,selected:d===t.id})}),t.name)})))})},ee=window.blocksyOptions;const te=(window.ctDashboardLocalizations||{}).DashboardContext;(te||{}).Provider,(te||{}).Consumer;var ne=te;(0,o.__)("Free","blocksy-companion"),(0,o.__)("Personal","blocksy-companion"),(0,o.__)("Business","blocksy-companion"),(0,o.__)("Agency","blocksy-companion"),(0,o.__)("Personal","blocksy-companion"),(0,o.__)("Business","blocksy-companion"),(0,o.__)("Agency","blocksy-companion");var oe=function({currentPlan:t="free",requiredPlan:n="personal",personal:i={title:(0,o.__)("This is a Pro feature","blocksy-companion"),description:(0,o.__)("Upgrade to any pro plan and get instant access to this and many other feature.","blocksy-companion")},professional:r={description:(0,o.__)("Upgrade to the business or agency plan and get instant access to this and many other features.","blocksy-companion")},agency:a={description:(0,o.__)("Upgrade to the agency plan and get instant access to this and many other features.","blocksy-companion")}}={}){const[s,l]=(0,e.useState)(!1);return{showNotice:function(e){l(e||!0)},content:(0,e.createElement)(ee.Overlay,{items:s,className:"ct-onboarding-modal",onDismiss:function(){return l(!1)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("svg",{width:"55",height:"55",viewBox:"0 0 40.5 48.3"},(0,e.createElement)("path",{fill:"#2d82c8",d:"M33.4 29.4l7.1 12.3-7.4.6-4 6-7.3-12.9"}),(0,e.createElement)("path",{d:"M33.5 29.6L26 42.7l-4.2-7.3 11.6-6 .1.2zM0 41.7l7.5.6 3.9 6 7.2-12.4-11-7.3L0 41.7z",fill:"#2271b1"}),(0,e.createElement)("path",{d:"M39.5 18.7c0 1.6-2.4 2.8-2.7 4.3-.4 1.5 1 3.8.2 5.1-.8 1.3-3.4 1.2-4.5 2.3-1.1 1.1-1 3.7-2.3 4.5-1.3.8-3.6-.6-5.1-.2-1.5.4-2.7 2.7-4.3 2.7S18 35 16.5 34.7c-1.5-.4-3.8 1-5.1.2s-1.2-3.4-2.3-4.5-3.7-1-4.5-2.3.6-3.6.2-5.1-2.7-2.7-2.7-4.3 2.4-2.8 2.7-4.3c.4-1.5-1-3.8-.2-5.1C5.4 8 8.1 8.1 9.1 7c1.1-1.1 1-3.7 2.3-4.5s3.6.6 5.1.2C18 2.4 19.2 0 20.8 0c1.6 0 2.8 2.4 4.3 2.7 1.5.4 3.8-1 5.1-.2 1.3.8 1.2 3.4 2.3 4.5 1.1 1.1 3.7 1 4.5 2.3s-.6 3.6-.2 5.1c.3 1.5 2.7 2.7 2.7 4.3z",fill:"#599fd9"}),(0,e.createElement)("path",{d:"M23.6 7c-6.4-1.5-12.9 2.5-14.4 8.9-.7 3.1-.2 6.3 1.5 9.1 1.7 2.7 4.3 4.6 7.4 5.4.9.2 1.9.3 2.8.3 2.2 0 4.4-.6 6.3-1.8 2.7-1.7 4.6-4.3 5.4-7.5C34 15 30 8.5 23.6 7zm7 14c-.6 2.6-2.2 4.8-4.5 6.2-2.3 1.4-5 1.8-7.6 1.2-2.6-.6-4.8-2.2-6.2-4.5-1.4-2.3-1.8-5-1.2-7.6.6-2.6 2.2-4.8 4.5-6.2 1.6-1 3.4-1.5 5.2-1.5.8 0 1.5.1 2.3.3 5.4 1.3 8.7 6.7 7.5 12.1zm-8.2-4.5l3.7.5-2.7 2.7.7 3.7-3.4-1.8-3.3 1.8.6-3.7-2.7-2.7 3.8-.5 1.6-3.4 1.7 3.4z",fill:"#fff"})),"personal"===n&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"ct-modal-title"},i.title),(0,e.createElement)("p",null,i.description)),"professional"===n&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",null,"Required plan"),(0,e.createElement)("h2",{className:"ct-modal-title"},(0,o.__)("Business or Agency","blocksy-companion")),(0,e.createElement)("p",null,r.description)),"agency"===n&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",null,"Required plan"),(0,e.createElement)("h2",{className:"ct-modal-title"},(0,o.__)("Agency","blocksy-companion")),(0,e.createElement)("p",null,a.description)),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("a",{href:ctDashboardLocalizations.plugin_data?ctDashboardLocalizations.plugin_data.modal_links["compare-plans"]:"https://creativethemes.com/blocksy/pricing/#comparison-free-vs-pro",target:"_blank",className:"button"},(0,o.__)("Compare Plans","blocksy-companion")),(0,e.createElement)("a",{href:ctDashboardLocalizations.plugin_data.modal_links?ctDashboardLocalizations.plugin_data.modal_links.pricing:"https://creativethemes.com/blocksy/pricing/",target:"_blank",className:"button button-primary"},(0,o.__)("Upgrade Now","blocksy-companion"))))}})}};var ie=function(t,n={}){n={strategy:"pro-ext",modalTitle:(0,o.__)("This is a Pro extension","blocksy-companion"),...n};const[i,r]=(0,e.useState)(!1),a=ctDashboardLocalizations.plugin_data.is_pro,{history:s}=(0,e.useContext)(ne),l=!a&&t.config.pro,c=ctDashboardLocalizations.plugin_data.current_plan;let u="personal";t.config.plans&&(t.config.plans.includes("agency_v2")&&(u="agency"),t.config.plans.includes("professional_v2")&&(u="professional"));const{content:p,showNotice:d}=oe({currentPlan:c,requiredPlan:u,...n});return{isPro:a,isProInFree:!a&&t.config.pro||t.config.plans&&t.config.plans.length&&!t.config.plans.includes(c),showNotice:d,content:"pro-ext"===n.strategy&&l||"pro"===n.strategy&&!a||t.config.plans&&t.config.plans.length&&!t.config.plans.includes(c)?p:null}};const re=["mailchimp","demo"];var ae=function({extension:t,onCredentialsValidated:n}){const[i,a]=(0,e.useState)(t.data.provider),[s,l]=(0,e.useState)(t.data.api_key),[c,u]=(0,e.useState)(t.data.api_url),[p,d]=(0,e.useState)(t.data.list_id),[m,h]=(0,e.useState)(!1),[f,g]=(0,e.useState)(!1),{isPro:v,showNotice:y,content:b}=ie(t,{strategy:"pro"});(0,e.useEffect)(function(){!t.data||re.includes(t.data.provider)||v||a(re[0])},[]);const I={mailerlite:"mailerlite-new",convertkit:"convertkit-new"},_=I[Object.keys(I).find(function(e){return i.includes(e)})||i]||i,w=i.indexOf("activecampaign")>-1||i.indexOf("sendy")>-1,S=i.indexOf("mailerlite")>-1||"activecampaign"===i||i.indexOf("convertkit")>-1||i.indexOf("sendy")>-1;return(0,e.createElement)("div",{className:r()("ct-extension-options ct-newsletter-subscribe-options")},(0,e.createElement)("h4",null,(0,o.__)("Connect Newsletter Provider","blocksy-companion")),(0,e.createElement)("div",{className:"ct-newsletter-credentials","data-columns":S?4:["mailpoet","fluentcrm"].includes(i)?2:3},(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,o.__)("Provider","blocksy-companion")),(0,e.createElement)(ee.Select,{onChange:function(e){if(!v&&!re.includes(e))return a(e),setTimeout(function(){a(re[0])}),void y();a(e)},option:{placeholder:(0,o.__)("Pick Mailing Service","blocksy-companion"),choices:t.data.providers},value:_})),w&&(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,o.__)("API URL","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",onChange:function({target:{value:e}}){return u(e)},value:c||""}))),i.indexOf("mailerlite")>-1&&(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,o.__)("API Version","blocksy-companion")),(0,e.createElement)(ee.Select,{onChange:function(e){a("new"===e?"mailerlite-new":"mailerlite")},option:{placeholder:(0,o.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"new",value:"New"},{key:"classic",value:"Classic"}]},value:"mailerlite-new"===i?"new":"classic"})),i.indexOf("convertkit")>-1&&(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,o.__)("API Version","blocksy-companion")),(0,e.createElement)(ee.Select,{onChange:function(e){a("new"===e?"convertkit-new":"convertkit")},option:{placeholder:(0,o.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"new",value:"New (v4)"},{key:"classic",value:"Classic (v3)"}]},value:"convertkit-new"===i?"new":"classic"})),(re.includes(i)||ctDashboardLocalizations.plugin_data.is_pro)&&(0,e.createElement)(e.Fragment,null,["mailpoet","fluentcrm"].includes(i)?null:(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,o.__)("API Key","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",onChange:function({target:{value:e}}){return l(e)},value:s||""}))),(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,o.__)("List ID","blocksy-companion")),(0,e.createElement)(Z,{listId:p,onChange:function(e){return d(e)},provider:i,apiUrl:c,apiKey:s,onListsLoading:function(e){return h(!!e)}})))),"mailchimp"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for Mailchimp can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&i.indexOf("mailerlite")>-1&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for Mailerlite can be found %shere%s. Please note that it is required at least one group to be created in your account for the integration to work. More info on how to create a group %shere%s.","blocksy-companion"),'<a target="_blank" href="https://www.mailerlite.com/help/where-to-find-the-mailerlite-api-key-and-documentation">',"</a>",'<a target="_blank" href="https://www.mailerlite.com/help/how-to-create-and-use-groups">',"</a>")}}),i.indexOf("demo")>-1&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.__)("This provider is used only for testing purposes. It doesnt register any real subscribers.","blocksy-companion")}}),ctDashboardLocalizations.plugin_data.is_pro&&"klaviyo"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for Klaviyo can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://developers.klaviyo.com/en/reference/api_overview">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"brevo"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for Brevo can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://help.brevo.com/hc/en-us/articles/209467485-Create-and-manage-your-API-keys">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&i.indexOf("convertkit")>-1&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for Kit (ConvertKit) can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://developers.kit.com/welcome#api-basics">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"activecampaign"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for ActiveCampaign can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://developers.activecampaign.com/reference/overview">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"campaignmonitor"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for Campaign Monitor can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://help.campaignmonitor.com/api-keys">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"emailoctopus"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to generate an API key for EmailOctopus can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://emailoctopus.com/api-documentation/v2">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"mailpoet"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to create a list in MailPoet can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://kb.mailpoet.com/article/282-create-a-list">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"fluentcrm"===i&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("More information on how to create a list in fluentcrm can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://kb.fluentcrm.com/article/282-create-a-list">',"</a>")}}),(0,e.createElement)("button",{className:"ct-button-primary",disabled:!s&&!["mailpoet","fluentcrm"].includes(i)||!p||!m||f||!c&&"activecampaign"===i,onClick:function(){return async function(){const e=new FormData;e.append("provider",i),e.append("api_key",s),e.append("api_url",c),e.append("list_id",p),e.append("action","blocksy_ext_newsletter_subscribe_maybe_save_credentials"),e.append("nonce",ctDashboardLocalizations.dashboard_actions_nonce),g(!0);try{const t=await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:e});if(200===t.status){const e=await t.json();e.success&&"api_key_invalid"!==e.data.result&&n()}}catch(e){}await new Promise(function(e){return setTimeout(function(){return e()},1e3)}),g(!1)}()}},f?(0,o.__)("Loading...","blocksy-companion"):(0,o.__)("Save Settings","blocksy-companion")),b)};var se=function({extension:t,onExtsSync:n}){return(0,e.createElement)(ae,{extension:t,onCredentialsValidated:function(){t.__object||async function(){const e=new FormData;e.append("ext",t.name),e.append("action",t.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),e.append("nonce",ctDashboardLocalizations.dashboard_actions_nonce);try{await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:e}),n()}catch(e){}}()}})};(0,t.addFilter)("blocksy.extensions.current_extension_content","blocksy",function(t,{extension:n,onExtsSync:o}){return"newsletter-subscribe"!==n.name?t:{...t,...n.data.api_key?{}:{activationStrategy:"from-custom-content"},content:(0,e.createElement)(se,{extension:n,onExtsSync:o})}})}()}();