").text(a.buttonText);a.$button=$("");a.$button.append(b);a.$container.append(a.$button)}if(a.$button){var e=
$("");a.mulitple&&e.attr("multiple","multiple");d.library.utils.IsNotNullUndefined(a.FileTypes)&&0Drop files here to upload
"),a.$container.append(a.$dropZone));b={pasteZone:null,
dropZone:a.$dropZone,url:d.library.service.CreateUrl(a.Url,!0),done:function(b,e){var g=e.files[0].name;if("string"===typeof e.result){var k=JSON.parse(e.result);k&&k.success&&k.success?(d.ui.ShowSuccessMessage(g,"File Uploaded"),a.Complete(g,k.detail)):c(g,k.message,a)}else{var k=$(e.result[0].body),p=k.find(".ui-exception-detail");p.isFound()?c(g,p.text(),a):(k=JSON.parse(k.html()))&&k.success&&k.success?(d.ui.ShowSuccessMessage(g,"File Uploaded"),a.Complete(g,k.detail)):c(g,k.message,a)}},fail:function(b,
e){d.error.ProcessHTTPStatusError(e.jqXHR,e.textStatus);a.Fail(e.files[0].name)},send:function(a,b){d.ui.ShowLoading(!0,"Uploading - "+b.files[0].name)},stop:function(a){d.ui.ShowLoading(!1)},progress:function(a,b){var e=b.files[0].name,c=100*(b.loaded/b.total);99<=c?d.ui.ShowLoading(!0,"Processing - "+e):d.ui.ShowLoading(!0,"Uploading - "+e,!1,c)},processfail:function(a,b){alert(b.files[b.index].error)},formData:a.ExtraData,fileInput:e,maxFileSize:h,messages:{maxFileSize:"File is too large. Maximum file size is "+
Math.floor(h/1048576)+" MB"}};a.mulitple||(b.maxNumberOfFiles=1);if(a.FileTypes&&0=a.x||0>=a.y)m.hide(),m=$()});document.AddJSEvent("dragover",function(a){a.preventDefault()});$(document).on("drop",function(a){m.hide();m=$();a.preventDefault()})}};f.ToggleDragAndDrop=
function(a,b){var e=a.find(".ui-file-upload-drop-area");b?e.removeClass("ui-upload-disabled"):e.addClass("ui-upload-disabled")};f.InitEmailUploadAttachment=function(b,e){var d={Url:"/attachment/UploadEmailAttachment",mulitple:!0,buttonText:"Upload a file",$container:$("#"+b),Complete:e,Fail:function(a){},ExtraData:function(){var a=[];a.push({name:"reference",value:b});return a}};a(d)};f.InitEntryPhotoUploadFunctions=function(b){var c=MVC.ModelJS.GetJSEntryQuickInformationModel(b),g=b.find(".ui-person"),
k=b.find(".ui-imagedelete"),f=b.find(".ui-imageupload"),h=b.find("#"+c.ImageUploadModelPopupContainerID);b={Url:"/attachment/UpdateEntryImage",mulitple:!1,buttonText:"Upload a file",$container:b.find("#"+c.ImageUploadModelID),Complete:function(){e(g);h.hide();k.removeClass("hidden")},Fail:function(a){},ExtraData:function(){var a=[];a.push({name:"ID",value:c.EntryID.toString()});return a},FileTypes:p()};k.SRClick(function(){d.ui.ShowQuestion("Are you sure you want to remove the current image?","Remove Image",
void 0).done(function(a){a&&(new MVC.Attachment.RemoveEntryImage(c.EntryID)).Request().done(function(a){e(g);k.addClass("hidden")})})});f.SRClick(function(){h.show()});a(b)};f.InitVisitorPhotoUploadFunctions=function(c){var g=MVC.ModelJS.GetJSVisitorModel(c),k=c.find(".ui-person"),f=c.find(".ui-imagedelete"),h=c.find(".ui-imageupload"),m=c.find("#"+g.ImageUploadModelPopupContainerID),g={Url:"/attachment/SaveTemporaryVisitorImage",mulitple:!1,buttonText:"Upload a file",$container:c.find("#"+g.ImageUploadModelID),
Complete:function(a,b){var d=parseInt(b);0>d?(c.GetControl("ProfilePictureStatus").SRVal(l.PictureRemoved),c.GetControl("TemporaryProfilePictureRecordAttachmentID").SRVal(-1),k.data("id","-1"),k.data("dbobjectname","visitor")):(c.GetControl("ProfilePictureStatus").SRVal(l.PictureAdded),c.GetControl("TemporaryProfilePictureRecordAttachmentID").SRVal(d),k.data("id",d),k.data("dbobjectname","recordattachment"));e(k);m.hide();f.removeClass("hidden")},Fail:function(a){},ExtraData:function(){var a=c.GetControl("TemporaryProfilePictureRecordAttachmentID").SRVal(),
b=[];b.push({name:"ID",value:a.toString()});return b},FileTypes:p()};f.SRClick(function(){d.ui.ShowQuestion("Are you sure you want to remove the current image?","Remove Image",void 0).done(function(a){a&&(b(c),c.GetControl("ProfilePictureStatus").SRVal(l.PictureRemoved),c.GetControl("TemporaryProfilePictureRecordAttachmentID").SRVal(-1),k.data("id","-1"),k.data("dbobjectname","visitor"),e(k),f.addClass("hidden"))})});h.SRClick(function(){m.show()});a(g)};f.DeleteTemporaryVisitorImage=b;f.InitAttachmentDownloadFunctions=
function(a){var b=MVC.ModelJS.GetJSAttachmentModel(a);a.GetElement("DownloadAttachment").SRClick(function(a){a=$(a.currentTarget).SRAttr().id;(new MVC.Attachment.Download(b.TableName,b.ID,a)).Download()})};f.InitAttachmentUploadFunctions=function(b){var e=MVC.ModelJS.GetJSAddAttachmentModel(b),c={Url:"/attachment/UploadAttachment",mulitple:!0,buttonText:"Upload a file",$container:$("#"+e.ImageUploadID),Complete:function(){d.popup.Close(b);d.FireEvent("File-Uploaded",e.TableName,e.ID)},Fail:function(a){},
ExtraData:function(){var a=[];a.push({name:"tableName",value:e.TableName});a.push({name:"ID",value:e.ID.toString()});return a}};a(c)};f.InitUploadTemporaryAttachment=function(b,e,c,g){var k=$("#"+e);b={Url:"/attachment/UploadTemporaryAttachment",mulitple:!1,$dropZone:b,$container:k,Complete:function(a){g&&g(a)},Fail:function(a){},ExtraData:function(){var a=[];a.push({name:"Reference",value:e});return a}};c&&(b.$button=c);c=k.closest("span").data("filetypes");d.library.utils.IsNotNullUndefined(c)&&
""!==c&&(b.FileTypes=c.split(","));a(b)};f.InitRecordAttachmentImageUpload=function(b,e,d,c){var g=$("#"+d);if(!g.isFound())throw"Cound not find the image upload container: #"+d;var k=new MVC.Attachment.UpdateRecordAttachmentItemImage(b,e);b={Url:k.GetURL(),mulitple:!1,buttonText:"Upload an image",$container:g,Complete:function(){c()},Fail:function(a){},ExtraData:function(){var a=[];$.each(k.CallData(),function(b,e){a.push({name:b,value:e.toString()})});return a},FileTypes:p()};a(b)};f.InitUploadPopup=
function(a){var b=MVC.ModelJS.GetJSFileUploadModel(a);a=d.popup.GetPopupContainerAreas(a).$footer.find(".ui-btn-cancel-fileupload");var e=$("#"+b.HtmlID);a.SRClick(function(){e.hide()})};f.GetUniqueUploadID=k;f.InitTemporaryAttachment=function(a){var b=a.closest("li"),e=b.isFound()?b:a,c=k(e);a=e.find(".ui-file-upload-drop-area");var b=e.find(".ui-btn-upload-file"),g=e.find(".ui-document-path-container"),p=g.find(".ui-document-path"),f=e.GetControl("ValidationControl"),h=d.savablescreen.CurrentCancelableManager();
d.upload.InitUploadTemporaryAttachment(a,c,b,function(a){f.isFound()&&f.SRVal(a);p.isFound()&&(p.text(a),d.library.controls.FlagChanged(g));e.trigger("fileuploaded",{FileName:a})});d.library.utils.IsNotNullUndefined(h)&&(h.ExternalCancel=d.utils.CreateSimplePromiseMethod(function(){(new MVC.Attachment.RemoveTemporaryAttachments(c,d.error.CreateSilentErrorObject())).Request({ShowLoading:!1})}))};f.SetBackgroundImage=e;f.MakeImageURL=g;f.SupportedImageFileTypes=p})(d.upload||(d.upload={}))})(starrez||
(starrez={}));
(function(d){(function(f){function c(a){a?h.SRAddClass("show-global-loading"):h.SRRemoveClass("show-global-loading")}function a(){var a=m.SRVal();d.library.utils.IsNullOrUndefined(a)||""===a||(h.SRLoading(!0),d.starcare.IsInitiated()&&(n=d.starcare.LoadModuleHelp("Global","Search")),(new MVC.GlobalSearch.SearchStarRez(a)).Request().done(function(a){h.SRLoading(!1);l.html(a);d.library.utils.BatchUpdateUI(function(){l.find(".ui-display-summary:first").click()});l.find(".ui-result-link").SRClick(function(a){d.library.utils.SafeStopPropagation(a);var b=
l.find(".ui-display-summary.ui-selected");a=b.data("recordid");b=b.data("dbobjectname");"StandardReportsV2"===b?d.standardreport.v2.ShowReport(a):d.sm.ShowScreen(void 0,b,a);c(!1)});l.find(".ui-close-search").SRClick(function(a){b(!0)});e=!0}))}function b(a){void 0===a&&(a=!1);if(""===m.SRVal()||a)g.SRRemoveClass("active"),m.SRVal(""),e=!1,l.empty(),d.starcare.IsInitiated()&&d.library.utils.IsNotNullUndefined(n)&&n();c(!1)}function k(){if(""!==m.SRVal())return c(!0),a(),!0;c(!1);return!1}var e=!1,
g,p,h,l,m,n=function(){};f.InitGlobalSearch=function(){g=$("#global-search-area");g.isFound()&&(p=$("#global-search-button"),h=$("#global-search-container"),l=$("#search-results"),m=g.GetControl("SearchString"),h.SRClick(function(a){d.library.utils.SafeStopPropagation(a)}),l.on("click.search-result-items",".ui-display-summary",function(a){d.library.utils.SafeStopPropagation(a);var b=$(a.currentTarget);h.UnSelectRows();b.SelectRow();var e=b.data("recordid");a=b.data("dbobjectname");var c=b.data("foundin").toString(),
g=b.data("buttoncaption").toString();h.find(".ui-search-result").SRLoading(!0);b=new MVC.Entry.SummaryView(e);b.Area=MVC.GetControllerArea(a);b.Controller=a;b.Request().done(function(a){h.find(".ui-summary-view").html(a);h.find(".ui-found-in").empty();$.each(c.split(","),function(a,b){h.find(".ui-found-in").append(""+b+"")});h.find(".ui-result-link").SRText(g);d.scroll.BindScroll(h.find(".ui-search-result"),function(a){d.scroll.StickToBottom(h.find("footer"),a)});h.find(".ui-search-result").SRLoading(!1)})}),
m.click(function(a){d.library.utils.SafeStopPropagation(a)}).focusin(function(a){g.SRAddClass("active");""!==m.SRVal()&&e&&c(!0)}).focusout(function(a){""===m.SRVal()&&!e&&b()}).keyup(function(a){d.keyboard.RunOnEnter(a,function(){k()});a.keyCode===d.keyboard.EscapeCode&&b(!0);a.keyCode===d.keyboard.Keys.ArrowDown&&(d.keyboard.InitListKeyboardEvents(l,"ui-display-summary",d.keyboard.ListDirection.Vertical,{onEnterOpen:function(){l.find(".ui-result-link").click()},onSpaceSelect:function(a){a.click()}}),
l.find(".ui-display-summary:first()").SRFocus())}),p.SRClick(function(a){d.library.utils.SafeStopPropagation(a);k()}),d.keyboard.AttachGlobalShortCutKey("globalsearch",d.keyboard.Keys.QuestionForwardSlash,!1,!1,!1,function(){m.SRFocus()}),$(document).on("click.globalsearchoff",function(a){g.hasClass("ui-active")&&(d.library.utils.SafeStopPropagation(a),b())}),$(document).on("click.globalsearch",".ui-globalsearch",function(b){d.library.utils.SafeStopPropagation(b);a()}))}})(d.globalsearch||(d.globalsearch=
{}))})(starrez||(starrez={}));
(function(d){(function(f){var c=function(){function a(){this.dataHasChanged=this.currentlyHasFocus=!1}a.prototype.LostFocus=function(){d.utils.CloseAllOverlays();this.currentlyHasFocus=!1};a.prototype.GotFocus=function(){this.currentlyHasFocus=!0;this.dataHasChanged&&(this.pagableGraph.RefreshKeepingPosition(),this.dataHasChanged=!1)};a.prototype.ResizeEvent=function(){};a.prototype.GlobalEvent=function(a,c){d.library.stringhelper.Equals(a,"Save.Complete",!0)?d.sm.GetScreenManager().IsDetailScreenShown()?this.pagableGraph.GridRequiresRefresh():
this.pagableGraph.RefreshKeepingPosition():!this.pagableGraph.IsBusy&&this.currentlyHasFocus&&d.library.stringhelper.Equals(a,"Wizard.Complete.AllEventsFired",!0)?this.pagableGraph.RefreshKeepingPosition():this.currentlyHasFocus||(this.dataHasChanged=!0)};return a}();f.GraphManagerBase=c})(d.graphmodule||(d.graphmodule={}))})(starrez||(starrez={}));
(function(d){(function(f){var c=function(){function a(a){this.$container=a;this.RowCount=0;this.$table=a.find("table");this.Init()}a.prototype.Init=function(){this.$tbody=this.$table.find("tbody");this.$rows=this.$tbody.find("tr");this.RowCount=this.$rows.length};a.prototype.HasData=function(){for(var a=this.GetTableData(),d=0;d"+c+"")),l=!0)});l?(d++,a.options.onItemFound(m),m.show()):m.hide()}),$.each(this.options.$listContainer.find(this.options.itemsGroupSelector),function(e,d){var c=$(d);c.find(a.options.searchableItemsSelector).is(":visible")?c.show():c.hide()}));this.options.onSearchComplete(c,d,e)};return a}();f.ListSearch=c})(d.listsearcher||(d.listsearcher={}))})(starrez||(starrez={}));
(function(d){(function(f){function c(a){var b=void 0,b=a.$list.data(),b={ID:Number(b.id),TableName:b.functiontable,GroupName:b.functiongroup,FunctionKeysCsv:b.functionkeys};(new MVC.Controls.GetFunctionsMenu(b.TableName,b.GroupName,b.ID,b.FunctionKeysCsv)).Request({ShowLoading:!1}).done(function(b){$.toHTML(b).insertAfter(a.$list);d.library.ui.PositionMe(a.$dropdown,{my:"right top",at:"right bottom",of:a.$button,AddOverlayTag:!1})})}$(function(){$(document).on("listview-load-required.global-load-on-demand",
function(a,b){c(b)})});f.ListClick=function(a,b){a.find(".ui-image-button-list-item[data-clickevent='true']").SRClick(function(d){d=$(d.currentTarget);a.UnSelectRows();d.parent().SelectRow();b(d,d.data())})};f.SelectFirstItem=function(a){a.find(".ui-image-button-list-item:not(.ignore):first").click()};f.SelectAttributeItem=function(a,b,d){a.find(".ui-image-button-list-item["+b+"='"+d+"']").click()}})(d.listview||(d.listview={}))})(starrez||(starrez={}));
(function(d){(function(f){function c(a,e){return b.IsModuleLoaded(a,e)}function a(a){d.library.utils.IsNullOrUndefined(a)?window.location.href=d.library.service.CreateUrl("/"+k):(b.RemoveModule(k),b.NavigateToSubModule(k,a))}var b,k,e,g,p=function(){function a(b,e,c,g){var k=this;this.$moduleContent=b;this.module=e;this.submodule=c;this.id=g;this.HeaderHeight=80;this.isModuleOptionsShown=this.IsResizable=!1;this.isModuleOptionsShown=this.GetOptions().is(":visible");this.IsResizable=d.library.convert.ToBoolean(this.GetViewSection().data("isresizable"));
this.$moduleContent.find(".ui-views-toggle-button").SRClick(function(a){d.library.utils.SafeStopPropagation(a);a=k.$moduleContent.find(".ui-views-menu, .ui-views-toggle-button");d.library.convert.ToBoolean(a.attr("aria-hidden"))?a.attr("aria-hidden","false"):a.attr("aria-hidden","true")});this.$moduleContent.find(".ui-module-options-pin").SRClick(function(a){d.library.utils.SafeStopPropagation(a);k.isModuleOptionsShown?k.CloseSideOptions():k.OpenSideOptions()});this.IsResizable&&this.GetOptions().resizable({handles:{e:"#egrip"},
stop:function(a,b){300>b.size.width?k.CloseSideOptions():k.GetModuleContents().css("margin-left",b.size.width)}})}a.prototype.GetCachedElement=function(a,b){d.library.utils.IsNullOrUndefined(this[b])&&(this[b]=a.find(b));return this[b]};a.prototype.ScrollToPosition=function(){this.ScrollPosition?d.scroll.ScrollTo(this.ScrollPosition.top,this.ScrollPosition.left):d.scroll.ScrollTo(0,0)};a.prototype.OpenSideOptions=function(){var a=this;document.getElementById("new-button-checkbox-label-design")?d.library.utils.BatchUpdateUI(function(){a.GetOptions().show().width(300);
a.GetModuleContents().css("margin-left",300);a.GetFooterSection().css("margin-left",380);a.isModuleOptionsShown=!0}):d.library.utils.BatchUpdateUI(function(){a.GetOptions().show().width(345);a.GetModuleContents().css("margin-left",345);a.GetFooterSection().css("margin-left",425);a.isModuleOptionsShown=!0})};a.prototype.CloseSideOptions=function(){var a=this;document.getElementById("new-button-checkbox-label-design")?d.library.utils.BatchUpdateUI(function(){a.GetOptions().hide();a.GetModuleContents().css("margin-left",
16);a.GetFooterSection().css("margin-left",95);a.isModuleOptionsShown=!1}):d.library.utils.BatchUpdateUI(function(){a.GetOptions().hide();a.GetModuleContents().css("margin-left",35);a.GetFooterSection().css("margin-left",115);a.isModuleOptionsShown=!1})};a.prototype.GetModuleContents=function(){return this.GetCachedElement(this.$moduleContent,".ui-contents")};a.prototype.GetOptions=function(){return this.GetCachedElement(this.$moduleContent,".ui-module-options-container")};a.prototype.GetViewSection=
function(){return this.GetCachedElement(this.$moduleContent,".ui-submodule-main-filter-views")};a.prototype.GetModuleSection=function(){return this.GetCachedElement(this.$moduleContent,".ui-submodule-main-filter")};a.prototype.GetSubModuleTabs=function(){return this.GetCachedElement(this.$moduleContent,".ui-submodule-picker")};a.prototype.GetScreenTitle=function(){return this.$moduleContent.data("caption")};a.prototype.GetFooterSection=function(){return this.GetCachedElement(this.$moduleContent,".ui-submodule-main-filter-footer")};
a.prototype.GetModuleOptions=function(){return this.GetCachedElement(this.$moduleContent,".ui-sys-module-options:first")};a.prototype.GetArea=function(){return MVC.GetControllerArea(this.submodule)};a.prototype.ChangeTitleText=function(a){this.$moduleContent.find(".ui-page-title").text(a)};a.prototype.ChangeTitleHtml=function(a){this.$moduleContent.find(".ui-page-title").html(a)};a.prototype.ChangeDescriptionHTML=function(a){this.$moduleContent.find(".ui-page-title-description").html(a)};a.prototype.ModuleLoadIconUsingTab=
function(){var a=this.GetCachedElement(this.$moduleContent,".ui-module-selector.ui-selected");return{ShowLoading:!1,LoadingFunc:function(b){b?a.addClass("loading"):a.removeClass("loading")}}};return a}();f.ModuleLayoutDef=p;var h=function(){return function(a){this.Name=a}}();f.GlobalInit=function(a,e){d.analytics.moduleChange(a,e);b=new l(a,e)};f.FireGlobalEvent=function(a,e){b.FireGlobalEvent(a,e)};f.GetCurrentModulePageManager=function(){return b.GetModulePageManager(k,e)};f.GetCurrentModuleController=
function(){return g.submodule};f.GetCurrentModuleArea=function(){return g.GetArea()};f.GetCurrentModuleName=function(){return k};f.GetCurrentSubModuleName=function(){return e};f.NavigateTo=function(a,e,d,c,g){void 0===d&&(d=!1);void 0===c&&(c=!0);return b.NavigateToSubModule(a,e,d,c,g)};f.IsModuleLoaded=c;f.ReloadSubModule=a;f.ClearUrlId=function(){-1!==window.location.href.indexOf("/?id=")&&b.SetWindowInformation(g,!0)};f.ShowReportGenerator=function(){return b.NavigateToSubModule(MVC.GetControllerArea(MVC.ReportGenerator.Controller.Name),
MVC.ReportGenerator.Controller.Name)};f.ShowReportGeneratorByReportId=function(a){return b.NavigateToSubModule(MVC.GetControllerArea(MVC.ReportGeneratorReact.Controller.Name),MVC.ReportGeneratorReact.Controller.Name,!1,!0,a.toString())};f.ShowStandardReportsV2=function(){return b.NavigateToSubModule(MVC.GetControllerArea(MVC.StandardReportsV2.Controller.Name),MVC.StandardReportsV2.Controller.Name)};f.ShowOccupancyGraph=function(){return b.NavigateToSubModule(MVC.GetControllerArea(MVC.OccupancyGraph.Controller.Name),
MVC.OccupancyGraph.Controller.Name)};var l=function(){function b(e,c){var k=this;this.m_modules=[];this.$screensContainer=$("#modules-container");this.$moduleMoreScreen=$("#modules-more-screen");this.$modulesSelector=$("#modules-selector");this.$screenHeader=$("#page-header");this.$moreButton=this.$modulesSelector.find(".ui-module-selector-more");this.ResizeModuleList();this.AttachSideBarOptionsPanel();this.ShowIfItemIsInMore(e);var f=new p(this.$screensContainer.find("> div:first"),e,c);this.SetupNewModuleManagers(f);
this.SetScreenAsCurrent(f,!1);this.AttachResizeEvents();d.BindEvent(function(b,e){d.library.stringhelper.Equals(b,"Wizard.Complete")&&0<=e.Key.indexOf("DashboardFunctions.NewDashboard")?a(e.ID.toString()):d.library.stringhelper.Equals(b,"Save.Complete")&&d.library.stringhelper.Equals(e.dbObjectName,"ConfigDashboard")?(new MVC.ConfigDashboard.GetAvailableDashboard(e.ID)).Request().done(function(b){a(b.toString())}):d.library.stringhelper.Equals(b,"Details.AllClosed")&&k.SetWindowInformation(g,!1)});
$(document).off("click.moduleselection").on("click.moduleselection",".ui-module-selector",function(a){if(d.library.utils.IsNullOrUndefined(a.button)||0===a.button){d.library.utils.SafeStopPropagation(a);a=$(a.currentTarget);var b=a.data("module").toString().toLowerCase(),e=a.data("submodule").toString().toLowerCase(),c=d.library.convert.ToBoolean(a.data("ismodule"));a=void 0;a=(a=k.GetModulePageManager(g.module,g.submodule))&&a.WillLoseFocus?a.WillLoseFocus():jQuery.Deferred(function(a){return a.resolve(!1)}).promise();
a.done(function(a){a||(d.appInsights.StartTrackPage(d.appInsights.AppInsightsType.ModuleNavigation,b+"-"+e),k.NavigateToSubModule(b,e,c).done(function(){if(c)k.$screensContainer.find("> div:visible .ui-submodule-picker .ui-selected").SRFocus();else{var a=k.GetModulePageManager(b,e);a&&d.library.utils.IsNotNullUndefined(a.OnKeyboardModuleFocus)?a.OnKeyboardModuleFocus():k.$screensContainer.find("> div:visible .ui-submodule-picker .ui-selected").SRFocus()}}))})}});$(document).off("click.barcodescanning").on("click.barcodescanning",
"#barcode-scanning",function(a){d.barcode.OpenScanningPopup();d.library.utils.SafeStopPropagation(a)});$(document).off("click.moreselector").on("click.moreselector",".ui-module-selector-more",function(a){$(a.currentTarget).next().show();d.library.ui.PositionMe($(a.currentTarget).next(),{of:$(a.currentTarget),at:"right bottom",my:"right top"});d.library.utils.SafeStopPropagation(a)});d.keyboard.InitListKeyboardEvents(this.$modulesSelector,"ui-module-selector",d.keyboard.ListDirection.Vertical);d.appInsights.StopTrackPage(d.appInsights.AppInsightsType.ModuleNavigation,
e+"-"+c)}b.prototype.GetModulePageManager=function(a,b){var e=this.GetLoadedModuleDetails(a);return d.library.utils.IsNotNullUndefined(e)?e[b]:null};b.prototype.FireGlobalEvent=function(a,b){for(var e=0;ed.toString().indexOf("_layout")){var c=this.m_modules[e][d];c.GlobalEvent&&c.GlobalEvent(a,b)}};b.prototype.NavigateToSubModule=function(a,b,e,g,k){var f=this;void 0===e&&(e=!1);void 0===g&&(g=!0);
b=b.toString().toLowerCase();var h=this.$modulesSelector.find(".ui-module-selector[data-module='"+a.toLowerCase()+"']");h.SelectRow(!0);d.utils.CloseAllOverlays();this.CloseSideBar();var l=$.Deferred(),m=this.GetLoadedModuleDetails(a);e&&c(a)?(!d.library.utils.IsNullOrUndefined(k)&&k!==m.Id&&(m.Id=k),this.SetScreenAsCurrent(m[m.LastVisible+"_layout"],g,k||m.Id),d.appInsights.StopTrackPage(d.appInsights.AppInsightsType.ModuleNavigation,a+"-"+b),l.resolve()):c(a,b)?(!d.library.utils.IsNullOrUndefined(k)&&
k!==m[b+"_layout"].id&&(m[b+"_layout"].id=k),this.SetScreenAsCurrent(m[b+"_layout"],g,k||m[b+"_layout"].id),m.LastVisible=b,d.appInsights.StopTrackPage(d.appInsights.AppInsightsType.ModuleNavigation,a+"-"+b),l.resolve()):(h.SRLoading(!0),(new MVC.GenericCaller(a,b,"index",{id:k})).Request("reportgeneratorreact"===b&&"reports"===a?{Cache:!0}:void 0).done(function(e){e=$.toHTML(e);var d=new p(e,a,b,k);f.$screensContainer.append(e);f.SetupNewModuleManagers(d);f.SetScreenAsCurrent(d,g,k)}).always(function(){f.$modulesSelector.find(".ui-module-selector[data-module='"+
a.toLowerCase()+"']").SRLoading(!1);d.appInsights.StopTrackPage(d.appInsights.AppInsightsType.ModuleNavigation,a+"-"+b);l.resolve()}));l.always(function(){d.starcare.LoadModuleHelp(a,b);d.analytics.moduleChange(a,b)});return l.promise()};b.prototype.IsModuleLoaded=function(a,b){var e=this.GetLoadedModuleDetails(a);return d.library.utils.IsNullOrUndefined(b)&&!d.library.utils.IsNullOrUndefined(e)||!d.library.utils.IsNullOrUndefined(b)&&!d.library.utils.IsNullOrUndefined(e)&&!d.library.utils.IsNullOrUndefined(e[b.toLowerCase()])?
!0:!1};b.prototype.RemoveModule=function(a){var b=this.GetLoadedModuleDetails(a);this.$screensContainer.find("> div[data-module='"+a+"']").remove();this.m_modules.splice($.inArray(b,this.m_modules),1)};b.prototype.SetupNewModuleManagers=function(a){this.ResizeSubModuleList(a.$moduleContent);var b=this.GetLoadedModuleDetails(a.module);d.library.utils.IsNullOrUndefined(b)&&(b=this.PushLoadedModuleDetails(a.module,a.submodule,a.id));var e=this.InitModuleJavascript(a);d.library.utils.IsNullOrUndefined(e)||
(b.LastVisible=a.submodule,b[a.submodule]=e,b[a.submodule+"_layout"]=a)};b.prototype.SetScreenAsCurrent=function(a,b,c){this.$screensContainer.find("> div").hide();this.SetWindowInformation(a,b,c);null!=g&&null!=g.module&&(b=this.GetModulePageManager(g.module,g.submodule),d.library.utils.IsNotNullUndefined(b)&&(b.GlobalKeyEvent&&g.$moduleContent.off("keydown",b.GlobalKeyEvent),b.LostFocus&&b.LostFocus()));k=a.module;e=a.submodule;g=a;b=this.GetModulePageManager(a.module,a.submodule);if(b.GlobalKeyEvent)g.$moduleContent.on("keydown",
b.GlobalKeyEvent);b.GotFocus&&b.GotFocus();a.$moduleContent.show();b.PostFocus&&b.PostFocus();g.ScrollToPosition()};b.prototype.AttachSideBarOptionsPanel=function(){var a=this;this.$moduleMoreScreen.off("keydown.moremenu").on("keydown.moremenu",function(b){b.keyCode===d.keyboard.EscapeCode&&(a.CloseSideBar(),a.$moreButton.focus())});d.keyboard.InitListKeyboardEvents(this.$moduleMoreScreen,"ui-module-selector",d.keyboard.ListDirection.Vertical);this.$moreButton.off("keydown.moremenu").on("keydown.moremenu",
function(b){b.keyCode===d.keyboard.EscapeCode&&a.CloseSideBar()});var b=this.$moduleMoreScreen.find(".ui-sortable"),e=this.$moduleMoreScreen.find(".ui-module-selector-reset");this.$moreButton.SRClick(function(b){a.$moduleMoreScreen.hasClass("ui-is-shown")?a.CloseSideBar():a.OpenSideBar();d.library.utils.SafeStopPropagation(b)});this.$moduleMoreScreen.next().hasClass("ui-close")?this.$moduleMoreScreen.next().SRClick(function(){a.CloseSideBar()}):this.$moduleMoreScreen.find(".ui-close").SRClick(function(){a.CloseSideBar()});
b.sortable({helper:"clone",items:".ui-module-selector",placeholder:"placeholder srw_orderableModuleSelector_placeholder",containment:"parent",axis:"y",stop:function(){var b=a.SaveModuleOrder();a.ReOrderModuleList(b,a.$modulesSelector);a.ResizeModuleList();d.analytics.generalEvent("Sorting Modules")}});e.SRClick(function(){d.ui.RequestConfirmation("Are you sure you wish to reset the module order back to the default","Reset Module Order").done(function(){(new MVC.Settings.ResetModuleOrderSetting).Request({ShowLoading:!0}).done(function(b){a.ReOrderModuleList(b,
a.$moduleMoreScreen);a.ReOrderModuleList(b,a.$modulesSelector)})})});this.$moduleMoreScreen.find(".ui-module-selector-close").SRClick(function(){a.CloseSideBar()})};b.prototype.OpenSideBar=function(){var a=this;this.$moduleMoreScreen.show();d.ui.RunCSSAnimation(function(){a.$moduleMoreScreen.addClass("shown ui-is-shown")})};b.prototype.CloseSideBar=function(){var a=this;this.$moduleMoreScreen.hasClass("ui-is-shown")&&(this.$moduleMoreScreen.removeClass("shown ui-is-shown"),d.ui.RunAfterCSSAnimation(function(){a.$moduleMoreScreen.hide()}))};
b.prototype.AttachResizeEvents=function(){var a=this,b=this.$screenHeader.outerHeight()+g.GetSubModuleTabs().outerHeight(),e=this.$modulesSelector.width();d.scroll.ListenOnScroll(function(c){if(!g.IsResizable){g.ScrollPosition=c;var k=a.GetModulePageManager(d.mm.GetCurrentModuleName(),d.mm.GetCurrentSubModuleName());d.library.utils.IsNotNullUndefined(k)&&k.ScrollEvent&&k.ScrollEvent(c);d.scroll.HandleModuleScrollEvents(c,g.$moduleContent,b,e,g.HeaderHeight,".ui-contents")}});$(window).bind("orientationchange",
function(b){a.ResizeModuleList();a.ResizeSubModuleList(g.$moduleContent);a.ThrowScreenResizeEvent("orientationchange",b);90!==Math.abs(window.orientation)&&d.ui.DisplayOrientationMessageIfNecessary()});$(window).bind("resize",function(b){window.clearTimeout(a.m_resizeEvent);a.m_resizeEvent=window.setTimeout(function(){a.ResizeModuleList();a.ResizeSubModuleList(g.$moduleContent);a.ThrowScreenResizeEvent("resize",b)},100)})};b.prototype.ThrowScreenResizeEvent=function(a,b){var d=this.GetLoadedModuleDetails(k)[e];
d&&d.ResizeEvent&&d.ResizeEvent(a,b)};b.prototype.ResizeSubModuleList=function(a){var b=a.find(".ui-submodule-picker");b.isFound()&&(a=a.find(".ui-sub-module-more-group-button"),b[0].scrollWidth>b[0].clientWidth?a.show():a.hide())};b.prototype.ResizeModuleList=function(){var a=this.$modulesSelector.height()-this.$modulesSelector.find(".ui-orderable-modules").position().top-this.$moreButton.height(),b=this.$modulesSelector.find(".ui-module-selector"),e=0;$.each(b,function(b,d){var c=$(d);e+=c.height();
e>a?c.hide():c.fadeIn()})};b.prototype.ShowIfItemIsInMore=function(a){this.IsModuleItemInMore(a)&&(this.$modulesSelector.find(".ui-module-selector:visible:last").hide(),this.$modulesSelector.find(".ui-module-selector:dataAttr(module='"+a+"')").show())};b.prototype.IsModuleItemInMore=function(a){return this.$modulesSelector.find(".ui-module-selector:dataAttr(module='"+a+"')").is(":hidden")};b.prototype.ReOrderModuleList=function(a,b){for(var e,d=b.find(".ui-orderable-modules"),c=0;c
")):d.library.stringhelper.Equals(c,"New.Complete",!0)&&a.treeviewManager.AddNewNode(e.ID.toString(),d.library.controls.treeview.NodeType.Unknown,a.GetDescription()))})};a.prototype.GetDescription=function(){var a="New Item",d=$(".ui-category-edit-screen");d.isFound()&&(d=d.GetControl("Description"),d.isFound()&&(a=d.SRVal()));return a};a.prototype.InitPermissionManagement=function(){d.permission.InitPermissionManagement(this.$detail)};return a}();f.CategorySetup=
c})(d.categorysetup||(d.categorysetup={}))})(starrez||(starrez={}));
(function(d){(function(f){var c=function(a){function b(b){var e=a.call(this,b)||this;e.SetupLinks(b);return e}__extends(b,a);b.prototype.AppendDataComplete=function(a){this.SetupLinks(a)};b.prototype.SetupLinks=function(a){a.find(".ui-view-item-button").SRClick(function(a){a=$(a.target).closest("tr").data("description");(new MVC.ApplicationChangeLog.ShowPopup(a)).ShowPopup()})};return b}(d.detailscreenlist.DetailScreenListManager);f.ChangeLogListManager=c})(d.changelog||(d.changelog={}))})(starrez||
(starrez={}));
(function(d){(function(f){f.InitChargeGroupSetup=function(a){var b=a.GetControl("ManagedExternally");b.change(function(a){d.library.convert.ToBoolean(b.SRVal())&&d.ui.ShowQuestion("Are you sure you want to flag this Charge Group for export?
New payments and refunds with a Table Name of 'RoomBase' under this charge group will trigger an export to the Property Management system.").done(function(a){a||b.SRVal(!1)})})};f.InitChargeGroupSearch=function(a){new c(a)};var c=function(){function a(a){this.$container=a;
this.isInitSearch=!1;this.model=MVC.ModelJS.GetJSChargeGroupSearchViewModel(a);this.$searchControls=a.find(".ui-search-control");this.$resultsArea=a.find(".ui-results");this.AttachEvents()}a.prototype.AttachEvents=function(){var a=this;this.$container.find(".ui-searchbtn").SRClick(function(c){c=d.library.service.SerialiseFormToJsonObject(a.$searchControls);(new MVC.ChargeGroupSearch.GetSearchResults(c,a.model.MultipleSelect)).Request(function(e){a.$resultsArea.html(e);var c;c=d.tablesetup.CreateArticleTableManager(a.$resultsArea,
{SelectedRowIDs:a.isInitSearch?d.controls.search.GetSelectedIDs():a.model.AlreadySelectedIDs,SelectedRowIDSelector:"data-chargegroup",AttachRowClickEvent:!0,OnRowClick:function(e,c){d.controls.search.SelectItem(c.id,c.caption,a.model.TSHtmlID,a.$container)},OnSelectAllClick:function(e){a.UpdateSelectedRecords(c)}})[0];d.popup.AutoHeightPopup(a.$resultsArea);a.isInitSearch=!0})})};a.prototype.UpdateSelectedRecords=function(a){var c=[];$.each(a.Rows(),function(a,b){var d=$(b),f=d.data();c.push({Value:f.id,
Text:f.caption,Selected:d.isSelected()})});d.controls.search.BulkUpdateSelect(c)};return a}()})(d.chargegroupsetup||(d.chargegroupsetup={}))})(starrez||(starrez={}));
(function(d){(function(f){f.InitChargeItemSearch=function(a){new c(a)};var c=function(){function a(a){this.$container=a;this.isInitSearch=!1;this.model=MVC.ModelJS.GetJSChargeItemSearchViewModel(a);this.$searchControls=a.find(".ui-search-control");this.$resultsArea=a.find(".ui-results");this.AttachEvents()}a.prototype.AttachEvents=function(){var a=this;this.$container.find(".ui-searchbtn").SRClick(function(c){c=d.library.service.SerialiseFormToJsonObject(a.$searchControls);(new MVC.ChargeItemSearch.GetChargeItemList(c,
a.model.MultipleSelect)).Request(function(e){a.$resultsArea.html(e);var c;c=d.tablesetup.CreateArticleTableManager(a.$resultsArea,{AttachRowClickEvent:!0,SelectedRowIDSelector:"data-chargeitem",SelectedRowIDs:a.isInitSearch?d.controls.search.GetSelectedIDs():a.model.AlreadySelectedIDs,OnRowClick:function(e,c){d.controls.search.SelectItem(c.id,c.caption,a.model.TSHtmlID,a.$container)},OnSelectAllClick:function(e){a.UpdateSelectedRecords(c)}})[0];d.popup.AutoHeightPopup(a.$resultsArea);a.isInitSearch=
!0})})};a.prototype.UpdateSelectedRecords=function(a){var c=[];$.each(a.Rows(),function(a,b){var d=$(b),f=d.data();c.push({Value:f.id,Text:f.caption,Selected:d.isSelected()})});d.controls.search.BulkUpdateSelect(c)};return a}()})(d.chargeitemsetup||(d.chargeitemsetup={}))})(starrez||(starrez={}));
(function(d){(function(f){function c(a,b){var e=a.GetControl("MessageSubscriberID"),d=a.GetControl("MessageSubscriptionID"),c=a.find(".ui-delete-existing");a.GetControl("Subscriber").on("change",function(a,e){(new MVC.DataSubscriptionSetup.LoadSubscription(-1)).Request().done(function(a){a.MessageSubscriberID=Number(e.GetValue());b.SetPagesData(a);b.MovePageNext()})});new h(a,function(a){(new MVC.DataSubscriptionSetup.LoadSubscription(a.MessageSubscriptionID)).Request().done(function(c){d.SRVal(a.MessageSubscriptionID);
e.SRVal(a.MessageSubscriberID);c.MessageSubscriberID=a.MessageSubscriberID;c.MessageSubscriptionID=a.MessageSubscriptionID;b.SetPagesData(c);b.MovePageNext()})});c.SRClick(function(a){b.GotoStandalonePage("delete")})}function a(a,b){var e=a.find(".ui-delete-subscription"),c=a.find(".ui-cancel"),g;new h(a,function(a){g=a.MessageSubscriptionID});c.SRClick(function(){b.MoveToFirstPage()});e.SRClick(function(a){isNaN(g)?d.ui.ShowInfoMessage("Please select a Data Subscription."):d.ui.ShowQuestion("Are you sure you want to delete this Data Subscription?",
"Data Subscriptions").done(function(a){a&&(new MVC.DataSubscriptionSetup.DeleteSubscription(g,d.error.CreateErrorObject())).Request().done(function(){b.Close();d.ui.ShowSuccessMessage("Data Subscription Deleted Successfully.")})})})}var b=d.library.utils.IsNotNullUndefined,k=d.library.convert.ToBoolean,e;(function(a){a[a.CheckIn=1]="CheckIn";a[a.CheckOut=2]="CheckOut";a[a.RoomChange=3]="RoomChange";a[a.DataInserted=4]="DataInserted";a[a.DataUpdated=5]="DataUpdated";a[a.DataDeleted=6]="DataDeleted";
a[a.WorkflowNextStep=7]="WorkflowNextStep";a[a.WorkflowPreviousStep=8]="WorkflowPreviousStep";a[a.Custom=9]="Custom";a[a.InterfaceRunFinished=10]="InterfaceRunFinished"})(e=f.SubscribeTo||(f.SubscribeTo={}));(function(a){a[a.UpdateRecord=0]="UpdateRecord";a[a.CreateRecord=1]="CreateRecord"})(f.DataAction||(f.DataAction={}));var g;(function(a){a[a.None=0]="None";a[a.Basic=1]="Basic";a[a.Credentials=2]="Credentials"})(g||(g={}));f.InitDataSubscriptionSetup_Trigger=function(a){(new l(a)).Init()};f.InitDataSubscriptionSetup_DataUpdater=
function(a){(new p(a)).Init()};f.InitDataSubscriptionSetup_WebService=function(a){(new m(a)).Init()};var p=function(){function a(e){this.$container=e;this.model=MVC.ModelJS.GetJSDataSubscriptionSetup(e);this.$updateMode=e.GetControl("UpdateMode");this.$recordTabs=e.find(".ui-record-tabs");this.$createTableName=e.GetControl("CreateTableName");this.$currentTab=e.GetControl("CurrentTab");this.$advancedOnly=e.GetControl("AdvancedOnly");this.previousUpdateMode=this.$updateMode.SRVal();this.askChangeQuestion=
b(this.$updateMode.SRVal())}a.prototype.Init=function(){this.AttachEvents();this.DisplayUI();this.AttachXMLBuilderEvents()};a.prototype.AttachEvents=function(){var a=this;this.$createTableName.change(function(){a.UpdateUI()});this.$updateMode.SRClick(function(){a.askChangeQuestion?d.ui.ShowQuestion("Changing this update type will reset existing data on this screen, continue?").done(function(b){b?(a.GetTableList(),a.DisplayUI(),a.askChangeQuestion=!1,a.previousUpdateMode=a.$updateMode.SRVal()):a.$updateMode.SRVal(a.previousUpdateMode)}):
(a.GetTableList(),a.DisplayUI(),a.previousUpdateMode=a.$updateMode.SRVal())});this.tabManager=d.popup.InitPopupTabBar(this.$recordTabs,function(b){a.$currentTab.SRVal(b)})};a.prototype.AttachTableSelectEvent=function(){var a=this;this.$createTableName.change(function(){a.UpdateUI()})};a.prototype.GetTableList=function(){var a=this,b=this.$createTableName.SRVal();(new MVC.DataSubscriptionSetup.GetTables(this.$updateMode.SRVal(),b)).Get().done(function(e){e=$.toHTML(e);a.$createTableName.replaceWith(e);
a.$createTableName=e;a.AttachTableSelectEvent();b!=a.$updateMode.SRVal()&&a.UpdateUI()})};a.prototype.UpdateUI=function(){"UpdateField"!==this.$updateMode.SRVal()&&this.BuildXMLTabs()};a.prototype.GetCreateTableName=function(){var a=this.$updateMode.SRVal();return"UpdateField"!==a&&"UpdateRelated"!==a&&("UpdateOtherTable"===a||"CreateRecord"===a)?this.$createTableName.SRVal():this.model.TableName};a.prototype.DisplayUI=function(){var a=this.$updateMode.SRVal();this.$container.find(".ui-field-value").hide();
this.$container.find(".ui-create-table").hide();this.$container.find(".ui-id-query").hide();this.$recordTabs.hide();"UpdateField"===a?this.$container.find(".ui-field-value").show():"UpdateRelated"===a?this.$recordTabs.show():"UpdateOtherTable"===a?(this.$container.find(".ui-create-table").show(),this.$container.find(".ui-id-query").show(),this.$recordTabs.show()):"CreateRecord"===a&&(this.$container.find(".ui-create-table").show(),this.$recordTabs.show())};a.prototype.BuildXMLTabs=function(){var a=
this;this.tabManager.LoadingPages();var b=this.GetCreateTableName();(new MVC.DataSubscriptionSetup.GetTableXml(void 0,b)).Get().done(function(b){a.tabManager.ReBuildPages($.toHTML(b));a.$advancedOnly.SRVal(!1);a.$currentTab.SRVal("1");a.AttachXMLBuilderEvents()})};a.prototype.AttachXMLBuilderEvents=function(){var a=this;this.$container.find("input:checkbox[name^='_Selected.']").each(function(b,e){var c=$(e).attr("name"),g=c.substring(10),k=function(b){d.library.controls.GetControlByName(c,a.$container).SRVal(!0)},
g=d.library.controls.GetControlByName(g,a.$container);g.change(k);g.keydown(k)});this.$container.find(".ui-xmlsection").GetAllControls().change(function(){a.BuildXMLFromFieldsCollection()});this.$container.GetControl("RecordDetails").keyup(function(){a.$advancedOnly.SRVal(!0);a.tabManager.DisableTab("1");a.tabManager.ShowPage("2")})};a.prototype.BuildXMLFromFieldsCollection=function(){var a=this.GetCreateTableName(),b="<"+a+">\n";$.each(this.$recordTabs.find(".ui-checkbox"),function(a,e){var c=$(e);
d.library.convert.ToBoolean(c.SRVal())&&0<=c.SRName().indexOf("_Selected")&&(c=c.siblings(".ui-controls-container"),b+=c.ToXMLElement())});this.askChangeQuestion=!0;b+=""+a+">";this.$container.GetControl("RecordDetails").SRVal(b)};return a}(),h=function(){function a(b,e){this.$container=b;this.onSelection=e;this.isAllLoaded=!1;this.$searchSubscriptions=b.GetControl("SearchExistingSubscriptions");this.$recentContainer=b.find(".ui-recent-subscriptions");this.$searchContainer=b.find(".ui-search-subscriptions");
this.$allContainer=b.find(".ui-all-subscriptions");this.AttachEvents()}a.prototype.AttachEvents=function(){var a=this;this.AttachTableEvents(this.$recentContainer);d.popup.InitPopupTabBar(this.$container.find(".ui-existing-tabs"),function(b){"all"===b&&!1===a.isAllLoaded&&(new MVC.DataSubscriptionSetup.AllSubscriptions).Request().done(function(b){a.$allContainer.find(".ui-all-subscriptions-results").html(b);a.isAllLoaded=!0;a.AttachTableEvents(a.$allContainer)})});this.$searchSubscriptions.keypress(function(b){window.clearTimeout(a.timeOut);
a.timeOut=window.setTimeout(function(){var b=a.$searchSubscriptions.SRVal();(new MVC.DataSubscriptionSetup.SearchSubscriptions(b)).Request({LoadingFunc:function(b){a.$searchSubscriptions.SRLoading(b)}}).done(function(b){a.$searchContainer.find(".ui-search-subscriptions-results").html(b);a.AttachTableEvents(a.$searchContainer)})},500)})};a.prototype.AttachTableEvents=function(a){var b=this;d.tablesetup.CreateTableManager(a.find(".ui-active-table"),a,{AttachRowClickEvent:!0,OnRowClick:function(a){b.FireSelectionEvent(a)}},
!0)};a.prototype.FireSelectionEvent=function(a){this.onSelection({MessageSubscriberID:Number(a.data("messagesubscriber")),MessageSubscriptionID:Number(a.data("messagesubscription")),$target:a})};return a}(),l=function(){function a(b){this.$container=b;this.model=MVC.ModelJS.GetJSDataSubscriptionSetup(b);this.$subscribeTo=b.GetControl("MessageActionID");this.$temporaryReportID=b.GetControl("TemporaryReportID");this.$subSettings=b.find(".ui-subscriptionsettings");this.$subSettingsField=b.find(".ui-subscriptionsettings-field");
this.$condCriteria=b.find(".ui-conditionalcriteria");this.$tableName=b.GetControl("TableName");this.$conditionalCriteriaNormalized=b.GetControl("ConditionalCriteriaNormalized");this.$conditionalCriteria=b.GetControl("ConditionalCriteria");this.$criteriaAddButton=b.find(".ui-add-criteria");this.$clearCriteria=b.find(".ui-clear-criteria");this.$clearField=b.find(".ui-clear-field")}a.prototype.Init=function(){this.AttachEvents();this.UpdateFilteringUI()};a.prototype.GetTableList=function(){var a=this,
b=this.$tableName.SRVal(),e=this.$subscribeTo.SRVal();e&&(new MVC.DataSubscriptionSetup.GetDataTriggerTables(e,b)).Get().done(function(b){b=$.toHTML(b);a.$tableName.replaceWith(b);a.$tableName=b;a.$subscribeTo.SRClick(function(){a.UpdateFilteringUI()});a.AttachEvents()})};a.prototype.AttachEvents=function(){var a=this;this.$tableName.change(function(b){var c=function(){var b=Number(a.$subscribeTo.SRVal());a.$conditionalCriteria.SRVal("");a.$conditionalCriteriaNormalized.SRVal("");a.criteria=void 0;
b===e.DataUpdated&&a.LoadTableFields()};0Click on a record to show further information & actions.";this.hasLoaded=!1;this.areas=d.popup.GetPopupContainerAreas(a);this.$graphContainer=
this.areas.$article.find(".ui-scrollable-graph-container");this.$graphContainer.css("height",this.$graphContainer.closest(".ui-date-dependent-graph").height());this.$footer=a.find(".ui-graph-footer");this.$filterGender=a.GetControl("FilterGenderType");this.$genderTypeID=a.GetControl("GenderTypeID");this.$filterRoomType=a.GetControl("FilterRoomType");this.$roomTypeID=a.GetControl("RoomTypeID");this.$filterClassification=a.GetControl("FilterClassification");this.$classificationID=a.GetControl("ClassificationID");
this.$filterRoomLocation=a.GetControl("FilterRoomLocation");this.$roomLocationID=a.GetControl("RoomLocationID");this.$filterTermType=a.GetControl("FilterTermType");this.$termTypeID=a.GetControl("TermTypeID");this.$filterProfile=a.GetControl("FilterProfile");this.$profileTypeID=a.GetControl("ProfileTypeID");this.$checkInDate=a.GetControl("CheckInDate");this.$checkOutDate=a.GetControl("CheckOutDate");this.AttachFilterEvents();this.$footer.html("Apply a filter.");this.generalObserver=
d.BindEvent(function(a,b){e.GlobalEvent(a,b)})}b.prototype.AttachFilterEvents=function(){var a=this;this.$filterGender.change(function(){d.library.controls.checkbox.ToggleControlFromCheckbox(a.$filterGender,a.$genderTypeID,!1)});this.$filterRoomType.change(function(){d.library.controls.checkbox.ToggleControlFromCheckbox(a.$filterRoomType,a.$roomTypeID,!1)});this.$filterClassification.change(function(){d.library.controls.checkbox.ToggleControlFromCheckbox(a.$filterClassification,a.$classificationID,
!1)});this.$filterRoomLocation.change(function(){d.library.controls.checkbox.ToggleControlFromCheckbox(a.$filterRoomLocation,a.$roomLocationID,!1)});this.$filterTermType.change(function(){d.library.controls.checkbox.ToggleControlFromCheckbox(a.$filterTermType,a.$termTypeID,!1)});this.$filterProfile.change(function(){d.library.controls.checkbox.ToggleControlFromCheckbox(a.$filterProfile,a.$profileTypeID,!1)});this.$container.find(".ui-btn-refresh").SRClick(function(){a.RefreshGraph()});this.$graphContainer.scroll(function(b){b=
$(b.currentTarget);a.$footer.css("bottom",-1*b.scrollTop()).css("left",b.scrollLeft())})};b.prototype.RefreshGraph=function(){var a=this;if(moment(this.$checkOutDate.SRVal()).isBefore(moment(this.$checkInDate.SRVal())))d.ui.ShowAlertMessage("End date cannot be before start date.");else{var b=new MVC.DateDependentRooms.GetDateDependentRoomFoxyGraphData(d.service.CreateSaveDataObject(this.$container,!0));this.hasLoaded?this.pagableGraph.Refresh(!0,b,!0):(this.pagableGraph=new d.pageablefoxygraph.PageableGraph(this.$container,
this.SetupPagableGrid(),b),this.pagableGraph.InitGrid(),(new d.scroll.Scroll(this.$graphContainer)).ListenOnScroll(function(b){d.scroll.HandleModuleScrollEvents(b,a.$graphContainer,0,0,0)}),this.hasLoaded=!0,this.SetFooterContent(this.baseFooterContent))}};b.prototype.SetFooterContent=function(a){this.$footer.html(a);this.AccountForFooterHeight()};b.prototype.AccountForFooterHeight=function(){this.pagableGraph.$foxyGrid.find(".body-container").css("margin-bottom",this.$footer.height())};b.prototype.GlobalEvent=
function(a,b){d.library.stringhelper.Equals(a,d.wizard.globalEventNameAll,!0)&&(this.pagableGraph.IsGridVisible()?this.pagableGraph.RefreshKeepingPosition():d.UnbindEvent(this.generalObserver))};b.prototype.SetupPagableGrid=function(){var b=this;return{gridID:"date_dependent_rooms_graph",AllowCreate:!0,AllowDragDrop:!0,AllowResize:!0,AllowRowSelection:!1,$scrollableContainer:this.$graphContainer,OnRecordMoveEnd:function(a,e,d){return b.FoxyGraphMoveDrop(a,e,d)},OnRecordResizeEnd:function(a,e,d){return b.FoxyGraphMoveDrop(a,
e,d)},OnDataLoad:function(a,e){b.AccountForFooterHeight()},OnSelectionEnd:function(a,e){var d=e.GetActiveSelections();b.LoadGraphFooter(d.SelectedIDs,d.DateStart,d.DateEnd,!0)},OnRecordSelection:function(e,d){var c=$.Deferred();if(a(d)&&0 Changes to this Room Location's Description, City, State/Province, or Zip/Postcode will trigger an export to the Property Management system. The first export will happen when this record is saved.").done(function(a){a||
b.SRVal(!1)})})};f.InitRoomFloorSetup=function(a){var b=a.GetControl("OverrideGender"),e=a.GetControl("GenderTypeEnum"),c=a.find(".ui-gender-override-description");b.change(function(a){d.library.convert.ToBoolean(b.SRVal())?(e.Enable(),c.hide()):(e.Disable(),c.show())})};f.InitRoomSetup=function(a){return new e(a)};f.InitRoomBaseConfigurationSetup=function(a){var b=a.GetControl("OverrideGender"),e=a.GetControl("GenderTypeEnum"),c=a.find(".ui-gender-override-description"),k=a.GetControl("SelectedClassifications"),
f=a.GetControl("ClassificationsFilter");k.SRVal(f.SRVal());var q=a.GetControl("SelectedTermTypes"),r=a.GetControl("TermTypesFilter");q.SRVal(r.SRVal());var u=a.GetControl("SelectedProfileItems"),s=a.GetControl("GeneralProfileIDs"),t=a.GetControl("MandatoryProfileIDs"),v=a.GetControl("StaffProfileIDs");a=function(){var a=[],b=s.SRVal(),e=t.SRVal(),c=v.SRVal();d.utils.IsDefined(b)&&$.merge(a,b);d.utils.IsDefined(e)&&$.merge(a,e);d.utils.IsDefined(c)&&$.merge(a,c);u.SRVal(a)};a();s.change(a);t.change(a);
v.change(a);d.library.controls.ResetChangedFlag(k);d.library.controls.ResetChangedFlag(q);d.library.controls.ResetChangedFlag(u);b.change(function(a){d.library.convert.ToBoolean(b.SRVal())?(e.Disable(),c.show()):(e.Enable(),c.hide())});f.change(function(a){k.SRVal(f.SRVal())});r.change(function(a){q.SRVal(r.SRVal())})};f.InitInventoryTypeNewEdit=function(a){var b=a.GetControl("ChargeItemID"),e=a.GetControl("DefaultChargeAmount");b.change(function(a){(new MVC.RoomSpaceInventory.GetDefaultChargeAmount(Number(b.SRVal()))).Request().done(function(a){e.SRVal(a)})})};
var e=function(){function e(a){var b=this;this.$container=a;this.$buttonBar=a.find(".ui-setup-buttons");this.$treeview=a.find(".ui-treeview-container");this.$detail=a.find(".ui-room-setup-info");this.$showHiddenAndDeleted=a.GetControl("ShowHiddenAndDeleted");this.treeviewManager=d.controls.lazytreeview.GetLazyTreeViewManager(this.$treeview);this.AttachTreeviewEvents();this.treeviewManager.SelectFirstItem();this.$showHiddenAndDeleted.SRClick(function(a){b.$treeview.toggleClass("hide-deleted-hidden")})}
e.prototype.AttachTreeviewEvents=function(){var a=this;this.treeviewManager.SetSelectionHandler(function(b){a.$selected=b.$selectedNode;var e=b.ID;a.currentController=b.TableName+"Setup";b=new MVC.GenericCaller(a.currentController,"Show",{id:e});void 0!==b&&b.Get().done(function(b){a.$detail.html(b);a.AttachMenuEvents(e);a.AttachToSaveEvent();d.popup.AutoHeightPopup(a.$detail)})})};e.prototype.AttachMenuEvents=function(a){var b=this;d.actionlink.AttachActionLinksEvents(this.$detail,function(e){e.EventType===
d.actionlink.ActionLinkTypes.Delete?b.DeleteRecord(e.$me,b.currentController):e.EventType===d.actionlink.ActionLinkTypes.New&&(new d.createnewitem.CreateNewItemWithParentStandaloneManager(e.Controller,a)).ShowScreen()});this.$detail.find(".ui-roomsetup-classifications").SRClick(function(e){(new MVC.RoomLocationSetup.ManageClassifications(a)).ShowPopup("manage-classifications",d.library.service.RequestType.Get).done(function(e){b.AttachToClassificationSaveEvents(a,e);b.AttachClassificationUserEvents(a,
e)})});this.$detail.find(".ui-roomsetup-configurations").SRClick(function(e){(new MVC.RoomBaseSetup.ManageRoomConfiguration(a)).ShowPopup("manage-configurations",d.library.service.RequestType.Get).done(function(e){d.tablesetup.InitTableManager(e);b.AttachToConfigurationSaveEvents(a,e);b.AttachConfigurationUserEvents(a,e)})})};e.prototype.AttachClassificationUserEvents=function(a,b){var e=this;b.find(".ui-btn-new").SRClick(function(b){(new d.createnewitem.CreateNewItemWithParentStandaloneManager(MVC.RoomLocationClassificationSetup.Controller.Name,
a)).ShowScreen()});d.actionlink.AttachActionLinksEvents(b,function(a){a.EventType===d.actionlink.ActionLinkTypes.Delete&&e.DeleteRecord(a.$me,MVC.RoomLocationClassificationSetup.Controller.Name)})};e.prototype.AttachToClassificationSaveEvents=function(b,e){var c=this;d.UnbindEvent(a);a=d.BindEvent(function(a,g){g.dbObjectName===MVC.RoomLocationClassificationSetup.Controller.Name&&(d.library.stringhelper.Equals(a,"Save.Complete",!0)||d.library.stringhelper.Equals(a,"New.Complete",!0)||d.library.stringhelper.Equals(a,
"Delete.Complete",!0))&&(new MVC.RoomLocationSetup.ManageClassifications(b)).Get().done(function(a){e.html(a);c.AttachClassificationUserEvents(b,e)})})};e.prototype.AttachConfigurationUserEvents=function(a,b){var e=this;b.find(".ui-btn-new").SRClick(function(b){(new d.createnewitem.CreateNewItemWithParentStandaloneManager(MVC.RoomBaseConfigurationSetup.Controller.Name,a)).ShowScreen()});d.actionlink.AttachActionLinksEvents(b,function(a){a.EventType===d.actionlink.ActionLinkTypes.Delete&&e.DeleteRecord(a.$me,
MVC.RoomBaseConfigurationSetup.Controller.Name)})};e.prototype.AttachToConfigurationSaveEvents=function(a,e){var c=this;d.UnbindEvent(b);b=d.BindEvent(function(b,g){g.dbObjectName===MVC.RoomBaseConfigurationSetup.Controller.Name&&(d.library.stringhelper.Equals(b,"Save.Complete",!0)||d.library.stringhelper.Equals(b,"New.Complete",!0)||d.library.stringhelper.Equals(b,"Delete.Complete",!0))&&(new MVC.RoomBaseSetup.ManageRoomConfiguration(a)).Get().done(function(b){e.html(b);d.tablesetup.InitTableManager(e);
c.AttachConfigurationUserEvents(a,e)})})};e.prototype.AttachToSaveEvent=function(){var a=this;d.UnbindEvent(c);c=d.BindEvent(function(b,e){if(e.dbObjectName===MVC.RoomLocationSetup.Controller.Name||e.dbObjectName===MVC.RoomLocationSectionSetup.Controller.Name||e.dbObjectName===MVC.RoomLocationFloorSuiteSetup.Controller.Name||e.dbObjectName===MVC.RoomBaseSetup.Controller.Name||e.dbObjectName===MVC.RoomSpaceSetup.Controller.Name)if(d.library.stringhelper.Equals(b,"Save.Complete",!0))a.UpdateRoomSaveDetails(a.$selected.closest("li"),
!0);else if(d.library.stringhelper.Equals(b,"Delete.Complete",!0))a.treeviewManager.DeleteNode(a.$selected),a.$detail.html("
Please select a Location, Section, Floor, Room Base or Room Space
");else if(d.library.stringhelper.Equals(b,"New.Complete",!0)){var c;c=d.library.stringhelper.Equals(e.dbObjectName,"RoomLocationSetup",!0)?a.treeviewManager.AddNewNode(e.ID.toString(),d.library.controls.treeview.NodeType.Unknown,"",!0):a.treeviewManager.AddNewNode(e.ID.toString(),d.library.controls.treeview.NodeType.Unknown,
"");d.library.utils.IsNotNullUndefined(c)&&a.UpdateRoomSaveDetails(c)}})};e.prototype.UpdateRoomSaveDetails=function(a,b){void 0===b&&(b=!1);var e="New Item",d=-1,d=$(document).find(".ui-room-setup-edit");if(d.isFound()){var c=d.GetControl("Description");c.isFound()&&(e=c.SRVal());d=d.GetControl("RecordTypeEnum");if(d.isFound())switch(d=Number(d.SRVal()),d){case k.Deleted:e+=" [Deleted]";a.addClass("treeitem-hidden ui-treeitem-hidden");break;case k.NotDeletableHidden:e+=" [Hidden]";a.addClass("treeitem-hidden ui-treeitem-hidden");
break;default:a.removeClass("treeitem-hidden ui-treeitem-hidden")}}this.treeviewManager.UpdateNodeText(a,e,b)};e.prototype.DeleteRecord=function(a,b){return d.setup.DeleteRecord(a,b,"room")};return e}();f.RoomSetup=e})(d.roomsetup||(d.roomsetup={}))})(starrez||(starrez={}));
(function(d){(function(f){var c;(function(a){a[a.Term=0]="Term";a[a.Dates=1]="Dates"})(c||(c={}));f.InitRoomSortConfigScreen=function(a){var c=a.GetControl("RoomLocationAreaID"),e=a.GetControl("RoomLocationID"),g=a.GetControl("RoomTypeID"),p=a.GetControl("ProfileItemID"),f=!1,l=function(){f||(f=!0,(new MVC.RoomSortConfiguration.GetConfigurationData(c.SRVal(),e.SRVal(),g.SRVal(),p.SRVal())).Get().done(function(a){d.library.controls.dropdown.FillDropDown(a.RoomLocationAreas,c,"Value","Text",c.SRVal(),
!0);d.library.controls.dropdown.FillDropDown(a.RoomLocations,e,"Value","Text",e.SRVal(),!0);d.library.controls.dropdown.FillDropDown(a.RoomTypes,g,"Value","Text",g.SRVal(),!0);a=$.toHTML(a.ProfileTreeViewString);p.replaceWith(a);p=a;p.SRVal(p.SRVal());f=!1}))};c.change(function(){l()});e.change(function(){l()});g.change(function(){l()})};f.InitRoomSortConfigurationSearch=function(a){var c=a.find(".ui-search-control"),e=a.find(".ui-results"),g=a.find(".ui-search-fieldset .ui-fieldset-caption"),p={ExcludeSelected:!1,
AlreadySelectedIDs:[]};d.controls.search.AddParamaters(p);p.ExcludeSelected&&(d.library.utils.IsNotNullUndefined(p.AlreadySelectedIDs)&&0this.$groups.SRVal().length?e.click():b.$moduleContent.find(".ui-wizard-option").Disable();d.wizard.AttachWizardsInContainer(b.$moduleContent)}a.prototype.GlobalEvent=
function(a,b){a===d.wizard.globalEventName&&"Security"===b.dbObjectName&&b.Key===MVC.Wizards.Security.GetExportSecurityObjectSetupOptions([b.ID]).Key&&d.ui.ShowQuestion("Create missing objects?","Missing Objects",null,null,"Yes","No").done(function(a){(new MVC.Security.GetSecurityObjectExport(a)).Download()})};a.prototype.AttachEvents=function(){var a=this;this.$groups.off("change.security").on("change.security",function(){a.LoadSecurityDetail(a.CurrentObjectID)});this.$keys.off("change.security").on("change.security",
function(){a.LoadTreeView()});d.library.controls.treeview.RebindFileSelectedEvent(this.$securityObjectsTreeView,void 0,function(b,e){a.LoadSecurityDetail(Number(e.ID))});d.library.controls.treeview.RebindFolderSelectedEvent(this.$securityObjectsTreeView,void 0,function(b,e){a.LoadSecurityDetail(Number(e.ID))});this.AttachImportClosing()};a.prototype.AttachImportClosing=function(){var a=this;d.UnbindEvent(c);c=d.BindEvent(function(b,e){e.dbObjectName===MVC.Security.Controller.Name&&d.library.stringhelper.Equals(e.Key,
MVC.Wizards.Security.GetImportSecurityObjectSetupOptions([-1]).Key,!0)&&a.LoadSecurityDetail(a.CurrentObjectID)})};a.prototype.LoadTreeView=function(){var a=this;(new MVC.Security.GetSecurityTree(this.$keys.SRVal())).Request(function(b){a.modelLayout.$moduleContent.find(".ui-keys-treeview").replaceWith($.toHTML(b));a.$securityObjectsDetailContainer.empty();a.$securityObjectsTreeView=a.modelLayout.$moduleContent.GetControl("ObjectID");a.AttachEvents()})};a.prototype.LoadSecurityDetail=function(a){var b=
this;d.library.utils.IsNullOrUndefined(a)||0===a||(this.CurrentObjectID=a,(new MVC.Security.GetSecurityDetail(a,this.$groups.SRVal(),this.$keys.SRVal())).Request(function(a){b.$securityObjectsDetailContainer.html(a.GridDetail);b.modelLayout.ChangeDescriptionHTML(a.Description);d.scroll.ScrollTo(0,0);d.ui.InitFieldMenuEditor(b.$securityObjectsDetailContainer,function(a){b.HandleMenuClick(a)});b.modelLayout.$moduleContent.find(".ui-wizard-option").Enable();var e=b.$securityObjectsDetailContainer.find(".ui-tree").width()+
10;b.$securityObjectsDetailContainer.find(".ui-data").each(function(a,b){e+=$(b).width()+10});b.$securityObjectsDetailContainer.find(".ui-tree-list-container").width(e)}))};a.prototype.HandleMenuClick=function(a){"row"===a.controlData.keylevel?this.UpdateKeysOnSelection(a,!1):this.UpdateKeysOnSelection(a,!0)};a.prototype.UpdateKeysOnSelection=function(a,b){var e=this,c=Number(a.controlData.objectid),k=d.library.convert.ToBoolean(a.controlData.haschildren),f=Number(a.controlData.securitygroupid),q=
a.clickedRowData.key,r="This will update the access level for this security key and all its child keys, are you sure?";k||(r="This will update the access level for this security key, are you sure?");d.ui.ShowQuestion(r,"Update Security Keys",void 0,{Type:d.ui.CheckboxQuestionType.DontAskAgain,Key:"security-update",DefaultValue:!1,Caption:"Don't ask again?"}).done(function(r){r&&(new MVC.Security.UpdateSecurityObject(c,f,q,d.error.CreateErrorObject())).Request().done(function(){if(!b&&!k){var f=$(a.originalEvent.currentTarget).closest(".ui-row .ui-field-menu-editor");
e.UpdateCell(q,f)}else if(!b&&k)d.ui.ShowLoading(!0,"Updating Keys..."),window.setTimeout(function(){var b={};$(a.originalEvent.currentTarget).closest(".ui-data").find(".ui-row .ui-field-menu-editor").each(function(a,e){var d=$(e);b[Number(d.data("objectid"))]=d});var k=e.modelLayout.$moduleContent.find(".ui-tree div[data-objectid="+c+"]"),p=k.data("level");e.UpdateCell(q,b[c]);do{var k=k.next(),f=Number(k.data("level"));if(p>=f||!k.isFound())break;f=Number(k.data("objectid"));e.UpdateCell(q,b[f])}while(1);
d.ui.ShowLoading(!1)},50);else{d.ui.ShowLoading(!0,"Updating Keys...");var n=$(a.originalEvent.currentTarget).closest(".ui-data").find(".ui-row .ui-field-menu-editor");window.setTimeout(function(){n.each(function(a,b){e.UpdateCell(q,$(b))});d.ui.ShowLoading(!1)},50)}})})};a.prototype.UpdateCell=function(a,b){if(d.library.utils.IsNotNullUndefined(b)&&b.isFound()){var e=b.data(),e=d.library.convert.ToBoolean(e.iswebkey),c=b.data("accessgrouptype"),e=this.ConvertSecurityKey(c,a,e);b.parent().find(".ui-item-shown").removeClass("item-shown ui-item-shown").end().find(".ui-field-menu-editor-caption").text(e.Value).end().find(".ui-image-button-list-item[data-key="+
e.Key+"]").addClass("item-shown ui-item-shown")}};a.prototype.ConvertSecurityKey=function(a,b,e){switch(a){case "Simple":return this.ToSimpleAccessType(b,e);case "Limited":return this.ToLimitedAccessType(b,e);case "AccessReadOnly":case "Normal":return this.ToNormalAccessType(b,e)}};a.prototype.ToNormalAccessType=function(a,e){switch(a){case "Administrator":case "FullControl":case "Limited":return new b("Administrator","Access");case "ReadOnly":return new b("ReadOnly");case "Hidden":case "NoAccess":return new b("NoAccess")}};
a.prototype.ToLimitedAccessType=function(a,e){if(e)switch(a){case "Administrator":return new b("Administrator","View/Edit/New/Delete");case "FullControl":return new b("FullControl","View/Edit/New");case "Limited":case "ReadOnly":return new b("ReadOnly","View");case "Hidden":case "NoAccess":return new b("Hidden","No Access")}else switch(a){case "Administrator":return new b("Administrator");case "FullControl":return new b("FullControl");case "Limited":case "ReadOnly":return new b("ReadOnly");case "Hidden":case "NoAccess":return new b("Hidden",
"No Access")}};a.prototype.ToSimpleAccessType=function(a,e){switch(a){case "Administrator":return new b("Administrator","Access");case "FullControl":case "Limited":case "ReadOnly":case "Hidden":case "NoAccess":return new b("NoAccess")}};return a}();f.SecurityManager=k})(d.security||(d.security={}))})(starrez||(starrez={}));
(function(d){(function(f){(function(c){c.CreateModule=function(a){a=new d.securitygroup.directory.SecurityGroupDirectoryManager(a);a.SetAsModule();return a};var a=function(a){function c(e){var g=a.call(this,e)||this;d.wizard.AttachWizardsInContainer(e.$moduleContent);return g}__extends(c,a);c.prototype.NewWizard=function(){return MVC.Wizards.SecurityGroup.GetNewSecurityGroupOptions([-1])};c.prototype.GlobalEvent=function(e,c){a.prototype.GlobalEvent.call(this,e,c);e===d.wizard.globalEventName&&"SecurityGroup"===
c.dbObjectName&&c.Key===MVC.Wizards.SecurityGroup.GetExportPermissionsOptions([c.ID]).Key&&(new MVC.SecurityGroup.GetExportedPermissions(c.ID)).Download()};c.prototype.RunDeleteWizard=function(a,b){MVC.Wizards.SecurityGroup.RunDeleteSecurityGroup(a,{CompleteFunction:b})};return c}(d.directory.DirectoryManager);c.SecurityGroupDirectoryManager=a})(f.directory||(f.directory={}))})(d.securitygroup||(d.securitygroup={}))})(starrez||(starrez={}));
(function(d){(function(f){f.InitNewItemStep1=function(c){var a=MVC.ModelJS.GetJSADManagementWizardModelBase(c),b=c.GetControl("CreationType"),k=c.GetControl("SelectedItemName"),e=c.GetControl("SelectedItemFullName"),g=c.GetControl("FilterImport"),p=c.find(".ui-import-treeview"),f=$(),l=function(){var a=c.GetControl("SelectedItemID");d.library.controls.treeview.UnbindItemSelectedEvent(a);d.library.controls.treeview.BindItemSelectedEvent(a,"securityitem",function(a,b){f=$(b.SelectedElement);k.SRVal(f.data("name"));
e.SRVal(f.data("item"))})};l();d.ui.AttachSectionInfoToggle(c,b);d.wizard.CurrentWizard.ValidateStep=function(){var e=[];"Import"===b.SRVal()&&(f.isFound()||e.push(d.error.CreateExclusiveDataErrorRule("Please select a "+a.ActiveDirectoryItem.toLowerCase()+" to add.")));return e};new d.library.ui.KeyboardSearchListener(g,function(b){b=new MVC.SecurityUser.ImportTreeview(b);b.Controller=a.Controller;b.Area=MVC.GetControllerArea(b.Controller);b.Request().done(function(a){p.html(a);d.popup.AutoHeightPopup(c);
l()})})}})(d.securityitem||(d.securityitem={}))})(starrez||(starrez={}));
(function(d){(function(f){(function(c){c.CreateModule=function(a){a=new d.securityuser.directory.UserDirectoryManager(a);a.SetAsModule();return a};var a=function(a){function c(e){var g=a.call(this,e)||this;d.wizard.AttachWizardsInContainer(e.$moduleContent);return g}__extends(c,a);c.prototype.NewWizard=function(){return MVC.Wizards.SecurityUser.GetNewUserOptions([-1])};c.prototype.RunDeleteWizard=function(a,b){MVC.Wizards.SecurityUser.RunDeleteUser(a,{CompleteFunction:b})};return c}(d.directory.DirectoryManager);
c.UserDirectoryManager=a})(f.directory||(f.directory={}))})(d.securityuser||(d.securityuser={}))})(starrez||(starrez={}));
(function(d){(function(f){(function(c){c.InitSettingScreen=function(a){var c=a.GetControl("SettingTreeView"),e=a.GetControl("Value"),g=a.GetControl("Name"),p=a.GetControl("Application"),f=MVC.ModelJS.GetJSSecurityUserGroupSettingModelBase(a),l=d.library.controls.treeview.InitTreeview(c,{OnItemSelect:function(a,b,c){a=d.library.controls.treeview.GetNodeCaption(b);b=d.library.controls.treeview.GetNodeParent(b);b=d.library.controls.treeview.GetNodeCaption(b);g.SRVal(a);p.SRVal(b);c=new MVC.SecurityGroupSetting.GetDefaultSettingValue(a,
b);"User"===f.SettingType&&(c=new MVC.SecurityUserSetting.GetDefaultSettingValue(a,b));c.Get().done(function(a){e.SRVal(a)})}});d.savablescreen.CurrentSavableScreenManager().customValidate=function(){var a=[];(""===g.SRVal()||""===p.SRVal())&&a.push(d.error.CreateExclusiveDataErrorRule("Invalid Setting","You must select a setting"));return a};var m=a.GetControl("ManuallySpecified");d.ui.AttachSectionInfoToggle(a,m,function(){if(d.library.convert.ToBoolean(m.SRVal()))g.SRVal(""),p.SRVal("");else{var a=
l.Selected();d.library.utils.IsNotNullUndefined(a)&&a.ReselectNode()}})};c.InitAddUserScreen=function(a){d.tablesetup.CreateArticleTableManager(a,{AttachRowClickEvent:!0,SelectedRowIDSelector:"securityuser",$SelectedRowIDsBindingControl:a.GetControl("SelectedSecurityUserIDs")})};c.InitAddGroupScreen=function(a){d.tablesetup.CreateArticleTableManager(a,{AttachRowClickEvent:!0,SelectedRowIDSelector:"securitygroup",$SelectedRowIDsBindingControl:a.GetControl("SecurityGroupIDs")})};var a=function(a){function c(e){return a.call(this,
e)||this}__extends(c,a);c.prototype.InitDetailListPage=function(e){var c=e.find(".sys-module-options");return c.isFound()&&(c=MVC.ModelJS.GetJSDetailListModel(c),c.ListControllerName===MVC.SecurityGroupUserList.Controller.Name||c.ListControllerName===MVC.SecurityUserGroupList.Controller.Name)?new d.securityusergroup.detailscreen.SecurityUserGroupDetailListManager(e):a.prototype.InitDetailListPage.call(this,e)};return c}(d.detailscreen.DetailScreenManager);c.SecurityUserGroupDetailScreenManager=a;
a=function(a){function d(e){e=a.call(this,e)||this;e.Init();return e}__extends(d,a);d.prototype.Init=function(){this.$container.find(".ui-detail-list-table").data("manager").Rows().each(function(a,b){var d=$(b),c=d.data("securityusergroupid");d.find(".ui-image-button-list-item").each(function(a,b){var e=$(b);e.is("[data-wizard-ids]")&&e.data("wizard-ids",[c])})})};return d}(d.detailscreenlist.DetailScreenListManager);c.SecurityUserGroupDetailListManager=a})(f.detailscreen||(f.detailscreen={}))})(d.securityusergroup||
(d.securityusergroup={}))})(starrez||(starrez={}));
(function(d){(function(f){var c=function(a){function b(b,e){var c=a.call(this,"Settings",(0<=b.indexOf("StarRez")?b:d.library.stringhelper.CamelCaseToString(b))+" Settings Saved")||this;c.category=b;c.dataSource=e;c.ShowScreen();return c}__extends(b,a);b.prototype.InitPopup=function(b){a.prototype.InitPopup.call(this,b);this.AttachChangeEvents()};b.prototype.AttachChangeEvents=function(){var a=this;this.screenAreas.$article.find(":checkbox").change(function(b){b=$(b.currentTarget);var d=b.attr("name"),
c=b.closest(".ui-controls-container").SRVal();a.screenAreas.$article.find('[data-enabledby="'+d+'"]').each(function(a,b){var e=$(b);c?e.find(".ui-controls-container").Enable():e.find(".ui-controls-container").Disable()})})};b.prototype.LoadScreenAction=function(){return new MVC.SettingsSetup.CategorySettingsEditPopup(this.dataSource,this.category)};b.prototype.SaveScreenAction=function(a){return new MVC.SettingsSetup.SaveCategorySettings(this.dataSource,this.category,a)};b.prototype.SerializeForm=
function(a){a=d.library.service.SerialiseFormToJsonObject(a,!0);a=(new d.library.collections.KeyValue(a)).ToArray();return 0";e.off("change").on("change",function(){var a=e.SRVal();""===a&&(a="");c.text(c.text().replace(f,a));$.each(d.find("option"),function(b,e){var d=
$(e);d.text(d.text().replace(f,a))});f=a})};b.prototype.SaveScreenAction=function(a){return new MVC.ResourceSetup.BulkAddResourcesSave(a,d.error.CreateErrorObject())};b.prototype.LoadScreenAction=function(){return new MVC.ResourceSetup.BulkAddResources(this.resourceTypeID)};b.prototype.ShowDataChangedMessageWarning=function(a,b,e){b&&b()};return b}(d.savablescreen.SavableScreenManager);c.BulkAddResourceScreenManager=b})(f.resource||(f.resource={}))})(d.setup||(d.setup={}))})(starrez||(starrez={}));
(function(d){(function(f){(function(c){function a(a){var e=a.GetControl("Type"),d=a.GetControl("FixedAmount");a=a.GetControl("Percentage");switch(b[e.SRVal()]){case b.FixedAmount:d.Enable();a.Disable();break;case b.Percentage:d.Disable(),a.Enable()}}var b;(function(a){a[a.FixedAmount=0]="FixedAmount";a[a.Percentage=1]="Percentage"})(b||(b={}));var k;(function(a){a[a.Day=0]="Day";a[a.Month=1]="Month";a[a.Session=2]="Session";a[a.MonthFixedDays=3]="MonthFixedDays";a[a.MonthFixedDaysCalculated=4]="MonthFixedDaysCalculated";
a[a.Week=5]="Week"})(k||(k={}));var e;(function(a){a[a.Sunday=0]="Sunday";a[a.Monday=1]="Monday";a[a.Tuesday=2]="Tuesday";a[a.Wednesday=3]="Wednesday";a[a.Thursday=4]="Thursday";a[a.Friday=5]="Friday";a[a.Saturday=6]="Saturday";a[a.CheckIn=7]="CheckIn";a[a.CheckOut=8]="CheckOut"})(e||(e={}));var g=function(){function a(b){this.$popup=b;this.deletedRateIDs=[];this.deletedChargeIDs=[];b=d.popup.GetPopupContainerAreas(this.$popup).$section;this.roomRates=d.tablesetup.CreateArticleTableManager(b.find(".ui-room-rates-container"),
{AttachRowClickEvent:!0})[0];this.roomCharges=d.tablesetup.CreateArticleTableManager(b.find(".ui-room-charges-container"),{AttachRowClickEvent:!0})[0];this.$roomRateDurationNumber=b.GetControl("RoomRateDurationNumber");this.$roomRateDurationEnum=b.GetControl("RoomRateDurationEnum");this.$roomRateDurationNights=b.GetControl("RoomRateDurationNights");this.$dayInWeekEnum=b.GetControl("DayInWeekEnum");this.$startOfMonth=b.GetControl("StartOfMonth");this.$rolloverDurationNumber=b.GetControl("RolloverDurationNumber");
this.$rolloverDurationEnum=b.GetControl("RolloverDurationEnum");this.$percentageCharges=b.GetControl("PercentageCharges");this.currencySymbol=d.GetSystemOptions().CurrencySymbol;this.$rateExplanation=b.find(".ui-rate-explanation");b=MVC.ModelJS.GetJSRoomRateSessionViewModel(b.find(".ui-fields-container"));this.isRolloverAutomatic=b.IsRolloverAutomatic;this.paidToEnabled=b.PaidToEnabled;this.SetRolloverFields();this.SetRateDurationFields();this.SetRateExplanation();this.AttachFieldEvents();this.AttachTableButtonEvents()}
a.prototype.SerializeForm=function(a,b){void 0===b&&(b=!1);var e=d.service.CreateSaveDataObject(a.find(".ui-record-fields"),b);return{__ChangedFields:e.__ChangedFields,Values:(new d.library.collections.KeyValue(e)).ToObjectProperty(),RoomRates:d.tablesetup.Serialize(this.roomRates,b),RoomCharges:d.tablesetup.Serialize(this.roomCharges,b),DeletedChargeIDs:this.deletedChargeIDs,DeletedRateIDs:this.deletedRateIDs}};a.prototype.SetRolloverFields=function(){this.isRolloverAutomatic||(this.$rolloverDurationNumber.Disable(),
this.$rolloverDurationEnum.Disable())};a.prototype.SetRateDurationFields=function(){switch(Number(this.$roomRateDurationEnum.SRVal())){case k.Day:case k.Month:0!==Number(this.$roomRateDurationNights.SRVal())&&this.$roomRateDurationNights.SRVal(0);this.$roomRateDurationNumber.Enable();this.$roomRateDurationNights.Disable();this.$dayInWeekEnum.Disable();Number(this.$roomRateDurationEnum.SRVal())==k.Month?this.$startOfMonth.Enable():this.$startOfMonth.Disable();break;case k.Week:0!==Number(this.$roomRateDurationNights.SRVal())&&
this.$roomRateDurationNights.SRVal(0);this.$roomRateDurationNumber.Enable();this.$roomRateDurationNights.Disable();this.$dayInWeekEnum.Enable();this.$startOfMonth.Disable();break;case k.MonthFixedDays:case k.MonthFixedDaysCalculated:this.$roomRateDurationNumber.Enable();this.$roomRateDurationNights.Enable();this.$dayInWeekEnum.Disable();this.$startOfMonth.Disable();break;case k.Session:case k.MonthFixedDaysCalculated:1!==Number(this.$roomRateDurationNumber.SRVal())&&this.$roomRateDurationNumber.SRVal(1);
this.$roomRateDurationNumber.Disable();this.$roomRateDurationNights.Enable();this.$dayInWeekEnum.Disable();this.$startOfMonth.Disable();break;default:throw"Invalid room rate duration: "+this.$roomRateDurationEnum.SRVal();}};a.prototype.SetRateExplanation=function(){var a;switch(Number(this.$roomRateDurationEnum.SRVal())){case k.Day:a=d.library.utils.FormatString("The amount will be charged every {0} {1}.",this.$roomRateDurationNumber.SRVal(),d.library.stringhelper.Pluralize("night","nights",Number(this.$roomRateDurationNumber.SRVal())));
this.paidToEnabled&&(a+=" Rent paid-to dates will be calculated in the same way, but if a booking has a remainder of nights less than the duration, then a calculated daily rate will be used.");break;case k.Week:a=d.library.utils.FormatString("The amount will be charged every {0} {1}, starting from {2}. If a booking has a remainder of nights to be charged that do not amount to a week, then the booking will be charged for a full week.",this.$roomRateDurationNumber.SRVal(),d.library.stringhelper.Pluralize("week",
"weeks",Number(this.$roomRateDurationNumber.SRVal())),e[Number(this.$dayInWeekEnum.SRVal())]);this.paidToEnabled&&(a+=" Rent paid-to dates will be calculated in the same way, except when a booking has a remainder of nights to be paid that do not amount to a week, then a calculated daily rate will be used.");break;case k.Month:a=d.library.utils.FormatString("The amount will be charged every {0} {1}.",this.$roomRateDurationNumber.SRVal(),d.library.stringhelper.Pluralize("month","months",Number(this.$roomRateDurationNumber.SRVal())));
if(this.paidToEnabled){var b=Number(this.$startOfMonth.SRVal());a=1>b||28g?alert("Please select room "+a+" to delete."):d.ui.RequestConfirmation("Are you sure you wish to delete "+(1Please select a task template.'))}})};a.prototype.GetDescription=function(){var a="New Item",b=$(".ui-tasktemplate-edit-screen");b.isFound()&&(b=b.GetControl("Description"),b.isFound()&&(a=b.SRVal()));return a};return a}();f.TaskTemplateSetup=
a})(d.tasksetup||(d.tasksetup={}))})(starrez||(starrez={}));
(function(d){(function(f){function c(b,e,d,c,g,k){var f=$('');f.click(function(b){a(b.currentTarget,e,d,c,g,k)});b.append(f)}function a(a,b,e,c,g,k){d.ui.ShowQuestion("Remove this file from the template?").done(function(f){if(f){f=$(a);if(c){var u=f.parent().data("attachmentid");k.filter(function(a){return a.recordAttachmentID===u})[0].toBeDeleted=!0;g.SRVal(d.library.service.ConvertObjectToJSONString(k));d.library.controls.FlagChanged(g)}else(new MVC.Attachment.DeleteEmailAttachment(b,
e)).Request().done(function(){var a=k.filter(function(a){return a.description===b})[0];k.splice(k.indexOf(a),1);g.SRVal(d.library.service.ConvertObjectToJSONString(k));d.library.controls.FlagChanged(g)});f.parent().fadeOut().remove()}})}function b(a,b,e,c,g,f,r,u){switch(r){case k.SMS:b.show();a.show();e.hide();c.hide();g.hide();break;case k.Email:b.hide();a.hide();e.show();c.hide();g.hide();break;case k.MailMerge:b.hide();a.hide();e.hide();c.show();g.hide();break;case k.MobileOnboardingEmail:b.hide();
a.hide();e.hide();c.hide();g.show();break;default:a.show(),b.hide(),e.hide(),c.hide(),g.hide()}u&&(d.library.controls.FlagChanged(f),r==k.Email&&(d.library.controls.FlagChanged(e.GetControl("CCAddressOnlyFirst")),d.library.controls.FlagChanged(e.GetControl("BCCAddressOnlyFirst"))))}var k;(function(a){a[a.General=0]="General";a[a.Email=1]="Email";a[a.MailMerge=2]="MailMerge";a[a.SMS=3]="SMS";a[a.Portal=4]="Portal";a[a.MobileOnboardingEmail=9999]="MobileOnboardingEmail"})(k=f.CorrespondenceSource||
(f.CorrespondenceSource={}));var e=function(){return function(){this.recordAttachmentID=-1;this.description="";this.toBeDeleted=!1}}();f.SimpleTemplateAttachment=e;f.InitTemplateEdit=function(a){var e=MVC.ModelJS.GetJSTemplateEditorModel(a),g=a.GetControl("TemplateText"),k=a.find(".ui-text-template"),f=a.find(".ui-sms-template"),q=a.find(".ui-email-template"),r=a.find(".ui-mailmerge-template"),u=a.find(".ui-mobile-onboarding-template"),s=a.GetControl("CorrespondenceSourceID"),t=a.find(".ui-btn-add-files"),
v=$("#"+e.FileUploadHtmlID),w=a.find(".ui_uploadedFiles"),x=a.GetControl("DummyAttachmentsCollection"),z=[];$.each(w.find(".ui-data-origin-interactive"),function(a,b){var e=$(b),e={recordAttachmentID:e.data("attachmentid"),description:e.text(),toBeDeleted:!1};z.push(e)});x.SRVal(d.library.service.ConvertObjectToJSONString(z));b(k,f,q,r,u,g,Number(s.SRVal()),!1);s.change(function(){b(k,f,q,r,u,g,Number(s.SRVal()),!0)});d.upload.InitEmailUploadAttachment(e.TemporaryAttachmentFolder,function(a){var b=
!1,g=z.filter(function(b){return b.description===a})[0];d.library.utils.IsNotNullUndefined(g)&&(b=!0);b||(b=$(""),g=$(""),g.text(a),b.append(g),$("#uploadedFiles").append(b),c(b,a,e.TemporaryAttachmentFolder,!1,x,z),z.push({recordAttachmentID:-1,description:a,toBeDeleted:!1}),x.SRVal(d.library.service.ConvertObjectToJSONString(z)),d.library.controls.FlagChanged(x));v.hide()});t.SRClick(function(){v.toggle()});$.each($("#uploadedFiles li.ui-data-origin-interactive"),
function(a,b){var d=$(b).find("span").text();c($(b),d,e.TemporaryAttachmentFolder,!0,x,z)})};f.AddRemoveAttachmentButton=c;f.InitTemplateSetup=function(a){return new g(a)};var g=function(){function a(b){this.$treeview=b.find(".ui-treeview-container");this.$detail=b.find(".ui-template-setup-info");this.AttachTreeViewEvents();this.$treeview.find(".ui-tree-view-row-item:first").click()}a.prototype.AttachTreeViewEvents=function(){var a=this;d.library.controls.treeview.InitTreeview(this.$treeview,{OnItemSelect:function(b,
e,d){a.OnTreeViewClick(d)},OnFolderSelect:function(b,e,d){a.OnTreeViewClick(d)},OnDeleteComplete:function(){a.$treeview.find(".ui-tree-view-row-item:first").click()}});this.$treeview.find(".ui-admin-button").SRClick(function(b){a.AttachAdminManager()})};a.prototype.OnTreeViewClick=function(a){var b=this;(new MVC.TemplateSetup.Show(a)).Get().done(function(a){b.$detail.html(a);b.InitMenus();b.SubscribeToGlobalEvents()})};a.prototype.AttachAdminManager=function(){var a=this;(new d.controls.treeviewslider.TreeSliderAdminManager("TemplateSetup",
$.noop,function(){(new MVC.TemplateSetup.GetTreeView).Request().done(function(b){b=$(b);a.$treeview.replaceWith(b);a.$treeview=b;a.AttachTreeViewEvents()})})).ShowListAdminPopup("Template")};a.prototype.InitMenus=function(){d.actionlink.AttachActionLinksEvents(this.$detail.find(".ui-template-setup-container"),function(a){a.EventType===d.actionlink.ActionLinkTypes.Delete&&d.setup.DeleteRecord(a.$me,MVC.TemplateSetup.Controller.Name,"template")})};a.prototype.SubscribeToGlobalEvents=function(){var a=
this;d.UnbindEvent(this.generalObserver);this.generalObserver=d.BindEvent(function(b,e){if(e.dbObjectName===MVC.TemplateSetup.Controller.Name){var c=d.library.controls.treeview.SelectedItem(a.$treeview);if(d.library.stringhelper.Equals(b,"Save.Complete",!0)){var g=a.GetDescription();g&&(c.find("span:nth-child(2)").text(g),c.click())}}})};a.prototype.GetDescription=function(){var a="New Item",b=$(".ui-template-edit");b.isFound()&&(b=b.GetControl("Description"),b.isFound()&&(a=b.SRVal()));return a};
return a}();f.TemplateSetup=g})(d.templatesetup||(d.templatesetup={}))})(starrez||(starrez={}));
(function(d){(function(f){(function(c){var a=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.InitMenus=function(){var a=this,b=this.$detail.find(".ui-template-setup-container");d.actionlink.AttachActionLinksEvents(b,function(a){a.EventType===d.actionlink.ActionLinkTypes.Delete&&d.setup.DeleteRecord(a.$me,MVC.TemplateSetup.Controller.Name,"template")});b.SRClickDelegate("edit-link","[data-srelement='Edit_Link']",function(a){a=$(a.currentTarget).data();
d.advancedemail.template.LaunchTemplateWizard("react-advanced-email-wizard",a.id)});if(!sessionStorage.getItem("TemplateDismissed")){var c=this.$detail.find("#legacy-template-banner");c.show();c.SRClickDelegate("close-upgrade-banner","#legacy-template-banner-close-button",function(a){c.hide();sessionStorage.setItem("TemplateDismissed","true")});c.SRClickDelegate("open-old-templates","#legacy-template-banner-link",function(b){a.CloseCurrentPopupWindow(b.target);a.OpenLegacyTemplateWizard()})}};c.prototype.CloseCurrentPopupWindow=
function(a){d.popup.Close($(a))};c.prototype.OpenLegacyTemplateWizard=function(){(new MVC.GenericCaller("TemplateSetup","ShowSetup",{})).ShowPopup("custom-setup",d.library.service.RequestType.Get);d.starcare.LoadModuleHelp("Setup","TemplateSetup")};c.prototype.AttachTreeViewEvents=function(){var e=this;a.prototype.AttachTreeViewEvents.call(this);this.$treeview.find(".ui-admin-button").SRClick(function(a){e.AttachAdminManager()})};c.prototype.OnTreeViewClick=function(a){var b=this;(new MVC.EmailTemplateSetup.Show(a)).Get().done(function(a){b.$detail.html(a);
b.InitMenus();b.SubscribeToGlobalEvents()})};c.prototype.AttachAdminManager=function(){var a=this;(new d.controls.treeviewslider.TreeSliderAdminManager("EmailTemplateSetup",$.noop,function(){(new MVC.EmailTemplateSetup.GetTreeView).Request().done(function(b){b=$(b);a.$treeview.replaceWith(b);a.$treeview=b;a.AttachTreeViewEvents()})})).ShowListAdminPopup("Template")};c.prototype.SubscribeToGlobalEvents=function(){var a=this;d.UnbindEvent(this.generalObserver);this.generalObserver=d.BindEvent(function(b,
c){if(c.dbObjectName===MVC.EmailTemplateSetup.Controller.Name){var k=d.library.controls.treeview.SelectedItem(a.$treeview);d.library.stringhelper.Equals(b,"Save.Complete",!0)&&(c.Data&&c.Data.templateName)&&(k.find("span:nth-child(2)").text(c.Data.templateName),k.click())}})};return c}(f.TemplateSetup);c.InitEmailTemplateSetup=function(b){return new a(b)}})(f.email||(f.email={}))})(d.templatesetup||(d.templatesetup={}))})(starrez||(starrez={}));
(function(d){(function(f){var c,a;f.InitAddEditScreen=function(b){var g=b.GetControl("PaymentOrRefund"),k=b.GetControl("PaymentTypeID"),f=b.GetControl("AutoPayMaximum"),l=g.find(":input");l.change(function(b){l.prop("checked")?(k.Enable(),f.Enable()):(k.Disable(),f.Disable());void 0!==a&&a()});c=function(){return l.prop("checked")};d.savablescreen.CurrentSavableScreenManager().ExternalCancel=d.utils.CreateSimplePromiseMethod(function(){c=void 0})};f.InitItemAddEditScreen=function(a){d.library.convert.ToBoolean(a.data("editmode"))&&
a.data("manager",new k(a))};var b;(function(a){a[a.Telephone=0]="Telephone";a[a.Transfer=1]="Transfer";a[a.Payment=2]="Payment";a[a.Refund=3]="Refund";a[a.Adjustment=4]="Adjustment";a[a.Charge=5]="Charge"})(b||(b={}));var k=function(){function e(b){var e=this;this.$container=b;var k=b.GetControl("TemplatePaymentOrRefund");this.$transactionTypeControl=b.GetControl("TransactionTypeEnum");this.$chargeItemControl=b.GetControl("ChargeItemID");this.$chargeGroupControl=b.GetControl("ChargeGroupID");this.$autoPayOverrideControl=
b.GetControl("AutoPayOverride");this.$amountControl=b.GetControl("Amount");this.$taxRatePara=b.find(".ui-taxrate");this.$excludingTaxPara=b.find(".ui-taxexcluded");this.getIsPaymentOrRefund=void 0!==c?c:function(){return d.library.convert.ToBoolean(k.SRVal())};a=function(){e.FilterTransactionTypes();e.RearrangeAmountField();e.RearrangeChargeField();e.getIsPaymentOrRefund()&&d.library.controls.treeview.Deselect(e.$chargeItemControl)};a();this.AttachChargeEvents();this.InitAmountOptions()}e.prototype.InitAmountOptions=
function(){var a=this,b=this.$container.GetControl("AmountOption");this.$container.GetControl("AmountOption").SRClick(function(e){"2"===$(e.currentTarget).SRVal()?a.$amountControl.Enable():(a.$amountControl.SRVal(0),a.$amountControl.Disable());a.$autoPayOverrideControl.SRVal("1"===b.SRVal())});this.$amountControl.change(function(b){return a.RecalculateTax()})};e.prototype.AttachChargeEvents=function(){var a=this;this.$chargeItemControl.change(function(b){a.getIsPaymentOrRefund()||a.RecalculateTax(!0)})};
e.prototype.GetChargeItemID=function(a){a=this.$chargeItemControl.find(".ui-treeview-list span[data-dbobject=ChargeGroup][data-id="+a+"]").closest("li").find("ul li span[data-dbobject=ChargeItem]").first();return!a.isFound()?0:a.data("id")};e.prototype.RecalculateTax=function(a){var b=this;void 0===a&&(a=!1);var e=Number(this.$chargeItemControl.SRVal()),d=Number(this.$amountControl.SRVal());isNaN(d)||(new MVC.Transaction.CalculateTax(d,e)).Request().done(function(e){b.$taxRatePara.text(e.TaxRate);
b.$excludingTaxPara.text(e.ExcludingTax);a&&b.$chargeGroupControl.SRVal(e.ChargeGroupID)})};e.prototype.RearrangeAmountField=function(){this.getIsPaymentOrRefund()?(this.$container.find(".ui-amount-options").show(),this.$container.find(".ui-autopay-text").show(),this.$container.find(".ui-amount-options input:checked").click(),this.$amountControl.addClass("optioned"),this.$taxRatePara.hide(),this.$excludingTaxPara.hide()):(this.$container.find(".ui-amount-options").hide(),this.$container.find(".ui-autopay-text").hide(),
this.$amountControl.Enable(),this.$amountControl.removeClass("optioned"),this.$taxRatePara.show(),this.$excludingTaxPara.show())};e.prototype.RearrangeChargeField=function(){this.getIsPaymentOrRefund()?(this.$chargeGroupControl.closest("li").show(),this.$chargeItemControl.closest("li").hide()):(this.$chargeGroupControl.closest("li").hide(),this.$chargeItemControl.closest("li").show(),this.RecalculateTax())};e.prototype.FilterTransactionTypes=function(){var a=this.getIsPaymentOrRefund(),e=[b.Payment,
b.Refund],d=this.$transactionTypeControl.SRVal(),c=[];this.$transactionTypeControl.find("option").each(function(b,d){var k=$(d),f=Number(k.val()),f=-1=Number(b.SRVal())&&a.push(d.error.CreateExclusiveDataErrorRule("Please enter a violation type"));0>=Number(c.SRVal())&&a.push(d.error.CreateExclusiveDataErrorRule("Please enter a violation sub-type"));
return a}};c.InitAddAppealStep2=function(a){d.wizard.CurrentWizard.InitMultiAddFunction(a);var b=a.GetControl("IncidentEntryViolationID");d.wizard.CurrentWizard.ValidateStep=function(){var a=[];0>Number(b.SRVal())&&a.push(d.error.CreateExclusiveDataErrorRule("Please select a violation"));return a}}})(f.wizards||(f.wizards={}))})(d.incident||(d.incident={}))})(starrez||(starrez={}));
(function(d){(function(f){function c(a,b){a.change(function(){(new MVC.Program.GetProgramSubTypes(a.SRVal())).Request(function(a){b.SRFillDropdown(a)})})}f.InitNewProgramScreen=function(a){var b=a.GetControl("ProgramTypeID");a=a.GetControl("ProgramSubTypeID");c(b,a)};f.InitGeneralInfo=function(a){var b=a.GetControl("ProgramTypeID");a=a.GetControl("ProgramSubTypeID");c(b,a)};f.AttachProgramTypeChange=c;f.InitCheckInOut=function(b){return new a(b)};var a=function(){function a(e){var c=this;this.$container=
e;this.barcodeScanned=!1;this.$barcodeControl=e.GetControl("Barcode");this.$barcodeInput=this.$barcodeControl.find(":input");this.$lastScannedArea=e.find(".ui-last-scanned");this.popupAreas=d.popup.GetPopupContainerAreas(e);var k=MVC.ModelJS.GetJSProgramScanWizardViewModel(e);this.scanAction=b[k.ScanType];this.programID=k.ProgramID;this.checkInReportID=k.CheckIn_ReportID;this.printOnCheckIn=k.PrintOnCheckIn;this.popupAreas.$footer.find(".ui-btn-ok").SRHide();d.barcode.InitBarcodeScanner(e,this.$barcodeControl,
function(a){c.OnScan(a)},this.popupAreas);this.AttachEvents()}a.prototype.AttachEvents=function(){d.popup.BindCloseEvent("ProgramEntry",function(a){a=d.sm.GetScreenManager();var b=a.GetCurrentScreen();d.library.utils.IsNotNullUndefined(b)&&d.library.stringhelper.Equals(b.currentSection.controller,"ProgramAttendees",!0)&&a.ReloadCurrentScreen();d.popup.UnbindCloseEvent("ProgramEntry")})};a.prototype.OnScan=function(a){var c=this;if(!1===this.barcodeScanned&&(this.barcodeScanned=!0,d.validation.ValidateForm(this.$container,
void 0,!0))){d.library.service.SerialiseFormToJsonObject(this.$container).Barcode=a;var k="";switch(this.scanAction){case b.CheckIn:k="checking-in";break;case b.CheckOut:k="checking-out"}(new MVC.ProgramEntry.CheckInOutAttendee(a,this.programID,this.scanAction)).Request({ActionVerb:d.library.service.RequestType.Post,Message:k+"..."}).done(function(a,e,k){c.$barcodeInput.val("");c.$lastScannedArea.html(a);k=c.$lastScannedArea.find(".ui-last-scanned-result");e=d.library.convert.ToBoolean(k.data("successful"));
a=Number(k.attr("programEntryID"));k=k.attr("tablename");var p;switch(c.scanAction){case b.CheckIn:p="checked-in";break;case b.CheckOut:p="checked-out"}e?(d.ui.ShowSuccessMessage("Attendee successfully "+p),c.printOnCheckIn&&(p=new d.reportexporter.SavedReportExporter(c.checkInReportID,null,d.report.ReportsViewMode.PDF),p.tableID=a,p.tableName=k,p.showInPopup=!0,p.autoClosePopup=d.GetSystemOptions().AutoCloseReportAfterPrint,p.autoClosePopupDelay=d.GetSystemOptions().AutoCloseReportAfterPrintDelaySeconds,
p.displayType=d.report.ReportExportAction.Print,p.Export())):d.ui.ShowErrorMessage("Attendee could not be "+p);d.popup.AutoHeightPopup(c.$container);c.barcodeScanned=!1})}};return a}();f.CheckInOutScanner=a;var b;(function(a){a[a.CheckIn=0]="CheckIn";a[a.CheckOut=1]="CheckOut"})(b||(b={}))})(d.program||(d.program={}))})(starrez||(starrez={}));
(function(d){(function(f){(function(c){var a=function(a){function d(e){return a.call(this,e)||this}__extends(d,a);return d}(d.campuslife.detailscreen.CampusLifeItemDetailScreenMangerBase);c.ProgramDetailScreenManger=a})(f.detailscreen||(f.detailscreen={}))})(d.program||(d.program={}))})(starrez||(starrez={}));
(function(d){(function(f){(function(c){c.CreateModule=function(a){a=new d.program.directory.ProgramDirectoryManager(a);a.SetAsModule();return a};var a=function(a){function d(e){return a.call(this,e)||this}__extends(d,a);d.prototype.RunDeleteWizard=function(a,b){MVC.Wizards.Program.RunDeleteProgram(a,{CompleteFunction:b})};return d}(d.directory.DirectoryManager);c.ProgramDirectoryManager=a})(f.directory||(f.directory={}))})(d.program||(d.program={}))})(starrez||(starrez={}));
(function(d){(function(f){f.CollapsibleCardViewInit=function(c){var a=c.children(".ui_collapsibleCardView_header"),b=c.children(".ui_collapsibleCardView_body"),k=b.children(".ui-active-table"),e=c.find(".ui_collapsibleCardView_header_caption").text(),g=function(a){(new MVC.Settings.SaveCollapsibleCardViewState(e,a)).Request({ShowLoading:!1})};a.SRClick(function(a){c.hasClass("ui_collapsibleCardView_expanded")?(b.AriaHide(),g(!1)):(g(!0),b.AriaShow(),k.isFound()&&d.tablesetup.CreateTableManager(k,
b));c.toggleClass("ui_collapsibleCardView_expanded");c.toggleClass("srw_collapsibleCardView_expanded")})}})(d.components||(d.components={}))})(starrez||(starrez={}));
(function(d){(function(f){f.CollapsibleDetailViewInit=function(c){var a=c.find(".ui_collapsibleDetailView_toggle"),b=c.children(".ui_collapsibleDetailView_body"),k=b.find(".ui-active-table");a.SRClick(function(a){!0===d.library.convert.ToBoolean(c.attr("aria-expanded"))?c.attr("aria-expanded","false"):(c.attr("aria-expanded","true"),k.isFound()&&d.tablesetup.CreateTableManager(k,b))})}})(d.components||(d.components={}))})(starrez||(starrez={}));
(function(d){(function(f){f.ImageDisplayManager=function(c){var a=MVC.ModelJS.GetJSImageDisplayManagerModel(c),b=c.find(".ui_imageDisplayManager_image"),k=c.find(".ui_imageDisplayManager"),e=c.find(".ui_imageDisplayManager_options"),g=c.find(".ui_imageDisplayManager_removeImage"),p=c.find(".ui_imageDisplayManager_upload"),f=c.find(".ui_imageDisplayManager_showFullSize"),l=c.find("#"+a.ImageUploadModelPopupContainerID),m=c.find("#"+a.ImageUploadModelID);d.ui.AddLightBox(c);$("#srw_container").append(l);
var n=d.BindEvent(function(b,e){b===d.sm.detailsClosedEvent&&(e.dbObjectName.toLowerCase()===a.DBObjectName.toLowerCase()&&e.ID===a.ID)&&(l.remove(),d.UnbindEvent(n))}),q=!1,r=function(a){q&&!a?(e.AriaHide(),q=!1,k.removeClass("srw_imageDisplayManager_displayEdit"),$(document).off("click.ImageDisplayManager")):a&&(e.AriaShow(),q=!0,k.addClass("srw_imageDisplayManager_displayEdit"),$(document).on("click.ImageDisplayManager",function(a){$(a.target).hasClass("ui_imageDisplayManager")||r(!1)}))},u=function(){d.upload.SetBackgroundImage(b);
var e=d.upload.MakeImageURL(a.DBObjectName,a.ID,1E3);c.find(".ui-lightbox").prop("href",e)},m={Url:"/attachment/"+a.UploadAction,mulitple:!1,buttonText:"Upload an Image",$container:m,Complete:function(){u();l.hide();r(!1);d.FireEvent("Event",a.DBObjectName,a.ID)},Fail:function(a){d.ui.ShowErrorMessage("File Upload Failed!")},ExtraData:function(){var b=[];b.push({name:"ID",value:a.ID.toString()});return b},FileTypes:d.upload.SupportedImageFileTypes()};d.upload.FileUploader(m);g.SRClick(function(){d.ui.ShowQuestion("Are you sure you want to remove the current image?",
"Remove Image",void 0).done(function(b){b&&(new MVC.GenericCaller("StarRezWeb","Attachment",a.RemoveAction,{ID:a.ID})).Request().done(function(){u();d.FireEvent("Event",a.DBObjectName,a.ID)})})});p.SRClick(function(){l.css({display:"flex"})});c.click(function(a){r(!q)});f.SRClick(function(){r(!1);var a=c.find("a.ui-lightbox");a.colorbox({returnFocus:!1});a.click()})}})(d.components||(d.components={}))})(starrez||(starrez={}));
(function(d){(function(f){function c(a){return{RelativeDateOption:a.GetControl("RelativeDateOption").SRVal(),AsAtMidnight:a.GetControl("AsAtMidnight").SRVal(),DateTimeIntervalType:a.GetControl("DateTimeIntervalType").SRVal(),DateTimeIntervalValue:a.GetControl("DateTimeIntervalValue").SRVal(),SourceDateHasTime:a.GetControl("SourceDateHasTime").SRVal()}}function a(a,d,e,c){return{RelativeDateOption:a,AsAtMidnight:d,DateTimeIntervalValue:c,DateTimeIntervalType:e}}f.Highlight=function(a){};f.IsMyControl=
function(a){return a.hasClass("ui_relativeDatePicker")};f.SetValue=function(a,d){a.GetControl("RelativeDateOption").SRVal(d.RelativeDateOption);a.GetControl("AsAtMidnight").SRVal(d.AsAtMidnight.toString());a.GetControl("DateTimeIntervalValue").SRVal(d.DateTimeIntervalValue);a.GetControl("DateTimeIntervalType").SRVal(d.DateTimeIntervalType)};f.GetValue=c;f.GetName=function(a){return a.attr("data-fieldname")};f.GetCaption=function(a){return a.find(".ui_relativeDatePickerCaption").text()};f.IsValueValid=
function(a){return""===a.GetControl("DateTimeIntervalValue").SRVal()?{IsValid:!1,Message:"Please enter a valid input for Date Time Interval Value",Type:d.library.validation.ValidationType.Ignorable}:{IsValid:!0,Message:void 0,Type:d.library.validation.ValidationType.Ignorable}};f.AttachKeyboardSupport=function(){};f.Init=function(b){var k=b.find(".ui_relativeDatePickerDropdownSelector"),e=b.find(".ui_relativeDatePickerCaption"),g=b.find(".ui_relativeDatePickerDropdownWrapper"),p=b.find(".ui_relativeDatePickerBackground"),
f=function(){g.AriaVisible()?(g.AriaHide(),p.hide()):(g.AriaShow(),p.show())},l=function(){g.AriaVisible()&&(g.AriaHide(),p.hide())};k.SRClick(function(){f()});k.keydown(function(a){a.keyCode===d.keyboard.Keys.EnterKeyCode||a.keyCode===d.keyboard.Keys.SpaceBar||a.keyCode===d.keyboard.Keys.ArrowDown?f():a.keyCode===d.keyboard.Keys.Escape&&l()});g.keydown(function(a){a.keyCode===d.keyboard.Keys.Escape&&l()});p.SRClick(function(){g.AriaHide();p.hide()});k=g.GetControl("RelativeDateOption").SRVal();if("0"===
k||"1"===k)g.GetControl("DateTimeIntervalType").Disable(),g.GetControl("DateTimeIntervalValue").Disable();b.GetAllControls().change(function(b){c(g);b=g.GetControl("RelativeDateOption").SRVal();var k=g.GetControl("AsAtMidnight").SRVal(),p=g.GetControl("DateTimeIntervalType").SRVal(),f=g.GetControl("DateTimeIntervalValue").SRVal();""===f&&g.GetControl("DateTimeIntervalValue").SRVal(0);"0"===b||"1"===b?(g.GetControl("DateTimeIntervalType").Disable(),g.GetControl("DateTimeIntervalValue").Disable()):
(g.GetControl("DateTimeIntervalType").Enable(),g.GetControl("DateTimeIntervalValue").Enable());var h=d.library.convert.ToObjectForServerString(d.library.service.SerialiseFormToJsonObject(g));(new MVC.Controls.GetRelativeDatePickerCaption(h)).Request().done(function(a){e.html(a)});a(b,k,p,f)})};f.UpdateRelativeDatePickerValue=a})(d.RelativeDatePicker||(d.RelativeDatePicker={}))})(starrez||(starrez={}));
(function(d){(function(f){var c;(function(a){a[a.empty=0]="empty";a[a.hasData=1]="hasData";a[a.drillIn=2]="drillIn";a[a.search=3]="search"})(c||(c={}));f.Highlight=function(a){};f.IsMyControl=function(a){return a.hasClass("ui_searchableNestedDropdown")};f.SetValue=function(a,b){a.attr("data-value",b);"0"===b?a.attr("data-state","empty"):a.attr("data-state","hasData")};f.SetFolder=function(a,b){a.attr("data-folder",b)};f.GetValue=function(a){return a.attr("data-value")};f.GetName=function(a){return a.attr("data-fieldname")};
f.GetCaption=function(a){return a.attr("data-caption")};f.SetCaption=function(a,b){a.find(".ui_searchableNestedDropdown_header_selected_text_value").text(b);a.attr("data-state","hasData")};f.GetFolderID=function(a){return Number(a.attr("data-folder"))};f.GetFolderIDOfItem=function(a){return Number(a.attr("data-folderid"))};f.GetFolderCaption=function(a){return a.attr("data-foldercaption")};f.GetItemID=function(a){return Number(a.attr("data-value"))};f.GetItemIDOfItem=function(a){return Number(a.attr("data-id"))};
f.IsValueValid=function(a){return null};f.AttachKeyboardSupport=function(){};f.Init=function(a){function b(a,b,e){a=a.split(".");for(var d=a.pop(),c=0;c=e&&I(c)},500))};C.keydown(function(a){a.keyCode===d.keyboard.Keys.EnterKeyCode?(d.library.utils.SafeStopPropagation(a),I(a.target.value)):a.keyCode===d.keyboard.Keys.ArrowDown&&(d.library.utils.SafeStopPropagation(a),t.find(".srw_searchableNestedDropdown_page").last().find("li:first").SRFocus());O(a.target.value)});var O=function(b){0Click on a record to show further information & actions.")};f.prototype.FoxyGraphMoveDrop=function(a,b,e){var c=this,g=$.Deferred(),k=!1,p,f;switch(b.DBObjectName.toLowerCase()){case "functionroombooking":case "functionbooking":case "functionresourcebooking":k=!0;f="Function";p={DBObjectName:"FunctionBooking",RowTitle:"Room Booking",IntervalStart:"Start Date",IntervalEnd:"End Date",
RowGroup:"Function Room Type"};break;case "functionroomclosed":k=!0;f="Function Room Closure";p={DBObjectName:"FunctionRoomClosed",RowTitle:"Function Room Closure",IntervalStart:"Start Date",IntervalEnd:"End Date",RowGroup:"Function Room Type"};break;default:alert("Unknown DbObjectName: "+b.DBObjectName.toLowerCase())}!1===k?(alert("You don't have permission to move "+name),g.resolve(!1)):d.ui.ShowQuestion(d.pageablefoxygraph.GenerateMoveConfirmationMessage(p,a,b,e,"