(function(n){let e=n.extend,f=n.ajax,r="#overviewDiv",o=r+" #propertiesDIV",s="#propertySelectorDiv",u="#Actions_ApplicantCanAddRemoveProperties",h="#ApplicationID",t={sUPDATEWIZARD:"#myRenewalNavButtonDiv",sSAVEPROPERTIES:"#SaveBtn",sCOMPLETEPROPERTYSELECTION:"#CompletePropertySelectionBtn",MYAPPLICATIONS:"#myApplicationsDashboardNavButtonDiv",MYPROPERTIES:"#myPropertiesDashboardNavButtonDiv",MYOFFERS:"#myOffersDashboardNavButtonDiv",MYCORRESPONDENCE:"#myCorrespondenceDashboardNavButtonDiv",sUPDATEPROPERTYSELECTION:"#PropertySelectionEditBtn",sAPPLICANTCONTACTEDIT:"#ApplicantContactEditBtn",sCOAPPLICANTCONTACTEDIT:"#CoApplicantContactEditBtn",sLIVINGSITUATIONEDIT:"#LivingSituationEditBtn",sADDITIONALCONTACTSEDIT:"#AdditionalContactsEditBtn"},i={APPLICATIONINFOINSTRUCTIONS:arcori.makeUrl("Application/GetApplicationInstructions"),APPLICATIONCOMPLETE:arcori.makeUrl("Application/Submit"),MYAPPLICATIONS:arcori.makeUrl("Application/MyApplicationsOverview"),MYPROPERTIES:arcori.makeUrl("Application/MyPropertiesOverview"),MYOFFERS:arcori.makeUrl("Application/MyOffersOverview"),MYCORRESPONDENCE:arcori.makeUrl("Application/MyCorrespondenceOverview"),TOGGLEINTERESTED:arcori.makeUrl("Application/ToggleInterested"),UPDATECONTACTINFO:arcori.makeUrl("Application/UpdateApplicantContactInfo"),SAVEAPPLICANTCHANGES:arcori.makeUrl("Application/SaveApplicantContactInfo")},c=kendo.Class.extend({container:null,address:null,properties:null,ELEMENT:{sORIGINID:"#OriginID",sAPPLICATIONSTATUS:"#ApplicationStatus",ApplicantContactUpdateElement:{sPRIMARYCONTACTID:"#PrimaryContactID",sSECONDARYCONTACTID:"#SecondaryContactID",sHASSECONDARY:"#HasSecondary",sAPPLICATIONID:"#ApplicationID",sHOUSEHOLDCONTACTGRID:"#householdContactGridDiv",sAPPLICANTUPDATETOOLBAR:"#applicantContactUpdateTB",sCOMMUNICATIONPREFERENCESDIV:"#applicantCommunicationPreferences",sLIVINGSITUATIONSDIV:"#applicantLivingSituationDiv",sMOVEOUTDATE:"#MoveOutDate",sMOVEOUTDATEDIV:"#MoveOutDateDiv",sMOVEADDRESSTOPASTRESIDENCE:"#MoveAddressToPastResidence",sORIGINID:"#OriginID",sVERSION:"#Version",sSPOKENLANGUAGES:"#SpokenLanguages",sUSESINTERPRETER:"#UsesInterpreter",sUSEINTERPRETERDIV:"#useInterpreterDiv"},tsCONTACTUPDATE:"#applicantContactUpdateTS"},ACTIONS:{SAVEAPPLICANTUPDATE:"saveApplicantUpdate"},primaryContactPhoneNumberListGrid:null,secondaryContactPhoneNumberListGrid:null,primaryContactEmailListGrid:null,secondaryContactEmailListGrid:null,householdContactGrid:null,housingHistory:null,init:function(){let u=this;this.container=r;n(t.MYAPPLICATIONS).bind("click",function(){u._overviewSelect(t.MYAPPLICATIONS)});n(t.MYPROPERTIES).bind("click",function(){u._overviewSelect(t.MYPROPERTIES)});n(t.MYOFFERS).bind("click",function(){u._overviewSelect(t.MYOFFERS)});n(t.MYCORRESPONDENCE).bind("click",function(){u._overviewSelect(t.MYCORRESPONDENCE)});n(t.sUPDATEWIZARD).bind("click",function(){u._launch(i.APPLICATIONINFOINSTRUCTIONS)});let f=new URLSearchParams(window.location.search.toLocaleLowerCase());n(this.ELEMENT.sAPPLICATIONSTATUS).val()===arcori.ApplicationStatusName.PropertySelection||f.getAll("pageindex")[0]==arcori.ePageIndex.PROPERTYSELECTION.toLocaleLowerCase()?u._overviewSelect(t.MYPROPERTIES):u._overviewSelect(t.MYAPPLICATIONS)},_showPropertyOverview:function(){this._overviewSelect(t.MYPROPERTIES)},_overviewSelect:function(r){let u=this;n(t.MYAPPLICATIONS+"_TitleDiv").removeClass("dashboard-item-selected");n(t.MYPROPERTIES+"_TitleDiv").removeClass("dashboard-item-selected");n(t.MYOFFERS+"_TitleDiv").removeClass("dashboard-item-selected");n(t.MYCORRESPONDENCE+"_TitleDiv").removeClass("dashboard-item-selected");n(r+"_TitleDiv").addClass("dashboard-item-selected");switch(r){case t.MYAPPLICATIONS:this._getView(i.MYAPPLICATIONS).then(function(){u._initMyApplications()});break;case t.MYPROPERTIES:this._getView(i.MYPROPERTIES).then(function(){u._initMyProperties()});break;case t.MYOFFERS:this._getView(i.MYOFFERS).then(function(){u._initMyOffers()});break;case t.MYCORRESPONDENCE:this._getView(i.MYCORRESPONDENCE).then(function(){u._initMyCorrespondence()});break;case t.sAPPLICANTCONTACTEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo()});break;case t.sCOAPPLICANTCONTACTEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo(arcori.strings.coApplicantContactDetailsTitle)});break;case t.sLIVINGSITUATIONEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo(arcori.strings.livingSituationTitle)});break;case t.sADDITIONALCONTACTSEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo(arcori.strings.additionalContactsTitle)})}},_getView:function(n){let t=this;t._busy(!0);return Promise.resolve(f({type:"POST",url:n,data:{applicationId:0},cache:!1})).then(function(n){t._updateView(n)}).catch(function(n){if(t._busy(!1),n.responseText)arcori.displayError(n),reject(n);else throw n;})},_initMyApplications:function(){let i=this,r=n(t.sUPDATEPROPERTYSELECTION);r.length&&r.getKendoButton().bind("click",function(){i._overviewSelect(t.MYPROPERTIES)});let u=n(t.sAPPLICANTCONTACTEDIT);u.length&&u.getKendoButton().bind("click",function(){i._overviewSelect(t.sAPPLICANTCONTACTEDIT)});let f=n(t.sCOAPPLICANTCONTACTEDIT);f.length&&f.getKendoButton().bind("click",function(){i._overviewSelect(t.sCOAPPLICANTCONTACTEDIT)});let e=n(t.sLIVINGSITUATIONEDIT);e.length&&e.getKendoButton().bind("click",function(){i._overviewSelect(t.sLIVINGSITUATIONEDIT)});let o=n(t.sADDITIONALCONTACTSEDIT);o.length&&o.getKendoButton().bind("click",function(){i._overviewSelect(t.sADDITIONALCONTACTSEDIT)});this._initCurrentResidenceAddress()},_initCurrentResidenceAddress:function(){this.address&&(this.address.destroy(),this.address=null);n("#CurrentResidenceAddress_UnitType").getKendoComboBox()&&(this.address=new arcori.Address({prefix:"CurrentResidenceAddress",hideAddressee:!0,hideEditorToolbar:!0,hideToolbar:!0}))},_initMyProperties:function(){let r=this;r.properties=new arcori.ApplicationProperty({container:o,selectorContainer:s,saveOnSelect:n(u).isTrue(),saveOnRemove:n(u).isTrue(),excludeOnApplicationID:n(h).val()});r.properties.show().then(function(){n(u).isTrue()?r.model.HasProperties||r.properties.kPropertyGrid._addProperties():(r.properties.kPropertyGrid.kToolBar.hide("#"+r.properties.kPropertyGrid.TBBUTTONS.ADD),r.properties.kPropertyGrid.kToolBar.hide("#"+r.properties.kPropertyGrid.TBBUTTONS.REMOVE))});n(t.sSAVEPROPERTIES).kendoButton().bind("click",function(){r.properties.save()});n(t.sCOMPLETEPROPERTYSELECTION).kendoButton().bind("click",function(){r.properties.save().then(function(){window.open(i.APPLICATIONCOMPLETE,"_self")})})},_initMyOffers:function(){let t=this;n("#overviewDiv input:checkbox").each(function(){n(this).getKendoSwitch().bind("change",function(n){let i=this;t._toggleInterested(this.element[0].id.split("_")[1],n.checked).catch(function(){i.value(i.element[0].checked?!1:!0)})})})},_initMyCorrespondence:function(){this.sentItemIndex=new arcori.SentItemIndex({entityID:n(this.ELEMENT.sORIGINID).val(),entityName:n("#PrimaryMember_Name").val(),entityType:arcori.CorrespondenceEntity.General,type:arcori.CorrespondenceType.Applicant});this.sentItemIndex.bind("deleted",function(){this.attachmentList.kGrid.dataSource.read()}.bind(this))},_initUpdateApplicantInfo:function(t){let i=this;i._initPrimaryMemberContact();n(i.ELEMENT.ApplicantContactUpdateElement.sHASSECONDARY).isTrue()&&i._initSecondaryMemberContact();i._initHouseholdContactsGrid();let r=n(i.ELEMENT.ApplicantContactUpdateElement.sAPPLICANTUPDATETOOLBAR).getKendoToolBar();r.bind("click",i._onApplicantUpdateTBClick.bind(i));n(i.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATEDIV).hide();i._getMoveAddressToPastResidenceSwitch().bind("change",i._onApplicantAddressChange.bind(i));i.housingHistory=new arcori.HousingHistory({container:i.ELEMENT.ApplicantContactUpdateElement.sLIVINGSITUATIONSDIV});i.housingHistory._initLivingSituation();i.housingHistory._initReceivedEvictionNotice();i.housingHistory._initOweArrears();i.housingHistory._initCurrentResidenceAddress();i.housingHistory._initSafeAddress();let u=i._getUsesInterpreterSwitch();if(i._onUseInterpreterChange(),u.bind("change",i._onUseInterpreterChange.bind(i)),t!=null){let r=n(i.ELEMENT.tsCONTACTUPDATE).getKendoTabStrip(),u=r.tabGroup.find(':contains("'+t+'")');r.select(u)}},_initPrimaryMemberContact:function(){let n=this,t=n._getPrimaryContactID();n.primaryContactPhoneNumberListGrid=new arcori.ContactPhoneNumberGrid({prefix:"PrimaryMember",ContactID:t.val()});n.primaryContactEmailListGrid=new arcori.ContactEmailGrid({prefix:"PrimaryMember",ContactID:t.val()})},_initSecondaryMemberContact:function(){let n=this,t=n._getSecondaryContactID();n.secondaryContactPhoneNumberListGrid=new arcori.ContactPhoneNumberGrid({prefix:"SecondaryMember",ContactID:t.val()});n.secondaryContactEmailListGrid=new arcori.ContactEmailGrid({prefix:"SecondaryMember",ContactID:t.val()})},_initHouseholdContactsGrid:function(){let n=this;n.householdContactGrid=new arcori.HouseholdContactGrid},_toggleInterested:function(n,t){let r=this;r._busy(!0);return new Promise(function(u,e){let o=Promise.resolve(f({type:"POST",url:i.TOGGLEINTERESTED,data:{offerItemID:n,interested:t},cache:!1})).then(function(n){return r._busy(!1),arcori.showMessage(n.msgTitle,n.msg),n}).catch(function(n){if(r._busy(!1),n.responseText)arcori.displayError(n),e(n);else throw n;}).then(function(n){r._busy(!1);u(n)})})},_updateView:function(t){t&&(t.view&&(kendo.destroy(n(r)),n(r).html(t.view)),t.model&&(this.model=kendo.observable(t.model)))},_launch:function(n){window.open(n,"_self")},_busy:function(t){kendo.ui.progress(n(this.container),t)},_onApplicantUpdateTBClick:function(n){let t=this;switch(n.id){case t.ACTIONS.SAVEAPPLICANTUPDATE:t._saveApplicantContact()}},_onApplicantAddressChange:function(){let t=this,i=t._getMoveAddressToPastResidenceSwitch();i.value()?n(t.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATEDIV).show():n(t.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATEDIV).hide()},_saveApplicantContact:function(){let n;const t=()=>{let t=this._getApplicantUpdateData();return arcori.ajax({type:"POST",url:i.SAVEAPPLICANTCHANGES,data:t,cache:!1}).then(t=>{n=t})},r=()=>{let n=this._getPrimaryContactID().val();return this.primaryContactPhoneNumberListGrid.save(n).then(()=>this.primaryContactEmailListGrid.save(n))},u=()=>{let t=this.secondaryContactPhoneNumberListGrid!==null;if(t){let n=this._getSecondaryContactID().val();return this.secondaryContactPhoneNumberListGrid.save(n).then(()=>this.secondaryContactEmailListGrid.save(n))}};this._busy(!0);return t().then(r).then(u).then(()=>this.householdContactGrid.save()).then(()=>arcori.showMessage(n.msgTitle,n.msg)).catch(n=>{arcori.displayError(n);throw n;}).finally(()=>this._busy(!1))},_getApplicantUpdateData:function(){let t={vm:this._getData(this.ELEMENT.ApplicantContactUpdateElement.sCOMMUNICATIONPREFERENCESDIV)};return t.vm.SpokenLanguages=n(this.ELEMENT.ApplicantContactUpdateElement.sSPOKENLANGUAGES).getKendoMultiSelect().value(),t.vm.HousingHistory=this._getData(this.ELEMENT.ApplicantContactUpdateElement.sLIVINGSITUATIONSDIV),t.vm.ApplicationID=this._getApplicationID().val(),t.vm.OriginID=this._getOriginID().val(),t.vm.Version=this._getApplicationVersion().val(),t.vm.PrimaryContactID=this._getPrimaryContactID().val(),t.vm.SecondaryContactID=this._getSecondaryContactID().val(),t.vm.HasSecondary=n(this.ELEMENT.ApplicantContactUpdateElement.sHASSECONDARY).val(),t.vm.MoveOutDate=n(this.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATE).val(),t.vm.PrimaryMember={ContactID:this._getPrimaryContactID().val()},t.vm.SecondaryMember={ContactID:this._getSecondaryContactID().val()},t.vm.MoveAddressToPastResidence=this._getMoveAddressToPastResidenceSwitch().value(),t},_getData:function(t){let i={};return n.each(n(t+" :input").serializeArray(),function(n,t){t.name in i||(i[t.name]=t.value)}),i},_getMoveAddressToPastResidenceSwitch:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sMOVEADDRESSTOPASTRESIDENCE).getKendoSwitch()},_getUsesInterpreterSwitch:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sUSESINTERPRETER).getKendoSwitch()},_getPrimaryContactID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sPRIMARYCONTACTID)},_getSecondaryContactID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sSECONDARYCONTACTID)},_getApplicationID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sAPPLICATIONID)},_getOriginID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sORIGINID)},_getApplicationVersion:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sVERSION)},_onUseInterpreterChange:function(){this._getUsesInterpreterSwitch().value()?n(this.ELEMENT.ApplicantContactUpdateElement.sUSEINTERPRETERDIV).show():n(this.ELEMENT.ApplicantContactUpdateElement.sUSEINTERPRETERDIV).hide()}});e(!0,arcori,{ApplicantHome:c})})(window.kendo.jQuery),function(n){let e=n.extend,o=n.ajax,t={HOUSEHOLD:0,COMMUNICATIONPREFERENCE:1,CURRENTLIVINGSITUATION:2,PREVIOUSLIVINGSITUATION:3,ACCOMMODATIONREQUESTS:4,PRIORITYINFO:5,INCOME:6,OBLIGATIONS:7,ASSISTANCE:8,PROGRAMSELECTION:9,REFERENCES:10,REASONSFORAPPLYING:11,DECLARATION:12,CONSENT:13,ATTACHMENTS:14,PROPERTYSELECTION:15,EMPLOYER:16,MORTGAGEPREAPPROVAL:17,REALESTATEDECLARATION:18},i={PROGRAMSELECTION:"#SectionProgramSelection",COMMUNICATIONPREFERENCES:"#SectionCommunicationPreferences",CURRENTLIVINGSITUATION:"#SectionCurrentLivingSituation",PREVIOUSLIVINGSITUATION:"#SectionPreviousLivingSituation",REFERENCES:"#SectionReferences",ACCOMMODATIONREQUESTS:"#SectionAccommodationRequests",FINANCIALINFORMATION:"#SectionFinancialInformation",EXPENSES:"#SectionExpenses",PRIORITIES:"#SectionPriorities",ASSISTANCE:"#SectionAssistance",DECLARATION:"#SectionDeclaration",CONSENT:"#SectionConsent"},r={REASONSFORAPPLYING:"#ProgramConfigurationReasonsForApplying",MORTGAGEPREAPPROVAL:"#ProgramConfigurationMortgagePreapproval",REALESTATEDECLARATION:"#ProgramConfigurationRealEstateDeclaration",INCOME:"#ProgramConfigurationIncome",LISTEMPLOYERS:"#ProgramConfigurationListEmployers"},s={ASKINCOMEOPTION:"#AskIncomeOption"},u={PREV:-1,NEXT:1},f={APPLICATIONCOMPLETE:arcori.makeUrl("Application/Submit"),SAVELASTPAGE:arcori.makeUrl("Application/SaveLastPage")},h=kendo.Class.extend({sLASTPAGEINDEX:"#LastPageIndex",sPREVIOUSBUTTON:"#PreviousBtn",sNEXTBUTTON:"#NextBtn",sREFRESHBUTTON:"#RefreshBtn",sCONTENTDIV:"#contentDiv",sFORM:"#widgetForm",sCANSUBMITAPPLICATION:"#Actions_ApplicantCanSubmitApplication",_currentPageIndex:arcori.ePageIndex.HOUSEHOLD,_widgetObject:null,section:{Programs:!0,CommunicationPreferences:!0,CurrentLivingSituation:!0,PreviousLivingSituation:!0,References:!0,AccommodationRequests:!0,FinancialInformation:!0,Expenses:!0,Priorities:!0,Assistance:!0,Declaration:!0,Consent:!0},programConfiguration:{ReasonsForApplying:!0,MortgagePreapproval:!0,RealEstateDeclaration:!0,Income:!0,ListEmployers:!0},systemSettingConfiguration:{AskIncomeOption:1},init:function(){var t=this;t.section.ProgramSelection=n(i.PROGRAMSELECTION).val().toLowerCase()==="true";t.section.CommunicationPreferences=n(i.COMMUNICATIONPREFERENCES).val().toLowerCase()==="true";t.section.CurrentLivingSituation=n(i.CURRENTLIVINGSITUATION).val().toLowerCase()==="true";t.section.PreviousLivingSituation=n(i.PREVIOUSLIVINGSITUATION).val().toLowerCase()==="true";t.section.References=n(i.REFERENCES).val().toLowerCase()==="true";t.section.AccommodationRequests=n(i.ACCOMMODATIONREQUESTS).val().toLowerCase()==="true";t.section.FinancialInformation=n(i.FINANCIALINFORMATION).val().toLowerCase()==="true";t.section.Expenses=n(i.EXPENSES).val().toLowerCase()==="true";t.section.Priorities=n(i.PRIORITIES).val().toLowerCase()==="true";t.section.Assistance=n(i.ASSISTANCE).val().toLowerCase()==="true";t.section.Declaration=n(i.DECLARATION).val().toLowerCase()==="true";t.section.Consent=n(i.CONSENT).val().toLowerCase()==="true";t.programConfiguration.ReasonsForApplying=n(r.REASONSFORAPPLYING).val().toLowerCase()==="true";t.programConfiguration.MortgagePreapproval=n(r.MORTGAGEPREAPPROVAL).val().toLowerCase()==="true";t.programConfiguration.RealEstateDeclaration=n(r.REALESTATEDECLARATION).val().toLowerCase()==="true";t.programConfiguration.Income=n(r.INCOME).isTrue();t.programConfiguration.ListEmployers=n(r.LISTEMPLOYERS).isTrue();t.systemSettingConfiguration.AskIncomeOption=parseInt(n(s.ASKINCOMEOPTION).val());t._getInitialPageIndex(n(t.sLASTPAGEINDEX).val());t.container=n(t.sCONTENTDIV);n(t.sPREVIOUSBUTTON).kendoButton().bind("click",function(){t._showNextPrevious(u.PREV)});n(t.sNEXTBUTTON).kendoButton().bind("click",function(){t._showNextPrevious(u.NEXT)});n(t.sREFRESHBUTTON).kendoButton().bind("click",function(){t._refresh()});t._showWidget();n("#helpMenu").show();new arcori.help.actions.MainMenu({container:"#main-nav"});new arcori.help.actions.Form({container:"#mainBody"})},_getInitialPageIndex:function(n){that=this;switch(n){case arcori.ePageIndex.PROGRAMSELECTION:that._currentPageIndex=that.section.ProgramSelection?n:arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:that._currentPageIndex=that.section.CommunicationPreferences?n:arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:that.section.CurrentLivingSituation?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:that.section.PreviousLivingSituation?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.CURRENTLIVINGSITUATION);break;case arcori.ePageIndex.REFERENCES:that.section.References?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.PREVIOUSLIVINGSITUATION);break;case arcori.ePageIndex.REASONSFORAPPLYING:that.programConfiguration.ReasonsForApplying?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.REFERENCES);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:that.section.AccommodationRequests?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.REASONSFORAPPLYING);break;case arcori.ePageIndex.INCOME:that.section.FinancialInformation?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.EMPLOYER:that.section.FinancialInformation?that.programConfiguration.ListEmployers&&that.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.INCOME):that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:that.section.FinancialInformation?that.programConfiguration.MortgagePreapproval?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.INCOME):that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.REALESTATEDECLARATION:that.section.FinancialInformation?that.programConfiguration.RealEstateDeclaration?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.MORTGAGEPREAPPROVAL):that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.OBLIGATION:that.section.Expenses?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.APPLICATIONPRIORITY:that.section.Priorities?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.ASSISTANCE:that.section.Assistance?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.APPLICATIONPRIORITY);break;case arcori.ePageIndex.ATTACHMENTS:that._currentPageIndex=n;break;case arcori.ePageIndex.DECLARATION:that.section.Declaration?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.ATTACHMENTS);break;case arcori.ePageIndex.CONSENT:that.section.Consent?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.DECLARATION)}},_showNextPrevious:function(n){this._busy(!0);this._enableButtons(!1);this._widgetObject.save().then(()=>{n==u.NEXT?this._getNext():this._getPrevious(),this._showWidget()}).catch(()=>{this._enableButtons(!0),this._busy(!1)})},_getPrevious:function(){var n=this;switch(n._currentPageIndex){case arcori.ePageIndex.HOUSEHOLD:n._currentPageIndex=arcori.ePageIndex.PROGRAMSELECTION;n.section.ProgramSelection||(n._currentPageIndex=arcori.ePageIndex.PROGRAMSELECTION,n._getPrevious());break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:n._currentPageIndex=arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:n._currentPageIndex=arcori.ePageIndex.COMMUNICATIONPREFERENCES;n.section.CommunicationPreferences||n._getPrevious();break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:n._currentPageIndex=arcori.ePageIndex.CURRENTLIVINGSITUATION;n.section.CurrentLivingSituation||n._getPrevious();break;case arcori.ePageIndex.REFERENCES:n._currentPageIndex=arcori.ePageIndex.PREVIOUSLIVINGSITUATION;n.section.PreviousLivingSituation||n._getPrevious();break;case arcori.ePageIndex.REASONSFORAPPLYING:n._currentPageIndex=arcori.ePageIndex.REFERENCES;n.section.References||n._getPrevious();break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:n._currentPageIndex=arcori.ePageIndex.REASONSFORAPPLYING;n.programConfiguration.ReasonsForApplying||n._getPrevious();break;case arcori.ePageIndex.INCOME:n._currentPageIndex=arcori.ePageIndex.ACCOMMODATIONREQUESTS;n.section.AccommodationRequests||n._getPrevious();break;case arcori.ePageIndex.EMPLOYER:n._currentPageIndex=arcori.ePageIndex.INCOME;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.Income)||n._getPrevious();break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:n._currentPageIndex=arcori.ePageIndex.EMPLOYER;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.ListEmployers&&n.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly)||n._getPrevious();break;case arcori.ePageIndex.REALESTATEDECLARATION:n._currentPageIndex=arcori.ePageIndex.MORTGAGEPREAPPROVAL;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.MortgagePreapproval)||n._getPrevious();break;case arcori.ePageIndex.OBLIGATION:n._currentPageIndex=arcori.ePageIndex.REALESTATEDECLARATION;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.RealEstateDeclaration)||n._getPrevious();break;case arcori.ePageIndex.APPLICATIONPRIORITY:n._currentPageIndex=arcori.ePageIndex.OBLIGATION;n.section.Expenses||n._getPrevious();break;case arcori.ePageIndex.ASSISTANCE:n._currentPageIndex=arcori.ePageIndex.APPLICATIONPRIORITY;n.section.Priorities||n._getPrevious();break;case arcori.ePageIndex.ATTACHMENTS:n._currentPageIndex=arcori.ePageIndex.ASSISTANCE;n.section.Assistance||n._getPrevious();break;case arcori.ePageIndex.DECLARATION:n._currentPageIndex=arcori.ePageIndex.ATTACHMENTS;break;case arcori.ePageIndex.CONSENT:n._currentPageIndex=arcori.ePageIndex.DECLARATION;n.section.Declaration||n._getPrevious()}},_getNext:function(){that=this;switch(that._currentPageIndex){case arcori.ePageIndex.PROGRAMSELECTION:that._currentPageIndex=arcori.ePageIndex.HOUSEHOLD;that.section.ProgramSelection||that._getNext();break;case arcori.ePageIndex.HOUSEHOLD:that._currentPageIndex=arcori.ePageIndex.COMMUNICATIONPREFERENCES;that.section.CommunicationPreferences||that._getNext();break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:that._currentPageIndex=arcori.ePageIndex.CURRENTLIVINGSITUATION;that.section.CurrentLivingSituation||that._getNext();break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:that._currentPageIndex=arcori.ePageIndex.PREVIOUSLIVINGSITUATION;that.section.PreviousLivingSituation||that._getNext();break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:that._currentPageIndex=arcori.ePageIndex.REFERENCES;that.section.References||that._getNext();break;case arcori.ePageIndex.REFERENCES:that._currentPageIndex=arcori.ePageIndex.REASONSFORAPPLYING;that.programConfiguration.ReasonsForApplying||that._getNext();break;case arcori.ePageIndex.REASONSFORAPPLYING:that._currentPageIndex=arcori.ePageIndex.ACCOMMODATIONREQUESTS;that.section.AccommodationRequests||that._getNext();break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:that._currentPageIndex=arcori.ePageIndex.INCOME;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.Income)||that._getNext();break;case arcori.ePageIndex.INCOME:that._currentPageIndex=arcori.ePageIndex.EMPLOYER;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.ListEmployers&&that.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly)||that._getNext();break;case arcori.ePageIndex.EMPLOYER:that._currentPageIndex=arcori.ePageIndex.MORTGAGEPREAPPROVAL;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.MortgagePreapproval)||that._getNext();break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:that._currentPageIndex=arcori.ePageIndex.REALESTATEDECLARATION;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.RealEstateDeclaration)||that._getNext();break;case arcori.ePageIndex.REALESTATEDECLARATION:that._currentPageIndex=arcori.ePageIndex.OBLIGATION;that.section.Expenses||that._getNext();break;case arcori.ePageIndex.OBLIGATION:that._currentPageIndex=arcori.ePageIndex.APPLICATIONPRIORITY;that.section.Priorities||that._getNext();break;case arcori.ePageIndex.APPLICATIONPRIORITY:that._currentPageIndex=arcori.ePageIndex.ASSISTANCE;that.section.Assistance||that._getNext();break;case arcori.ePageIndex.ASSISTANCE:that._currentPageIndex=arcori.ePageIndex.ATTACHMENTS;break;case arcori.ePageIndex.ATTACHMENTS:that._currentPageIndex=arcori.ePageIndex.DECLARATION;that.section.Declaration||that._getNext();break;case arcori.ePageIndex.DECLARATION:that._currentPageIndex=arcori.ePageIndex.CONSENT;that.section.Consent||that._getNext();break;case arcori.ePageIndex.CONSENT:window.open(f.APPLICATIONCOMPLETE,"_self")}},_refresh:function(){var n=this;n._showWidget()},_enableButtons:function(t){let i=this,r=t&&n(i.sCANSUBMITAPPLICATION).val().toLowerCase()==="true";n(i.sPREVIOUSBUTTON).data("kendoButton").enable(r);n(i.sNEXTBUTTON).data("kendoButton").enable(r)},_updateProgramBasedConfiguration:function(n){this.programConfiguration.ReasonsForApplying=n.ProgramConfiguration.ReasonsForApplying;this.programConfiguration.MortgagePreapproval=n.ProgramConfiguration.MortgagePreapproval;this.programConfiguration.RealEstateDeclaration=n.ProgramConfiguration.RealEstateDeclaration;this.programConfiguration.Income=n.ProgramConfiguration.Income;this.programConfiguration.ListEmployers=n.ProgramConfiguration.ListEmployers;this.section.FinancialInformation=n.ProgramConfiguration.HasFinancialQuestions;this.section.AccommodationRequests=n.ProgramConfiguration.HasAccommodationRequests},_showWidget:function(){var t=this,i={container:t.sCONTENTDIV,form:t.sFORM};t._busy(!0);t._enableButtons(!1);n("[data-helpid].k-icon.k-i-question").attr("data-helpid","1."+t._getPageIndexID());n("[data-helpid].k-icon.k-i-question").data().helpid="1."+t._getPageIndexID();n("[data-helpid].k-icon.k-i-question").attr("data-helpid","1."+t._getPageIndexID());n("[data-helpid].k-icon.k-i-question").data().helpid="1."+t._getPageIndexID();n("#helpMenu").attr("data-helpid","1."+t._getPageIndexID());n("#helpMenu").data().helpid="1."+t._getPageIndexID();switch(t._currentPageIndex){case arcori.ePageIndex.PROGRAMSELECTION:let n=i;n.onSaved=n=>t._updateProgramBasedConfiguration(n);t._widgetObject=new arcori.ApplicationProgramSelection(n);break;case arcori.ePageIndex.HOUSEHOLD:t._widgetObject=new arcori.Household(i);break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:t._widgetObject=new arcori.CommunicationPreferences(i);break;case arcori.ePageIndex.REASONSFORAPPLYING:t._widgetObject=new arcori.ReasonsForApplying(i);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:t._widgetObject=new arcori.AccommodationRequests(i);break;case arcori.ePageIndex.APPLICATIONPRIORITY:t._widgetObject=new arcori.ApplicationPriority(i);break;case arcori.ePageIndex.INCOME:t._widgetObject=new arcori.Income(i);break;case arcori.ePageIndex.EMPLOYER:t._widgetObject=new arcori.EmployerGrid(i);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:t._widgetObject=new arcori.MortgagePreapproval(i);break;case arcori.ePageIndex.REALESTATEDECLARATION:t._widgetObject=new arcori.RealEstateDeclaration(i);break;case arcori.ePageIndex.OBLIGATION:t._widgetObject=new arcori.Obligation(i);break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:t._widgetObject=new arcori.HousingHistory(i);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:t._widgetObject=new arcori.ResidenceGrid(i);break;case arcori.ePageIndex.REFERENCES:t._widgetObject=new arcori.ReferenceGrid(i);break;case arcori.ePageIndex.ASSISTANCE:t._widgetObject=new arcori.ApplicationAssistance(i);break;case arcori.ePageIndex.ATTACHMENTS:t._widgetObject=new arcori.ApplicationAttachments(i);break;case arcori.ePageIndex.DECLARATION:t.section.Declaration&&(t._widgetObject=new arcori.Declaration(i));break;case arcori.ePageIndex.CONSENT:t.section.Consent&&(t._widgetObject=new arcori.Consent(i))}t._widgetObject.show().then(function(){t._configurePreviousButton(t._currentPageIndex);t._configureNextButton(t._currentPageIndex);t._savePageIndex();t._enableButtons(!0);t._busy(!1)}).catch(function(){t._enableButtons(!0);t._busy(!1)})},_configurePreviousButton:function(t){var i=this;switch(t){case arcori.ePageIndex.PROGRAMSELECTION:n(i.sPREVIOUSBUTTON).hide();break;case arcori.ePageIndex.HOUSEHOLD:i.section.ProgramSelection?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.HouseholdBackButton),n(i.sPREVIOUSBUTTON).show()):n(i.sPREVIOUSBUTTON).hide();break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.CommunicationPreferencesBackButton);n(i.sPREVIOUSBUTTON).show();break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:i.section.CommunicationPreferences?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.CurrentLivingSituationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.COMMUNICATIONPREFERENCES);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:i.section.CurrentLivingSituation?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.PreviousLivingSituationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.CURRENTLIVINGSITUATION);break;case arcori.ePageIndex.REFERENCES:i.section.PreviousLivingSituation?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ReferencesBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.PREVIOUSLIVINGSITUATION);break;case arcori.ePageIndex.REASONSFORAPPLYING:i.section.References?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ReasonsForApplyingBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.REFERENCES);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:i.programConfiguration.ReasonsForApplying?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.AccommodationRequestsBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.REASONSFORAPPLYING);break;case arcori.ePageIndex.INCOME:i.section.AccommodationRequests?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.IncomeBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.EMPLOYER:i.section.FinancialInformation&&i.programConfiguration.Income?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.EmployerBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:i.section.FinancialInformation?i.programConfiguration.ListEmployers&&i.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.MortgageApprovalBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.EMPLOYER):i._configurePreviousButton(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.REALESTATEDECLARATION:i.section.FinancialInformation&&i.programConfiguration.MortgagePreapproval?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.RealEstateDeclarationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.MORTGAGEPREAPPROVAL);break;case arcori.ePageIndex.OBLIGATION:i.section.FinancialInformation&&i.programConfiguration.RealEstateDeclaration?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ObligationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.REALESTATEDECLARATION);break;case arcori.ePageIndex.APPLICATIONPRIORITY:i.section.Expenses?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.PriorityBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.ASSISTANCE:i.section.Priorities?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.AssistanceBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.APPLICATIONPRIORITY);break;case arcori.ePageIndex.ATTACHMENTS:i.section.Assistance?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.AttachmentsBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.ASSISTANCE);break;case arcori.ePageIndex.DECLARATION:n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.DeclarationBackButton);n(i.sPREVIOUSBUTTON).show();break;case arcori.ePageIndex.CONSENT:i.section.Declaration?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ConsentBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.DECLARATION)}},_configureNextButton:function(t){var i=this;switch(t){case arcori.ePageIndex.PROGRAMSELECTION:n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ProgramNextButton);break;case arcori.ePageIndex.HOUSEHOLD:i.section.CommunicationPreferences?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.HouseholdNextButton):i._configureNextButton(arcori.ePageIndex.COMMUNICATIONPREFERENCES);break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:i.section.CurrentLivingSituation?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.CommunicationPreferencesNextButton):i._configureNextButton(arcori.ePageIndex.CURRENTLIVINGSITUATION);break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:i.section.PreviousLivingSituation?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.CurrentLivingSituationNextButton):i._configureNextButton(arcori.ePageIndex.PREVIOUSLIVINGSITUATION);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:i.section.References?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.PreviousLivingSituationNextButton):i._configureNextButton(arcori.ePageIndex.REFERENCES);break;case arcori.ePageIndex.REFERENCES:i.programConfiguration.ReasonsForApplying?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ReferencesNextButton):i._configureNextButton(arcori.ePageIndex.REASONSFORAPPLYING);break;case arcori.ePageIndex.REASONSFORAPPLYING:i.section.AccommodationRequests?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ReasonsForApplyingNextButton):i._configureNextButton(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:i.section.FinancialInformation&&i.programConfiguration.Income?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.AccommodationRequestsNextButton):i._configureNextButton(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.INCOME:i.section.FinancialInformation&&i.programConfiguration.ListEmployers&&i.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.IncomeNextButton):i._configureNextButton(arcori.ePageIndex.EMPLOYER);break;case arcori.ePageIndex.EMPLOYER:i.section.FinancialInformation&&i.programConfiguration.MortgagePreapproval?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.EmployerNextButton):i._configureNextButton(arcori.ePageIndex.MORTGAGEPREAPPROVAL);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:i.section.FinancialInformation&&i.programConfiguration.RealEstateDeclaration?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.MortgageApprovalNextButton):i._configureNextButton(arcori.ePageIndex.REALESTATEDECLARATION);break;case arcori.ePageIndex.REALESTATEDECLARATION:i.section.Expenses?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.RealEstateDeclarationNextButton):i._configureNextButton(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.OBLIGATION:i.section.Priorities?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ObligationNextButton):i._configureNextButton(arcori.ePageIndex.APPLICATIONPRIORITY);break;case arcori.ePageIndex.APPLICATIONPRIORITY:i.section.Assistance?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.PriorityNextButton):i._configureNextButton(arcori.ePageIndex.ASSISTANCE);break;case arcori.ePageIndex.ASSISTANCE:n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.AssistanceNextButton);break;case arcori.ePageIndex.ATTACHMENTS:i.section.Declaration?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.AttachmentsNextButton):i._configureNextButton(arcori.ePageIndex.DECLARATION);break;case arcori.ePageIndex.DECLARATION:i.section.Consent?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.DeclarationNextButton):i._configureNextButton(arcori.ePageIndex.CONSENT);break;case arcori.ePageIndex.CONSENT:n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ConsentNextButton)}},_savePageIndex:function(){if(n("#ApplicationID").val()!==0){var t=this,i={id:n("#ApplicationID").val(),pageIndex:t._currentPageIndex};o({type:"POST",url:f.SAVELASTPAGE,data:i,cache:!1})}},_getPageIndexID:function(){switch(this._currentPageIndex){case arcori.ePageIndex.PROGRAMSELECTION:return t.PROGRAMSELECTION;case arcori.ePageIndex.HOUSEHOLD:return t.HOUSEHOLD;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:return t.COMMUNICATIONPREFERENCE;case arcori.ePageIndex.APPLICATIONPRIORITY:return t.PRIORITYINFO;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:return t.ACCOMMODATIONREQUESTS;case arcori.ePageIndex.INCOME:return t.INCOME;case arcori.ePageIndex.EMPLOYER:return t.EMPLOYER;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:return t.MORTGAGEPREAPPROVAL;case arcori.ePageIndex.REALESTATEDECLARATION:return t.REALESTATEDECLARATION;case arcori.ePageIndex.OBLIGATION:return t.OBLIGATIONS;case arcori.ePageIndex.CURRENTLIVINGSITUATION:return t.CURRENTLIVINGSITUATION;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:return t.PREVIOUSLIVINGSITUATION;case arcori.ePageIndex.REFERENCES:return t.REFERENCES;case arcori.ePageIndex.REASONSFORAPPLYING:return t.REASONSFORAPPLYING;case arcori.ePageIndex.ASSISTANCE:return t.ASSISTANCE;case arcori.ePageIndex.ATTACHMENTS:return t.ATTACHMENTS;case arcori.ePageIndex.DECLARATION:return t.DECLARATION;case arcori.ePageIndex.CONSENT:return t.CONSENT}},_busy:function(t){kendo.ui.progress(n(this.container),t)}});e(!0,arcori,{ApplicationWizard:h})}(window.kendo.jQuery),function(n){let r=n.extend,u=n.ajax,i={APPLICATIONCOMPLETE:arcori.makeUrl("Application/Submit"),SAVELASTPAGE:arcori.makeUrl("Application/SaveLastPage"),WIZARDSTEPURL:arcori.makeUrl("Application/RenewalWizardTemplate")};const t="_WizardNavItem";let f=kendo.Class.extend({_currentPageIndex:arcori.ePageIndex.APPLICATIONQUESTIONNAIRE,_widgetObject:null,kWizard:null,ELEMENT:{sFORM:"#wizardForm",sWIZARD:"#renewalWizard",sDEFAULTSTEPPER:".k-stepper",sWIZARDSTEPPER:"#wizardStepper",sHOUSEHOLDSTEP:`#wizardStepper #Household${t}`,sLIVINGSITUATIONSTEP:`#wizardStepper #CurrentLivingSituation${t}`,sPRIORITYSTEP:`#wizardStepper #PriorityInfo${t}`,sACCOMMODATIONSTEP:`#wizardStepper #AccommodationRequests${t}`},household:null,communicationPreferences:null,accommodationRequests:null,applicationPriority:null,income:null,employerGrid:null,mortgagePreapproval:null,realEstateDeclaration:null,housingHistory:null,applicationAttachments:null,declaration:null,consent:null,renewalQuestionnaire:null,init:function(n){this.options=r(!0,{},this.options,n);this.options.container=this.ELEMENT.sFORM;n.currentPageIndex&&(this._currentPageIndex=n.currentPageIndex);this._initWizard();this._initStepper();this._selectInitialStep()},_initWizard:function(){this.kWizard=n(this.ELEMENT.sWIZARD).getKendoWizard();this.kWizard.bind("contentLoad",n=>this._onStepActivate(n));this.kWizard.bind("select",n=>this._onStepSelect(n));this.kWizard.bind("done",()=>this._onDone())},_initStepper:function(){n(this.ELEMENT.sDEFAULTSTEPPER).hide();n(this.ELEMENT.sWIZARDSTEPPER).on("click",".a-step",n=>this._selectStepFromStepper(n));this.kWizard.removeStepByID("DummyStep");let t=this.kWizard.steps()[0];t.options.buttons.shift();t._buttons.shift();t._leftButtonsContainer.find("[data-wizard-reset]").remove()},_selectStepFromStepper:function(n){let t=this._wizardNavItemToPageIndex(n.currentTarget.id);this._saveCurrentWidget(t)},_saveCurrentWidget:function(n){this._widgetObject&&this._widgetObject.save().then(()=>this._setActiveWidget(n)).catch(()=>{})},_highlightCurrentStep:function(){n(".a-step").removeClass("a-step-current");n(`${this.ELEMENT.sWIZARDSTEPPER} #${this._pageIndexToWizardNavItem(this._currentPageIndex)}`).addClass("a-step-current")},_addStep:function(n){let t=this.kWizard.getStepByID(n);if(t==null){let t={title:n,contentId:n,contentUrl:`${i.WIZARDSTEPURL}?page=${n}`,buttons:["previous","next"]};this.kWizard.insertAt(this._getInsertIndex(n),t)}},_getInsertIndex:function(n){let i=null,t=null;switch(n){case arcori.ePageIndex.HOUSEHOLD:t=arcori.ePageIndex.APPLICATIONQUESTIONNAIRE;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:t=arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:t=arcori.ePageIndex.CURRENTLIVINGSITUATION;break;case arcori.ePageIndex.INCOME:t=arcori.ePageIndex.ACCOMMODATIONREQUESTS;break;case arcori.ePageIndex.EMPLOYER:t=arcori.ePageIndex.INCOME;break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:t=arcori.ePageIndex.EMPLOYER;break;case arcori.ePageIndex.REALESTATEDECLARATION:t=arcori.ePageIndex.MORTGAGEPREAPPROVAL;break;case arcori.ePageIndex.APPLICATIONPRIORITY:t=arcori.ePageIndex.REALESTATEDECLARATION}return i=this.kWizard.getStepByID(t),i?i.options.index+1:this._getInsertIndex(t)},_removeStep:function(n){switch(n){case arcori.ePageIndex.HOUSEHOLD:this.household=null;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:this.accommodationRequests=null;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:this.housingHistory=null;break;case arcori.ePageIndex.APPLICATIONPRIORITY:this.applicationPriority=null}this.kWizard.removeStepByID(n)},_enabledStep:function(n,t){t?this._addStep(n):this._removeStep(n);this._toggleStepVisibility(n,t)},_toggleStepVisibility:function(t,i){let r=null;switch(t){case arcori.ePageIndex.HOUSEHOLD:r=n(this.ELEMENT.sHOUSEHOLDSTEP);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:r=n(this.ELEMENT.sACCOMMODATIONSTEP);break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:r=n(this.ELEMENT.sLIVINGSITUATIONSTEP);break;case arcori.ePageIndex.APPLICATIONPRIORITY:r=n(this.ELEMENT.sPRIORITYSTEP)}r&&r.toggle(i)},_selectInitialStep:function(){this._stepIsAvailable(this._currentPageIndex)?this._setActiveWidget(this._currentPageIndex):this._setActiveWidget(arcori.ePageIndex.APPLICATIONQUESTIONNAIRE)},_stepIsAvailable:function(t){let i=n(`${this.ELEMENT.sWIZARDSTEPPER} #${this._pageIndexToWizardNavItem(t)}`);return i.is(":visible")},_getWidgetOptions:function(n){return{container:`#${n}ContentDiv`,form:`#${n}Form`}},_updateWizardSteps:function(n){this._enabledStep(arcori.ePageIndex.HOUSEHOLD,n.UpdateHousehold);this._enabledStep(arcori.ePageIndex.ACCOMMODATIONREQUESTS,n.UpdateAccommodations);this._enabledStep(arcori.ePageIndex.CURRENTLIVINGSITUATION,n.UpdateCurrentLivingSituation);this._enabledStep(arcori.ePageIndex.APPLICATIONPRIORITY,n.UpdatePriorityInfo)},_showWidget:function(n){let t=this,i=!1,r=t._getWidgetOptions(n);t._busy(!0);switch(n){case arcori.ePageIndex.APPLICATIONQUESTIONNAIRE:t.renewalQuestionnaire===null&&(r.callBack=n=>t._updateWizardSteps(n),t.renewalQuestionnaire=new arcori.RenewalQuestionnaire(r),i=!0);t._widgetObject=t.renewalQuestionnaire;break;case arcori.ePageIndex.HOUSEHOLD:t.household===null&&(t.household=new arcori.Household(r),i=!0);t._widgetObject=t.household;break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:t.communicationPreferences===null&&(t.communicationPreferences=new arcori.CommunicationPreferences(r),i=!0);t._widgetObject=t.communicationPreferences;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:t.accommodationRequests===null&&(t.accommodationRequests=new arcori.AccommodationRequests(r),i=!0);t._widgetObject=t.accommodationRequests;break;case arcori.ePageIndex.APPLICATIONPRIORITY:t.applicationPriority===null&&(t.applicationPriority=new arcori.ApplicationPriority(r),i=!0);t._widgetObject=t.applicationPriority;break;case arcori.ePageIndex.INCOME:t.income===null&&(t.income=new arcori.Income(r),i=!0);t._widgetObject=t.income;break;case arcori.ePageIndex.EMPLOYER:t.employerGrid===null&&(t.employerGrid=new arcori.EmployerGrid(r),i=!0);t._widgetObject=t.employerGrid;break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:t.mortgagePreapproval===null&&(t.mortgagePreapproval=new arcori.MortgagePreapproval(r),i=!0);t._widgetObject=t.mortgagePreapproval;break;case arcori.ePageIndex.REALESTATEDECLARATION:t.realEstateDeclaration===null&&(t.realEstateDeclaration=new arcori.RealEstateDeclaration(r),i=!0);t._widgetObject=t.realEstateDeclaration;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:t.housingHistory===null&&(t.housingHistory=new arcori.HousingHistory(r),i=!0);t._widgetObject=t.housingHistory;break;case arcori.ePageIndex.ATTACHMENTS:t.applicationAttachments===null&&(t.applicationAttachments=new arcori.ApplicationAttachments(r),i=!0);t._widgetObject=t.applicationAttachments;break;case arcori.ePageIndex.DECLARATION:t.declaration===null&&(t.declaration=new arcori.Declaration(r),i=!0);t._widgetObject=t.declaration;break;case arcori.ePageIndex.CONSENT:t.consent===null&&(t.consent=new arcori.Consent(r),i=!0);t._widgetObject=t.consent}i?t._widgetObject.show().finally(()=>this._busy(!1)):t._busy(!1)},_setActiveWidget:function(n){this._currentPageIndex=n;this._highlightCurrentStep();this.kWizard.selectStepByID(this._currentPageIndex);switch(this._currentPageIndex){case arcori.ePageIndex.APPLICATIONQUESTIONNAIRE:this._widgetObject=this.renewalQuestionnaire;break;case arcori.ePageIndex.HOUSEHOLD:this._widgetObject=this.household;break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:this._widgetObject=this.communicationPreferences;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:this._widgetObject=this.accommodationRequests;break;case arcori.ePageIndex.APPLICATIONPRIORITY:this._widgetObject=this.applicationPriority;break;case arcori.ePageIndex.INCOME:this._widgetObject=this.income;break;case arcori.ePageIndex.EMPLOYER:this._widgetObject=this.employerGrid;break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:this._widgetObject=this.mortgagePreapproval;break;case arcori.ePageIndex.REALESTATEDECLARATION:this._widgetObject=this.realEstateDeclaration;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:this._widgetObject=this.housingHistory;break;case arcori.ePageIndex.ATTACHMENTS:this._widgetObject=this.applicationAttachments;break;case arcori.ePageIndex.DECLARATION:this._widgetObject=this.declaration;break;case arcori.ePageIndex.CONSENT:this._widgetObject=this.consent}this._savePageIndex()},_savePageIndex:function(){let r=this,t=n("#ApplicationID").val();if(t!==0){var f={id:t,pageIndex:r._currentPageIndex};u({type:"POST",url:i.SAVELASTPAGE,data:f,cache:!1})}},_onStepActivate:function(n){this._showWidget(n.step.options.contentId)},_onStepSelect:function(n){n.preventDefault();let t=n.step.options.contentId;this._saveCurrentWidget(t)},_onDone:function(){this._widgetObject.save().then(()=>{window.open(i.APPLICATIONCOMPLETE,"_self")})},_busy:function(n){arcori.busy(this.options.container,n)},_pageIndexToWizardNavItem:function(n){return`${n}${t}`},_wizardNavItemToPageIndex:function(n){return n.slice(0,-t.length)}});r(!0,arcori,{RenewalWizard:f})}(window.kendo.jQuery),function(n){var t=n.extend,f=n.ajax,i="#ApplicationID",r={RENEW:arcori.makeUrl("Application/Renew")},u=kendo.Class.extend({init:function(n){n&&n.container&&(this.sCONTAINER=n.container)},_renew:function(){var t=this;return new Promise(function(u){n.when(kendo.ui.ExtYesNoDialog.show({title:arcori.strings.renewApplicationTitle,message:arcori.strings.renewApplicationMsg,icon:"k-ext-question",modal:!0})).done(function(f){f.button==="Yes"?(t._busy(!0),Promise.resolve(n.ajax({type:"POST",url:r.RENEW,data:{applicationID:n(i).val()},cache:!1})).then(function(n){return window.location.reload(),n}).catch(function(n){arcori.displayError(n)}).then(function(n){t._busy(!1);u(n)})):u()})})},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});t(!0,arcori,{Application:u})}(window.kendo.jQuery),function(n){var t=n.extend,i=n.ajax,r={VIEW:arcori.makeUrl("Application/GetAttachmentsView")},u=kendo.Class.extend({ID:null,sCONTAINER:null,sAPPLICATIONID:"#ApplicationID",sORIGINID:"#OriginID",sFORM:null,kValidator:null,$form:null,attachmentList:null,sATTACHMENTSDIV:"#applicationAttachmentsDiv",NODETYPE:"Application",init:function(n){n&&(n.container&&(this.sCONTAINER=n.container),n.form&&(this.sFORM=n.form))},show:function(){var n=this;return n._getView()},_getView:function(){var t=this;return t._busy(!0),Promise.resolve(i({type:"POST",url:r.VIEW,data:{applicationId:n(t.sAPPLICATIONID).val()},cache:!1})).then(function(n){t._updateView(n)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){t._busy(!1)})},_updateView:function(t){var i=this;t&&(kendo.destroy(n(i.sCONTAINER)),n(i.sCONTAINER).html(t.view));i.$form=n(i.sFORM);this.attachmentList=new arcori.AttachmentList({entityID:n(this.sAPPLICATIONID).val(),entityType:this.NODETYPE,container:this.sATTACHMENTSDIV,permissions:{add:!0,remove:!0}});arcori.formatServerSideErrors(i.$form);this.kValidator=i.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator()},save:function(){this.attachmentList.entityID=n(this.sAPPLICATIONID).val();this._busy(!0);return new Promise((n,t)=>this.attachmentList.save().then(()=>{arcori.showMessage(arcori.strings.AttachmentsSaveTitle,arcori.strings.AttachmentsSaveMsg),n()}).catch(n=>{arcori.displayError(n),t(n)}).finally(()=>this._busy(!1)))},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});t(!0,arcori,{ApplicationAttachments:u})}(window.kendo.jQuery),function(n){let r=n.extend,t=n.ajax,i={VIEW:arcori.makeUrl("Application/GetRenewalQuestionnaire"),SAVE:arcori.makeUrl("Application/SaveRenewalQuestionnaire")},u=kendo.Observable.extend({ID:null,sCONTAINER:null,sDETAILSDIV:"#renewalQuestionnaireDetailsDiv",sAPPLICATIONID:"#ApplicationID",sORIGINID:"#OriginID",sLIVINGSITUATIONSUMMARY:"#renewalQuestionnaireDetailsDiv #livingSituationSummary",sACCOMMODATIONSUMMARY:"#renewalQuestionnaireDetailsDiv #accomodationSummary",sPRIORITIESSUMMARY:"#renewalQuestionnaireDetailsDiv #prioritiesSummary",sHOUSEHOLDSUMMARY:"#renewalQuestionnaireDetailsDiv #householdSummary",sVIEWHOUSEHOLDDETAILSBTN:"#renewalQuestionnaireDetailsDiv #ViewHouseholdDetails",sVIEWLIVINGSITUATIONBTN:"#renewalQuestionnaireDetailsDiv #ViewLivingSituationDetails",sVIEWACCOMMODATIONDETAILSBTN:"#renewalQuestionnaireDetailsDiv #ViewAccommodationDetails",sVIEWPRIORITYDETAILSBTN:"#renewalQuestionnaireDetailsDiv #ViewPriorityDetails",sHOUSEHOLDSWITCH:"#renewalQuestionnaireDetailsDiv #UpdateHousehold",sLIVINGSITUATIONSWITCH:"#renewalQuestionnaireDetailsDiv #UpdateCurrentLivingSituation",sACCOMMODATIONSWITCH:"#renewalQuestionnaireDetailsDiv #UpdateAccommodations",sPRIORITYSWITCH:"#renewalQuestionnaireDetailsDiv #UpdatePriorityInfo",sFORM:null,kValidator:null,$form:null,model:null,callBack:null,init:function(n){kendo.Observable.fn.init.call(this);n&&(n.container&&(this.sCONTAINER=n.container),n.form&&(this.sFORM=n.form),n.callBack&&(this.callBack=n.callBack))},_initSummaries:function(){n(this.sVIEWHOUSEHOLDDETAILSBTN).getKendoButton().bind("click",()=>n(this.sHOUSEHOLDSUMMARY).toggle());n(this.sHOUSEHOLDSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate());n(this.sVIEWLIVINGSITUATIONBTN).getKendoButton().bind("click",()=>n(this.sLIVINGSITUATIONSUMMARY).toggle());n(this.sLIVINGSITUATIONSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate());let t=new arcori.Address({prefix:"CurrrentAddressRenewal",hideAddressee:!0,hideToolbar:!0});n(this.sVIEWACCOMMODATIONDETAILSBTN).getKendoButton().bind("click",()=>n(this.sACCOMMODATIONSUMMARY).toggle());n(this.sACCOMMODATIONSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate());n(this.sVIEWPRIORITYDETAILSBTN).getKendoButton().bind("click",()=>n(this.sPRIORITIESSUMMARY).toggle());n(this.sPRIORITYSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate())},onQuestionnaireUpdate:function(){if(this.callBack){let n=this._serializedData();this.callBack(n)}},show:function(){return this._getView()},_getView:function(){let r=this;r._busy(!0);return Promise.resolve(t({type:"POST",url:i.VIEW,data:{applicationId:n(r.sAPPLICATIONID).val()},cache:!1})).then(function(n){r._updateView(n)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){r._busy(!1)})},_updateView:function(t){t&&(kendo.destroy(n(this.sCONTAINER)),n(this.sCONTAINER).html(t.view));this.$form=n(this.sFORM);arcori.formatServerSideErrors(this.$form);this.kValidator=this.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator();t.model&&this._model(t.model);this._initSummaries()},_model:function(n){delete n.UpdateHouseholdQuestionText;delete n.UpdateCurrentLivingSituationQuestionText;delete n.UpdateAccommodationsQuestionText;delete n.UpdatePriorityInfoQuestionText;this.model=kendo.observable(n);kendo.bind(this.sDETAILSDIV,this.model)},save:function(){let n=this;n._busy(!0);return new Promise(function(r,u){Promise.resolve(t({type:"POST",url:i.SAVE,data:n._serializedData(),cache:!1})).then(function(n){arcori.showMessage(n.msgTitle,n.msg)}).catch(function(n){if(n.responseText)arcori.displayError(n),u(n);else throw n;}).then(function(t){n._busy(!1);r(t)})})},_serializedData:function(){let n;return n=this.model.toJSON(),delete n.RenewalInstructions,delete n.PrimaryApplicantPhoneNumbers,delete n.PrimaryApplicantEmailAddresses,delete n.AdditionalHouseholdMembersDisplay,delete n.AlternateContactDisplay,delete n.AlternateContactCards,delete n.HouseholdVM,delete n.CurrentResidenceAddress,n},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});r(!0,arcori,{RenewalQuestionnaire:u})}(window.kendo.jQuery),function(n){var ot=n.extend,st=n.ajax,nt="ID",et="StreetDirection",i="Type",e="Addressee",u="StreetType",b="Municipality",o="Province",f="UnitType",a="CivicNumber",v="CivicSuffix",y="StreetName",s="StreetDirection",h="UnitNumber",k="GeneralDeliveryInfo",p="POBox",w="RRNumber",c="StationInfo",l="PostalCode",d="#AddresseeDiv",g="#UnitDiv",tt="#PO_RRDiv",ut="#PODiv",ft="#RRDiv",it="#GeneralDeliveryDiv",rt="#StreetDiv",t={CIVIC:"Civic",POBOX:"PO",RR:"RR",GD:"GeneralDelivery"},r={EDIT:"EditAddress",COPY:"CopyAddress",EDITOR:{OK:"SaveAddress",CANCEL:"CancelAddress"}},ht={VALIDATE:arcori.makeUrl("Address/Validate")},ct=kendo.Class.extend({prefix:"",copyOptions:null,hideAddressee:!1,hideUnit:!1,hideEditorToolbar:!1,hideToolbar:!1,kTypeDropDown:null,kWindow:null,kToolBar:null,kEditorToolBar:null,result:null,title:null,kEdit:null,kCopy:null,init:function(t){var i=this;this.prefix=t.prefix;"copy"in t&&(this.copyOptions=t.copy);"hideAddressee"in t&&(this.hideAddressee=t.hideAddressee);"hideUnit"in t&&(this.hideUnit=t.hideUnit);"hideEditorToolbar"in t&&(this.hideEditorToolbar=t.hideEditorToolbar);"hideToolbar"in t&&(this.hideToolbar=t.hideToolbar);"enabled"in t&&(t.enabled||_setAddressState(!1));this.title="title"in t?t.title:arcori.strings.address;this._initAddress();this._updateDisplayValue();this.hideToolbar&&n("#"+this.prefix+"TB").hide();this.hideEditorToolbar||(this.kEdit=n("#"+this.prefix+"TB"+r.EDIT).getKendoButton(),this.kEdit.bind("click",this._onTBClick.bind(this,r.EDIT)),this.copyOptions&&(n("#"+this.prefix+"TB"+r.COPY).html(this.copyOptions.text),this.kCopy=n("#"+this.prefix+"TB"+r.COPY).kendoButton({spriteCssClass:"fa fa-copy"}).getKendoButton(),this.kCopy.bind("click",this._onTBClick.bind(this,r.COPY))),this.kEditorToolBar=n("#"+this.prefix+"EditorTB").getKendoToolBar(),this.kEditorToolBar.bind("click",function(n){var t=function(){i.result=n.id;i.kWindow.close()};switch(n.id){case r.EDITOR.OK:i._validate().then(function(){t()});break;case r.EDITOR.CANCEL:t()}}))},_onTBClick:function(n){var t=this;switch(n){case r.EDIT:t._edit();break;case r.COPY:t.copyOptions.address().then(function(n){t.value(n)})}},_initAddress:function(t){t&&(kendo.destroy("#"+this.prefix+"Form"),n("#"+this.prefix+"Form").html(t));arcori.formatServerSideErrors(n("#"+this.prefix+"Form"));this.kTypeDropDown=n(this._$getID(i)).getKendoDropDownList();this.kTypeDropDown.bind("change",this._onTypeChange.bind(this));this._onTypeChange();n(this._$getID(et)).getKendoComboBox().list.width(150);n(this._$getID(u)).getKendoComboBox().list.width(150);this.hideAddressee&&n(this._$getSelector(d)).hide();this.hideUnit&&n(this._$getSelector(g)).hide();n(this._$getID(u)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(et)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(o)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(f)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(l)).bind("blur",function(){this.value=this.value.toUpperCase()})},_edit:function(){var t=this,i=this.value();this.result=null;this.kWindow=n("
").kendoWindow({width:700,height:"auto",modal:!0,title:this.title,resizable:!1,deactivate:function(){this.destroy()},close:function(){t.result===r.EDITOR.OK?t._updateDisplayValue():t.value(i);n("#"+t.prefix+"Hidden").append(n("#"+t.prefix+"Window").contents())}}).getKendoWindow();n("#"+this.prefix+"Window").append(n("#"+this.prefix+"Hidden").contents());this.kWindow.center().open()},destroy:function(){},resize:function(){},_busy:function(t){kendo.ui.progress(n("#"+this.prefix),t)},_validate:function(){var n=this;return this._busy(!0),new Promise(function(t){Promise.resolve(st({type:"POST",url:ht.VALIDATE,data:{address:n.value(),prefix:n.prefix},cache:!1})).then(function(){t()}).catch(function(t){var i=arcori.displayError(t);n._initAddress(i.address)}).then(function(){n._busy(!1)})})},_updateDisplayValue:function(){n("#"+this.prefix+"_d").html(this._displayValue())},_displayValue:function(){var r=this.value(),n="";return r[i]!==t.GD&&(this.hideAddressee||(n+="