UNPKG

@salaxy/ng1

Version:

AngularJS libraries for Salaxy platform (Palkkaus.fi)

15 lines (11 loc) 4.15 MB
(function(Y,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@salaxy/core"),require("@salaxy/reports")):typeof define=="function"&&define.amd?define(["exports","@salaxy/core","@salaxy/reports"],o):(Y=typeof globalThis<"u"?globalThis:Y||self,o((Y.salaxy=Y.salaxy||{},Y.salaxy.ng1={}),Y.salaxy.core,Y.salaxy.reports))})(this,function(Y,o,ye){"use strict";var yj=Object.defineProperty;var fj=(Y,o,ye)=>o in Y?yj(Y,o,{enumerable:!0,configurable:!0,writable:!0,value:ye}):Y[o]=ye;var Mt=(Y,o,ye)=>(fj(Y,typeof o!="symbol"?o+"":o,ye),ye),bj=(Y,o,ye)=>{if(!o.has(Y))throw TypeError("Cannot "+ye)};var tA=(Y,o,ye)=>{if(o.has(Y))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(Y):o.set(Y,ye)};var mg=(Y,o,ye)=>(bj(Y,o,"access private method"),ye);var Ni,Yb,nu,eA,Pm,R0;const vr=class vr{constructor(t,e,a=null){this.$http=t,this.$q=e,this.useCookie=!0,this.useCredentials=!1,this.serverAddress="https://test-api.salaxy.com";const n=o.Configs.current;if(n||a){const i=a?.apiServer??n.apiServer;i&&(this.serverAddress=i);const r=a?.useCredentials??n.useCredentials;r!=null&&(this.useCredentials=r);const l=a?.useCookie??n.useCookie;l!=null&&(this.useCookie=l)}}getApiAddress(){return this.serverAddress+"/v03/api"}getServerAddress(){return this.serverAddress}getJSON(t){const e={},a=this.getCurrentToken();return a&&(e.headers={Authorization:"Bearer "+a}),e.url=this.getUrl(t),e.method="GET",e.responseType="json",e.withCredentials=a?!1:this.useCredentials,this.$http(e).then(n=>n.data,n=>this.handleError(n))}getHTML(t){const e={},a=this.getCurrentToken();return a&&(e.headers={Authorization:"Bearer "+a}),e.url=this.getUrl(t),e.method="GET",e.responseType="text",e.withCredentials=a?!1:this.useCredentials,this.$http(e).then(n=>n.data,n=>this.handleError(n))}postJSON(t,e){const a={},n=this.getCurrentToken();return n&&(a.headers={Authorization:"Bearer "+n}),a.url=this.getUrl(t),a.method="POST",a.data=e,a.responseType="json",a.withCredentials=n?!1:this.useCredentials,this.$http(a).then(i=>i.data,i=>this.handleError(i))}postHTML(t,e){const a={},n=this.getCurrentToken();return n&&(a.headers={Authorization:"Bearer "+n}),a.url=this.getUrl(t),a.method="POST",a.data=e,a.responseType="text",a.withCredentials=n?!1:this.useCredentials,this.$http(a).then(i=>i.data,i=>this.handleError(i))}remove(t){const e={},a=this.getCurrentToken();return a&&(e.headers={Authorization:"Bearer "+a}),e.url=this.getUrl(t),e.method="DELETE",e.responseType="json",e.withCredentials=a?!1:this.useCredentials,this.$http(e).then(n=>n.data,n=>this.handleError(n))}getCurrentToken(){return!this.token&&this.useCookie&&(this.token=new o.Cookies().get("salaxy-token")||""),this.token}getTokenStatus(){const t=this.getCurrentToken();return o.Token.validate(t)}setCurrentToken(t){this.useCookie&&new o.Cookies().setCookie("salaxy-token",t||""),this.token=t}getUrl(t){return!t||t.trim()===""?null:t.toLowerCase().startsWith("http")?t:t.toLowerCase().startsWith("/v")?this.getServerAddress()+t:this.getApiAddress()+t}handleError(t){let e;if(t?t.data&&t.data.messageHtml?e=`<b>${t.data.error}:</b><br/>${t.data.messageHtml}`:t.data&&t.data.message?e=t.data.message:e=`HTTP error: ${t.statusText} (${t.status})`:e="Unexpected error in HTTP request",vr.alertService){if(vr.alertService.catchError)return vr.alertService.catchError(t);vr.alertService.addError(e)}return this.$q.reject(t)}};vr.$inject=["$http","$q"];let Vl=vr;const Ff=class Ff{constructor(t,e,a=null){this.$scope=t,this.wizardService=e,this.data=a,this.colWidthClasses=["col-sm-12","col-sm-12","col-sm-6","col-sm-4","col-sm-3","col-sm-fifth","col-sm-2"]}$onInit(){}get steps(){return this.wizardService.getSteps()}get step(){return this.wizardService.activeStepNumber}set step(t){this.wizardService.activeStepNumber=t}get currentStep(){return this.wizardService.getCurrentStepObject()}get style(){return{colWidthClass:this.colWidthClasses[this.steps.length]}}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled)}get canGoPrevious(){return this.step>1&&!this.steps[this.step-2].disabled}goNext(){this.canGoNext&&this.step++}goPrevious(){this.canGoPrevious&&this.step--}};Ff.$inject=["$scope","WizardService","data"];let Wn=Ff;const zf=class zf extends Wn{constructor(t,e,a,n,i,r,l,c){super(t,e,c),this.onboardingService=a,this.sessionService=n,this.authorizedAccountService=i,this.ajax=r,this.$location=l,this.isStepProceeding=!1,this.linkCopied=!1}$onInit(){this.wizardService.setSteps(this.getWizardSteps()),this.model&&this.model.company.resolvedId&&this.model.signature.personalId!=null?this.wizardService.activeStepNumber=this.wizardService.getSteps().length:this.wizardService.activeStepNumber=1}getWizardSteps(){const t=[];return t.push({title:"SALAXY.NG1.CustomerOnboardingComponent.stepUserInfo.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/user.html",buttonsView:"salaxy-components/modals/onboarding/customer/user-buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepCompanyInfo.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/company.html",buttonsView:"salaxy-components/modals/onboarding/customer/buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepCompanyLegal.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/company-legal.html",buttonsView:"salaxy-components/modals/onboarding/customer/buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepInsurance.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/insurance.html",buttonsView:"salaxy-components/modals/onboarding/customer/commit-buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepInviteCompany.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/finish.html",buttonsView:"salaxy-components/modals/onboarding/customer/finish-buttons.html"}),t}get model(){return this.onboardingService.model}goNext(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goNext(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}get signingLink(){return this.model?o.Configs.current.wwwServer+"/share/signing/"+encodeURIComponent(this.model.owner)+"/"+this.model.id:""}get sharingLink(){return this.model?o.Configs.current.wwwServer+"/share/authorization/"+encodeURIComponent(this.model.owner)+"/"+this.model.id:""}copyLink(t){navigator.clipboard.writeText(t),this.linkCopied=!0}get mailtoLink(){if(!this.model||!this.model.person)return"";let t="mailto:";t+=this.model.person.contact.email,t+="?subject="+encodeURIComponent("Palkkaus.fi-palvelun valtakirjan allekirjoitus");let e="Hei "+this.model.person.firstName+" "+this.model.person.lastName+`, `;return e+="Olemme ottamassa käyttöön Palkkaus.fi-palvelun yrityksesi palkanmaksuun.",e+=" Jotta he voivat hoitaa kaikki viranomaisvelvoitteet, tarvitaan allekirjoitus sinulta.",e+=" Se hoituu helposti pankkitunnuksilla seuraamalla tätä linkkiä: ",e+=this.sharingLink+`. `,e+=`Ystävällisin terveisin, `,e+=this.sessionService.getAvatar().displayName,t+="&body="+encodeURIComponent(e),t}get existingCompanyAlert(){const t=this.sessionService.session?.currentAccount?.id;return this.model?.company?.resolvedId&&this.model.company.resolvedId!=t}goToCompanySelection(){this.model.company.doYtjUpdate=!0,this.goNext()}commit(){this.isStepProceeding||(this.isStepProceeding=!0,this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.commit().then(()=>{this.authorizedAccountService.reloadAuthorizingAccounts(),super.goNext(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}checkPensionCompanySelection(){this.model.products.pension.isPensionContractDone||(this.model.products.pension.pensionCompany=o.PensionCompany.None,this.model.products.pension.pensionContractNumber=null);const t=this.model.products.pension.pensionCompany;this.model.products.pension.isPensionContractDone&&t===o.PensionCompany.Varma&&(this.model.products.pension.isPendingContract=!1),(t===o.PensionCompany.Veritas||t===o.PensionCompany.Apteekkien||t===o.PensionCompany.Verso||t===o.PensionCompany.Valio||(t??"").startsWith("keva")||t===o.PensionCompany.Other)&&(this.model.products.pension.isPensionSelfHandling=!0),this.model.products.pension.isPendingContract&&(this.model.products.pension.isPensionSelfHandling=!1)}checkInsuranceCompanySelection(){this.model.products.insurance.isInsuranceContractDone||(this.model.products.insurance.insuranceCompany=null,this.model.products.insurance.insuranceContractNumber=null)}save(){return this.onboardingService.save()}setPensionNumberForTest(){this.model.products.pension.pensionContractNumber=o.SettingsLogic.getPensionNumberForTest(this.model.products.pension.pensionCompany)}launch(t=null){return this.onboardingService.launchCustomerOnboarding(t)}};zf.$inject=["$scope","WizardService","OnboardingService","SessionService","AuthorizedAccountService","AjaxNg1","$location","data"];let ku=zf;const Bf=class Bf extends Wn{constructor(t,e,a,n,i){super(t,e),this.onboardingService=a,this.sessionService=n,this.uiHelpers=i,this.wizardSteps=[{title:"SALAXY.NG1.WorkerOnboardingComponent.stepUserInfo.title",heading:"SALAXY.NG1.WorkerOnboardingComponent.stepUserInfo.heading",intro:"",active:!0,view:"salaxy-components/modals/onboarding/worker/user-info.html",buttonsView:"salaxy-components/modals/onboarding/worker/firstPageButtons.html"},{title:"SALAXY.NG1.WorkerOnboardingComponent.stepContract.stepTitle",heading:"SALAXY.NG1.WorkerOnboardingComponent.stepContract.heading",intro:"SALAXY.NG1.WorkerOnboardingComponent.stepContract.intro",view:"salaxy-components/modals/onboarding/worker/contract-worker.html",buttonsView:"salaxy-components/modals/onboarding/worker/contractButtons.html"}],this.isStepProceeding=!1}$onInit(){this.wizardService.setSteps(this.wizardSteps),this.wizardService.activeStepNumber=1}goNext(){return this.isStepProceeding?Promise.resolve(!1):(this.isStepProceeding=!0,this.save().then(()=>(super.goNext(),this.isStepProceeding=!1,!0)).catch(t=>(this.isStepProceeding=!1,!1)))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}goNextIf(t){t(()=>this.goNext())}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}save(){return this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.save()}get vismaSignUrl(){const t=this.model.signature.method;return this.onboardingService.getDigitalSignUrl(t)}get model(){return this.onboardingService.model}getPdfPreviewAddress(){return this.onboardingService.getPdfPreviewAddress()}getValidationError(t){return this.model&&this.model.validation?this.model.validation.errors.find(e=>e.key===t):null}removeValidationError(t){this.model&&this.model.validation&&(this.model.validation.errors=this.model.validation.errors.filter(e=>e.key!==t))}isOtherIdentifier(t){return/^.{7}[9]/.test((t||"").trim())}launch(t=null){return this.onboardingService.launchWorkerOnboarding(t)}};Bf.$inject=["$scope","WizardService","OnboardingService","SessionService","UiHelpers"];let Tu=Bf;const Wf=class Wf extends Wn{constructor(t,e,a,n,i){super(t,e,i),this.onboardingService=a,this.sessionService=n,this.wizardSteps=[{title:"Käyttäjän tiedot",heading:"Tervetuloa, Palkkamyllyyn!",intro:`Palkkamyllyn tarjoaa Rakennusliitto ry, joka toimii henkilötietojen käsittelijänä ja vastaa myös asiakaspalvelusta. Palvelun tuottajana, teknisenä toteuttajana ja myös henkilötietojen käsittelijä toimii Suomen Palkanlaskenta Oy (Palkkaus.fi).`,active:!0,view:"salaxy-components/modals/onboarding/household/wizard_index.html",buttonsView:"salaxy-components/modals/onboarding/household/firstPageButtons.html"},{title:"Palkanmaksun tiedot",heading:"Palkanmaksun tiedot",view:"salaxy-components/modals/onboarding/household/household.html",buttonsView:"salaxy-components/modals/onboarding/household/householdButtons.html"},{title:"Palvelusopimus",heading:"Palvelusopimus ja valtuutus",view:"salaxy-components/modals/onboarding/household/contract.html",buttonsView:"salaxy-components/modals/onboarding/household/contractButtons.html"}],this.isStepProceeding=!1}$onInit(){this.wizardService.setSteps(this.wizardSteps),this.wizardService.activeStepNumber=1}goNext(){return this.isStepProceeding?Promise.resolve(!1):(this.isStepProceeding=!0,this.save().then(()=>(super.goNext(),this.isStepProceeding=!1,!0)).catch(t=>(this.isStepProceeding=!1,!1)))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}goNextIf(t){t(()=>this.goNext())}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}save(){return this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.save()}get vismaSignUrl(){const t=this.model.signature.method;return this.onboardingService.getDigitalSignUrl(t)}get model(){return this.onboardingService.model}getPdfPreviewAddress(){return this.onboardingService.getPdfPreviewAddress()}getValidationError(t){return this.model&&this.model.validation?this.model.validation.errors.find(e=>e.key===t):null}removeValidationError(t){this.model&&this.model.validation&&(this.model.validation.errors=this.model.validation.errors.filter(e=>e.key!==t))}launch(t=null){return this.onboardingService.launchHouseholdOnboarding(t)}};Wf.$inject=["$scope","WizardService","OnboardingService","SessionService","data"];let Lu=Wf;const jf=class jf extends Wn{constructor(t,e,a,n,i,r,l,c){super(t,e,l),this.onboardingService=a,this.sessionService=n,this.ajax=i,this.$location=r,this.uiHelpers=c,this.isStepProceeding=!1}$onInit(){this.wizardService.setSteps(this.getWizardSteps()),this.model&&this.model.signature.isProcura?this.wizardService.activeStepNumber=3:this.wizardService.activeStepNumber=1}getWizardSteps(){const t=[];return t.push({title:"SALAXY.NG1.CompanyOnboardingComponent.step1.title",intro:"SALAXY.NG1.CompanyOnboardingComponent.step1.intro",active:!0,view:"salaxy-components/modals/onboarding/company/wizard_index.html",buttonsView:"salaxy-components/modals/onboarding/company/firstPageButtons.html"}),this.showCompanySelection&&t.push({title:"SALAXY.NG1.CompanyOnboardingComponent.stepSuomiFi.title",intro:"SALAXY.NG1.CompanyOnboardingComponent.stepSuomiFi.intro",view:"salaxy-components/modals/onboarding/company/suomifi.html",buttonsView:"salaxy-components/modals/onboarding/company/suomifiButtons.html"}),t.push({title:"SALAXY.NG1.CompanyOnboardingComponent.stepCompanyInfo.title",intro:"SALAXY.NG1.CompanyOnboardingComponent.stepCompanyInfo.intro",view:"salaxy-components/modals/onboarding/company/company.html",buttonsView:"salaxy-components/modals/onboarding/company/defaultWizardButtons.html"},{title:"SALAXY.NG1.CompanyOnboardingComponent.stepContract.title",view:"salaxy-components/modals/onboarding/company/contract.html",buttonsView:"salaxy-components/modals/onboarding/company/contractButtons.html"}),t}goNext(){return this.isStepProceeding?Promise.resolve(!1):(this.isStepProceeding=!0,this.save().then(()=>(super.goNext(),this.isStepProceeding=!1,!0)).catch(t=>(this.isStepProceeding=!1,!1)))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}save(){return this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.save()}get vismaSignUrl(){return this.onboardingService.getDigitalSignUrl()}get model(){return this.onboardingService.model}get showCompanySelection(){return this.model&&this.model.company&&this.model.company.roles&&this.model.company.roles.some(e=>e===o.Role.Accountant||e===o.Role.AccountantCandidate)}getPdfPreviewAddress(){return this.onboardingService.getPdfPreviewAddress()}get existingCompanyAlert(){const t=this.sessionService.session?.currentAccount?.id;return this.model?.company?.resolvedId&&this.model.company.resolvedId!=t}goToSuomifi(){const t=this.$location.url();let e=this.$location.absUrl();t.length>1&&(e=e.substring(0,e.indexOf(t))),e=e.replace(/\/$/,"").trim();const a=this.ajax.getCurrentToken(),n=a?`${encodeURIComponent(a)}`:"",i=e.indexOf("&")>=0||e.indexOf("?")>=0?"&url=":"",r=`${e}${i}/onboarding/company/${this.model.id}${n?"&ob_token="+n:""}`,l=`${e}${i}/onboarding/company/${this.model.id}${n?"&ob_token="+n:""}`;this.save().then(()=>{window.location.assign(`${this.ajax.getServerAddress()}/Onboarding/CompanySelection?OnboardingId=${encodeURIComponent(this.model.id)}&Language=${encodeURIComponent(o.Translations.getLanguage())}&SuccessUrl=${encodeURIComponent(l)}&CancelUrl=${encodeURIComponent(r)}${n?"&access_token="+n:""}`)})}launch(t=null){return this.onboardingService.launchCompanyOnboarding(t)}chooseBusinessId(t){this.model.company.businessId=t,this.model.company.ytjSearch=null,this.searchYtj()}searchYtj(t){this.model.company.companyType=null,this.model.company.contact.street=null,this.model.company.contact.city=null,this.model.company.contact.postalCode=null,this.model.company.ytjSearch=null,this.model.company.doYtjUpdate=!0,t==="name"&&(this.model.company.businessId=null),t==="businessId"&&(this.model.company.name=null),this.save()}getValidationError(t){return this.model&&this.model.validation?this.model.validation.errors.find(e=>e.key===t):null}openSigningWizardDialog(t=null){const e=this.sessionService.getCurrentCss(),a=this.sessionService.getOrigin(),n=a+(e?`popup.html#settings/signing?skin=${e}&lang=${o.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`:`popup.html#settings/signing?lang=${o.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`);return this.uiHelpers.showExternalDialog(t,n,{id:t,origin:a},{width:1080,height:800}).then(i=>{if(i?.action!="cancel")return this.checkSession()})}launchSigningWizard(){const t=this.readTokenFromUrl(this.$location.absUrl(),"data="),e=JSON.parse(atob(decodeURIComponent(t)))?.id,a=JSON.parse(atob(decodeURIComponent(t)))?.origin;return this.onboardingService.getOnboardingData(e).then(()=>{const n=this.sessionService.getCurrentCss();return this.onboardingService.model.ui.successUrl=a+(n?`popup.html#settings/signing-success?skin=${n}&lang=${o.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`:`popup.html#settings/signing-success?lang=${o.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`),this.onboardingService.model.ui.cancelUrl=this.onboardingService.model.ui.successUrl.replace("/signing-success?","/signing-cancel?"),this.onboardingService.save().then(()=>this.onboardingService.launchCompanyOnboarding(this.onboardingService.model.id))})}checkSession(){return this.sessionService.checkSession()}readTokenFromUrl(t,e){const a=t.toLowerCase().indexOf(e);if(a>=0){const n=t.indexOf("&",a);return n>=0?t.substring(a+e.length,n):t.substring(a+e.length)}return null}};jf.$inject=["$scope","WizardService","OnboardingService","SessionService","AjaxNg1","$location","data","UiHelpers"];let Du=jf;const Vf=class Vf{constructor(t,e,a,n,i,r,l,c){this.$scope=t,this.onboardingService=e,this.sessionService=a,this.signatureService=n,this.$sce=i,this.uiHelpers=r,this.ajax=l,this.$timeout=c,this.showInPopup=!1,this.isSigninStarted=!1,this.$onInit=()=>{this.init(),this.sessionService.subscribe(this.$scope,()=>{this.init()}),this.isContactPersonSigner=!0}}save(){return this.isContactPersonSigner&&(this.model.company.contact.email=this.model.signature.email,this.model.company.contact.telephone=this.model.signature.telephone),this.onboardingService.save().then(t=>(this.pdfPreviewUrl=null,t))}get model(){return this.onboardingService.model?.company&&(this.onboardingService.model.company.language=o.Translations.getLanguage()),this.onboardingService.model?.person&&(this.onboardingService.model.person.language=o.Translations.getLanguage()),this.onboardingService.model}getPdfPreviewAddress(){return!this.pdfPreviewUrl&&this.model?.id&&(this.pdfPreviewUrl=this.$sce.trustAsResourceUrl(this.onboardingService.getPdfPreviewAddress(!0)+"&t="+new Date().getTime()+"&language="+this.model.company.language)),this.pdfPreviewUrl}startDigitalSignature(t){this.isSigninStarted=!0,this.showInPopup?this.save().then(()=>{let e=this.sessionService.getCurrentCss()||"";e&&(e=`skin=${e}&`);const a=this.sessionService.getOrigin()+`popup.html#settings/signing-success?${e}lang=${o.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`,n=this.onboardingService.getDigitalSignUrl(t,null,null,a,a.replace("/signing-success?","/signing-cancel?"));return this.$timeout(()=>this.isSigninStarted=!1,2e3),this.uiHelpers.showExternalDialog("vismaSignPopup",n,{},{width:1080,height:800}).then(i=>{if(i?.action!="cancel")return this.sessionService.checkSession()})}):(this.uiHelpers.showLoading("SALAXY.NG1.SigningComponent.dialog.header",`Siirrytään allekirjoitukseen (${t})`),this.save().then(()=>{window.top.location.href=this.onboardingService.getDigitalSignUrl(t)}))}get methods(){return this.signatureService.getMethods()}getMethod(t){const e=this.methods.filter(a=>a.value===t);return e.length>0?e[0]:null}init(){if(this.isSigningOk=this.sessionService.isSigningOk(),this.pdfPreviewUrl=null,this.isSigningRequired=!this.sessionService.isSigningOk(),this.sessionService.isSessionChecked&&this.sessionService.isAuthenticated){const t=this.sessionService.session.currentAccount.id;if(this.onboardingService.model&&this.onboardingService.model.company.resolvedId===t)return;this.onboardingService.model=null,this.onboardingService.id=null,this.onboardingService.getOnboardingDataForAccount(this.sessionService.session.currentAccount.id).then(()=>{if(this.onboardingService.model){this.onboardingService.model.signature.isPep=null,this.onboardingService.model.company.ownership.isRequiredTracking=null,this.onboardingService.model.id||this.onboardingService.save();return}else this.onboardingService.model={accountType:o.WebSiteUserRole.Company,signature:{}},this.onboardingService.save()})}}};Vf.$inject=["$scope","OnboardingService","SessionService","SignatureService","$sce","UiHelpers","AjaxNg1","$timeout"];let ql=Vf;const qf=class qf{constructor(t){this.signatureService=t,this.$onInit=()=>{}}get methods(){return this.getMethods("tupas")}getMethods(t="tupas"){return this.signatureService.getMethods(t)}getMethod(t){return this.signatureService.getMethods("tupas").find(e=>e.value===t)??this.signatureService.getMethods("telia").find(e=>e.value===t)}};qf.$inject=["SignatureService"];let Iu=qf;const Kf=class Kf{constructor(t,e,a,n){if(this.crudService=t,this.$location=e,this.$attrs=a,this.uiHelpers=n,this.copyIdAsNew=i=>{const r=this.list.find(l=>l.id===i);return r?this.copyAsNew(r):null},this.listSelect=i=>{this.$attrs.onListSelect?this.onListSelect({item:i}):this.detailsUrl?this.$location.url(this.detailsUrl+(i.id||i.rowIndex)):this.setCurrent(i)},this.listSelectId=i=>{const r=this.list.find(l=>l.id===i);r&&this.listSelect(r)},this.delete=(i,r)=>this.uiHelpers.showConfirm(r||"SALAXY.NG1.ApiCrudObjectComponent.deleteDialog").then(l=>l?this.$attrs.onDelete?this.onDelete({deleteResult:this.deleteNoConfirm(i)}):(this.listUrl&&this.$location.url(this.listUrl),this.deleteNoConfirm(i)):Promise.resolve(!1)),!t)throw new Error("crudService is undefined in CrudControllerBase");if(!e)throw new Error("$location is undefined in CrudControllerBase");if(!n)throw new Error("uiHelpers is undefined in CrudControllerBase");if(!a)throw new Error("$attrs is undefined in CrudControllerBase")}$onInit(){}get current(){return this.getBindingMode()==="model"?this.model.$viewValue:this.crudService.current}get list(){return this.crudService.list}createNew(t=null){return t||(t=this.crudService.getBlank()),this.$attrs.onCreateNew?this.onCreateNew({item:t}):(this.setCurrent(t),this.detailsUrl&&this.$location.url(this.detailsUrl+"new#"+new Date().getTime())),t}copyCurrent(){this.current&&this.setCurrent(this.crudService.copyAsNew(this.current))}copyAsNew(t){const e=this.crudService.copyAsNew(t);return this.createNew(e)}getBindingMode(){return this.model?"model":"singleton"}saveCurrent(){return this.crudService.saveCurrent()}setCurrent(t){this.getBindingMode()==="model"?this.model.$setViewValue(t):this.crudService.setCurrent(t)}deleteNoConfirm(t){const e=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");return this.crudService.delete(t).then(()=>(e.dismiss(),!0))}};Kf.crudBindings={onListSelect:"&",onDelete:"&",onCreateNew:"&",detailsUrl:"@",listUrl:"@"};let Hi=Kf;const Jf=class Jf extends Hi{constructor(t,e,a,n,i,r){super(t,e,a,n),this.authorizedAccountService=t,this.sessionService=i,this.ajax=r}get partnerIntegrationSites(){return this.authorizedAccountService.getPartnerIntegrationSiteList()}getPartnerSite(t){return this.authorizedAccountService.getPartnerSite(t)}get currentPartnerSite(){return this.authorizedAccountService.getCurrentPartnerSite()}showPartnerSiteDialog(t){const e=this.getPartnerSite(t);this.authorizedAccountService.setCurrentPartnerSite(e),this.uiHelpers.showDialog("salaxy-components/modals/account/Authorization.html","AccountAuthorizationController")}switchAuthorization(){const t=this.currentPartnerSite;if(this.disabled!==!0&&!t.disabled){if(t.enabled==!1&&t.accountId)console.debug("delete"),this.authorizedAccountService.delete(t.accountId);else if(t.enabled==!0&&t.accountId){console.debug("save");const e=this.authorizedAccountService.getBlank();e.id=t.accountId,this.authorizedAccountService.save(e)}}}get authorizingAccounts(){return this.authorizedAccountService.getAuthorizingAccounts()}deleteAccount(t){this.uiHelpers.showConfirm("Haluatko varmasti poistaa tilin, tiliä ei voi palauttaa?").then(e=>{if(e){const a=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");this.ajax.remove("/accounts/authorizingAccount/"+t).then(()=>{this.authorizedAccountService.reloadAuthorizingAccounts().then(()=>{a.dismiss()})})}})}showAuthorizedAccountAddDialog(){super.createNew(),this.uiHelpers.showDialog("salaxy-components/modals/account/AuthorizedAccountAdd.html","AccountAuthorizationController")}saveCurrent(t=null){const e=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");return super.saveCurrent().then(a=>(e.dismiss(),t&&t(a),a))}getLoginAsUrl(t){let e=this.ajax.getServerAddress()+"/Security/LoginAs/"+t;return e=e+"?access_token="+encodeURIComponent(this.ajax.getCurrentToken()),e}isInRole(t){return this.sessionService.isInRole(t)}};Jf.$inject=["AuthorizedAccountService","$location","$attrs","UiHelpers","SessionService","AjaxNg1"];let ri=Jf;const Qf=class Qf extends Hi{constructor(t,e,a,n,i){super(t,e,a,n),this.certificateService=t,this.certificateApi=i,this.result=void 0,this.certFormat="pfx",this.certFormats=[{value:"pfx",text:"Windows-sertifikaatti (pfx / pkcs12)",ui:{mime:"application/x-pkcs12",suffix:"pfx"}},{value:"pem",text:"Yleinen sertifikaatti (zip / pem)",ui:{mime:"application/zip",suffix:"zip"}}]}createNew(){return super.createNew(),this.current.title=o.Translations.get("SALAXY.NG1.CertificatesComponent.newCertificate"),this.current}get currentCertFormat(){return this.certFormats.find(t=>t.value===this.certFormat)||this.certFormats[0]}showCertificateAddDialog(){this.createNew(),this.uiHelpers.showDialog("salaxy-components/modals/account/CertificateAdd.html","CertificateController")}createCert(){const t=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");this.certFormat==="pem"?this.certificateApi.issuePemCertificate(this.current).then(e=>{this.result={blob:this.uiHelpers.bytes2Blob(e.bytes,this.currentCertFormat.ui.mime),text:e.cert+` `+e.key,thumbprint:e.thumbprint},t.dismiss()}):super.saveCurrent().then(e=>{this.result={blob:this.uiHelpers.bytes2Blob(e.bytes,this.currentCertFormat.ui.mime),text:e.bytes,thumbprint:e.thumbprint},t.dismiss()})}downloadCertFile(){this.uiHelpers.downloadFile(this.result.blob,`${this.result.thumbprint}.${this.currentCertFormat.ui.suffix}`)}};Qf.$inject=["CertificateService","$location","$attrs","UiHelpers","Certificates"];let Pr=Qf;var jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vn(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}/** * @license AngularJS v1.8.3 * (c) 2010-2020 Google LLC. http://angularjs.org * License: MIT */(function(s){var t={objectMaxDepth:5,urlErrorParamsEnabled:!0};function e(u){if(ot(u))K(u.objectMaxDepth)&&(t.objectMaxDepth=a(u.objectMaxDepth)?u.objectMaxDepth:NaN),K(u.urlErrorParamsEnabled)&&_a(u.urlErrorParamsEnabled)&&(t.urlErrorParamsEnabled=u.urlErrorParamsEnabled);else return t}function a(u){return pt(u)&&u>0}function n(u,m){m=m||Error;var f="https://errors.angularjs.org/1.8.3/",b=f.replace(".","\\.")+"[\\s\\S]*",w=new RegExp(b,"g");return function(){var D=arguments[0],S=arguments[1],$="["+(u?u+":":"")+D+"] ",C=ka(arguments,2).map(function(M){return pu(M,t.objectMaxDepth)}),I,E;if($+=S.replace(/\{\d+\}/g,function(M){var H=+M.slice(1,-1);return H<C.length?C[H].replace(w,""):M}),$+=` `+f+(u?u+"/":"")+D,t.urlErrorParamsEnabled)for(E=0,I="?";E<C.length;E++,I="&")$+=I+"p"+E+"="+encodeURIComponent(C[E]);return new m($)}}var i=/^\/(.+)\/([a-z]*)$/,r="validity",l=Object.prototype.hasOwnProperty,c=function(u){return Z(u)?u.toLowerCase():u},d=function(u){return Z(u)?u.toUpperCase():u},p,h,g,y=[].slice,A=[].splice,v=[].push,k=Object.prototype.toString,L=Object.getPrototypeOf,R=n("ng"),T=s.angular||(s.angular={}),x,P=0;p=s.document.documentMode;function X(u){if(u==null||Kt(u))return!1;if(kt(u)||Z(u)||h&&u instanceof h)return!0;var m="length"in Object(u)&&u.length;return pt(m)&&(m>=0&&m-1 in u||typeof u.item=="function")}function N(u,m,f){var b,w;if(u)if(wt(u))for(b in u)b!=="prototype"&&b!=="length"&&b!=="name"&&u.hasOwnProperty(b)&&m.call(f,u[b],b,u);else if(kt(u)||X(u)){var D=typeof u!="object";for(b=0,w=u.length;b<w;b++)(D||b in u)&&m.call(f,u[b],b,u)}else if(u.forEach&&u.forEach!==N)u.forEach(m,f,u);else if(Q(u))for(b in u)m.call(f,u[b],b,u);else if(typeof u.hasOwnProperty=="function")for(b in u)u.hasOwnProperty(b)&&m.call(f,u[b],b,u);else for(b in u)l.call(u,b)&&m.call(f,u[b],b,u);return u}function _(u,m,f){for(var b=Object.keys(u).sort(),w=0;w<b.length;w++)m.call(f,u[b[w]],b[w]);return b}function U(u){return function(m,f){u(f,m)}}function z(){return++P}function J(u,m){m?u.$$hashKey=m:delete u.$$hashKey}function tt(u,m,f){for(var b=u.$$hashKey,w=0,D=m.length;w<D;++w){var S=m[w];if(!(!ot(S)&&!wt(S)))for(var $=Object.keys(S),C=0,I=$.length;C<I;C++){var E=$[C],M=S[E];f&&ot(M)?It(M)?u[E]=new Date(M.valueOf()):se(M)?u[E]=new RegExp(M):M.nodeName?u[E]=M.cloneNode(!0):Pa(M)?u[E]=M.clone():E!=="__proto__"&&(ot(u[E])||(u[E]=kt(M)?[]:{}),tt(u[E],[M],!0)):u[E]=M}}return J(u,b),u}function at(u){return tt(u,y.call(arguments,1),!1)}function nt(u){return tt(u,y.call(arguments,1),!0)}function G(u){return parseInt(u,10)}var O=Number.isNaN||function(m){return m!==m};function F(u,m){return at(Object.create(u),m)}function j(){}j.$inject=[];function ht(u){return u}ht.$inject=[];function ft(u){return function(){return u}}function _t(u){return wt(u.toString)&&u.toString!==k}function W(u){return typeof u>"u"}function K(u){return typeof u<"u"}function ot(u){return u!==null&&typeof u=="object"}function Q(u){return u!==null&&typeof u=="object"&&!L(u)}function Z(u){return typeof u=="string"}function pt(u){return typeof u=="number"}function It(u){return k.call(u)==="[object Date]"}function kt(u){return Array.isArray(u)||u instanceof Array}function Dt(u){var m=k.call(u);switch(m){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return u instanceof Error}}function wt(u){return typeof u=="function"}function se(u){return k.call(u)==="[object RegExp]"}function Kt(u){return u&&u.window===u}function xe(u){return u&&u.$evalAsync&&u.$watch}function ma(u){return k.call(u)==="[object File]"}function va(u){return k.call(u)==="[object FormData]"}function Ia(u){return k.call(u)==="[object Blob]"}function _a(u){return typeof u=="boolean"}function xa(u){return u&&wt(u.then)}var un=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;function ss(u){return u&&pt(u.length)&&un.test(k.call(u))}function ee(u){return k.call(u)==="[object ArrayBuffer]"}var le=function(u){return Z(u)?u.trim():u},ze=function(u){return u.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};function Pa(u){return!!(u&&(u.nodeName||u.prop&&u.attr&&u.find))}function $t(u){var m={},f=u.split(","),b;for(b=0;b<f.length;b++)m[f[b]]=!0;return m}function ae(u){return c(u.nodeName||u[0]&&u[0].nodeName)}function Jt(u,m){return Array.prototype.indexOf.call(u,m)!==-1}function we(u,m){var f=u.indexOf(m);return f>=0&&u.splice(f,1),f}function ea(u,m,f){var b=[],w=[];if(f=a(f)?f:NaN,m){if(ss(m)||ee(m))throw R("cpta","Can't copy! TypedArray destination cannot be mutated.");if(u===m)throw R("cpi","Can't copy! Source and destination are identical.");return kt(m)?m.length=0:N(m,function(C,I){I!=="$$hashKey"&&delete m[I]}),b.push(u),w.push(m),D(u,m,f)}return S(u,f);function D(C,I,E){if(E--,E<0)return"...";var M=I.$$hashKey,H;if(kt(C))for(var q=0,et=C.length;q<et;q++)I.push(S(C[q],E));else if(Q(C))for(H in C)I[H]=S(C[H],E);else if(C&&typeof C.hasOwnProperty=="function")for(H in C)C.hasOwnProperty(H)&&(I[H]=S(C[H],E));else for(H in C)l.call(C,H)&&(I[H]=S(C[H],E));return J(I,M),I}function S(C,I){if(!ot(C))return C;var E=b.indexOf(C);if(E!==-1)return w[E];if(Kt(C)||xe(C))throw R("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");var M=!1,H=$(C);return H===void 0&&(H=kt(C)?[]:Object.create(L(C)),M=!0),b.push(C),w.push(H),M?D(C,H,I):H}function $(C){switch(k.call(C)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new C.constructor(S(C.buffer),C.byteOffset,C.length);case"[object ArrayBuffer]":if(!C.slice){var I=new ArrayBuffer(C.byteLength);return new Uint8Array(I).set(new Uint8Array(C)),I}return C.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new C.constructor(C.valueOf());case"[object RegExp]":var E=new RegExp(C.source,C.toString().match(/[^/]*$/)[0]);return E.lastIndex=C.lastIndex,E;case"[object Blob]":return new C.constructor([C],{type:C.type})}if(wt(C.cloneNode))return C.cloneNode(!0)}}function za(u,m){return u===m||u!==u&&m!==m}function Pe(u,m){if(u===m)return!0;if(u===null||m===null)return!1;if(u!==u&&m!==m)return!0;var f=typeof u,b=typeof m,w,D,S;if(f===b&&f==="object")if(kt(u)){if(!kt(m))return!1;if((w=u.length)===m.length){for(D=0;D<w;D++)if(!Pe(u[D],m[D]))return!1;return!0}}else{if(It(u))return It(m)?za(u.getTime(),m.getTime()):!1;if(se(u))return se(m)?u.toString()===m.toString():!1;if(xe(u)||xe(m)||Kt(u)||Kt(m)||kt(m)||It(m)||se(m))return!1;S=me();for(D in u)if(!(D.charAt(0)==="$"||wt(u[D]))){if(!Pe(u[D],m[D]))return!1;S[D]=!0}for(D in m)if(!(D in S)&&D.charAt(0)!=="$"&&K(m[D])&&!wt(m[D]))return!1;return!0}return!1}var aa=function(){if(!K(aa.rules)){var u=s.document.querySelector("[ng-csp]")||s.document.querySelector("[data-ng-csp]");if(u){var m=u.getAttribute("ng-csp")||u.getAttribute("data-ng-csp");aa.rules={noUnsafeEval:!m||m.indexOf("no-unsafe-eval")!==-1,noInlineStyle:!m||m.indexOf("no-inline-style")!==-1}}else aa.rules={noUnsafeEval:f(),noInlineStyle:!1}}return aa.rules;function f(){try{return new Function(""),!1}catch{return!0}}},Vt=function(){if(K(Vt.name_))return Vt.name_;var u,m,f=ai.length,b,w;for(m=0;m<f;++m)if(b=ai[m],u=s.document.querySelector("["+b.replace(":","\\:")+"jq]"),u){w=u.getAttribute(b+"jq");break}return Vt.name_=w};function wa(u,m,f){return u.concat(y.call(m,f))}function ka(u,m){return y.call(u,m||0)}function pe(u,m){var f=arguments.length>2?ka(arguments,2):[];return wt(m)&&!(m instanceof RegExp)?f.length?function(){return arguments.length?m.apply(u,wa(f,arguments,0)):m.apply(u,f)}:function(){return arguments.length?m.apply(u,arguments):m.call(u)}:m}function Fn(u,m){var f=m;return typeof u=="string"&&u.charAt(0)==="$"&&u.charAt(1)==="$"?f=void 0:Kt(m)?f="$WINDOW":m&&s.document===m?f="$DOCUMENT":xe(m)&&(f="$SCOPE"),f}function zn(u,m){if(!W(u))return pt(m)||(m=m?2:null),JSON.stringify(u,Fn,m)}function Oi(u){return Z(u)?JSON.parse(u):u}var Em=/:/g;function su(u,m){u=u.replace(Em,"");var f=Date.parse("Jan 01, 1970 00:00:00 "+u)/6e4;return O(f)?m:f}function iu(u,m){return u=new Date(u.getTime()),u.setMinutes(u.getMinutes()+m),u}function xr(u,m,f){f=f?-1:1;var b=u.getTimezoneOffset(),w=su(m,b);return iu(u,f*(w-b))}function vn(u){u=h(u).clone().empty();var m=h("<div></div>").append(u).html();try{return u[0].nodeType===Aa?c(m):m.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(f,b){return"<"+c(b)})}catch{return c(m)}}function ru(u){try{return decodeURIComponent(u)}catch{}}function Pl(u){var m={};return N((u||"").split("&"),function(f){var b,w,D;f&&(w=f=f.replace(/\+/g,"%20"),b=f.indexOf("="),b!==-1&&(w=f.substring(0,b),D=f.substring(b+1)),w=ru(w),K(w)&&(D=K(D)?ru(D):!0,l.call(m,w)?kt(m[w])?m[w].push(D):m[w]=[m[w],D]:m[w]=D))}),m}function lw(u){var m=[];return N(u,function(f,b){kt(f)?N(f,function(w){m.push(xn(b,!0)+(w===!0?"":"="+xn(w,!0)))}):m.push(xn(b,!0)+(f===!0?"":"="+xn(f,!0)))}),m.length?m.join("&"):""}function lu(u){return xn(u,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function xn(u,m){return encodeURIComponent(u).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,m?"%20":"+")}var ai=["ng-","data-ng-","ng:","x-ng-"];function ow(u,m){var f,b,w=ai.length;for(b=0;b<w;++b)if(f=ai[b]+m,Z(f=u.getAttribute(f)))return f;return null}function El(u){var m=u.currentScript;if(!m)return!0;if(!(m instanceof s.HTMLScriptElement||m instanceof s.SVGScriptElement))return!1;var f=m.attributes,b=[f.getNamedItem("src"),f.getNamedItem("href"),f.getNamedItem("xlink:href")];return b.every(function(w){if(!w)return!0;if(!w.value)return!1;var D=u.createElement("a");if(D.href=w.value,u.location.origin===D.origin)return!0;switch(D.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}})}var Rm=El(s.document);function Rl(u,m){var f,b,w={};if(N(ai,function(D){var S=D+"app";!f&&u.hasAttribute&&u.hasAttribute(S)&&(f=u,b=u.getAttribute(S))}),N(ai,function(D){var S=D+"app",$;!f&&($=u.querySelector("["+S.replace(":","\\:")+"]"))&&(f=$,b=$.getAttribute(S))}),f){if(!Rm){s.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match.");return}w.strictDi=ow(f,"strict-di")!==null,m(f,b?[b]:[],w)}}function ou(u,m,f){ot(f)||(f={});var b={strictDi:!1};f=at(b,f);var w=function(){if(u=h(u),u.injector()){var $=u[0]===s.document?"document":vn(u);throw R("btstrpd","App already bootstrapped with this element '{0}'",$.replace(/</,"&lt;").replace(/>/,"&gt;"))}m=m||[],m.unshift(["$provide",function(I){I.value("$rootElement",u)}]),f.debugInfoEnabled&&m.push(["$compileProvider",function(I){I.debugInfoEnabled(!0)}]),m.unshift("ng");var C=mu(m,f.strictDi);return C.invoke(["$rootScope","$rootElement","$compile","$injector",function(E,M,H,q){E.$apply(function(){M.data("$injector",q),H(M)(E)})}]),C},D=/^NG_ENABLE_DEBUG_INFO!/,S=/^NG_DEFER_BOOTSTRAP!/;if(s&&D.test(s.name)&&(f.debugInfoEnabled=!0,s.name=s.name.replace(D,"")),s&&!S.test(s.name))return w();s.name=s.name.replace(S,""),T.resumeBootstrap=function($){return N($,function(C){m.push(C)}),w()},wt(T.resumeDeferredBootstrap)&&T.resumeDeferredBootstrap()}function Nm(){s.name="NG_ENABLE_DEBUG_INFO!"+s.name,s.location.reload()}function cw(u){var m=T.element(u).injector();if(!m)throw R("test","no injector found for element argument to getTestability");return m.get("$$testability")}var cu=/[A-Z]/g;function Ym(u,m){return m=m||"_",u.replace(cu,function(f,b){return(b?m:"")+f.toLowerCase()})}var Nl=!1;function At(){var u;if(!Nl){var m=Vt();g=W(m)?s.jQuery:m?s[m]:void 0,g&&g.fn.on?(h=g,at(g.fn,{scope:Xl.scope,isolateScope:Xl.isolateScope,controller:Xl.controller,injector:Xl.injector,inheritedData:Xl.inheritedData})):h=Ta,u=h.cleanData,h.cleanData=function(f){for(var b,w=0,D;(D=f[w])!=null;w++)b=(h._data(D)||{}).events,b&&b.$destroy&&h(D).triggerHandler("$destroy");u(f)},T.element=h,Nl=!0}}function Yt(){Ta.legacyXHTMLReplacement=!0}function oe(u,m,f){if(!u)throw R("areq","Argument '{0}' is {1}",m||"?",f||"required");return u}function Bt(u,m,f){return f&&kt(u)&&(u=u[u.length-1]),oe(wt(u),m,"not a function, got "+(u&&typeof u=="object"?u.constructor.name||"Object":typeof u)),u}function he(u,m){if(u==="hasOwnProperty")throw R("badname","hasOwnProperty is not a valid {0} name",m)}function ce(u,m,f){if(!m)return u;for(var b=m.split("."),w,D=u,S=b.length,$=0;$<S;$++)w=b[$],u&&(u=(D=u)[w]);return!f&&wt(u)?pe(D,u):u}function ie(u){for(var m=u[0],f=u[u.length-1],b,w=1;m!==f&&(m=m.nextSibling);w++)(b||u[w]!==m)&&(b||(b=h(y.call(u,0,w))),b.push(m));return b||u}function me(){return Object.create(null)}function na(u){if(u==null)return"";switch(typeof u){case"string":break;case"number":u=""+u;break;default:_t(u)&&!kt(u)&&!It(u)?u=u.toString():u=zn(u)}return u}var Ee=1,wn=2,Aa=3,sn=8,gs=9,ni=11;function du(u){var m=n("$injector"),f=n("ng");function b(D,S,$){return D[S]||(D[S]=$())}var w=b(u,"angular",Object);return w.$$minErr=w.$$minErr||n,b(w,"module",function(){var D={};return function($,C,I){var E={},M=function(H,q){if(H==="hasOwnProperty")throw f("badname","hasOwnProperty is not a valid {0} name",q)};return M($,"module"),C&&D.hasOwnProperty($)&&(D[$]=null),b(D,$,function(){if(!C)throw m("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",$);var H=[],q=[],et=[],xt=Ct("$injector","invoke","push",q),Rt={_invokeQueue:H,_configBlocks:q,_runBlocks:et,info:function(bt){if(K(bt)){if(!ot(bt))throw f("aobj","Argument '{0}' must be an object","value");return E=bt,this}return E},requires:C,name:$,provider:vt("$provide","provider"),factory:vt("$provide","factory"),service:vt("$provide","service"),value:Ct("$provide","value"),constant:Ct("$provide","constant","unshift"),decorator:vt("$provide","decorator",q),animation:vt("$animateProvider","register"),filter:vt("$filterProvider","register"),controller:vt("$controllerProvider","register"),directive:vt("$compileProvider","directive"),component:vt("$compileProvider","component"),config:xt,run:function(bt){return et.push(bt),this}};return I&&xt(I),Rt;function Ct(bt,Tt,rt,ct){return ct||(ct=H),function(){return ct[rt||"push"]([bt,Tt,arguments]),Rt}}function vt(bt,Tt,rt){return rt||(rt=H),function(ct,V){return V&&wt(V)&&(V.$$moduleName=$),rt.push([bt,Tt,arguments]),Rt}}})}})}function Bn(u,m){if(kt(u)){m=m||[];for(var f=0,b=u.length;f<b;f++)m[f]=u[f]}else if(ot(u)){m=m||{};for(var w in u)w.charAt(0)==="$"&&w.charAt(1)==="$"||(m[w]=u[w])}return m||u}function uu(u,m){var f=[];return a(m)&&(u=T.copy(u,null,m)),JSON.stringify(u,function(b,w){if(w=Fn(b,w),ot(w)){if(f.indexOf(w)>=0)return"...";f.push(w)}return w})}function pu(u,m){return typeof u=="function"?u.toString().replace(/ \{[\s\S]*$/,""):W(u)?"undefined":typeof u!="string"?uu(u,m):u}var Xm={full:"1.8.3",major:1,minor:8,dot:3,codeName:"ultimate-farewell"};function Om(u){at(u,{errorHandlingConfig:e,bootstrap:ou,copy:ea,extend:at,merge:nt,equals:Pe,element:h,forEach:N,injector:mu,noop:j,bind:pe,toJson:zn,fromJson:Oi,identity:ht,isUndefined:W,isDefined:K,isString:Z,isFunction:wt,isObject:ot,isNumber:pt,isElement:Pa,isArray:kt,version:Xm,isDate:It,callbacks:{$$counter:0},getTestability:cw,reloadWithDebugInfo:Nm,UNSAFE_restoreLegacyJqLiteXHTMLReplacement:Yt,$$minErr:n,$$csp:aa,$$encodeUriSegment:lu,$$encodeUriQuery:xn,$$lowercase:c,$$stringify:na,$$uppercase:d}),x=du(s),x("ng",["ngLocale"],["$provide",function(f){f.provider({$$sanitizeUri:mB}),f.provider("$compile",sP).directive({a:qB,input:s0,textarea:s0,form:JB,script:qW,select:QW,option:ZW,ngBind:gW,ngBindHtml:fW,ngBindTemplate:yW,ngClass:vW,ngClassEven:wW,ngClassOdd:xW,ngCloak:AW,ngController:CW,ngForm:QB,ngHide:UW,ngIf:SW,ngInclude:kW,ngInit:LW,ngNonBindable:NW,ngPluralize:MW,ngRef:_W,ngRepeat:GW,ngShow:HW,ngStyle:FW,ngSwitch:zW,ngSwitchWhen:BW,ngSwitchDefault:WW,ngOptions:OW,ngTransclude:VW,ngModel:PW,ngList:DW,ngChange:bW,pattern:y0,ngPattern:y0,required:g0,ngRequired:g0,minlength:b0,ngMinlength:b0,maxlength:f0,ngMaxlength:f0,ngValue:mW,ngModelOptions:RW}).directive({ngInclude:TW,input:pW}).directive(ag).directive(i0),f.provider({$anchorScroll:rz,$animate:pz,$animateCss:gz,$$animateJs:dz,$$animateQueue:uz,$$AnimateRunner:mz,$$animateAsyncRun:hz,$browser:vz,$cacheFactory:xz,$controller:Sz,$document:kz,$$isDocumentHidden:Tz,$exceptionHandler:Lz,$filter:RP,$$forceReflow:Dz,$interpolate:Gz,$interval:Uz,$$intervalFactory:Fz,$http:Xz,$httpParamSerializer:Rz,$httpParamSerializerJQLike:Nz,$httpBackend:Mz,$xhrFactory:Oz,$jsonpCallbacks:zz,$location:tB,$log:eB,$parse:cB,$rootScope:hB,$q:dB,$$q:uB,$sce:bB,$sceDelegate:fB,$sniffer:vB,$$taskTrackerFactory:xB,$templateCache:wz,$templateRequest:CB,$$testability:$B,$timeout:kB,$window:EB,$$rAF:pB,$$jqLite:KF,$$Map:QF,$$cookieReader:RB})}]).info({angularVersion:"1.8.3"})}Ta.expando="ng339";var Yl=Ta.cache={},EF=1;Ta._data=function(u){return this.cache[u[this.expando]]||{}};function RF(){return++EF}var NF=/-([a-z])/g,YF=/^-ms-/,Mm={mouseleave:"mouseout",mouseenter:"mouseover"},dw=n("jqLite");function XF(u){return _m(u.replace(YF,"ms-"))}function _I(u,m){return m.toUpperCase()}function _m(u){return u.replace(NF,_I)}var OF=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,MF=/<|&#?\w+;/,_F=/<([\w:-]+)/,GF=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Ms={thead:["table"],col:["colgroup","table"],tr:["tbody","table"],td:["tr","tbody","table"]};Ms.tbody=Ms.tfoot=Ms.colgroup=Ms.caption=Ms.thead,Ms.th=Ms.td;var hu={option:[1,'<select multiple="multiple">',"</select>"],_default:[0,"",""]};for(var GI in Ms){var HI=Ms[GI],UI=HI.slice().reverse();hu[GI]=[UI.length,"<"+UI.join("><")+">","</"+HI.join("></")+">"]}hu.optgroup=hu.option;function uw(u){return!MF.test(u)}function pw(u){var m=u.nodeType;return m===Ee||!m||m===gs}function HF(u){for(var m in Yl[u.ng339])return!0;return!1}function FI(u,m){var f,b,w,D,S=m.createDocumentFragment(),$=[],C;if(uw(u))$.push(m.createTextNode(u));else{if(f=S.appendChild(m.createElement("div")),b=(_F.exec(u)||["",""])[1].toLowerCase(),D=Ta.legacyXHTMLReplacement?u.replace(GF,"<$1></$2>"):u,p<10)for(w=hu[b]||hu._default,f.innerHTML=w[1]+D+w[2],C=w[0];C--;)f=f.firstChild;else{for(w=Ms[b]||[],C=w.length;--C>-1;)f.appendChild(s.document.createElement(w[C])),f=f.firstChild;f.innerHTML=D}$=wa($,f.childNodes),f=S.firstChild,f.textContent=""}return S.textContent="",S.innerHTML="",N($,function(I){S.appendChild(I)}),S}function UF(u,m){m=m||s.document;var f;return(f=OF.exec(u))?[m.createElement(f[1])]:(f=FI(u,m))?f.childNodes:[]}function FF(u,m){var f=u.parentNode;f&&f.replaceChild(m,u),m.appendChild(u)}var zF=s.Node.prototype.contains||function(u){return!!(this.compareDocumentPosition(u)&16)};function Ta(u){if(u instanceof Ta)return u;var m;if(Z(u)&&(u=le(u),m=!0),!(this instanceof Ta)){if(m&&u.charAt(0)!=="<")throw dw("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Ta(u)}m?yw(this,UF(u)):wt(u)?qI(u):yw(this,u)}function hw(u){return u.cloneNode(!0)}function Gm(u,m){!m&&pw(u)&&h.cleanData([u]),u.querySelectorAll&&h.cleanData(u.querySelectorAll("*"))}function zI(u){var m;for(m in u)return!1;return!0}function BI(u){var m=u.ng339,f=m&&Yl[m],b=f&&f.events,w=f&&f.data;(!w||zI(w))&&(!b||zI(b))&&(delete Yl[m],u.ng339=void 0)}function WI(u,m,f,b){if(K(b))throw dw("offargs","jqLite#off() does not support the `selector` argument");var w=Hm(u),D=w&&w.events,S=w&&w.handle;if(S){if(m){var $=function(C){var I=D[C];K(f)&&we(I||[],f),K(f)&&I&&I.length>0||(u.removeEventListener(C,S),delete D[C])};N(m.split(" "),function(C){$(C),Mm[C]&&$(Mm[C])})}else for(m in D)m!=="$destroy"&&u.removeEventListener(m,S),delete D[m];BI(u)}}function mw(u,m){var f=u.ng339,b=f&&Yl[f];b&&(m?delete b.data[m]:b.data={},BI(u))}function Hm(u,m