1"use strict";(self.webpackChunkinfotorg=self.webpackChunkinfotorg||[]).push([[7252],{77252:(ne,N,a)=>{a.r(N),a.d(N,{PersonModule:()=>fi});var T,p=a(69808),u=a(93075),m=a(65620);!function(n){let i;var r;(r=i||(i={})).LOAD="[TranslatedCode] Load",r.SUCCESS="[TranslatedCode] Success",r.FAIL="[TranslatedCode] Fail",r.CLEAN="[TranslatedCode] Clean",n.load=(0,m.PH)(i.LOAD,(0,m.Ky)()),n.success=(0,m.PH)(i.SUCCESS,(0,m.Ky)()),n.fail=(0,m.PH)(i.FAIL,(0,m.Ky)()),n.clean=(0,m.PH)(i.CLEAN),(0,m.G0)({load:n.load,success:n.success,fail:n.fail,clean:n.clean})}(T||(T={}));var A=a(55122),e=a(65542);let S=(()=>{class n extends A.B{constructor(){super(...arguments),this.apiPath="/api/ontology/codes"}buildRequestUrl(t){return this.requestUrlFromId(t.group)}buildRequestOptions(t){return this.requestOptionsFromParams()}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var F=a(15148),O=a(26991);let re=(()=>{class n extends F.n{constructor(t,r){super(),this.actions$=t,this.dataService=r,this.storeActions=T,this.init()}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(O.eX),e.LFG(S))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var Q=a(35685);const E=(0,Q.H)({selectId:n=>n.group+(n.identifier||n.pristine)});var C=a(49818);const B=E.getInitialState({groups:{}}),v=(0,m.Lq)(B,(0,m.on)(T.load,(n,{payload:i})=>Object.assign(Object.assign({},n),{groups:Object.assign(Object.assign({},n.groups),{[i.group]:C.AP})})),(0,m.on)(T.success,(n,{payload:i,response:t})=>E.addMany(t.data.items.map(r=>Object.assign(Object.assign({},r),{actionState:C.m5,group:i.group})),Object.assign(Object.assign({},n),{groups:Object.assign(Object.assign({},n.groups),{[i.group]:C.m5})}))),(0,m.on)(T.fail,(n,{payload:i})=>Object.assign(Object.assign({},n),{groups:Object.assign(Object.assign({},n.groups),{[i.group]:C.Tu})})),(0,m.on)(T.clean,n=>E.removeAll(Object.assign(Object.assign({},n),{groups:{}}))));function L(n,i){return v(n,i)}let Y=(()=>{class n{constructor(t){this.store=t}load(t){this._dispatch(T.load({payload:t}))}clean(){this._dispatch(T.clean())}_dispatch(t){this.store.dispatch(t)}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(m.yh))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var f=a(54004),Se=a(34782);let Pe=(()=>{class n{constructor(t){this.store=t,this.feature=(0,m.ZF)("translatedCode"),this.adapterSelectors=E.getSelectors(),this.multiSelectors={selectAll:(0,m.P1)(this.feature,this.adapterSelectors.selectEntities),selectGroupsState:(0,m.P1)(this.feature,r=>r.groups)}}selectGroupsActionState(){return this.store.select(this.multiSelectors.selectGroupsState)}selectGroup(t){return this.store.select(this.multiSelectors.selectAll).pipe((0,f.U)(r=>Object.values(r).filter(o=>o.group===t)),(0,Se.d)(1))}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(m.yh))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),Zt=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[Y,Pe,S],imports:[m.Aw.forFeature("translatedCode",L),O.sQ.forFeature([re])]}),n})();var M=a(39300),y=a(95698),ie=a(18505),w=a(63900);let Ze=(()=>{class n{constructor(t,r){this.actionService=t,this.storeService=r}retrieve(t){return this.storeService.selectGroupsActionState().pipe((0,M.h)(r=>{var o;return!(null!==(o=r[t])&&void 0!==o&&o.isLoading)}),(0,y.q)(1),(0,ie.b)(r=>{var o,s;return null!==(s=null===(o=r[t])||void 0===o?void 0:o.isSuccess)&&void 0!==s?s:this.actionService.load({group:t})}),(0,w.w)(()=>this.storeService.selectGroup(t)),(0,Se.d)(1))}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(Y),e.LFG(Pe))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),Ft=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[Ze],imports:[Zt]}),n})();var Ot=a(90599),Nt=a(72071),Lt=a(72705),Mt=a(27166),It=a(52362),Rt=a(57503),wt=a(45005),Dt=a(53330),Jt=a(98810),Et=a(12956),Bt=a(11575),Yt=a(44466),g=a(74202),Ht=a(89998);let D=(()=>{class n extends Ht.t{constructor(){super(...arguments),this.rootPath=["/","persons"],this.reportBuilderPath=["/","builder"]}getSearchPath(){return this.rootPath}getReportPath(t,r){return[...this.rootPath,"report","person",r,t]}getResultsPath(t){return[...this.rootPath,"results",t]}navigateToReport(t,r){this.routeToLocation(this.getReportPath(t,r))}navigateToResults(t,r){this.routeToLocation(this.getResultsPath(t),r)}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var Fe=a(21641),j=a(90824),Qt=a(11982),c=a(90570),b=a(18995),Ut=a(60522),Gt=a(48829);let jt=(()=>{class n{constructor(t){this.routerStore=t}transform(t){const r=t||{};return this.routerStore.selectCurrentRouterPath().pipe((0,y.q)(1),(0,f.U)(o=>(0,Gt.hO)(o,r.replace)))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Ut.O,16))},n.\u0275pipe=e.Yjl({name:"urlPath",type:n,pure:!0}),n})(),se=(()=>{class n{transform(t,r,o){return null==t?void 0:t.replace(r,o)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=e.Yjl({name:"replace",type:n,pure:!0}),n})();const $t=function(n,i){return{id:n,page:i}},Vt=function(n){return{replace:n}};function Kt(n,i){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"bis-checkbox",16),e.NdJ("valueChange",function(){e.CHM(t),e.oxw();const o=e.MAs(2),s=e.oxw(2);return e.KtG(s.doUncheckGroup(o))}),e.TgZ(2,"a",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onClose())}),e.ALo(3,"async"),e.ALo(4,"urlPath"),e.ALo(5,"replace"),e._uU(6),e.qZA()(),e.BQk()}if(2&n){const t=i.$implicit,r=e.oxw(3);e.xp6(1),e.Q6J("formControlName",t.id),e.xp6(1),e.Q6J("routerLink",e.lcZ(3,3,e.lcZ(4,5,e.VKq(14,Vt,e.WLB(11,$t,e.Dn7(5,7,t.displayId,r.onlyLettersAndDigits,""),t.report.id))))),e.xp6(4),e.hij(" ",t.reportName," ")}}function kt(n,i){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"bis-checkbox",5,13),e.NdJ("valueChange",function(){const s=e.CHM(t).$implicit,l=e.MAs(2),d=e.oxw(2);return e.KtG(d.onSelectGroup(s,l))}),e.TgZ(3,"span",14),e._uU(4),e.qZA()(),e.TgZ(5,"div",15),e.YNc(6,Kt,7,16,"ng-container",9),e.qZA(),e.BQk()}if(2&n){const t=i.$implicit;e.xp6(4),e.AsE("",t[0].displayId," | ",t[0].displayName,""),e.xp6(2),e.Q6J("ngForOf",t)}}function qt(n,i){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"bis-dialog-section")(2,"div",4)(3,"bis-checkbox",5,6),e.NdJ("valueChange",function(){e.CHM(t);const o=e.MAs(4),s=e.oxw();
1return e.KtG(s.onSelectAll(o))}),e.TgZ(5,"span",7),e._uU(6),e.ALo(7,"translate"),e.qZA()(),e.TgZ(8,"form",8),e.YNc(9,kt,7,3,"ng-container",9),e.ALo(10,"async"),e.qZA()()(),e.TgZ(11,"bis-dialog-button-container",10)(12,"button",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onClean())}),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",12),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onCreatePdf())}),e._uU(16),e.ALo(17,"translate"),e.qZA()(),e.BQk()}if(2&n){const t=e.oxw();e.xp6(6),e.Oqu(e.lcZ(7,5,"app.component.visited-pages.select-all.label")),e.xp6(2),e.Q6J("formGroup",t.formGroup),e.xp6(1),e.Q6J("ngForOf",e.lcZ(10,7,t.groupedVisitedReports$)),e.xp6(4),e.hij(" ",e.lcZ(14,9,"app.component.visited-pages.clear.text")," "),e.xp6(3),e.hij(" ",e.lcZ(17,11,"app.component.visited-pages.create.text")," ")}}function zt(n,i){1&n&&(e.TgZ(0,"bis-inline-alert",19),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.component.visited-pages.clear.info")," "))}function Wt(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"bis-dialog-section",4),e.YNc(1,zt,3,3,"bis-inline-alert",18),e.TgZ(2,"div"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"bis-dialog-button-container")(6,"button",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onClose())}),e._uU(7),e.ALo(8,"translate"),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.hasCleaned),e.xp6(2),e.Oqu(e.lcZ(4,3,"app.component.visited-pages.empty.text")),e.xp6(4),e.hij(" ",e.lcZ(8,5,"app.component.visited-pages.close.text")," ")}}let Xt=(()=>{class n{constructor(t,r,o,s,l){this.dialogRef=t,this.visitedReportStore=r,this.visitedReportAction=o,this.router=s,this.formBuilder=l,this.hasCleaned=!1,this.onlyLettersAndDigits=/[^\w\d*]/g}ngOnInit(){this.initVisitedPages(),this.formGroup=this.formBuilder.group({});const t={};this.visitedReportStore.selectAll().pipe((0,y.q)(1)).subscribe(r=>{r.forEach(o=>{t[o.id]=[!1]}),this.formGroup=this.formBuilder.group(t)})}onCreatePdf(){const t=Object.entries(this.formGroup.getRawValue()).filter(([r,o])=>o).map(([r,o])=>r).join(",");this.router.navigate(["persons/visitedpages/person",t])}onSelectAll(t){Object.values(this.formGroup.controls).forEach(r=>r.setValue(t.checked))}onSelectGroup(t,r){t.forEach(o=>{this.formGroup.get(o.id).setValue(r.checked)})}doUncheckGroup(t){t.checked=!1}onClose(){this.dialogRef.close()}onClean(){this.hasCleaned=!0,this.visitedReportAction.clean()}initVisitedPages(){this.groupedVisitedReports$=this.visitedReportStore.selectAll().pipe((0,f.U)(t=>(0,Qt.vM)(t,"displayId")))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(c.zjC),e.Y36(j.g3),e.Y36(j.wm),e.Y36(g.F0),e.Y36(u.QS))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-visited-pages-modal"]],decls:9,vars:7,consts:[[1,"visited-pages-modal_header"],["icon","close",1,"close-modal",3,"click"],[4,"ngIf","ngIfElse"],["EMPTY",""],[1,"visited-pages-modal_content"],[3,"valueChange"],["ALL_CHECK",""],[1,"text-secondary"],[3,"formGroup"],[4,"ngFor","ngForOf"],[1,"button-container"],["bis-btn","","btn-type","primary",3,"click"],["autofocus","","bis-btn","","btn-type","secondary",3,"click"],["GROUP_CHECK",""],[1,"visited-pages-modal_group","text-secondary"],[1,"u-margin-left-default"],[3,"formControlName","valueChange"],[3,"routerLink","click"],["type","success","class","u-margin-bottom-default",4,"ngIf"],["type","success",1,"u-margin-bottom-default"]],template:function(t,r){if(1&t&&(e.TgZ(0,"bis-dialog-header",0)(1,"h3"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"bis-icon",1),e.NdJ("click",function(){return r.onClose()}),e.qZA()(),e.YNc(5,qt,18,13,"ng-container",2),e.ALo(6,"async"),e.YNc(7,Wt,9,7,"ng-template",null,3,e.W1O)),2&t){const o=e.MAs(8);let s;e.xp6(2),e.Oqu(e.lcZ(3,3,"app.component.visited-pages.modal.header")),e.xp6(3),e.Q6J("ngIf",null==(s=e.lcZ(6,5,r.groupedVisitedReports$))?null:s.length)("ngIfElse",o)}},dependencies:[p.sg,p.O5,u._Y,u.JJ,u.JL,u.sg,u.u,c.Hq3,c.bK4,c.oJW,c.A61,c.JQ_,c.U$3,g.yS,c.lIM,p.Ov,b.X$,jt,se],styles:["[_nghost-%COMP%]{display:block;min-width:450px}.visited-pages-modal[_ngcontent-%COMP%]{margin-bottom:0;width:400px;padding:1rem}.visited-pages-modal_content[_ngcontent-%COMP%]{max-height:500px;overflow-y:scroll}.visited-pages-modal_header[_ngcontent-%COMP%]{display:flex!important;justify-content:space-between}.close-modal[_ngcontent-%COMP%]{cursor:pointer}.button-container[_ngcontent-%COMP%]{border-top:1px #d1d3d7 solid;padding-top:1rem;display:flex!important;justify-content:space-between}"]}),n})();var en=a(60390);let ae=(()=>{class n{constructor(t,r,o,s){this.pdfService=t,this.dialogService=r,this.route=o,this.searchPath=s.getSearchPath()}ngOnInit(){this.routeSettings=this.route.data.pipe((0,y.q)(1),(0,f.U)(t=>(null==t?void 0:t.actionbar)||{}))}createPDF(){this.pdfService.savePdf()}openVisitedPages(){this.dialogService.open(Xt)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Fe.F),e.Y36(c.xAy),e.Y36(g.gz),e.Y36(D))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-actionbar"]],decls:21,vars:15,consts:[[3,"hideLatestPOIButton","
1newSearchLink"],[1,"u-margin-left-xsmall"],["bis-btn","","btn-type","secondary",1,"create-pdf"],["icon","angle-down","element-type","btn",1,"button-arrow"],["type","dropdown"],[3,"click"],["icon","download",1,"u-margin-right-xsmall"],["icon","edit",1,"u-margin-right-xsmall"]],template:function(t,r){1&t&&(e._UZ(0,"app-base-actionbar",0),e.ALo(1,"async"),e.ALo(2,"async"),e.TgZ(3,"bis-dropdown",1)(4,"button",2)(5,"span"),e._uU(6),e.ALo(7,"translate"),e.qZA(),e._UZ(8,"bis-icon",3),e.qZA(),e.TgZ(9,"bis-dropdown-body")(10,"bis-list",4)(11,"bis-list-item",5),e.NdJ("click",function(){return r.createPDF()}),e._UZ(12,"bis-icon",6),e.TgZ(13,"span"),e._uU(14),e.ALo(15,"translate"),e.qZA()(),e.TgZ(16,"bis-list-item",5),e.NdJ("click",function(){return r.openVisitedPages()}),e._UZ(17,"bis-icon",7),e.TgZ(18,"span"),e._uU(19),e.ALo(20,"translate"),e.qZA()()()()()),2&t&&(e.Q6J("hideLatestPOIButton",e.lcZ(1,5,r.routeSettings).hideLatestPOI)("newSearchLink",e.lcZ(2,7,r.routeSettings).hideNewSearch?null:r.searchPath),e.xp6(6),e.Oqu(e.lcZ(7,9,"Skapa PDF")),e.xp6(8),e.Oqu(e.lcZ(15,11,"Skapa PDF")),e.xp6(5),e.Oqu(e.l
1cZ(20,13,"Bes\xf6kta sidor")))},dependencies:[c.Hq3,c.oJW,c.JOL,c.oqg,c.nsn,c.GBp,en.n,p.Ov,b.X$],styles:[".button-arrow[_ngcontent-%COMP%]{border-left:1px solid #d1d3d7;margin-left:.5rem;padding-left:.5rem}"]}),n})();var Oe=a(69948),tn=a(35772),nn=a(77894),rn=a(25740),$=a(92272),on=a(43625),le=a(13709),Ne=a(61151),V=a(87285),sn=a(74030);let an=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-search-header"]],decls:2,vars:3,consts:[[3,"title"]],template:function(t,r){1&t&&(e._UZ(0,"app-page-title",0),e.ALo(1,"translate")),2&t&&e.s9C("title",e.lcZ(1,1,"person._self.name"))},dependencies:[le.T,b.X$],encapsulation:2}),n})();var ln=a(14376),Z=a(56650),Le=a(15346),U=a(77670),Me=a(71884),K=a(21948),cn=a(37646),G=a(62691);let Ie=(()=>{class n{constructor(t){this.element=t,this.focusOnInit=!0}ngAfterViewInit(){(!0===this.focusOnInit||""===this.focusOnInit)&&(this.timer=setTimeout(()=>this.element.nativeElement.focus(),0))}ngOnDestroy(){clearTimeout(this.timer)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq))},n.\u0275dir=e.lG2({type:n,selectors:[["","focusOnInit",""]],inputs:{focusOnInit:"focusOnInit"}}),n})();var ce=a(32343),k=a(12768),Re=a(11423),we=a(60398);function pn(n,i){1&n&&e.GkF(0)}function un(n,i){if(1&n&&(e.TgZ(0,"div",2),e.ALo(1,"translate"),e.TgZ(2,"bis-card-section"),e._UZ(3,"app-loading-progress",3),e.YNc(4,pn,1,0,"ng-container",4),e.TgZ(5,"bis-inline-alert",5),e._uU(6),e.ALo(7,"translateSplit"),e.ALo(8,"translate"),e.TgZ(9,"a",6),e._uU(10),e.ALo(11,"translateSplit"),e.ALo(12,"translate"),e.qZA(),e._uU(13),e.ALo(14,"translateSplit"),e.ALo(15,"translate"),e.qZA()()()),2&n){const t=e.oxw(),r=e.MAs(2);e.s9C("header",e.lcZ(1,7,"person.search-form.person.header")),e.xp6(3),e.Q6J("isLoading",!(null!=t.reportDropdown&&t.reportDropdown.length)),e.xp6(1),e.Q6J("ngTemplateOutlet",r),e.xp6(2),e.hij("",e.xi3(7,9,e.lcZ(8,12,"app.form.builder-promo.text"),0)," "),e.xp6(3),e.Q6J("routerLink",t.builderPath),e.xp6(1),e.Oqu(e.xi3(11,14,e.lcZ(12,17,"app.form.builder-promo.text"),1)),e.xp6(3),e.hij(" ",e.xi3(14,19,e.lcZ(15,22,"app.form.builder-promo.text"),2)," ")}}function dn(n,i){if(1&n&&(e.TgZ(0,"div",19),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.lcZ(2,1,"validation."+t.getError("pid"))," ")}}function mn(n,i){if(1&n&&(e.ynx(0),e.YNc(1,dn,3,3,"div",18),e.BQk()),2&n){const t=i.ngIf;e.xp6(1),e.Q6J("ngIf",t.touched&&t.dirty&&t.invalid)}}function hn(n,i){if(1&n&&(e.TgZ(0,"bis-radio",23)(1,"span",24),e._uU(2),e.qZA(),e._uU(3),e.ALo(4,"identityNr"),e.qZA()),2&n){const t=i.$implicit,r=e.oxw(3);e.MGl("id","century-",t,""),e.s9C("value",t),e.xp6(2),e.Oqu(t),e.xp6(1),e.hij("",e.lcZ(4,4,r.form.controls.pid.value)," ")}}const gn=function(){return["19","20"]};function _n(n,i){1&n&&(e.TgZ(0,"bis-form-group",20)(1,"label",21),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.YNc(4,hn,5,6,"bis-radio",22),e.qZA()),2&n&&(e.xp6(2),e.Oqu(e.lcZ(3,2,"app.form.input.pid-choice.label")),e.xp6(2),e.Q6J("ngForOf",e.DdM(4,gn)))}function fn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"form",7),e.NdJ("ngSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.submit())}),e.TgZ(1,"div",8)(2,"div")(3,"bis-form-group")(4,"label",9),e._uU(5),e.ALo(6,"translate"),e.qZA(),e.TgZ(7,"input",10),e.NdJ("focus",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsUntouched("pid"))})("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("pid",o))})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.checkCentury())})("keydown.enter",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.submit())}),e.ALo(8,"translate"),e.qZA(),e.YNc(9,mn,2,1,"ng-container",11),e.qZA(),e.YNc(10,_n,5,5,"bis-form-group",12),e.qZA(),e.TgZ(11,"bis-form-group")(12,"label",13),e._uU(13),e.ALo(14,"translate"),e.TgZ(15,"bis-tooltip",14),e.ALo(16,"translate"),e._UZ(17,"bis-icon",15),e.qZA()(),e._UZ(18,"app-dropdown-input",16),e.qZA(),e.TgZ(19,"button",17),e._uU(20),e.ALo(21,"translate"),e.qZA()()()}if(2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.Tol(t.showCentury?"u-display-flex":""),e.xp6(3),e.Oqu(e.l
1cZ(6,17,"app.form.input.pid.label")),e.xp6(2),e.ekj("form-control--error",t.hasErrorState("pid")),e.s9C("placeholder",e.lcZ(8,19,"app.form.input.pid.placeholder")),e.Q6J("focusOnInit",t.focusOnInit),e.xp6(2),e.Q6J("ngIf",t.form.controls.pid),e.xp6(1),e.Q6J("ngIf",t.showCentury),e.xp6(3),e.hij("",e.lcZ(14,21,"app.form.input.report.label")," "),e.xp6(2),e.s9C("tooltip-data",e.lcZ(16,23,"app.form.input.report.tooltip")),e.xp6(3),e.Q6J("formControl",t.form.controls.report)("values",t.reportDropdown),e.xp6(1),e.Q6J("disabled",t.isSubmitDisabled()),e.xp6(1),e.hij(" ",e.lcZ(21,25,"app.form.submit.text")," ")}}let De=(()=>{class n extends K.D{constructor(t,r,o,s){super(),this.personRoutingService=t,this.reportsListingService=r,this.formBuilder=o,this.route=s,this.wrapWithCard=!0,this.focusOnInit=!1,this.submitEvent=new e.vpe,this.inputControl={pid:{formatters:[Z.yf],returnFormatters:[Z.Mj]}},this.idValidatorForCenturyCheck=(0,Le.n)(10,12),this.subs=new U.M,this.builderPath=t.reportBuilderPath}ngOnInit(){this.initReportDropdownSub(),this.buildForm()}ngOnDestroy(){this.subs.unsub()}initReportDropdownSub(){this.subs.addSub(this.reportsListingService.getAsDropdown($.y.PERSON).pipe((0,M.h)(t=>!(null==t||!t.length)),(0,Me.x)((t,r)=>(null==t?void 0:t.length)===(null==r?void 0:r.length))).subscribe(t=>this.reportDropdown=this.addPresetReportsToTop(t)))}buildForm(){this.form=this.formBuilder.group({pid:["",[u.kI.required,(0,Le.n)(10)]],century:[],report:[]})}checkCentury(){const t=this.form.controls.pid,r=(t.value||"").replace("-",""),o=!this.idValidatorForCenturyCheck(t);this.showCentury=10===r.length&&o&&this.isShortPidValidForYear2000(r),this.showCentury||this.form.controls.century.setValue(void 0)}submit(){if(!this.isSubmitDisabled()){const{century:t="19",pid:r,report:o}=this.formattedFormData,s=10===r.length?t+r:r;this.personRoutingService.navigateToReport(o,s),this.submitEvent.next({pid:s,report:o})}}isSubmitDisabled(){var t;const r=null===(t=this.form.controls.pid.value)||void 0===t?void 0:t.replace("-",""),o=10===r.length&&this.isShortPidValidForYear2000(r);return super.isSubmitDisabled()||o&&!this.form.controls.century.value}isShortPidValidForYear2000(t){const r=["20"+t.substring(0,2),t.substring(2,4),t.substring(4,6)].join("-");return Date.now()>=+new Date(r)}addPresetReportsToTop(t){var r;const o=null===(r=this.route.snapshot.queryParams)||void 0===r?void 0:r._presetReport;return o?t.map(s=>s.map(l=>Object.assign(Object.assign({},l),{selected:l.value===o}))):t}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(D),e.Y36(ln.a),e.Y36(u.QS),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-identity-search-box"]],inputs:{wrapWithCard:"wrapWithCard",focusOnInit:"focusOnInit"},outputs:{submitEvent:"submitEvent"},features:[e.qOj],decls:3,vars:2,consts:[["bis-card","","app-card","",3,"header",4,"ngIf","ngIfElse"],["CONTENT",""],["bis-card","","app-card","",3,"header"],[3,"isLoading"],[4,"ngTemplateOutlet"],["type","info"],[3,"routerLink"],[3,"formGroup","ngSubmit"],[1,"form-builder-wrapper","flex-table_33"],["for","pid"],["bis-input","","id","pid","name","pid","type","text","formControlName","pid",3,"placeholder","focusOnInit","focus","input","ngModelChange","keydown.enter"],[4,"ngIf"],["bis-radio-group","","formControlName","century","class","century-choice",4,"ngIf"],["for","report",1,"tooltip-label"],["type","line-break","direction","top",1,"tooltip-inline-offset",3,"tooltip-data"],["icon","info"],["name","report",1,"dropdown_report",3,"formControl","values"],["bis-btn","","type","submit",1,"submit-btn",3,"disabled"],["class","form-input-error-message text-secondary",4,"ngIf"],[1,"form-input-error-message","text-secondary"],["bis-radio-group","","formControlName","century",1,"century-choice"],["for","century"],["name","century",3,"id","value",4,"ngFor","ngForOf"],["name","century",3,"id","value"],[1,"text-bold"]],template:function(t,r){if(1&t&&(e.YNc(0,un,16,24,"div",0),e.YNc(1,fn,22,27,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",r.wrapWithCard)("ngIfElse",o)}},dependencies:[p.sg,p.O5,p.tP,u._Y,u.Fj,u.JJ,u.JL,u.oH,u.sg,u.u,c.H41,c.AD5,c.Vdl,c.HK$,c.w0r,c.UKb,c.Hq3,c.oJW,c.KZt,c.lIM,cn.J,G.l,Ie,ce.A,k.E,g.yS,b.X$,Re.v,we.$],styles:["person-identity-search-box .search-box{display:block;margin-bottom:.5rem}person-identity-search-box bis-form-group{margin-bottom:1rem;margin-top:0!important;position:relative}person-identity-search-box .form-input-error-message{position:absolute;bottom:-1.2rem;width:200%}person-identity-search-box .submit-btn{max-width:70px;align-self:start;margin-top:1.75rem;margin-bottom:1rem}person-identity-search-box .century-choice{margin-left:1rem;min-width:170px}person-identity-search-box .tooltip-label{position:relative}person-identity-search-box .tooltip-label>.tooltip-inline-offset{position:absolute;margin-left:3px}\n"],encapsulation:2}),n})();var J=a(13664),I=(()=>{return(n=I||(I={})).SPAR="SOURCE_PERSON_SPAR",n.NAVET="SOURCE_PERSON_NAVET",n.GOV_BASIC="BUNDLE_PERSON_GOVERNMENT_BASIC",n.GOV_PREMIUM="BUNDLE_PERSON_GOVERNMENT_PREMIUM",I;var n})();function pe(n=1,i=80){return t=>{const r=(t.value||"").trim();
1if(r){if(!/^[\u00C0-\u017F\w]+[\u00C0-\u017F\w\s*\-']*$/.test(r))return{invalidIndividualName:!0};if(r.replace(/[*]/g,"").length<n)return{minlength:!0};if(r.length>i)return{maxlength:!0}}return null}}var q=a(61135),vn=a(56451),Je=a(43212),P=a(46532);let Ee=(()=>{class n extends K.D{constructor(){super(...arguments),this.useBirthInterval=!1,this.subHelper=new U.M}ngOnInit(){this.initDefaultFormValues(),this.initUseBirthInterval(),this.buildForm()}ngOnDestroy(){this.subHelper.unsub()}initDefaultFormValues(){this.defaultFormValues$=this.activatedRoute.queryParamMap}formatDatesForForm(t){const r=Object.assign({},t);return this.useBirthInterval?delete r.birthDate:(delete r.birthFrom,delete r.birthTo),r.birthFrom&&!r.birthTo&&(r.birthTo=(0,Z.p6)((0,P.UW)(new Date))),r.birthDate&&(r.birthDate=(0,P.zK)(r.birthDate,"start")),r.birthFrom&&(r.birthFrom=(0,P.zK)(r.birthFrom,"start")),r.birthTo&&(r.birthTo=(0,P.zK)(r.birthTo,"end")),r}initUseBirthInterval(){this.defaultFormValues$.pipe((0,y.q)(1)).subscribe(t=>{this.useBirthInterval=!(!t.get("birthFrom")&&!t.get("birthTo"))}).unsubscribe()}buildForm(){this.defaultFormValues$.pipe((0,y.q)(1)).subscribe(t=>{this.form=this.formBuilder.group(this.buildGroupDefinitionWithParams(t,{nameMinLength:1,wildcardMinLength:0})),this.updateFormOnRoute()}).unsubscribe()}updateFormOnRoute(){this.subHelper.addSub(this.defaultFormValues$.subscribe(t=>{var r;return null===(r=this.form)||void 0===r?void 0:r.setValue(this.paramsToFormValues(t))}))}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275dir=e.lG2({type:n,features:[e.qOj]}),n})();function Be(n,i=!1){return t=>{const r=(t.value||"").trim().replace(/[\d-]/g,"");return(i?r.split(" "):[r]).map(l=>{if(l.includes("*")&&l.split("*")[0].length<n)return{invalidWildcard:!0}}).filter(l=>l)[0]||null}}function Ye(n){return"string"==typeof n&&(P.Om.test(n)||P.LV.test(n)||P.oe.test(n))}function He(n="start"){return i=>{const t=i.value;if(!t)return null;if(!P.Om.test(t)&&!P.LV.test(t)&&!P.oe.test(t))return{invalidDate:!0};const r=(0,P.zK)(t,n);if(!(0,P.ix)(r))return{invalidDate:!0};const[o]=r.split("-").map(Number);if(o<1878)return{dateOutOfRange:!0};const s=new Date;s.setHours(0,0,0,0);const l=new Date(r);return l.setHours(0,0,0,0),l>s?{dateOutOfRange:!0}:null}}function Cn(n,i){1&n&&e.GkF(0)}function yn(n,i){1&n&&e.GkF(0)}function Tn(n,i){1&n&&e.GkF(0)}function An(n,i){if(1&n&&(e.ynx(0),e.YNc(1,Tn,1,0,"ng-container",3),e.BQk()),2&n){e.oxw();const t=e.MAs(26);e.xp6(1),e.Q6J("ngTemplateOutlet",t)}}function Sn(n,i){1&n&&e.GkF(0)}function Pn(n,i){1&n&&e.GkF(0)}function Zn(n,i){1&n&&e.GkF(0)}function Fn(n,i){if(1&n&&(e.TgZ(0,"div",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.hij(" ",e.lcZ(2,1,"validation."+t)," ")}}const z=function(n){return{"form-control--error":n}};
1function On(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",16)(1,"label",17),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"input",18),e.NdJ("focus",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsUntouched("givenName"))}),e.ALo(5,"translate"),e.qZA(),e.YNc(6,Fn,3,3,"div",19),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.hij(" ",e.lcZ(3,5,"person.search-form.first-name.label")," "),e.xp6(2),e.s9C("placeholder",e.lcZ(5,7,"person.search-form.first-name.placeholder")),e.Q6J("ngClass",e.VKq(9,z,t.hasErrorState("givenName"))),e.xp6(2),e.Q6J("ngIf",t.getError("givenName"))}}function Nn(n,i){if(1&n&&(e.TgZ(0,"div",21)(1,"bis-checkbox",22),e._uU(2),e.ALo(3,"translate"),e.qZA()()),2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.hij(" ",e.lcZ(3,2,"person.search-form.non-phonetic.label")," ")}}function Ln(n,i){if(1&n&&(e.TgZ(0,"div",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.hij(" ",e.lcZ(2,1,"validation."+t)," ")}}function Mn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",16)(1,"label",23),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"input",24),e.NdJ("focus",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsUntouched("familyName"))}),e.ALo(5,"translate"),e.qZA(),e.YNc(6,Ln,3,3,"div",19),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.hij(" ",e.lcZ(3,5,"person.search-form.last-name.label")," "),e.xp6(2),e.s9C("placeholder",e.lcZ(5,7,"person.search-form.last-name.placeholder")),e.Q6J("ngClass",e.VKq(9,z,t.hasErrorState("familyName"))),e.xp6(2),e.Q6J("ngIf",t.getError("familyName"))}}function In(n,i){if(1&n&&(e.TgZ(0,"div",36),e._uU(1),e.ALo(2,"translate"),e.ALo(3,"translate"),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.AsE(" ",e.lcZ(2,2,"person.search-form.birth-date-from.label"),": ",e.lcZ(3,4,"validation."+t)," ")}}function Rn(n,i){if(1&n&&(e.TgZ(0,"div",36),e._uU(1),e.ALo(2,"translate"),e.ALo(3,"translate"),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.AsE(" ",e.lcZ(2,2,"person.search-form.birth-date-to.label"),": ",e.lcZ(3,4,"validation."+t)," ")}}function wn(n,i){1&n&&(e.TgZ(0,"div",36),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"validation.birthToBeforeBirthFrom")," "))}function Dn(n,i){if(1&n&&(e.TgZ(0,"div",34),e.YNc(1,In,4,6,"div",35),e.YNc(2,Rn,4,6,"div",35),e.YNc(3,wn,3,3,"div",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.getError("birthFrom")),e.xp6(1),e.Q6J("ngIf",t.getError("birthTo")),e.xp6(1),e.Q6J("ngIf",null==t.form||null==t.form.errors?null:t.form.errors.birthToBeforeBirthFrom)}}const ue=function(n){return{hidden:n}};function Jn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div",25)(5,"bis-checkbox",26),e.NdJ("valueChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.toggleBirthInterval())}),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"div",27)(9,"input",28),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("birthDate",o))}),e.ALo(10,"translate"),e.qZA()(),e.TgZ(11,"div",29)(12,"input",30),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("birthFrom",o))})("blur",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsTouched("birthFrom"))}),e.ALo(13,"translate"),e.qZA()(),e.TgZ(14,"div",31)(15,"input",32),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("birthTo",o))})("blur",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsTouched("birthTo"))}),e.ALo(16,"translate"),e.qZA()()(),e.YNc(17,Dn,4,3,"div",33),e._UZ(18,"div",6),e.qZA()}if(2&n){const t=e.oxw();e.xp6(2),e.Oqu(e.lcZ(3,12,"person.search-form.birth-date.label")),e.xp6(2),e.Q6J("formGroup",t.form),e.xp6(2),e.hij(" ",e.lcZ(7,14,"person.search-form.birth-interval.label")," "),e.xp6(2),e.Q6J("ngClass",e.VKq(22,ue,t.useBirthInterval)),e.xp6(1),e.s9C("placeholder",e.lcZ(10,16,"person.search-form.birth-date.placeholder")),e.xp6(2),e.Q6J("ngClass",e.VKq(24,ue,!t.useBirthInterval)),e.xp6(1),e.s9C("placeholder",e.lcZ(13,18,"person.search-form.birth-date-from.placeholder")),e.Q6J("ngClass",e.VKq(26,z,t.hasErrorState("birthFrom"))),e.xp6(2),e.Q6J("ngClass",e.VKq(28,ue,!t.useBirthInterval)),e.xp6(1),e.s9C("placeholder",e.lcZ(16,20,"person.search-form.birth-date-to.placeholder")),e.Q6J("ngClass",e.VKq(30,z,t.hasErrorState("birthTo"))),e.xp6(2),e.Q6J("ngIf",t.useBirthInterval)}}
1function En(n,i){if(1&n&&(e.TgZ(0,"div",37)(1,"label",38),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"input",39),e.ALo(5,"translate"),e.qZA()),2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.Oqu(e.lcZ(3,3,"person.search-form.address.label")),e.xp6(2),e.s9C("placeholder",e.lcZ(5,5,"person.search-form.address.placeholder"))}}function Bn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",40)(1,"div")(2,"label",41),e._uU(3),e.ALo(4,"translate"),e.TgZ(5,"bis-tooltip",42),e.ALo(6,"translate"),e._UZ(7,"bis-icon",43),e.qZA()(),e.TgZ(8,"input",44),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("postCode",o))}),e.ALo(9,"translate"),e.qZA()(),e.TgZ(10,"div")(11,"label",45),e._uU(12),e.ALo(13,"translate"),e.qZA(),e._UZ(14,"input",46),e.ALo(15,"translate"),e.qZA()()}if(2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(3),e.hij(" ",e.lcZ(4,6,"person.search-form.post-code.label")," "),e.xp6(2),e.s9C("tooltip-data",e.lcZ(6,8,"person.search-form.post-code.tooltip")),e.xp6(3),e.s9C("placeholder",e.lcZ(9,10,"person.search-form.post-code.placeholder")),e.xp6(4),e.Oqu(e.lcZ(13,12,"person.search-form.postal-city.label")),e.xp6(2),e.s9C("placeholder",e.lcZ(15,14,"person.search-form.postal-city.placeholder"))}}const Yn=["*"];let Qe=(()=>{class n extends Ee{constructor(t,r,o){super(),this.formBuilder=t,this.activatedRoute=r,this.accessRightService=o,this.isExtendedSearch=!1,this.isFormClear$=new q.X(!0),this.isSubmitDisabled$=new q.X(!0),this.inputControl={birthDate:{formatters:[Z.p6]},birthFrom:{formatters:[Z.p6]},birthTo:{formatters:[Z.p6]},postCode:{formatters:[Z.Mj]},namePhonetic:{returnFormatters:[s=>!this.isGov&&!s||null]}}}toggleBirthInterval(){var t,r,o;this.useBirthInterval=!this.useBirthInterval,null===(t=this.form.get("birthDate"))||void 0===t||t.setValue(null),null===(r=this.form.get("birthFrom"))||void 0===r||r.setValue(null),null===(o=this.form.get("birthTo"))||void 0===o||o.setValue(null)}ngOnInit(){this.initIsGov(),super.ngOnInit()}submit(){if(this.isSubmitDisabled())return;const t=this.formatDatesForForm(this.formattedFormData);this.isExtendedSearch&&(t.isExtended=!0),this.submitEvent.emit(t)}clearForm(){this.form.reset()}isSubmitDisabled(){return super.isSubmitDisabled()||this.isFormClear()}buildForm(){this.defaultFormValues$.pipe((0,w.w)(t=>this.getValidatorSettings().pipe((0,f.U)(r=>[t,r]))),(0,y.q)(1)).subscribe(t=>{this.form=this.formBuilder.group(this.buildGroupDefinitionWithParams(...t),{validators:n=>{var i,t;const r=null===(i=n.get("birthFrom"))||void 0===i?void 0:i.value,o=null===(t=n.get("birthTo"))||void 0===t?void 0:t.value;if(!Ye(r)||!Ye(o))return null;const s=(0,P.zK)(r,"start");return(0,P.zK)(o,"end")<s?{birthToBeforeBirthFrom:!0}:null}}),this.isFormClear$.next(this.isFormClear()),this.isSubmitDisabled$.next(this.isSubmitDisabled()),this.subHelper.addSub(this.form.valueChanges.subscribe(()=>{this.isFormClear$.next(this.isFormClear())})),this.subHelper.addSub((0,vn.T)(this.form.valueChanges,this.form.statusChanges).subscribe(()=>{this.isSubmitDisabled$.next(this.isSubmitDisabled())})),this.updateFormOnRoute()}).unsubscribe()}buildGroupDefinitionWithParams(t,r){const o=this.paramsToFormValues(t),s=[Be(r.wildcardMinLength),pe(r.nameMinLength)];return{givenName:[o.givenName,s],familyName:[o.familyName,s],birthDate:[o.birthDate],birthFrom:[o.birthFrom,He()],birthTo:[o.birthTo,He()],address:[o.address],postalCity:[o.postalCity],postCode:[o.postCode],namePhonetic:[o.phonetic]}}paramsToFormValues(t){const r=this.getReversedPhoneticFromParams(t);return{givenName:t.get("givenName"),familyName:t.get("familyName"),birthDate:t.get("birthDate"),birthFrom:t.get("birthFrom"),birthTo:t.get("birthTo"),address:t.get("address"),postalCity:t.get("postalCity"),postCode:t.get("postCode"),namePhonetic:r}}getReversedPhoneticFromParams(t){return t.has("namePhonetic")?"true"!==t.get("namePhonetic"):t.has("_searchTab")}getValidatorSettings(){return this.accessRightService.has(I.SPAR).pipe((0,y.q)(1),(0,f.U)(t=>({nameMinLength:t?2:1,wildcardMinLength:t?2:0})))}initIsGov(){this.accessRightService.has(I.GOV_BASIC).pipe((0,y.q)(1)).subscribe(t=>this.isGov=t).unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(u.QS),e.Y36(g.gz),e.Y36(Je.
1L))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-advanced-search"]],inputs:{isExtendedSearch:"isExtendedSearch"},features:[e.qOj],ngContentSelectors:Yn,decls:35,vars:18,consts:[[3,"ngSubmit"],[1,"u-display-flex","u-flex-column"],[1,"u-display-flex","form-group_person","flex-table_33"],[4,"ngTemplateOutlet"],[4,"ngIf"],[1,"u-display-flex","form-group_person","u-margin-top-default"],[1,"spacer","u-margin-y-default"],[1,"submit-container"],["bis-btn","","type","button",3,"disabled","click"],["bis-btn","","type","submit",3,"disabled"],["GIVEN_NAME",""],["PHONETIC",""],["FAMILY_NAME",""],["AGE",""],["ADDRESS",""],["CITY_ZIP",""],[1,"form-input_name",3,"formGroup"],["for","givenName"],["bis-input","","type","text","id","givenName","name","givenName","formControlName","givenName","maxlength","80",3,"ngClass","placeholder","focus"],["class","form-input-error-message",4,"ngIf"],[1,"form-input-error-message"],[1,"u-margin-top-small","form-input_phonetic","align-self-end",3,"formGroup"],["name","namePhonetic","formControlName","namePhonetic",1,"u-margin-none"],["for","familyName"],["bis-input","","type","text","id","familyName","name","familyName","formControlName","familyName","maxlength","80",3,"ngClass","placeholder","focus"],[1,"birth-inputs","u-justify-content-between",3,"formGroup"],[1,"u-margin-none",3,"valueChange"],[1,"form-input_birth",3,"ngClass"],["bis-input","","type","text","id","birthDate","name","birthDate","formControlName","birthDate",3,"placeholder","input"],[1,"form-input_birth-from",3,"ngClass"],["bis-input","","type","text","id","birthFrom","name","birthFrom","formControlName","birthFrom",3,"ngClass","placeholder","input","blur"],[1,"form-input_birth-to",3,"ngClass"],["bis-input","","type","text","id","birthTo","name","birthTo","formControlName","birthTo",3,"ngClass","placeholder","input","blur"],["class","birth-error-messages",4,"ngIf"],[1,"birth-error-messages"],["class","form-input-error-message text-secondary",4,"ngIf"],[1,"form-input-error-message","text-secondary"],[1,"form-input_address",3,"formGroup"],["for","address"],["bis-input","","type","text","id","address","name","address","formControlName","address",3,"placeholder"],[1,"linked-inputs","u-justify-content-between","form-input__city-zip",3,"formGroup"],["for","postCode",1,"label-with-tooltip"],["type","line-break","direction","top",1,"label-tooltip",3,"tooltip-data"],["icon","help"],["bis-input","","type","text","id","postCode","name","postCode","formControlName","postCode",3,"placeholder","input"],["for","postalCity"],["bis-input","","type","text","id","postalCity","name","postalCity","formControlName","postalCity",3,"placeholder"]],template:function(t,r){if(1&t&&(e.F$t(),e.TgZ(0,"form",0),e.NdJ("ngSubmit",function(){return r.submit()}),e.TgZ(1,"div",1)(2,"div",2),e.YNc(3,Cn,1,0,"ng-container",3),e.YNc(4,yn,1,0,"ng-container",3),e.YNc(5,An,2,1,"ng-container",4),e.qZA(),e.TgZ(6,"div",5),e.YNc(7,Sn,1,0,"ng-container",3),e.qZA(),e.TgZ(8,"div",2),e.YNc(9,Pn,1,0,"ng-container",3),e.YNc(10,Zn,1,0,"ng-container",3),e.qZA()(),e._UZ(11,"div",6),e.TgZ(12,"div",7)(13,"div")(14,"button",8),e.NdJ("click",function(){return r.clearForm()}),e.ALo(15,"async"),e._uU(16),e.ALo(17,"translate"),e.qZA(),e.TgZ(18,"button",9),e.ALo(19,"async"),e._uU(20),e.ALo(21,"translate"),e.qZA()(),e.Hsn(22),e.qZA()(),e.YNc(23,On,7,11,"ng-template",null,10,e.W1O),e.YNc(25,Nn,4,4,"ng-template",null,11,e.W1O),e.YNc(27,Mn,7,11,"ng-template",null,12,e.W1O),e.YNc(29,Jn,19,32,"ng-template",null,13,e.W1O),e.YNc(31,En,6,7,"ng-template",null,14,e.W1O),e.YNc(33,Bn,16,16,"ng-template",null,15,e.W1O)),2&t){const o=e.MAs(24),s=e.MAs(28),l=e.MAs(30),d=e.MAs(32),x=e.MAs(34);e.xp6(3),e.Q6J("ngTemplateOutlet",o),e.xp6(1),e.Q6J("ngTemplateOutlet",s),e.xp6(1),e.Q6J("ngIf",!r.isGov),e.xp6(2),e.Q6J("ngTemplateOutlet",l),e.xp6(2),e.Q6J("ngTemplateOutlet",d),e.xp6(1),e.Q6J("ngTemplateOutlet",x),e.xp6(4),e.Q6J("disabled",e.lcZ(15,10,r.isFormClear$)),e.xp6(2),e.hij(" ",e.lcZ(17,12,"app.button.clear.text")," "),e.xp6(2),e.Q6J("disabled",e.lcZ(19,14,r.isSubmitDisabled$)),e.xp6(2),e.hij(" ",e.lcZ(21,16,"app.button.search.text")," ")}},dependencies:[p.mk,p.O5,p.tP,u._Y,u.Fj,u.JJ,u.JL,u.nD,u.F,u.sg,u.u,c.Vdl,c.bK4,c.Hq3,c.oJW,c.KZt,G.l,p.Ov,b.X$],styles:[".form-group_person[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-right:1rem}.linked-inputs[_ngcontent-%COMP%]{display:flex}.linked-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{margin-right:.5rem}.submit-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;flex-direction:row-reverse;align-items:center;flex-wrap:wrap;gap:1rem}.submit-container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}@media (max-width: 990px){.submit-container[_ngcontent-%COMP%]{flex-direction:column}.submit-container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{order:1;align-self:flex-end}}.birth-inputs[_ngcontent-%COMP%]{display:flex;align-items:center}.birth-inputs[_ngcontent-%COMP%] > bis-checkbox[_ngcontent-%COMP%]{margin-right:1rem!important}.birth-inputs[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{align-self:flex-start;max-width:160px}.birth-inputs[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:not(:last-child){margin-right:1rem!important}.birth-error-messages[_ngcontent-%COMP%]{margin-top:.25rem;line-height:1.2}.label-with-tooltip[_ngcontent-%COMP%]{position:relative}.label-tooltip[_ngcontent-%COMP%]{position:absolute;bottom:-2px;margin-left:.25rem}"],changeDetection:0}),n})();function Hn(n,i){1&n&&e.GkF(0)}function Qn(n,i){1&n&&e.GkF(0)}
1function Un(n,i){if(1&n&&(e.TgZ(0,"div",10),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.hij(" ",e.lcZ(2,1,"validation."+t)," ")}}const Gn=function(n){return{"form-control--error":n}};function jn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",6)(1,"label",7),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"input",8),e.NdJ("focus",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsUntouched("name"))}),e.ALo(5,"translate"),e.qZA(),e.YNc(6,Un,3,3,"div",9),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.hij(" ",e.lcZ(3,5,"person.search-form.name.label")," "),e.xp6(2),e.s9C("placeholder",e.lcZ(5,7,"person.search-form.name.placeholder")),e.Q6J("ngClass",e.VKq(9,Gn,t.hasErrorState("name"))),e.xp6(2),e.Q6J("ngIf",t.getError("name"))}}function $n(n,i){if(1&n&&(e.TgZ(0,"div",11)(1,"label",12),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"input",13),e.ALo(5,"translate"),e.qZA()),2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.Oqu(e.lcZ(3,3,"person.search-form.address.label")),e.xp6(2),e.s9C("placeholder",e.lcZ(5,5,"person.search-form.address.placeholder2"))}}const Vn=["*"];let Ue=(()=>{class n extends K.D{constructor(t,r,o){super(),this.formBuilder=t,this.route=r,this.accessRightService=o,this.subHelper=new U.M,this.inputControl={}}submit(t){const r=this.separateNameAndDate(this.formattedFormData.name),o=this.separateAddressFields(this.formattedFormData.address);this.submitEvent.emit({fullName:r[0],birthDate:r[1],addressAndCity:o[0],postCode:o[1],namePhonetic:!0})}ngOnInit(){this.initDefaultFormValues(),this.buildForm()}ngOnDestroy(){this.subHelper.unsub()}initDefaultFormValues(){this.defaultFormValues$=this.route.queryParamMap}buildForm(){this.defaultFormValues$.pipe((0,w.w)(t=>this.getValidatorSettings().pipe((0,f.U)(r=>[t,r]))),(0,y.q)(1)).subscribe(t=>{this.form=this.formBuilder.group(this.buildGroupDefinitionWithParams(...t)),this.updateFormOnRoute()}).unsubscribe()}updateFormOnRoute(){this.subHelper.addSub(this.defaultFormValues$.subscribe(t=>{var r;return null===(r=this.form)||void 0===r?void 0:r.setValue(this.paramsToFormValues(t))}))}getValidatorSettings(){return this.accessRightService.has(I.SPAR).pipe((0,y.q)(1),(0,f.U)(t=>({nameMinLength:t?2:1,wildcardMinLength:t?2:0})))}buildGroupDefinitionWithParams(t,r){const o=this.paramsToFormValues(t);return{name:[o.name,[Be(r.wildcardMinLength,!0),pe(r.nameMinLength)]],address:[o.address]}}paramsToFormValues(t){var r;const o=null!==(r=t.get("fullName"))&&void 0!==r?r:this.cleanAndJoin([t.get("givenName"),t.get("familyName")]);return{name:this.cleanAndJoin([o,t.get("birthDate")]),address:this.cleanAndJoin([t.get("address"),t.get("addressAndCity"),t.get("postCode")])}}separateNameAndDate(t){var r;const o=/\d{4}-\d{2}-\d{2}|\d{4}-\d{2}|\d{4,8}/g,s=(null===(r=null==t?void 0:t.replace(/-/g,"").match(o))||void 0===r?void 0:r[0])||"",l=[s.substring(0,4),s.substring(4,6),s.substring(6,8)].filter(x=>x).join("-"),d=null==t?void 0:t.replace(o,"");return this.filterAndTrim([d,l])}separateAddressFields(t){var r;const o=/\d{5}|\d{3}\s\d{2}/g,s=((null===(r=t.match(o))||void 0===r?void 0:r[0])||"").replace(" ","");return[t.replace(o,"").trim(),s]}cleanAndJoin(t){return this.filterAndTrim(t).join(" ")}filterAndTrim(t){return t.filter(r=>r).map(r=>r.trim())}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(u.QS),e.Y36(g.gz),e.Y36(Je.L))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-simple-search"]],features:[e.qOj],ngContentSelectors:Vn,decls:12,vars:6,consts:[[3,"ngSubmit"],[1,"u-display-flex","form-group_person","flex-table_33"],[4,"ngTemplateOutlet"],["bis-btn","","type","submit",1,"submit-btn",3,"disabled"],["NAME",""],["ADDRESS",""],[1,"form-input_name",3,"formGroup"],["for","name"],["bis-input","","type","text","id","name","name","name","formControlName","name","maxlength","80",3,"ngClass","placeholder","focus"],["class","form-input-error-message",4,"ngIf"],[1,"form-input-error-message"],[1,"form-input_address",3,"formGroup"],["for","address"],["bis-input","","type","text","id","address","name","address","formControlName","address",3,"placeholder"]],template:function(t,r){if(1&t&&(e.F$t(),e.TgZ(0,"form",0),e.NdJ("ngSubmit",function(){return r.submit()}),e.TgZ(1,"div",1),e.YNc(2,Hn,1,0,"ng-container",2),e.YNc(3,Qn,1,0,"ng-container",2),e.TgZ(4,"button",3),e._uU(5),e.ALo(6,"translate"),e.qZA()()(),e.Hsn(7),e.YNc(8,jn,7,11,"ng-template",null,4,e.W1O),e.YNc(10,$n,6,7,"ng-template",null,5,e.W1O)),2&t){const o=e.MAs(9),s=e.MAs(11);e.xp6(2),e.Q6J("ngTemplateOutlet",o),e.xp6(1),e.Q6J("ngTemplateOutlet",s),e.xp6(1),e.Q6J("disabled",r.isSubmitDisabled()),e.xp6(1),e.hij(" ",e.lcZ(6,4,"app.button.search.text")," ")}},dependencies:[p.mk,p.O5,p.tP,u._Y,u.Fj,u.JJ,u.JL,u.nD,u.F,u.sg,u.u,c.Vdl,c.Hq3,G.l,b.X$],styles:[".submit-btn[_ngcontent-%COMP%]{max-width:70px;align-self:flex-end}"],changeDetection:0}),n})();function Kn(n,i){1&n&&e.GkF(0)}function kn(n,i){1&n&&e.GkF(0)}function qn(n,i){1&n&&e.GkF(0)}function zn(n,i){1&n&&e.GkF(0)}
1function Wn(n,i){if(1&n&&(e.TgZ(0,"div",12)(1,"label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div",13)(5,"bis-radio",14),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"bis-radio",15),e._uU(9),e.ALo(10,"translate"),e.qZA(),e.TgZ(11,"bis-radio",16),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.Oqu(e.lcZ(3,5,"person.search-form.sex.label")),e.xp6(4),e.Oqu(e.lcZ(7,7,"person.search-form.sex.value.any.text")),e.xp6(3),e.Oqu(e.lcZ(10,9,"person.search-form.sex.value.male.text")),e.xp6(3),e.Oqu(e.lcZ(13,11,"person.search-form.sex.value.female.text"))}}function Xn(n,i){if(1&n&&(e.TgZ(0,"div",21),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.hij(" ",e.lcZ(2,1,"validation."+t)," ")}}const Ge=function(n){return{"form-control--error":n}};function er(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",17)(1,"label",18),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"input",19),e.NdJ("focus",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsUntouched("givenName"))}),e.ALo(5,"translate"),e.qZA(),e.YNc(6,Xn,3,3,"div",20),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.hij(" ",e.lcZ(3,5,"person.search-form.first-name.label")," "),e.xp6(2),e.s9C("placeholder",e.lcZ(5,7,"person.search-form.first-name.placeholder")),e.Q6J("ngClass",e.VKq(9,Ge,t.hasErrorState("givenName"))),e.xp6(2),e.Q6J("ngIf",t.getError("givenName"))}}function tr(n,i){if(1&n&&(e.TgZ(0,"div",21),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.hij(" ",e.lcZ(2,1,"validation."+t)," ")}}function nr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",17)(1,"label",22),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"input",23),e.NdJ("focus",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.markAsUntouched("familyName"))}),e.ALo(5,"translate"),e.qZA(),e.YNc(6,tr,3,3,"div",20),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("formGroup",t.form),e.xp6(2),e.hij(" ",e.lcZ(3,5,"person.search-form.last-name.label")," "),e.xp6(2),e.s9C("placeholder",e.lcZ(5,7,"person.search-form.last-name.placeholder")),e.Q6J("ngClass",e.VKq(9,Ge,t.hasErrorState("familyName"))),e.xp6(2),e.Q6J("ngIf",t.getError("familyName"))}}const de=function(n){return{hidden:n}};function rr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div",24)(5,"bis-checkbox",25),e.NdJ("valueChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.useBirthInterval=!o.useBirthInterval)}),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"div",26)(9,"input",27),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("birthDate",o))}),e.ALo(10,"translate"),e.qZA()(),e.TgZ(11,"div",28)(12,"input",29),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("birthFrom",o))}),e.ALo(13,"translate"),e.qZA()(),e.TgZ(14,"div",30)(15,"input",31),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("birthTo",o))}),e.ALo(16,"translate"),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Oqu(e.lcZ(3,10,"person.search-form.birth-date.label")),e.xp6(2),e.Q6J("formGroup",t.form),e.xp6(1),e.Q6J("checked",t.useBirthInterval),e.xp6(1),e.hij(" ",e.lcZ(7,12,"person.search-form.birth-interval.label")," "),e.xp6(2),e.Q6J("ngClass",e.VKq(20,de,t.useBirthInterval)),e.xp6(1),e.s9C("placeholder",e.lcZ(10,14,"person.search-form.birth-date.placeholder")),e.xp6(2),e.Q6J("ngClass",e.VKq(22,de,!t.useBirthInterval)),e.xp6(1),e.s9C("placeholder",e.lcZ(13,16,"person.search-form.birth-date-from.placeholder")),e.xp6(2),e.Q6J("ngClass",e.VKq(24,de,!t.useBirthInterval)),e.xp6(1),e.s9C("placeholder",e.lcZ(16,18,"person.search-form.birth-date-to.placeholder"))}}const or=["*"];let ir=(()=>{class n extends Ee{constructor(t,r){super(),this.formBuilder=t,this.activatedRoute=r,this.inputControl={birthFrom:{formatters:[Z.p6]},birthTo:{formatters:[Z.p6]},birthDate:{formatters:[Z.p6]}}}submit(){if(this.isSubmitDisabled())return;const t=this.formatDatesForForm(this.formattedFormData);this.submitEvent.emit(Object.assign(Object.assign({},t),{searchScope:"DEREGISTERED"}))}buildGroupDefinitionWithParams(t,r){const o=this.paramsToFormValues(t),s=[pe(r.nameMinLength)];return{givenName:[o.givenName,s],familyName:[o.familyName,s],birthDate:[o.birthDate],birthFrom:[o.birthFrom],birthTo:[o.birthTo],sex:[o.sex]}}paramsToFormValues(t){return{givenName:t.get("givenName"),familyName:t.get("familyName"),birthDate:t.get("birthDate"),birthFrom:t.get("birthFrom"),birthTo:t.get("birthTo"),sex:t.get("sex")||""}}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(u.QS),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-history-search"]],features:[e.qOj],ngContentSelectors:or,decls:23,vars:8,consts:[[3,"ngSubmit"],[1,"u-display-flex","u-flex-column"],[1,"u-display-flex","form-group_person","flex-table_33"],[4,"ngTemplateOutlet"],[1,"u-display-flex","form-group_person","u-margin-top-default"],[1,"spacer","u-margin-y-default"],[1,"submit-container"],["bis-btn","","type","submit",3,"disabled"],["SEX",""],["GIVEN_NAME",""],["FAMILY_NAME",""],["AGE",""],[3,"formGroup"],["bis-radio-group","","name","sex","formControlName","sex",1,"u-display-flex"],["value",""],["value","M"],["value","F"],[1,"form-input_name",3,"formGroup"],["for","givenName"],["bis-input","","type","text","id","givenName","name","givenName","formControlName","givenName","maxlength","80",3,"ngClass","placeholder","focus"],["class","form-input-error-message",4,"ngIf"],[1,"form-input-error-message"],["for","familyName"],["bis-input","","type","text","id","familyName","name","familyName","formControlName","familyName","maxlength","80",3,"ngClass","placeholder","focus"],[1,"birth-inputs","u-justify-content-between","u-align-items-end",3,"formGroup"],[1,"u-margin-none",3,"checked","valueChange"],[1,"form-input_birth",3,"ngClass"],["bis-input","","type","text","id","birthDate","name","birthDate","formControlName","birthDate",3,"placeholder","input"],[1,"form-input_birth-from",3,"ngClass"],["bis-input","","type","text","id","birthFrom","name","birthFrom","formControlName","birthFrom",3,"placeholder","input"],[1,"form-input_birth-to",3,"ngClass"],["bis-input","","type","text","id","birthTo","name","birthTo","formControlName","birthTo",3,"placeholder","input"]],template:function(t,r){if(1&t&&(e.F$t(),e.TgZ(0,"form",0),e.NdJ("ngSubmit",function(){return r.submit()}),e.TgZ(1,"div",1)(2,"div",2),e.YNc(3,Kn,1,0,"ng-container",3),e.YNc(4,kn,1,0,"ng-container",3),e.qZA(),e.TgZ(5,"div",4),e.YNc(6,qn,1,0,"ng-container",3),e.YNc(7,zn,1,0,"ng-container",3),e.qZA()(),e._UZ(8,"div",5),e.TgZ(9,"div",6)(10,"div")(11,"button",7),e._uU(12),e.ALo(13,"translate"),e.qZA()(),e.Hsn(14),e.qZA()(),e.YNc(15,Wn,14,13,"ng-template",null,8,e.W1O),e.YNc(17,er,7,11,"ng-template",null,9,e.W1O),e.YNc(19,nr,7,11,"ng-template",null,10,e.W1O),e.YNc(21,rr,17,26,"ng-template",null,11,e.W1O)),2&t){const o=e.MAs(16),s=e.MAs(18),l=e.MAs(20),d=e.MAs(22);e.xp6(3),e.Q6J("ngTemplateOutlet",s),e.xp6(1),e.Q6J("ngTemplateOutlet",l),e.xp6(2),e.Q6J("ngTemplateOutlet",d),e.xp6(1),e.Q6J("ngTemplateOutlet",o),e.xp6(4),e.Q6J("disabled",r.isSubmitDisabled()),e.xp6(1),e.hij(" ",e.lcZ(13,6,"app.button.search.text")," ")}},dependencies:[p.mk,p.O5,p.tP,u._Y,u.Fj,u.JJ,u.JL,u.nD,u.F,u.sg,u.u,c.Vdl,c.bK4,c.w0r,c.UKb,c.Hq3,G.l,b.X$],styles:[".form-group_person[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-right:1rem}.linked-inputs[_ngcontent-%COMP%]{display:flex}.linked-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{margin-right:.5rem}.submit-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;flex-direction:row-reverse}.birth-inputs[_ngcontent-%COMP%]{display:flex}.birth-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{align-self:center;max-width:160px}.birth-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:not(:last-child){margin-right:1rem!important}.label-with-tooltip[_ngcontent-%COMP%]{position:relative}.label-tooltip[_ngcontent-%COMP%]{position:absolute;bottom:-2px;margin-left:.25rem}"],changeDetection:0}),n})();var je=a(22116);const W=function(n){return{"tab--active":n}};function sr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"li",5)(1,"span",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.searchTab="easy")}),e._uU(2),e.ALo(3,"translate"),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngClass",e.VKq(4,W,"easy"===t.searchTab)),e.xp6(1),e.hij(" ",e.lcZ(3,2,"person.search-form.easy.text")," ")}}function ar(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"li",5)(1,"span",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.searchTab="extended")}),e._uU(2),e.ALo(3,"translate"),e.TgZ(4,"bis-tooltip",10),e.ALo(5,"translate"),e._UZ(6,"bis-icon",11),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngClass",e.VKq(7,W,"extended"===t.searchTab)),e.xp6(1),e.hij(" ",e.lcZ(3,3,"person.search-form.extended.text")," "),e.xp6(2),e.Q6J("tooltip-data",e.lcZ(5,5,"person.search-form.extended.tooltip"))}}function lr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"li",5)(1,"span",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.searchTab="history")}),e._uU(2),e.ALo(3,"translate"),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngClass",e.VKq(4,W,"history"===t.searchTab)),e.xp6(1),e.hij(" ",e.lcZ(3,2,"person.search-form.history.text")," ")}}function cr(n,i){if(1&n&&(e.TgZ(0,"bis-inline-alert",14),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=e.oxw(2).ngIf;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.hasSpar?"app.form.wildcard.text-alt":"app.form.wildcard.text")," ")}}function pr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"person-simple-search",12),e.NdJ("submitEvent",function(o){e.CHM(t);const s=e.oxw(2);return e.KtG(s.onSearchNameAndAddress(o))}),e.YNc(1,cr,3,3,"bis-inline-alert",13),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.showHint)}}function ur(n,i){if(1&n&&(e.TgZ(0,"bis-inline-alert",17),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=e.oxw(2).ngIf,r=e.oxw();e.xp6(1),e.hij(" ",e.lcZ(2,1,(r.isExtendedSearchMode?t.hasNavet:t.hasSpar)?"app.form.wildcard.text-alt":"app.form.wildcard.text")," ")}}function dr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"person-advanced-search",15),e.NdJ("submitEvent",function(o){e.CHM(t);const s=e.oxw(2);return e.KtG(s.onSearchNameAndAddress(o))}),e.YNc(1,ur,3,3,"bis-inline-alert",16),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("isExtendedSearch",t.isExtendedSearchMode),e.xp6(1),e.Q6J("ngIf",t.showHint)}}function mr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"person-history-search",12),e.NdJ("submitEvent",function(o){e.CHM(t);const s=e.oxw(2);return e.KtG(s.onSearchNameAndAddress(o))}),e.qZA()}}function hr(n,i){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",1),e._UZ(2,"app-loading-progress",2),e.ALo(3,"async"),e.TgZ(4,"ul",3),e.YNc(5,sr,4,6,"li",4),e.TgZ(6,"li",5)(7,"span",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchTab="advanced")}),e._uU(8),e.ALo(9,"translate"),e.qZA()(),e.YNc(10,ar,7,9,"li",4),e.YNc(11,lr,4,6,"li",4),e.qZA(),e.TgZ(12,"bis-card-section",7),e.YNc(13,pr,2,1,"person-simple-search",8),e.YNc(14,dr,2,2,"person-advanced-search",9),e.YNc(15,mr,1,0,"person-history-search",8),e.qZA()(),e.BQk()}if(2&n){const t=i.ngIf,r=e.oxw();e.xp6(2),e.Q6J("isLoading",e.lcZ(3,9,r.loading$)),e.xp6(3),e.Q6J("ngIf",!t.isGov),e.xp6(2),e.Q6J("ngClass",e.VKq(13,W,"advanced"===r.searchTab||"easy"===r.searchTab&&t.isGov)),e.xp6(1),e.hij(" ",e.lcZ(9,11,"person.search-form.advanced.text")," "),e.xp6(2),e.Q6J("ngIf",t.hasNavet),e.xp6(1),e.Q6J("ngIf",t.isGov),e.xp6(2),e.Q6J("ngIf","easy"===r.searchTab&&!t.isGov),e.xp6(1),e.Q6J("ngIf","advanced"===r.searchTab||"extended"===r.searchTab||"easy"===r.searchTab&&t.isGov),e.xp6(1),e.Q6J("ngIf","history"===r.searchTab)}}const me=function(n){return[n]}
1,gr=function(n,i,t){return{isGov:n,hasSpar:i,hasNavet:t}};let $e=(()=>{class n{constructor(t,r){this.routingService=t,this.route=r,this.showHint=!1,this.searchTab="easy",this.permissions=I}ngOnInit(){this.initSearchTab()}get isExtendedSearchMode(){return"extended"===this.searchTab}onSearchNameAndAddress(t){this.routingService.navigateToResults("name-address",Object.assign(Object.assign({},(0,J.wK)(t)),{_searchTab:this.searchTab}))}initSearchTab(){this.route.queryParamMap.pipe((0,y.q)(1)).subscribe(t=>this.searchTab=t.get("_searchTab")||"easy").unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(D),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-name-and-address-search-box"]],inputs:{loading$:"loading$",showHint:"showHint"},decls:7,vars:26,consts:[[4,"ngIf"],["bis-card","",1,"print-hide-important"],[3,"isLoading"],[1,"tabs","u-margin-x-default"],["class","tab",4,"ngIf"],[1,"tab"],[1,"tab__link","u-cursor-pointer",3,"ngClass","click"],[1,"u-padding-top-none"],[3,"submitEvent",4,"ngIf"],[3,"isExtendedSearch","submitEvent",4,"ngIf"],["type","line-break","direction","bottom",1,"extended-tooltip",3,"tooltip-data"],["icon","info"],[3,"submitEvent"],["class","u-margin-top-default","type","info",4,"ngIf"],["type","info",1,"u-margin-top-default"],[3,"isExtendedSearch","submitEvent"],["type","info",4,"ngIf"],["type","info"]],template:function(t,r){1&t&&(e.YNc(0,hr,16,15,"ng-container",0),e.ALo(1,"async"),e.ALo(2,"accessRight"),e.ALo(3,"async"),e.ALo(4,"accessRight"),e.ALo(5,"async"),e.ALo(6,"accessRight")),2&t&&e.Q6J("ngIf",e.kEZ(22,gr,e.lcZ(1,1,e.xi3(2,3,e.VKq(16,me,r.permissions.GOV_BASIC),"any")),e.lcZ(3,6,e.xi3(4,8,e.VKq(18,me,r.permissions.SPAR),"any")),e.lcZ(5,11,e.xi3(6,13,e.VKq(20,me,r.permissions.NAVET),"any"))))},dependencies:[p.mk,p.O5,c.H41,c.AD5,c.oJW,c.KZt,c.lIM,k.E,Qe,Ue,ir,p.Ov,b.X$,je.V],styles:["person-name-and-address-search-box .tabs{overflow-x:visible}person-name-and-address-search-box .tab{max-width:12.5rem}person-name-and-address-search-box .extended-tooltip{position:relative;display:inline-block;vertical-align:middle;margin-left:.25rem}person-name-and-address-search-box .extended-tooltip>.tooltip:hover:after{max-width:11.25rem;text-align:left;white-space:pre-line}person-name-and-address-search-box bis-inline-alert{max-width:43.75rem}\n"],encapsulation:2}),n})();function _r(n,i){1&n&&e.GkF(0)}function fr(n,i){if(1&n&&(e.TgZ(0,"div",2),e.ALo(1,"translate"),e.TgZ(2,"bis-card-section"),e.YNc(3,_r,1,0,"ng-container",3),e.qZA()()),2&n){e.oxw();const t=e.MAs(2);e.s9C("header",e.lcZ(1,2,"person.search-form.phone-number.header")),e.xp6(3),e.Q6J("ngTemplateOutlet",t)}}function vr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"form",4),e.NdJ("ngSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.submit())}),e.TgZ(1,"div",5)(2,"div")(3,"bis-form-group")(4,"label",6),e._uU(5),e.ALo(6,"translate"),e.qZA(),e.TgZ(7,"input",7),e.NdJ("input",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.formatOnInput("phoneNumber",o))})("keydown.enter",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.submit())}),e.ALo(8,"translate"),e.qZA()()(),e.TgZ(9,"button",8),e._uU(10),e.ALo(11,"translate"),e.qZA()()()}if(2&n){const t=e.oxw();
1e.Q6J("formGroup",t.form),e.xp6(5),e.Oqu(e.lcZ(6,5,"person.search-form.phone-number.label")),e.xp6(2),e.s9C("placeholder",e.lcZ(8,7,"person.search-form.phone-number.placeholder")),e.xp6(2),e.Q6J("disabled",t.form.get("phoneNumber").invalid),e.xp6(1),e.hij(" ",e.lcZ(11,9,"app.button.search.text")," ")}}let Ve=(()=>{class n extends K.D{constructor(t,r,o){super(),this.routingService=t,this.formBuilder=r,this.route=o,this.inputControl={phoneNumber:{formatters:[Z.un],returnFormatters:[Z.un]}},this.wrapWithCard=!0}ngOnInit(){this.route.queryParams.pipe((0,y.q)(1)).subscribe(t=>{var r;this.form=this.formBuilder.group({phoneNumber:[null!==(r=null==t?void 0:t.phoneNumber)&&void 0!==r?r:"",[u.kI.required,u.kI.minLength(4)]]})})}submit(){this.routingService.navigateToResults("phone-number",this.formattedFormData)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(D),e.Y36(u.QS),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["phone-number-person-search-box"]],inputs:{wrapWithCard:"wrapWithCard"},features:[e.qOj],decls:3,vars:2,consts:[["class","print-hide","bis-card","","app-card","",3,"header",4,"ngIf","ngIfElse"],["CONTENT",""],["bis-card","","app-card","",1,"print-hide",3,"header"],[4,"ngTemplateOutlet"],[3,"formGroup","ngSubmit"],[1,"form-builder-wrapper","flex-table_33"],["for","phoneNumber"],["bis-input","","id","phoneNumber","name","phoneNumber","type","text","formControlName","phoneNumber",3,"placeholder","input","keydown.enter"],["bis-btn","","type","submit",1,"submit-btn","btn--primary","btn","print-hide",3,"disabled"]],template:function(t,r){if(1&t&&(e.YNc(0,fr,4,4,"div",0),e.YNc(1,vr,12,11,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",r.wrapWithCard)("ngIfElse",o)}},dependencies:[p.O5,p.tP,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,c.H41,c.AD5,c.Vdl,c.HK$,c.Hq3,G.l,ce.A,b.X$],styles:["phone-number-person-search-box bis-form-group{margin-bottom:1rem;margin-top:0!important;position:relative}phone-number-person-search-box .submit-btn{max-width:70px;align-self:start;margin-top:1.75rem;margin-bottom:1rem}\n"],encapsulation:2}),n})(),br=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-search"]],decls:3,vars:1,consts:[[3,"showHint"]],template:function(t,r){1&t&&e._UZ(0,"person-identity-search-box")(1,"person-name-and-address-search-box",0)(2,"phone-number-person-search-box"),2&t&&(e.xp6(1),e.Q6J("showHint",!0))},dependencies:[De,$e,Ve],styles:["[_nghost-%COMP%]{display:block}"]}),n})();var xr=a(43809),Cr=a(38343),Ke=a(45495),ke=a(73124),yr=a(37705),Tr=a(25695),qe=a(84770);const ze="results-person",We=n=>n.identityNumber,Xe=(0,Q.H)({selectId:We}),he=(0,Ke.KD)("Person Results"),Ar=(0,ke.Fi)(he,Xe);let et=(()=>{class n extends qe.s{constructor(){super(...arguments),this.apiPath="/api/search/persons"}buildRequestOptions(t){return this.requestOptionsFromParams(t)}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),ge=(()=>{class n extends yr.i{constructor(t){super(),this.store=t,this.featureName=ze,this.adapter=Xe,this.selectId=We,this.init()}createIdItem(t){return{identityNumber:t}}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(m.yh))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),_e=(()=>{class n extends Tr.E{constructor(t){super(),this.store=t,this.storeActions=he}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(m.yh))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),Sr=(()=>{class n extends F.n{constructor(t,r,o){super(),this.actions$=t,this.dataService=r,this.actionService=o,this.storeActions=he,this.initLoad(),this.initOnlyAuthFail()}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(O.eX),e.LFG(et),e.LFG(_e))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),tt=(()=>{class n{constructor(t,r,o){this.actionService=t,this.storeService=r,this.route=o,this.initRetrieve()}retrieve(){return this.retrieve$}initRetrieve(){this.retrieve$=this.route.queryParams.pipe((0,Me.x)((t,r)=>(0,J.Zu)(t,r)),(0,ie.b)(t=>this.actionService.load(t)),(0,w.w)(()=>this.storeService.selectAll()),(0,xr._)(1),(0,Cr.x)())}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(_e),e.LFG(ge),e.LFG(g.gz))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();class R{constructor(){this.filter={},this.minLength=1}reset(){this.filter={}}getFilters(){const i=this.toAggregationItem(this.filter);return i.length>=this.minLength?i:[]}toAggregationItem(i){return Object.keys(i).map(t=>({label:t,count:i[t]})).sort((t,r)=>r.count-t.count)}stringToFilter(i,t){i&&i.split(",").map(r=>
1r.trim()).forEach(r=>{t[r]=t[r]?t[r]+1:1})}}let nt=(()=>{class n extends R{toFilter(t){var r,o;this.stringToFilter(null===(o=null===(r=null==t?void 0:t.birth)||void 0===r?void 0:r.date)||void 0===o?void 0:o.substring(0,4),this.filter)}useFilter(t,r){const o=r.label.split("-").filter(s=>s).map(s=>+s);return t.filter(s=>{var l,d;const x=+((null===(d=null===(l=s.birth)||void 0===l?void 0:l.date)||void 0===d?void 0:d.substring(0,4))||"0");return x>=o[0]&&(!o[1]||x<=o[1])})}getFilters(){const t=this.toAggregationItem(this.filter);return t.length>this.minLength?this.groupBirthsDecades(t):[]}groupBirthsDecades(t){t.sort((h,_)=>+h.label-+_.label);const o=10*Math.floor(+t[0].label/10),l=Math.ceil((+t[t.length-1].label-o)/10),d=(new Date).getFullYear();return[...new Array(l).fill(void 0).map((h,_)=>[o+10*_+(_?1:0),o+10*(_+1)]).map(h=>({label:h.filter(_=>_<=d).join("-"),count:this.countOfYearsInDecade(h,t)})).filter(h=>h.count)]}countOfYearsInDecade(t,r){return r.filter(o=>+o.label>=t[0]&&+o.label<=t[1]).reduce((o,s)=>o+s.count,0)}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var X=a(78075);let rt=(()=>{class n extends R{constructor(t){super(),this.codePipe=t,this.minLength=2}toFilter(t){var r;this.stringToFilter(null===(r=this.codePipe.transform(t.sex))||void 0===r?void 0:r.text,this.filter)}useFilter(t,r){return t.filter(o=>{var s;return null===(s=this.codePipe.transform(o.sex))||void 0===s?void 0:s.text.toLowerCase().includes(r.label.toLowerCase())})}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(X.h))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var Pr=a(94736);let ot=(()=>{class n extends R{constructor(){super(...arguments),this.minLength=2}toFilter(t){this.stringToFilter((0,Pr.wR)(t.tableCity||""),this.filter)}useFilter(t,r){return t.filter(o=>{var s;return null===(s=o.tableCity)||void 0===s?void 0:s.toLowerCase().includes(r.label.toLowerCase())})}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),it=(()=>{class n extends R{constructor(t){super(),this.noNote="app.form.filter.no-comment.text",this.minLength=2,this.noNote=t.instant(this.noNote)}useFilter(t,r){return t.filter(o=>{var s;return this.isNoteMatch(null===(s=o.note)||void 0===s?void 0:s.toLowerCase(),r.label.toLowerCase())})}toFilter(t){this.stringToFilter(t.note||this.noNote,this.filter)}isNoteMatch(t,r){return r.toLowerCase()===this.noNote.toLowerCase()&&!t||(null==t?void 0:t.includes(r))}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(b.sK))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),st=(()=>{class n extends R{constructor(){super(...arguments),this.minLength=2}toFilter(t){this.stringToFilter(this.getPostCode(t).substring(0,2),this.filter)}useFilter(t,r){return t.filter(o=>this.getPostCode(o).substring(0,2).includes(r.label))}getPostCode(t){var r,o,s,l;return(null===(o=null===(r=t.address)||void 0===r?void 0:r.registeredAddress)||void 0===o?void 0:o.postCode)||(null===(l=null===(s=t.address)||void 0===s?void 0:s.specialPostalAddress)||void 0===l?void 0:l.postCode)||""}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),at=(()=>{class n extends R{constructor(){super(...arguments),this.minLength=2}toFilter(t){this.stringToFilter(this.getName(t),this.filter)}useFilter(t,r){return t.filter(o=>this.getName(o).includes(r.label))}getName(t){var r,o,s;return(null===(r=t.name)||void 0===r?void 0:r.calledName)||(null===(s=null===(o=t.name)||void 0===o?void 0:o.givenName)||void 0===s?void 0:s.split(" ")[0])||""}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),lt=(()=>{class n extends R{constructor(){super(...arguments),this.minLength=2,this.co
1dePipe=(0,e.f3M)(X.h)}toFilter(t){this.stringToFilter(this.getCounty(t),this.filter)}useFilter(t,r){return t.filter(o=>{var s;return null===(s=this.getCounty(o))||void 0===s?void 0:s.includes(r.label)})}getCounty(t){var r,o;return null===(o=this.codePipe.transform(null===(r=t.nationalRegistration)||void 0===r?void 0:r.county))||void 0===o?void 0:o.clearText}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),ct=(()=>{class n extends R{constructor(){super(...arguments),this.minLength=2,this.codePipe=(0,e.f3M)(X.h)}toFilter(t){this.stringToFilter(this.getMunicipality(t),this.filter)}useFilter(t,r){return t.filter(o=>{var s;return null===(s=this.getMunicipality(o))||void 0===s?void 0:s.includes(r.label)})}getMunicipality(t){var r,o;return null===(o=this.codePipe.transform(null===(r=t.nationalRegistration)||void 0===r?void 0:r.municipality))||void 0===o?void 0:o.clearText}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var Zr=a(48903),Fr=a(32041),Or=a(34352),Nr=a(38247),Lr=a(71605),Mr=a(37869),pt=a(39646),ut=a(67764),Ir=a(47178),Rr=a(49428),dt=a(4459);function wr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"bis-radio",6),e.NdJ("valueChange",function(){const s=e.CHM(t).ngIf,l=e.oxw().$implicit,d=e.oxw();return e.KtG(d.onOption(s,l))}),e.ALo(1,"checkedResultsFilter"),e.ALo(2,"async"),e._uU(3),e.ALo(4,"translate"),e.ALo(5,"translate"),e.qZA()}if(2&n){const t=i.ngIf,r=e.oxw().$implicit,o=e.oxw();e.Q6J("name",r.name)("checked",e.Dn7(1,3,e.lcZ(2,7,o.routeParams$),r,t)),e.xp6(3),e.hij(" ",e.lcZ(4,9,"app.value.prefix.below.text")+" 18 "+e.lcZ(5,11,"app.value.suffix.age.text")," ")}}function Dr(n,i){1&n&&e.GkF(0)}const mt=function(n,i){return{$implicit:n,$option:i}};function Jr(n,i){if(1&n&&(e.ynx(0),e.YNc(1,Dr,1,0,"ng-container",10),e.BQk()),2&n){const t=i.$implicit,r=e.oxw().$implicit;e.oxw();const o=e.MAs(5);e.xp6(1),e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.WLB(2,mt,r,t))}}function Er(n,i){1&n&&e.GkF(0)}function Br(n,i){if(1&n&&(e.ynx(0),e.YNc(1,Er,1,0,"ng-container",10),e.BQk()),2&n){const t=i.$implicit,r=e.oxw(2).$implicit;e.oxw();const o=e.MAs(5);e.xp6(1),e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.WLB(2,mt,r,t))}}function Yr(n,i){if(1&n&&(e.ynx(0),e.TgZ(1,"app-toggler",11),e.YNc(2,Br,2,5,"ng-container",8),e.ALo(3,"slice"),e.qZA(),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("hideAfterToggle",!0),e.xp6(1),e.Q6J("ngForOf",e.xi3(3,2,t.results,10))}}const Hr=function(n){return{label:n,count:0}};function Qr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"app-toggler",4),e.ALo(1,"translate"),e.ALo(2,"replace"),e.ALo(3,"translate"),e.ALo(4,"replace"),e.ALo(5,"checkedResultsFilter"),e.ALo(6,"async"),e.TgZ(7,"div",5)(8,"bis-radio",6),e.NdJ("valueChange",function(){const s=e.CHM(t).$implicit,l=e.oxw();return e.KtG(l.onClear(s))}),e.ALo(9,"checkedResultsFilter"),e.ALo(10,"async"),e._uU(11),e.ALo(12,"translate"),e.qZA(),e.YNc(13,wr,6,13,"bis-radio",7),e.YNc(14,Jr,2,5,"ng-container",8),e.ALo(15,"slice"),e.YNc(16,Yr,4,5,"ng-container",9),e.qZA()()}if(2&n){const t=i.$implicit,r=e.oxw();e.Q6J("hideText",e.lcZ(1,9,"app.model.common."+e.Dn7(2,11,t.name,"Code","")+".label"))("showText",e.lcZ(3,15,"app.model.common."+e.Dn7(4,17,t.name,"Code","")+".label"))("toggled",e.xi3(5,21,e.lcZ(6,24,r.routeParams$),t)),e.xp6(8),e.Q6J("name",t.name)("checked",!e.xi3(9,26,e.lcZ(10,29,r.routeParams$),t)),e.xp6(3),e.hij(" ",e.lcZ(12,31,"app.form.filter.all.text")," "),e.xp6(2),e.Q6J("ngIf","birthDecades"===t.name&&e.VKq(37,Hr,r.below18Year)),e.xp6(1),e.Q6J("ngForOf",e.Dn7(15,33,t.results,0,10)),e.xp6(2),e.Q6J("ngIf",(null==t.results?null:t.results.length)>10)}}function Ur(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$option;e.xp6(1),e.hij("(~",t.count,")")}}function Gr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"bis-radio",6),e.NdJ("valueChange",function(){const o=e.CHM(t),s=o.$option,l=o.$implicit,d=e.oxw();return e.KtG(d.onOption(s,l))}),e.ALo(1,"checkedResultsFilter"),e.ALo(2,"async"),e._uU(3),e.ALo(4,"async"),e.ALo(5,"translateFilterOption"),e.YNc(6,Ur,2,1,"span",9),e.qZA()}if(2&n){const t=i.$implicit,r=i.$option,o=e.oxw();
1e.Q6J("name",t.name)("checked",e.Dn7(1,4,e.lcZ(2,8,o.routeParams$),t,r)),e.xp6(3),e.hij(" ",e.lcZ(4,10,e.xi3(5,12,r.label,t.name))," "),e.xp6(3),e.Q6J("ngIf",r.count)}}let jr=(()=>{class n{constructor(t,r,o,s){this.router=t,this.viewStore=r,this.viewAction=o,this.route=s,this.hideHost=!0,this.below18Year=""+((new Date).getFullYear()-18),this.viewMemKey={id:"results-filter",context:"person"},this.memorizedParams={}}ngOnChanges(t){t.filters&&(this.rememberView(),this.addMissingFiltersFromMemory(),this.initParams(),this.toggleHost())}onOption(t,r){const o={[r.name]:t.label};this.memorize(o),fe(r)?this.handleDecades(r,t):this.updateRouterQuery(o)}onClear(t){const r={[t.name]:void 0};this.memorize(r),fe(t)?this.handleDecades(t):this.updateRouterQuery(r)}initParams(){this.routeParams$=this.route.queryParams}handleDecades(t,r){const o=r?ht(r):[],s=ve(t);this.updateRouterQuery({[s[0]]:o[0],[s[1]]:o[1]})}updateRouterQuery(t){this.router.navigate([],{relativeTo:this.route,queryParams:t,queryParamsHandling:"merge",replaceUrl:!0})}addMissingFiltersFromMemory(){var t;const r=[];Object.keys(this.memorizedParams).forEach(o=>{var s;!(null===(s=this.filters)||void 0===s?void 0:s.find(d=>d.name===o))&&this.memorizedParams[o]&&r.push({name:o,results:[{count:0,label:this.memorizedParams[o]}]})}),this.filters=[...r,...null!==(t=this.filters)&&void 0!==t?t:[]]}rememberView(){this.viewStore.select(this.viewMemKey).pipe((0,y.q)(1)).subscribe(t=>{var r;return this.memorizedParams=null!==(r=null==t?void 0:t.value)&&void 0!==r?r:{}}).unsubscribe()}memorize(t){this.memorizedParams=Object.assign(Object.assign({},this.memorizedParams),t),this.viewAction.upsert(Object.assign(Object.assign({},this.viewMemKey),{value:Object.assign({},this.memorizedParams)}))}toggleHost(){this.hideHost=!this.filters.length}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g.F0),e.Y36(Ir.Y),e.Y36(Rr.F),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-results-filter"]],hostVars:2,hostBindings:function(t,r){2&t&&e.ekj("u-display-none",r.hideHost)},inputs:{filters:"filters",loading$:"loading$"},features:[e.TTD],decls:6,vars:4,consts:[["bis-card","",1,"u-margin-bottom-none"],[3,"isLoading"],["toggleClass","filter-toggle",3,"hideText","showText","toggled",4,"ngFor","ngForOf"],["RADIO",""],["toggleClass","filter-toggle",3,"hideText","showText","toggled"],[1,"filter-radio-group"],[3,"name","checked","valueChange"],[3,"name","checked","valueChange",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["showText","app.button.show-more.text",1,"show-more-toggle",3,"hideAfterToggle"]],template:function(t,r){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"app-loading-progress",1),e.ALo(2,"async"),e.YNc(3,Qr,17,39,"app-toggler",2),e.qZA(),e.YNc(4,Gr,7,15,"ng-template",null,3,e.W1O)),2&t&&(e.xp6(1),e.Q6J("isLoading",e.lcZ(2,2,r.loading$)),e.xp6(2),e.Q6J("ngForOf",r.filters))},dependencies:function(){return[p.sg,p.O5,p.tP,c.H41,c.UKb,k.E,dt.u,p.Ov,p.OU,b.X$,se,$r,Vr]},styles:["person-results-filter .filter-radio-group{margin-top:.875rem}person-results-filter app-toggler{display:block;border-bottom:1px solid #e8eaed;padding:1rem}person-results-filter app-toggler .filter-toggle{display:flex;justify-content:space-between;cursor:pointer}person-results-filter app-toggler .radio-container{margin:0 0 .5rem}person-results-filter app-toggler .radio-container:last-child{margin-bottom:0}person-results-filter app-toggler label{display:flex;justify-content:space-between;width:100%}person-results-filter .show-more-toggle{border-bottom:0;padding:0}\n"],encapsulation:2}),n})(),$r=(()=>{class n{constructor(t,r){this.translate=t,this.codeRetriever=r,this.codes={countyCode:this.codeRetriever.retrieve("counties"),municipalityCode:this.codeRetriever.retrieve("municipalities"),districtCode:this.codeRetriever.retrieve("districts")}}transform(t,r){return this.codes[r]?this.attemptCode(t,r):(0,pt.of)(this.attemptTranslation(t,r))}attemptCode(t,r){return this.codes[r].pipe((0,f.U)(o=>o.find(s=>this.matchCode(s,t,r))),(0,f.U)(o=>null!=o&&o.label?(0,ut.j)(o.label):t))}matchCode(t,r,o){var s,l;return t.identifier===r||!(null===(l=null===(s=t.chart)||void 0===s?void 0:s.find)||void 0===l||!l.call(s,d=>d.type===o&&d.identifier===r))}attemptTranslation(t,r){const o=this.translate.instant(`app.code.${r.toLowerCase()}.${t.toLowerCase()}.text`);return o.includes("app.code.")?t:o}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(b.sK,16),e.Y36(Ze,16))},n.\u0275pipe=e.Yjl({name:"translateFilterOption",type:n,pure:!0}),n})(),Vr=(()=>{class n{transform(t,r,o){return o?(null==t?void 0:t[r.name])===o.label||this.hasDecadesMatch(t,r,o):this.isParamSet(t,r)}isParamSet(t,r){const o=ve(r);return!(!(null==t?void 0:t[o[0]])&&!(null==t?void 0:t[o[1]]))}hasDecadesMatch(t,r,o){const s=ht(o),l=ve(r);return fe(r)&&(null==t?void 0:t[l[0]])===s[0]&&(null==t?void 0:t[l[1]])===s[1]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=e.Yjl({name:"checkedResultsFilter",type:n,pure:!0}),n})();function fe(n){return n.name.includes("Decades")}function ht(n){return n.label.split("-").map(i=>i.trim()||void 0)}function ve(n){return[n.name.replace("Decades","From"),n.name.replace("Decades","To")]}const gt=function(n){return{disabled:n}},Kr=function(n,i){return{page:n,amount:i}};let kr=(()=>{class n{constructor(t,r){this.router=t,this.route=r,this.previous=[],this.forwardQuery="searchAfter",this.historyQuery="_formerSearch"}ngOnInit(){this.initParamsFromRoute(),this.initPagesAmount()}onBack(){this.current=this.previous.pop(),this.updateRouterQuery()}onForward(){this.current&&this.previous.push(this.current),this.current=this.next,this.updateRouterQuery()}initParamsFromRoute(){this.route.queryParamMap.pipe((0,y.q)(1)).subscribe(t=>{this.previous=JSON.parse(t.get(this.historyQuery)||"[]"),this.current=t.get(this.forwardQuery)}).unsubscribe()}initPagesAmount(){var t,r,o;this.pageAmount=Math.ceil((null===(t=this.pageInfo)||void 0===t?void 0:t.totalItems)/(null!==(o=null===(r=this.pageInfo)||void 0===r?void 0:r.itemsPerPage)&&void 0!==o?o:1))}updateRouterQuery(){this.router.navigate([],{relativeTo:this.route,queryParams:{[this.forwardQuery]:this.current,[this.historyQuery]:JSON.stringify(this.previous)},queryParamsHandling:"merge",replaceUrl:!1})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g.F0),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-results-pagination"]],inputs:{next:"next",pageInfo:"pageInfo"},decls:6,vars:13,consts:[[1,"pagination","u-padding-top-none"],[1,"pagination__item","pagination__item--previous","pagination__item--selected","u-margin-x-xsmall",3,"ngClass","click"],[1,"pagination__item","pagination__item--next","pagination__item--selected","u-margin-x-xsmall",3,"ngClass","click"],[1,"u-text-center","u-margin-top-small"]],template:function(t,r){1&t&&(e.TgZ(0,"div",0)(1,"span",1),e.NdJ("click",function(){return r.onBack()}),e.qZA(),e.TgZ(2,"span",2),e.NdJ("click",function(){return r.onForward()}),e.qZA()(),e.TgZ(3,"div",3),e._uU(4),e.ALo(5,"translate"),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngClass",e.VKq(6,gt,!r.current)),e.xp6(1),e.Q6J("ngClass",e.VKq(8,gt,r.current===r.next)),e.xp6(2),e.hij(" ",e.xi3(5,3,"app.data-table.pagination.text",e.WLB(10,Kr,1+(r.current?1:0)+r.previous.length,r.pageAmount))," "))},dependencies:[p.mk,b.X$],styles:[".pagination__item--previous[_ngcontent-%COMP%]:after{margin-right:2px}.pagination__item--next[_ngcontent-%COMP%]:after{margin-left:4px}.pagination__item[_ngcontent-%COMP%]{cursor:pointer}.pagination__item.disabled[_ngcontent-%COMP%]{cursor:default;opacity:50%;pointer-events:none}"]}),n})();var ee=a(4918),_t=a(34043);function qr(n,i){1&n&&e.GkF(0)}const ft=function(n,i){return{$implicit:n,$option:i}};function zr(n,i){if(1&n&&(e.ynx(0),e.YNc(1,qr,1,0,"ng-container",9),e.BQk()),2&n){const t=i.$implicit,r=e.oxw().$implicit;e.oxw();const o=e.MAs(6);e.xp6(1),e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.WLB(2,ft,r,t))}}function Wr(n,i){1&n&&e.GkF(0)}function Xr(n,i){if(1&n&&(e.ynx(0),e.YNc(1,Wr,1,0,"ng-container",9),e.BQk()),2&n){const t=i.$implicit,r=e.oxw(2).$implicit;e.oxw();const o=e.MAs(6);e.xp6(1),e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.WLB(2,ft,r,t))}}
1function eo(n,i){if(1&n&&(e.ynx(0),e.TgZ(1,"app-toggler",10),e.YNc(2,Xr,2,5,"ng-container",7),e.ALo(3,"slice"),e.qZA(),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("hideAfterToggle",!0),e.xp6(1),e.Q6J("ngForOf",e.xi3(3,2,t.results,10))}}function to(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"app-toggler",4),e.ALo(1,"translate"),e.ALo(2,"replace"),e.ALo(3,"translate"),e.ALo(4,"replace"),e.TgZ(5,"div",5)(6,"bis-radio",6),e.NdJ("valueChange",function(){const s=e.CHM(t).$implicit,l=e.oxw();return e.KtG(l.onClear(s))}),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.YNc(9,zr,2,5,"ng-container",7),e.ALo(10,"slice"),e.YNc(11,eo,4,5,"ng-container",8),e.qZA()()}if(2&n){const t=i.$implicit;e.Q6J("hideText",e.lcZ(1,8,"app.model.common."+e.Dn7(2,10,t.name,"Code","")+".label"))("showText",e.lcZ(3,14,"app.model.common."+e.Dn7(4,16,t.name,"Code","")+".label"))("toggled",!1),e.xp6(6),e.Q6J("name",t.name)("checked",!0),e.xp6(1),e.hij(" ",e.lcZ(8,20,"app.form.filter.all.text")," "),e.xp6(2),e.Q6J("ngForOf",e.Dn7(10,22,t.results,0,10)),e.xp6(2),e.Q6J("ngIf",(null==t.results?null:t.results.length)>10)}}function no(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"bis-radio",6),e.NdJ("valueChange",function(){const o=e.CHM(t),s=o.$implicit,l=o.$option,d=e.oxw();return e.KtG(d.onOption(s,l))}),e._uU(1),e.ALo(2,"titlecase"),e.TgZ(3,"span"),e._uU(4),e.qZA()()}if(2&n){const r=i.$option;e.Q6J("name",i.$implicit.name)("checked",!1),e.xp6(1),e.hij(" ",e.lcZ(2,4,r.label)," "),e.xp6(3),e.hij("(",r.count,")")}}let ro=(()=>{class n extends ee.r{constructor(){super(...arguments),this.hideHost=!0,this.tableData=[],this.selectedFilters={},this.subject$$=new q.X(null),this.subHelper=new U.M,this.plugin={subscribe:{tableState:t=>this.subHelper.addSub(t.pipe((0,f.U)(r=>r.originalTable),(0,M.h)(r=>!(0,J.Zu)(r||[],this.tableData))).subscribe(r=>{this.resetFilters(),this.tableData=r||[],this.createFilters()}))},publish:{tableData$:this.subject$$.asObservable()}}}ngOnDestroy(){this.subHelper.unsub()}onOption(t,r){this.selectedFilters[t.name]=r,this.runFilters()}onClear(t){delete this.selectedFilters[t.name],this.runFilters()}createFilters(){const t=Object.values(this.filterServices||{});this.tableData.forEach(r=>{t.forEach(o=>o.toFilter(r))}),this.filters=Object.keys(this.filterServices||{}).map(r=>({name:r,results:this.filterServices[r].getFilters()})).filter(r=>r.results.length),this.toggleHost()}runFilters(){let t=this.tableData;Object.keys(this.selectedFilters).forEach(r=>t=this.filterServices[r].useFilter(t,this.selectedFilters[r])),this.subject$$.next(t)}resetFilters(){Object.values(this.filterServices).forEach(t=>t.reset())}toggleHost(){this.hideHost=!this.filters.length}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275cmp=e.Xpm({type:n,selectors:[["person-results-local-filter"]],hostVars:2,hostBindings:function(t,r){2&t&&e.ekj("u-display-none",r.hideHost)},inputs:{filterServices:"filterServices"},features:[e._Bn([(0,_t.A)(ee.r,n)]),e.qOj],decls:7,vars:4,consts:[[1,"text-secondary","subtle-header","u-margin-bottom-xsmall","print-hide"],["bis-card","",1,"print-hide-important"],["toggleClass","filter-toggle",3,"hideText","showText","toggled",4,"ngFor","ngForOf"],["RADIO",""],["toggleClass","filter-toggle",3,"hideText","showText","toggled"],[1,"filter-radio-group"],[3,"name","checked","valueChange"],[4,"ngFor","ngForOf"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["showText","app.button.show-more.text",1,"show-more-toggle",3,"hideAfterToggle"]],template:function(t,r){1&t&&(e.TgZ(0,"div",0),e._uU(1),e.ALo(2,"translate"),e.qZA(),e.TgZ(3,"div",1),e.YNc(4,to,12,26,"app-toggler",2),e.qZA(),e.YNc(5,no,5,6,"ng-template",null,3,e.W1O)),2&t&&(e.xp6(1),e.hij(" ",e.lcZ(2,2,"app.form.filter.locally.text")," "),e.xp6(3),e.Q6J("ngForOf",r.filters))},dependencies:[p.sg,p.O5,p.tP,c.H41,c.UKb,dt.u,p.OU,p.rS,b.X$,se],styles:["person-results-local-filter .filter-radio-group{margin-top:.875rem}person-results-local-filter app-toggler{display:block;border-bottom:1px solid #e8eaed;padding:1rem}person-results-local-filter app-toggler .filter-toggle{display:flex;justify-content:space-between;cursor:pointer}
1person-results-local-filter app-toggler .radio-container{margin:0 0 .5rem}person-results-local-filter app-toggler .radio-container:last-child{margin-bottom:0}person-results-local-filter app-toggler label{display:flex;justify-content:space-between;width:100%}person-results-local-filter .show-more-toggle{border-bottom:0;padding:0}\n"],encapsulation:2}),n})(),oo=(()=>{class n extends ee.r{constructor(t,r){super(),this.router=t,this.route=r,this.subject$$=new q.X(null),this.subHelper=new U.M,this.colToOrderBy={tableName:"name","birth-date":"birth",tableAddr:"address",phoneNumber:"phoneNumber"},this.plugin={subscribe:{tableState:o=>this.subHelper.addSub(o.pipe((0,f.U)(s=>s.sort),(0,M.h)(s=>s&&!(0,J.Zu)(s,this.currentSort||{}))).subscribe(s=>{this.currentSort=s,this.sort()}))},publish:{initialState$:this.subject$$.asObservable()}}}ngOnInit(){this.createInitialState(),this.publishInitialState()}ngOnDestroy(){this.subHelper.unsub()}sort(){this.currentSort&&this.updateRouterQuery({orderBy:this.colToOrderBy[this.currentSort.active],desc:"desc"===this.currentSort.direction})}createInitialState(){const t=Object.keys(this.colToOrderBy).find(r=>this.colToOrderBy[r]===this.orderBy);this.currentSort={active:t,direction:this.desc?"desc":"asc"}}publishInitialState(){this.currentSort.active&&this.subject$$.next({sort:this.currentSort})}updateRouterQuery(t){this.router.navigate([],{relativeTo:this.route,queryParams:t,queryParamsHandling:"merge",replaceUrl:!0})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g.F0),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-results-sorting"]],inputs:{orderBy:"orderBy",desc:"desc"},features:[e._Bn([(0,_t.A)(ee.r,n)]),e.qOj],decls:0,vars:0,template:function(t,r){},encapsulation:2}),n})();function io(n,i){if(1&n&&(e.TgZ(0,"p",2),e._uU(1),e.qZA()),2&n){const t=i.ngIf;e.xp6(1),e.hij(" ",t," ")}}let so=(()=>{class n{constructor(t){this.translate=t,this.errorType="warning",this.warningCodes=[400,404,451],this.generateHttpCodeMessage=(r,o="text")=>`app.alert-message.http-code.${r}.${o}`}ngOnChanges(t){this.error&&(this.setErrorType(),this.setErrorText())}setErrorText(){var t,r,o,s;const l=""+this.error.code,d=Object.assign({},(null===(r=null===(t=this.error.applicationError)||void 0===t?void 0:t.errors)||void 0===r?void 0:r[0])||{}),x=`app.alert-message.error.${null===(o=d.reason)||void 0===o?void 0:o.toLowerCase()}.text`,h=`app.alert-message.error.${null===(s=d.reason)||void 0===s?void 0:s.toLowerCase()}.description`;this.errorTranslation=this.getReasonCodeTranslation(x,h,d)||this.getHttpCodeTranslation(l)||this.getHttpCodeTranslation(`${l[0]}xx`)||this.getHttpCodeTranslation("unknown")}setErrorType(){this.errorType=this.warningCodes.includes(this.error.code)?"warning":"danger"}getReasonCodeTranslation(t,r,o){const s=this.attemptTranslate(t,o);return s?{text:s,desc:this.attemptTranslate(r,o)}:null}getHttpCodeTranslation(t){const r=this.attemptTranslate(this.generateHttpCodeMessage(t));return r?{text:r,desc:this.attemptTranslate(this.generateHttpCodeMessage(t,"description"))}:null}attemptTranslate(t,r){const o=this.translate.instant(t,r);return o!==t?o:null}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(b.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-results-error"]],inputs:{error:"error"},features:[e.TTD],decls:3,vars:3,consts:[[1,"hits-alert",3,"type"],["class","error-description",4,"ngIf"],[1,"error-description"]],template:function(t,r){1&t&&(e.TgZ(0,"bis-inline-alert",0),e._uU(1),e.qZA(),e.YNc(2,io,2,1,"p",1)),2&t&&(e.s9C("type",r.errorType),e.xp6(1),e.hij(" ",null==r.errorTranslation?null:r.errorTranslation.text," "),e.xp6(1),e.Q6J("ngIf",null==r.errorTranslation?null:r.errorTranslation.desc))},dependencies:[p.O5,c.lIM],styles:[".error-description[_ngcontent-%COMP%]{white-space:pre-line;margin-top:1rem;max-width:750px}"]}),n})();var ao=a(89808),lo=a(29089);const co=function(n){return{"u-margin-bottom-default":n}};function po(n,i){if(1&n&&e._UZ(0,"conn-data-table-results-information-plugin",14),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(2,co,!(null!=t.metaData&&t.metaData.totalItems)))("totalHits",null==t.metaData?null:t.metaData.totalItems)}}function uo(n,i){1&n&&e._UZ(0,"conn-data-table-quick-search-filter-plugin",15)}
1function mo(n,i){if(1&n&&e._UZ(0,"person-results-sorting",16),2&n){const t=e.oxw();e.Q6J("desc",null==t.metaData?null:t.metaData.desc)("orderBy",null==t.metaData?null:t.metaData.orderBy)}}function ho(n,i){if(1&n&&(e.TgZ(0,"a",23),e.ALo(1,"async"),e.ALo(2,"defaultReportPath"),e._uU(3),e.ALo(4,"identityNr"),e.qZA()),2&n){const t=e.oxw(),r=t.$implicit,o=t.$value,s=e.oxw(2);e.Q6J("routerLink",e.lcZ(1,2,e.Dn7(2,4,r.identityNumber,s.entityType,s.execId))),e.xp6(3),e.hij(" ",e.lcZ(4,8,o)," ")}}function go(n,i){if(1&n&&(e.TgZ(0,"a",23),e.ALo(1,"async"),e.ALo(2,"defaultReportPath"),e._uU(3),e.qZA()),2&n){const t=e.oxw(),r=t.$implicit,o=t.$value,s=e.oxw(2);e.Q6J("routerLink",e.lcZ(1,2,e.Dn7(2,4,r.identityNumber,s.entityType,s.execId))),e.xp6(3),e.hij(" ",o," ")}}function _o(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"titlecase"),e._UZ(3,"br"),e._uU(4),e.ALo(5,"titlecase"),e.qZA()),2&n){const t=e.oxw(),r=t.$value,o=t.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,2,r)," "),e.xp6(3),e.hij(" ",e.lcZ(5,4,o.tableCity)," ")}}function fo(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$value;e.xp6(1),e.hij(" ",t," ")}}function vo(n,i){if(1&n&&(e.TgZ(0,"span",24),e._uU(1),e.qZA()),2&n){const t=e.oxw().$value;e.xp6(1),e.hij(" ",t," ")}}function bo(n,i){if(1&n&&(e._UZ(0,"span",25),e.ALo(1,"titlecase")),2&n){const t=e.oxw().$value;e.Q6J("innerHTML",e.lcZ(1,1,t),e.oJD)}}function xo(n,i){1&n&&(e.ynx(0,18),e.YNc(1,ho,5,10,"a",19),e.YNc(2,go,4,8,"a",19),e.YNc(3,_o,6,6,"span",20),e.YNc(4,fo,2,1,"span",20),e.YNc(5,vo,2,1,"span",21),e.YNc(6,bo,2,3,"span",22),e.BQk()),2&n&&(e.Q6J("ngSwitch",i.$column),e.xp6(1),e.Q6J("ngSwitchCase","identityNumber"),e.xp6(1),e.Q6J("ngSwitchCase","tableName"),e.xp6(1),e.Q6J("ngSwitchCase","tableAddr"),e.xp6(1),e.Q6J("ngSwitchCase","tablePostCode"),e.xp6(1),e.Q6J("ngSwitchCase","note"))}function Co(n,i){if(1&n&&(e.ynx(0),e.TgZ(1,"conn-data-table-plugin",17),e.ALo(2,"personResultsHasBirthDatesPipe"),e.ALo(3,"async"),e.ALo(4,"async"),e.ALo(5,"personResultTableTransform"),e.ALo(6,"async"),e.ALo(7,"async"),e.YNc(8,xo,7,6,"ng-template"),e.qZA(),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.s9C("translationPrefix",t.translationPrefix),e.Q6J("columns",e.lcZ(2,9,e.lcZ(3,11,t.results$))?t.tableConfig.columns:t.tableConfig.columnsNoBirthDate)("columnGrowthDefinition",t.tableConfig.colSizes)("paginationConfig",t.isExternal?null:t.tableConfig.pagination)("collapseAtRow",t.tableConfig.pagination.pageSize)("emptyText",e.lcZ(4,13,t.loading$)?"app.data-table.searching.text":null)("sortable",!0)("sortableColumns",t.isExternal?t.tableConfig.sortableColumns:null)("tableData",e.xi3(5,15,e.lcZ(6,18,t.results$),e.lcZ(7,20,t.queryParams$)))}}function yo(n,i){if(1&n&&(e.TgZ(0,"bis-card-section"),e._UZ(1,"person-results-error",26),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("error",t.error)}}function To(n,i){1&n&&(e.TgZ(0,"bis-card-section")(1,"bis-inline-alert",27),e._uU(2),e.ALo(3,"translate"),e.qZA()()),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"person.component.name-address.too-many-hits.text")," "))}function Ao(n,i){if(1&n&&e._UZ(0,"person-results-pagination",28),2&n){const t=i.ngIf,r=e.oxw();e.Q6J("next",t.searchAfter)("pageInfo",r.metaData)}}let So=(()=>{class n{constructor(t){this.route=t,this.entityType=$.y.PERSON,this.translationPrefix="person.component.name-address.",this.tableConfig={columns:["birth-date","tableName","tableAddr","tablePostCode","note"],columnsNoBirthDate:["identityNumber","tableName","tableAddr","tablePostCode","note"],pagination:{pageSize:100,pageIndex:0},sortableColumns:{tableName:!0,"birth-date":!0,tableAddr:!0,tablePostCode:!0},colSizes:[1,2,2,1,1,1],excelColumns:["identityNumber","tableName","birth-date","tableAddr","tablePostCode","tableCity","note"]},this.localFilters={birthDecades:(0,e.f3M)(nt),sex:(0,e.f3M)(rt),postalCity:(0,e.f3M)(ot),county:(0,e.f3M)(lt),municipality:(0,e.f3M)(ct),note:(0,e.f3M)(it),postcodeArea:(0,e.f3M)(st),calledName:(0,e.f3M)(at)}}set additionalColumns(t){var r,o,s;this.tableConfig.sortableColumns=Object.assign(Object.assign({},this.tableConfig.sortableColumns),null!==(r=null==t?void 0:t.sortableColumns)&&void 0!==r?r:{}),this.tableConfig.colSizes=null!==(o=null==t?void 0:t.colSizes)&&void 0!==o?o:this.tableConfig.colSizes,this.tableConfig.excelC
1olumns=null!==(s=null==t?void 0:t.excelColumns)&&void 0!==s?s:this.tableConfig.excelColumns;const l=(d,x)=>(null!=d?d:[]).forEach(h=>{x.splice(h.colNumber,0,h.colName)});l(null==t?void 0:t.columns,this.tableConfig.columns),l(null==t?void 0:t.columnsNoBirthDate,this.tableConfig.columnsNoBirthDate)}ngOnChanges(t){t.metaData&&this.setIsExternal(),this.queryParams$=this.route.queryParams}setIsExternal(){var t,r;const o=null===(t=this.metaData)||void 0===t?void 0:t.itemsPerPage,s=null===(r=this.metaData)||void 0===r?void 0:r.totalItems;this.isExternal=o&&o<s}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-results-table"]],inputs:{results$:"results$",loading$:"loading$",tooManyHits$:"tooManyHits$",error:"error",metaData:"metaData",additionalColumns:"additionalColumns"},features:[e._Bn([nt,rt,ot,it,st,at,lt,ct]),e.TTD],decls:26,vars:38,consts:[[1,"table-connector"],[1,"table-container"],[1,"report-selector","print-hide-important",3,"entityName","execId"],["bis-card","","app-card","",3,"showHeader","source"],[3,"isLoading"],["class","content__card-header",3,"ngClass","totalHits",4,"ngIf"],["class","content__card-toolbar",4,"ngIf"],[3,"desc","orderBy",4,"ngIf"],["filename","person-search",1,"content__card-toolbar",3,"translationPrefix","headers","data"],[4,"ngIf"],[3,"next","pageInfo",4,"ngIf"],[1,"filter-container"],[3,"loading$","filters"],[3,"filterServices"],[1,"content__card-header",3,"ngClass","totalHits"],[1,"content__card-toolbar"],[3,"desc","orderBy"],[3,"translationPrefix","columns","columnGrowthDefinition","paginationConfig","collapseAtRow","emptyText","sortable","sortableColumns","tableData"],[3,"ngSwitch"],["class","link",3,"routerLink",4,"ngSwitchCase"],[4,"ngSwitchCase"],["class","text-red-dark",4,"ngSwitchCase"],[3,"innerHTML",4,"ngSwitchDefault"],[1,"link",3,"routerLink"],[1,"text-red-dark"],[3,"innerHTML"],[3,"error"],["type","info",1,"hits-alert"],[3,"next","pageInfo"]],template:function(t,r){if(1&t&&(e.TgZ(0,"app-data-table-plugin-connector",0)(1,"div",1)(2,"report-selector",2),e.NdJ("execId",function(s){return r.execId=s}),e.qZA(),e.TgZ(3,"div",3),e.ALo(4,"async"),e._UZ(5,"app-loading-progress",4),e.ALo(6,"async"),e.YNc(7,po,1,4,"conn-data-table-results-information-plugin",5),e.ALo(8,"async"),e.ALo(9,"async"),e.YNc(10,uo,1,0,"conn-data-table-quick-search-filter-plugin",6),e.ALo(11,"async"),e.YNc(12,mo,1,2,"person-results-sorting",7),e._UZ(13,"conn-data-table-export-excel-button-plugin",8),e.ALo(14,"personResultTableTransform"),e.ALo(15,"async"),e.ALo(16,"async"),e.YNc(17,Co,9,22,"ng-container",9),e.ALo(18,"async"),e.YNc(19,yo,2,1,"bis-card-section",9),e.YNc(20,To,4,3,"bis-card-section",9),e.ALo(21,"async"),e.qZA(),e.YNc(22,Ao,1,2,"person-results-pagination",10),e.qZA(),e.TgZ(23,"div",11),e._UZ(24,"person-results-filter",12)(25,"person-results-local-filter",13),e.qZA()()),2&t){let o,s;e.xp6(2),e.Q6J("entityName",r.entityType),e.xp6(1),e.Q6J("showHeader",!r.error)("source",null!=(o=e.lcZ(4,17,r.results$))&&o.length?null==r.metaData?null:r.metaData._source:null),e.xp6(2),e.Q6J("isLoading",e.lcZ(6,19,r.loading$)),e.xp6(2),e.Q6J("ngIf",!e.lcZ(8,21,r.loading$)&&!e.lcZ(9,23,r.tooManyHits$)&&!r.error&&r.metaData),e.xp6(3),e.Q6J("ngIf",null==(s=e.lcZ(11,25,r.results$))?null:s.length),e.xp6(2),e.Q6J("ngIf",r.isExternal),e.xp6(1),e.s9C("translationPrefix",r.translationPrefix),e.Q6J("headers",r.tableConfig.excelColumns)("data",e.xi3(14,27,e.lcZ(15,30,r.results$),e.lcZ(16,32,r.queryParams$))),e.xp6(4),e.Q6J("ngIf",!e.lcZ(18,34,r.tooManyHits$)&&!r.error),e.xp6(2),e.Q6J("ngIf",r.error),e.xp6(1),e.Q6J("ngIf",e.lcZ(21,36,r.tooManyHits$)),e.xp6(2),e.Q6J("ngIf",null==r.metaData?null:r.metaData.next),e.xp6(2),e.Q6J("loading$",r.loading$)("filters",null==r.metaData?null:r.metaData.aggregations),e.xp6(1),e.Q6J("filterServices",r.localFilters)}},dependencies:function(){return[Zr.q,p.mk,p.O5,p.RF,p.n9,p.ED,c.H41,c.AD5,c.lIM,ce.A,k.E,Fr.Q,Or.x,Nr.Q,Lr.H,Mr.E,g.yS,jr,kr,ro,oo,so,ao.v,p.Ov,p.rS,b.X$,Re.v,Po,Zo]},styles:[".table-connector[_ngcontent-%COMP%]{display:flex;width:100%}.report-selector[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;height:1.5rem;margin-bottom:.5rem}.table-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-flow:column}.filter-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{display:block;width:210px;margin-left:1rem;margin-top:.5rem}.filter-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{margin-top:2rem}.hits-alert[_ngcontent-%COMP%]{white-space:pre-wrap}"]}),n})(),Po=(()=>
1{class n{constructor(t,r,o){this.namePipe=t,this.codePipe=r,this.translate=o,this.noPhoneNumberPlaceholder="-"}transform(t,r){return null==t?void 0:t.map(o=>{var s,l,d,x;const h=o.address,_=(null==h?void 0:h.registeredAddress)||(null==h?void 0:h.specialPostalAddress)||(null==h?void 0:h.contactAddress);return Object.assign(Object.assign({},o),{tableName:this.namePipe.transform(o.name,"edited"),tableAddr:this.buildAddress(_),tablePostCode:null==_?void 0:_.postCode,tableCity:null==_?void 0:_.postalCity,tablePhoneNumber:null!==(l=null===(s=o.phoneSubscriptions)||void 0===s?void 0:s.map(H=>H.number).join("<br/>"))&&void 0!==l?l:this.noPhoneNumberPlaceholder,note:this.buildNote(o,r),excelTableAddress:this.buildAddress(_)+" "+(null==_?void 0:_.postalCity),excelTablePhoneNumber:null!==(x=null===(d=o.phoneSubscriptions)||void 0===d?void 0:d.map(H=>H.number).join("\n "))&&void 0!==x?x:this.noPhoneNumberPlaceholder})})}buildAddress(t){return t&&[null==t?void 0:t.addressLine1,null==t?void 0:t.addressLine2,null==t?void 0:t.addressLine3].filter(r=>!!r).join(", ")}buildNote(t,r){var o,s;return[null===(s=this.codePipe.transform(null===(o=t.deregistration)||void 0===o?void 0:o.reasonCode,"deregistration"))||void 0===s?void 0:s.text,t.notes&&this.hasHistoricalMatch(t.notes)?this.translate.instant("person.component.name-address.historicalPost.text"):null,t.address&&this.hasNonRegisteredPostAddressMatch(t.address,r,"specialPostalAddress")?this.translate.instant("person.component.name-address.specialPostAddress.text"):null,t.address&&this.hasNonRegisteredPostAddressMatch(t.address,r,"contactAddress")?this.translate.instant("person.component.name-address.contactAddress.text"):null].filter(l=>!!l).join(", ")}hasHistoricalMatch(t){return!!t.deviations.find(o=>o.toLowerCase()==="HISTORICAL".toLowerCase())}hasNonRegisteredPostAddressMatch(t,r,o){var s,l,d,x,h,_;if(t.registeredAddress||!t[o])return!1;const H=null===(s=null==r?void 0:r.address)||void 0===s?void 0:s.toLowerCase(),vi=(null!==(d=null===(l=null==r?void 0:r.addressAndCity)||void 0===l?void 0:l.toLowerCase())&&void 0!==d?d:"").split(" "),Te=(Ae,bi)=>Ae&&(Ae.includes(bi)||vi.find(xi=>Ae.includes(xi))),te=t[o];return Te(null===(x=te.addressLine1)||void 0===x?void 0:x.toLowerCase(),H)||Te(null===(h=te.addressLine2)||void 0===h?void 0:h.toLowerCase(),H)||Te(te.postalCity,null===(_=null==r?void 0:r.postalCity)||void 0===_?void 0:_.toLowerCase())||te.postCode===(null==r?void 0:r.postCode)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(lo.u,16),e.Y36(X.h,16),e.Y36(b.sK,16))},n.\u0275pipe=e.Yjl({name:"personResultTableTransform",type:n,pure:!0}),n})(),Zo=(()=>{class n{transform(t){return!(null==t||!t.find(r=>{var o;return!(null===(o=null==r?void 0:r.birth)||void 0===o||!o.date)}))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=e.Yjl({name:"personResultsHasBirthDatesPipe",type:n,pure:!0}),n})(),vt=(()=>{class n{constructor(t,r,o){this.retrieverService=t,this.storeService=r,this.route=o}ngOnInit(){this.initLoading(),this.initResults(),this.initTooManyHits(),this.initMeta(),this.initError(),this.routeData$=this.route.data}initLoading(){this.loading$=this.storeService.selectActionState().pipe((0,f.U)(t=>null==t?void 0:t.isLoading))}initResults(){this.results$=this.retrieverService.retrieve()}initMeta(){this.meta$=this.storeService.selectMeta().pipe((0,M.h)(J.Fk))}initTooManyHits(){this.tooManyHits$=this.results$.pipe((0,f.U)(t=>null==t?void 0:t.length),(0,w.w)(t=>this.storeService.selectTotalItems().pipe((0,f.U)(r=>!t&&!!r))))}initError(){this.error$=this.storeService.selectError()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(tt),e.Y36(ge),e.Y36(g.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-results-container"]],decls:6,vars:12,consts:[["name","searchBoxOutlet"],[1,"results-content"],[1,"results-table",3,"loading$","results$","tooManyHits$","metaData","error","additionalColumns"]],template:function(t,r){if(1&t&&(e._UZ(0,"router-outlet",0),e.TgZ(1,"div",1),e._UZ(2,"person-results-table",2),e.ALo(3,"async"),e.ALo(4,"async"),e.ALo(5,"async"),e.qZA()),2&t){let o;e.xp6(2),e.Q6J("loading$",r.loading$)("results$",r.results$)("tooManyHits$",r.tooManyHits$)("metaData",e.lcZ(3,6,r.meta$))("error",e.lcZ(4,8,r.error$))("additionalColumns",null==(o=e.lcZ(5,10,r.routeData$))?null:o.resultsTableConfig)}},dependencies:[g.lC,So,p.Ov],styles:[".results-content[_ngcontent-%COMP%]{display:flex}.results-table[_ngcontent-%COMP%]{display:flex;width:100%}.results-filter[_ngcontent-%COMP%]{display:block;width:25%;margin-left:1rem}"]}),n})();const be=function(n){return{"tab--active":n}};
1function Fo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"li",2),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.activeTab="simple")}),e.TgZ(1,"span",3),e._uU(2),e.ALo(3,"translate"),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngClass",e.VKq(4,be,"simple"===t.activeTab)),e.xp6(1),e.hij(" ",e.lcZ(3,2,"person.search-form.easy.text")," ")}}function Oo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"person-identity-search-box",9),e.NdJ("submitEvent",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.dialogRef.close())}),e.qZA()}2&n&&e.Q6J("wrapWithCard",!1)("focusOnInit",!0)}function No(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"person-simple-search",10),e.NdJ("submitEvent",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.onSearchNameAndAddress(o))}),e.qZA()}}function Lo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"person-advanced-search",10),e.NdJ("submitEvent",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.onSearchNameAndAddress(o))}),e.qZA()}}const Mo=function(n){return[n]},Io=function(n){return{"u-margin-bottom-default":n}};let Ro=(()=>{class n{constructor(t,r){this.dialogRef=t,this.routingService=r,this.activeTab="lookup",this.permissions=I}onSearchNameAndAddress(t){this.routingService.navigateToResults("name-address",Object.assign({},(0,J.wK)(t))),this.dialogRef.close()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(c.zjC),e.Y36(D))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-search-modal"]],decls:18,vars:25,consts:[[1,"search-modal__header"],[1,"tabs","u-margin-x-default"],[1,"tab","u-cursor-pointer",3,"click"],[1,"tab__link",3,"ngClass"],["class","tab u-cursor-pointer",3,"click",4,"ngIf"],["icon","close",1,"close",3,"click"],[1,"u-margin-x-default",3,"ngClass"],[3,"wrapWithCard","focusOnInit","submitEvent",4,"ngIf"],[3,"submitEvent",4,"ngIf"],[3,"wrapWithCard","focusOnInit","submitEvent"],[3,"submitEvent"]],template:function(t,r){1&t&&(e.TgZ(0,"div",0)(1,"ul",1)(2,"li",2),e.NdJ("click",function(){return r.activeTab="lookup"}),e.TgZ(3,"span",3),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.YNc(6,Fo,4,6,"li",4),e.ALo(7,"async"),e.ALo(8,"accessRight"),e.TgZ(9,"li",2),e.NdJ("click",function(){return r.activeTab="advanced"}),e.TgZ(10,"span",3),e._uU(11),e.ALo(12,"translate"),e.qZA()()(),e.TgZ(13,"bis-icon",5),e.NdJ("click",function(){return r.dialogRef.close()}),e.qZA()(),e.TgZ(14,"div",6),e.YNc(15,Oo,1,2,"person-identity-search-box",7),e.YNc(16,No,1,0,"person-simple-search",8),e.YNc(17,Lo,1,0,"person-advanced-search",8),e.qZA()),2&t&&(e.xp6(3),e.Q6J("ngClass",e.VKq(17,be,"lookup"===r.activeTab)),e.xp6(1),e.hij(" ",e.lcZ(5,9,"person.search-form.lookup.text")," "),e.xp6(2),e.Q6J("ngIf",e.lcZ(7,11,e.lcZ(8,13,e.VKq(19,Mo,r.permissions.SPAR)))),e.xp6(4),e.Q6J("ngClass",e.VKq(21,be,"advanced"===r.activeTab)),e.xp6(1),e.hij(" ",e.lcZ(12,15,"person.search-form.advanced.text")," "),e.xp6(3),e.Q6J("ngClass",e.VKq(23,Io,"lookup"!==r.activeTab)),e.xp6(1),e.Q6J("ngIf","lookup"===r.activeTab),e.xp6(1),e.Q6J("ngIf","simple"===r.activeTab),e.xp6(1),e.Q6J("ngIf","advanced"===r.activeTab))},dependencies:[p.mk,p.O5,c.oJW,Ie,De,Qe,Ue,p.Ov,b.X$,je.V],styles:["[_nghost-%COMP%]{display:block}.search-modal__header[_ngcontent-%COMP%]{position:relative}@media only screen and (max-width: 767px){.search-modal__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start}}@media only screen and (max-width: 767px){.tabs[_ngcontent-%COMP%]{flex:1;min-width:0;margin-right:0;padding-right:.5rem}}.close[_ngcontent-%COMP%]{position:absolute;right:1rem;top:1rem;cursor:pointer;z-index:1}@media only screen and (max-width: 767px){.close[_ngcontent-%COMP%]{position:relative;flex-shrink:0;align-self:flex-start;top:auto;right:auto;margin-top:1rem;margin-right:1rem}}.tab[_ngcontent-%COMP%]{max-width:200px}"]}),n})();var wo=a(91942),Do=a(21839);const bt="personHeader",xt=()=>"singleton",Ct=(0,Q.H)({selectId:xt}),xe=(0,Ke.SW)("Person Header"),Jo=(0,ke.te)(xe,Ct);let yt=(()=>{class n extends qe.s{constructor(){super(...arguments),this.apiPath="/api/report-header/person-header"}buildRequestOptions(t){return this.requestOptionsFromParams(t)}}return n.\u0275fac=function(){let i;return function(r){return(i||(i=e.n5z(n)))(r||n)}}(),n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),Tt=(()=>{class n extends Do.j{constructor(t){super(),this.store=t,this.storeActions=xe}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(m.yh))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),Ce=(()=>{class n extends wo.Z{constructor(t){super(),this.store=t,this.featureName=bt,this.adapter=Ct,this.selectId=xt,this.init()}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(m.yh))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),Eo=(()=>{class n extends F.n{constructor(t,r){super(),this.actions$=t,this.dataService=r,this.storeActions=xe,this.init()}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(O.eX),e.LFG(yt))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var Bo=a(62685),Yo=a(52596),Ho=a(79116);const ye=n=>(0,ut.j)(n.label)||n.identifier||n.pristine;let Qo=(()=>{class n{constructor(t,r){this.headerActions=t,this.translate=r,this.conf={id:{format:Z.yf,item:{id:"id",position:"main",priority:100}},name:{format:Ho.K,item:{id:"name",position:"secondary",priority:100}},city:{format:o=>o,item:{id:"city",position:"secondary",priority:90}},sex:{format:ye,item:{id:"sex",position:"secondary",priority:80}},age:{format:o=>`${o} ${this.translate.instant("app.value.suffix.age.text")}`,item:{id:"age",position:"secondary",priority:70}},dereg:{format:ye,item:{id:"dereg",position:"tag",priority:100}},protected:{format:ye,item:{id:"protected",position:"tag",priority:90}}}}ngOnChanges(t){t.unformatted&&this.unformatted&&this.publishUnformattedValues(),t.formatted&&this.formatted&&this.publishFormattedValues()}
1publishUnformattedValues(){Object.keys(this.unformatted).forEach(t=>{const r=this.conf[t],o=this.unformatted[t];o&&this.headerActions.upsert(Object.assign(Object.assign({},r.item),{value:r.format(o)}))})}publishFormattedValues(){this.formatted.forEach(t=>this.headerActions.upsert(t))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Yo.lq),e.Y36(b.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-header-publisher"]],inputs:{unformatted:"unformatted",formatted:"formatted"},features:[e.TTD],decls:0,vars:0,template:function(t,r){},encapsulation:2}),n})();function Uo(n,i){1&n&&e._UZ(0,"person-header-publisher",1),2&n&&e.Q6J("unformatted",i.ngIf)}let Go=(()=>{class n{constructor(t){this.headerStore=t}ngOnInit(){this.initHeader()}initHeader(){this.header$=this.headerStore.selectData().pipe((0,M.h)(J.Fk),(0,f.U)(t=>{var r,o,s;return{id:t.identityNumber,name:t.name,city:null===(o=null===(r=t.address)||void 0===r?void 0:r.registeredAddress)||void 0===o?void 0:o.postalCity,age:t.age,dereg:null===(s=t.deregistration)||void 0===s?void 0:s.reasonCode,sex:t.sex,protected:this.getProtectedStatus(t)}}))}getProtectedStatus(t){const o=(t.protectedPersonalDataStatus||t.protectedNationalRegistration||{}).statusCode;return o&&"NOPRO"!==(null==o?void 0:o.identifier)&&"NOPRO"!==(null==o?void 0:o.pristine)?o:null}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Ce))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-content"]],decls:3,vars:3,consts:[[3,"unformatted",4,"ngIf"],[3,"unformatted"]],template:function(t,r){1&t&&(e._UZ(0,"report-container"),e.YNc(1,Uo,1,1,"person-header-publisher",0),e.ALo(2,"async")),2&t&&(e.xp6(1),e.Q6J("ngIf",e.lcZ(2,1,r.header$)))},dependencies:[Bo.N,p.O5,Qo,p.Ov],encapsulation:2}),n})();var jo=a(50457),$o=a(24351),Vo=a(62557),Ko=a(22529),ko=a(13103),qo=a(68466),zo=a(86194),Wo=a(21502),Xo=a(16347),ei=a(95577);let At=(()=>{class n{constructor(t,r,o){this.levelOfAssuranceService=t,this.personRouting=r,this.reportStoreService=o}canActivate(t,r){return(0,pt.of)(t.params.report).pipe((0,f.U)(o=>this.reportStoreService.selectById(o)),(0,ei.z)(o=>this.levelOfAssuranceService.watch(o,()=>this.personRouting.routeToLocation([r.url.split("?")[0]],r.root.queryParams))))}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(Wo.t),e.LFG(D),e.LFG(Xo.I))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var ti=a(42724);let St=(()=>{class n{constructor(t,r){this.storeService=t,this.actionService=r}canActivate(t,r){this.setIdAndClear(t.params.id);const o={personalIdentityNumber:this.currentId};return(0,ti.F)(()=>this.actionService.load(o),()=>this.storeService.selectActionState(),()=>this.actionService.clean(),()=>!0)}setIdAndClear(t){t!==this.currentId&&this.actionService.clean(),this.currentId=t}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(Ce),e.LFG(Tt))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),Pt=(()=>{class n{constructor(){this.guards=[qo.V,[At,St,zo.L]].map(t=>Array.isArray(t)?t.map(r=>(0,e.f3M)(r)):(0,e.f3M)(t))}canActivate(t,r){return(0,jo.D)(this.guards).pipe((0,$o.b)(o=>{const l=(Array.isArray(o)?o:[o]).map(d=>d.canActivate(t,r));return(0,Vo.$)(...l)}),(0,f.U)(o=>o.filter(s=>!0!==s)),(0,Ko.o)(o=>!o.length,!0),(0,f.U)(o=>{var s;return null===(s=o[0])||void 0===s||s}),(0,ko.Z)())}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})();var ni=a(84718),ri=a(87367),oi=a(3517),ii=a(63262);let si=(()=>{class n{constructor(){this.titleService=(0,e.f3M)(ii.y),this.reportUtilService=(0,e.f3M)(ri.Y),this.executableReportStore=(0,e.f3M)(oi.Ot)}canActivate(){return this.reportUtilService.selectCurrent().pipe((0,M.h)(t=>!!t&&void 0!==t.id),(0,w.w)(t=>this.executableReportStore.selectById(t.id)),(0,f.U)(t=>t.name),(0,ie.b)(t=>{this.titleService.addTitleEnding(t)}),(0,f.U)(()=>!0))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var ai=a(82805),li=a(63768);function ci(n,i){1&n&&e._UZ(0,"div",4)}function pi(n,i){if(1&n&&(e.ynx(0),e._UZ(1,"report-page-header",1)(2,"report-coordinator",2),e.YNc(3,ci,1,0,"div",3),e.BQk()),2&n){const t=i.$implicit,r=i.last;e.xp6(1),e.Q6J("pageHeaderOverride",t.headers),e.xp6(1),e.Q6J("report",t.report)("hasContainedReport",!0),e.xp6(1),e.Q6J("ngIf",!r)}}let ui=(()=>{class n{constructor(t,r,o,s,l,d){this.storeService=t,this.actionService=r,this.pdfService=o,this.route=s,this.router=l,this.location=d}ngOnInit(){this.initReport()}ngAfterContentInit(){(0,ai.H)(1e3).subscribe(()=>{this.pdfService.savePdf(),this.location.back()})}initReport(){this.visitedReports$=this.route.params.pipe((0,f.U)(t=>t.reports.split(",")),(0,M.h)(t=>!!t),(0,w.w)(t=>this.storeService.selectSome(t)),(0,y.q)(1))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(j.g3),e.Y36(j.wm),e.Y36(Fe.F),e.Y36(g.gz),e.Y36(g.F0),e.Y36(p.Ye))},n.\u0275cmp=e.Xpm({type:n,selectors:[["person-visited-pages-content"]],decls:2,vars:3,consts:[[4,"ngFor","ngForOf"],[3,"pageHeaderOverride"],[3,"report","hasContainedReport"],["class","page-break",4,"ngIf"],[1,"page-break"]],template:function(t,r){1&t&&(e.YNc(0,pi,4,4,"ng-container",0),e.ALo(1,"async")),2&t&&e.Q6J("ngForOf",e.lcZ(1,1,r.visitedReports$))},dependencies:[p.sg,p.O5,li.o,Oe.q,p.Ov],styles:[".button-arrow[_ngcontent-%COMP%]{border-left:1px solid #d1d3d7;margin-left:.5rem;padding-left:.5rem}"]}),n})();const di=[{path:"",component:on.C,canActivate:[Ne.c],data:Object.assign(Object.assign({},(0,V.C)("persons")),{outletConfig:{sideBarOutlet:{optionalModes:["quicksearch"]}}}),canActivateChild:[Ne.c,nn.h],resolve:{presLoaded:sn.C},children:[{path:"",children:[{path:"",component:an,outlet:"contentHeaderOutlet"},{path:"",component:br}]},{path:"report/person/:id",canActivate:[rn.V],data:Object.assign(Object.assign({},(0,V.C)("persons_report")),{defaultReportGuard:{entityName:$.y.PERSON}}),children:[{path:"",component:Oe.q,outlet:"headerOutlet"},{path:"",component:ae,outlet:"headerButtonsOutlet",data:{actionbar:{hideNewSearch:!0}}},{path:"",component:ni._,outlet:"sideBarOutlet",children:[{path:"",component:tn.T,data:{sideMenu:{searchModal:Ro,enableGroupToggle:!0}}}]},{path:":report",canActivate:[Pt,si],component:Go}]},{path:"visitedpages/person/:reports",data:{defaultReportGuard:{entityName:$.y.PERSON}},children:[{path:"",component:ui}]},{path:"results/name-address",data:(0,V.C)("persons_results_name-address"),children:[{path:"",component:le.T,outlet:"contentHeaderOutlet",data:{pageTitle:{title:"app.page-header.results.header"}}},{path:"",component:ae,data:{actionbar:{hideLatestPOI:!0}},outlet:"contentButtonsOutlet"},{path:"",component:vt,children:[{path:"",component:$e,outlet:"searchBoxOutlet"}]}]},{path:"results/phone-number",data:(0,V.C)("persons_results_name-address"),children:[{path:"",component:le.T,outlet:"contentHeaderOutlet",data:{pageTitle:{title:"app.page-header.results.header"}}},{path:"",component:ae,data:{actionbar:{hideLatestPOI:!0}},outlet:"contentButtonsOutlet"}
1,{path:"",component:vt,data:{resultsTableConfig:{columns:[{colName:"tablePhoneNumber",colNumber:2}],columnsNoBirthDate:[{colName:"tablePhoneNumber",colNumber:2}],sortableColumns:{tablePhoneNumber:!0},colSizes:[1,2,1,2,1],excelColumns:["identityNumber","tableName","excelTablePhoneNumber","excelTableAddress","note"]}},children:[{path:"",component:Ve,outlet:"searchBoxOutlet"}]}]}]}];let mi=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[g.Bz.forChild(di),g.Bz]}),n})(),hi=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[et,ge,_e,yt,Ce,Tt],imports:[m.Aw.forFeature(ze,Ar),m.Aw.forFeature(bt,Jo),O.sQ.forFeature([Sr,Eo])]}),n})();var gi=a(56233),_i=a(30748);let fi=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[D,tt,St,At,Pt],imports:[Ot.b,_i.c,p.ez,u.u5,u.UX,c.dTQ,c.ejP,c.hJ1,c.sxC,c.hLZ,c.z8t,c.nMh,c.Suy,c.kWm,c.pVY,Yt.m,wt.e,Rt.$,Dt.I,Bt.U,It.X,Jt.t,Et.$,Nt.i,Lt.d,we.w,Mt.q,Ft,gi.n,mi,hi]}),n})()},98810:(ne,N,a)=>{a.d(N,{t:()=>e});var p=a(69808),u=a(74202),m=a(90570),T=a(72071),A=a(65542);let e=(()=>{class S{}return S.\u0275fac=function(O){return new(O||S)},S.\u0275mod=A.oAB({type:S}),S.\u0275inj=A.cJS({imports:[p.ez,u.Bz,T.i,m.DUX,m.sxC]}),S})()},60390:(ne,N,a)=>{a.d(N,{n:()=>E});var p=a(74202),u=a(49892),m=a(77579),T=a(82722),A=a(39300),e=a(65542),S=a(69808),F=a(90570),O=a(18995);function re(C,B){if(1&C){const v=e.EpF();e.TgZ(0,"button",2),e.NdJ("click",function(){e.CHM(v);const Y=e.oxw();return e.KtG(Y.onLatestPOIClick())}),e._UZ(1,"bis-icon",3),e._uU(2),e.ALo(3,"translate"),e.qZA()}if(2&C){const v=e.oxw();e.xp6(2),e.hij(" ",e.lcZ(3,1,v.latestPOIButtonText)," ")}}function Q(C,B){if(1&C&&(e.TgZ(0,"a",4)(1,"button",5),e._UZ(2,"bis-icon",6),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&C){const v=e.oxw();e.Q6J("routerLink",v.newSearchLink),e.xp6(3),e.hij(" ",e.lcZ(4,2,"app.button.new-search.text")," ")}}const oe=["*"];let E=(()=>{class C{constructor(v,L,Y){this.historyService=v,this.router=L,this.route=Y,this.ngUnsubscribe=new m.x,this.hideLatestPOIButton=!1,this.latestPOIButtonText="app.button.back.text",this.showBackButton=!0}ngOnInit(){this.hideLatestPOIButton||(this.latestPOI=this.historyService.lastestPOI(),this.router.events.pipe((0,T.R)(this.ngUnsubscribe),(0,A.h)(v=>v instanceof p.m2)).subscribe(()=>{setTimeout(()=>{this.latestPOI=this.historyService.lastestPOI(),this.showBackButton=!this.isFromOldSection()},0)}))}isFromOldSection(){var v;return!(null!==(v=this.router.getCurrentNavigation())&&void 0!==v&&v.previousNavigation)}onLatestPOIClick(){this.latestPOI.route()}ngOnDestroy(){this.ngUnsubscribe.next(),this.ngUnsubscribe.unsubscribe()}}return C.\u0275fac=function(v){return new(v||C)(e.Y36(u.X),e.Y36(p.F0),e.Y36(p.gz))},C.\u0275cmp=e.Xpm({type:C,selectors:[["app-base-actionbar"]],inputs:{newSearchLink:"newSearchLink",hideLatestPOIButton:"hideLatestPOIButton"},ngContentSelectors:oe,decls:3,vars:2,consts:[["id","back-btn","bis-btn","","btn-type","secondary","small","true",3,"click",4,"ngIf"],["class","inverted",3,"routerLink",4,"ngIf"],["id","back-btn","bis-btn","","btn-type","secondary","small","true",3,"click"],["icon","left","element-type","btn","position","right"],[1,"inverted",3,"routerLink"],["id","new-search-button","bis-btn","","small","true"],["icon","search","element-type","btn","position","right"]],template:function(v,L){1&v&&(e.F$t(),e.Hsn(0),e.YNc(1,re,4,3,"button",0),e.YNc(2,Q,5,4,"a",1)),2&v&&(e.xp6(1),e.Q6J("ngIf",L.latestPOI&&L.showBackButton),e.xp6(1),e.Q6J("ngIf",L.newSearchLink))},dependencies:[S.O5,p.yS,F.oJW,F.Hq3,O.X$],encapsulation:2}),C})()},11423:(ne,N,a)=>{a.d(N,{v:()=>u});var p=a(65542);let u=(()=>{class m{transform(A,e=", "){return A?("string"==typeof A?[A]:A).map(F=>this.formatId(F)).join(e):null}formatId(A){const e=A.replace("-","");return e.substring(0,e.length-4)+"-"+e.substring(e.length-4)}}return m.\u0275fac=function(A){return new(A||m)},m.\u0275pipe=p.Yjl({name:"identityNr",type:m,pure:!0}),m})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.