View file File name : formselector.es5.min.js Content :!function n(o,a,l){function s(r,e){if(!a[r]){if(!o[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(i)return i(r,!0);throw new Error("Cannot find module '"+r+"'")}e=a[r]={exports:{}};o[r][0].call(e.exports,function(e){var t=o[r][1][e];return s(t||e)},e,e.exports,n,o,a,l)}return a[r].exports}for(var i="function"==typeof require&&require,e=0;e<l.length;e++)s(l[e]);return s}({1:[function(e,t,r){var n,o,a,t=t.exports={};function l(){}t.nextTick=(o="undefined"!=typeof window&&window.setImmediate,a="undefined"!=typeof window&&window.postMessage&&window.addEventListener,o?function(e){return window.setImmediate(e)}:a?(n=[],window.addEventListener("message",function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<n.length&&n.shift()())},!0),function(e){n.push(e),window.postMessage("process-tick","*")}):function(e){setTimeout(e,0)}),t.title="browser",t.browser=!0,t.env={},t.argv=[],t.on=l,t.addListener=l,t.once=l,t.off=l,t.removeListener=l,t.removeAllListeners=l,t.emit=l,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],2:[function(e,t,r){"use strict";var i=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(Object.assign){var e=new String("abc");if(e[5]="de","5"!==Object.getOwnPropertyNames(e)[0]){for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n,o=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"===o.join(""))return n={},"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")?1:void 0}}}catch(e){}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var a in r=Object(arguments[o]))c.call(r,a)&&(n[a]=r[a]);if(i)for(var l=i(r),s=0;s<l.length;s++)u.call(r,l[s])&&(n[l[s]]=r[l[s]])}return n}},{}],3:[function(t,r,e){!function(i){"use strict";var c,u,f,d=function(){};function e(e,t,r,n,o){if("production"!==i.env.NODE_ENV)for(var a in e)if(f(e,a)){var l,s;try{if("function"!=typeof e[a])throw(s=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",s;l=e[a](t,a,n,r,null,c)}catch(e){l=e}!l||l instanceof Error||d((n||"React class")+": type specification of "+r+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in u)&&(u[l.message]=!0,a=o?o():"",d("Failed "+r+" type: "+l.message+(null!=a?a:"")))}}"production"!==i.env.NODE_ENV&&(c=t("./lib/ReactPropTypesSecret"),u={},f=t("./lib/has"),d=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),e.resetWarningCache=function(){"production"!==i.env.NODE_ENV&&(u={})},r.exports=e}.call(this,t("hmr7eR"))},{"./lib/ReactPropTypesSecret":7,"./lib/has":8,hmr7eR:1}],4:[function(e,t,r){"use strict";var l=e("./lib/ReactPropTypesSecret");function n(){}function o(){}o.resetWarningCache=n,t.exports=function(){function e(e,t,r,n,o,a){if(a!==l)throw(a=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")).name="Invariant Violation",a}function t(){return e}var r={array:e.isRequired=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:o,resetWarningCache:n};return r.PropTypes=r}},{"./lib/ReactPropTypesSecret":7}],5:[function(e,t,r){!function(g){"use strict";var c=e("react-is"),y=e("object-assign"),h=e("./lib/ReactPropTypesSecret"),v=e("./lib/has"),n=e("./checkPropTypes"),w=function(){};function o(){return null}"production"!==g.env.NODE_ENV&&(w=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),t.exports=function(a,u){var l="function"==typeof Symbol&&Symbol.iterator,s="@@iterator";var f="<<anonymous>>",e={array:t("array"),bigint:t("bigint"),bool:t("boolean"),func:t("function"),number:t("number"),object:t("object"),string:t("string"),symbol:t("symbol"),any:r(o),arrayOf:function(i){return r(function(e,t,r,n,o){if("function"!=typeof i)return new d("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=e[t];if(!Array.isArray(a))return new d("Invalid "+n+" `"+o+"` of type `"+p(a)+"` supplied to `"+r+"`, expected an array.");for(var l=0;l<a.length;l++){var s=i(a,l,r,n,o+"["+l+"]",h);if(s instanceof Error)return s}return null})},element:r(function(e,t,r,n,o){return e=e[t],a(e)?null:new d("Invalid "+n+" `"+o+"` of type `"+p(e)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:r(function(e,t,r,n,o){return e=e[t],c.isValidElementType(e)?null:new d("Invalid "+n+" `"+o+"` of type `"+p(e)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(l){return r(function(e,t,r,n,o){var a;return e[t]instanceof l?null:(a=l.name||f,new d("Invalid "+n+" `"+o+"` of type `"+((n=e[t]).constructor&&n.constructor.name?n.constructor.name:f)+"` supplied to `"+r+"`, expected instance of `"+a+"`."))})},node:r(function(e,t,r,n,o){return i(e[t])?null:new d("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(i){return r(function(e,t,r,n,o){if("function"!=typeof i)return new d("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a,l=e[t];if("object"!==(e=p(l)))return new d("Invalid "+n+" `"+o+"` of type `"+e+"` supplied to `"+r+"`, expected an object.");for(a in l)if(v(l,a)){var s=i(l,a,r,n,o+"."+a,h);if(s instanceof Error)return s}return null})},oneOf:function(s){if(Array.isArray(s))return r(function(e,t,r,n,o){for(var a=e[t],l=0;l<s.length;l++)if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(a,s[l]))return null;e=JSON.stringify(s,function(e,t){return"symbol"===b(t)?String(t):t});return new d("Invalid "+n+" `"+o+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+e+".")});"production"!==g.env.NODE_ENV&&w(1<arguments.length?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array.");return o},oneOfType:function(i){if(!Array.isArray(i))return"production"!==g.env.NODE_ENV&&w("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var e=0;e<i.length;e++){var t=i[e];if("function"!=typeof t)return w("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+function(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}(t)+" at index "+e+"."),o}return r(function(e,t,r,n,o){for(var a=[],l=0;l<i.length;l++){var s=(0,i[l])(e,t,r,n,o,h);if(null==s)return null;s.data&&v(s.data,"expectedType")&&a.push(s.data.expectedType)}return new d("Invalid "+n+" `"+o+"` supplied to `"+r+"`"+(0<a.length?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(i){return r(function(e,t,r,n,o){var a,l=e[t];if("object"!==(e=p(l)))return new d("Invalid "+n+" `"+o+"` of type `"+e+"` supplied to `"+r+"`, expected `object`.");for(a in i){var s=i[a];if("function"!=typeof s)return m(r,n,o,a,b(s));s=s(l,a,r,n,o+"."+a,h);if(s)return s}return null})},exact:function(c){return r(function(e,t,r,n,o){var a,l=e[t],s=p(l);if("object"!==s)return new d("Invalid "+n+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(a in y({},e[t],c)){var i=c[a];if(v(c,a)&&"function"!=typeof i)return m(r,n,o,a,b(i));if(!i)return new d("Invalid "+n+" `"+o+"` key `"+a+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(c),null," "));i=i(l,a,r,n,o+"."+a,h);if(i)return i}return null})}};function d(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(s){var i,c;function e(e,t,r,n,o,a,l){if(n=n||f,a=a||r,l!==h){if(u)throw(l=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")).name="Invariant Violation",l;"production"!==g.env.NODE_ENV&&"undefined"!=typeof console&&!i[l=n+":"+r]&&c<3&&(w("You are manually calling a React.PropTypes validation function for the `"+a+"` prop on `"+n+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),i[l]=!0,c++)}return null==t[r]?e?null===t[r]?new d("The "+o+" `"+a+"` is marked as required in `"+n+"`, but its value is `null`."):new d("The "+o+" `"+a+"` is marked as required in `"+n+"`, but its value is `undefined`."):null:s(t,r,n,o,a)}"production"!==g.env.NODE_ENV&&(i={},c=0);var t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}function t(l){return r(function(e,t,r,n,o,a){return p(e=e[t])!==l?new d("Invalid "+n+" `"+o+"` of type `"+b(e)+"` supplied to `"+r+"`, expected `"+l+"`.",{expectedType:l}):null})}function m(e,t,r,n,o){return new d((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function i(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(i);if(null!==e&&!a(e)){var t=function(e){if("function"==typeof(e=e&&(l&&e[l]||e[s])))return e}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!i(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!i(o[1]))return!1}}return!0;default:return!1}}function p(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":(e=e,"symbol"===t||e&&("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)?"symbol":t)}function b(e){if(null==e)return""+e;var t=p(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}return d.prototype=Error.prototype,e.checkPropTypes=n,e.resetWarningCache=n.resetWarningCache,e.PropTypes=e}}.call(this,e("hmr7eR"))},{"./checkPropTypes":3,"./lib/ReactPropTypesSecret":7,"./lib/has":8,hmr7eR:1,"object-assign":2,"react-is":11}],6:[function(t,r,e){!function(e){"production"!==e.env.NODE_ENV?(e=t("react-is"),r.exports=t("./factoryWithTypeCheckers")(e.isElement,!0)):r.exports=t("./factoryWithThrowingShims")()}.call(this,t("hmr7eR"))},{"./factoryWithThrowingShims":4,"./factoryWithTypeCheckers":5,hmr7eR:1,"react-is":11}],7:[function(e,t,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}],8:[function(e,t,r){t.exports=Function.call.bind(Object.prototype.hasOwnProperty)},{}],9:[function(e,t,O){!function(e){"use strict";function t(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:var r=e.type;switch(r){case f:case d:case l:case i:case s:case p:return r;default:var n=r&&r.$$typeof;switch(n){case u:case m:case g:case b:case c:return n;default:return t}}case a:return t}}}function r(e){return t(e)===d}var o,a,l,s,i,c,u,f,d,m,p,n,b,g,y,h,v,w,k,S,C,_,E,P,R,x,T,j,B,I;"production"!==e.env.NODE_ENV&&(e="function"==typeof Symbol&&Symbol.for,o=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,n=e?Symbol.for("react.suspense_list"):60120,b=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119,e=d,k=u,S=c,C=o,_=m,E=l,P=g,R=b,x=a,T=i,j=s,B=p,I=!1,O.AsyncMode=f,O.ConcurrentMode=e,O.ContextConsumer=k,O.ContextProvider=S,O.Element=C,O.ForwardRef=_,O.Fragment=E,O.Lazy=P,O.Memo=R,O.Portal=x,O.Profiler=T,O.StrictMode=j,O.Suspense=B,O.isAsyncMode=function(e){return I||(I=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),r(e)||t(e)===f},O.isConcurrentMode=r,O.isContextConsumer=function(e){return t(e)===u},O.isContextProvider=function(e){return t(e)===c},O.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},O.isForwardRef=function(e){return t(e)===m},O.isFragment=function(e){return t(e)===l},O.isLazy=function(e){return t(e)===g},O.isMemo=function(e){return t(e)===b},O.isPortal=function(e){return t(e)===a},O.isProfiler=function(e){return t(e)===i},O.isStrictMode=function(e){return t(e)===s},O.isSuspense=function(e){return t(e)===p},O.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===d||e===i||e===s||e===p||e===n||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===b||e.$$typeof===c||e.$$typeof===u||e.$$typeof===m||e.$$typeof===h||e.$$typeof===v||e.$$typeof===w||e.$$typeof===y)},O.typeOf=t)}.call(this,e("hmr7eR"))},{hmr7eR:1}],10:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,l=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,f=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,m=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,b=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,h=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,k=n?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case d:case l:case i:case s:case p:return e;default:switch(e=e&&e.$$typeof){case u:case m:case y:case g:case c:return e;default:return t}}case a:return t}}}function C(e){return S(e)===d}r.AsyncMode=f,r.ConcurrentMode=d,r.ContextConsumer=u,r.ContextProvider=c,r.Element=o,r.ForwardRef=m,r.Fragment=l,r.Lazy=y,r.Memo=g,r.Portal=a,r.Profiler=i,r.StrictMode=s,r.Suspense=p,r.isAsyncMode=function(e){return C(e)||S(e)===f},r.isConcurrentMode=C,r.isContextConsumer=function(e){return S(e)===u},r.isContextProvider=function(e){return S(e)===c},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},r.isForwardRef=function(e){return S(e)===m},r.isFragment=function(e){return S(e)===l},r.isLazy=function(e){return S(e)===y},r.isMemo=function(e){return S(e)===g},r.isPortal=function(e){return S(e)===a},r.isProfiler=function(e){return S(e)===i},r.isStrictMode=function(e){return S(e)===s},r.isSuspense=function(e){return S(e)===p},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===d||e===i||e===s||e===p||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===g||e.$$typeof===c||e.$$typeof===u||e.$$typeof===m||e.$$typeof===v||e.$$typeof===w||e.$$typeof===k||e.$$typeof===h)},r.typeOf=S},{}],11:[function(t,r,e){!function(e){"use strict";"production"===e.env.NODE_ENV?r.exports=t("./cjs/react-is.production.min.js"):r.exports=t("./cjs/react-is.development.js")}.call(this,t("hmr7eR"))},{"./cjs/react-is.development.js":9,"./cjs/react-is.production.min.js":10,hmr7eR:1}],12:[function(e,t,r){"use strict";var n=f(e("../../../js/integrations/gutenberg/modules/education.js")),o=f(e("../../../js/integrations/gutenberg/modules/common.js")),a=f(e("../../../js/integrations/gutenberg/modules/themes-panel.js")),l=f(e("../../../js/integrations/gutenberg/modules/container-styles.js")),s=f(e("../../../js/integrations/gutenberg/modules/background-styles.js")),i=f(e("../../../js/integrations/gutenberg/modules/button-styles.js")),c=f(e("../../../js/integrations/gutenberg/modules/advanced-settings.js")),u=f(e("../../../js/integrations/gutenberg/modules/field-styles.js"));function f(e){return e&&e.__esModule?e:{default:e}}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function p(n){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?m(Object(o),!0).forEach(function(e){var t,r;t=n,r=o[e=e],(e=function(e){e=function(e,t){if("object"!=d(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==d(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var b,e=window.WPForms||{};e.FormSelector=e.FormSelector||(b={common:{},panels:{},init:function(){b.education=n.default,b.common=o.default,b.panels.themes=a.default,b.panels.container=l.default,b.panels.background=s.default,b.panels.button=i.default,b.panels.advanced=c.default,b.panels.field=u.default;var e={panels:b.panels,getThemesPanel:b.panels.themes.getThemesPanel,getFieldStyles:b.panels.field.getFieldStyles,getContainerStyles:b.panels.container.getContainerStyles,getBackgroundStyles:b.panels.background.getBackgroundStyles,getButtonStyles:b.panels.button.getButtonStyles,getCommonAttributes:b.getCommonAttributes,setStylesHandlers:b.getStyleHandlers(),education:b.education};b.panels.advanced.init(b.common),b.common.init(e)},getCommonAttributes:function(){return p(p(p(p({},b.panels.field.getBlockAttributes()),b.panels.container.getBlockAttributes()),b.panels.background.getBlockAttributes()),b.panels.button.getBlockAttributes())},getStyleHandlers:function(){return{"background-image":b.panels.background.setContainerBackgroundImage,"background-position":b.panels.background.setContainerBackgroundPosition,"background-repeat":b.panels.background.setContainerBackgroundRepeat,"background-width":b.panels.background.setContainerBackgroundWidth,"background-height":b.panels.background.setContainerBackgroundHeight,"background-color":b.panels.background.setBackgroundColor,"background-url":b.panels.background.setBackgroundUrl}}}),e.FormSelector.init()},{"../../../js/integrations/gutenberg/modules/advanced-settings.js":13,"../../../js/integrations/gutenberg/modules/background-styles.js":15,"../../../js/integrations/gutenberg/modules/button-styles.js":16,"../../../js/integrations/gutenberg/modules/common.js":17,"../../../js/integrations/gutenberg/modules/container-styles.js":18,"../../../js/integrations/gutenberg/modules/education.js":19,"../../../js/integrations/gutenberg/modules/field-styles.js":20,"../../../js/integrations/gutenberg/modules/themes-panel.js":21}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,o,a,l,s,i,c;r.default=(n=jQuery,o=wp.hooks.addFilter,r=wp.compose.createHigherOrderComponent,a=wp.element.Fragment,l=(wp.blockEditor||wp.editor).InspectorAdvancedControls,s=wp.components.TextareaControl,i=wpforms_gutenberg_form_selector.strings,c={init:function(e){c.common=e,c.hooks(),c.events()},hooks:function(){o("editor.BlockEdit","editorskit/custom-advanced-control",c.withAdvancedControls)},events:function(){n(document).on("focus click","textarea",c.copyPasteFocus)},copyPasteFocus:function(){var e=n(this);e.siblings("label").text()===i.copy_paste_settings&&e.select()},getFields:function(e){var t;return"wpforms/form-selector"!==(null==e?void 0:e.name)?null:(t=c.common.getSettingsFieldsHandlers(e),React.createElement(l,null,React.createElement("div",{className:c.common.getPanelClass(e)+" advanced"},React.createElement(s,{className:"wpforms-gutenberg-form-selector-custom-css",label:i.custom_css,rows:"5",spellCheck:"false",value:e.attributes.customCss,onChange:function(e){return t.attrChange("customCss",e)}}),React.createElement("div",{className:"wpforms-gutenberg-form-selector-legend",dangerouslySetInnerHTML:{__html:i.custom_css_notice}}),React.createElement(s,{className:"wpforms-gutenberg-form-selector-copy-paste-settings",label:i.copy_paste_settings,rows:"4",spellCheck:"false",value:e.attributes.copyPasteJsonValue,onChange:function(e){return t.pasteSettings(e)}}),React.createElement("div",{className:"wpforms-gutenberg-form-selector-legend",dangerouslySetInnerHTML:{__html:i.copy_paste_notice}}))))},withAdvancedControls:r(function(t){return function(e){return React.createElement(a,null,React.createElement(t,e),c.getFields(e))}},"withAdvancedControls")})},{}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("prop-types"))&&e.__esModule?e:{default:e};function n(e){var t=e.attributes,r=e.onRemoveBackground,n=e.onPreviewClicked,e=wp.components.Button,o=wpforms_gutenberg_form_selector.strings;return React.createElement("div",{className:"wpforms-gutenberg-form-selector-background-preview"},React.createElement("style",null,"\n\t\t\t\t\t.wpforms-gutenberg-form-selector-background-preview-image {\n\t\t\t\t\t\t--wpforms-background-url: ".concat(t.backgroundUrl,";\n\t\t\t\t\t}\n\t\t\t\t")),React.createElement("input",{className:"wpforms-gutenberg-form-selector-background-preview-image",onClick:n,tabIndex:0,type:"button",onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||n()}}),React.createElement(e,{isSecondary:!0,className:"is-destructive",onClick:r},o.remove_image))}n.propTypes={attributes:e.default.object.isRequired,onRemoveBackground:e.default.func.isRequired,onPreviewClicked:e.default.func.isRequired},r.default=n},{"prop-types":6}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=(e=e("./background-preview.js"))&&e.__esModule?e:{default:e};function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,l,s=[],i=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;i=!1}else for(;!(i=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{if(!i&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){var r;if(e)return"string"==typeof e?n(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}(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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var p,b,g,y,h,v,w,k,S,C,_,o,E,P,R,x;r.default=(p=(wp.blockEditor||wp.editor).PanelColorSettings,e=wp.components,b=e.SelectControl,g=e.PanelBody,y=e.Flex,h=e.FlexBlock,v=e.__experimentalUnitControl,w=e.TextControl,k=e.Button,e=wp.element,S=e.useState,C=e.useEffect,e=wpforms_gutenberg_form_selector,_=e.strings,o=e.defaults,E=e.isPro,P=e.isLicenseActive,R=!1,x={getBlockAttributes:function(){return{backgroundImage:{type:"string",default:o.backgroundImage},backgroundPosition:{type:"string",default:o.backgroundPosition},backgroundRepeat:{type:"string",default:o.backgroundRepeat},backgroundSizeMode:{type:"string",default:o.backgroundSizeMode},backgroundSize:{type:"string",default:o.backgroundSize},backgroundWidth:{type:"string",default:o.backgroundWidth},backgroundHeight:{type:"string",default:o.backgroundHeight},backgroundColor:{type:"string",default:o.backgroundColor},backgroundUrl:{type:"string",default:o.backgroundUrl}}},getBackgroundStyles:function(t,r,n,e){var o=m(S(x._showBackgroundPreview(t)),2),a=o[0],l=o[1],o=m(S(""),2),s=o[0],i=o[1],o=m(S(E&&P),2),c=o[0],o=(o[1],m(S(E),2)),u=o[0],o=(o[1],c?0:-1),f=n.getPanelClass(t)+(c?"":" wpforms-gutenberg-panel-disabled");return C(function(){l("none"!==t.attributes.backgroundImage&&t.attributes.backgroundUrl&&"url()"!==t.attributes.backgroundUrl)},[R,t.attributes.backgroundImage,t.attributes.backgroundUrl]),React.createElement(g,{className:f,title:_.background_styles},React.createElement("div",{className:"wpforms-gutenberg-form-selector-panel-body",onClick:function(e){if(!c){if(e.stopPropagation(),!u)return n.education.showProModal("background",_.background_styles);n.education.showLicenseModal("background",_.background_styles,"background-styles")}},onKeyDown:function(e){if(!c){if(e.stopPropagation(),!u)return n.education.showProModal("background",_.background_styles);n.education.showLicenseModal("background",_.background_styles,"background-styles")}}},React.createElement(y,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(h,null,React.createElement(b,{label:_.image,tabIndex:o,value:t.attributes.backgroundImage,options:[{label:_.none,value:"none"},{label:_.media_library,value:"library"},{label:_.stock_photo,value:"stock"}],onChange:function(e){return x.setContainerBackgroundImageWrapper(t,r,e,s,i)}})),React.createElement(h,null,("none"!==t.attributes.backgroundImage||!c)&&React.createElement(b,{label:_.position,value:t.attributes.backgroundPosition,tabIndex:o,options:[{label:_.top_left,value:"top left"},{label:_.top_center,value:"top center"},{label:_.top_right,value:"top right"},{label:_.center_left,value:"center left"},{label:_.center_center,value:"center center"},{label:_.center_right,value:"center right"},{label:_.bottom_left,value:"bottom left"},{label:_.bottom_center,value:"bottom center"},{label:_.bottom_right,value:"bottom right"}],disabled:"none"===t.attributes.backgroundImage&&c,onChange:function(e){return r.styleAttrChange("backgroundPosition",e)}}))),("none"!==t.attributes.backgroundImage||!c)&&React.createElement(y,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(h,null,React.createElement(b,{label:_.repeat,tabIndex:o,value:t.attributes.backgroundRepeat,options:[{label:_.no_repeat,value:"no-repeat"},{label:_.tile,value:"repeat"},{label:_.repeat_x,value:"repeat-x"},{label:_.repeat_y,value:"repeat-y"}],disabled:"none"===t.attributes.backgroundImage&&c,onChange:function(e){return r.styleAttrChange("backgroundRepeat",e)}})),React.createElement(h,null,React.createElement(b,{label:_.size,tabIndex:o,value:t.attributes.backgroundSizeMode,options:[{label:_.dimensions,value:"dimensions"},{label:_.cover,value:"cover"}],disabled:"none"===t.attributes.backgroundImage&&c,onChange:function(e){return x.handleSizeFromDimensions(t,r,e)}}))),("dimensions"===t.attributes.backgroundSizeMode&&"none"!==t.attributes.backgroundImage||!c)&&React.createElement(y,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(h,null,React.createElement(v,{label:_.width,tabIndex:o,value:t.attributes.backgroundWidth,isUnitSelectTabbable:c,onChange:function(e){return x.handleSizeFromWidth(t,r,e)}})),React.createElement(h,null,React.createElement(v,{label:_.height,tabIndex:o,value:t.attributes.backgroundHeight,isUnitSelectTabbable:c,onChange:function(e){return x.handleSizeFromHeight(t,r,e)}}))),(!a||"url()"===t.attributes.backgroundUrl)&&("library"===t.attributes.backgroundImage&&React.createElement(y,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(h,null,React.createElement(k,{isSecondary:!0,tabIndex:o,className:"wpforms-gutenberg-form-selector-media-library-button",onClick:x.openMediaLibrary.bind(null,t,r,l)},_.choose_image)))||"stock"===t.attributes.backgroundImage&&React.createElement(y,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(h,null,React.createElement(k,{isSecondary:!0,tabIndex:o,className:"wpforms-gutenberg-form-selector-media-library-button",onClick:null==e?void 0:e.openModal.bind(null,t,r,"bg-styles",l)},_.choose_image)))),(a&&"none"!==t.attributes.backgroundImage||"url()"!==t.attributes.backgroundUrl)&&React.createElement(y,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(h,null,React.createElement("div",null,React.createElement(d.default,{attributes:t.attributes,onRemoveBackground:function(){x.onRemoveBackground(l,r,i)},onPreviewClicked:function(){return"library"===t.attributes.backgroundImage?x.openMediaLibrary(t,r,l):null==e?void 0:e.openModal(t,r,"bg-styles",l)}})),React.createElement(w,{label:_.image_url,tabIndex:o,value:"none"!==t.attributes.backgroundImage&&t.attributes.backgroundUrl,className:"wpforms-gutenberg-form-selector-image-url",onChange:function(e){return r.styleAttrChange("backgroundUrl",e)},onLoad:function(e){return"none"!==t.attributes.backgroundImage&&r.styleAttrChange("backgroundUrl",e)}}))),React.createElement(y,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(h,null,React.createElement("div",{className:"wpforms-gutenberg-form-selector-control-label"},_.colors),React.createElement(p,{__experimentalIsRenderedInSidebar:!0,enableAlpha:!0,showTitle:!1,tabIndex:o,className:"wpforms-gutenberg-form-selector-color-panel",colorSettings:[{value:t.attributes.backgroundColor,onChange:function(e){c&&r.styleAttrChange("backgroundColor",e)},label:_.background}]})))))},openMediaLibrary:function(r,n,o){var a=wp.media({title:_.select_background_image,multiple:!1,library:{type:"image"},button:{text:_.select_image}});a.on("select",function(){var e=a.state().get("selection").first().toJSON(),t={};e.url&&(e="url(".concat(e.url,")"),t.backgroundUrl=e,r.setAttributes(t),n.styleAttrChange("backgroundUrl",e),o(!0))}),a.open()},setContainerBackgroundImage:function(e,t){return"none"===t&&e.style.setProperty("--wpforms-background-url","url()"),!0},setContainerBackgroundImageWrapper:function(e,t,r,n,o){"none"===r?(o(e.attributes.backgroundUrl),e.attributes.backgroundUrl="url()",t.styleAttrChange("backgroundUrl","url()")):n&&(e.attributes.backgroundUrl=n,t.styleAttrChange("backgroundUrl",n)),t.styleAttrChange("backgroundImage",r)},setContainerBackgroundPosition:function(e,t){return e.style.setProperty("--wpforms-background-position",t),!0},setContainerBackgroundRepeat:function(e,t){return e.style.setProperty("--wpforms-background-repeat",t),!0},handleSizeFromDimensions:function(e,t,r){"cover"===r?(e.attributes.backgroundSize="cover",t.styleAttrChange("backgroundWidth",e.attributes.backgroundWidth),t.styleAttrChange("backgroundHeight",e.attributes.backgroundHeight),t.styleAttrChange("backgroundSizeMode","cover"),t.styleAttrChange("backgroundSize","cover")):(e.attributes.backgroundSize="dimensions",t.styleAttrChange("backgroundSizeMode","dimensions"),t.styleAttrChange("backgroundSize",e.attributes.backgroundWidth+" "+e.attributes.backgroundHeight))},handleSizeFromWidth:function(e,t,r){e.attributes.backgroundSize=r+" "+e.attributes.backgroundHeight,e.attributes.backgroundWidth=r,t.styleAttrChange("backgroundSize",r+" "+e.attributes.backgroundHeight),t.styleAttrChange("backgroundWidth",r)},handleSizeFromHeight:function(e,t,r){e.attributes.backgroundSize=e.attributes.backgroundWidth+" "+r,e.attributes.backgroundHeight=r,t.styleAttrChange("backgroundSize",e.attributes.backgroundWidth+" "+r),t.styleAttrChange("backgroundHeight",r)},setContainerBackgroundWidth:function(e,t){return e.style.setProperty("--wpforms-background-width",t),!0},setContainerBackgroundHeight:function(e,t){return e.style.setProperty("--wpforms-background-height",t),!0},setBackgroundUrl:function(e,t){return e.style.setProperty("--wpforms-background-url",t),!0},setBackgroundColor:function(e,t){return e.style.setProperty("--wpforms-background-color",t),!0},_showBackgroundPreview:function(e){return"none"!==e.attributes.backgroundImage&&e.attributes.backgroundUrl&&"url()"!==e.attributes.backgroundUrl},onRemoveBackground:function(e,t,r){e(!1),t.styleAttrChange("backgroundUrl","url()"),r("")},onSetTheme:function(e){R="url()"!==e.attributes.backgroundImage}})},{"./background-preview.js":14}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o,a,l,s,i,c,u,n;r.default=(o=(wp.blockEditor||wp.editor).PanelColorSettings,r=wp.components,a=r.SelectControl,l=r.PanelBody,s=r.Flex,i=r.FlexBlock,c=r.__experimentalUnitControl,r=wpforms_gutenberg_form_selector,u=r.strings,n=r.defaults,{getBlockAttributes:function(){return{buttonSize:{type:"string",default:n.buttonSize},buttonBorderStyle:{type:"string",default:n.buttonBorderStyle},buttonBorderSize:{type:"string",default:n.buttonBorderSize},buttonBorderRadius:{type:"string",default:n.buttonBorderRadius},buttonBackgroundColor:{type:"string",default:n.buttonBackgroundColor},buttonTextColor:{type:"string",default:n.buttonTextColor},buttonBorderColor:{type:"string",default:n.buttonBorderColor}}},getButtonStyles:function(e,t,r,n){return React.createElement(l,{className:n.getPanelClass(e),title:u.button_styles},React.createElement(s,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(i,null,React.createElement(a,{label:u.size,value:e.attributes.buttonSize,options:r,onChange:function(e){return t.styleAttrChange("buttonSize",e)}})),React.createElement(i,null,React.createElement(a,{label:u.border,value:e.attributes.buttonBorderStyle,options:[{label:u.none,value:"none"},{label:u.solid,value:"solid"},{label:u.dashed,value:"dashed"},{label:u.dotted,value:"dotted"}],onChange:function(e){return t.styleAttrChange("buttonBorderStyle",e)}}))),React.createElement(s,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(i,null,React.createElement(c,{label:u.border_size,value:"none"===e.attributes.buttonBorderStyle?"":e.attributes.buttonBorderSize,min:0,disabled:"none"===e.attributes.buttonBorderStyle,onChange:function(e){return t.styleAttrChange("buttonBorderSize",e)},isUnitSelectTabbable:!0})),React.createElement(i,null,React.createElement(c,{onChange:function(e){return t.styleAttrChange("buttonBorderRadius",e)},label:u.border_radius,min:0,isUnitSelectTabbable:!0,value:e.attributes.buttonBorderRadius}))),React.createElement("div",{className:"wpforms-gutenberg-form-selector-color-picker"},React.createElement("div",{className:"wpforms-gutenberg-form-selector-control-label"},u.colors),React.createElement(o,{__experimentalIsRenderedInSidebar:!0,enableAlpha:!0,showTitle:!1,className:n.getColorPanelClass(e.attributes.buttonBorderStyle),colorSettings:[{value:e.attributes.buttonBackgroundColor,onChange:function(e){return t.styleAttrChange("buttonBackgroundColor",e)},label:u.background},{value:e.attributes.buttonBorderColor,onChange:function(e){return t.styleAttrChange("buttonBorderColor",e)},label:u.border},{value:e.attributes.buttonTextColor,onChange:function(e){return t.styleAttrChange("buttonTextColor",e)},label:u.text}]}),React.createElement("div",{className:"wpforms-gutenberg-form-selector-legend wpforms-button-color-notice"},u.button_color_notice)))}})},{}],17:[function(M,L,e){"use strict";function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function n(n){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?t(Object(o),!0).forEach(function(e){var t,r;t=n,r=o[e=e],(e=function(e){e=function(e,t){if("object"!=x(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=x(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==x(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function T(){T=function(){return l};var i,l={},e=Object.prototype,c=e.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(i){a=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var o,a,l,s,t=t&&t.prototype instanceof y?t:y,t=Object.create(t.prototype),n=new P(n||[]);return u(t,"_invoke",{value:(o=e,a=r,l=n,s=d,function(e,t){if(s===p)throw new Error("Generator is already running");if(s===b){if("throw"===e)throw t;return{value:i,done:!0}}for(l.method=e,l.arg=t;;){var r=l.delegate;if(r){r=function e(t,r){var n=r.method,o=t.iterator[n];if(o===i)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=i,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;n=f(o,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,g;o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=i),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}(r,l);if(r){if(r===g)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if(s===d)throw s=b,l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);s=p;r=f(o,a,l);if("normal"===r.type){if(s=l.done?b:m,r.arg===g)continue;return{value:r.arg,done:l.done}}"throw"===r.type&&(s=b,l.method="throw",l.arg=r.arg)}})}),t}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}l.wrap=s;var d="suspendedStart",m="suspendedYield",p="executing",b="completed",g={};function y(){}function h(){}function v(){}var t={},w=(a(t,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(R([]))),k=(w&&w!==e&&c.call(w,n)&&(t=w),v.prototype=y.prototype=Object.create(t));function S(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function C(l,s){var t;u(this,"_invoke",{value:function(r,n){function e(){return new s(function(e,t){!function t(e,r,n,o){var a,e=f(l[e],l,r);if("throw"!==e.type)return(r=(a=e.arg).value)&&"object"==x(r)&&c.call(r,"__await")?s.resolve(r.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):s.resolve(r).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,o)});o(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function R(t){if(t||""===t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(c.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=i,e.done=!0,e}).next=e}throw new TypeError(x(t)+" is not iterable")}return u(k,"constructor",{value:h.prototype=v,configurable:!0}),u(v,"constructor",{value:h,configurable:!0}),h.displayName=a(v,o,"GeneratorFunction"),l.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,a(e,o,"GeneratorFunction")),e.prototype=Object.create(k),e},l.awrap=function(e){return{__await:e}},S(C.prototype),a(C.prototype,r,function(){return this}),l.AsyncIterator=C,l.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var a=new C(s(e,t,r,n),o);return l.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},S(k),a(k,o,"Generator"),a(k,n,function(){return this}),a(k,"toString",function(){return"[object Generator]"}),l.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},l.values=R,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&c.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=i)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return a.type="throw",a.arg=r,n.next=e,t&&(n.method="next",n.arg=i),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],a=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var l=c.call(o,"catchLoc"),s=c.call(o,"finallyLoc");if(l&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&c.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var a=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,E(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:R(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=i),g}},l}function i(e,t,r,n,o,a,l){try{var s=e[a](l),i=s.value}catch(e){return void r(e)}s.done?t(i):Promise.resolve(i).then(n,o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a,l,s,c,o,r,u,f,z,d,m,p,b,g,U,y,h,$,v,w,k,S,C,E,P,R,j,B,I,O,A,N,F;e.default=(a=document,l=window,s=jQuery,e=wp.serverSideRender,o=void 0===e?wp.components.ServerSideRender:e,e=wp.element,r=e.createElement,u=e.Fragment,f=e.createInterpolateElement,z=wp.blocks.registerBlockType,e=wp.blockEditor||wp.editor,d=e.InspectorControls,m=e.PanelColorSettings,e=wp.components,p=e.SelectControl,b=e.ToggleControl,g=e.PanelBody,U=e.Placeholder,y=wp.i18n.__,e=wpforms_gutenberg_form_selector,h=e.strings,$=e.defaults,v=e.sizes,w=e.urls,k=e.isPro,S=e.isLicenseActive,C=$,l.WPFormsEducation,E=wpforms_gutenberg_form_selector.forms,P={},R=!0,B=!(j={}),I={},O={clientId:{type:"string",default:""},formId:{type:"string",default:C.formId},displayTitle:{type:"boolean",default:C.displayTitle},displayDesc:{type:"boolean",default:C.displayDesc},preview:{type:"boolean"},theme:{type:"string",default:C.theme},themeName:{type:"string",default:C.themeName},labelSize:{type:"string",default:C.labelSize},labelColor:{type:"string",default:C.labelColor},labelSublabelColor:{type:"string",default:C.labelSublabelColor},labelErrorColor:{type:"string",default:C.labelErrorColor},pageBreakColor:{type:"string",default:C.pageBreakColor},customCss:{type:"string",default:C.customCss},copyPasteJsonValue:{type:"string",default:C.copyPasteJsonValue}},N=!(A={}),F={panels:{},init:function(e){I.$window=s(l),F.panels=e.panels,F.education=e.education,F.initDefaults(e),F.registerBlock(e),F.initJConfirm(),s(F.ready)},ready:function(){F.events()},events:function(){I.$window.on("wpformsFormSelectorEdit",_.debounce(F.blockEdit,250)).on("wpformsFormSelectorFormLoaded",F.formLoaded)},initJConfirm:function(){jconfirm.defaults={closeIcon:!1,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",animateFromElement:!1}},getForms:function(){return s=T().mark(function e(){return T().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(B)return e.abrupt("return");e.next=2;break;case 2:return B=!0,e.prev=3,e.next=6,wp.apiFetch({path:wpforms_gutenberg_form_selector.route_namespace+"forms/",method:"GET",cache:"no-cache"});case 6:E=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),console.error(e.t0);case 12:return e.prev=12,B=!1,e.finish(12);case 15:case"end":return e.stop()}},e,null,[[3,9,12,15]])}),function(){var e=this,l=arguments;return new Promise(function(t,r){var n=s.apply(e,l);function o(e){i(n,t,r,o,a,"next",e)}function a(e){i(n,t,r,o,a,"throw",e)}o(void 0)})}();var s},openBuilderPopup:function(e){s.isEmptyObject(j)&&(r=s("#wpwrap"),t=s('iframe[name="editor-canvas"]'),t=Boolean(t.length)?t.contents().find("#wpforms-gutenberg-popup"):s("#wpforms-gutenberg-popup"),r.after(t),j=r.siblings("#wpforms-gutenberg-popup"));var t=wpforms_gutenberg_form_selector.get_started_url,r=j.find("iframe");F.builderCloseButtonEvent(e),r.attr("src",t),j.fadeIn()},builderCloseButtonEvent:function(o){j.off("wpformsBuilderInPopupClose").on("wpformsBuilderInPopupClose",function(e,t,r,n){"saved"===t&&r&&(t=wp.blocks.createBlock("wpforms/form-selector",{formId:r.toString()}),E=[{ID:r,post_title:n}],wp.data.dispatch("core/block-editor").removeBlock(o),wp.data.dispatch("core/block-editor").insertBlocks(t))})},registerBlock:function(l){z("wpforms/form-selector",{title:h.title,description:h.description,icon:F.getIcon(),keywords:h.form_keywords,category:"widgets",attributes:F.getBlockAttributes(),supports:{customClassName:F.hasForms()},example:{attributes:{preview:!0}},edit:function(e){var t,r=e.attributes,n=F.getFormOptions(),o=F.getSettingsFieldsHandlers(e),a=(r.clientId&&F.isClientIdAttrUnique(e)||e.setAttributes({clientId:e.clientId}),[F.jsxParts.getMainSettings(r,o,n)]);return F.hasForms()?(t=F.getSizeOptions(),r&&r.formId&&!1===F.isFormAvailable(r.formId)?a.push(F.jsxParts.getBlockPlaceholder(e.attributes,o,n)):r.formId?(F.maybeSubscribeToBlockEvents(e,o,l),a.push(F.jsxParts.getStyleSettings(e,o,t,l),F.jsxParts.getBlockFormContent(e)),N||(o.updateCopyPasteContent(),N=!0),I.$window.trigger("wpformsFormSelectorEdit",[e])):r.preview?a.push(F.jsxParts.getBlockPreview()):a.push(F.jsxParts.getBlockPlaceholder(e.attributes,o,n))):a.push(F.jsxParts.getEmptyFormsPreview(e)),a},save:function(){return null}})},initDefaults:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};O=n(n({},O),e.getCommonAttributes()),A=e.setStylesHandlers,["formId","copyPasteJsonValue"].forEach(function(e){return delete C[e]})},hasForms:function(){return 0<E.length},isFormAvailable:function(t){return void 0!==E.find(function(e){return e.ID===Number(t)})},setTriggerServerRender:function(e){R=Boolean(e)},maybeSubscribeToBlockEvents:function(e,t,r){var n=e.clientId;I.$window.off("wpformsFormSelectorDeleteTheme."+n).off("wpformsFormSelectorUpdateTheme."+n).off("wpformsFormSelectorSetTheme."+n),I.$window.on("wpformsFormSelectorDeleteTheme."+n,F.subscriberDeleteTheme(e,r)).on("wpformsFormSelectorUpdateTheme."+n,F.subscriberUpdateTheme(e,r)).on("wpformsFormSelectorSetTheme."+n,F.subscriberSetTheme(e,r))},subscriberDeleteTheme:function(n,o){return function(e,t,r){n.clientId!==r.clientId&&(null==n||null==(r=n.attributes)?void 0:r.theme)===t&&null!=o&&null!=(r=o.panels)&&r.themes&&o.panels.themes.setBlockTheme(n,"default")}},subscriberUpdateTheme:function(o,a){return function(e,t,r,n){o.clientId!==n.clientId&&(null==o||null==(n=o.attributes)?void 0:n.theme)===t&&null!=a&&null!=(n=a.panels)&&n.themes&&a.panels.themes.setBlockTheme(o,t)}},subscriberSetTheme:function(o,a){return function(e,t,r,n){o.clientId!==n.clientId&&null!=a&&null!=(n=a.panels)&&n.themes&&a.panels.background.onSetTheme(o)}},jsxParts:{getMainSettings:function(e,t,r){return F.hasForms()?React.createElement(d,{key:"wpforms-gutenberg-form-selector-inspector-main-settings"},React.createElement(g,{className:"wpforms-gutenberg-panel wpforms-gutenberg-panel-form-settings",title:h.form_settings},React.createElement(p,{label:h.form_selected,value:e.formId,options:r,onChange:function(e){return t.attrChange("formId",e)}}),e.formId?React.createElement("p",{className:"wpforms-gutenberg-form-selector-actions"},React.createElement("a",{href:w.form_url.replace("{ID}",e.formId),rel:"noreferrer",target:"_blank"},h.form_edit),k&&S&&React.createElement(React.Fragment,null," | ",React.createElement("a",{href:w.entries_url.replace("{ID}",e.formId),rel:"noreferrer",target:"_blank"},h.form_entries))):null,React.createElement(b,{label:h.show_title,checked:e.displayTitle,onChange:function(e){return t.attrChange("displayTitle",e)}}),React.createElement(b,{label:h.show_description,checked:e.displayDesc,onChange:function(e){return t.attrChange("displayDesc",e)}}),React.createElement("p",{className:"wpforms-gutenberg-panel-notice"},React.createElement("strong",null,h.panel_notice_head),h.panel_notice_text,React.createElement("a",{href:h.panel_notice_link,rel:"noreferrer",target:"_blank"},h.panel_notice_link_text)))):F.jsxParts.printEmptyFormsNotice(e.clientId)},printEmptyFormsNotice:function(e){return React.createElement(d,{key:"wpforms-gutenberg-form-selector-inspector-main-settings"},React.createElement(g,{className:"wpforms-gutenberg-panel",title:h.form_settings},React.createElement("p",{className:"wpforms-gutenberg-panel-notice wpforms-warning wpforms-empty-form-notice",style:{display:"block"}},React.createElement("strong",null,y("You haven’t created a form, yet!","wpforms-lite")),y("What are you waiting for?","wpforms-lite")),React.createElement("button",{type:"button",className:"get-started-button components-button is-secondary",onClick:function(){F.openBuilderPopup(e)}},y("Get Started","wpforms-lite"))))},getLabelStyles:function(e,t,r){return React.createElement(g,{className:F.getPanelClass(e),title:h.label_styles},React.createElement(p,{label:h.size,value:e.attributes.labelSize,className:"wpforms-gutenberg-form-selector-fix-bottom-margin",options:r,onChange:function(e){return t.styleAttrChange("labelSize",e)}}),React.createElement("div",{className:"wpforms-gutenberg-form-selector-color-picker"},React.createElement("div",{className:"wpforms-gutenberg-form-selector-control-label"},h.colors),React.createElement(m,{__experimentalIsRenderedInSidebar:!0,enableAlpha:!0,showTitle:!1,className:"wpforms-gutenberg-form-selector-color-panel",colorSettings:[{value:e.attributes.labelColor,onChange:function(e){return t.styleAttrChange("labelColor",e)},label:h.label},{value:e.attributes.labelSublabelColor,onChange:function(e){return t.styleAttrChange("labelSublabelColor",e)},label:h.sublabel_hints.replace("&","&")},{value:e.attributes.labelErrorColor,onChange:function(e){return t.styleAttrChange("labelErrorColor",e)},label:h.error_message}]})))},getPageIndicatorStyles:function(e,t){var r,n=F.hasPageBreak(E,e.attributes.formId),o=F.hasRating(E,e.attributes.formId);return n||o?(r="",n&&o?r="".concat(h.page_break," / ").concat(h.rating):n?r=h.page_break:o&&(r=h.rating),React.createElement(g,{className:F.getPanelClass(e),title:h.other_styles},React.createElement("div",{className:"wpforms-gutenberg-form-selector-color-picker"},React.createElement("div",{className:"wpforms-gutenberg-form-selector-control-label"},h.colors),React.createElement(m,{__experimentalIsRenderedInSidebar:!0,enableAlpha:!0,showTitle:!1,className:"wpforms-gutenberg-form-selector-color-panel",colorSettings:[{value:e.attributes.pageBreakColor,onChange:function(e){return t.styleAttrChange("pageBreakColor",e)},label:r}]})))):null},getStyleSettings:function(e,t,r,n){return React.createElement(d,{key:"wpforms-gutenberg-form-selector-style-settings"},n.getThemesPanel(e,F,n.stockPhotos),n.getFieldStyles(e,t,r,F),F.jsxParts.getLabelStyles(e,t,r),n.getButtonStyles(e,t,r,F),n.getContainerStyles(e,t,F),n.getBackgroundStyles(e,t,F,n.stockPhotos),F.jsxParts.getPageIndicatorStyles(e,t))},getBlockFormContent:function(e){var t,r;return R?React.createElement(o,{key:"wpforms-gutenberg-form-selector-server-side-renderer",block:"wpforms/form-selector",attributes:e.attributes}):(t=e.clientId,null!=(r=F.getBlockContainer(e))&&r.innerHTML?(P[t]=P[t]||{},P[t].blockHTML=r.innerHTML,P[t].loadedFormId=e.attributes.formId,React.createElement(u,{key:"wpforms-gutenberg-form-selector-fragment-form-html"},React.createElement("div",{dangerouslySetInnerHTML:{__html:P[t].blockHTML}}))):(R=!0,F.jsxParts.getBlockFormContent(e)))},getBlockPreview:function(){return React.createElement(u,{key:"wpforms-gutenberg-form-selector-fragment-block-preview"},React.createElement("img",{src:wpforms_gutenberg_form_selector.block_preview_url,style:{width:"100%"},alt:""}))},getEmptyFormsPreview:function(e){var t=e.clientId;return React.createElement(u,{key:"wpforms-gutenberg-form-selector-fragment-block-empty"},React.createElement("div",{className:"wpforms-no-form-preview"},React.createElement("img",{src:wpforms_gutenberg_form_selector.block_empty_url,alt:""}),React.createElement("p",null,f(y("You can use <b>WPForms</b> to build contact forms, surveys, payment forms, and more with just a few clicks.","wpforms-lite"),{b:React.createElement("strong",null)})),React.createElement("button",{type:"button",className:"get-started-button components-button is-primary",onClick:function(){F.openBuilderPopup(t)}},y("Get Started","wpforms-lite")),React.createElement("p",{className:"empty-desc"},f(y("Need some help? Check out our <a>comprehensive guide.</a>","wpforms-lite"),{a:React.createElement("a",{href:wpforms_gutenberg_form_selector.wpforms_guide,target:"_blank",rel:"noopener noreferrer"})})),React.createElement("div",{id:"wpforms-gutenberg-popup",className:"wpforms-builder-popup"},React.createElement("iframe",{src:"about:blank",width:"100%",height:"100%",id:"wpforms-builder-iframe",title:"WPForms Builder Popup"}))))},getBlockPlaceholder:function(e,t,r){var n=e.formId&&!F.isFormAvailable(e.formId);return React.createElement(U,{key:"wpforms-gutenberg-form-selector-wrap",className:"wpforms-gutenberg-form-selector-wrap"},React.createElement("img",{src:wpforms_gutenberg_form_selector.logo_url,alt:""}),n&&React.createElement("p",{style:{textAlign:"center",marginTop:"0"}},h.form_not_available_message),React.createElement(p,{key:"wpforms-gutenberg-form-selector-select-control",value:e.formId,options:r,onChange:function(e){return t.attrChange("formId",e)}}))}},hasPageBreak:function(e,t){var e=e.find(function(e){return parseInt(e.ID,10)===parseInt(t,10)});return!!e.post_content&&(e=null==(e=JSON.parse(e.post_content))?void 0:e.fields,Object.values(e).some(function(e){return"pagebreak"===e.type}))},hasRating:function(e,t){var e=e.find(function(e){return parseInt(e.ID,10)===parseInt(t,10)});return!!(e.post_content&&k&&S)&&(e=null==(e=JSON.parse(e.post_content))?void 0:e.fields,Object.values(e).some(function(e){return"rating"===e.type}))},getPanelClass:function(e){e="wpforms-gutenberg-panel wpforms-block-settings-"+e.clientId;return F.isFullStylingEnabled()||(e+=" disabled_panel"),e},getColorPanelClass:function(e){var t="wpforms-gutenberg-form-selector-color-panel";return"none"===e&&(t+=" wpforms-gutenberg-form-selector-border-color-disabled"),t},isFullStylingEnabled:function(){return wpforms_gutenberg_form_selector.is_modern_markup&&wpforms_gutenberg_form_selector.is_full_styling},isLeadFormsEnabled:function(e){return!!e&&s(e.querySelector(".wpforms-container")).hasClass("wpforms-lead-forms-container")},getBlockContainer:function(e){var t,e="#block-".concat(e.clientId," > div"),r=a.querySelector(e);return r=r?r:null==(t=a.querySelector('iframe[name="editor-canvas"]'))?void 0:t.contentWindow.document.querySelector(e)},updatePreviewCSSVarValue:function(e,t,r,n){if(r&&e){var o=e.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())});if("function"==typeof A[o])A[o](r,t);else switch(o){case"field-size":case"label-size":case"button-size":case"container-shadow-size":for(var a in v[o][t])r.style.setProperty("--wpforms-".concat(o,"-").concat(a),v[o][t][a]);break;case"field-border-style":"none"===t?F.toggleFieldBorderNoneCSSVarValue(r,!0):(F.toggleFieldBorderNoneCSSVarValue(r,!1),r.style.setProperty("--wpforms-".concat(o),t));break;case"button-background-color":F.maybeUpdateAccentColor(n.attributes.buttonBorderColor,t,r),t=F.maybeSetButtonAltBackgroundColor(t,n.attributes.buttonBorderColor,r),F.maybeSetButtonAltTextColor(n.attributes.buttonTextColor,t,n.attributes.buttonBorderColor,r),r.style.setProperty("--wpforms-".concat(o),t);break;case"button-border-color":F.maybeUpdateAccentColor(t,n.attributes.buttonBackgroundColor,r),F.maybeSetButtonAltTextColor(n.attributes.buttonTextColor,n.attributes.buttonBackgroundColor,t,r),r.style.setProperty("--wpforms-".concat(o),t);break;case"button-text-color":F.maybeSetButtonAltTextColor(t,n.attributes.buttonBackgroundColor,n.attributes.buttonBorderColor,r),r.style.setProperty("--wpforms-".concat(o),t);break;default:r.style.setProperty("--wpforms-".concat(o),t),r.style.setProperty("--wpforms-".concat(o,"-spare"),t)}}},toggleFieldBorderNoneCSSVarValue:function(e,t){e=e.querySelector("form");t?(e.style.setProperty("--wpforms-field-border-style","solid"),e.style.setProperty("--wpforms-field-border-size","1px"),e.style.setProperty("--wpforms-field-border-color","transparent")):(e.style.setProperty("--wpforms-field-border-style",null),e.style.setProperty("--wpforms-field-border-size",null),e.style.setProperty("--wpforms-field-border-color",null))},maybeSetButtonAltBackgroundColor:function(e,t,r){return r.querySelector("form").style.setProperty("--wpforms-button-background-color-alt",e),WPFormsUtils.cssColorsUtils.isTransparentColor(e)?WPFormsUtils.cssColorsUtils.isTransparentColor(t)?C.buttonBackgroundColor:t:e},maybeSetButtonAltTextColor:function(e,t,r,n){var o=n.querySelector("form"),a=null;e=e.toLowerCase(),(WPFormsUtils.cssColorsUtils.isTransparentColor(e)||e===t||WPFormsUtils.cssColorsUtils.isTransparentColor(t)&&e===r)&&(a=WPFormsUtils.cssColorsUtils.getContrastColor(t)),n.style.setProperty("--wpforms-button-text-color-alt",e),o.style.setProperty("--wpforms-button-text-color-alt",a)},maybeUpdateAccentColor:function(e,t,r){var n=r.querySelector("form");e=WPFormsUtils.cssColorsUtils.isTransparentColor(e)?C.buttonBackgroundColor:e,WPFormsUtils.cssColorsUtils.isTransparentColor(t)?(n.style.setProperty("--wpforms-button-background-color-alt","rgba( 0, 0, 0, 0 )"),n.style.setProperty("--wpforms-button-background-color",e)):(r.style.setProperty("--wpforms-button-background-color-alt",t),n.style.setProperty("--wpforms-button-background-color-alt",null),n.style.setProperty("--wpforms-button-background-color",null))},getSettingsFieldsHandlers:function(l){return{styleAttrChange:function(e,t){var r,n=F.getBlockContainer(l),o=n.querySelector("#wpforms-".concat(l.attributes.formId)),a={};e.includes("Color")&&(t=null!=(r=t)?r:"rgba( 0, 0, 0, 0 )"),F.updatePreviewCSSVarValue(e,t,o,l),a[e]=t,F.setBlockRuntimeStateVar(l.clientId,"prevAttributesState",l.attributes),l.setAttributes(a),R=!1,this.updateCopyPasteContent(),F.panels.themes.updateCustomThemeAttribute(e,t,l),this.maybeToggleDropdown(l,e),I.$window.trigger("wpformsFormSelectorStyleAttrChange",[n,l,e,t])},maybeToggleDropdown:function(e,t){var r=this,n=e.attributes.formId,e=a.querySelector("#wpforms-form-".concat(n," .choices__list.choices__list--dropdown")),o=a.querySelector("#wpforms-form-".concat(n," .wpforms-field-select-style-classic select"));"fieldMenuColor"===t?(e?(e.classList.add("is-active"),e.parentElement.classList.add("is-open")):this.showClassicMenu(o),clearTimeout(c),c=setTimeout(function(){var e=a.querySelector("#wpforms-form-".concat(n," .choices__list.choices__list--dropdown"));e?(e.classList.remove("is-active"),e.parentElement.classList.remove("is-open")):r.hideClassicMenu(a.querySelector("#wpforms-form-".concat(n," .wpforms-field-select-style-classic select")))},5e3)):e?e.classList.remove("is-active"):this.hideClassicMenu(o)},showClassicMenu:function(e){e&&(e.size=2,e.style.cssText="padding-top: 40px; padding-inline-end: 0; padding-inline-start: 0; position: relative;",e.querySelectorAll("option").forEach(function(e){e.style.cssText="border-left: 1px solid #8c8f94; border-right: 1px solid #8c8f94; padding: 0 10px; z-index: 999999; position: relative;"}),e.querySelector("option:last-child").style.cssText="border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; padding: 0 10px; border-left: 1px solid #8c8f94; border-right: 1px solid #8c8f94; border-bottom: 1px solid #8c8f94; z-index: 999999; position: relative;")},hideClassicMenu:function(e){e&&(e.size=0,e.style.cssText="padding-top: 0; padding-inline-end: 24px; padding-inline-start: 12px; position: relative;",e.querySelectorAll("option").forEach(function(e){e.style.cssText="border: none;"}))},attrChange:function(e,t){var r={};r[e]=t,F.setBlockRuntimeStateVar(l.clientId,"prevAttributesState",l.attributes),l.setAttributes(r),R=!0,this.updateCopyPasteContent()},updateCopyPasteContent:function(){var e,t={},r=wp.data.select("core/block-editor").getBlockAttributes(l.clientId);for(e in C)t[e]=r[e];l.setAttributes({copyPasteJsonValue:JSON.stringify(t)})},pasteSettings:function(e){e=e.trim();var t=F.parseValidateJson(e);t?(t.copyPasteJsonValue=e,e=F.panels.themes.maybeCreateCustomThemeFromAttributes(t),F.setBlockRuntimeStateVar(l.clientId,"prevAttributesState",l.attributes),l.setAttributes(t),F.panels.themes.setBlockTheme(l,e),R=!1):(wp.data.dispatch("core/notices").createErrorNotice(h.copy_paste_error,{id:"wpforms-json-parse-error"}),this.updateCopyPasteContent())}}},parseValidateJson:function(e){if("string"!=typeof e)return!1;var t;try{t=JSON.parse(e.trim())}catch(e){t=!1}return t},getIcon:function(){return r("svg",{width:20,height:20,viewBox:"0 0 612 612",className:"dashicon"},r("path",{fill:"currentColor",d:"M544,0H68C30.445,0,0,30.445,0,68v476c0,37.556,30.445,68,68,68h476c37.556,0,68-30.444,68-68V68 C612,30.445,581.556,0,544,0z M464.44,68L387.6,120.02L323.34,68H464.44z M288.66,68l-64.26,52.02L147.56,68H288.66z M544,544H68 V68h22.1l136,92.14l79.9-64.6l79.56,64.6l136-92.14H544V544z M114.24,263.16h95.88v-48.28h-95.88V263.16z M114.24,360.4h95.88 v-48.62h-95.88V360.4z M242.76,360.4h255v-48.62h-255V360.4L242.76,360.4z M242.76,263.16h255v-48.28h-255V263.16L242.76,263.16z M368.22,457.3h129.54V408H368.22V457.3z"}))},getWPFormsBlocks:function(){return wp.data.select("core/block-editor").getBlocks().filter(function(e){return"wpforms/form-selector"===e.name})},isClientIdAttrUnique:function(e){var t,r=F.getWPFormsBlocks();for(t in r)if(r[t].clientId!==e.clientId&&r[t].attributes.clientId===e.attributes.clientId)return!1;return!0},getBlockAttributes:function(){return O},getBlockRuntimeStateVar:function(e,t){return null==(e=P[e])?void 0:e[t]},setBlockRuntimeStateVar:function(e,t,r){return!(!e||!t||(P[e]=P[e]||{},"object"!==x(P[e][t]=r)||Array.isArray(r)||null===r||(P[e][t]=n({},r)),0))},getFormOptions:function(){var e=E.map(function(e){return{value:e.ID,label:e.post_title}});return e.unshift({value:"",label:h.form_select}),e},getSizeOptions:function(){return[{label:h.small,value:"small"},{label:h.medium,value:"medium"},{label:h.large,value:"large"}]},blockEdit:function(e,t){t=F.getBlockContainer(t);null!=t&&t.dataset&&F.initLeadFormSettings(t.parentElement)},initLeadFormSettings:function(e){var t;null!=e&&e.dataset&&F.isFullStylingEnabled()&&(t=e.dataset.block,t=s(".wpforms-block-settings-".concat(t)),F.isLeadFormsEnabled(e)?(t.addClass("disabled_panel").find(".wpforms-gutenberg-panel-notice.wpforms-lead-form-notice").css("display","block"),t.find(".wpforms-gutenberg-panel-notice.wpforms-use-modern-notice").css("display","none")):(t.removeClass("disabled_panel").find(".wpforms-gutenberg-panel-notice.wpforms-lead-form-notice").css("display","none"),t.find(".wpforms-gutenberg-panel-notice.wpforms-use-modern-notice").css("display",null)))},formLoaded:function(e){F.initLeadFormSettings(e.detail.block),F.updateAccentColors(e.detail),F.loadChoicesJS(e.detail),F.initRichTextField(e.detail.formId),F.initRepeaterField(e.detail.formId),s(e.detail.block).off("click").on("click",F.blockClick)},blockClick:function(e){F.initLeadFormSettings(e.currentTarget)},updateAccentColors:function(e){var t;wpforms_gutenberg_form_selector.is_modern_markup&&null!=(t=l.WPForms)&&t.FrontendModern&&null!=e&&e.block&&(t=s(e.block.querySelector("#wpforms-".concat(e.formId))),(e=l.WPForms.FrontendModern).updateGBBlockPageIndicatorColor(t),e.updateGBBlockIconChoicesColor(t),e.updateGBBlockRatingColor(t))},loadChoicesJS:function(e){"function"==typeof l.Choices&&s(e.block.querySelector("#wpforms-".concat(e.formId))).find(".choicesjs-select").each(function(e,t){var r=s(t);if("active"!==r.data("choice")){var n=l.wpforms_choicesjs_config||{},o=r.data("search-enabled"),a=r.closest(".wpforms-field");n.searchEnabled=void 0===o||o,n.callbackOnInit=function(){var e=s(this.passedElement.element),t=s(this.input.element),r=e.data("size-class");r&&s(this.containerOuter.element).addClass(r),e.prop("multiple")&&(t.data("placeholder",t.attr("placeholder")),this.getValue(!0).length)&&t.hide(),this.disable(),a.find(".is-disabled").removeClass("is-disabled")};try{t instanceof parent.HTMLSelectElement||Object.setPrototypeOf(t,parent.HTMLSelectElement.prototype),r.data("choicesjs",new parent.Choices(t,n))}catch(e){}}})},initRichTextField:function(e){s("#wpforms-".concat(e," .wp-editor-wrap")).removeClass("html-active").addClass("tmce-active")},initRepeaterField:function(e){s("#wpforms-".concat(e," .wpforms-field-repeater > .wpforms-field-repeater-display-rows .wpforms-field-repeater-display-rows-buttons")).each(function(){var e=s(this),t=e.siblings(".wpforms-layout-column").find(".wpforms-field").first().find(".wpforms-field-label"),r=l.getComputedStyle(t.get(0)),r=(null==r?void 0:r.getPropertyValue("--wpforms-field-size-input-spacing"))||0,t=(t.outerHeight()||0)+parseInt(r,10)+10;e.css({top:t})}),s('.wpforms-form[data-formid="'.concat(e,'"]')).each(function(){var e=s(this).find(".wpforms-field-repeater");e.find(".wpforms-field-repeater-display-rows-buttons").addClass("wpforms-init"),e.find(".wpforms-field-repeater-display-rows:last .wpforms-field-description").addClass("wpforms-init")})}})},{}],18:[function(e,t,r){"use strict";function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,l,s=[],i=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;i=!1}else for(;!(i=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{if(!i&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){var r;if(e)return"string"==typeof e?n(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}(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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o,s,i,c,u,f,d,m,p,a,b,g,y;r.default=(o=jQuery,s=(wp.blockEditor||wp.editor).PanelColorSettings,r=wp.components,i=r.SelectControl,c=r.PanelBody,u=r.Flex,f=r.FlexBlock,d=r.__experimentalUnitControl,m=wp.element.useState,r=wpforms_gutenberg_form_selector,p=r.strings,a=r.defaults,b=r.isPro,g=r.isLicenseActive,y={init:function(){o(y.ready)},ready:function(){y.events()},events:function(){},getBlockAttributes:function(){return{containerPadding:{type:"string",default:a.containerPadding},containerBorderStyle:{type:"string",default:a.containerBorderStyle},containerBorderWidth:{type:"string",default:a.containerBorderWidth},containerBorderColor:{type:"string",default:a.containerBorderColor},containerBorderRadius:{type:"string",default:a.containerBorderRadius},containerShadowSize:{type:"string",default:a.containerShadowSize}}},getContainerStyles:function(e,t,r){var n=l(m(b&&g),2),o=n[0],n=(n[1],l(m(b),2)),a=n[0],n=(n[1],r.getPanelClass(e));return o||(n+=" wpforms-gutenberg-panel-disabled"),React.createElement(c,{className:n,title:p.container_styles},React.createElement("div",{className:"wpforms-gutenberg-form-selector-panel-body",onClick:function(e){if(!o){if(e.stopPropagation(),!a)return r.education.showProModal("container",p.container_styles);r.education.showLicenseModal("container",p.container_styles,"container-styles")}},onKeyDown:function(e){if(!o){if(e.stopPropagation(),!a)return r.education.showProModal("container",p.container_styles);r.education.showLicenseModal("container",p.container_styles,"container-styles")}}},React.createElement(u,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(f,null,React.createElement(d,{label:p.padding,tabIndex:o?0:-1,value:e.attributes.containerPadding,min:0,isUnitSelectTabbable:o,onChange:function(e){return t.styleAttrChange("containerPadding",e)}})),React.createElement(f,null,React.createElement(i,{label:p.border_style,tabIndex:o?0:-1,value:e.attributes.containerBorderStyle,options:[{label:p.none,value:"none"},{label:p.solid,value:"solid"},{label:p.dotted,value:"dotted"},{label:p.dashed,value:"dashed"},{label:p.double,value:"double"}],onChange:function(e){return t.styleAttrChange("containerBorderStyle",e)}}))),React.createElement(u,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(f,null,React.createElement(d,{label:p.border_width,tabIndex:o?0:-1,value:"none"===e.attributes.containerBorderStyle?"":e.attributes.containerBorderWidth,min:0,disabled:"none"===e.attributes.containerBorderStyle,isUnitSelectTabbable:o,onChange:function(e){return t.styleAttrChange("containerBorderWidth",e)}})),React.createElement(f,null,React.createElement(d,{label:p.border_radius,tabIndex:o?0:-1,value:e.attributes.containerBorderRadius,min:0,isUnitSelectTabbable:o,onChange:function(e){return t.styleAttrChange("containerBorderRadius",e)}}))),React.createElement(u,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(f,null,React.createElement(i,{label:p.shadow_size,tabIndex:o?0:-1,value:e.attributes.containerShadowSize,options:[{label:p.none,value:"none"},{label:p.small,value:"small"},{label:p.medium,value:"medium"},{label:p.large,value:"large"}],onChange:function(e){return t.styleAttrChange("containerShadowSize",e)}}))),React.createElement(u,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(f,null,React.createElement("div",{className:"wpforms-gutenberg-form-selector-control-label"},p.colors),React.createElement(s,{__experimentalIsRenderedInSidebar:!0,enableAlpha:!0,showTitle:!1,tabIndex:o?0:-1,className:"none"===e.attributes.containerBorderStyle?"wpforms-gutenberg-form-selector-color-panel wpforms-gutenberg-form-selector-color-panel-disabled":"wpforms-gutenberg-form-selector-color-panel",colorSettings:[{value:e.attributes.containerBorderColor,onChange:function(e){o&&t.styleAttrChange("containerBorderColor",e)},label:p.border_color}]})))))}})},{}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a;r.default=(a=jQuery,{showProModal:function(e,t){var r="pro",n=wpforms_education.upgrade.pro.message_plural.replace(/%name%/g,t),o={container:"Upgrade to Pro - Container Styles",background:"Upgrade to Pro - Background Styles",themes:"Upgrade to Pro - Themes"};a.alert({backgroundDismiss:!0,title:t+" "+wpforms_education.upgrade.pro.title_plural,icon:"fa fa-lock",content:n,boxWidth:"550px",theme:"modern,wpforms-education",closeIcon:!0,onOpenBefore:function(){this.$btnc.after('<div class="discount-note">'+wpforms_education.upgrade_bonus+"</div>"),this.$btnc.after(wpforms_education.upgrade.pro.doc.replace(/%25name%25/g,"AP - "+t)),this.$body.find(".jconfirm-content").addClass("lite-upgrade")},buttons:{confirm:{text:wpforms_education.upgrade.pro.button,btnClass:"btn-confirm",keys:["enter"],action:function(){window.open(WPFormsEducation.core.getUpgradeURL(o[e],r),"_blank"),WPFormsEducation.core.upgradeModalThankYou(r)}}}})},showLicenseModal:function(e,t,r){WPFormsEducation.proCore.licenseModal(e,t,r)}})},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o,a,l,s,i,c,u,n;r.default=(o=(wp.blockEditor||wp.editor).PanelColorSettings,r=wp.components,a=r.SelectControl,l=r.PanelBody,s=r.Flex,i=r.FlexBlock,c=r.__experimentalUnitControl,r=wpforms_gutenberg_form_selector,u=r.strings,n=r.defaults,{getBlockAttributes:function(){return{fieldSize:{type:"string",default:n.fieldSize},fieldBorderStyle:{type:"string",default:n.fieldBorderStyle},fieldBorderSize:{type:"string",default:n.fieldBorderSize},fieldBorderRadius:{type:"string",default:n.fieldBorderRadius},fieldBackgroundColor:{type:"string",default:n.fieldBackgroundColor},fieldBorderColor:{type:"string",default:n.fieldBorderColor},fieldTextColor:{type:"string",default:n.fieldTextColor},fieldMenuColor:{type:"string",default:n.fieldMenuColor}}},getFieldStyles:function(e,t,r,n){return React.createElement(l,{className:n.getPanelClass(e),title:u.field_styles},React.createElement(s,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(i,null,React.createElement(a,{label:u.size,value:e.attributes.fieldSize,options:r,onChange:function(e){return t.styleAttrChange("fieldSize",e)}})),React.createElement(i,null,React.createElement(a,{label:u.border,value:e.attributes.fieldBorderStyle,options:[{label:u.none,value:"none"},{label:u.solid,value:"solid"},{label:u.dashed,value:"dashed"},{label:u.dotted,value:"dotted"}],onChange:function(e){return t.styleAttrChange("fieldBorderStyle",e)}}))),React.createElement(s,{gap:4,align:"flex-start",className:"wpforms-gutenberg-form-selector-flex",justify:"space-between"},React.createElement(i,null,React.createElement(c,{label:u.border_size,value:"none"===e.attributes.fieldBorderStyle?"":e.attributes.fieldBorderSize,min:0,disabled:"none"===e.attributes.fieldBorderStyle,onChange:function(e){return t.styleAttrChange("fieldBorderSize",e)},isUnitSelectTabbable:!0})),React.createElement(i,null,React.createElement(c,{label:u.border_radius,value:e.attributes.fieldBorderRadius,min:0,isUnitSelectTabbable:!0,onChange:function(e){return t.styleAttrChange("fieldBorderRadius",e)}}))),React.createElement("div",{className:"wpforms-gutenberg-form-selector-color-picker"},React.createElement("div",{className:"wpforms-gutenberg-form-selector-control-label"},u.colors),React.createElement(o,{__experimentalIsRenderedInSidebar:!0,enableAlpha:!0,showTitle:!1,className:n.getColorPanelClass(e.attributes.fieldBorderStyle),colorSettings:[{value:e.attributes.fieldBackgroundColor,onChange:function(e){return t.styleAttrChange("fieldBackgroundColor",e)},label:u.background},{value:e.attributes.fieldBorderColor,onChange:function(e){return t.styleAttrChange("fieldBorderColor",e)},label:u.border},{value:e.attributes.fieldTextColor,onChange:function(e){return t.styleAttrChange("fieldTextColor",e)},label:u.text},{value:e.attributes.fieldMenuColor,onChange:function(e){return t.styleAttrChange("fieldMenuColor",e)},label:u.menu}]})))}})},{}],21:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function a(e,t,r){return(t=function(e){e=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==n(e)?e:String(e)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l,s,i,c,f,d,m,p,b,g,y,h,v,w,k,S,C,E;r.default=(document,l=window,s=jQuery,r=wp.components,i=r.PanelBody,c=r.ColorIndicator,f=r.TextControl,d=r.Button,r=wp.components,m=r.__experimentalRadio,p=r.__experimentalRadioGroup,r=wpforms_gutenberg_form_selector,b=r.isPro,g=r.isLicenseActive,y=r.strings,h=r.route_namespace,w={},k={wpforms:v=null,custom:null},S=null,C={},(E={init:function(){C.$window=s(l),E.fetchThemesData(),s(E.ready)},ready:function(){E.events()},events:function(){wp.data.subscribe(function(){var e,t=null==(t=wp.data.select("core/editor"))?void 0:t.isSavingPost(),r=null==(r=wp.data.select("core/editor"))?void 0:r.isAutosavingPost(),n=null==(n=wp.data.select("core/edit-widgets"))?void 0:n.isSavingWidgetAreas(),o=null==(o=wp.data.select("core/editor"))?void 0:o.getCurrentPost(),o=(null==o||null==(e=o.type)?void 0:e.includes("wp_template"))||(null==o||null==(e=o.type)?void 0:e.includes("wp_block"));(t||n||o)&&!r&&(o?_.debounce(E.saveCustomThemes,500)():E.saveCustomThemes())})},getAllThemes:function(){return u(u({},k.custom||{}),k.wpforms||{})},getTheme:function(e){return E.getAllThemes()[e]||null},getEnabledThemes:function(){if(!S){var n=E.getAllThemes();if(b&&g)return n;S=Object.keys(n).reduce(function(e,t){var r;return null!=(r=n[t].settings)&&r.fieldSize&&!n[t].disabled&&(e[t]=n[t]),e},{})}return S},updateEnabledThemes:function(e,t){S=S&&u(u({},S),{},a({},e,t))},isDisabledTheme:function(e){var t;return!(null!=(t=E.getEnabledThemes())&&t[e])},isWPFormsTheme:function(e){return Boolean(null==(e=k.wpforms[e])?void 0:e.settings)},fetchThemesData:function(){if(!w.isFetchingThemes&&!k.wpforms){w.isFetchingThemes=!0;try{wp.apiFetch({path:h+"themes/",method:"GET",cache:"no-cache"}).then(function(e){k.wpforms=e.wpforms||{},k.custom=e.custom||{}}).catch(function(e){console.error(null==e?void 0:e.message)}).finally(function(){w.isFetchingThemes=!1})}catch(e){console.error(e)}}},saveCustomThemes:function(){if(!w.isSavingThemes&&k.custom){w.isSavingThemes=!0;try{wp.apiFetch({path:h+"themes/custom/",method:"POST",data:{customThemes:k.custom}}).then(function(e){null!=e&&e.result||console.log(null==e?void 0:e.error)}).catch(function(e){console.error(null==e?void 0:e.message)}).finally(function(){w.isSavingThemes=!1})}catch(e){console.error(e)}}},getCurrentStyleAttributes:function(e){var t,r,n=Object.keys(null==(t=k.wpforms.default)?void 0:t.settings),o={};for(r in n){var a=n[r];o[a]=null!=(a=e.attributes[a])?a:""}return o},maybeCreateCustomTheme:function(e){var t,r=E.getCurrentStyleAttributes(e),n=!!k.wpforms[e.attributes.theme],o=!!k.custom[e.attributes.theme],a=!1;return!(n&&JSON.stringify(null==(t=k.wpforms[e.attributes.theme])?void 0:t.settings)===JSON.stringify(r)||(t=v.getBlockRuntimeStateVar(e.clientId,"prevAttributesState"),"default"!==e.attributes.theme||""!==e.attributes.themeName||t||(a=!0),!n&&o&&!a||E.createCustomTheme(e,r,a),0))},createCustomTheme:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=0,o=e.attributes.theme,a=(E.getTheme(e.attributes.theme)||k.wpforms.default).name;for(k.custom=k.custom||{},r&&(o="custom",a=y.theme_custom);o=o+"-copy-"+ ++n,k.custom[o]&&n<1e4;);return a+=" ("+(n<2?y.theme_copy:y.theme_copy+" "+n)+")",a=r&&n<2?y.theme_custom:a,k.custom[o]={name:a,settings:t||E.getCurrentStyleAttributes(e)},E.updateEnabledThemes(o,k.custom[o]),e.setAttributes({theme:o,themeName:a}),!0},maybeCreateCustomThemeFromAttributes:function(e){var t,r=e.theme,n=E.getTheme(e.theme),o=Object.keys(e),a=Boolean(null==n?void 0:n.settings);if(a)for(var l in o){l=o[l];if(!n.settings[l]||n.settings[l]!==e[l]){a=!1;break}}if(!a){var s,i=Object.keys(k.wpforms.default.settings),c={};for(s in i){var u=i[s];c[u]=null!=(u=e[u])?u:""}k.custom[r]={name:null!=(t=e.themeName)?t:y.theme_custom,settings:c},E.updateEnabledThemes(r,k.custom[r])}return r},updateCustomThemeAttribute:function(e,t,r){var n=r.attributes.theme;k.wpforms[n]||"themeName"!==e&&!k.wpforms.default.settings[e]||k.custom[n]&&("themeName"===e?k.custom[n].name=t:(k.custom[n].settings=k.custom[n].settings||k.wpforms.default.settings,k.custom[n].settings[e]=t),C.$window.trigger("wpformsFormSelectorUpdateTheme",[n,k.custom[n],r]))},getThemesPanel:function(e,t,r){var n,o,a,l,s;return v=t,w.stockPhotos=r,k.wpforms?(n=E.getEventHandlers(e),r=t.isFullStylingEnabled()&&E.maybeCreateCustomTheme(e),o=t.isFullStylingEnabled()?e.attributes.theme:"classic",l="block"==(a=(t=t.isLeadFormsEnabled(t.getBlockContainer(e)))?"block":"none")?{display:"none"}:{},s=v.getPanelClass(e),s=(s+=t?" wpforms-lead-forms-enabled":"")+(E.isMac()?" wpforms-is-mac":""),React.createElement(i,{className:s,title:y.themes},React.createElement("p",{className:"wpforms-gutenberg-panel-notice wpforms-warning wpforms-use-modern-notice",style:l},React.createElement("strong",null,y.use_modern_notice_head),y.use_modern_notice_text," ",React.createElement("a",{href:y.use_modern_notice_link,rel:"noreferrer",target:"_blank"},y.learn_more)),React.createElement("p",{className:"wpforms-gutenberg-panel-notice wpforms-warning wpforms-lead-form-notice",style:{display:a}},React.createElement("strong",null,y.lead_forms_panel_notice_head),y.lead_forms_panel_notice_text),React.createElement(p,{className:"wpforms-gutenberg-form-selector-themes-radio-group",label:y.themes,checked:o,defaultChecked:e.attributes.theme,onChange:function(e){return n.selectTheme(e)}},E.getThemesItemsJSX(e)),r&&React.createElement(React.Fragment,null,React.createElement(f,{className:"wpforms-gutenberg-form-selector-themes-theme-name",label:y.theme_name,value:e.attributes.themeName,onChange:function(e){return n.changeThemeName(e)}}),React.createElement(d,{isSecondary:!0,className:"wpforms-gutenberg-form-selector-themes-delete",onClick:n.deleteTheme,buttonSettings:""},y.theme_delete)))):(E.fetchThemesData(),React.createElement(React.Fragment,null))},getThemesItemsJSX:function(e){var t=E.getAllThemes();if(!t)return[];var r,n,o,a=[],l=Object.keys(t);for(o in E.isWPFormsTheme(e.attributes.theme)||(n=e.attributes.theme,a.push(E.getThemesItemJSX(e.attributes.theme,E.getTheme(e.attributes.theme)))),l){var s=l[o];n&&n===s||((r=u(u({},t.default),t[s]||{})).settings=u(u({},t.default.settings),r.settings||{}),a.push(E.getThemesItemJSX(s,r)))}return a},getThemesItemJSX:function(e,t){var r;return t?(r=0<(null==(r=t.name)?void 0:r.length)?t.name:y.theme_noname,React.createElement(m,{value:e,title:r},React.createElement("div",{className:E.isDisabledTheme(e)?"wpforms-gutenberg-form-selector-themes-radio-disabled":""},React.createElement("div",{className:"wpforms-gutenberg-form-selector-themes-radio-title"},r)),React.createElement(c,{colorValue:t.settings.buttonBackgroundColor,title:y.button_background}),React.createElement(c,{colorValue:t.settings.buttonTextColor,title:y.button_text}),React.createElement(c,{colorValue:t.settings.labelColor,title:y.field_label}),React.createElement(c,{colorValue:t.settings.labelSublabelColor,title:y.field_sublabel}),React.createElement(c,{colorValue:t.settings.fieldBorderColor,title:y.field_border}))):null},setBlockTheme:function(e,t){if(E.maybeDisplayUpgradeModal(t))return!1;var r=E.getTheme(t);if(null==r||!r.settings)return!1;var n,o=Object.keys(r.settings),a=v.getBlockContainer(e),l=a.querySelector("#wpforms-".concat(e.attributes.formId)),s=u(u({},e),{},{attributes:u(u({},e.attributes),r.settings)});for(n in o){var i=o[n];r.settings[i]="0"===r.settings[i]?"0px":r.settings[i],v.updatePreviewCSSVarValue(i,r.settings[i],l,s)}var c=u({theme:t,themeName:r.name},r.settings);return e.setAttributes&&e.setAttributes(c),C.$window.trigger("wpformsFormSelectorSetTheme",[a,t,e]),!0},maybeDisplayUpgradeModal:function(e){return!(!E.isDisabledTheme(e)||(b?g||(v.education.showLicenseModal("themes",y.themes,"select-theme"),0):(v.education.showProModal("themes",y.themes),0)))},getEventHandlers:function(r){var n=v.getSettingsFieldsHandlers(r),t={selectTheme:function(e){var t;E.setBlockTheme(r,e)&&(null!=w&&null!=(t=w.stockPhotos)&&t.onSelectTheme(e,r,E,n),t=v.getBlockContainer(r),v.setTriggerServerRender(!1),n.updateCopyPasteContent(),C.$window.trigger("wpformsFormSelectorSelectTheme",[t,r,e]))},changeThemeName:function(e){v.setTriggerServerRender(!1),r.setAttributes({themeName:e}),E.updateCustomThemeAttribute("themeName",e,r)},deleteTheme:function(){var e=r.attributes.theme;delete k.custom[e],E.deleteThemeModal(r,e,t)}};return t},deleteThemeModal:function(e,t,r){var n=y.theme_delete_confirm.replace("%1$s","<b>".concat(e.attributes.themeName,"</b>")),n='<p class="wpforms-theme-delete-text">'.concat(n," ").concat(y.theme_delete_cant_undone,"</p>");s.confirm({title:y.theme_delete_title,content:n,icon:"wpforms-exclamation-circle",type:"red",buttons:{confirm:{text:y.theme_delete_yes,btnClass:"btn-confirm",keys:["enter"],action:function(){r.selectTheme("default"),C.$window.trigger("wpformsFormSelectorDeleteTheme",[t,e])}},cancel:{text:y.cancel,keys:["esc"]}}})},isMac:function(){return navigator.userAgent.includes("Macintosh")}}).init(),E)},{}]},{},[12]);