(()=>{var i=window,t=i.tinymce,o=i.VPTinyMCEData;if(void 0!==o&&o.layouts.length){var l=[{text:"",value:""}];Object.keys(o.layouts).forEach(function(i){l.push({text:o.layouts[i].title,value:o.layouts[i].id})}),t.create("tinymce.plugins.visual_portfolio",{init:function(i){i.addButton("visual_portfolio",{type:"listbox",title:o.plugin_name,icon:"visual-portfolio",classes:"visual-portfolio-btn",onclick:function(){this.menu&&this.menu.$el.find(".mce-first").hide()},onselect:function(){this.value()&&i.insertContent('[visual_portfolio id="'.concat(this.value(),'"]')),this.value("")},values:l,value:""})}}),t.PluginManager.add("visual_portfolio",t.plugins.visual_portfolio)}})();