import{b as V,c as A}from"./chunk-LMI6FIPG.js";import{a as j,b as G}from"./chunk-BQPO535K.js";import{b as R,c as P}from"./chunk-U5Y75IZ5.js";import{E as B}from"./chunk-MDIMQ3H3.js";import{Ad as w,Bb as u,Db as f,Dc as S,Eb as s,Fa as d,Gb as p,Hb as _,Ib as C,Jb as a,Kb as r,Kc as h,Lb as x,Lc as k,Mc as E,Ub as F,Xb as M,Za as o,Zb as l,eb as y,ib as T,lc as $,mc as m,nc as g,oc as D,ra as I,va as v,vd as O,wa as b,xd as N}from"./chunk-GJDGQISV.js";var z=t=>({"text-end":t});function H(t,n){if(t&1&&(a(0,"th"),m(1),r()),t&2){let e=n.$implicit,i=n.$index,c=l();$(S(3,z,e.type=="number")),o(),D(" ",c.headers()[i]," ")}}function J(t,n){if(t&1&&(a(0,"td"),m(1),h(2,"date"),r()),t&2){let e=l().$implicit,i=l().$implicit;o(),g(E(2,1,i[e.field],"dd MMM yyyy"))}}function K(t,n){if(t&1&&(a(0,"td",7),m(1),h(2,"number"),r()),t&2){let e=l().$implicit,i=l().$implicit;o(),g(k(2,1,i[e.field]))}}function Q(t,n){if(t&1&&(a(0,"td"),m(1),r()),t&2){let e=l().$implicit,i=l().$implicit;o(),g(i[e.field])}}function U(t,n){if(t&1&&u(0,J,3,4,"td")(1,K,3,3,"td",7)(2,Q,2,1,"td"),t&2){let e=n.$implicit;f(e.type=="date"?0:e.type=="number"?1:2)}}function W(t,n){if(t&1&&(a(0,"small",6),m(1),r()),t&2){let e=l(2);o(),D("(",e.actionTitle(),")")}}function X(t,n){if(t&1){let e=F();a(0,"tr")(1,"td")(2,"mat-radio-button",5),M("change",function(){let c=v(e).$implicit,q=l();return b(q.selectedId.set(c.ID))}),r()(),p(3,U,3,1,null,null,s),a(5,"td"),u(6,W,2,1,"small",6),r()()}if(t&2){let e=n.$implicit,i=l();o(2),C("id",e.ID)("checked",i.selectedId()==e.ID)("name",e.ID)("value",e.ID),o(),_(i.columns()),o(3),f(i.selectedId()!=e.ID?6:-1)}}var L=class t{constructor(n){this.dialogData=n;this.data.set(n.data),this.columns.set(n.columns),this.headers.set(n.headers),this.selectedId.set(this.data()[0]?.ID),this.actionTitle.set(n.actionTitle?n.actionTitle:"Deleted"),this.config.title=n.title,this.config.bodyScrollable=!0}dialogRef=I(j);config=new R;selectedId=d(null);data=d([]);actionTitle=d("Deleted");columns=d([]);headers=d([]);onOk(){let n=this.data()?.filter(i=>i.ID!==this.selectedId())?.map(i=>i.ID),e={mergeTarget:this.selectedId(),deleted:n};this.dialogRef.close(e)}onClose(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||t)(y(G))};static \u0275cmp=T({type:t,selectors:[["app-merge-dialog"]],decls:12,vars:2,consts:[[3,"onOk","onCancel","onClose","config","dynamicValidated"],[1,"table"],[1,"thead-light"],[2,"width","5px"],[3,"class"],["color","primary",3,"change","id","checked","name","value"],[1,"fst-italic","ms-2","text-danger"],[1,"text-end"]],template:function(e,i){e&1&&(a(0,"modal-material",0),M("onOk",function(){return i.onOk()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),a(1,"content")(2,"table",1)(3,"thead",2)(4,"tr"),x(5,"th",3),p(6,H,2,5,"th",4,s),x(8,"th"),r()(),a(9,"tbody"),p(10,X,7,5,"tr",null,s),r()()()()),e&2&&(C("config",i.config)("dynamicValidated",i.selectedId()),o(6),_(i.columns()),o(4),_(i.data()))},dependencies:[w,P,A,V,B,N,O],styles:[".radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0;align-items:flex-start}.radio-button[_ngcontent-%COMP%]{margin:5px}"]})};export{L as a};
