(self.vcvWebpackJsonp4x=self.vcvWebpackJsonp4x||[]).push([["wpUpdate","mustLibs"],{"./public/activation.js":function(e,t,a){"use strict";var i=a("./node_modules/react/index.js"),n=a("./node_modules/react-dom/client.js"),l=(a("./public/variables.js"),a("./public/config/wp-services.js"),a("./public/config/wp-attributes.js"),a("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js")),r=a("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),s=a("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),o=a("./node_modules/@babel/runtime/helpers/esm/createClass.js"),c=a("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),u=a("./node_modules/@babel/runtime/helpers/esm/inherits.js"),d=a("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),v=a("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),p=a("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),m=a("./node_modules/@babel/runtime/regenerator/index.js"),f=a.n(m),h=a("./node_modules/vc-cake/index.js"),g=a.n(h);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var b=(0,h.getService)("dataManager"),C=function(e){(0,u.default)(a,e);var t=y(a);function a(e){var n;return(0,s.default)(this,a),(n=t.call(this,e)).activationContent=i.createRef(),n}return(0,o.default)(a,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.activationContent.current&&e.activationContent.current.classList.add("vcv-activation-content--active")}),0)}},{key:"getDownloadText",value:function(e){var t=e.assetsActions,n=e.activeAssetsAction,l=e.postUpdateActions,r=e.activePostUpdate,s=e.assetsActionsDone,o=e.postUpdateDone;if(!e.actionsStarted)return i.createElement("p",{className:"vcv-activation-loading-text"},a.texts.downloadingInitialExtensionsText);if(!s){var c=t[n],u=a.texts.downloadingAssetsText.replace("{i}",n+1).replace("{cnt}",t.length).replace("{name}",c.name);return i.createElement("p",{className:"vcv-activation-loading-text"},u)}if(!o){var d=l[r],v=a.texts.postUpdateText.replace("{i}",r+1).replace("{cnt}",l.length).replace("{name}",d.name||"No name");return i.createElement("p",{className:"vcv-activation-loading-text"},v)}return s&&o?i.createElement("p",{className:"vcv-activation-loading-text"},a.texts.savingResultsText):void 0}},{key:"render",value:function(){var e=this;return i.createElement(ce,null,(function(t){var n=t.assetsActions,l=t.postUpdateActions,r=t.activeAssetsAction,s=t.activePostUpdate,o=t.showSkipPostButton,c=t.assetsActionsDone,u=t.postUpdateDone,d=t.actionsStarted,v=t.loadingText,p=t.loadingDescription;return i.createElement("div",{className:"vcv-activation-loading-screen vcv-activation-content",ref:e.activationContent},i.createElement("div",{id:"vcv-posts-update-wrapper"}),i.createElement("div",{className:"vcv-loading-dots-container"},i.createElement("div",{className:"vcv-loading-dot vcv-loading-dot-1"}),i.createElement("div",{className:"vcv-loading-dot vcv-loading-dot-2"})),v?i.createElement("p",{className:"vcv-activation-loading-text"},v):e.getDownloadText({assetsActions:n,postUpdateActions:l,activeAssetsAction:r,activePostUpdate:s,assetsActionsDone:c,postUpdateDone:u,actionsStarted:d}),i.createElement("p",{className:"vcv-activation-loading-helper-text"},p||a.texts.doNotCloseWhileUpdateText),o&&i.createElement("div",{className:"vcv-activation-button-container"},i.createElement("button",{onClick:a.handleClickSkipPostUpdate,className:"vcv-activation-button"},"Skip this post")))}))}}],[{key:"handleClickSkipPostUpdate",value:function(){var e=b.get("rebuildPostSkipPost"),t=b.get("sourceID");e&&t&&e(t)}}]),a}(i.Component);(0,p.default)(C,"localizations",b.get("localizations")),(0,p.default)(C,"texts",{downloadingAssetsText:C.localizations?C.localizations.downloadingAssets:"Downloading assets {i} of {cnt}: {name}",downloadingInitialExtensionsText:C.localizations?C.localizations.downloadingInitialExtensions:"Downloading initial extensions",savingResultsText:C.localizations?C.localizations.savingResults:"Saving Results",postUpdateText:C.localizations?C.localizations.postUpdateText:"Update posts {i} in {cnt}: {name}",doNotCloseWhileUpdateText:C.localizations?C.localizations.doNotCloseWhileUpdateText:"Don’t close this window while the download is in progress.",skipThisPostText:C.localizations?C.localizations.skipThisPostText:"Skip this post"});var k=a("./public/components/account/vcvLogo.js");function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var w=(0,h.getService)("dataManager"),S=function(e){(0,u.default)(a,e);var t=x(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){return i.createElement("div",{className:"vcv-activation-plugin-version-box"},"version ",w.get("pluginVersion"))}}]),a}(i.Component);function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var L=(0,h.getService)("dataManager"),T=function(e){(0,u.default)(a,e);var t=E(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){var e=L.get("licenseType"),t=a.localizations?a.localizations.goPremium:"Go Premium",n=a.localizations?a.localizations.download:"Download",l=a.localizations?a.localizations.install:"Install";if(!L.get("manageOptions"))return null;var r="vcv-timeline-item";"premium"!==e&&"theme"!==e||(r+=" vcv-step-done");var s=i.createElement("li",{className:r},i.createElement("span",{className:"vcv-timeline-item-helper"},"3"),i.createElement("span",{className:"vcv-timeline-item-text"},t));return i.createElement("ul",{className:"vcv-timeline vcv-timeline--three-steps"},i.createElement("li",{className:"vcv-timeline-item vcv-step-done"},i.createElement("span",{className:"vcv-timeline-item-helper"},"1"),i.createElement("span",{className:"vcv-timeline-item-text"},n)),i.createElement("li",{className:"vcv-timeline-item vcv-step-done"},i.createElement("span",{className:"vcv-timeline-item-helper"},"2"),i.createElement("span",{className:"vcv-timeline-item-text"},l)),s)}}]),a}(i.Component);(0,p.default)(T,"localizations",L.get("localizations"));var D=a("./public/tools/response.js");function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var P=(0,h.getService)("dataProcessor"),O=(0,h.getService)("dataManager"),j=function(e){(0,u.default)(a,e);var t=R(a);function a(e){var n;return(0,s.default)(this,a),(n=t.call(this,e)).state={licenseValue:"",hasError:!1,errorText:""},n.activationContent=i.createRef(),n.handleInputChange=n.handleInputChange.bind((0,c.default)(n)),n.handleInputFocus=n.handleInputFocus.bind((0,c.default)(n)),n.handleActivateClick=n.handleActivateClick.bind((0,c.default)(n)),n.setError=n.setError.bind((0,c.default)(n)),n}return(0,o.default)(a,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.activationContent.current&&e.activationContent.current.classList.add("vcv-activation-content--active")}),0)}},{key:"handleInputChange",value:function(e){var t=e.currentTarget&&e.currentTarget.value;this.setState({licenseValue:t})}},{key:"handleActivateClick",value:function(e){var t=this;e.preventDefault(),this.setState({hasError:!1,errorText:""}),this.state.licenseValue?(this.setState({loading:!0}),P.appAdminServerRequest({"vcv-action":"license:activate:adminNonce","vcv-license-key":this.state.licenseValue}).then((function(e){var a=(0,D.getResponse)(e);if(a&&a.status){var i=O.get("updateUrl");i?window.location.href=i:window.location.reload()}else t.setError(a&&a.message?a.message:""),console.warn(a)}),(function(e){t.setError(),console.warn(e)}))):this.setError(a.localizations?a.localizations.noSuchLicenseFound:'No such license found. Make sure it is correct or buy a new one here.'))}},{key:"setError",value:function(e){e&&this.setState({errorText:e}),this.setState({hasError:!0,loading:!1})}},{key:"handleInputFocus",value:function(){this.setState({hasError:!1})}},{key:"getFeatureList",value:function(){var e=a.localizations?a.localizations.goPremium:"Go Premium",t=a.localizations?a.localizations.freeLicense:"Free License (Your plan)",n=a.localizations?a.localizations.limitedAccessToExtensions:"Limited access to the Visual Composer Hub of elements, templates, and addons",l=a.localizations?a.localizations.themeBuilderWithHFS:"A theme builder with Header, Footer, and Sidebar editor",r=a.localizations?a.localizations.wooCommerceCompatibility:"WooCommerce compatibility",s=a.localizations?a.localizations.premiumSupportAndUpdates:"Premium support and updates",o=a.localizations?a.localizations.premiumLicense:"Premium License",c=a.localizations?a.localizations.unlimitedAccessToExtensions:"Unlimited access to the Visual Composer Hub of elements, templates, and addons",u=i.createElement("a",{href:O.get("goPremiumUrlWithRef"),target:"_blank",rel:"noopener noreferrer",className:"vcv-activation-button vcv-activation-button--dark"},e);return i.createElement("div",{className:"vcv-activation-box-container"},i.createElement("div",{className:"vcv-activation-box"},i.createElement("h3",{className:"vcv-activation-box-heading"},t),i.createElement("ul",{className:"vcv-basic-list"},i.createElement("li",{className:"vcv-basic-list-item"},n),i.createElement("li",{className:"vcv-basic-list-item vcv-basic-list-item--not-included"},l),i.createElement("li",{className:"vcv-basic-list-item vcv-basic-list-item--not-included"},r),i.createElement("li",{className:"vcv-basic-list-item vcv-basic-list-item--not-included"},s))),i.createElement("div",{className:"vcv-activation-box"},i.createElement("h3",{className:"vcv-activation-box-heading"},o),i.createElement("ul",{className:"vcv-basic-list"},i.createElement("li",{className:"vcv-basic-list-item"},c),i.createElement("li",{className:"vcv-basic-list-item"},l),i.createElement("li",{className:"vcv-basic-list-item"},r),i.createElement("li",{className:"vcv-basic-list-item"},s)),i.createElement("div",{className:"vcv-activation-button-container"},u)))}},{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.errorText,l=e.loading,r=a.localizations?a.localizations.enterYourLicenseKey:"Enter your license key",s=a.localizations?a.localizations.makeTheFinalStep:"Make the final step! Enter your license key to activate Visual Composer Premium and get full access to the Visual Composer Hub.",o=a.localizations?a.localizations.activateYourPremiumLicenseText:"Activate Your Premium License",c=a.localizations?a.localizations.activate:"Activate",u=a.localizations?a.localizations.bundledInAThemeText:"It seems that your copy of Visual Composer was bundled in a theme - use your Envato purchase key to activate Visual Composer Premium. You can also activate Visual Composer with a free or premium license.",d=a.localizations?a.localizations.alreadyHaveALicenseText:"Already have a license? Log in to My Visual Composer(link) to find it.",v="vcv-activation-input-field";t&&(v+=" vcv-activation-input-field--error"),l&&(v+=" vcv-activation-input-field--loading");var p=null;n&&(p=i.createElement("div",{className:"vcv-activation-box-error-box",dangerouslySetInnerHTML:{__html:n}}));var m=O.get("authorApiKey"),f=O.get("utm")["activate-license-myvc-license-url"].replace("{medium}","activatepremium"),h=i.createElement("p",{className:"vcv-activation-input-field-forgot-license",dangerouslySetInnerHTML:{__html:d.replace("{link}",f)}}),g=null;return"theme"!==this.props.licenseType&&m&&(g=i.createElement("div",{className:"vcv-activation-theme-notice"},i.createElement("svg",{className:"vcv-activation-theme-notice-logo",enableBackground:"new 0 0 128 128",version:"1.1",viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg"},i.createElement("g",null,i.createElement("rect",{fill:"none",height:"128",width:"128"}),i.createElement("path",{clipRule:"evenodd",d:"M102.953,0.702 c5.732,2.812,29.055,53.144,9.158,96.98c-15.979,35.2-56.093,35.204-76.427,22.8c-17.368-10.6-43.898-43.996-14.528-84.776 c1.243-1.548,4.225-1.408,3.552,3.268c-0.476,3.32-4.736,27.156,3.395,37.512c3.714,5.18,4.583,1.608,4.583,1.608 S32.053,43.41,58.422,17.078C75.16,1.022,98.374-1.546,102.953,0.702",fill:"#FFFFFF",fillRule:"evenodd"}))),u),h=null),i.createElement("div",{className:"vcv-activation-content",ref:this.activationContent},i.createElement(k.default,null),i.createElement(S,null),i.createElement(T,null),i.createElement("p",{className:"vcv-activation-heading"},o),i.createElement("p",{className:"vcv-activation-description"},s),p,i.createElement("div",{className:"vcv-activation-input-field-container"},i.createElement("form",{className:v,onSubmit:this.handleActivateClick},i.createElement("input",{name:"licenseKey",value:this.state.licenseValue,onChange:this.handleInputChange,maxLength:"36",onFocus:this.handleInputFocus,type:"text",className:"vcv-activation-input",placeholder:r}),i.createElement("button",{type:"submit",className:"vcv-activation-input-button",onClick:this.handleActivateClick},c)),h),g,this.getFeatureList())}}]),a}(i.Component);(0,p.default)(j,"localizations",O.get("localizations"));var A=a("./public/components/account/logger.js"),M=function(){function e(t,a,i){(0,s.default)(this,e),this.globalUrls=t,this.vendorUrl=a,this.updaterUrl=i}var t,a;return(0,o.default)(e,[{key:"setup",value:(a=(0,r.default)(f().mark((function e(){var t,a,i=this;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.vcvPostUpdateAction="updatePosts",(t=window.jQuery).ajaxSetup({beforeSend:function(e,t){e.url=t.url}}),a=window.VCV_HUB_GET_ELEMENTS?window.VCV_HUB_GET_ELEMENTS():{},e.next=6,t.getJSON(this.globalUrls,{"vcv-nonce":window.vcvNonce}).done((function(e){if(e&&e.vcvGlobals){i.buildGlobalVariables(e.vcvGlobals);var t=e.vcvGlobals.findIndex((function(e){return"VCV_HUB_GET_ELEMENTS"===e.key}));t>-1?a=e.vcvGlobals[t].value:console.warn("VCV_HUB_GET_ELEMENTS not available in response",e.vcvGlobals)}})).fail((function(e,t,a){console.warn(e,t,a),(0,A.log)("Error in rebuild process get json globalUrls",{code:"postsUpdate-update-3",codeNum:"000012",jqXHR:e,status:t,error:a,globalUrls:i.globalUrls})}));case 6:return e.next=8,t.getScript(this.vendorUrl).fail((function(e,t,a){console.warn(e,t,a),(0,A.log)("Error in rebuild process get json vendorUrl ",{code:"postsUpdate-update-4",codeNum:"000013",jqXHR:e,status:t,error:a,vendorUrl:i.vendorUrl})}));case 8:return e.next=10,t.getScript(this.updaterUrl).fail((function(e,t,a){console.warn(e,t,a),(0,A.log)("Error in rebuild process get json updaterUrl",{code:"postsUpdate-update-5",codeNum:"000014",jqXHR:e,status:t,error:a,updaterUrl:i.updaterUrl})}));case 10:return e.next=12,this.downloadElements(a);case 12:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"isReady",value:function(){return!!this.ready}},{key:"downloadElements",value:function(e){var t=window.jQuery,a=[];return Object.keys(e).forEach((function(i){var n=e[i];a.push(t.getScript(n.bundlePath).fail((function(e,t,a){console.warn(e,t,a)})))})),Promise.all(a).catch((function(e){console.warn(e),(0,A.log)("Error in rebuild process downloadElements",{code:"postsUpdate-downloadElements-1",codeNum:"000015",error:e})}))}},{key:"setGlobalVariable",value:function(e,t){if(void 0===window[e]){if("vcvSourceID"===e)return;Object.defineProperty(window,e,{value:function(){return t},writable:!1})}}},{key:"buildGlobalVariables",value:function(e){var t=this;Object.keys(e).forEach((function(a){t.setGlobalVariable(e[a].key,e[a].value)}))}},{key:"update",value:(t=(0,r.default)(f().mark((function e(t){var a,i;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isReady()){e.next=14;break}return e.prev=1,e.next=4,this.setup();case 4:this.ready=!0,e.next=14;break;case 7:throw e.prev=7,e.t0=e.catch(1),console.warn(e.t0),a=window.VCV_I18N&&window.VCV_I18N(),i=(a.postUpdateAjaxRequestError||"Failed to load: {file} #10077").replace(/{file}/,e.t0.url),(0,A.log)(i,{code:"postsUpdate-update-1",codeNum:"000010",error:e.t0,data:t}),i;case 14:return e.prev=14,e.next=17,window.vcvRebuildPostSave(t);case 17:e.next=24;break;case 19:return e.prev=19,e.t1=e.catch(14),console.warn(e.t1),(0,A.log)("Error in rebuild process",{code:"postsUpdate-update-2",codeNum:"000011",error:e.t1,data:t}),e.abrupt("return",new Error("Error in rebuild process"));case 24:return e.abrupt("return",t);case 25:case"end":return e.stop()}}),e,this,[[1,7],[14,19]])}))),function(e){return t.apply(this,arguments)})}]),e}(),N=a("./public/components/account/oopsScreen.js");function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var B=function(e){(0,u.default)(a,e);var t=_(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){return i.createElement(ce,null,(function(e){var t=e.error;return i.createElement(N.default,{errorMessage:t&&t.message,errorAction:t&&t.errorAction,errorReportAction:t&&t.errorReportAction,errorName:t&&t.errorName})}))}}]),a}(i.Component);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var F=(0,h.getService)("dataManager"),V=function(e){(0,u.default)(a,e);var t=I(a);function a(e){var n;return(0,s.default)(this,a),(n=t.call(this,e)).activationContent=i.createRef(),n}return(0,o.default)(a,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.activationContent.current&&e.activationContent.current.classList.add("vcv-activation-content--active")}),0)}},{key:"render",value:function(){return i.createElement("div",{className:"vcv-activation-loading-screen vcv-activation-content",ref:this.activationContent},i.createElement(k.default,null),i.createElement("p",{className:"vcv-activation-loading-text"},a.texts.thankYouText),i.createElement("p",{className:"vcv-activation-loading-helper-text"},"We have successfully received Your error report."))}}]),a}(i.Component);(0,p.default)(V,"localizations",F.get("localizations")),(0,p.default)(V,"texts",{thankYouText:V.localizations?V.localizations.thankYouText:"Thank You!"});var H=a("./node_modules/classnames/index.js"),U=a.n(H),z=a("./public/components/account/courseList.tsx"),$=a.n(z);function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var W=g().getService("dataProcessor"),G=g().getService("dataManager"),q=G.get("localizations"),Z=[{img:"https://cdn.hub.visualcomposer.com/plugin-assets/create-a-new-page-video.png",title:q.course1,duration:q.courseDuration1},{img:"https://cdn.hub.visualcomposer.com/plugin-assets/add-elements-video.png",title:q.course2,duration:q.courseDuration2},{img:"https://cdn.hub.visualcomposer.com/plugin-assets/quick-actions-video.png",title:q.course3,duration:q.courseDuration3}],Y=function(e){(0,u.default)(a,e);var t=K(a);function a(e){var n;return(0,s.default)(this,a),(n=t.call(this,e)).state={isLoading:!1},n.activationContent=i.createRef(),n.handleTakeTutorialClick=n.handleTakeTutorialClick.bind((0,c.default)(n)),n}return(0,o.default)(a,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.activationContent.current&&e.activationContent.current.classList.add("vcv-activation-content--active")}),0)}},{key:"getDoMoreText",value:function(){if(!G.get("isPremiumActivated")&&G.get("manageOptions")){var e=a.localizations?a.localizations.alreadyHaveLicenseText:"Already have a Premium license? %1$1s or %2$2s.",t=a.localizations?a.localizations.activateHere:"Activate here",n=a.localizations?a.localizations.goPremiumLcFirst:"go Premium";return e=(e=e.replace("%1$1s","").concat(t,""))).replace("%2$2s","").concat(n,"")),i.createElement("p",{className:"vcv-activation-description",dangerouslySetInnerHTML:{__html:e}})}}},{key:"handleTakeTutorialClick",value:function(e){var t=this;if(G.get("tutorialPageUrl"))return!0;this.state.isLoading?e.preventDefault():(e.preventDefault(),this.setState({isLoading:!0}),W.appAdminServerRequest({"vcv-action":"editors:tutorial:create:adminNonce"}).then((function(e){var t=(0,D.getResponse)(e);!0===t.status&&(window.location.href=t.tutorialUrl)}),(function(e){t.setState({isLoading:!1}),console.warn("Failed to get Tutorial Template URL",e)})))}},{key:"render",value:function(){var e=a.localizations?a.localizations.createYourWordpressWebsite:"Create Your WordPress Website Today.",t=a.localizations?a.localizations.startEasyBuildFast:"Start Easy. Build Fast.",n=a.localizations?a.localizations.buildYourSiteWithDragAndDrop:"Build your site with the help of the drag and drop builder and without coding - it's that easy.",l=G.get("createNewText"),r=a.localizations?a.localizations.takeTutorialTemplate:"Try The Tutorial Template",s=G.get("utm")["get-started-course"],o=a.localizations?a.localizations.courseButtonText:"View full course (4 videos)",c=null,u=null;if(G.get("createNewUrl")&&(c=i.createElement("a",{href:G.get("createNewUrl")||"",className:"vcv-activation-button"},l)),G.get("tutorialPageCapability")){var d=U()({"vcv-activation-button":!0,"vcv-activation-button--dark":!0,"vcv-activation-button--loading":this.state.isLoading});u=i.createElement("a",{href:G.get("tutorialPageUrl")||"",className:d,onClick:this.handleTakeTutorialClick},r)}return i.createElement("div",{className:"vcv-activation-content",ref:this.activationContent},i.createElement(k.default,null),i.createElement(S,null),i.createElement("p",{className:"vcv-activation-heading"},e,i.createElement("br",null),t),i.createElement("p",{className:"vcv-activation-description"},n),i.createElement("div",{className:"vcv-activation-button-container"},c,u),this.getDoMoreText(),i.createElement("div",{className:"vcv-course-container"},i.createElement("div",{className:"vcv-activation-video-container"},i.createElement("div",{className:"vcv-activation-video"},i.createElement("iframe",{className:"vcv-activation-video-iframe",src:"https://www.youtube.com/embed/YxvsO21te5Q?rel=0",frameBorder:"0"}))),i.createElement($(),{list:Z,url:s,buttonText:o})))}}]),a}(i.Component);(0,p.default)(Y,"localizations",G.get("localizations"));var J=a("./public/components/modal/modal.tsx"),Q=a.n(J),X=(0,h.getService)("dataManager").get("localizations"),ee=[{id:"myself",title:X.myselfTitle,description:X.myselfDescription},{id:"client",title:X.clientTitle,description:X.clientDescription},{id:"work",title:X.workTitle,description:X.workDescription},{id:"else",title:X.elseTitle,description:X.elseDescription}];var te=function(e){var t=e.show,a=e.onClose,n=e.onSubmitSurvey,r=e.isLoading,s=(0,i.useState)(!1),o=(0,l.default)(s,2),c=o[0],u=o[1],d=function(e){u(e.currentTarget.id)},v=U()({"survey-submit":!0,"survey-submit--loading":r});return i.createElement("div",{className:"vcv-activation-survey"},i.createElement(Q(),{show:t,onClose:a},i.createElement("div",{className:"vcv-ui-modal"},i.createElement("span",{className:"vcv-ui-modal-close",onClick:a,title:"Close"},i.createElement("i",{className:"vcv-ui-modal-close-icon vcv-ui-icon vcv-ui-icon-close"})),i.createElement("h1",{className:"vcv-ui-modal-header-title"},"Who are you making the website for?"),i.createElement("section",{className:"vcv-ui-modal-content"},i.createElement("ul",{className:"vcv-answer-list"},ee.map((function(e){return i.createElement("li",{key:e.id,className:"vcv-answer-box"},i.createElement("input",{className:"survey-radio",type:"radio",id:e.id,name:"answers",onClick:d}),i.createElement("label",{className:"survey-label",htmlFor:e.id},i.createElement("div",{className:"survey-label-content"},i.createElement("p",{className:"survey-label-title"},e.title),i.createElement("p",{className:"survey-label-text"},e.description))))})))),i.createElement("footer",{className:"vcv-ui-modal-footer"},i.createElement("button",{className:v,disabled:r||!c,onClick:function(){n(c)}},"Submit")))))};function ae(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function ie(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[],n=!1,l=window.jQuery(e),s=2,o=s,c=s,d={x:0,y:0},v=!1;i=r().defaults(i||{},{attribute:!1,afterLastContainerElement:!1,allowAppend:!0,allowBeforeAfter:!0});var p=e.getBoundingClientRect(),m=t.y-(p.top+p.height/2),f=t.x-(p.left+p.width/2);if(!0===i.allowAppend?n="append":!0===i.allowBeforeAfter&&Math.abs(f)/p.width>Math.abs(m)/p.height?n=f>0?"after":"before":!0===i.allowBeforeAfter||i.attribute?n=m>0?"after":"before":i.afterLastContainerElement&&(n="after"),"append"===n)d.x=p.left,d.y=p.top,o=p.width,c=p.height,v=!0;else{var h=l.prevAll('[data-vcv-dnd-element]:not([data-vcv-dnd-helper="true"])').get(0),g=l.nextAll("[data-vcv-dnd-element]").get(0),y=h?h.getBoundingClientRect():null,b=g?g.getBoundingClientRect():null;if(l.closest(".vcv-ui-tree-layout").get(0)||(a=y&&y.left!==p.left||b&&b.left!==p.left,!l.hasClass("vce-col")||h||g||(a=!0)),d.x=p.left,d.y="before"===n?p.top:p.bottom,d.y-=s/2,o=p.width,a&&(o=s,c=p.height,d.y=p.top,d.x="before"===n?p.left:p.right,d.x-=s/2),"before"===n&&y)if(a){var C=(p.left-y.right)/2;C=C>0?C:0,d.x-=C}else{var k=(p.top-y.bottom)/2;k=k>0?k:0,d.y-=k}if("after"===n&&b)if(a){var x=(b.left-p.right)/2;x=x>0?x:0,d.x+=x}else{var w=(b.top-p.bottom)/2;w=w>0?w:0,d.y+=w}}return n&&!this.isSameElementPosition(d,this.getVcvIdFromElement(e))?(this.clearStyle(),this.setPoint(d.x,d.y),this.setStyle(u(u({},t),d),o,c,v),window.setTimeout(function(){this.el&&this.el.classList.add("vcv-is-shown"),a?this.el&&this.el.classList.add("vcv-smart-line-vertical"):this.el&&this.el.classList.remove("vcv-smart-line-vertical"),this.el&&this.el.classList.add("vcv-smart-line-transition")}.bind(this),0)):n=!1,this.prevElement!==this.getVcvIdFromElement(e)&&(this.prevElement=this.getVcvIdFromElement(e)),n};var v=d,p=a("./public/components/dnd/helper.js"),m=a("./node_modules/@babel/runtime/helpers/esm/typeof.js"),f=function(){function e(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(this,e),Object.defineProperty(this,"clone",{enumerable:!1,configurable:!1,writable:!0,value:t.cloneNode(!0)}),Object.defineProperty(this,"maxCloneHeight",{enumerable:!1,configurable:!1,writable:!1,value:350}),Object.defineProperty(this,"options",{enumerable:!1,configurable:!1,writable:!1,value:r().defaults(n,{opacity:1})}),"object"===(0,m.default)(a)&&void 0!==a.x&&void 0!==a.y&&Object.defineProperty(this,"mousePoint",{enumerable:!1,configurable:!1,writable:!1,value:a}),t.getBoundingClientRect().height>=this.maxCloneHeight&&Object.defineProperty(this,"cutSize",{enumerable:!1,configurable:!1,writable:!1,value:!0}),this.hide(),this.setInitStyle(t),t.parentNode.insertBefore(this.clone,t)}return(0,n.default)(e,[{key:"setInitStyle",value:function(e){var t=e.getBoundingClientRect();this.clone.style.position="fixed",this.clone.style.zIndex="1",this.clone.style.opacity=this.options.opacity,this.clone.style.pointerEvents="none";var a,i,n=t.height,l=t.width;this.clone.style.width=l+"px",this.clone.style.overflowY="hidden",this.cutSize?(this.clone.style.maxHeight=this.maxCloneHeight+"px",n=this.maxCloneHeight):this.clone.style.height=n+"px",this.clone.style.transition="none",this.clone.displayStyle="block",this.mousePoint?(a=t.top-this.mousePoint.y,Math.abs(a)>n&&(a=-n/2),i=t.left-this.mousePoint.x):(a=-n/2,i=-l/2),this.clone.style.marginTop=a+"px",this.clone.style.marginLeft=i+"px",(this.clone.classList.contains("vce-row")||this.clone.classList.contains("vce-col"))&&(this.clone.style.border="1px dashed rgba(183, 183, 183, 1)",this.clone.displayStyle="flex"),this.clone.setAttribute("data-vcv-dnd-helper",!0)}},{key:"setPosition",value:function(e){this.clone.style.top=e.y+"px",this.clone.style.left=e.x+"px"}},{key:"hide",value:function(){this.clone.style.display="none"}},{key:"show",value:function(){this.clone.style.display=this.clone.displayStyle}},{key:"remove",value:function(){var e=this.clone;this.clone=null,e.parentNode.removeChild(e)}}]),e}(),h=function(){function e(t){(0,i.default)(this,e),this.dnd=t}return(0,n.default)(e,[{key:"start",value:function(e){this.dnd.manualScroll=!0,this.dnd.option("drop",!1),this.dnd.start(null,null,null,this.dnd.container.querySelector('[data-vcv-dnd-element="'.concat(e.id,'"]'))),e.point&&this.dnd.check(e.point)}},{key:"addNew",value:function(e){e.endDnd?(this.dnd.draggingElement=null,this.dnd.handleDragEnd()):(this.dnd.start(e.id,!1,e.tag,e.domNode,e.element),this.dnd.manualScroll=!0,this.dnd.option("drop",!0),e.point&&this.dnd.check(e.point))}}]),e}(),g=a("./public/components/dnd/domElement.js"),y=(0,s.getService)("document"),b=(0,s.getService)("cook"),C=(0,s.getService)("hubElements"),k=(0,s.getStorage)("workspace"),x=function(){function e(t,a){(0,i.default)(this,e),Object.defineProperties(this,{helper:{enumerable:!1,configurable:!1,writable:!0,value:null},position:{enumerable:!1,configurable:!1,writable:!0,value:null},placeholder:{enumerable:!1,configurable:!1,writable:!0,value:null},currentElement:{enumerable:!1,configurable:!1,writable:!0,value:null},draggingElement:{enumerable:!1,configurable:!1,writable:!0,value:null},point:{enumerable:!1,configurable:!1,writable:!0,value:null},hover:{enumerable:!1,configurable:!1,writable:!0,value:""},container:{enumerable:!1,configurable:!1,writable:!1,value:t},manualScroll:{enumerable:!1,configurable:!1,writable:!0,value:!1},elementToColumn:{enumerable:!1,configurable:!1,writable:!0,value:!1},options:{enumerable:!1,configurable:!1,writable:!1,value:r().defaults(a,{cancelMove:!1,moveCallback:function(){},dropCallback:function(){},startCallback:function(){},endCallback:function(){},window:window,document:document,container:document.body,wrapper:null,boundariesGap:10,rootContainerFor:["RootElements"],rootID:"vcv-content-root",handler:null,ignoreHandling:null,disabled:!1,helperType:null,manualScroll:!1,drop:!1,customScroll:!1,scrollContainer:null,scrollCallback:function(){},isAttribute:!1,disableMobile:!1,isIframe:a&&a.container&&"vcv-editor-iframe-overlay"===a.container.id||!1,elementData:!1})}}),this.api=new h(this)}return(0,n.default)(e,[{key:"option",value:function(e,t){this.options[e]=t}},{key:"init",value:function(){var e=new g.default(this.options.rootID,this.container,{containerFor:this.options.rootContainerFor});this.handleDragFunction=this.handleDrag.bind(this),this.handleMobileCancelDragFunction=this.handleMobileCancelDrag.bind(this),this.handleDragStartFunction=this.handleDragStart.bind(this),this.handleDoubleClickFuntion=this.handleDoubleClick.bind(this),this.handleMobileDragStartFunction=this.handleMobileDragStart.bind(this),this.handleDragEndFunction=this.handleDragEnd.bind(this),this.handleRightMouseClickFunction=this.handleRightMouseClick.bind(this),e.refresh()}},{key:"addItem",value:function(e){var t=this;if(y.get(e)){var a=this.container.querySelectorAll('[data-vcv-element="'+e+'"]');(a=Array.prototype.slice.call(a)).forEach((function(a){a&&a.ELEMENT_NODE&&t.buildNodeElement(a,e)}))}}},{key:"dOMElementCreate",value:function(e,t){if(t===this.options.rootID)return new g.default(this.options.rootID,this.container,{containerFor:this.options.rootContainerFor});var a=b.get(y.get(t));if(!a)return null;var i,n=a.get("containerFor"),l=a.get("relatedTo"),r=a.get("parent"),s=b.getById(r);return i=r&&s&&(void 0===s.get("metaIsDraggable")||s.get("metaIsDraggable"))&&r||this.options.rootID,new g.default(t,e,{containerFor:n?n.value:null,relatedTo:l?l.value:null,parent:i,handler:this.options.handler,tag:a.get("tag"),iconLink:C.getElementIcon(a.get("tag"))})}},{key:"buildNodeElement",value:function(e,t){var a=this.dOMElementCreate(e,t);a.on("dragstart",(function(e){e.preventDefault()})).on("mousedown",this.handleDragStartFunction),null===a.options.containerFor&&a.on("dblclick",this.handleDoubleClickFuntion),this.options.disableMobile||a.on("touchstart",this.handleMobileDragStartFunction).on("touchmove",this.handleMobileCancelDragFunction).on("touchend",this.handleMobileCancelDragFunction)}},{key:"removeItem",value:function(){}},{key:"removePlaceholder",value:function(){null!==this.placeholder&&(this.placeholder.remove(),this.placeholder=null)}},{key:"getDomElement",value:function(e){if(!e||!e.ELEMENT_NODE)return null;var t=e.dataset.vcvDndElement||e.dataset.vcvDndElementHandler;return this.dOMElementCreate(e,t)}},{key:"getDomElementParent",value:function(e){var t=this.container.querySelector('[data-vcv-dnd-element="'.concat(e,'"]:not([data-vcv-dnd-helper="true"])'));return"vcv-content-root"===e&&(t=this.container),this.getDomElement(t)}},{key:"findElementWithValidParent",value:function(e){var t=e.parent()?this.getDomElementParent(e.parent()):null;return t&&this.draggingElement.isChild(t)?e:t?this.findElementWithValidParent(t):null}},{key:"isDraggingElementParent",value:function(e){return e.$node.parents('[data-vcv-dnd-element="'+this.draggingElement.id+'"]').length>0}},{key:"findNode",value:function(e){var t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=(t=a?this.options.document.getElementById(a):this.options.document.elementFromPoint(e.x,e.y))&&t.getAttribute("data-vcv-dnd-element"),n=t&&t.getAttribute("data-vcv-dnd-dom-element"),l=window.jQuery(t).closest(".".concat(n)).get(0);if(t&&!i&&(t=window.jQuery(t).closest('[data-vcv-dnd-element]:not([data-vcv-dnd-element="vcv-content-root"])').get(0)),t&&i&&"vcv-content-root"===i){var r=this.getDomElement(t);this.draggingElement.relatedTo(r.containerFor())||(t=null)}return t&&l&&(t=l),t||null}},{key:"checkBlankRow",value:function(e){var t=e.x,a=e.y,i=this.options.document.elementFromPoint(t,a);return i&&window.jQuery(i).closest("#vcv-ui-blank-row").get(0)}},{key:"checkHFS",value:function(e){var t=e.x,a=e.y,i=this.options.document.elementFromPoint(t,a);return i&&window.jQuery(i).closest("[data-vcv-layout-zone]").get(0)}},{key:"checkItems",value:function(e){var t=this,a=this.checkBlankRow(e),i=this.checkHFS(e);if(a){var n=this.placeholder&&this.placeholder.redraw(a,e);n&&this.setPosition(n),this.currentElement="vcv-ui-blank-row",this.removeHFSActive(),this.setMouseOverStartBlank(),this.elementToColumn=null}else if(i)i.classList.add("vcv-drag-helper-over-hfs"),this.removeMouseOverStartBlank(),this.elementToColumn=null;else{var l,r=this.findNode(e),s=this.getDomElement(r);if(!s)return;var o=r.closest(".vcv-ui-tree-layout"),c=this.getDomElementParent(s.parent())||null;if(s.isNearHorizontalBoundaries(e,30)&&"column"!==this.draggingElement.tag&&null!==(l=c)&&void 0!==l&&l.tag&&this.draggingElement.id!==c.id&&this.draggingElement.id!==c.parent()&&!o){var u="column"!==s.tag?c.node:s.node,d="column"!==s.tag?c.id:s.id,v=this.placeholder&&this.placeholder.redraw(u,e,{attribute:this.options.isAttribute,afterLastContainerElement:!1,allowBeforeAfter:!0,allowAppend:!1});return v&&(this.point=e,this.setPosition(v),this.currentElement=d,this.placeholder.setCurrentElement(d)),void(this.elementToColumn=!0)}if(s.isNearBoundaries(e,this.options.boundariesGap)&&c&&c.id!==this.options.rootID&&(s=this.findElementWithValidParent(c)||s,c=this.getDomElementParent(s.parent())||null),this.isDraggingElementParent(s))return;var p=y.children(s.id),m=!1,f=!p.length;if(!f&&s.node&&s.node.classList&&"closed"===s.node.dataset.vcvDndElementExpandStatus&&(f=!0),!f&&p.length&&(f=!0),s.options&&s.options.containerFor&&s.options.containerFor.includes("Column")&&!o){var h,g=null===(h=s.node)||void 0===h?void 0:h.getBoundingClientRect();if(g&&e.y>g.top+30&&e.yt.left&&e.x-1&&p[b]){var C="el-".concat(p[b].id);r=this.findNode({},C),s=this.getDomElement(r),c=this.getDomElementParent(s.parent())||null}}}if(this.removeHFSActive(),this.removeMouseOverStartBlank(),s.id===this.options.rootID){var k=s.$node.children("[data-vcv-dnd-element]").last().attr("data-vcv-dnd-element");if(!k)return void(s=null);r=this.container.querySelector('[data-vcv-dnd-element="'.concat(k,'"]:not([data-vcv-dnd-helper="true"])')),(s=this.getDomElement(r))&&(m=!0)}var x=!m&&!this.isDraggingElementParent(s)&&s&&this.draggingElement.isChild(s)&&f&&!s.node.dataset.vceTab&&("tab"!==s.options.tag||"true"===s.node.dataset.vcvActive),w=c&&this.draggingElement.isChild(c);s.$node.attr("data-vcv-element-locked")&&(x=!1),w&&c.$node.attr("data-vcv-element-locked")&&(w=!1);var S=this.placeholder.redraw(s.node,e,{attribute:this.options.isAttribute,afterLastContainerElement:m,allowBeforeAfter:w,allowAppend:x});S&&(this.point=e,this.setPosition(S),this.currentElement=s.id,this.placeholder.setCurrentElement(s.id),this.elementToColumn=null)}}},{key:"setPosition",value:function(e){this.position=e}},{key:"setMouseOverStartBlank",value:function(){this.options.document.querySelector("#vcv-ui-blank-row").classList.add("vcv-drag-helper-over-blank-row")}},{key:"removeMouseOverStartBlank",value:function(){this.options.document.querySelector("#vcv-ui-blank-row")&&this.options.document.querySelector("#vcv-ui-blank-row").classList.remove("vcv-drag-helper-over-blank-row")}},{key:"removeHFSActive",value:function(){var e=[].slice.call(this.options.document.querySelectorAll("[data-vcv-layout-zone]"));e.length&&e.forEach((function(e){e.classList.remove("vcv-drag-helper-over-hfs")}))}},{key:"start",value:function(e,t,a,i,n){var l=this;if(this.dragStartHandled||(this.dragStartHandled=!0),e&&a)this.draggingElement=this.createDraggingElementFromTag(a,i),this.options.elementData=n;else if(this.draggingElement=this.getDomElement(i),this.options.drop=!1,!this.draggingElement)return this.dragStartHandled=!1,this.draggingElement=null,!1;this.options.document.addEventListener("mousedown",this.handleRightMouseClickFunction,!1),this.options.document.addEventListener("mouseup",this.handleDragEndFunction,!1),this.options.document.addEventListener("touchend",this.handleDragEndFunction,!1),"clone"===this.options.helperType?this.helper=new f(this.draggingElement.node.closest("[data-vcv-element]"),t):this.helper=new p.default(this.draggingElement,{container:this.options.container,wrapper:this.options.isIframe&&this.options.wrapper}),this.options.document.body.classList.add("vcv-dnd-dragging--start","vcv-is-no-selection"),this.watchMouse(),this.createPlaceholder(),this.scrollEvent=function(){l.placeholder&&(l.placeholder.clearStyle(),l.placeholder.setPoint(0,0)),l.check(l.point||{})},this.options.document.addEventListener("scroll",this.scrollEvent),"function"==typeof this.options.startCallback&&this.options.startCallback(this.draggingElement),window.setTimeout((function(){l.helper&&l.helper.show()}),200),this.dragStartedAt=(new Date).getTime()}},{key:"createDraggingElementFromTag",value:function(e,t){var a=b.get({tag:e});if(a){var i=a.get("containerFor"),n=a.get("relatedTo");return new g.default("dropElement",t,{containerFor:i?i.value:null,relatedTo:n?n.value.concat(["RootElements"]):null,parent:this.options.rootID,handler:this.options.handler,tag:a.get("tag"),iconLink:C.getElementIcon(a.get("tag"))})}}},{key:"columnDrop",value:function(){var e=b.get({tag:"column"}),t=b.getById(this.currentElement).get("parent"),a=document.createElement("div");e.set("parent",t);var i=this.createDraggingElementFromTag("column",a);this.position&&this.options.dropCallback("dropElement",this.position,this.currentElement,i,e.toJS(),{silent:!0}),this.position="append",this.currentElement=e.get("id")}},{key:"end",value:function(){var e=(new Date).getTime(),t=this.dragStartedAt;this.dragStartedAt=null,this.helper&&this.helper.remove(),this.options.document.body.classList.remove("vcv-dnd-dragging--start","vcv-is-no-selection"),this.forgetMouse(),this.removePlaceholder(),this.options.document.removeEventListener("scroll",this.scrollEvent),this.point=null,this.options.manualScroll=!1,"function"==typeof this.options.endCallback&&this.options.endCallback(this.draggingElement);var a=(0,s.getData)("vcv:layoutCustomMode")&&(0,s.getData)("vcv:layoutCustomMode").mode,i="dnd"===a;this.removeMouseOverStartBlank(),this.removeHFSActive(),e-t>250&&(!0===this.options.drop&&this.draggingElement&&"function"==typeof this.options.dropCallback?(this.elementToColumn&&this.columnDrop(),this.position&&this.options.dropCallback(this.draggingElement.id,this.position,this.currentElement,this.draggingElement,this.options.elementData,{silent:!0}),this.position||k.state("drag").set({terminate:!0})):i&&this.draggingElement&&"function"==typeof this.options.moveCallback&&this.draggingElement.id!==this.currentElement&&(this.elementToColumn&&"column"!==this.draggingElement.tag&&this.columnDrop(),this.position&&this.options.moveCallback(this.draggingElement.id,this.position,this.currentElement))),this.draggingElement=null,this.currentElement=null,this.position=null,this.helper=null,this.startPoint=null,this.elementToColumn=null,"contentEditable"!==a&&"columnResizer"!==a&&null!==a&&"elementResize"!==a&&(0,s.setData)("vcv:layoutCustomMode",null),this.options.document.removeEventListener("mouseup",this.handleDragEndFunction,!1),this.options.document.removeEventListener("touchend",this.handleDragEndFunction,!1)}},{key:"scrollManually",value:function(e){var t=this.options.isIframe?this.options.window:this.options.document.body,a=this.options.document.documentElement.clientHeight,i=null,n=this.options.isIframe?t.scrollY:t.scrollTop;a-10<=e.y-e.top?i=n+30:e.y-e.top<=10&&n>=30&&(i=n-30),null!==i&&(this.options.isIframe?t.scroll(0,i):t.scrollTop=i>0?i:0)}},{key:"check",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!0!==this.options.disabled){var a=(0,s.getData)("vcv:layoutCustomMode")&&(0,s.getData)("vcv:layoutCustomMode").mode;if(this.draggingElement&&"dnd"!==a){var i={mode:"dnd",options:{containerId:this.options.container.id}};(0,s.setData)("vcv:layoutCustomMode",i)}this.options.manualScroll&&this.scrollManually(t),this.dragStartHandled&&this.options.customScroll&&this.options.scrollCallback(t),window.setTimeout((function(){e.startPoint||(e.startPoint=t)}),0),this.helper&&this.helper.setPosition(t),this.placeholder&&this.checkItems(t)}else this.handleDragEnd()}},{key:"watchMouse",value:function(){this.options.document.addEventListener("mousemove",this.handleDragFunction,!1),this.options.document.addEventListener("touchmove",this.handleDragFunction,!1)}},{key:"forgetMouse",value:function(){this.options.document.removeEventListener("mousemove",this.handleDragFunction,!1),this.options.document.removeEventListener("touchmove",this.handleDragFunction,!1)}},{key:"createPlaceholder",value:function(){this.placeholder=new v(r().pick(this.options,"document","container"))}},{key:"handleDrag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.button&&2===e.button)return this.handleDragEnd(),!1;var i=this.options.isIframe&&this.options.wrapper&&this.options.wrapper.scrollLeft?this.options.wrapper.scrollLeft:0,n=this.options.isIframe&&this.options.wrapper&&this.options.wrapper.scrollTop?this.options.wrapper.scrollTop:0;e.touches&&e.touches[0]&&this.dragStartHandled?(e.preventDefault(),void 0!==e.touches[0].clientX&&void 0!==e.touches[0].clientY&&this.check({x:e.touches[0].clientX-t,y:e.touches[0].clientY-a,left:i,top:n})):void 0!==e.clientX&&void 0!==e.clientY&&this.check({x:e.clientX-t,y:e.clientY-a,left:i,top:n})}},{key:"handleMobileCancelDrag",value:function(e){this.startDragTimeout?(clearTimeout(this.startDragTimeout),this.startDragTimeout=null):this.handleDrag(e)}},{key:"handleDragStart",value:function(e){if(!0!==this.options.disabled&&!this.dragStartHandled&&!(this.options.ignoreHandling&&window.jQuery(e.currentTarget).is(this.options.ignoreHandling)||e.which>1)){var t=this.options.isIframe&&this.options.wrapper&&this.options.wrapper.scrollLeft?this.options.wrapper.scrollLeft:0,a=this.options.isIframe&&this.options.wrapper&&this.options.wrapper.scrollTop?this.options.wrapper.scrollTop:0,i=e.currentTarget.getAttribute("data-vcv-dnd-element-handler");e.target.closest(".vce-column-resizer")||(e.touches&&e.touches[0]?(e.preventDefault(),this.start(i,{x:e.touches[0].clientX,y:e.touches[0].clientY,left:t,top:a},null,e.currentTarget)):this.start(i,{x:e.clientX,y:e.clientY,left:t,top:a},null,e.currentTarget),this.handleDrag(e))}}},{key:"handleDoubleClick",value:function(e){if((!e.target||!e.target.closest("[data-vcv-content-editable-inline-mode]"))&&!e.currentTarget.getAttribute("data-vcv-element-locked")){var t=e.currentTarget.getAttribute("data-vcv-dnd-element-handler");k.trigger("edit",t)}}},{key:"handleMobileDragStart",value:function(e){var t=this;if(!0!==this.options.disabled&&!this.dragStartHandled&&!(this.options.ignoreHandling&&window.jQuery(e.currentTarget).is(this.options.ignoreHandling)||e.which>1)){var a=e.currentTarget.getAttribute("data-vcv-dnd-element-handler");e.touches&&e.touches[0]&&(this.startDragTimeout=setTimeout((function(){t.startDragTimeout=null,e.preventDefault(),t.start(a,{x:e.touches[0].clientX,y:e.touches[0].clientY},null,t.findNode({x:e.touches[0].clientX,y:e.touches[0].clientY}))}),450))}}},{key:"handleDragEnd",value:function(){this.dragStartHandled=!1,this.options.customScroll&&this.options.scrollCallback({end:!0}),this.end()}},{key:"handleRightMouseClick",value:function(e){e.button&&2===e.button&&(this.options.document.removeEventListener("mousedown",this.handleRightMouseClickFunction,!1),this.handleDragEnd())}}]),e}()},"./public/components/dnd/domElement.js":function(e,t,a){"use strict";a.d(t,{default:function(){return s}});var i=a("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),n=a("./node_modules/@babel/runtime/helpers/esm/createClass.js"),l=a("./node_modules/lodash/lodash.js"),r=a.n(l),s=function(){function e(t,a,n){(0,i.default)(this,e),n=r().defaults(n,{containerFor:null,childFor:null,parent:null,handler:null,datasetKey:"vcvDndDomElement"}),Object.defineProperties(this,{node:{configurable:!1,enumerable:!1,value:a,writable:!1},$node:{configurable:!1,enumerable:!1,value:window.jQuery(a),writable:!1},id:{configurable:!1,enumerable:!1,value:t,writable:!1},options:{configurable:!1,enumerable:!1,value:n,writable:!1},isEmptyAsContainer:{enumerable:!1,get:function(){return 0===this.$node.find("[data-vcv-dnd-element]").length}}}),this.setAttributes()}return(0,n.default)(e,[{key:"setAttributes",value:function(){var e=this.options.handler;"string"==typeof e&&(e=this.$node.find(this.options.handler).get(0)),e&&e.ELEMENT_NODE&&(void 0!==this.handler?Object.defineProperty(this,"handler",{configurable:!0,enumerable:!1,value:e,writable:!0}):this.handler=e),this.node.setAttribute("data-vcv-dnd-element",this.id),this.handler?(this.handler.setAttribute("data-vcv-dnd-element-handler",this.id),this.handler.dataset[this.options.datasetKey]=this.node.className):this.options.handler||this.node.setAttribute("data-vcv-dnd-element-handler",this.id)}},{key:"refresh",value:function(){return this.setAttributes(),this}},{key:"parent",value:function(){return this.options.parent}},{key:"isChild",value:function(e){return this.relatedTo(e.containerFor())}},{key:"relatedTo",value:function(e){if(!this.options.relatedTo||!e)return!1;var t=!1;return Array.isArray(this.options.relatedTo)?this.options.relatedTo.find((function(a){return t=Array.isArray(e)?e.indexOf(a)>-1:e===a})):e===this.options.relatedTo&&(t=!0),t}},{key:"containerFor",value:function(){return this.options.containerFor}},{key:"equals",value:function(e){return this.id===e.id}},{key:"isNearHorizontalBoundaries",value:function(e,t){var a=this.node.getBoundingClientRect();return e.x-a.left');var n=a.getBoundingClientRect();return a.style.marginTop=-n.height/2+"px",a.style.marginLeft=-n.width/2+"px",a.style.top="-100%",a.style.left="-100%",a}},{key:"setPosition",value:function(e){this.control.style.top=e.top?"".concat(e.y-e.top,"px"):"".concat(e.y,"px"),this.control.style.left=e.left?"".concat(e.x-e.left,"px"):"".concat(e.x,"px")}},{key:"hide",value:function(){this.control.style.display="none"}},{key:"show",value:function(){var e=this,t=o.state("drag").get();t&&t.active&&t.addPanel?this.control.style.display="flex":window.setTimeout((function(){e&&e.control&&(e.control.style.display="flex")}),50)}},{key:"remove",value:function(){var e=this.control;this.control=null;var t=e.parentNode;t.classList.contains("vcv-ui-drag-helper-wrapper")?t.parentNode&&t.parentNode.removeChild(t):t.removeChild(e)}}]),e}()},"./public/components/elementControls/controlHelpers.js":function(e,t,a){"use strict";a.r(t),a.d(t,{ControlHelpers:function(){return o}});var i=a("./node_modules/vc-cake/index.js"),n=(0,i.getService)("cook"),l=(0,i.getService)("document"),r=(0,i.getService)("dataManager"),s=(0,i.getStorage)("settings"),o={getVcElement:function(e){return l.get(e)&&n.get(l.get(e))},getElementColorIndex:function(e){var t=2;if(e&&e.containerFor().length>0){var a=e.containerFor().indexOf("General")>-1,i="div"===e.data.tag;t=a&&!i?1:0}return t},getPasteOptions:function(e,t){var a={disabled:!e,pasteAfter:!1};if(!e)return a;if(e.constructor===String)try{e=JSON.parse(e)}catch(h){return console.error(h),a}var i=e&&e.element&&e.element.element,l=i&&n.get(i),o=l.get("relatedTo"),c=o&&o.value,u=t&&n.get(t),d=u.get("containerFor"),v=d&&d.value,p=r.get("editorType"),m=s.state("layoutType").get(),f=e&&e.options;return e&&f&&f.editorTypeRelation&&"vcv_layouts"===f.editorTypeRelation&&("vcv_layouts"!==p||"archiveTemplate"===m&&"layoutContentArea"===f.elementTag||"postTemplate"===m&&"postsGridDataSourceArchive"===f.elementTag)?a.disabled=!0:c&&v&&c.length&&v.length?((v.indexOf("General")<0||c.indexOf("General")<0)&&(a.disabled=!0,v.forEach((function(e){c.indexOf(e)>=0&&(a.disabled=!1)}))),a.disabled&&v.indexOf("General")<0&&u.get("tag")===l.get("tag")&&(a.disabled=!1,a.pasteAfter=!0)):v||(a.pasteAfter=!0,c.indexOf("General")<0&&(a.disabled=!0)),a},getDropdownOptions:function(e,t){return{isContainer:t<2,title:e.get("customHeaderTitle")||e.get("name"),name:e.get("name"),tag:e.get("tag"),relatedTo:e.get("relatedTo"),designOptions:"designTab",advanced:"advancedTab",containerFor:e.get("containerFor")}}}},"./public/components/layoutHelpers/tinymce/fontFamily/getUsedFonts.js":function(e,t,a){"use strict";function i(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var i=0,l=function(){};return{s:l,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,r=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw r}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,i=new Array(t);a-1?n:"all"};t.default=function(e){var t,a={},n=i(e.querySelectorAll("*"));try{for(n.s();!(t=n.n()).done;){var s=t.value,o=window.getComputedStyle(s),c=o.fontFamily;c=c.replace(/^\s*['"]([^'"]*)['"]\s*$/,"$1").trim();var u=l.map((function(e){return e.family.toLowerCase()})).indexOf(c.toLowerCase());if(u>-1){var d=o.fontStyle,v=o.fontWeight,p=r(d,v,u);Object.prototype.hasOwnProperty.call(a,c)?a[c].variants.indexOf("all")<0&&a[c].variants.indexOf(p)<0&&a[c].variants.push(p):a[c]={variants:[p],subsets:l[u].subsets}}}}catch(m){n.e(m)}finally{n.f()}return Object.keys(a).forEach((function(e){a[e].variants.indexOf("all")>-1&&delete a[e].variants})),a}},"./public/components/layoutHelpers/tinymce/fontFamily/tinymceFontsSelect.jquery.js":function(e,t){"use strict";t.default=function(e){var t=e.jQuery;if(!e.vcvTinymcePluginInitialized){e.vcvTinymcePluginInitialized=!0;var a=function(e){e?e.closest(".vcv-ui-tinymce-fonts-selectbox").removeClass("mce-active"):t(".vcv-ui-tinymce-fonts-selectbox").removeClass("mce-active"),document.body.removeEventListener("click",i)},i=function(e){e&&e.preventDefault();var i=t(e.target),n=i.closest(".vcv-ui-tinymce-fonts-selectbox-options")||i.closest(".vcv-ui-tinymce-fonts-selectbox");n&&n.length||a()};t("body").on("click.vcvuitinymcefontsselectbox.data-api touchstart.vcvuitinymcefontsselectbox.data-api",".vcv-ui-tinymce-fonts-selectbox [data-toggle=vcv-ui-tinymce-fonts-selectbox]",(function(e){e&&e.preventDefault();var n=t(this);if(n.is(".disabled, :disabled"))return!1;var l=n.closest(".vcv-ui-tinymce-fonts-selectbox"),r=l.hasClass("mce-active");if(a(n),!r){l.toggleClass("mce-active");var s=l.find(".vcv-ui-tinymce-fonts-selectbox-font-family").val();if(s){var o=JSON.parse(s);l.find('[role=option] > li > [data-option*="'+(o.value||o.family)+'"]').focus()}var c=l.closest(".vcv-ui-tree-content");if(c.length){var u=l.offset().left,d=c.offset().left,v=c.width(),p=l.find(".vcv-ui-tinymce-fonts-selectbox-options"),m=p.width();u+m>d+v?p.css("left",d+v-(u+m)-10+"px"):p.css("left",0)}}return r?document.body.removeEventListener("click",i):document.body.addEventListener("click",i),!1})).on("click.vcvuitinymcefontsselectbox.data-api",".vcv-ui-tinymce-fonts-selectbox [role=option] > li > a",(function(e){var i=t(this);if(e.preventDefault(),e.stopPropagation(),i.is(".disabled, :disabled"))return!1;var n=i.closest(".vcv-ui-tinymce-fonts-selectbox"),l=n.find(".vcv-ui-tinymce-fonts-selectbox-label"),r=n.find(".vcv-ui-tinymce-fonts-selectbox-font-family");l.html(i.html()),r.removeData(),r.val(JSON.stringify(i.data("option"))),t.each(i.data(),(function(e,t){r.data(e,t)})),r.trigger("change"),a(i)})).on("propertychange.vcvuitinymcefontsselectbox.data-api change.vcvuitinymcefontsselectbox.data-api input.vcvuitinymcefontsselectbox.data-api paste.vcvuitinymcefontsselectbox.data-api",".vcv-ui-tinymce-fonts-selectbox-filter",(function(){var e=t(this),a=e.closest(".vcv-ui-tinymce-fonts-selectbox"),i=t("[role=option] li",a);i.hide(),i.filter((function(){return-1!==t(this).text().toUpperCase().indexOf(e.val().toUpperCase())})).show()}))}}},"./public/components/layoutHelpers/tinymce/tinymceVcvHtmleditorPlugin.js":function(e,t,a){"use strict";a.d(t,{default:function(){return b}});var i=function(e){e.addCommand("mceApplyTextFont",(function(t){!function(e,t){e.undoManager.transact((function(){e.focus(),e.formatter.apply("fontname",{value:t}),e.nodeChanged()}))}(e,t)})),e.addCommand("mceRemoveTextFont",(function(t){!function(e,t){e.undoManager.transact((function(){e.focus(),e.formatter.remove("fontname",{value:t},null,!0),e.nodeChanged()}))}(e,t)}))},n=a("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),l=a("./node_modules/webfontloader/webfontloader.js"),r=a.n(l);function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function o(e){for(var t=1;t2&&void 0!==arguments[2])||arguments[2],i=document.querySelector("#vcv-editor-iframe"),n=i&&i.contentWindow,l={};n&&(l.context=n),r().load(o({google:{families:["".concat(t)]}},l)),a&&(l={},e.getWin()&&(l.context=e.getWin()),r().load(o({google:{families:["".concat(t)]}},l)))},u=a("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),d=a("./public/sources/attributes/googleFonts/lib/google-fonts-set.json").families,v=function(){return[{family:"Default Font",value:"inherit",defaultFont:!0}].concat([{family:"Andale Mono",value:"andale mono,monospace",defaultFont:!0},{family:"Arial",value:"arial,helvetica,sans-serif",defaultFont:!0},{family:"Arial Black",value:"arial black,sans-serif",defaultFont:!0},{family:"Book Antiqua",value:"book antiqua,palatino,serif",defaultFont:!0},{family:"Comic Sans MS",value:"comic sans ms,sans-serif",defaultFont:!0},{family:"Courier New",value:"courier new,courier,monospace",defaultFont:!0},{family:"Georgia",value:"georgia,palatino,serif",defaultFont:!0},{family:"Helvetica",value:"helvetica,arial,sans-serif",defaultFont:!0},{family:"Impact",value:"impact,sans-serif",defaultFont:!0},{family:"Symbol",value:"symbol",defaultFont:!0},{family:"Tahoma",value:"tahoma,arial,helvetica,sans-serif",defaultFont:!0},{family:"Terminal",value:"terminal,monaco,monospace",defaultFont:!0},{family:"Times New Roman",value:"times new roman,times,serif",defaultFont:!0},{family:"Trebuchet MS",value:"trebuchet ms,geneva,sans-serif",defaultFont:!0},{family:"Verdana",value:"verdana,geneva,sans-serif",defaultFont:!0},{family:"Webdings",value:"webdings",defaultFont:!0},{family:"Wingdings",value:"wingdings,zapf dingbats",defaultFont:!0}],(0,u.default)(d))},p=function(e,t){var a=t.jQuery,i=function(e){var t;return e.dom.getParents(e.selection.getStart(),(function(e){var a=e.style["font-family"];a&&(t=t?t.replace(/"/g,""):a.replace(/"/g,""))})),t};e.addButton("VcvFontsSelect",{type:"VcvFontsSelect",tooltip:"Font family",onPostRender:function(e){return function(t){var n=t.control,l=a(n.$el);var r=l.find(".vcv-ui-tinymce-fonts-selectbox-font-family"),s=n.$el.find(".vcv-ui-tinymce-fonts-selectbox-label"),o=v();e.on("init nodeChange",(function(){var t,a=i(e),c=!!a&&o.find((function(e){return e.value?e.value.replace(/\s/g,"")===a.replace(/\s/g,""):e.family.replace(/\s/g,"")===a.replace(/\s/g,"")}));c?(n.state.set("value",c),s.html(a?c?c.family:a:"Default Font"),r.val(JSON.stringify(c))):(s.html(a||"Default Font"),r.val(a||""),n.state.set("value","")),(t=l).is(".vcv-ui-tinymce-fonts-selectbox")?t.removeClass("mce-active"):t.closest(".vcv-ui-tinymce-fonts-selectbox").removeClass("mce-active")})),r.on("change",(function(){if(n.state.set("value",this.value),this.value){var t=JSON.parse(this.value);n.state.set("value",t),e.execCommand("mceApplyTextFont",t.value||t.family),t.defaultFont||c(e,t.family)}else e.execCommand("mceRemoveTextFont",i(e))}))}}(e)})},m=function(e,t){var a={100:"Thin",200:"Extra Light",300:"Light",400:"Normal",500:"Medium",600:"Semi Bold",700:"Bold",800:"Extra Bold",900:"Black"},i=function(e){var t=e.match(/\d+/g),a=e.match(/[a-z]+$/i);return{weight:t?t[0]:"400",style:a&&"italic"===a[0]?"italic":"regular"}},n=function(e){var t=i(e),n=a[t.weight],l="italic"===t.style?" Italic":" Regular";return"".concat(n," (").concat(t.weight,")")+l},l=function(e,t){var a=e;if(!a){var l=t.controlManager,r=l&&l.buttons&&l.buttons.VcvFontsSelect&&l.buttons.VcvFontsSelect.state;a=r&&r.data&&r.data.value}var s=[],o={text:"Default",value:JSON.stringify({weight:"inherit",style:"inherit"}),textStyle:"font-weight:inherit"};return a&&!a.defaultFont?a.variants.forEach((function(e){var t=i(e);s.push({text:n(e),value:JSON.stringify(t),textStyle:"font-weight:".concat(t.weight)})})):s=[{text:"Normal (400) Regular",value:JSON.stringify({weight:"400",style:"regular"}),textStyle:"font-weight:normal"},{text:"Bold (700) Regular",value:JSON.stringify({weight:"700",style:"regular"}),textStyle:"font-weight:bold"}],s=[o].concat((0,u.default)(s))},r=l(null,e);e.addButton("fontWeight",{type:"listbox",text:"Font Weight",tooltip:"Font Weight",icon:!1,fixedWidth:!0,onselect:function(t){var a=t.control.settings.value;if(a){var i=JSON.parse(a);e.formatter.toggle("fontweight",{value:i.weight}),e.formatter.toggle("fontstyle",{value:"regular"===i.style?"normal":i.style});var n=e.controlManager;n&&n.buttons&&n.buttons.fontWeight&&n.buttons.fontWeight.classes.remove("active"),e.nodeChanged(),e.fire("change")}},values:r,onPostRender:function(e){return function(){this.state.set("value",null),e.on("init nodeChange",(function(){var a=l(null,e),i=function(){var a=function(e){var t=e.selection.getRng&&e.selection.getRng(),a=t&&t.startContainer;return a?3===a.nodeType?a.parentNode:a:null}(e);if(a){var i="inherit"===a.style.fontWeight,n=t.getComputedStyle(a),l=n.fontWeight,r=n.fontStyle;return{weight:i?"inherit":l,style:i?"inherit":r}}return""}(),n=function(e,t){var a="normal"===e.style?"regular":e.style,i={};return t.forEach((function(t){var n=JSON.parse(t.value);n&&n.style===a&&n.weight===e.weight&&(i.value=t.value,i.text=t.text)})),i}(i,a);!function(e,t,a,i,n){var l=t.controlManager,r=l&&l.buttons&&l.buttons.fontWeight&&l.buttons.fontWeight;r&&(r._values=a,i&&(r.state.set("value",i),r.state.set("text",n)),r.state.set("menu",a))}(0,e,a,n.value,n.text)}))}}(e)})},f=function(e){var t="Default 8pt 10pt 12pt 14pt 16pt 18pt 24pt 36pt 42pt 48pt 56pt 64pt 80pt 96pt".split(" ").map((function(e){var t=e,a="Default"===e?"inherit":e,i=e.split("=");return i.length>1&&(t=i[0],a=i[1]),{text:t,value:a}}));e.addButton("fontSizeSelectAdvanced",{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",fixedWidth:!0,values:t,onPostRender:function(e,t){var a=function(e,t){return/[0-9.]+px$/.test(e)?function(e,t){var a=Math.pow(10,t);return Math.round(e*a)/a}(72*parseInt(e,10)/96,t||0)+"pt":e},i=function(e,t,a){var i;return e.forEach((function(e){e.value===a?i=a:e.value===t&&(i=t)})),i};return function(){var n=this;e.on("init nodeChange",(function(){var l,r,s,o=e.queryCommandValue("FontSize");if(o)for(r=3;!s&&r>=0;r--)l=a(o,r),s=i(t,l,o);n.value(s||null),s||n.text(l)}))}}(e,t),onselect:function(t){var a=t.control.settings.value;a&&e.execCommand("FontSize",!1,a)}})},h=function(e){var t=[];"Default 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5 3".split(" ").forEach((function(e){var a=e,i="Default"===e?"inherit":e,n=e.split("=");n.length>1&&(a=n[0],i=n[1]),t.push({text:a,value:i})})),e.addButton("lineHeight",{type:"listbox",text:"Line Height",tooltip:"Line Height",fixedWidth:!0,values:t,onPostRender:function(e,t){return function(){var a=this;e.on("nodeChange",(function(i){var n=e.formatter,l=null;i.parents.forEach((function(e){if(t.forEach((function(t){if(n.matchNode(e,"lineheight",{value:t.value})&&(l=t.value),l)return!1})),l)return!1})),a.value(l)}))}}(e,t),onselect:function(t){var a=t.control.settings.value;a&&(e.formatter.apply("lineheight",{value:a}),e.fire("change"))}})},g=function(e){var t="Default 1px 2px 3px 4px 5px 6px 7px 8px 9px 10px 15px 25px 30px 35px".split(" ").map((function(e){var t=e,a="Default"===e?"inherit":e,i=e.split("=");return i.length>1&&(t=i[0],a=i[1]),{text:t,value:a}}));e.addButton("letterSpacing",{type:"listbox",text:"Letter Spacing",tooltip:"Letter Spacing",fixedWidth:!0,values:t,onPostRender:function(e,t){return function(){var a=this;e.on("nodeChange",(function(i){var n="letterspacing",l=e.formatter,r=null;i.parents.forEach((function(e){if(t.forEach((function(t){if(n?l.matchNode(e,n,{value:t.value})&&(r=t.value):l.matchNode(e,t.value)&&(r=t.value),r)return!1})),r)return!1})),a.value(r)}))}}(e,t),onselect:function(t){var a=t.control.settings.value;a&&(e.formatter.apply("letterspacing",{value:a}),e.fire("change"))}})},y=function(e){return e.ui.Widget.extend({renderHtml:function(){var e,t,a=this._id;return'
\n \n \n
\n
\n \n
\n
\n
    ').concat((e=[],t=22,v().forEach((function(a){var i="";"Default Font"!==a.family?(i="background-position: 10px ".concat(t-22,"px;"),t-=22):i="background: none;text-indent: 0;",e.push('
  • ").concat(a.family,"
  • "))})),e.join("")),"
\n
\n
\n
")}})},b=function(e,t){var a=e.util.Tools.resolve("tinymce.PluginManager");a.vcvhtmleditor||(a.vcvhtmleditor=!0,a.add("vcvhtmleditor",(function(a){var n=y(e);e.ui.VcvFontsSelect=n,e.util.Tools.resolve("tinymce.ui.Factory").add("VcvFontsSelect",n),i(a),p(a,t),m(a,t),f(a,t),h(a,t),g(a,t),a.on("init",(function(){a.formatter.register("fontweight",{inline:"span",toggle:!1,styles:{fontWeight:"%value"},clear_child_styles:!0}),a.formatter.register("fontstyle",{inline:"span",toggle:!1,styles:{fontStyle:"%value"},clear_child_styles:!0}),a.formatter.register("lineheight",{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",toggle:!1,styles:{lineHeight:"%value"},clear_child_styles:!0}),a.formatter.register("letterspacing",{selector:"span,figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",toggle:!1,styles:{letterSpacing:"%value"},clear_child_styles:!0})}))})))}},"./public/components/panels/hub/categoriesSettings.js":function(e,t,a){"use strict";a.d(t,{default:function(){return l}});var i=a("./node_modules/vc-cake/index.js"),n=(0,i.getService)("roleManager");function l(){return{element:{index:0,type:"element",title:"Elements",visible:n.can("hub_elements_templates_blocks",n.defaultTrue()),subControls:[{title:"Free",type:"free"},{title:"Premium",type:"premium"}]},template:{index:1,type:"template",title:"Templates",visible:n.can("hub_elements_templates_blocks",n.defaultTrue()),subControls:[{title:"Free",type:"free"},{title:"Premium",type:"premium"}]},block:{index:2,type:"block",title:"Blocks",visible:n.can("hub_elements_templates_blocks",n.defaultTrue()),templateType:!0},addon:{index:3,type:"addon",title:"Addons",visible:n.can("hub_addons",n.defaultTrue())},hubHeader:{index:4,type:"hubHeader",title:"Headers",visible:n.can("hub_headers_footers_sidebars",n.defaultTrue()),templateType:!0},hubFooter:{index:5,type:"hubFooter",title:"Footers",visible:n.can("hub_headers_footers_sidebars",n.defaultTrue()),templateType:!0},hubSidebar:{index:6,type:"hubSidebar",title:"Sidebars",visible:n.can("hub_headers_footers_sidebars",n.defaultTrue()),templateType:!0},unsplash:{index:7,type:"unsplash",title:"Stock Images",visible:n.can("hub_unsplash",n.defaultTrue())},giphy:{index:8,type:"giphy",title:"Giphy",visible:n.can("hub_giphy",n.defaultTrue())}}}},"./public/components/panels/treeView/treeViewLayout.js":function(e,t,a){"use strict";a.d(t,{default:function(){return pe}});var i,n=a("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),l=a("./node_modules/@babel/runtime/helpers/esm/createClass.js"),r=a("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),s=a("./node_modules/@babel/runtime/helpers/esm/inherits.js"),o=a("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),c=a("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),u=a("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),d=a("./node_modules/vc-cake/index.js"),v=a("./node_modules/react/index.js"),p=a("./node_modules/@babel/runtime/helpers/esm/extends.js"),m=a("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),f=a("./node_modules/classnames/index.js"),h=a.n(f),g=a("./node_modules/mobile-detect/mobile-detect.js"),y=a.n(g),b=a("./public/components/elementControls/controlHelpers.js"),C=(0,d.getStorage)("workspace"),k=(0,d.getStorage)("elements"),x=(0,d.getService)("utils"),w=(0,d.getService)("cook"),S=(0,d.getService)("hubElements"),E=(0,d.getService)("document"),L=(0,d.getService)("dataManager"),T=(0,d.getService)("roleManager"),D=document.getElementById("wpadminbar"),R=document.querySelector(".vcv-layout-bar"),P=null===(i=document.getElementById("vcv-editor-iframe"))||void 0===i?void 0:i.contentWindow.document,O=!1,j=new(y())(window.navigator.userAgent);j.mobile()&&(j.tablet()||j.phone())&&(O=!0);var A=L.get("localizations"),M=A?A.add:"Add",N=A?A.addElement:"Add Element",_=A?A.clone:"Clone",B=A?A.copy:"Copy",I=A?A.paste:"Paste",F=A?A.pasteAfter:"Paste After",V=A?A.remove:"Remove",H=A?A.edit:"Edit",U=function(e){var t,a,i,n,l,r,s,o,c,u=(0,v.useState)(e.level>1||O),f=(0,m.default)(u,2),g=f[0],y=f[1],j=(0,v.useState)(!1),U=(0,m.default)(j,2),z=U[0],$=U[1],K=(0,v.useState)(!1),G=(0,m.default)(K,2),q=G[0],Z=G[1],Y=(0,v.useState)(!1),J=(0,m.default)(Y,2),Q=J[0],X=J[1],ee=e.elementData,te=(0,v.useState)(!1),ae=(0,m.default)(te,2),ie=ae[0],ne=ae[1],le=(0,v.useState)(window.localStorage&&(window.localStorage.getItem("vcv-copy-data")||C.state("copyData").get())),re=(0,m.default)(le,2),se=re[0],oe=re[1],ce=(0,v.useRef)(null),ue=(0,v.useRef)(null),de=(0,v.useRef)(null),ve=(0,v.useRef)(null),pe=(0,v.useRef)(null),me=(0,v.useCallback)((function(t){var a,i;return(null==e||null===(a=e.controls)||void 0===a?void 0:a.length)&&(null==e?void 0:e.controls.indexOf(t))>-1||!(null!=e&&null!==(i=e.controls)&&void 0!==i&&i.length)})),fe=(0,v.useCallback)((function(e){if(null!=e&&e.element||"vcv-copy-data"===e.key){var t="vcv-copy-data"===e.key?JSON.parse(e.newValue):e;oe(t)}}),[]);if((0,v.useEffect)((function(){return null!=ee&&ee.id&&e.onMountCallback(ee.id),C.state("copyData").onChange(fe),window.addEventListener("storage",fe),function(){null!=ee&&ee.id&&e.onUnmountCallback(ee.id),C.state("copyData").ignoreChange(fe),C.state("userInteractWith").set(!1),window.removeEventListener("storage",fe)}}),[null==ee?void 0:ee.id]),(0,v.useEffect)((function(){ie&&ce&&ce.current.focus()}),[ie]),(0,v.useEffect)((function(){var t,a,i,n;(null!==(t=e.elementData)&&void 0!==t&&t.customHeaderTitle||null!==(a=e.elementData)&&void 0!==a&&a.name)&&(ce.current.innerText=(null===(i=e.elementData)||void 0===i?void 0:i.customHeaderTitle)||(null===(n=e.elementData)||void 0===n?void 0:n.name))}),[null===(t=e.elementData)||void 0===t?void 0:t.customHeaderTitle,null===(a=e.elementData)||void 0===a?void 0:a.name]),!e.elementData)return null;var he=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=C.state("settings").get();a&&"edit"===a.action&&C.state("settings").set(!1);var i={};e.isAttribute&&(i.child=!0,i.parentElementId=ee.parent,i.parentElementOptions={}),C.trigger("edit",ee.id,t,i)},ge=function(e){e&&e.preventDefault(),C.trigger("remove",ee.id)},ye=function(){!function(t){var a=w.get(e.elementData);a.set("customHeaderTitle",t);var i=a.toJS();k.trigger("update",i.id,i,"editForm"),ne(!1)}(ce?ce.current.innerText.trim():"")},be=function(e){e&&e.target&&ue&&!ue.current.contains(e.target)&&!de.current.contains(e.target)&&Ce()},Ce=function(){var e=q?"removeEventListener":"addEventListener";window[e]&&window[e]("touchstart",be),Z(!q)},ke=function(){X(!0)},xe=function(){X(!1)},we=ee.hidden,Se="";Se=we?A?A.hideOn:"Hide Element":A?A.hideOff:"Show Element";var Ee=A?A.lockedElementText:"The element has been locked by your site Administrator.",Le=A?A.elementIsHidden:"Element is Hidden",Te=ee&&w.get(ee);if(!Te)return null;var De=(0,d.env)("VCV_ADDON_ROLE_MANAGER_ENABLED")&&Te.get("metaIsElementLocked")&&!T.can("editor_settings_element_lock",T.defaultAdmin()),Re=Te.get("metaIsDraggable"),Pe=T.can("editor_content_element_add",T.defaultTrue()),Oe=h()({"vcv-ui-tree-layout-node-child":!0,"vcv-ui-tree-layout-node-expand":g,"vcv-ui-tree-layout-node-state-draft":!1,"vcv-ui-tree-layout-node-hidden":we,"vcv-ui-tree-layout-node-non-draggable":void 0!==Re&&!Re||De}),je={},Ae=null,Me=E.children(ee.id),Ne=function(t){if(!g&&!z&&!O)return null;var a=e.onMountCallback,i=e.onUnmountCallback,n=e.level+1,l=t.map((function(t){return v.createElement(W,{onMountCallback:a,onUnmountCallback:i,id:t.id,key:t.id,level:n,scrollValue:e.scrollValue})}),undefined);return l.length?v.createElement("ul",{className:"vcv-ui-tree-layout-node"},l):""}(Me),_e=!1;if(Te.containerFor().length){var Be=N,Ie="",Fe=w.getContainerChildren(Te.get("tag"));1===Fe.length&&(Ie=Fe[0].tag,Be="".concat(M," ").concat(Fe[0].name)),Pe&&(_e=v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:Be,onClick:function(){return e=Ie,void C.trigger("add",ee.id,e);var e}},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-add-thin"})))}var Ve="";Me.length&&(Ve=v.createElement("i",{className:"vcv-ui-tree-layout-node-expand-trigger vcv-ui-icon vcv-ui-icon-expand",onClick:function(){y(!g),$(!0)}}));var He="";if("column"!==e.elementData.tag){var Ue=h()({"vcv-ui-icon":!0,"vcv-ui-icon-eye-on":!we,"vcv-ui-icon-eye-off":we});He=v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:Se,onClick:function(){C.trigger("hide",ee.id)}},v.createElement("i",{className:Ue}))}var ze=!1,$e=De||!Pe?null:v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:B,onClick:function(e){e&&e.preventDefault();var t={},a=w.getById(ee.id),i=a.get("tag"),n=a.getAll();"vcv_layouts"===L.get("editorType")&&("layoutContentArea"===i||n.sourceItem&&"postsGridDataSourceArchive"===n.sourceItem.tag)&&(t.editorTypeRelation=L.get("editorType"),t.elementTag="layoutContentArea"===i?"layoutContentArea":"postsGridDataSourceArchive"),C.trigger("copy",ee.id,i,t)}},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-copy-icon"})),Ke=De||!Pe?null:v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:_,onClick:function(e){e&&e.preventDefault(),C.trigger("clone",ee.id)}},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-copy"})),We=Te.get("metaElementControls");We&&(!1===We.copy&&($e=null),!1===We.clone&&(Ke=null));var Ge=Te&&Te.get("containerFor");if((null==Ge||null===(i=Ge.value)||void 0===i?void 0:i.length)&&!De&&Pe){var qe=b.ControlHelpers.getPasteOptions(se,ee),Ze={};qe.disabled&&(Ze.disabled=!0),Ze.disabled||(We&&!1===We.pasteAfter&&qe.pasteAfter?Ze.disabled=!0:Ze.onClick=qe.pasteAfter?function(e){e&&e.preventDefault(),C.trigger("pasteAfter",ee.id)}:function(e){e&&e.preventDefault(),C.trigger("paste",ee.id)}),ze=v.createElement("span",(0,p.default)({className:"vcv-ui-tree-layout-control-action",title:qe.pasteAfter?F:I},Ze),v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-paste-icon"}))}var Ye=De?null:v.createElement("span",{className:"vcv-ui-tree-layout-control-actions"},_e,v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:H,onClick:function(){return he("")}},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-edit"})),Ke,He,$e,ze,v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:V,onClick:ge},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-trash"}))),Je=null,Qe=T.can("editor_settings_element_lock",T.defaultAdmin()),Xe=Te.relatedTo("General")||Te.relatedTo("RootElements"),et=Te.get("metaIsElementLocked")&&(0,d.env)("VCV_ADDON_ROLE_MANAGER_ENABLED"),tt=et?v.createElement("span",{className:"vcv-ui-tree-layout-control-state vcv-ui-tree-layout-control--lock",title:Ee},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-lock-fill"})):null,at=Te.get("hidden")?v.createElement("span",{className:"vcv-ui-tree-layout-control-state",title:Le},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-eye-off"})):null;if(!e.isAttribute&&(0,d.env)("VCV_ADDON_ROLE_MANAGER_ENABLED")&&Qe&&Xe){var it=h()({"vcv-ui-icon":!0,"vcv-ui-icon-lock-fill":et,"vcv-ui-icon-unlock-fill":!et}),nt=A?A.lockElementText:"Lock Element";Je=v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:nt,onClick:function(){var e={};w.getById(ee.id).containerFor().length>0&&(e.lockInnerElements=!0,e.action=E.get(ee.id).metaIsElementLocked?"unlock":"lock"),C.trigger("lock",ee.id,e)}},v.createElement("i",{className:it}))}var lt=[me("addChild")&&_e,me("clone")&&Ke,me("visibility")&&He,me("copy")&&$e,me("paste")&&ze],rt=v.createElement("div",{ref:pe},lt),st=(null==ve||null===(n=ve.current)||void 0===n||null===(l=n.getBoundingClientRect())||void 0===l?void 0:l.width)||0,ot=ve.current?Array.from(ve.current.children):[],ct=0;ot.forEach((function(e){ct+=e.getBoundingClientRect().width}));var ut=(null==pe||null===(r=pe.current)||void 0===r||null===(s=r.getBoundingClientRect())||void 0===s?void 0:s.width)||0,dt=sts&&l.top>s;if((r?l.bottomn&&i.top>n;if(i.bottom<0&&i.top<0||l){var r=0;(e.target.classList.contains("vcv-ui-tree-layout-control-action--edit")||e.target.classList.contains("vcv-ui-icon-edit"))&&(r=500),window.setTimeout((function(){a.scrollIntoView({behavior:"smooth"})}),r)}}}(t)}},Ae,v.createElement("div",{className:"vcv-ui-tree-layout-control-content"},Ve,v.createElement("i",{className:"vcv-ui-tree-layout-control-icon"},v.createElement("img",{src:gt,className:"vcv-ui-icon",alt:""})),v.createElement("span",{className:bt},St),pt),ft),Ne)};U.displayName="TreeViewElement";var z=U,$=a("./node_modules/react-redux/es/index.js"),K=function(e){return v.createElement(z,e)};K.displayName="TreeViewElementWrapper";var W=(0,$.connect)((function(e,t){return{isElementHovered:e.controls.outlineData.id===t.id,elementData:e.document.documentData[t.id]}}))(K),G=a("./public/components/dnd/dndDataSet.js"),q=(0,d.getStorage)("workspace"),Z=function(){function e(){(0,n.default)(this,e),Object.defineProperties(this,{iframe:{value:null,writable:!0,enumerable:!1,configurable:!0},documentDOM:{value:null,writable:!0,enumerable:!1,configurable:!0},items:{value:null,writable:!0,enumerable:!1,configurable:!0},sidebarContent:{value:document.querySelector(".vcv-layout-bar-content"),writable:!1,enumerable:!1,configurable:!0}})}return(0,l.default)(e,[{key:"buildItems",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=e?".vcv-ui-edit-form-section-content .vcv-ui-tree-layout-container .vcv-ui-scroll-content":".vcv-ui-tree-layout-container .vcv-ui-scroll-content";t||(t=e?".vcv-ui-edit-form-section-content .vcv-ui-tree-layout":".vcv-ui-tree-layout"),this.items||(this.scrollContainer=document.querySelector(a),this.items=new G.default(document.querySelector(t),{cancelMove:!0,moveCallback:this.move.bind(this),startCallback:this.start.bind(this),endCallback:this.end.bind(this),document:document,container:document.getElementById("vcv-layout"),handler:"> .vcv-ui-tree-layout-control .vcv-ui-tree-layout-control-drag-handler",helperType:"clone",customScroll:!0,scrollContainer:this.scrollContainer,scrollCallback:this.scrollTo.bind(this),isAttribute:e}),this.items.init())}},{key:"scrollTo",value:function(e){if(this.scroll=!1,!e.end&&this.sidebarContent&&this.scrollContainer){var t=this.scrollContainer.getBoundingClientRect(),a=0;e.y-t.top<=50?a=-4:t.height+t.top<=e.y+50&&(a=4),a&&(this.scroll=!0,this.scrollContent(a))}}},{key:"scrollContent",value:function(e){var t=this;if(this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=null),this.scroll){var a=this.scrollContainer&&(this.scrollContainer.scrollY||this.scrollContainer.scrollTop),i=this.scrollContainer&&(this.scrollContainer.scrollX||this.scrollContainer.scrollLeft);if(void 0===a||void 0===i)return;this.scrollContainer.scroll?this.scrollContainer.scroll(i,a+e):this.scrollContainer.scrollTop=a+e,this.scrollTimeout=setTimeout((function(){t.scrollContent(e)}),30)}}},{key:"getOffsetTop",value:function(){return this.iframe?this.iframe.getBoundingClientRect().top:0}},{key:"updateOffsetTop",value:function(){this.items.option("offsetTop",this.getOffsetTop())}},{key:"removeItems",value:function(){this.items=null,q.state("navbarPosition").ignoreChange(this.updateOffsetTop.bind(this))}},{key:"add",value:function(e,t,a){this.buildItems(t,a),this.items.addItem(e,this.documentDOM)}},{key:"remove",value:function(e,t){var a=this;this.buildItems(t,""),this.items.removeItem(e),window.setTimeout((function(){document.querySelector(".vcv-ui-tree-layout")||a.removeItems()}),0)}},{key:"update",value:function(e){this.buildItems(),this.items.updateItem(e,this.documentDOM)}},{key:"move",value:function(e,t,a){e&&a&&q.trigger("move",e,{action:t,related:a})}},{key:"start",value:function(){document.body.classList.add("vcv-is-no-selection")}},{key:"end",value:function(){document.body.classList.remove("vcv-is-no-selection")}}]),e}(),Y=a("./public/components/scrollbar/scrollbar.tsx"),J=a.n(Y),Q=a("./node_modules/lodash/lodash.js"),X=a.n(Q),ee=a("./node_modules/prop-types/index.js"),te=a.n(ee);function ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,c.default)(e);if(t){var n=(0,c.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,o.default)(this,a)}}var ie=(0,d.getStorage)("elements"),ne=(0,d.getStorage)("workspace"),le=(0,d.getStorage)("layout"),re=(0,d.getStorage)("workspace").state("settings"),se=(0,d.getStorage)("workspace").state("content"),oe=ne.state("treeViewId"),ce=(0,d.getService)("document"),ue=(0,d.getService)("cook"),de=(0,d.getService)("dataManager"),ve=(0,d.getService)("roleManager"),pe=function(e){(0,s.default)(a,e);var t=ae(a);function a(e){var i;(0,n.default)(this,a),i=t.call(this,e),(0,u.default)((0,r.default)(i),"layoutContainer",null),(0,u.default)((0,r.default)(i),"scrollbar",null),(0,u.default)((0,r.default)(i),"scrollTimeout",0),(0,u.default)((0,r.default)(i),"onContentChangeHandleScroll",(function(e){var t=setTimeout((function(){e&&i.handleScrollToElement(e),clearTimeout(t)}),1)})),i.updateElementsData=X().debounce(i.updateElementsData.bind((0,r.default)(i)),250),i.handleScrollToElement=i.handleScrollToElement.bind((0,r.default)(i)),i.interactWithContent=i.interactWithContent.bind((0,r.default)(i)),i.handleAddElement=i.handleAddElement.bind((0,r.default)(i)),i.handleAddTemplate=i.handleAddTemplate.bind((0,r.default)(i)),i.handleElementMount=i.handleElementMount.bind((0,r.default)(i)),i.handleElementUnmount=i.handleElementUnmount.bind((0,r.default)(i)),i.scrollBarMounted=i.scrollBarMounted.bind((0,r.default)(i)),i.getScrollbarContent=i.getScrollbarContent.bind((0,r.default)(i)),i.setVisibility=i.setVisibility.bind((0,r.default)(i)),i.hasElementControl=i.hasElementControl.bind((0,r.default)(i)),i.dnd=new Z;var l=e.isAttribute?ce.children(e.element.get("id")):ce.children(!1);return i.state={data:l,selectedItem:null,outlineElementId:!1,isVisible:e.isAttribute||"treeView"===se.get()},i}return(0,l.default)(a,[{key:"componentDidMount",value:function(){var e=this;ie.state("document").onChange(this.updateElementsData),le.state("userInteractWith").onChange(this.interactWithContent),this.props.isAttribute?ie.on("element:".concat(this.props.element.get("id")),this.updateElementsData):se.onChange(this.setVisibility),this.scrollTimeout=setTimeout((function(){e.handleScrollToElement(oe.get())}),1),oe.onChange(this.onContentChangeHandleScroll)}},{key:"componentWillUnmount",value:function(){this.updateElementsData.cancel(),ie.state("document").ignoreChange(this.updateElementsData),le.state("userInteractWith").ignoreChange(this.interactWithContent),oe.ignoreChange(this.onContentChangeHandleScroll),this.scrollTimeout&&(window.clearTimeout(this.scrollTimeout),this.scrollTimeout=0),this.props.isAttribute?ie.off("element:".concat(this.props.element.get("id")),this.updateElementsData):se.ignoreChange(this.setVisibility)}},{key:"hasElementControl",value:function(e){var t,a,i,n,l;return(null===(t=this.props)||void 0===t||null===(a=t.controls)||void 0===a?void 0:a.length)&&(null===(i=this.props)||void 0===i?void 0:i.controls.indexOf(e))>-1||!(null!==(n=this.props)&&void 0!==n&&null!==(l=n.controls)&&void 0!==l&&l.length)}},{key:"setVisibility",value:function(e){var t=this.props.isAttribute?ce.children(this.props.element.get("id")):ce.children(!1);this.setState({isVisible:"treeView"===e,data:t})}},{key:"updateElementsData",value:function(e){var t,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(a&&"singleElement"===a){var i=this.state.data,n=i.findIndex((function(t){return t.id===e.id}));i[n]=e,t=i}else t=e;this.props.isAttribute&&(t=ce.children(this.props.element.get("id"))),this.setState({data:t})}},{key:"interactWithContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setState({outlineElementId:e})}},{key:"expandTree",value:function(e){e.classList.contains("vcv-ui-tree-layout")||(e.classList.contains("vcv-ui-tree-layout-node-child")&&!e.classList.contains("vcv-ui-tree-layout-node-expand")&&e.querySelector(".vcv-ui-tree-layout-node-expand-trigger").click(),this.expandTree(e.parentElement))}},{key:"getExistingParent",value:function(e){var t=ce.get(e).parent,a=this.layoutContainer.querySelector('[data-vcv-element="'.concat(t,'"]'));return a||this.getExistingParent(t)}},{key:"scrollBarMounted",value:function(e){this.scrollbar=e,this.handleScrollToElement(oe.get())}},{key:"handleScrollToElement",value:function(e){if(e&&this.scrollbar&&this.layoutContainer){var t=this.layoutContainer.querySelector(".vcv-ui-tree-layout").getBoundingClientRect(),a=this.layoutContainer.querySelector('[data-vcv-element="'.concat(e,'"]'));a||(this.expandTree(this.getExistingParent(e)),a=this.layoutContainer.querySelector('[data-vcv-element="'.concat(e,'"]'))),this.expandTree(a);var i=a.getBoundingClientRect().top-t.top;this.interactWithContent(e),this.scrollbar.scrollTop(i),oe.set(null)}}},{key:"getElements",value:function(){var e=this,t=[];return this.state.data&&(t=this.state.data.map((function(t){return v.createElement(W,{id:t.id,key:"tree-view-"+t.id,level:1,onMountCallback:e.handleElementMount,onUnmountCallback:e.handleElementUnmount,scrollValue:e.props.scrollValue,isAttribute:e.props.isAttribute,controls:e.props.controls,updateElementsData:e.updateElementsData})}),this)),t}},{key:"handleElementMount",value:function(e){var t=ue.getById(e).get("metaIsDraggable");if(void 0===t||t){var a="",i=ce.getTopParent(e),n=ue.getById(i).get("metaIsDraggable");void 0===n||n||this.props.isAttribute||(a='[data-vcv-element="'.concat(i,'"]')),this.dnd.add(e,this.props.isAttribute,a)}}},{key:"handleElementUnmount",value:function(e){this.dnd.remove(e,this.props.isAttribute)}},{key:"handleAddElement",value:function(e){e&&e.preventDefault(),ve.can("editor_content_element_add",ve.defaultTrue())?this.props.isAttribute?ne.trigger("add",this.props.element.get("id"),this.props.element.get("tag")):ne.trigger("add",null):ne.trigger("addTemplate",null)}},{key:"handleRemoveAllElements",value:function(e){e&&e.preventDefault();var t=ce.children(!1);t.forEach((function(e,a){var i=t.length-1!==a;ie.trigger("remove",e.id,{silent:i})}))}},{key:"handleAddTemplate",value:function(e){e&&e.preventDefault(),re.set({action:"addTemplate",element:{},tag:"",options:{}})}},{key:"getElementsOutput",value:function(){var e=de.get("localizations"),t=e?e.emptyTreeView:"There is no content on the page - start by adding an element or template.",a=this.getElements(),i=h()({"vcv-ui-tree-layout":!0,"vcv-ui-tree-layout-empty-content":!a.length});return v.createElement("ul",{className:i},null!=a&&a.length?a:v.createElement("li",{className:"vcv-ui-tree-layout-message"},t))}},{key:"getScrollbarContent",value:function(){var e=de.get("localizations"),t=e?e.addElement:"Add Element",a=e?e.removeAll:"Remove All",i=null;return(ve.can("editor_content_element_add",ve.defaultTrue())||ve.can("editor_content_template_add",ve.defaultTrue()))&&this.hasElementControl("add")&&(i=v.createElement("span",{className:"vcv-ui-tree-layout-action",title:t,onClick:this.handleAddElement},v.createElement("span",{className:"vcv-ui-tree-layout-action-content"},v.createElement("i",{className:"vcv-ui-tree-layout-action-icon vcv-ui-icon vcv-ui-icon-add"}),v.createElement("span",null,t)))),v.createElement(v.Fragment,null,this.getElementsOutput(),v.createElement("div",{className:"vcv-ui-tree-layout-actions"},i,this.props.isAttribute?null:v.createElement("span",{className:"vcv-ui-tree-layout-action",title:a,onClick:this.handleRemoveAllElements},v.createElement("span",{className:"vcv-ui-tree-layout-action-content"},v.createElement("i",{className:"vcv-ui-tree-layout-action-icon vcv-ui-icon vcv-ui-icon-trash"}),v.createElement("span",null,a)))))}},{key:"render",value:function(){var e=this,t=h()({"vcv-ui-tree-layout-container":!0,"vcv-ui-state--hidden":!this.state.isVisible}),a="";return a=this.props.isAttribute?this.getScrollbarContent():v.createElement(J(),{ref:this.scrollBarMounted},this.getScrollbarContent()),v.createElement("div",{className:t,ref:function(t){e.layoutContainer=t}},a)}}]),a}(v.Component);(0,u.default)(pe,"propTypes",{scrollValue:te().any,isAttribute:te().bool,element:te().object})},"./public/components/stockMedia/giphyContainer.js":function(e,t,a){"use strict";a.d(t,{default:function(){return C}});var i=a("./node_modules/@babel/runtime/helpers/esm/extends.js"),n=a("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),l=a("./node_modules/@babel/runtime/helpers/esm/createClass.js"),r=a("./node_modules/@babel/runtime/helpers/esm/inherits.js"),s=a("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),o=a("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),c=a("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),u=a("./node_modules/react/index.js"),d=a("./public/components/stockMedia/stockMedia.js"),v=a("./node_modules/prop-types/index.js"),p=a.n(v),m=a("./public/sources/images/giphyLogo.raw"),f=a.n(m),h=a("./node_modules/vc-cake/index.js");function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,o.default)(e);if(t){var n=(0,o.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,s.default)(this,a)}}var y=(0,h.getService)("dataManager"),b=(0,h.getService)("roleManager"),C=function(e){(0,r.default)(a,e);var t=g(a);function a(){return(0,n.default)(this,a),t.apply(this,arguments)}return(0,l.default)(a,[{key:"render",value:function(){var e=y.get("localizations"),t={searchText:e?e.discoverGifAnimationsText:"Discover the best GIF animations from Giphy.",getMediaText:e?e.getGiphiesText:"Download and Add Free Animated GIFs to Your Site",getMediaWithPremiumText:e?e.getGiphiesWithPremiumText:"Download and Add Free Animated GIFs to Your Site With Visual Composer Premium",noConnectionToStockMediaText:"".concat(e.noConnectionToGiphy," #10089")||0,downloadText:e?e.downloadAnimationsFromGiphy:"Download animations from Giphy to your Media Library",unlockText:e?e.activatePremiumToUnlockGiphy:"Activate Premium to Unlock Giphy Integration",searchResultKey:e?e.gifAnimations:"GIF animations",hasBeenDownloadedText:e?e.gifAnimationDownloadedToMediaLibrary:"GIF animation has been downloaded to your Media Library.",poweredByText:e&&e.poweredBy?"".concat(e.poweredBy," GIPHY"):"Powered by GIPHY"},a=[{size:"small",title:e?e.small:"Small"},{size:"regular",title:e?e.regular:"Regular"},{size:"full",title:e?e.full:"Full"}];return u.createElement(d.default,(0,i.default)({stockMediaLogo:f(),stockMediaLocalizations:t,vcvAuthorApiKey:null,apiUrlKey:"giphy",sizes:a,previewImageSize:"regular",customContainerClass:"vcv-stock-media-container--giphy",isAllowedForThisRole:b.can("hub_giphy",b.defaultTrue())},this.props))}}]),a}(u.Component);(0,c.default)(C,"propTypes",{scrolledToBottom:p().bool,scrollTop:p().number,namespace:p().string,filterType:p().string})},"./public/components/stockMedia/stockMedia.js":function(e,t,a){"use strict";a.d(t,{default:function(){return j}});var i=a("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),n=a("./node_modules/@babel/runtime/helpers/esm/createClass.js"),l=a("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),r=a("./node_modules/@babel/runtime/helpers/esm/inherits.js"),s=a("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),o=a("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),c=a("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),u=a("./node_modules/react/index.js"),d=a("./node_modules/classnames/index.js"),v=a.n(d),p=a("./node_modules/@babel/runtime/helpers/esm/extends.js"),m=a("./node_modules/prop-types/index.js"),f=a.n(m),h=a("./node_modules/lodash/lodash.js"),g=a.n(h),y=a("./node_modules/vc-cake/index.js"),b=a("./node_modules/react-redux/es/index.js"),C=a("./public/editor/stores/notifications/slice.js"),k=a("./public/editor/stores/editorPopup/slice.ts");function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,o.default)(e);if(t){var n=(0,o.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,s.default)(this,a)}}var w=(0,y.getService)("dataProcessor"),S=(0,y.getService)("sharedAssetsLibrary"),E=(0,y.getService)("dataManager"),L=(0,y.getStorage)("workspace"),T=function(e){(0,r.default)(a,e);var t=x(a);function a(e){var n;return(0,i.default)(this,a),n=t.call(this,e),(0,c.default)((0,l.default)(n),"maxColumnCount",5),(0,c.default)((0,l.default)(n),"abortController",new window.AbortController),(0,c.default)((0,l.default)(n),"componentUnmounted",!1),(0,c.default)((0,l.default)(n),"vcvLicenseKey",E.get("licenseKey")||"free"),(0,c.default)((0,l.default)(n),"allowDownload",!0),n.state={columnData:g().defaultsDeep({},n.createDefaultColumnData()),total:0,columnCount:3,page:1,totalPages:0,requestInProgress:!1,hasError:!1,downloadingItems:[]},n.resultsWrapperRef=u.createRef(),n.resultContainerRef=u.createRef(),n.showImages=n.showImages.bind((0,l.default)(n)),n.handleImageLoad=n.handleImageLoad.bind((0,l.default)(n)),n.handleClickDownloadImage=n.handleClickDownloadImage.bind((0,l.default)(n)),n.setColumnCount=n.setColumnCount.bind((0,l.default)(n)),n.handleLockClick=n.handleLockClick.bind((0,l.default)(n)),n}return(0,n.default)(a,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.setColumnCount),this.setColumnCount(),this.getImagesFromServer("",1,"trending")}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.setColumnCount),this.componentUnmounted=!0,this.abortController.abort()}},{key:"componentDidUpdate",value:function(e,t){var a=t.requestInProgress,i=t.page,n=e.scrolledToBottom,l=e.searchValue,r=e.scrollTop;this.props.searchValue&&(this.props.searchValue!==l?this.getImagesFromServer(this.props.searchValue,1):!1===a&&this.props.scrolledToBottom&&this.props.scrolledToBottom!==n&&this.getImagesFromServer(this.props.searchValue,i)),this.props.scrollTop!==r&&this.showImages()}},{key:"prepareImages",value:function(e){var t,a=this.getColumnData(e.results);if(this.setState({columnData:a,total:parseInt(e.total),page:this.state.page+1,totalPages:parseInt(e.totalPages),requestInProgress:!1}),null!==(t=this.resultContainerRef)&&void 0!==t&&t.current){var i=this.resultContainerRef.current.closest(".vcv-ui-scroll-content"),n=i&&i.getBoundingClientRect();n&&n.height>=i.scrollHeight&&this.getImagesFromServer(this.props.searchValue,this.state.page)}}},{key:"getColumnData",value:function(e){var t=this,a="";return a=1===this.state.page?g().defaultsDeep({},this.createDefaultColumnData()):g().defaultsDeep({},this.state.columnData),e&&e.length&&Object.keys(a).forEach((function(i){var n=a[i];e.forEach((function(e){var a=e.height/e.width,i=t.getSmallestFromArray(n);n[i].value+=a,n[i].images.push(e)}))})),a}},{key:"createDefaultColumnData",value:function(){for(var e={},t=1;t<=this.maxColumnCount;t++){e[t]=[];for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:"search",n=this.props,l=n.vcvAuthorApiKey,r=n.apiUrlKey,s=n.stockMediaLocalizations;if(!(t>1&&t>this.state.totalPages)){var o=E.get("apiUrl"),c=E.get("pluginUrl"),u="".concat(o,"/api/").concat(r,"/").concat(i),d=this.vcvLicenseKey;this.setState({page:t,requestInProgress:!0,hasError:!1});var v="";v="search"===i?"".concat(u,"/").concat(e,"?licenseKey=").concat(d,"&page=").concat(t,"&url=").concat(c):"".concat(u,"?licenseKey=").concat(d,"&url=").concat(c),l&&(v+="&author_api_key=".concat(l)),window.fetch(v,{method:"get",signal:this.abortController.signal}).then((function(e){return e.json()})).then((function(e){e&&(Object.prototype.hasOwnProperty.call(e,"allowDownload")?a.allowDownload=e.allowDownload:a.allowDownload=!0,a.prepareImages(e),e.results&&e.results.length&&window.setTimeout(a.showImages,500))}),(function(e){if(!a.componentUnmounted){var t=s&&s.noConnectionToStockMediaText;a.props.addNotification({text:t,time:5e3,type:"error",id:"stock-media-error--".concat(r),usePortal:".media-frame"===a.props.portal}),a.setState({hasError:!0}),(0,y.env)("VCV_DEBUG")&&console.warn(t,e)}}))}}},{key:"getSmallestFromArray",value:function(e){if(1===e.length)return 0;var t=0,a=e[0].value;return e.forEach((function(i,n){i.value0?u.createElement("div",{className:p,ref:this.resultContainerRef},this.getItems()):this.getNoResultsElement();var f=a.localizations.free&&a.localizations.free.toLowerCase(),h=d&&d.downloadText,g=d&&d.searchResultKey;return u.createElement("div",{className:"vcv-stock-image-results-wrapper",ref:this.resultsWrapperRef},o&&u.createElement("div",{className:"vcv-stock-images-results-data"},u.createElement("span",null,t," ",f||"free"," ",o.toLowerCase()," ",g),u.createElement("span",null,h)),m,n&&u.createElement("div",{className:"vcv-loading-wrapper"},v))}}]),a}(u.Component);(0,c.default)(T,"propTypes",{searchValue:f().string,scrolledToBottom:f().bool,scrollTop:f().number,isSearchUsed:f().bool,namespace:f().string,filterType:f().string}),(0,c.default)(T,"localizations",E.get("localizations"));var D=(0,b.connect)((function(e){return{portal:e.notifications.portal}}),(function(e){return{addNotification:function(t){return e((0,C.notificationAdded)(t))},activeFullPopupSet:function(t){return e((0,k.activeFullPopupSet)(t))},fullScreenPopupDataSet:function(t){return e((0,k.fullScreenPopupDataSet)(t))}}}))(T),R=a("./public/components/panels/hub/categoriesSettings.js");function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,o.default)(e);if(t){var n=(0,o.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,s.default)(this,a)}}var O=(0,y.getService)("dataManager"),j=function(e){(0,r.default)(a,e);var t=P(a);function a(e){var n;return(0,i.default)(this,a),n=t.call(this,e),(0,c.default)((0,l.default)(n),"inputTimeout",0),n.categories=(0,R.default)(),n.state={inputValue:"",input:!1,searchValue:"",isSearchUsed:!1},n.handleValueChange=n.handleValueChange.bind((0,l.default)(n)),n.handleInputFocus=n.handleInputFocus.bind((0,l.default)(n)),n.handleSearch=n.handleSearch.bind((0,l.default)(n)),n.handleKeyPress=n.handleKeyPress.bind((0,l.default)(n)),n}return(0,n.default)(a,[{key:"componentWillUnmount",value:function(){this.inputTimeout&&(window.clearTimeout(this.inputTimeout),this.inputTimeout=0)}},{key:"handleKeyPress",value:function(e){"Enter"===e.key&&(e.preventDefault(),this.handleSearch())}},{key:"handleSearch",value:function(){var e={searchValue:""!==this.state.inputValue?this.state.inputValue:this.state.searchValue};this.state.inputValue&&(e.isSearchUsed=!0),this.setState(e)}},{key:"handleValueChange",value:function(e){this.setState({inputValue:e.currentTarget.value})}},{key:"handleInputFocus",value:function(){var e=this;this.setState({input:!0}),this.inputTimeout=setTimeout((function(){e.setState({input:!1})}),400)}},{key:"getSearch",value:function(){var e=this.props.stockMediaLocalizations,t=e&&e.searchText||"",a=v()({"vcv-ui-search-container":!0,"vcv-ui-editor-field-highlight":this.state.input});return u.createElement("div",{className:a},u.createElement("button",{className:"vcv-ui-search-button",onClick:this.handleSearch},u.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-search"})),u.createElement("input",{className:"vcv-ui-form-input vcv-ui-search-field",onChange:this.handleValueChange,onFocus:this.handleInputFocus,type:"text",value:this.state.inputValue,placeholder:t,onKeyPress:this.handleKeyPress,autoFocus:!0}))}},{key:"getUtmMedium",value:function(){var e=this.categories[this.props.filterType].title.toLowerCase().trim().replace(/\s+/g,""),t=this.props.renderPlace||"hub";return"".concat(e,"-").concat(t,"-").concat(this.props.namespace)}},{key:"render",value:function(){var e=this.props,t=e.backgroundImage,i=e.stockMediaLocalizations,n=e.stockMediaLogo,l=e.vcvAuthorApiKey,r=e.apiUrlKey,s=e.scrollTop,o=e.scrolledToBottom,d=e.sizes,p=e.previewImageSize,m=e.customContainerClass,f=e.goPremiumLink,h=i&&i.getMediaWithPremiumText||"",g=i&&i.getMediaText||"",y=a.localizations?a.localizations.goPremium:"Go Premium",b=a.localizations?a.localizations.alreadyHaveLicenseTextOneAction:"Already have a Premium license?",C=a.localizations?a.localizations.activateHere:"Activate here",k="&vcv-ref=".concat(this.getUtmMedium()),x={rel:"noopener noreferrer",href:"".concat(O.get("goPremiumUrl")).concat(k),className:"vcv-hub-banner-link"};"vcdashboard"!==this.props.namespace&&(x.target="_blank");var w="";if(O.get("isPremiumActivated")){var S=null;i.poweredByText&&(S=u.createElement("div",{className:"vcv-stock-media-powered-text",dangerouslySetInnerHTML:{__html:i.poweredByText}})),w=u.createElement(u.Fragment,null,u.createElement("span",{className:"vcv-stock-images-unsplash-logo",dangerouslySetInnerHTML:{__html:n}}),u.createElement("p",{className:"vcv-stock-images-subtitle"},g),this.getSearch(),S)}else w=u.createElement(u.Fragment,null,u.createElement("span",{className:"vcv-stock-images-unsplash-logo",dangerouslySetInnerHTML:{__html:n}}),u.createElement("p",{className:"vcv-stock-images-subtitle"},h),u.createElement("a",{className:"vcv-stock-images-button",href:f,target:"_blank",rel:"noopener noreferrer"},y),u.createElement("p",{className:"vcv-hub-banner-subtitle"},b," ",u.createElement("a",x,C),"."));var E={};!this.state.isSearchUsed&&t&&(E.backgroundImage=t);var L=v()({"vcv-ui-editor-plates-container":!0,"vcv-ui-editor-plate--stock-images":!0,"vcv-ui-editor-plate--stock-images--search-is-used":this.state.isSearchUsed}),T=v()((0,c.default)({"vcv-stock-images-container":!0},m,!!m));return u.createElement(u.Fragment,null,u.createElement("div",{className:L},u.createElement("div",{className:T,style:E},u.createElement("div",{className:"vcv-stock-images-inner"},w))),u.createElement(D,{searchValue:this.state.searchValue,scrolledToBottom:o,scrollTop:s,isSearchUsed:this.state.isSearchUsed,stockMediaLocalizations:i,vcvAuthorApiKey:l,apiUrlKey:r,sizes:d,previewImageSize:p,namespace:this.props.namespace,filterType:this.props.filterType,renderPlace:this.props.renderPlace,isAllowedForThisRole:this.props.isAllowedForThisRole}))}}]),a}(u.Component);(0,c.default)(j,"localizations",O.get("localizations")),(0,c.default)(j,"propTypes",{scrolledToBottom:f().bool,scrollTop:f().number,backgroundImage:f().string,namespace:f().string,filterType:f().string,renderPlace:f().string,onClickGoPremium:f().func,isAllowedForThisRole:f().bool})},"./public/components/stockMedia/unsplashContainer.js":function(e,t,a){"use strict";a.d(t,{default:function(){return x}});var i=a("./node_modules/@babel/runtime/helpers/esm/extends.js"),n=a("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),l=a("./node_modules/@babel/runtime/helpers/esm/createClass.js"),r=a("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),s=a("./node_modules/@babel/runtime/helpers/esm/inherits.js"),o=a("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),c=a("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),u=a("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),d=a("./node_modules/react/index.js"),v=a("./public/components/stockMedia/stockMedia.js"),p=a("./node_modules/prop-types/index.js"),m=a.n(p),f=a("./public/sources/images/unsplashLogo.raw"),h=a.n(f),g=a("./node_modules/vc-cake/index.js");function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,c.default)(e);if(t){var n=(0,c.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,o.default)(this,a)}}var b=(0,g.getService)("dataManager"),C=["https://cdn.hub.visualcomposer.com/plugin-assets/unsplash-1.jpg","https://cdn.hub.visualcomposer.com/plugin-assets/unsplash-2.jpg","https://cdn.hub.visualcomposer.com/plugin-assets/unsplash-3.jpg","https://cdn.hub.visualcomposer.com/plugin-assets/unsplash-4.jpg","https://cdn.hub.visualcomposer.com/plugin-assets/unsplash-5.jpg"],k=(0,g.getService)("roleManager"),x=function(e){(0,s.default)(a,e);var t=y(a);function a(){var e;(0,n.default)(this,a);for(var i=arguments.length,l=new Array(i),s=0;s',formStatus:!1,formBound:!1}}},{key:"componentDidMount",value:function(){this.requestToServer()}},{key:"componentDidUpdate",value:function(){this.state.formStatus&&this.fieldContainer&&!this.state.formBound&&(this.fields=Array.from(this.fieldContainer.querySelectorAll("input, select, textarea, datalist")),this.bindFormChangeEvents())}},{key:"componentWillUnmount",value:function(){var e=this;this.serverRequest.abort(),this.fieldContainer&&this.fields&&this.fields.forEach((function(t){t.removeEventListener("change",e.handleFormChange.bind(e))}))}},{key:"bindFormChangeEvents",value:function(){var e=this;if(this.fieldContainer&&this.fields){this.fields.forEach((function(t){t.addEventListener("change",e.handleFormChange.bind(e))}));var t=this.fieldContainer.querySelectorAll("a");(t=Array.from(t)).forEach((function(e){e.setAttribute("target","_blank")}))}this.setState({formBound:!0})}},{key:"handleFormChange",value:function(){var e=this;this.pseudoForm=document.createElement("form"),this.fields.forEach((function(t){var a=t.cloneNode(!0);a.value=t.value,e.pseudoForm.appendChild(a)}));var t=f()(this.pseudoForm,{hash:!0});this.setFieldValue(t),this.pseudoForm=null}},{key:"requestToServer",value:function(){var e=this,t=(0,i.getService)("utils").ajax;this.serverRequest&&this.serverRequest.abort();var a=this.props.options.action,n=this.state.value;this.setState({formContent:'',formStatus:!1,formBound:!1}),this.serverRequest=t({"vcv-action":"attribute:ajaxForm:render:adminNonce","vcv-form-action":a,"vcv-form-element":this.props.elementAccessPoint.cook().toJS(),"vcv-form-value":n,"vcv-nonce":y.get("nonce"),"vcv-source-id":y.get("sourceID")},(function(t){var a=(0,h.getResponse)(t.response);a&&a.status?e.setState({formContent:a.html||"There are no options for this widget.",formStatus:!0,formBound:!1}):e.setState({formContent:"There are no options for this widget.",formStatus:!1,formBound:!1})}))}},{key:"render",value:function(){var e=this;return v.createElement("div",{className:"vcv-ui-ajax-form-container"},v.createElement("div",{ref:function(t){e.fieldContainer=t}},v.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.formContent||""}})))}}]),a}(p.default);(0,d.default)(b,"defaultProps",{fieldType:"ajaxForm"});var C=a("./public/sources/attributes/animateDropdown/Component.js"),k=a("./public/sources/attributes/attachimage/Component.js"),x=a("./node_modules/lodash/lodash.js"),w=a.n(x),S=a("./node_modules/@babel/runtime/helpers/esm/extends.js"),E=a("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),L=a("./public/sources/attributes/url/Component.js"),T=a("./node_modules/classnames/index.js"),D=a.n(T),R=a("./node_modules/prop-types/index.js"),P=a.n(R);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var j=(0,i.getService)("dataManager"),A=function(e){(0,o.default)(a,e);var t=O(a);function a(e){var i;return(0,l.default)(this,a),(i=t.call(this,e)).state={videoSize:{}},i.getLinkHtml=i.getLinkHtml.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){var e=this;this.props.url.url&&this.getVideoDimensionsOf(this.props.url.url).then((function(t){e.setState({videoSize:t})}))}},{key:"componentDidUpdate",value:function(e,t){var a=this;this.props.url.url&&this.getVideoDimensionsOf(this.props.url.url).then((function(e){w().isEqual(t.videoSize,a.state.videoSize)&&a.setState({videoSize:e})}))}},{key:"handleRemove",value:function(e){this.props.handleRemove(e)}},{key:"getLinkHtml",value:function(e){return this.props.getUrlHtml(e)}},{key:"getVideoDimensionsOf",value:function(e){return new Promise((function(t){var a=document.createElement("video");a.addEventListener("loadedmetadata",(function(){var e=this.videoHeight,a=this.videoWidth;t({height:e,width:a})}),!1),a.src=e}))}},{key:"render",value:function(){var e=this.props,t=e.className,a=e.fieldKey,i=e.url,n=e.icon,l=e.oneMoreControl,r=e.indexValue,s=j.get("localizations"),o=s&&s.removeVideo?s.removeVideo:"Remove the video";t=D()(t,{"vcv-ui-form-attach-image-item":!0,"vcv-ui-form-attach-image-item-add-control":!0,"vcv-ui-form-attach-image-item-has-link-value":i&&i.url});var c=i&&i.url?i.url.split("/").pop():"",u=null;return this.state.videoSize.width&&(u=v.createElement("i",null,"".concat(this.state.videoSize.width,"x").concat(this.state.videoSize.height))),v.createElement("li",{className:t},v.createElement("div",{className:"vcv-ui-form-attach-image-item-inner"},v.createElement("figure",{className:"vcv-ui-form-attach-image-thumbnail",onClick:this.props.handleOpenLibrary},v.createElement("img",{key:a+"-li-img-:"+i.full,src:n})),v.createElement("div",{className:"vcv-ui-form-attach-image-description"},v.createElement("span",{title:c},c),u),v.createElement("div",{className:"vcv-ui-form-attach-image-item-controls",tabIndex:"0"},l,v.createElement("a",{className:"vcv-ui-form-attach-image-item-control vcv-ui-form-attach-image-item-control-state--danger",onClick:this.handleRemove.bind(this,r),title:o},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-close-modern"})))),this.getLinkHtml(r))}}]),a}(v.Component);(0,d.default)(A,"propTypes",{className:P().string}),(0,d.default)(A,"displayName","vcv-ui-form-sortable-attach-image-item-inner");var M=a("./node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js");function N(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function _(e){for(var t=1;t0){var a=[],i=[];t.forEach((function(e){a.push(e.id),e.full?i.push(e):i.push({full:e})})),t={ids:a,urls:i}}else t={ids:[],urls:[]};else t.ids||t.urls||!t.id||(t={ids:[t.id],urls:[t]});else t=t?{ids:[null],urls:[{full:t}]}:{ids:[],urls:[]};return{value:t}}},{key:"openLibrary",value:function(){if(!this.mediaUploader)throw new Error("Media uploader not found. Make sure you are running this on WordPress.");this.mediaUploaderOpen=this.mediaUploader.open()}},{key:"handleRemove",value:function(e){var t=(0,E.default)(this.state.value.ids),a=(0,E.default)(this.state.value.urls);t.splice(e,1),a.splice(e,1);var i={ids:[],urls:[]};t.length?i={ids:t,urls:a}:this.props.defaultValue&&(i=this.props.defaultValue),this.setFieldValue(i)}},{key:"onMediaSelect",value:function(){var e=this.mediaUploader.state().get("selection");this.setFieldValue(this.parseSelection(e))}},{key:"parseSelection",value:function(e){var t=this,a=[],i=[],n=[];return e.models.forEach((function(e){var l=t.mediaAttachmentParse(e);a.push(l.id),i.push(l.url),n.push(l.icon)})),{ids:a,urls:i,icons:n}}},{key:"mediaAttachmentParse",value:function(e){e=e.toJSON();var t={};return t.id=e.id,t.title=e.title,t.alt=e.alt,t.url=e.url,{id:e.id,url:t,icon:e.icon}}},{key:"handleUrlChange",value:function(e,t,a){var i=this.state.value;i.urls[e].link=a,this.updateFieldValue(i)}},{key:"updateFieldValue",value:function(e){var t=w().merge(this.state.value,e);this.setFieldValue(t)}},{key:"onMediaOpen",value:function(){var e=this.mediaUploader.state().get("selection"),t=this.state.value.ids;t&&t.forEach((function(t){if(t){var a=window.wp.media.attachment(t);a&&e.add([a])}})),$.state("hasModal").set(!0)}},{key:"onMediaClose",value:function(){setTimeout((function(){return $.state("hasModal").set(!1)}),100)}},{key:"closeMediaPopup",value:function(e){27===(null==e?void 0:e.which)&&this.mediaUploader.close()}},{key:"getUrlHtml",value:function(e){var t="";return this.props.options.url&&(t=v.createElement(L.default,{value:this.state.value.urls[e].link,updater:this.handleUrlChange.bind(this,e),api:this.props.api,fieldKey:"".concat(this.props.fieldKey,".linkUrl")})),t}},{key:"handleSortEnd",value:function(e){var t=e.oldIndex,a=e.newIndex,i=Object.assign({},this.state.value),n={};n.urls=z(i.urls,t,a),n.ids=z(i.ids,t,a),n.icons=z(i.icons,t,a),this.setFieldValue(n)}},{key:"handleDrop",value:function(e){e.stopPropagation(),e.preventDefault(),this.uploadFileList=e.dataTransfer.files,this.mediaUploader.on("open",this.handleUploadFiles),this.openLibrary()}},{key:"handleUploadFiles",value:function(){var e=this;window.setTimeout((function(){e.mediaUploaderOpen&&e.mediaUploaderOpen.uploader&&e.mediaUploaderOpen.uploader.uploader&&e.mediaUploaderOpen.uploader.uploader.uploader.addFile(w().toArray(e.uploadFileList)),e.uploadFileList=[],e.mediaUploader.off("open",e.handleUploadFiles)}),200)}},{key:"render",value:function(){return v.createElement("div",{className:"vcv-ui-form-attach-image"},v.createElement(K,(0,S.default)({},this.props,{helperClass:"vcv-ui-form-attach-image-item--dragging",useDragHandle:!0,onSortEnd:this.handleSortEnd,axis:"xy",value:this.state.value,openLibrary:this.openLibrary,onRemove:this.handleRemove,getUrlHtml:this.getUrlHtml,mediaLibrary:this.mediaUploader,onHandleDrop:this.handleDrop})))}}]),a}(p.default);(0,d.default)(W,"defaultProps",{fieldType:"attachvideo"}),(0,d.default)(W,"propTypes",{value:P().oneOfType([P().string,P().object,P().array]).isRequired,fieldKey:P().string.isRequired});var G=a("./public/sources/attributes/autocomplete/Component.js"),q=a("./public/sources/attributes/boxModel/Component.js"),Z=a("./public/sources/attributes/toggle/Component.js"),Y=a("./public/sources/attributes/color/Component.js");function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Q=function(e){(0,o.default)(a,e);var t=J(a);function a(e){var i;return(0,l.default)(this,a),(i=t.call(this,e)).state=i.updateState(i.props),i.setFieldValue=i.setFieldValue.bind((0,s.default)(i)),i.handleChange=i.handleChange.bind((0,s.default)(i)),i.handleBlur=i.handleBlur.bind((0,s.default)(i)),i.update=i.update.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){this.lastCall=new Date}},{key:"handleChange",value:function(e){this.setFieldValue(e.currentTarget.value)}},{key:"setFieldValue",value:function(e){var t=this,a=this.props.value,i=this.props.options.measurement;e=(e=e.replace(i,""))&&"-"!==e?parseInt(e):e,Number.isNaN(e)&&(e=a),this.setState({value:e.toString()},(function(){"-"!==e&&t.update()}))}},{key:"update",value:function(){clearInterval(this.updateInterval);var e=new Date;e-this.lastCall>=300?this.props.updater(this.props.fieldKey,this.state.value):this.updateInterval=setInterval(this.update,300),this.lastCall=e}},{key:"handleBlur",value:function(){var e=this.state.value,t=this.props.options.min;e||e===t||this.setFieldValue(this.props.value)}},{key:"render",value:function(){var e=this.state.value,t=this.props.options,a=t.min,i=void 0===a?0:a,n=t.max,l=void 0===n?100:n,r=t.measurement,s=void 0===r?"%":r,o=this.props.placeholder;!o&&this.props.options&&this.props.options.placeholder&&(o=this.props.options.placeholder);var c=parseInt(e),u=Number.isInteger(c)&&c>i?e:i,d="".concat((u-i)/(l-i)*100,"%");return v.createElement("div",{className:"vcv-ui-form-range"},v.createElement("div",{className:"vcv-ui-form-range-helper"},v.createElement("div",{className:"vcv-ui-form-range-slider-bg"}),v.createElement("div",{className:"vcv-ui-form-range-bg",style:{width:d}}),v.createElement("input",{className:"vcv-ui-form-range-slider",type:"range",onChange:this.handleChange,min:i,max:l,value:u})),v.createElement("input",{className:"vcv-ui-form-input vcv-ui-form-range-input",type:"text",onChange:this.handleChange,onBlur:this.handleBlur,min:i,max:l,placeholder:o,value:"".concat(e).concat(s)}))}}]),a}(p.default);(0,d.default)(Q,"defaultProps",{fieldType:"range"});var X=Q;function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var te=function(e){(0,o.default)(a,e);var t=ee(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),e.setInnerFieldStatus&&e.setInnerFieldStatus(),i.valueChangeHandler=i.valueChangeHandler.bind((0,s.default)(i)),i.showHoverFields=!(e.options&&!1===e.options.hoverBoxShadow),i}return(0,r.default)(a,[{key:"getBoxShadowValue",value:function(e){var t=w().defaultsDeep({},e);t.boxShadowEnable||(t.boxShadowEnable=a.deviceDefaults.boxShadowEnable),t.shadowColor||(t.shadowColor=a.deviceDefaults.shadowColor),this.showHoverFields&&(t.hoverBoxShadowEnable||(t.hoverBoxShadowEnable=a.deviceDefaults.hoverBoxShadowEnable),t.hoverShadowColor||(t.hoverShadowColor=a.deviceDefaults.hoverShadowColor));var i=a.addPixelToNumber(t.horizontalOffset),n=a.addPixelToNumber(t.verticalOffset),l=a.addPixelToNumber(t.blurRadius),r=a.addPixelToNumber(t.spreadRadius),s=t.shadowColor;if(t.boxShadow="".concat(i," ").concat(n," ").concat(l," ").concat(r," ").concat(s),this.showHoverFields){var o=a.addPixelToNumber(t.hoverHorizontalOffset),c=a.addPixelToNumber(t.hoverVerticalOffset),u=a.addPixelToNumber(t.hoverBlurRadius),d=a.addPixelToNumber(t.hoverSpreadRadius),v=t.hoverShadowColor;t.hoverBoxShadow="".concat(o," ").concat(c," ").concat(u," ").concat(d," ").concat(v)}return t}},{key:"updateValue",value:function(e,t){var i=this,n={},l={},r=[];"all"===(e=this.updateState(e)).currentDevice&&r.push("all"),r.forEach((function(t){w().isEmpty(e.devices[t])||(e.devices[t]=i.getBoxShadowValue(e.devices[t]),n[t]=w().defaultsDeep({},e.devices[t]),a.getMixins(n,t,l),Object.keys(n[t]).length||delete n[t])})),this.setFieldValue(n,l,t),this.setState(e)}},{key:"updateState",value:function(e){var t={};if(e.value)(t=this.parseValue(e.value)).devices&&this.setFieldValue(t.devices,t.attributeMixins);else{if(!this.hasEnabledOptions(e.devices))return t;t=w().defaultsDeep({},e,a.defaultState)}return t}},{key:"valueChangeHandler",value:function(e,t){var i=w().defaultsDeep({},this.state);i.currentDevice?i.devices[i.currentDevice].updated=!0:(i=w().defaultsDeep({},a.defaultState)).devices.all=w().defaultsDeep({},a.deviceDefaults),i.devices[i.currentDevice][e]=t,this.updateValue(i,e)}},{key:"hasEnabledOptions",value:function(e){return!!e&&Object.keys(e).find((function(t){return e[t].boxShadowEnable||e[t].hoverBoxShadowEnable||e[t].updated}))}},{key:"parseValue",value:function(e){var t=this,i={};if(!this.hasEnabledOptions(e.device))return i;i=w().defaultsDeep({},a.defaultState);var n={},l=[];return w().isEmpty(e.device)||(i.currentDevice=Object.keys(e.device).shift()),l.push("all"),l.forEach((function(l){i.devices[l]=w().defaultsDeep({},a.deviceDefaults),e.device&&e.device[l]&&(i.devices[l]=w().defaultsDeep({},e.device[l],i.devices[l])),i.devices[l]=t.getBoxShadowValue(i.devices[l]),a.getMixins(i.devices,l,n)})),i.attributeMixins=n,i}},{key:"setFieldValue",value:function(e,t,a){var i=this.props;(0,i.updater)(i.fieldKey,{device:e,attributeMixins:t},a)}},{key:"getBoxShadowToggle",value:function(e){var t=e?"hoverBoxShadowEnable":"boxShadowEnable",a=this.state.devices&&this.state.currentDevice?this.state.devices[this.state.currentDevice]:null,i=!(!a||!a[t])&&a[t],n=e?"Enable hover box shadow":"Enable box shadow";return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:t,updater:this.valueChangeHandler,options:{labelText:n},value:i}))}},{key:"getBoxShadowFields",value:function(e){var t=this,a=this.state.devices&&this.state.currentDevice?this.state.devices[this.state.currentDevice]:null;return a&&a[e?"hoverBoxShadowEnable":"boxShadowEnable"]?function(e){return[{fieldKey:e?"hoverHorizontalOffset":"horizontalOffset",value:"0",min:-300,max:300,measurement:"px",description:e?"Hover horizontal offset":"Horizontal offset",attributeType:"range"},{fieldKey:e?"hoverVerticalOffset":"verticalOffset",value:"5",min:-300,max:300,measurement:"px",description:e?"Hover vertical offset":"Vertical offset",attributeType:"range"},{fieldKey:e?"hoverBlurRadius":"blurRadius",value:"8",min:0,max:300,measurement:"px",description:e?"Hover blur radius":"Blur radius",attributeType:"range"},{fieldKey:e?"hoverSpreadRadius":"spreadRadius",value:"3",min:-300,max:300,measurement:"px",description:e?"Hover spread radius":"Spread radius",attributeType:"range"},{fieldKey:e?"hoverShadowColor":"shadowColor",value:"#555",description:e?"Hover shadow color":"Shadow color",attributeType:"color"}]}(e).map((function(e){var i;return i="range"===e.attributeType?v.createElement(X,{api:t.props.api,fieldKey:e.fieldKey,updater:t.valueChangeHandler,options:{min:e.min,max:e.max,measurement:e.measurement},value:a[e.fieldKey]}):v.createElement(Y.default,{api:t.props.api,fieldKey:e.fieldKey,updater:t.valueChangeHandler,value:a[e.fieldKey]||e.value,defaultValue:e.value}),v.createElement("div",{className:"vcv-ui-form-group",key:"box-shadow-fields-".concat(e.fieldKey)},v.createElement("span",{className:"vcv-ui-form-group-heading"},e.description),i)})):null}},{key:"render",value:function(){var e=null;return this.showHoverFields&&(e=v.createElement(v.Fragment,null,this.getBoxShadowToggle(!0),this.getBoxShadowFields(!0))),v.createElement("div",{className:"vcv-ui-box-shadow"},this.getBoxShadowToggle(),this.getBoxShadowFields(),e)}}],[{key:"addPixelToNumber",value:function(e){return/^-?\d+$/.test(e)?"".concat(e,"px"):e}},{key:"getMixins",value:function(e,t,i){if(Object.prototype.hasOwnProperty.call(e[t],"boxShadow")){var n=e[t].boxShadow,l="boxShadowMixin:".concat(t);i[l]=w().defaultsDeep({},a.attributeMixins.boxShadow),i[l].variables.device={value:t},i[l].variables.boxShadow={value:n}}if(Object.prototype.hasOwnProperty.call(e[t],"hoverBoxShadow")){var r=e[t].hoverBoxShadow,s="hoverBoxShadowMixin:".concat(t);i[s]=w().defaultsDeep({},a.attributeMixins.hoverBoxShadow),i[s].variables.device={value:t},i[s].variables.hoverBoxShadow={value:r}}}}]),a}(p.default);(0,d.default)(te,"defaultProps",{fieldType:"boxShadow"}),(0,d.default)(te,"deviceDefaults",{boxShadowEnable:!1,horizontalOffset:"0",verticalOffset:"0",blurRadius:"4",spreadRadius:"2",shadowColor:"rgba(85, 85, 85, 0.5)",hoverBoxShadowEnable:!1,hoverHorizontalOffset:"0",hoverVerticalOffset:"0",hoverBlurRadius:"4",hoverSpreadRadius:"2",hoverShadowColor:"rgba(85, 85, 85, 0.8)"}),(0,d.default)(te,"defaultState",{currentDevice:"all",devices:{},attributeMixins:{}}),(0,d.default)(te,"attributeMixins",{boxShadow:{src:a("./node_modules/raw-loader/index.js!./public/sources/attributes/boxShadow/cssMixins/boxShadow.pcss"),variables:{device:{value:"all"}}},hoverBoxShadow:{src:a("./node_modules/raw-loader/index.js!./public/sources/attributes/boxShadow/cssMixins/hoverBoxShadow.pcss"),variables:{device:{value:"all"}}}});var ae=a("./public/sources/attributes/buttonGroup/Component.js"),ie=a("./node_modules/react-datepicker/dist/react-datepicker.min.js"),ne=a.n(ie);a("./node_modules/react-datepicker/dist/react-datepicker.css");function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var re=function(e){(0,o.default)(a,e);var t=le(a);function a(){var e;(0,l.default)(this,a);for(var i=arguments.length,n=new Array(i),r=0;r=1e3;t.target&&!isNaN(a)&&i&&e.handleChange(a)})),e}return(0,r.default)(a,[{key:"updateState",value:function(e){var t=new Date;return e.options.addDays&&(t=new Date(t.setDate(t.getDate()+e.options.addDays))),{value:e.value?new Date(e.value):t}}},{key:"handleChange",value:function(e){this.setFieldValue(e)}},{key:"getCalendarProps",value:function(){var e={selected:this.state.value,onChange:this.handleChange,onChangeRaw:this.handleChangeRaw,disabledKeyboardNavigation:!0,calendarClassName:"vcv-ui-form-datepicker",className:"vcv-ui-form-input",popperClassName:"vcv-ui-form-datepicker-popper",dateFormat:"MMMM d, yyyy",popperPlacement:"bottom-start",popperModifiers:[{name:"flip",options:{behavior:["bottom"]}},{name:"preventOverflow",options:{enabled:!1}},{name:"hide",options:{enabled:!1}}]};return Object.prototype.hasOwnProperty.call(this.props.options,"time")&&this.props.options.time&&(e.calendarClassName="vcv-ui-form-datepicker vcv-ui-form-datepicker-time",e.showTimeSelect=!0,e.timeIntervals=this.props.options.timeIntervals||10,e.timeFormat="h:mm aa",e.dateFormat="MMMM d, yyyy h:mm aa",e.timeCaption="Time"),e}},{key:"render",value:function(){return v.createElement(ne(),this.getCalendarProps())}}]),a}(p.default);(0,d.default)(re,"defaultProps",{fieldType:"calendar"});var se=a("./public/sources/attributes/checkbox/Component.js");function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var ce=function(e){(0,o.default)(a,e);var t=oe(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,r.default)(a,[{key:"render",value:function(){var e=!1===this.state.value?"":this.state.value;return v.createElement("input",{className:"vcv-ui-form-input",type:"text",onChange:this.handleChange,value:e})}}]),a}(p.default);(0,d.default)(ce,"defaultProps",{fieldType:"customId"});var ue=ce;function de(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var ve=function(e){(0,o.default)(a,e);var t=de(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),(0,d.default)((0,s.default)(i),"selectChildren",null),i.generateSelectChildren(e),i}return(0,r.default)(a,[{key:"createOptions",value:function(e,t,a){var i=t[e].value,n=t[e].label;return v.createElement("option",{key:a+":"+e+":"+i,value:i},n)}},{key:"getSelectOptions",value:function(e){e||(e=this.props);var t=(e.options||{}).values,a=(e.options||{}).global;return!a||t&&t.length||(t="function"==typeof window[a]?window[a]():window[a]||[]),t}},{key:"generateSelectChildren",value:function(e){var t=[],a=this.getSelectOptions(e),i=e.fieldKey;for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&t.push(this.createOptions(n,a,i));this.selectChildren=t}},{key:"render",value:function(){var e=this.state.value;return v.createElement(v.Fragment,null,v.createElement("input",{className:"vcv-ui-form-datalist",list:"vcv-data-list-".concat(this.props.fieldKey),type:"text",value:e,onChange:this.handleChange}),v.createElement("datalist",{id:"vcv-data-list-".concat(this.props.fieldKey)},this.selectChildren))}}]),a}(p.default);function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}(0,d.default)(ve,"defaultProps",{fieldType:"datalist"});var me=(0,i.getStorage)("workspace").state("settings"),fe=function(e){(0,o.default)(a,e);var t=pe(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,r.default)(a,[{key:"handleClick",value:function(e){e&&e.workspaceSettings&&me.set(e.workspaceSettings)}},{key:"parseProps",value:function(e){return e.onClickAction&&(e.onClick=this.handleClick.bind(this,e.onClickAction),delete e.onClickAction),e}},{key:"getReactContent",value:function(e){var t=this;if("string"==typeof e)return e;var a=[];return e.forEach((function(e){"string"==typeof e?a.push(e):a.push(v.createElement.apply(v,[e.tag,t.parseProps(e.props)].concat((0,E.default)(t.getReactContent(e.content)))))})),a}},{key:"getReactHtml",value:function(e){return v.createElement.apply(v,[e.tag,this.parseProps(e.props)].concat((0,E.default)(this.getReactContent(e.content))))}},{key:"render",value:function(){var e="string"==typeof this.props.value?this.props.value:this.getReactHtml(this.props.value);return v.createElement("p",{className:"vcv-ui-form-helper"},e)}}]),a}(p.default);(0,d.default)(fe,"defaultProps",{fieldType:"description"});var he=a("./public/sources/attributes/designOptions/Component.js"),ge=a("./public/sources/attributes/devices/Component.js"),ye=a("./public/sources/attributes/dropdown/Component.js"),be=a("./public/sources/attributes/string/Component.js"),Ce=a("./public/sources/attributes/number/Component.js"),ke=a("./public/components/tooltip/tooltip.tsx"),xe=a.n(ke),we=a("./public/sources/attributes/designOptionsAdvanced/helpers.ts");function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Ee=(0,i.getStorage)("elements"),Le=(0,i.getService)("dataManager"),Te=(0,i.getService)("document"),De=(0,i.getService)("cook").dynamicFields,Re=De.getDynamicValue,Pe=De.getDefaultDynamicFieldKey,Oe=function(e){(0,o.default)(a,e);var t=Se(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),e.setInnerFieldStatus&&e.setInnerFieldStatus(),i.devicesChangeHandler=i.devicesChangeHandler.bind((0,s.default)(i)),i.deviceVisibilityChangeHandler=i.deviceVisibilityChangeHandler.bind((0,s.default)(i)),i.getHiddenState=i.getHiddenState.bind((0,s.default)(i)),i.boxModelChangeHandler=i.boxModelChangeHandler.bind((0,s.default)(i)),i.attachImageChangeHandler=i.attachImageChangeHandler.bind((0,s.default)(i)),i.sliderTimeoutChangeHandler=i.sliderTimeoutChangeHandler.bind((0,s.default)(i)),i.valueChangeHandler=i.valueChangeHandler.bind((0,s.default)(i)),i.handleElementChange=i.handleElementChange.bind((0,s.default)(i)),i.backgroundLazyLoadHandler=i.backgroundLazyLoadHandler.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){var e=this;window.setTimeout((function(){e.getDefaultStyles()}),200),this.setDefaultState();var t=this.props.elementAccessPoint.id;Ee.on("element:".concat(t),this.handleElementChange)}},{key:"componentWillUnmount",value:function(){var e=this.props.elementAccessPoint.id;Ee.off("element:".concat(e),this.handleElementChange)}},{key:"handleElementChange",value:function(e,t,a){var i=this;a&&"hide"===a.action?this.forceUpdate():setTimeout((function(){i.getDefaultStyles()}),200)}},{key:"getHiddenState",value:function(){var e=this.props.elementAccessPoint.id,t=Te.get(e);return!!t&&t.hidden}},{key:"setDefaultState",value:function(){var e=this.state.devices,t=w().defaultsDeep({},this.state),a={isValueExists:!1,value:null,isImageSet:!1};Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(e[t],"lazyLoad")&&Object.prototype.hasOwnProperty.call(e[t],"images")&&(a.isValueExists=!0,a.value=e[t].lazyLoad,a.isImageSet=!0)})),!a.isValueExists&&a.isImageSet&&(Object.keys(e).forEach((function(e){t.devices[e].lazyLoad=we.defaultState.lazyLoad})),this.updateValue(t,"lazyLoad"))}},{key:"updateState",value:function(e){return(0,we.getUpdatedState)(e)}},{key:"updateValue",value:function(e,t){e=this.updateState(e);var a=(0,we.getUpdatedValues)(e),i=a.newValue,n=a.newMixins;this.setFieldValue(i,n,t),this.setState(e)}},{key:"setFieldValue",value:function(e,t,a){var i=this.props;(0,i.updater)(i.fieldKey,{device:e,attributeMixins:t},a)}},{key:"getDevicesRender",value:function(){return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group--has-inner-fields"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Device type"),v.createElement(ge.default,{api:this.props.api,fieldKey:"currentDevice",options:{customDevices:(0,we.getCustomDevices)()},updater:this.devicesChangeHandler,value:this.state.currentDevice}))}},{key:"devicesChangeHandler",value:function(e,t){var a=w().defaultsDeep({},(0,d.default)({},e,t),this.state);"all"===a.currentDevice?(a.devices.all=w().defaultsDeep({},a.devices[(0,we.getCustomDevicesKeys)().shift()]),delete a.devices.all.display):"all"===this.state.currentDevice&&(0,we.getCustomDevicesKeys)().forEach((function(e){a.devices[e]=w().defaultsDeep({},a.devices.all)})),this.updateValue(a,e)}},{key:"getDeviceVisibilityRender",value:function(){var e=a.localizations?a.localizations.useTheShowElementToggle:"Use the Show element toggle to hide or show elements on all or custom devices.";if("all"===this.state.currentDevice){var t=this.props.elementAccessPoint.id,i=Te.get(t);if(!i)return null;if("column"===i.tag)return null;var n=!i.hidden;return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement("div",{className:"vcv-ui-form-switch-container"},v.createElement("label",{className:"vcv-ui-form-switch"},v.createElement("input",{type:"checkbox",onChange:this.deviceVisibilityChangeHandler.bind(this,"currentDeviceVisible",!n),id:"show_element",checked:n}),v.createElement("span",{className:"vcv-ui-form-switch-indicator"}),v.createElement("span",{className:"vcv-ui-form-switch-label","data-vc-switch-on":"on"}),v.createElement("span",{className:"vcv-ui-form-switch-label","data-vc-switch-off":"off"})),v.createElement("label",{htmlFor:"show_element",className:"vcv-ui-form-switch-trigger-label"},"Show element"),v.createElement(xe(),null,e)))}return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:"currentDeviceVisible",updater:this.deviceVisibilityChangeHandler,options:{labelText:"Show on device"},value:!this.state.devices[this.state.currentDevice].display}),v.createElement(xe(),null,e))}},{key:"deviceVisibilityChangeHandler",value:function(e,t){var a=w().defaultsDeep({},this.state);t?delete a.devices[this.state.currentDevice].display:a.devices[this.state.currentDevice].display="none",this.updateValue(a,e),"all"===this.state.currentDevice?this.props.updater("hidden",!t):this.props.updater("hidden",!1)}},{key:"backgroundLazyLoadHandler",value:function(e,t){var a=w().defaultsDeep({},this.state);Object.keys(a.devices).forEach((function(e){a.devices[e].lazyLoad=t})),this.updateValue(a,e)}},{key:"valueChangeHandler",value:function(e,t){var a=w().defaultsDeep({},this.state);a.devices[a.currentDevice][e]=t,this.updateValue(a,e)}},{key:"getBackgroundTypeRender",value:function(){var e=this.state.devices[this.state.currentDevice].backgroundType||we.deviceDefaults.backgroundType;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Background type"),v.createElement(ye.default,{api:this.props.api,fieldKey:"backgroundType",options:{values:[{label:"Single image",value:"imagesSimple"},{label:"Background zoom",value:"backgroundZoom"},{label:"Image slideshow",value:"imagesSlideshow"},{label:"Youtube video",value:"videoYoutube"},{label:"Vimeo video",value:"videoVimeo"},{label:"Self-hosted video",value:"videoEmbed"}]},updater:this.valueChangeHandler,value:e}))}},{key:"renderBoxModel",value:function(){var e=this.state.devices[this.state.currentDevice].boxModel||{};return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement(q.default,{api:this.props.api,fieldKey:"boxModel",updater:this.boxModelChangeHandler,placeholder:this.state.defaultStyles,value:e}))}},{key:"getDefaultStyles",value:function(){var e=this,t={margin:{},padding:{},border:{}},a="data-vce-do-apply",i=document.querySelector("#vcv-editor-iframe"),n=i.contentDocument||i.contentWindow.document,l="el-".concat(this.props.elementAccessPoint.id),r=n.querySelector("#".concat(l)),s=["border","padding","margin"];if(r){var o=r.getAttribute(a);if(o){var c=this.getElementStyles(r);o.indexOf("all")>=0?t.all=c:s.forEach((function(i){if(o.indexOf(i)>=0)t[i]=c;else{var n="[".concat(a,"*='").concat(i,"'][").concat(a,"*='").concat(l,"']");t[i]=e.getElementStyles(r,n)}}))}else{var u=r.querySelector("[".concat(a,"*='all'][").concat(a,"*='").concat(l,"']"));u?t.all=this.getElementStyles(u):s.forEach((function(i){var n="[".concat(a,"*='").concat(i,"'][").concat(a,"*='").concat(l,"']");t[i]=e.getElementStyles(r,n)}))}}var d=this.parseStyles(t);this.setState({defaultStyles:d})}},{key:"parseStyles",value:function(e){var t={};for(var a in e){var i=e.all||e[a];for(var n in i)n.indexOf(a)>=0&&(t[n]=i[n])}return t}},{key:"getElementStyles",value:function(e,t){var a={};if(e){var i="",n=t?e.querySelector(t):e;for(var l in n&&(n.setAttribute("data-vcv-transition-disabled",!0),i=window.getComputedStyle(n),window.setTimeout((function(){n.removeAttribute("data-vcv-transition-disabled")}),100)),q.default.defaultState)if(i&&i.getPropertyValue){var r=i.getPropertyValue(l.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})));r&&"0px"!==r&&1===r.split(" ").length&&(a[l]=r)}}return a}},{key:"boxModelChangeHandler",value:function(e,t){var a=this.state.devices[this.state.currentDevice].boxModel||{};if(!w().isEqual(a,t)){var i=w().defaultsDeep({},this.state);w().isEmpty(t)?delete i.devices[i.currentDevice].boxModel:i.devices[i.currentDevice].boxModel=t,this.updateValue(i,e)}}},{key:"getAttachImageRender",value:function(){var e=this.state.devices[this.state.currentDevice].backgroundType;if(e||(e=this.state.backgroundType),-1===["imagesSimple","backgroundZoom","imagesSlideshow"].indexOf(e))return null;var t=this.state.devices[this.state.currentDevice].images||"",a={value:"$dynamicFieldKey",type:"backgroundImage",sourceId:"$sourceId"};return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("div",{className:"vcv-ui-form-group-heading-wrapper"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Background images")),v.createElement(k.default,{api:this.props.api,fieldKey:"attachImage",options:{multiple:!0,dynamicField:!0},defaultValue:"",updater:this.attachImageChangeHandler,value:t,prevValue:this.state.devices[this.state.currentDevice].prevValue,elementAccessPoint:this.props.elementAccessPoint,onDynamicFieldOpen:function(e,t){var i=t||Pe(e.fieldType);return Re(i,null,null,{dynamicTemplateProps:a})},onDynamicFieldChange:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Re(e,t,null,{dynamicTemplateProps:a,forceSaveSourceId:i})},onDynamicFieldClose:this.props.onDynamicFieldClose}))}},{key:"attachImageChangeHandler",value:function(e,t,a){t&&Object.prototype.hasOwnProperty.call(t,t.draggingIndex)&&delete t.draggingIndex;var i=w().defaultsDeep({},this.state),n=i.devices[i.currentDevice];w().isEmpty(t)?delete n.images:n.images=t,!n.prevValue&&a&&(n.prevValue=a),n.prevValue&&!a&&(n.prevValue=null),this.updateValue(i,e)}},{key:"getBackgroundStyleRender",value:function(){var e=this.state.devices[this.state.currentDevice];if(-1===["imagesSimple","imagesSlideshow"].indexOf(e.backgroundType)||!Object.prototype.hasOwnProperty.call(e,"images"))return null;var t=e.images,a=t.constructor===Array;if(a&&0===t.length||!a&&(!t.urls||0===t.urls.length))return null;var i=e.backgroundStyle||we.deviceDefaults.backgroundStyle;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Background style"),v.createElement(ye.default,{api:this.props.api,fieldKey:"backgroundStyle",options:{values:[{label:"Cover",value:"cover"},{label:"Contain",value:"contain"},{label:"Full width",value:"full-width"},{label:"Full height",value:"full-height"},{label:"Repeat",value:"repeat"},{label:"Repeat horizontal",value:"repeat-x"},{label:"Repeat vertical",value:"repeat-y"},{label:"No repeat",value:"no-repeat"}]},updater:this.valueChangeHandler,value:i}))}},{key:"getBackgroundPositionRender",value:function(){var e=this.state.devices[this.state.currentDevice];if(-1===["imagesSimple","backgroundZoom","imagesSlideshow"].indexOf(e.backgroundType)||!Object.prototype.hasOwnProperty.call(e,"images"))return null;var t=e.images,a=t.constructor===Array;if(a&&0===t.length||!a&&(!t.urls||0===t.urls.length))return null;var i=e.backgroundPosition||we.deviceDefaults.backgroundPosition;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Background position"),v.createElement(ae.default,{api:this.props.api,fieldKey:"backgroundPosition",options:{values:[{label:"Left top",value:"left-top",icon:"vcv-ui-icon-attribute-background-position-left-top"},{label:"Center top",value:"center-top",icon:"vcv-ui-icon-attribute-background-position-center-top"},{label:"Right top",value:"right-top",icon:"vcv-ui-icon-attribute-background-position-right-top"},{label:"Left center",value:"left-center",icon:"vcv-ui-icon-attribute-background-position-left-center"},{label:"Center center",value:"center-center",icon:"vcv-ui-icon-attribute-background-position-center-center"},{label:"Right center",value:"right-center",icon:"vcv-ui-icon-attribute-background-position-right-center"},{label:"Left bottom",value:"left-bottom",icon:"vcv-ui-icon-attribute-background-position-left-bottom"},{label:"Center bottom",value:"center-bottom",icon:"vcv-ui-icon-attribute-background-position-center-bottom"},{label:"Right bottom",value:"right-bottom",icon:"vcv-ui-icon-attribute-background-position-right-bottom"}]},updater:this.valueChangeHandler,value:i}))}},{key:"getBackgroundZoomRender",value:function(){var e=this.state.devices[this.state.currentDevice];if("backgroundZoom"!==e.backgroundType||!Object.prototype.hasOwnProperty.call(e,"images"))return null;var t=e.images,a=t.constructor===Array;if(a&&0===t.length||!a&&(!t.urls||0===t.urls.length))return null;var i=e.backgroundZoom||we.deviceDefaults.backgroundZoom;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Background zoom scale"),v.createElement(X,{api:this.props.api,fieldKey:"backgroundZoom",options:{min:0,max:100,measurement:"%"},updater:this.valueChangeHandler,value:i}))}},{key:"getBackgroundZoomSpeedRender",value:function(){var e=this.state.devices[this.state.currentDevice];if("backgroundZoom"!==e.backgroundType||!Object.prototype.hasOwnProperty.call(e,"images"))return null;var t=e.images,a=t.constructor===Array;if(a&&0===t.length||!a&&(!t.urls||0===t.urls.length))return null;var i=e.backgroundZoomSpeed||we.deviceDefaults.backgroundZoomSpeed;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Background zoom time (in seconds)"),v.createElement(Ce.default,{api:this.props.api,fieldKey:"backgroundZoomSpeed",options:{min:1},updater:this.valueChangeHandler,value:i}))}},{key:"getBackgroundZoomReverseRender",value:function(){var e=this.state.devices[this.state.currentDevice];if("backgroundZoom"!==e.backgroundType||!Object.prototype.hasOwnProperty.call(e,"images"))return null;var t=e.images,a=t.constructor===Array;if(a&&0===t.length||!a&&(!t.urls||0===t.urls.length))return null;var i=e.backgroundZoomReverse||we.deviceDefaults.backgroundZoomReverse;return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:"backgroundZoomReverse",updater:this.valueChangeHandler,options:{labelText:"Use reverse zoom"},value:i}))}},{key:"getBackgroundColorRender",value:function(){var e=this.state.devices[this.state.currentDevice].backgroundColor||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Background color"),v.createElement(Y.default,{api:this.props.api,fieldKey:"backgroundColor",updater:this.valueChangeHandler,value:e,defaultValue:""}))}},{key:"getGradientOverlayRender",value:function(){var e=this.state.devices[this.state.currentDevice].gradientOverlay||!1;return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:"gradientOverlay",updater:this.valueChangeHandler,options:{labelText:"Use gradient overlay"},value:e}))}},{key:"getGradientTypeRender",value:function(){if(!this.state.devices[this.state.currentDevice].gradientOverlay)return null;var e=this.state.devices[this.state.currentDevice].gradientType||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Gradient type"),v.createElement(ye.default,{api:this.props.api,fieldKey:"gradientType",options:{values:[{label:"Linear gradient",value:"linear"},{label:"Radial gradient",value:"radial"}]},updater:this.valueChangeHandler,value:e}))}},{key:"getGradientStartColorRender",value:function(){if(!this.state.devices[this.state.currentDevice].gradientOverlay)return null;var e=this.state.devices[this.state.currentDevice].gradientStartColor||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Start color"),v.createElement(Y.default,{api:this.props.api,fieldKey:"gradientStartColor",updater:this.valueChangeHandler,value:e,defaultValue:we.deviceDefaults.gradientStartColor}))}},{key:"getGradientEndColorRender",value:function(){if(!this.state.devices[this.state.currentDevice].gradientOverlay)return null;var e=this.state.devices[this.state.currentDevice].gradientEndColor||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"End color"),v.createElement(Y.default,{api:this.props.api,fieldKey:"gradientEndColor",updater:this.valueChangeHandler,value:e,defaultValue:we.deviceDefaults.gradientEndColor}))}},{key:"getBorderStyleRender",value:function(){var e=this.state.devices[this.state.currentDevice];if(!e.boxModel||!(e.boxModel.borderBottomWidth||e.boxModel.borderLeftWidth||e.boxModel.borderRightWidth||e.boxModel.borderTopWidth||e.boxModel.borderWidth))return null;var t=this.state.devices[this.state.currentDevice].borderStyle||we.deviceDefaults.borderStyle;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Border style"),v.createElement(ye.default,{api:this.props.api,fieldKey:"borderStyle",options:{values:[{label:"Solid",value:"solid"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Double",value:"double"}]},updater:this.valueChangeHandler,value:t}))}},{key:"getBorderColorRender",value:function(){var e=this.state.devices[this.state.currentDevice];if(!e.boxModel||!(e.boxModel.borderBottomWidth||e.boxModel.borderLeftWidth||e.boxModel.borderRightWidth||e.boxModel.borderTopWidth||e.boxModel.borderWidth))return null;var t=this.state.devices[this.state.currentDevice].borderColor||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Border color"),v.createElement(Y.default,{api:this.props.api,fieldKey:"borderColor",updater:this.valueChangeHandler,value:t,defaultValue:""}))}},{key:"getSliderTimeoutRender",value:function(){if("imagesSlideshow"!==this.state.devices[this.state.currentDevice].backgroundType)return null;var e=this.state.devices[this.state.currentDevice].sliderTimeout||"",t="carousel"===this.state.devices[this.state.currentDevice].sliderEffect?10:5;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Animation timeout (in seconds)"),v.createElement(Ce.default,{api:this.props.api,fieldKey:"sliderTimeout",updater:this.sliderTimeoutChangeHandler,placeholder:t,options:{min:1},value:e}))}},{key:"getSliderDirectionRender",value:function(){if("imagesSlideshow"!==this.state.devices[this.state.currentDevice].backgroundType||"carousel"!==this.state.devices[this.state.currentDevice].sliderEffect)return null;var e=this.state.devices[this.state.currentDevice].sliderDirection||"left";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Slider direction"),v.createElement(ye.default,{api:this.props.api,fieldKey:"sliderDirection",updater:this.valueChangeHandler,placeholder:"Left",options:{values:[{label:"Left",value:"left"},{label:"Top",value:"top"},{label:"Right",value:"right"},{label:"Bottom",value:"bottom"}]},value:e}))}},{key:"getSliderEffectRender",value:function(){if("imagesSlideshow"!==this.state.devices[this.state.currentDevice].backgroundType)return null;var e=this.state.devices[this.state.currentDevice].sliderEffect||we.deviceDefaults.sliderEffect;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Slideshow effect"),v.createElement(ye.default,{api:this.props.api,fieldKey:"sliderEffect",options:{values:[{label:"Slide",value:"slide"},{label:"Fade",value:"fade"},{label:"Carousel",value:"carousel"}]},updater:this.valueChangeHandler,value:e}))}},{key:"sliderTimeoutChangeHandler",value:function(e,t){var a=w().defaultsDeep({},this.state);a.devices[a.currentDevice][e]=parseInt(t),this.updateValue(a,e)}},{key:"getGradientAngleRender",value:function(){if(!this.state.devices[this.state.currentDevice].gradientOverlay||"radial"===this.state.devices[this.state.currentDevice].gradientType)return null;var e=this.state.devices[this.state.currentDevice].gradientAngle;return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Gradient angle"),v.createElement(X,{api:this.props.api,fieldKey:"gradientAngle",updater:this.valueChangeHandler,options:{min:0,max:180,measurement:"°"},value:e}))}},{key:"getAnimationRender",value:function(){var e=this.state.devices[this.state.currentDevice].animation||"",t=null;if(e){var a=this.state.devices[this.state.currentDevice].animationDelay||"";t=v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Animation delay (in seconds)"),v.createElement(Ce.default,{api:this.props.api,fieldKey:"animationDelay",updater:this.valueChangeHandler,placeholder:0,options:{min:0},value:a}))}return v.createElement(v.Fragment,null,v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Animate"),v.createElement(C.default,{api:this.props.api,fieldKey:"animation",updater:this.valueChangeHandler,value:e})),t)}},{key:"getYoutubeVideoRender",value:function(){if("videoYoutube"!==this.state.devices[this.state.currentDevice].backgroundType)return null;var e=this.state.devices[this.state.currentDevice].videoYoutube||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"YouTube video link"),v.createElement(be.default,{api:this.props.api,fieldKey:"videoYoutube",updater:this.valueChangeHandler,value:e}))}},{key:"getVimeoVideoRender",value:function(){if("videoVimeo"!==this.state.devices[this.state.currentDevice].backgroundType)return null;var e=this.state.devices[this.state.currentDevice].videoVimeo||"",t=a.localizations?a.localizations.vimeoVideoLink:"Vimeo video link",i=a.localizations?a.localizations.hidingPlayerControls:"Hiding player controls available only for Vimeo PRO users.";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("div",{className:"vcv-ui-form-group-heading-wrapper"},v.createElement("span",{className:"vcv-ui-form-group-heading"},t),v.createElement(xe(),null,i)),v.createElement(be.default,{api:this.props.api,fieldKey:"videoVimeo",updater:this.valueChangeHandler,value:e}))}},{key:"getEmbedVideoRender",value:function(){if("videoEmbed"!==this.state.devices[this.state.currentDevice].backgroundType)return null;var e=this.state.devices[this.state.currentDevice].videoEmbed||{};return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Video"),v.createElement(W,{api:this.props.api,fieldKey:"videoEmbed",options:{multiple:!1},updater:this.valueChangeHandler,value:e}),v.createElement("p",{className:"vcv-ui-form-helper"},"For better browser compatibility please use ",v.createElement("b",null,"mp4")," video format"))}},{key:"render",value:function(){var e=this.state.devices[this.state.currentDevice].display;return e||"all"!==this.state.currentDevice||(e=this.getHiddenState()),v.createElement("div",{className:"advanced-design-options"},this.getDevicesRender(),v.createElement("div",{className:"vcv-ui-row vcv-ui-row-gap--md"},v.createElement("div",{className:"vcv-ui-col vcv-ui-col--fixed-width"},this.getDeviceVisibilityRender(),!e&&this.renderBoxModel()),!e&&v.createElement("div",{className:"vcv-ui-col vcv-ui-col--fixed-width"},this.getBorderStyleRender(),this.getBorderColorRender(),this.getBackgroundTypeRender(),this.getAttachImageRender(),this.getSliderEffectRender(),this.getSliderTimeoutRender(),this.getSliderDirectionRender(),this.getYoutubeVideoRender(),this.getVimeoVideoRender(),this.getEmbedVideoRender(),this.getBackgroundStyleRender(),this.getBackgroundPositionRender(),this.getBackgroundZoomRender(),this.getBackgroundZoomSpeedRender(),this.getBackgroundZoomReverseRender(),this.getBackgroundColorRender(),this.getGradientOverlayRender(),this.getGradientTypeRender(),this.getGradientStartColorRender(),this.getGradientEndColorRender(),this.getGradientAngleRender(),this.getAnimationRender())))}}],[{key:"addPixelToNumber",value:function(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}}]),a}(p.default);(0,d.default)(Oe,"localizations",Le.get("localizations")),(0,d.default)(Oe,"defaultProps",{fieldType:"designOptionsAdvanced"});function je(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Ae={dividers:a("./public/sources/attributes/dividerpicker/lib/dividerShapes-2.0.js")},Me=function(e){(0,o.default)(a,e);var t=je(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),(0,d.default)((0,s.default)(i),"handlePopupToggle",(function(e){e&&e.preventDefault&&e.preventDefault(),i.state.popupOpen?document.body.removeEventListener("click",i.closeIfNotInside):document.body.addEventListener("click",i.closeIfNotInside),i.setState({popupOpen:!i.state.popupOpen,search:""})})),(0,d.default)((0,s.default)(i),"handleSearchChange",(function(e){i.setState({search:e.currentTarget.value})})),(0,d.default)((0,s.default)(i),"closeIfNotInside",(function(e){e&&e.preventDefault();var t=e.target,a=".vcv-ui-form-iconpicker-content",n=".vcv-ui-iconpicker-picker-dropdown";(void 0===t.closest?i.getClosest(t,a)||i.getClosest(t,n):t.closest(a)||t.closest(n))||i.handlePopupToggle()})),i.state={search:"",popupOpen:!1,value:{icon:e.value.icon},showSearch:!0,iconSetList:Ae.dividers},i}return(0,r.default)(a,[{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.closeIfNotInside)}},{key:"filteredIcons",value:function(){var e=this.state,t=e.search,a=e.iconSetList,i=[],n=[];return a.forEach((function(e){n.indexOf(e.id)>-1||(n.push(e.id),i.push(e))})),t&&(i=i.filter((function(e){return e.title.toLowerCase().indexOf(t.toLowerCase())>-1}))),i}},{key:"iconsContent",value:function(){var e=this,t=this.state.value.icon,a=[];return this.filteredIcons().forEach((function(i){var n=D()({"vcv-ui-form-iconpicker-option":!0,"vcv-ui-form-state--active":i.id===t});a.push(v.createElement("span",{key:i.id,className:n,value:i.id,onClick:e.handleChange,title:i.title},v.createElement("i",{className:i.id})))})),a}},{key:"popupContent",value:function(){var e=this.state,t=e.search,a=e.showSearch,i=this.iconsContent();i.length||i.push(v.createElement("div",{className:"vcv-ui-form-iconpicker-error",key:"no-icon-found"},"No icons found"));var n=D()({"vcv-ui-form-iconpicker-content":!0,"vcv-ui-form-state--active":this.state.popupOpen}),l=null;return a&&(l=v.createElement("div",{className:"vcv-ui-input-search"},v.createElement("input",{type:"search",value:t,onChange:this.handleSearchChange,placeholder:"Search Icon",className:"vcv-ui-form-input"}),v.createElement("label",{className:"vcv-ui-form-input-search-addon"},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-search"})))),v.createElement("div",{className:n},v.createElement("div",{className:"vcv-ui-form-iconpicker-content-heading"},l),v.createElement("div",{className:"vcv-ui-form-iconpicker-options"},i))}},{key:"handleChange",value:function(e){var t=Object.assign({},this.state.value);t.icon=e.currentTarget.attributes.value.textContent,this.setFieldValue(t)}},{key:"getClosest",value:function(e,t){var a,i;for(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].some((function(e){return"function"==typeof document.body[e]&&(a=e,!0)}));e;){if((i=e.parentElement)&&i[a](t))return i;e=i}return null}},{key:"render",value:function(){var e=this.state.popupOpen,t=this.state.value.icon,a=D()({"vcv-ui-param-iconpicker-icon-empty":!t},t),i=D()({"vcv-ui-form-dropdown":!0,"vcv-ui-form-dropdown-style--inline":!0,"vcv-ui-iconpicker-picker-dropdown":!0,"vcv-ui-form-state--focus":e}),n="";e&&(n=this.popupContent());var l=D()({"vcv-ui-form-iconpicker":!0});return v.createElement("div",{className:l},v.createElement("div",{className:"vcv-ui-form-iconpicker"},v.createElement("div",{className:i,onClick:this.handlePopupToggle},v.createElement("i",{className:a})),n))}}]),a}(p.default);function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}(0,d.default)(Me,"defaultProps",{fieldType:"dividerpicker"});var _e=function(e){(0,o.default)(a,e);var t=Ne(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),e.setInnerFieldStatus&&e.setInnerFieldStatus(),i.devicesChangeHandler=i.devicesChangeHandler.bind((0,s.default)(i)),i.valueChangeHandler=i.valueChangeHandler.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"updateState",value:function(e){return e.value?this.parseValue(e.value):w().defaultsDeep({},e,a.defaultState)}},{key:"parseValue",value:function(e){var t=w().defaultsDeep({},a.defaultState),i=this.getCustomDevicesKeys();return w().isEmpty(e.device)||(t.currentDevice=Object.keys(e.device).shift()),i.push("all"),i.forEach((function(i){t.devices[i]=w().defaultsDeep({},a.deviceDefaults),e.device&&e.device[i]&&(t.devices[i]=w().defaultsDeep({},e.device[i],t.devices[i]))})),t}},{key:"updateValue",value:function(e,t){var i={},n={},l=[];"all"===(e=this.updateState(e)).currentDevice?l.push("all"):l=l.concat(this.getCustomDevicesKeys()),l.forEach((function(t){if(!w().isEmpty(e.devices[t])){if(e.devices[t].dividerTopBackgroundStyle||(e.devices[t].dividerTopBackgroundStyle=a.deviceDefaults.dividerTopBackgroundStyle),e.devices[t].dividerBottomBackgroundStyle||(e.devices[t].dividerBottomBackgroundStyle=a.deviceDefaults.dividerBottomBackgroundStyle),e.devices[t].dividerTopBackgroundPosition||(e.devices[t].dividerTopBackgroundPosition=a.deviceDefaults.dividerTopBackgroundPosition),e.devices[t].dividerBottomBackgroundPosition||(e.devices[t].dividerBottomBackgroundPosition=a.deviceDefaults.dividerBottomBackgroundPosition),i[t]=w().defaultsDeep({},e.devices[t]),i[t].dividerTop){if("image"!==e.devices[t].dividerTopBackgroundType&&"videoEmbed"!==e.devices[t].dividerTopBackgroundType&&"videoYoutube"!==e.devices[t].dividerTopBackgroundType&&"videoVimeo"!==e.devices[t].dividerTopBackgroundType&&(delete i[t].dividerTopBackgroundImage,delete i[t].dividerTopBackgroundStyle,delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopVideoEmbed,delete i[t].dividerTopVideoYoutube,delete i[t].dividerTopVideoVimeo),"image"===e.devices[t].dividerTopBackgroundType)if(Object.prototype.hasOwnProperty.call(i[t],"dividerTopBackgroundImage")){var n=i[t].dividerTopBackgroundImage,l=n.constructor===Array;(l&&0===n.length||!l&&(!n.urls||0===n.urls.length))&&(delete i[t].dividerTopBackgroundStyle,delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopVideoEmbed,delete i[t].dividerTopVideoYoutube,delete i[t].dividerTopVideoVimeo)}else delete i[t].dividerTopBackgroundStyle,delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopVideoEmbed,delete i[t].dividerTopVideoYoutube,delete i[t].dividerTopVideoVimeo;if("videoEmbed"===e.devices[t].dividerTopBackgroundType)if(delete i[t].dividerTopBackgroundStyle,Object.prototype.hasOwnProperty.call(i[t],"dividerTopVideoEmbed")){var r=i[t].dividerTopVideoEmbed,s=r.constructor===Array;(s&&0===r.length||!s&&(!r.urls||0===r.urls.length))&&(delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopBackgroundImage,delete i[t].dividerTopVideoYoutube,delete i[t].dividerTopVideoVimeo)}else delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopBackgroundImage,delete i[t].dividerTopVideoYoutube,delete i[t].dividerTopVideoVimeo;if("videoYoutube"===e.devices[t].dividerTopBackgroundType)if(delete i[t].dividerTopBackgroundStyle,Object.prototype.hasOwnProperty.call(i[t],"dividerTopVideoYoutube"))i[t].dividerTopVideoYoutube||(delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopBackgroundImage,delete i[t].dividerTopVideoEmbed,delete i[t].dividerTopVideoVimeo);else delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopBackgroundImage,delete i[t].dividerTopVideoEmbed,delete i[t].dividerTopVideoVimeo;if("videoVimeo"===e.devices[t].dividerTopBackgroundType)if(delete i[t].dividerTopBackgroundStyle,Object.prototype.hasOwnProperty.call(i[t],"dividerTopVideoVimeo"))i[t].dividerTopVideoVimeo||(delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopBackgroundImage,delete i[t].dividerTopVideoEmbed,delete i[t].dividerTopVideoYoutube);else delete i[t].dividerTopBackgroundPosition,delete i[t].dividerTopBackgroundImage,delete i[t].dividerTopVideoEmbed,delete i[t].dividerTopVideoYoutube}else Object.keys(i[t]).forEach((function(e){"dividerTop"!==e&&e.includes("dividerTop")&&delete i[t][e]}));if(i[t].dividerBottom){if("image"!==e.devices[t].dividerBottomBackgroundType&&"videoEmbed"!==e.devices[t].dividerBottomBackgroundType&&"videoYoutube"!==e.devices[t].dividerBottomBackgroundType&&"videoVimeo"!==e.devices[t].dividerBottomBackgroundType&&(delete i[t].dividerBottomBackgroundImage,delete i[t].dividerBottomBackgroundStyle,delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomVideoEmbed,delete i[t].dividerBottomVideoYoutube,delete i[t].dividerBottomVideoVimeo),"image"===e.devices[t].dividerBottomBackgroundType)if(Object.prototype.hasOwnProperty.call(i[t],"dividerBottomBackgroundImage")){var o=i[t].dividerBottomBackgroundImage,c=o.constructor===Array;(c&&0===o.length||!c&&(!o.urls||0===o.urls.length))&&(delete i[t].dividerBottomBackgroundStyle,delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomVideoEmbed,delete i[t].dividerBottomVideoYoutube,delete i[t].dividerBottomVideoVimeo)}else delete i[t].dividerBottomBackgroundStyle,delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomVideoEmbed,delete i[t].dividerBottomVideoYoutube,delete i[t].dividerBottomVideoVimeo;if("videoEmbed"===e.devices[t].dividerBottomBackgroundType)if(delete i[t].dividerBottomBackgroundStyle,Object.prototype.hasOwnProperty.call(i[t],"dividerBottomVideoEmbed")){var u=i[t].dividerBottomVideoEmbed,d=u.constructor===Array;(d&&0===u.length||!d&&(!u.urls||0===u.urls.length))&&(delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomBackgroundImage,delete i[t].dividerBottomVideoYoutube,delete i[t].dividerBottomVideoVimeo)}else delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomBackgroundImage,delete i[t].dividerBottomVideoYoutube,delete i[t].dividerBottomVideoVimeo;if("videoYoutube"===e.devices[t].dividerBottomBackgroundType)if(delete i[t].dividerBottomBackgroundStyle,Object.prototype.hasOwnProperty.call(i[t],"dividerBottomVideoYoutube"))i[t].dividerBottomVideoYoutube||(delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomBackgroundImage,delete i[t].dividerBottomVideoEmbed,delete i[t].dividerBottomVideoVimeo);else delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomBackgroundImage,delete i[t].dividerBottomVideoEmbed,delete i[t].dividerBottomVideoVimeo;if("videoVimeo"===e.devices[t].dividerBottomBackgroundType)if(delete i[t].dividerBottomBackgroundStyle,Object.prototype.hasOwnProperty.call(i[t],"dividerBottomVideoVimeo"))i[t].dividerBottomVideoVimeo||(delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomBackgroundImage,delete i[t].dividerBottomVideoEmbed,delete i[t].dividerBottomVideoYoutube);else delete i[t].dividerBottomBackgroundPosition,delete i[t].dividerBottomBackgroundImage,delete i[t].dividerBottomVideoEmbed,delete i[t].dividerBottomVideoYoutube}else Object.keys(i[t]).forEach((function(e){"dividerBottom"!==e&&e.includes("dividerBottom")&&delete i[t][e]}));Object.keys(i[t]).length||delete i[t]}}));var r=l.concat(this.getCustomDevicesKeys());r.push("all"),r.forEach((function(e){var t="dividerTopMixin:".concat(e);n[t]=w().defaultsDeep({},a.attributeMixins.dividerTopMixin),n[t].variables.device={value:e},t="dividerBottomMixin:".concat(e),n[t]=w().defaultsDeep({},a.attributeMixins.dividerBottomMixin),n[t].variables.device={value:e}})),this.setFieldValue(i,n,t),this.setState(e)}},{key:"setFieldValue",value:function(e,t,a){var i=this.props;(0,i.updater)(i.fieldKey,{device:e,attributeMixins:t},a)}},{key:"getCustomDevices",value:function(){return[{label:"Desktop",value:"xl",icon:"vcv-ui-icon-desktop"},{label:"Tablet Landscape",value:"lg",icon:"vcv-ui-icon-tablet-landscape"},{label:"Tablet Portrait",value:"md",icon:"vcv-ui-icon-tablet-portrait"},{label:"Mobile Landscape",value:"sm",icon:"vcv-ui-icon-mobile-landscape"},{label:"Mobile Portrait",value:"xs",icon:"vcv-ui-icon-mobile-portrait"}]}},{key:"getCustomDevicesKeys",value:function(){return this.getCustomDevices().map((function(e){return e.value}))}},{key:"getDevicesRender",value:function(){return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group--has-inner-fields"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Device type"),v.createElement(ge.default,{api:this.props.api,fieldKey:"currentDevice",options:{customDevices:this.getCustomDevices()},updater:this.devicesChangeHandler,value:this.state.currentDevice}))}},{key:"devicesChangeHandler",value:function(e,t){var a=w().defaultsDeep({},(0,d.default)({},e,t),this.state);"all"===a.currentDevice?(a.devices.all=w().defaultsDeep({},a.devices[this.getCustomDevicesKeys().shift()]),delete a.devices.all.display):"all"===this.state.currentDevice&&this.getCustomDevicesKeys().forEach((function(e){a.devices[e]=w().defaultsDeep({},a.devices.all)})),this.updateValue(a,e)}},{key:"valueChangeHandler",value:function(e,t){var a=w().defaultsDeep({},this.state);a.devices[a.currentDevice][e]=t,this.updateValue(a,e)}},{key:"getDividerRender",value:function(e){var t="divider".concat(e),a=this.state.devices[this.state.currentDevice][t]||!1,i=t,n="Enable ".concat(e.toLowerCase()," shape divider");return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:i,updater:this.valueChangeHandler,options:{labelText:n},value:a}))}},{key:"getDividerShapeRender",value:function(e){var t="divider".concat(e),i="".concat(t,"Shape"),n=this.state.devices[this.state.currentDevice];if(!n[t])return null;var l=n[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider shape"),v.createElement(Me,{api:this.props.api,fieldKey:i,updater:this.valueChangeHandler,value:l}))}},{key:"getDividerFlipRender",value:function(e){var t="divider".concat(e),i="".concat(t,"FlipHorizontal"),n=this.state.devices[this.state.currentDevice];if(!n[t])return null;var l=n[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Flip"),v.createElement(ae.default,{api:this.props.api,fieldKey:i,options:{values:[{label:"Left",value:"horizontally-left",icon:"vcv-ui-icon-attribute-mirror-horizontally-left"},{label:"Right",value:"horizontally-right",icon:"vcv-ui-icon-attribute-mirror-horizontally-right"}]},updater:this.valueChangeHandler,value:l}))}},{key:"getDividerHeightRender",value:function(e){var t="divider".concat(e),a="".concat(t,"Height"),i=this.state.devices[this.state.currentDevice];if(!i[t])return null;var n=i[a];return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider size"),v.createElement(X,{api:this.props.api,fieldKey:a,updater:this.valueChangeHandler,options:{min:0,max:200,measurement:"%"},value:n}))}},{key:"getDividerWidthRender",value:function(e){var t="divider".concat(e),a="".concat(t,"Width"),i=this.state.devices[this.state.currentDevice];if(!i[t])return null;var n=i[a];return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider form scale"),v.createElement(X,{api:this.props.api,fieldKey:a,updater:this.valueChangeHandler,options:{min:100,max:300,measurement:"%"},value:n}))}},{key:"getDividerBackgroundTypeRender",value:function(e){var t="divider".concat(e),i="".concat(t,"BackgroundType"),n=this.state.devices[this.state.currentDevice];if(!n[t])return null;var l=n[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider background type"),v.createElement(ye.default,{api:this.props.api,fieldKey:i,options:{values:[{label:"Color",value:"color"},{label:"Gradient",value:"gradient"},{label:"Image",value:"image"},{label:"Self-hosted video",value:"videoEmbed"},{label:"Youtube video",value:"videoYoutube"},{label:"Vimeo video",value:"videoVimeo"}]},updater:this.valueChangeHandler,value:l}))}},{key:"getDividerBackgroundColorRender",value:function(e){var t="divider".concat(e),i="".concat(t,"BackgroundColor"),n="".concat(t,"BackgroundType"),l=this.state.devices[this.state.currentDevice],r=l[n];if(!l[t]||"color"!==r)return null;var s=l[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider background color"),v.createElement(Y.default,{api:this.props.api,fieldKey:i,updater:this.valueChangeHandler,value:s,defaultValue:a.deviceDefaults[i]}))}},{key:"getDividerBackgroundGradientStartColorRender",value:function(e){var t="divider".concat(e),i="".concat(t,"BackgroundGradientStartColor"),n="".concat(t,"BackgroundType"),l=this.state.devices[this.state.currentDevice],r=l[n];if(!l[t]||"gradient"!==r)return null;var s=l[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider start color"),v.createElement(Y.default,{api:this.props.api,fieldKey:i,updater:this.valueChangeHandler,value:s,defaultValue:a.deviceDefaults[i]}))}},{key:"getDividerBackgroundGradientEndColorRender",value:function(e){var t="divider".concat(e),i="".concat(t,"BackgroundGradientEndColor"),n="".concat(t,"BackgroundType"),l=this.state.devices[this.state.currentDevice],r=l[n];if(!l[t]||"gradient"!==r)return null;var s=l[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider end color"),v.createElement(Y.default,{api:this.props.api,fieldKey:i,updater:this.valueChangeHandler,value:s,defaultValue:a.deviceDefaults[i]}))}},{key:"getDividerBackgroundGradientAngleRender",value:function(e){var t="divider".concat(e),a="".concat(t,"BackgroundGradientAngle"),i="".concat(t,"BackgroundType"),n=this.state.devices[this.state.currentDevice],l=n[i];if(!n[t]||"gradient"!==l)return null;var r=n[a];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider gradient angle"),v.createElement(X,{api:this.props.api,fieldKey:a,updater:this.valueChangeHandler,options:{min:0,max:180,measurement:"°"},value:r}))}},{key:"getDividerAttachImageRender",value:function(e){var t="divider".concat(e),a="".concat(t,"BackgroundImage"),i="".concat(t,"BackgroundType"),n=this.state.devices[this.state.currentDevice],l=n[i];if(!n[t]||"image"!==l)return null;var r=n[a]||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider image"),v.createElement(k.default,{api:this.props.api,fieldKey:a,options:{multiple:!1},updater:this.valueChangeHandler,value:r,elementAccessPoint:this.props.elementAccessPoint}))}},{key:"getDividerBackgroundStyleRender",value:function(e){var t="divider".concat(e),i="".concat(t,"BackgroundStyle"),n="".concat(t,"BackgroundType"),l="".concat(t,"BackgroundImage"),r=this.state.devices[this.state.currentDevice],s=r[n];if(!r[t]||"image"!==s||!Object.prototype.hasOwnProperty.call(r,l))return null;var o=r[l],c=o.constructor===Array;if(c&&0===o.length||!c&&(!o.urls||0===o.urls.length))return null;var u=r[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider background style"),v.createElement(ye.default,{api:this.props.api,fieldKey:i,options:{values:[{label:"Cover",value:"cover"},{label:"Contain",value:"contain"},{label:"Full width",value:"full-width"},{label:"Full height",value:"full-height"},{label:"Repeat",value:"repeat"},{label:"Repeat horizontal",value:"repeat-x"},{label:"Repeat vertical",value:"repeat-y"},{label:"No repeat",value:"no-repeat"}]},updater:this.valueChangeHandler,value:u}))}},{key:"getDividerBackgroundPositionRender",value:function(e){var t="divider".concat(e),i="".concat(t,"BackgroundPosition"),n="".concat(t,"BackgroundType"),l="".concat(t,"BackgroundImage"),r="".concat(t,"VideoEmbed"),s="".concat(t,"VideoYoutube"),o="".concat(t,"VideoVimeo"),c=this.state.devices[this.state.currentDevice],u=c[n];if("image"!==u&&"videoEmbed"!==u&&"videoYoutube"!==u&&"videoVimeo"!==u||!c[t])return null;if("image"===u){if(!Object.prototype.hasOwnProperty.call(c,l))return null;var d=c[l],p=d.constructor===Array;if(p&&0===d.length||!p&&(!d.urls||0===d.urls.length))return null}if("videoEmbed"===u){if(!Object.prototype.hasOwnProperty.call(c,r))return null;var m=c[r],f=m.constructor===Array;if(f&&0===m.length||!f&&(!m.urls||0===m.urls.length))return null}if("videoYoutube"===u&&!c[s])return null;if("videoVimeo"===u&&!c[o])return null;var h=c[i]||a.deviceDefaults[i];return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider background position"),v.createElement(ae.default,{api:this.props.api,fieldKey:i,options:{values:[{label:"Left top",value:"left-top",icon:"vcv-ui-icon-attribute-background-position-left-top"},{label:"Center top",value:"center-top",icon:"vcv-ui-icon-attribute-background-position-center-top"},{label:"Right top",value:"right-top",icon:"vcv-ui-icon-attribute-background-position-right-top"},{label:"Left center",value:"left-center",icon:"vcv-ui-icon-attribute-background-position-left-center"},{label:"Center center",value:"center-center",icon:"vcv-ui-icon-attribute-background-position-center-center"},{label:"Right center",value:"right-center",icon:"vcv-ui-icon-attribute-background-position-right-center"},{label:"Left bottom",value:"left-bottom",icon:"vcv-ui-icon-attribute-background-position-left-bottom"},{label:"Center bottom",value:"center-bottom",icon:"vcv-ui-icon-attribute-background-position-center-bottom"},{label:"Right bottom",value:"right-bottom",icon:"vcv-ui-icon-attribute-background-position-right-bottom"}]},updater:this.valueChangeHandler,value:h}))}},{key:"getDividerEmbedVideoRender",value:function(e){var t="divider".concat(e),a="".concat(t,"BackgroundType"),i="".concat(t,"VideoEmbed"),n=this.state.devices[this.state.currentDevice],l=n[a];if(!n[t]||"videoEmbed"!==l)return null;var r=n[i]||{};return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Divider background video"),v.createElement(W,{api:this.props.api,fieldKey:i,options:{multiple:!1},updater:this.valueChangeHandler,value:r}),v.createElement("p",{className:"vcv-ui-form-helper"},"For better browser compatibility please use ",v.createElement("b",null,"mp4")," video format"))}},{key:"getDividerYoutubeVideoRender",value:function(e){var t="divider".concat(e),a="".concat(t,"BackgroundType"),i="".concat(t,"VideoYoutube"),n=this.state.devices[this.state.currentDevice],l=n[a];if(!n[t]||"videoYoutube"!==l)return null;var r=n[i]||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"YouTube video link"),v.createElement(be.default,{api:this.props.api,fieldKey:i,updater:this.valueChangeHandler,value:r}))}},{key:"getDividerVimeoVideoRender",value:function(e){var t="divider".concat(e),a="".concat(t,"BackgroundType"),i="".concat(t,"VideoVimeo"),n=this.state.devices[this.state.currentDevice],l=n[a];if(!n[t]||"videoVimeo"!==l)return null;var r=n[i]||"";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("span",{className:"vcv-ui-form-group-heading"},"Vimeo video link"),v.createElement(be.default,{api:this.props.api,fieldKey:i,updater:this.valueChangeHandler,value:r}))}},{key:"render",value:function(){return v.createElement("div",{className:"vcv-ui-divider-section"},this.getDevicesRender(),v.createElement("div",{className:"vcv-ui-row vcv-ui-row-gap--md"},v.createElement("div",{className:"vcv-ui-col vcv-ui-col--fixed-width"},this.getDividerRender("Top"),this.getDividerShapeRender("Top"),this.getDividerFlipRender("Top"),this.getDividerHeightRender("Top"),this.getDividerWidthRender("Top"),this.getDividerBackgroundTypeRender("Top"),this.getDividerBackgroundColorRender("Top"),this.getDividerBackgroundGradientStartColorRender("Top"),this.getDividerBackgroundGradientEndColorRender("Top"),this.getDividerBackgroundGradientAngleRender("Top"),this.getDividerAttachImageRender("Top"),this.getDividerBackgroundStyleRender("Top"),this.getDividerEmbedVideoRender("Top"),this.getDividerYoutubeVideoRender("Top"),this.getDividerVimeoVideoRender("Top"),this.getDividerBackgroundPositionRender("Top"),this.getDividerRender("Bottom"),this.getDividerShapeRender("Bottom"),this.getDividerFlipRender("Bottom"),this.getDividerHeightRender("Bottom"),this.getDividerWidthRender("Bottom"),this.getDividerBackgroundTypeRender("Bottom"),this.getDividerBackgroundColorRender("Bottom"),this.getDividerBackgroundGradientStartColorRender("Bottom"),this.getDividerBackgroundGradientEndColorRender("Bottom"),this.getDividerBackgroundGradientAngleRender("Bottom"),this.getDividerAttachImageRender("Bottom"),this.getDividerBackgroundStyleRender("Bottom"),this.getDividerEmbedVideoRender("Bottom"),this.getDividerYoutubeVideoRender("Bottom"),this.getDividerVimeoVideoRender("Bottom"),this.getDividerBackgroundPositionRender("Bottom"))))}}]),a}(p.default);(0,d.default)(_e,"defaultProps",{fieldType:"divider"}),(0,d.default)(_e,"attributeMixins",{dividerTopMixin:{src:a("./node_modules/raw-loader/index.js!./public/sources/attributes/divider/cssMixins/dividerTop.pcss"),variables:{device:{value:"all"}}},dividerBottomMixin:{src:a("./node_modules/raw-loader/index.js!./public/sources/attributes/divider/cssMixins/dividerBottom.pcss"),variables:{device:{value:"all"}}}}),(0,d.default)(_e,"deviceDefaults",{dividerTopBackgroundStyle:"cover",dividerTopBackgroundPosition:"center-top",dividerTopFlipHorizontal:"horizontally-left",dividerTopFlipVertical:"vertically-down",dividerTopBackgroundType:"color",dividerTopShape:{icon:"vcv-ui-icon-divider vcv-ui-icon-divider-zigzag",iconSet:"dividers"},dividerTopBackgroundColor:"#6567df",dividerTopBackgroundGradientStartColor:"rgb(226, 135, 135)",dividerTopBackgroundGradientEndColor:"rgb(93, 55, 216)",dividerTopBackgroundGradientAngle:0,dividerTopWidth:"100",dividerTopHeight:"20",dividerBottomBackgroundStyle:"cover",dividerBottomBackgroundPosition:"center-top",dividerBottomFlipHorizontal:"horizontally-left",dividerBottomFlipVertical:"vertically-down",dividerBottomBackgroundType:"color",dividerBottomShape:{icon:"vcv-ui-icon-divider vcv-ui-icon-divider-zigzag",iconSet:"dividers"},dividerBottomBackgroundColor:"#6567df",dividerBottomBackgroundGradientStartColor:"rgb(226, 135, 135)",dividerBottomBackgroundGradientEndColor:"rgb(93, 55, 216)",dividerBottomBackgroundGradientAngle:0,dividerBottomWidth:"100",dividerBottomHeight:"20"}),(0,d.default)(_e,"defaultState",{currentDevice:"all",devices:{},attributeMixins:{}});var Be=a("./node_modules/@babel/runtime/helpers/esm/typeof.js");function Ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Fe=function(e){(0,o.default)(a,e);var t=Ie(a);function a(e){var i;(0,l.default)(this,a),(i=t.call(this,e)).fieldAttributeWrapper=v.createRef(),i.attributeComponent=v.createRef();var n=e.elementAccessPoint.cook().toJS()[e.fieldKey];return e.options&&e.options.nestedAttr&&(n=e.options.activeParamGroup[e.fieldKey]),i.state={value:n,dependenciesClasses:[],hasInnerFields:!1,isFieldLoading:!1},i.setInnerFieldStatus=i.setInnerFieldStatus.bind((0,s.default)(i)),i.updateValue=i.updateValue.bind((0,s.default)(i)),i.updateElement=i.updateElement.bind((0,s.default)(i)),i.setLoadingState=i.setLoadingState.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){this.props.elementAccessPoint.onAttributeChange(this.props.fieldKey,this.updateValue),this.props.setFieldMount(this.props.fieldKey,{refWrapper:this.fieldAttributeWrapper.current,refWrapperComponent:this,refAttributeComponent:this.attributeComponent.current},"field")}},{key:"componentWillUnmount",value:function(){this.props.elementAccessPoint.ignoreAttributeChange(this.props.fieldKey,this.updateValue),this.props.setFieldUnmount(this.props.fieldKey,"field")}},{key:"componentDidUpdate",value:function(){this.props.elementAccessPoint.ignoreAttributeChange(this.props.fieldKey,this.updateValue),this.props.elementAccessPoint.onAttributeChange(this.props.fieldKey,this.updateValue),this.props.setFieldMount(this.props.fieldKey,{refWrapper:this.fieldAttributeWrapper.current,refWrapperComponent:this,refAttributeComponent:this.attributeComponent.current},"field")}},{key:"updateValue",value:function(e){w().isEqual(e,this.state.value)||this.setState({value:e})}},{key:"updateElement",value:function(e,t){this.props.updater(e,t),this.props.onAttributeChange(e)}},{key:"setInnerFieldStatus",value:function(){this.setState({hasInnerFields:!0})}},{key:"setLoadingState",value:function(e){this.setState({isFieldLoading:e})}},{key:"render",value:function(){var e=this.props,t=e.elementAccessPoint,a=e.fieldKey,i=t.cook(),n=i.toJS(),l=i.settings(a),r=l.type,s=l.settings,o=r.component;if(!o)return null;if(!s)throw new Error("Wrong attribute settings "+a);if(!r)throw new Error("Wrong attribute type "+a);var c=D()({"vcv-ui-form-dependency":!0},this.state.dependenciesClasses),u=D()({"vcv-ui-form-group":!0,"vcv-ui-form-group--has-inner-fields":this.state.hasInnerFields}),d=null;a&&n&&(d=n[a]);var p=s.options,m="",f=null;if(p&&"string"==typeof p.description&&(f=v.createElement(xe(),null,p.description)),p&&"string"==typeof p.label){var h=null;this.state.isFieldLoading&&(h=v.createElement("span",{className:"vcv-ui-wp-spinner"})),m=v.createElement("div",{className:"vcv-ui-form-group-heading-wrapper"},v.createElement("span",{className:"vcv-ui-form-group-heading"},p.label,h),f)}var g="";if(p&&p.descriptionHTML){var y=p.descriptionHTML.replace("{vcvCreateMenuUrl}",window.vcvCreateMenuUrl);g=v.createElement("p",{className:"vcv-ui-form-helper",dangerouslySetInnerHTML:{__html:y}})}var b=s.defaultValue;return void 0===b&&(b=s.value),v.createElement("div",{ref:this.fieldAttributeWrapper,className:c},v.createElement("div",{className:u,key:"element-form-group-field-".concat(i.get("id"),"-").concat(a)},m,v.createElement(o,(0,S.default)({},this.props,{key:"inner-attribute-"+a+i.get("id"),options:p,value:d,fieldKey:a,defaultValue:b,updater:this.updateElement,elementAccessPoint:t,ref:this.attributeComponent,setLoadingState:this.setLoadingState})),g))}}]),a}(v.Component);function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}(0,d.default)(Fe,"propTypes",{elementAccessPoint:P().object.isRequired,fieldKey:P().string.isRequired,updater:P().func.isRequired,setFieldMount:P().func.isRequired,setFieldUnmount:P().func.isRequired});var He=(0,i.getService)("rulesManager"),Ue=(0,i.getService)("actionsManager"),ze=function(e){(0,o.default)(a,e);var t=Ve(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),(0,d.default)((0,s.default)(i),"field",(function(e){if("designOptions"!==e.key&&"metaCustomId"!==e.key&&!(i.props.exclude&&i.props.exclude.length&&i.props.exclude.indexOf(e.key)>=0))return v.createElement(Fe,(0,S.default)({},i.props,{setFieldMount:i.setFieldMount,setFieldUnmount:i.setFieldUnmount,onAttributeChange:i.handleAttributeChange,key:"element-edit-form-field-".concat(i.props.elementAccessPoint.id,"-").concat(e.key),fieldKey:e.key,fieldType:e.data.type.name||e.data.settings.type,updater:i.onElementChange}))})),(0,d.default)((0,s.default)(i),"onElementChange",(function(e,t){i.props.elementAccessPoint.set(e,t),i.callFieldActivities(null,e),i.props.onChange()})),(0,d.default)((0,s.default)(i),"setFieldMount",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"field";a.mount[e]||(a.mount[e]={}),void 0===a.mount[e][n]&&(t.key=e,t.type=n,a.mount[e][n]=t,i.callInitialStack(e),i.callMountStack(e))})),(0,d.default)((0,s.default)(i),"setFieldUnmount",(function(e,t){t&&a.mount[e]?(delete a.mount[e][t],a.stack[e]&&a.stack[e][t]&&delete a.stack[e][t]):a.mount[e]&&(delete a.mount[e].field,a.stack[e]&&a.stack[e].field&&delete a.stack[e].field)})),(0,d.default)((0,s.default)(i),"callFieldActivities",(function(e,t){i.listeners[t]&&w().each(i.listeners[t],(function(n){!a.mount[n.key]||e&&n.key!==e||i.addStack(n,t)})),a.stack[t]&&(a.stack[t]=a.stack[t].filter(i.callStack.bind((0,s.default)(i),t)))})),(0,d.default)((0,s.default)(i),"callMountStack",(function(e){a.mountStack[e]&&(a.mountStack[e]=a.mountStack[e].filter(i.callFieldActivities.bind((0,s.default)(i),e)))})),(0,d.default)((0,s.default)(i),"callInitialStack",(function(e){a.initialStack[e]&&a.initialStack[e].map(i.callFieldActivities.bind((0,s.default)(i),e))})),(0,d.default)((0,s.default)(i),"callStack",(function(e,t){if(!a.mount[t.key])return i.addMountStack(t,e),!0;var n=i.props.elementAccessPoint.cook(),l=n.toJS(),r=Object.keys(a.mount[t.key]),s=n.settings(t.key);if(i.props.options&&i.props.options.nestedAttr){var o=n.settings(i.props.options.fieldKey).settings.options.settings;s=n.settings(t.key,o)}var c=i.getOnChange(s).rules,u=i.props.options&&i.props.options.nestedAttr,d=l;return u&&(d=l[i.props.options.fieldKey].value[i.props.options.activeParamGroupIndex]),c&&He.check(d,c,(function(e){!function(e,t){var s=i.getOnChange(n.settings(t.key)).actions;if(i.props.options&&i.props.options.nestedAttr){var o=n.settings(i.props.options.fieldKey).settings.options.settings,c=n.settings(t.key,o);s=i.getOnChange(c).actions}s&&r.forEach((function(i){s.forEach((function(r){var s=a.mount[t.key][i];s.value=l[t.key],Ue.do(r,e,s,n)}))}))}(e,t)})),!1})),i.handleAttributeChange=i.handleAttributeChange.bind((0,s.default)(i)),i.listeners=i.initListeners(i.props.elementAccessPoint.cook(),e),i}return(0,r.default)(a,[{key:"render",value:function(){var e=this,t=[];return this.props.allTabs.forEach((function(a){var i=D()({},"vcv-ui-editor-plate-".concat(a.id));t.push(v.createElement("div",{key:"element-plate-visible-".concat(e.props.elementAccessPoint.id,"-").concat(a.id),className:i},a.params.map(e.field)))})),v.createElement("div",null,t)}},{key:"initListeners",value:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[],n=Object.keys(e.getAll(!1));return a.options&&a.options.nestedAttr&&(n=Object.keys(e.settings(a.options.fieldKey).settings.options.settings)),n.forEach((function(n){var l=t.getOnChange(e.settings(n)).rules;if(a.options&&a.options.nestedAttr){var r=e.settings(a.options.fieldKey).settings.options.settings;l=t.getOnChange(e.settings(n,r)).rules}l&&Object.keys(l).forEach((function(e){i[e]||(i[e]=[]),i[e].push({key:n}),t.addInitialStack(n,e)}))})),i}},{key:"getOnChange",value:function(e){return e&&e.settings&&e.settings.options&&e.settings.options.onChange?e.settings.options.onChange:{}}},{key:"handleAttributeChange",value:function(e){this.callFieldActivities(null,e)}},{key:"addStack",value:function(e,t){a.stack[t]||(a.stack[t]=[]),a.stack[t].push(e)}},{key:"addMountStack",value:function(e,t){a.mountStack[e.key]||(a.mountStack[e.key]=[]),a.mountStack[e.key].push(t)}},{key:"addInitialStack",value:function(e,t){a.initialStack[e]||(a.initialStack[e]=[]),a.initialStack[e].push(t)}}]),a}(v.Component);function $e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}(0,d.default)(ze,"propTypes",{elementAccessPoint:P().object.isRequired,activeTabId:P().string,options:P().object,exclude:P().array}),(0,d.default)(ze,"mount",{}),(0,d.default)(ze,"stack",{}),(0,d.default)(ze,"mountStack",{}),(0,d.default)(ze,"initialStack",{});var Ke=n().getService("cook"),We=n().getService("elementAccessPoint"),Ge=n().getService("hubElements"),qe=n().getStorage("hubElements"),Ze=n().getStorage("workspace"),Ye=n().getService("dataManager"),Je=n().getService("roleManager"),Qe=function(e){(0,o.default)(a,e);var t=$e(a);function a(e){var i;return(0,l.default)(this,a),(i=t.call(this,e)).handleAttributeChange=i.handleAttributeChange.bind((0,s.default)(i)),i.onClickReplacement=i.onClickReplacement.bind((0,s.default)(i)),i.handleReplacementsToggle=i.handleReplacementsToggle.bind((0,s.default)(i)),i.handleSectionToggle=i.handleSectionToggle.bind((0,s.default)(i)),i.handleToggleShowReplace=i.handleToggleShowReplace.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"updateState",value:function(e){!e.value.id&&e.fieldKeyInner&&(e.value.id=e.fieldKeyInner);var t=We.getInstance(null,e.value,e);return t.parentElementAccessPoint=this.props.elementAccessPoint,{allValues:Object.assign({},e.value),value:e.value,tag:e.value.tag,elementAccessPoint:t,allTabs:a.updateTabs(t.cook()),isInnerElementReplaceOpened:e.isInnerElementReplaceOpened}}},{key:"handleGoToHub",value:function(){var e={action:"addHub",element:{},tag:"",options:{filterType:"element",id:0,bundleType:void 0}};Ze.state("settings").set(e)}},{key:"onClickReplacement",value:function(e,t){var i=this,n={tag:e};t&&(n=t.toJS()),n.id=this.state.value.id;var l=We.getInstance(null,n);l.parentElementAccessPoint=this.props.elementAccessPoint;var r=l.cook(),s=Object.assign({},this.state.allValues,this.state.value);this.props.options&&this.props.options.merge&&Object.keys(r.toJS()).forEach((function(e){void 0!==s[e]&&(i.props.options.merge.attributes.findIndex((function(t){return t.key===e&&t.type===(0,Be.default)(s[e])}))>-1&&(r.set(e,s[e]),l.set(e,s[e])))}));var o=r.toJS();this.setState({allValues:Object.assign({},this.state.value,n),value:o,tag:r.get("tag"),elementAccessPoint:l,allTabs:a.updateTabs(r)}),this.setFieldValue(o)}},{key:"onClickReplacementDropdown",value:function(e,t){this.onClickReplacement(t)}},{key:"handleReplacementsToggle",value:function(){this.setState({showReplacements:!this.state.showReplacements})}},{key:"handleAttributeChange",value:function(){this.setFieldValue(this.state.elementAccessPoint.cook().toJS())}},{key:"handleSectionToggle",value:function(e){(e.currentTarget===e.target||e.target&&e.target.classList&&e.target.classList.contains("vcv-ui-edit-form-section-header-title"))&&this.setState({isActive:!this.state.isActive})}},{key:"getReplacementItem",value:function(e,t){var a=Ke.get(e);if(!a||!a.get("name")||"--"===a.get("name"))return null;var i=e.tag,n=t||a.get("name"),l=a.get("metaThumbnailUrl"),r=D()({"vcv-ui-item-element-content":!0,"vcv-ui-item-list-item-content--active":!t&&this.state.tag===i}),s=D()({"vcv-ui-item-list-item":!0,"vcv-ui-item-list-item--preset":!!t});return v.createElement("li",{key:"vcv-replace-element-".concat(n.replace(/ /g,""),"-").concat(i),className:s},v.createElement("span",{className:"vcv-ui-item-element",onClick:this.onClickReplacement.bind(this,i,t?a:null)},v.createElement("span",{className:r},v.createElement("img",{className:"vcv-ui-item-element-image",src:l,alt:n}),v.createElement("span",{className:"vcv-ui-item-overlay"},v.createElement("span",{className:"vcv-ui-item-add vcv-ui-icon vcv-ui-icon-add"}))),v.createElement("span",{className:"vcv-ui-item-element-name"},v.createElement("span",null,n))))}},{key:"getReplacements",value:function(e){var t=this;return e.elements.map((function(e){return t.getReplacementItem({tag:e})}))}},{key:"getPresetReplacements",value:function(e){var t=this;return e.map((function(e){return t.getReplacementItem(e.presetData,e.name)}))}},{key:"getReplaceShownStatus",value:function(e){var t=Ge.get(e),a=!1;(qe.action("getPresetsByCategory",e).length&&(a=!0),!a&&t&&t.elements&&t.elements.length>1)&&(a=t.elements.filter((function(e){return Object.keys(qe.state("elements").get()).includes(e)})).length>1);return a}},{key:"handleToggleShowReplace",value:function(){this.setState({isInnerElementReplaceOpened:!this.state.isInnerElementReplaceOpened})}},{key:"render",value:function(){var e=this.props.options,t=e.category,i=e.replaceView,l=e.exclude;t=t||"*";var r=Ge.get(t),s="";if(i&&"dropdown"===i){var o=r.elements.map((function(e){if(!Ke.getSettings(e))return null;var t=Ke.get({tag:e});return t?{label:t.get("name"),value:e}:null})).filter(Boolean);s=v.createElement("div",{className:"vcv-ui-form-group vcv-ui-replace-element-block-dropdown"},v.createElement(ye.default,{fieldKey:"replaceElement",updater:this.onClickReplacementDropdown.bind(this),value:this.state.value.tag,options:{values:o}}))}else if(this.state.isInnerElementReplaceOpened){var c=qe.action("getPresetsByCategory",t),u=this.getPresetReplacements(c),d=this.getReplacements(r),p=a.localizations?a.localizations.replaceElementEditForm:"Replace the element with a different element from the same category.",m=a.localizations?a.localizations.substituteElement:"Substitute Element",f=a.localizations?a.localizations.getMoreElements:"Get More Elements",h=a.localizations?a.localizations.goToHubButtonDescription:"Access the Visual Composer Hub - download additional elements, blocks, templates, and addons.",g=null;Je.can("hub_elements_templates_blocks",Je.defaultTrue())&&(g=v.createElement("div",{className:"vcv-ui-editor-get-more"},v.createElement("button",{className:"vcv-ui-form-button vcv-ui-form-button--large",onClick:this.handleGoToHub},f),v.createElement("span",{className:"vcv-ui-editor-get-more-description"},h))),s=v.createElement("div",{className:"vcv-ui-replace-element-block vcv-ui-replace-element-block--inner"},v.createElement("div",{className:"vcv-ui-replace-element-container"},v.createElement("h2",{className:"vcv-ui-replace-element-heading"},m),v.createElement("p",{className:"vcv-ui-replace-element-description"},p),v.createElement("ul",{className:"vcv-ui-replace-element-list"},u,d)),g)}var y=n().getStorage("workspace").state("settings").get(),b=!!y.id&&y.id,C=this.props.elementAccessPoint.id,k=v.createElement(ze,(0,S.default)({},this.props,{onChange:this.handleAttributeChange,elementAccessPoint:this.state.elementAccessPoint,onDynamicFieldOpen:this.props.onDynamicFieldOpen,onDynamicFieldChange:this.props.onDynamicFieldChange,onDynamicFieldClose:this.props.onDynamicFieldClose,allTabs:this.state.allTabs,exclude:l}));if(b!==C){var x=this.props.options,w=this.state.isActive;void 0===w&&(w=!0);var E=D()({"vcv-ui-edit-form-section":!0,"vcv-ui-edit-form-section--opened":w,"vcv-ui-edit-form-section--closed":!w}),L=!1,T=null,R=null;if("element"===this.props.fieldType&&!this.props.options.disableReplaceable&&"dropdown"!==this.props.options.replaceView){var P=this.props.options.category||"*";L=this.getReplaceShownStatus(P)}if(L){var O=a.localizations?a.localizations.backToParent:"Back to parent";this.state.isInnerElementReplaceOpened&&(T=v.createElement("span",{className:"vcv-ui-edit-form-section-header-go-back",onClick:this.handleToggleShowReplace,title:O},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-chevron-left"}))),R=v.createElement("span",{className:"vcv-ui-edit-form-section-header-control vcv-ui-icon vcv-ui-icon-swap",onClick:this.handleToggleShowReplace})}return v.createElement("div",{className:E},v.createElement("div",{className:"vcv-ui-edit-form-section-header",onClick:this.handleSectionToggle},T,v.createElement("span",{className:"vcv-ui-edit-form-section-header-title"},x.tabLabel),R),v.createElement("div",{className:"vcv-ui-form-element vcv-ui-edit-form-section-content"},!s||i&&"dropdown"===i?v.createElement(v.Fragment,null,s,k):s))}return v.createElement("div",{className:"vcv-ui-form-element"},!s||i&&"dropdown"===i?v.createElement(v.Fragment,null,s,k):s)}}],[{key:"updateTabs",value:function(e){var t=[];return a.editFormTabs(e).map((function(i,n){var l={id:i.key,index:n,data:i.data,params:a.editFormTabParams(e,i.key),key:"element-params-tab-".concat(e.get("id"),"-").concat(i.key)};t.push(l)}),a),t}},{key:"editFormTabs",value:function(e){var t=e.get("metaEditFormTabs");return t&&t.each?t.each(a.editFormTabsIterator.bind(this,e)).flat():[]}},{key:"editFormTabsIterator",value:function(e,t){return"advancedTab"!==t?Array.isArray(e.get(t).value)&&e.get(t).value.length?e.get(t).value.map((function(t){return{key:t,value:e.get(t),data:e.settings(t)}})):[{key:t,value:e.get(t),data:e.settings(t)}]:[]}},{key:"editFormTabParams",value:function(e,t){var i=e.get(t),n=e.settings(t);return"group"===n.settings.type&&i&&i.each?i.each(a.editFormTabsIterator.bind(this,e)).flat():[{key:t,value:i,data:n}]}}]),a}(p.default);(0,d.default)(Qe,"defaultProps",{fieldType:"element"}),(0,d.default)(Qe,"localizations",Ye.get("localizations")),(0,d.default)(Qe,"propTypes",{updater:P().func.isRequired,fieldKey:P().string.isRequired,value:P().object.isRequired,elementAccessPoint:P().object.isRequired,options:P().any,id:P().string});var Xe=a("./public/sources/attributes/googleFonts/lib/google-fonts-set.json"),et=a("./node_modules/webfontloader/webfontloader.js"),tt=a.n(et);function at(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function it(e){for(var t=1;t-1}},{key:"each",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return"function"==typeof e?this.value.slice().map(e):this.value.slice()}},{key:"update",value:function(e){return Array.isArray(e)?(this.value=e,this.value):null}}]),e}(),ot=a("./node_modules/react-dom/index.js");function ct(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var ut=function(e){(0,o.default)(a,e);var t=ct(a);function a(e){var i;return(0,l.default)(this,a),(i=t.call(this,e)).el=document.createElement("div"),i.el.className="vcv-gutenberg-modal",i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){document.querySelector(".vcv-layout-container").appendChild(this.el)}},{key:"componentWillUnmount",value:function(){document.querySelector(".vcv-layout-container").removeChild(this.el)}},{key:"render",value:function(){return ot.createPortal(this.props.children,this.el)}}]),a}(v.Component);function dt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var vt=(0,i.getService)("dataManager"),pt=function(e){(0,o.default)(a,e);var t=dt(a);function a(e){var i;return(0,l.default)(this,a),(i=t.call(this,e)).handleEditorOpen=i.handleEditorOpen.bind((0,s.default)(i)),i.handleIframeLoad=i.handleIframeLoad.bind((0,s.default)(i)),i.updateValueFromIframe=i.updateValueFromIframe.bind((0,s.default)(i)),i.closeEditor=i.closeEditor.bind((0,s.default)(i)),i.updateEditor=i.updateEditor.bind((0,s.default)(i)),i.state={showEditor:!1,loadingEditor:!1,value:e.value},i}return(0,r.default)(a,[{key:"handleEditorOpen",value:function(e){e.preventDefault(),this.setState({showEditor:!0,loadingEditor:!0})}},{key:"closeEditor",value:function(){this.setState({showEditor:!1,loadingEditor:!1})}},{key:"updateEditor",value:function(){this.updateValueFromIframe(),this.closeEditor()}},{key:"handleIframeLoad",value:function(){var e=this,t=this.state.value,a=this.iframe.contentWindow,i=!!a.wp&&a.wp.data;if(!i){var n=vt.get("localizations"),l=n?n.gutenbergDoesntWorkProperly:"Gutenberg plugin doesn't work properly. Check the Gutenberg plugin.";a.alert(l),this.closeEditor()}var r=this.iframe.contentWindow.document.getElementById("post_ID"),s={id:r?r.value:"",guid:{raw:"/?",rendered:"/?"},title:{raw:""},content:{raw:t,rendered:t},type:"vcv_gutenberg_attr",slug:"",status:"publish",link:"/?",format:"standard",categories:[],_links:[]},o=i.dispatch("core/editor"),c=i.dispatch("core/edit-post");o.setupEditor(s,{content:t}),o.disablePublishSidebar(),o.lockPostSaving(),c.closeGeneralSidebar(),o.autosave&&"function"==typeof o.autosave&&(o.autosave=function(){});var u=c.openGeneralSidebar;c.openGeneralSidebar=function(e){"edit-post/document"!==e&&u(e)};var d=a.document.querySelector(".editor-post-title"),v=a.document.querySelector(".components-notice-list");d&&d.classList.add("hidden"),v&&v.classList.add("hidden"),a.setTimeout((function(){e.renderGutenbergControls(a)}),300),this.setState({loadingEditor:!1})}},{key:"getControlsHTML",value:function(){var e=vt.get("localizations"),t=e.gutenbergEditorUpdateButton?e.gutenbergEditorUpdateButton:"Update";return'\n
\n '.concat('','\n \n \n
\n ')}},{key:"renderGutenbergControls",value:function(e){var t=this,a=e.document.querySelector(".edit-post-header-toolbar");if(a){var i=this.getControlsHTML();a.insertAdjacentHTML("afterend",i);var n=e.document.querySelector(".vcv-gutenberg-modal-update-button"),l=e.document.querySelector(".vcv-gutenberg-modal-close-button");n.addEventListener("click",this.updateEditor),l.addEventListener("click",this.closeEditor)}else window.setTimeout((function(){t.renderGutenbergControls(e)}),300)}},{key:"updateValueFromIframe",value:function(){if(this.iframe&&this.iframe.contentWindow&&this.iframe.contentWindow.wp){var e=this.iframe.contentWindow.wp.data;if(e){var t=e.select("core/editor").getEditedPostContent();this.setFieldValue(t)}}}},{key:"render",value:function(){var e=this,t=this.state,a=t.showEditor,i=t.loadingEditor,n=null;i&&(n=v.createElement("div",{className:"vcv-loading-overlay"},v.createElement("div",{className:"vcv-loading-dots-container"},v.createElement("div",{className:"vcv-loading-dot vcv-loading-dot-1"}),v.createElement("div",{className:"vcv-loading-dot vcv-loading-dot-2"}))));return v.createElement(v.Fragment,null,v.createElement("button",{className:"vcv-ui-form-button vcv-ui-form-button--action",onClick:this.handleEditorOpen},"Open Gutenberg"),function(){if(a){var t=vt.get("gutenbergEditorUrl");return v.createElement(ut,null,n,v.createElement("div",{className:"vcv-gutenberg-modal-inner"},v.createElement("iframe",{id:"vcv-gutenberg-attribute-modal-iframe",ref:function(t){e.iframe=t},src:t,onLoad:e.handleIframeLoad})))}}())}}]),a}(p.default);(0,d.default)(pt,"defaultProps",{fieldType:"gutenbergEditor"});var mt=a("./public/components/layoutHelpers/tinymce/fontFamily/tinymceFontsSelect.jquery.js"),ft=a("./public/components/layoutHelpers/tinymce/tinymceVcvHtmleditorPlugin.js"),ht=a("./public/components/layoutHelpers/tinymce/fontFamily/getUsedFonts.js");function gt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var yt=n().getService("dataManager"),bt=function(e){(0,o.default)(a,e);var t=gt(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,r.default)(a,[{key:"render",value:function(){var e=this.props,t=e.fieldKey,a=e.options,i=e.elementAccessPoint,n=this.state.value?"checked":"",l=yt.get("localizations"),r=l?l.useTheToggleToSwitchBetweenLightAndDarkBackground:"Use the toggle to switch between light and dark background while editing the text.",s=null,o="".concat(t,"_input");return i&&i.id&&(o+="_".concat(i.id)),a&&a.labelText&&(s=v.createElement("label",{htmlFor:o,className:"vcv-ui-form-switch-small-trigger-label"},this.props.options.labelText)),v.createElement("div",{className:"vcv-ui-form-switch-small-container"},v.createElement(xe(),null,r),v.createElement("label",{className:"vcv-ui-form-switch-small"},v.createElement("input",{type:"checkbox",onChange:this.handleChange,id:o,checked:n}),v.createElement("span",{className:"vcv-ui-form-switch-small-indicator"})),s)}}]),a}(Z.default);(0,d.default)(bt,"defaultProps",{fieldType:"toggleSmall"});var Ct=bt,kt=a("./public/sources/attributes/htmleditor/wpautop.min.js"),xt=a.n(kt);function wt(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function St(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Et=(0,i.getService)("utils"),Lt=Et.getBlockRegexp,Tt=Et.parseDynamicBlock,Dt=Lt(),Rt=function(e){(0,o.default)(a,e);var t=St(a);function a(e){var i;return(0,l.default)(this,a),(i=t.call(this,e)).handleChange=i.handleChange.bind((0,s.default)(i)),i.handleChangeQtagsEditor=i.handleChangeQtagsEditor.bind((0,s.default)(i)),i.handleChangeWpEditor=w().debounce(i.handleChangeWpEditor.bind((0,s.default)(i)),400,{maxWait:400}),i.skinChange=i.skinChange.bind((0,s.default)(i)),i.handleFontChange=i.handleFontChange.bind((0,s.default)(i)),i.initWpEditorJs=i.initWpEditorJs.bind((0,s.default)(i)),i.id="tinymce-htmleditor-component-".concat(e.fieldKey),i.state={},i.state.darkTextSkin=i.getDarkTextSkinState(),i.state.value=e.value,(0,mt.default)(window),window.tinymce&&(0,ft.default)(window.tinymce,window),i}return(0,r.default)(a,[{key:"shouldComponentUpdate",value:function(e,t){if(this.props.dynamicFieldOpened!==e.dynamicFieldOpened)return void 0!==window.tinymce&&(this.props.editorLoaded&&this.destroyEditor(),window.setTimeout(this.initWpEditorJs,1)),!0;if(e.editorLoaded&&void 0!==window.tinymce){var a=this.props.fieldKey,i="vcv-wpeditor-".concat(a),n=window.tinymce.get(i);if(n){if(n.getBody().style.backgroundColor=t.darkTextSkin?"#2f2f2f":"",t.value.match(Dt)){var l=Tt(t.value),r=t.value.match(Dt);if(l){var s=l.beforeBlock||"",o=l.afterBlock||"",c=s+window.encodeURIComponent(r[0])+window.encodeURIComponent(r[1])+o;n.setContent(c)}}if(this.props.value!==e.value&&!this.editorValue){if(e.value.match(Dt)){var u=Tt(e.value),d=e.value.match(Dt);if(u){var v=u.beforeBlock||"",p=u.afterBlock||"",m=v+window.encodeURIComponent(d[0])+window.encodeURIComponent(d[1])+p;n.setContent(m)}}else n.setContent(e.value);this.loadUsedFonts(e),n.nodeChanged()}this.editorValue&&(this.editorValue=null)}return this.props.editorLoaded!==e.editorLoaded}return!e.editorLoaded||this.props.value!==e.value}},{key:"loadUsedFonts",value:function(e){if(this.editor){var t=e.elementAccessPoint.cook().get("metaElementAssets"),a={};this.editor.getWin()&&(a.context=this.editor.getWin());var i=e.options.nestedAttrPath?e.options.nestedAttrPath:e.fieldKey;if(t&&t.googleFonts&&t.googleFonts[i]){var n=Object.keys(t.googleFonts[i]);n&&n.length>0&&tt().load(function(e){for(var t=1;t0){var o=r.googleFonts||{};o[s]=l,r.googleFonts=o}else r&&Object.prototype.hasOwnProperty.call(r,"googleFonts")&&delete r.googleFonts;i.set("metaElementAssets",r)}},{key:"handleChange",value:function(e){this.props.setFieldValue(e.currentTarget.value)}},{key:"handleChangeWpEditor",value:function(e){var t=e.getContent(),a=e.getBody();if(a){if(this.handleFontChange(a),this.props.dynamicFieldOpened){t=decodeURIComponent(t);var i=Tt(t);i&&this.setState({blockInfo:i})}var n=this.props,l=n.updater,r=n.fieldKey,s=n.fieldType,o=n.setValueState;this.editorValue=!0,o(t),window.setTimeout((function(){l(r,t,null,s)}),0)}}},{key:"handleChangeQtagsEditor",value:function(e){var t=xt()(e.target.value);this.props.setFieldValue(t)}},{key:"skinChange",value:function(e,t){this.setState({darkTextSkin:t}),this.props.updater(e,t)}},{key:"renderFallbackEditor",value:function(){var e=this.props.value;return v.createElement("div",{className:"vcv-ui-form-input vcv-ui-form-tinymce"},v.createElement("textarea",{id:this.id,onChange:this.handleChange,onKeyUp:this.handleChange,value:e,style:{width:"100%",minHeight:"300px"}}))}},{key:"initWpEditorJs",value:function(e){var t=this,a=this.props.fieldKey,i="vcv-wpeditor-".concat(a);document.querySelector("#"+i)&&window.tinyMCEPreInit&&(this.props.dynamicFieldOpened?(window.tinyMCEPreInit.mceInit[i]=Object.assign({},window.tinyMCEPreInit.mceInit.__VCVIDDYNAMIC__,{id:i,menubar:!1,statusbar:!1,plugins:"textcolor",toolbar1:"formatselect,bold,italic,alignleft,aligncenter,alignright",toolbar2:"fontselect,fontsizeselect,removeformat,forecolor",powerpaste_word_import:"clean",powerpaste_html_import:"clean",formats:{fontweight:{inline:"span",toggle:!1,styles:{fontWeight:"%value"},clear_child_styles:!0},fontstyle:{inline:"span",toggle:!1,styles:{fontStyle:"%value"},clear_child_styles:!0},defaultfont:{inline:"span",toggle:!1,styles:{fontFamily:""},clear_child_styles:!0}},selector:"#"+i,setup:function(e){t.editor=e,e.on("keyup change undo redo",t.handleChangeWpEditor.bind(t,e))},init_instance_callback:function(a){if(!e){var i=document.querySelector(".vcv-ui-form-wp-tinymce");!i||(n=i.getBoundingClientRect()).top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)||i.scrollIntoView()}var n;t.loadUsedFonts(t.props),a.iframeElement.style.visibility="hidden",a.iframeElement.style.height="0",a.on("BeforeExecCommand",(function(){a.selection.select(a.getBody(),!0)})),a.on("nodeChange",(function(){a.selection.select(a.getBody(),!0)})),a.selection.select(a.getBody(),!0),t.props.setEditorLoaded(!0)}}),window.tinyMCEPreInit.qtInit[i]=Object.assign({},window.tinyMCEPreInit.qtInit.__VCVIDDYNAMIC__,{id:i}),window.setTimeout((function(){document.querySelector("#"+i)&&window.switchEditors&&window.switchEditors.go(i,"tmce")}),10)):(window.tinyMCEPreInit.mceInit[i]=Object.assign({},window.tinyMCEPreInit.mceInit.__VCVID__,{id:i,selector:"#"+i,setup:function(e){t.editor=e,e.on("keyup change undo redo",t.handleChangeWpEditor.bind(t,e))},init_instance_callback:function(){t.loadUsedFonts(t.props),t.props.setEditorLoaded(!0);var e=document.getElementById("vcv-wpeditor-output_ifr");e&&e.contentWindow.addEventListener("mouseup",(function(e){"object"===(0,Be.default)(e)&&e.button&&e.button>2&&e.preventDefault()}))}}),window.tinyMCEPreInit.qtInit[i]=Object.assign({},window.tinyMCEPreInit.qtInit.__VCVID__,{id:i}),window.setTimeout((function(){document.querySelector("#"+i)&&(window.quicktags&&window.quicktags(window.tinyMCEPreInit.qtInit[i]),window.switchEditors&&window.switchEditors.go(i,"tmce"),window.QTags&&(delete window.QTags.instances[0],window.QTags.instances[i]&&window.QTags.instances[i].canvas.addEventListener("keyup",t.handleChangeQtagsEditor)))}),10)))}},{key:"componentDidMount",value:function(){var e=this;void 0!==window.tinymce&&window.setTimeout((function(){e.initWpEditorJs(!0)}),1)}},{key:"componentWillUnmount",value:function(){void 0!==window.tinymce&&this.destroyEditor()}},{key:"destroyEditor",value:function(){if(void 0!==window.tinymce){var e=this.props.fieldKey,t="vcv-wpeditor-".concat(e);window.tinyMCE&&window.tinyMCE.get(t)&&window.tinyMCE.get(t).remove(),window.tinyMCE&&window.tinyMCE.editors&&window.tinyMCE.editors[t]&&window.tinyMCE.editors[t].destroy(),window.QTags&&window.QTags.instances[t]&&(window.QTags.instances[t].canvas.removeEventListener("keyup",this.handleChangeQtagsEditor),delete window.QTags.instances[t]),this.editor=!1,this.props.setEditorLoaded(!1)}}},{key:"encodeHTML",value:function(e){return e.replace(/
/g,"\n").replace(/[\u00A0-\u9999<>&$](?!#)/gim,(function(e){return"&#"+e.charCodeAt(0)+";"}))}},{key:"getSkinToggle",value:function(){var e=this.props&&this.props.options&&this.props.options.skinToggle;return e?v.createElement(Ct,{api:this.props.api,fieldKey:e,updater:this.skinChange,value:this.state.darkTextSkin}):null}},{key:"getDarkTextSkinState",value:function(){var e=this.props,t=e.elementAccessPoint,a=e.options,i=e.editFormOptions,n=a&&a.skinToggle;if(i&&i.nestedAttr&&i.activeParamGroup)return!(!n||!i.activeParamGroup[n]);var l=t.cook().toJS();return!!(n&&l&&l[n])}},{key:"getFieldComponent",value:function(e){return v.createElement(v.Fragment,null,v.createElement("div",{className:"vcv-ui-form-wp-tinymce-inner",dangerouslySetInnerHTML:{__html:e}}),this.getSkinToggle())}},{key:"render",value:function(){if(void 0!==window.tinymce){var e=this.props.fieldKey,t="vcv-wpeditor-".concat(e);if(this.props.dynamicFieldOpened){var a=this.state.value;if(this.state.value.match(Dt)){var i=Tt(this.state.value),n=this.state.value.match(Dt);if(i){var l=i.beforeBlock||"",r=i.afterBlock||"";a=l+window.encodeURIComponent(n[0])+window.encodeURIComponent(n[1])+r}}var s=document.getElementById("vcv-wpeditor-dynamic-template").innerHTML.replace(/__VCVIDDYNAMIC__/g,t).replace(/%%content%%/g,a);return v.createElement(v.Fragment,null,this.getFieldComponent(s))}var o=document.getElementById("vcv-wpeditor-template").innerHTML.replace(/__VCVID__/g,t).replace(/%%content%%/g,this.encodeHTML(this.state.value));return v.createElement(v.Fragment,null,this.getFieldComponent(o))}return this.renderFallbackEditor()}}],[{key:"getDerivedStateFromProps",value:function(e,t){return t.value!==e.value?{value:e.value}:null}}]),a}(v.Component),Pt=a("./node_modules/react-dom/client.js"),Ot=a("./public/sources/attributes/dynamicField/dynamicAttribute.js"),jt=a("./node_modules/react-redux/es/index.js"),At=a("./public/sources/attributes/attachimage/stockMediaTab.js"),Mt=a("./public/sources/attributes/attachimage/giphyMediaTab.js"),Nt=a("./public/editor/stores/store.js"),_t=a("./public/editor/stores/notifications/slice.js");function Bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var It=(0,i.getService)("utils"),Ft=It.getBlockRegexp,Vt=It.parseDynamicBlock,Ht=(0,i.getService)("roleManager"),Ut=(0,i.getStorage)("settings"),zt=Ft(),$t=["wysiwyg","textarea"],Kt=(0,i.getService)("dataManager"),Wt=function(e){(0,o.default)(a,e);var t=Bt(a);function a(e){var i;(0,l.default)(this,a),(i=t.call(this,e)).giphyRoot=null,i.stockImageRoot=null,i.handleDynamicFieldOpen=i.handleDynamicFieldOpen.bind((0,s.default)(i)),i.handleDynamicFieldClose=i.handleDynamicFieldClose.bind((0,s.default)(i)),i.handleDynamicFieldChange=i.handleDynamicFieldChange.bind((0,s.default)(i)),i.setValueState=i.setValueState.bind((0,s.default)(i)),i.setEditorLoaded=i.setEditorLoaded.bind((0,s.default)(i)),i.handleBodyClick=i.handleBodyClick.bind((0,s.default)(i)),i.onToggleChange=i.onToggleChange.bind((0,s.default)(i));var n=e.options&&e.options.dynamicField&&"string"==typeof i.state.value&&i.state.value.match(zt);if(i.state.dynamicFieldOpened=n,i.state.isDynamicSet=n,e.options&&e.options.extraToggle){var r=Vt(i.state.value);r&&r.blockAtts&&(i.state.dynamicExtraToggleValue=e.options.extraToggle.trueValue===r.blockAtts.value)}return n&&(i.state.exceptionField=i.getExceptionField(i.state.value,i.props.fieldType)),i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){if(void 0===window.wp)return!1;document.body.addEventListener("click",this.handleBodyClick);var e=window.wp.media.view.MediaFrame.Post;window.wp.media.view.MediaFrame.Post=e.extend({bindHandlers:function(){e.prototype.bindHandlers.apply(this,arguments),this.off("content:render:unsplash",this.stockImagesContent,this),this.on("content:render:unsplash",this.stockImagesContent,this),this.off("content:render:giphy",this.giphyContent,this),this.on("content:render:giphy",this.giphyContent,this)},stockImagesContent:function(){this.content.set(new a({controller:this}))},giphyContent:function(){this.content.set(new i({controller:this}))},browseRouter:function(t){e.prototype.browseRouter.apply(this,arguments),Ht.can("hub_unsplash",Ht.defaultTrue())&&t.set("unsplash",{text:"Stock Images",priority:60}),Ht.can("hub_giphy",Ht.defaultTrue())&&t.set("giphy",{text:"Giphy",priority:70})}});var t=this,a=window.wp.media.View.extend({remove:function(){return t.stockImageRoot&&t.stockImageRoot.unmount(),t.stockImageRoot=null,this},render:function(){return t.stockImageRoot||(t.stockImageRoot=(0,Pt.createRoot)(this.$el.get(0))),t.stockImageRoot.render(v.createElement(jt.Provider,{store:Nt.default},v.createElement(At.default,null))),this}}),i=window.wp.media.View.extend({remove:function(){return t.giphyRoot&&t.giphyRoot.unmount(),t.giphyRoot=null,this},render:function(){return t.giphyRoot||(t.giphyRoot=(0,Pt.createRoot)(this.$el.get(0))),t.giphyRoot.render(v.createElement(jt.Provider,{store:Nt.default},v.createElement(Mt.default,null))),this}});window.wp.media.controller.Library.prototype.defaults.contentUserSetting=!1}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.handleBodyClick)}},{key:"handleBodyClick",value:function(e){e.target.classList.contains("insert-media")?Nt.default.dispatch((0,_t.portalChanged)(".media-frame")):(e.target.classList.contains("media-modal-icon")||e.target.classList.contains("media-button-insert"))&&Nt.default.dispatch((0,_t.portalChanged)(null))}},{key:"handleDynamicFieldClose",value:function(){var e=this;window.setTimeout((function(){e.setState({dynamicFieldOpened:!1,isDynamicSet:!1,exceptionField:!1})}),1)}},{key:"handleDynamicFieldOpen",value:function(e){this.setState({dynamicFieldOpened:!0}),e&&e.state&&e.state.blockInfo&&e.state.blockInfo.value&&this.setState({isDynamicSet:!0})}},{key:"handleDynamicFieldChange",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.props.onDynamicFieldChange(e,t,a),n=this.getExceptionField(i,this.props.fieldType),l=this.state.value,r=Vt(l);if(r){var s=r.beforeBlock||"

",o=r.afterBlock||"

";i=s+i+o}else i="

".concat(i,"

");return this.setState({isDynamicSet:!0,exceptionField:n}),i}},{key:"setValueState",value:function(e){this.setState({value:e})}},{key:"setEditorLoaded",value:function(e){this.setState({editorLoaded:e})}},{key:"getExceptionField",value:function(e,t){var a=!1,i=e&&e.split(zt);if(i.length>1){var n=JSON.parse(i[4].trim()).value,l=n.includes(":")&&n.split(":"),r=Ut.state("postFields").get();if(l&&r&&r[t]){var s=l[0],o=r[t][s];if(o&&o.group&&o.group.values){var c=o.group.values.find((function(e){return e.value===n}));a=c&&c.fieldType&&$t.includes(c.fieldType)}}}return a}},{key:"onToggleChange",value:function(e,t){var a=this.props.options.extraToggle;this.setState({dynamicExtraToggleValue:t});var i=t?a.trueValue:a.falseValue,n=this.props.onDynamicFieldChange(i,Kt.get("sourceID")),l=Vt(this.state.value);l?n=(l.beforeBlock||"

")+n+(l.afterBlock||"

"):n="

".concat(n,"

");this.setFieldValue(n)}},{key:"getExtraToggle",value:function(){var e=this.props.options;if(e&&e.extraToggle){var t=null;return e.extraToggle.description&&(t=v.createElement(xe(),null,e.extraToggle.description)),v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("div",{className:"vcv-ui-form-group-heading-wrapper"},v.createElement("span",{className:"vcv-ui-form-group-heading"},e.extraToggle.title),t),v.createElement(Z.default,{fieldKey:"html_editor_dynamic_extra_toggle",updater:this.onToggleChange,value:this.state.dynamicExtraToggleValue}))}return null}},{key:"render",value:function(){var e=this.props.options&&this.props.options.dynamicField,t=this.props.options&&this.props.options.onlyDynamic,a=this.props.options&&this.props.options.onlyDynamicCustomFields,i=D()({"vcv-ui-form-wp-tinymce":!0,"vcv-is-invisible":!0!==this.state.editorLoaded,"vcv-ui-form-field-dynamic-is-opened":this.state.dynamicFieldOpened,"vcv-ui-form-field-dynamic-is-active":this.state.isDynamicSet,"vcv-ui-form-field-has-dynamic":e,"vcv-ui-form-field-has-exception-field":this.state.exceptionField,"vcv-ui-form-field-only-dynamic":t}),n=null;return t&&!a||(n=v.createElement(Ot.default,(0,S.default)({},this.props,{onOpen:this.handleDynamicFieldOpen,onClose:this.handleDynamicFieldClose,onDynamicFieldChange:this.handleDynamicFieldChange,setFieldValue:this.setFieldValue,value:this.state.value,onlyDynamicCustomFields:a}))),v.createElement("div",{className:i},v.createElement(Rt,(0,S.default)({},this.props,{value:this.state.value,setFieldValue:this.setFieldValue,setValueState:this.setValueState,setEditorLoaded:this.setEditorLoaded,dynamicFieldOpened:this.state.dynamicFieldOpened,editorLoaded:this.state.editorLoaded})),n,this.getExtraToggle(),v.createElement("div",{className:"vcv-ui-form-wp-tinymce-clearfix"}))}}]),a}(p.default);function Gt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}(0,d.default)(Wt,"defaultProps",{fieldType:"htmleditor"});var qt=(0,i.getStorage)("attributes"),Zt=(0,i.getService)("dataManager"),Yt=function(e){(0,o.default)(a,e);var t=Gt(a);function a(e){var i;(0,l.default)(this,a),i=t.call(this,e),(0,d.default)((0,s.default)(i),"handlePopupToggle",(function(e){e&&e.preventDefault&&e.preventDefault(),i.state.popupOpen?document.body.removeEventListener("click",i.closeIfNotInside):document.body.addEventListener("click",i.closeIfNotInside),i.setState({popupOpen:!i.state.popupOpen,search:"",category:""})})),(0,d.default)((0,s.default)(i),"handleSearchChange",(function(e){i.setState({search:e.currentTarget.value,category:""})})),(0,d.default)((0,s.default)(i),"handleCategoryChange",(function(e){i.setState({category:e.currentTarget.value,search:""})})),(0,d.default)((0,s.default)(i),"handleIconSetChange",(function(e){var t=Object.assign({},i.state.value);t.iconSet=e.currentTarget.value,i.setState({value:t,category:"",search:""})})),(0,d.default)((0,s.default)(i),"closeIfNotInside",(function(e){e&&e.preventDefault();var t=e.target,a=".vcv-ui-form-iconpicker-content",n=".vcv-ui-iconpicker-picker-dropdown";(void 0===t.closest?i.getClosest(t,a)||i.getClosest(t,n):t.closest(a)||t.closest(n))||i.handlePopupToggle()}));var n=qt.state("iconpicker:iconSet").get(),r=n[e.options.iconType]||n.icons,o=e.value.iconSet;r[o]||(o=Object.keys(r)[0]);return i.state={search:"",category:"",popupOpen:!1,value:{icon:e.value.icon,iconSet:o},showSearch:!("search"in e.options)||e.options.search,iconSetList:r},i}return(0,r.default)(a,[{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.closeIfNotInside)}},{key:"filteredIcons",value:function(){var e=this.state,t=e.category,a=e.search,i=e.value,n=e.iconSetList,l=i.iconSet,r=[],s=[];if(!Object.prototype.hasOwnProperty.call(n[l],"iconData"))return r;if(!n[l]){var o=Object.keys(n);l=o[0]}var c=function(e,t){e.forEach((function(e){s.indexOf(e.id)>-1||(t&&(e.disabled=!0),s.push(e.id),r.push(e))}))};return t?c(n[l].iconData[t],n[l].iconData[t].disabled):Array.isArray(n[l].iconData)?c(n[l].iconData,n[l].disabled):Object.keys(n[l].iconData).forEach((function(e){c(n[l].iconData[e],n[l].disabled)})),a&&(r=r.filter((function(e){return e.title.toLowerCase().indexOf(a.toLowerCase())>-1}))),r}},{key:"iconsContent",value:function(){var e=this,t=this.state.value.icon,a=[];return this.filteredIcons().forEach((function(i){var n=D()({"vcv-ui-form-iconpicker-option":!0,"vcv-ui-form-state--active":i.id===t,"vcv-ui-form-iconpicker--disabled":i.disabled});a.push(v.createElement("span",{key:i.id,className:n,value:i.id,onClick:e.handleChange,title:i.title},v.createElement("i",{className:i.id})))})),a}},{key:"categoriesContent",value:function(){var e=[],t=this.state.iconSetList,a=this.state.value.iconSet;t[a]||(a=Object.keys(t)[0]);return a&&void 0!==t[a]&&void 0!==t[a].iconData&&!Array.isArray(t[a].iconData)&&Object.keys(t[a].iconData).forEach((function(t){e.push(v.createElement("option",{key:"innerCategory"+t,value:t},t))})),e}},{key:"popupContent",value:function(){var e=this.state,t=e.search,i=e.category,n=e.value,l=e.showSearch,r=e.iconSetList,s=n.iconSet,o=this.categoriesContent(),c=this.iconsContent();c.length||c.push(v.createElement("div",{className:"vcv-ui-form-iconpicker-error",key:"no-icon-found"},"No icons found"));var u=D()({"vcv-ui-form-iconpicker-content":!0,"vcv-ui-form-state--active":this.state.popupOpen}),d="",p=Object.keys(r).length;o.length&&p>1&&(d=v.createElement("select",{onChange:this.handleCategoryChange,value:i,className:"vcv-ui-form-dropdown"},v.createElement("option",{key:"all",value:""},"From all categories"),o));var m=a.localizations?a.localizations.downloadPremiumIconLibraries:"Download Premium Icon Libraries",f=a.localizations?a.localizations.availableInPremiumText:"Available in Premium",h="";if(p>1){var g=[],y=Object.keys(r).filter((function(e){return r[e].default})),b=Object.keys(r).filter((function(e){return!r[e].default})).sort();(b=y.concat(b)).forEach((function(e){var t=e.charAt(0).toUpperCase()+e.slice(1),a=!1;r[e].premium&&(Zt.get("isPremiumActivated")?t+=" (".concat(m,")"):t+=" (".concat(f,")"),a=!0);var i=t;g.push(v.createElement("option",{disabled:a,key:"inner"+e,value:e},i))})),h=v.createElement("select",{onChange:this.handleIconSetChange,value:s,className:"vcv-ui-form-dropdown"},g)}var C=null;return l&&(C=v.createElement("div",{className:"vcv-ui-input-search"},v.createElement("input",{type:"search",value:t,onChange:this.handleSearchChange,placeholder:"Search Icon",className:"vcv-ui-form-input"}),v.createElement("label",{className:"vcv-ui-form-input-search-addon"},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-search"})))),v.createElement("div",{className:u},v.createElement("div",{className:"vcv-ui-form-iconpicker-content-heading"},h,C,d),v.createElement("div",{className:"vcv-ui-form-iconpicker-options"},c))}},{key:"handleChange",value:function(e){var t=Object.assign({},this.state.value);t.icon=e.currentTarget.attributes.value.textContent,this.setFieldValue(t)}},{key:"getClosest",value:function(e,t){var a,i;for(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].some((function(e){return"function"==typeof document.body[e]&&(a=e,!0)}));e;){if((i=e.parentElement)&&i[a](t))return i;e=i}return null}},{key:"render",value:function(){var e=this.state.popupOpen,t=this.state.value.icon,a=D()({"vcv-ui-param-iconpicker-icon-empty":!t},t),i=D()({"vcv-ui-form-dropdown":!0,"vcv-ui-form-dropdown-style--inline":!0,"vcv-ui-iconpicker-picker-dropdown":!0,"vcv-ui-form-state--focus":e}),n="";e&&(n=this.popupContent());var l=D()({"vcv-ui-form-iconpicker":!0});return v.createElement("div",{className:l},v.createElement("div",{className:"vcv-ui-form-iconpicker"},v.createElement("div",{className:i,onClick:this.handlePopupToggle},v.createElement("i",{className:a})),n))}}]),a}(p.default);(0,d.default)(Yt,"defaultProps",{fieldType:"iconpicker"}),(0,d.default)(Yt,"localizations",Zt.get("localizations")),Yt.DEFAULT_ICON_SET="fontawesome";var Jt=Yt;function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Xt=function(e){(0,o.default)(a,e);var t=Qt(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,r.default)(a,[{key:"render",value:function(){var e=this.state.value,t=this.props,a=t.placeholder,i=t.options,n=i.min,l=i.max,r="vcv-ui-form-dropdown vcv-ui-form-icon "+i.iconClasses;return v.createElement("div",{className:"vcv-ui-form-input-icon"},v.createElement("div",{className:"vcv-ui-form-input-group"},v.createElement("div",{className:r}),v.createElement("input",{className:"vcv-ui-form-input",type:i.inputType,min:n,max:l,onChange:this.handleChange,placeholder:a,value:e})))}}]),a}(p.default);(0,d.default)(Xt,"defaultProps",{fieldType:"inputIcon"});var ea=Xt,ta={size:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"vh",label:"vh"},{value:"vw",label:"vw"},{value:"%",label:"%"}],currency:[{value:"$_",label:"U.S. Dollar"},{value:"CAD_",label:"Canadian Dollar"},{value:"€_",label:"Euro"},{value:"£_",label:"Pound Sterling"},{value:"AR$",label:"Argentine Peso"},{value:"AUD_",label:"Australian Dollar"},{value:"AZN_",label:"Azerbaijani New Manats"},{value:"BHD_",label:"Bahrain Dinar"},{value:"R$_",label:"Brazilian Real"},{value:"BGN_",label:"Bulgarian Lev"},{value:"XOF_",label:"CFA Franc BCEAO"},{value:"CL$_",label:"Chilean Peso"},{value:"CNY_",label:"Chinese Yuan"},{value:"COP_",label:"Columbian Peso"},{value:"_Kč",label:"Czech Koruna"},{value:"DKK_",label:"Danish Krone"},{value:"EGP_",label:"Egyptian Pound"},{value:"FJD_",label:"Fijian Dollar"},{value:"GEL_",label:"Georgian Lari"},{value:"HK$_",label:"Hong Kong Dollar"},{value:"HUF_",label:"Hungarian Forint"},{value:"Rs._",label:"Indian Rupee"},{value:"Rp_",label:"Indonesian Rupiah"},{value:"¥_",label:"Japanese Yen"},{value:"JOD_",label:"Jordanian Dinar"},{value:"KZT_",label:"Kazakhstani Tenge"},{value:"KRW_",label:"Korean Won"},{value:"KWD_",label:"Kuwaiti Dinar"},{value:"MYR_",label:"Malaysian Ringgit"},{value:"MXN_",label:"Mexican Peso"},{value:"MDL_",label:"Moldovan Leu"},{value:"NAD_",label:"Namibian Dollar"},{value:"₪_",label:"New Israeli Sheqel"},{value:"TWD_",label:"New Taiwan Dollar"},{value:"NZD_",label:"New Zealand Dollar"},{value:"NOK_",label:"Norwegian Krone"},{value:"OMR_",label:"Omani Rial"},{value:"PHP",label:"Philippine Peso"},{value:"_zł",label:"Polish Zloty"},{value:"QAR_",label:"Qatari Riyal"},{value:"_lei",label:"Romanian New Leu"},{value:"₽_",label:"Russian Ruble"},{value:"SAR_",label:"Saudi Arabian Riyal"},{value:"S$_",label:"Singaporean Dollar"},{value:"ZAR_",label:"South Africa Rand"},{value:"SEK_",label:"Swedish Krona"},{value:"CHF_",label:"Swiss Franc"},{value:"THB_",label:"Thai Baht"},{value:"TL_",label:"Turkish Lira"},{value:"AED_",label:"U.A.E. Dirham"},{value:"UAH_",label:"Ukraine Hryvnia"},{value:"BTC",label:"Bitcoin"},{value:"ETH",label:"Ethereum"}]};function aa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var ia=function(e){(0,o.default)(a,e);var t=aa(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),(0,d.default)((0,s.default)(i),"list",null),i.state=i.updateState(i.props),i.handleClick=i.handleClick.bind((0,s.default)(i)),i.handleSelectToggle=i.handleSelectToggle.bind((0,s.default)(i)),i.setFieldValue=i.setFieldValue.bind((0,s.default)(i)),i.handleInputChange=i.handleInputChange.bind((0,s.default)(i)),i.handleDropdownChange=i.handleDropdownChange.bind((0,s.default)(i)),i.dynamicAttributeChange=i.dynamicAttributeChange.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"updateState",value:function(e){return{input:e.value.input||e.value||e.defaultValue.input,select:e.value.select||e.defaultValue.select,openedSelect:!1}}},{key:"handleClick",value:function(e){e&&e.preventDefault(),this.list.contains(e.target)||this.handleSelectToggle()}},{key:"handleSelectToggle",value:function(e){this.state.openedSelect?document.body.removeEventListener("click",this.handleClick):document.body.addEventListener("click",this.handleClick),e&&e.target&&this.setState({openedSelect:!this.state.openedSelect})}},{key:"createGroup",value:function(e,t,a){var i=[],n=t.values,l=t.label,r=l.replace(/\s+/g,"");for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(this.createOptions(s,n,a));return v.createElement("optgroup",{key:a+":"+e+":"+r,label:l},i)}},{key:"createOptions",value:function(e,t,a,i){var n=t[e].value,l=t[e].label;if("large"===i){var r=n.replace("_",""),s="vcv-ui-form-input-select-item";return(this.state&&this.state.select||this.props.value.select)===n&&(s+=" vcv-ui-form-input-select-item-active"),v.createElement("div",{key:a+":"+e+":"+n,onClick:this.hangleLargeListClick.bind(this,n),className:s},v.createElement("span",null,r," ",l))}return v.createElement("option",{key:a+":"+e+":"+n,value:n},l)}},{key:"getSelectOptions",value:function(e){e||(e=this.props);var t=(e.options||{}).values,a=(e.options||{}).global;return!a||t&&t.length||(t="function"==typeof window[a]?window[a]():window[a]||[]),t}},{key:"getDefaultOptions",value:function(e){e||(e=this.props);var t=(e.options||"").type;return t&&ta[t]?ta[t]:[]}},{key:"generateSelectChildren",value:function(e){var t=[],a=this.getDefaultOptions(e),i=[].concat((0,E.default)(a),(0,E.default)(this.getSelectOptions(e))),n=e.fieldKey,l=e.options&&("currency"===e.options.type||e.options.large)?"large":"small";for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(Object.prototype.hasOwnProperty.call(i[r],"group")&&"small"===l?t.push(this.createGroup(r,i[r].group,n)):t.push(this.createOptions(r,i,n,l)));return t}},{key:"handleInputChange",value:function(e){this.setFieldValue("input",e.target.value)}},{key:"handleDropdownChange",value:function(e){this.setFieldValue("select",e.target.value)}},{key:"dynamicAttributeChange",value:function(e){this.setFieldValue("input",e)}},{key:"hangleLargeListClick",value:function(e){this.handleSelectToggle(),this.setFieldValue("select",e)}},{key:"setFieldValue",value:function(e,t){var a,i=this.props,n=i.updater,l=i.fieldKey,r=this.state,s=r.input,o=r.select;n(l,(0,d.default)({input:s,select:o},e,t)),this.setState((a={},(0,d.default)(a,e,t),(0,d.default)(a,"openedSelect",!1),a))}},{key:"getSelect",value:function(e){if(e||(e=this.props),e.options&&("currency"===e.options.type||e.options.large)){var t=this.state.select.replace("_",""),a="vcv-ui-form-dropdown vcv-ui-form-input-select";return this.state.openedSelect&&(a+=" vcv-ui-form-state--focus"),v.createElement("div",{className:a,onClick:this.handleSelectToggle},t)}var i=this.generateSelectChildren(e);return v.createElement("select",{value:this.state.select,onChange:this.handleDropdownChange,className:"vcv-ui-form-dropdown"},i)}},{key:"getList",value:function(){var e=this;if(this.state.openedSelect){var t=this.generateSelectChildren(this.props);return v.createElement("div",{className:"vcv-ui-form-input-select-list",ref:function(t){e.list=t}},t)}return null}},{key:"render",value:function(){var e=this.state.input,t=this.props.placeholder;!t&&this.props.options&&this.props.options.placeholder&&(t=this.props.options.placeholder);var a=this.getSelect(this.props),i=this.getList(),n=D()({"vcv-ui-form-input-select":!0,"vcv-ui-form-field-dynamic":this.props.options&&this.props.options.dynamicField}),l=v.createElement("div",{className:n},v.createElement("div",{className:"vcv-ui-form-input-group"},v.createElement("input",{className:"vcv-ui-form-input",type:"text",onChange:this.handleInputChange,placeholder:t,value:e}),a),i);return v.createElement(Ot.default,(0,S.default)({},this.props,{setFieldValue:this.dynamicAttributeChange,value:e}),l)}}]),a}(p.default);function na(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}(0,d.default)(ia,"defaultProps",{fieldType:"inputSelect"});var la=a("./node_modules/@babel/runtime/helpers/esm/get.js");function ra(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var sa=function(e){(0,o.default)(a,e);var t=ra(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),(0,d.default)((0,s.default)(i),"selectChildren",null),i.generateSelectChildren(i.props),i}return(0,r.default)(a,[{key:"componentDidUpdate",value:function(e){(0,la.default)((0,u.default)(a.prototype),"componentDidUpdate",this).call(this,e),(0,x.isEqual)(e,this.props)||this.generateSelectChildren(this.props)}},{key:"createGroup",value:function(e,t,a){var i=[],n=t.values,l=t.label,r=l.replace(/\s+/g,"");for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(this.createOptions(s,n,a));return v.createElement("optgroup",{key:a+":"+e+":"+r,label:l},i)}},{key:"createOptions",value:function(e,t,a){var i=t[e].value,n=t[e].label;return v.createElement("option",{key:a+":"+e+":"+i,value:i},n)}},{key:"getSelectOptions",value:function(e){e||(e=this.props);var t=(e.options||{}).values,a=(e.options||{}).global;return!a||t&&t.length||(t="function"==typeof window[a]?window[a]():window[a]||[]),t}},{key:"generateSelectChildren",value:function(e){var t=[],a=this.getSelectOptions(e),i=e.fieldKey;for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(Object.prototype.hasOwnProperty.call(a[n],"group")?t.push(this.createGroup(n,a[n].group,i)):t.push(this.createOptions(n,a,i)));this.selectChildren=t}},{key:"handleChange",value:function(e){for(var t=e.target.options,a=[],i=0,n=t.length;i=i.max&&(n=!0),i.min&&a&&a.value&&a.value.length<=i.min&&(l=!0),a&&a.value&&a.value.length<=1&&(l=!0);var r=wa.get("localizations"),s=r?r.clone:"Clone",o=r?r.remove:"Remove",c=r?r.edit:"Edit",u=null;n||(u=v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:s,onClick:function(){t.clickClone(e)}},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-copy"})));var d=null;return l||(d=v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:o,onClick:function(){t.clickDelete(e)}},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-trash"}))),v.createElement("div",{className:"vcv-ui-tree-layout-control-actions-container"},v.createElement("span",{className:"vcv-ui-tree-layout-control-actions"},v.createElement("span",{className:"vcv-ui-tree-layout-control-action",title:c,onClick:function(){t.clickEdit(e)}},v.createElement("i",{className:"vcv-ui-icon vcv-ui-icon-edit"})),u,d))}},{key:"render",value:function(){var e=this.state.value,t=this.props.options,a=!1;t.max&&e&&e.value&&e.value.length>=t.max&&(a=!0);var i=wa.get("localizations"),n=i?i.add:"Add",l=null;return a||(l=v.createElement("div",{className:"vcv-ui-form-params-group-add-item vcv-ui-icon vcv-ui-icon-add",onClick:this.handleAddClick,title:n})),v.createElement(Ot.default,(0,S.default)({},this.props,{setFieldValue:this.setFieldValue,value:e}),e.value&&e.value.length?null:v.createElement("div",{className:"vcv-ui-form-group-heading"},t.title),v.createElement("div",{className:"vcv-ui-form-params-group"},this.getSortableList(),l))}}]),a}(p.default);function Ea(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}(0,d.default)(Sa,"defaultProps",{fieldType:"paramsGroup"});var La=function(e){(0,o.default)(a,e);var t=Ea(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,r.default)(a,[{key:"handleChange",value:function(e){this.setFieldValue(e.currentTarget.value)}},{key:"getValues",value:function(){var e=this.props,t=(e.options||{}).values,a=(e.options||{}).global;return!a||t&&t.length||(t="function"==typeof window[a]?window[a]():window[a]||[]),t}},{key:"render",value:function(){var e=this.props.fieldKey,t=[],a=this.getValues(),i=this.state.value;for(var n in a){var l=a[n].value,r=i===l?"checked":"";t.push(v.createElement("label",{key:"".concat(e,":").concat(n,":").concat(l),className:"vcv-ui-form-radio"},v.createElement("input",{type:"radio",name:"".concat(e),onChange:this.handleChange,checked:r,value:l}),v.createElement("span",{className:"vcv-ui-form-radio-indicator"}),a[n].label))}var s="vcv-ui-form-radio-buttons";return this.props.options&&this.props.options.listView&&(s+=" vcv-ui-form-radio-buttons--list"),v.createElement("div",{className:s},t)}}]),a}(p.default);(0,d.default)(La,"defaultProps",{fieldType:"radio"});var Ta=a("./public/components/codeEditor/codeEditor.js");function Da(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Ra=function(e){(0,o.default)(a,e);var t=Da(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),(0,d.default)((0,s.default)(i),"editorWrapper",null),(0,d.default)((0,s.default)(i),"codeEditor",null),i.setValue=i.setValue.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){var e=this.props.value;this.props.options.mode&&"html"!==this.props.options.mode?"javascript"===this.props.options.mode&&(this.codeEditor=Ta.default.getEditor(this.editorWrapper,"javascript",e)):this.codeEditor=Ta.default.getEditor(this.editorWrapper,"htmlmixed",e),this.codeEditor.setSize("100%",this.props.options.height||"50vh"),this.codeEditor.on("change",this.setValue)}},{key:"componentDidUpdate",value:function(){this.codeEditor.refresh()}},{key:"setValue",value:function(){this.setFieldValue(this.codeEditor.getValue())}},{key:"render",value:function(){var e=this;return v.createElement("textarea",{className:"vcv-row-html-editor-container",ref:function(t){return e.editorWrapper=t}})}}]),a}(p.default);(0,d.default)(Ra,"defaultProps",{fieldType:"rawCode"}),(0,d.default)(Ra,"propTypes",{fieldKey:P().string.isRequired,value:P().string.isRequired,options:P().object.isRequired});var Pa=a("./public/sources/attributes/responsivenessSettings/Component.js"),Oa=a("./public/sources/attributes/rowLayout/Component.js");function ja(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Aa=(0,i.getService)("dataManager"),Ma=function(e){(0,o.default)(a,e);var t=ja(a);function a(e){var i;return(0,l.default)(this,a),i=t.call(this,e),e.setInnerFieldStatus&&e.setInnerFieldStatus(),i.valueChangeHandler=i.valueChangeHandler.bind((0,s.default)(i)),i.getStickyOffset=i.getStickyOffset.bind((0,s.default)(i)),i}return(0,r.default)(a,[{key:"updateState",value:function(e){return e.value?this.parseValue(e.value):w().defaultsDeep({},e,a.defaultState)}},{key:"parseValue",value:function(e){var t=w().defaultsDeep({},a.defaultState),i=[];return w().isEmpty(e.device)||(t.currentDevice=Object.keys(e.device).shift()),i.push("all"),i.forEach((function(i){t.devices[i]=w().defaultsDeep({},a.deviceDefaults),e.device&&e.device[i]&&(t.devices[i]=w().defaultsDeep({},e.device[i],t.devices[i]))})),t}},{key:"updateValue",value:function(e,t){var i={},n=[];"all"===(e=this.updateState(e)).currentDevice&&n.push("all"),n.forEach((function(t){w().isEmpty(e.devices[t])||(e.devices[t].stickyEnable||(e.devices[t].stickyEnable=a.deviceDefaults.stickyEnable),i[t]=w().defaultsDeep({},e.devices[t]),Object.keys(i[t]).length||delete i[t])})),this.setFieldValue(i,t),this.setState(e)}},{key:"setFieldValue",value:function(e,t){var a=this.props;(0,a.updater)(a.fieldKey,{device:e},t)}},{key:"valueChangeHandler",value:function(e,t){var a=w().defaultsDeep({},this.state);a.devices[a.currentDevice][e]=t,this.updateValue(a,e)}},{key:"getStickyToggle",value:function(){var e="stickyEnable",t=this.state.devices[this.state.currentDevice][e]||!1;return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:e,updater:this.valueChangeHandler,options:{labelText:"Enable stickiness"},value:t}))}},{key:"getStickyOffset",value:function(){var e="stickyOffsetTop",t=this.state.devices[this.state.currentDevice];if(!t.stickyEnable)return null;var i=t[e]||!1,n=a.localizations?a.localizations.marginTop:"Margin top",l=a.localizations?a.localizations.specifySpacesFromTheScreenTop:"Specify space (in pixels) from the screen top where element should stick.";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("div",{className:"vcv-ui-form-group-heading-wrapper"},v.createElement("span",{className:"vcv-ui-form-group-heading"},n),v.createElement(xe(),null,l)),v.createElement(Ce.default,{api:this.props.api,fieldKey:e,updater:this.valueChangeHandler,options:{placeholder:a.deviceDefaults.stickyOffsetTop},value:i}))}},{key:"getStickyZIndex",value:function(){var e="stickyZIndex",t=this.state.devices[this.state.currentDevice];if(!t.stickyEnable)return null;var i=t[e]||!1,n=a.localizations?a.localizations.zIndex:"Z-index",l=a.localizations?a.localizations.controlZIndexForElement:"Control the z-index for the section to place it over or under the following content. Sections with a higher index will be placed on top of sections with a lower index.";return v.createElement("div",{className:"vcv-ui-form-group"},v.createElement("div",{className:"vcv-ui-form-group-heading-wrapper"},v.createElement("span",{className:"vcv-ui-form-group-heading"},n),v.createElement(xe(),null,l)),v.createElement(Ce.default,{api:this.props.api,fieldKey:e,updater:this.valueChangeHandler,options:{placeholder:"999"},value:i}))}},{key:"getStickyContainerToggle",value:function(){var e="stickyContainer",t=this.state.devices[this.state.currentDevice];if(!t.stickyEnable)return null;var i=t[e]||!1,n=a.localizations?a.localizations.relateToParent:"Relate to parent",l=a.localizations?a.localizations.limitStickinessToWorkOnlyInTheParentContainer:"Limit stickiness to work only in the parent container.";return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:e,updater:this.valueChangeHandler,options:{labelText:n},value:i}),v.createElement(xe(),null,l))}},{key:"getStickyVisibilityToggle",value:function(){var e="stickyVisibility",t=this.state.devices[this.state.currentDevice];if(!t.stickyEnable)return null;var i=t[e]||!1,n=a.localizations?a.localizations.showOnSticky:"Show on sticky",l=a.localizations?a.localizations.showOnlyWhenItBecomesSticky:"Show only when it becomes sticky.";return v.createElement("div",{className:"vcv-ui-form-group vcv-ui-form-group-style--inline"},v.createElement(Z.default,{api:this.props.api,fieldKey:e,updater:this.valueChangeHandler,options:{labelText:n},value:i}),v.createElement(xe(),null,l))}},{key:"render",value:function(){return v.createElement("div",{className:"vcv-ui-sticky-section"},v.createElement("div",{className:"vcv-ui-row vcv-ui-row-gap--md"},v.createElement("div",{className:"vcv-ui-col vcv-ui-col--fixed-width"},this.getStickyToggle(),this.getStickyOffset(),this.getStickyZIndex(),this.getStickyContainerToggle(),this.getStickyVisibilityToggle())))}}]),a}(p.default);(0,d.default)(Ma,"defaultProps",{fieldType:"sticky"}),(0,d.default)(Ma,"localizations",Aa.get("localizations")),(0,d.default)(Ma,"deviceDefaults",{stickyEnable:!1,stickyOffsetTop:"0",stickyZIndex:null}),(0,d.default)(Ma,"defaultState",{currentDevice:"all",devices:{}});var Na=a("./public/sources/attributes/styleEditor/Component.tsx"),_a=a.n(Na);function Ba(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Ia=function(e){(0,o.default)(a,e);var t=Ba(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,r.default)(a,[{key:"render",value:function(){var e=this.state.value;return v.createElement("textarea",{className:"vcv-ui-form-input",onChange:this.handleChange,value:e})}}]),a}(p.default);(0,d.default)(Ia,"defaultProps",{fieldType:"textarea"});var Fa=a("./node_modules/lodash/debounce.js"),Va=a.n(Fa);function Ha(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Ua=function(e){(0,o.default)(a,e);var t=Ha(a);function a(e){var i;return(0,l.default)(this,a),(i=t.call(this,e)).onChangeToggleCheckboxList=i.onChangeToggleCheckboxList.bind((0,s.default)(i)),i.onChangeCheckboxList=i.onChangeCheckboxList.bind((0,s.default)(i)),i.requestToServer=Va()(i.requestToServer.bind((0,s.default)(i)),100),i.checkboxList=v.createRef(),i}return(0,r.default)(a,[{key:"componentDidMount",value:function(){this.requestToServer()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){}},{key:"onChangeToggleCheckboxList",value:function(e,t){var a=this.state.value;a.enabled=t,this.setFieldValue(a)}},{key:"onChangeCheckboxList",value:function(e,t){var a=this.state.value;a.values=t,this.setFieldValue(a)}},{key:"requestToServer",value:function(){var e,t;null===(e=this.checkboxList)||void 0===e||null===(t=e.current)||void 0===t||t.requestToServer()}},{key:"render",value:function(){var e,t,a,i=v.createElement("div",{className:"vcv-ui-form-group"},v.createElement(Z.default,(0,S.default)({},this.props,{api:this.props.api,key:"toggleCheckboxList",fieldKey:"toggleCheckboxList",updater:this.onChangeToggleCheckboxList,options:{labelText:""},value:(null===(e=this.state.value)||void 0===e?void 0:e.enabled)||!1}))),n=null;null!==(t=this.state.value)&&void 0!==t&&t.enabled&&(n=v.createElement("div",{className:"vcv-ui-form-group"},v.createElement(se.default,(0,S.default)({},this.props,{key:"checkboxList",fieldKey:"checkboxList",fieldType:"checkbox",ref:this.checkboxList,options:this.props.options,value:(null===(a=this.state.value)||void 0===a?void 0:a.values)||[],api:this.props.api,updater:this.onChangeCheckboxList}))));return v.createElement("div",{className:"vcv-ui-form-group"},i,n)}}]),a}(p.default);(0,d.default)(Ua,"defaultProps",{fieldType:"toggleableCheckboxList"});var za=a("./public/components/panels/treeView/treeViewLayout.js");function $a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,u.default)(e);if(t){var n=(0,u.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,c.default)(this,a)}}var Ka=function(e){(0,o.default)(a,e);var t=$a(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,r.default)(a,[{key:"render",value:function(){var e,t;return v.createElement("div",{className:"vcv-ui-form-tree-view--attribute"},v.createElement(za.default,{visible:!0,isAttribute:!0,controls:null===(e=this.props)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.controls,element:this.props.elementAccessPoint.cook()}))}}]),a}(p.default);(0,d.default)(Ka,"defaultProps",{fieldType:"treeView",options:P().any});var Wa=(0,i.getService)("cook").attributes;Wa.add("ajaxForm",b,{}),Wa.add("animateDropdown",C.default,{getAttributeLibs:function(e){var t=[];if(e){t.push({name:"animate",dependencies:["waypoints"]})}return t}}),Wa.add("attachimage",k.default,{getter:function(e,t,a){var i=a.options&&a.options.multiple,n=e[t],l=n;return w().isString(n)&&i?l=[n]:w().isArray(n)&&!i?l=n[0]:w().isObject(n)&&!w().isArray(n)&&(l=n.ids||n.urls||!n.id?i?n.urls:w().isArray(n.urls)?n.urls[0]:n:n),l},getAttributeLibs:function(e){var t=[],a=null,i=!1;if(e instanceof Array?(a=e[0]&&e[0]&&e[0].filter,e.forEach((function(e){e.link&&"popup"===e.link.type&&(i=!0)}))):(a=e&&e.filter,e.link&&"popup"===e.link.type&&(i=!0)),"normal"!==a){t.push({name:"imageFilter",dependencies:[]})}if(i){t.push({name:"popup",dependencies:[]})}return t}}),Wa.add("attachvideo",W,{getter:function(e,t,a){var i=a.options&&a.options.multiple,n=e[t],l=n;return w().isString(n)&&i?l=[n]:w().isArray(n)&&!i?l=n[0]:w().isObject(n)&&!w().isArray(n)&&(l=n.ids||n.urls||!n.id?i?n.urls:n.urls[0]:n),w().isEmpty(l)&&a.options&&a.options.defaultValue&&(l=a.options.defaultValue),l}}),Wa.add("autocomplete",G.default,{}),Wa.add("boxModel",q.default,{}),Wa.add("boxShadow",te,{}),Wa.add("buttonGroup",ae.default,{}),Wa.add("calendar",re,{}),Wa.add("checkbox",se.default,{}),Wa.add("color",Y.default,{}),Wa.add("customId",ue,{}),Wa.add("datalist",ve,{}),Wa.add("description",fe,{}),Wa.add("designOptions",he.default,{getAttributeLibs:function(e){var t=[],a=[{fieldKey:"animation",library:"animate",dependencies:["waypoints"],value:function(e){return e}},{fieldKey:"image",library:"backgroundSimple",value:function(e){return e&&e.ids&&e.urls&&e.ids.length&&e.urls.length}},{fieldKey:"lazyLoad",library:"lazyLoad",value:function(e){return e}}];if(e&&e.device&&Object.keys(e.device).length){var i=function(i){if(Object.prototype.hasOwnProperty.call(e.device,i)){var n=function(n){if(Object.prototype.hasOwnProperty.call(e.device[i],n)){var l=a.find((function(t){var a=t.fieldKey===n;return a&&t.value?a&&t.value(e.device[i][n]):a}));if(l){var r,s={name:"",dependencies:[]};if(s.name=l.library,l.dependencies)(r=s.dependencies).push.apply(r,(0,E.default)(l.dependencies));t.push(s)}}};for(var l in e.device[i])n(l)}};for(var n in e.device)i(n)}return t}}),Wa.add("designOptionsAdvanced",Oe,{getAttributeLibs:function(e){var t=[],a=[{fieldKey:"animation",library:"animate",dependencies:["waypoints"]},{fieldKey:"gradientOverlay",value:!0,library:"backgroundColorGradient"},{fieldKey:"backgroundType",value:"imagesSimple",library:"backgroundSimple"},{fieldKey:"backgroundType",value:"imagesSlideshow",library:"backgroundSlider"},{fieldKey:"backgroundType",value:"videoEmbed",library:"backgroundVideoEmbed"},{fieldKey:"backgroundType",value:"videoVimeo",library:"backgroundVideoVimeo"},{fieldKey:"backgroundType",value:"videoYoutube",library:"backgroundVideoYoutube"},{fieldKey:"backgroundType",value:"backgroundZoom",library:"backgroundZoom",dependencies:["waypoints"]},{fieldKey:"parallax",value:"simple",library:"parallaxBackground",dependencies:["waypoints"]},{fieldKey:"parallax",value:"simple-fade",library:"parallaxFade",dependencies:["waypoints","parallaxBackground"]},{fieldKey:"parallax",value:"mouse-move",library:"parallaxMouseMove",dependencies:[]},{fieldKey:"lazyLoad",value:!0,library:"lazyLoad"}];if(e&&e.device&&Object.keys(e.device).length){var i=function(i){if(Object.prototype.hasOwnProperty.call(e.device,i)){var n=function(n){if(Object.prototype.hasOwnProperty.call(e.device[i],n)){var l=a.find((function(t){var a=t.fieldKey===n,l=e.device[i][n];"0"!==l&&"1"!==l||(l=!!parseInt(l));var r=t.value===l;return a&&r||"animation"===n}));if(l){var r,s={name:"",dependencies:[]};if(s.name=l.library,l.dependencies)(r=s.dependencies).push.apply(r,(0,E.default)(l.dependencies));t.push(s)}}};for(var l in e.device[i])n(l)}};for(var n in e.device)i(n)}return t}}),Wa.add("devices",ge.default,{}),Wa.add("divider",_e,{getAttributeLibs:function(e){var t=[];e&&e.device&&Object.keys(e.device).length&&Object.keys(e.device).forEach((function(a){var i=e.device[a];if(i.dividerTop||i.dividerBottom){var n={name:"divider",dependencies:[]};switch(i.dividerTopBackgroundType||i.dividerBottomBackgroundType){case"videoEmbed":n.dependencies.push("backgroundVideoEmbed");break;case"videoYoutube":n.dependencies.push("backgroundVideoYoutube");break;case"videoVimeo":n.dependencies.push("backgroundVideoVimeo")}t.push(n)}}));return t}}),Wa.add("dividerpicker",Me,{}),Wa.add("dropdown",ye.default,{}),Wa.add("dynamicField",null,{}),Wa.add("element",Qe,{}),Wa.add("googleFonts",rt,{}),Wa.add("group",null,{getter:function(e,t){var a=Object.assign(e[t]);return new st(t,a)},setter:function(e,t,a){var i=new st(t,a);return e[t]=i.update(a),e}}),Wa.add("gutenbergEditor",pt,{}),Wa.add("htmleditor",Wt,{}),Wa.add("iconpicker",Jt,{getAttributeLibs:function(e){var t=[];if(e&&e.icon&&e.iconSet){var a={name:"iconpicker",subset:e.iconSet,dependencies:[]};t.push(a)}return t}}),Wa.add("inputIcon",ea,{}),Wa.add("inputSelect",ia,{getter:function(e,t,a){var i=e[t],n=a.value,l=a.options&&a.options.cssMixin,r=i&&"object"===(0,Be.default)(i)&&i.constructor===Object,s=function(e){for(var t=1;t',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"40",width:"500"}},"zigzag-1":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"40",width:"500"}},"rounded-zigzag":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"39",width:"500"}},angled:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"170",width:"500"}},"angled-1":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"170",width:"500"}},"angled-2":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"140",width:"500"}},"inner-triangle-with-offset":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"inner-triangle-with-offset-1":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"inner-triangle":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"inner-triangle-1":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"outer-triangle":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"outer-triangle-1":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"outer-triangle-with-offset":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"outer-triangle-with-offset-1":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"135",width:"500"}},"rounded-outer-triangle-with-offset":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"133",width:"500"}},"rounded-outer-triangle":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"133",width:"500"}},"rounded-outer-triangle-1":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"134",width:"500"}},round:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"128",width:"500"}},"angled-triangles":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"93",width:"500"}},curved:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"113",width:"500"}},"curved-wave":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"89",width:"500"}},"angle-with-fade":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"170",width:"500"}},wave:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"97",width:"500"}},"wave-with-fade":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"97",width:"500"}},"rounded-outer-triangle-with-offset-and-fade":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"115",width:"500"}},wavy:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"94",width:"500"}},spikes:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"62",width:"500"}},"rounded-spikes":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"59",width:"500"}},"arrow-split":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"27",width:"500"}},"rounded-arrow-split":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"25",width:"500"}},"inner-clouds-with-fade":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"44",width:"500"}},"outer-clouds-with-fade":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"44",width:"500"}},"inner-clouds":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"29",width:"500"}},"outer-clouds":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"29",width:"500"}},curvy:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"52",width:"500"}},"curvy-with-fade":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"60",width:"500"}},"uneven-wave-with-fade":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"77",width:"500"}},"opened-book-with-offset":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"130",width:"500"}},curve:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"110",width:"500"}},"uneven-cloud":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"140",width:"500"}},cloud:{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"110",width:"500"}},"opened-book":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"77",width:"440"}},"rounded-rectangle":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"77",width:"500"}},"bubble-outer":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"76",width:"500"}},"bubble-inner":{top:{content:'',unitContent:''},bottom:{content:'',unitContent:''},viewBox:{height:"70",width:"500"}}}},"./public/editor/services/api/service.js":function(e,t,a){"use strict";a.r(t);var i=a("./node_modules/vc-cake/index.js"),n=a.n(i),l=a("./public/components/api/publicAPI.js"),r=a("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=a("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),o=a("./node_modules/@babel/runtime/helpers/esm/createClass.js"),c=a("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),u=a("./node_modules/@babel/runtime/helpers/esm/inherits.js"),d=a("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),v=a("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),p=a("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),m=a("./node_modules/react/index.js"),f=a("./node_modules/react-dom/index.js"),h=a("./node_modules/lodash/lodash.js"),g=a.n(h),y=a("./node_modules/classnames/index.js"),b=a.n(y),C=a("./node_modules/prop-types/index.js"),k=a.n(C);function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var w=function(e){(0,u.default)(a,e);var t=x(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){var e=this.props,t=e.deviceKey,a=e.deviceData,i=a.videoYoutube,n=/^.*((youtu\.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*)(?:(\?t|&start)=(?:(\d+)h)?(?:(\d+)m)?(\d+)s)?.*/;if(i&&-1!==i.search(n)){var l={videoId:i.trim().match(n)[7]},r=b()({"vce-asset-video-yt-player":!0,"vcv-lozad":a.lazyLoad}),s='
'),o=["vce-asset-video-yt-container","vce-visible-".concat(t,"-only")];return m.createElement("div",{className:b()(o)},m.createElement("div",{className:"vce-asset-video-yt-wrapper"},m.createElement("div",{className:"vce-asset-video-yt-background","data-vce-assets-video-yt":l.videoId,"data-vce-assets-video-replacer":".vce-asset-video-yt-player","data-vce-assets-video-orientation-class":"vce-asset-video-yt--state-landscape"},m.createElement("svg",{className:"vce-asset-video-yt-sizer",width:"0",height:"0"}),m.createElement("div",{className:"vcvhelper","data-vcvs-html":s,dangerouslySetInnerHTML:{__html:'
'}}))))}return null}}]),a}(m.Component);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}(0,p.default)(w,"propTypes",{id:k().string,atts:k().object,editor:k().object});var E=function(e){(0,u.default)(a,e);var t=S(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){var e=this.props,t=e.deviceKey,a=e.deviceData,i=a.videoVimeo,n=/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/;if(i&&-1!==i.search(n)){var l={videoId:i.trim().match(n)[3]},r=b()({"vce-asset-video-vimeo-player":!0,"vcv-lozad":a.lazyLoad}),s='
'),o=["vce-asset-video-vimeo-container","vce-visible-".concat(t,"-only")];return m.createElement("div",{className:b()(o)},m.createElement("div",{className:"vce-asset-video-vimeo-wrapper"},m.createElement("div",{className:"vce-asset-video-vimeo-background","data-vce-assets-video-vimeo":l.videoId,"data-vce-assets-video-replacer":".vce-asset-video-vimeo-player","data-vce-assets-video-orientation-class":"vce-asset-video-vimeo--state-landscape"},m.createElement("svg",{className:"vce-asset-video-vimeo-sizer"}),m.createElement("div",{className:"vcvhelper","data-vcvs-html":s,dangerouslySetInnerHTML:{__html:'
'}}))))}return null}}]),a}(m.Component);(0,p.default)(E,"propTypes",{id:k().string,atts:k().object,editor:k().object});var L=a("./node_modules/@babel/runtime/helpers/esm/extends.js");function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var D=function(e){(0,u.default)(a,e);var t=T(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"getPublicImage",value:function(e){var t=this.props.atts.metaAssetsPath;return e&&e.match&&e.match("^(https?:)?\\/\\/?")?e:t+e}},{key:"render",value:function(){var e=this,t=this.props,a=t.reactKey,i=t.deviceKey,n=t.deviceData,l=t.images,r=n.backgroundStyle,s=n.backgroundPosition;if(l){var o=[];l.urls&&l.urls.length?l.urls.forEach((function(e,t){var i=e.id;e.id||(i="".concat(e.full,"-").concat(t));var l=b()({"vce-asset-background-simple-item":!0,vcvhelper:n.lazyLoad}),r={style:{backgroundImage:"url(".concat(e.full,")")}},s="".concat(a,"-").concat(i);n.lazyLoad&&(r["data-vcvs-html"]='\n
\n \n ')),o.push(m.createElement("div",(0,L.default)({className:l},r,{key:s})))})):l.length&&l.forEach((function(t,i){var l={style:{backgroundImage:"url(".concat(e.getPublicImage(t),")")}},r=b()({"vce-asset-background-simple-item":!0,vcvhelper:n.lazyLoad});n.lazyLoad&&(l["data-vcvs-html"]='\n
\n \n '));var s="".concat(a,"-").concat(t,"-").concat(i);o.push(m.createElement("div",(0,L.default)({className:r},l,{key:s})))}));var c=["vce-asset-background-simple-container","vce-visible-".concat(i,"-only")];r&&c.push("vce-asset-background-simple--style-".concat(r)),s&&c.push("vce-asset-background-simple--position-".concat(s));var u=b()(["vce-asset-background-simple"]);return m.createElement("div",{className:b()(c)},m.createElement("div",{className:b()(u)},o))}return null}}]),a}(m.Component);(0,p.default)(D,"propTypes",{id:k().string,atts:k().object,editor:k().object});var R=a("./node_modules/react-dom/server.browser.js");function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var O=function(e){(0,u.default)(a,e);var t=P(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"getPublicImage",value:function(e){var t=this.props.atts.metaAssetsPath;return e.match("^(https?:)?\\/\\/?")?e:t+e}},{key:"render",value:function(){var e=this,t=this.props,a=t.reactKey,i=t.deviceKey,n=t.deviceData,l=t.images,r=n.backgroundPosition,s=n.backgroundZoom,o=n.backgroundZoomSpeed,c=n.backgroundZoomReverse;if(l){var u=[];l.urls&&l.urls.length?l.urls.forEach((function(e,t){var i=e.id;e.id||(i="".concat(e.full,"-").concat(t));var l=b()({"vce-asset-background-zoom-item":!0,vcvhelper:n.lazyLoad}),r={style:{backgroundImage:"url(".concat(e.full,")")}},s="".concat(a,"-").concat(i);n.lazyLoad&&(r["data-vcvs-html"]='\n
\n \n ')),u.push(m.createElement("div",(0,L.default)({className:l},r,{key:s})))})):l.length&&l.forEach((function(t,i){var l="".concat(a,"-").concat(t,"-").concat(i),r=b()({"vce-asset-background-zoom-item":!0,vcvhelper:n.lazyLoad}),s={style:{backgroundImage:"url(".concat(e.getPublicImage(t),")")}};n.lazyLoad&&(s["data-vcvs-html"]='\n
\n \n ')),u.push(m.createElement("div",(0,L.default)({className:r},s,{key:l})))}));var d=["vce-asset-background-zoom-container","vce-visible-".concat(i,"-only")];r&&d.push("vce-asset-background-zoom--position-".concat(r));var v=b()(["vce-asset-background-zoom"]),p=1+s/100,f=c?p:1/p,h=c?{}:{transform:"scale(".concat(p,")")},g={"data-vce-assets-zoom":c?"in":"out","data-vce-assets-zoom-scale":f,"data-vce-assets-zoom-duration":o},y=R.renderToStaticMarkup(m.createElement("div",{className:b()(d)},m.createElement("div",{className:"vce-asset-background-zoom--scale-helper",style:h},m.createElement("div",(0,L.default)({className:v},g),u))));return m.createElement("div",{className:b()(d)},m.createElement("div",{className:"vcvhelper","data-vcvs-html":y,dangerouslySetInnerHTML:{__html:y}}))}return null}}]),a}(m.Component);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}(0,p.default)(O,"propTypes",{id:k().string,atts:k().object,editor:k().object});var A=function(e){(0,u.default)(a,e);var t=j(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"getPublicImage",value:function(e){var t=this.props.atts.metaAssetsPath;return e.match("^(https?:)?\\/\\/?")?e:t+e}},{key:"render",value:function(){var e=this,t=this.props,a=t.reactKey,i=t.deviceKey,n=t.deviceData,l=t.images,r=n.backgroundStyle,s=n.backgroundPosition,o=n.sliderTimeout,c=n.sliderEffect,u=n.sliderDirection,d=o;if(d||(d="carousel"===c?10:5),l){var v=[];l.urls&&l.urls.length?l.urls.forEach((function(e,t){var i=e.id;e.id||(i="".concat(e.full,"-").concat(t));var l=b()({"vce-asset-background-slider-item":!0,vcvhelper:n.lazyLoad}),r={style:{backgroundImage:"url(".concat(e.full,")")}},s="".concat(a,"-").concat(i);n.lazyLoad&&(r["data-vcvs-html"]='\n
\n \n ')),v.push(m.createElement("div",(0,L.default)({className:l},r,{key:s})))})):l.length&&l.forEach((function(t,i){var l={style:{backgroundImage:"url(".concat(e.getPublicImage(t),")")}},r=b()({"vce-asset-background-slider-item":!0,vcvhelper:n.lazyLoad});n.lazyLoad&&(l["data-vcvs-html"]='\n
\n \n '));var s="".concat(a,"-").concat(t,"-").concat(i);v.push(m.createElement("div",(0,L.default)({className:r},l,{key:s})))}));var p=["vce-asset-background-slider-container","vce-visible-".concat(i,"-only")];r&&p.push("vce-asset-background-slider--style-".concat(r)),s&&p.push("vce-asset-background-slider--position-".concat(s));var f={"data-vce-assets-slider":d,"data-vce-assets-slider-effect":c,"data-vce-assets-slider-direction":u,"data-vce-assets-slider-slides":".vce-asset-background-slider-items","data-vce-assets-slider-slide":".vce-asset-background-slider-item"},h=R.renderToStaticMarkup(m.createElement("div",(0,L.default)({className:b()(["vce-asset-background-slider"])},f),m.createElement("div",{className:"vce-asset-background-slider-items"},v)));return m.createElement("div",{className:b()(p)},m.createElement("div",{className:"vcvhelper","data-vcvs-html":h,dangerouslySetInnerHTML:{__html:h}}))}return null}}]),a}(m.Component);function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}(0,p.default)(A,"propTypes",{id:k().string,atts:k().object,editor:k().object});var N=function(e){(0,u.default)(a,e);var t=M(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){var e=this.props,t=e.reactKey,a=e.deviceKey,i=e.deviceData,n=i.videoEmbed;if(n&&n.urls&&n.urls.length){var l=n.urls[0],r="".concat(t,"-").concat(l.id),s=["vce-asset-video-embed-container","vce-visible-".concat(a,"-only")],o=!0,c=m.createElement("video",{key:r,className:"vce-asset-video-embed-player",playsInline:o},m.createElement("source",{src:l.url,type:"video/mp4"}));if(i.lazyLoad){var u='\n \n \n ');c=m.createElement("div",{className:"vcvhelper","data-vcvs-html":u},c)}return m.createElement("div",{className:b()(s)},m.createElement("div",{className:"vce-asset-video-embed-wrapper"},m.createElement("div",{className:"vce-asset-video-embed-background","data-vce-assets-video-embed":l.id,"data-vce-assets-video-replacer":".vce-asset-video-embed-player","data-vce-assets-video-orientation-class":"vce-asset-video-embed--state-landscape"},m.createElement("svg",{className:"vce-asset-video-embed-sizer"}),c)))}return null}}]),a}(m.Component);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}(0,p.default)(N,"propTypes",{id:k().string,atts:k().object,editor:k().object});var B=function(e){(0,u.default)(a,e);var t=_(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){var e=this.props,t=e.deviceKey,a=e.applyBackground,i=["vce-asset-color-gradient-container","vce-visible-".concat(t,"-only")];return m.createElement("div",(0,L.default)({className:b()(i)},a))}}]),a}(m.Component);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}(0,p.default)(B,"propTypes",{id:k().string,atts:k().object,editor:k().object});var F=function(e){(0,u.default)(a,e);var t=I(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"render",value:function(){var e=this.props,t=e.deviceKey,a=e.deviceData,i=e.content,n=e.divider,l=e.atts,r=a.parallax,s=a.parallaxSpeed,o=a.parallaxReverse;if(r){var c={},u=["vce-asset-parallax-container","vce-visible-".concat(t,"-only")],d=["vce-asset-parallax"];return"mouse-move"===r?(c["data-vce-assets-parallax-mouse-move"]=".vce-asset-parallax",c["data-vce-assets-parallax-mouse-move-element"]=l.id,d.push("vce-asset-parallax-mouse-move")):(r&&(c["data-vce-assets-parallax"]=".vce-asset-parallax"),"fixed"!==r||n||(c["data-vce-assets-parallax-fixed"]=!0),"simple-fade"!==r||n||(c["data-vce-assets-parallax-fade"]=!0)),n?c["data-vce-assets-parallax-speed"]=s?s/2:15:s&&(c["data-vce-assets-parallax-speed"]=s),c["data-vce-assets-parallax-reverse"]=o,m.createElement("div",(0,L.default)({className:b()(u)},c),m.createElement("div",{className:b()(d)},i))}return null}}]),a}(m.Component);(0,p.default)(F,"propTypes",{id:k().string,atts:k().object,editor:k().object});var V=a("./public/editor/services/api/lib/shapes.js"),H=a.n(V);function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var z=function(e){(0,u.default)(a,e);var t=U(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"setAlphaForColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1";if(e.indexOf("rgba")>=0){var a=e.match(/[\d.]+/g);a[3]&&"1"!==a[3]&&(a[3]=t,e="rgba(".concat(a.join(","),")"))}return e}},{key:"getAlphaFromColor",value:function(e){var t="1";if(e.indexOf("rgba")>=0){var a=e.match(/[\d.]+/g);a[3]&&(t=a[3])}return t}},{key:"getLinearGradient",value:function(){if("gradient"!==this.props.fillType)return null;var e=this.setAlphaForColor(this.props.gradientColorStart),t=this.getAlphaFromColor(this.props.gradientColorStart),a=this.setAlphaForColor(this.props.gradientColorEnd),i=this.getAlphaFromColor(this.props.gradientColorEnd),n=this.props.gradientAngle;this.props.flipHorizontally&&(e=this.setAlphaForColor(this.props.gradientColorEnd),t=this.getAlphaFromColor(this.props.gradientColorEnd),a=this.setAlphaForColor(this.props.gradientColorStart),i=this.getAlphaFromColor(this.props.gradientColorStart));var l="gradient-".concat(this.props.id,"-").concat(this.props.deviceKey);return this.props.type&&(l="gradient-".concat(this.props.id,"-").concat(this.props.deviceKey,"-").concat(this.props.type)),m.createElement("linearGradient",{id:l,gradientUnits:"objectBoundingBox",gradientTransform:"rotate(".concat(n||"0"," 0.5 0.5)")},m.createElement("stop",{offset:"0%",style:{stopColor:e,stopOpacity:t}}),m.createElement("stop",{offset:"100%",style:{stopColor:a,stopOpacity:i}}))}},{key:"changePercentageHeight",value:function(e,t,a,i,n){var l=i*e/100,r=l-n,s=(new window.DOMParser).parseFromString(t,"text/html"),o=s.querySelectorAll("path");return(o=[].slice.call(o)).forEach((function(e){var t=e.getAttribute("d").split(/(?=[LMCZ])/);t.pop();var i=t.map((function(e){var t=e[0],i=e.slice(1,e.length).split(" "),s=[];return i.forEach((function(e){if(""!==e){var t=e.split(","),i=parseFloat(t[1]),o=n*i;"top"===a?0!==i&&1!==i&&(i=(o+r)/l):0!==i&&1!==i&&(i=o/l),s.push(t[0]+","+i)}})),t+s.join(" ")}));e.setAttribute("d","".concat(i.join(" ")," Z"))})),s.body&&s.body.innerHTML}},{key:"changeHeight",value:function(e,t,a,i){var n=(new window.DOMParser).parseFromString(t,"text/html");e=parseFloat(e);var l=n.querySelectorAll("path");return(l=[].slice.call(l)).forEach((function(t){var n=t.getAttribute("d").split(/(?=[LMCZ])/);n.pop();var l=n.map((function(t){var n=t[0],l=t.slice(1,t.length).split(" "),r=[];return l.forEach((function(t){if(""!==t){var n=t.split(","),l=parseFloat(n[1]);"top"===a?0!==l&&(l+=e):l-i!=0&&(l-=e),r.push(n[0]+","+l)}})),n+r.join(" ")}));t.setAttribute("d","".concat(l.join(" ")," Z"))})),n.body&&n.body.innerHTML}},{key:"render",value:function(){var e=this.props,t=e.type,a=e.width,i=e.height,n=e.fill,l=e.shape,r=e.fillType,s=e.backgroundImage,o=e.deviceKey,c=e.id,u=e.videoEmbed,d=e.videoYoutube,v=e.videoVimeo,p=e.percentageHeight,f=H()[l],h=f.viewBox&&f.viewBox.width,g=f.viewBox&&f.viewBox.height;if(!(f=f&&f["".concat(t.toLowerCase())]))return null;var y=null,b="";u&&u.urls&&u.urls.length&&(y=u.urls[0],b=u.urls[0].url);var C=f.content,k=f.unitContent,x="0 0 ".concat(h," ").concat(g),w=t?t.toLowerCase():"top";if("color"===r||"gradient"===r||"image"===r&&!s||"videoEmbed"===r&&!b||"videoYoutube"===r&&!d||"videoVimeo"===r&&!v){var S=i;p&&(S=h*(parseFloat(p)/100));var E=this.changeHeight(S,C,w,g),T={};if(T.fill=n,"gradient"===r){var D="gradient-".concat(c,"-").concat(o);t&&(D="gradient-".concat(c,"-").concat(o,"-").concat(t)),T.fill="url(#".concat(D,")")}var R={viewBox:x,width:a,preserveAspectRatio:"none"};return m.createElement("svg",(0,L.default)({className:"vce-divider-svg"},R),this.getLinearGradient(),m.createElement("g",(0,L.default)({},T,{dangerouslySetInnerHTML:{__html:E}})))}if("image"===r){var P="image-el-".concat(c,"-").concat(o,"-").concat(w),O=k,j="url(".concat(s,")"),A=a.replace("%",""),M={};M.style={width:a};var N={style:{}},_={};return _.style={backgroundImage:j,width:"".concat(100/A*100,"%")},p?(p=parseFloat(p)+10,N.style.paddingBottom="".concat(p,"%"),O=this.changePercentageHeight(p,k,w,h,g)):M.style.height="".concat(parseFloat(i),"px"),m.createElement("div",(0,L.default)({className:"vce-divider-with-image"},M),m.createElement("svg",{className:"vce-divider-svg"},m.createElement("clipPath",{id:P,dangerouslySetInnerHTML:{__html:O},clipPathUnits:"objectBoundingBox"})),m.createElement("div",(0,L.default)({},N,{className:"vce-divider-image-block"}),m.createElement("div",(0,L.default)({},_,{className:"vce-divider-image-background-block"}))))}if("videoEmbed"===r){var B="video-el-".concat(c,"-").concat(o,"-").concat(w),I=k,F=a.replace("%",""),V={};V.style={width:a};var U={style:{}},z={};return z.style={width:"".concat(100/F*100,"%")},p?(p=parseFloat(p)+10,U.style.paddingBottom="".concat(p,"%"),I=this.changePercentageHeight(p,k,w,h,g)):U.style.height="".concat(parseFloat(i),"px"),m.createElement("div",(0,L.default)({className:"vce-divider-with-video"},V),m.createElement("svg",{className:"vce-divider-svg"},m.createElement("clipPath",{id:B,dangerouslySetInnerHTML:{__html:I},clipPathUnits:"objectBoundingBox"})),m.createElement("div",(0,L.default)({},U,{className:"vce-divider-video-block"}),m.createElement("div",(0,L.default)({},z,{className:"vce-divider-video-background-block"}),m.createElement("div",{className:"vce-divider-video-background-inner-block","data-vce-assets-video-embed":y.id,"data-vce-assets-video-replacer":".vce-asset-video-embed-player","data-vce-assets-video-orientation-class":"vce-asset-video-embed--state-landscape"},m.createElement("svg",{className:"vce-asset-video-embed-sizer"}),m.createElement("video",{className:"vce-asset-video-embed-player"},m.createElement("source",{src:b,type:"video/mp4"}))))))}if("videoYoutube"===r){var $=/^.*((youtu\.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*)(?:(\?t|&start)=(?:(\d+)h)?(?:(\d+)m)?(\d+)s)?.*/;if(d&&-1!==d.search($)){var K="video-el-".concat(c,"-").concat(o,"-").concat(w),W=k,G=a.replace("%",""),q={};q.style={width:a};var Z={style:{}},Y={};Y.style={width:"".concat(100/G*100,"%")},p?(p=parseFloat(p)+10,Z.style.paddingBottom="".concat(p,"%"),W=this.changePercentageHeight(p,k,w,h,g)):Z.style.height="".concat(parseFloat(i),"px");var J={videoId:d.trim().match($)[7]},Q="
";return m.createElement("div",(0,L.default)({className:"vce-divider-with-video"},q),m.createElement("svg",{className:"vce-divider-svg"},m.createElement("clipPath",{id:K,dangerouslySetInnerHTML:{__html:W},clipPathUnits:"objectBoundingBox"})),m.createElement("div",(0,L.default)({},Z,{className:"vce-divider-video-block"}),m.createElement("div",(0,L.default)({},Y,{className:"vce-divider-video-background-block"}),m.createElement("div",{className:"vce-divider-video-background-inner-block","data-vce-assets-video-yt":J.videoId,"data-vce-assets-video-replacer":".vce-asset-video-yt-player","data-vce-assets-video-orientation-class":"vce-asset-video-yt--state-landscape"},m.createElement("svg",{className:"vce-asset-video-yt-sizer",width:"0",height:"0"}),m.createElement("div",{className:"vcvhelper","data-vcvs-html":Q,dangerouslySetInnerHTML:{__html:Q}})))))}return null}if("videoVimeo"===r){var X=/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/;if(v&&-1!==v.search(X)){var ee="video-el-".concat(c,"-").concat(o,"-").concat(w),te=k,ae=a.replace("%",""),ie={};ie.style={width:a};var ne={style:{}},le={};le.style={width:"".concat(100/ae*100,"%")},p?(p=parseFloat(p)+10,ne.style.paddingBottom="".concat(p,"%"),te=this.changePercentageHeight(p,k,w,h,g)):ne.style.height="".concat(parseFloat(i),"px");var re={videoId:v.trim().match(X)[3]},se="
";return m.createElement("div",(0,L.default)({className:"vce-divider-with-video"},ie),m.createElement("svg",{className:"vce-divider-svg"},m.createElement("clipPath",{id:ee,dangerouslySetInnerHTML:{__html:te},clipPathUnits:"objectBoundingBox"})),m.createElement("div",(0,L.default)({},ne,{className:"vce-divider-video-block"}),m.createElement("div",(0,L.default)({},le,{className:"vce-divider-video-background-block"}),m.createElement("div",{className:"vce-divider-video-background-inner-block","data-vce-assets-video-vimeo":re.videoId,"data-vce-assets-video-replacer":".vce-asset-video-vimeo-player","data-vce-assets-video-orientation-class":"vce-asset-video-vimeo--state-landscape"},m.createElement("svg",{className:"vce-asset-video-vimeo-sizer"}),m.createElement("div",{className:"vcvhelper","data-vcvs-html":se,dangerouslySetInnerHTML:{__html:se}})))))}}return null}}]),a}(m.Component);function $(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}(0,p.default)(z,"propTypes",{width:k().string,height:k().string,fill:k().string,shape:k().string,fillType:k().string,backgroundImage:k().string,id:k().string,flipHorizontally:k().bool,deviceKey:k().string,videoEmbed:k().object,percentageHeight:k().string,videoYoutube:k().string,videoVimeo:k().string});var K=function(e){(0,u.default)(a,e);var t=$(a);function a(){return(0,s.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"getPublicImage",value:function(e){var t=this.props.metaAssetsPath;return e.match("^(https?:)?\\/\\/?")?e:t+e}},{key:"render",value:function(){var e,t=this.props,a=t.deviceData,i=t.deviceKey,n=t.id,l=t.applyDivider,r=t.type,s="divider".concat(r),o=a["".concat(s,"Shape")],c=a["".concat(s,"BackgroundImage")],u=a["".concat(s,"BackgroundColor")],d=a["".concat(s,"Width")],v=a["".concat(s,"Height")],f=a["".concat(s,"Height")]||"20",h=a["".concat(s,"BackgroundStyle")],g=a["".concat(s,"BackgroundPosition")],y=a["".concat(s,"FlipHorizontal")],C=a["".concat(s,"BackgroundGradientStartColor")],k=a["".concat(s,"BackgroundGradientEndColor")],x=a["".concat(s,"BackgroundGradientAngle")],w=a["".concat(s,"BackgroundType")],S=a["".concat(s,"VideoEmbed")],E=a["".concat(s,"VideoYoutube")],T=a["".concat(s,"VideoVimeo")],D=!1;"horizontally-right"===y&&(D=!0);var R="vce-container-divider-background-style--".concat(h),P="vce-container-divider-background-position--".concat(g),O=b()((e={"vce-container-divider":!0},(0,p.default)(e,"vce-divider-position--".concat(r&&r.toLowerCase()),r),(0,p.default)(e,"vce-container-divider-flip--horizontally",D),(0,p.default)(e,R,h),(0,p.default)(e,P,g),(0,p.default)(e,"vce-container-divider-new",!0),e),"vce-visible-".concat(i,"-only")),j=u,A=v||"200",M=d||"100";M="".concat(M,"%");var N=o&&o.icon;N=N&&N.split(" ")[1].replace("vcv-ui-icon-divider-","");var _="",B=c;return B&&(B.urls&&B.urls.length?_=B.urls[0].full:B.length&&(_=this.getPublicImage(B[0]))),m.createElement("div",(0,L.default)({className:O},l),m.createElement("div",{className:"vce-container-divider-inner"},m.createElement(z,{id:n,shape:N,width:M,height:A,fill:j,fillType:w,gradientColorStart:C,gradientColorEnd:k,gradientAngle:x,backgroundImage:_,flipHorizontally:D,deviceKey:i,videoEmbed:S,type:r,percentageHeight:f,videoYoutube:E,videoVimeo:T})))}}]),a}(m.Component);(0,p.default)(K,"propTypes",{deviceData:k().object,deviceKey:k().string,metaAssetsPath:k().string,id:k().string,applyDivider:k().object,type:k().string});var W=a("./public/tools/response.js"),G=a("./public/tools/updateHtmlWithServer.js"),q=a("./public/editor/services/modernAssetsStorage/cssMixins.ts"),Z=a("./public/tools/spinnerHtml.js");function Y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,i=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(i,arguments,n)}else a=i.apply(this,arguments);return(0,d.default)(this,a)}}var J=(0,i.getService)("cook"),Q=(0,i.getStorage)("assets"),X=(0,i.getService)("utils").getBlockRegexp,ee=J.dynamicFields.getDynamicFieldsData,te=X(),ae=(0,i.getStorage)("elementsSettings"),ie=(0,i.getService)("dataManager"),ne=function(e){(0,u.default)(a,e);var t=Y(a);function a(e){var i;return(0,s.default)(this,a),i=t.call(this,e),(0,p.default)((0,c.default)(i),"setCssVariables",(function(e,t){for(var a=0,i=Object.entries(e);a1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||a&&!m)return null;var f=function(e){var t=e.length,a={};if(t>9){var i,o;if(i=e=e.split(","),o=(0,r.default)(i,4),n=o[0],l=o[1],s=o[2],m=o[3],(t=e.length)<3||t>4)return null;a.r=v("a"==n[3]?n.slice(5):n.slice(4)),a.g=v(l),a.b=v(s),a.a=m?parseFloat(m):-1}else{if(8==t||6==t||t<4)return null;t<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?e[4]+e[4]:"")),e=v(e.slice(1),16),9==t||5==t?(a.r=e>>24&255,a.g=e>>16&255,a.b=e>>8&255,a.a=p((255&e)/.255)/1e3):(a.r=e>>16,a.g=e>>8&255,a.b=255&e,a.a=-1)}return a};return d=t.length>9,d=m?a.length>9||"c"==a&&!d:d,c=f(t),o=e<0,u=a&&"c"!=a?f(a):o?{r:0,g:0,b:0,a:-1}:{r:255,g:255,b:255,a:-1},o=1-(e=o?-1*e:e),c&&u?(i?(n=p(o*c.r+e*u.r),l=p(o*c.g+e*u.g),s=p(o*c.b+e*u.b)):(n=p(Math.pow(o*Math.pow(c.r,2)+e*Math.pow(u.r,2),.5)),l=p(Math.pow(o*Math.pow(c.g,2)+e*Math.pow(u.g,2),.5)),s=p(Math.pow(o*Math.pow(c.b,2)+e*Math.pow(u.b,2),.5))),m=c.a,u=u.a,m=(c=m>=0||u>=0)?m<0?u:u<0?m:m*o+u*e:0,d?"rgb"+(c?"a(":"(")+n+","+l+","+s+(c?","+p(1e3*m)/1e3:"")+")":"#"+(4294967296+16777216*n+65536*l+256*s+(c?p(255*m):0)).toString(16).slice(1,c?void 0:-2)):null}(e,t,a,i)})),i.mixinData=null,i.updateElementAssets=i.updateElementAssets.bind((0,c.default)(i)),i}return(0,o.default)(a,[{key:"shouldComponentUpdate",value:function(e,t){if(!e.children&&!this.props.children){var a=g().isEqual(this.state,t),i=g().isEqual(this.props.rawAtts,e.rawAtts);return!(a&&i)}return!0}},{key:"getShortcodesRegexp",value:function(){return new RegExp("\\[(\\[?)([\\w|-]+\\b)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)")}},{key:"spinnerHTML",value:function(){return Z.spinnerHtml}},{key:"updateElementAssets",value:function(e,t,a){this.updateElementAssetsWithExclusion(this.props.element.id,a)}},{key:"updateElementAssetsWithExclusion",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];a.length?t&&a.indexOf(t.changedAttribute)<0&&Q.trigger("updateElement",e,t):Q.trigger("updateElement",e,t)}},{key:"updateShortcodeToHtml",value:function(e,t,a,n,l){t?((0,G.addShortcodeToQueueUpdate)(e,t,this.props.id,a,n,l),"changed"===(0,i.getStorage)("wordpressData").state("status").get().status&&(0,G.setShortcodeListHtmlServerRequest)()):(0,i.env)("VCV_DEBUG")&&console.error("The ref argument in updateShortcodeToHtml method is undefined: ",t)}},{key:"getResponse",value:function(e){return(0,W.getResponse)(e)}},{key:"updateInlineHtml",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=document.createElement("div");e.innerHTML=this.spinnerHTML(),a||(a=t),n.setAttribute("data-vcvs-html","".concat(a)),n.classList.add("vcvhelper");var l=this.props.id,r=function(){!function(t){t.setTimeout((function(){var a=e.querySelector(".vcv-ui-wp-spinner");a&&a.remove();var i=ie.get("freezeReady");i&&i(l,!1),t.vcv&&t.vcv.trigger("ready","update",l)}),500)}((0,i.env)("iframe"))};(0,G.renderInlineHtml)(t,{headerContent:"",shortcodeContent:t,footerContent:""},n,l,r),e.appendChild(n)}},{key:"updateInlineScript",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=document.createElement("div");e.innerHTML="";var i='