File: /home/b/o/h/bohousj/www/wp-content/plugins/happy-elementor-addons-pro/assets/admin/js/marvin.min.js
"use strict";!function(){function o(e,t){if(e=e,!(null!=(t=t)&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}var n,r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=((n=jQuery)(window).on("elementor/frontend/init",function(){var e,t,o;window.elementor&&(e=elementor.hooks.addFilter,t=r?new d(marvin.storageKey,"https://happymonster.dev/storage/safari.php",n):new p(marvin.storageKey),o=new u(t),e("elements/widget/contextMenuGroups",function(e,t){return s.prepare(e,t,o)}),e("elements/section/contextMenuGroups",function(e,t){return s.prepare(e,t,o,!1)}),e("elements/column/contextMenuGroups",function(e,t){return s.prepare(e,t,o,!0)}),e("element/view",function(t,e,n){var i;return"column"===e.get("elType")?t.extend({initialize:function(){t.prototype.initialize.apply(this,arguments),i=this},emptyView:t.prototype.emptyView.extend({getContextMenuGroups:function(){var e=t.prototype.emptyView.prototype.getContextMenuGroups.apply(this,arguments);return s.prepareForBlankColumn(e,i,o)}})}):t}))}),function(){function e(){o(this,e)}return a(e,null,[{key:"prepare",value:function(e,t,n,i){return e.push({name:"x-domain",actions:[{name:"x-copy",title:"X Copy",shortcut:'<i class="hm hm-happyaddons"></i>',callback:function(){var e=new l(t.model.get("widgetType"),t.model.toJSON({copyHtmlCache:!0}));n.copy(e)}},{name:"x-paste",title:"X Paste",shortcut:'<i class="hm hm-happyaddons"></i>',callback:function(){n.paste(t,i)}},{name:"live-paste",title:"Live Paste",shortcut:'<i class="hm hm-happyaddons"></i>',callback:function(){n.paste(t,i)}}]}),e}},{key:"prepareForBlankColumn",value:function(e,t,n){return e[0].actions.push({name:"x-paste",title:"X Paste",shortcut:'<i class="hm hm-happyaddons"></i>',callback:function(){n.paste(t,!0)},isEnabled:function(){return!0}}),e[0].actions.push({name:"live-paste",title:"Live Paste",shortcut:'<i class="hm hm-happyaddons"></i>',callback:function(){n.paste(t,!0)},isEnabled:function(){return!0}}),e[0].actions.push({name:"x-insert",title:"Insert Blank Section",shortcut:'<i class="hm hm-happyaddons"></i>',callback:function(){c.insert(t)},isEnabled:function(){return!0}}),e}}]),e}()),c=function(){function e(){o(this,e)}return a(e,null,[{key:"insert",value:function(e){elementor.channels.data.trigger("element:before:add",{elType:"section"}),e.addChildElement({id:elementorCommon&&elementorCommon.helpers&&elementor.helpers.CommongetUniqueId||elementor.helpers.getUniqueID,elType:"section",settings:{},elements:[]},{edit:!0}),elementor.channels.data.trigger("element:after:add")}}]),e}(),l=function(){function n(e,t){o(this,n),this.widgetType=e,this.widgetCode=t}return a(n,[{key:"getWidgetType",value:function(){return this.widgetType}},{key:"getWidgetCode",value:function(){return this.widgetCode}},{key:"toJSON",value:function(){return{widgetType:this.widgetType,widgetCode:this.widgetCode}}}]),n}(),u=function(){function t(e){o(this,t),this.widgetStorage=e}return a(t,[{key:"copy",value:function(e){this.widgetStorage.save(e)}},{key:"paste",value:function(o,a){this.widgetStorage.fetch(function(e){var t,n,i=JSON.stringify(e.getWidgetCode()).replace('.png","id":','.png","id":xLock').replace('.jpg","id":','.jpg","id":xLock').replace('.gif","id":','.gif","id":xLock').replace('.jpeg","id":','.jpeg","id":xLock').replace('.svg","id":','.svg","id":xLock').replace(/xLock([\d]+)/g,'"x$1"');o.startTransport("copy"),elementorFrontend.storage.set("transfer",{type:"copy",elementsType:e.getWidgetType(),elements:[JSON.parse(i)]}),a?(t=o,e=elementorFrontend.storage.get("transfer").elements,n=0,e.forEach(function(e){t.addChildElement(e,{at:n,clone:!0}),n++})):o.trigger("request:paste")})}}]),t}(),p=function(){function t(e){o(this,t),this.storageKey=e,xdLocalStorage.init({iframeUrl:"https://happyaddons.com/marvin/index.html",initCallback:function(){}})}return a(t,[{key:"save",value:function(e){xdLocalStorage.setItem(this.storageKey,JSON.stringify(e))}},{key:"fetch",value:function(t){return xdLocalStorage.getItem(this.storageKey,function(e){e=JSON.parse(e.value),e=new l(e.widgetType,e.widgetCode);t(e)})}}]),t}(),d=function(){function i(e,t,n){o(this,i),this.storageKey=e,this.storageEndpoint=t,this.$=n}return a(i,[{key:"save",value:function(e){this.$.post(this.storageEndpoint,{key:this.storageKey,data:JSON.stringify(e)})}},{key:"fetch",value:function(t){this.$.get(this.storageEndpoint,{key:this.storageKey},function(e){e=JSON.parse(e),e=new l(e.widgetType,e.widgetCode);t(e)})}}]),i}();window.HWidgetStorage=p,window.HSWidgetStorage=d,window.HClipBoard=u,window.HWidget=l}();