UNPKG

@rero/rero-ils-ui

Version:

User interface for RERO integrated library system (RERO ILS).

1 lines 57.7 kB
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[838],{4838:(cn,k,l)=>{l.r(k),l.d(k,{MigrationModule:()=>ln});var S=l(1880),d=l(2203),y=l(1728),D=l(3400),_=l(5779),c=l(177),t=l(4438);function P(n,o){if(1&n&&(t.j41(0,"span",1),t.EFF(1),t.k0s()),2&n){const e=t.XpG();t.HbH(e.styleClass),t.Y8G("ngClass",e.containerClass())("ngStyle",e.style),t.R7$(),t.JRh(e.value)}}let x=(()=>{class n{styleClass;style;badgeSize;severity;value;badgeDisabled=!1;set size(e){this._size=e,console.warn("size property is deprecated and will removed in v18, use badgeSize instead.")}get size(){return this._size}_size;containerClass(){return{"p-badge p-component":!0,"p-badge-no-gutter":null!=this.value&&1===String(this.value).length,"p-badge-lg":"large"===this.badgeSize||"large"===this.size,"p-badge-xl":"xlarge"===this.badgeSize||"xlarge"===this.size,[`p-badge-${this.severity}`]:this.severity}}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=t.VBU({type:n,selectors:[["p-badge"]],hostAttrs:[1,"p-element"],inputs:{styleClass:"styleClass",style:"style",badgeSize:"badgeSize",severity:"severity",value:"value",badgeDisabled:[t.Mj6.HasDecoratorInputTransform,"badgeDisabled","badgeDisabled",t.L39],size:"size"},features:[t.GFd],decls:1,vars:1,consts:[[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"]],template:function(i,a){1&i&&t.DNE(0,P,2,5,"span",0),2&i&&t.Y8G("ngIf",!a.badgeDisabled)},dependencies:[c.YU,c.bT,c.B3],styles:["@layer primeng{.p-badge{display:inline-block;border-radius:10px;text-align:center;padding:0 .5rem}.p-overlay-badge{position:relative}.p-overlay-badge .p-badge{position:absolute;top:0;right:0;transform:translate(50%,-50%);transform-origin:100% 0;margin:0}.p-badge-dot{width:.5rem;min-width:.5rem;height:.5rem;border-radius:50%;padding:0}.p-badge-no-gutter{padding:0;border-radius:50%}}\n"],encapsulation:2,changeDetection:0})}return n})(),H=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=t.$C({type:n});static \u0275inj=t.G2t({imports:[c.MD,_.Gg]})}return n})();var b=l(1141),v=l(1512);const L=[[["","pInplaceDisplay",""]],[["","pInplaceContent",""]]],U=["[pInplaceDisplay]","[pInplaceContent]"],Q=n=>({"p-inplace p-component":!0,"p-inplace-closable":n}),W=n=>({"p-disabled":n});function Z(n,o){1&n&&t.eu8(0)}function J(n,o){if(1&n){const e=t.RV6();t.j41(0,"div",3),t.bIt("click",function(a){t.eBV(e);const s=t.XpG();return t.Njj(s.onActivateClick(a))})("keydown",function(a){t.eBV(e);const s=t.XpG();return t.Njj(s.onKeydown(a))}),t.SdG(1),t.DNE(2,Z,1,0,"ng-container",4),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("ngClass",t.eq3(2,W,e.disabled)),t.R7$(2),t.Y8G("ngTemplateOutlet",e.displayTemplate)}}function q(n,o){1&n&&t.eu8(0)}function K(n,o){if(1&n){const e=t.RV6();t.j41(0,"button",9),t.bIt("click",function(a){t.eBV(e);const s=t.XpG(3);return t.Njj(s.onDeactivateClick(a))}),t.k0s()}if(2&n){const e=t.XpG(3);t.Y8G("icon",e.closeIcon),t.BMQ("aria-label",e.closeAriaLabel)}}function tt(n,o){1&n&&t.nrm(0,"TimesIcon")}function et(n,o){}function nt(n,o){1&n&&t.DNE(0,et,0,0,"ng-template")}function it(n,o){if(1&n){const e=t.RV6();t.j41(0,"button",10),t.bIt("click",function(a){t.eBV(e);const s=t.XpG(3);return t.Njj(s.onDeactivateClick(a))}),t.DNE(1,tt,1,0,"TimesIcon",6)(2,nt,1,0,null,4),t.k0s()}if(2&n){const e=t.XpG(3);t.Y8G("ngClass","p-button-icon-only"),t.BMQ("aria-label",e.closeAriaLabel),t.R7$(),t.Y8G("ngIf",!e.closeIconTemplate),t.R7$(),t.Y8G("ngTemplateOutlet",e.closeIconTemplate)}}function at(n,o){if(1&n&&(t.qex(0),t.DNE(1,K,1,2,"button",7)(2,it,3,4,"button",8),t.bVm()),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("ngIf",e.closeIcon),t.R7$(),t.Y8G("ngIf",!e.closeIcon)}}function ot(n,o){if(1&n&&(t.j41(0,"div",5),t.SdG(1,1),t.DNE(2,q,1,0,"ng-container",4)(3,at,3,2,"ng-container",6),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.Y8G("ngTemplateOutlet",e.contentTemplate),t.R7$(),t.Y8G("ngIf",e.closable)}}let st=(()=>{class n{cd;active=!1;closable=!1;disabled=!1;preventClick;style;styleClass;closeIcon;closeAriaLabel;onActivate=new t.bkB;onDeactivate=new t.bkB;templates;hover;displayTemplate;contentTemplate;closeIconTemplate;constructor(e){this.cd=e}ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"display":this.displayTemplate=e.template;break;case"closeicon":this.closeIconTemplate=e.template;break;case"content":this.contentTemplate=e.template}})}onActivateClick(e){this.preventClick||this.activate(e)}onDeactivateClick(e){this.preventClick||this.deactivate(e)}activate(e){this.disabled||(this.active=!0,this.onActivate.emit(e),this.cd.markForCheck())}deactivate(e){this.disabled||(this.active=!1,this.hover=!1,this.onDeactivate.emit(e),this.cd.markForCheck())}onKeydown(e){"Enter"===e.code&&(this.activate(e),e.preventDefault())}static \u0275fac=function(i){return new(i||n)(t.rXU(t.gRc))};static \u0275cmp=t.VBU({type:n,selectors:[["p-inplace"]],contentQueries:function(i,a,s){if(1&i&&t.wni(s,_.Ei,4),2&i){let r;t.mGM(r=t.lsd())&&(a.templates=r)}},hostAttrs:[1,"p-element"],inputs:{active:[t.Mj6.HasDecoratorInputTransform,"active","active",t.L39],closable:[t.Mj6.HasDecoratorInputTransform,"closable","closable",t.L39],disabled:[t.Mj6.HasDecoratorInputTransform,"disabled","disabled",t.L39],preventClick:[t.Mj6.HasDecoratorInputTransform,"preventClick","preventClick",t.L39],style:"style",styleClass:"styleClass",closeIcon:"closeIcon",closeAriaLabel:"closeAriaLabel"},outputs:{onActivate:"onActivate",onDeactivate:"onDeactivate"},features:[t.GFd],ngContentSelectors:U,decls:3,vars:9,consts:[[3,"ngClass","ngStyle"],["class","p-inplace-display","tabindex","0","role","button",3,"ngClass","click","keydown",4,"ngIf"],["class","p-inplace-content",4,"ngIf"],["tabindex","0","role","button",1,"p-inplace-display",3,"click","keydown","ngClass"],[4,"ngTemplateOutlet"],[1,"p-inplace-content"],[4,"ngIf"],["type","button","pButton","",3,"icon","click",4,"ngIf"],["type","button","pButton","",3,"ngClass","click",4,"ngIf"],["type","button","pButton","",3,"click","icon"],["type","button","pButton","",3,"click","ngClass"]],template:function(i,a){1&i&&(t.NAR(L),t.j41(0,"div",0),t.DNE(1,J,3,4,"div",1)(2,ot,4,2,"div",2),t.k0s()),2&i&&(t.HbH(a.styleClass),t.Y8G("ngClass",t.eq3(7,Q,a.closable))("ngStyle",a.style),t.BMQ("aria-live","polite"),t.R7$(),t.Y8G("ngIf",!a.active),t.R7$(),t.Y8G("ngIf",a.active))},dependencies:()=>[c.YU,c.bT,c.T3,c.B3,b._f,v.A],styles:["@layer primeng{.p-inplace .p-inplace-display{display:inline;cursor:pointer}.p-inplace .p-inplace-content{display:inline}.p-fluid .p-inplace.p-inplace-closable .p-inplace-content{display:flex}.p-fluid .p-inplace.p-inplace-closable .p-inplace-content>.p-inputtext{flex:1 1 auto;width:1%}}\n"],encapsulation:2,changeDetection:0})}return n})(),rt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=t.$C({type:n});static \u0275inj=t.G2t({imports:[c.MD,b.tm,_.Gg,v.A,b.tm,_.Gg]})}return n})();var T=l(2609),j=l(8490),m=l(9969),F=l(3306),G=l(9329),$=l(1962),R=l(2816),w=l(563),f=l(4420);const E=["container"],lt=n=>[n,"p-toast-message"],ct=(n,o,e,i)=>({showTransformParams:n,hideTransformParams:o,showTransitionParams:e,hideTransitionParams:i}),dt=n=>({value:"visible",params:n}),pt=(n,o)=>({$implicit:n,closeFn:o}),_t=n=>({$implicit:n});function mt(n,o){1&n&&t.eu8(0)}function ut(n,o){if(1&n&&(t.qex(0),t.DNE(1,mt,1,0,"ng-container",4),t.bVm()),2&n){const e=t.XpG();t.R7$(),t.Y8G("ngTemplateOutlet",e.headlessTemplate)("ngTemplateOutletContext",t.l_i(2,pt,e.message,e.onCloseIconClick))}}function gt(n,o){if(1&n&&t.nrm(0,"span"),2&n){const e=t.XpG(3);t.HbH("p-toast-message-icon pi "+e.message.icon)}}function ht(n,o){1&n&&t.nrm(0,"CheckIcon"),2&n&&t.BMQ("aria-hidden",!0)("data-pc-section","icon")}function ft(n,o){1&n&&t.nrm(0,"InfoCircleIcon"),2&n&&t.BMQ("aria-hidden",!0)("data-pc-section","icon")}function Ct(n,o){1&n&&t.nrm(0,"TimesCircleIcon"),2&n&&t.BMQ("aria-hidden",!0)("data-pc-section","icon")}function bt(n,o){1&n&&t.nrm(0,"ExclamationTriangleIcon"),2&n&&t.BMQ("aria-hidden",!0)("data-pc-section","icon")}function vt(n,o){if(1&n&&(t.j41(0,"span",13),t.qex(1),t.DNE(2,ht,1,2,"CheckIcon",6)(3,ft,1,2,"InfoCircleIcon",6)(4,Ct,1,2,"TimesCircleIcon",6)(5,bt,1,2,"ExclamationTriangleIcon",6),t.bVm(),t.k0s()),2&n){const e=t.XpG(3);t.BMQ("aria-hidden",!0)("data-pc-section","icon"),t.R7$(2),t.Y8G("ngIf","success"===e.message.severity),t.R7$(),t.Y8G("ngIf","info"===e.message.severity),t.R7$(),t.Y8G("ngIf","error"===e.message.severity),t.R7$(),t.Y8G("ngIf","warn"===e.message.severity)}}function yt(n,o){if(1&n&&(t.qex(0),t.DNE(1,gt,1,2,"span",8)(2,vt,6,6,"span",9),t.j41(3,"div",10)(4,"div",11),t.EFF(5),t.k0s(),t.j41(6,"div",12),t.EFF(7),t.k0s()(),t.bVm()),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("ngIf",e.message.icon),t.R7$(),t.Y8G("ngIf",!e.message.icon),t.R7$(),t.BMQ("data-pc-section","text"),t.R7$(),t.BMQ("data-pc-section","summary"),t.R7$(),t.JRh(e.message.summary),t.R7$(),t.BMQ("data-pc-section","detail"),t.R7$(),t.JRh(e.message.detail)}}function xt(n,o){1&n&&t.eu8(0)}function Tt(n,o){if(1&n&&t.nrm(0,"span"),2&n){const e=t.XpG(3);t.HbH("pt-1 text-base p-toast-message-icon pi "+e.message.closeIcon)}}function Mt(n,o){1&n&&t.nrm(0,"TimesIcon",16),2&n&&(t.Y8G("styleClass","p-toast-icon-close-icon"),t.BMQ("aria-hidden",!0)("data-pc-section","closeicon"))}function It(n,o){if(1&n){const e=t.RV6();t.j41(0,"button",14),t.bIt("click",function(a){t.eBV(e);const s=t.XpG(2);return t.Njj(s.onCloseIconClick(a))})("keydown.enter",function(a){t.eBV(e);const s=t.XpG(2);return t.Njj(s.onCloseIconClick(a))}),t.DNE(1,Tt,1,2,"span",8)(2,Mt,1,3,"TimesIcon",15),t.k0s()}if(2&n){const e=t.XpG(2);t.BMQ("aria-label",e.closeAriaLabel)("data-pc-section","closebutton"),t.R7$(),t.Y8G("ngIf",e.message.closeIcon),t.R7$(),t.Y8G("ngIf",!e.message.closeIcon)}}function kt(n,o){if(1&n&&(t.j41(0,"div",5),t.DNE(1,yt,8,7,"ng-container",6)(2,xt,1,0,"ng-container",4)(3,It,3,4,"button",7),t.k0s()),2&n){const e=t.XpG();t.Y8G("ngClass",null==e.message?null:e.message.contentStyleClass),t.BMQ("data-pc-section","content"),t.R7$(),t.Y8G("ngIf",!e.template),t.R7$(),t.Y8G("ngTemplateOutlet",e.template)("ngTemplateOutletContext",t.eq3(6,_t,e.message)),t.R7$(),t.Y8G("ngIf",!1!==(null==e.message?null:e.message.closable))}}function St(n,o){if(1&n){const e=t.RV6();t.j41(0,"p-toastItem",3),t.bIt("onClose",function(a){t.eBV(e);const s=t.XpG();return t.Njj(s.onMessageClose(a))})("@toastAnimation.start",function(a){t.eBV(e);const s=t.XpG();return t.Njj(s.onAnimationStart(a))})("@toastAnimation.done",function(a){t.eBV(e);const s=t.XpG();return t.Njj(s.onAnimationEnd(a))}),t.k0s()}if(2&n){const e=o.$implicit,i=o.index,a=t.XpG();t.Y8G("message",e)("index",i)("life",a.life)("template",a.template)("headlessTemplate",a.headlessTemplate)("@toastAnimation",void 0)("showTransformOptions",a.showTransformOptions)("hideTransformOptions",a.hideTransformOptions)("showTransitionOptions",a.showTransitionOptions)("hideTransitionOptions",a.hideTransitionOptions)}}let Dt=(()=>{class n{zone;config;message;index;life;template;headlessTemplate;showTransformOptions;hideTransformOptions;showTransitionOptions;hideTransitionOptions;onClose=new t.bkB;containerViewChild;timeout;constructor(e,i){this.zone=e,this.config=i}ngAfterViewInit(){this.initTimeout()}initTimeout(){this.message?.sticky||this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>{this.onClose.emit({index:this.index,message:this.message})},this.message?.life||this.life||3e3)})}clearTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}onMouseEnter(){this.clearTimeout()}onMouseLeave(){this.initTimeout()}onCloseIconClick=e=>{this.clearTimeout(),this.onClose.emit({index:this.index,message:this.message}),e.preventDefault()};get closeAriaLabel(){return this.config.translation.aria?this.config.translation.aria.close:void 0}ngOnDestroy(){this.clearTimeout()}static \u0275fac=function(i){return new(i||n)(t.rXU(t.SKi),t.rXU(_.r1))};static \u0275cmp=t.VBU({type:n,selectors:[["p-toastItem"]],viewQuery:function(i,a){if(1&i&&t.GBs(E,5),2&i){let s;t.mGM(s=t.lsd())&&(a.containerViewChild=s.first)}},hostAttrs:[1,"p-element"],inputs:{message:"message",index:[t.Mj6.HasDecoratorInputTransform,"index","index",t.Udg],life:[t.Mj6.HasDecoratorInputTransform,"life","life",t.Udg],template:"template",headlessTemplate:"headlessTemplate",showTransformOptions:"showTransformOptions",hideTransformOptions:"hideTransformOptions",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions"},outputs:{onClose:"onClose"},features:[t.GFd],decls:5,vars:18,consts:[["container",""],["notHeadless",""],["role","alert","aria-live","assertive","aria-atomic","true",3,"mouseenter","mouseleave","ngClass"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-toast-message-content",3,"ngClass"],[4,"ngIf"],["type","button","class","p-toast-icon-close p-link","pRipple","",3,"click","keydown.enter",4,"ngIf"],[3,"class",4,"ngIf"],["class","p-toast-message-icon",4,"ngIf"],[1,"p-toast-message-text"],[1,"p-toast-summary"],[1,"p-toast-detail"],[1,"p-toast-message-icon"],["type","button","pRipple","",1,"p-toast-icon-close","p-link",3,"click","keydown.enter"],[3,"styleClass",4,"ngIf"],[3,"styleClass"]],template:function(i,a){if(1&i){const s=t.RV6();t.j41(0,"div",2,0),t.bIt("mouseenter",function(){return t.eBV(s),t.Njj(a.onMouseEnter())})("mouseleave",function(){return t.eBV(s),t.Njj(a.onMouseLeave())}),t.DNE(2,ut,2,5,"ng-container",3)(3,kt,4,8,"ng-template",null,1,t.C5r),t.k0s()}if(2&i){const s=t.sdS(4);t.HbH(null==a.message?null:a.message.styleClass),t.Y8G("ngClass",t.eq3(9,lt,"p-toast-message-"+(null==a.message?null:a.message.severity)))("@messageState",t.eq3(16,dt,t.ziG(11,ct,a.showTransformOptions,a.hideTransformOptions,a.showTransitionOptions,a.hideTransitionOptions))),t.BMQ("id",null==a.message?null:a.message.id)("data-pc-name","toast")("data-pc-section","root"),t.R7$(2),t.Y8G("ngIf",a.headlessTemplate)("ngIfElse",s)}},dependencies:()=>[c.YU,c.bT,c.T3,w.n,F.S,$.e,R.I,G.P,v.A],encapsulation:2,data:{animation:[(0,m.hZ)("messageState",[(0,m.wk)("visible",(0,m.iF)({transform:"translateY(0)",opacity:1})),(0,m.kY)("void => *",[(0,m.iF)({transform:"{{showTransformParams}}",opacity:0}),(0,m.i0)("{{showTransitionParams}}")]),(0,m.kY)("* => void",[(0,m.i0)("{{hideTransitionParams}}",(0,m.iF)({height:0,opacity:0,transform:"{{hideTransformParams}}"}))])])]},changeDetection:0})}return n})(),jt=(()=>{class n{document;renderer;messageService;cd;config;key;autoZIndex=!0;baseZIndex=0;life=3e3;style;styleClass;get position(){return this._position}set position(e){this._position=e,this.cd.markForCheck()}preventOpenDuplicates=!1;preventDuplicates=!1;showTransformOptions="translateY(100%)";hideTransformOptions="translateY(-100%)";showTransitionOptions="300ms ease-out";hideTransitionOptions="250ms ease-in";breakpoints;onClose=new t.bkB;containerViewChild;templates;messageSubscription;clearSubscription;messages;messagesArchieve;template;headlessTemplate;_position="top-right";constructor(e,i,a,s,r){this.document=e,this.renderer=i,this.messageService=a,this.cd=s,this.config=r}styleElement;id=(0,f._Y)();ngOnInit(){this.messageSubscription=this.messageService.messageObserver.subscribe(e=>{if(e)if(Array.isArray(e)){const i=e.filter(a=>this.canAdd(a));this.add(i)}else this.canAdd(e)&&this.add([e])}),this.clearSubscription=this.messageService.clearObserver.subscribe(e=>{e?this.key===e&&(this.messages=null):this.messages=null,this.cd.markForCheck()})}ngAfterViewInit(){this.breakpoints&&this.createStyle()}add(e){this.messages=this.messages?[...this.messages,...e]:[...e],this.preventDuplicates&&(this.messagesArchieve=this.messagesArchieve?[...this.messagesArchieve,...e]:[...e]),this.cd.markForCheck()}canAdd(e){let i=this.key===e.key;return i&&this.preventOpenDuplicates&&(i=!this.containsMessage(this.messages,e)),i&&this.preventDuplicates&&(i=!this.containsMessage(this.messagesArchieve,e)),i}containsMessage(e,i){return!!e&&null!=e.find(a=>a.summary===i.summary&&a.detail==i.detail&&a.severity===i.severity)}ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"message":default:this.template=e.template;break;case"headless":this.headlessTemplate=e.template}})}onMessageClose(e){this.messages?.splice(e.index,1),this.onClose.emit({message:e.message}),this.cd.detectChanges()}onAnimationStart(e){"void"===e.fromState&&(this.renderer.setAttribute(this.containerViewChild?.nativeElement,this.id,""),this.autoZIndex&&""===this.containerViewChild?.nativeElement.style.zIndex&&f.Q$.set("modal",this.containerViewChild?.nativeElement,this.baseZIndex||this.config.zIndex.modal))}onAnimationEnd(e){"void"===e.toState&&this.autoZIndex&&f.BF.isEmpty(this.messages)&&f.Q$.clear(this.containerViewChild?.nativeElement)}createStyle(){if(!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",this.renderer.appendChild(this.document.head,this.styleElement);let e="";for(let i in this.breakpoints){let a="";for(let s in this.breakpoints[i])a+=s+":"+this.breakpoints[i][s]+" !important;";e+=`\n @media screen and (max-width: ${i}) {\n .p-toast[${this.id}] {\n ${a}\n }\n }\n `}this.renderer.setProperty(this.styleElement,"innerHTML",e)}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngOnDestroy(){this.messageSubscription&&this.messageSubscription.unsubscribe(),this.containerViewChild&&this.autoZIndex&&f.Q$.clear(this.containerViewChild.nativeElement),this.clearSubscription&&this.clearSubscription.unsubscribe(),this.destroyStyle()}static \u0275fac=function(i){return new(i||n)(t.rXU(c.qQ),t.rXU(t.sFG),t.rXU(_.bg),t.rXU(t.gRc),t.rXU(_.r1))};static \u0275cmp=t.VBU({type:n,selectors:[["p-toast"]],contentQueries:function(i,a,s){if(1&i&&t.wni(s,_.Ei,4),2&i){let r;t.mGM(r=t.lsd())&&(a.templates=r)}},viewQuery:function(i,a){if(1&i&&t.GBs(E,5),2&i){let s;t.mGM(s=t.lsd())&&(a.containerViewChild=s.first)}},hostAttrs:[1,"p-element"],inputs:{key:"key",autoZIndex:[t.Mj6.HasDecoratorInputTransform,"autoZIndex","autoZIndex",t.L39],baseZIndex:[t.Mj6.HasDecoratorInputTransform,"baseZIndex","baseZIndex",t.Udg],life:[t.Mj6.HasDecoratorInputTransform,"life","life",t.Udg],style:"style",styleClass:"styleClass",position:"position",preventOpenDuplicates:[t.Mj6.HasDecoratorInputTransform,"preventOpenDuplicates","preventOpenDuplicates",t.L39],preventDuplicates:[t.Mj6.HasDecoratorInputTransform,"preventDuplicates","preventDuplicates",t.L39],showTransformOptions:"showTransformOptions",hideTransformOptions:"hideTransformOptions",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",breakpoints:"breakpoints"},outputs:{onClose:"onClose"},features:[t.GFd],decls:3,vars:5,consts:[["container",""],[1,"p-toast","p-component",3,"ngClass","ngStyle"],[3,"message","index","life","template","headlessTemplate","showTransformOptions","hideTransformOptions","showTransitionOptions","hideTransitionOptions","onClose",4,"ngFor","ngForOf"],[3,"onClose","message","index","life","template","headlessTemplate","showTransformOptions","hideTransformOptions","showTransitionOptions","hideTransitionOptions"]],template:function(i,a){1&i&&(t.j41(0,"div",1,0),t.DNE(2,St,1,10,"p-toastItem",2),t.k0s()),2&i&&(t.HbH(a.styleClass),t.Y8G("ngClass","p-toast-"+a._position)("ngStyle",a.style),t.R7$(2),t.Y8G("ngForOf",a.messages))},dependencies:[c.YU,c.Sq,c.B3,Dt],styles:["@layer primeng{.p-toast{position:fixed;width:25rem}.p-toast-message{overflow:hidden}.p-toast-message-content{display:flex;align-items:flex-start}.p-toast-message-text{flex:1 1 auto}.p-toast-top-right{top:20px;right:20px}.p-toast-top-left{top:20px;left:20px}.p-toast-bottom-left{bottom:20px;left:20px}.p-toast-bottom-right{bottom:20px;right:20px}.p-toast-top-center{top:20px;left:50%;transform:translate(-50%)}.p-toast-bottom-center{bottom:20px;left:50%;transform:translate(-50%)}.p-toast-center{left:50%;top:50%;min-width:20vw;transform:translate(-50%,-50%)}.p-toast-icon-close{display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative;flex:none}.p-toast-icon-close.p-link{cursor:pointer}}\n"],encapsulation:2,data:{animation:[(0,m.hZ)("toastAnimation",[(0,m.kY)(":enter, :leave",[(0,m.P)("@*",(0,m.MA)())])])]},changeDetection:0})}return n})(),Ft=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=t.$C({type:n});static \u0275inj=t.G2t({imports:[c.MD,w.Z,F.S,$.e,R.I,G.P,v.A,_.Gg]})}return n})();var p=l(52),g=l(6688),h=l(7673),u=l(3955);const Gt=n=>[n],$t=n=>({migration:n});function Rt(n,o){if(1&n&&(t.EFF(0),t.nI1(1,"mainTitle")),2&n){const e=t.XpG(2);t.SpI("\n",t.bMT(1,1,e.record.metadata.conversion.json.title),"\n")}}function wt(n,o){if(1&n&&(t.j41(0,"h5")(1,"a",0),t.EFF(2),t.nrm(3,"p-badge",1),t.nI1(4,"translate"),t.k0s()(),t.DNE(5,Rt,2,3),t.j41(6,"div")(7,"i")(8,"small")(9,"span",2),t.EFF(10,"Modification date"),t.k0s(),t.EFF(11),t.nI1(12,"dateTranslate"),t.k0s()()()),2&n){const e=t.XpG();t.R7$(),t.Y8G("routerLink",t.eq3(13,Gt,e.detailUrl.link))("queryParams",t.eq3(15,$t,e.record.metadata.migration_id)),t.R7$(),t.Lme("",e.record.id," ",e.status," \xa0"),t.R7$(),t.Y8G("severity","complete"===e.status?"success":e.status.endsWith("error")?"danger":"secondary")("value",t.bMT(4,8,e.record.metadata.conversion.status)),t.R7$(2),t.vxM(5,null!=e.record&&null!=e.record.metadata&&null!=e.record.metadata.conversion&&null!=e.record.metadata.conversion.json&&e.record.metadata.conversion.json.title?5:-1),t.R7$(6),t.SpI("\xa0",t.i5U(12,10,null==e.record||null==e.record.metadata?null:e.record.metadata.updated_at,"medium"),"")}}let Et=(()=>{class n{get status(){return this.record?.metadata?.conversion?.status}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["admin-migration-data"]],inputs:{record:"record",detailUrl:"detailUrl"},decls:1,vars:1,consts:[[3,"routerLink","queryParams"],[3,"severity","value"],["translate",""]],template:function(i,a){1&i&&t.DNE(0,wt,13,17),2&i&&t.vxM(0,a.record?0:-1)},dependencies:[p.Wk,x,u.Mm,y.kE,u.D9,d.X1],encapsulation:2})}return n})();const Bt=()=>["..","format","migration_data"],B=n=>({migration:n}),Xt=()=>["..","deduplication","migration_data"];function Ot(n,o){if(1&n&&(t.j41(0,"div")(1,"p"),t.EFF(2),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.record.metadata.description," ")}}function Nt(n,o){if(1&n&&(t.j41(0,"div",0)(1,"div")(2,"h5"),t.EFF(3),t.nrm(4,"p-badge",1),t.k0s(),t.DNE(5,Ot,3,1,"div"),t.k0s(),t.j41(6,"div")(7,"a",2),t.EFF(8,"Data conversion"),t.k0s(),t.j41(9,"a",3),t.EFF(10,"Deduplication"),t.k0s()()()),2&n){const e=t.XpG();t.R7$(3),t.SpI(" ",e.record.metadata.name," "),t.R7$(),t.Y8G("value",e.record.metadata.status),t.R7$(),t.vxM(5,null!=e.record.metadata&&e.record.metadata.description?5:-1),t.R7$(2),t.Y8G("routerLink",t.lJ4(7,Bt))("queryParams",t.eq3(8,B,e.record.id)),t.R7$(2),t.Y8G("routerLink",t.lJ4(10,Xt))("queryParams",t.eq3(11,B,e.record.id))}}let At=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["admin-migration"]],inputs:{record:"record"},decls:1,vars:1,consts:[[1,"flex","w-100","justify-content-between"],[3,"value"],["translate","",1,"p-button","p-button-sm","mr-2",3,"routerLink","queryParams"],["translate","",1,"p-button","p-button-sm",3,"routerLink","queryParams"]],template:function(i,a){1&i&&t.DNE(0,Nt,11,13,"div",0),2&i&&t.vxM(0,a.record?0:-1)},dependencies:[p.Wk,x,u.Mm],encapsulation:2})}return n})();var Yt=l(1626);function O(n,o){const e=!o?.manualCleanup;e&&!o?.injector&&(0,t.Af3)(O);const i=e?o?.injector?.get(t.abz)??(0,t.WQX)(t.abz):null;let a;a=(0,t.vPA)(o?.requireSync?{kind:0}:{kind:1,value:o?.initialValue});const s=n.subscribe({next:r=>a.set({kind:1,value:r}),error:r=>{if(o?.rejectErrors)throw r;a.set({kind:2,error:r})}});return i?.onDestroy(s.unsubscribe.bind(s)),(0,t.EWP)(()=>{const r=a();switch(r.kind){case 1:return r.value;case 2:throw r.error;case 0:throw new t.wOt(601,"`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.")}})}var Pt=l(5558),Ht=l(345);let Lt=(()=>{class n{constructor(){this.sanitizer=(0,t.WQX)(Ht.up)}transform(e){if(null==e)return;let i=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(?:\r\n|\r|\n)/g,"<br>").replace(/( )/g,"&thinsp;");return i=i.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,s=>{let r="text-gray-600";return/^"/.test(s)?r=/:$/.test(s)?"text-cyan-600":"text-orange-600":(/true|false/.test(s)||/null/.test(s))&&(r="text-blue-600"),`<span class="${r}">${s}</span>`}),this.sanitizer.bypassSecurityTrustHtml(i)}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275pipe=t.EJ8({name:"highlightJson",type:n,pure:!0})}return n})();function Ut(n,o){if(1&n&&t.nrm(0,"p-messages",2),2&n){const e=t.XpG(2);t.Y8G("escape",!1)("value",e.messages())("enableService",!1)("closable",!1)}}function Qt(n,o){if(1&n&&(t.j41(0,"h5"),t.EFF(1),t.nrm(2,"p-badge",0),t.nI1(3,"translate"),t.k0s(),t.j41(4,"i")(5,"small")(6,"span",1),t.EFF(7,"Modification date"),t.k0s(),t.EFF(8),t.nI1(9,"dateTranslate"),t.k0s()(),t.nrm(10,"hr"),t.DNE(11,Ut,1,4,"p-messages",2),t.j41(12,"div",3),t.nrm(13,"div",4),t.nI1(14,"markdown"),t.nrm(15,"div",5),t.nI1(16,"json"),t.nI1(17,"highlightJson"),t.k0s()),2&n){let e,i;const a=t.XpG();t.R7$(),t.SpI(" ",a.record().id," \xa0"),t.R7$(),t.Y8G("severity","complete"===a.status()?"success":a.status().endsWith("error")?"danger":"secondary")("value",t.bMT(3,7,a.record().conversion.status)),t.R7$(6),t.SpI("\xa0",t.i5U(9,9,null==(e=a.record())?null:e.updated_at,"medium"),""),t.R7$(3),t.vxM(11,a.messages()?11:-1),t.R7$(2),t.Y8G("innerHTML",t.bMT(14,12,a.record().raw),t.npT),t.R7$(2),t.Y8G("innerHTML",t.bMT(17,16,t.bMT(16,14,null==(i=a.record())||null==i.conversion?null:i.conversion.json)),t.npT)}}let N=(()=>{class n{constructor(){this.route=(0,t.WQX)(p.nX),this.http=(0,t.WQX)(Yt.Qq),this.apiService=(0,t.WQX)(d.Gf),this.record=O(this.route.paramMap.pipe((0,Pt.n)(()=>{const e=this.route.snapshot.params.type,i=this.route.snapshot.params.pid,a=this.route.snapshot.queryParams.migration;return null==e||null==i||null==a?(0,h.of)(null):this.http.get(`${this.apiService.getEndpointByType(e,!0)}/${i}?migration=${a}`)}))),this.messages=(0,t.EWP)(()=>this.getMessages()),this.status=(0,t.EWP)(()=>this.record()?.conversion?.status)}getMessages(){const e=[];return this.record()?.conversion.logs&&["info","warning","error"].map(i=>{const a=this.record().conversion.logs[i];a&&e.push({severity:"warning"==i?"warn":i,detail:a.join("<br/>")})}),e}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["admin-migration-data"]],decls:1,vars:1,consts:[[3,"severity","value"],["translate",""],[3,"escape","value","enableService","closable"],[1,"text-sm","grid","data"],[1,"markdown","col",3,"innerHTML"],[1,"json","col",3,"innerHTML"]],template:function(i,a){1&i&&t.DNE(0,Qt,18,18),2&i&&t.vxM(0,a.record()?0:-1)},dependencies:[x,u.Mm,T.B,c.TG,u.D9,d.X1,d.i0,Lt],styles:[".markdown td, .markdown th{padding:0 10px;vertical-align:top} tbody tr:nth-child(odd){background-color:#f8fafc}.data[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]{max-height:600px;overflow:auto}.data[_ngcontent-%COMP%] .json[_ngcontent-%COMP%]{border-left:1px solid gray}"]})}return n})();var Wt=l(935),C=l(9417);const Zt=()=>({"min-width":"50rem",width:"100%","font-size":"0.8em"});function Jt(n,o){1&n&&(t.j41(0,"tr")(1,"th",3),t.EFF(2,"Field"),t.k0s(),t.j41(3,"th",4),t.EFF(4,"Record to Import"),t.k0s(),t.j41(5,"th",4),t.EFF(6,"Candidate"),t.k0s(),t.j41(7,"th",3),t.EFF(8,"Score | Weight"),t.k0s()())}function qt(n,o){if(1&n&&(t.j41(0,"td")(1,"a",6),t.EFF(2),t.nrm(3,"i",7),t.k0s()()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Y8G("routerLink",e.link.router)("queryParams",null==e.link?null:e.link.params),t.R7$(),t.SpI(" ",e.field,"\xa0")}}function Kt(n,o){if(1&n&&t.nrm(0,"td",5),2&n){const e=t.XpG().$implicit;t.Y8G("innerHTML",e.field,t.npT)}}function te(n,o){if(1&n&&(t.j41(0,"td")(1,"a",6),t.EFF(2),t.nrm(3,"i",7),t.k0s()()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Y8G("routerLink",e.c_link.router)("queryParams",null==e.c_link?null:e.c_link.params),t.R7$(),t.SpI(" ",e.c_field,"\xa0")}}function ee(n,o){if(1&n&&t.nrm(0,"td",5),2&n){const e=t.XpG().$implicit;t.Y8G("innerHTML",e.c_field,t.npT)}}function ne(n,o){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"strong"),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.DNE(5,qt,4,3,"td")(6,Kt,1,1)(7,te,4,3,"td")(8,ee,1,1),t.nrm(9,"td",5),t.k0s()),2&n){const e=o.$implicit;t.R7$(3),t.JRh(t.bMT(4,4,e.label)),t.R7$(2),t.vxM(5,e.link?5:6),t.R7$(2),t.vxM(7,null!=e&&null!=e.c_link&&e.c_link.router?7:8),t.R7$(2),t.Y8G("innerHTML",e.score,t.npT)}}let ie=(()=>{class n{constructor(){this.translateService=(0,t.WQX)(u.c$),this.mainTitlePipe=(0,t.WQX)(y.kE),this.record=(0,t.hFB)(),this.candidate=(0,t.hFB)(),this.data=(0,t.EWP)(()=>this.getData())}getScore(e){if(null==e)return"";if(null==e?.weight)return`${e.value.toFixed(2)}&nbsp;|&nbsp;1.0`;var i="text-orange-500";return e.value<.6?i="text-red-500":e.value>.8&&(i="text-green-500"),`<span class="${i}">${e.value.toFixed(2)}</span>&nbsp;|&nbsp;${e.weight.toFixed(1)}`}getData(){const e=this.record()?.metadata?.conversion?.json,i=this?.candidate()?.json,a=this?.candidate()?.detailed_score;return[{field:this.record().id??"",link:{router:["/migrations","records","format","migration_data","detail",this.record().id],params:{migration:this.record().metadata.migration_id}},c_field:i?.pid??"",c_link:{router:i?.pid?["/records","documents","detail",i?.pid]:null},label:"pid"},{field:e?.type?e.type.map(s=>this.translateService.instant(s.main_type)).join("; "):"",c_field:i?.type?i.type.map(s=>this.translateService.instant(s.main_type)).join("; "):"",label:"Type",score:this.getScore(a?.main_type)},{field:e?.title?this.mainTitlePipe.transform(e.title):"",c_field:i?.title?this.mainTitlePipe.transform(i.title):"",label:"Title",score:this.getScore(a?.title)},{field:e?.responsibilityStatement?e.responsibilityStatement.map(s=>s.map(r=>r.value)).join("<br/>"):"",c_field:i?.responsibilityStatement?i.responsibilityStatement.map(s=>s.map(r=>r.value)).join("<br/>"):"",label:"Responsibility",score:this.getScore(a?.responsibility_statement)},{field:e?.sort_date_old??"",c_field:i?.sort_date_old??"",label:"Publication year",score:this.getScore(a?.publication_date)},{field:e?.provisionActivity?e.provisionActivity[0]._text[0].value:"",c_field:i?.provisionActivity?i.provisionActivity[0]._text[0].value:"",label:"Provision activity",score:this.getScore(a?.provision_activity)},{field:e?.extent?e.extent:"",c_field:i?.extent?i.extent:"",label:"Extent",score:this.getScore(a?.extent)},{field:e?.editionStatement?e.editionStatement.map(s=>s?._text.map(r=>r.value)).join("<br/>"):"",c_field:i?.editionStatement?i.editionStatement.map(s=>s?._text.map(r=>r.value)).join("<br/>"):"",label:"Edition statement",score:this.getScore(a?.edition_statement)},{field:e?.seriesStatement?e.seriesStatement.map(s=>s?._text.map(r=>r.value)).join("<br/>"):"",c_field:i?.seriesStatement?i.seriesStatement.map(s=>s?._text.map(r=>r.value)).join("<br/>"):"",label:"Series statement",score:this.getScore(a?.series_statement)},{field:e?.identifiedBy?e.identifiedBy.map(s=>`${s.type}: ${s.value}`).sort().join("<br/>"):"",c_field:i?.identifiedBy?i.identifiedBy.map(s=>`${s.type}: ${s.value}`).sort().join("<br/>"):"",label:"Identifiers",score:this.getScore(a?.identifier)}]}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["admin-migration-metadata"]],inputs:{record:[t.Mj6.SignalBased,"record"],candidate:[t.Mj6.SignalBased,"candidate"]},decls:3,vars:3,consts:[["styleClass","p-datatable-sm p-datatable-striped",3,"value","tableStyle"],["pTemplate","header"],["pTemplate","body"],["translate","",2,"width","10%"],["translate","",2,"width","40%"],[3,"innerHTML"],["target","_blank",3,"routerLink","queryParams"],[1,"fa","fa-external-link"]],template:function(i,a){1&i&&(t.j41(0,"p-table",0),t.DNE(1,Jt,9,0,"ng-template",1)(2,ne,10,6,"ng-template",2),t.k0s()),2&i&&t.Y8G("value",a.data())("tableStyle",t.lJ4(2,Zt))},dependencies:[p.Wk,_.Ei,u.Mm,j.XI,u.D9],styles:["td{vertical-align:top} table td:last-child, table th:last-child{text-align:right}"]})}return n})();function ae(n,o){if(1&n&&(t.j41(0,"strong"),t.EFF(1,"ILS pid:"),t.k0s(),t.EFF(2),t.nrm(3,"i",14)),2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.ilsPid,"\xa0")}}function oe(n,o){if(1&n){const e=t.RV6();t.j41(0,"input",15),t.bIt("keyup.enter",function(a){t.eBV(e),t.XpG();const s=t.sdS(3);return t.XpG().saveIlsPid(a),t.Njj(s.deactivate())})("keydown.escape",function(){t.eBV(e),t.XpG();const a=t.sdS(3);return t.Njj(a.deactivate())}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("ngModel",e.ilsPid)("autofocus",!0)}}function se(n,o){if(1&n&&(t.j41(0,"div"),t.nrm(1,"p-messages",16),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("value",e.messages())("escape",!1)("enableService",!1)("closable",!1)}}function re(n,o){if(1&n&&(t.j41(0,"small",12),t.EFF(1),t.nI1(2,"dateTranslate"),t.k0s()),2&n){let e;const i=t.XpG(2);t.R7$(),t.Lme("(",null==(e=i.record())||null==e.metadata||null==e.metadata.deduplication?null:e.metadata.deduplication.modified_by," / ",t.i5U(2,2,null==(e=i.record())||null==e.metadata||null==e.metadata.deduplication?null:e.metadata.deduplication.modified_at,"medium"),")")}}function le(n,o){if(1&n&&(t.j41(0,"strong",17),t.EFF(1,"Score"),t.k0s(),t.EFF(2),t.nI1(3,"number")),2&n){const e=t.XpG(3);t.R7$(2),t.SpI("\xa0",t.bMT(3,1,e.currentCandidate.score)," ")}}function ce(n,o){1&n&&(t.j41(0,"strong",17),t.EFF(1,"Manually added"),t.k0s())}function de(n,o){if(1&n&&(t.j41(0,"div",2),t.DNE(1,le,4,3)(2,ce,2,0),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.vxM(1,null!=e.currentCandidate&&e.currentCandidate.score?1:2)}}function pe(n,o){if(1&n){const e=t.RV6();t.j41(0,"div",1)(1,"div",2)(2,"p-inplace",null,0),t.DNE(4,ae,4,1,"ng-template",3)(5,oe,1,2,"ng-template",4),t.k0s()(),t.j41(6,"div",2)(7,"p-button",5),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.previousCandidate())}),t.k0s(),t.j41(8,"small"),t.EFF(9),t.k0s(),t.j41(10,"p-button",6),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.nextCandidate())}),t.k0s()(),t.j41(11,"div",7)(12,"p-button",8),t.nI1(13,"translate"),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.save())}),t.k0s(),t.j41(14,"p-button",9),t.nI1(15,"translate"),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.reject())}),t.k0s()()(),t.DNE(16,se,2,4,"div"),t.j41(17,"div",10)(18,"div",2),t.nrm(19,"p-tag",11),t.nI1(20,"translate"),t.DNE(21,re,3,5,"small",12),t.k0s(),t.DNE(22,de,3,1,"div",2),t.k0s(),t.nrm(23,"admin-migration-metadata",13)}if(2&n){let e;const i=t.XpG();t.R7$(7),t.Y8G("disabled",!i.hasPrevious())("text",!0),t.R7$(2),t.Lme(" ",i.currentCandidateIndex+1,"\xa0/\xa0",i.candidates.length," "),t.R7$(),t.Y8G("disabled",!i.hasNext())("text",!0),t.R7$(2),t.Y8G("outlined",!0)("label",t.bMT(13,17,"Validate")),t.R7$(2),t.Y8G("outlined",!0)("label",t.bMT(15,19,"Reject")),t.R7$(2),t.vxM(16,i.messages?16:-1),t.R7$(3),t.Y8G("severity","match"===i.status()?"success":i.status().endsWith("check")?"warning":"secondary")("value",t.bMT(20,21,i.record().metadata.deduplication.status)),t.R7$(2),t.vxM(21,null!=(e=i.record())&&null!=e.metadata&&null!=e.metadata.deduplication&&e.metadata.deduplication.modified_by?21:-1),t.R7$(),t.vxM(22,i.currentCandidate?22:-1),t.R7$(),t.Y8G("record",i.record())("candidate",i.currentCandidate)}}let A=(()=>{class n{constructor(){this.toastService=(0,t.WQX)(_.bg),this.recordService=(0,t.WQX)(d.nO),this.translateService=(0,t.WQX)(u.c$),this.record=(0,t.hFB)(),this.refresh=(0,t.CGW)(),this.ilsPid=null,this.currentCandidate=null,this.currentCandidateIndex=null,this.messages=(0,t.EWP)(()=>this.getMessages()),this.status=(0,t.EWP)(()=>this.record()?.metadata?.deduplication?.status)}ngOnInit(){let e=this.record()?.metadata?.deduplication?.ils_pid;null==e&&this.candidates.length>0&&"no match"!==this.status()&&(e=this.candidates[0].json.pid),this.updateCurrentCandidate(e),"no match"==this.status()&&(this.currentCandidateIndex=-1,this.currentCandidate=null)}getMessages(){const e=[];return this.record()?.metadata?.deduplication?.logs&&["info","warning","error"].map(i=>{const a=this.record()?.metadata?.deduplication?.logs[i];a&&e.push({severity:"warning"==i?"warn":i,detail:a.join("<br/>")})}),e}updateCurrentCandidate(e){if(null==e||""===e)this.currentCandidateIndex=-1,this.currentCandidate=null,this.ilsPid=null;else{const i=this.candidates.findIndex(a=>a?.json?.pid==e);i>-1?(this.currentCandidateIndex=i,this.currentCandidate=this.record()?.metadata?.deduplication?.candidates[this.currentCandidateIndex],this.updateIlsPid()):this.recordService.getRecords("documents",`pid:${e}`,1,1).subscribe(a=>{if(1==a.hits.hits.length){const s=a.hits.hits[0].metadata;this.record().metadata.deduplication.candidates=[{pid:s.pid,json:s},...this.candidates.filter(r=>r.score)],this.currentCandidateIndex=0,this.currentCandidate=this.record()?.metadata?.deduplication?.candidates[this.currentCandidateIndex],this.updateIlsPid()}else this.toastService.add({severity:"warn",summary:this.translateService.instant("Record not found.")})})}}updateIlsPid(){this.currentCandidate&&this.ilsPid!=this.currentCandidate.json.pid&&(this.ilsPid=this.currentCandidate.json.pid)}get candidates(){const e=this.record()?.metadata?.deduplication?.candidates;return e||[]}hasPrevious(){return this.currentCandidateIndex>0}hasNext(){return this.currentCandidateIndex<this.candidates.length-1}nextCandidate(){this.hasNext()&&(this.currentCandidateIndex+=1,this.updateCurrentCandidate(this.candidates[this.currentCandidateIndex].json.pid))}previousCandidate(){this.hasPrevious()&&(this.currentCandidateIndex-=1,this.updateCurrentCandidate(this.candidates[this.currentCandidateIndex].json.pid))}saveIlsPid(e){this.updateCurrentCandidate(""!=e.target.value?e.target.value:null)}reject(){this.ilsPid=null,this.save()}save(){this.recordService.update("migration_data",`${this.record().id}?migration=${this.record().metadata.migration_id}`,{ils_pid:this.ilsPid,candidates:this.candidates}).subscribe(e=>{this.refresh.emit(!0),this.toastService.add({severity:"success",summary:`${e.id} `+this.translateService.instant("has been sucessfully updated."),detail:this.translateService.instant("The status is now:")+" "+this.translateService.instant(e.deduplication.status)})})}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["admin-migration-data-deduplication"]],inputs:{record:[t.Mj6.SignalBased,"record"]},outputs:{refresh:"refresh"},decls:1,vars:1,consts:[["inplace",""],[1,"flex","w-100","justify-content-between","mb-2"],[1,"flex","align-items-center","justify-content-center"],["pTemplate","display"],["pTemplate","content"],["icon","pi pi-chevron-left",3,"click","disabled","text"],["icon","pi pi-chevron-right",3,"click","disabled","text"],[1,"flex","align-items-center","gap-2","justify-content-center"],["size","small","icon","pi pi-check",3,"click","outlined","label"],["size","small","icon","pi pi-trash","severity","danger",3,"click","outlined","label"],[1,"flex","justify-content-between","mb-1"],[3,"severity","value"],[1,"ml-2"],[1,"mb-2",3,"record","candidate"],[1,"pi","pi-pencil"],["type","text","pInputText","","onFocus","this.setSelectionRange(0, this.value.length)","pAutoFocus","",3,"keyup.enter","keydown.escape","ngModel","autofocus"],[3,"value","escape","enableService","closable"],["translate",""]],template:function(i,a){1&i&&t.DNE(0,pe,24,23),2&i&&t.vxM(0,a.record()?0:-1)},dependencies:[_.Ei,Wt.v,b.$n,C.me,C.BC,C.vS,u.Mm,T.B,st,S.q,ie,c.QX,u.D9,d.X1],styles:["[_nghost-%COMP%] .p-message .p-message-wrapper{padding:.5rem .75rem}"]})}return n})();var Y=l(6354),_e=l(8141),M=l(8580);const me=[[["","header",""]],[["","afterInputSearch",""]],[["","beforeResult",""]],[["","top-search-result",""]],[["","top-result",""]],[["","footer-result",""]],"*",[["","footer-search-result",""]],[["","top-facets",""]]],ue=["[header]","[afterInputSearch]","[beforeResult]","[top-search-result]","[top-result]","[footer-result]","*","[footer-search-result]","[top-facets]"],V=()=>["new"],ge=()=>[10,20,50,100],I=n=>({active:n}),z=n=>({filter:n});function he(n,o){if(1&n&&t.nrm(0,"ng-core-error",2),2&n){const e=t.XpG();t.Y8G("error",e.error)}}function fe(n,o){if(1&n){const e=t.RV6();t.j41(0,"li",8)(1,"a",9),t.bIt("click",function(a){const s=t.eBV(e).$implicit,r=t.XpG(3);return t.Njj(r.changeType(a,s.key))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=o.$implicit,i=t.XpG(3);t.R7$(),t.AVh("active",i.currentType===e.key),t.R7$(),t.SpI(" ",t.bMT(3,3,e.label)," ")}}function Ce(n,o){if(1&n&&(t.j41(0,"ul",3),t.Z7z(1,fe,4,5,"li",8,t.fX1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.Dyx(e.typesInTabs)}}function be(n,o){if(1&n&&(t.j41(0,"h5"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.JRh(t.bMT(2,1,e.typesInTabs[0].label))}}function ve(n,o){if(1&n){const e=t.RV6();t.j41(0,"ng-core-search-input",10),t.nI1(1,"translate"),t.nI1(2,"ucfirst"),t.bIt("search",function(a){t.eBV(e);const s=t.XpG(2);return t.Njj(s.searchByQuery(a))}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("placeholder",t.bMT(2,6,t.bMT(1,4,"search")))("searchText",e.q)("displayLabel",!1)("focus",!0)}}function ye(n,o){if(1&n&&(t.j41(0,"a",12),t.nrm(1,"i",14),t.j41(2,"span",15),t.EFF(3,"Add"),t.k0s()()),2&n){const e=t.XpG(3);t.Y8G("routerLink",e.addStatus.routerLink||t.lJ4(1,V))}}function xe(n,o){if(1&n&&(t.j41(0,"div",11),t.EFF(1),t.k0s(),t.DNE(2,ye,4,2,"a",12),t.nrm(3,"ng-core-list-filters",13)),2&n){const e=t.XpG(2);t.R7$(),t.JRh(e.emptyRecordMessage),t.R7$(),t.vxM(2,e.adminMode.can&&e.addStatus.can?2:-1),t.R7$(),t.Y8G("aggregations",e.aggregations)("aggregationsFilters",e.aggregationsFilters)("searchFilters",e.searchFilters)}}function Te(n,o){1&n&&(t.j41(0,"div",17)(1,"strong"),t.EFF(2),t.k0s()()),2&n&&(t.R7$(2),t.JRh(o))}function Me(n,o){if(1&n&&(t.j41(0,"a",19),t.nrm(1,"i",14),t.j41(2,"span",15),t.EFF(3,"Add"),t.k0s()()),2&n){const e=t.XpG(3);t.Y8G("routerLink",e.addStatus.routerLink||t.lJ4(1,V))}}function Ie(n,o){if(1&n){const e=t.RV6();t.j41(0,"li",35)(1,"a",36),t.bIt("click",function(a){t.eBV(e);const s=t.XpG().$implicit,r=t.XpG(5);return a.preventDefault(),t.Njj(r.changeSorting(s))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG().$implicit;t.R7$(2),t.SpI(" ",t.bMT(3,1,e.label)," ")}}function ke(n,o){if(1&n&&t.DNE(0,Ie,4,3,"li",35),2&n){const e=o.$implicit,i=t.XpG(5);t.vxM(0,i.currentSortOption&&i.currentSortOption.value===e.value?-1:0)}}function Se(n,o){if(1&n&&(t.j41(0,"ul",34),t.Z7z(1,ke,1,1,null,null,t.fX1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.Dyx(e.sortOptions)}}function De(n,o){if(1&n&&(t.j41(0,"div",20)(1,"button",32),t.EFF(2),t.nI1(3,"translate"),t.nI1(4,"translate"),t.nrm(5,"span",23),t.k0s(),t.DNE(6,Se,3,0,"ul",33),t.k0s()),2&n){const e=t.XpG(3);t.R7$(2),t.Lme(" ",t.bMT(3,2,"Sort by"),"",e.currentSortOption?": "+t.bMT(4,4,e.currentSortOption.label):""," ")}}function je(n,o){if(1&n){const e=t.RV6();t.j41(0,"li",35)(1,"a",36),t.bIt("click",function(a){const s=t.eBV(e).$implicit,r=t.XpG(4);return t.Njj(r.changeSize(a,s))}),t.EFF(2),t.k0s()()}if(2&n){const e=o.$implicit;t.R7$(2),t.JRh(e)}}function Fe(n,o){1&n&&(t.j41(0,"ul",37),t.Z7z(1,je,3,1,"li",35,t.fX1),t.k0s()),2&n&&(t.R7$(),t.Dyx(t.lJ4(0,ge)))}function Ge(n,o){if(1&n){const e=t.RV6();t.j41(0,"button",41),t.bIt("click",function(){t.eBV(e);const a=t.XpG(5);return t.Njj(a.searchInField(a.searchFields[0]))}),t.EFF(1),t.nI1(2,"translate"),t.nI1(3,"translate"),t.k0s()}if(2&n){const e=t.XpG(5);t.Y8G("ngClass",t.eq3(7,I,e.selectedSearchFields[0]===e.searchFields[0])),t.R7$(),t.Lme(" ",t.bMT(2,3,"Search in")," ",t.bMT(3,5,e.searchFields[0].label)," ")}}function $e(n,o){if(1&n){const e=t.RV6();t.j41(0,"li")(1,"a",43),t.bIt("click",function(a){const s=t.eBV(e).$implicit,r=t.XpG(7);return a.preventDefault(),t.Njj(r.searchInField(s))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=o.$implicit;t.R7$(),t.Y8G("ngClass",t.eq3(4,I,e.selected)),t.R7$(),t.SpI(" ",t.bMT(3,2,e.label)," ")}}function Re(n,o){if(1&n&&(t.j41(0,"ul",34),t.Z7z(1,$e,4,6,"li",null,t.fX1),t.k0s()),2&n){const e=t.XpG(6);t.R7$(),t.Dyx(e.searchFields)}}function we(n,o){if(1&n&&(t.j41(0,"button",42),t.EFF(1),t.nI1(2,"translate"),t.j41(3,"span"),t.EFF(4),t.k0s()(),t.DNE(5,Re,3,0,"ul",33)),2&n){const e=t.XpG(5);t.Y8G("ngClass",t.eq3(5,I,e.selectedSearchFields.length>0)),t.R7$(),t.SpI(" ",t.bMT(2,3,"Search in")," "),t.R7$(3),t.JRh(e.selectedSearchFields.length>0?' "'+e.selectedSearchFields[0].label+'"':"...")}}function Ee(n,o){if(1&n&&(t.j41(0,"div",38),t.DNE(1,Ge,4,9,"button",40)(2,we,6,7),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.vxM(1,1===e.searchFields.length?1:2)}}function Be(n,o){if(1&n&&t.eu8(0,44),2&n){const e=t.XpG(2).$implicit;t.XpG(2);const i=t.sdS(4);t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(2,z,e))}}function Xe(n,o){if(1&n&&t.DNE(0,Be,1,4,"ng-container",44),2&n){const e=t.XpG().$implicit,i=t.XpG(5);t.vxM(0,i.showFilter(e)?0:-1)}}function Oe(n,o){if(1&n&&t.eu8(0,44),2&n){const e=t.XpG().$implicit;t.XpG(5);const i=t.sdS(4);t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(2,z,e))}}function Ne(n,o){if(1&n&&t.DNE(0,Oe,1,4,"ng-container",44),2&n){const e=o.$implicit,i=t.XpG(8);t.vxM(0,i.showFilter(e)?0:-1)}}function Ae(n,o){if(1&n&&(t.j41(0,"div",45),t.EFF(1),t.nI1(2,"translate"),t.k0s(),t.Z7z(3,Ne,1,1,null,null,t.fX1)),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.JRh(t.bMT(2,1,e.label)),t.R7$(2),t.Dyx(e.filters)}}function Ye(n,o){if(1&n&&t.DNE(0,Ae,5,3),2&n){const e=t.XpG().$implicit,i=t.XpG(5);t.vxM(0,i.showFilterSection(e)?0:-1)}}function Ve(n,o){1&n&&t.DNE(0,Xe,1,1)(1,Ye,1,1),2&n&&t.vxM(0,o.$implicit.filters?1:0)}function ze(n,o){if(1&n&&(t.j41(0,"div",39),t.Z7z(1,Ve,2,1,null,null,t.fX1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.Dyx(e.searchFilters)}}function Pe(n,o){if(1&n&&(t.j41(0,"a",49),t.nrm(1,"i",50),t.k0s()),2&n){const e=t.XpG(2).filter;t.Y8G("title",e.url.title)("href",e.url.link,t.B4B)("target",e.url.target)}}function He(n,o){if(1&n&&(t.j41(0,"a",51),t.nrm(1,"i",50),t.k0s()),2&n){const e=t.XpG(2).filter;t.Y8G("title",e.url.title)("routerLink",e.url.routerLink)}}function Le(n,o){if(1&n&&t.DNE(0,Pe,2,3,"a",49)(1,He,2,2),2&n){const e=t.XpG().filter;t.vxM(0,e.url.external?0:1)}}function Ue(n,o){if(1&n){const e=t.RV6();t.j41(0,"div",46)(1,"input",47),t.bIt("click",function(){const a=t.eBV(e).filter,s=t.XpG(4);return t.Njj(s.searchFilter(a))}),t.k0s(),t.j41(2,"label",48),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.DNE(5,Le,2,1),t.k0s()}if(2&n){const e=o.filter,i=t.XpG(4);t.R7$(),t.Mz_("id","customSwitch-",e.filter,""),t.Y8G("checked",i.isFilterActive(e)),t.R7$(),t.Mz_("for","customSwitch-",e.filter,""),t.R7$(),t.JRh(t.bMT(4,7,e.label)),t.R7$(2),t.vxM(5,e.url?5:-1)}}function Qe(n,o){if(1&n){const e=t.RV6();t.j41(0,"ng-core-record-search-aggregation",53),t.bIt("aggregationClicked",function(a){t.eBV(e);const s=t.XpG(6);return t.Njj(s.loadAggregationBuckets(a))}),t.k0s()}if(2&n){const e=t.XpG().$implicit,i=t.XpG(5);t.Y8G("aggregation",e)("aggregationsFilters",i.aggregationsFilters)}}function We(n,o){if(1&n&&(t.j41(0,"div"),t.DNE(1,Qe,1,2,"ng-core-record-search-aggregation",52),t.k0s()),2&n){const e=o.$implicit,i=t.XpG(5);t.R7$(),t.vxM(1,i.aggregationsToHide.includes(e.key)?-1:1)}}function Ze(n,o){if(1&n&&(t.SdG(0,8),t.Z7z(1,We,2,1,"div",null,t.fX1)),2&n){const e=t.XpG(4);t.R7$(),t.Dyx(e.aggregations)}}function Je(n,o){if(1&n&&(t.j41(0,"div",26),t.DNE(1,Ee,3,1,"div",38)(2,ze,3,0,"div",39)(3,Ue,6,9,"ng-template",null,1,t.C5r)(5,Ze,3,0),t.k0s()),2&n){const e=t.XpG(3);t.R7$(),t.vxM(1,e.searchFields.length>0&&e.q?1:-1),t.R7$(),t.vxM(2,e.searchFilters?2:-1),t.R7$(3),t.vxM(5,!e.showEmptySearchMessage||e.q?5:-1)}}function qe(n,o){1&n&&(t.j41(0,"div",28),t.nrm(1,"i",54),t.EFF(2),t.nI1(3,"translate"),t.k0s()),2&n&&(t.R7$(2),t.SpI(" ",t.bMT(3,1,"Enter a query to get results.")," "))}function Ke(n,o){if(1&n){const e=t.RV6();t.j41(0,"li",30)(1,"admin-migration-data-deduplication",55),t.bIt("refresh",function(a){t.eBV(e);const s=t.XpG(3);return t.Njj(s.refresh(a))}),t.k0s()()}if(2&n){const e=o.$implicit;t.R7$(),t.Y8G("record",e)}}function tn(n,o){if(1&n){const e=t.RV6();t.j41(0,"pagination",56),t.mxI("ngModelChange",function(a){t.eBV(e);const s=t.XpG(3);return t.DH7(s.currentPage,a)||(s.currentPage=a),t.Njj(a)}),t.bIt("pageChanged",function(){t.eBV(e);const a=t.XpG(3);return t.Njj(a.pageChanged())}),t.k0s()}if(2&n){const e=t.XpG(3);t.R50("ngModel",e.currentPage),t.Y8G("totalItems",e.total)("itemsPerPage",e.size)("maxSize",e.paginationMaxSize)("boundaryLinks",e.paginationBoundaryLinks)}}function en(n,o){if(1&n&&(t.j41(0,"div",16),t.DNE(1,Te,3,1,"div",17),t.nI1(2,"async"),t.j41(3,"div",18),t.DNE(4,Me,4,2,"a",19)(5,De,7,6,"div",20),t.nrm(6,"ng-core-export-button",21),t.j41(7,"div",20)(8,"button",22),t.EFF(9),t.nrm(10,"span",23),t.k0s(),t.DNE(11,Fe,3,1,"ul",24),t.k0s()()(),t.SdG(12,2),t.j41(13,"div",25),t.nrm(14,"ng-core-list-filters",13),t.SdG(15,3),t.DNE(16,Je,6,3,"div",26),t.j41(17,"div",27),t.DNE(18,qe,4,3,"div",28),t.SdG(19,4),t.j41(20,"ul",29),t.Z7z(21,Ke,2,1,"li",30,t.fX1),t.k0s(),t.DNE(23,tn,1,5,"pagination",31),t.SdG(24,5),t.SdG(25,6),t.k0s()(),t.SdG(26,7)),2&n){let e;const i=t.XpG(2);t.R7$(),t.vxM(1,(e=t.bMT(2,11,i.resultsText$))?1:-1,e),t.R7$(3),t.vxM(4,i.adminMode.can&&i.addStatus.can?4:-1),t.R7$(),t.vxM(5,i.sortOptions.length>0?5:-1),t.R7$(),t.Y8G("exportOptions",i.exportOptions),t.R7$(3),t.SpI(" ",i.size," "),t.R7$(5),t.Y8G("aggregations",i.aggregations)("aggregationsFilters",i.aggregationsFilters)("searchFilters",i.searchFilters),t.R7$(2