/*! For license information please see theme-builder.js.LICENSE.txt */ !function(e,t){for(var r in t)e[r]=t[r]}(window,function(e){function t(t){for(var r,o,a=t[0],i=t[1],u=0,c=[];u0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.keys(e),n=Object.keys(t),o=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:[],r=t.reduce((function(t,r){return!!(t||e instanceof r)||t}),!1);return!(void 0===e||!(r||c(e)&&"[object Object]"===Object.prototype.toString.call(e)&&(e.constructor===Object||null===Object.getPrototypeOf(e))||"number"==typeof e||"string"==typeof e||"boolean"==typeof e||null===e||Array.isArray(e)))}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e:"string"==typeof e?e.split("."):[]}function p(e){throw new Error("Cerebral - "+e)}function y(){return!1}function m(e,t,r){var n=void 0;return function(){var o=this,a=arguments,i=function(){n=null,r||e.apply(o,a)},u=r&&!n;clearTimeout(n),n=setTimeout(i,t),u&&e.apply(o,a)}}function h(e){if(e&&!f(e)){var t=e.constructor.name;try{Object.defineProperty(e,"toJSON",{value:function(){return"["+t+"]"}})}catch(e){}}return e}function b(e){return Object.assign(Object.keys(e.providers||{}).reduce((function(t,r){return t[r]=e.providers[r]instanceof a.b?e.providers[r]:new a.b(e.providers[r]),t}),{}),Object.keys(e.modules||{}).reduce((function(t,r){return Object.assign(t,b(e.modules[r]))}),{}))}function v(e){return Object.keys(e).reduce((function(t,r){return e[r].children?t.concat(e[r]).concat(v(e[r].children)):t.concat(e[r])}),[])}function g(e,t){for(var r=[],n=0;n0&&void 0===e&&p('You are extracting with path "'+t+'", but it is not valid for this object'),e[r]}),e)}}function _(e,t){return s(t)&&-1===e.indexOf("*")?e+".**":e}function w(e){return{isTag:function(e){if(!(e instanceof n.Tag))return!1;for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(t){return d(t).reduce((function(e,t){return e?e[t]:void 0}),e)};return{options:{},on:function(){},getState:r,model:{get:r},getSequence:function(e){return t[e]||function(){}},dependencyStore:{addEntity:T,removeEntity:T}}}function P(e){if(s(e)&&!(e instanceof o.a)){for(var t in e)P(e[t]);!e.__CerebralState&&Object.defineProperty(e,"__CerebralState",{value:!0})}return e}function j(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,r){return!t&&s(e[r])&&"__CerebralState"in e[r]?r:t}),null)}function S(e,t){var r=Array.isArray(e)?e:d(e);return r.reduce((function(t,n){return t.modules[n]||p('The path "'+r.join(".")+'" is invalid, can not find module. Does the path "'+r.splice(0,e.length-1).join(".")+'" exist?'),t.modules[n]}),t)}function I(e,t,r){var n=Object.keys(e.modules||{}).reduce((function(n,o){return n[o]=I(e.modules[o],t,r),n}),{});if(e[t]){var o=Object.keys(e[t]).reduce((function(r,n){var o=Object.getOwnPropertyDescriptor(e[t],n);return o&&"get"in o?Object.defineProperty(r,n,o):r[n]=e[t][n],r}),n);return r?r(o,e):o}return n}var M=[];function C(e,t){-1===M.indexOf(e)&&(M.push(e),console.warn(e+" is DEPRECATED - "+t))}function A(e,t){var r=t.execution.name.split(".");return r.splice(0,r.length-1).concat(e).join(".")}function D(e){return e instanceof o.a||e instanceof o.b}function k(e,t,r){var n=[];return function e(t,r,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(D(r)||D(o))return o;if(c(r)&&c(o)){var i=Object.keys(r).concat(Object.keys(o)).reduce((function(e,t){return-1===e.indexOf(t)?e.concat(t):e}),[]),u=!0,l=!1,s=void 0;try{for(var f,d=i[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var p=f.value;e(t[p],r[p],o[p],a.concat(p))}}catch(e){l=!0,s=e}finally{try{!u&&d.return&&d.return()}finally{if(l)throw s}}}else"function"!=typeof o&&(Array.isArray(r)&&Array.isArray(o)||o===t&&r!==t?n.push({path:a.slice(),value:r}):o!==t&&n.push({path:a.slice(),value:o}))}(e,t,r),n}},function(e,t,r){"use strict";r.r(t),r.d(t,"props",(function(){return Q})),r.d(t,"path",(function(){return ee})),r.d(t,"state",(function(){return te})),r.d(t,"string",(function(){return re})),r.d(t,"sequences",(function(){return ne})),r.d(t,"computed",(function(){return oe})),r.d(t,"moduleState",(function(){return ae})),r.d(t,"moduleSequences",(function(){return ie})),r.d(t,"moduleComputed",(function(){return ue})),r.d(t,"ModuleClass",(function(){return m})),r.d(t,"ControllerClass",(function(){return k})),r.d(t,"ProviderClass",(function(){return b.a})),r.d(t,"BaseControllerClass",(function(){return P})),r.d(t,"ChainSequenceFactory",(function(){return H})),r.d(t,"ChainSequenceWithPropsFactory",(function(){return Y})),r.d(t,"sequence",(function(){return u.j})),r.d(t,"parallel",(function(){return u.h})),r.d(t,"createTemplateTag",(function(){return u.e})),r.d(t,"extractValueWithPath",(function(){return u.g})),r.d(t,"resolveObject",(function(){return u.i})),r.d(t,"ResolveValue",(function(){return u.c})),r.d(t,"Tag",(function(){return u.d})),r.d(t,"Controller",(function(){return le})),r.d(t,"UniversalController",(function(){return ce})),r.d(t,"UniversalApp",(function(){return se})),r.d(t,"Module",(function(){return fe})),r.d(t,"CerebralError",(function(){return $})),r.d(t,"Provider",(function(){return b.a})),r.d(t,"Compute",(function(){return l.c})),r.d(t,"Reaction",(function(){return d})),r.d(t,"View",(function(){return X})),r.d(t,"createDummyController",(function(){return o.d})),r.d(t,"throwError",(function(){return o.y})),r.d(t,"default",(function(){return pe}));var n=r(58),o=r(2),a=function(){function e(e,t){for(var r=0;rt.rawId?1:-1}))}},{key:"getUniqueEntities",value:function(e){return Object(o.g)(e,this.map).reduce((function(e,t){return(t.entities||[]).reduce((function(e,t){return-1===e.indexOf(t)?e.concat(t):e}),e)}),[]).sort((function(e,t){return e.rawId>t.rawId?1:-1}))}}]),e}(),u=r(6),l=r(21),c=r(112),s=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[];r=Object(o.h)(r),Object(o.a)("module.*","use the new STORE provider, store.set(state.isAwesome, true)");for(var n=this.context.execution.name.split("."),a=n.splice(0,n.length-1),i=arguments.length,u=Array(i>1?i-1:0),l=1;l2&&void 0!==arguments[2]?arguments[2]:{};!this.devtools||Object(o.v)(n)&&Object(o.w)(n)||(console.warn('You passed an invalid payload to sequence "'+e+'". Only serializable payloads can be passed to a sequence. The payload has been ignored. This is the object:',n),n={}),this.devtools&&(n=Object.keys(n).reduce((function(t,a){return Object(o.w)(n[a],r.devtools.allowedTypes)?(t[a]=Object(o.k)(n[a]),t):(console.warn('You passed an invalid payload to sequence "'+e+'", on key "'+a+'". Only serializable values like Object, Array, String, Number and Boolean can be passed in. Also these special value types:',r.devtools.allowedTypes),t)}),{}));var a=function(e){if(e){var t=Object(o.h)(e.execution.name).reduce((function(e,t,r){return e.currentModule.catch&&(e.catchingModule=e.currentModule),e.currentModule=e.currentModule.modules[t],e}),{currentModule:r.module,catchingModule:null});if(t.catchingModule){var n=!0,a=!1,i=void 0;try{for(var u,l=t.catchingModule.catch[Symbol.iterator]();!(n=(u=l.next()).done);n=!0){var c=w(u.value,2),s=c[0],f=c[1];if(e instanceof s)return r.runSequence("catch",f,e.payload),void(r.throwToConsole&&setTimeout((function(){console.log('Cerebral is handling error "'+e.name+": "+e.message+'" thrown by sequence "'+e.execution.name+'". Check debugger for more information.')})))}}catch(e){a=!0,i=e}finally{try{!n&&l.return&&l.return()}finally{if(a)throw i}}}if(!r.noRethrow){if(!e.execution.isAsync)throw e;setTimeout((function(){throw e}))}}};if(this.returnSequencePromise)return this.run(e,t,n).catch(a);this.run(e,t,n,a)}},{key:"getSequence",value:function(e){var t=Object(o.h)(e),r=t.pop(),n=t.reduce((function(e,t){return e?e.modules[t]:void 0}),this.module),a=n&&n.sequences[r];if(a)return a&&a.run}},{key:"getSequences",value:function(e){var t=Object(o.h)(e).reduce((function(e,t){return e?e.modules[t]:void 0}),this.module),r=t&&t.sequences;if(r){var n={};for(var a in r)n[a]=r[a].run;return n}}},{key:"addModule",value:function(e,t){var r=Object(o.h)(e),n=r.pop(),a=Object(o.m)(r,this.module),i=t instanceof m?t.create(this,Object(o.h)(e)):new m(t).create(this,Object(o.h)(e));a.modules[n]=i,i.providers&&Object.assign(this.contextProviders,i.providers),this.emit("moduleAdded",e.split("."),i),this.flush()}},{key:"removeModule",value:function(e){var t=this;if(!e)return console.warn("Controller.removeModule requires a Module Path"),null;var r=Object(o.h)(e),n=r.pop(),a=Object(o.m)(r,this.module),i=a.modules[n];i.providers&&Object.keys(i.providers).forEach((function(e){delete t.contextProviders[e]})),delete a.modules[n],this.emit("moduleRemoved",Object(o.h)(e),i),this.flush()}}]),t}(u.f),P=E,j=r(187),S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I=function(){function e(e,t){for(var r=0;r2&&void 0!==arguments[2]&&arguments[2];e.length?e.reduce((function(a,i,u){if(u===e.length-1){Array.isArray(a)||Object(o.v)(a)||Object(o.y)('The path "'+e.join(".")+'" is invalid. Path: "'+e.slice(0,e.length-1).join(".")+'" is type of "'+(null===a?"null":void 0===a?"undefined":S(a))+'"');var l=a[i];t(a[i],a,i),(a[i]!==l||Object(o.s)(a[i])&&Object(o.s)(l))&&r.changedPaths.push({path:e,forceChildPathUpdates:n})}else a[i]||(a[i]={});return a[i]}),this.state):t(this.state,this,"state")}},{key:"checkForComputed",value:function(e){var t=e.reduce((function(e,t){return e[t]}),this.state);if(t instanceof l.a&&Object(o.y)('You are trying to replace a computed value on path "'+e.join(".")+'", but that is not allowed'),Object(o.v)(t)){!function e(t,r){Object.keys(t).forEach((function(n){t[n]instanceof l.a?Object(o.y)('You are trying to replace a computed value on path "'+r.join(".")+'", but that is not allowed'):Object(o.v)(t[n])&&e(t[n],r.concat(n))}))}(t,e)}}},{key:"verifyValue",value:function(e,t){this.devtools&&(this.checkForComputed(t),Object(o.w)(e,this.devtools.allowedTypes)||Object(o.y)('You are passing a non serializable value into the state tree on path "'+t.join(".")+'"'),Object(o.k)(e),this.devtools.warnStateProps&&Object(o.b)(e))}},{key:"verifyValues",value:function(e,t){var r=this;this.devtools&&e.forEach((function(e){r.verifyValue(e,t)}))}},{key:"emitMutationEvent",value:function(e,t,r){for(var n=arguments.length,o=Array(n>3?n-3:0),a=3;a0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((function(t,r,n){return t instanceof l.b?t:t instanceof l.a?new l.b(t,e.slice(n)):t?t[r]:void 0}),this.state)}},{key:"set",value:function(e,t){this.verifyValue(t,e),this.updateIn(e,(function(e,r,n){r[n]=t}),!0),this.emitMutationEvent("set",e,!0,t)}},{key:"toggle",value:function(e){this.updateIn(e,(function(e,t,r){t[r]=!e})),this.emitMutationEvent("toggle",e,!1)}},{key:"push",value:function(e,t){this.verifyValue(t,e),this.updateIn(e,(function(e){e.push(t)})),this.emitMutationEvent("push",e,t,!1)}},{key:"merge",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:1;if(!Number.isInteger(t))throw new Error("Cerebral state.increment: you must increment with integer values.");this.updateIn(e,(function(e,r,n){if(!Number.isInteger(e))throw new Error("Cerebral state.increment: you must increment integer values.");r[n]=e+t})),this.emitMutationEvent("increment",e,!1,t)}}]),t}(j.a),C=M,A=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=this.createContext(t),n=e.getValue(r);return Object(o.t)(n)?n.getValue(t):n}},{key:"createContext",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.length?t.join(".")+".":"";return{props:e,controller:this,execution:{name:r}}}},{key:"createDependencyMap",value:function(e,t,r){var n=this,a=this.createContext(t,r);return e.reduce((function(e,r){return r instanceof u.d?r.getTags(a).reduce((function(e,r){if("state"===r.type||"moduleState"===r.type){var i=r.getValue(a);if(Object(o.t)(i))return i.getValue(t),Object.assign(e,i.getDependencyMap());var u=r.getPath(a);e[Object(o.i)(u,n.getState(u))]=!0}return e}),e):e}),{})}}]),t}(P),k=D,R=function(){function e(e,t){for(var r=0;rwindow.CEREBRAL_STATE = "+e+"<\/script>"}},{key:"runSequence",value:function(e,t){var r=void 0;if(Array.isArray(e))r=this.run("UniversalController.run",e,t);else if("string"==typeof e){var n=Object(o.h)(e),a=n.pop(),i=Object(o.m)(n,this.module),u=i&&i.sequences[a];r=this.run(e,u.sequence,t)}else Object(o.y)("Sequence must be a sequence-path or an array of action.");return r}},{key:"setState",value:function(e,t){this.model.set(Object(o.h)(e),t),this.flush(!0)}}]),t}(k),B=L,N=r(94),U=(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),W=function(){function e(e){this.sequenceArray=e}return e.prototype.action=function(){for(var t=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:"";V(this,t);var r=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.defineProperty(r,"message",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:r.constructor.name,writable:!0}),Error.hasOwnProperty("captureStackTrace")?(Error.captureStackTrace(r,r.constructor),q(r)):(Object.defineProperty(r,"stack",{configurable:!0,enumerable:!1,value:new Error(e).stack,writable:!0}),r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));var $=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.name="CerebralError",n.details=r,n.toJSON=function(){var e=this;return Object.getOwnPropertyNames(this).reduce((function(t,r){return["toJSON","execution","functionDetails"].includes(r)||(t[r]=e[r]),t}),{})},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(G),K=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Object.keys(this.dependencies).reduce((function(n,a){var i=t.dependencies[a],u=i.getValue(e);if(Object(o.t)(u)){var l=i.getPath(e);t.computedWithProps[l]?n[a]=t.computedWithProps[l].getValue(r):n[a]=u.getValue(r)}else n[a]=u;return n}),{});return this.controller.devtools&&this.controller.devtools.bigComponentsWarning&&!this._hasWarnedBigComponent&&Object.keys(this.dependencies).length>=this.controller.devtools.bigComponentsWarning&&(console.warn("Component named "+this._displayName+" has a lot of dependencies, consider refactoring or adjust this option in devtools"),this._hasWarnedBigComponent=!0),this.mergeProps?this.mergeProps(a,r,(function(t){t instanceof u.d||Object(o.y)("You are not passing a tag to the mergeProp get function");var n=t.getValue(e);return Object(o.t)(n)?n.getValue(r):n})):(a.get=this.createDynamicGetter(r,e),a.reaction=this.createReaction,Object.assign({},n?r:{},a))}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments[2],n=this.controller.createContext(e),o=this.getProps(n,e,r);this.executedCount++,this.controller.devtools&&this.controller.devtools.sendWatchMap([],[],0,0);var a=t(o);return this.dynamicDependencies.length&&this.update(e),a}}]),t}(c.a),X=Z,J=n;var Q=J.props,ee=J.path,te=J.state,re=J.string,ne=J.sequences,oe=J.computed,ae=J.moduleState,ie=J.moduleSequences,ue=J.moduleComputed;function le(e,t){return Object(o.a)("Controller","Use App default import instead"),new k(e,t)}function ce(e,t){return Object(o.a)("UniversalController","Use UniversalApp import instead"),new B(e,t)}function se(e,t){return new B(e,t)}function fe(e){return Object(o.a)("Module","Use plain object/function. Type with ModuleDefinition export"),new m(e)}var de=void 0;function pe(e,t){return t&&!0===t.hotReloading&&de?(de.reconfigure(e),de):de=new k(e,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TEMPLATE_PREVIEW_STATUS_LOADING=t.TEMPLATE_PREVIEW_STATUS_LOADED=t.STATUS_CODE_SUBSCRIPTION_EXPIRED=t.SAVE_STATE_SUCCESS=t.SAVE_STATE_LOADING=t.SAVE_STATE_IDLE=t.SAVE_STATE_ERROR=t.PROMPT_TYPE_VISUAL_BUILDER_UNSAVED_CHANGES=t.PROMPT_TYPE_UNKNOWN_ERROR=t.PROMPT_TYPE_THEME_BUILDER_RESET=t.PROMPT_TYPE_LOAD_DRAFT=t.PROMPT_TYPE_LIBRARY_ITEM_NOT_EXISTS=t.PROMPT_TYPE_ITEM_EXPORT_MODAL=t.PROMPT_TYPE_IMPORT_LIBRARY_TEMPLATE=t.PROMPT_TYPE_DELETE_GLOBAL_LAYOUT_PROGRESS=t.PROMPT_TYPE_DELETE_GLOBAL_LAYOUT=t.PORTABILITY_STATE_IMPORT_LIBRARY_TEMPLATE=t.PORTABILITY_STATE_EXPORT_TEMPLATE=t.PORTABILITY_STATE_DEFAULT=t.MODAL_TYPE_VISUAL_BUILDER=t.MODAL_TYPE_USE_GLOBAL_LAYOUTS=t.MODAL_TYPE_USE_DEFAULT_TEMPLATE=t.MODAL_TYPE_THEME_BUILDER_LIBRARY=t.MODAL_TYPE_SAVE_TO_LIBRARY=t.MODAL_TYPE_PORTABILITY=t.MODAL_TYPE_IMPORT_TEMPLATES=t.MODAL_TYPE_HISTORY=t.MODAL_TYPE_DIVI_LIBRARY=t.LOAD_TEMPLATE_ACTION_OVERRIDE_DEFAULT=t.LOAD_TEMPLATE_ACTION_LOAD_WITH_GLOBAL_REFERENCES=t.LOAD_TEMPLATE_ACTION_LOAD_AS_STATIC=t.LIBRARY_SAVE_TEMPLATE_ACTION=t.LIBRARY_SAVE_PRESET_ACTION=t.LIBRARY_ITEM_TYPE_TEMPLATE=t.LIBRARY_ITEM_TYPE_SET=t.LIBRARY_ITEM_ACTION_PREVIEW=t.LIBRARY_ITEM_ACTION_EDIT=t.LAYOUT_TYPE_HEADER=t.LAYOUT_TYPE_FOOTER=t.LAYOUT_TYPE_BODY=t.LAYOUT_TYPES=t.IMPORT_STATE_SUCCESS=t.IMPORT_STATE_LOADING=t.IMPORT_STATE_INCOMING_LAYOUT_DUPLICATE_DECISION=t.IMPORT_STATE_IDLE=t.IMPORT_STATE_ERROR=t.HOTKEYS_UNDO=t.HOTKEYS_SAVE=t.HOTKEYS_REDO=t.HOTKEYS_PASTE=t.HOTKEYS_COPY=t.HOTKEYS_CLOSE=t.EXPORT_STATE_SUCCESS=t.EXPORT_STATE_LOADING=t.EXPORT_STATE_IDLE=t.EXPORT_STATE_ERROR=t.CAP_PORTABILITY=t.CAP_LOAD_LAYOUT=t.CAP_DIVI_LIBRARY=t.ADMIN_BAR_HEIGHT=void 0;t.ADMIN_BAR_HEIGHT=32;var n="header";t.LAYOUT_TYPE_HEADER=n;var o="body";t.LAYOUT_TYPE_BODY=o;var a="footer";t.LAYOUT_TYPE_FOOTER=a;var i=[n,o,a];t.LAYOUT_TYPES=i;t.PROMPT_TYPE_UNKNOWN_ERROR="unknown_error";t.PROMPT_TYPE_LOAD_DRAFT="load_draft";t.PROMPT_TYPE_THEME_BUILDER_RESET="theme_builder_reset";t.PROMPT_TYPE_VISUAL_BUILDER_UNSAVED_CHANGES="visual_builder_unsaved_changes";t.PROMPT_TYPE_DELETE_GLOBAL_LAYOUT="delete_global_layout";t.PROMPT_TYPE_DELETE_GLOBAL_LAYOUT_PROGRESS="delete_global_layout_progress";t.PROMPT_TYPE_LIBRARY_ITEM_NOT_EXISTS="library_item_not_exists";t.PROMPT_TYPE_IMPORT_LIBRARY_TEMPLATE="import_library_template";t.PROMPT_TYPE_ITEM_EXPORT_MODAL="item_export_modal";t.MODAL_TYPE_DIVI_LIBRARY="divi_library";t.MODAL_TYPE_HISTORY="history";t.MODAL_TYPE_IMPORT_TEMPLATES="import_templates";t.MODAL_TYPE_PORTABILITY="portability";t.MODAL_TYPE_SAVE_TO_LIBRARY="save_to_library";t.MODAL_TYPE_THEME_BUILDER_LIBRARY="theme_builder_library";t.MODAL_TYPE_VISUAL_BUILDER="visual_builder";t.MODAL_TYPE_USE_DEFAULT_TEMPLATE="use_default_template";t.MODAL_TYPE_USE_GLOBAL_LAYOUTS="use_global_layouts";t.SAVE_STATE_IDLE="idle";t.SAVE_STATE_LOADING="loading";t.SAVE_STATE_SUCCESS="success";t.SAVE_STATE_ERROR="error";t.PORTABILITY_STATE_DEFAULT="default";t.PORTABILITY_STATE_EXPORT_TEMPLATE="export_template";t.PORTABILITY_STATE_IMPORT_LIBRARY_TEMPLATE="import_template";t.EXPORT_STATE_IDLE="idle";t.EXPORT_STATE_LOADING="loading";t.EXPORT_STATE_SUCCESS="success";t.EXPORT_STATE_ERROR="error";t.IMPORT_STATE_IDLE="idle";t.IMPORT_STATE_LOADING="loading";t.IMPORT_STATE_INCOMING_LAYOUT_DUPLICATE_DECISION="incoming_layout_duplicate_decision";t.IMPORT_STATE_SUCCESS="success";t.IMPORT_STATE_ERROR="error";t.CAP_PORTABILITY="et_theme_builder_portability";t.CAP_DIVI_LIBRARY="divi_library";t.CAP_LOAD_LAYOUT="load_layout";t.HOTKEYS_SAVE=["command+s","ctrl+s"];t.HOTKEYS_CLOSE=["escape"];t.HOTKEYS_UNDO=["command+z","ctrl+z"];t.HOTKEYS_REDO=["command+shift+z","ctrl+shift+z","ctrl+y"];t.HOTKEYS_COPY=["command+c","ctrl+c"];t.HOTKEYS_PASTE=["command+v","ctrl+v"];t.LIBRARY_SAVE_TEMPLATE_ACTION="save_template_action";t.LIBRARY_SAVE_PRESET_ACTION="save_preset_action";t.LIBRARY_ITEM_TYPE_TEMPLATE="template";t.LIBRARY_ITEM_TYPE_SET="set";t.LIBRARY_ITEM_ACTION_EDIT="edit";t.LIBRARY_ITEM_ACTION_PREVIEW="preview";t.TEMPLATE_PREVIEW_STATUS_LOADING="loading";t.TEMPLATE_PREVIEW_STATUS_LOADED="loaded";t.LOAD_TEMPLATE_ACTION_OVERRIDE_DEFAULT="override_default";t.LOAD_TEMPLATE_ACTION_LOAD_AS_STATIC="load_as_static";t.LOAD_TEMPLATE_ACTION_LOAD_WITH_GLOBAL_REFERENCES="load_with_global_references";t.STATUS_CODE_SUBSCRIPTION_EXPIRED=999},function(e,t,r){var n=r(115);e.exports=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"j",(function(){return q})),r.d(t,"h",(function(){return G})),r.d(t,"f",(function(){return V})),r.d(t,"b",(function(){return j.a})),r.d(t,"g",(function(){return C})),r.d(t,"i",(function(){return D})),r.d(t,"c",(function(){return M})),r.d(t,"e",(function(){return x})),r.d(t,"d",(function(){return R}));var n=function(){function e(e,t){for(var r=0;r0&&void 0===e)throw new Error('Cannot extract value at path "'+t+'" ("'+r+'" is not defined).');return e[r]}),e)}var A=function(e){function t(e){I(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.cvalue=e,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),S(t,[{key:"getValue",value:function(e){var t=e.resolve,r=this.cvalue;return t.isResolveValue(r)?t.value(r):Object.keys(r).reduce((function(e,n){return e[n]=t.value(r[n]),e}),{})}}]),t}(M),D=function(e){return new A(e)},k=function(){function e(e,t){for(var r=0;r1?n-1:0),a=1;a1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return e instanceof M?e.getValue(t?Object.assign({},this.context,t):this.context):e},path:function(e){if(e instanceof R)return e.getPath(this.context);throw new Error("You are extracting a path from an argument that is not a Tag.")}},{wrap:!1}),B=r(114),N=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};F(this,t);var n=W(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(n.cachedTrees=[],n.cachedStaticTrees=[],n.executeBranchWrapper=r.executeBranchWrapper||function(e){e()},"object"!==(void 0===e?"undefined":U(e))||null===e||Array.isArray(e))throw new Error("You have to pass an object of context providers to FunctionTree");var o=Object.keys(e);if(o.indexOf("props")>=0||o.indexOf("path")>=0||o.indexOf("resolve")>=0||o.indexOf("execution")>=0||o.indexOf("debugger")>=0)throw new Error('You are trying to add a provider with protected key. "props", "path", "resolve", "execution" and "debugger" are protected');return n.contextProviders=Object.assign({},e,{resolve:L}),n.run=n.run.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),N(t,[{key:"run",value:function(){var e=this,t=void 0,r=void 0,n=void 0,o=void 0,a=void 0,i=[].slice.call(arguments);if(i.forEach((function(e){"string"==typeof e?t=e:Array.isArray(e)||e instanceof u?r=e:r||"function"!=typeof e?"function"==typeof e?o=e:n=e:r=e})),!r)throw new Error("function-tree - You did not pass in a function tree");var l=function(o,i){var u=e.cachedTrees.indexOf(r);-1===u?(a=O(t,r),e.cachedTrees.push(r),e.cachedStaticTrees.push(a)):a=e.cachedStaticTrees[u];var l=new Y(t,a,e,(function(t,r,n,o){e.emit("error",t,r,n,o),i(t)}));e.emit("start",l,n),P(l,n,e.executeBranchWrapper,(function(t,r,n){e.emit("pathStart",r,l,t,n)}),(function(t){e.emit("pathEnd",l,t)}),(function(t,r){e.emit("parallelStart",l,t,r)}),(function(t,r){e.emit("parallelProgress",l,t,r)}),(function(t,r){e.emit("parallelEnd",l,t,r)}),(function(t){e.emit("end",l,t),o===i?o(null,t):o(t)}))};if(!o)return new Promise(l);l(o,o)}}]),t}(T.a);function q(){for(var e=arguments.length,t=Array(e),r=0;r2?r-2:0),a=2;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?(a=o(r[0]),2===u?i=r.length>1?o(r[1]):(0,S.default)("themeBuilder","Exclude From: %1$s",o(n[0])):u>2&&(i=(0,S.default)("themeBuilder","And %1$s More",u-1))):a=(0,S.default)("themeBuilder","Unassigned"),t&&(a=(0,S.default)("themeBuilder","Default Website Template")),{title:a,meta:i}};t.generateTemplateTitle=W;t.getTemplateTitle=function(e,t,r,n){return e||(0,T.default)(r)?n:r};t.getTemplateMeta=function(e,t,r){return e||(0,T.default)(t)?r:""};var F=function(e){return{id:e,default:!1,enabled:!0,title:"",automaticTitle:"",automaticMeta:"",layouts:(0,u.default)((0,f.default)(P.LAYOUT_TYPES),(function(e){return{layout:null,enabled:!0,busy:!1}})),useOn:[],excludeFrom:[]}};t.getEmptyTemplate=F;var z=function(e,t){var r=function(e){return!(0,O.default)(t[e])},n={},o=(0,l.default)(e,(function(e){var t=(0,E.v4)();n[t]=e.id.toString();var o=F(t);return o.default=e.default,o.enabled=e.enabled,o.title=e.title,o.useOn=(0,g.default)(e.use_on,r),o.excludeFrom=(0,g.default)(e.exclude_from,r),o.itemId=e.item_id,o.placeholder=(0,p.default)(e,"placeholder",!1),(0,h.default)(P.LAYOUT_TYPES,(function(t){o.layouts[t].enabled=e.layouts[t].enabled,o.layouts[t].layout=0!==e.layouts[t].id?e.layouts[t].id.toString():null,o.layouts[t].global=e.layouts[t].global})),o}));return{templates:(0,f.default)(o,(function(e){return e.id})),idMap:n}};t.formatTemplates=z;t.formatTemplatesForStorage=function(e,t){return(0,l.default)(e,(function(e){var r=e.title,n=!1;if(e.default&&(r=(0,S.default)("themeBuilder","Default Website Template")),""===r&&(r=e.automaticTitle,n=!0),""===r&&(r=(0,S.default)("themeBuilder","Unassigned")),!(0,w.default)(e.is_default)&&(0,w.default)(e.default)){var o="1"===(0,p.default)(e,"is_default","0");(0,y.default)(e,"default",o)}return{id:(0,p.default)(t,e.id,e.id),title:r,autogenerated_title:n?"1":"0",default:e.default?"1":"0",enabled:e.enabled?"1":"0",layouts:(0,u.default)((0,f.default)(P.LAYOUT_TYPES),(function(t){return{id:e.layouts[t].layout||0,enabled:e.layouts[t].enabled?"1":"0"}})),use_on:e.useOn,exclude_from:e.excludeFrom,item_id:e.itemId}}))};var H=null;t.getInitialState=function(){if(!(0,_.default)(H))return H;var e=function(e){(0,T.default)(e)||(0,i.default)(e,(function(e){return e.default}))||(e[(0,s.default)(e)[0]].default=!0);return e},t=(0,E.v4)(),r=((0,I.getIdQueryParam)("tb_template"),R({},t,k(k({},F(t)),{},{default:!0}))),n={live:{},draft:{}},o=[],a="",u=k(k({},function(e){return(0,m.default)(e,(function(e,t,r){return(0,h.default)(t.settings,(function(t){e[t.id]?(0,y.default)(e,[t.id,"labels",r],t.label):e[t.id]=t})),e}),{})}(j.default.templateSettings.default)),j.default.templateSettings.preloaded);if(!(0,T.default)(j.default.templates.live)){var l=G(j.default.templates.live),c=z(l,u);r=e(c.templates),n.live=c.idMap}var f={templates:{},idMap:{}};return j.default.templates.hasDraft&&((f=z(j.default.templates.draft,u)).templates=e(f.templates)),Y(r,u,(function(e,t,n){r[e].automaticTitle=t,r[e].automaticMeta=n})),V(r,[],(function(e){o=e})),q(r,a,(function(e){a=e})),H={templates:r,templateIdMap:n,draft:f,templateIds:o,defaultTemplate:a,settingGroups:j.default.templateSettings.default,settings:u}};var Y=function(e,t,r){(0,h.default)(e,(function(e){var n=W(t,e.default,e.useOn,e.excludeFrom);n.title===e.automaticTitle&&n.meta===e.automaticMeta||r(e.id,n.title,n.meta)}))};t.optimizationSetAutomaticTitles=Y;var V=function(e,t,r){var n=(0,s.default)(e);(0,d.default)(t,n)||r(n)};t.optimizationSetTemplateIds=V;var q=function(e,t,r){var n=(0,v.default)(e,(function(e){return e.default})).id;t!==n&&r(n)};t.optimizationSetDefaultTemplate=q;var G=function(e){var t=(0,I.getIdQueryParam)("tb_template"),r=(0,I.getIdQueryParam)("tb_set"),n=!1;if(t?n=!0:r&&(n=!(0,i.default)(e,(function(e){return e.default}))),n){var a=function(){var e=j.default.templates.live;if((0,T.default)(e)&&(e=j.default.templates.draft),(0,T.default)(e))return null;var t=(0,o.default)(e[0]);return t.id=0,t.layouts.body.id=0,t.layouts.header.id=0,t.layouts.footer.id=0,t.hidden=!0,t.use_on=[],t.placeholder=!0,t}();(0,_.default)(a)||e.unshift(a)}return e};t.removePlaceholderTemplates=function(e){return(0,g.default)(e,(function(e){return!e.placeholder}))};var $=function(e,t,r){var o=(0,b.default)((0,l.default)(t,(function(t){var n=B(e,t),o=(0,p.default)(n,"parent",null),a=B(e,o);return{group:r,setting:n,parentId:o,parent:a}})),(function(e){return"".concat(e.group,"-").concat(e.parentId||e.setting.id)}));return"useOn"===r&&x(t)&&(o["useOn-unassigned"]=[{group:r,parent:null,parentId:null,setting:{id:"unassigned",label:(0,S.default)("themeBuilder","Unassigned"),priority:0}}]),(0,n.default)(o)};t.renderTemplateConditions=function(e,t,r){var n=[].concat(C($(r,U(r,e),"useOn")),C($(r,U(r,t),"excludeFrom")));return React.createElement("ul",{className:"et-tb-template__conditions"},(0,l.default)(n,(function(e,t){var r=e[0],n=r.group,o=r.setting,a=r.parent,i=r.parentId,u="useOn"===n&&"unassigned"!==o.id?"success":"danger",c=(0,_.default)(i)?"":"".concat(a.label,": "),s=(0,l.default)(e,"setting.label");return React.createElement("li",{key:t},React.createElement("div",{className:"et-tb-admin-list-item et-tb-admin-list-item--".concat(u)}),React.createElement("div",{className:"et-tb-template__condition-item"},c+s.join(", ")))})))}},function(e,t,r){"use strict";r.r(t),r.d(t,"sequence",(function(){return n.j})),r.d(t,"parallel",(function(){return n.h})),r.d(t,"debounce",(function(){return o.a})),r.d(t,"when",(function(){return c})),r.d(t,"wait",(function(){return o.b})),r.d(t,"equals",(function(){return s})),r.d(t,"concat",(function(){return f})),r.d(t,"increment",(function(){return d})),r.d(t,"merge",(function(){return y})),r.d(t,"pop",(function(){return m})),r.d(t,"push",(function(){return h})),r.d(t,"set",(function(){return v})),r.d(t,"shift",(function(){return g})),r.d(t,"splice",(function(){return O})),r.d(t,"toggle",(function(){return _})),r.d(t,"unset",(function(){return w})),r.d(t,"unshift",(function(){return T}));var n=r(6),o=r(94),a=r(58),i=r(2);function u(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?t[t.length-1]:null,o=t.length>1?t.slice(0,-1):t;function c(e){var t=e.path,r=e.props,c=e.resolve;if(o.length>0&&!(o[0]instanceof a.Tag))throw new Error("Cerebral factory.when: You have to use the STATE, MODULESTATE or PROPS tag as values, see: "+l);if(!t||!t.true||!t.false)throw new Error("Cerebral factory.when: true/false paths need to be provided, see: http://cerebraljs.com/docs/api/factories.html#when");var s=o.map((function(e){var t=c.value(e);return Object(i.t)(t)?t.getValue(r):t}));return Boolean(n?n.apply(void 0,u(s)):s[0])?t.true():t.false()}return c.displayName="factory.when("+t.filter((function(e){return"function"!=typeof e})).map((function(e){return String(e)})).join(",")+")",c};var s=function(e){function t(t){var r=t.path,n=t.resolve;if(!n.isTag(e,"state","props","moduleState"))throw new Error("Cerebral factory.equals: You have to use the STATE, PROPS or MODULESTATE tag as first argument");var o=n.value(e);return r[o]?r[o]():r.otherwise()}return t.displayName="factory.equals("+String(e)+")",t},f=function(e,t){function r(r){if(!r.resolve.isTag(e,"state","moduleState"))throw new Error("Cerebral factory.concat: You have to use the STATE or MODULESTATE tag as first argument");r.store.concat(e,t)}return r.displayName="factory.concat("+String(e)+", "+String(t)+")",r},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;function r(r){var n=r.store,o=(r.module,r.props),a=r.resolve;if(!a.isTag(e,"state","props","moduleState"))throw new Error("Cerebral factory.increment: You have to use the STATE, MODULESTATE or PROPS tag as first argument");var i=a.value(t);if(!Number.isInteger(i))throw new Error("Cerebral factory.increment: You must increment by integer values");if("state"!==e.type&&"moduleState"!==e.type){var u=Object.assign({},o),l=a.path(e).split("."),c=l.pop(),s=l.reduce((function(e,t){return e[t]=Object.assign({},e[t]||{})}),u);if(!Number.isInteger(s[c]))throw new Error("Cerebral factory.increment: You must increment integer values");return s[c]+=i,u}n.increment(e,i)}return r.displayName="factory.increment("+String(e)+", "+String(t)+")",r};function p(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?t-1:0),n=1;n1?t-1:0),n=1;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r-1:!!s&&n(e,t,r)>-1}},function(e,t,r){var n=r(20).Symbol;e.exports=n},function(e,t,r){var n=r(48),o=r(28),a=r(64),i=r(15);e.exports=function(e,t,r){if(!i(r))return!1;var u=typeof t;return!!("number"==u?o(r)&&a(t,r.length):"string"==u&&t in r)&&n(r[t],e)}},function(e,t,r){var n=r(118);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},function(e,t){e.exports=function(e){return null==e}},function(e,t,r){var n=r(251),o=r(50),a=r(79),i=o((function(e,t){return a(e)?n(e,t):[]}));e.exports=i},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=b(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=a?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}o.default=e,r&&r.set(e,o);return o}(r(0)),a=h(r(1)),i=h(r(593)),u=h(r(32)),l=h(r(19)),c=h(r(108)),s=h(r(41)),f=h(r(23)),d=h(r(17)),p=h(r(56)),y=r(594),m=h(r(344));function h(e){return e&&e.__esModule?e:{default:e}}function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(b=function(e){return e?r:t})(e)}function v(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r-1&&e%1==0&&e=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;ru)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=y,l=m,o=d;var b=(1e4*(268435455&(y+=122192928e5))+m)%4294967296;s[c++]=b>>>24&255,s[c++]=b>>>16&255,s[c++]=b>>>8&255,s[c++]=255&b;var v=y/4294967296*1e4&268435455;s[c++]=v>>>8&255,s[c++]=255&v,s[c++]=v>>>24&15|16,s[c++]=v>>>16&255,s[c++]=d>>>8|128,s[c++]=255&d;for(var g=0;g<6;++g)s[c+g]=f[g];return t||Object(i.a)(s)};var s=function(e,t,r){var n=function(e,n,o,a){var u=o&&a||0;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=new Array(e.length),r=0;r>16)+(t>>16)+(r>>16)<<16|65535&r}function d(e,t,r,n,o,a){return f((i=f(f(t,e),f(n,a)))<<(u=o)|i>>>32-u,r);var i,u}function p(e,t,r,n,o,a,i){return d(t&r|~t&n,e,t,o,a,i)}function y(e,t,r,n,o,a,i){return d(t&n|r&~n,e,t,o,a,i)}function m(e,t,r,n,o,a,i){return d(t^r^n,e,t,o,a,i)}function h(e,t,r,n,o,a,i){return d(r^(t|~n),e,t,o,a,i)}var b=s("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Array(t.length);for(var r=0;r>5]>>>t%32&255,n=parseInt(i.charAt(r>>>4&15)+i.charAt(15&r),16),o.push(n);return o}(function(e,t){var r,n,o,a,i;e[t>>5]|=128<>>9<<4)]=t;var u=1732584193,l=-271733879,c=-1732584194,s=271733878;for(r=0;r>2)-1]=void 0,t=0;t>5]|=(255&e[t/8])<>>32-t}var _=s("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=new Array(n.length);for(var o=0;o>>0;m=y,y=p,p=O(d,30)>>>0,d=f,f=b}r[0]=r[0]+f>>>0,r[1]=r[1]+d>>>0,r[2]=r[2]+p>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+m>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}))},function(e,t,r){"use strict";var n=r(114),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},o=r.wrap,a=void 0===o||o,u=r.ignoreDefinition,l=void 0!==u&&u;i(this,e),this.definition=t,"function"!=typeof t&&(l||this.verifyDefinition(t),this.wrap=a,this.ProviderConstructor=function(e){this.context=e},this.ProviderConstructor.prototype=t,this.WrappedProviderConstructor=function(e,t){this.context=t,this.providerName=e},this.WrappedProviderConstructor.prototype=Object.keys(l?{}:t).reduce((function(e,r){var o=t[r];return e[r]=function(){for(var e=this,t=arguments.length,a=Array(t),i=0;i-1&&e%1==0&&e<=9007199254740991}},function(e,t,r){(function(e){var n=r(116),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,u=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=u}).call(this,r(86)(e))},function(e,t,r){var n=r(61),o=r(220),a=r(221),i=r(222),u=r(223),l=r(224);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=u,c.prototype.set=l,e.exports=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openPrompt=t.closePrompt=void 0;var n,o,a=r(3),i=r(35),u=r(230);function l(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}t.openPrompt=function(e){var t=e.type,r=e.title,o=void 0===r?"":r,i=e.content,c=void 0===i?"":i,s=e.requireAction,f=void 0!==s&&s,d=e.payload,p=void 0===d?{}:d;return function(e){var r=e.resolve;return e.store.push((0,a.state)(n||(n=l(["prompts.prompts"]))),{type:(0,u.resolveTag)(t,r),title:(0,u.resolveTag)(o,r),content:(0,u.resolveTag)(c,r),requireAction:f,payload:(0,u.resolveTag)(p,r,!0)})}};t.closePrompt=function(){return(0,i.pop)((0,a.state)(o||(o=l(["prompts.prompts"]))))}},function(e,t,r){var n=r(54),o=r(48),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var i=e[t];a.call(e,t)&&o(i,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){var n=r(142)(Object.getPrototypeOf,Object);e.exports=n},function(e,t,r){var n=r(15),o=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},function(e,t,r){var n=r(147),o=r(442);e.exports=function e(t,r,a,i,u){var l=-1,c=t.length;for(a||(a=o),u||(u=[]);++l0&&a(s)?r>1?e(s,r-1,a,i,u):n(u,s):i||(u[u.length]=s)}return u}},function(e,t){e.exports=function(e){return e&&e.length?e[0]:void 0}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=a?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}o.default=e,r&&r.set(e,o);return o}(r(0)),a=u(r(1)),i=u(r(267));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;to?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++ne){var c=r((0,y.state)(o||(o=g(["history.currentPoint"])))),s=l.length-e;u.set((0,y.state)(a||(a=g(["history.points"]))),l.slice(-e)),u.set((0,y.state)(i||(i=g(["history.currentPoint"]))),Math.max(0,c-s))}}},_=function(e,t){return function(r){var n=r.get,o=r.store,a=(0,b.createHistoryPoint)(e,n((0,y.state)(u||(u=g(["templates.templates"])))),n((0,y.state)(l||(l=g(["templates.defaultTemplate"])))),n((0,y.state)(c||(c=g(["templates.templateIdMap.live"]))))),i=n((0,y.state)(s||(s=g(["history.points"])))).slice(0,n((0,y.state)(f||(f=g(["history.currentPoint"]))))+1),v=(0,h.default)(i);(0,m.default)(v)||a.time-v.time>t?i.push(a):i[i.length-1]=a,o.set((0,y.state)(d||(d=g(["history.points"]))),i),o.set((0,y.state)(p||(p=g(["history.currentPoint"]))),i.length-1)}};t.addHistoryPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(r){_(e,t)(r),O(200)(r)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateCloudPure=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return I(e,t)},t.createMissingTermPure=M,t.doApiRequest=A,t.fetchTimeoutHandler=void 0,t.hasCloudPermission=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];return!includes(t,e)},t.removeTokens=function(){return new Promise((function(e){h.default.ajax({type:"POST",url:et_cloud_data.ajaxurl,dataType:"json",data:{action:"et_cloud_remove_tokens",et_cloud_token_nonce:et_cloud_data.nonces.et_cloud_remove_token}})}))},t.resourceToEndpointMapping=C,t.retrieveCloudData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"layouts",r=e.isUserItems?"userItems":"predefined",n=e.pageNo,o=e.perPage,a=e.token,i=(0,s.default)(e,"orderBy","date"),u=(0,s.default)(e,"providedUrl",null),l=(0,s.default)(e,"providedBaseUrl",""),c=(0,s.default)(e,"editPermission",!1),f={providedUrl:u,providedBaseUrl:l,editPermission:c};switch(e.type){case"categoriesList":return P("categories",r,n,o,a,f);case"tagsList":return P("tags",r,n,o,a,f);case"packsList":return P("packs",r,n,o,a);case"itemsList":var d="predefined"===r||"layout"===t?"layouts":t;return j(r,d,n,o,i,a,f)}return new Promise((function(e){return e()}))},t.saveToCloudPure=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;return I().then((function(u){var l=(0,s.default)(u,"accessToken","");if(""===l)return n&&n({error:"auth_error"}),new Promise((function(e){return e({error:"auth_error"})}));var c=(0,s.default)(u,"sharedFolders",[]),d=(0,f.default)(c,["id",i]);return d&&!a&&(a="".concat(d.endpoint,"/cloud/v1")),S(l,e,t,r,n,o,a)})).catch((function(e){return n&&n({error:e}),{error:e}}))},t.saveToCloudWithToken=S,t.splitLibraryItem=function(e,t){var r=et_cloud_data,n=r.ajaxurl,o=r.nonces;return new Promise((function(r){h.default.ajax({type:"POST",url:n,dataType:"json",data:w(w({id:e},t),{},{action:"et_builder_split_library_item",et_cloud_nonce:o.et_builder_split_library_item}),success:function(e){r(e.data)}})}))},t.updateTokens=I;var n=O(r(55)),o=O(r(23)),a=O(r(29)),i=O(r(17)),u=O(r(27)),l=O(r(88)),c=O(r(12)),s=O(r(5)),f=O(r(89)),d=O(r(19)),p=O(r(511)),y=O(r(305)),m=O(r(253)),h=O(r(11)),b=r(167),v=r(337),g=r(168);function O(e){return e&&e.__esModule?e:{default:e}}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"user",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("predefined"===e)return et_cloud_data.predefined_items_url;var r=(0,b.parseJWT)(t),n="invalid-token"===r?"":(0,s.default)(r,["aud",[1]],"");return"".concat(n,"/wp-json/cloud/v1")}function P(e,t,r,o,a,i){var u={},l=(0,s.default)(i,"providedUrl",null),f=(0,s.default)(i,"providedBaseUrl","");return A({type:"get",resource:e,queryString:"per_page=".concat(o,"&page=").concat(r,"&orderby=id"),source:t,accessToken:a,providedUrl:l,providedBaseUrl:f}).then((function(e){var t=e.data,r=t;return(0,n.default)(t)&&(r=e),(0,c.default)(r)||r.error||(0,d.default)(r,(function(e){var t=e.id;u[t]={},u[t].id=t,u[t].name=e.name,u[t].slug=e.slug,u[t].count=e.count,u[t].location="cloud"})),{data:u}}))}function j(e,t,r,n,o,a){var i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},u=[],l=(0,s.default)(i,"editPermission",!1),f="predefined"!==e&&l?"&status=publish,trash":"",y=(0,s.default)(i,"providedUrl",null),b=(0,s.default)(i,"providedBaseUrl",""),v="date",g="asc";switch(o){case"name":v="name";break;case"dateDesc":g="desc"}return A({type:"get",resource:t,queryString:"per_page=".concat(n,"&page=").concat(r).concat(f,"&orderBy=").concat(v,"&order=").concat(g),includeHeaders:!0,source:e,accessToken:a,providedUrl:y,providedBaseUrl:b}).then((function(t){return t.error?t:((0,d.default)(t.body,(function(t){if(t.id){var r={};if(r.id=t.id,r.date=t.date,r.name=(0,h.default)("