Web.define("Web.Extension.ExternalBasket.Controller.ExternalBasket",{extend:"Web.Core.Controller",modal:null,featureEvents:{"Web.Extension.ExternalBasket.Feature.Button":"Web.Extension.ExternalBasket.Event.Button.Initialize","Web.Extension.ExternalBasket.Feature.Modal":"Web.Extension.ExternalBasket.Event.Modal.Initialize"},listeners:{"Web.Extension.ExternalBasket.Event.Button.Initialize":function(n,t){Web.create("Web.Extension.ExternalBasket.View.Button",{controller:this,feature:n,el:t})},"Web.Extension.ExternalBasket.Event.Modal.Initialize":function(n,t){if(this.modal){console.warn("An external basket modal was already initalized. Consider removing the duplicate feature to prevent this message.");return}this.modal=Web.create("Web.Extension.ExternalBasket.View.Modal",{controller:this,feature:n,el:t})}},getBasket:function(n){Web.Core.Server.get({url:"{$baseFolder}/{$language}/ExternalBasket/Basket",success:function(t){n(t)}})},getModal:function(){return this.modal}});Web.define("Web.Extension.ExternalBasket.View.Button",{extend:"Web.Core.View",events:{'click [data-id="Button"]':"onClick"},initialize:function(n){this.controller=n.controller},onClick:function(){var t=this,n=t.controller.getModal();n&&(n.isLoaded?n.show():(n.show(),t.controller.getBasket(function(t){n.setContent(t)})))}});Web.define("Web.Extension.ExternalBasket.View.Modal",{extend:"Web.Core.View",isLoaded:!1,initialize:function(n){this.controller=n.controller;this.$el.on("shown.bs.modal",_.bind(this.onModalShown,this))},onModalShown:function(){this.isLoaded||this.mask()},show:function(){this.$el.modal("show")},setContent:function(n){this.isLoaded=!0;this.getId("Body").html(n)},mask:function(){this.getId("Body").mask("")},unmask:function(){this.getId("Body").unmask()}})