(function(){"use strict";var t=['<div>{{FilterSetSelector({ filterSets: filterSets, filterSet: filterSet, bindings: "_filterSet<==@value" })}}</div>','<div class="u8-buttons dock-bottom">','{{Button({ textId:"TXT_button_text_9", command:"Apply" })}}&nbsp;','{{Button({ textId: "TXT_button_text_0", command:"Cancel" })}}',"</div>"].join("");u8.Crm.Widgets.VisitPlanningSettingsPopup=function(t,i){$.extend(this,u8.Crm.Widgets.VisitPlanningSettingsPopup.defaults,i);this.WidgetContainer();this.element=t;this.bind()};u8.Crm.Widgets.VisitPlanningSettingsPopup.defaults={popup:{title:"TXT_button_text_22",sizing:"fit",allowResize:false,autoShow:false,position:"center-top",showArrow:true,allowMaximize:false}};u8.Crm.Widgets.VisitPlanningSettingsPopup.makeClass({name:"VisitPlanningSettingsPopup",deriveFrom:u8.Base.Widgets.WidgetContainer,events:["Close"]});$.extend(u8.Crm.Widgets.VisitPlanningSettingsPopup.prototype,{open:function(){Function.chain(this._using,this._openPopup,this._createView).call(this)},dispose:function(){if(this._isDisposed){return}this.unbind();this.WidgetContainer_dispose()},_openPopup:function(t){var i=$.extend({},this.popup,{alignTo:this.element,parent:this,onCreate:t,onClose:this._onPopupClose.bind(this)});this._popup=new u8.Base.Widgets.Popup("<div></div>",i);this._popup.open()},_createView:function(){var i=this._popup;var e=this.model;var n=i.getContent();n.addClass("u8-visitplanningsettingspopup u8-padding-l");n.utml({template:t,itemOptions:{parent:i,context:this},data:{filterSets:e.customerFilterSets,filterSet:e.customerFilterSet}},function(){u8.tools.ready(i.children,function(){i.autoSizeAndPosition().show()})})},_using:function(t){u8.using({texts:["button_text"]},t)},_apply:function(){if(this._filterSet){this.model.setCustomerFilterSet(this._filterSet)}return true},_onPopupClose:function(t,i){this.raise("Close",i);this.dispose()},"Command.Apply":function(){if(this._apply()){this._popup.close()}},"Command.Cancel":function(){this._popup.close({cancel:true})}})})();