!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 r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var a=o.apply(null,n);a&&e.push(a)}else if("object"===i)for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},172:function(e,t,n){var r,o,i=n(760),a=n(529),s=(o=[],{activateTrap:function(e){if(o.length>0){var t=o[o.length-1];t!==e&&t.pause()}var n=o.indexOf(e);-1===n||o.splice(n,1),o.push(e)},deactivateTrap:function(e){var t=o.indexOf(e);-1!==t&&o.splice(t,1),o.length>0&&o[o.length-1].unpause()}});function c(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,o="string"==typeof e?n.querySelector(e):e,l=a({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),u={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},p={activate:function(e){if(u.active)return;I(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:l.onActivate;t&&t();return f(),p},deactivate:d,pause:function(){if(u.paused||!u.active)return;u.paused=!0,h()},unpause:function(){if(!u.paused||!u.active)return;u.paused=!1,I(),f()}};return p;function d(e){if(u.active){clearTimeout(r),h(),u.active=!1,u.paused=!1,s.deactivateTrap(p);var t=e&&void 0!==e.onDeactivate?e.onDeactivate:l.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:l.returnFocusOnDeactivate)&&c((function(){var e;S((e=u.nodeFocusedBeforeActivation,m("setReturnFocus")||e))})),p}}function f(){if(u.active)return s.activateTrap(p),r=c((function(){S(v())})),n.addEventListener("focusin",y,!0),n.addEventListener("mousedown",g,{capture:!0,passive:!1}),n.addEventListener("touchstart",g,{capture:!0,passive:!1}),n.addEventListener("click",w,{capture:!0,passive:!1}),n.addEventListener("keydown",b,{capture:!0,passive:!1}),p}function h(){if(u.active)return n.removeEventListener("focusin",y,!0),n.removeEventListener("mousedown",g,!0),n.removeEventListener("touchstart",g,!0),n.removeEventListener("click",w,!0),n.removeEventListener("keydown",b,!0),p}function m(e){var t=l[e],r=t;if(!t)return null;if("string"==typeof t&&!(r=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(r=t()))throw new Error("`"+e+"` did not return a node");return r}function v(){var e;if(!(e=null!==m("initialFocus")?m("initialFocus"):o.contains(n.activeElement)?n.activeElement:u.firstTabbableNode||m("fallbackFocus")))throw new Error("Your focus-trap needs to have at least one focusable element");return e}function g(e){o.contains(e.target)||(l.clickOutsideDeactivates?d({returnFocus:!i.isFocusable(e.target)}):l.allowOutsideClick&&l.allowOutsideClick(e)||e.preventDefault())}function y(e){o.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),S(u.mostRecentlyFocusedNode||v()))}function b(e){if(!1!==l.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void d();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(I(),e.shiftKey&&e.target===u.firstTabbableNode)return e.preventDefault(),void S(u.lastTabbableNode);if(!e.shiftKey&&e.target===u.lastTabbableNode)e.preventDefault(),S(u.firstTabbableNode)}(e)}function w(e){l.clickOutsideDeactivates||o.contains(e.target)||l.allowOutsideClick&&l.allowOutsideClick(e)||(e.preventDefault(),e.stopImmediatePropagation())}function I(){var e=i(o);u.firstTabbableNode=e[0]||v(),u.lastTabbableNode=e[e.length-1]||v()}function S(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),u.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):S(v()))}}},703:function(e,t,n){"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){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,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:i,resetWarningCache:o};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"},921:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;
/** @license React v16.13.1
 * 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 I(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case d:case v:case m:case c:return e;default:return t}}case o:return t}}}function S(e){return I(e)===p}},864:function(e,t,n){"use strict";n(921)},760:function(e){var t=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],n=t.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function o(e,t){t=t||{};var o,a,s,u=[],p=[],d=e.querySelectorAll(n);for(t.includeContainer&&r.call(e,n)&&(d=Array.prototype.slice.apply(d)).unshift(e),o=0;o<d.length;o++)i(a=d[o])&&(0===(s=c(a))?u.push(a):p.push({documentOrder:o,tabIndex:s,node:a}));return p.sort(l).map((function(e){return e.node})).concat(u)}function i(e){return!(!a(e)||function(e){return function(e){return u(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'),n=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(t);return!n||n===e}(e)}(e)||c(e)<0)}function a(e){return!(e.disabled||function(e){return u(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}o.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==r.call(e,n)&&i(e)},o.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==r.call(e,s)&&a(e)};var s=t.concat("iframe").join(",");function c(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function l(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function u(e){return"INPUT"===e.tagName}e.exports=o},529:function(e){e.exports=function(){for(var e={},n=0;n<arguments.length;n++){var r=arguments[n];for(var o in r)t.call(r,o)&&(e[o]=r[o])}return e};var t=Object.prototype.hasOwnProperty}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.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 r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.hooks,r=window.wp.i18n,o=n(184),i=n.n(o);function a(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var l=n(697),u=n.n(l),p=window.React,d=n.n(p);n(864);function f(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function h(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function m(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return h(n.overflowY,t)||h(n.overflowX,t)||function(e){var t=function(e){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.frameElement:null}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function v(e,t,n,r,o,i,a,s){return i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0}var g=0;function y(e){return"function"==typeof e?e:b}function b(){}function w(e,t){if(null!==e){var n=function(e,t){var n=t.scrollMode,r=t.block,o=t.inline,i=t.boundary,a=t.skipOverflowHiddenElements,s="function"==typeof i?i:function(e){return e!==i};if(!f(e))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,l=[],u=e;f(u)&&s(u);){if((u=u.parentNode)===c){l.push(u);break}u===document.body&&m(u)&&!m(document.documentElement)||m(u,a)&&l.push(u)}for(var p=window.visualViewport?visualViewport.width:innerWidth,d=window.visualViewport?visualViewport.height:innerHeight,h=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),b=y.height,w=y.width,I=y.top,S=y.right,O=y.bottom,_=y.left,E="start"===r||"nearest"===r?I:"end"===r?O:I+b/2,x="center"===o?_+w/2:"end"===o?S:_,k=[],P=0;P<l.length;P++){var C=l[P],D=C.getBoundingClientRect(),A=D.height,j=D.width,M=D.top,T=D.right,H=D.bottom,N=D.left;if("if-needed"===n&&I>=0&&_>=0&&O<=d&&S<=p&&I>=M&&O<=H&&_>=N&&S<=T)return k;var R=getComputedStyle(C),L=parseInt(R.borderLeftWidth,10),U=parseInt(R.borderTopWidth,10),K=parseInt(R.borderRightWidth,10),F=parseInt(R.borderBottomWidth,10),V=0,B=0,z="offsetWidth"in C?C.offsetWidth-C.clientWidth-L-K:0,W="offsetHeight"in C?C.offsetHeight-C.clientHeight-U-F:0;if(c===C)V="start"===r?E:"end"===r?E-d:"nearest"===r?v(g,g+d,d,U,F,g+E,g+E+b,b):E-d/2,B="start"===o?x:"center"===o?x-p/2:"end"===o?x-p:v(h,h+p,p,L,K,h+x,h+x+w,w),V=Math.max(0,V+g),B=Math.max(0,B+h);else{V="start"===r?E-M-U:"end"===r?E-H+F+W:"nearest"===r?v(M,H,A,U,F+W,E,E+b,b):E-(M+A/2)+W/2,B="start"===o?x-N-L:"center"===o?x-(N+j/2)+z/2:"end"===o?x-T+K+z:v(N,T,j,L,K+z,x,x+w,w);var q=C.scrollLeft,$=C.scrollTop;E+=$-(V=Math.max(0,Math.min($+V,C.scrollHeight-A+W))),x+=q-(B=Math.max(0,Math.min(q+B,C.scrollWidth-j+z)))}k.push({el:C,top:V,left:B})}return k}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}}function I(e,t){return e===t||e.contains&&e.contains(t)}function S(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function O(){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,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function _(){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 E(e){var t=e.isOpen,n=e.selectedItem,r=e.resultCount,o=e.previousResultCount,i=e.itemToString;return t?r?r!==o?r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""}function x(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function k(e){return"string"==typeof e.type}function P(e){return e.props}var C=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function D(e){void 0===e&&(e={});var t={};return C.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function A(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function j(e,t,n){var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var o=t+e;return o<0?o=r:o>r&&(o=0),o}var M=S((function(){H().textContent=""}),500);function T(e,t){var n=H(t);e&&(n.textContent=e,M())}function H(e){void 0===e&&(e=document);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)}var N=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),R=function(){var e=function(e){var t,n;function r(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(g++),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.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=D(t),n.internalSetState(s({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,r){t=D(t),n.internalSetState(s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,s({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var c=a?e(t):e;c=n.props.stateReducer(t,c),r=c.hasOwnProperty("selectedItem");var l={},u={};return r&&c.selectedItem!==t.selectedItem&&(o=c.selectedItem),c.type=c.type||0,Object.keys(c).forEach((function(e){t[e]!==c[e]&&(i[e]=c[e]),"type"!==e&&(u[e]=c[e],n.isControlledProp(e)||(l[e]=c[e]))})),a&&c.hasOwnProperty("inputValue")&&n.props.onInputValueChange(c.inputValue,s({},n.getStateAndHelpers(),{},c)),l}),(function(){y(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,c=void 0===i?"ref":i,l=o.ref,u=a(o,["refKey","ref"]),p=(void 0===t?{}:t).suppressRefError,d=void 0!==p&&p;n.getRootProps.called=!0,n.getRootProps.refKey=c,n.getRootProps.suppressRefError=d;var f=n.getState().isOpen;return s(((r={})[c]=_(l,n.rootRef),r.role="combobox",r["aria-expanded"]=f,r["aria-haspopup"]="listbox",r["aria-owns"]=f?n.menuId:null,r["aria-labelledby"]=n.labelId,r),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();e>0&&t.setHighlightedIndex(j(1,t.getState().highlightedIndex,e),{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();e>0&&t.setHighlightedIndex(j(-1,t.getState().highlightedIndex,e),{type:4})}))},Enter:function(e){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=s({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=s({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:7})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:8})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,o=(t.onPress,t.onKeyDown),i=t.onKeyUp,c=t.onBlur,l=a(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),u=n.getState().isOpen,p={onClick:O(r,n.buttonHandleClick),onKeyDown:O(o,n.buttonHandleKeyDown),onKeyUp:O(i,n.buttonHandleKeyUp),onBlur:O(c,n.buttonHandleBlur)};return s({type:"button",role:"button","aria-label":u?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l.disabled?{}:p,{},l)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=A(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(c(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return s({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,c=t.onInput,l=(t.onChangeText,a(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),u={};var p,d=n.getState(),f=d.inputValue,h=d.isOpen,m=d.highlightedIndex;l.disabled||((p={}).onChange=O(i,c,n.inputHandleChange),p.onKeyDown=O(r,n.inputHandleKeyDown),p.onBlur=O(o,n.inputHandleBlur),u=p);return s({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof m&&m>=0?n.getItemId(m):null,"aria-controls":h?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:f,id:n.inputId},u,{},l)},n.inputHandleKeyDown=function(e){var t=A(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(c(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=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,c=void 0===i?"ref":i,l=o.ref,u=a(o,["refKey","ref"]),p=(void 0===t?{}:t).suppressRefError,d=void 0!==p&&p;return n.getMenuProps.called=!0,n.getMenuProps.refKey=c,n.getMenuProps.suppressRefError=d,s(((r={})[c]=_(l,n.menuRef),r.role="listbox",r["aria-labelledby"]=u&&u["aria-label"]?null:n.labelId,r.id=n.menuId,r),u)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,c=r.onClick,l=(r.onPress,r.index),u=r.item,p=void 0===u?void 0:u,d=a(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===l?(n.items.push(p),l=n.items.indexOf(p)):n.items[l]=p;var f=c,h=((t={onMouseMove:O(o,(function(){l!==n.getState().highlightedIndex&&(n.setHighlightedIndex(l,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:O(i,(function(e){e.preventDefault()}))}).onClick=O(f,(function(){n.selectItemAtIndex(l,{type:9})})),t),m=d.disabled?{onMouseDown:h.onMouseDown}:h;return s({id:n.getItemId(l),role:"option","aria-selected":n.getState().highlightedIndex===l},m,{},d)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=D(e),n.internalSetState((function(t){var r=t.selectedItem;return s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=D(e),n.internalSetState((function(t){var r=t.isOpen;return s({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),y(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=S((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(s({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,T(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,l=void 0===i?o:i,u=r.defaultIsOpen,p=r.initialIsOpen,d=void 0===p?u:p,f=r.initialInputValue,h=void 0===f?"":f,m=r.initialSelectedItem,v=void 0===m?null:m,b=n.getState({highlightedIndex:l,isOpen:d,inputValue:h,selectedItem:v});return null!=b.selectedItem&&void 0===n.props.initialInputValue&&(b.inputValue=n.props.itemToString(b.selectedItem)),n.state=b,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},o.getState=function(e){var t=this;return void 0===e&&(e=this.state),Object.keys(e).reduce((function(n,r){return n[r]=t.isControlledProp(r)?t.props[r]:e[r],n}),{})},o.isControlledProp=function(e){return void 0!==this.props[e]},o.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},o.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},o.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},o.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var r=j(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(r,t)}},o.highlightFirstOrLastIndex=function(e,t,n){var r=this.getItemCount()-1;r<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:r,n))},o.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,s=this.getRootProps,c=this.getToggleButtonProps,l=this.getLabelProps,u=this.getMenuProps,p=this.getInputProps,d=this.getItemProps,f=this.openMenu,h=this.closeMenu,m=this.toggleMenu,v=this.selectItem,g=this.selectItemAtIndex,y=this.selectHighlightedItem,b=this.setHighlightedIndex,w=this.clearSelection,I=this.clearItems;return{getRootProps:s,getToggleButtonProps:c,getLabelProps:l,getMenuProps:u,getInputProps:p,getItemProps:d,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:m,selectItem:v,selectItemAtIndex:g,selectHighlightedItem:y,setHighlightedIndex:b,clearSelection:w,clearItems:I,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},o.componentDidMount=function(){var e=this;var t=function(t,n){void 0===n&&(n=!0);var r=e.props.environment.document;return[e._rootNode,e._menuNode].some((function(e){return e&&(I(e,t)||n&&I(e,r.activeElement))}))},n=function(){e.isMouseDown=!0},r=function(n){e.isMouseDown=!1,!t(n.target)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},o=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},a=function(n){var r=t(n.target,!1);e.isTouchMove||r||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},s=this.props.environment;s.addEventListener("mousedown",n),s.addEventListener("mouseup",r),s.addEventListener("touchstart",o),s.addEventListener("touchmove",i),s.addEventListener("touchend",a),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),s.removeEventListener("mousedown",n),s.removeEventListener("mouseup",r),s.removeEventListener("touchstart",o),s.removeEventListener("touchmove",i),s.removeEventListener("touchend",a)}},o.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},o.componentDidUpdate=function(e,t){this.isControlledProp("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()},o.componentWillUnmount=function(){this.cleanup()},o.render=function(){var e=x(this.props.children,b);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=x(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:k(t)?(0,p.cloneElement)(t,this.getRootProps(P(t))):void 0:null},r}(p.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:E,itemToString:function(e){return null==e?"":String(e)},onStateChange:b,onInputValueChange:b,onUserAction:b,onChange:b,onSelect:b,onOuterClick:b,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:w},e.stateChangeTypes=N,e}();u().array.isRequired,u().func,u().func,u().func,u().bool,u().number,u().number,u().number,u().bool,u().bool,u().bool,u().any,u().any,u().any,u().string,u().string,u().string,u().func,u().string,u().func,u().func,u().func,u().func,u().func,u().shape({addEventListener:u().func,removeEventListener:u().func,document:u().shape({getElementById:u().func,activeElement:u().any,body:u().any})});"undefined"==typeof window||window;var L=R;function U(){return U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(this,arguments)}function K(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;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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 B(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var q=function(t){var n=t.listId,o=t.provider,a=t.apiKey,s=t.onChange,c=z((0,e.useState)([]),2),l=c[0],u=c[1],p=z((0,e.useState)(!1),2),d=p[0],f=p[1],h=z((0,e.useState)({controller:null}),2),m=h[0].controller,v=h[1],g=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m&&m.abort(),f(!0),"AbortController"in window&&(m=new AbortController,v({controller:m})),(t=new FormData).append("api_key",a),t.append("provider",o),t.append("action","blocksy_ext_newsletter_subscribe_maybe_get_lists"),e.prev=7,e.next=10,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",signal:m.signal,body:t});case 10:if(200!==(n=e.sent).status){e.next=20;break}return e.next=14,n.json();case 14:if(!(r=e.sent).success){e.next=20;break}if("api_key_invalid"===r.data.result){e.next=20;break}return f(!1),u(r.data.result.map((function(e){return F(F({},e),{},{id:e.id.toString()})}))),e.abrupt("return");case 20:e.next=24;break;case 22:e.prev=22,e.t0=e.catch(7);case 24:u([]),f(!1);case 26:case"end":return e.stop()}}),e,null,[[7,22]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){B(i,r,o,a,s,"next",e)}function s(e){B(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return(0,e.useEffect)((function(){a?g():u([])}),[o,a]),0===l.length?(0,e.createElement)("div",{className:i()("ct-select-input","ct-no-results")},(0,e.createElement)("input",{disabled:!0,placeholder:d?(0,r.__)("Fetching...","blocksy-companion"):""})):(0,e.createElement)(L,{selectedItem:n||"",onChange:function(e){return s(e)},itemToString:function(e){return e?(l.find((function(t){return t.id===e}))||{}).name:""}},(function(t){var n=t.getInputProps,o=t.getItemProps,a=(t.getLabelProps,t.getMenuProps),s=t.isOpen,c=(t.inputValue,t.highlightedIndex),u=t.selectedItem,p=t.openMenu;return(0,e.createElement)("div",{className:"ct-select-input"},(0,e.createElement)("input",U({},n({onFocus:function(){return p()},onClick:function(){return p()}}),{placeholder:(0,r.__)("Select list...","blocksy-companion"),readOnly:!0})),s&&(0,e.createElement)("div",a({className:"ct-select-dropdown"}),l.map((function(t,n){return(0,e.createElement)("div",o({key:t.id,index:n,item:t.id,className:i()("ct-select-dropdown-item",{active:c===n,selected:u===t.id})}),t.name)}))))}))};function $(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Y=function(e){e.initialState,e.getInitialState,e.refs,e.getRefs,e.didMount,e.didUpdate,e.willUnmount,e.getSnapshotBeforeUpdate,e.shouldUpdate,e.render;return function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["initialState","getInitialState","refs","getRefs","didMount","didUpdate","willUnmount","getSnapshotBeforeUpdate","shouldUpdate","render"])},X=function(e){function t(){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=$(this,e.call.apply(e,[this].concat(i))),G.call(r),$(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getArgs=function(){var e=this.state,t=this.props,n=this._setState,r=this._forceUpdate,o=this._refs;return{state:e,props:Y(t),refs:o,setState:n,forceUpdate:r}},t.prototype.componentDidMount=function(){this.props.didMount&&this.props.didMount(this.getArgs())},t.prototype.shouldComponentUpdate=function(e,t){return!this.props.shouldUpdate||this.props.shouldUpdate({props:this.props,state:this.state,nextProps:Y(e),nextState:t})},t.prototype.componentWillUnmount=function(){this.props.willUnmount&&this.props.willUnmount({state:this.state,props:Y(this.props),refs:this._refs})},t.prototype.componentDidUpdate=function(e,t,n){this.props.didUpdate&&this.props.didUpdate(Object.assign(this.getArgs(),{prevProps:Y(e),prevState:t}),n)},t.prototype.getSnapshotBeforeUpdate=function(e,t){return this.props.getSnapshotBeforeUpdate?this.props.getSnapshotBeforeUpdate(Object.assign(this.getArgs(),{prevProps:Y(e),prevState:t})):null},t.prototype.render=function(){var e=this.props,t=e.children,n=e.render;return n?n(this.getArgs()):"function"==typeof t?t(this.getArgs()):t||null},t}(d().Component);X.defaultProps={getInitialState:function(){},getRefs:function(){return{}}};var G=function(){var e=this;this.state=this.props.initialState||this.props.getInitialState(this.props),this._refs=this.props.refs||this.props.getRefs(this.getArgs()),this._setState=function(){return e.setState.apply(e,arguments)},this._forceUpdate=function(){return e.forceUpdate.apply(e,arguments)}},J=X,Q=function(t){var n=t.children,r=t.container,o=void 0===r?document.body:r,i=t.type,a=void 0===i?"reach-portal":i;return(0,e.createElement)(J,{getRefs:function(){return{node:null}},didMount:function(e){var t=e.refs,n=e.forceUpdate,r=o.hasOwnProperty("current")?o.current:o;t.node=document.createElement(a),r.appendChild(t.node),n()},willUnmount:function(e){var t=e.refs.node,n=o.hasOwnProperty("current")?o.current:o;n&&n.removeChild(t)},render:function(t){var r=t.refs.node;return r?(0,e.createPortal)(n,r):null}})};var Z=function(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}},ee=n(172),te=n.n(ee);function ne(){return ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ne.apply(this,arguments)}function re(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<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var oe=function(){},ie=function(){},ae=function(e,t){var n,r,o;e.disposeAriaHider=(n=e.overlayNode,r=[],o=[],Array.prototype.forEach.call(document.querySelectorAll("body > *"),(function(e){if(e!==n.parentNode){var t=e.getAttribute("aria-hidden");null!==t&&"false"!==t||(r.push(t),o.push(e),e.setAttribute("aria-hidden","true"))}})),function(){o.forEach((function(e,t){var n=r[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)}))}),e.trap=te()(e.overlayNode,{initialFocus:t?function(){return t.current}:void 0,fallbackFocus:e.contentNode,escapeDeactivates:!1,clickOutsideDeactivates:!1})},se=function(e){var t=e.refs;t.trap.deactivate(),t.disposeAriaHider()},ce=React.createContext(),le=React.forwardRef((function(t,n){var r=t.container,o=t.isOpen,i=void 0===o||o,a=t.onDismiss,s=void 0===a?oe:a,c=t.initialFocusRef,l=t.onClick,u=t.onKeyDown,p=re(t,["container","isOpen","onDismiss","initialFocusRef","onClick","onKeyDown"]);return(0,e.createElement)(J,{didMount:ie},i?(0,e.createElement)(Q,{container:r,"data-reach-dialog-wrapper":!0},(0,e.createElement)(J,{refs:{overlayNode:null,contentNode:null},didMount:function(e){var t=e.refs;ae(t,c)},willUnmount:se},(function(t){var r=t.refs;return(0,e.createElement)(ce.Provider,{value:function(e){return r.contentNode=e}},(0,e.createElement)("div",ne({"data-reach-dialog-overlay":!0,onClick:Z(l,(function(e){e.stopPropagation(),s()})),onKeyDown:Z(u,(function(e){"Escape"===e.key&&(e.stopPropagation(),s())})),ref:function(e){r.overlayNode=e,n&&n(e)}},p)))}))):null)}));le.propTypes={initialFocusRef:function(){}};var ue=function(e){return e.stopPropagation()},pe=React.forwardRef((function(t,n){var r=t.onClick,o=(t.onKeyDown,re(t,["onClick","onKeyDown"]));return(0,e.createElement)(ce.Consumer,null,(function(t){return(0,e.createElement)("div",ne({"aria-modal":"true","data-reach-dialog-content":!0,tabIndex:"-1",onClick:Z(r,ue),ref:function(e){t(e),n&&n(e)}},o))}))})),de=window.blocksyOptions,fe=function(e){return!!e},he=function(t){var n=t.items,r=t.isVisible,o=void 0===r?fe:r,a=t.render,s=t.className,c=t.onDismiss;return(0,e.createElement)(de.Transition,{items:n,onStart:function(){return document.body.classList[o(n)?"add":"remove"]("ct-dashboard-overlay-open")},config:{duration:200},from:{opacity:0,y:-10},enter:{opacity:1,y:0},leave:{opacity:0,y:10}},(function(t){return o(t)&&function(n){return(0,e.createElement)(le,{style:{opacity:n.opacity},container:document.querySelector("#wpbody"),onDismiss:function(){return c()}},(0,e.createElement)(pe,{className:i()("ct-admin-modal",s),style:{transform:"translate3d(0px, ".concat(n.y,"px, 0px)")}},(0,e.createElement)("button",{className:"close-button",onClick:function(){return c()}},"×"),a(t,n)))}}))},me=(window.ctDashboardLocalizations||{}).DashboardContext,ve=((me||{}).Provider,(me||{}).Consumer,me);function ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ye(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}(0,r.__)("Free","blocksy-companion"),(0,r.__)("Personal","blocksy-companion"),(0,r.__)("Professional","blocksy-companion"),(0,r.__)("Agency","blocksy-companion"),(0,r.__)("Personal","blocksy-companion"),(0,r.__)("Professional","blocksy-companion"),(0,r.__)("Agency","blocksy-companion");var be=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(t.currentPlan,t.requiredPlan),o=void 0===n?"personal":n,i=t.personal,a=void 0===i?{title:(0,r.__)("This is a Pro feature","blocksy-companion"),description:(0,r.__)("Upgrade to any pro plan and get instant access to this and many other feature.","blocksy-companion")}:i,s=t.professional,c=void 0===s?{description:(0,r.__)("Upgrade to the professional or agency plan and get instant access to this and many other features.","blocksy-companion")}:s,l=t.agency,u=void 0===l?{description:(0,r.__)("Upgrade to the agency plan and get instant access to this and many other features.","blocksy-companion")}:l,p=ge((0,e.useState)(!1),2),d=p[0],f=p[1];return{showNotice:function(e){f(e||!0)},content:(0,e.createElement)(he,{items:d,className:"ct-onboarding-modal",onDismiss:function(){return f(!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"===o&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"ct-modal-title"},a.title),(0,e.createElement)("p",null,a.description)),"professional"===o&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",null,"Required plan"),(0,e.createElement)("h2",{className:"ct-modal-title"},(0,r.__)("Professional or Agency","blocksy-companion")),(0,e.createElement)("p",null,c.description)),"agency"===o&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",null,"Required plan"),(0,e.createElement)("h2",{className:"ct-modal-title"},(0,r.__)("Agency","blocksy-companion")),(0,e.createElement)("p",null,u.description)),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("a",{href:"https://creativethemes.com/blocksy/pricing/#comparison-free-vs-pro",target:"_blank",className:"button"},(0,r.__)("Compare Plans","blocksy-companion")),(0,e.createElement)("a",{href:"https://creativethemes.com/blocksy/pricing/",target:"_blank",className:"button button-primary"},(0,r.__)("Upgrade Now","blocksy-companion"))))}})}};function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ie(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Se(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 Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(n),!0).forEach((function(t){_e(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ee=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n=Oe({strategy:"pro-ext",modalTitle:(0,r.__)("This is a Pro extension","blocksy-companion")},n);var o=we((0,e.useState)(!1),2),i=(o[0],o[1],ctDashboardLocalizations.plugin_data.is_pro),a=((0,e.useContext)(ve).history,!i&&t.config.pro),s=ctDashboardLocalizations.plugin_data.current_plan,c="personal";t.config.plans&&(t.config.plans.includes("agency_v2")&&(c="agency"),t.config.plans.includes("professional_v2")&&(c="professional"));var l=be(Oe({currentPlan:s,requiredPlan:c},n)),u=l.content,p=l.showNotice;return{isPro:i,isProInFree:!i&&t.config.pro||t.config.plans&&t.config.plans.length&&!t.config.plans.includes(s),showNotice:p,content:"pro-ext"===n.strategy&&a||"pro"===n.strategy&&!i||t.config.plans&&t.config.plans.length&&!t.config.plans.includes(s)?u:null}};function xe(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ce=["mailchimp","demo"],De=function(t){var n=t.extension,o=t.onCredentialsValidated,a=ke((0,e.useState)(n.data.provider),2),s=a[0],c=a[1],l=ke((0,e.useState)(n.data.api_key),2),u=l[0],p=l[1],d=ke((0,e.useState)(n.data.list_id),2),f=d[0],h=d[1],m=ke((0,e.useState)(!1),2),v=m[0],g=m[1],y=Ee(n,{strategy:"pro"}),b=y.isPro,w=y.showNotice,I=y.content;(0,e.useEffect)((function(){!n.data||Ce.includes(n.data.provider)||b||c(Ce[0])}),[]);var S=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new FormData).append("provider",s),t.append("api_key",u),t.append("list_id",f),t.append("action","blocksy_ext_newsletter_subscribe_maybe_save_credentials"),g(!0),e.prev=6,e.next=9,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:t});case 9:if(200!==(n=e.sent).status){e.next=15;break}return e.next=13,n.json();case 13:(r=e.sent).success&&"api_key_invalid"!==r.data.result&&o();case 15:e.next=19;break;case 17:e.prev=17,e.t0=e.catch(6);case 19:return e.next=21,new Promise((function(e){return setTimeout((function(){return e()}),1e3)}));case 21:g(!1);case 22:case"end":return e.stop()}}),e,null,[[6,17]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xe(i,r,o,a,s,"next",e)}function s(e){xe(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return(0,e.createElement)("div",{className:i()("ct-extension-options ct-newsletter-subscribe-options")},(0,e.createElement)("h4",null,(0,r.__)("Connect Newsletter Provider","blocksy-companion")),(0,e.createElement)("div",{className:"ct-newsletter-credentials","data-columns":s.indexOf("mailerlite")>-1?4:3},(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,r.__)("Provider","blocksy-companion")),(0,e.createElement)(de.Select,{onChange:function(e){if(!b&&!Ce.includes(e))return c(e),setTimeout((function(){c(Ce[0])})),void w();c(e)},option:{placeholder:(0,r.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"mailchimp",value:"Mailchimp"},{key:"mailerlite",value:"Mailerlite"},{key:"brevo",value:"Brevo (Sendinblue)"},{key:"campaignmonitor",value:"Campaign Monitor"},{key:"convertkit",value:"ConvertKit"},{key:"demo",value:"Demo"}]},value:s.indexOf("mailerlite")>-1?"mailerlite":s})),s.indexOf("mailerlite")>-1&&(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,r.__)("Version","blocksy-companion")),(0,e.createElement)(de.Select,{onChange:function(e){c("new"===e?"mailerlite-new":"mailerlite")},option:{placeholder:(0,r.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"classic",value:"Classic"},{key:"new",value:"New"}]},value:"mailerlite-new"===s?"new":"classic"})),(Ce.includes(s)||ctDashboardLocalizations.plugin_data.is_pro)&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,r.__)("API Key","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",onChange:function(e){var t=e.target.value;return p(t)},value:u||""}))),(0,e.createElement)("section",null,(0,e.createElement)("label",null,(0,r.__)("List ID","blocksy-companion")),(0,e.createElement)(q,{listId:f,onChange:function(e){return h(e)},provider:s,apiKey:u})))),"mailchimp"===s&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,r.sprintf)((0,r.__)("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&&s.indexOf("mailerlite")>-1&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,r.sprintf)((0,r.__)("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>")}}),s.indexOf("demo")>-1&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,r.__)("This provider is used only for testing purposes. It doesnt register any real subscribers.","blocksy-companion")}}),ctDashboardLocalizations.plugin_data.is_pro&&"brevo"===s&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,r.sprintf)((0,r.__)("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&&"convertkit"===s&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,r.sprintf)((0,r.__)("More information on how to generate an API key for ConvertKit can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://developers.convertkit.com/#api-basics">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"campaignmonitor"===s&&(0,e.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,r.sprintf)((0,r.__)("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>")}}),(0,e.createElement)("button",{className:"ct-button-primary",disabled:!u||!f||v,onClick:function(){return S()}},v?(0,r.__)("Loading...","blocksy-companion"):(0,r.__)("Save Settings","blocksy-companion")),I)};function Ae(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}var je=function(t){var n=t.extension,r=t.onExtsSync,o=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new FormData).append("ext",n.name),t.append("action",n.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),e.prev=3,e.next=6,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:t});case 6:r(),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:case"end":return e.stop()}}),e,null,[[3,9]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ae(i,r,o,a,s,"next",e)}function s(e){Ae(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return(0,e.createElement)(De,{extension:n,onCredentialsValidated:function(){n.__object||o()}})};function Me(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 Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(n),!0).forEach((function(t){He(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,t.addFilter)("blocksy.extensions.current_extension_content","blocksy",(function(t,n){var r=n.extension,o=n.onExtsSync;return"newsletter-subscribe"!==r.name?t:Te(Te(Te({},t),r.data.api_key?{}:{activationStrategy:"from-custom-content"}),{},{content:(0,e.createElement)(je,{extension:r,onExtsSync:o})})}))}()}();