angular.module("RegisterOfActionsApp",["ngAria","ngRoute","TylerUI","TylerUI.Components","gettext","ngScrollSpy"]).constant("appConfig",window.appConfig).config(["$routeProvider","$locationProvider","appConfig","$httpProvider",function(n,t,i,r){function e(n){if(n.authmethod=="auth"&&!window.appConfig.token){if(i.ngNoToken&&!confirm("An error occurred while validating your login session.  Try again?"))return f;var t=$.param({id:n.id,isAuthenticated:"true",mode:n.mode||n.mode==0?n.mode:undefined,ngNoToken:"true"});location.href=i.virtualDirectory+"?"+t;return}return n.mode!=undefined&&(i.roaMode=n.mode,$("body").addClass(n.mode.split(",").join(" "))),u}r.defaults.headers.get||(r.defaults.headers.get={});r.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT";r.defaults.headers.get["Cache-Control"]="no-cache";r.defaults.headers.get.Pragma="no-cache";var f=i.virtualDirectory+"Areas/RegisterOfActions/Views/Index/Unauthorized.html",u=i.virtualDirectory+"Areas/RegisterOfActions/Views/ROA/RegisterOfAction.html",o=i.virtualDirectory+"Areas/RegisterOfActions/Views/Index/PrintToPdf_Loading.html";n.when("/",{templateUrl:u,controller:"ROACtrl"}).when("/unauthorized",{templateUrl:f}).when("/pdfLoading",{templateUrl:o,controller:"ROACtrl"}).when("/:id",{templateUrl:u,controller:"ROACtrl"}).when("/:id/:authmethod",{templateUrl:e,controller:"ROACtrl"}).when("/:id/:authmethod/:mode",{templateUrl:e,controller:"ROACtrl"}).otherwise({redirectTo:"/"});t.html5Mode(!1)}]).run(["appConfig","ttLocale","gettextCatalog",function(n,t,i){t.init(i);t.setCurrentLanguage(n.acceptLanguages);t.setDebug(!0)}]).directive("templateInclude",function(){return{restrict:"CAE",scope:{src:"=",templateInclude:"="},transclude:!0,link:function(n){n.$on("$includeContentError",function(){n.loadFailed=!0});n.$on("$includeContentLoaded",function(){n.loadFailed=!1})},template:"<div ng-include='src||templateInclude' ng-show='loadFailed'><\/div><div ng-show='loadFailed' ng-transclude/>"}});$(angular.element(document).ready(function(){angular.bootstrap(angular.element(app),["RegisterOfActionsApp"],{strictDi:!1})}));$(function(){window.top!=window.self&&window.top.postMessage(JSON.stringify({act:"set-dialog-title",value:document.title}),"*")});var useExternalDocumentViewer=function(n){return $("body").hasClass("use-external-document-viewer")||$("body").hasClass("jeapp")&&n.IconURI.indexOf("jeapp")>-1||appConfig.roaMode=="portalembed"};angular.module("RegisterOfActionsApp").controller("ROACtrl",["$scope","$routeParams","$mdDialog","$window","$timeout","ROAService","focus","appConfig","$anchorScroll","$location","$mdMedia","$http","$q","$log",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v){function g(){return t.id?t.id.split("?")[0].split("&")[0]:""}function k(n){return n&&n.indexOf("jeapp")>-1?"roa-icon-jeapp":"roa-icon"}function nt(n,t){return"Content/images/"+(p(n)?t.IconURI:"NonPublicImageView.gif")}function p(n){return n&&n.NotForPublicViewFlag!==undefined?n.NotForPublicViewFlag==0:n&&n.Document&&n.Document.NotForPublicViewFlag==0}function y(n){return!!n&&n!==""}function tt(n,t){try{return n()}catch(i){return t}}function d(t,u,f,e){w(u)?useExternalDocumentViewer(t)?(u.CaseNumber=n.data.summary.CaseSummaryHeader.CaseNumber,e&&(u.sourceData={contextType:e.contextType},e.context&&e.context.Event&&e.context.Event.TypeId&&(u.sourceData.eventName=e.context.Event.TypeId.Description)),it(u,f)):l.get(o.serviceUri+"api/ViewDocument?caseId="+this.searchparams.caseId+"&fragmentId="+t.URI,{responseType:"arraybuffer"}).success(function(t,i,u){var f=new Blob([t],{type:u("Content-Type")}),e;f.name=n.data.summary.CaseSummaryHeader.CaseNumber;window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(f,n.data.summary.CaseSummaryHeader.CaseNumber+st(u("Content-Type"))):(e=window.URL.createObjectURL(f),r.open(e,"_blank"),window.URL.revokeObjectURL(f))}):i.show(i.alert().clickOutsideToClose(!0).title("Warning").textContent("You are not authorized to view this document.").ok("OK"))}function it(t,i){var u,f,e;ot()&&(u=rt(i),f={document:t,documentId:u,nodeId:ut(t.DocumentNodes,u),caseId:"",documentType:t.DocumentTypeID&&t.DocumentTypeID.Description,documentName:t.DocumentName,caseNumber:n.data.summary.CaseSummaryHeader.CaseNumber,isVersionId:!i.IsCurrentVersion},ft(f),e=et(f,u),e&&r.open(e,"_blank"))}function rt(n){return n.IsCurrentVersion?n.DocumentFragments[0].DocumentFragmentID:n.DocumentVersionID}function ut(n,t){for(var r="",i=0;i<n.length;i++)n[i].DocumentID==t&&(r=n[i].NodeID);return r}function ft(n){var i,t;if(n.document)for(i=n.document.ParentLinks,t=0;t<i.length;t++)i[t].ParentTypeID=="1"&&(n.caseId=i[t].ParentID,n.nodeId=i[t].NodeID)}function et(t,i){var u,f,r;if(!t||!t.document){console.log("controller.roa.makeDocumentViewerUrl() failed because it was not passed a valid parameter.");return}return u=o.portalBaseUri+o.portalVirtualDirectoryPath,n.portalUrl&&n.portalUrl!=u&&(u=n.portalUrl),f=t.document.DocumentTypeID.CodeID,r=u+"/DocumentViewer/DisplayDoc?documentID="+encodeURIComponent(i)+"&caseNum="+encodeURIComponent(t.caseNumber)+"&locationId="+encodeURIComponent(t.nodeId)+"&caseId="+encodeURIComponent(t.caseId)+"&docTypeId="+encodeURIComponent(f)+"&isVersionId="+t.isVersionId,t.documentType&&(r=r+"&docType="+encodeURIComponent(t.documentType)),t.documentName&&(r=r+"&docName="+encodeURIComponent(t.documentName)),t.document&&t.document.sourceData&&t.document.sourceData.eventName&&(r=r+"&eventName="+encodeURIComponent(t.document.sourceData.eventName)),r}function ot(){return o.isPortalSiteFound.toLowerCase()=="false"?!1:!0}function st(n){switch(n){case"application/pdf":return".pdf";case"image/tiff":return".tif";default:return""}}function w(n){return(n&&n.DocumentVersion&&n.DocumentVersion.SecurityMask&2)==2}function b(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}n.Math=Math;n.footer={};n.footer.copyRightDate=o.copyRightDate;n.footer.version=o.version;n.virtualDirectory=o.virtualDirectory;n.dateFormat={};n.loadCount=0;n.itemsPerPage=50;n.debug=t.debug=="1"?!0:!1;n.roaSectionLimit=1;window.$s=n;n.searchparams={caseId:g(),debug:n.debug};f.getDateFormat().then(function(t){n.dateFormat=t});n.getDocumentIconClass=k;n.getSrcForDocument=nt;n.getCustomCss=function(){return{"margin-left":"0px"}};n.hasAppMode=function(n){return n&&$("body").hasClass(n)};n.isLockedOpen=function(){var n=c("gt-md");return n&&$("body").hasClass("nonav")==!1?$("body").addClass("nomenunav"):$("body").removeClass("nomenunav"),n};n.isSecurityMaskViewBitSet=function(n){return(+n&2)==2};n.isDocForPublicView=p;n.getMinuteEventLeftMarginOffset=function(n){var t=$("#Event_"+n)[0].offsetWidth;return-1*t+"px"};n.shouldShowIELoadAllWarning=function(){if(defunctr.browser().vendor!=="ie")return!1;var t=0;try{t+=n.data.roaSections.dispositionEvents.eventInfo.Count}catch(i){}try{t+=n.data.roaSections.caseEvents.eventInfo.Count}catch(i){}try{t+=n.data.roaSections.partySection.partyInfo.Count}catch(i){}try{t+=n.data.roaSections.hearingsSection.hearingInfo.Count}catch(i){}try{t+=n.data.roaSections.hearingNoticesSection.hearingNoticeInfo.Count}catch(i){}try{t+=n.data.roaSections.serviceEventsSection.serviceEventInfo.Count}catch(i){}try{t+=n.data.roaSections.otherDocumentsSection.otherDocumentsInfo.Count}catch(i){}try{t+=n.data.combinedEvents.Count}catch(i){}return v.log("This case has "+t+" total items in paged sections."),t>250};n.showAllDataActionVisible=function(){for(var i=Object.keys(n.data.roaSections),t=0;t<i.length;t++)if(n.data.roaSections[i[t]]&&n.data.roaSections[i[t]].enablePaging)return!0;return!1};n.generatePdf=function(){var i=$.param({contentHeight:$("#roa-content")[0].scrollHeight,headerHtml:$("#roa-header")[0].outerHTML,headerHtmlHeight:$("#roa-header")[0].scrollHeight,content:document.documentElement.outerHTML}),t;window.navigator.msSaveOrOpenBlob||(t=window.open(o.virtualDirectory+"?hideOmniBar=true#/pdfLoading","_blank"));l.post("pdf",i,{responseType:"arraybuffer"}).success(function(i){var r=new Blob([i],{type:"application/pdf"}),u;r.name=n.data.summary.CaseSummaryHeader.CaseNumber+".pdf";window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(r,n.data.summary.CaseSummaryHeader.CaseNumber+".pdf"):(u=window.URL.createObjectURL(r),t.location.href=u,window.URL.revokeObjectURL(r))})};n.DialogController=["$scope","$mdDialog",function(t,i){t.closeDialog=function(r){(i.hide(),t.doNotShowAgain&&(t.print?window.localStorage.doNotShowPrintWarningAgain="1":window.localStorage.doNotShowExpandWarningAgain="1"),r)&&(t.print?n.doPrintAll():n.showAllData())}}];n.showAllDataButtonPressed=function(){if(n.shouldShowIELoadAllWarning()&&window.localStorage.doNotShowExpandWarningAgain===undefined){var t=n.$new(!0);t.print=!1;t.doNotShowAgain=!1;i.show({template:document.getElementById("IEPrintAllWarning").innerHTML,parent:angular.element(document.body),targetEvent:event,clickOutsideToClose:!0,hasBackdrop:!0,scope:t,controller:n.DialogController})}else n.showAllData()};n.showAllData=function(){var t=[];return Object.keys(n.data.roaSections).forEach(function(i){n.data.roaSections[i].loadAll&&t.push(n.data.roaSections[i].loadAll())}),t};n.doPrintAll=function(){var t=n.showAllData();a.all(t).then(function(){u(function(){n.generatePdf()})})};n.printerIconClicked=function(t){if(n.shouldShowIELoadAllWarning()&&window.localStorage.doNotShowPrintWarningAgain===undefined){var r=n.$new(!0);r.print=!0;r.doNotShowAgain=!1;i.show({template:document.getElementById("IEPrintAllWarning").innerHTML,parent:angular.element(document.body),targetEvent:t,clickOutsideToClose:!0,hasBackdrop:!0,scope:r,controller:n.DialogController})}else n.doPrintAll()};n.navSectionData=[{name:"header-info",title:"Case Summary",active:function(){return n.selectedSection==="header-info"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.caseSummary&&n.data.roaSections.caseSummary.showSection&&!n.data.roaSections.caseSummary.loading}},{name:"case-info",title:"Case Information",active:function(){return n.selectedSection==="case-info"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.caseInformation&&n.data.roaSections.caseInformation.showSection&&!n.data.roaSections.caseInformation.loading}},{name:"assignment-info",title:"Assignment Information",active:function(){return n.selectedSection==="assignment-info"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.assignmentInformation&&n.data.roaSections.assignmentInformation.showSection}},{name:"party-info",title:"Party Information",active:function(){return n.selectedSection==="party-info"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.partySection&&n.data.roaSections.partySection.showSection}},{name:"disposition-events-first",title:"Dispositions",active:function(){return n.selectedSection==="disposition-events-first"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.dispositionEvents&&n.data.roaSections.dispositionEvents.showSection&&n.data.Options&&n.data.Options.DispFirst==="1"}},{name:"cause-of-action",title:"Causes of Action",active:function(){return n.selectedSection==="cause-of-action"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.causesSection&&n.data.roaSections.causesSection.showSection}},{name:"case-events",title:"Case Events",active:function(){return n.selectedSection==="case-events"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.caseEvents&&n.data.roaSections.caseEvents.showSection}},{name:"disposition-events",title:"Dispositions",active:function(){return n.selectedSection==="disposition-events"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.dispositionEvents&&n.data.roaSections.dispositionEvents.showSection&&n.data.Options&&n.data.Options.DispFirst!=="1"}},{name:"hearings",title:"Hearings",active:function(){return n.selectedSection==="hearings"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.hearingsSection&&n.data.roaSections.hearingsSection.showSection}},{name:"hearing-notices",title:"Hearing Notice Histories",active:function(){return n.selectedSection==="hearing-notices"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.hearingNoticesSection&&n.data.roaSections.hearingNoticesSection.showSection}},{name:"conditions",title:"Conditions",active:function(){return n.selectedSection==="conditions"},visible:function(){return n.data.roaSections&&n.data.roaSections.conditionsSection&&n.data.roaSections.conditionsSection.showSection}},{name:"service-events",title:"Service Events",active:function(){return n.selectedSection==="service-events"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.serviceEventsSection&&n.data.roaSections.serviceEventsSection.showSection}},{name:"bond-settings",title:"Bond Settings",active:function(){return n.selectedSection==="bond-settings"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.bondSettingsSection&&n.data.roaSections.bondSettingsSection.showSection}},{name:"event-and-hearing-info",title:"Events and Orders of the Court",active:function(){return n.selectedSection==="event-and-hearing-info"},visible:function(){return tt(function(){return n.data.combinedEvents.Count>0},!1)}},{name:"placements",title:"Placements",active:function(){return n.selectedSection==="placements"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.placementSection&&n.data.roaSections.placementSection.placementPartyInfo&&n.data.roaSections.placementSection.placementPartyInfo.PlacementParties&&n.data.roaSections.placementSection.placementPartyInfo.PlacementParties.length>0}},{name:"time-standards",title:"Time Standards",active:function(){return n.selectedSection==="time-standards"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.timeStandardSummarySection&&n.data.roaSections.timeStandardSummarySection.showSection}},{name:"other-documents",title:"Other Documents",active:function(){return n.selectedSection==="other-documents"},visible:function(){return n.data&&n.data.roaSections&&n.data.roaSections.otherDocumentsSection&&n.data.roaSections.otherDocumentsSection.otherDocumentsInfo&&n.data.roaSections.otherDocumentsSection.otherDocumentsInfo.Documents&&n.data.roaSections.otherDocumentsSection.otherDocumentsInfo.Documents.length>0}},{name:"financial-info",title:"Financial Information",active:function(){return n.selectedSection==="financial-info"},visible:function(){return n.configMode||n.data&&n.data.roaSections&&n.data.roaSections.financialSummarySection&&n.data.roaSections.financialSummarySection.financialInfo&&(n.data.roaSections.financialSummarySection.financialInfo.ShowFinancialSummaryCaseFees||n.data.roaSections.financialSummarySection.financialInfo.ShowFinancialSummaryRegister&&(n.data.roaSections.financialSummarySection.financialInfo.CaseFees&&n.data.roaSections.financialSummarySection.financialInfo.CaseFees.length>0||n.data.roaSections.financialSummarySection.financialInfo.RegistryBalances&&n.data.roaSections.financialSummarySection.financialInfo.RegistryBalances.length>0))}}];n.showEvent=function(n){i.show(i.alert().clickOutsideToClose(!0).title("Event").textContent(n).ok("OK"))};n.hasValue=y;n.selectedSection="header-info";n.selectedSubsection=null;n.setSection=function(t){n.selectedSubsection=null;n.scrollTo(t);n.selectedSection=t};n.setSubsection=function(t){n.scrollTo(t);n.selectedSubsection=t};n.scrollTo=function(n){setTimeout(function(){var t=document.getElementById(n);t&&($("#roa-content").scrollTop(t.offsetTop),e(t))},200)};n.handleIntent=function(n){n.URI&&r.open(n.URI)};n.virtualDirectory=o.virtualDirectory;n.templateUrl=n.virtualDirectory+"Areas/RegisterOfActions/Views/ROA/Templates/";n.onLaunchDocumentViewerEvent=d;n.isDocumentSecurityMaskViewEnabled=w;n.onLaunchDocumentSelectorEvent=function(r){i.show({templateUrl:n.templateUrl+"DocumentSelector.html",parent:angular.element(document.body),targetEvent:r,clickOutsideToClose:!0,locals:{event:r},controller:["$scope","$mdDialog","event",function(n,i,r){n.event=r;n.hasValue=y;n.isDocForPublicView=p;n.getDocumentIconClass=k;n.isDocumentSecurityMaskViewEnabled=w;n.searchparams={caseId:t.id,debug:t.debug=="1"?!0:!1};n.onLaunchDocumentViewerEvent=d;n.closeDialog=function(){i.hide()}}]})};n.data={};n.getPartyById=function(t){var i=null;if(t){if(!n.data.PartyNames)return null;i=$.grep(n.data.PartyNames,function(n){return n.PartyId==t})}return i?i[0]:null};n.arePartiesInEvent=function(n){return n?n.length>0:!1};n.chargeComponentValue=function(n,t){var r=null,i;return n.AdditionalChargeComponentValues.length>0&&t&&(i=$.grep(n.AdditionalChargeComponentValues,function(n){return n.FieldName===t}),i&&i.length>0&&(r=i[0].FieldValue)),r};n.isChargeJurisdicationVisible=function(n,t){function r(t){return(((n||[])[t]||{}).ChargeOffense||{}).Jurisdiction}var i=r(t);return i&&i!=r(t-1)};n.greaterThan=function(n,t){return n>t};n.lessThan=function(n,t){return n<t};n.mathFloor=function(n){return Math.floor(n)};n.getTemplateForDispositionComponent=function(t){var i=t&&t.DispositionComponentTypeCode&&t.DispositionComponentTypeCode.Word;if(i)return n.virtualDirectory+"Areas/RegisterOfActions/Views/ROA/Templates/DispositionComponents/"+i+".html";console.warn("Could not find code word to load disposition component template.",t)};n.getClassForEventTemplate=function(n){var t=[];return t.push("roa-event-"+b(n.Type||"undefined")),n.Event&&n.Event.IsDeleted&&t.push("roa-event-is-deleted"),t.join(" ")};n.camelCaseToDash=b;n.getClassForDispositionComponent=function(n){var t=((n||{}).DispositionComponentTypeCode||{}).Word;return"roa-disp-comp-"+b(t)};n.getEventTemplate=function(t){return n.virtualDirectory+"Areas/RegisterOfActions/Views/ROA/Templates/RoA_EventAndHearingInfo_"+t.Type+"_Template.html"};n.checkEventDiffPriorsClass=function(t,i){var r=n.data,u;return r&&r.Options&&t.FoundParent&&r.Options.DifferPriors=="1"?(u=[null,"roa-indent","roa-indent-2"][i||0],["roa-text-italic","roa-text-diff-priors",u].filter(Boolean).join(" ")):""};n.compValueAppendCharge=function(t,i,r){return n.compValueAny(t,"FineAmount")?n.compValue(t,i):n.compValue(t,i+"_"+r)};n.compValueSelect=function(n,t){var r=null,i;return n.DispositionComponentValues.length>0&&t&&(i=$.grep(n.DispositionComponentValues,function(n){return n.FieldName===t&&n.FieldValue}),i&&i.length>0&&(r=i)),r};n.compValueCount=function(t,i){var r=n.compValueSelect(t,i);return r?r.length:0};n.compValueAny=function(t,i){return n.compValueCount(t,i)>0};n.compValueObject=function(n,t){var r,i;return n?(r=null,n.DispositionComponentValues.length&&t&&(i=$.grep(n.DispositionComponentValues,function(n){return n.FieldName===t}),i&&i.length>0&&(r=i[0])),r):null};n.compValueCode=function(t,i){var r=n.compValueObject(t,i);return r?r.Code:null};n.compValue=function(t,i){var r=n.compValueObject(t,i);return r?r.FieldValue:null};n.compValueIsTrue=function(t,i){var r=n.compValue(t,i);return r&&(r=="1"||r.toLowerCase()=="true")};n.compValueIsTrueAll=function(t){if(arguments.length<2)return!0;for(var i=1;i<arguments.length;i++)if(!n.compValueIsTrue(t,arguments[i]))return!1;return!0};n.compValueIsTrueAny=function(t){if(arguments.length<2)return!0;for(var i=1;i<arguments.length;i++)if(n.compValueIsTrue(t,arguments[i]))return!0;return!1};n.compValueIsEmpty=function(t,i){return n.compValue(t,i)==""};n.search=function(){function r(t){function u(n){n.caseInfo=t.CaseInformation;n.causeInfo=t.CauseInformation;n.chargeInfo=t.ChargeInformation;n.relationsInfo=t.RelatedCasesInformation;n.lowerCourtCasesInfo=t.LowerCourtCasesInformation;n.dispositionInfo=t.DispositionInformation;n.warrantInfo=t.WarrantInformation;n.bondInfo=t.BondInformation;n.loading=!1}var i,r;if(t.Options.DynamicProperties&&t.Options.DynamicProperties.length>0)for(i=0;i<t.Options.DynamicProperties.length;i++)r=t.Options.DynamicProperties[i],t.Options[r.Key]=r.Property;n.data.Options=t.Options;n.data.WarrantInformation=[];n.data.WarrantInformation.ShowWarrantHeaderIcon=t.WarrantInformation?t.WarrantInformation.ShowWarrantHeaderIcon:!1;f.getPortalUrl().then(function(t){n.portalUrl=t});n.data.summary=t;t.CaseSummaryHeader&&(document.title="Register of Actions - "+t.CaseSummaryHeader.CaseNumber);n.data.roaSections.caseSummary.headerInfo=t.CaseSummaryHeader;n.data.roaSections.caseSummary.assignmentInfo=t.Assignments;n.data.roaSections.caseSummary.loading=!1;t.CaseInformation?u(n.data.roaSections.caseInformation):n.data.roaSections.caseInformation.showSection=!1;n.data.roaSections.assignmentInformation={template:"RoA_AssignmentInfo_Template.html",sectionHeading:"Assignment Information",sectionToolbarId:"assignment-info",showSection:t.Assignments&&t.Assignments.ShowAssignments,assignmentInfo:t.Assignments};n.loadCount--;it().then(function(){});n.navigationBarIntents=t.RoaIntents}function e(){n.data.roaSections.combinedEvents={template:"RoA_EventAndHearingInfo_Template.html",sectionHeading:"Events and Orders of the Court",sectionToolbarId:"event-and-hearing-info",showSection:!1,loading:!0,enablePaging:!0,itemsPerPage:n.itemsPerPage,error:null,onCombinedEventsChangePage:function(t){n.scrollTo(n.data.roaSections.combinedEvents.sectionToolbarId);n.data.roaSections.combinedEvents.loading=!0;f.getCombinedEventsById(n.searchparams,t,n.data.roaSections.combinedEvents.itemsPerPage).then(function(i){n.data.combinedEvents=i;n.data.combinedEvents.CurrentPage=t;n.data.roaSections.combinedEvents.loading=!1;n.scrollTo(n.data.roaSections.combinedEvents.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.combinedEvents,t)})},loadAll:function(t){return n.data.roaSections.combinedEvents.enablePaging&&n.data.combinedEvents.Count>n.data.roaSections.combinedEvents.itemsPerPage?(n.loadCount++,n.data.roaSections.combinedEvents.loading=!0,t&&n.scrollTo(n.data.roaSections.combinedEvents.sectionToolbarId),f.getCombinedEventsById(n.searchparams).then(function(i){return n.data.combinedEvents.CurrentPage=1,n.data.roaSections.combinedEvents.enablePaging=!1,n.data.combinedEvents.Events=[],n.data.combinedEvents.MinutesEvents=i.MinutesEvents,n.addByChunks(n.data.combinedEvents.Events,i.Events,200,"Events").then(function(){n.data.roaSections.combinedEvents.loading=!1;t&&n.scrollTo(n.data.roaSections.combinedEvents.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.combinedEvents,t)}).finally(function(){n.loadCount--})):a.resolve()},getEvent:function(t){var i=n.data.combinedEvents.Events.filter(function(n){return n.EventId===t});return i&&i.length>0?i[0]:(i=n.data.combinedEvents.MinutesEvents.filter(function(n){return n.EventId===t}),i&&i.length>0)?i[0]:null}}}function t(){if(n.data.Options.ShowDispositionEvents!=="1"){n.data.roaSections.dispositionEvents=!1;return}n.data.roaSections.dispositionEvents={template:"RoA_CaseEventInfo_Template.html",sectionHeading:"Dispositions",sectionToolbarId:n.data.Options.DispFirst==="1"?"disposition-events-first":"disposition-events",showSection:!1,loading:!0,enablePaging:!0,itemsPerPage:n.itemsPerPage,loadAll:function(t){return n.data.roaSections.dispositionEvents.enablePaging&&n.data.roaSections.dispositionEvents.showSection&&n.data.roaSections.dispositionEvents.eventInfo&&n.data.roaSections.dispositionEvents.eventInfo.Count>n.data.roaSections.dispositionEvents.itemsPerPage?(n.loadCount++,n.data.roaSections.dispositionEvents.loading=!0,t&&n.scrollTo(n.data.roaSections.dispositionEvents.sectionToolbarId),f.getDispositionEvents(n.searchparams).then(function(i){return n.data.roaSections.dispositionEvents.eventInfo.CurrentPage=1,n.data.roaSections.dispositionEvents.enablePaging=!1,n.data.roaSections.dispositionEvents.eventInfo.Events=[],n.addByChunks(n.data.roaSections.dispositionEvents.eventInfo.Events,i.Events,200,"Dispositions").then(function(){n.data.roaSections.dispositionEvents.loading=!1;t&&n.scrollTo(n.data.roaSections.dispositionEvents.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.dispositionEvents,t)}).finally(function(){n.loadCount--})):a.resolve()},onDispositionEventsChangePage:function(t){n.scrollTo(n.data.roaSections.dispositionEvents.sectionToolbarId);n.loadCount++;n.data.roaSections.dispositionEvents.loading=!0;f.getDispositionEvents(n.searchparams,t).then(function(i){n.data.roaSections.dispositionEvents.updateDispositionEventInfo(i,!1);n.data.roaSections.dispositionEvents.eventInfo.CurrentPage=t;n.scrollTo(n.data.roaSections.dispositionEvents.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.dispositionEvents,t)}).finally(function(){n.loadCount--})},updateDispositionEventInfo:function(t,i){n.data.roaSections.dispositionEvents.eventInfo=t;i&&(n.data.roaSections.dispositionEvents.eventInfo.CurrentPage=1,n.data.roaSections.dispositionEvents.showSection=t.Count>0,n.data.roaSections.dispositionEvents.enablePaging=t.Count>n.data.roaSections.dispositionEvents.itemsPerPage);n.data.roaSections.dispositionEvents.loading=!1}}}function o(){n.data.roaSections.caseEvents=n.data.Options.Events==="1"?{template:"RoA_CaseEventInfo_Template.html",sectionHeading:"Case Events",sectionToolbarId:"case-events",showSection:!1,loading:!0,enablePaging:!0,eventInfo:{},itemsPerPage:n.itemsPerPage,loadAll:function(t){return n.data.roaSections.caseEvents.enablePaging&&n.data.roaSections.caseEvents.showSection&&n.data.roaSections.caseEvents.eventInfo.Count>n.data.roaSections.caseEvents.itemsPerPage?(n.loadCount++,n.data.roaSections.caseEvents.loading=!0,t&&n.scrollTo(n.data.roaSections.caseEvents.sectionToolbarId),f.getCaseEventsById(n.searchparams).then(function(i){return n.data.roaSections.caseEvents.currentPage=1,n.data.roaSections.caseEvents.enablePaging=!1,n.data.roaSections.caseEvents.eventInfo.Events=[],n.addByChunks(n.data.roaSections.caseEvents.eventInfo.Events,i.Events,200,"Case Events").then(function(){n.data.roaSections.caseEvents.loading=!1;t&&n.scrollTo(n.data.roaSections.caseEvents.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.caseEvents,t)}).finally(function(){n.loadCount--})):a.resolve()},onCaseEventsChangePage:function(t){n.scrollTo(n.data.roaSections.caseEvents.sectionToolbarId);n.loadCount++;n.data.roaSections.caseEvents.loading=!0;f.getCaseEventsById(n.searchparams,t,n.data.roaSections.caseEvents.itemsPerPage).then(function(i){n.data.roaSections.caseEvents.updateCaseEventInfo(i,!1);n.data.roaSections.caseEvents.eventInfo.CurrentPage=t;n.scrollTo(n.data.roaSections.caseEvents.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.caseEvents,t)}).finally(function(){n.loadCount--})},updateCaseEventInfo:function(t,i){n.data.roaSections.caseEvents.eventInfo=t;i&&(n.data.roaSections.caseEvents.eventInfo.CurrentPage=1,n.data.roaSections.caseEvents.showSection=t.Count>0,n.data.roaSections.caseEvents.enablePaging=t.Count>n.data.roaSections.caseEvents.itemsPerPage);n.data.roaSections.caseEvents.loading=!1}}:!1}function s(){n.data.roaSections.partySection=n.data.Options.ShowParties==="1"?{template:"RoA_PartyInfo_Template.html",sectionHeading:"Party Information",sectionToolbarId:"party-info",showSection:!1,loading:!0,enablePaging:!0,itemsPerPage:n.itemsPerPage,partyInfo:{},casePartyConnectionsTypes:[],maxPartyCount:-1,getPartiesByConnectionTypeId:function(t){function i(n){return n.CasePartyConnection.ExtendedConnectionId.Word===t}return n.data.roaSections.partySection.partyInfo.CaseParties.filter(i)},isInactive:function(n){return n.RemovedReason},loadAll:function(t){return n.data.roaSections.partySection.enablePaging&&n.data.roaSections.partySection.showSection&&n.data.roaSections.partySection.partyInfo.Count>n.data.roaSections.partySection.itemsPerPage?(n.loadCount++,n.data.roaSections.partySection.loading=!0,t&&n.scrollTo(n.data.roaSections.partySection.sectionToolbarId),f.getPartiesById(n.searchparams).then(function(i){return n.data.roaSections.partySection.partyInfo.CurrentPage=1,n.data.roaSections.partySection.enablePaging=!1,n.data.roaSections.partySection.partyInfo.CaseParties=[],n.addByChunks(n.data.roaSections.partySection.partyInfo.CaseParties,i.Parties,200,"Case Parties").then(function(){n.data.roaSections.partySection.updatePartyConnections(i.Parties);n.data.roaSections.partySection.loading=!1;t&&n.scrollTo(n.data.roaSections.partySection.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.partySection,t)}).finally(function(){n.loadCount--})):a.resolve()},onPartiesChangePage:function(t){n.scrollTo(n.data.roaSections.partySection.sectionToolbarId);n.loadCount++;n.data.roaSections.partySection.loading=!0;n.data.roaSections.partySection.casePartyConnectionsTypes=[];n.data.roaSections.partySection.partyInfo={};f.getPartiesById(n.searchparams,t,n.data.roaSections.partySection.itemsPerPage).then(function(i){n.data.roaSections.partySection.updatePartyInfo(i,!1);n.data.roaSections.partySection.partyInfo.CurrentPage=t;n.scrollTo(n.data.roaSections.partySection.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.partySection,t)}).finally(function(){n.loadCount--})},updatePartyInfo:function(t,i){i?(n.data.roaSections.partySection.partyInfo={ShowParties:!0,ShowOnlyLeadAttornies:n.data.Options.AttLead==="1",ShowAttorneyHeader:!1,CaseParties:t.Parties,Count:t.Count,Skipped:t.Skipped,CurrentPage:1},n.data.roaSections.partySection.enablePaging=t.Count>n.data.roaSections.partySection.itemsPerPage,n.data.roaSections.partySection.showSection=t.Count>0):(n.data.roaSections.partySection.partyInfo.CaseParties=t.Parties,n.data.roaSections.partySection.partyInfo.Count=t.Count,n.data.roaSections.partySection.partyInfo.Skipped=t.Skipped);n.data.roaSections.partySection.updatePartyConnections(n.data.roaSections.partySection.partyInfo.CaseParties);n.data.roaSections.partySection.loading=!1},updatePartyConnections:function(t){if(n.data.roaSections.partySection.partyInfo.ShowAttorneyHeader=!1,t){var i=[];t.forEach(function(t){var r={type:t.CasePartyConnection.ExtendedConnectionId.Description,codeId:t.CasePartyConnection.ExtendedConnectionId.Word};i.indexOf(r.codeId)===-1&&(i.push(r.codeId),n.data.roaSections.partySection.casePartyConnectionsTypes.push(r));t.CasePartyAttorneys&&t.CasePartyAttorneys.length>0&&(n.data.roaSections.partySection.partyInfo.ShowAttorneyHeader=!0)})}},getPartyPhoneStringForPrefix:function(n,t){function e(){var n=r("PhoneConfidential");return y(n)&&(""+n).toLowerCase()!=="false"}function r(i){return n[t+i]}function u(){var n=Array.prototype.slice.call(arguments);return function(t){return y(n[t||0])?n.join(""):""}}var i,f;return n?(t=t||"",i=u("(",t[0],")")(1),e())?"** Confidential Phone **"+i:(f=u(" x",r("PhoneExtension"))(1),u(r("PhoneNumber"),f,i)()):""}}:!1}function h(){n.data.roaSections.hearingsSection=n.data.Options.Hearings==="1"?{template:"RoA_HearingInfo_Template.html",sectionHeading:"Hearings",sectionToolbarId:"hearings",showSection:!1,loading:!0,enablePaging:!0,itemsPerPage:n.itemsPerPage,hearingInfo:{},currentPage:1,loadAll:function(t){return n.data.roaSections.hearingsSection.enablePaging&&n.data.roaSections.hearingsSection.showSection&&n.data.roaSections.hearingsSection.hearingInfo.Count>n.data.roaSections.hearingsSection.itemsPerPage?(n.loadCount++,n.data.roaSections.hearingsSection.loading=!0,t&&n.scrollTo(n.data.roaSections.hearingsSection.sectionToolbarId),f.getHearings(n.searchparams).then(function(i){return n.data.roaSections.hearingsSection.currentPage=1,n.data.roaSections.hearingsSection.enablePaging=!1,n.data.roaSections.hearingsSection.hearingInfo.Hearings=[],n.data.roaSections.hearingsSection.hearingInfo.MinutesEvents=i.MinutesEvents,n.addByChunks(n.data.roaSections.hearingsSection.hearingInfo.Hearings,i.Hearings,200,"Hearings").then(function(){n.data.roaSections.hearingsSection.loading=!1;t&&n.scrollTo(n.data.roaSections.hearingsSection.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.hearingsSection,t)}).finally(function(){n.loadCount--})):a.resolve()},getEvent:function(t){var i=n.data.roaSections.hearingsSection.hearingInfo.MinutesEvents.filter(function(n){return n.EventId===t});return i&&i.length>0?i[0]:null},onHearingsChangePage:function(t){n.scrollTo(n.data.roaSections.hearingsSection.sectionToolbarId);n.loadCount++;n.data.roaSections.hearingsSection.loading=!0;n.data.roaSections.hearingsSection.hearingInfo.Hearings=[];n.data.roaSections.hearingsSection.hearingInfo.MinutesEvents=[];f.getHearings(n.searchparams,t,n.data.roaSections.hearingsSection.itemsPerPage).then(function(i){n.data.roaSections.hearingsSection.updateHearingInfo(i,!1);n.data.roaSections.hearingsSection.currentPage=t;n.scrollTo(n.data.roaSections.hearingsSection.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.hearingsSection,t)}).finally(function(){n.loadCount--})},updateHearingInfo:function(t,i){i?(n.data.roaSections.hearingsSection.hearingInfo=t,n.data.roaSections.hearingsSection.showSection=t.Count>0,n.data.roaSections.hearingsSection.enablePaging=t.Count>n.data.roaSections.hearingsSection.itemsPerPage):(n.data.roaSections.hearingsSection.hearingInfo.Hearings=t.Hearings,n.data.roaSections.hearingsSection.hearingInfo.MinutesEvents=t.MinutesEvents,n.data.roaSections.hearingsSection.hearingInfo.Skipped=t.Skipped);n.data.roaSections.hearingsSection.loading=!1}}:!1}function c(){n.data.roaSections.hearingNoticesSection=n.data.Options.Hearings==="1"&&n.data.Options.ShowNoticeHistory==="1"?{template:"RoA_HearingNoticeHistory_Template.html",sectionHeading:"Hearing Notice Histories",sectionToolbarId:"hearing-notices",showSection:!1,loading:!0,enablePaging:!0,itemsPerPage:n.itemsPerPage,hearingNoticeInfo:{},currentPage:1,loadAll:function(t){return n.data.roaSections.hearingNoticesSection.enablePaging&&n.data.roaSections.hearingNoticesSection.showSection&&n.data.roaSections.hearingNoticesSection.hearingNoticeInfo.Count>n.data.roaSections.hearingNoticesSection.itemsPerPage?(n.loadCount++,n.data.roaSections.hearingNoticesSection.loading=!0,t&&n.scrollTo(n.data.roaSections.hearingNoticesSection.sectionToolbarId),f.getHearingNoticeHistories(n.searchparams).then(function(i){return n.data.roaSections.hearingNoticesSection.currentPage=1,n.data.roaSections.hearingNoticesSection.enablePaging=!1,n.data.roaSections.hearingNoticesSection.hearingNoticeInfo.NoticeHistories=[],n.addByChunks(n.data.roaSections.hearingNoticesSection.hearingNoticeInfo.NoticeHistories,i.NoticeHistories,200,"Hearing Notices").then(function(){n.data.roaSections.hearingNoticesSection.loading=!1;t&&n.scrollTo(n.data.roaSections.hearingNoticesSection.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.hearingNoticesSection,t)}).finally(function(){n.loadCount--})):a.resolve()},onNoticeHistoryChangePage:function(t){n.scrollTo(n.data.roaSections.hearingNoticesSection.sectionToolbarId);n.loadCount++;n.data.roaSections.hearingNoticesSection.loading=!0;n.data.roaSections.hearingNoticesSection.hearingNoticeInfo.NoticeHistories=[];f.getHearingNoticeHistories(n.searchparams,t,n.data.roaSections.hearingNoticesSection.itemsPerPage).then(function(i){n.data.roaSections.hearingNoticesSection.updateNoticeHistoryInfo(i,!1);n.data.roaSections.hearingNoticesSection.currentPage=t;n.scrollTo(n.data.roaSections.hearingNoticesSection.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.hearingNoticesSection,t)}).finally(function(){n.loadCount--})},updateNoticeHistoryInfo:function(t,i){i?(n.data.roaSections.hearingNoticesSection.hearingNoticeInfo=t,n.data.roaSections.hearingNoticesSection.showSection=t.Count>0,n.data.roaSections.hearingNoticesSection.enablePaging=t.Count>n.data.roaSections.hearingNoticesSection.itemsPerPage):n.data.roaSections.hearingNoticesSection.hearingNoticeInfo.NoticeHistories=t.NoticeHistories;n.data.roaSections.hearingNoticesSection.loading=!1}}:!1}function l(){n.data.roaSections.serviceEventsSection=n.data.Options.Papers==="1"?{template:"RoA_ServiceEventInfo_Template.html",sectionHeading:"Service Events",sectionToolbarId:"service-events",showSection:!1,loading:!0,enablePaging:!0,itemsPerPage:n.itemsPerPage,serviceEventInfo:{},currentPage:1,loadAll:function(t){return n.data.roaSections.serviceEventsSection.enablePaging&&n.data.roaSections.serviceEventsSection.showSection&&n.data.roaSections.serviceEventsSection.serviceEventInfo.Count>n.data.roaSections.serviceEventsSection.itemsPerPage?(n.loadCount++,n.data.roaSections.serviceEventsSection.loading=!0,t&&n.scrollTo(n.data.roaSections.serviceEventsSection.sectionToolbarId),f.getServiceEvents(n.searchparams).then(function(i){return n.data.roaSections.serviceEventsSection.currentPage=1,n.data.roaSections.serviceEventsSection.enablePaging=!1,n.data.roaSections.serviceEventsSection.serviceEventInfo.Services=[],n.addByChunks(n.data.roaSections.serviceEventsSection.serviceEventInfo.Services,i.Services,200,"Service Events").then(function(){n.data.roaSections.serviceEventsSection.loading=!1;t&&n.scrollTo(n.data.roaSections.serviceEventsSection.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.serviceEventsSection,t)}).finally(function(){n.loadCount--})):a.resolve()},onChangePage:function(t){n.scrollTo(n.data.roaSections.serviceEventsSection.sectionToolbarId);n.loadCount++;n.data.roaSections.serviceEventsSection.loading=!0;n.data.roaSections.serviceEventsSection.serviceEventInfo.Services=[];f.getServiceEvents(n.searchparams,t,n.data.roaSections.serviceEventsSection.itemsPerPage).then(function(i){n.data.roaSections.serviceEventsSection.updateServiceEventInfo(i,!1);n.data.roaSections.serviceEventsSection.currentPage=t;n.scrollTo(n.data.roaSections.serviceEventsSection.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.serviceEventsSection,t)}).finally(function(){n.loadCount--})},updateServiceEventInfo:function(t,i){i?(n.data.roaSections.serviceEventsSection.serviceEventInfo=t,n.data.roaSections.serviceEventsSection.showSection=t.Count>0,n.data.roaSections.serviceEventsSection.enablePaging=t.Count>n.data.roaSections.serviceEventsSection.itemsPerPage):n.data.roaSections.serviceEventsSection.serviceEventInfo.Services=t.Services;n.data.roaSections.serviceEventsSection.loading=!1}}:!1}function p(){n.data.roaSections.otherDocumentsSection=n.data.Options.DisplayOtherDocuments==="1"?{template:"RoA_OtherDocuments_Template.html",sectionHeading:"Other Documents",sectionToolbarId:"other-documents",showSection:!1,loading:!0,enablePaging:!0,itemsPerPage:n.itemsPerPage,otherDocumentsInfo:{},currentPage:1,loadAll:function(t){return n.data.roaSections.otherDocumentsSection.enablePaging&&n.data.roaSections.otherDocumentsSection.showSection&&n.data.roaSections.otherDocumentsSection.otherDocumentsInfo.Count>n.data.roaSections.otherDocumentsSection.itemsPerPage?(n.loadCount++,n.data.roaSections.otherDocumentsSection.loading=!0,t&&n.scrollTo(n.data.roaSections.otherDocumentsSection.sectionToolbarId),f.getOtherDocuments(n.searchparams).then(function(i){return n.data.roaSections.otherDocumentsSection.currentPage=1,n.data.roaSections.otherDocumentsSection.enablePaging=!1,n.data.roaSections.otherDocumentsSection.otherDocumentsInfo.Documents=[],n.addByChunks(n.data.roaSections.otherDocumentsSection.otherDocumentsInfo.Documents,i.Documents,200,"Other Documents").then(function(){n.loadCount--;n.data.roaSections.otherDocumentsSection.loading=!1;t&&n.scrollTo(n.data.roaSections.otherDocumentsSection.sectionToolbarId)})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.otherDocumentsSection,t)}).finally(function(){n.loadCount--})):a.resolve()},onDocumentsChangePage:function(t){n.scrollTo(n.data.roaSections.otherDocumentsSection.sectionToolbarId);n.loadCount++;n.data.roaSections.otherDocumentsSection.loading=!0;n.data.roaSections.otherDocumentsSection.otherDocumentsInfo.Documents=[];f.getOtherDocuments(n.searchparams,t,n.data.roaSections.otherDocumentsSection.itemsPerPage).then(function(i){n.data.roaSections.otherDocumentsSection.updateDocumentInfo(i,!1);n.data.roaSections.otherDocumentsSection.currentPage=t;n.scrollTo(n.data.roaSections.otherDocumentsSection.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.otherDocumentsSection,t)}).finally(function(){n.loadCount--})},updateDocumentInfo:function(t){n.data.roaSections.otherDocumentsSection.otherDocumentsInfo=t;n.data.roaSections.otherDocumentsSection.showSection=t.Count>0;n.data.roaSections.otherDocumentsSection.enablePaging=t.Count>n.data.roaSections.otherDocumentsSection.itemsPerPage;n.data.roaSections.otherDocumentsSection.loading=!1}}:!1}function w(){n.data.roaSections.financialSummarySection=n.data.Options.FinSumCaseFee==="1"||n.data.Options.FinSumReg==="1"?{template:"RoA_FinancialInfo_Template.html",sectionHeading:"Financial Information",sectionToolbarId:"financial-info",showSection:!1,loading:!0,financialInfo:{},updateFinancialInfo:function(t){n.data.roaSections.financialSummarySection.financialInfo=t;n.data.roaSections.financialSummarySection.showSection=t.ShowFinancialSummaryCaseFees||t.ShowFinancialSummaryRegister;n.data.roaSections.financialSummarySection.loading=!1}}:!1}function b(){n.data.roaSections.conditionsSection=n.data.Options.InterimConds==="1"?{template:"RoA_Conditions_Template.html",sectionHeading:"Conditions",sectionToolbarId:"conditions",showSection:!1,loading:!0,enablePaging:!1,conditionInfo:{},currentPage:1,onConditionsChangePage:function(t){n.scrollTo(n.data.roaSections.conditionsSection.sectionToolbarId);n.loadCount++;n.data.roaSections.conditionsSection.loading=!0;f.getConditions(n.searchparams,t,n.data.roaSections.conditionsSection.itemsPerPage).then(function(i){n.data.roaSections.conditionsSection.updateConditionInfo(i,!1);n.data.roaSections.conditionsSection.currentPage=t;n.scrollTo(n.data.roaSections.conditionsSection.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.conditionsSection,t)}).finally(function(){n.loadCount--})},updateConditionInfo:function(t){n.data.roaSections.conditionsSection.conditionInfo=t;n.data.roaSections.conditionsSection.showSection=t.Count>0;n.data.roaSections.conditionsSection.loading=!1}}:!1}function k(){n.data.roaSections.bondSettingsSection=n.data.Options.BondSetting==="1"?{template:"RoA_BondSettings_Template.html",sectionHeading:"Bond Settings",sectionToolbarId:"bond-settings",showSection:!1,loading:!0,enablePaging:!1,bondSettingInfo:{},currentPage:1,onChangePage:function(t){n.scrollTo(n.data.roaSections.bondSettingsSection.sectionToolbarId);n.loadCount++;n.data.roaSections.bondSettingsSection.loading=!0;f.getBondSettings(n.searchParams,t,n.data.roaSections.bondSettingsSection.itemsPerPage).then(function(i){n.data.roaSections.bondSettingsSection.updateBondSettingInfo(i,!1);n.data.roaSections.bondSettingsSection.currentPage=t;n.scrollTo(n.data.roaSections.bondSettingsSection.sectionToolbarId)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.bondSettingsSection,t)}).finally(function(){n.loadCount--})},updateBondSettingInfo:function(t){n.data.roaSections.bondSettingsSection.bondSettingInfo=t;n.data.roaSections.bondSettingsSection.showSection=t.Count>0;n.data.roaSections.bondSettingsSection.loading=!1}}:!1}function d(){n.data.roaSections.causesSection=n.data.summary.CauseInformation&&n.data.summary.CauseInformation.Causes&&n.data.summary.CauseInformation.Causes.length>0?{template:"RoA_CausesOfAction_Template.html",sectionHeading:"Causes of Action",sectionToolbarId:"cause-of-action",showSection:!0,loading:!1,enablePaging:!1,causes:[],initialize:function(){n.data.summary.CauseInformation.Causes.forEach(function(t){var i={Event:t,EventId:t.CauseOfActionId,SortEventDate:t.FiledDate,TimestampCreate:t.TimestampCreate,Type:"CauseEvent"};n.data.roaSections.causesSection.causes.push(i)})}}:!1}function g(){n.data.Options.ShowGroundsForDivorce==="1"||n.data.Options.ShowSeparationDate==="1"?n.data.roaSections.divorceSection={template:"RoA_Placements_Template.html",sectionHeading:"Divorce",sectionToolbarId:"divorce",showSection:!1,loading:!0,enablePaging:!1,divorceInfo:{},updateDivorceInfo:function(t){n.data.roaSections.divorceSection.divorceInfo=t;n.data.roaSections.divorceSection.showSection=t.divorceInfo.GroundsForDivorce.length>0;n.data.roaSections.divorceSection.loading=!1}}:n.data.roaSections.placementSection=!1}function nt(){n.data.roaSections.timeStandardSummarySection=n.data.Options.TimeStandards==="1"?{template:"RoA_TimeStandard_Template.html",sectionHeading:"Time Standards",sectionToolbarId:"time-standards",showSection:!1,loading:!0,enablePaging:!1,timeStandardInfo:{},updateTimeStandardInfo:function(t){n.data.roaSections.timeStandardSummarySection.timeStandardInfo=t;n.data.roaSections.timeStandardSummarySection.showSection=n.data.roaSections.timeStandardSummarySection.timeStandardInfo.TimeStandardGroups.length>0||n.data.roaSections.timeStandardSummarySection.timeStandardInfo.TimeStandardInstances.length>0;n.data.roaSections.timeStandardSummarySection.loading=!1}}:!1}function tt(){n.data.roaSections.placementSection=n.data.Options.Placements==="1"?{template:"RoA_Placements_Template.html",sectionHeading:"Placements",sectionToolbarId:"placements",showSection:!1,loading:!0,enablePaging:!1,placementPartyInfo:{},updatePlacementPartyInfo:function(t){n.data.roaSections.placementSection.placementPartyInfo=t;n.data.roaSections.placementSection.showSection=t.PlacementParties.length>0;n.data.roaSections.placementSection.loading=!1}}:!1}function it(){i(!1);var t={};return n.loadCount++,t.partyNamesLoad=f.getPartyNamesById(n.searchparams).then(function(t){n.data.PartyNames=t.Names}).finally(function(){n.loadCount--}),n.loadCount++,t.chargesLoad=f.getCharges(n.searchparams).then(function(t){n.data.roaSections.caseInformation.chargeInfo=t}).finally(function(){n.loadCount--}),n.data.roaSections.partySection&&(n.loadCount++,t.partyLoad=f.getPartiesById(n.searchparams,1,n.data.roaSections.partySection.itemsPerPage).then(function(t){n.data.roaSections.partySection.updatePartyInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.partySection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.dispositionEvents&&(n.loadCount++,t.dispEventLoad=f.getDispositionEvents(n.searchparams,1,n.data.roaSections.dispositionEvents.itemsPerPage).then(function(t){n.data.roaSections.dispositionEvents.updateDispositionEventInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.dispositionEvents,t)}).finally(function(){n.loadCount--})),n.data.roaSections.caseEvents&&(n.loadCount++,t.eventLoad=f.getCaseEventsById(n.searchparams,1,n.data.roaSections.caseEvents.itemsPerPage).then(function(t){n.data.roaSections.caseEvents.updateCaseEventInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.caseEvents,t)}).finally(function(){n.loadCount--})),n.data.roaSections.hearingsSection&&(n.loadCount++,t.hearingLoad=f.getHearings(n.searchparams,1,n.data.roaSections.hearingsSection.itemsPerPage).then(function(t){n.data.roaSections.hearingsSection.updateHearingInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.hearingsSection,t)}).finally(function(){n.loadCount--}),n.data.roaSections.hearingNoticesSection&&(n.loadCount++,t.hearingNoticeLoad=f.getHearingNoticeHistories(n.searchparams,1,n.data.roaSections.hearingNoticesSection.itemsPerPage).then(function(t){n.data.roaSections.hearingNoticesSection.updateNoticeHistoryInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.hearingNoticesSection,t)}).finally(function(){n.loadCount--}))),n.data.roaSections.serviceEventsSection&&(n.loadCount++,t.serviceEventsSection=f.getServiceEvents(n.searchparams,1,n.data.roaSections.serviceEventsSection.itemsPerPage).then(function(t){n.data.roaSections.serviceEventsSection.updateServiceEventInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.serviceEventsSection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.combinedEvents&&(n.loadCount++,t.combinedEventLoad=f.getCombinedEventsById(n.searchparams,1,n.data.roaSections.combinedEvents.itemsPerPage).then(function(t){n.data.combinedEvents=t;n.data.combinedEvents.CurrentPage=1;n.data.roaSections.combinedEvents.loading=!1;n.data.combinedEvents.Count>0&&(n.data.roaSections.combinedEvents.showSection=!0);n.data.roaSections.combinedEvents.enablePaging=n.data.combinedEvents.Count>n.data.roaSections.combinedEvents.itemsPerPage;n.data.combinedEvents.Events.filter(function(n){return n.Type==="CauseEvent"}).forEach(function(t){var i=n.data.summary.CauseInformation.Causes.filter(function(n){return n.CauseOfActionId===t.EventId});t.Event=i[0];t.SortEventDate=t.Event.FiledDate;t.TimestampCreate=t.Event.TimestampCreate});n.data.combinedEvents.Events.filter(function(n){return n.Type==="DispositionEvent"}).forEach(function(t){var i=n.data.summary.DispositionInformation.Dispositions.filter(function(n){return n.DispositionId===t.Event.DispositionId});t.Event=i[0];t.TimestampCreate=t.Event.TimestampCreate;t.TimestampCreateIso8601=t.Event.TimestampCreate;t.SortEventDate=t.Event.DispositionDate})}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.combinedEvents,t)}).finally(function(){n.loadCount--})),n.data.roaSections.otherDocumentsSection&&(n.loadCount++,t.otherDocumentsLoad=f.getOtherDocuments(n.searchparams,1,n.data.roaSections.otherDocumentsSection.itemsPerPage).then(function(t){n.data.roaSections.otherDocumentsSection.updateDocumentInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.otherDocumentsSection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.financialSummarySection&&(n.loadCount++,t.financialSummary=f.getFinancialSummary(n.searchparams).then(function(t){n.data.roaSections.financialSummarySection.updateFinancialInfo(t)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.financialSummarySection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.conditionsSection&&(n.loadCount++,t.conditions=f.getConditions(n.searchparams).then(function(t){n.data.roaSections.conditionsSection.updateConditionInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.conditionsSection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.divorceSection&&(n.loadCount++,t.divorceLoad=f.getDivorceDetail(n.searchparams,1).then(function(t){n.data.roaSections.caseInformation.divorceInfo=t}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.partySection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.bondSettingsSection&&(n.loadCount++,t.bondSettings=f.getBondSettings(n.searchparams).then(function(t){n.data.roaSections.bondSettingsSection.updateBondSettingInfo(t,!0)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.bondSettingsSection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.placementSection&&(n.loadCount++,t.placements=f.getPlacements(n.searchparams).then(function(t){n.data.roaSections.placementSection.updatePlacementPartyInfo(t)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.placementSection,t)}).finally(function(){n.loadCount--})),n.data.roaSections.causesSection&&n.data.roaSections.causesSection.initialize(),n.data.roaSections.timeStandardSummarySection&&(n.loadCount++,t.TimeStandards=f.getTimeStandards(n.searchparams).then(function(t){n.data.roaSections.timeStandardSummarySection.updateTimeStandardInfo(t)}).catch(function(t){n.handleRoaSectionError(n.data.roaSections.timeStandardSummarySection,t)}).finally(function(){n.loadCount--})),a.all(t)}function i(i){i?(n.data.roaSections={},n.data.roaSections.caseSummary={template:"RoA_HeaderInfo_Template.html",sectionHeading:"Case Summary",sectionToolbarId:"header-info",showSection:!0,loading:!0},n.data.roaSections.caseInformation={template:"RoA_CaseInfo_Template.html",sectionHeading:"Case Information",sectionToolbarId:"case-info",showSection:!0,loading:!0,roaCaseInfoInfoTemplate:"RoA_CaseInfo_Info_Template.html",subSectionTemplates:["RoA_CaseInfo_Causes_Template.html","RoA_CaseInfo_Charges_Template.html","RoA_CaseInfo_Related_Cases_Template.html","RoA_CaseInfo_Lower_Court_Cases_Template.html","RoA_CaseInfo_Dispositions_Template.html","RoA_CaseInfo_Warrants_Template.html","RoA_CaseInfo_Bonds_Template.html","RoA_CaseInfo_Divorce_Template.html"],isActiveStatus:function(n){return n==="PA"||n==="OA"||n==="A"||n==="S"}}):(s(),p(),g(),n.data.Options.Group==="1"?(t(),o(),h(),c(),l(),b(),k(),d(),tt()):(n.data.Options.DispFirst==="1"&&t(),e()),w(),nt())}function rt(t){function e(t){n.error={hasError:!0,status:i,data:t}}var r=t.data,i=t.status,u=t.config.headers,f=t.config;console.warn({data:r,status:i,headers:u,config:f});e(n.buildErrorMessage(r,i));$("html").addClass("roa-is-loaded roa-is-load-error");$("#section-loading-indicator").hide();n.loadCount=0}if(n.error={hasError:!1},!this.searchparams.caseId){n.error={hasError:!0,status:-1,data:"No case id provided."};return}n.loadCount++;i(!0);f.getCaseById(this.searchparams).then(r).catch(rt);n.addByChunks=function(n,t,i,r){var o=0;defunctr.browser().vendor==="ie"&&(i=5,o=10);for(var s=[],f=t.length,e=0;e<f;)s.push(t.slice(e,e+=i));return s.reduce(function(t,e,s){return t.then(function(){return v.log((r?r+" - ":"")+"Adding chunk "+(i*(s+1)-i+1)+"-"+Math.min(i*(s+1),f)+" of "+f+"..."),u(function(t){Array.prototype.push.apply(n,t)},o,!0,e)})},a.resolve()).then(function(){v.log((r?r+" - ":"")+"Finished adding all chunks.")})};n.handleRoaSectionError=function(t,i){t.showSection=!0;t.loading=!1;t.error=n.buildErrorMessage(i.data,i.status)};n.buildErrorMessage=function(n,t){return t===404?"404 Not Found":t===401?"401 Unauthorized":t===403?"403 Forbidden":n&&n.error&&n.error.innererror?n.error.innererror.message||n.error.message||t+" Error":t>=400&&t<500?t+" Request Error":t>=500&&t<600?t+" Server Error":t+" Error"}};n.data&&n.data.casetext||n.search();n.$on("$includeContentError",function(){console.warn("$includeContentError",arguments)})}]),function(){function u(n){return function(){return{scope:!1,templateUrl:"/app/RegisterOfActions/Areas/RegisterOfActions/Views/ROA/Templates/"+n}}}function t(n,t){return function(){return{scope:!1,template:r(n),replace:t,link:function(n,t,i){n.$args=i}}}}function i(n){return function(){return{scope:!1,transclude:!0,template:r(n),replace:!0,link:function(n,t,i){n.$args=i}}}}function f(n,t,i){return function(){return{scope:e(i),transclude:!0,template:r(n),replace:t,link:function(n,t,i){n.$args=i}}}}function r(n){return(document.getElementById(n)||{}).innerHTML||"[Could not load template: "+n+"]"}function e(n){var t=(n||[]).reduce(function(n,t){return n[t]="@",n},{});return Object.keys(t).length===0?!1:t}var n=angular.module("RegisterOfActionsApp");n.directive("roaDocuments",u("RoA_EventAndHearingInfo_Documents_Template.html")).directive("roaDispositionBaseCond",u("DispositionComponents/Base_COND.html"));n.directive("roaSectionToolbar",t("roa-section-toolbar.template",!0)).directive("roaPartyAddress",t("roa-party-address.template",!0)).directive("roaChargeDataColumn",t("roa-charge-data-column.template",!1));n.directive("roaEventDate",i("roa-event-date.template")).directive("roaEventIndex",i("roa-event-index.template")).directive("roaEventTimestampCreate",i("roa-event-timestamp-create.template"));n.directive("roaHeaderData",f("roa-header-data.template",!0,["label","value"])).directive("roaData",f("roa-data.template",!0,["label","value"]));n.directive("ngIncludeTemplate",function(){return{templateUrl:function(n,t){return t.ngIncludeTemplate},restrict:"A",scope:{ngIncludeVariables:"&"},link:function(n){var t=n.ngIncludeVariables();Object.keys(t).forEach(function(i){n[i]=t[i]})}}})}();angular.module("RegisterOfActionsApp").service("ROAService",["$http","$log","appConfig","$q",function(n,t,i,r){var f=i.serviceUri,u=this,e=50;u.getCaseById=function(n){var t=encodeURIComponent(n.caseId),i=f+"CaseSummariesSlim?key="+t;return u.httpGet(i).promise};u.getCombinedEventsById=function(n,t,i){var r=f+"CombinedEvents('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getDispositionEvents=function(n,t,i){var r=f+"DispositionEvents('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getCaseEventsById=function(n,t,i){var r=f+"CaseEvents('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getPartiesById=function(n,t,i){var r=f+"Parties('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getHearings=function(n,t,i){var r=f+"Hearings('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getHearingNoticeHistories=function(n,t,i){var r=f+"HearingNoticeHistories('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getServiceEvents=function(n,t,i){var r=f+"ServiceEvents('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getPartyNamesById=function(n){var t=f+"PartyNames('"+n.caseId+"')?mode="+i.roaMode;return u.httpGet(t).promise};u.getOtherDocuments=function(n,t,i){var r=f+"OtherDocuments('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getFinancialSummary=function(n){var t=f+"FinancialSummary('"+n.caseId+"')"+u.buildQueryString(n);return u.httpGet(t).promise};u.getConditions=function(n,t,i){var r=f+"Conditions('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getBondSettings=function(n,t,i){var r=f+"BondSettings('"+n.caseId+"')"+u.buildQueryString(n,t,i);return u.httpGet(r).promise};u.getTimeStandards=function(n){var t=f+"TimeStandards('"+n.caseId+"')"+u.buildQueryString(n);return u.httpGet(t).promise};u.getCharges=function(n){var t=f+"Charges('"+n.caseId+"')"+u.buildQueryString(n);return u.httpGet(t).promise};u.getPlacements=function(n,t){var i=f+"Placements('"+n.caseId+"')"+u.buildQueryString(n,t);return u.httpGet(i).promise};u.getDivorceDetail=function(n){var t=f+"DivorceDetails('"+n.caseId+"')"+u.buildQueryString(n);return u.httpGet(t).promise};u.getNavigationBarIntents=function(t,i,u){var e=r.defer();return n.get(f+"api/RoaIntent?"+$.param({nodeId:t,caseCategory:i,caseId:u})).then(function(n){e.resolve(n.data)}),e.promise};u.getDateFormat=function(){var n=f+"api/Config/DateFormat";return u.httpGet(n).promise};u.getPortalUrl=function(){var n=f+"api/Config/PortalUrl";return u.httpGet(n).promise};u.buildQueryString=function(n,t,r){var u="?mode="+i.roaMode;return t&&(r||(r=e),u=u+"&$top="+r,t>0&&(u=u+"&$skip="+r*(t-1))),u};u.httpGet=function(t){var i=r.defer();return n.get(t).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n)}),i}}])