!function(){var e={184:function(e,t){var n;
/*!
  Copyright (c) 2017 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];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)&&n.length){var a=i.apply(null,n);a&&e.push(a)}else if("object"===r)for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},781:function(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"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=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 y(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 f:return e;default:switch(e=e&&e.$$typeof){case u:case c:case p:case h:case m:case l:return e;default:return t}}case i:return t}}}n=Symbol.for("react.module.reference")},726:function(e,t,n){"use strict";n(781)},703:function(e,t,n){"use strict";var o=n(414);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}},697:function(e,t,n){e.exports=n(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},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";function e(t){return e="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(t)}function t(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function o(e,n,o){return(n=t(n))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}var i=window.wp.element,r=window.wp.hooks,a=window.wp.i18n,s=n(184),l=n.n(s);function c(){return c=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},c.apply(null,arguments)}function u(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 p(){return p=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},p.apply(null,arguments)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var f=n(697),m=n.n(f),h=window.React,g=n.n(h);n(726);const y=e=>"object"==typeof e&&null!=e&&1===e.nodeType,v=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,b=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return v(n.overflowY,t)||v(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},I=(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,_=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var w=function(){return w=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},w.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var S=0;function O(e){return"function"==typeof e?e:k}function k(){}function E(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(!y(e))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,f=[];let m=e;for(;y(m)&&p(m);){if(m=_(m),m===d){f.push(m);break}null!=m&&m===document.body&&b(m)&&!b(document.documentElement)||null!=m&&b(m,u)&&f.push(m)}const h=null!=(o=null==(n=window.visualViewport)?void 0:n.width)?o:innerWidth,g=null!=(r=null==(i=window.visualViewport)?void 0:i.height)?r:innerHeight,{scrollX:v,scrollY:w}=window,{height:S,width:O,top:k,right:E,bottom:x,left:P}=e.getBoundingClientRect(),{top:D,right:C,bottom:H,left:M}=(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?k-D:"end"===s?x+H:k+S/2-D+H,j="center"===l?P+O/2-M+C:"end"===l?E+C:P-M;const L=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:o,top:i,right:r,bottom:c,left:u}=t.getBoundingClientRect();if("if-needed"===a&&k>=0&&P>=0&&x<=g&&E<=h&&(t===d&&!b(t)||k>=i&&x<=c&&P>=u&&E<=r))return L;const p=getComputedStyle(t),m=parseInt(p.borderLeftWidth,10),y=parseInt(p.borderTopWidth,10),_=parseInt(p.borderRightWidth,10),D=parseInt(p.borderBottomWidth,10);let C=0,H=0;const M="offsetWidth"in t?t.offsetWidth-t.clientWidth-m-_:0,A="offsetHeight"in t?t.offsetHeight-t.clientHeight-y-D:0,R="offsetWidth"in t?0===t.offsetWidth?0:o/t.offsetWidth:0,N="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(d===t)C="start"===s?T:"end"===s?T-g:"nearest"===s?I(w,w+g,g,y,D,w+T,w+T+S,S):T-g/2,H="start"===l?j:"center"===l?j-h/2:"end"===l?j-h:I(v,v+h,h,m,_,v+j,v+j+O,O),C=Math.max(0,C+w),H=Math.max(0,H+v);else{C="start"===s?T-i-y:"end"===s?T-c+D+A:"nearest"===s?I(i,c,n,y,D+A,T,T+S,S):T-(i+n/2)+A/2,H="start"===l?j-u-m:"center"===l?j-(u+o/2)+M/2:"end"===l?j-r+_+M:I(u,r,o,m,_+M,j,j+O,O);const{scrollLeft:e,scrollTop:a}=t;C=0===N?0:Math.max(0,Math.min(a+C/N,t.scrollHeight-n/N+A)),H=0===R?0:Math.max(0,Math.min(e+H/R,t.scrollWidth-o/R+M)),T+=a-C,j+=e-H}L.push({el:t,top:C,left:H})}return L})(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 x(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function P(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 D(){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 C(){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 H(){return String(S++)}function M(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 T(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function j(e){return"string"==typeof e.type}function L(e){return e.props}var A=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function R(e){void 0===e&&(e={});var t={};return A.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function N(e,t){return e&&t?Object.keys(e).reduce((function(n,o){return n[o]=V(t,o)?t[o]:e[o],n}),{}):e}function V(e,t){return void 0!==e[t]}function K(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function z(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=B(s,t<0,n,o,i);return-1===l?e>=r?-1:e:l}function B(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?B(t?r-1:0,t,n,o):-1}function F(e,t,n,o){return void 0===o&&(o=!0),n&&t.some((function(t){return t&&(x(t,e,n)||o&&x(t,n.document.activeElement,n))}))}var U=P((function(e){W(e).textContent=""}),500);function W(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 q(e,t){e&&t&&(W(t).textContent=e,U(t))}var $=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}),Y=["refKey","ref"],X=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],G=["onKeyDown","onBlur","onChange","onInput","onChangeText"],J=["refKey","ref"],Q=["onMouseMove","onMouseDown","onClick","onPress","index","item"],Z=function(){var e=function(e){function t(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+H(),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=R(t),n.internalSetState(p({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=R(t),n.internalSetState(p({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={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,p({},n.getStateAndHelpers(),e)),n.setState((function(t){var s;t=n.getState(t);var l=a?e(t):e;l=n.props.stateReducer(t,l),o=l.hasOwnProperty("selectedItem");var c={};return o&&l.selectedItem!==t.selectedItem&&(i=l.selectedItem),(s=l).type||(s.type=0),Object.keys(l).forEach((function(e){t[e]!==l[e]&&(r[e]=l[e]),"type"!==e&&(l[e],V(n.props,e)||(c[e]=l[e]))})),a&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,p({},n.getStateAndHelpers(),l)),c}),(function(){O(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,a=void 0===r?"ref":r,s=i.ref,l=u(i,Y),c=(void 0===t?{}:t).suppressRefError,d=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=d;var f=n.getState().isOpen;return p(((o={})[a]=C(s,n.rootRef),o.role="combobox",o["aria-expanded"]=f,o["aria-haspopup"]="listbox",o["aria-owns"]=f?n.menuId:void 0,o["aria-labelledby"]=n.labelId,o),l)},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=z(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=z(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(p({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=p({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=p({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var o=B(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=B(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,a=t.onBlur,s=u(t,X),l=n.getState().isOpen,c={onClick:D(o,n.buttonHandleClick),onKeyDown:D(i,n.buttonHandleKeyDown),onKeyUp:D(r,n.buttonHandleKeyUp),onBlur:D(a,n.buttonHandleBlur)};return p({type:"button",role:"button","aria-label":l?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},s.disabled?{}:c,s)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=K(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 p({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,a=t.onInput;t.onChangeText;var s=u(t,G),l={};var c,d=n.getState(),f=d.inputValue,m=d.isOpen,h=d.highlightedIndex;s.disabled||((c={}).onChange=D(r,a,n.inputHandleChange),c.onKeyDown=D(o,n.inputHandleKeyDown),c.onBlur=D(i,n.inputHandleBlur),l=c);return p({"aria-autocomplete":"list","aria-activedescendant":m&&"number"==typeof h&&h>=0?n.getItemId(h):void 0,"aria-controls":m?n.menuId:void 0,"aria-labelledby":s&&s["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},l,s)},n.inputHandleKeyDown=function(e){var t=K(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,a=void 0===r?"ref":r,s=i.ref,l=u(i,J),c=(void 0===t?{}:t).suppressRefError,d=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=d,p(((o={})[a]=C(s,n.menuRef),o.role="listbox",o["aria-labelledby"]=l&&l["aria-label"]?void 0:n.labelId,o.id=n.menuId,o),l)},n.getItemProps=function(e){var t,o=void 0===e?{}:e,i=o.onMouseMove,r=o.onMouseDown,a=o.onClick;o.onPress;var s=o.index,l=o.item,c=void 0===l?void 0:l,d=u(o,Q);void 0===s?(n.items.push(c),s=n.items.indexOf(c)):n.items[s]=c;var f=a,m=((t={onMouseMove:D(i,(function(){s!==n.getState().highlightedIndex&&(n.setHighlightedIndex(s,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:D(r,(function(e){e.preventDefault()}))}).onClick=D(f,(function(){n.selectItemAtIndex(s,{type:9})})),t),h=d.disabled?{onMouseDown:m.onMouseDown}:m;return p({id:n.getItemId(s),role:"option","aria-selected":n.getState().highlightedIndex===s},h,d)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=R(e),n.internalSetState((function(t){var o=t.selectedItem;return p({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=R(e),n.internalSetState((function(t){var o=t.isOpen;return p({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),O(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=P((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(p({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:i,highlightedItem:o},t));n.previousResultCount=i,q(r,n.props.environment.document)}}),200);var o=n.props,i=o.defaultHighlightedIndex,r=o.initialHighlightedIndex,a=void 0===r?i:r,s=o.defaultIsOpen,l=o.initialIsOpen,c=void 0===l?s:l,d=o.initialInputValue,f=void 0===d?"":d,m=o.initialSelectedItem,h=void 0===m?null:m,g=n.getState({highlightedIndex:a,isOpen:c,inputValue:f,selectedItem:h});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,d(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),N(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=z(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,f=this.openMenu,m=this.closeMenu,h=this.toggleMenu,g=this.selectItem,y=this.selectItemAtIndex,v=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:f,closeMenu:m,toggleMenu:h,selectItem:g,selectItemAtIndex:y,selectHighlightedItem:v,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,!F(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=F(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){V(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=T(this.props.children,k);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=T(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:j(t)?(0,h.cloneElement)(t,this.getRootProps(L(t))):void 0:null},t}(h.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:M,itemToString:function(e){return null==e?"":String(e)},onStateChange:k,onInputValueChange:k,onUserAction:k,onChange:k,onSelect:k,onOuterClick:k,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:E},e.stateChangeTypes=$,e}();P((function(e,t){q(e,t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?h.useLayoutEffect:h.useEffect,g();var ee={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:E,environment:"undefined"==typeof window?void 0:window};var te={environment:m().shape({addEventListener:m().func.isRequired,removeEventListener:m().func.isRequired,document:m().shape({createElement:m().func.isRequired,getElementById:m().func.isRequired,activeElement:m().any.isRequired,body:m().any.isRequired}).isRequired,Node:m().func.isRequired}),itemToString:m().func,itemToKey:m().func,stateReducer:m().func},ne=p({},te,{getA11yStatusMessage:m().func,highlightedIndex:m().number,defaultHighlightedIndex:m().number,initialHighlightedIndex:m().number,isOpen:m().bool,defaultIsOpen:m().bool,initialIsOpen:m().bool,selectedItem:m().any,initialSelectedItem:m().any,defaultSelectedItem:m().any,id:m().string,labelId:m().string,menuId:m().string,getItemId:m().func,toggleButtonId:m().string,onSelectedItemChange:m().func,onHighlightedIndexChange:m().func,onStateChange:m().func,onIsOpenChange:m().func,scrollIntoView:m().func});w(w({},ne),{items:m().array.isRequired,isItemDisabled:m().func}),w(w({},ee),{isItemDisabled:function(){return!1}});p({},ne,{items:m().array.isRequired,isItemDisabled:m().func,inputValue:m().string,defaultInputValue:m().string,initialInputValue:m().string,inputId:m().string,onInputValueChange:m().func});p({},ee,{isItemDisabled:function(){return!1}});m().array,m().array,m().array,m().func,m().number,m().number,m().number,m().func,m().func,m().string,m().string;function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var re=function({listId:e,provider:t,apiKey:n,apiUrl:o,onChange:r,onListsLoading:s}){const[u,p]=(0,i.useState)([]),[d,f]=(0,i.useState)(!1);let[{controller:m},h]=(0,i.useState)({controller:null});const g=function(e){p(e),s(e.length)};return(0,i.useEffect)((function(){n||["mailpoet","fluentcrm"].includes(t)?async function(){m&&m.abort(),f(!0),"AbortController"in window&&(m=new AbortController,h({controller:m}));const e=new FormData;e.append("api_key",n),e.append("api_url",o),e.append("provider",t),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:m.signal,body:e});if(200===t.status){const e=await t.json();if(e.success&&"api_key_invalid"!==e.data.result)return f(!1),void g(e.data.result.map((function(e){return ie(ie({},e),{},{id:e.id.toString()})})))}}catch(e){}g([]),f(!1)}():g([])}),[t,n,o]),0===u.length?(0,i.createElement)("div",{className:l()("ct-select-input","ct-no-results")},(0,i.createElement)("input",{disabled:!0,placeholder:d?(0,a.__)("Fetching...","blocksy-companion"):""})):(0,i.createElement)(Z,{selectedItem:u.find((function({id:t}){return t===e}))?e:"",onChange:function(e){return r(e)},itemToString:function(e){return e?(u.find((function({id:t}){return t===e}))||{}).name:""}},(function({getInputProps:e,getItemProps:t,getLabelProps:n,getMenuProps:o,isOpen:r,inputValue:s,highlightedIndex:p,selectedItem:d,openMenu:f}){return(0,i.createElement)("div",{className:"ct-select-input"},(0,i.createElement)("input",c({},e({onFocus:function(){return f()},onClick:function(){return f()}}),{placeholder:(0,a.__)("Select list...","blocksy-companion"),readOnly:!0})),r&&(0,i.createElement)("div",o({className:"ct-select-dropdown"}),u.map((function(e,n){return(0,i.createElement)("div",t({key:e.id,index:n,item:e.id,className:l()("ct-select-dropdown-item",{active:p===n,selected:d===e.id})}),e.name)}))))}))},ae=window.blocksyOptions;const se=(window.ctDashboardLocalizations||{}).DashboardContext;(se||{}).Provider,(se||{}).Consumer;var le=se;(0,a.__)("Free","blocksy-companion"),(0,a.__)("Personal","blocksy-companion"),(0,a.__)("Business","blocksy-companion"),(0,a.__)("Agency","blocksy-companion"),(0,a.__)("Personal","blocksy-companion"),(0,a.__)("Business","blocksy-companion"),(0,a.__)("Agency","blocksy-companion");var ce=function({currentPlan:e="free",requiredPlan:t="personal",personal:n={title:(0,a.__)("This is a Pro feature","blocksy-companion"),description:(0,a.__)("Upgrade to any pro plan and get instant access to this and many other feature.","blocksy-companion")},professional:o={description:(0,a.__)("Upgrade to the business or agency plan and get instant access to this and many other features.","blocksy-companion")},agency:r={description:(0,a.__)("Upgrade to the agency plan and get instant access to this and many other features.","blocksy-companion")}}={}){const[s,l]=(0,i.useState)(!1);return{showNotice:function(e){l(e||!0)},content:(0,i.createElement)(ae.Overlay,{items:s,className:"ct-onboarding-modal",onDismiss:function(){return l(!1)},render:function(){return(0,i.createElement)("div",{className:"ct-modal-content"},(0,i.createElement)("svg",{width:"55",height:"55",viewBox:"0 0 40.5 48.3"},(0,i.createElement)("path",{fill:"#2d82c8",d:"M33.4 29.4l7.1 12.3-7.4.6-4 6-7.3-12.9"}),(0,i.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,i.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,i.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"===t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h2",{className:"ct-modal-title"},n.title),(0,i.createElement)("p",null,n.description)),"professional"===t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",null,"Required plan"),(0,i.createElement)("h2",{className:"ct-modal-title"},(0,a.__)("Business or Agency","blocksy-companion")),(0,i.createElement)("p",null,o.description)),"agency"===t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",null,"Required plan"),(0,i.createElement)("h2",{className:"ct-modal-title"},(0,a.__)("Agency","blocksy-companion")),(0,i.createElement)("p",null,r.description)),(0,i.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,i.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,a.__)("Compare Plans","blocksy-companion")),(0,i.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,a.__)("Upgrade Now","blocksy-companion"))))}})}};function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var de=function(e,t={}){t=pe({strategy:"pro-ext",modalTitle:(0,a.__)("This is a Pro extension","blocksy-companion")},t);const[n,o]=(0,i.useState)(!1),r=ctDashboardLocalizations.plugin_data.is_pro,{history:s}=(0,i.useContext)(le),l=!r&&e.config.pro,c=ctDashboardLocalizations.plugin_data.current_plan;let u="personal";e.config.plans&&(e.config.plans.includes("agency_v2")&&(u="agency"),e.config.plans.includes("professional_v2")&&(u="professional"));const{content:p,showNotice:d}=ce(pe({currentPlan:c,requiredPlan:u},t));return{isPro:r,isProInFree:!r&&e.config.pro||e.config.plans&&e.config.plans.length&&!e.config.plans.includes(c),showNotice:d,content:"pro-ext"===t.strategy&&l||"pro"===t.strategy&&!r||e.config.plans&&e.config.plans.length&&!e.config.plans.includes(c)?p:null}};const fe=["mailchimp","demo"];var me=function({extension:e,onCredentialsValidated:t}){const[n,o]=(0,i.useState)(e.data.provider),[r,s]=(0,i.useState)(e.data.api_key),[c,u]=(0,i.useState)(e.data.api_url),[p,d]=(0,i.useState)(e.data.list_id),[f,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),{isPro:y,showNotice:v,content:b}=de(e,{strategy:"pro"});(0,i.useEffect)((function(){!e.data||fe.includes(e.data.provider)||y||o(fe[0])}),[]);const I={mailerlite:"mailerlite-new",convertkit:"convertkit-new"},_=I[Object.keys(I).find((function(e){return n.includes(e)}))||n]||n;return(0,i.createElement)("div",{className:l()("ct-extension-options ct-newsletter-subscribe-options")},(0,i.createElement)("h4",null,(0,a.__)("Connect Newsletter Provider","blocksy-companion")),(0,i.createElement)("div",{className:"ct-newsletter-credentials","data-columns":n.indexOf("mailerlite")>-1||"activecampaign"===n||n.indexOf("convertkit")>-1?4:["mailpoet","fluentcrm"].includes(n)?2:3},(0,i.createElement)("section",null,(0,i.createElement)("label",null,(0,a.__)("Provider","blocksy-companion")),(0,i.createElement)(ae.Select,{onChange:function(e){if(!y&&!fe.includes(e))return o(e),setTimeout((function(){o(fe[0])})),void v();o(e)},option:{placeholder:(0,a.__)("Pick Mailing Service","blocksy-companion"),choices:e.data.providers},value:_})),n.indexOf("activecampaign")>-1&&(0,i.createElement)("section",null,(0,i.createElement)("label",null,(0,a.__)("API URL","blocksy-companion")),(0,i.createElement)("div",{className:"ct-option-input"},(0,i.createElement)("input",{type:"text",onChange:function({target:{value:e}}){return u(e)},value:c||""}))),n.indexOf("mailerlite")>-1&&(0,i.createElement)("section",null,(0,i.createElement)("label",null,(0,a.__)("API Version","blocksy-companion")),(0,i.createElement)(ae.Select,{onChange:function(e){o("new"===e?"mailerlite-new":"mailerlite")},option:{placeholder:(0,a.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"new",value:"New"},{key:"classic",value:"Classic"}]},value:"mailerlite-new"===n?"new":"classic"})),n.indexOf("convertkit")>-1&&(0,i.createElement)("section",null,(0,i.createElement)("label",null,(0,a.__)("API Version","blocksy-companion")),(0,i.createElement)(ae.Select,{onChange:function(e){o("new"===e?"convertkit-new":"convertkit")},option:{placeholder:(0,a.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"new",value:"New (v4)"},{key:"classic",value:"Classic (v3)"}]},value:"convertkit-new"===n?"new":"classic"})),(fe.includes(n)||ctDashboardLocalizations.plugin_data.is_pro)&&(0,i.createElement)(i.Fragment,null,["mailpoet","fluentcrm"].includes(n)?null:(0,i.createElement)("section",null,(0,i.createElement)("label",null,(0,a.__)("API Key","blocksy-companion")),(0,i.createElement)("div",{className:"ct-option-input"},(0,i.createElement)("input",{type:"text",onChange:function({target:{value:e}}){return s(e)},value:r||""}))),(0,i.createElement)("section",null,(0,i.createElement)("label",null,(0,a.__)("List ID","blocksy-companion")),(0,i.createElement)(re,{listId:p,onChange:function(e){return d(e)},provider:n,apiUrl:c,apiKey:r,onListsLoading:function(e){return m(!!e)}})))),"mailchimp"===n&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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&&n.indexOf("mailerlite")>-1&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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>")}}),n.indexOf("demo")>-1&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.__)("This provider is used only for testing purposes. It doesnt register any real subscribers.","blocksy-companion")}}),ctDashboardLocalizations.plugin_data.is_pro&&"brevo"===n&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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&&n.indexOf("convertkit")>-1&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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"===n&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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"===n&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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"===n&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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"===n&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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"===n&&(0,i.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("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,i.createElement)("button",{className:"ct-button-primary",disabled:!r&&!["mailpoet","fluentcrm"].includes(n)||!p||!f||h||!c&&"activecampaign"===n,onClick:function(){return async function(){const e=new FormData;e.append("provider",n),e.append("api_key",r),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 n=await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:e});if(200===n.status){const e=await n.json();e.success&&"api_key_invalid"!==e.data.result&&t()}}catch(e){}await new Promise((function(e){return setTimeout((function(){return e()}),1e3)})),g(!1)}()}},h?(0,a.__)("Loading...","blocksy-companion"):(0,a.__)("Save Settings","blocksy-companion")),b)};var he=function({extension:e,onExtsSync:t}){return(0,i.createElement)(me,{extension:e,onCredentialsValidated:function(){e.__object||async function(){const n=new FormData;n.append("ext",e.name),n.append("action",e.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),n.append("nonce",ctDashboardLocalizations.dashboard_actions_nonce);try{await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:n}),t()}catch(e){}}()}})};function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}(0,r.addFilter)("blocksy.extensions.current_extension_content","blocksy",(function(e,{extension:t,onExtsSync:n}){return"newsletter-subscribe"!==t.name?e:ye(ye(ye({},e),t.data.api_key?{}:{activationStrategy:"from-custom-content"}),{},{content:(0,i.createElement)(he,{extension:t,onExtsSync:n})})}))}()}();