@reltio/remotes 1.4.1349 → 1.4.1350

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/5501.js +1 -1
  2. package/5501.js.map +1 -1
  3. package/package.json +1 -1
package/5501.js CHANGED
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5501],{74489:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>js,IL3:()=>Cp,PY2:()=>an,Ng6:()=>Pe,YJ7:()=>Xr,NlI:()=>$r,XYV:()=>Qr,Xt7:()=>ve,wfT:()=>Gn,EMD:()=>In,HAc:()=>ge,PEf:()=>cn,oA3:()=>wn,$XE:()=>Ge,eWf:()=>ln,q7e:()=>_e,KVe:()=>Wn,WVQ:()=>br,oZZ:()=>zn,bNA:()=>Zn,Rjq:()=>ei,G39:()=>dn,W0P:()=>Ke,X1H:()=>Qe,yn8:()=>Me,N0y:()=>Fe,dZX:()=>We,bQt:()=>ri,oS0:()=>ze,MU4:()=>a.DatePeriod,bZE:()=>qr,Nsj:()=>Zr,psV:()=>Jr,xPW:()=>on,pyR:()=>kn,p8l:()=>Cn,Wkf:()=>Oe,zHr:()=>be,NIO:()=>he,$26:()=>Lv,Esk:()=>An,s9T:()=>je,MEy:()=>bu,j5E:()=>xr,vAw:()=>Sn,NMQ:()=>Rn,mNm:()=>Dn,s_5:()=>Fn,RgZ:()=>Ln,unl:()=>Xn,Qy0:()=>ti,pYu:()=>_n,wIJ:()=>ng,GFH:()=>Se,Ury:()=>yn,S91:()=>fn,p3$:()=>oi,wSh:()=>ee,BDP:()=>Ei,pGS:()=>jn,ARY:()=>Ze,XGc:()=>Vn,fO_:()=>Pr,wwy:()=>Ce,h_8:()=>En,_XL:()=>zr,j2V:()=>Yn,dMV:()=>xn,NBX:()=>rA,OXy:()=>et,BXd:()=>xe,KM9:()=>Ne,CJB:()=>Hn,lXI:()=>qe,nqG:()=>ii,C68:()=>pn,yxQ:()=>ni,Yj_:()=>Le,D25:()=>Ie,ZIY:()=>Ye,Tl4:()=>cg,lwr:()=>un,NkU:()=>Bn,Rtp:()=>$n,YGx:()=>$e,uTS:()=>Mn,MCv:()=>Ae,IYE:()=>Un,PiC:()=>Jn,MVv:()=>Je,h_m:()=>He,DUe:()=>Hr,tJI:()=>Re,fDt:()=>we,cNQ:()=>qn,SwE:()=>Nn,ZHR:()=>Kn,lD1:()=>Tn,lVm:()=>Ve,vnX:()=>iv,$x5:()=>av,_R1:()=>rv,wUm:()=>nv,z7V:()=>ai,dC6:()=>ke,MBD:()=>Ue,GmF:()=>Qi,cKm:()=>Be,iP_:()=>sn,NVC:()=>De,tPT:()=>ll,tZe:()=>Kp,kRE:()=>rf,psB:()=>nf,X0$:()=>sl,zE1:()=>hl,Wm5:()=>Xs,vyX:()=>fc,wLZ:()=>ul,W4V:()=>le,EtK:()=>hs,Wtd:()=>ol,asT:()=>fA,kGs:()=>$E,ewt:()=>$T,O_f:()=>du,sOy:()=>At,Tde:()=>zt,LMI:()=>Xu,skb:()=>Zg,sPt:()=>Gu,sH1:()=>Wu,RPM:()=>sm,h27:()=>sc,Uqd:()=>yc,xG:()=>d_,Z2f:()=>bO,fgW:()=>Lg,I69:()=>i_,ZxB:()=>o_,mdt:()=>rm,Qbq:()=>PE,rny:()=>Ui,UEY:()=>Ta,Q0T:()=>fa,Lyr:()=>ga,sBn:()=>ya,itK:()=>ua,H9$:()=>da,KPc:()=>pa,zos:()=>ca,ELQ:()=>_a,dZs:()=>Zi,Cz4:()=>zi,z_L:()=>Oa,fGe:()=>Xi,iuF:()=>sa,Wib:()=>la,Hn0:()=>va,obS:()=>Aa,E$L:()=>ea,XUh:()=>oa,Qp_:()=>ia,_jk:()=>ta,sKE:()=>ra,WmG:()=>aa,QKx:()=>ha,Oik:()=>ma,s0A:()=>na,o9m:()=>Ea,MCd:()=>ba,RsS:()=>lc,tGK:()=>Vl,lIv:()=>bl,Vg3:()=>Mi,mkC:()=>Ni,xv5:()=>$i,a14:()=>Ri,yv0:()=>xi,Zm0:()=>Pi,Nxd:()=>Ai,$mM:()=>Fi,ifj:()=>vr,NWi:()=>MO,xr3:()=>FO,wNf:()=>Xl,iJH:()=>xO,d89:()=>vi,Edd:()=>gi,Z5t:()=>_i,uGe:()=>hi,UoR:()=>mi,xvW:()=>kO,$qe:()=>jO,yPM:()=>Ji,$cp:()=>ml,vKJ:()=>Tl,VtG:()=>Gc,AID:()=>tT,B1H:()=>eA,b7X:()=>_E,$uE:()=>WE,keo:()=>NE,C_p:()=>Ym,G27:()=>Jh,JA0:()=>By,b3T:()=>xE,oC6:()=>FE,_Zs:()=>ME,epC:()=>BE,YYG:()=>YE,f_2:()=>Hy,w3l:()=>k_,QHB:()=>Kh,Jso:()=>W_,RXH:()=>Dh,Vr9:()=>ib,lMm:()=>Xb,BlA:()=>AA,fmQ:()=>cs,yRD:()=>__,NcL:()=>Jm,QK6:()=>ye,ymd:()=>Up,JV_:()=>bf,XiW:()=>bT,Yrx:()=>Cy,GPx:()=>al,gjI:()=>il,vlo:()=>iE,E_P:()=>JE,aAL:()=>hp,NBq:()=>ps,wp9:()=>tm,DsR:()=>dp,MPc:()=>oT,gWE:()=>sT,DT_:()=>lT,ipn:()=>cT,ORg:()=>yi,_wz:()=>uT,RYR:()=>jT,PP2:()=>Fy,wS7:()=>PO,cBQ:()=>Jc,pBq:()=>xf,DsO:()=>te,X78:()=>vf,xZs:()=>Tf,YFy:()=>Dy,Gmt:()=>lf,K$w:()=>sf,DSj:()=>bp,Mfr:()=>jy,k9j:()=>zc,ww$:()=>cl,WVU:()=>of,hxF:()=>Zs,E7G:()=>Fd,nwO:()=>RA,Mzk:()=>Bc,aFF:()=>CE,HRH:()=>gu,EZK:()=>sd,Kxm:()=>nd,Z9i:()=>Nm,CrF:()=>zy,DNd:()=>Pa,vUy:()=>bA,lJh:()=>Nu,zHo:()=>Pu,sEJ:()=>iA,UO$:()=>Bf,zeJ:()=>ir,dLR:()=>gs,JQy:()=>Cs,XtP:()=>Os,Ug0:()=>kr,A1W:()=>AE,sw:()=>od,nv3:()=>HO,JgD:()=>qO,nve:()=>aA,SkP:()=>Ls,SAs:()=>Vf,i5L:()=>Ds,PWK:()=>No,IM5:()=>vs,Mfk:()=>rO,HQx:()=>xo,oN$:()=>Mo,mB6:()=>gO,p6d:()=>I,o0x:()=>C,ufS:()=>uO,k7L:()=>cO,mrB:()=>U,ncP:()=>ht,Zmi:()=>yt,hm5:()=>Tt,ECL:()=>Ar,vPL:()=>cd,qmL:()=>gE,hPi:()=>Ff,hXd:()=>Li,OCS:()=>Di,p2l:()=>Fs,qF1:()=>Lp,_X$:()=>Dp,yj2:()=>Zv,bzh:()=>am,k66:()=>jo,kiP:()=>Ja,pSg:()=>pe,kz_:()=>Vy,H_U:()=>Fo,t9e:()=>La,j2$:()=>Jp,PFL:()=>Vt,aJ3:()=>Av,To9:()=>Zt,wpo:()=>Id,ADq:()=>Om,UUb:()=>hm,tQX:()=>bm,xy8:()=>Bt,EUG:()=>ar,AFK:()=>It,X3M:()=>nr,WN0:()=>ko,kDl:()=>_s,uDV:()=>vE,IhQ:()=>Ss,pfb:()=>Is,R$r:()=>KE,w80:()=>yo,Pfu:()=>Ua,Gtj:()=>Cl,fyF:()=>Ul,kkq:()=>Do,u5q:()=>bt,O$n:()=>Sd,ptG:()=>wd,f4_:()=>ih,uap:()=>nh,d7q:()=>Uy,liG:()=>My,$oF:()=>Iy,avf:()=>QT,DiQ:()=>HT,cfX:()=>qT,vD3:()=>JT,Qrb:()=>BT,EJQ:()=>KT,HWy:()=>YT,gjS:()=>MT,y6v:()=>WT,JUW:()=>Qy,GtP:()=>mh,_kX:()=>Sa,u1e:()=>wa,sJj:()=>wE,CJp:()=>Th,uKF:()=>SE,wo0:()=>tf,s5:()=>So,cwx:()=>Ro,Y6b:()=>Oy,TTx:()=>df,UtR:()=>vy,HaQ:()=>yf,E6I:()=>Xy,Won:()=>_y,vTU:()=>hy,Nsy:()=>hd,KMQ:()=>UE,Do$:()=>gd,CSV:()=>$s,TMe:()=>gy,l1V:()=>Su,RHh:()=>ku,VQ1:()=>Du,cGG:()=>Lu,z7d:()=>aE,Xaq:()=>Go,Sj8:()=>gA,PJj:()=>Ml,k3T:()=>Mr,PjQ:()=>Ti,s7l:()=>Fc,jLA:()=>hh,GGR:()=>eE,j5q:()=>zT,DnY:()=>Dc,RY5:()=>TE,Px$:()=>kT,KPC:()=>X_,NIY:()=>Wc,HvW:()=>xc,Fof:()=>Da,fX:()=>bh,BTI:()=>Ad,uie:()=>yd,ChB:()=>ld,q27:()=>Cd,vrC:()=>Eb,fAQ:()=>Nf,XkT:()=>Lc,lrH:()=>Pf,nt9:()=>Ur,XH8:()=>Rd,XH2:()=>Fr,jFi:()=>Pd,qhs:()=>po,wwR:()=>_d,Uk3:()=>Ut,ev7:()=>tA,RB9:()=>Yy,iFp:()=>um,e$p:()=>pm,PcX:()=>dm,SpP:()=>cm,R6_:()=>Pv,CY1:()=>Dv,Ajk:()=>wc,Yiz:()=>Sc,FK9:()=>gc,UOo:()=>pO,aTW:()=>cf,uug:()=>Jl,P$2:()=>Fv,XS2:()=>Gl,Hyb:()=>lu,d3Y:()=>hc,Klp:()=>Oc,WxZ:()=>Mv,Gzu:()=>Ru,ZOr:()=>Cc,uqV:()=>Ty,Pm4:()=>ne,hWO:()=>Rt,nHA:()=>oh,nVD:()=>mE,dED:()=>Sy,P2h:()=>Ry,jrr:()=>qa,mmY:()=>Qa,T6O:()=>$o,h6J:()=>qp,hM2:()=>q_,XR6:()=>z,jmz:()=>OE,IHt:()=>bE,NZI:()=>Am,wdF:()=>_f,kgP:()=>Af,ZYI:()=>Rp,QXK:()=>Rl,efz:()=>Sl,Q5d:()=>Pl,Ysv:()=>wl,UWq:()=>lE,ocC:()=>sE,io3:()=>Dr,Sbt:()=>To,roS:()=>fo,Ww1:()=>Eo,QaS:()=>qc,ERZ:()=>D_,CL1:()=>H_,idV:()=>ad,nIW:()=>Pt,fjE:()=>Rv,sG0:()=>fO,tV7:()=>xl,g8o:()=>lg,Qy:()=>sg,t2P:()=>_v,KbW:()=>to,wId:()=>no,LS0:()=>io,bFH:()=>ry,Rgl:()=>iy,fW1:()=>Xm,GFW:()=>ff,Ywp:()=>zO,pg:()=>xd,WSA:()=>ay,fed:()=>Y_,tT_:()=>ws,BgZ:()=>Us,KbL:()=>kc,JBA:()=>jt,aNC:()=>BO,RFJ:()=>Pp,Zeh:()=>Yf,OT5:()=>XO,mC3:()=>vl,kR6:()=>_A,NVY:()=>ZE,k6v:()=>jp,FEC:()=>kp,L5S:()=>XE,Ob5:()=>Ld,KUV:()=>Dd,dvH:()=>zE,Sn:()=>nb,V3i:()=>sb,VD3:()=>jr,mm2:()=>Cu,rou:()=>Lf,izH:()=>Ia,DK$:()=>Ca,KMp:()=>mp,c31:()=>nt,mbo:()=>gm,gT8:()=>ot,CZ8:()=>ls,uGi:()=>fs,Poc:()=>tt,_9k:()=>ms,ZTM:()=>ds,bwT:()=>Ts,tzW:()=>lt,tF$:()=>at,o96:()=>us,M4S:()=>Es,_vs:()=>cp,xF8:()=>xT,PUO:()=>LE,ATu:()=>vm,j1S:()=>pi,V3K:()=>ui,Lmx:()=>ci,ZaZ:()=>rt,n_1:()=>my,N6e:()=>fp,SxO:()=>Ha,w3p:()=>em,xU7:()=>de,Y_p:()=>bo,$k6:()=>ho,Gdl:()=>EO,U6P:()=>TO,OwB:()=>Nv,hTh:()=>hE,xqc:()=>wo,JvE:()=>Io,i29:()=>rc,dzT:()=>wi,uPS:()=>Kc,cZV:()=>Qc,n3B:()=>$g,e6O:()=>Dg,s7j:()=>rg,j$Q:()=>Ky,kW2:()=>Eh,tH7:()=>Po,Yxg:()=>Bs,MaZ:()=>ZT,nqN:()=>XT,jWj:()=>cE,o_J:()=>Wo,hgZ:()=>ud,yW4:()=>Hp,uT0:()=>Yp,C82:()=>Bp,bsH:()=>ah,u9Z:()=>Cf,J$m:()=>Ey,j_Q:()=>Ac,OaI:()=>Nc,wB1:()=>Z_,SP6:()=>Md,ZYr:()=>J_,IMU:()=>Np,FoU:()=>qy,DVz:()=>vO,mxe:()=>Mg,FHr:()=>Gf,D1g:()=>Df,VO3:()=>uv,de5:()=>lv,Uw1:()=>Ee,J6q:()=>_m,XCe:()=>Wa,fbl:()=>ZO,Ir:()=>Za,XQO:()=>eo,QXb:()=>Kd,P8_:()=>mf,iiD:()=>Ep,MOC:()=>Jd,WF:()=>Qd,xE1:()=>fi,idW:()=>dA,QWZ:()=>oO,YL3:()=>Yc,Fn9:()=>E,j2U:()=>ks,MpE:()=>ut,kQw:()=>Wt,mfm:()=>uu,vZp:()=>Ct,E8K:()=>lA,VSb:()=>os,vr_:()=>Gt,Vmh:()=>hA,FgW:()=>ob,oDv:()=>Bo,fGG:()=>sO,kuw:()=>Ho,eHk:()=>uE,Tt2:()=>Yo,pQZ:()=>Qo,oZ7:()=>lO,T6Y:()=>fr,_26:()=>au,YkM:()=>Xt,J6y:()=>Bl,njU:()=>Zl,TBP:()=>qo,IT0:()=>Pm,x_:()=>IE,biM:()=>Od,TMl:()=>vd,Vkd:()=>ru,WiY:()=>Uv,_zi:()=>nu,J6D:()=>Uu,Lt4:()=>lr,QEi:()=>tr,whI:()=>Sr,KIu:()=>Ir,JhM:()=>se,C_0:()=>mr,lzc:()=>kd,qIF:()=>Vg,O27:()=>m,aBi:()=>Ud,xOX:()=>Js,EdS:()=>gt,WgC:()=>vt,eEv:()=>xt,A4t:()=>eu,YOQ:()=>Dt,Wos:()=>dr,jWr:()=>Na,Or$:()=>Jt,lhE:()=>Lr,CwH:()=>er,pzC:()=>Hs,ymH:()=>zl,QZu:()=>Qt,rYH:()=>Iv,FVt:()=>pr,Kn2:()=>ce,jgw:()=>cu,Qgr:()=>Iu,OXP:()=>as,lS4:()=>rr,g5f:()=>Cv,fp6:()=>Ql,Uty:()=>Wi,YkG:()=>Kt,xdS:()=>st,kMF:()=>pT,$NE:()=>_t,bC9:()=>Ot,Ian:()=>di,KVV:()=>RE,q9e:()=>mo,iIf:()=>mO,ian:()=>el,m6e:()=>hr,OFd:()=>Qs,kqr:()=>Yt,fnZ:()=>Rr,VFZ:()=>tl,ZiX:()=>Et,j5n:()=>ur,zkt:()=>A,Pcm:()=>z_,QDV:()=>qs,M5u:()=>wv,laD:()=>xg,mtq:()=>Mt,CtB:()=>hO,CBv:()=>oe,I0t:()=>Er,u1G:()=>nE,gk1:()=>kg,Bgb:()=>jg,uzs:()=>wr,v0l:()=>xu,Zqp:()=>Ay,j0k:()=>Ao,tCm:()=>wt,gmx:()=>Wl,mOr:()=>Ou,TwZ:()=>ug,GyU:()=>QO,zGm:()=>Gd,bMg:()=>uy,EyD:()=>LO,FQA:()=>DO,fZN:()=>dy,xsF:()=>UO,Lxg:()=>CO,O3l:()=>ep,Wni:()=>Zc,wRx:()=>VO,OxG:()=>Zd,uJQ:()=>zd,qWg:()=>OO,i96:()=>$d,zhn:()=>$O,G8q:()=>si,Jct:()=>IT,A9Y:()=>re,Y5F:()=>P_,gxP:()=>ue,c$P:()=>Yl,M7o:()=>dc,BBN:()=>Ba,ZBU:()=>X,UkJ:()=>ao,xkv:()=>Ef,z$M:()=>yA,KAm:()=>Wy,lCl:()=>rT,rkF:()=>Bm,IU6:()=>td,RGr:()=>b,aYu:()=>h,ije:()=>kl,Buf:()=>Tp,YLu:()=>jl,ct9:()=>vo,XkY:()=>cy,T5R:()=>Wd,uQS:()=>yy,wcJ:()=>Oo,d$I:()=>pl,rSp:()=>bd,Sx:()=>Vc,Ilm:()=>Ol,Ki6:()=>zs,VGk:()=>pp,sFD:()=>jh,eWN:()=>TA,dWE:()=>tg,Lkd:()=>OT,aDL:()=>qf,yaA:()=>fy,lOh:()=>kf,DBr:()=>Ov,hK$:()=>$l,TZ_:()=>ed,CMB:()=>Gg,FU8:()=>$c,J$p:()=>Jf,b5s:()=>Kf,h2W:()=>St,SL_:()=>wf,oUH:()=>Vp,ck9:()=>Yd,nL:()=>yO,k$p:()=>Fh,Xs0:()=>Dl,u7I:()=>jf,rxg:()=>fu,bji:()=>Tu,oCZ:()=>$m,MjG:()=>sv,FuV:()=>$p,$ju:()=>Wp,t6d:()=>Gp,m5F:()=>Te,sx:()=>EA,rSc:()=>_O,U10:()=>Pc,L8n:()=>af,R9X:()=>by,rj2:()=>Of,_C4:()=>Xp,tCj:()=>hf,uAg:()=>Ly,wx9:()=>VT,KF3:()=>zp,ax9:()=>Zp,HH7:()=>yp,ufV:()=>ky,_6y:()=>Xc,XTh:()=>tv,AJo:()=>Hc,Ixr:()=>Jy,P6Y:()=>SA,Bd_:()=>km,xkB:()=>jm,W41:()=>Uf,WkI:()=>If,sSE:()=>Dm,GMd:()=>zu,jtL:()=>Zu,Bxm:()=>Mm,FVh:()=>wm,U_T:()=>oy,FTe:()=>ae,VGB:()=>ie,Wfe:()=>Au,Ls5:()=>_u,$bd:()=>mu});var n={};r.r(n),r.d(n,{normalize:()=>c,removeLineBreaks:()=>y,search:()=>p,sort:()=>d});var i={};r.r(i),r.d(i,{clearDateTime:()=>_,formatDate:()=>I,formatDateTime:()=>C,formatTime:()=>U,getEndOfDay:()=>w,getMomentFormatFromDateMask:()=>H,getMomentFormatFromDateTimeMask:()=>J,getMomentFormatFromTimeMask:()=>K,getStartOfDay:()=>S,isToday:()=>A,isValidMomentDate:()=>O,isValidMomentDateOrNull:()=>v,momentToDate:()=>g,parseTimestamp:()=>X,toLocalDate:()=>N,toUtcDate:()=>P});var a={};r.r(a),r.d(a,{XY:()=>Qr,b1:()=>Kr,DU:()=>Hr,ZP:()=>qr});var o={};r.r(o),r.d(o,{addAttribute:()=>Xo,editAttribute:()=>zo,editEndDate:()=>is,editRoles:()=>ts,editStartDate:()=>ns,editTags:()=>rs,removeAttribute:()=>es});var s={};r.r(s),r.d(s,{applyCrosswalks:()=>$E,collectCrosswalksFromAttributes:()=>WE,compareActivenessAttributes:()=>xE,compareAttributes:()=>FE,compareImages:()=>ME,compareRoles:()=>BE,compareTags:()=>YE});var l={};r.r(l),r.d(l,{createHistoryManager:()=>QE});var u=r(17440);const c=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,p=(e,t)=>(t=(c(t)||"").toLowerCase(),(e=(c(e)||"").toLowerCase()).includes(t)),d=(0,u.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),y=(0,u.replace)(/(\r\n|\n|\r)/gm,"");var f=r(95038),T=r.n(f);const E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},m=(0,u.anyPass)([u.isEmpty,u.isNil]),h=e=>()=>new Promise(e),b=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),O=e=>e&&e.isValid(),v=(0,u.either)(O,u.isNil),g=e=>e&&e.toDate(),_=e=>(e&&e.setHours(0,0,0,0),e),A=e=>T()(e).isSame(Date.now(),"day"),N=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},P=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},R=e=>(t,r)=>(r?T().utc(t):T()(t))[e]("day").valueOf(),S=R("startOf"),w=R("endOf"),I=e=>T()(e).format(T().localeData().longDateFormat("L")),U=e=>T()(e).format(T().localeData().longDateFormat("LTS")),C=e=>`${I(e)} ${U(e)}`,L=(0,u.equals)("9"),D=(0,u.equals)("99"),j=(0,u.equals)("9999"),k=(0,u.test)(/^[az][az][az]$/),F=(0,u.test)(/^[az][az][az][az]$/),M=(0,u.test)(/^9+$/),x=(0,u.test)(/^[9az]+$/),$=(0,u.cond)([[L,(0,u.always)("M")],[D,(0,u.always)("MM")],[k,(0,u.always)("MMM")],[F,(0,u.always)("MMMM")],[x,(0,u.always)("Mo")],[u.T,(0,u.always)("MM")]]),V=(0,u.cond)([[L,(0,u.always)("D")],[D,(0,u.always)("DD")],[x,(0,u.always)("Do")],[u.T,(0,u.always)("DD")]]),G=(0,u.cond)([[L,(0,u.always)("y")],[D,(0,u.always)("YY")],[j,(0,u.always)("YYYY")],[M,(0,u.always)("YYYYYY")],[u.T,(0,u.always)("YYYY")]]),W=(e,t)=>(0,u.cond)([[(0,u.both)((0,u.always)(t),L),(0,u.always)("h")],[(0,u.both)((0,u.always)(t),D),(0,u.always)("hh")],[L,(0,u.always)("H")],[D,(0,u.always)("HH")],[u.T,(0,u.always)(t?"hh":"HH")]])(e),Y=(0,u.cond)([[L,(0,u.always)("m")],[D,(0,u.always)("mm")],[u.T,(0,u.always)("mm")]]),B=(0,u.cond)([[L,(0,u.always)("s")],[D,(0,u.always)("ss")],[u.T,(0,u.always)("ss")]]),q=/([9az]+)([^9az]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(q)];if(m(e)||t.length>0){const[,e="",r=""]=(0,u.propOr)([],0,t),[,n="",i=""]=(0,u.propOr)([],1,t),[,a="",o=""]=(0,u.propOr)([],2,t);return(0,u.join)("",[$(e),r,V(n),i,G(a),o])}return e},Q=/(9+)([^9]+)*/g,K=e=>{const t=[...e.toLowerCase().matchAll(Q)];if(m(e)||t.length>0){const[,e="",r=""]=(0,u.propOr)([],0,t),[,n="",i=""]=(0,u.propOr)([],1,t),[,a="",o=""]=(0,u.propOr)([],2,t),s=(0,u.pipe)(u.last,(0,u.propOr)("",2),(0,u.test)(/^[^9]+$/))(t),l=(0,u.reject)(u.isEmpty,[W(e,s),r,Y(n),i,a?B(a):"",o]),c=s?" A":"",p=(0,u.pipe)(u.init,(0,u.append)(c));return(0,u.pipe)((0,u.when)((0,u.always)(s),p),(0,u.join)(""))(l)}return e},J=e=>{const[t="",r=""]=(0,u.pipe)((0,u.indexOf)(" "),u.inc,(0,u.splitAt)(u.__,e),(0,u.map)(u.trim))(e);return`${H(t)} ${K(r)}`},X=e=>{const t=Number(e);return Number.isNaN(t)?e:t},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",Z=e=>({isNone:()=>(0,u.isNil)(e),extract:()=>e,orSome:t=>(0,u.isNil)(e)?t:e,map:t=>(0,u.isNil)(e)?ee.None():ee.Some(t(e))}),ee={Some:Z,None:()=>Z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?ee.Some(e):ee.None()},fromNull:function(e){return null==e?ee.None():ee.Some(e)},fromUndefined:function(e){return void 0===e?ee.None():ee.Some(e)},fromEmpty:function(e){return m(e)?ee.None():ee.Some(e)}},te=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},re=(e,t)=>(r,n)=>{const i=t?(0,u.prop)(t):u.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ne=(0,u.when)((0,u.is)(Array),(0,u.prop)(0)),ie=e=>Array.isArray(e)?e:[e],ae=e=>[e],oe=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),se=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),le=e=>(e=(e||"").toLowerCase(),se(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),ue=(0,u.when)((0,u.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ce=e=>null!=e&&["object","function"].includes(typeof e),pe=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ce(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},de=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,u.cond)([...n.map((e=>[(0,u.prop)(e),(0,u.prop)(e)])),[(0,u.always)(t),(0,u.always)(t)],[u.T,(0,u.always)(e)]])(e)},ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,u.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,u.pluck)("percent",i);const s=Math.sign(o),l=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<l.length;e++)l[e].percent=n(l[e].percent+c),o=n(o-c);return(0,u.pipe)((0,u.sortBy)((0,u.prop)("index")),(0,u.pluck)("percent"))(l)},fe=/[\n\r%#()<>?[\\\]^`{}|]/g,Te=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(fe,encodeURIComponent)}`,Ee=e=>`data:image/gif;base64,${e}`;var me=r(76665);let he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,Le,De,je,ke,Fe,Me,xe,$e,Ve,Ge,We,Ye,Be,qe,He,Qe,Ke,Je;var Xe;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(he||(he={})),function(e){e.local="local",e.validationService="validationService"}(be||(be={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Oe||(Oe={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(ve||(ve={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ge||(ge={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(_e||(_e={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(Ae||(Ae={})),function(e){e.asc="asc",e.desc="desc"}(Ne||(Ne={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Pe||(Pe={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Re||(Re={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Se||(Se={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(we||(we={})),function(e){e.PROFILE="profile",e.MAP="map"}(Ie||(Ie={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ue||(Ue={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ce||(Ce={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Le||(Le={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(De||(De={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(je||(je={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(ke||(ke={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(Fe||(Fe={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Me||(Me={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(xe||(xe={})),function(e){e.IN="in",e.OUT="out"}($e||($e={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ve||(Ve={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(Ge||(Ge={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(We||(We={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.SingleAttribute="com.reltio.plugins.entity.attributes.SingleAttributeView",e.AttributeTable="com.reltio.plugins.entity.attributes.AttributeTableView",e.Custom="com.reltio.plugins.ui.CustomActionView",e.Map="com.reltio.plugins.react.EntityMapView",e.ImageAttribute="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatches="com.reltio.plugins.entity.PotentialMatchesView"}(Ye||(Ye={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Be||(Be={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting"}(qe||(qe={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(He||(He={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Qe||(Qe={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(Ke||(Ke={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(Je||(Je={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Xe||(Xe={}));const ze=Xe;let Ze,et;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Ze||(Ze={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(et||(et={}));const tt=(0,u.prop)("referencedEntityTypeURI"),rt=(0,u.prop)("relationshipTypeURI"),nt=(0,u.prop)("referencedAttributeURIs"),it=(0,u.curry)(((e,t)=>(0,u.pipe)(nt,(0,u.filter)((0,u.startsWith)(e)))(t))),at=it("configuration/relationTypes"),ot=it("configuration/entityTypes"),st=(0,u.pipe)((0,u.prop)("uri"),(0,u.startsWith)("configuration/relationTypes")),lt=(0,u.filter)(st),ut=(e,t)=>!t||t.some((t=>t===e.uri)),ct="1Tempo4rary",pt="1Tepmo4Rel",dt=(0,u.cond)([[u.isNil,(0,u.always)("")],[(0,u.test)(/[^/]$/),(0,u.concat)(u.__,"/")]]),yt=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,ft=e=>()=>yt(e),Tt=(e,t)=>{const r=dt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return yt(n)},Et=e=>e&&e.includes("uri$$"),mt=ft("entities"),ht=ft("relations"),bt=(0,u.pipe)((0,u.split)("/attributes/"),(0,u.prop)("0")),Ot=(0,u.startsWith)("relations/"),vt=(0,u.startsWith)("entities/"),gt=(0,u.pipe)((0,u.defaultTo)(""),(0,u.startsWith)("configuration/entityTypes/")),_t=(0,u.pipe)((0,u.defaultTo)(""),(0,u.startsWith)("configuration/relationTypes/")),At=(0,u.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Nt=(0,u.pipe)((0,u.split)("/"),u.head),Pt=(0,u.pipe)((0,u.split)("/"),u.last),Rt=e=>e.split(".").slice(0,2).join("."),St=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},wt=(0,u.curry)(((e,t)=>`${e}/attributes/${t}`)),It=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},Ut=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Ct=(0,u.either)((0,u.startsWith)("attributes."),(0,u.startsWith)("analyticsAttributes.")),Lt=e=>2===e.split("/").length,Dt=e=>5===e.split("/").length,jt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},kt=e=>e.replace(/uri\$\$/g,ct);function Ft(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mt=(0,u.allPass)([(0,u.propSatisfies)((0,u.either)(u.isNil,gt),"uri"),(0,u.prop)("faceted"),(0,u.propEq)("type",ze.TYPE_STRING)]),xt=(0,u.has)("values"),$t=(0,u.cond)([[(0,u.has)("dependentLookupCode"),(0,u.always)(ze.TYPE_DEPENDENT_LOOKUP)],[(0,u.has)("lookupCode"),(0,u.always)(ze.TYPE_LOOKUP)],[xt,(0,u.always)(ze.TYPE_ENUM)],[Mt,(0,u.always)(ze.TYPE_TYPEAHEAD)],[(0,u.propEq)("type",ze.TYPE_BOOLEAN),(0,u.always)(ze.TYPE_BOOLEAN_RADIO)],[u.T,(0,u.prop)("type")]]),Vt=(0,u.pipe)((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ft(e,t,r[t])}))}return e}({},e,{type:$t(e)})),(0,u.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Gt=e=>!!e&&(!!e.autoGenerated&&e.type!==ze.TYPE_NESTED||!!e.parentAutoGenerated),Wt=(0,u.pipe)((0,u.when)((0,u.pipe)(u.type,(0,u.test)(/Object/)),(0,u.prop)("uri")),(0,u.test)(/\/analyticsAttributes\//)),Yt=(0,u.pipe)((0,u.when)((0,u.pipe)(u.type,(0,u.test)(/Object/)),(0,u.prop)("uri")),(0,u.startsWith)("configuration/"),u.not),Bt=e=>Wt(e)?"analyticsAttributes":"attributes",qt=(0,u.propEq)("hidden",!0),Ht=(0,u.curry)(((e,t)=>(0,u.pipe)((0,u.when)((0,u.pipe)(u.type,(0,u.test)(/Object/)),(0,u.prop)("type")),(0,u.equals)(e))(t))),Qt=Ht(ze.TYPE_NESTED),Kt=Ht(ze.TYPE_REFERENCE),Jt=Ht(ze.TYPE_IMAGE),Xt=(0,u.either)(Qt,Kt),zt=(e,t)=>{const r=Wt(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,u.chain)((0,u.prop)("name"),t),(0,u.last)(n)]:[...n.slice(1)]].join(".")},Zt=(0,u.either)((0,u.prop)("lookupCode"),(0,u.prop)("dependentLookupCode")),er=(0,u.pipe)(Zt,Boolean),tr=(0,u.pipe)((0,u.prop)("dependentLookupCode"),Boolean),rr=(0,u.both)(er,(0,u.pipe)(Zt,("rdm",(0,u.pipe)(Nt,(0,u.equals)("rdm")))));const nr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Bt({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,u.propEq)("uri",r)):null,s=o?i(o.uri):0,l=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,u.last)(o.split(`/${n}/`)),c=(r?r[n]||ar(e,r)||[]:a).find((e=>{let{uri:t,name:r}=e;return t===o||r===s})),p=c?[c]:[];return c&&o!==t&&p.push(...l(c,i+1)),p},c=l(o,s),p=c.length===i(t)-s;return p?c:[]},ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=nr(e,t,r);return n.length?(0,u.last)(n):null},ar=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,u.cond)([[(0,u.has)("analyticsAttributes"),(0,u.prop)("analyticsAttributes")],[(0,u.anyPass)([(0,u.propEq)("type",ze.TYPE_NESTED),(0,u.propEq)("type",ze.TYPE_IMAGE)]),(0,u.prop)("attributes")],[(0,u.propEq)("type",ze.TYPE_REFERENCE),(0,u.pipe)(nt,(0,u.map)((t=>ir(e,t))),(0,u.reject)(u.isNil))],[u.T,(0,u.always)(null)]])(t)},or=[ze.TYPE_ACTIVENESS_DATE,ze.TYPE_DATE,ze.TYPE_TIMESTAMP,ze.TYPE_LOCAL_DATE],sr=[ze.TYPE_ACTIVENESS_DATE,ze.TYPE_TIMESTAMP,ze.TYPE_LOCAL_DATE],lr=e=>or.includes(e),ur=e=>sr.includes(e),cr=[ze.TYPE_INT,ze.TYPE_LONG,ze.TYPE_NUMBER,ze.TYPE_FLOAT,ze.TYPE_DOUBLE,ze.TYPE_COUNT],pr=e=>cr.includes(e),dr=e=>[ze.TYPE_FLOAT,ze.TYPE_DOUBLE].includes(e),yr=[ze.TYPE_BOOLEAN,ze.TYPE_BOOLEAN_RADIO,ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED],fr=e=>yr.includes(e),Tr=[ze.TYPE_URL,ze.TYPE_BLOG_URL,ze.TYPE_IMAGE_URL],Er=e=>Tr.includes(e),mr=Ht(ze.TYPE_EMAIL),hr=e=>ze.TYPE_SSN===e;var br,Or=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(br||(br={}));const vr=(0,u.curry)(((e,t,r)=>{var n;const i=e===br.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),gr=(0,u.compose)((0,u.join)("&"),(0,u.map)((0,u.join)("=")),(0,u.map)((0,u.map)(encodeURIComponent)),u.toPairs),_r=(0,u.compose)((0,u.unless)(u.isEmpty,(e=>`?${e}`)),gr),Ar=(0,u.pipe)((0,u.reject)(m),_r),Nr=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r={dcrObjectUris:[],dcrUri:t},n=e=>e&&e.includes("changeRequest"),i=(0,u.propSatisfies)(n,"uri"),a=(0,u.pipe)((0,u.prop)("changes"),u.keys),o=(0,u.when)(i,(0,u.applySpec)({dcrObjectUris:a,dcrUri:(0,u.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},l=(0,u.pipe)(o,s),c=(0,u.pipe)((0,u.prop)("dcrUri"),(0,u.unless)(u.isNil,(0,u.pipe)((0,u.split)("/"),(0,u.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+gr(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;return{updateDCRUriFromResponse:l,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f}},Pr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Rr=(0,u.equals)(Pr.SUGGESTING),Sr=(0,u.equals)(Pr.EDITING),wr=(0,u.equals)(Pr.VIEWING),Ir=(0,u.either)(Sr,Rr),Ur=(0,u.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,u.find)((0,u.propEq)("uri",t),r)})),Cr=(0,u.curry)(((e,t)=>(0,u.pipe)(Ur(e),(0,u.prop)("extendsTypeURI"))(t))),Lr=(0,u.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Cr(e,r)));return n(r)})),Dr=(0,u.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Cr(e,n);return r})),jr=(e,t,r)=>(0,u.prop)(r,t)?t[r]:(0,u.prop)("extendsTypeURI",t)?jr(e,Ur(e,t.extendsTypeURI),r):void 0,kr=(e,t)=>{const r=t.map(Dr(e));return(r.length?r.reduce(u.intersection):[])[0]},Fr=(e,t)=>jr(e,(0,u.is)(Object,t)?t:Ur(e,t),"typeImage"),Mr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Lr(e,t,n.uri)?r.concat(n.uri):r),[]),xr={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},$r={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},Vr={[xr.EQUALS]:"equals",[xr.NOT_EQUALS]:"not",[xr.STARTS_WITH]:"starts with",[xr.MISSING_VALUE]:"missing value",[xr.IN_RANGE]:"in range",[xr.HAS_ALL]:"has all",[xr.FULL_TEXT]:"full text",[xr.EXISTS]:"exists",[xr.COUNT_EQUALS]:"count equals",[xr.COUNT_NOT_EQUALS]:"count not equal",[xr.COUNT_LT]:"count less",[xr.COUNT_LTE]:"count less or equal",[xr.COUNT_GT]:"count greater",[xr.COUNT_GTE]:"count greater or equal",[xr.COUNT_RANGE]:"count in range",[xr.LT]:"less than",[xr.LTE]:"less than or equal",[xr.GT]:"greater than",[xr.GTE]:"greater than or equal",[xr.IN_FILE]:"in file",[xr.NOT_IN_FILE]:"not in file",[xr.CONTAINS]:"contains",[xr.ON]:"on",[xr.BEFORE]:"before",[xr.AFTER]:"after",[xr.WITHIN]:"within"},Gr="in",Wr="notIn",Yr="not range",Br=e=>({[Gr]:xr.EQUALS,[Wr]:xr.NOT_EQUALS}[e]||e);var qr,Hr;!function(e){e.LAST_DAY="lastDay",e.LAST_WEEK="lastWeek",e.LAST_MONTH="lastMonth",e.LAST_6MONTHS="last6Months",e.LAST_YEAR="lastYear",e.PICK_DATE="pickDate"}(qr||(qr={})),function(e){e.LAST_3DAYS="last3Days"}(Hr||(Hr={}));const Qr=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=qr[t]||Hr[t],e)),{}),Kr={[qr.LAST_DAY]:"Last 24 hours",[Hr.LAST_3DAYS]:"Last 3 days",[qr.LAST_WEEK]:"Last 7 days",[qr.LAST_MONTH]:"Last month",[qr.LAST_6MONTHS]:"Last 6 months",[qr.LAST_YEAR]:"Last year",[qr.PICK_DATE]:"Pick date"},Jr={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Xr={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},zr="<No label>",Zr={IN:"in",OUT:"out"};var en=r(87918),tn=r.n(en);function rn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nn(e,t,r[t])}))}return e}function nn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const an={startDate:{type:ze.TYPE_ACTIVENESS_DATE,get label(){return tn().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:ze.TYPE_ACTIVENESS_DATE,get label(){return tn().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},on=rn({id:{type:ze.TYPE_ENTITY_ID,get label(){return tn().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},an,{roles:{type:ze.TYPE_STRING,get label(){return tn().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:ze.TYPE_STRING,get label(){return tn().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),sn={workflow:{type:ze.TYPE_STRING,get label(){return tn().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:ze.TYPE_STRING,get label(){return tn().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:ze.TYPE_STRING,get label(){return tn().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},ln={commenter:{type:ze.TYPE_STRING,get label(){return tn().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},un={notResolved:{type:ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return tn().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},cn={createdBy:{type:ze.TYPE_STRING,get label(){return tn().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:ze.TYPE_STRING,get label(){return tn().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},pn={matches:{type:ze.TYPE_COUNT,get label(){return tn().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:ze.TYPE_COUNT,get label(){return tn().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},dn={sourceSystems:{type:ze.TYPE_STRING,get label(){return tn().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:ze.TYPE_STRING,get label(){return tn().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:ze.TYPE_INT,get label(){return tn().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:ze.TYPE_STRING,get label(){return tn().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let yn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(yn||(yn={}));const fn={[yn.matchRules]:{type:ze.TYPE_STRING,get label(){return tn().text("Match Rules")},uri:yn.matchRules,name:yn.matchRules,faceted:!0,hideForDataTenant:!0},[yn.MLRecommendedMatch]:{type:ze.TYPE_STRING,get label(){return tn().text("Match IQ")},uri:yn.MLRecommendedMatch,name:yn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Tn=rn({},on,sn,ln,un,cn,pn,dn,fn,{type:{type:ze.TYPE_STRING,get label(){return tn().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),En="NOT_MATCH";var mn=r(13980),hn=r.n(mn);function bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){On(e,t,r[t])}))}return e}function On(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vn=hn().oneOf(["mobile","tablet","desktop"]),gn=hn().shape({deviceTypes:hn().oneOfType([vn,hn().arrayOf(vn)]),roles:hn().arrayOf(hn().string)}),_n=hn().shape({value:hn().string,lookupCode:hn().string}),An=hn().shape({link:hn().string,filename:hn().string}),Nn=hn().shape({displayName:hn().string,parent:hn().string}),Pn=hn().oneOfType([hn().string,hn().number,hn().bool,_n]),Rn=hn().oneOfType([Pn,hn().arrayOf(Pn)]),Sn=hn().shape({fieldName:hn().string,values:hn().arrayOf(Rn),filter:hn().string,type:hn().string}),wn=hn().shape({minValue:hn().number,maxValue:hn().number}),In=hn().shape({label:hn().string,name:hn().string,description:hn().string,type:hn().string,hidden:hn().bool,faceted:hn().bool,searchable:hn().bool,uri:hn().string,access:hn().arrayOf(hn().string),cardinality:wn}),Un=hn().shape({label:hn().string,uri:hn().string,typeColor:hn().string,direction:hn().string,startObject:hn().object,endObject:hn().object}),Cn=hn().shape({typeColor:hn().string,typeIcon:hn().string,typeImage:hn().string,label:hn().string,uri:hn().string,attributes:hn().arrayOf(In)}),Ln=hn().shape({uri:hn().string,label:hn().string,memberTypes:hn().array,extendsTypeUri:hn().string,attributes:hn().arrayOf(In)}),Dn=hn().shape({uri:hn().string,label:hn().string,extendsTypeUri:hn().string,relationshipTypeURIs:hn().arrayOf(hn().string)}),jn=hn().shape({uri:hn().string,description:hn().string,label:hn().string,schemaVersion:hn().string,entityTypes:hn().arrayOf(Cn),roles:hn().arrayOf(hn().object),groupTypes:hn().arrayOf(hn().object),relationTypes:hn().arrayOf(Un),graphTypes:hn().arrayOf(Dn),interactionTypes:hn().arrayOf(Ln),sources:hn().arrayOf(hn().object)}),kn=hn().shape({uri:hn().string,type:hn().string}),Fn=hn().shape({uri:hn().string,attributes:hn().object,type:hn().string,timestamp:hn().number,members:hn().object}),Mn=hn().shape({uri:hn().string,type:hn().string}),xn=hn().shape({value:hn().object,ov:hn().bool,type:hn().string,uri:hn().string}),$n=hn().shape({refEntity:hn().oneOfType([hn().array,hn().object]),refRelation:hn().oneOfType([hn().array,hn().object]),value:hn().object,ov:hn().bool,type:hn().string,uri:hn().string}),Vn=hn().oneOf((0,u.values)(Pr)),Gn=hn().shape({type:hn().oneOf(Object.values(he)).isRequired,attributeTypeUri:hn().string.isRequired,parentUri:hn().string.isRequired,uri:hn().string,message:hn().string}),Wn={attributeType:In,showEmptyEditors:hn().bool,lazy:hn().bool,mode:Vn,metadata:jn,ownError:Gn,errors:hn().arrayOf(Gn),crosswalks:hn().array,onAddAttributes:hn().func,onAddOneMore:hn().func,onDeleteAttribute:hn().func,onChangeAttribute:hn().func,additionalControlsRenderer:hn().func,hideDeleteButton:hn().bool,showNonOv:hn().bool,state:hn().oneOf(["deleted","edited"]),expanded:hn().bool},Yn=bn({attributeValue:xn},Wn),Bn=bn({attributeValue:$n},Wn),qn=hn().shape({value:hn().oneOfType([hn().string,hn().bool,hn().number]),ov:hn().bool,type:hn().string,uri:hn().string,lookupCode:hn().string,lookupRawValue:hn().string}),Hn=hn().shape({totalOvValues:hn().number,totalValues:hn().number}),Qn=hn().shape({inRelations:hn().arrayOf(hn().oneOfType([hn().object,hn().string])),outRelations:hn().arrayOf(hn().oneOfType([hn().object,hn().string])),groups:hn().arrayOf(hn().string),entityTypes:hn().arrayOf(hn().string),nextEntry:hn().object}),Kn=hn().oneOf(["asc","desc"]),Jn=hn().shape({id:hn().string,content:Qn,allowOnlyCreateNew:hn().bool,sortColumn:hn().string,sortOrder:Kn,"text-empty":hn().string,max:hn().number,icon:hn().string,caption:hn().string,canCreate:gn,canRead:gn,canUpdate:gn,canDelete:gn,editingEnabled:hn().bool}),Xn=hn().shape({id:hn().string,caption:hn().string,pageSize:hn().number,icon:hn().string,canCreate:gn,canRead:gn,canUpdate:gn,canDelete:gn,attributes:hn().object}),zn=hn().shape({entityUri:hn().string,entityType:hn().string,entityLabel:hn().string,object:kn}),Zn=hn().shape({relationUri:hn().string,relationType:hn().string,relationLabel:hn().string,direction:hn().string,object:Mn}),ei=hn().shape({entity:zn,relation:Zn}),ti=hn().shape({value:hn().string,isRawFilter:hn().bool}),ri=hn().shape({id:hn().string,label:hn().string,name:hn().string,availableEntityTypes:hn().array}),ni=hn().shape({id:hn().string,allowMergeAll:hn().bool,matchActions:hn().object,availableTabs:hn().arrayOf(hn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ii=hn().shape({matchRules:hn().arrayOf(hn().string),object:kn,shortestTransitiveMatchPath:hn().arrayOf(hn().shape({matchRules:hn().arrayOf(hn().string),match:hn().string})),direct:hn().bool,matchScore:hn().number}),ai=hn().arrayOf(ii),oi=hn().arrayOf(hn().shape({uri:hn().string,label:hn().string})),si=[{label:tn().text("And"),value:"and"},{label:tn().text("Or"),value:"or"},{label:tn().text("And not"),value:"and not"},{label:tn().text("Or not"),value:"or not"}];function li(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ui=(0,u.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,u.find)((0,u.propEq)("uri",t),r)})),ci=(0,u.pipe)(ui,(0,u.propOr)("","label")),pi=(0,u.curry)(((e,t)=>{const r=ui(e,t);return[(0,u.path)(["startObject","objectTypeURI"],r),(0,u.path)(["endObject","objectTypeURI"],r)]})),di=(0,u.curry)(((e,t,r)=>{const[n,i]=pi(e,r);return Lr(e,n,t)||Lr(e,i,t)})),yi=(0,u.pipe)((0,u.propOr)([],"relationTypes"),(0,u.reduce)(((e,t)=>{let{uri:r,label:n}=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){li(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),fi=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?Zr.OUT:Zr.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,u.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Zr.IN),i=r(Zr.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ti=(0,u.pathOr)("",["directionalContext",0,"labelPattern"]),Ei={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},mi=(0,u.curry)(((e,t)=>e.every((e=>hi(e,t))))),hi=(0,u.curry)(((e,t)=>{const r=Gt(t);return bi(e,t)&&(e===Ei.READ||!r)})),bi=(e,t)=>!t||!t.access||t.access.includes(e),Oi=(0,u.curry)(((e,t,r)=>hi(Ei.READ,r)&&(Rr(t)?hi(Ei.INITIATE_CHANGE_REQUEST,r):hi(e,r)))),vi=Oi(Ei.CREATE),gi=Oi(Ei.DELETE),_i=Oi(Ei.UPDATE),Ai=mi([Ei.CREATE,Ei.MERGE,Ei.READ,Ei.UPDATE]),Ni=mi([Ei.UPDATE,Ei.READ,Ei.CREATE]),Pi=mi([Ei.UPDATE,Ei.READ]),Ri=mi([Ei.DELETE,Ei.UPDATE,Ei.READ]),Si=(0,u.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,u.pipe)((0,u.propOr)([],"matchGroups"),(0,u.find)((0,u.propEq)("uri",t)),(0,u.defaultTo)({}),(0,u.prop)("type"))(e))(t,r)]||e["*"])),wi=(e,t,r)=>(0,u.pipe)((0,u.map)(Si(e,t)),(0,u.filter)(u.identity))(r),Ii=(e,t,r)=>{const n=wi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&hi(Ei.MERGE,r)},Ui=(0,u.curry)(((e,t,r,n)=>{const i=ui(e,n),[a,o]=pi(e,n);return i&&hi(Ei.CREATE,i)&&Lr(e,a,t.type)&&Lr(e,o,r.type)})),Ci=(e,t,r,n,i)=>{const a=Ur(e,n.type),o=wi(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(u.identity);return o.some((t=>{let{inRelations:r,outRelations:a}=t;return r.some(Ui(e,n,i))||a.some(Ui(e,i,n))}))},Li=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Ur(e,r.type),o=(0,u.propOr)({},"matchActions",t);return{canMerge:Ii(o,i,a),canAddRelation:Ci(e,o,i,r,n),canMark:hi(Ei.UPDATE,a)&&hi(Ei.READ,a)}},Di=(e,t,r,n)=>(0,u.pipe)((0,u.map)((n=>Li(e,t,n.object,r,n.matchRules))),(0,u.reduce)((0,u.mergeWith)(u.and),{}))(n),ji=Wt,ki=(0,u.complement)(ji),Fi=hi(Ei.READ),Mi=e=>{let{attributeType:t,mode:r}=e;return ki(t)&&vi(r,t)&&!qt(t)},xi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Et(r.uri),o=_i(n),s=vi(n);return(0,u.cond)([[ji,u.F],[(0,u.always)(a),u.T],[(0,u.always)(i),o],[u.T,(0,u.allPass)([o,s])]])(t)},$i=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Et(r.uri),s=_i(n),l=gi(n),c=Gi(Ei.UPDATE,n,a,r),p=Gi(Ei.DELETE,n,a,r);return(0,u.cond)([[ji,u.F],[(0,u.always)(o),u.T],[(0,u.always)(i),(0,u.allPass)([l,p])],[u.T,(0,u.allPass)([s,l,c,p])]])(t)},Vi=(0,u.curry)(((e,t,r,n)=>{const i=ar(t,n);return!i||!(0,u.pipe)((0,u.unless)(Array.isArray,u.of),(0,u.map)((0,u.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!bi(e,n)||!Vi(e,t,r[n.name],n)))))})),Gi=(0,u.curry)(((e,t,r,n,i)=>Rr(t)?Vi(Ei.INITIATE_CHANGE_REQUEST,r,n,i):Vi(e,r,n,i))),Wi=(0,u.both)((0,u.complement)(qt),Fi),Yi="SuperUser",Bi="allTenants",qi=[Bi,"allCustomers"],Hi=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return u.T;case r.SECURED:return e=>void 0!==e.userPermissions;default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,u.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===Yi})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,u.endsWith)(["*"],o)?o.slice(0,-1):o,(0,u.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===Yi){const e=r?qi.concat(r.map((e=>`allTenants.${e}`))):qi,n=r&&t[0]===Bi?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,u.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:u.F}var t}))},Qi={NON_SECURED:"NON_SECURED",SECURED:"SECURED",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},Ki={[Qi.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Qi.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Qi.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Qi.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Qi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Qi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Qi.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Qi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Qi.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Qi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Qi.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Qi.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Qi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Qi.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Qi.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Qi.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Qi.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Qi.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Qi.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Qi.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Qi.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Qi.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Qi.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Qi.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Qi.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Ji=(0,u.curry)(((e,t,r)=>Hi({allowedPermissionsNames:e,permissionsNames:Qi,permissionsConfig:Ki}).some((e=>e(t,{params:{tenant:r}}))))),Xi=Ji([Qi.CAN_EXPORT]),zi=Ji([Qi.CAN_EXPORT_ACTIVITIES]),Zi=Ji([Qi.CAN_IMPORT_ENTITIES_FROM_DT]),ea=Ji([Qi.CAN_READ_ENTITIES_FROM_DT]),ta=Ji([Qi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ra=Ji([Qi.CAN_UPDATE_PROCESS_INSTANCE]),na=Ji([Qi.CAN_VIEW_WORKFLOW_DEFINITION]),ia=Ji([Qi.CAN_CONFIG_ENVIRONMENT_REGISTER]),aa=Ji([Qi.CAN_UPDATE_WORKFLOW_DATA_TASK]),oa=Ji([Qi.CAN_READ_WORKFLOW_DATA_TASK]),sa=Ji([Qi.CAN_MANAGE_WORKFLOW_DEFINITION]),la=Ji([Qi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),ua=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),ca=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),pa=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),da=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ya=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS]),fa=Ji([Qi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ta=Ji([Qi.CAN_CREATE_CONFIG_JAR]),Ea=Ji([Qi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ma=Ji([Qi.CAN_VIEW_CONFIG_JAR]),ha=Ji([Qi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),ba=Ji([Qi.CAN_VIEW_WORKFLOW_JOBS]),Oa=Ji([Qi.CAN_MAKE_BULK_UPDATE]),va=Ji([Qi.CAN_OPEN_DATA_LOADER_EXECUTE,Qi.CAN_OPEN_DATA_LOADER_READ]),ga=Ji([Qi.CAN_BULK_DELETE_PROFILES]),_a=Ji([Qi.CAN_READ_MDM_DATA_ENTITIES]),Aa=Ji([Qi.CAN_READ_DVF]),Na=Ji([Qi.IS_FREEMIUM_ADMIN]),Pa=(0,u.reject)(qt),Ra=(e,t)=>(0,u.pipe)((0,u.defaultTo)([]),Pa,(0,u.filter)(e))(t),Sa=(0,u.curry)(((e,t)=>Ra((t=>Mi({attributeType:t,mode:e})),t))),wa=(0,u.curry)(((e,t)=>Ra((t=>Mi({attributeType:t,mode:e})||Wi(t)),t))),Ia=(0,u.pipe)((0,u.defaultTo)([]),(0,u.filter)(Wi)),Ua=(0,u.pipe)((0,u.propOr)([],"attributes"),(0,u.chain)((0,u.when)((0,u.has)("attributes"),(e=>[e,...Ua(e)])))),Ca=(0,u.pipe)((0,u.propOr)([],"attributes"),(0,u.filter)(Wi),(0,u.chain)((0,u.when)((0,u.has)("attributes"),(e=>[e,...Ca(e)])))),La=(0,u.pipe)((0,u.propOr)([],"analyticsAttributes"),(0,u.chain)((0,u.when)((0,u.has)("analyticsAttributes"),(e=>[e,...La(e)])))),Da=(0,u.pipe)(Ur,(0,u.converge)(u.concat,[Ca,La]));function ja(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ka(e,t,r[t])}))}return e}function ka(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fa=(0,u.curry)(((e,t)=>(0,u.evolve)({attributes:(0,u.map)((0,u.pipe)(e,Fa(e)))},t))),Ma=e=>{var t;return ja({},e,{matchGroups:(0,u.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},xa=(0,u.both)((0,u.has)("values"),(0,u.has)("lookupCode")),$a=(0,u.when)(xa,(0,u.dissoc)("values")),Va=(0,u.when)((0,u.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return ja({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),Ga=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Wa=(0,Or.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,u.chain)(Ua,t).concat((0,u.chain)(Ua,r)).some(Ga)})),Ya=e=>{let t=!1;const r=Fa((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?ja({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ba=e=>{const t=Wa(e),r=(0,u.map)((e=>Fa((0,u.pipe)($a,(0,u.when)((0,u.always)(e),Va))))(t)),n=(0,u.map)(Ma),i=(0,u.map)(Ya);return(0,u.evolve)({entityTypes:(0,u.pipe)(r,n,i),relationTypes:(0,u.pipe)(r,i)},e)},qa=(0,u.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,u.find)((0,u.propEq)("uri",t),r)})),Ha=(0,u.prop)("relationshipTypeURIs"),Qa=(0,u.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Ka(e,t)))||[]})),Ka=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(di(e,t))},Ja=(e,t)=>(0,u.pipe)(qa,(0,u.defaultTo)({}),Ha,(0,u.defaultTo)([]),(0,u.chain)(pi(e)),(0,u.reject)(u.isNil),u.uniq,(0,u.map)(Ur(e)))(e,t),Xa=(0,u.allPass)([(0,u.propEq)("matchMethod","match_iq"),(0,u.anyPass)([(0,u.propEq)("scope","ALL"),(0,u.propEq)("scope","INTERNAL")])]),za=e=>(0,u.pipe)((0,u.defaultTo)({}),(0,u.prop)("matchGroups"),(0,u.defaultTo)([]),(0,u.any)(e)),Za=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return za((0,u.complement)(Xa))(e)},eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return za(Xa)(e)},to=(0,u.pipe)(Ur,(0,u.propOr)([],"matchGroups")),ro=(e,t,r)=>(0,u.pipe)(to,(0,u.find)((0,u.propEq)("uri",r)))(e,t),no=(0,u.curry)(((e,t,r)=>(0,u.pipe)(ro,(0,u.propOr)(r,"label"))(e,t,r))),io=(0,u.curry)(((e,t,r)=>{const n=(0,u.pipe)(to,(0,u.filter)((0,u.pipe)((0,u.prop)("uri"),(0,u.includes)(u.__,r))))(e,t),i=(0,u.pipe)((0,u.map)((0,u.prop)("uri")),(0,u.without)(u.__,r),(0,u.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),ao=e=>(0,u.partition)(Xa,e),oo=(0,u.includes)(u.__,["and","or","not"]),so=(0,u.includes)(u.__,(0,u.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),lo=(0,u.includes)(u.__,["equals","notEquals","in"]),uo=(0,u.pipe)(u.toPairs,(0,u.chain)((e=>{let[t,r]=e;return oo(t)?uo(r):so(t)?r.filter(gt):lo(t)?r.map((0,u.prop)("uri")).filter(gt):[]})),u.uniq),co=(0,u.pipe)((0,u.pluck)("rule"),(0,u.chain)(uo),u.uniq),po=(0,u.pipe)(to,co),yo=(0,u.pipe)(io,co),fo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,u.find)((0,u.propEq)("uri",t),r)},To=(0,u.pipe)(fo,Ca),Eo=(e,t)=>(e.interactionTypes||[]).filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||Lr(e,n,t)})(e,t))})(e,t)),mo=e=>!!e.required,ho=(e,t,r)=>{const n=(0,u.cond)([[gt,Ur(e)],[_t,ui(e)]])(t);return bo(e,n,r)},bo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&gt(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Gt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===ze.TYPE_REFERENCE){const n=rt(t),a=nt(t);i=ho(e,n,r).filter((e=>a.some(At(e.uri))))}else t.attributes&&(i=bo(e,t,r));i&&n.push(...i)}return n})):t.type===ze.TYPE_REFERENCE?ho(e,rt(t),r):[],Oo=e=>{const t=(0,u.pipe)((0,u.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),u.values,(0,u.filter)(u.identity))(e);return(0,u.filter)((0,u.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,u.any)((0,u.anyPass)([(0,u.includes)(n),(0,u.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),mo]),e.attributes||[])},vo=(e,t)=>{const r=ot(e);return(0,u.pipe)((0,u.filter)((e=>r.includes(e.uri))),(0,u.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},go=(0,u.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?tn().text(n):n};return r(null,t)})),_o=["label","description","abbreviation","caption","toolTip"],Ao=e=>go(_o,e),No=(0,u.curry)(((e,t)=>{const{sources:r}=e,n=Pt(t);return r.find((e=>{let{uri:t}=e;return Pt(t)===n}))})),Po=(0,u.curry)(((e,t)=>{const r=Pt(t);return(0,u.pipe)(No(u.__,t),(0,u.unless)(u.isNil,(0,u.propOr)(r,"label")))(e)})),Ro=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,u.propEq)("uri","configuration/sources/Reltio")))?t:null==t?void 0:t.concat({uri:"configuration/sources/Reltio",label:"Reltio",icon:"images/source/reltio.png",abbreviation:"Reltio"})},So=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},wo=(0,u.curry)(((e,t)=>{let{roles:r}=e;return(0,u.pipe)((0,u.find)((0,u.propEq)("uri",t)),(0,u.prop)("label"))(r)})),Io=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Ur(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Uo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Co(e,t,r[t])}))}return e}function Co(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return Do(i,e,t,r,n)},Do=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return ee.fromNull(e&&e.length?e:ar(t,r)).map((e=>e.map((e=>{const r=Lo(t,e,n,i);return r.length?Uo({},e,{children:r}):e})))).orSome([]).filter((0,u.either)((0,u.complement)(Xt),(0,u.prop)("children"))).filter(Wi).filter(n).filter((0,u.either)((0,u.prop)("label"),(0,u.prop)("name")))},jo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return Lo(e,t,r,["attributes","analyticsAttributes"])},ko=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return Lo(e,t,r,["attributes"])},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return Lo(e,t,r,["analyticsAttributes"])},Mo=e=>e.children?e.children.flatMap(Mo):e,xo=e=>e.children?[e,...e.children.flatMap(xo)]:e,$o=(0,u.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,u.pipe)((0,u.find)((0,u.propEq)("uri",t)),(0,u.prop)("label"))(r)})),Vo=(0,u.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Pt(r)===e})))),Go=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,u.pipe)((0,u.either)((0,u.find)((0,u.propEq)("default",!0)),Vo("LUD")),(0,u.defaultTo)(r))(t||[])},Wo=(e,t)=>{let{survivorshipStrategies:r}=e;return Vo(t,r)},Yo=(0,u.allPass)([(0,u.complement)(u.isNil),hi(Ei.READ)]),Bo=(0,u.allPass)([(0,u.complement)(u.isNil),(0,u.complement)((0,u.prop)("abstract")),(0,u.complement)((0,u.propEq)("uiConfigHiddenType",!0)),hi(Ei.READ)]),qo=(0,u.allPass)([(0,u.complement)(u.isNil),(0,u.complement)((0,u.prop)("abstract")),(0,u.complement)((0,u.propEq)("uiConfigHiddenType",!0)),(0,u.anyPass)([hi(Ei.CREATE),hi(Ei.INITIATE_CHANGE_REQUEST)])]),Ho=(0,u.curryN)(2,(0,u.pipe)(Ur,Bo)),Qo=(0,u.curryN)(2,(0,u.pipe)(ui,Yo));function Ko(e,t,r,n){var i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Jo(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Ko(r[i],r[i+1],e,t));return n}function Xo(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Jo(r,t)[a];if(s.hasChildren){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Xo(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function zo(e,t,r,n,i,a){void 0===a&&(a=0);var o=Jo(r,t)[a];if(!o.hasChildren){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Zo(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Zo.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Xo(e,t,r,n,i,a),s}var c=zo(e,o,o.valueUri,{},i,a);zo(c,t,r,n,i,a+1)}function Zo(e,t){ce(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function es(e,t,r,n){void 0===n&&(n=0);var i=Jo(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&es(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function ts(e,t){e.roles=t||[]}function rs(e,t){e.tags=t||[]}function ns(e,t){e.startDate=t||""}function is(e,t){e.endDate=t||""}const as=e=>{let{ov:t}=e;return!1!==t},os=(e,t)=>((e,t)=>Er(e.type)&&oe(t))(e,t)||((e,t)=>mr(e.type)&&se(t))(e,t),ss=(0,u.curry)(((e,t)=>(0,u.cond)([[u.isNil,(0,u.always)(null)],[(0,u.pipe)((0,u.prop)(e),Array.isArray),(0,u.path)([e,0])],[u.T,(0,u.prop)(e)]])(t))),ls=ss("refEntity"),us=ss("refRelation"),cs=e=>(0,u.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ps=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,u.pipe)((0,u.split)("/"),u.last)(t)}`}]},ds=(0,u.prop)("objectURI"),ys=(0,u.prop)("objectURI"),fs=(0,u.prop)("type"),Ts=(0,u.pipe)(ls,(0,u.defaultTo)({}),ds),Es=(0,u.pipe)(us,(0,u.defaultTo)({}),ys),ms=(0,u.pipe)(ls,(0,u.defaultTo)({}),fs),hs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},bs=(0,u.evolve)({refEntity:ne,refRelation:ne}),Os=(e,t,r,n)=>{const i=nr(e,r),a=Ur(e,t.type)||ui(e,t.type);if(0===i.length)return null;const o=Bt(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!ut(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=a.attributes.filter((e=>rt(e)===r.uri||tt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},vs=(e,t)=>{const[r,n,...i]=t.split("/"),a=(e[r]||[]).find((e=>{let{uri:t}=e;return t.endsWith("/"+n)})),o=i.join("/");return o&&a?vs(a.value,o):a},gs=(0,u.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return vs(e[r],i)})),_s=(0,u.cond)([[(0,u.has)("lookupCode"),(0,u.pick)(["value","lookupCode"])],[(0,u.has)("refEntity"),(0,u.pick)(["refEntity","label","value"])],[u.T,(0,u.prop)("value")]]),As=(0,u.cond)([[(0,u.has)("lookupCode"),(0,u.pick)(["value","lookupCode","ov"])],[(0,u.has)("refEntity"),(0,u.pick)(["refEntity","label","value","ov"])],[u.T,(0,u.pick)(["value","ov"])]]),Ns=(0,u.curry)(((e,t,r)=>{const[n,...i]=t;return(0,u.pipe)((0,u.defaultTo)({}),(0,u.propOr)([],n),(t=>e?t.filter(e):t),(0,u.when)((()=>i.length>0),(0,u.pipe)((0,u.map)((0,u.prop)("value")),(0,u.map)(Ns(e,i)))))(r)})),Ps=(0,u.curry)(((e,t)=>(0,u.ifElse)((0,u.is)(Array),(0,u.map)(Ps(e)),e)(t))),Rs=(0,u.curry)(((e,t,r,n)=>(0,u.pipe)(Ns(e,r),Ps(t))(n))),Ss=Rs(null,_s),ws=Rs(as,_s),Is=Rs(null,As),Us=Rs(as,As),Cs=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=gs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ls=(e,t)=>(0,u.pipe)(u.values,u.flatten,(0,u.find)((0,u.pipe)(Ts,(0,u.equals)(t))))((null==e?void 0:e.attributes)||{}),Ds=(e,t)=>{const r=jt(t),n=(0,u.pipe)((0,u.split)("/"),(0,u.dropLast)(1),u.last)(t);return Cs(e,r,n)},js=Object.values(an),ks=(0,u.includes)(u.__,js),Fs=e=>js.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,u.assoc)(n,e[n],t):t}),{});function Ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xs(e,t,r[t])}))}return e}function xs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $s=(e,t)=>`${e}_${t}`,Vs=[Tn.matches.name,Tn.matchRules.name],Gs=(0,u.values)(sn).map((e=>e.name)),Ws=e=>(0,u.when)((0,u.always)(!e),(0,u.reject)((0,u.pipe)((0,u.prop)("name"),(0,u.includes)(u.__,Gs)))),Ys=(0,u.curry)(((e,t)=>{const r=t.filter((0,u.pipe)((0,u.prop)("name"),(0,u.includes)(u.__,Vs)));return(e||[]).flatMap((e=>r.map((0,u.evolve)({label:(0,u.concat)(`${e.label} `),name:t=>$s(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Bs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,u.pipe)(u.values,Ws(r),Ys(t),(0,u.find)((0,u.either)((0,u.propEq)("name",e),t?u.F:t=>e.startsWith($s(`dtPotentialMatches.${t.name}`,"")))))(Tn)},qs=(0,u.propEq)("uri",Tn.type.uri),Hs=e=>(0,u.values)(fn).some((0,u.propEq)("uri",null==e?void 0:e.uri)),Qs=(0,u.propEq)("uri",dn.sourceSystems.uri),Ks=Object.values(on),Js=(0,u.includes)(u.__,Ks),Xs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:void 0===n?r.defaultValue:n})},zs=e=>{let{entity:t,attributeType:r}=e;return(0,u.dissoc)(r.uri,t)},Zs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:n})},el=(0,u.propEq)("uri",on.roles.uri),tl=(0,u.propEq)("uri",on.tags.uri);function rl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nl(e,t,r[t])}))}return e}function nl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const il=e=>{let{parentUri:t,attributeType:r}=e;return rl({uri:Tt(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,u.propOr)("","defaultValue",e);return(0,u.cond)([[Xt,(0,u.always)({value:{}})],[er,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,u.both)((0,u.propEq)("defaultValue","now"),(0,u.pipe)((0,u.prop)("type"),lr)),(0,u.always)({value:Date.now()})],[u.T,(0,u.always)({value:t})]])(e)})(r))},al=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,u.pipe)(Sa(i),(0,u.filter)((0,u.anyPass)([(0,u.has)("defaultValue"),tr,(0,u.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=il({parentUri:r,attributeType:e});let s=ar(n,e);s&&(e.type===ze.TYPE_REFERENCE&&(s=lt(s)),a.value=al({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,u.isEmpty)(a.value)||Boolean(a.lookupCode)||tr(e))&&(o[t]=[a])}return o},ol=e=>{let{entity:t,metadata:r}=e;return ho(r,t.type,!0).filter(tr).reduce(((e,t)=>{const n=t.name,i=jt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:Os(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:ll({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},sl=(0,u.curry)(((e,t)=>{let{metadata:r,attributeTypes:n,parentUri:i,mode:a}=e;const o=n.filter((e=>{let{name:r}=e;return!t[r]})),s=(0,u.mapObjIndexed)(((e,t)=>{const{type:i,attributes:o}=n.find((e=>t===e.name));return e.map((e=>{const{value:t,uri:n}=e;return i===ze.TYPE_NESTED?rl({},e,{value:sl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return rl({},s(t),al({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),ll=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=il({parentUri:n,attributeType:r}),u=_s(l);return(0,me.ZP)(t,(e=>{Xo(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},ul=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{Xo(e.attributes||e.value,r,n.uri,_s(n),a,o,i)}))},cl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{zo(e.attributes||e.value,r,n,i,a,o)}))},pl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,me.ZP)(t,(e=>{es(e.attributes||e.value,r,n,i)}))},dl=e=>""===e,yl=(0,u.cond)([[(0,u.propSatisfies)((0,u.complement)((0,u.anyPass)([dl,u.isNil])),"lookupCode"),u.F],[(0,u.propSatisfies)((0,u.anyPass)([dl,u.isNil]),"value"),u.T],[(0,u.both)((0,u.propSatisfies)(u.isEmpty,"value"),(0,u.propSatisfies)((0,u.either)(u.isNil,u.isEmpty),"refEntity")),u.T],[u.T,u.F]]),fl=(0,u.reject)(yl),Tl=e=>{let{deleteEmptyComplex:t,valueTransformer:r=u.identity}=e;return(0,u.pipe)((0,u.map)((0,u.pipe)((0,u.map)((0,u.pipe)(r,(0,u.evolve)({value:(0,u.when)((0,u.is)(Object),(e=>Tl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),fl)),(0,u.when)((0,u.always)(t),(0,u.reject)(u.isEmpty)))},El=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Tl({valueTransformer:(0,u.pipe)((0,u.omit)(["type","uri"]),bs),deleteEmptyComplex:e})},ml=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,u.pipe)(El(e),(0,u.reject)(u.isEmpty))},hl=(0,u.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return ks(r)?Xs({entity:e,attributeType:r}):ll({entity:e,attributeType:r,parentUri:n,index:i})}),e))),bl=(0,u.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return ks(r)?Zs({entity:e,attributeType:r,value:i}):cl({entity:e,attributeType:r,uri:n,value:i})})),Ol=(0,u.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return ks(r)?zs({entity:e,attributeType:r}):pl({entity:e,attributeType:r,uri:n})})),vl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.pipe)((0,u.filter)((0,u.pipe)((0,u.pathOr)([],["roles"]),(0,u.either)((0,u.propEq)("length",0),(0,u.any)((e=>t.includes(e)))))),(0,u.map)((0,u.pathOr)([],["attributes"])),u.flatten)(e)},gl="UrlThumbnail",_l="CdnUrlThumbnail",Al=(0,u.curry)(((e,t,r)=>{const n=(0,u.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(as):(0,u.head)(n);return e&&e.value}return null})),Nl=(e,t)=>(0,u.pipe)((0,u.propOr)({},"value"),(r=>e.map((e=>Al(e,r,t)))),(0,u.filter)(u.identity),u.head,(0,u.defaultTo)("")),Pl=Nl(["CdnUrl","Url"],!0),Rl=Nl(["CdnUrlPreview","UrlPreview"],!0),Sl=Nl([_l,gl],!0),wl=Nl([_l,gl]),Il=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,u.cond)([[Yt,(0,u.always)(t)],[(0,u.both)(Wt,(0,u.always)(i)),(0,u.always)(i)],[u.T,(0,u.always)(n)]])(a),s=Yt(a)?"uri":"name",l=(0,u.pipe)((0,u.prop)(a[s]),(0,u.when)((0,u.both)((0,u.always)(ks(a)),(e=>null===e)),(0,u.always)([""])),(0,u.defaultTo)([]),ie)(o);return(0,u.when)((0,u.always)(r(l,a)),(0,u.append)({attrType:a,values:l}),e)}),[])},Ul=(e,t,r)=>{const n=Ia(e),i=(0,u.any)(r?u.T:as);return Il(n,t,i)},Cl=(e,t,r,n,i,a)=>{const o=Et(null==r?void 0:r.uri)?Sa(t,e):wa(t,e);return Il(o,r,((e,o)=>{const s=Mi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,u.any)(i?u.T:as,e)||Yt(o)&&(0,u.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Ll;const Dl=e=>{Ll=e};function jl(e,t){return Ll(e,t)}const kl=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,u.when)((0,u.is)(String),(0,u.always)({errorMessage:e,errorCode:t}))(e))}),null)})),Fl=50,Ml=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Fl,offset:a=0}=e;return jl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},xl=(0,u.once)((()=>jl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),$l=e=>jl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Vl=(e,t)=>jl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Gl=e=>ee.fromNull(Vr[e]).map(tn().text).orSome(""),Wl=(0,u.curry)(((e,t)=>`${e}_${t}`)),Yl=(0,u.split)("_"),Bl=(0,u.includes)("_"),ql=(0,u.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Hl=(0,u.curry)(((e,t)=>e.some(ql(t)))),Ql=Hl([xr.IN_RANGE,xr.COUNT_RANGE,xr.WITHIN]),Kl=Hl([xr.EXISTS,xr.MISSING_VALUE]),Jl=(0,u.cond)([[Kl,(0,u.always)(0)],[Ql,(0,u.always)(2)],[u.T,(0,u.always)(1)]]),Xl=(0,u.complement)(Kl),zl=Hl([xr.HAS_ALL,xr.EQUALS,xr.NOT_EQUALS]),Zl=Hl([xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE,xr.COUNT_RANGE]),eu=Hl([xr.IN_FILE,xr.NOT_IN_FILE]),tu=e=>{switch(e){case xr.COUNT_EQUALS:return xr.EQUALS;case xr.COUNT_NOT_EQUALS:return xr.NOT_EQUALS;case xr.COUNT_LT:return xr.LT;case xr.COUNT_LTE:return xr.LTE;case xr.COUNT_GT:return xr.GT;case xr.COUNT_GTE:return xr.GTE;case xr.COUNT_RANGE:return xr.IN_RANGE}},ru=Hl([xr.ON,xr.BEFORE,xr.AFTER,xr.WITHIN,xr.NOT_EQUALS]),nu=Hl([xr.WITHIN]),iu=[[xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE],[xr.NOT_IN_FILE,xr.IN_FILE],[xr.EQUALS,xr.NOT_EQUALS,xr.HAS_ALL],[xr.LT,xr.LTE,xr.GT,xr.GTE],[xr.MISSING_VALUE,xr.EXISTS],[xr.COUNT_RANGE],[xr.IN_RANGE],[xr.STARTS_WITH,xr.CONTAINS],[xr.FULL_TEXT],[xr.ON,xr.BEFORE,xr.AFTER,xr.NOT_EQUALS],[xr.WITHIN]],au=(e,t)=>iu.some((r=>r.includes(e)&&r.includes(t))),ou=(0,u.pipe)(u.omit,u.values),su={OPTIONS_FOR_STRING:ou(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_DATE:[xr.ON,xr.BEFORE,xr.AFTER,xr.WITHIN,xr.NOT_EQUALS,xr.MISSING_VALUE,xr.EXISTS,xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE,xr.COUNT_RANGE,xr.IN_FILE,xr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:ou(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_BLOB:ou(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_NUMBER:ou(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_LOOKUP:ou(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],xr),OPTIONS_FOR_ENUM:ou(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_ID:[xr.EQUALS,xr.NOT_EQUALS,xr.IN_FILE,xr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[xr.EQUALS,xr.NOT_EQUALS,xr.LT,xr.LTE,xr.GT,xr.GTE,xr.IN_RANGE],OPTIONS_FOR_COMPLEX:[xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE,xr.COUNT_RANGE,xr.EXISTS,xr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[xr.EQUALS,xr.NOT_EQUALS,xr.EXISTS,xr.MISSING_VALUE]},lu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case ze.TYPE_TYPEAHEAD:case ze.TYPE_STRING:case ze.TYPE_PASSWORD:case ze.TYPE_TEXT:case ze.TYPE_CIK_ID:case ze.TYPE_URL:case ze.TYPE_BLOG_URL:case ze.TYPE_IMAGE_URL:case ze.TYPE_EMAIL:return su.OPTIONS_FOR_STRING;case ze.TYPE_LOOKUP:case ze.TYPE_DEPENDENT_LOOKUP:return su.OPTIONS_FOR_LOOKUP;case ze.TYPE_ENUM:return su.OPTIONS_FOR_ENUM;case ze.TYPE_DATE:case ze.TYPE_ACTIVENESS_DATE:case ze.TYPE_TIMESTAMP:case ze.TYPE_LOCAL_DATE:return su.OPTIONS_FOR_DATE;case ze.TYPE_BOOLEAN:case ze.TYPE_BOOLEAN_RADIO:return su.OPTIONS_FOR_BOOLEAN;case ze.TYPE_BLOB:return su.OPTIONS_FOR_BLOB;case ze.TYPE_LONG:case ze.TYPE_INT:case ze.TYPE_FLOAT:case ze.TYPE_DOUBLE:case ze.TYPE_NUMBER:return su.OPTIONS_FOR_NUMBER;case ze.TYPE_ENTITY_ID:return su.OPTIONS_FOR_ID;case ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[xr.EQUALS];case ze.TYPE_COUNT:return su.OPTIONS_FOR_COUNT;case ze.TYPE_NESTED:case ze.TYPE_REFERENCE:case ze.TYPE_IMAGE:return su.OPTIONS_FOR_COMPLEX;default:return su.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,u.reject)(Zl,n):n},uu=e=>[Re.and,Re.andNot].includes(e),cu=e=>[Re.or,Re.orNot].includes(e),pu=e=>e.slice(0,-1).some((0,u.pipe)((0,u.prop)("operator"),cu)),du=(yu=[Re.and],e=>e.slice(0,-1).every((e=>yu.includes(e.operator))));var yu;const fu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,u.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Tu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,u.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Eu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,u.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},mu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Re.or,Re.orNot],n=t?[Re.and,Re.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,u.head)(e)&&")"===(0,u.last)(e)&&Eu(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},hu="and",bu=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,u.propOr)(hu,n,e),o=(e=>[Re.andNot,Re.orNot].includes(e))(a)?mu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Ou=(0,u.curry)(((e,t)=>{const r=(0,u.unless)(u.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),vu=e=>Array.isArray(e)?e.map(vu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),gu=(0,u.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),_u=e=>`'${e}'`,Au=e=>`"${e}"`,Nu=(0,u.pipe)(vu,gu),Pu=(0,u.pipe)(Nu,_u),Ru=(0,u.curry)(((e,t)=>(0,u.cond)([[(0,u.allPass)([(0,u.always)(Ql(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[u.T,u.identity]])(t))),Su=(e,t)=>Zl(t)?{type:ze.TYPE_INT}:eu(t)?{type:ze.TYPE_FILE}:ru(t)&&!nu(t)&&ur(e.type)?{type:ze.TYPE_LOCAL_DATE}:e,wu=Object.values(Qr),Iu=e=>!Object.values(Qr).includes(e),Uu=e=>wu.includes(e),Cu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kr;return tn().text(t[e])},Lu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(qr),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kr;return e.map((e=>({value:e,get label(){return Cu(e,t)}})))},Du=e=>{const t=T()();switch(e){case qr.LAST_DAY:return[T()(t).subtract(1,"day").valueOf(),t.valueOf()];case qr.LAST_WEEK:return[T()(t).subtract(1,"week").valueOf(),t.valueOf()];case qr.LAST_MONTH:return[T()(t).subtract(1,"month").valueOf(),t.valueOf()];case qr.LAST_6MONTHS:return[T()(t).subtract(6,"months").valueOf(),t.valueOf()];case qr.LAST_YEAR:return[T()(t).subtract(1,"year").valueOf(),t.valueOf()];case Hr.LAST_3DAYS:return[T()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},ju=e=>{let[t,r]=e;return[T()(t).valueOf(),T()(r).endOf("date").valueOf()]},ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;return(0,u.is)(String,e)?t(e):ju(e)};function Fu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mu(e,t,r[t])}))}return e}function Mu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xu=(0,u.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),$u=(0,u.curry)(((e,t,r)=>{const n=r.map(Ql(e)||t.endsWith(".count")?Nu:Pu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Vu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Gu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Jl(t);return(0,u.pipe)(Vu(i),(0,u.map)($u(t,r)),xu(" or "))(n)},Wu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,u.flatten)(n).map(Pu).join(",")})`},Yu=e=>`*${e}*`,Bu=e=>`URL:${e}`,qu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Hu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===xr.IN_FILE?r:`not ${r}`},Qu=(e,t)=>[S(e,t),w(e,t)],Ku=(0,u.pipe)((e=>{const{values:t,filter:r}=e,n=!Ju(e);if(!(0,u.isEmpty)(t)){const[i]=t;switch(r){case xr.ON:return Fu({},e,n?{filter:xr.EQUALS}:{filter:xr.IN_RANGE,values:[Qu(i,n)]});case xr.BEFORE:return Fu({},e,{filter:xr.LTE,values:[[w(i,n)]]});case xr.AFTER:return Fu({},e,{filter:xr.GTE,values:[[S(i,n)]]});case xr.WITHIN:return Fu({},e,{filter:xr.IN_RANGE,values:[Du(i)]})}}return e}),Gu),Ju=(0,u.propSatisfies)(ur,"type"),Xu=[[(0,u.prop)("rawFilter"),(0,u.prop)("rawFilter")],[(0,u.propEq)("filter",xr.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,u.pipe)((0,u.map)((e=>e.reduce(((e,r)=>e.addClause(Gu({filter:xr.EQUALS,fieldName:t,values:[r]}))),new bu).build())),xu(" or "))(r)}],[(0,u.propEq)("filter",xr.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return Gu({fieldName:r,filter:t,values:n.map((0,u.pipe)(vu,Yu))})}],[(0,u.propEq)("filter",xr.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?Gu(Fu({},e,{values:(0,u.flatten)(r)})):qu(r)?Wu(Fu({},e,{filter:"listEquals"})):Gu(e)}],[(0,u.propEq)("filter",xr.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Jl(t);return(0,u.pipe)(Vu(i),(0,u.map)($u(t,r)),xu(" and "))(n)})(Fu({},e,{values:(0,u.flatten)(e.values)})):Ju(e)?(e=>{const{values:t}=e,r=!Ju(e),[n]=t;return(new bu).addClause(Gu(Fu({},e,{filter:xr.LT,values:[S(n,r)]}))).addClause(Gu(Fu({},e,{filter:xr.GT,values:[w(n,r)]}))).orBuild()})(e):qu(t)?Wu(Fu({},e,{filter:"not listEquals"})):Gu(e)}],[(0,u.propSatisfies)(eu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Gu({fieldName:r,filter:Hu(t,r),values:n.map((0,u.prop)("link")).map(Bu)})}],[(0,u.propSatisfies)(Zl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Gu({fieldName:`${r}.count`,values:n,filter:tu(t)})}],[(0,u.propSatisfies)(ru,"filter"),Ku],[(0,u.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,u.pipe)((0,u.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,u.join)(";"))(r);return $u(t,n,[])}],[(0,u.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return $u(a,`${t},'${r},${n}',0,${i}`,[])}],[u.T,Gu]],zu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Xl(e)||ec(e,r))},Zu=(e,t)=>Array.isArray(t)?ec(e,t):e===xr.WITHIN?Uu(t)||Number.isInteger(t):!(0,u.isNil)(t)&&vu(t).length>0,ec=(e,t)=>t&&t.length>0&&t.every((t=>Zu(e,t)));function tc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},nc=(0,u.pipe)((0,u.propOr)("","fieldName"),(0,u.split)("."),(0,u.slice)(0,-1),(0,u.join)(".")),ic=(e,t,r)=>"children"===e?oc(r,[...t][0],!0):r,ac=(e,t,r)=>"values"===e?[...r,...t]:r,oc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,u.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,u.adjust)(n,(0,u.mergeDeepWithKey)(ic,t),e);if(!r&&zl(t.filter)&&t.filter===i.filter)return(0,u.adjust)(n,(0,u.mergeDeepWithKey)(ac,t),e)}return(0,u.append)(t,e)},sc=(0,u.reduce)(((e,t)=>{const r=(e=>{const t=rc(e),r=e=>e.fieldName===t?e:r({fieldName:nc(e),children:[e]});return r(e)})(t);return oc(e,r)}),[]),lc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,u.has)("rawFilter")),uc=e=>{let[t]=e;return t.children?uc(t.children):t.operator},cc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,u.splitAt)(1,e),i=uc(t)===Re.andNot,a=n(t,!1),o=i?`not ${mu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${uc(r)||hu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,u.cond)([[(0,u.has)("children"),e=>{let{children:i}=e;return a&&lc(i)&&!t?r(i):n(i,a)}],...e])(o))),new bu).buildWithOperators(i.map((0,u.prop)("operator")))}return n},pc=(0,u.pipe)((0,u.propOr)("","filter"),Bl),dc=(0,u.map)((0,u.when)(pc,(e=>{const[t,r]=Yl(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),yc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,u.pipe)((0,u.filter)(zu),dc,sc,cc([...e,...Xu],t))},fc=(0,u.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Tc=[xr.ON,xr.BEFORE,xr.AFTER,xr.WITHIN,xr.NOT_EQUALS,xr.MISSING_VALUE,xr.EXISTS],Ec=[xr.EQUALS,xr.NOT_EQUALS,xr.STARTS_WITH,xr.MISSING_VALUE,xr.HAS_ALL,xr.FULL_TEXT,xr.EXISTS],mc=[xr.EQUALS,xr.NOT_EQUALS,xr.LT,xr.LTE,xr.GT,xr.GTE,xr.IN_RANGE],hc=(e,t)=>{const r=Vt(e);return(e=>{switch(e){case an.startDate.name:case an.endDate.name:case sn.dueDate.name:case cn.createdTime.name:case cn.updatedTime.name:case dn.reltioLoadDate.name:case dn.createDate.name:case dn.updateDate.name:case dn.deleteDate.name:case dn.publishDate.name:return Tc;case pn.matches.name:case dn.count.name:return mc;case sn.workflow.name:case sn.assignee.name:case sn.step.name:case ln.commenter.name:case cn.createdBy.name:case cn.updatedBy.name:case dn.sourceSystems.name:case dn.value.name:return Ec;default:return null}})(t)||lu(r)},bc=[xr.EQUALS,xr.NOT_EQUALS,xr.CONTAINS,xr.STARTS_WITH,xr.MISSING_VALUE,xr.HAS_ALL,xr.IN_RANGE,xr.WITHIN,xr.EXISTS,xr.ON],Oc=(0,u.pipe)(hc,(0,u.filter)((0,u.includes)(u.__,bc))),vc=(0,u.unless)((0,u.startsWith)("?"),(0,u.concat)("?")),gc=e=>{let{query:t,body:r}=e;return t=vc(t),jl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},_c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,u.pipe)(yc(),fc(t.globalFilter))(n),activeness:t.activityFilter||Xr.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Ar(i)}`},Ac=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=_c(e,t,r);return jl(n)},Nc=e=>jl(`/entities/_total?${e}`),Pc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,u.pipe)((0,u.filter)(Bo),(0,u.map)((0,u.prop)("uri")))(e),i={filter:xr.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,u.pipe)(yc(),fc(r.globalFilter))([i,a]),s=Ar({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Xr.ACTIVE_ONLY,max:r.max||4});return jl("/entities/_typeAheadSearch"+s,{method:"GET"})},Rc=(0,u.pipe)((0,u.reject)(u.isNil),_r),Sc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:l}=n,c=(0,u.pipe)(yc(),fc(i))(r),p=Rc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:l||1,orderType:n.orderType||"reversedCount"}];return gc({query:p,body:d})},wc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Sc({fieldName:t,searchParams:i,options:n})},Ic="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Uc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i={filter:(0,u.pipe)(yc(),fc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Ic,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Ar(i)}`},Cc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=Uc(e,t,r);return jl(n)},Lc=e=>xc(e,{select:"secondaryLabel"}),Dc=(e,t)=>{const{select:r=Ic,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),jl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},jc=(0,u.filter)((0,u.pipe)((0,u.prop)("uri"),Et)),kc=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:l,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=jc(n).length,T={[r]:{max:a,offset:(0,u.isNil)(i)?y-f:i}},E=zt(r),m={method:"POST",data:{attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E}},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[l]}],b=(0,u.pipe)(yc(),fc(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),jl(`${s}/api/${o}/${t}/_object`,m)},Fc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Mc={options:"sendHidden,addRefAttrUriToCrosswalk"},xc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mc;return jl(`/${e}${Ar(t)}`)},$c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const r={method:"POST",data:[e]},n=t("/entities");return jl(n,r)},Vc=e=>jl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Gc=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return jl(`/${e}/_clone${Ar({executeLCA:!1,valuesToCopy:r})}`,n)},Wc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return jl(`/entities/_events/_total${_r({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Yc=(e,t)=>jl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),Bc=e=>{let{uri:t,diff:r,uriPreprocessor:n=u.identity}=e;return jl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},qc=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return jl(`/${t}/_interactions${(0,u.pipe)((0,u.reject)(m),_r)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Hc=e=>{const t=new FormData;return t.append("file",e),jl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=de(e,tn().text("Can't upload file"));return Promise.reject(t)}))},Qc=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return jl(`/personal/findSavedSearches${_r({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},Kc=e=>jl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Jc=e=>jl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xc=e=>{const{uri:t}=e,r=(0,u.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return jl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},zc=e=>{let{uri:t}=e;return jl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Zc=(e,t)=>(0,u.pipe)((0,u.evolve)({isPublic:(0,u.always)(t)}),Xc)(e),ep=(e,t)=>(0,u.pipe)((0,u.evolve)({isFavorite:(0,u.always)(t)}),Xc)(e);function tp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rp=["max","offset","filter"],np=(0,u.curry)(((e,t)=>t.nextEntry?(0,u.evolve)({nextEntry:np(e)},t):function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tp(e,t,r[t])}))}return e}({},t,(0,u.pick)(rp,e)))),ip=e=>{if(1===e.length&&((0,u.pathEq)([0,"activeness","entity"],Pe.ALL,e)||(0,u.pathEq)([0,"activeness","relation"],Pe.ALL,e)))return!1},ap=(0,u.omit)(["activeness"]),op=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=ip(t),{searchByOv:i}=r;t=(0,u.map)((0,u.pipe)((0,u.when)((0,u.prop)("nextEntry"),(e=>(0,u.pipe)(np(e),(0,u.omit)(rp))(e))),ap,(0,u.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Ar(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},sp=(0,u.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),lp=(0,u.reject)(u.isNil),up=(0,u.unless)((0,u.startsWith)("/"),(0,u.concat)("/")),cp=e=>jl(up(e),{method:"GET",headers:{"Content-Type":"application/json"}}),pp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const r=(0,u.pipe)(t,up);return jl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},dp=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=u.identity}=e;const l={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?ml()(i):null,startDate:a,endDate:o},c=(0,u.pipe)(lp,ie,JSON.stringify);return jl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(l)})},yp=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=u.identity}=e;const i=(0,u.prop)("attributes"),a=(0,u.pipe)((0,u.prop)("uri"),(0,u.concat)(u.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),up,n),o=FE(i(t),i(r)).concat(xE(t,r));return jl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},fp=(e,t,r)=>{const{url:n,options:i}=op(e,t,r);return jl(n,i).then(sp)},Tp=(e,t)=>jl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Ep=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Zr.IN?a.inRelations=[n]:a.outRelations=[n],jl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},mp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return jl(`${t}/recentSearches${Ar({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},hp=e=>jl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),bp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return jl(`/recentSearches${Ar({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Op(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vp(e,t,r[t])}))}return e}function vp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gp={select:"label,secondaryLabel,name,type,startDate,endDate"},_p=(0,u.reject)(u.isNil),Ap=(0,u.pipe)(_p,_r),Np=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Op({},gp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return jl(`/${t}/_tree${Ap(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Pp=e=>{let{uri:t,graphUri:r}=e;const n=Op({},gp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return jl(`/${t}/_parents${Ap(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Rp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Op({},gp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return jl(`/${t}/_hops${Ap(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Sp(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const wp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Ip="/activities",Up=e=>{let{label:t,description:r}=e;return jl(Ip,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:wp()}})};var Cp;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Cp||(Cp={}));const Lp=e=>{const t=Ar(e);return jl(Ip+t,{method:"GET"})},Dp=e=>jl(`/activities/_total${Ar(e)}`,{method:"GET"}),jp=e=>{const{entityUri:t}=e,r=Sp(e,["entityUri"]);return jl(`/${t}/_activities${Ar(r)}`,{method:"GET"})},kp=e=>{const{entityUri:t}=e,r=Sp(e,["entityUri"]);return jl(`/${t}/_activities/_total${Ar(r)}`,{method:"GET"})};function Fp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mp(e,t,r[t])}))}return e}function Mp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},$p=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return jl(xp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},Vp=e=>{let{workflowPath:t,url:r,tenant:n,method:i,data:a,headers:o}=e,s=r;return r.includes("http:")||r.includes("https:")||(s=xp({url:r,workflowPath:t,tenant:n})),jl(s,{method:i||"GET",body:JSON.stringify(a),headers:Fp({"Content-Type":"application/json"},null!=o?o:{})})},Gp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=xp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,u.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return jl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,u.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,u.map)(s(o,r)),(e=>Promise.all(e)),(0,u.andThen)(u.last))(n)},Wp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=xp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Fp({},l,{comment:o}):l;return jl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Yp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const l=xp({url:`/tasks${s?Ar(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Fp({objectURIs:[i]},(0,u.reject)(m,a)))};return jl(l,Fp({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Bp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return jl(xp({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,u.pipe)((0,u.reject)(u.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},qp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return jl(xp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,u.pipe)((0,u.reject)(u.isNil),JSON.stringify)(Fp({max:a,offset:o},i))})},Hp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return jl(xp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Qp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return jl(xp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Kp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Jp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return jl(xp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Xp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},zp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},Zp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},ed=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return jl(xp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},td=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return jl(xp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},rd=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(as);return a&&a[0]&&(r=n.length>0&&a[0].value?rd(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),nd=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=rd(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},id=/[,\s]*$/,ad=e=>{const t=tn().text(zr);if(!e)return t;const r=e.replace(id,"");return""===r.toString().trim()?t:r},od=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},sd=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=od(e,r.referencedEntityTypeURI);if(n)return nd({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return nd({attributes:t||{}},r.dataLabelPattern);return""},ld=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},ud=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},cd=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",pd=(0,u.when)((0,u.is)(Object),(0,u.ifElse)((0,u.pipe)((0,u.prop)("value"),(0,u.is)(Object)),Sl,(0,u.prop)("value"))),dd=(0,u.pipe)((0,u.prop)("defaultProfilePicValue"),pd),yd=(e,t,r)=>{const n=dd(r)||(e=>(0,u.pipe)((0,u.prop)("defaultProfilePic"),(0,u.when)(u.identity,(0,u.pipe)(gs(e),pd)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,u.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(Ur(e,t.type));return(0,u.pipe)((0,u.map)((0,u.pipe)((r=>Os(e,t,r)),(0,u.defaultTo)([]),u.head)),(0,u.reject)(u.isNil),u.head,(0,u.when)(u.identity,pd))(r)})(e,r)||Fr(e,r.type);return cd(t,n)};function fd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Td(e,t,r[t])}))}return e}function Td(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ed="DTSS/",md=(0,u.replace)(new RegExp("^entities/"),""),hd=e=>Ed+e.dataTenant+"/"+e.uri,bd=(0,u.replace)(new RegExp("^DTSS/.+?/"),""),Od=e=>!(!e||!e.dataTenant),vd=(0,u.startsWith)(Ed),gd=(0,u.pipe)((0,u.ifElse)(vd,(0,u.pipe)((0,u.split)("/"),(0,u.nth)(1)),(0,u.always)(null))),_d=(0,u.ifElse)(Od,hd,(0,u.prop)("uri")),Ad=e=>e&&e.uri?e.dataTenant?hd(e):md(e.uri):"",Nd=(0,u.curry)(((e,t,r)=>(Ur(t,r.type)||{})[e]||"")),Pd=Nd("label"),Rd=Nd("typeGraphIcon"),Sd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Ur(e,t.type)||{},n=(r.attributes||[]).reduce(((e,t)=>(e[t.uri]=t,e[t.name]=t,e)),{});return t.attributes&&r.businessCardAttributeURIs?r.businessCardAttributeURIs.map((r=>{const i=n[r];if(!i)return null;let a=t.attributes[i.name];if(!a)return null;Array.isArray(a)&&(a=a.find(as)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:sd(e,o,i),uri:a.uri}})).filter(u.identity):[]},wd=(0,u.pipe)(Sd,(0,u.map)((0,u.prop)("text")),(0,u.join)(", ")),Id=(0,u.curry)(((e,t)=>{if(!t)return[];if(1===e.length){return t[e[0]]||[]}{const r=t[e[0]];return Array.isArray(r)?r.reduce(((t,r)=>{if((0,u.is)(Object,r.value)){const n=Id(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Id(e.slice(1),r)}})),Ud=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Cd=e=>(0,u.propOr)([],"matchRules",e),Ld=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?fd({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Dd=(e,t,r)=>t&&r?r.aEntity:e,jd=(0,u.evolve)({attributes:ml(!0)}),kd=(0,u.pipe)(jd,(0,u.props)(["attributes","startDate","endDate","roles","tags"]),(0,u.all)(m)),Fd=e=>(0,u.assoc)("dataTenant",e),Md=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:l,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:l,sort:i,order:a,activeness:o,sources:c,rules:p};return jl(`/${t}/_transitiveMatches${(0,u.pipe)((0,u.reject)(m),_r)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xd=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return jl(`/${t}/_notMatch${(0,u.pipe)((0,u.reject)(m),_r)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},$d=(e,t)=>{const r=(0,u.map)((0,u.prop)("uri"))(t);return jl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Vd=(e,t,r)=>Promise.all(t.map((async t=>await jl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),Gd=async(e,t)=>await Vd(e,t,"NOT"),Wd=async(e,t)=>await Vd(e,t,"MATCH"),Yd=async(e,t)=>await Promise.all(t.map((async t=>await jl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function Bd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qd(e,t,r[t])}))}return e}function qd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hd(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const Qd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return jl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Kd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return fy({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Jd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return fy({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Xd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return jl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},zd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return Xd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Zd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,u.partition)(Od,i);return Promise.all([s.length?$d(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Xd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},ey=(0,u.pipe)(u.toPairs,(0,u.chain)((e=>{let[t,r]=e;return r.map((0,u.assoc)("matchRule",t))})),(0,u.reduce)(((e,t)=>{let{matchRule:r}=t,n=Hd(t,["matchRule"]);const i=e.findIndex((e=>{let{object:{uri:t}}=e;return n.uri===t}));return-1===i?e.concat({object:n,matchRules:[r]}):(0,u.adjust)(i,(0,u.evolve)({matchRules:(0,u.append)(r)}),e)}),[])),ty=(0,u.pipe)((0,u.find)((0,u.propEq)("index",0)),(0,u.propOr)({},"object"),ey),ry=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return jl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(ty)},ny=e=>t=>{let{dtssPath:r,dataTenants:n=[],customerTenant:i,entity:a}=t;return Promise.all(n.map((t=>{let{id:n}=t;return e({dtssPath:r,dataTenant:n,customerTenant:i,entity:a}).then((0,u.map)((0,u.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(u.flatten)},iy=ny((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return jl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(ty)})),ay=ny((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return jl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),oy=(e,t)=>{let{dtssPath:r,dataTenants:n=[],entity:i,customerTenant:a,dtssRequest:o}=e;return function(){if(r&&n&&n.length){const e=o({dtssPath:r,dataTenants:n,entity:i,customerTenant:a});return Promise.all([t(...arguments),e]).then(u.flatten)}return t(...arguments)}},sy=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return jl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},ly=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{dataTenant:o,uri:s}=i;return Promise.all(a.map((t=>{let{uri:i}=t;return sy(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},uy=ly("NOT"),cy=ly("MATCH"),py=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,l]=(0,u.partition)(Od,a);return Promise.all([Vd(o,l,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return sy(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},dy=py("NOT"),yy=py("MATCH");function fy(e){let{requestProvider:t=jl,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,Bd({},Hd(s,["headers"]),{headers:Bd({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Ty=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return fy({url:Uc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Ey=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return fy({url:_c(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},my=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:l}=op(t,r);return fy({url:`entities/_connections/_getConnections${Ar({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:l,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,u.pipe)(sp,(0,u.map)((0,u.evolve)({connections:(0,u.map)((0,u.pipe)((0,u.assocPath)(["entity","dataTenant"],n),(0,u.assocPath)(["relation","dataTenant"],n)))}))))},hy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return fy({url:`${Fc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},by=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return jl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Oy=e=>{let{dtssPath:t,tenant:r}=e;return jl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},vy=e=>{let{dtssPath:t,customerTenant:r}=e;return jl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},gy=e=>{let{dtssPath:t,tenants:r}=e;return jl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},_y=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return fy({url:Fc(t),dataTenant:r,customerTenant:n,dtssPath:i})},Ay=()=>jl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function Ny(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Py(e,t,r[t])}))}return e}function Py(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ry=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Ny({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return jl(`${t}/api/${r}/graph/search${Ar({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Sy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return jl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Ny({},n,i),headers:{"Content-Type":"application/json"}})},wy=(e,t)=>`${e}/${t}/comments`,Iy=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return jl(`${wy(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Uy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return jl(`${wy(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Cy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return jl(wy(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Ly=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return jl(`${wy(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Dy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return jl(`${wy(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},jy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return jl(`${wy(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},ky=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return jl(`${wy(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Fy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return jl(`${wy(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},My=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Ar({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return jl(`${wy(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function xy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$y(e,t,r[t])}))}return e}function $y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vy=e=>{let{tenant:t,servicesPath:r}=e;return jl(`${r}/oauth/proxy${Ar({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Gy="graphExport",Wy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await Hy({servicesPath:e,tenant:t,environment:r,namespace:Gy,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(xy({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await Hy({servicesPath:e,tenant:t,environment:r,namespace:Gy,options:xy({method:"PUT"},o)})}catch(e){s=null}return s||(s=await Hy({servicesPath:e,tenant:t,environment:r,namespace:Gy,options:xy({method:"POST"},o)})),s},Yy=e=>{let{servicesPath:t,key:r}=e;return jl(`${t}/settings${Ar({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},By=e=>{let{servicesPath:t}=e;return jl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},qy=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return jl(`${n}/plugins${Ar({tenant:t,user:r})}`,{method:"GET"})},Hy=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return jl(`${n}/configService${Ar({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Qy=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return Hy({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Ky=e=>{let{servicesPath:t,stateHash:r}=e;return jl(`${t}/searchLink?key=${r}`,{method:"GET"})},Jy=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),jl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Xy=e=>jl(`/${e}?showObjectsInfo=true`,{method:"GET"}),zy=e=>{let{exportPath:t,tenant:r,options:n}=e;return jl(`${t}/${r}/activities${Ar(n)}`,{method:"POST"})};function Zy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ef(e,t,r[t])}))}return e}function ef(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tf=e=>{const{entityUri:t}=e;return jl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},rf=e=>{let{entityUri:t,crosswalk:r}=e;return jl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},nf=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return jl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Zy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Zy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},af=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return jl(`/${r}/_${n}${Ar({contributorURI:t})}`,{method:"POST"})},of=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return jl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},sf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return jl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},lf=e=>{let{entityUri:t,crosswalkId:r}=e;return jl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cf=e=>{let{entityTypeUri:t}=e;return jl(`/dataQuality/fillRates${_r({entityType:Pt(t)})}`,{method:"GET"})},pf=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},df=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uf(e,t,r[t])}))}return e}({},n===Me.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Me.ATTRIBUTE_TYPE?_r({numberOfThreads:pf({attributes:r,metrics:i})||1}):"";return jl(`/entityType/${Pt(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},yf=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return jl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Pt(n)}`,{method:"GET",headers:{env:i}})},ff=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Me.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return jl(`${t}/${r}/entityType/${Pt(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},Tf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return jl(`/${t}${Ar({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Ef=e=>{let{attributeUri:t,value:r}=e;return jl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},mf=e=>{let{attributeUri:t,value:r}=e;return jl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},hf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return jl(`/${t}${Ar({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},bf=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Ar({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=ml()([[{value:a}]]);return jl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Of=e=>{let{entityUri:t,attributeName:r,value:n}=e;return jl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},vf=e=>{let{entityUri:t,attributeName:r}=e;return jl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function gf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _f=e=>{let{entityUri:t}=e;return jl(`/${t}/_historicURIs`,{method:"GET"})},Af=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return jl(`/${t}/_changesWithTotal${Ar(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gf(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Nf=(e,t)=>jl(`/${e}/_previousChange${Ar({timestamp:t})}`,{method:"GET"}),Pf=(e,t)=>jl(`/${e}${Ar({time:t})}`,{method:"GET"});function Rf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sf(e,t,r[t])}))}return e}function Sf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wf=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return jl(t,{method:r||"GET",body:n,headers:Rf({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},If=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Ar({options:a.join(","),severity:o.join(",")});return jl(`${t}/validate/${i}/entity/${Ad({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Uf=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return jl(`${t}/validate/${n}/entity${Ar({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Cf=e=>{let{tenant:t,apiPath:r}=e;return jl(`${r}/tenants/${t}/name`,{method:"GET"})},Lf=e=>{let{tenant:t,apiPath:r}=e;return jl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Df=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return jl(`${a}/preferences${Ar({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},jf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return jl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},kf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return jl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Ff=e=>{const{servicesPath:t}=e;return jl(`${t}/getTokenForWorker`,{method:"GET"})};var Mf=r(29524);const xf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=mt(),s={attributes:al({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=Os(r,e,n.uri)[0];return i&&i.value?cl({entity:e,attributeType:n,uri:i.uri,value:t}):ll({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},$f=(e,t)=>(0,u.pipe)(u.values,u.flatten,(0,u.filter)((0,u.has)("refEntity")),(0,u.map)(Ts),(0,u.filter)(Et),(0,u.map)((t=>e[t])),(0,u.reject)(u.isNil))((null==t?void 0:t.attributes)||{}),Vf=(0,u.curry)(((e,t)=>{const r=$f(e=e||{},t=t||{});return r.concat((0,u.chain)(Vf(e),r))})),Gf=(0,u.curry)(((e,t)=>(0,u.pipe)(pe,(0,u.filter)(e))(t))),Wf=Gf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Yf=e=>(0,u.filter)((0,u.pipe)((t=>(0,u.path)(t,e)),Et)),Bf=e=>(0,u.pipe)(Wf,Yf(e),(0,u.map)((t=>(0,u.path)(t,e))))(e),qf=(0,u.curry)(((e,t,r)=>{const n=(0,u.pipe)(Wf,(0,u.find)((t=>(0,u.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,u.set)((0,u.lensPath)(n),t,r):r})),Hf=(0,u.when)((0,u.pipe)((0,u.prop)("uri"),Et),(0,u.omit)(["uri","timestamp"])),Qf=(0,u.pipe)(Hf,jd),Kf=async(e,t,r)=>{if(!e)return null;const n=Bf(e);if(n.length>0)for(const r of n)e=qf(r,t[r],e);const i=await $c(Qf(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,u.path)([0,"errors"],e))(i);if(a)throw a;if((0,u.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,u.pipe)((0,u.prop)("changes"),u.keys,(0,u.find)((e=>!(0,u.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,u.pathOr)(e,[0,"object"],e))(i);return o.uri},Jf=async(e,t,r)=>{const n=zf(e,t),i={};for(const t of n)i[t]=await Kf(e[t],i,r);return i},Xf=(0,u.curry)(((e,t)=>{const r=Mf.Node(t);return Bf(e[t]).forEach((t=>{const n=Xf(e,t);r.addEdge(n)})),r})),zf=(e,t)=>(0,u.pipe)((0,u.map)(Xf(e)),(0,u.map)(Mf.getDependencyOrder),u.flatten,(0,u.map)((e=>e.getInfo())))(t),Zf=(0,u.map)((0,u.evolve)({newValue:(0,u.when)(Array.isArray,(0,u.map)(Hf))})),eT=(e,t)=>[...YE(e.tags||[],t.tags||[]),...BE(e.roles||[],t.roles||[]),...ME(e,t),...xE(e,t)],tT=(e,t)=>[...$E(FE((0,u.clone)(e.attributes),(0,u.clone)(t.attributes),!1),WE((0,u.clone)(t.attributes),(0,u.clone)(t.crosswalks)),e),...eT(e,t)],rT=(0,u.pipe)(((e,t)=>{const r=(0,u.toPairs)(e);return(0,u.map)((0,u.evolve)({newValue:(0,u.when)(Array.isArray,(0,u.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return qf(r,n,e)}),e))))}),t)}),Zf),nT=(0,u.curry)(((e,t)=>(0,u.when)(Et,(0,u.propOr)(u.__,t,e),t)));function iT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aT(e,t,r[t])}))}return e}function aT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oT=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:xe.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},sT=e=>{let{relationUri:t}=e;return{type:xe.DELETE_RELATION,parameters:{relationUri:t}}},lT=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:xe.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},uT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:xe.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},cT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:xe.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},pT=(0,u.curry)(((e,t)=>(0,u.cond)([[(0,u.pathEq)(["parameters","relation","uri"],e),u.T],[(0,u.pathEq)(["parameters","relationUri"],e),u.T],[(0,u.pathEq)(["parameters","oldRelation","uri"],e),u.T],[(0,u.pathEq)(["parameters","newRelation","uri"],e),u.T],[u.T,u.F]])(t))),dT=e=>e.type===xe.DELETE_RELATION,yT=e=>e.type===xe.CREATE_RELATION,fT=e=>e.type===xe.REPOINT_RELATION,TT=e=>e.type===xe.UPDATE_RELATION,ET=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),mT=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case xe.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return dp({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case xe.DELETE_RELATION:return()=>{const{relationUri:e}=r;return pp(e,i).then(o)};case xe.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Ep(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case xe.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return yp({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case xe.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[sT({relationUri:o}),oT({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,u.pipe)((0,u.map)(hT(n)),(0,u.map)(mT),ET)(s)}}},hT=e=>t=>iT({dcrProcessor:e},t),bT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Nr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,u.pipe)(u.flatten,(0,u.map)(hT(r)),(0,u.map)(mT),ET,(0,u.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},OT=e=>t=>(0,u.map)((t=>iT({},t,{parameters:(0,u.evolve)({parentUri:nT(e),entityUri:nT(e),newEntityUri:nT(e)},t.parameters)})),t),vT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},gT=(e,t)=>{const r=e.filter(yT).find(pT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>TT(o)&&pT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!fT(o)||!pT(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(vT({condition:e=>r===e,updater:e=>(0,u.evolve)({parameters:(0,u.evolve)({relation:(0,u.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},_T=(e,t)=>{const r=e.filter(fT).filter(pT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,u.last)(r)===i:!TT(i)||!pT(t,i)||(a>e.indexOf((0,u.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(vT({condition:e=>(0,u.last)(r)===e,updater:e=>(0,u.evolve)({parameters:(0,u.evolve)({relation:(0,u.always)(n)})})(e)})):i},AT=(e,t)=>{const r=e.filter(dT).filter(pT(t));return e.filter((e=>r.includes(e)?(0,u.last)(r)===e:!pT(t,e)))},NT=(e,t)=>{const r=e.filter(TT).filter(pT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!TT(e)||(n=n||e.parameters.oldRelation,(0,u.last)(r)===e)));return n?i.map(vT({condition:e=>(0,u.last)(r)===e,updater:e=>(0,u.evolve)({parameters:(0,u.evolve)({oldRelation:(0,u.always)(n)})})(e)})):i},PT=e=>{const t=e.filter(dT).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,u.uniq)(t).reduce(AT,e)},RT=e=>{const t=e.filter(yT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,u.uniq)(t).reduce(gT,e)},ST=e=>{const t=e.filter(fT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,u.uniq)(t).reduce(_T,e)},wT=e=>{const t=e.filter(TT).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,u.pipe)((0,u.filter)((e=>(0,u.count)((0,u.equals)(e),t)>1)),u.uniq,(0,u.reduce)(NT,e))(t)},IT=e=>(0,u.pipe)(PT,RT,ST,wT)(e);function UT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){CT(e,t,r[t])}))}return e}function CT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LT=e=>UT({},(0,u.path)(BT(),e),{startDate:(0,u.path)(KT(),e),endDate:(0,u.path)(JT(),e)}),DT=(e,t)=>(0,u.pipe)((0,u.path)(QT()),nT(t))(e),jT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=DT(e,r),i=(0,u.path)(qT(),e)===$e.IN,a=e.parentEntityUri||n;return oT({parentUri:i?t:a,relation:LT(e),entityUri:i?a:t})})),...o.map((t=>{const i=DT(t,r),a=(0,u.path)(qT(),t)===$e.IN,o=i!==(0,u.pipe)((0,u.path)(BT()),a?XT:zT)(t),s=tE(e,(0,u.path)(WT(),t)),l=t.parentEntityUri||n,c=nT(r,i);return o?cT({entityUri:a?l:c,newEntityUri:a?c:l,relation:(0,u.path)(BT(),t),isReversed:!1}):uT({oldRelation:(0,u.path)(BT(),s),newRelation:LT(t)})})),...i.map((e=>sT({relationUri:e}))),...s.map((e=>lT({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},kT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return UT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),FT=(0,u.has)("dataTenant"),MT=(0,u.ifElse)(FT,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,u.prop)("relationUri")),xT=(e,t)=>(0,u.pipe)(ui,(0,u.defaultTo)({}),(0,u.propOr)([],"attributes"),(0,u.concat)(js),Pa)(e,t),$T=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,u.pipe)((0,u.assoc)("relationType",t),(0,u.assoc)("relationLabel",r),(0,u.assoc)("object",{type:t,attributes:{},uri:i}),(0,u.assoc)("direction",n))(e)}},VT=(e,t,r)=>{const n=nd(t,e.dataLabelPattern),i=(0,u.lensProp)("entity");return(0,u.over)(i,(0,u.evolve)({entityLabel:(0,u.always)(n),object:{label:(0,u.always)(n)}}),r)},GT="relation",WT=(0,u.always)([GT,"relationUri"]),YT=(0,u.always)([GT,"relationType"]),BT=(0,u.always)([GT,"object"]),qT=(0,u.always)([GT,"direction"]),HT=(0,u.always)([GT,"object","attributes"]),QT=(0,u.always)(["entity","entityUri"]),KT=(0,u.always)([GT,"startDate"]),JT=(0,u.always)([GT,"endDate"]),XT=(0,u.path)(["startObject","objectURI"]),zT=(0,u.path)(["endObject","objectURI"]),ZT=(0,u.path)(["startObject","objectTypeURI"]),eE=(0,u.path)(["endObject","objectTypeURI"]),tE=(e,t)=>{for(const r of e){if((0,u.pipe)((0,u.path)(WT()),(0,u.equals)(t))(r))return r;if(r.connections){const e=tE(r.connections,t);if(e)return e}}},rE=(0,u.pipe)(tE,(0,u.path)(BT())),nE=(0,u.allPass)([(0,u.pipe)((0,u.path)(QT()),(0,u.complement)(m)),(0,u.pipe)((0,u.path)(YT()),(0,u.complement)(m))]),iE=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:ht()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:l,outRelations:c}=sE({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=aE(l,c);return(0,u.pipe)((0,u.evolve)({relation:p?$T(p):u.identity}),(0,u.defaultTo)({}),(0,u.when)((0,u.always)(i),(0,u.assoc)("parentEntityUri",i)))(a)},aE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:Zr.IN}:{type:t[0],direction:Zr.OUT}:null},oE=e=>e.uri||e,sE=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&vi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Zr.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,u.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},l=e=>(0,u.pipe)((0,u.assocPath)(["startObject","objectType"],Ur(a,e.startObject.objectTypeURI)),(0,u.assocPath)(["endObject","objectType"],Ur(a,e.endObject.objectTypeURI)))(e),c=(0,u.pipe)(oE,ui(a));return(0,u.evolve)({inRelations:(0,u.pipe)((0,u.map)(c),(0,u.filter)(s(Zr.IN)),(0,u.map)(l)),outRelations:(0,u.pipe)((0,u.map)(c),(0,u.filter)(s(Zr.OUT)),(0,u.map)(l))},t)||{}},lE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=fi({reversedContextLabels:!0}),a=(0,u.curry)(((e,t,r,n)=>{const[i,a]=pi(e,n.uri);return n&&(!t||Lr(e,i,t))&&(!r||Lr(e,a,r))})),o=t=>(0,u.pipe)((0,u.assocPath)(["startObject","objectType"],Ur(e,t.startObject.objectTypeURI)),(0,u.assocPath)(["endObject","objectType"],Ur(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,u.both)(Yo,r));return{inRelations:(0,u.pipe)((0,u.filter)(a(e,null,t)),(0,u.filter)(n),(0,u.map)(o))(s),outRelations:(0,u.pipe)((0,u.filter)(a(e,t,null)),(0,u.filter)(i),(0,u.map)(o))(s)}},uE=(0,u.curry)(((e,t,r,n,i)=>{const a=Lr(n,u.__,t.type),o=e?eE:ZT,s=Lr(n,u.__,r.type),l=e?ZT:eE;return(0,u.both)((0,u.pipe)(o,a),(0,u.pipe)(l,s))(i)})),cE=(e,t,r)=>{const n=e?eE:ZT,i=(0,u.pipe)((0,u.map)(n),u.uniq)(r);return(0,u.pipe)((0,u.filter)((e=>{let{uri:r}=e;return i.some(Lr(t,u.__,r))})),(0,u.reject)((0,u.prop)("abstract")),(0,u.map)((0,u.prop)("uri")))(t.entityTypes||[])};function pE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dE(e,t,r[t])}))}return e}function dE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return pE({},t,{[r]:{parents:n,children:i}})},fE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return pE({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},TE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t[e],a=$f(t,i),o=yE({hierarchy:n,uri:e,children:a.map((0,u.prop)("uri")),parents:r});return a.reduce(((r,n)=>TE(n.uri,t,[e],r)),o)},EE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,u.path)(WT(),n),a=t?fE({hierarchy:e,uri:t,children:[i]}):e,o=(0,u.path)(QT(),n),s=Et(o)?[o]:[],l=yE({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>TE(t,r,[i],e)),l)}),n)},mE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return EE(r,e,t,TE(e,t))},hE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return mE(t,r,n);if(Ot(e)){const t=tE(n,e);return t&&EE([t],null,r)}return r[e]?TE(e,r):void 0},bE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>bE(e,t))))},OE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>OE(e,t))))},vE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=bt(t),l=mE(r,n,i),c=((e,t,r)=>{let{entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[];let s;for(let e=0;e<t.length;e++){const l=t[e],c=t[e+1]||r;if(Ot(c)){if(s=tE(i,c),!s)return null;o.push({type:ge.relationConnection,value:s,valueType:ui(a,(0,u.path)(YT(),s))});continue}if(Ot(l)){const e=n[c];if(!e)return null;o.push({type:ge.tempEntity,value:e,valueType:Ur(a,e.type)});continue}const p=n[l],d=Ls(p,c),y=n[c];if(!d||!y)return null;o.push({type:ge.attributeValue,value:d,valueType:ir(a,It(d.uri,p.type))}),o.push({type:ge.tempEntity,value:y,valueType:Ur(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},OE(l,s).reverse(),s);if(!c)return null;o.push(...c);const p=Ot(s),d=p?rE(i,s):n[s],[y,f]=t!==s?(e=>{const t=e.split("/attributes/").slice(1).join("/attributes/");if(!t)return[];const[r,n]=t.split("/").reduce(((e,t,r)=>(e[r%2==0?0:1].push(t),e)),[[],[]]);return r.length!==n.length?[]:[r,n]})(t):[[],[]];if(!d||!y||!f)return null;let T,E=p?ui(a,d.type):Ur(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:ar(a,E);if(E=null==t?void 0:t.find((0,u.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:ge.tempEntity,value:T,valueType:Ur(a,T.type)}),o.push({type:ge.attributeValue,value:s,valueType:E}),m=s.value;const l=Ts(s);T=l&&Et(l)?n[l]:null}}return o},gE=e=>e.every((e=>{let{type:t}=e;return[ge.attributeValue,ge.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ge.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,_E=e=>{let t=[];var r;return e&&(t.push({uri:e.uri,crosswalks:e.crosswalks,merges:e.merges}),null===(r=e.merges)||void 0===r||r.forEach((e=>{e.losers.forEach((e=>{t=t.concat(_E(e))}))}))),t},AE=(e,t)=>(0,u.find)((e=>(0,u.find)((0,u.eqBy)(SE,t),(0,u.propOr)([],"crosswalks",e))),e),NE=(e,t)=>{let r=e.crosswalks||[];var n;return t||null===(n=e.merges)||void 0===n||n.forEach((e=>{var t;null===(t=e.losers)||void 0===t||t.forEach((e=>{r=r.concat(NE(e))}))})),r},PE=e=>{let t=0;var r;return e?(null===(r=e.merges)||void 0===r||r.forEach((e=>{var r;null===(r=e.losers)||void 0===r||r.forEach((e=>{const r=PE(e);r>t&&(t=r)}))})),t+1):t},RE=(e,t)=>{if(Et(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},SE=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},wE=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},IE=e=>{let{deleteDate:t}=e;return!!t&&T().utc(t).valueOf()<Date.now()},UE=(e,t)=>{const r=t.reduce(((e,t)=>(e["configuration/sources/"+t.name]=t,e)),{}),n=t.reduce(((e,t)=>(e[t.id]=t,e)),{});return(0,u.pipe)((0,u.map)((e=>{var t,i;if(r[e.type])return r[e.type];const a=null===(t=e.crosswalkExternalInfo)||void 0===t||null===(i=t.dtssInfo)||void 0===i?void 0:i.tenantId;return a&&n[a]?n[a]:void 0})),(0,u.reject)(u.isNil),u.uniq,(0,u.ifElse)((e=>{let{length:t}=e;return 1===t}),u.head,(()=>{})))(e)},CE=(0,u.eqBy)(SE),LE=(0,u.pipe)((0,u.propOr)({},"attributes"),u.values,u.flatten,(0,u.filter)((0,u.has)("refRelation")),(0,u.chain)((e=>(0,u.pipe)(us,(0,u.propOr)([],"crosswalks"),(0,u.map)((0,u.when)((0,u.pipe)((0,u.prop)("attributeURIs"),m),(0,u.assoc)("attributeURIs",[e.uri]))))(e))));function DE(e){return e&&void 0!==e.uri}function jE(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function kE(e,t){function r(r){if(e[r]&&t[r])if(Array.isArray(e[r])&&Array.isArray(t[r])){if(e[r].length!==t[r].length)return!1;if(e[r][0]&&t[r][0]&&e[r][0].objectURI!==t[r][0].objectURI)return!1}else if(e[r].objectURI!==t[r].objectURI)return!1;return!0}return r("refEntity")&&r("refRelation")}function FE(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var l=e[s];if(void 0===t[s])for(var c in l)l.hasOwnProperty(c)&&o.push.apply(o,m(l[c]));else for(var p in l)if(l.hasOwnProperty(p)){var d=l[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,u.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(FE(d.value,y.value,r)):"Reference"===g(d)?kE(d,y)?o.push.apply(o,FE(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,u.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ce(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ce(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function ME(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||DE(r)&&DE(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function xE(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,u.isNil)(t)?"":t+""),r}}function $E(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=VE(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?GE(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=VE(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const VE=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),GE=(e,t,r)=>(0,u.pipe)(Ds,(0,u.defaultTo)([]),(0,u.reject)((0,u.propEq)("uri",r)),(0,u.ifElse)((0,u.allPass)([e=>1===e.length,e=>{let[r]=e;return RE(t,r)},e=>{let[t]=e;return!as(t)}]),(0,u.prop)(0),(0,u.always)(null)))(e,r);function WE(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function YE(e,t){return jE("UPDATE_TAGS").call(this,e,t)}function BE(e,t){return jE("UPDATE_ROLES").call(this,e,t)}function qE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HE(e,t,r[t])}))}return e}function HE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var QE=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ce(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ce(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ce(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ce(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,u.difference)(t,e),n=(0,u.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,u.pipe)((0,u.map)((t=>[t,e])),u.fromPairs)(t),o=qE({},a("INSERT_ATTRIBUTE",r),a("DELETE_ATTRIBUTE",n));return[i,o]};return{computeHistoryDiff:a,computeEntityHistoryDiff:(e,t)=>{const{attributes:r,appearance:n}=e?a(e.attributes,t.attributes):{attributes:t.attributes,appearance:{}},[i,s]=o(e?e.roles:[],t.roles),[l,u]=o(e?e.tags:[],t.tags);return{attributes:r,appearance:qE({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const KE=(0,u.pipe)(u.values,u.flatten,(0,u.reduce)(((e,t)=>{const r=[t.uri,...(0,u.is)(Object,t.value)?KE(t.value):[]];return e.concat(r)}),[])),JE=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,XE=e=>e?[_d(e)]:[],zE=e=>{const t=[...KE((null==e?void 0:e.attributes)||[]),...KE((null==e?void 0:e.analyticsAttributes)||[])];return e?[...XE(e),...t]:[]},ZE=(e,t)=>[e,...t.map((t=>JE(e,t)))],em=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return MT(t)}))},tm=(e,t)=>{switch(e){case _e.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case _e.ENTITY_ATTRIBUTE:case _e.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Ut(t)]})(t);case _e.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case _e.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,_d({uri:n,dataTenant:i}),r]})(t)}},rm=e=>(0,u.pipe)(u.values,(0,u.map)((0,u.map)((0,u.pipe)((0,u.prop)("replies"),u.inc))),(0,u.map)(u.sum),u.sum)(e),nm=(0,u.curry)(((e,t)=>{const r=fo(e,t),n=(0,u.pipe)((0,u.prop)("memberTypes"),(0,u.chain)((0,u.prop)("name")))(r);return r.extendsTypeURI?n.concat(nm(e,r.extendsTypeURI)):n})),im=(0,u.curry)(((e,t)=>(0,u.reduce)(((t,r)=>(0,u.assoc)(r,((e,t)=>(0,u.path)(["members",t],e))(e,r),t)),{},t))),am=(e,t)=>(0,u.pipe)((0,u.prop)("type"),nm(e),im(t))(t);function om(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sm=e=>{let{type:t,attributeType:r,attributeTypeUri:n,parentUri:i,uri:a,message:o,source:s}=e;return{type:t,uri:a,attributeTypeUri:n,attributeType:r,parentUri:i,message:o,source:s}},lm=e=>!e.deactivated,um=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},cm=e=>um(e)+e.message,pm=(0,u.unless)(u.isNil,(0,u.prop)("message")),dm=(0,u.unless)(u.isNil,(0,u.prop)("type")),ym=(0,u.curry)(((e,t)=>At(t.parentUri,e))),fm=(0,u.curry)(((e,t)=>t.parentUri===e)),Tm=(0,u.curry)(((e,t)=>(0,u.cond)([[(0,u.pipe)((0,u.prop)("uri"),At(t.attributeTypeUri)),u.T],[(0,u.both)((0,u.propEq)("type",ze.TYPE_REFERENCE),(0,u.pipe)(nt,(0,u.any)(At(t.attributeTypeUri)))),u.T],[u.T,u.F]])(e))),Em=(0,u.curry)(((e,t)=>t.attributeTypeUri===e)),mm=(0,u.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),hm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,u.filter)((0,u.allPass)([Pm,lm,ym(e),Tm(t),(0,u.complement)(mm(e,t.uri))]))(r)},bm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,u.find)((0,u.allPass)([Pm,lm,fm(e),Em(t.uri),(0,u.complement)((0,u.prop)("uri")),(0,u.complement)((0,u.propEq)("type",he.missed))]))(r);return n&&n.message||""},Om=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,u.find)((0,u.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===he.missed))},vm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.find)((0,u.allPass)([lm,(0,u.propEq)("type",he.missedRefEntity),(0,u.propEq)("parentUri",(0,u.path)(WT(),e))]))(t)},gm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.find)((0,u.allPass)([lm,(0,u.propEq)("type",he.missedRefEntity),(0,u.propEq)("parentUri",e.uri)]))(t)},_m=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.any)((0,u.allPass)([lm,ym(t)]))(r)},Am=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.find)((0,u.allPass)([lm,(0,u.propEq)("type",he.missedRefEntity),(0,u.propEq)("parentUri",(0,u.path)(["relation","uri"],e))]))(t)},Nm=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?vE(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case ge.attributeValue:{const e=a;if(Qt(a))return nd(o,e.dataLabelPattern);if(Kt(a)){const t=o,i=Ts(t),a=tt(e),s=Ur(n,a);return Et(i)?nd(r[i],s.dataLabelPattern):t.label}return""}case ge.tempEntity:return nd(o,a.dataLabelPattern);case ge.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Ur(n,null==e?void 0:e.entityType);return`${ad(i&&Et(i)?nd(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||ci(n,null==t?void 0:t.relationType)}`}}})({entitiesMap:r,metadata:n},e);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){om(e,t,r[t])}))}return e}({},e,{label:ad(t)})}))},Pm=e=>!e.severity||e.severity===Oe.ERROR,Rm=(0,u.curry)(((e,t)=>{let r=t.value;switch(e.type){case ze.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,u.propEq)("name",t));return r[t].some(Rm(n))}));case ze.TYPE_REFERENCE:return!!ls(t);case ze.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),Sm=(e,t)=>e.every((0,u.complement)(Rm(t))),wm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;const n=ho(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=Os(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!as(e.parent))))).forEach((e=>{Sm(e.attrValues,n)&&r.push(sm({type:he.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:tn().text("Attribute is required"),source:be.local}))})),r}),[])},Im=(0,u.curry)(((e,t,r)=>Os(e,t,r,!1))),Um=(e,t)=>{const r=(0,u.pipe)((0,u.prop)("type"),Ur(e),(0,u.prop)("attributes"),(0,u.defaultTo)([]),(0,u.reject)(qt),(0,u.filter)(Kt),(0,u.map)((0,u.prop)("uri")),(0,u.chain)(Im(e,t)));return(0,u.pipe)(r,(0,u.reject)(Ts),(0,u.map)((e=>{let{uri:r}=e;return sm({type:he.missedRefEntity,uri:"",attributeTypeUri:It(r,t.type),parentUri:r,message:tn().text("Entity is required"),source:be.local})})))(t)},Cm=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,u.has)("refEntity")).filter((0,u.pipe)(Ts,Et)).flatMap((n=>{const i=Ts(n),a=t[i],o=ir(e,It(n.uri,r.type));return Lm(e,t,o,a)})),Lm=(e,t,r,n)=>{const i=nt(r),a=i.map((t=>ir(e,t))).filter((0,u.both)(u.identity,(0,u.propEq)("type",ze.TYPE_REFERENCE))).flatMap(at).concat(i);return Dm(e,t,n,(e=>a.some(At(e.uri))))},Dm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.identity;const i=wm(e,r,n),a=Um(e,r),o=Cm(e,t,r);return[...i,...a,...o]},jm=(e,t)=>{const r=(0,u.path)(BT(),t)||{};return wm(e,r)},km=(e,t,r)=>{t=t||{};const n=(0,u.pipe)((0,u.path)(QT()),(0,u.ifElse)(Et,(e=>t[e]),(0,u.always)(null)))(r),i=jm(e,r),a=(e=>(0,u.path)(QT(),e)?[]:[sm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,u.path)(YT(),e),parentUri:(0,u.path)(WT(),e),message:tn().text("Entity is required"),source:be.local})])(r),o=((e,t,r)=>r?Dm(e,t,r):[])(e,t,n);return[...i,...a,...o]},Fm=e=>(0,u.path)(["entity","uri"],e)?[]:[sm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,u.path)(["relation","type"],e),parentUri:(0,u.path)(["relation","uri"],e),message:tn().text("Entity is required"),source:be.local})],Mm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=wm(e,r),i=Fm(t);return[...n,...i]};function xm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $m=(e,t)=>{var r,n;const i=Ur(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Wa(e)},Vm=e=>(0,u.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Gm=e=>{const t=r=>(0,u.ifElse)(Array.isArray,(0,u.map)(t),(0,u.pipe)(Vm(e),(0,u.evolve)({value:(0,u.when)((0,u.is)(Object),(0,u.map)(t))})))(r);return t},Wm=(e,t)=>(0,u.when)((0,u.prop)("refEntity"),(0,u.pipe)((0,u.when)((0,u.allPass)([(0,u.prop)("refRelation"),(0,u.always)("INSERT_ATTRIBUTE"===t),(0,u.pipe)(Es,Et,u.not)]),(e=>{const t=(0,u.pipe)(Es,Pt)(e);return Gm((e=>e.replace(t,t+pt)))(e)})),(0,u.when)((0,u.pipe)(Ts,Et),(t=>{const r=Ts(t),n=e[r],i=n&&Bm(n,e);return null!=i&&i.attributes?(0,u.evolve)({value:e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xm(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Ym=(e,t,r)=>$E(FE((0,u.clone)(e.attributes),(0,u.clone)(t.attributes),!0),WE((0,u.clone)(t.attributes),(0,u.clone)(t.crosswalks)),e).map((e=>(0,u.evolve)({newValue:(0,u.when)(Array.isArray,(0,u.pipe)((0,u.filter)((e=>!e.refRelation||e.refEntity)),(0,u.map)(Wm(r,e.type)),(0,u.map)(Gm(kt))))})(e))).concat(eT(e,t)),Bm=(e,t)=>(0,u.evolve)({attributes:Tl({valueTransformer:(0,u.pipe)(bs,Wm(t),Vm(kt)),deleteEmptyComplex:!0}),uri:kt})(e);function qm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hm(e,t,r[t])}))}return e}function Hm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qm=(0,u.unless)(u.isNil,(e=>e.replace(new RegExp(ct,"g"),"uri$$$$").replace(new RegExp(pt,"g"),""))),Km=e=>(0,u.pipe)((0,u.evolve)({objectUri:Qm,objectParentUri:Qm}),(e=>{return qm({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?he.missed:he.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&jt(e.objectUri),uri:e.objectUri,source:be.validationService},(0,u.pick)(["message","severity"],e));var t}))(e),Jm=(e,t)=>(0,u.map)((0,u.pipe)(Km,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:l}=e,c=Nm(t,s),p=null!=c&&c.length?c.slice(0,-1):Nm(t,l),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&ir(e,i);if(!a&&n&&t&&t.length){const e=(0,u.last)(t);e.type===ge.attributeValue&&(a=e.valueType)}return a})(o,c,e);return qm({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,u.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,u.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||l,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&Dt(i)){const n=(0,u.last)(a),i=n.valueType;if(Kt(i)&&ot(i).includes(o)){const i=Ts(n.value),o=i&&Et(i)?t[i]:null;return o?qm({},e,{parentUri:o.uri,path:a.concat({type:ge.tempEntity,value:o,valueType:Ur(r,o.type),label:""})}):e}}return e}})(t)))(e),Xm=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var zm,Zm=r(33164);function eh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(zm||(zm={}));const th={},rh={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},nh=(0,u.curry)(((e,t)=>{const r=(e=>{if(!th[e]){const t=rh[e]||rh.random0;th[e]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eh(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return th[e]})(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),ih=e=>nh(zm.Charts,e),ah=e=>nh(zm.Random1,e),oh=e=>(0,Zm.getColor)(e)?"#FFFFFF":"#212121";var sh=r(51404),lh=r.n(sh);const uh=Array.from({length:100},((e,t)=>t/100)),ch=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},ph={},dh=new(lh())({hash:ch,saturation:uh.slice(15,71),lightness:uh.slice(50,90)}),yh=new(lh())({hash:ch,saturation:uh.slice(46,89),lightness:uh.slice(44,58)}),fh=(0,u.curry)(((e,t,r)=>{t in ph||(ph[t]={});const n=ph[t];r in n||(n[r]=((e,t)=>{const r=String(ch(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Th=fh(dh,"crosswalks"),Eh=fh(dh,"sources"),mh=fh(dh,"contributors"),hh=fh(dh,"dataValidationFunctions"),bh=fh(yh,"entities");function Oh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vh(e,t,r[t])}))}return e}function vh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gh=(0,u.has)("items"),_h=e=>0===e,Ah=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.min(Math.max(e,t),r)},Nh=e=>e.reduce(((e,t)=>e+t.width),0),Ph=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Rh=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Sh=e=>e.reduce(((e,t)=>e+t.height),0),wh=e=>(0,u.is)(String,e)&&e.includes("%"),Ih=e=>Boolean(e.spacer),Uh=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),Ch=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(gh(t)?Ch(t):t)),[]),Lh=e=>({id:e.layout}),Dh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lh;const i=(e,t,r,n)=>{let{width:i}=e;const a=t.items.some((e=>e.flex));let o;if(a){const[e,n]=(0,u.partition)((0,u.propIs)(Number,"flex"),t.items),a=(0,u.pipe)((0,u.map)((0,u.pipe)((0,u.prop)("flex"),parseInt)),u.sum)(e),s=Math.round(i-i*(a/(a+n.length))),l=Math.max(s/Math.max((0,u.length)(n),1),1),c=(e,t,r)=>Math.max(Math.floor(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):l}else{const[e,n]=(0,u.partition)((0,u.both)((0,u.propIs)(String,"width"),(0,u.pipe)((0,u.propOr)("","width"),(0,u.includes)("%"))),t.items),a=(0,u.pipe)((0,u.map)((0,u.pipe)((0,u.prop)("width"),parseInt)),u.sum)(e),s=Math.round(i-i*(a/100)),l=Math.max(s/Math.max((0,u.length)(n),1),1);o=wh(r.width)?Uh(i,r.width):l}return Ah(o,(0,u.prop)("minWidth",n),(0,u.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Ah(n,t,r)},o=(e,t)=>gh(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.reduce(((o,s,l)=>{const c=i(t,r,s,gh(s)?n(s.layout):e(s.view)),d=_h(l)?t.x:(0,u.last)(o).x+(0,u.propOr)(c,"width",(0,u.last)(o));if(gh(s))return o.concat(p(Oh({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(Oh({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:Nh(o),height:Ph(o),items:o}},l=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=gh(i)?n(i.layout):e(i.view),l=t.width,c=a(s),d=_h(o)?t.y:(0,u.last)(r).y+((0,u.last)(r).height||c);if(gh(i))return r.concat(p(Oh({},t,{y:d,width:l}),i));{const n=e(i.view);return r.push(Oh({},n,{y:d,x:t.x,height:c,width:l,minWidth:(0,u.is)(Number,n.minWidth)?Ah(n.minWidth,n.minWidth,l):void 0,maxWidth:(0,u.is)(Number,n.maxWidth)?Ah(n.maxWidth,n.maxWidth,l):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Rh(i),height:Sh(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,l=a(o),c=_h(i)?t.y:(0,u.last)(r).y+((0,u.last)(r).height||l);return Oh({},o,{x:t.x,y:c,width:s,height:l})},i=(e,t)=>{const r=t.reduce(((t,r,i)=>{if("string"==typeof r)t.push(n(e,t,r,i));else if("object"==typeof r){const a=Math.round(e.width/2),o=Oh({},e,{width:a}),s=Oh({},e,{x:e.x+a,width:a}),l=(0,u.has)("left",r)&&n(o,t,r.left,i),c=(0,u.has)("right",r)&&n(s,t,r.right,i),p=(0,u.propOr)(0,"height"),d=Math.max(p(l),p(c));t.push(Oh({},e,{height:d,items:(0,u.filter)(u.identity,[l,c])}))}return t}),[]);return Oh({},e,{height:Sh(r),items:r})},o=i(t,(0,u.propOr)([],"top",r)),s=Math.round(.66*t.width),l=(0,u.isEmpty)(o)?t.y:t.y+o.height,c=i(Oh({},t,{y:l,width:s}),(0,u.propOr)([],"center",r)),p=i({x:t.x+s,y:l,width:t.width-s},(0,u.propOr)([],"right",r)),d=o.height+Math.max(c.height,p.height),y=(0,u.pipe)((0,u.prop)("items"),u.length,(0,u.equals)(0));return Oh({},t,{height:d,items:(0,u.reject)(y,[o,c,p])})},p=(e,t)=>{const r=Oh({},t,{items:(0,u.reject)(Ih,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return l(e,r);default:return null}},d=(0,u.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return Ch(f)},jh=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),kh=[We.FilteredEntitiesViewFacet,We.ActivitiesViewFacet,We.ProfileStatsFacet,We.FilteredSavedSearchesFacet],Fh=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=kh.includes(a.component)?8:4;return Oh({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Mh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xh(e,t,r[t])}))}return e}function xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $h={BarChart:Ge.BAR,BarChartGrouped:Ge.BAR,BarChartHorizontal:Ge.BAR,LineChart:Ge.LINE,Map:Ge.MAP,Pie:Ge.PIE},Vh=(e,t)=>Ct(e)?St(e,t):e,Gh=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=$h[r];return Mh({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Wh=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Mh({findPublic:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["findShared"]))},Yh=(e,t,r)=>{const n=(e=>e&&ie(e).map((e=>{const{type:t,value:r}=e;return Mh({},e,{value:[Gr,Wr,xr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Br(t),fieldName:r,values:n?ie(n):void 0}})))(e);return t&&Ct(t)||!r?n:(n||[]).concat((i=r,{filter:xr.EQUALS,fieldName:"type",values:[i]}));var i},Bh=["https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/world.countries.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/usa_prefix_latlng.topo.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/us-10m.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/zips-us-topo.json"],qh={"com.reltio.plugins.dashboard.BarChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:Vh(n,r),filters:Yh(a,n,r),chartType:Ge.BAR,component:We.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:Vh(n,r),filters:Yh(a,n,r),chartType:Ge.BUBBLE,component:We.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:We.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ie(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Mh({id:t,count:o,canRead:u,orderType:s,attributeUri:Vh(r,p),filters:Yh(a,r,p),component:We.DashboardFacet,title:i,showOthers:!0},Gh(l))},"com.reltio.plugins.dashboard.MapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,mapType:l,canRead:u}=e;return{id:t,count:o,canRead:u,orderType:s,attributeUri:Vh(n,r),filters:Yh(a,n,r),chartType:Ge.MAP,component:We.DashboardFacet,title:i,geoUrl:Bh[l||0],projection:"geoMercator"}},"com.reltio.plugins.dashboard.SimpleMapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,map:s,canRead:l,options:u}=e;return Mh({id:t,count:o,canRead:l,attributeUri:Vh(n,r),filters:Yh(a,n,r),component:We.DashboardFacet,title:i,geoUrl:s,chartType:Ge.MAP,projection:"geoMercator"},Gh(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:Wh(i),component:We.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:Yh(n,null,a),component:We.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:xr.GTE,fieldName:"matches",values:["1"]}],component:We.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:We.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ge.CLOUD,component:We.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ge.TREE,component:We.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.NotificationInboxFacet,title:n||tn().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.ActivitiesViewFacet,title:n||tn().text("Activity log")}}},Hh=e=>({id:e,height:10}),Qh=(0,u.pipe)((0,u.map)((e=>{const t=qh[null==e?void 0:e.class];return t?t(e):null})),(0,u.reject)(u.isNil)),Kh=e=>{if("0.1"===e.version){const t=Qh(e.views),r=Dh(Hh,e.layout,{columns:4});return{id:e.id,margin:0,layout:jh(r,t),views:t}}return e},Jh=e=>(0,u.cond)([[(0,u.propEq)("layout","profile"),(0,u.pipe)((0,u.pick)(["center","right","top"]),u.values,u.flatten,(0,u.map)((0,u.when)((0,u.is)(Object),u.values)),u.flatten)],[(0,u.has)("view"),(0,u.pipe)((0,u.prop)("view"),ie)],[(0,u.prop)("items"),(0,u.pipe)((0,u.prop)("items"),(0,u.map)((e=>Jh(e))),u.flatten)],[u.T,(0,u.always)([])]])(e);function Xh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zh(e,t,r[t])}))}return e}function zh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zh=Xh({},Ye,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),eb=e=>e,tb={[Zh.Attributes]:eb,[Zh.HierarchyTree]:eb,[Zh.HierarchyPaths]:eb,[Zh.RelationsTable]:eb,[Zh.Relations]:e=>Xh({},(0,u.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Zh.SingleAttribute]:eb,[Zh.Custom]:eb,[Zh.AttributeTable]:eb,[Zh.Map]:eb,[Zh.OldTree]:e=>Xh({},e,{class:Ye.HierarchyTree}),[Zh.OldMap]:e=>Xh({},e,{class:Ye.Map}),[Zh.ImageAttribute]:eb,[Zh.PotentialMatches]:eb},rb=(0,u.pipe)((0,u.map)((e=>{const t=tb[null==e?void 0:e.class];return t?t(e):null})),(0,u.reject)(u.isNil)),nb=(0,u.curry)(((e,t)=>(0,u.pipe)((0,u.defaultTo)([]),(0,u.find)((0,u.propEq)("id",t)),(0,u.prop)("class"))(e)===Ye.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),ib=e=>{const t=(0,u.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return Xh({},t,{layout:e.newLayout});if("0.1"===e.version){const r=rb(e.views),n=Dh(nb(r),e.layout,{columns:4});return Xh({},t,{layout:jh(n,r),views:r})}return e},ab=(e,t)=>e.class===t||e["react-class"]===t,ob=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(ab(t,Ye.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,u.intersection)(e.excludeUris,r):r}return ab(t,Ye.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(At(n))||t.some(At(n))}},sb=(e,t)=>e.filter((e=>t.some((t=>ab(e,t))))).map((e=>{let{id:t}=e;return t})),lb=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},ub=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),cb=(e,t)=>(e||[]).find((e=>e.activator===t)),pb=e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.entity.ProfileBand"))),(0,u.reject)(u.isNil),u.head)(e);function db(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yb(e,t,r[t])}))}return e}function yb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fb=(e,t)=>Jh(t).map((t=>(0,u.pipe)((0,u.map)((e=>lb(e,t))),(0,u.reject)(u.isNil),u.head)(e))),Tb=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},Eb=(e,t)=>{const r=(0,u.propOr)("0.1","version",t),n=t["entity-type"];if("2.0"===r&&t.newLayout){const{newLayout:e}=t,r=((e,t)=>(t||[]).map((t=>db({},t,nb(e,t.id)))))(t.views,e);return(0,u.pipe)((0,u.pick)(["views","sidePanelViews","profileBand"]),(0,u.mergeRight)({entityType:n,layout:r}),(0,u.reject)(u.isNil))(t)}const i=fb(e,t.layout),a=((e,t)=>{if(t.side){const r=(0,u.pipe)((0,u.chain)((e=>lb(e,t.side))),(0,u.reject)(u.isNil),u.head)(e);return Jh(r.layout||{})}})(e,t),o=ib(db({},t,{views:i,version:"0.1"})),s=(0,u.pipe)(pb,(0,u.defaultTo)({}),(0,u.pick)(["cloneAction","showEntityId"]))(e);return(0,u.reject)(u.isNil,{entityType:n,views:o.views,layout:o.layout,sidePanelViews:a,profileBand:s})},mb=(e,t)=>{if("scroll"===t.layout.layout){const r=fb(e,t.layout),n=Kh(db({},t,{views:r,version:"0.1"}));return{class:qe.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:qe.Dashboard,views:t.views,layout:t.layout,id:t.id}},hb=(e,t)=>{const r=fb(e,t.layout)[0];return{class:qe.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},bb=(e,t)=>{const r=fb(e,t.layout)[0];return{class:qe.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},Ob=(e,t)=>{const r=fb(e,t.layout)[0];return{class:qe.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},vb=(e,t)=>{const r=fb(e,t.layout)[0];return{class:qe.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},gb=(e,t)=>{const r=fb(e,t.layout)[0];return{class:qe.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},_b=(e,t)=>{const r=fb(e,t.layout)[0];return{class:qe.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},Ab=(e,t)=>{const r=fb(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=ub(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:qe.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},Nb=(e,t)=>({class:qe.Graph,id:t.id}),Pb=(e,t)=>{const r=fb(e,t.layout)[0];return{class:qe.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},Rb=e=>t=>!!(0,u.intersection)(e,t).length,Sb=(0,u.cond)([[Rb(["com.reltio.plugins.dashboard.BarChartView","com.reltio.plugins.dashboard.BubbleChartView","com.reltio.plugins.ui.CustomActionView","com.reltio.plugins.dashboard.FacetChartView","com.reltio.plugins.dashboard.MapView","com.reltio.plugins.dashboard.SimpleMapView","com.reltio.plugins.dashboard.ProfileStatsView","com.reltio.plugins.dashboard.FilteredSavedSearchesView","com.reltio.plugins.dashboard.FilteredEntitiesView","com.reltio.plugins.dashboard.EntitiesByTypeView","com.reltio.plugins.dashboard.EntitiesByTagView","com.reltio.plugins.dashboard.EntitiesByRoleView","com.reltio.plugins.inbox.NotificationInboxView","com.reltio.plugins.activities.ActivitiesView","com.reltio.plugins.react.ReactDashboardView"]),()=>mb],[Rb(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>hb],[Rb(["com.reltio.plugins.graph.GraphView"]),()=>Nb],[Rb(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>bb],[Rb(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>Ob],[Rb(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>vb],[Rb(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>gb],[Rb(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>_b],[Rb(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>Ab],[Rb(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Pb],[u.T,()=>(0,u.always)(void 0)]]),wb=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,u.pipe)((0,u.chain)(Tb),(0,u.map)((t=>Eb(e,t))),(0,u.indexBy)((0,u.prop)("entityType")),(0,u.map)((0,u.pick)(["layout","views","sidePanelViews","profileBand"])))(e);return{class:qe.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:He.CustomAction,config:(0,u.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:He.ConsoleAppAction,config:(0,u.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,u.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,u.find)((0,u.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,u.pipe)((e=>lb(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,u.pick)(["id","views","layout"]),(0,u.assoc)("class",qe.Dashboard))(e)}const i=(0,u.pipe)((0,u.map)((e=>lb(e,n))),(0,u.reject)(u.isNil),u.head)(t);if((0,u.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=Eb(e,r),i=(0,u.pipe)((0,u.propOr)([],"entity-types"),(0,u.map)((e=>[e,n])),u.fromPairs)(t);return{class:qe.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=Jh(i.layout),o=(0,u.pipe)((0,u.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,u.pluck)("class"),(0,u.reject)(u.isNil))(t);return Sb(o)(t,i)};function Ib(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ub(e,t,r[t])}))}return e}function Ub(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cb=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},Lb="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var Db;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(Db||(Db={}));const jb={[qe.DQDashboard]:`${Lb}DqDashboard.svg`,[qe.Dashboard]:`${Lb}Dashboard.svg`,[qe.Graph]:`${Lb}Graph.svg`,[qe.RelationshipSearch]:`${Lb}GraphSearch.svg`,[qe.Interactions]:`${Lb}Interactions.svg`,[qe.PotentialMatches]:`${Lb}PotentialMatches.svg`,[qe.Profile]:`${Lb}Profile.svg`,[qe.NestedProfile]:`${Lb}Profile.svg`,[qe.ProfileActivityLog]:`${Lb}ActivityLog.svg`,[qe.Relationships]:`${Lb}Relationships.svg`,[qe.Sources]:`${Lb}Crosswalk.svg`,[qe.Search]:`${Lb}Search.svg`,[Db.DashboardGroup]:`${Lb}DashboardGroup.svg`,[Db.ProfileGroup]:`${Lb}ProfileGroup.svg`,[Db.SearchGroup]:`${Lb}SearchGroup.svg`,DEFAULT:`${Lb}Default.svg`},kb=e=>jb[null==e?void 0:e.class]||jb.DEFAULT,Fb=(0,u.pipe)((0,u.pluck)("screen"),(0,u.filter)((0,u.anyPass)([(0,u.propEq)("class",qe.NestedProfile)])),(0,u.groupBy)((0,u.prop)("class")),(0,u.map)((e=>e.map(((e,t)=>Ib({},e,{nestedRoute:`${t+1}`})))))),Mb=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,u.propEq)("id",t.id)))||t},xb=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?jb[Db.ProfileGroup]:null,$b=e=>(0,u.cond)([[(0,u.any)((e=>{let{icon:t}=e;return t===jb[qe.Dashboard]||t===jb[qe.DQDashboard]})),(0,u.always)(jb[Db.DashboardGroup])],[(0,u.any)((e=>{let{icon:t}=e;return t===jb[qe.Search]||t===jb[qe.RelationshipSearch]})),(0,u.always)(jb[Db.SearchGroup])],[u.T,()=>null]])(e),Vb=e=>(0,u.pipe)((0,u.chain)(Cb),(0,u.sortBy)((0,u.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,u.pipe)((0,u.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,u.sortBy)((0,u.propOr)(1/0,"position")),(0,u.map)((e=>Ib({},e,{entityTypes:e["entity-types"],screen:wb(e,t)}))),(0,u.filter)((e=>e.screen)))(t),n=Fb(r);return(0,u.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:kb(r),screen:Mb(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=wb(t,e);return{label:t.label,icon:xb(t)||$b(r)||kb(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function Gb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wb=e=>{let{extensions:t}=e;return(t||[]).filter((0,u.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Yb=e=>({id:e,height:10}),Bb=e=>{const t=(e=>(0,u.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["attribute-types"]))}))(e))(e),r=(e=>(0,u.pipe)((0,u.chain)(Wb),(0,u.pluck)("pivotingAttributes"),u.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,u.propEq)("attribute-types","*")))(t);return(0,u.pipe)((0,u.reduce)(((e,n)=>{const i=((e,t)=>e.find((e=>Array.isArray(e["attribute-types"])&&e["attribute-types"].includes(t.uri))))(t,n)||r;return null!=i&&i.id&&(e[i.id]||(e[i.id]={extension:i,attributeTypes:[]}),e[i.id].attributeTypes.push(n)),e}),{}),u.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=Qh(((e,t)=>{const r=Jh(t);return(0,u.pipe)((0,u.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,u.filter)((e=>{let{views:t}=e;return t})),(0,u.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gb(e,t,r[t])}))}return e}({id:r},t[0])})),(0,u.uniqBy)((0,u.prop)("id")))(e)})(e,t.layout)),n=Dh(Yb,t.layout,{columns:4});return{views:r,layout:jh(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function qb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hb=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Qb=e=>(0,u.pipe)((e=>ub(e,"com.reltio.plugins.ui.custom_script")),(0,u.reject)(m),(0,u.map)((e=>{let{action:t}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qb(e,t,r[t])}))}return e}({},t,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["action"]))})))(e),Kb=(0,u.prop)("showLookupCode"),Jb=e=>{var t;const r=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,u.reject)(u.isNil),u.head,(0,u.omit)(["point","id"]))(e))(e),i=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,u.reject)(u.isNil),u.head,(0,u.defaultTo)({}),(0,u.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("levels"))(e))(e),o=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.entity.Validation"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("validateReadMode"))(e))(e),s=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("configuration"))(e))(e),l=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("configuration"),(0,u.defaultTo)({}),(0,u.filter)((0,u.propEq)("format","none")),(0,u.map)((0,u.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.workflow.configuration"))),(0,u.reject)(u.isNil),u.head,(0,u.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,u.pipe)((e=>cb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("default-perspective"),(0,u.ifElse)(Hb,(0,u.always)("dashboard"),(0,u.always)("search")))(e))(e),d=Qb(e),y=(e=>(0,u.pipe)((e=>cb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("checkUser"))(e))(e),f=(e=>(0,u.pipe)((e=>cb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("checkIdle"))(e))(e),T=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("preferNewUI"),u.not)(e))(e),E=(e=>(0,u.pipe)((0,u.map)((e=>lb(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,u.reject)(u.isNil),u.head,(0,u.defaultTo)({}))(e))(e),m=void 0===(h=Kb(E))||h;var h;const b=null===(t=pb(e))||void 0===t?void 0:t.showEntityId,O=(e=>(0,u.pipe)((e=>cb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("preview"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:m},validate:{levels:a,validateReadMode:o},attributePresentations:l,workflow:c,defaultRoute:p,customScripts:d,checkUser:y,checkIdle:f,showSwitchToClassic:T,showEntityId:b,preview:O}},Xb=e=>({layout:Vb(e),pivoting:Bb(e),properties:Jb(e)});var zb=r(58697),Zb=r.n(zb);function eO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tO(e,t,r[t])}))}return e}function tO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rO=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${Zb()()}`;return n[e.id].push(t),i=!0,eO({},e,{id:t})}return n[e.id]=[e.id],e})),o={},s=r&&i?r.map((e=>null==o[e.id]?(o[e.id]=0,e):(o[e.id]++,eO({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function nO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iO(e,t,r[t])}))}return e}function iO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let aO={};const oO=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=z(`${r.id}: ${r.action.files.join('","')}`);if(m(aO[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}aO=nO({},aO,{[a]:nO({},aO[a]||{},{worker:i})})}else i=aO[a].worker,aO[a].innerText&&t({task:{action:Ke.SET_HTML,params:{html:aO[a].innerText}},worker:i,config:r}),i.removeEventListener("message",aO[a].onWorkerMessage);return i&&(aO[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(aO[a].innerText=n.params.html)}},i.addEventListener("message",aO[a].onWorkerMessage)),i},sO=(0,u.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),lO=(0,u.flip)(sO),uO=(0,u.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=tn().number(t));return t})),cO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,u.is)(Number,e)?e>t?tn().number(e,"0,0.0a").toUpperCase():tn().number(e,"0,0"):""},pO=(0,u.ifElse)((0,u.has)("filename"),(0,u.prop)("filename"),(0,u.pipe)((0,u.prop)("link"),(0,u.split)("/"),u.last));let dO=!0;const yO=e=>dO=e,fO=(e,t)=>e!==t&&t?dO&&e?`${t} (${e})`:t:e,TO=(e,t,r)=>(0,u.path)([t,r,"displayName"],e),EO=(e,t,r)=>{const n=TO(e,t,r);return fO(r,n)},mO=(0,u.curry)(((e,t,r)=>(0,u.hasPath)([t,r],e))),hO=(0,u.complement)(mO),bO=e=>(0,u.pipe)((0,u.propOr)({},e),Object.entries,(0,u.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),OO=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,u.pipe)((0,u.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,u.uniq)([...(0,u.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),u.values)(t)},vO=(0,u.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(hO(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),gO=(0,u.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?H(i):"L",l=a?J(a):"L LTS";switch(n.type){case ze.TYPE_NUMBER:case ze.TYPE_FLOAT:case ze.TYPE_DOUBLE:case ze.TYPE_LONG:case ze.TYPE_INT:case ze.TYPE_COUNT:return t&&uO(o,t);case ze.TYPE_BOOLEAN:case ze.TYPE_BOOLEAN_RADIO:case ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,u.isNil)(t)?t:ue(t)?tn().text("Yes"):tn().text("No");case ze.TYPE_DATE:return(0,u.is)(Number,t)&&(t=N(Number(t)).getTime()),(t=t)&&(Uu(t)?Cu(t):tn().date(t,s));case ze.TYPE_ACTIVENESS_DATE:case ze.TYPE_LOCAL_DATE:return(t=t)&&(Uu(t)?Cu(t):tn().date(t,s));case ze.TYPE_TIMESTAMP:return(t=t)&&(Uu(t)?Cu(t):tn().date(isNaN(t)?t:Number(t),l));case ze.TYPE_FILE:return(0,u.propOr)(null,"filename",t);case ze.TYPE_SELECT:{const e=n.options.find((0,u.propEq)("value",t));return(0,u.propOr)(null,"label",e)}case ze.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,u.is)(Object,t)?fO((0,u.propOr)(null,"lookupCode",t),(0,u.propOr)(null,"value",t)):t}})),_O={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},AO=e=>{const t=e=>{switch(e){case 429:case 502:case 503:case 504:return 4;default:return 0}},r=e=>{const t=Math.random()+1;return new Promise((r=>{const n=Math.min(Math.round(1e3*Math.exp(e)*t),2e4);setTimeout(r,n)}))};return(n,i)=>{const a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e(n,i).then((e=>{const n=t(e.status);return n>0&&o<n?r(o).then((()=>a(o+1))):e}))};return a()}},NO=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status}}throw r})))),PO=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)}),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,u.pipe)((e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),AO,NO);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},RO="__metadata",SO=(e=>{const t=[RO,"draft"];return(0,u.lens)((0,u.pathOr)(null,t),(0,u.assocPath)(t))})(),wO=(0,u.set)(SO),IO=(0,u.view)(SO),UO=wO(Jr.NEW),CO=wO(Jr.REMOVED),LO=wO(Jr.EDITED),DO=wO(Jr.IGNORED),jO=(0,u.pipe)(IO,(0,u.equals)(Jr.REMOVED)),kO=(0,u.pipe)(IO,(0,u.equals)(Jr.NEW)),FO=(0,u.pipe)(IO,(0,u.equals)(Jr.EDITED)),MO=(0,u.pipe)(IO,(0,u.complement)(u.isNil)),xO=(0,u.pipe)(IO,(0,u.equals)(Jr.IGNORED)),$O=(0,u.omit)([RO]),VO=(e,t)=>e===RO?void 0:t;function GO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WO=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e(t))return r.concat(t);if(t&&t.children)for(const n of t.children){const i=WO(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},YO=(e,t)=>WO((0,u.propEq)("nodeId",t),e),BO=(e,t)=>WO((0,u.pathEq)(["entity","uri"],t),e),qO=(e,t)=>{const r=YO(e,t);return r.length>1?r[r.length-2]:null},HO=(e,t)=>{const r=YO(e,t);return r.length>0?r[r.length-1]:null},QO=(e,t)=>{let{parent:r,childrenProcessing:n=(e=>e),nodeProcessing:i=(e=>e)}=t;return(e=i(e,r)).children&&(e.children=n(e.children.map((t=>QO(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},KO=()=>{},JO=(e,t)=>{let{parent:r,nodeProcessing:n=KO}=t;n(e,r),e.children&&e.children.forEach((t=>JO(t,{parent:e,nodeProcessing:n})))},XO=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ce.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case Ce.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case Ce.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){GO(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},zO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&JO(r,{nodeProcessing:r=>{const n=(0,u.path)(["editingConnections",(0,u.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ce.addingChild||r.editingMode===Ce.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=XO({node:r,connection:n,isReversed:i}),s=oT({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ce.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=XO({node:r,isReversed:i,connection:n}),l=s?cT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):uT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},ZO=(e,t)=>{if((0,u.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=ZO(r,t);if(e)return e}return!1},ev=(0,u.curry)(((e,t)=>{const r=(0,u.map)(ev(e));return(0,u.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),tv=(e,t)=>{const r=(0,u.pipe)(Object.entries,(0,u.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>ZO(t,e.uri))(e,r.root)}))),n=(0,u.map)((t=>{let[r,n]=t;return{id:r,root:ev(e,n.root)}}));return(0,u.pipe)(r,n)(t)},rv={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},nv={asc:"asc",desc:"desc"},iv=rv.entityLabel,av=nv.asc,ov=(0,u.always)(0),sv=e=>{let{sortField:t=iv,sortOrder:r=av,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case rv.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,u.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return SA.strings.sort(t,a,o)})(n,r);case rv.entityLabel:return(e=>(t,r)=>{const n=(0,u.path)(["entity","label"]),i=n(t),a=n(r);return SA.strings.sort(e,i,a)})(r);default:return ov}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},lv=(0,u.pipe)((0,u.defaultTo)(""),u.toLower,(0,u.ifElse)((0,u.includes)(u.__,Object.values(nv)),u.identity,(0,u.always)(av))),uv=(0,u.pipe)((0,u.defaultTo)(""),(0,u.ifElse)((0,u.includes)(u.__,Object.values(rv)),u.identity,(0,u.always)(iv)));var cv=r(91104);let pv;const dv=(e,t)=>(pv||(pv=cv.createClient({key:t})),new Promise((t=>{pv.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,u.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),yv=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,u.is)(Object,t)&&(t=""),t},fv=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(as).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[yv(e)]),(0,u.is)(Object,e.value)&&(n=(n||[]).concat(fv(e.value,t,r))),n})),Tv=e=>e&&e.length>0,Ev=(e,t)=>[].concat(e&&e.attributes?fv(e.attributes,t):[]).filter(u.identity),mv=(e,t,r,n,i)=>{if(e&&e.type){const t=(Ur(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Ev(e,t.latitude),n=Ev(e,t.longitude),Tv(r)&&Tv(n)&&{lat:Number(r[0]),lng:Number(n[0])};var r,n})).filter(u.identity);if(t.length>0)return Promise.resolve(t[0])}const a=t.GeoLocation;if(a){const e=a.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(Tv(t)&&t[0].value&&Tv(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(u.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?dv(n.label,i).catch((()=>null)):Promise.resolve(null)},hv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,u.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=Ur(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(u.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return mv(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?dv(a.label,r).catch((()=>null)):e)).then((e=>{let t=Array.isArray(e)?e:[e];return e&&t.map((e=>({id:e.id||n,label:i,entity:a,point:e})))})).catch((()=>null))}))).then((e=>e.flat(1/0).filter(u.identity)))},bv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,u.pipe)((0,u.chain)((t=>{const r=Ur(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(ir(e,r.latitude,t.type)&&ir(e,r.longitude,t.type)){const e=Ev(t,r.latitude),n=Ev(t,r.longitude),i=(e,r)=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}});return(0,u.zipWith)(i,e,n)}}))})),(0,u.filter)(u.identity),(0,u.uniqBy)((0,u.prop)("id")))(t))},Ov=(e,t,r)=>Promise.all([bv(e,t),hv(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lon===e.point.lon))))]}));function vv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gv(e,t,r[t])}))}return e}function gv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _v=(e,t)=>t.values.map(no(e,t.entityTypeUri)),Av=(e,t,r)=>Bs(t.fieldName,r)||ir(e,St(t.fieldName,(0,u.propOr)("","entityTypeUri",t)),(0,u.propOr)("","entityTypeUri",t)),Nv=(e,t)=>{const r=(0,u.propOr)([],"values",t),n=(0,u.path)([t.attrType.lookupCode],e);return(0,u.map)((e=>{const t=(0,u.prop)(e,n);return t?fO(e,t):e}),r)},Pv=(0,u.path)(["attrType","label"]),Rv=(0,u.reduce)(((e,t)=>{const r=(0,u.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>vv({},e,{[t]:!0})),{});e[r]=e[r]?vv({},e[r],n):n}return e}),{}),Sv=(0,u.pipe)((0,u.prop)("values"),m),wv=(0,u.pipe)((0,u.defaultTo)({}),(0,u.propEq)("fieldName",Tn.type.name)),Iv=e=>e.type===Lv.NUMERIC_RANGE_FACET,Uv=e=>e.type===Lv.DATE_RANGE_FACET,Cv=(0,u.either)(Iv,Uv),Lv={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},Dv=e=>{switch(null==e?void 0:e.name){case Tn.type.name:return Lv.ENTITY_TYPE_FACET;case Tn.createdBy.name:case Tn.updatedBy.name:case Tn.sourceSystems.name:case Tn.tags.name:case Tn.roles.name:case Tn.matchRules.name:case Tn.MLRecommendedMatch.name:return Lv.WITH_DROPDOWN_CHECKBOXES_FACET;case Tn.createdTime.name:case Tn.updatedTime.name:case Tn.startDate.name:case Tn.endDate.name:return Lv.DATE_RANGE_FACET;case Tn.matches.name:case Tn.matchScore.name:return Lv.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return Lv.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return Lv.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return Lv.DATE_RANGE_FACET;default:return Lv.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},jv=(0,u.pipe)(Av,Dv),kv=(0,u.pipe)((0,u.path)(["attrType","type"]),fr),Fv=(0,u.cond)([[Iv,(0,u.always)(xr.IN_RANGE)],[Uv,(0,u.always)(xr.WITHIN)],[(0,u.allPass)([kv,e=>e.values.length>=2]),(0,u.always)(xr.EXISTS)],[u.T,(0,u.always)(xr.EQUALS)]]),Mv=(0,u.cond)([[Uv,(0,u.prop)("values")],[Iv,(0,u.prop)("values")],[kv,e=>1===e.values.length?e.values.map(ue):[]],[(0,u.pipe)((0,u.path)(["values",0]),Array.isArray),(0,u.prop)("values")],[u.T,e=>[e.values]]]);function xv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $v=(0,u.pipe)((0,u.path)(["attrType","type"]),lr),Vv=(0,u.pipe)((0,u.path)(["attrType","type"]),pr),Gv=(0,u.pipe)((0,u.prop)("attrType"),Hs),Wv=(0,u.pipe)((0,u.prop)("attrType"),qs),Yv=e=>t=>t.values.map((t=>Ur(e,t).label)).join(" , "),Bv=(0,u.when)((0,u.propSatisfies)((0,u.gt)(u.__,1),"length"),(0,u.join)(" – ")),qv=e=>{const t=(0,u.pipe)((0,u.map)((0,u.pipe)(u.uniq,(0,u.map)(tn().number),Bv)),(0,u.join)(","))(e.values);return`${Pv(e)}: ${t}`},Hv=e=>{const t=(0,u.pipe)((0,u.map)((0,u.pipe)(u.uniq,(0,u.map)(I),Bv)),(0,u.join)(","))(e.values);return`${Pv(e)}: ${t}`},Qv=e=>t=>`${Pv(t)}: ${_v(e,t).join(", ")}`,Kv=e=>t=>{const r=Nv(e,t);return`${Pv(t)}: ${r.join(", ")}`},Jv=(0,u.curry)(((e,t,r)=>(0,u.map)((0,u.cond)([[Wv,Yv(e)],[Vv,qv],[$v,Hv],[Gv,Qv(e)],[u.T,Kv(t)]]),r))),Xv=(e,t,r,n)=>(0,u.pipe)(u.values,(0,u.reject)((0,u.pipe)((0,u.prop)("values"),m)),(0,u.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xv(e,t,r[t])}))}return e}({},t,{attrType:Av(e,t,n)}))),Jv(e,r))(t),zv=new RegExp(`^${tn().text("Search")}`),Zv=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:l}=i;return(0,u.isEmpty)(s)?[...Xv(e,a,r,n),...o?[o.value]:[]]:[(0,u.replace)(zv,"",l)]},eg=(0,u.pipe)((0,u.omit)(["PICK_DATE"]),u.values)(Qr),tg=e=>(e=>eg.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=Du(t);return e.replace(r,i).replace(n,a)}),e))(e),rg=(0,u.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),ng={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},ig=e=>[ng.geoPolygon,ng.onMapMove].includes(e),ag=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},og=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},sg=(e,t)=>ig(e)?t.map(ag):[og(t)],lg=e=>ig(e)?tn().text("Geo Polygon"):tn().text("Geo Location"),ug=e=>{switch(e){case ng.geoLocation:return"geoLocation";case ng.geoPolygon:case ng.onMapMove:return"geoPolygon"}},cg={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},pg=e=>tn().text(e),dg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[xr.EQUALS]:"=",[xr.NOT_EQUALS]:"≠",[xr.STARTS_WITH]:"*",[xr.MISSING_VALUE]:tn().text("missing value"),[xr.HAS_ALL]:tn().text("has all"),[xr.IN_RANGE]:tn().text("in range"),[xr.FULL_TEXT]:tn().text("full text"),[xr.EXISTS]:tn().text("exists"),[xr.COUNT_EQUALS]:`${tn().text("count")} =`,[xr.COUNT_NOT_EQUALS]:`${tn().text("count")} ≠`,[xr.COUNT_LT]:`${tn().text("count")} <`,[xr.COUNT_LTE]:`${tn().text("count")} <=`,[xr.COUNT_GT]:`${tn().text("count")} >`,[xr.COUNT_RANGE]:tn().text("count range"),[xr.LT]:"<",[xr.LTE]:"<=",[xr.GT]:">",[xr.GTE]:">=",[xr.IN_FILE]:tn().text("in file"),[xr.NOT_IN_FILE]:tn().text("not in file"),[xr.CONTAINS]:"~",[$r.LIST_EQUALS]:"=",[$r.NOT_LIST_EQUALS]:"≠",[$r.LIST_EQUALS_CASE_SENSITIVE]:"=",[$r.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||tn().text(e.toLowerCase())},yg=e=>({type:cg.operator,text:e}),fg=e=>({type:cg.operator,text:pg(e)}),Tg=e=>({type:cg.attributeLabel,text:e}),Eg=e=>({type:cg.specialAttributeLabel,text:e}),mg=e=>({type:cg.attributeFilter,text:dg(e)}),hg=e=>({type:cg.attributeValue,text:e}),bg=e=>({type:cg.entityTypeLabel,text:e}),Og=()=>({type:cg.space,text:" "}),vg=()=>({type:cg.bracket,text:"("}),gg=()=>({type:cg.bracket,text:")"}),_g=(0,u.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Ag=(0,u.curry)(((e,t)=>t.map(_g(e)))),Ng=(0,u.curry)(((e,t,r)=>[e,...r,t])),Pg=Ng(vg(),gg()),Rg=Ng(Og(),Og()),Sg=(0,u.curry)(((e,t)=>[e,...t])),wg=e=>Sg(bg(e)),Ig=e=>Sg(bg(`${e}: `)),Ug=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=pu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=uu(s),a=cu(s);!r&&t&&n&&(i.push(vg()),r=!0),i.push(o),r&&a&&(i.push(gg()),r=!1);const l=e?fg(s):yg(s);i.push(...Rg([l]))}else i.push(o),r&&(i.push(gg()),r=!1)}return i}},Cg=(0,u.pipe)((0,u.map)((0,u.when)((0,u.has)("text"),(0,u.prop)("text"))),(0,u.join)("")),Lg=(0,u.pipe)(Ug({localizable:!1}),Cg),Dg=function(e){let{data:{title:t,pathToTitle:r}}=e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r&&n?r.slice(1).join(" / "):t},jg=e=>{let{data:t,values:r,filter:n}=e;return t&&zu({filter:n,fieldName:(0,u.prop)("fieldName",t),values:r})},kg=(0,u.anyPass)([(0,u.pipe)((0,u.prop)("attributes"),(0,u.any)(jg)),(0,u.pipe)((0,u.path)(["entityTypes","length"]),(0,u.lt)(0))]),Fg=(0,u.pipe)((0,u.chain)((0,u.pipe)((0,u.propOr)([],"attributes"),(0,u.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&er(e.data.attrType)})(e)&&[xr.HAS_ALL,xr.EQUALS,xr.NOT_EQUALS].includes(e.filter))),(0,u.map)((e=>({type:Zt((0,u.path)(["data","attrType"],e)),codeValues:(0,u.flatten)((0,u.propOr)([],"values",e))}))),(0,u.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),OO),Mg=(e,t)=>(0,u.pipe)(Fg,vO(t))(e),xg=(0,u.pathEq)(["data","fieldName"],Tn.type.name),$g=(0,u.path)(["data","entityTypeUri"]),Vg=(0,u.pipe)((0,u.props)(["entityTypes","attributes"]),(0,u.all)(u.isEmpty)),Gg=(0,u.curry)(((e,t)=>t.map((t=>(0,u.evolve)({entityTypes:(0,u.filter)(Ho(e)),attributes:(0,u.filter)((0,u.pipe)($g,(0,u.anyPass)([u.isNil,Ho(e),r=>{const n=(t.entityTypes||[]).filter(Ho(e));return(n.length>1?kr(e,n):null)===r&&!!Ur(e,r)}])))})(t))))),Wg=e=>(0,u.pipe)((0,u.prop)("filter"),Jl,(0,u.equals)(e)),Yg=(0,u.curry)(((e,t,r,n,i,a)=>{const o=Bs(n.fieldName)||n.attrType,s=Su(o,i),l=gO({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,u.pipe)((0,u.cond)([[()=>er(s),()=>(0,u.is)(Object,a)&&a.lookupCode?fO(a.lookupCode,a.value):EO(r,Zt(o),a)],[()=>Hs(s),()=>no(e,n.entityTypeUri,a)],[()=>Qs(s),()=>Po(e,a)],[()=>el(s),()=>wo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[u.T,()=>l(a)]]),(0,u.unless)((()=>pr(c)||fr(c)),Au),hg)()})),Bg=(e,t,r,n)=>{const i=Yg(e,t,r,n.data,n.filter);return(0,u.cond)([[Wg(0),(0,u.always)([])],[(0,u.both)(Wg(2),(2,(0,u.pipe)((0,u.prop)("values"),u.flatten,u.length,(0,u.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,u.flatten)(t);return[Og(),i(r),{type:cg.punctuationMark,text:" — "},i(n)]}],[u.T,e=>{let{values:t}=e;return[Og(),...(0,u.pipe)(u.flatten,(0,u.map)(i),Ag({type:cg.punctuationMark,text:", "}))(t)]}]])(n)},qg=(e,t)=>{const r=!!Bs(e.data.fieldName);return(0,u.pipe)(Dg,r?Eg:Tg)(e,t)},Hg=(e,t,r,n,i)=>[qg(n,i),Og(),mg(n.filter),...Bg(e,t,r,n)],Qg=(0,u.addIndex)(u.map),Kg=(0,u.propEq)("length",1),Jg=(0,u.propSatisfies)((0,u.lt)(1),"length"),Xg=(0,u.complement)(u.isEmpty),zg=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,u.pipe)(fu,(0,u.filter)(jg),Tu,(0,u.map)((n=>({operand:Hg(e,t,r,n,i),operator:n.operator}))),(0,u.unless)(u.isEmpty,Ug()))(n)},Zg=(0,u.pipe)(zg,u.flatten),e_=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Pd(e,{type:t}))).join(", ");return r?t(r):u.identity},l=zg(e,t,r,a);return(0,u.ifElse)(u.isEmpty,s(wg),(0,u.pipe)(s(Ig),(0,u.unless)((()=>Kg(l)||i),Pg)))(l)},t_=(e,t,r,n)=>(0,u.pipe)(fu,(0,u.filter)(kg),Tu,Qg(((n,i,a)=>({operand:e_(e,t,r,n,Kg(a)),operator:n.operator}))),Ug(),u.flatten)(n),r_=(0,u.pipe)((0,u.reject)(u.isEmpty),(0,u.map)((e=>({operand:e,operator:"and"}))),Ug(),u.flatten),n_=e=>{let{searchType:t,values:[r]}=e;return sg(t,r).join(", ")},i_=(e,t,r,n,i,a)=>{const o=(e=>e?[Eg(e.isRawFilter?tn().text("Raw filter"):tn().text("Search")),...Rg([mg(xr.EQUALS)]),hg(`"${e.value}"`)]:[])(i),s=(e=>e?[Eg(lg(e.searchType)),Og(),hg(n_(e))]:[])(a),l=(0,u.pipe)(t_,(0,u.when)((e=>Jg(e)&&(Xg(o)||Xg(s))),Pg))(e,t,r,n);return r_([o,s,l])},a_=(0,u.pipe)((0,u.map)((0,u.prop)("text")),(0,u.join)("")),o_=(0,u.pipe)(i_,a_),s_=(0,u.has)("attributes"),l_=Array.isArray,u_=(0,u.allPass)([(0,u.propEq)("length",1),(0,u.pathSatisfies)((0,u.startsWith)("not"),[0,"filter"])]),c_=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=p_(e,t,r,a,i);return(0,u.when)((0,u.always)((0,u.complement)(u.isNil)(o)),(0,u.pipe)((0,u.when)((0,u.always)((0,u.not)(u_(a))),Pg),(0,u.concat)(Rg([yg(o)]))))(s)},p_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return s_(n)?c_(e,t,r,n,i):l_(n)?n.reduce(((n,a)=>n.concat(p_(e,t,r,a,i))),[]):(0,u.when)((0,u.always)((0,u.has)("operator",n)),(0,u.concat)(Rg([yg(n.operator)])))(Hg(e,t,r,n,i))},d_=(e,t,r,n,i)=>(0,u.pipe)(p_,u.flatten)(e,t,r,n,i);function y_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){f_(e,t,r[t])}))}return e}function f_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const T_=(0,u.complement)(xg),E_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,u.pipe)((0,u.filter)(xg),(0,u.map)((0,u.prop)("values")),u.flatten,u.uniq)(e),r=(0,u.pipe)((0,u.map)($g),(0,u.reject)(u.isNil),u.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,u.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},m_=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=E_(t);return(r||n)&&du(t)},h_=(0,u.ifElse)((0,u.all)((0,u.has)("entityTypes")),u.identity,(0,u.pipe)((e=>{const t=[],r=e.filter((0,u.complement)(m_)),n=e.filter((e=>{let{attributes:t=[]}=e;return t.length>0}));if(0===r.length||1===r.length&&1===n.length||t.push("Can't convert more than one complex transition advanced search group"),e.some((e=>(e.attributes||[]).filter(xg).some((0,u.propEq)("filter",xr.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,u.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=E_(r);if(m_(e))t.push(y_({},e,{entityTypes:(0,u.uniq)((0,u.concat)(n,i)),attributes:r.filter(T_)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,u.pipe)((0,u.ifElse)(xg,(0,u.pipe)((0,u.prop)("values"),u.flatten),(0,u.pipe)($g,(e=>[e]),(0,u.reject)(u.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(T_),entityTypes:n,operator:i?a:e.operator,id:Zb()()}}));t.push(...n)}var a;return t})(t))),[]))),b_={[xr.EQUALS]:xr.ON,[xr.IN_RANGE]:xr.WITHIN,[xr.GTE]:xr.AFTER,[xr.GT]:xr.AFTER,[xr.LTE]:xr.BEFORE,[xr.LT]:xr.BEFORE},O_=(0,u.curry)((e=>b_[e]||e)),v_=(0,u.curry)(((e,t)=>{switch(e){case xr.LT:return[T()(t[0]).subtract(1,"day").valueOf()];case xr.GT:return[T()(t[0]).add(1,"day").valueOf()];default:return t}})),g_=(0,u.pipe)((0,u.path)(["data","attrType","type"]),lr),__=(0,u.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>y_({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return g_(e)?(0,u.evolve)({filter:O_,values:v_(t)},e):e}))})))})),A_=(0,u.evolve)({values:(0,u.when)((0,u.pipe)((0,u.prop)(0),Iu),(0,u.map)(Du))}),N_=(0,u.map)((0,u.cond)([[g_,A_],[u.T,u.identity]])),P_=(0,u.curryN)(3,((e,t,r,n,i)=>(0,u.pipe)((0,u.defaultTo)([]),h_,Gg(t),(0,u.map)((0,u.evolve)({attributes:(0,u.pipe)((0,u.map)((0,u.evolve)({data:e(t,n,i)})),(0,u.reject)((0,u.propSatisfies)(u.isNil,"data")),N_)})),__,(0,u.reject)(Vg))(r)));function R_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){S_(e,t,r[t])}))}return e}function S_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const w_=(e,t)=>({data:{uri:Ct(e.fieldName)?St(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||Fv(e),id:Zb()(),values:Mv(e)}),I_=(0,u.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Bs(a,t,r)||ir(e,i);if(!s)return null;if(Yt(s))return R_({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Pd(e,{type:o}),i=(nr(e,St(a,o),o)||[]).map((0,u.pick)(["label","name"])).slice(0,-1);return R_({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,u.chain)((0,u.prop)("label"),i),t]:[r,t]})}})),U_=(0,u.curry)(((e,t,r,n)=>P_(I_,e,n,t,r)));function C_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){L_(e,t,r[t])}))}return e}function L_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const D_=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},j_=e=>"rdmLookups.not.resolved"===e?Tn.notResolved.name:e,k_=(0,u.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Yr?xr.IN_RANGE:Br(a),l=j_(n),c=Bs(l)||ir(e,i),p=(0,u.cond)([[()=>eu(s),(0,u.map)((0,u.when)((0,u.both)((0,u.has)("link"),(0,u.complement)((0,u.has)("filename"))),(e=>C_({},e,{filename:pO(e)}))))],[()=>fr(null==c?void 0:c.type),(0,u.map)(ue)],[e=>zl(s)&&!Array.isArray(e[0])&&!lr(null==c?void 0:c.type),ae],[u.T,u.identity]])(o);return{id:Zb()(),data:{uri:i,fieldName:l,entityTypeUri:t},operator:a===Yr?"and not":"and",filter:s,values:p}})),F_=(0,u.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(k_(e,kr(e,i)));return[{id:Zb()(),operator:"or",attributes:a,entityTypes:i}]})),M_=e=>(0,u.pipe)((0,u.prop)(e),(0,u.is)(Number)),x_=(0,u.cond)([[(0,u.has)("values"),(0,u.prop)("values")],[(0,u.allPass)([M_("from"),M_("to")]),(0,u.pipe)((0,u.pick)(["from","to"]),u.values)],[(0,u.pipe)((0,u.prop)("rangeSelection"),m,u.not),(0,u.pipe)((0,u.prop)("rangeSelection"),(0,u.pick)(["start","end"]),u.values)],[u.T,()=>[]]]),$_=(e,t)=>{const r=(0,u.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return C_({},r,{values:x_(e),entityType:(0,u.propOr)(t,"entityType",r),fieldName:n?$s(e.fieldName,n):e.fieldName})},V_=(e,t)=>{if((0,u.has)("children")(e)){const r=$_(e,t);return e.children.reduce(((e,n)=>(e.push(V_(n,(0,u.propOr)(t,"entityType",r))),e)),[])}return $_(e,t)},G_=(0,u.cond)([[(0,u.has)("searchParameters"),e=>{const t=[];return(0,u.has)("values",e)&&t.push($_(e)),(0,u.propOr)([],"searchParameters",e).forEach((r=>t.push(C_({fieldName:e.fieldName},$_(r,e.entityType))))),t}],[(0,u.has)("children"),(0,u.pipe)(V_,u.flatten)],[u.T,$_]]),W_=(0,u.pipe)((0,u.map)(G_),u.flatten),Y_=e=>{if(e.every((e=>Array.isArray(e))))return e;if(2===e.length)return[e.map((e=>Number(e)))];if(1===e.length){const t=Number(e[0]);return[[t,t]]}return e},B_=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=F_(e,a),[l]=((e,t)=>{if(!t)return[];const[r,n]=(0,u.pipe)((0,u.reject)((e=>"tenants"===e.fieldName)),(0,u.partition)((e=>"type"===e.fieldName)))(t),i=(0,u.chain)((0,u.propOr)([],"values"),r);return[{attributes:W_(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>C_({},t,{type:jv(e,t)}))).map((e=>C_({},e,{values:Cv(e)?Y_(e.values):e.values}))).map((e=>{let{filter:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["filter"]);return w_(r,t)})),operator:"or",id:Zb()(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,u.pipe)(u.keys,(0,u.map)((t=>({[j_(t)]:e[t]}))),u.mergeAll)(e)}(o),p=[C_({},l,{entityTypes:null!=c&&c.type?(0,u.uniq)([...l.entityTypes,...s.entityTypes]):[],attributes:[...l.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return U_(e,t,r,p)},q_=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,u.pipe)(u.values,(0,u.reject)(Sv),(0,u.partition)(wv))(t),i=n.map((t=>R_({},t,{type:jv(e,t)}))).map((e=>w_(e))),a=r.values||[];return[{attributes:i,operator:"or",id:Zb()(),entityTypes:a}]})(e,a);return U_(e,t,r,o)})(e,t,r,n):B_(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},H_=e=>"2.0"===e.version?e.keyword:D_(e),Q_=e=>(0,u.pathEq)(["object","uri"],e),K_=(e,t)=>(0,u.pipe)((0,u.find)(Q_(e)),(0,u.prop)("object"))(t),J_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,u.pipe)((0,u.find)((0,u.allPass)([(0,u.has)("shortestTransitiveMatchPath"),Q_(r.uri),(0,u.pipe)((0,u.propOr)(!1,"direct"),u.not)])),(0,u.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=K_(r.match,t)||n[r.match];return i?{label:ad((0,u.prop)("label",i)),matchRules:(0,u.propOr)([],"matchRules",r).map((function(t){return ro(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,u.pipe)((0,u.defaultTo)([]),(0,u.when)((0,u.complement)(u.isEmpty),(0,u.map)(a)),(0,u.reject)(u.isNil))(i)},X_=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,u.pick)(["uri","type","label"],r),e}),{}),z_=(0,u.allPass)([(0,u.has)("shortestTransitiveMatchPath"),(0,u.pipe)((0,u.propOr)(!1,"direct"),u.not)]),Z_=(e,t,r)=>(0,u.pipe)((0,u.propOr)([],"shortestTransitiveMatchPath"),(0,u.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,u.propOr)({},n,r);return{label:ad((0,u.prop)("label",o)),matchRules:i.concat(a).map((function(t){return ro(e,o.type,t)||{label:t,uri:t}}))}})))(t),eA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,u.pipe)((0,u.map)((0,u.prop)("shortestTransitiveMatchPath")),u.flatten,(0,u.filter)(u.identity),(0,u.map)((0,u.prop)("match")),u.uniq);return t(e)},tA=(0,u.path)(["object","uri"]),rA=e=>{let t=[];return{addChild:e=>{t=(0,u.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,u.without)([e],t)}}},nA=e=>e.getValue(),iA=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=iA(n[e],t),!r);e++);return r},aA=(e,t)=>{const r=[],n=(0,u.pipe)(nA,t),i=(0,u.pipe)(u.map,u.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,u.partialRight)(aA,[t]),a);return r.push.apply(r,o),r};function oA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sA(e,t,r[t])}))}return e}function sA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lA=(e,t)=>!!e[t],uA=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},cA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return 0===t.length&&e?e:(0,u.uniqBy)(r,[...t,...e||[]])},pA=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return oA({},t,{[r.uri]:oA({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:cA(null==o?void 0:o.parents,n),children:cA(null==o?void 0:o.children,i),values:cA(null==o?void 0:o.values,a,(0,u.prop)("uri"))})})},dA=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Ur(r,t)||ui(r,t),i=(0,u.either)((0,u.both)((0,u.prop)("dependentLookupAttributes"),(0,u.prop)("dependentLookupCode")),(0,u.prop)("children"));return ko(r,n,i).flatMap(Mo).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>ir(r,e))).filter(u.identity).filter((0,u.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,u.prop)("uri")),a=pA({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>pA({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},yA=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Et(e.uri)&&gt(e.type)&&gt(t)&&!t.startsWith(e.type))(n,t))return e;const i=Os(r,n,t)||[],a=(0,u.pipe)((0,u.filter)(as),(0,u.map)(uA))(i);return pA({structure:e,attrType:e[t].attrType,values:a})}),t)},fA=e=>{let{structure:t,attributeValue:r}=e;if((0,u.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,u.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return lA(e,r)}));return r||n?t.filter(as).reduce(((e,t)=>fA({structure:e,attributeValue:t})),e):e}),t);{const e=r;return lA(t,e.type)?pA({structure:t,attrType:t[e.type].attrType,values:[uA(e)]}):t}},TA=e=>{let{structure:t,uri:r}=e;return(0,u.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?oA({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},EA=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Os(i,n,r)||[];return a.length?pA({structure:t,attrType:t[r].attrType,values:a.filter(as).map(uA)}):t},mA=(e,t,r)=>{const n=bt(e),i=bt(t);return n===i?((e,t)=>{const r=jt(t),n=jt(e);return At(n,r)||((e,t)=>Lt(e)&&!Lt(t)&&At(t,e))(n,r)})(e,t):!(!r||!Dt(t))&&bE(r,i).includes(n)},hA=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},bA=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?mE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return mA(r,t,o)}))},OA=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,u.uniq)(n.concat(n.flatMap((r=>OA(e,t,r)))))},vA=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&hA(n,e)}},gA=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=bt(n),c=hE(u,o,i,a),p=OA("children",t,l),d=OA("parents",t,l),y=p.flatMap((e=>OA("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return mA(t,n,c)})).map((t=>vA(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return mA(n,t,c)||bt(t)!==u&&mA(t,n,c)})).map((t=>vA(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=OA("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&mA(n,t,c)}))})).map((t=>vA(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return mA(t,n,c)})).map((e=>vA(r,n,e,s))),...T,...E,...f]},_A=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=gO({attributePresentations:r,dataTypeDefinition:t}),a=(0,u.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>nd(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,u.pipe)(o,i),l=(0,u.cond)([[Qt,()=>a(n)],[er,()=>(e=>{const r=o(e),n=Zt(t);return $l([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return EO(e[0],n,r)}))})(n)],[u.T,()=>s(n)]]);return await l(t)},AA=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:xr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(NA(r,t)):i.push(PA([t],r)),i},NA=(e,t)=>{const r=Bt(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=Qt(i)?NA(i,t[r]):[PA(t[r],i)];return e.push(...a),e}}),[])},PA=(e,t)=>e&&e.length&&!(0,u.isNil)(e[0])&&""!==e[0]?{fieldName:zt(t.uri),filter:t.type===ze.TYPE_BLOB?xr.FULL_TEXT:xr.EQUALS,values:e}:{fieldName:zt(t.uri),filter:xr.MISSING_VALUE},RA={AttributesDiff:s,AttributesEditor:o,HistoryManager:l},SA={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},29524:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
1
+ (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5501],{74489:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>js,IL3:()=>Cp,PY2:()=>an,Ng6:()=>Pe,YJ7:()=>Xr,NlI:()=>$r,XYV:()=>Qr,Xt7:()=>ve,wfT:()=>Gn,EMD:()=>In,HAc:()=>ge,PEf:()=>cn,oA3:()=>wn,$XE:()=>Ge,eWf:()=>ln,q7e:()=>_e,KVe:()=>Wn,WVQ:()=>br,oZZ:()=>zn,bNA:()=>Zn,Rjq:()=>ei,G39:()=>dn,W0P:()=>Ke,X1H:()=>Qe,yn8:()=>Me,N0y:()=>Fe,dZX:()=>We,bQt:()=>ri,oS0:()=>ze,MU4:()=>a.DatePeriod,bZE:()=>qr,Nsj:()=>Zr,psV:()=>Jr,xPW:()=>on,pyR:()=>kn,p8l:()=>Cn,Wkf:()=>Oe,zHr:()=>be,NIO:()=>he,$26:()=>Dv,Esk:()=>An,s9T:()=>je,MEy:()=>bu,j5E:()=>xr,vAw:()=>Sn,NMQ:()=>Rn,mNm:()=>Dn,s_5:()=>Fn,RgZ:()=>Ln,unl:()=>Xn,Qy0:()=>ti,pYu:()=>_n,wIJ:()=>ig,GFH:()=>Se,Ury:()=>yn,S91:()=>fn,p3$:()=>oi,wSh:()=>ee,BDP:()=>Ei,pGS:()=>jn,ARY:()=>Ze,XGc:()=>Vn,fO_:()=>Pr,wwy:()=>Ce,h_8:()=>En,_XL:()=>zr,j2V:()=>Yn,dMV:()=>xn,NBX:()=>nA,OXy:()=>et,BXd:()=>xe,KM9:()=>Ne,CJB:()=>Hn,lXI:()=>qe,nqG:()=>ii,C68:()=>pn,yxQ:()=>ni,Yj_:()=>Le,D25:()=>Ie,ZIY:()=>Ye,Tl4:()=>pg,lwr:()=>un,NkU:()=>Bn,Rtp:()=>$n,YGx:()=>$e,uTS:()=>Mn,MCv:()=>Ae,IYE:()=>Un,PiC:()=>Jn,MVv:()=>Je,h_m:()=>He,DUe:()=>Hr,tJI:()=>Re,fDt:()=>we,cNQ:()=>qn,SwE:()=>Nn,ZHR:()=>Kn,lD1:()=>Tn,lVm:()=>Ve,vnX:()=>av,$x5:()=>ov,_R1:()=>nv,wUm:()=>iv,z7V:()=>ai,dC6:()=>ke,MBD:()=>Ue,GmF:()=>Qi,cKm:()=>Be,iP_:()=>sn,NVC:()=>De,tPT:()=>ll,tZe:()=>Kp,kRE:()=>rf,psB:()=>nf,X0$:()=>sl,zE1:()=>hl,Wm5:()=>Xs,vyX:()=>fc,wLZ:()=>ul,W4V:()=>le,EtK:()=>hs,Wtd:()=>ol,asT:()=>TA,kGs:()=>VE,ewt:()=>VT,O_f:()=>du,sOy:()=>At,Tde:()=>zt,LMI:()=>Xu,skb:()=>e_,sPt:()=>Gu,sH1:()=>Wu,RPM:()=>lm,h27:()=>sc,Uqd:()=>yc,xG:()=>y_,Z2f:()=>OO,fgW:()=>Dg,I69:()=>a_,ZxB:()=>s_,mdt:()=>nm,Qbq:()=>RE,rny:()=>Ui,UEY:()=>Ta,Q0T:()=>fa,Lyr:()=>ga,sBn:()=>ya,itK:()=>ua,H9$:()=>da,KPc:()=>pa,zos:()=>ca,ELQ:()=>_a,dZs:()=>Zi,Cz4:()=>zi,z_L:()=>Oa,fGe:()=>Xi,iuF:()=>sa,Wib:()=>la,Hn0:()=>va,obS:()=>Aa,E$L:()=>ea,XUh:()=>oa,Qp_:()=>ia,_jk:()=>ta,sKE:()=>ra,WmG:()=>aa,QKx:()=>ha,Oik:()=>ma,s0A:()=>na,o9m:()=>Ea,MCd:()=>ba,RsS:()=>lc,tGK:()=>Vl,lIv:()=>bl,Vg3:()=>Mi,mkC:()=>Ni,xv5:()=>$i,a14:()=>Ri,yv0:()=>xi,Zm0:()=>Pi,Nxd:()=>Ai,$mM:()=>Fi,ifj:()=>vr,NWi:()=>xO,xr3:()=>MO,wNf:()=>Xl,iJH:()=>$O,d89:()=>vi,Edd:()=>gi,Z5t:()=>_i,uGe:()=>hi,UoR:()=>mi,xvW:()=>FO,$qe:()=>kO,yPM:()=>Ji,$cp:()=>ml,vKJ:()=>Tl,VtG:()=>Gc,AID:()=>tT,B1H:()=>tA,b7X:()=>AE,$uE:()=>YE,keo:()=>PE,C_p:()=>Bm,G27:()=>Xh,JA0:()=>By,b3T:()=>$E,oC6:()=>ME,_Zs:()=>xE,epC:()=>qE,YYG:()=>BE,f_2:()=>Hy,w3l:()=>F_,QHB:()=>Jh,Jso:()=>Y_,RXH:()=>jh,Vr9:()=>ab,lMm:()=>zb,BlA:()=>NA,fmQ:()=>cs,yRD:()=>A_,NcL:()=>Xm,QK6:()=>ye,ymd:()=>Up,JV_:()=>bf,XiW:()=>OT,Yrx:()=>Cy,GPx:()=>al,gjI:()=>il,vlo:()=>aE,E_P:()=>XE,aAL:()=>hp,NBq:()=>ps,wp9:()=>rm,DsR:()=>dp,MPc:()=>oT,gWE:()=>sT,DT_:()=>lT,ipn:()=>cT,ORg:()=>yi,_wz:()=>uT,RYR:()=>kT,PP2:()=>Fy,wS7:()=>RO,cBQ:()=>Jc,pBq:()=>xf,DsO:()=>te,X78:()=>vf,xZs:()=>Tf,YFy:()=>Dy,Gmt:()=>lf,K$w:()=>sf,DSj:()=>bp,Mfr:()=>jy,k9j:()=>zc,ww$:()=>cl,WVU:()=>of,hxF:()=>Zs,E7G:()=>Fd,nwO:()=>SA,Mzk:()=>Bc,aFF:()=>LE,HRH:()=>gu,EZK:()=>sd,Kxm:()=>nd,Z9i:()=>Pm,CrF:()=>zy,DNd:()=>Pa,vUy:()=>OA,lJh:()=>Nu,zHo:()=>Pu,sEJ:()=>aA,UO$:()=>Bf,zeJ:()=>ir,dLR:()=>gs,JQy:()=>Cs,XtP:()=>Os,Ug0:()=>kr,A1W:()=>NE,sw:()=>od,nv3:()=>QO,JgD:()=>HO,nve:()=>oA,SkP:()=>Ls,SAs:()=>Vf,i5L:()=>Ds,PWK:()=>No,IM5:()=>vs,Mfk:()=>nO,HQx:()=>xo,oN$:()=>Mo,mB6:()=>_O,p6d:()=>I,o0x:()=>C,ufS:()=>cO,k7L:()=>pO,mrB:()=>U,ncP:()=>ht,Zmi:()=>yt,hm5:()=>Tt,ECL:()=>Ar,vPL:()=>cd,qmL:()=>_E,hPi:()=>Ff,hXd:()=>Li,OCS:()=>Di,p2l:()=>Fs,qF1:()=>Lp,_X$:()=>Dp,yj2:()=>eg,bzh:()=>om,k66:()=>jo,kiP:()=>Ja,pSg:()=>pe,kz_:()=>Vy,H_U:()=>Fo,t9e:()=>La,j2$:()=>Jp,PFL:()=>Vt,aJ3:()=>Nv,To9:()=>Zt,wpo:()=>Id,ADq:()=>vm,UUb:()=>bm,tQX:()=>Om,xy8:()=>Bt,EUG:()=>ar,AFK:()=>It,X3M:()=>nr,WN0:()=>ko,kDl:()=>_s,uDV:()=>gE,IhQ:()=>Ss,pfb:()=>Is,R$r:()=>JE,w80:()=>yo,Pfu:()=>Ua,Gtj:()=>Cl,fyF:()=>Ul,kkq:()=>Do,u5q:()=>bt,O$n:()=>Sd,ptG:()=>wd,f4_:()=>ah,uap:()=>ih,d7q:()=>Uy,liG:()=>My,$oF:()=>Iy,avf:()=>KT,DiQ:()=>QT,cfX:()=>HT,vD3:()=>XT,Qrb:()=>qT,EJQ:()=>JT,HWy:()=>BT,gjS:()=>xT,y6v:()=>YT,JUW:()=>Qy,GtP:()=>hh,_kX:()=>Sa,u1e:()=>wa,sJj:()=>IE,CJp:()=>Eh,uKF:()=>wE,wo0:()=>tf,s5:()=>So,cwx:()=>Ro,Y6b:()=>Oy,TTx:()=>df,UtR:()=>vy,HaQ:()=>yf,E6I:()=>Xy,Won:()=>_y,vTU:()=>hy,Nsy:()=>hd,KMQ:()=>CE,Do$:()=>gd,CSV:()=>$s,TMe:()=>gy,l1V:()=>Su,RHh:()=>ku,VQ1:()=>Du,cGG:()=>Lu,z7d:()=>oE,Xaq:()=>Go,Sj8:()=>_A,PJj:()=>Ml,k3T:()=>Mr,PjQ:()=>Ti,s7l:()=>Fc,jLA:()=>bh,GGR:()=>tE,j5q:()=>ZT,DnY:()=>Dc,RY5:()=>EE,Px$:()=>FT,KPC:()=>z_,NIY:()=>Wc,HvW:()=>xc,Fof:()=>Da,fX:()=>Oh,BTI:()=>Ad,uie:()=>yd,ChB:()=>ld,q27:()=>Cd,vrC:()=>mb,fAQ:()=>Nf,XkT:()=>Lc,lrH:()=>Pf,nt9:()=>Ur,XH8:()=>Rd,XH2:()=>Fr,jFi:()=>Pd,qhs:()=>po,wwR:()=>_d,Uk3:()=>Ut,ev7:()=>rA,RB9:()=>Yy,iFp:()=>cm,e$p:()=>dm,PcX:()=>ym,SpP:()=>pm,R6_:()=>Rv,CY1:()=>jv,Ajk:()=>wc,Yiz:()=>Sc,FK9:()=>gc,UOo:()=>dO,aTW:()=>cf,uug:()=>Jl,P$2:()=>Mv,XS2:()=>Gl,Hyb:()=>lu,d3Y:()=>hc,Klp:()=>Oc,WxZ:()=>xv,Gzu:()=>Ru,ZOr:()=>Cc,uqV:()=>Ty,Pm4:()=>ne,hWO:()=>Rt,nHA:()=>sh,nVD:()=>hE,dED:()=>Sy,P2h:()=>Ry,jrr:()=>qa,mmY:()=>Qa,T6O:()=>$o,h6J:()=>qp,hM2:()=>H_,XR6:()=>z,jmz:()=>vE,IHt:()=>OE,NZI:()=>Nm,wdF:()=>_f,kgP:()=>Af,ZYI:()=>Rp,QXK:()=>Rl,efz:()=>Sl,Q5d:()=>Pl,Ysv:()=>wl,UWq:()=>uE,ocC:()=>lE,io3:()=>Dr,Sbt:()=>To,roS:()=>fo,Ww1:()=>Eo,QaS:()=>qc,ERZ:()=>j_,CL1:()=>Q_,idV:()=>ad,nIW:()=>Pt,fjE:()=>Sv,sG0:()=>TO,tV7:()=>xl,g8o:()=>ug,Qy:()=>lg,t2P:()=>Av,KbW:()=>to,wId:()=>no,LS0:()=>io,bFH:()=>ry,Rgl:()=>iy,fW1:()=>zm,GFW:()=>ff,Ywp:()=>ZO,pg:()=>xd,WSA:()=>ay,fed:()=>B_,tT_:()=>ws,BgZ:()=>Us,KbL:()=>kc,JBA:()=>jt,aNC:()=>qO,RFJ:()=>Pp,Zeh:()=>Yf,OT5:()=>zO,mC3:()=>vl,kR6:()=>AA,NVY:()=>em,k6v:()=>jp,FEC:()=>kp,L5S:()=>zE,Ob5:()=>Ld,KUV:()=>Dd,dvH:()=>ZE,Sn:()=>ib,V3i:()=>lb,VD3:()=>jr,mm2:()=>Cu,rou:()=>Lf,izH:()=>Ia,DK$:()=>Ca,KMp:()=>mp,c31:()=>nt,mbo:()=>_m,gT8:()=>ot,CZ8:()=>ls,uGi:()=>fs,Poc:()=>tt,_9k:()=>ms,ZTM:()=>ds,bwT:()=>Ts,tzW:()=>lt,tF$:()=>at,o96:()=>us,M4S:()=>Es,_vs:()=>cp,xF8:()=>$T,PUO:()=>DE,ATu:()=>gm,j1S:()=>pi,V3K:()=>ui,Lmx:()=>ci,ZaZ:()=>rt,n_1:()=>my,N6e:()=>fp,SxO:()=>Ha,w3p:()=>tm,xU7:()=>de,Y_p:()=>bo,$k6:()=>ho,Gdl:()=>mO,U6P:()=>EO,OwB:()=>Pv,hTh:()=>bE,xqc:()=>wo,JvE:()=>Io,i29:()=>rc,dzT:()=>wi,uPS:()=>Kc,cZV:()=>Qc,n3B:()=>Vg,e6O:()=>jg,s7j:()=>ng,j$Q:()=>Ky,kW2:()=>mh,tH7:()=>Po,Yxg:()=>Bs,MaZ:()=>eE,nqN:()=>zT,jWj:()=>pE,o_J:()=>Wo,hgZ:()=>ud,yW4:()=>Hp,uT0:()=>Yp,C82:()=>Bp,bsH:()=>oh,u9Z:()=>Cf,J$m:()=>Ey,j_Q:()=>Ac,OaI:()=>Nc,wB1:()=>eA,SP6:()=>Md,ZYr:()=>X_,IMU:()=>Np,FoU:()=>qy,DVz:()=>gO,mxe:()=>xg,FHr:()=>Gf,D1g:()=>Df,VO3:()=>cv,de5:()=>uv,Uw1:()=>Ee,J6q:()=>Am,XCe:()=>Wa,fbl:()=>ev,Ir:()=>Za,XQO:()=>eo,QXb:()=>Kd,P8_:()=>mf,iiD:()=>Ep,MOC:()=>Jd,WF:()=>Qd,xE1:()=>fi,idW:()=>yA,QWZ:()=>sO,YL3:()=>Yc,Fn9:()=>E,j2U:()=>ks,MpE:()=>ut,kQw:()=>Wt,mfm:()=>uu,vZp:()=>Ct,E8K:()=>uA,VSb:()=>os,vr_:()=>Gt,Vmh:()=>bA,FgW:()=>sb,oDv:()=>Bo,fGG:()=>lO,kuw:()=>Ho,eHk:()=>cE,Tt2:()=>Yo,pQZ:()=>Qo,oZ7:()=>uO,T6Y:()=>fr,_26:()=>au,YkM:()=>Xt,J6y:()=>Bl,njU:()=>Zl,TBP:()=>qo,IT0:()=>Rm,x_:()=>UE,biM:()=>Od,TMl:()=>vd,Vkd:()=>ru,WiY:()=>Cv,_zi:()=>nu,J6D:()=>Uu,Lt4:()=>lr,QEi:()=>tr,whI:()=>Sr,KIu:()=>Ir,JhM:()=>se,C_0:()=>mr,lzc:()=>kd,qIF:()=>Gg,O27:()=>m,aBi:()=>Ud,xOX:()=>Js,EdS:()=>gt,WgC:()=>vt,eEv:()=>xt,A4t:()=>eu,YOQ:()=>Dt,Wos:()=>dr,jWr:()=>Na,Or$:()=>Jt,lhE:()=>Lr,CwH:()=>er,pzC:()=>Hs,ymH:()=>zl,QZu:()=>Qt,rYH:()=>Uv,FVt:()=>pr,Kn2:()=>ce,jgw:()=>cu,Qgr:()=>Iu,OXP:()=>as,lS4:()=>rr,g5f:()=>Lv,fp6:()=>Ql,Uty:()=>Wi,YkG:()=>Kt,xdS:()=>st,kMF:()=>pT,$NE:()=>_t,bC9:()=>Ot,Ian:()=>di,KVV:()=>SE,q9e:()=>mo,iIf:()=>hO,ian:()=>el,m6e:()=>hr,OFd:()=>Qs,kqr:()=>Yt,fnZ:()=>Rr,VFZ:()=>tl,ZiX:()=>Et,j5n:()=>ur,zkt:()=>A,Pcm:()=>Z_,QDV:()=>qs,M5u:()=>Iv,laD:()=>$g,mtq:()=>Mt,CtB:()=>bO,CBv:()=>oe,I0t:()=>Er,u1G:()=>iE,gk1:()=>Fg,Bgb:()=>kg,uzs:()=>wr,v0l:()=>xu,Zqp:()=>Ay,j0k:()=>Ao,tCm:()=>wt,gmx:()=>Wl,mOr:()=>Ou,TwZ:()=>cg,GyU:()=>KO,zGm:()=>Gd,bMg:()=>uy,EyD:()=>DO,FQA:()=>jO,fZN:()=>dy,xsF:()=>CO,Lxg:()=>LO,O3l:()=>ep,Wni:()=>Zc,wRx:()=>GO,OxG:()=>Zd,uJQ:()=>zd,qWg:()=>vO,i96:()=>$d,zhn:()=>VO,G8q:()=>si,Jct:()=>UT,A9Y:()=>re,Y5F:()=>R_,gxP:()=>ue,c$P:()=>Yl,M7o:()=>dc,BBN:()=>Ba,ZBU:()=>X,UkJ:()=>ao,xkv:()=>Ef,z$M:()=>fA,KAm:()=>Wy,lCl:()=>rT,rkF:()=>qm,IU6:()=>td,RGr:()=>b,aYu:()=>h,ije:()=>kl,Buf:()=>Tp,YLu:()=>jl,ct9:()=>vo,XkY:()=>cy,T5R:()=>Wd,uQS:()=>yy,wcJ:()=>Oo,d$I:()=>pl,rSp:()=>bd,Sx:()=>Vc,Ilm:()=>Ol,Ki6:()=>zs,VGk:()=>pp,sFD:()=>kh,eWN:()=>EA,dWE:()=>rg,Lkd:()=>vT,aDL:()=>qf,yaA:()=>fy,lOh:()=>kf,DBr:()=>vv,hK$:()=>$l,TZ_:()=>ed,CMB:()=>Wg,FU8:()=>$c,J$p:()=>Jf,b5s:()=>Kf,h2W:()=>St,SL_:()=>wf,oUH:()=>Vp,ck9:()=>Yd,nL:()=>fO,k$p:()=>Mh,Xs0:()=>Dl,u7I:()=>jf,rxg:()=>fu,bji:()=>Tu,oCZ:()=>Vm,MjG:()=>lv,FuV:()=>$p,$ju:()=>Wp,t6d:()=>Gp,m5F:()=>Te,sx:()=>mA,rSc:()=>AO,U10:()=>Pc,L8n:()=>af,R9X:()=>by,rj2:()=>Of,_C4:()=>Xp,tCj:()=>hf,uAg:()=>Ly,wx9:()=>GT,KF3:()=>zp,ax9:()=>Zp,HH7:()=>yp,ufV:()=>ky,_6y:()=>Xc,XTh:()=>rv,AJo:()=>Hc,Ixr:()=>Jy,P6Y:()=>wA,Bd_:()=>Fm,xkB:()=>km,W41:()=>Uf,WkI:()=>If,sSE:()=>jm,GMd:()=>zu,jtL:()=>Zu,Bxm:()=>xm,FVh:()=>Im,U_T:()=>oy,FTe:()=>ae,VGB:()=>ie,Wfe:()=>Au,Ls5:()=>_u,$bd:()=>mu});var n={};r.r(n),r.d(n,{normalize:()=>c,removeLineBreaks:()=>y,search:()=>p,sort:()=>d});var i={};r.r(i),r.d(i,{clearDateTime:()=>_,formatDate:()=>I,formatDateTime:()=>C,formatTime:()=>U,getEndOfDay:()=>w,getMomentFormatFromDateMask:()=>H,getMomentFormatFromDateTimeMask:()=>J,getMomentFormatFromTimeMask:()=>K,getStartOfDay:()=>S,isToday:()=>A,isValidMomentDate:()=>O,isValidMomentDateOrNull:()=>v,momentToDate:()=>g,parseTimestamp:()=>X,toLocalDate:()=>N,toUtcDate:()=>P});var a={};r.r(a),r.d(a,{XY:()=>Qr,b1:()=>Kr,DU:()=>Hr,ZP:()=>qr});var o={};r.r(o),r.d(o,{addAttribute:()=>Xo,editAttribute:()=>zo,editEndDate:()=>is,editRoles:()=>ts,editStartDate:()=>ns,editTags:()=>rs,removeAttribute:()=>es});var s={};r.r(s),r.d(s,{applyCrosswalks:()=>VE,collectCrosswalksFromAttributes:()=>YE,compareActivenessAttributes:()=>$E,compareAttributes:()=>ME,compareImages:()=>xE,compareRoles:()=>qE,compareTags:()=>BE});var l={};r.r(l),r.d(l,{createHistoryManager:()=>KE});var u=r(17440);const c=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,p=(e,t)=>(t=(c(t)||"").toLowerCase(),(e=(c(e)||"").toLowerCase()).includes(t)),d=(0,u.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),y=(0,u.replace)(/(\r\n|\n|\r)/gm,"");var f=r(95038),T=r.n(f);const E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},m=(0,u.anyPass)([u.isEmpty,u.isNil]),h=e=>()=>new Promise(e),b=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),O=e=>e&&e.isValid(),v=(0,u.either)(O,u.isNil),g=e=>e&&e.toDate(),_=e=>(e&&e.setHours(0,0,0,0),e),A=e=>T()(e).isSame(Date.now(),"day"),N=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},P=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},R=e=>(t,r)=>(r?T().utc(t):T()(t))[e]("day").valueOf(),S=R("startOf"),w=R("endOf"),I=e=>T()(e).format(T().localeData().longDateFormat("L")),U=e=>T()(e).format(T().localeData().longDateFormat("LTS")),C=e=>`${I(e)} ${U(e)}`,L=(0,u.equals)("9"),D=(0,u.equals)("99"),j=(0,u.equals)("9999"),k=(0,u.test)(/^[az][az][az]$/),F=(0,u.test)(/^[az][az][az][az]$/),M=(0,u.test)(/^9+$/),x=(0,u.test)(/^[9az]+$/),$=(0,u.cond)([[L,(0,u.always)("M")],[D,(0,u.always)("MM")],[k,(0,u.always)("MMM")],[F,(0,u.always)("MMMM")],[x,(0,u.always)("Mo")],[u.T,(0,u.always)("MM")]]),V=(0,u.cond)([[L,(0,u.always)("D")],[D,(0,u.always)("DD")],[x,(0,u.always)("Do")],[u.T,(0,u.always)("DD")]]),G=(0,u.cond)([[L,(0,u.always)("y")],[D,(0,u.always)("YY")],[j,(0,u.always)("YYYY")],[M,(0,u.always)("YYYYYY")],[u.T,(0,u.always)("YYYY")]]),W=(e,t)=>(0,u.cond)([[(0,u.both)((0,u.always)(t),L),(0,u.always)("h")],[(0,u.both)((0,u.always)(t),D),(0,u.always)("hh")],[L,(0,u.always)("H")],[D,(0,u.always)("HH")],[u.T,(0,u.always)(t?"hh":"HH")]])(e),Y=(0,u.cond)([[L,(0,u.always)("m")],[D,(0,u.always)("mm")],[u.T,(0,u.always)("mm")]]),B=(0,u.cond)([[L,(0,u.always)("s")],[D,(0,u.always)("ss")],[u.T,(0,u.always)("ss")]]),q=/([9az]+)([^9az]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(q)];if(m(e)||t.length>0){const[,e="",r=""]=(0,u.propOr)([],0,t),[,n="",i=""]=(0,u.propOr)([],1,t),[,a="",o=""]=(0,u.propOr)([],2,t);return(0,u.join)("",[$(e),r,V(n),i,G(a),o])}return e},Q=/(9+)([^9]+)*/g,K=e=>{const t=[...e.toLowerCase().matchAll(Q)];if(m(e)||t.length>0){const[,e="",r=""]=(0,u.propOr)([],0,t),[,n="",i=""]=(0,u.propOr)([],1,t),[,a="",o=""]=(0,u.propOr)([],2,t),s=(0,u.pipe)(u.last,(0,u.propOr)("",2),(0,u.test)(/^[^9]+$/))(t),l=(0,u.reject)(u.isEmpty,[W(e,s),r,Y(n),i,a?B(a):"",o]),c=s?" A":"",p=(0,u.pipe)(u.init,(0,u.append)(c));return(0,u.pipe)((0,u.when)((0,u.always)(s),p),(0,u.join)(""))(l)}return e},J=e=>{const[t="",r=""]=(0,u.pipe)((0,u.indexOf)(" "),u.inc,(0,u.splitAt)(u.__,e),(0,u.map)(u.trim))(e);return`${H(t)} ${K(r)}`},X=e=>{const t=Number(e);return Number.isNaN(t)?e:t},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",Z=e=>({isNone:()=>(0,u.isNil)(e),extract:()=>e,orSome:t=>(0,u.isNil)(e)?t:e,map:t=>(0,u.isNil)(e)?ee.None():ee.Some(t(e))}),ee={Some:Z,None:()=>Z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?ee.Some(e):ee.None()},fromNull:function(e){return null==e?ee.None():ee.Some(e)},fromUndefined:function(e){return void 0===e?ee.None():ee.Some(e)},fromEmpty:function(e){return m(e)?ee.None():ee.Some(e)}},te=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},re=(e,t)=>(r,n)=>{const i=t?(0,u.prop)(t):u.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ne=(0,u.when)((0,u.is)(Array),(0,u.prop)(0)),ie=e=>Array.isArray(e)?e:[e],ae=e=>[e],oe=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),se=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),le=e=>(e=(e||"").toLowerCase(),se(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),ue=(0,u.when)((0,u.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ce=e=>null!=e&&["object","function"].includes(typeof e),pe=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ce(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},de=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,u.cond)([...n.map((e=>[(0,u.prop)(e),(0,u.prop)(e)])),[(0,u.always)(t),(0,u.always)(t)],[u.T,(0,u.always)(e)]])(e)},ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,u.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,u.pluck)("percent",i);const s=Math.sign(o),l=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<l.length;e++)l[e].percent=n(l[e].percent+c),o=n(o-c);return(0,u.pipe)((0,u.sortBy)((0,u.prop)("index")),(0,u.pluck)("percent"))(l)},fe=/[\n\r%#()<>?[\\\]^`{}|]/g,Te=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(fe,encodeURIComponent)}`,Ee=e=>`data:image/gif;base64,${e}`;var me=r(76665);let he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,Le,De,je,ke,Fe,Me,xe,$e,Ve,Ge,We,Ye,Be,qe,He,Qe,Ke,Je;var Xe;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(he||(he={})),function(e){e.local="local",e.validationService="validationService"}(be||(be={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Oe||(Oe={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(ve||(ve={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ge||(ge={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(_e||(_e={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(Ae||(Ae={})),function(e){e.asc="asc",e.desc="desc"}(Ne||(Ne={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Pe||(Pe={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Re||(Re={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Se||(Se={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(we||(we={})),function(e){e.PROFILE="profile",e.MAP="map"}(Ie||(Ie={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ue||(Ue={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ce||(Ce={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Le||(Le={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(De||(De={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(je||(je={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(ke||(ke={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(Fe||(Fe={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Me||(Me={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(xe||(xe={})),function(e){e.IN="in",e.OUT="out"}($e||($e={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ve||(Ve={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(Ge||(Ge={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(We||(We={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.SingleAttribute="com.reltio.plugins.entity.attributes.SingleAttributeView",e.AttributeTable="com.reltio.plugins.entity.attributes.AttributeTableView",e.Custom="com.reltio.plugins.ui.CustomActionView",e.Map="com.reltio.plugins.react.EntityMapView",e.ImageAttribute="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatches="com.reltio.plugins.entity.PotentialMatchesView"}(Ye||(Ye={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Be||(Be={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting"}(qe||(qe={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(He||(He={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Qe||(Qe={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(Ke||(Ke={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(Je||(Je={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Xe||(Xe={}));const ze=Xe;let Ze,et;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Ze||(Ze={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(et||(et={}));const tt=(0,u.prop)("referencedEntityTypeURI"),rt=(0,u.prop)("relationshipTypeURI"),nt=(0,u.prop)("referencedAttributeURIs"),it=(0,u.curry)(((e,t)=>(0,u.pipe)(nt,(0,u.filter)((0,u.startsWith)(e)))(t))),at=it("configuration/relationTypes"),ot=it("configuration/entityTypes"),st=(0,u.pipe)((0,u.prop)("uri"),(0,u.startsWith)("configuration/relationTypes")),lt=(0,u.filter)(st),ut=(e,t)=>!t||t.some((t=>t===e.uri)),ct="1Tempo4rary",pt="1Tepmo4Rel",dt=(0,u.cond)([[u.isNil,(0,u.always)("")],[(0,u.test)(/[^/]$/),(0,u.concat)(u.__,"/")]]),yt=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,ft=e=>()=>yt(e),Tt=(e,t)=>{const r=dt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return yt(n)},Et=e=>e&&e.includes("uri$$"),mt=ft("entities"),ht=ft("relations"),bt=(0,u.pipe)((0,u.split)("/attributes/"),(0,u.prop)("0")),Ot=(0,u.startsWith)("relations/"),vt=(0,u.startsWith)("entities/"),gt=(0,u.pipe)((0,u.defaultTo)(""),(0,u.startsWith)("configuration/entityTypes/")),_t=(0,u.pipe)((0,u.defaultTo)(""),(0,u.startsWith)("configuration/relationTypes/")),At=(0,u.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Nt=(0,u.pipe)((0,u.split)("/"),u.head),Pt=(0,u.pipe)((0,u.split)("/"),u.last),Rt=e=>e.split(".").slice(0,2).join("."),St=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},wt=(0,u.curry)(((e,t)=>`${e}/attributes/${t}`)),It=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},Ut=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Ct=(0,u.either)((0,u.startsWith)("attributes."),(0,u.startsWith)("analyticsAttributes.")),Lt=e=>2===e.split("/").length,Dt=e=>5===e.split("/").length,jt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},kt=e=>e.replace(/uri\$\$/g,ct);function Ft(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mt=(0,u.allPass)([(0,u.propSatisfies)((0,u.either)(u.isNil,gt),"uri"),(0,u.prop)("faceted"),(0,u.propEq)("type",ze.TYPE_STRING)]),xt=(0,u.has)("values"),$t=(0,u.cond)([[(0,u.has)("dependentLookupCode"),(0,u.always)(ze.TYPE_DEPENDENT_LOOKUP)],[(0,u.has)("lookupCode"),(0,u.always)(ze.TYPE_LOOKUP)],[xt,(0,u.always)(ze.TYPE_ENUM)],[Mt,(0,u.always)(ze.TYPE_TYPEAHEAD)],[(0,u.propEq)("type",ze.TYPE_BOOLEAN),(0,u.always)(ze.TYPE_BOOLEAN_RADIO)],[u.T,(0,u.prop)("type")]]),Vt=(0,u.pipe)((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ft(e,t,r[t])}))}return e}({},e,{type:$t(e)})),(0,u.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Gt=e=>!!e&&(!!e.autoGenerated&&e.type!==ze.TYPE_NESTED||!!e.parentAutoGenerated),Wt=(0,u.pipe)((0,u.when)((0,u.pipe)(u.type,(0,u.test)(/Object/)),(0,u.prop)("uri")),(0,u.test)(/\/analyticsAttributes\//)),Yt=(0,u.pipe)((0,u.when)((0,u.pipe)(u.type,(0,u.test)(/Object/)),(0,u.prop)("uri")),(0,u.startsWith)("configuration/"),u.not),Bt=e=>Wt(e)?"analyticsAttributes":"attributes",qt=(0,u.propEq)("hidden",!0),Ht=(0,u.curry)(((e,t)=>(0,u.pipe)((0,u.when)((0,u.pipe)(u.type,(0,u.test)(/Object/)),(0,u.prop)("type")),(0,u.equals)(e))(t))),Qt=Ht(ze.TYPE_NESTED),Kt=Ht(ze.TYPE_REFERENCE),Jt=Ht(ze.TYPE_IMAGE),Xt=(0,u.either)(Qt,Kt),zt=(e,t)=>{const r=Wt(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,u.chain)((0,u.prop)("name"),t),(0,u.last)(n)]:[...n.slice(1)]].join(".")},Zt=(0,u.either)((0,u.prop)("lookupCode"),(0,u.prop)("dependentLookupCode")),er=(0,u.pipe)(Zt,Boolean),tr=(0,u.pipe)((0,u.prop)("dependentLookupCode"),Boolean),rr=(0,u.both)(er,(0,u.pipe)(Zt,("rdm",(0,u.pipe)(Nt,(0,u.equals)("rdm")))));const nr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Bt({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,u.propEq)("uri",r)):null,s=o?i(o.uri):0,l=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,u.last)(o.split(`/${n}/`)),c=(r?r[n]||ar(e,r)||[]:a).find((e=>{let{uri:t,name:r}=e;return t===o||r===s})),p=c?[c]:[];return c&&o!==t&&p.push(...l(c,i+1)),p},c=l(o,s),p=c.length===i(t)-s;return p?c:[]},ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=nr(e,t,r);return n.length?(0,u.last)(n):null},ar=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,u.cond)([[(0,u.has)("analyticsAttributes"),(0,u.prop)("analyticsAttributes")],[(0,u.anyPass)([(0,u.propEq)("type",ze.TYPE_NESTED),(0,u.propEq)("type",ze.TYPE_IMAGE)]),(0,u.prop)("attributes")],[(0,u.propEq)("type",ze.TYPE_REFERENCE),(0,u.pipe)(nt,(0,u.map)((t=>ir(e,t))),(0,u.reject)(u.isNil))],[u.T,(0,u.always)(null)]])(t)},or=[ze.TYPE_ACTIVENESS_DATE,ze.TYPE_DATE,ze.TYPE_TIMESTAMP,ze.TYPE_LOCAL_DATE],sr=[ze.TYPE_ACTIVENESS_DATE,ze.TYPE_TIMESTAMP,ze.TYPE_LOCAL_DATE],lr=e=>or.includes(e),ur=e=>sr.includes(e),cr=[ze.TYPE_INT,ze.TYPE_LONG,ze.TYPE_NUMBER,ze.TYPE_FLOAT,ze.TYPE_DOUBLE,ze.TYPE_COUNT],pr=e=>cr.includes(e),dr=e=>[ze.TYPE_FLOAT,ze.TYPE_DOUBLE].includes(e),yr=[ze.TYPE_BOOLEAN,ze.TYPE_BOOLEAN_RADIO,ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED],fr=e=>yr.includes(e),Tr=[ze.TYPE_URL,ze.TYPE_BLOG_URL,ze.TYPE_IMAGE_URL],Er=e=>Tr.includes(e),mr=Ht(ze.TYPE_EMAIL),hr=e=>ze.TYPE_SSN===e;var br,Or=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(br||(br={}));const vr=(0,u.curry)(((e,t,r)=>{var n;const i=e===br.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),gr=(0,u.compose)((0,u.join)("&"),(0,u.map)((0,u.join)("=")),(0,u.map)((0,u.map)(encodeURIComponent)),u.toPairs),_r=(0,u.compose)((0,u.unless)(u.isEmpty,(e=>`?${e}`)),gr),Ar=(0,u.pipe)((0,u.reject)(m),_r),Nr=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r={dcrObjectUris:[],dcrUri:t},n=e=>e&&e.includes("changeRequest"),i=(0,u.propSatisfies)(n,"uri"),a=(0,u.pipe)((0,u.prop)("changes"),u.keys),o=(0,u.when)(i,(0,u.applySpec)({dcrObjectUris:a,dcrUri:(0,u.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},l=(0,u.pipe)(o,s,(()=>E())),c=(0,u.pipe)((0,u.prop)("dcrUri"),(0,u.unless)(u.isNil,(0,u.pipe)((0,u.split)("/"),(0,u.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+gr(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;let T,E=u.identity;const m=()=>!e||f()||T?T||Promise.resolve():(T=new Promise((e=>{E=e})),Promise.resolve());return{updateDCRUriFromResponse:l,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f,getDcrUriAwait:m}},Pr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Rr=(0,u.equals)(Pr.SUGGESTING),Sr=(0,u.equals)(Pr.EDITING),wr=(0,u.equals)(Pr.VIEWING),Ir=(0,u.either)(Sr,Rr),Ur=(0,u.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,u.find)((0,u.propEq)("uri",t),r)})),Cr=(0,u.curry)(((e,t)=>(0,u.pipe)(Ur(e),(0,u.prop)("extendsTypeURI"))(t))),Lr=(0,u.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Cr(e,r)));return n(r)})),Dr=(0,u.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Cr(e,n);return r})),jr=(e,t,r)=>(0,u.prop)(r,t)?t[r]:(0,u.prop)("extendsTypeURI",t)?jr(e,Ur(e,t.extendsTypeURI),r):void 0,kr=(e,t)=>{const r=t.map(Dr(e));return(r.length?r.reduce(u.intersection):[])[0]},Fr=(e,t)=>jr(e,(0,u.is)(Object,t)?t:Ur(e,t),"typeImage"),Mr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Lr(e,t,n.uri)?r.concat(n.uri):r),[]),xr={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},$r={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},Vr={[xr.EQUALS]:"equals",[xr.NOT_EQUALS]:"not",[xr.STARTS_WITH]:"starts with",[xr.MISSING_VALUE]:"missing value",[xr.IN_RANGE]:"in range",[xr.HAS_ALL]:"has all",[xr.FULL_TEXT]:"full text",[xr.EXISTS]:"exists",[xr.COUNT_EQUALS]:"count equals",[xr.COUNT_NOT_EQUALS]:"count not equal",[xr.COUNT_LT]:"count less",[xr.COUNT_LTE]:"count less or equal",[xr.COUNT_GT]:"count greater",[xr.COUNT_GTE]:"count greater or equal",[xr.COUNT_RANGE]:"count in range",[xr.LT]:"less than",[xr.LTE]:"less than or equal",[xr.GT]:"greater than",[xr.GTE]:"greater than or equal",[xr.IN_FILE]:"in file",[xr.NOT_IN_FILE]:"not in file",[xr.CONTAINS]:"contains",[xr.ON]:"on",[xr.BEFORE]:"before",[xr.AFTER]:"after",[xr.WITHIN]:"within"},Gr="in",Wr="notIn",Yr="not range",Br=e=>({[Gr]:xr.EQUALS,[Wr]:xr.NOT_EQUALS}[e]||e);var qr,Hr;!function(e){e.LAST_DAY="lastDay",e.LAST_WEEK="lastWeek",e.LAST_MONTH="lastMonth",e.LAST_6MONTHS="last6Months",e.LAST_YEAR="lastYear",e.PICK_DATE="pickDate"}(qr||(qr={})),function(e){e.LAST_3DAYS="last3Days"}(Hr||(Hr={}));const Qr=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=qr[t]||Hr[t],e)),{}),Kr={[qr.LAST_DAY]:"Last 24 hours",[Hr.LAST_3DAYS]:"Last 3 days",[qr.LAST_WEEK]:"Last 7 days",[qr.LAST_MONTH]:"Last month",[qr.LAST_6MONTHS]:"Last 6 months",[qr.LAST_YEAR]:"Last year",[qr.PICK_DATE]:"Pick date"},Jr={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Xr={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},zr="<No label>",Zr={IN:"in",OUT:"out"};var en=r(87918),tn=r.n(en);function rn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nn(e,t,r[t])}))}return e}function nn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const an={startDate:{type:ze.TYPE_ACTIVENESS_DATE,get label(){return tn().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:ze.TYPE_ACTIVENESS_DATE,get label(){return tn().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},on=rn({id:{type:ze.TYPE_ENTITY_ID,get label(){return tn().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},an,{roles:{type:ze.TYPE_STRING,get label(){return tn().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:ze.TYPE_STRING,get label(){return tn().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),sn={workflow:{type:ze.TYPE_STRING,get label(){return tn().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:ze.TYPE_STRING,get label(){return tn().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:ze.TYPE_STRING,get label(){return tn().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},ln={commenter:{type:ze.TYPE_STRING,get label(){return tn().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},un={notResolved:{type:ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return tn().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},cn={createdBy:{type:ze.TYPE_STRING,get label(){return tn().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:ze.TYPE_STRING,get label(){return tn().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},pn={matches:{type:ze.TYPE_COUNT,get label(){return tn().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:ze.TYPE_COUNT,get label(){return tn().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},dn={sourceSystems:{type:ze.TYPE_STRING,get label(){return tn().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:ze.TYPE_STRING,get label(){return tn().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:ze.TYPE_INT,get label(){return tn().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:ze.TYPE_TIMESTAMP,get label(){return tn().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:ze.TYPE_STRING,get label(){return tn().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let yn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(yn||(yn={}));const fn={[yn.matchRules]:{type:ze.TYPE_STRING,get label(){return tn().text("Match Rules")},uri:yn.matchRules,name:yn.matchRules,faceted:!0,hideForDataTenant:!0},[yn.MLRecommendedMatch]:{type:ze.TYPE_STRING,get label(){return tn().text("Match IQ")},uri:yn.MLRecommendedMatch,name:yn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Tn=rn({},on,sn,ln,un,cn,pn,dn,fn,{type:{type:ze.TYPE_STRING,get label(){return tn().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),En="NOT_MATCH";var mn=r(13980),hn=r.n(mn);function bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){On(e,t,r[t])}))}return e}function On(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vn=hn().oneOf(["mobile","tablet","desktop"]),gn=hn().shape({deviceTypes:hn().oneOfType([vn,hn().arrayOf(vn)]),roles:hn().arrayOf(hn().string)}),_n=hn().shape({value:hn().string,lookupCode:hn().string}),An=hn().shape({link:hn().string,filename:hn().string}),Nn=hn().shape({displayName:hn().string,parent:hn().string}),Pn=hn().oneOfType([hn().string,hn().number,hn().bool,_n]),Rn=hn().oneOfType([Pn,hn().arrayOf(Pn)]),Sn=hn().shape({fieldName:hn().string,values:hn().arrayOf(Rn),filter:hn().string,type:hn().string}),wn=hn().shape({minValue:hn().number,maxValue:hn().number}),In=hn().shape({label:hn().string,name:hn().string,description:hn().string,type:hn().string,hidden:hn().bool,faceted:hn().bool,searchable:hn().bool,uri:hn().string,access:hn().arrayOf(hn().string),cardinality:wn}),Un=hn().shape({label:hn().string,uri:hn().string,typeColor:hn().string,direction:hn().string,startObject:hn().object,endObject:hn().object}),Cn=hn().shape({typeColor:hn().string,typeIcon:hn().string,typeImage:hn().string,label:hn().string,uri:hn().string,attributes:hn().arrayOf(In)}),Ln=hn().shape({uri:hn().string,label:hn().string,memberTypes:hn().array,extendsTypeUri:hn().string,attributes:hn().arrayOf(In)}),Dn=hn().shape({uri:hn().string,label:hn().string,extendsTypeUri:hn().string,relationshipTypeURIs:hn().arrayOf(hn().string)}),jn=hn().shape({uri:hn().string,description:hn().string,label:hn().string,schemaVersion:hn().string,entityTypes:hn().arrayOf(Cn),roles:hn().arrayOf(hn().object),groupTypes:hn().arrayOf(hn().object),relationTypes:hn().arrayOf(Un),graphTypes:hn().arrayOf(Dn),interactionTypes:hn().arrayOf(Ln),sources:hn().arrayOf(hn().object)}),kn=hn().shape({uri:hn().string,type:hn().string}),Fn=hn().shape({uri:hn().string,attributes:hn().object,type:hn().string,timestamp:hn().number,members:hn().object}),Mn=hn().shape({uri:hn().string,type:hn().string}),xn=hn().shape({value:hn().object,ov:hn().bool,type:hn().string,uri:hn().string}),$n=hn().shape({refEntity:hn().oneOfType([hn().array,hn().object]),refRelation:hn().oneOfType([hn().array,hn().object]),value:hn().object,ov:hn().bool,type:hn().string,uri:hn().string}),Vn=hn().oneOf((0,u.values)(Pr)),Gn=hn().shape({type:hn().oneOf(Object.values(he)).isRequired,attributeTypeUri:hn().string.isRequired,parentUri:hn().string.isRequired,uri:hn().string,message:hn().string}),Wn={attributeType:In,showEmptyEditors:hn().bool,lazy:hn().bool,mode:Vn,metadata:jn,ownError:Gn,errors:hn().arrayOf(Gn),crosswalks:hn().array,onAddAttributes:hn().func,onAddOneMore:hn().func,onDeleteAttribute:hn().func,onChangeAttribute:hn().func,additionalControlsRenderer:hn().func,hideDeleteButton:hn().bool,showNonOv:hn().bool,state:hn().oneOf(["deleted","edited"]),expanded:hn().bool},Yn=bn({attributeValue:xn},Wn),Bn=bn({attributeValue:$n},Wn),qn=hn().shape({value:hn().oneOfType([hn().string,hn().bool,hn().number]),ov:hn().bool,type:hn().string,uri:hn().string,lookupCode:hn().string,lookupRawValue:hn().string}),Hn=hn().shape({totalOvValues:hn().number,totalValues:hn().number}),Qn=hn().shape({inRelations:hn().arrayOf(hn().oneOfType([hn().object,hn().string])),outRelations:hn().arrayOf(hn().oneOfType([hn().object,hn().string])),groups:hn().arrayOf(hn().string),entityTypes:hn().arrayOf(hn().string),nextEntry:hn().object}),Kn=hn().oneOf(["asc","desc"]),Jn=hn().shape({id:hn().string,content:Qn,allowOnlyCreateNew:hn().bool,sortColumn:hn().string,sortOrder:Kn,"text-empty":hn().string,max:hn().number,icon:hn().string,caption:hn().string,canCreate:gn,canRead:gn,canUpdate:gn,canDelete:gn,editingEnabled:hn().bool}),Xn=hn().shape({id:hn().string,caption:hn().string,pageSize:hn().number,icon:hn().string,canCreate:gn,canRead:gn,canUpdate:gn,canDelete:gn,attributes:hn().object}),zn=hn().shape({entityUri:hn().string,entityType:hn().string,entityLabel:hn().string,object:kn}),Zn=hn().shape({relationUri:hn().string,relationType:hn().string,relationLabel:hn().string,direction:hn().string,object:Mn}),ei=hn().shape({entity:zn,relation:Zn}),ti=hn().shape({value:hn().string,isRawFilter:hn().bool}),ri=hn().shape({id:hn().string,label:hn().string,name:hn().string,availableEntityTypes:hn().array}),ni=hn().shape({id:hn().string,allowMergeAll:hn().bool,matchActions:hn().object,availableTabs:hn().arrayOf(hn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ii=hn().shape({matchRules:hn().arrayOf(hn().string),object:kn,shortestTransitiveMatchPath:hn().arrayOf(hn().shape({matchRules:hn().arrayOf(hn().string),match:hn().string})),direct:hn().bool,matchScore:hn().number}),ai=hn().arrayOf(ii),oi=hn().arrayOf(hn().shape({uri:hn().string,label:hn().string})),si=[{label:tn().text("And"),value:"and"},{label:tn().text("Or"),value:"or"},{label:tn().text("And not"),value:"and not"},{label:tn().text("Or not"),value:"or not"}];function li(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ui=(0,u.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,u.find)((0,u.propEq)("uri",t),r)})),ci=(0,u.pipe)(ui,(0,u.propOr)("","label")),pi=(0,u.curry)(((e,t)=>{const r=ui(e,t);return[(0,u.path)(["startObject","objectTypeURI"],r),(0,u.path)(["endObject","objectTypeURI"],r)]})),di=(0,u.curry)(((e,t,r)=>{const[n,i]=pi(e,r);return Lr(e,n,t)||Lr(e,i,t)})),yi=(0,u.pipe)((0,u.propOr)([],"relationTypes"),(0,u.reduce)(((e,t)=>{let{uri:r,label:n}=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){li(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),fi=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?Zr.OUT:Zr.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,u.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Zr.IN),i=r(Zr.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ti=(0,u.pathOr)("",["directionalContext",0,"labelPattern"]),Ei={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},mi=(0,u.curry)(((e,t)=>e.every((e=>hi(e,t))))),hi=(0,u.curry)(((e,t)=>{const r=Gt(t);return bi(e,t)&&(e===Ei.READ||!r)})),bi=(e,t)=>!t||!t.access||t.access.includes(e),Oi=(0,u.curry)(((e,t,r)=>hi(Ei.READ,r)&&(Rr(t)?hi(Ei.INITIATE_CHANGE_REQUEST,r):hi(e,r)))),vi=Oi(Ei.CREATE),gi=Oi(Ei.DELETE),_i=Oi(Ei.UPDATE),Ai=mi([Ei.CREATE,Ei.MERGE,Ei.READ,Ei.UPDATE]),Ni=mi([Ei.UPDATE,Ei.READ,Ei.CREATE]),Pi=mi([Ei.UPDATE,Ei.READ]),Ri=mi([Ei.DELETE,Ei.UPDATE,Ei.READ]),Si=(0,u.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,u.pipe)((0,u.propOr)([],"matchGroups"),(0,u.find)((0,u.propEq)("uri",t)),(0,u.defaultTo)({}),(0,u.prop)("type"))(e))(t,r)]||e["*"])),wi=(e,t,r)=>(0,u.pipe)((0,u.map)(Si(e,t)),(0,u.filter)(u.identity))(r),Ii=(e,t,r)=>{const n=wi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&hi(Ei.MERGE,r)},Ui=(0,u.curry)(((e,t,r,n)=>{const i=ui(e,n),[a,o]=pi(e,n);return i&&hi(Ei.CREATE,i)&&Lr(e,a,t.type)&&Lr(e,o,r.type)})),Ci=(e,t,r,n,i)=>{const a=Ur(e,n.type),o=wi(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(u.identity);return o.some((t=>{let{inRelations:r,outRelations:a}=t;return r.some(Ui(e,n,i))||a.some(Ui(e,i,n))}))},Li=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Ur(e,r.type),o=(0,u.propOr)({},"matchActions",t);return{canMerge:Ii(o,i,a),canAddRelation:Ci(e,o,i,r,n),canMark:hi(Ei.UPDATE,a)&&hi(Ei.READ,a)}},Di=(e,t,r,n)=>(0,u.pipe)((0,u.map)((n=>Li(e,t,n.object,r,n.matchRules))),(0,u.reduce)((0,u.mergeWith)(u.and),{}))(n),ji=Wt,ki=(0,u.complement)(ji),Fi=hi(Ei.READ),Mi=e=>{let{attributeType:t,mode:r}=e;return ki(t)&&vi(r,t)&&!qt(t)},xi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Et(r.uri),o=_i(n),s=vi(n);return(0,u.cond)([[ji,u.F],[(0,u.always)(a),u.T],[(0,u.always)(i),o],[u.T,(0,u.allPass)([o,s])]])(t)},$i=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Et(r.uri),s=_i(n),l=gi(n),c=Gi(Ei.UPDATE,n,a,r),p=Gi(Ei.DELETE,n,a,r);return(0,u.cond)([[ji,u.F],[(0,u.always)(o),u.T],[(0,u.always)(i),(0,u.allPass)([l,p])],[u.T,(0,u.allPass)([s,l,c,p])]])(t)},Vi=(0,u.curry)(((e,t,r,n)=>{const i=ar(t,n);return!i||!(0,u.pipe)((0,u.unless)(Array.isArray,u.of),(0,u.map)((0,u.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!bi(e,n)||!Vi(e,t,r[n.name],n)))))})),Gi=(0,u.curry)(((e,t,r,n,i)=>Rr(t)?Vi(Ei.INITIATE_CHANGE_REQUEST,r,n,i):Vi(e,r,n,i))),Wi=(0,u.both)((0,u.complement)(qt),Fi),Yi="SuperUser",Bi="allTenants",qi=[Bi,"allCustomers"],Hi=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return u.T;case r.SECURED:return e=>void 0!==e.userPermissions;default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,u.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===Yi})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,u.endsWith)(["*"],o)?o.slice(0,-1):o,(0,u.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===Yi){const e=r?qi.concat(r.map((e=>`allTenants.${e}`))):qi,n=r&&t[0]===Bi?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,u.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:u.F}var t}))},Qi={NON_SECURED:"NON_SECURED",SECURED:"SECURED",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},Ki={[Qi.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Qi.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Qi.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Qi.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Qi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Qi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Qi.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Qi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Qi.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Qi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Qi.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Qi.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Qi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Qi.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Qi.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Qi.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Qi.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Qi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Qi.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Qi.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Qi.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Qi.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Qi.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Qi.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Qi.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Qi.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Ji=(0,u.curry)(((e,t,r)=>Hi({allowedPermissionsNames:e,permissionsNames:Qi,permissionsConfig:Ki}).some((e=>e(t,{params:{tenant:r}}))))),Xi=Ji([Qi.CAN_EXPORT]),zi=Ji([Qi.CAN_EXPORT_ACTIVITIES]),Zi=Ji([Qi.CAN_IMPORT_ENTITIES_FROM_DT]),ea=Ji([Qi.CAN_READ_ENTITIES_FROM_DT]),ta=Ji([Qi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ra=Ji([Qi.CAN_UPDATE_PROCESS_INSTANCE]),na=Ji([Qi.CAN_VIEW_WORKFLOW_DEFINITION]),ia=Ji([Qi.CAN_CONFIG_ENVIRONMENT_REGISTER]),aa=Ji([Qi.CAN_UPDATE_WORKFLOW_DATA_TASK]),oa=Ji([Qi.CAN_READ_WORKFLOW_DATA_TASK]),sa=Ji([Qi.CAN_MANAGE_WORKFLOW_DEFINITION]),la=Ji([Qi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),ua=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),ca=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),pa=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),da=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ya=Ji([Qi.CAN_EXECUTE_WORKFLOW_JOBS]),fa=Ji([Qi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ta=Ji([Qi.CAN_CREATE_CONFIG_JAR]),Ea=Ji([Qi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ma=Ji([Qi.CAN_VIEW_CONFIG_JAR]),ha=Ji([Qi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),ba=Ji([Qi.CAN_VIEW_WORKFLOW_JOBS]),Oa=Ji([Qi.CAN_MAKE_BULK_UPDATE]),va=Ji([Qi.CAN_OPEN_DATA_LOADER_EXECUTE,Qi.CAN_OPEN_DATA_LOADER_READ]),ga=Ji([Qi.CAN_BULK_DELETE_PROFILES]),_a=Ji([Qi.CAN_READ_MDM_DATA_ENTITIES]),Aa=Ji([Qi.CAN_READ_DVF]),Na=Ji([Qi.IS_FREEMIUM_ADMIN]),Pa=(0,u.reject)(qt),Ra=(e,t)=>(0,u.pipe)((0,u.defaultTo)([]),Pa,(0,u.filter)(e))(t),Sa=(0,u.curry)(((e,t)=>Ra((t=>Mi({attributeType:t,mode:e})),t))),wa=(0,u.curry)(((e,t)=>Ra((t=>Mi({attributeType:t,mode:e})||Wi(t)),t))),Ia=(0,u.pipe)((0,u.defaultTo)([]),(0,u.filter)(Wi)),Ua=(0,u.pipe)((0,u.propOr)([],"attributes"),(0,u.chain)((0,u.when)((0,u.has)("attributes"),(e=>[e,...Ua(e)])))),Ca=(0,u.pipe)((0,u.propOr)([],"attributes"),(0,u.filter)(Wi),(0,u.chain)((0,u.when)((0,u.has)("attributes"),(e=>[e,...Ca(e)])))),La=(0,u.pipe)((0,u.propOr)([],"analyticsAttributes"),(0,u.chain)((0,u.when)((0,u.has)("analyticsAttributes"),(e=>[e,...La(e)])))),Da=(0,u.pipe)(Ur,(0,u.converge)(u.concat,[Ca,La]));function ja(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ka(e,t,r[t])}))}return e}function ka(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fa=(0,u.curry)(((e,t)=>(0,u.evolve)({attributes:(0,u.map)((0,u.pipe)(e,Fa(e)))},t))),Ma=e=>{var t;return ja({},e,{matchGroups:(0,u.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},xa=(0,u.both)((0,u.has)("values"),(0,u.has)("lookupCode")),$a=(0,u.when)(xa,(0,u.dissoc)("values")),Va=(0,u.when)((0,u.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return ja({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),Ga=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Wa=(0,Or.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,u.chain)(Ua,t).concat((0,u.chain)(Ua,r)).some(Ga)})),Ya=e=>{let t=!1;const r=Fa((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?ja({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ba=e=>{const t=Wa(e),r=(0,u.map)((e=>Fa((0,u.pipe)($a,(0,u.when)((0,u.always)(e),Va))))(t)),n=(0,u.map)(Ma),i=(0,u.map)(Ya);return(0,u.evolve)({entityTypes:(0,u.pipe)(r,n,i),relationTypes:(0,u.pipe)(r,i)},e)},qa=(0,u.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,u.find)((0,u.propEq)("uri",t),r)})),Ha=(0,u.prop)("relationshipTypeURIs"),Qa=(0,u.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Ka(e,t)))||[]})),Ka=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(di(e,t))},Ja=(e,t)=>(0,u.pipe)(qa,(0,u.defaultTo)({}),Ha,(0,u.defaultTo)([]),(0,u.chain)(pi(e)),(0,u.reject)(u.isNil),u.uniq,(0,u.map)(Ur(e)))(e,t),Xa=(0,u.allPass)([(0,u.propEq)("matchMethod","match_iq"),(0,u.anyPass)([(0,u.propEq)("scope","ALL"),(0,u.propEq)("scope","INTERNAL")])]),za=e=>(0,u.pipe)((0,u.defaultTo)({}),(0,u.prop)("matchGroups"),(0,u.defaultTo)([]),(0,u.any)(e)),Za=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return za((0,u.complement)(Xa))(e)},eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return za(Xa)(e)},to=(0,u.pipe)(Ur,(0,u.propOr)([],"matchGroups")),ro=(e,t,r)=>(0,u.pipe)(to,(0,u.find)((0,u.propEq)("uri",r)))(e,t),no=(0,u.curry)(((e,t,r)=>(0,u.pipe)(ro,(0,u.propOr)(r,"label"))(e,t,r))),io=(0,u.curry)(((e,t,r)=>{const n=(0,u.pipe)(to,(0,u.filter)((0,u.pipe)((0,u.prop)("uri"),(0,u.includes)(u.__,r))))(e,t),i=(0,u.pipe)((0,u.map)((0,u.prop)("uri")),(0,u.without)(u.__,r),(0,u.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),ao=e=>(0,u.partition)(Xa,e),oo=(0,u.includes)(u.__,["and","or","not"]),so=(0,u.includes)(u.__,(0,u.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),lo=(0,u.includes)(u.__,["equals","notEquals","in"]),uo=(0,u.pipe)(u.toPairs,(0,u.chain)((e=>{let[t,r]=e;return oo(t)?uo(r):so(t)?r.filter(gt):lo(t)?r.map((0,u.prop)("uri")).filter(gt):[]})),u.uniq),co=(0,u.pipe)((0,u.pluck)("rule"),(0,u.chain)(uo),u.uniq),po=(0,u.pipe)(to,co),yo=(0,u.pipe)(io,co),fo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,u.find)((0,u.propEq)("uri",t),r)},To=(0,u.pipe)(fo,Ca),Eo=(e,t)=>(e.interactionTypes||[]).filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||Lr(e,n,t)})(e,t))})(e,t)),mo=e=>!!e.required,ho=(e,t,r)=>{const n=(0,u.cond)([[gt,Ur(e)],[_t,ui(e)]])(t);return bo(e,n,r)},bo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&gt(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Gt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===ze.TYPE_REFERENCE){const n=rt(t),a=nt(t);i=ho(e,n,r).filter((e=>a.some(At(e.uri))))}else t.attributes&&(i=bo(e,t,r));i&&n.push(...i)}return n})):t.type===ze.TYPE_REFERENCE?ho(e,rt(t),r):[],Oo=e=>{const t=(0,u.pipe)((0,u.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),u.values,(0,u.filter)(u.identity))(e);return(0,u.filter)((0,u.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,u.any)((0,u.anyPass)([(0,u.includes)(n),(0,u.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),mo]),e.attributes||[])},vo=(e,t)=>{const r=ot(e);return(0,u.pipe)((0,u.filter)((e=>r.includes(e.uri))),(0,u.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},go=(0,u.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?tn().text(n):n};return r(null,t)})),_o=["label","description","abbreviation","caption","toolTip"],Ao=e=>go(_o,e),No=(0,u.curry)(((e,t)=>{const{sources:r}=e,n=Pt(t);return r.find((e=>{let{uri:t}=e;return Pt(t)===n}))})),Po=(0,u.curry)(((e,t)=>{const r=Pt(t);return(0,u.pipe)(No(u.__,t),(0,u.unless)(u.isNil,(0,u.propOr)(r,"label")))(e)})),Ro=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,u.propEq)("uri","configuration/sources/Reltio")))?t:null==t?void 0:t.concat({uri:"configuration/sources/Reltio",label:"Reltio",icon:"images/source/reltio.png",abbreviation:"Reltio"})},So=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},wo=(0,u.curry)(((e,t)=>{let{roles:r}=e;return(0,u.pipe)((0,u.find)((0,u.propEq)("uri",t)),(0,u.prop)("label"))(r)})),Io=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Ur(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Uo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Co(e,t,r[t])}))}return e}function Co(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return Do(i,e,t,r,n)},Do=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return ee.fromNull(e&&e.length?e:ar(t,r)).map((e=>e.map((e=>{const r=Lo(t,e,n,i);return r.length?Uo({},e,{children:r}):e})))).orSome([]).filter((0,u.either)((0,u.complement)(Xt),(0,u.prop)("children"))).filter(Wi).filter(n).filter((0,u.either)((0,u.prop)("label"),(0,u.prop)("name")))},jo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return Lo(e,t,r,["attributes","analyticsAttributes"])},ko=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return Lo(e,t,r,["attributes"])},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return Lo(e,t,r,["analyticsAttributes"])},Mo=e=>e.children?e.children.flatMap(Mo):e,xo=e=>e.children?[e,...e.children.flatMap(xo)]:e,$o=(0,u.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,u.pipe)((0,u.find)((0,u.propEq)("uri",t)),(0,u.prop)("label"))(r)})),Vo=(0,u.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Pt(r)===e})))),Go=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,u.pipe)((0,u.either)((0,u.find)((0,u.propEq)("default",!0)),Vo("LUD")),(0,u.defaultTo)(r))(t||[])},Wo=(e,t)=>{let{survivorshipStrategies:r}=e;return Vo(t,r)},Yo=(0,u.allPass)([(0,u.complement)(u.isNil),hi(Ei.READ)]),Bo=(0,u.allPass)([(0,u.complement)(u.isNil),(0,u.complement)((0,u.prop)("abstract")),(0,u.complement)((0,u.propEq)("uiConfigHiddenType",!0)),hi(Ei.READ)]),qo=(0,u.allPass)([(0,u.complement)(u.isNil),(0,u.complement)((0,u.prop)("abstract")),(0,u.complement)((0,u.propEq)("uiConfigHiddenType",!0)),(0,u.anyPass)([hi(Ei.CREATE),hi(Ei.INITIATE_CHANGE_REQUEST)])]),Ho=(0,u.curryN)(2,(0,u.pipe)(Ur,Bo)),Qo=(0,u.curryN)(2,(0,u.pipe)(ui,Yo));function Ko(e,t,r,n){var i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Jo(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Ko(r[i],r[i+1],e,t));return n}function Xo(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Jo(r,t)[a];if(s.hasChildren){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Xo(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function zo(e,t,r,n,i,a){void 0===a&&(a=0);var o=Jo(r,t)[a];if(!o.hasChildren){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Zo(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Zo.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Xo(e,t,r,n,i,a),s}var c=zo(e,o,o.valueUri,{},i,a);zo(c,t,r,n,i,a+1)}function Zo(e,t){ce(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function es(e,t,r,n){void 0===n&&(n=0);var i=Jo(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&es(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function ts(e,t){e.roles=t||[]}function rs(e,t){e.tags=t||[]}function ns(e,t){e.startDate=t||""}function is(e,t){e.endDate=t||""}const as=e=>{let{ov:t}=e;return!1!==t},os=(e,t)=>((e,t)=>Er(e.type)&&oe(t))(e,t)||((e,t)=>mr(e.type)&&se(t))(e,t),ss=(0,u.curry)(((e,t)=>(0,u.cond)([[u.isNil,(0,u.always)(null)],[(0,u.pipe)((0,u.prop)(e),Array.isArray),(0,u.path)([e,0])],[u.T,(0,u.prop)(e)]])(t))),ls=ss("refEntity"),us=ss("refRelation"),cs=e=>(0,u.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ps=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,u.pipe)((0,u.split)("/"),u.last)(t)}`}]},ds=(0,u.prop)("objectURI"),ys=(0,u.prop)("objectURI"),fs=(0,u.prop)("type"),Ts=(0,u.pipe)(ls,(0,u.defaultTo)({}),ds),Es=(0,u.pipe)(us,(0,u.defaultTo)({}),ys),ms=(0,u.pipe)(ls,(0,u.defaultTo)({}),fs),hs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},bs=(0,u.evolve)({refEntity:ne,refRelation:ne}),Os=(e,t,r,n)=>{const i=nr(e,r),a=Ur(e,t.type)||ui(e,t.type);if(0===i.length)return null;const o=Bt(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!ut(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=a.attributes.filter((e=>rt(e)===r.uri||tt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},vs=(e,t)=>{const[r,n,...i]=t.split("/"),a=(e[r]||[]).find((e=>{let{uri:t}=e;return t.endsWith("/"+n)})),o=i.join("/");return o&&a?vs(a.value,o):a},gs=(0,u.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return vs(e[r],i)})),_s=(0,u.cond)([[(0,u.has)("lookupCode"),(0,u.pick)(["value","lookupCode"])],[(0,u.has)("refEntity"),(0,u.pick)(["refEntity","label","value"])],[u.T,(0,u.prop)("value")]]),As=(0,u.cond)([[(0,u.has)("lookupCode"),(0,u.pick)(["value","lookupCode","ov"])],[(0,u.has)("refEntity"),(0,u.pick)(["refEntity","label","value","ov"])],[u.T,(0,u.pick)(["value","ov"])]]),Ns=(0,u.curry)(((e,t,r)=>{const[n,...i]=t;return(0,u.pipe)((0,u.defaultTo)({}),(0,u.propOr)([],n),(t=>e?t.filter(e):t),(0,u.when)((()=>i.length>0),(0,u.pipe)((0,u.map)((0,u.prop)("value")),(0,u.map)(Ns(e,i)))))(r)})),Ps=(0,u.curry)(((e,t)=>(0,u.ifElse)((0,u.is)(Array),(0,u.map)(Ps(e)),e)(t))),Rs=(0,u.curry)(((e,t,r,n)=>(0,u.pipe)(Ns(e,r),Ps(t))(n))),Ss=Rs(null,_s),ws=Rs(as,_s),Is=Rs(null,As),Us=Rs(as,As),Cs=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=gs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ls=(e,t)=>(0,u.pipe)(u.values,u.flatten,(0,u.find)((0,u.pipe)(Ts,(0,u.equals)(t))))((null==e?void 0:e.attributes)||{}),Ds=(e,t)=>{const r=jt(t),n=(0,u.pipe)((0,u.split)("/"),(0,u.dropLast)(1),u.last)(t);return Cs(e,r,n)},js=Object.values(an),ks=(0,u.includes)(u.__,js),Fs=e=>js.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,u.assoc)(n,e[n],t):t}),{});function Ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xs(e,t,r[t])}))}return e}function xs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $s=(e,t)=>`${e}_${t}`,Vs=[Tn.matches.name,Tn.matchRules.name],Gs=(0,u.values)(sn).map((e=>e.name)),Ws=e=>(0,u.when)((0,u.always)(!e),(0,u.reject)((0,u.pipe)((0,u.prop)("name"),(0,u.includes)(u.__,Gs)))),Ys=(0,u.curry)(((e,t)=>{const r=t.filter((0,u.pipe)((0,u.prop)("name"),(0,u.includes)(u.__,Vs)));return(e||[]).flatMap((e=>r.map((0,u.evolve)({label:(0,u.concat)(`${e.label} `),name:t=>$s(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Bs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,u.pipe)(u.values,Ws(r),Ys(t),(0,u.find)((0,u.either)((0,u.propEq)("name",e),t?u.F:t=>e.startsWith($s(`dtPotentialMatches.${t.name}`,"")))))(Tn)},qs=(0,u.propEq)("uri",Tn.type.uri),Hs=e=>(0,u.values)(fn).some((0,u.propEq)("uri",null==e?void 0:e.uri)),Qs=(0,u.propEq)("uri",dn.sourceSystems.uri),Ks=Object.values(on),Js=(0,u.includes)(u.__,Ks),Xs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:void 0===n?r.defaultValue:n})},zs=e=>{let{entity:t,attributeType:r}=e;return(0,u.dissoc)(r.uri,t)},Zs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:n})},el=(0,u.propEq)("uri",on.roles.uri),tl=(0,u.propEq)("uri",on.tags.uri);function rl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nl(e,t,r[t])}))}return e}function nl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const il=e=>{let{parentUri:t,attributeType:r}=e;return rl({uri:Tt(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,u.propOr)("","defaultValue",e);return(0,u.cond)([[Xt,(0,u.always)({value:{}})],[er,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,u.both)((0,u.propEq)("defaultValue","now"),(0,u.pipe)((0,u.prop)("type"),lr)),(0,u.always)({value:Date.now()})],[u.T,(0,u.always)({value:t})]])(e)})(r))},al=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,u.pipe)(Sa(i),(0,u.filter)((0,u.anyPass)([(0,u.has)("defaultValue"),tr,(0,u.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=il({parentUri:r,attributeType:e});let s=ar(n,e);s&&(e.type===ze.TYPE_REFERENCE&&(s=lt(s)),a.value=al({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,u.isEmpty)(a.value)||Boolean(a.lookupCode)||tr(e))&&(o[t]=[a])}return o},ol=e=>{let{entity:t,metadata:r}=e;return ho(r,t.type,!0).filter(tr).reduce(((e,t)=>{const n=t.name,i=jt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:Os(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:ll({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},sl=(0,u.curry)(((e,t)=>{let{metadata:r,attributeTypes:n,parentUri:i,mode:a}=e;const o=n.filter((e=>{let{name:r}=e;return!t[r]})),s=(0,u.mapObjIndexed)(((e,t)=>{const{type:i,attributes:o}=n.find((e=>t===e.name));return e.map((e=>{const{value:t,uri:n}=e;return i===ze.TYPE_NESTED?rl({},e,{value:sl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return rl({},s(t),al({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),ll=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=il({parentUri:n,attributeType:r}),u=_s(l);return(0,me.ZP)(t,(e=>{Xo(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},ul=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{Xo(e.attributes||e.value,r,n.uri,_s(n),a,o,i)}))},cl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{zo(e.attributes||e.value,r,n,i,a,o)}))},pl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,me.ZP)(t,(e=>{es(e.attributes||e.value,r,n,i)}))},dl=e=>""===e,yl=(0,u.cond)([[(0,u.propSatisfies)((0,u.complement)((0,u.anyPass)([dl,u.isNil])),"lookupCode"),u.F],[(0,u.propSatisfies)((0,u.anyPass)([dl,u.isNil]),"value"),u.T],[(0,u.both)((0,u.propSatisfies)(u.isEmpty,"value"),(0,u.propSatisfies)((0,u.either)(u.isNil,u.isEmpty),"refEntity")),u.T],[u.T,u.F]]),fl=(0,u.reject)(yl),Tl=e=>{let{deleteEmptyComplex:t,valueTransformer:r=u.identity}=e;return(0,u.pipe)((0,u.map)((0,u.pipe)((0,u.map)((0,u.pipe)(r,(0,u.evolve)({value:(0,u.when)((0,u.is)(Object),(e=>Tl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),fl)),(0,u.when)((0,u.always)(t),(0,u.reject)(u.isEmpty)))},El=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Tl({valueTransformer:(0,u.pipe)((0,u.omit)(["type","uri"]),bs),deleteEmptyComplex:e})},ml=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,u.pipe)(El(e),(0,u.reject)(u.isEmpty))},hl=(0,u.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return ks(r)?Xs({entity:e,attributeType:r}):ll({entity:e,attributeType:r,parentUri:n,index:i})}),e))),bl=(0,u.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return ks(r)?Zs({entity:e,attributeType:r,value:i}):cl({entity:e,attributeType:r,uri:n,value:i})})),Ol=(0,u.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return ks(r)?zs({entity:e,attributeType:r}):pl({entity:e,attributeType:r,uri:n})})),vl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.pipe)((0,u.filter)((0,u.pipe)((0,u.pathOr)([],["roles"]),(0,u.either)((0,u.propEq)("length",0),(0,u.any)((e=>t.includes(e)))))),(0,u.map)((0,u.pathOr)([],["attributes"])),u.flatten)(e)},gl="UrlThumbnail",_l="CdnUrlThumbnail",Al=(0,u.curry)(((e,t,r)=>{const n=(0,u.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(as):(0,u.head)(n);return e&&e.value}return null})),Nl=(e,t)=>(0,u.pipe)((0,u.propOr)({},"value"),(r=>e.map((e=>Al(e,r,t)))),(0,u.filter)(u.identity),u.head,(0,u.defaultTo)("")),Pl=Nl(["CdnUrl","Url"],!0),Rl=Nl(["CdnUrlPreview","UrlPreview"],!0),Sl=Nl([_l,gl],!0),wl=Nl([_l,gl]),Il=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,u.cond)([[Yt,(0,u.always)(t)],[(0,u.both)(Wt,(0,u.always)(i)),(0,u.always)(i)],[u.T,(0,u.always)(n)]])(a),s=Yt(a)?"uri":"name",l=(0,u.pipe)((0,u.prop)(a[s]),(0,u.when)((0,u.both)((0,u.always)(ks(a)),(e=>null===e)),(0,u.always)([""])),(0,u.defaultTo)([]),ie)(o);return(0,u.when)((0,u.always)(r(l,a)),(0,u.append)({attrType:a,values:l}),e)}),[])},Ul=(e,t,r)=>{const n=Ia(e),i=(0,u.any)(r?u.T:as);return Il(n,t,i)},Cl=(e,t,r,n,i,a)=>{const o=Et(null==r?void 0:r.uri)?Sa(t,e):wa(t,e);return Il(o,r,((e,o)=>{const s=Mi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,u.any)(i?u.T:as,e)||Yt(o)&&(0,u.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Ll;const Dl=e=>{Ll=e};function jl(e,t){return Ll(e,t)}const kl=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,u.when)((0,u.is)(String),(0,u.always)({errorMessage:e,errorCode:t}))(e))}),null)})),Fl=50,Ml=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Fl,offset:a=0}=e;return jl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},xl=(0,u.once)((()=>jl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),$l=e=>jl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Vl=(e,t)=>jl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Gl=e=>ee.fromNull(Vr[e]).map(tn().text).orSome(""),Wl=(0,u.curry)(((e,t)=>`${e}_${t}`)),Yl=(0,u.split)("_"),Bl=(0,u.includes)("_"),ql=(0,u.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Hl=(0,u.curry)(((e,t)=>e.some(ql(t)))),Ql=Hl([xr.IN_RANGE,xr.COUNT_RANGE,xr.WITHIN]),Kl=Hl([xr.EXISTS,xr.MISSING_VALUE]),Jl=(0,u.cond)([[Kl,(0,u.always)(0)],[Ql,(0,u.always)(2)],[u.T,(0,u.always)(1)]]),Xl=(0,u.complement)(Kl),zl=Hl([xr.HAS_ALL,xr.EQUALS,xr.NOT_EQUALS]),Zl=Hl([xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE,xr.COUNT_RANGE]),eu=Hl([xr.IN_FILE,xr.NOT_IN_FILE]),tu=e=>{switch(e){case xr.COUNT_EQUALS:return xr.EQUALS;case xr.COUNT_NOT_EQUALS:return xr.NOT_EQUALS;case xr.COUNT_LT:return xr.LT;case xr.COUNT_LTE:return xr.LTE;case xr.COUNT_GT:return xr.GT;case xr.COUNT_GTE:return xr.GTE;case xr.COUNT_RANGE:return xr.IN_RANGE}},ru=Hl([xr.ON,xr.BEFORE,xr.AFTER,xr.WITHIN,xr.NOT_EQUALS]),nu=Hl([xr.WITHIN]),iu=[[xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE],[xr.NOT_IN_FILE,xr.IN_FILE],[xr.EQUALS,xr.NOT_EQUALS,xr.HAS_ALL],[xr.LT,xr.LTE,xr.GT,xr.GTE],[xr.MISSING_VALUE,xr.EXISTS],[xr.COUNT_RANGE],[xr.IN_RANGE],[xr.STARTS_WITH,xr.CONTAINS],[xr.FULL_TEXT],[xr.ON,xr.BEFORE,xr.AFTER,xr.NOT_EQUALS],[xr.WITHIN]],au=(e,t)=>iu.some((r=>r.includes(e)&&r.includes(t))),ou=(0,u.pipe)(u.omit,u.values),su={OPTIONS_FOR_STRING:ou(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_DATE:[xr.ON,xr.BEFORE,xr.AFTER,xr.WITHIN,xr.NOT_EQUALS,xr.MISSING_VALUE,xr.EXISTS,xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE,xr.COUNT_RANGE,xr.IN_FILE,xr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:ou(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_BLOB:ou(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_NUMBER:ou(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_LOOKUP:ou(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],xr),OPTIONS_FOR_ENUM:ou(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],xr),OPTIONS_FOR_ID:[xr.EQUALS,xr.NOT_EQUALS,xr.IN_FILE,xr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[xr.EQUALS,xr.NOT_EQUALS,xr.LT,xr.LTE,xr.GT,xr.GTE,xr.IN_RANGE],OPTIONS_FOR_COMPLEX:[xr.COUNT_EQUALS,xr.COUNT_NOT_EQUALS,xr.COUNT_LT,xr.COUNT_LTE,xr.COUNT_GT,xr.COUNT_GTE,xr.COUNT_RANGE,xr.EXISTS,xr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[xr.EQUALS,xr.NOT_EQUALS,xr.EXISTS,xr.MISSING_VALUE]},lu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case ze.TYPE_TYPEAHEAD:case ze.TYPE_STRING:case ze.TYPE_PASSWORD:case ze.TYPE_TEXT:case ze.TYPE_CIK_ID:case ze.TYPE_URL:case ze.TYPE_BLOG_URL:case ze.TYPE_IMAGE_URL:case ze.TYPE_EMAIL:return su.OPTIONS_FOR_STRING;case ze.TYPE_LOOKUP:case ze.TYPE_DEPENDENT_LOOKUP:return su.OPTIONS_FOR_LOOKUP;case ze.TYPE_ENUM:return su.OPTIONS_FOR_ENUM;case ze.TYPE_DATE:case ze.TYPE_ACTIVENESS_DATE:case ze.TYPE_TIMESTAMP:case ze.TYPE_LOCAL_DATE:return su.OPTIONS_FOR_DATE;case ze.TYPE_BOOLEAN:case ze.TYPE_BOOLEAN_RADIO:return su.OPTIONS_FOR_BOOLEAN;case ze.TYPE_BLOB:return su.OPTIONS_FOR_BLOB;case ze.TYPE_LONG:case ze.TYPE_INT:case ze.TYPE_FLOAT:case ze.TYPE_DOUBLE:case ze.TYPE_NUMBER:return su.OPTIONS_FOR_NUMBER;case ze.TYPE_ENTITY_ID:return su.OPTIONS_FOR_ID;case ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[xr.EQUALS];case ze.TYPE_COUNT:return su.OPTIONS_FOR_COUNT;case ze.TYPE_NESTED:case ze.TYPE_REFERENCE:case ze.TYPE_IMAGE:return su.OPTIONS_FOR_COMPLEX;default:return su.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,u.reject)(Zl,n):n},uu=e=>[Re.and,Re.andNot].includes(e),cu=e=>[Re.or,Re.orNot].includes(e),pu=e=>e.slice(0,-1).some((0,u.pipe)((0,u.prop)("operator"),cu)),du=(yu=[Re.and],e=>e.slice(0,-1).every((e=>yu.includes(e.operator))));var yu;const fu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,u.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Tu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,u.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Eu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,u.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},mu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Re.or,Re.orNot],n=t?[Re.and,Re.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,u.head)(e)&&")"===(0,u.last)(e)&&Eu(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},hu="and",bu=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,u.propOr)(hu,n,e),o=(e=>[Re.andNot,Re.orNot].includes(e))(a)?mu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Ou=(0,u.curry)(((e,t)=>{const r=(0,u.unless)(u.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),vu=e=>Array.isArray(e)?e.map(vu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),gu=(0,u.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),_u=e=>`'${e}'`,Au=e=>`"${e}"`,Nu=(0,u.pipe)(vu,gu),Pu=(0,u.pipe)(Nu,_u),Ru=(0,u.curry)(((e,t)=>(0,u.cond)([[(0,u.allPass)([(0,u.always)(Ql(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[u.T,u.identity]])(t))),Su=(e,t)=>Zl(t)?{type:ze.TYPE_INT}:eu(t)?{type:ze.TYPE_FILE}:ru(t)&&!nu(t)&&ur(e.type)?{type:ze.TYPE_LOCAL_DATE}:e,wu=Object.values(Qr),Iu=e=>!Object.values(Qr).includes(e),Uu=e=>wu.includes(e),Cu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kr;return tn().text(t[e])},Lu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(qr),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kr;return e.map((e=>({value:e,get label(){return Cu(e,t)}})))},Du=e=>{const t=T()();switch(e){case qr.LAST_DAY:return[T()(t).subtract(1,"day").valueOf(),t.valueOf()];case qr.LAST_WEEK:return[T()(t).subtract(1,"week").valueOf(),t.valueOf()];case qr.LAST_MONTH:return[T()(t).subtract(1,"month").valueOf(),t.valueOf()];case qr.LAST_6MONTHS:return[T()(t).subtract(6,"months").valueOf(),t.valueOf()];case qr.LAST_YEAR:return[T()(t).subtract(1,"year").valueOf(),t.valueOf()];case Hr.LAST_3DAYS:return[T()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},ju=e=>{let[t,r]=e;return[T()(t).valueOf(),T()(r).endOf("date").valueOf()]},ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;return(0,u.is)(String,e)?t(e):ju(e)};function Fu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mu(e,t,r[t])}))}return e}function Mu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xu=(0,u.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),$u=(0,u.curry)(((e,t,r)=>{const n=r.map(Ql(e)||t.endsWith(".count")?Nu:Pu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Vu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Gu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Jl(t);return(0,u.pipe)(Vu(i),(0,u.map)($u(t,r)),xu(" or "))(n)},Wu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,u.flatten)(n).map(Pu).join(",")})`},Yu=e=>`*${e}*`,Bu=e=>`URL:${e}`,qu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Hu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===xr.IN_FILE?r:`not ${r}`},Qu=(e,t)=>[S(e,t),w(e,t)],Ku=(0,u.pipe)((e=>{const{values:t,filter:r}=e,n=!Ju(e);if(!(0,u.isEmpty)(t)){const[i]=t;switch(r){case xr.ON:return Fu({},e,n?{filter:xr.EQUALS}:{filter:xr.IN_RANGE,values:[Qu(i,n)]});case xr.BEFORE:return Fu({},e,{filter:xr.LTE,values:[[w(i,n)]]});case xr.AFTER:return Fu({},e,{filter:xr.GTE,values:[[S(i,n)]]});case xr.WITHIN:return Fu({},e,{filter:xr.IN_RANGE,values:[Du(i)]})}}return e}),Gu),Ju=(0,u.propSatisfies)(ur,"type"),Xu=[[(0,u.prop)("rawFilter"),(0,u.prop)("rawFilter")],[(0,u.propEq)("filter",xr.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,u.pipe)((0,u.map)((e=>e.reduce(((e,r)=>e.addClause(Gu({filter:xr.EQUALS,fieldName:t,values:[r]}))),new bu).build())),xu(" or "))(r)}],[(0,u.propEq)("filter",xr.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return Gu({fieldName:r,filter:t,values:n.map((0,u.pipe)(vu,Yu))})}],[(0,u.propEq)("filter",xr.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?Gu(Fu({},e,{values:(0,u.flatten)(r)})):qu(r)?Wu(Fu({},e,{filter:"listEquals"})):Gu(e)}],[(0,u.propEq)("filter",xr.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Jl(t);return(0,u.pipe)(Vu(i),(0,u.map)($u(t,r)),xu(" and "))(n)})(Fu({},e,{values:(0,u.flatten)(e.values)})):Ju(e)?(e=>{const{values:t}=e,r=!Ju(e),[n]=t;return(new bu).addClause(Gu(Fu({},e,{filter:xr.LT,values:[S(n,r)]}))).addClause(Gu(Fu({},e,{filter:xr.GT,values:[w(n,r)]}))).orBuild()})(e):qu(t)?Wu(Fu({},e,{filter:"not listEquals"})):Gu(e)}],[(0,u.propSatisfies)(eu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Gu({fieldName:r,filter:Hu(t,r),values:n.map((0,u.prop)("link")).map(Bu)})}],[(0,u.propSatisfies)(Zl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Gu({fieldName:`${r}.count`,values:n,filter:tu(t)})}],[(0,u.propSatisfies)(ru,"filter"),Ku],[(0,u.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,u.pipe)((0,u.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,u.join)(";"))(r);return $u(t,n,[])}],[(0,u.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return $u(a,`${t},'${r},${n}',0,${i}`,[])}],[u.T,Gu]],zu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Xl(e)||ec(e,r))},Zu=(e,t)=>Array.isArray(t)?ec(e,t):e===xr.WITHIN?Uu(t)||Number.isInteger(t):!(0,u.isNil)(t)&&vu(t).length>0,ec=(e,t)=>t&&t.length>0&&t.every((t=>Zu(e,t)));function tc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},nc=(0,u.pipe)((0,u.propOr)("","fieldName"),(0,u.split)("."),(0,u.slice)(0,-1),(0,u.join)(".")),ic=(e,t,r)=>"children"===e?oc(r,[...t][0],!0):r,ac=(e,t,r)=>"values"===e?[...r,...t]:r,oc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,u.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,u.adjust)(n,(0,u.mergeDeepWithKey)(ic,t),e);if(!r&&zl(t.filter)&&t.filter===i.filter)return(0,u.adjust)(n,(0,u.mergeDeepWithKey)(ac,t),e)}return(0,u.append)(t,e)},sc=(0,u.reduce)(((e,t)=>{const r=(e=>{const t=rc(e),r=e=>e.fieldName===t?e:r({fieldName:nc(e),children:[e]});return r(e)})(t);return oc(e,r)}),[]),lc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,u.has)("rawFilter")),uc=e=>{let[t]=e;return t.children?uc(t.children):t.operator},cc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,u.splitAt)(1,e),i=uc(t)===Re.andNot,a=n(t,!1),o=i?`not ${mu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${uc(r)||hu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,u.cond)([[(0,u.has)("children"),e=>{let{children:i}=e;return a&&lc(i)&&!t?r(i):n(i,a)}],...e])(o))),new bu).buildWithOperators(i.map((0,u.prop)("operator")))}return n},pc=(0,u.pipe)((0,u.propOr)("","filter"),Bl),dc=(0,u.map)((0,u.when)(pc,(e=>{const[t,r]=Yl(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),yc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,u.pipe)((0,u.filter)(zu),dc,sc,cc([...e,...Xu],t))},fc=(0,u.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Tc=[xr.ON,xr.BEFORE,xr.AFTER,xr.WITHIN,xr.NOT_EQUALS,xr.MISSING_VALUE,xr.EXISTS],Ec=[xr.EQUALS,xr.NOT_EQUALS,xr.STARTS_WITH,xr.MISSING_VALUE,xr.HAS_ALL,xr.FULL_TEXT,xr.EXISTS],mc=[xr.EQUALS,xr.NOT_EQUALS,xr.LT,xr.LTE,xr.GT,xr.GTE,xr.IN_RANGE],hc=(e,t)=>{const r=Vt(e);return(e=>{switch(e){case an.startDate.name:case an.endDate.name:case sn.dueDate.name:case cn.createdTime.name:case cn.updatedTime.name:case dn.reltioLoadDate.name:case dn.createDate.name:case dn.updateDate.name:case dn.deleteDate.name:case dn.publishDate.name:return Tc;case pn.matches.name:case dn.count.name:return mc;case sn.workflow.name:case sn.assignee.name:case sn.step.name:case ln.commenter.name:case cn.createdBy.name:case cn.updatedBy.name:case dn.sourceSystems.name:case dn.value.name:return Ec;default:return null}})(t)||lu(r)},bc=[xr.EQUALS,xr.NOT_EQUALS,xr.CONTAINS,xr.STARTS_WITH,xr.MISSING_VALUE,xr.HAS_ALL,xr.IN_RANGE,xr.WITHIN,xr.EXISTS,xr.ON],Oc=(0,u.pipe)(hc,(0,u.filter)((0,u.includes)(u.__,bc))),vc=(0,u.unless)((0,u.startsWith)("?"),(0,u.concat)("?")),gc=e=>{let{query:t,body:r}=e;return t=vc(t),jl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},_c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,u.pipe)(yc(),fc(t.globalFilter))(n),activeness:t.activityFilter||Xr.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Ar(i)}`},Ac=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=_c(e,t,r);return jl(n)},Nc=e=>jl(`/entities/_total?${e}`),Pc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,u.pipe)((0,u.filter)(Bo),(0,u.map)((0,u.prop)("uri")))(e),i={filter:xr.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,u.pipe)(yc(),fc(r.globalFilter))([i,a]),s=Ar({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Xr.ACTIVE_ONLY,max:r.max||4});return jl("/entities/_typeAheadSearch"+s,{method:"GET"})},Rc=(0,u.pipe)((0,u.reject)(u.isNil),_r),Sc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:l}=n,c=(0,u.pipe)(yc(),fc(i))(r),p=Rc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:l||1,orderType:n.orderType||"reversedCount"}];return gc({query:p,body:d})},wc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Sc({fieldName:t,searchParams:i,options:n})},Ic="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Uc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i={filter:(0,u.pipe)(yc(),fc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Ic,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Ar(i)}`},Cc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=Uc(e,t,r);return jl(n)},Lc=e=>xc(e,{select:"secondaryLabel"}),Dc=(e,t)=>{const{select:r=Ic,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),jl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},jc=(0,u.filter)((0,u.pipe)((0,u.prop)("uri"),Et)),kc=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:l,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=jc(n).length,T={[r]:{max:a,offset:(0,u.isNil)(i)?y-f:i}},E=zt(r),m={method:"POST",data:{attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E}},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[l]}],b=(0,u.pipe)(yc(),fc(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),jl(`${s}/api/${o}/${t}/_object`,m)},Fc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Mc={options:"sendHidden,addRefAttrUriToCrosswalk"},xc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mc;return jl(`/${e}${Ar(t)}`)},$c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const r={method:"POST",data:[e]},n=t("/entities");return jl(n,r)},Vc=e=>jl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Gc=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return jl(`/${e}/_clone${Ar({executeLCA:!1,valuesToCopy:r})}`,n)},Wc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return jl(`/entities/_events/_total${_r({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Yc=(e,t)=>jl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),Bc=e=>{let{uri:t,diff:r,uriPreprocessor:n=u.identity}=e;return jl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},qc=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return jl(`/${t}/_interactions${(0,u.pipe)((0,u.reject)(m),_r)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Hc=e=>{const t=new FormData;return t.append("file",e),jl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=de(e,tn().text("Can't upload file"));return Promise.reject(t)}))},Qc=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return jl(`/personal/findSavedSearches${_r({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},Kc=e=>jl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Jc=e=>jl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xc=e=>{const{uri:t}=e,r=(0,u.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return jl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},zc=e=>{let{uri:t}=e;return jl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Zc=(e,t)=>(0,u.pipe)((0,u.evolve)({isPublic:(0,u.always)(t)}),Xc)(e),ep=(e,t)=>(0,u.pipe)((0,u.evolve)({isFavorite:(0,u.always)(t)}),Xc)(e);function tp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rp=["max","offset","filter"],np=(0,u.curry)(((e,t)=>t.nextEntry?(0,u.evolve)({nextEntry:np(e)},t):function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tp(e,t,r[t])}))}return e}({},t,(0,u.pick)(rp,e)))),ip=e=>{if(1===e.length&&((0,u.pathEq)([0,"activeness","entity"],Pe.ALL,e)||(0,u.pathEq)([0,"activeness","relation"],Pe.ALL,e)))return!1},ap=(0,u.omit)(["activeness"]),op=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=ip(t),{searchByOv:i}=r;t=(0,u.map)((0,u.pipe)((0,u.when)((0,u.prop)("nextEntry"),(e=>(0,u.pipe)(np(e),(0,u.omit)(rp))(e))),ap,(0,u.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Ar(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},sp=(0,u.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),lp=(0,u.reject)(u.isNil),up=(0,u.unless)((0,u.startsWith)("/"),(0,u.concat)("/")),cp=e=>jl(up(e),{method:"GET",headers:{"Content-Type":"application/json"}}),pp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const r=(0,u.pipe)(t,up);return jl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},dp=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=u.identity}=e;const l={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?ml()(i):null,startDate:a,endDate:o},c=(0,u.pipe)(lp,ie,JSON.stringify);return jl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(l)})},yp=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=u.identity}=e;const i=(0,u.prop)("attributes"),a=(0,u.pipe)((0,u.prop)("uri"),(0,u.concat)(u.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),up,n),o=ME(i(t),i(r)).concat($E(t,r));return jl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},fp=(e,t,r)=>{const{url:n,options:i}=op(e,t,r);return jl(n,i).then(sp)},Tp=(e,t)=>jl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Ep=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Zr.IN?a.inRelations=[n]:a.outRelations=[n],jl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},mp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return jl(`${t}/recentSearches${Ar({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},hp=e=>jl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),bp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return jl(`/recentSearches${Ar({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Op(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vp(e,t,r[t])}))}return e}function vp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gp={select:"label,secondaryLabel,name,type,startDate,endDate"},_p=(0,u.reject)(u.isNil),Ap=(0,u.pipe)(_p,_r),Np=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Op({},gp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return jl(`/${t}/_tree${Ap(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Pp=e=>{let{uri:t,graphUri:r}=e;const n=Op({},gp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return jl(`/${t}/_parents${Ap(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Rp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Op({},gp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return jl(`/${t}/_hops${Ap(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Sp(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const wp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Ip="/activities",Up=e=>{let{label:t,description:r}=e;return jl(Ip,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:wp()}})};var Cp;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Cp||(Cp={}));const Lp=e=>{const t=Ar(e);return jl(Ip+t,{method:"GET"})},Dp=e=>jl(`/activities/_total${Ar(e)}`,{method:"GET"}),jp=e=>{const{entityUri:t}=e,r=Sp(e,["entityUri"]);return jl(`/${t}/_activities${Ar(r)}`,{method:"GET"})},kp=e=>{const{entityUri:t}=e,r=Sp(e,["entityUri"]);return jl(`/${t}/_activities/_total${Ar(r)}`,{method:"GET"})};function Fp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mp(e,t,r[t])}))}return e}function Mp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},$p=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return jl(xp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},Vp=e=>{let{workflowPath:t,url:r,tenant:n,method:i,data:a,headers:o}=e,s=r;return r.includes("http:")||r.includes("https:")||(s=xp({url:r,workflowPath:t,tenant:n})),jl(s,{method:i||"GET",body:JSON.stringify(a),headers:Fp({"Content-Type":"application/json"},null!=o?o:{})})},Gp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=xp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,u.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return jl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,u.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,u.map)(s(o,r)),(e=>Promise.all(e)),(0,u.andThen)(u.last))(n)},Wp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=xp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Fp({},l,{comment:o}):l;return jl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Yp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const l=xp({url:`/tasks${s?Ar(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Fp({objectURIs:[i]},(0,u.reject)(m,a)))};return jl(l,Fp({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Bp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return jl(xp({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,u.pipe)((0,u.reject)(u.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},qp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return jl(xp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,u.pipe)((0,u.reject)(u.isNil),JSON.stringify)(Fp({max:a,offset:o},i))})},Hp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return jl(xp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Qp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return jl(xp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Kp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Jp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return jl(xp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Xp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},zp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},Zp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Qp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},ed=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return jl(xp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},td=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return jl(xp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},rd=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(as);return a&&a[0]&&(r=n.length>0&&a[0].value?rd(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),nd=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=rd(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},id=/[,\s]*$/,ad=e=>{const t=tn().text(zr);if(!e)return t;const r=e.replace(id,"");return""===r.toString().trim()?t:r},od=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},sd=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=od(e,r.referencedEntityTypeURI);if(n)return nd({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return nd({attributes:t||{}},r.dataLabelPattern);return""},ld=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},ud=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},cd=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",pd=(0,u.when)((0,u.is)(Object),(0,u.ifElse)((0,u.pipe)((0,u.prop)("value"),(0,u.is)(Object)),Sl,(0,u.prop)("value"))),dd=(0,u.pipe)((0,u.prop)("defaultProfilePicValue"),pd),yd=(e,t,r)=>{const n=dd(r)||(e=>(0,u.pipe)((0,u.prop)("defaultProfilePic"),(0,u.when)(u.identity,(0,u.pipe)(gs(e),pd)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,u.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(Ur(e,t.type));return(0,u.pipe)((0,u.map)((0,u.pipe)((r=>Os(e,t,r)),(0,u.defaultTo)([]),u.head)),(0,u.reject)(u.isNil),u.head,(0,u.when)(u.identity,pd))(r)})(e,r)||Fr(e,r.type);return cd(t,n)};function fd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Td(e,t,r[t])}))}return e}function Td(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ed="DTSS/",md=(0,u.replace)(new RegExp("^entities/"),""),hd=e=>Ed+e.dataTenant+"/"+e.uri,bd=(0,u.replace)(new RegExp("^DTSS/.+?/"),""),Od=e=>!(!e||!e.dataTenant),vd=(0,u.startsWith)(Ed),gd=(0,u.pipe)((0,u.ifElse)(vd,(0,u.pipe)((0,u.split)("/"),(0,u.nth)(1)),(0,u.always)(null))),_d=(0,u.ifElse)(Od,hd,(0,u.prop)("uri")),Ad=e=>e&&e.uri?e.dataTenant?hd(e):md(e.uri):"",Nd=(0,u.curry)(((e,t,r)=>(Ur(t,r.type)||{})[e]||"")),Pd=Nd("label"),Rd=Nd("typeGraphIcon"),Sd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Ur(e,t.type)||{},n=(r.attributes||[]).reduce(((e,t)=>(e[t.uri]=t,e[t.name]=t,e)),{});return t.attributes&&r.businessCardAttributeURIs?r.businessCardAttributeURIs.map((r=>{const i=n[r];if(!i)return null;let a=t.attributes[i.name];if(!a)return null;Array.isArray(a)&&(a=a.find(as)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:sd(e,o,i),uri:a.uri}})).filter(u.identity):[]},wd=(0,u.pipe)(Sd,(0,u.map)((0,u.prop)("text")),(0,u.join)(", ")),Id=(0,u.curry)(((e,t)=>{if(!t)return[];if(1===e.length){return t[e[0]]||[]}{const r=t[e[0]];return Array.isArray(r)?r.reduce(((t,r)=>{if((0,u.is)(Object,r.value)){const n=Id(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Id(e.slice(1),r)}})),Ud=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Cd=e=>(0,u.propOr)([],"matchRules",e),Ld=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?fd({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Dd=(e,t,r)=>t&&r?r.aEntity:e,jd=(0,u.evolve)({attributes:ml(!0)}),kd=(0,u.pipe)(jd,(0,u.props)(["attributes","startDate","endDate","roles","tags"]),(0,u.all)(m)),Fd=e=>(0,u.assoc)("dataTenant",e),Md=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:l,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:l,sort:i,order:a,activeness:o,sources:c,rules:p};return jl(`/${t}/_transitiveMatches${(0,u.pipe)((0,u.reject)(m),_r)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xd=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return jl(`/${t}/_notMatch${(0,u.pipe)((0,u.reject)(m),_r)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},$d=(e,t)=>{const r=(0,u.map)((0,u.prop)("uri"))(t);return jl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Vd=(e,t,r)=>Promise.all(t.map((async t=>await jl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),Gd=async(e,t)=>await Vd(e,t,"NOT"),Wd=async(e,t)=>await Vd(e,t,"MATCH"),Yd=async(e,t)=>await Promise.all(t.map((async t=>await jl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function Bd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qd(e,t,r[t])}))}return e}function qd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hd(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const Qd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return jl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Kd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return fy({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Jd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return fy({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Xd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return jl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},zd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return Xd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Zd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,u.partition)(Od,i);return Promise.all([s.length?$d(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Xd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},ey=(0,u.pipe)(u.toPairs,(0,u.chain)((e=>{let[t,r]=e;return r.map((0,u.assoc)("matchRule",t))})),(0,u.reduce)(((e,t)=>{let{matchRule:r}=t,n=Hd(t,["matchRule"]);const i=e.findIndex((e=>{let{object:{uri:t}}=e;return n.uri===t}));return-1===i?e.concat({object:n,matchRules:[r]}):(0,u.adjust)(i,(0,u.evolve)({matchRules:(0,u.append)(r)}),e)}),[])),ty=(0,u.pipe)((0,u.find)((0,u.propEq)("index",0)),(0,u.propOr)({},"object"),ey),ry=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return jl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(ty)},ny=e=>t=>{let{dtssPath:r,dataTenants:n=[],customerTenant:i,entity:a}=t;return Promise.all(n.map((t=>{let{id:n}=t;return e({dtssPath:r,dataTenant:n,customerTenant:i,entity:a}).then((0,u.map)((0,u.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(u.flatten)},iy=ny((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return jl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(ty)})),ay=ny((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return jl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),oy=(e,t)=>{let{dtssPath:r,dataTenants:n=[],entity:i,customerTenant:a,dtssRequest:o}=e;return function(){if(r&&n&&n.length){const e=o({dtssPath:r,dataTenants:n,entity:i,customerTenant:a});return Promise.all([t(...arguments),e]).then(u.flatten)}return t(...arguments)}},sy=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return jl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},ly=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{dataTenant:o,uri:s}=i;return Promise.all(a.map((t=>{let{uri:i}=t;return sy(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},uy=ly("NOT"),cy=ly("MATCH"),py=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,l]=(0,u.partition)(Od,a);return Promise.all([Vd(o,l,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return sy(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},dy=py("NOT"),yy=py("MATCH");function fy(e){let{requestProvider:t=jl,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,Bd({},Hd(s,["headers"]),{headers:Bd({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Ty=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return fy({url:Uc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Ey=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return fy({url:_c(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},my=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:l}=op(t,r);return fy({url:`entities/_connections/_getConnections${Ar({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:l,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,u.pipe)(sp,(0,u.map)((0,u.evolve)({connections:(0,u.map)((0,u.pipe)((0,u.assocPath)(["entity","dataTenant"],n),(0,u.assocPath)(["relation","dataTenant"],n)))}))))},hy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return fy({url:`${Fc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},by=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return jl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Oy=e=>{let{dtssPath:t,tenant:r}=e;return jl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},vy=e=>{let{dtssPath:t,customerTenant:r}=e;return jl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},gy=e=>{let{dtssPath:t,tenants:r}=e;return jl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},_y=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return fy({url:Fc(t),dataTenant:r,customerTenant:n,dtssPath:i})},Ay=()=>jl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function Ny(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Py(e,t,r[t])}))}return e}function Py(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ry=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Ny({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return jl(`${t}/api/${r}/graph/search${Ar({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Sy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return jl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Ny({},n,i),headers:{"Content-Type":"application/json"}})},wy=(e,t)=>`${e}/${t}/comments`,Iy=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return jl(`${wy(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Uy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return jl(`${wy(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Cy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return jl(wy(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Ly=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return jl(`${wy(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Dy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return jl(`${wy(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},jy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return jl(`${wy(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},ky=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return jl(`${wy(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Fy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return jl(`${wy(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},My=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Ar({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return jl(`${wy(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function xy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$y(e,t,r[t])}))}return e}function $y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vy=e=>{let{tenant:t,servicesPath:r}=e;return jl(`${r}/oauth/proxy${Ar({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Gy="graphExport",Wy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await Hy({servicesPath:e,tenant:t,environment:r,namespace:Gy,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(xy({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await Hy({servicesPath:e,tenant:t,environment:r,namespace:Gy,options:xy({method:"PUT"},o)})}catch(e){s=null}return s||(s=await Hy({servicesPath:e,tenant:t,environment:r,namespace:Gy,options:xy({method:"POST"},o)})),s},Yy=e=>{let{servicesPath:t,key:r}=e;return jl(`${t}/settings${Ar({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},By=e=>{let{servicesPath:t}=e;return jl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},qy=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return jl(`${n}/plugins${Ar({tenant:t,user:r})}`,{method:"GET"})},Hy=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return jl(`${n}/configService${Ar({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Qy=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return Hy({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Ky=e=>{let{servicesPath:t,stateHash:r}=e;return jl(`${t}/searchLink?key=${r}`,{method:"GET"})},Jy=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),jl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Xy=e=>jl(`/${e}?showObjectsInfo=true`,{method:"GET"}),zy=e=>{let{exportPath:t,tenant:r,options:n}=e;return jl(`${t}/${r}/activities${Ar(n)}`,{method:"POST"})};function Zy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ef(e,t,r[t])}))}return e}function ef(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tf=e=>{const{entityUri:t}=e;return jl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},rf=e=>{let{entityUri:t,crosswalk:r}=e;return jl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},nf=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return jl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Zy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Zy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},af=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return jl(`/${r}/_${n}${Ar({contributorURI:t})}`,{method:"POST"})},of=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return jl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},sf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return jl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},lf=e=>{let{entityUri:t,crosswalkId:r}=e;return jl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cf=e=>{let{entityTypeUri:t}=e;return jl(`/dataQuality/fillRates${_r({entityType:Pt(t)})}`,{method:"GET"})},pf=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},df=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uf(e,t,r[t])}))}return e}({},n===Me.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Me.ATTRIBUTE_TYPE?_r({numberOfThreads:pf({attributes:r,metrics:i})||1}):"";return jl(`/entityType/${Pt(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},yf=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return jl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Pt(n)}`,{method:"GET",headers:{env:i}})},ff=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Me.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return jl(`${t}/${r}/entityType/${Pt(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},Tf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return jl(`/${t}${Ar({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Ef=e=>{let{attributeUri:t,value:r}=e;return jl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},mf=e=>{let{attributeUri:t,value:r}=e;return jl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},hf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return jl(`/${t}${Ar({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},bf=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Ar({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=ml()([[{value:a}]]);return jl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Of=e=>{let{entityUri:t,attributeName:r,value:n}=e;return jl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},vf=e=>{let{entityUri:t,attributeName:r}=e;return jl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function gf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _f=e=>{let{entityUri:t}=e;return jl(`/${t}/_historicURIs`,{method:"GET"})},Af=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return jl(`/${t}/_changesWithTotal${Ar(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gf(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Nf=(e,t)=>jl(`/${e}/_previousChange${Ar({timestamp:t})}`,{method:"GET"}),Pf=(e,t)=>jl(`/${e}${Ar({time:t})}`,{method:"GET"});function Rf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sf(e,t,r[t])}))}return e}function Sf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wf=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return jl(t,{method:r||"GET",body:n,headers:Rf({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},If=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Ar({options:a.join(","),severity:o.join(",")});return jl(`${t}/validate/${i}/entity/${Ad({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Uf=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return jl(`${t}/validate/${n}/entity${Ar({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Cf=e=>{let{tenant:t,apiPath:r}=e;return jl(`${r}/tenants/${t}/name`,{method:"GET"})},Lf=e=>{let{tenant:t,apiPath:r}=e;return jl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Df=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return jl(`${a}/preferences${Ar({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},jf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return jl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},kf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return jl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Ff=e=>{const{servicesPath:t}=e;return jl(`${t}/getTokenForWorker`,{method:"GET"})};var Mf=r(29524);const xf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=mt(),s={attributes:al({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=Os(r,e,n.uri)[0];return i&&i.value?cl({entity:e,attributeType:n,uri:i.uri,value:t}):ll({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},$f=(e,t)=>(0,u.pipe)(u.values,u.flatten,(0,u.filter)((0,u.has)("refEntity")),(0,u.map)(Ts),(0,u.filter)(Et),(0,u.map)((t=>e[t])),(0,u.reject)(u.isNil))((null==t?void 0:t.attributes)||{}),Vf=(0,u.curry)(((e,t)=>{const r=$f(e=e||{},t=t||{});return r.concat((0,u.chain)(Vf(e),r))})),Gf=(0,u.curry)(((e,t)=>(0,u.pipe)(pe,(0,u.filter)(e))(t))),Wf=Gf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Yf=e=>(0,u.filter)((0,u.pipe)((t=>(0,u.path)(t,e)),Et)),Bf=e=>(0,u.pipe)(Wf,Yf(e),(0,u.map)((t=>(0,u.path)(t,e))))(e),qf=(0,u.curry)(((e,t,r)=>{const n=(0,u.pipe)(Wf,(0,u.find)((t=>(0,u.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,u.set)((0,u.lensPath)(n),t,r):r})),Hf=(0,u.when)((0,u.pipe)((0,u.prop)("uri"),Et),(0,u.omit)(["uri","timestamp"])),Qf=(0,u.pipe)(Hf,jd),Kf=async(e,t,r)=>{if(!e)return null;const n=Bf(e);if(n.length>0)for(const r of n)e=qf(r,t[r],e);const i=await $c(Qf(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,u.path)([0,"errors"],e))(i);if(a)throw a;if((0,u.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,u.pipe)((0,u.prop)("changes"),u.keys,(0,u.find)((e=>!(0,u.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,u.pathOr)(e,[0,"object"],e))(i);return o.uri},Jf=async(e,t,r)=>{const n=zf(e,t),i={};for(const t of n)i[t]=await Kf(e[t],i,r);return i},Xf=(0,u.curry)(((e,t)=>{const r=Mf.Node(t);return Bf(e[t]).forEach((t=>{const n=Xf(e,t);r.addEdge(n)})),r})),zf=(e,t)=>(0,u.pipe)((0,u.map)(Xf(e)),(0,u.map)(Mf.getDependencyOrder),u.flatten,(0,u.map)((e=>e.getInfo())))(t),Zf=(0,u.map)((0,u.evolve)({newValue:(0,u.when)(Array.isArray,(0,u.map)(Hf))})),eT=(e,t)=>[...BE(e.tags||[],t.tags||[]),...qE(e.roles||[],t.roles||[]),...xE(e,t),...$E(e,t)],tT=(e,t)=>[...VE(ME((0,u.clone)(e.attributes),(0,u.clone)(t.attributes),!1),YE((0,u.clone)(t.attributes),(0,u.clone)(t.crosswalks)),e),...eT(e,t)],rT=(0,u.pipe)(((e,t)=>{const r=(0,u.toPairs)(e);return(0,u.map)((0,u.evolve)({newValue:(0,u.when)(Array.isArray,(0,u.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return qf(r,n,e)}),e))))}),t)}),Zf),nT=(0,u.curry)(((e,t)=>(0,u.when)(Et,(0,u.propOr)(u.__,t,e),t)));function iT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aT(e,t,r[t])}))}return e}function aT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oT=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:xe.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},sT=e=>{let{relationUri:t}=e;return{type:xe.DELETE_RELATION,parameters:{relationUri:t}}},lT=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:xe.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},uT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:xe.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},cT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:xe.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},pT=(0,u.curry)(((e,t)=>(0,u.cond)([[(0,u.pathEq)(["parameters","relation","uri"],e),u.T],[(0,u.pathEq)(["parameters","relationUri"],e),u.T],[(0,u.pathEq)(["parameters","oldRelation","uri"],e),u.T],[(0,u.pathEq)(["parameters","newRelation","uri"],e),u.T],[u.T,u.F]])(t))),dT=e=>e.type===xe.DELETE_RELATION,yT=e=>e.type===xe.CREATE_RELATION,fT=e=>e.type===xe.REPOINT_RELATION,TT=e=>e.type===xe.UPDATE_RELATION,ET=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),mT=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case xe.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return dp({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case xe.DELETE_RELATION:return()=>{const{relationUri:e}=r;return pp(e,i).then(o)};case xe.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Ep(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case xe.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return yp({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case xe.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[sT({relationUri:o}),oT({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,u.pipe)((0,u.map)(bT(n)),(0,u.map)(mT),ET)(s)}}},hT=e=>t=>()=>e().then(t),bT=e=>t=>iT({dcrProcessor:e},t),OT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Nr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,u.pipe)(u.flatten,(0,u.map)(bT(r)),(0,u.map)(mT),(0,u.map)(hT(r.getDcrUriAwait)),ET,(0,u.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},vT=e=>t=>(0,u.map)((t=>iT({},t,{parameters:(0,u.evolve)({parentUri:nT(e),entityUri:nT(e),newEntityUri:nT(e)},t.parameters)})),t),gT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},_T=(e,t)=>{const r=e.filter(yT).find(pT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>TT(o)&&pT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!fT(o)||!pT(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(gT({condition:e=>r===e,updater:e=>(0,u.evolve)({parameters:(0,u.evolve)({relation:(0,u.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},AT=(e,t)=>{const r=e.filter(fT).filter(pT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,u.last)(r)===i:!TT(i)||!pT(t,i)||(a>e.indexOf((0,u.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(gT({condition:e=>(0,u.last)(r)===e,updater:e=>(0,u.evolve)({parameters:(0,u.evolve)({relation:(0,u.always)(n)})})(e)})):i},NT=(e,t)=>{const r=e.filter(dT).filter(pT(t));return e.filter((e=>r.includes(e)?(0,u.last)(r)===e:!pT(t,e)))},PT=(e,t)=>{const r=e.filter(TT).filter(pT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!TT(e)||(n=n||e.parameters.oldRelation,(0,u.last)(r)===e)));return n?i.map(gT({condition:e=>(0,u.last)(r)===e,updater:e=>(0,u.evolve)({parameters:(0,u.evolve)({oldRelation:(0,u.always)(n)})})(e)})):i},RT=e=>{const t=e.filter(dT).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,u.uniq)(t).reduce(NT,e)},ST=e=>{const t=e.filter(yT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,u.uniq)(t).reduce(_T,e)},wT=e=>{const t=e.filter(fT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,u.uniq)(t).reduce(AT,e)},IT=e=>{const t=e.filter(TT).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,u.pipe)((0,u.filter)((e=>(0,u.count)((0,u.equals)(e),t)>1)),u.uniq,(0,u.reduce)(PT,e))(t)},UT=e=>(0,u.pipe)(RT,ST,wT,IT)(e);function CT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LT(e,t,r[t])}))}return e}function LT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DT=e=>CT({},(0,u.path)(qT(),e),{startDate:(0,u.path)(JT(),e),endDate:(0,u.path)(XT(),e)}),jT=(e,t)=>(0,u.pipe)((0,u.path)(KT()),nT(t))(e),kT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=jT(e,r),i=(0,u.path)(HT(),e)===$e.IN,a=e.parentEntityUri||n;return oT({parentUri:i?t:a,relation:DT(e),entityUri:i?a:t})})),...o.map((t=>{const i=jT(t,r),a=(0,u.path)(HT(),t)===$e.IN,o=i!==(0,u.pipe)((0,u.path)(qT()),a?zT:ZT)(t),s=rE(e,(0,u.path)(YT(),t)),l=t.parentEntityUri||n,c=nT(r,i);return o?cT({entityUri:a?l:c,newEntityUri:a?c:l,relation:(0,u.path)(qT(),t),isReversed:!1}):uT({oldRelation:(0,u.path)(qT(),s),newRelation:DT(t)})})),...i.map((e=>sT({relationUri:e}))),...s.map((e=>lT({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},FT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return CT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),MT=(0,u.has)("dataTenant"),xT=(0,u.ifElse)(MT,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,u.prop)("relationUri")),$T=(e,t)=>(0,u.pipe)(ui,(0,u.defaultTo)({}),(0,u.propOr)([],"attributes"),(0,u.concat)(js),Pa)(e,t),VT=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,u.pipe)((0,u.assoc)("relationType",t),(0,u.assoc)("relationLabel",r),(0,u.assoc)("object",{type:t,attributes:{},uri:i}),(0,u.assoc)("direction",n))(e)}},GT=(e,t,r)=>{const n=nd(t,e.dataLabelPattern),i=(0,u.lensProp)("entity");return(0,u.over)(i,(0,u.evolve)({entityLabel:(0,u.always)(n),object:{label:(0,u.always)(n)}}),r)},WT="relation",YT=(0,u.always)([WT,"relationUri"]),BT=(0,u.always)([WT,"relationType"]),qT=(0,u.always)([WT,"object"]),HT=(0,u.always)([WT,"direction"]),QT=(0,u.always)([WT,"object","attributes"]),KT=(0,u.always)(["entity","entityUri"]),JT=(0,u.always)([WT,"startDate"]),XT=(0,u.always)([WT,"endDate"]),zT=(0,u.path)(["startObject","objectURI"]),ZT=(0,u.path)(["endObject","objectURI"]),eE=(0,u.path)(["startObject","objectTypeURI"]),tE=(0,u.path)(["endObject","objectTypeURI"]),rE=(e,t)=>{for(const r of e){if((0,u.pipe)((0,u.path)(YT()),(0,u.equals)(t))(r))return r;if(r.connections){const e=rE(r.connections,t);if(e)return e}}},nE=(0,u.pipe)(rE,(0,u.path)(qT())),iE=(0,u.allPass)([(0,u.pipe)((0,u.path)(KT()),(0,u.complement)(m)),(0,u.pipe)((0,u.path)(BT()),(0,u.complement)(m))]),aE=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:ht()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:l,outRelations:c}=lE({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=oE(l,c);return(0,u.pipe)((0,u.evolve)({relation:p?VT(p):u.identity}),(0,u.defaultTo)({}),(0,u.when)((0,u.always)(i),(0,u.assoc)("parentEntityUri",i)))(a)},oE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:Zr.IN}:{type:t[0],direction:Zr.OUT}:null},sE=e=>e.uri||e,lE=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&vi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Zr.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,u.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},l=e=>(0,u.pipe)((0,u.assocPath)(["startObject","objectType"],Ur(a,e.startObject.objectTypeURI)),(0,u.assocPath)(["endObject","objectType"],Ur(a,e.endObject.objectTypeURI)))(e),c=(0,u.pipe)(sE,ui(a));return(0,u.evolve)({inRelations:(0,u.pipe)((0,u.map)(c),(0,u.filter)(s(Zr.IN)),(0,u.map)(l)),outRelations:(0,u.pipe)((0,u.map)(c),(0,u.filter)(s(Zr.OUT)),(0,u.map)(l))},t)||{}},uE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=fi({reversedContextLabels:!0}),a=(0,u.curry)(((e,t,r,n)=>{const[i,a]=pi(e,n.uri);return n&&(!t||Lr(e,i,t))&&(!r||Lr(e,a,r))})),o=t=>(0,u.pipe)((0,u.assocPath)(["startObject","objectType"],Ur(e,t.startObject.objectTypeURI)),(0,u.assocPath)(["endObject","objectType"],Ur(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,u.both)(Yo,r));return{inRelations:(0,u.pipe)((0,u.filter)(a(e,null,t)),(0,u.filter)(n),(0,u.map)(o))(s),outRelations:(0,u.pipe)((0,u.filter)(a(e,t,null)),(0,u.filter)(i),(0,u.map)(o))(s)}},cE=(0,u.curry)(((e,t,r,n,i)=>{const a=Lr(n,u.__,t.type),o=e?tE:eE,s=Lr(n,u.__,r.type),l=e?eE:tE;return(0,u.both)((0,u.pipe)(o,a),(0,u.pipe)(l,s))(i)})),pE=(e,t,r)=>{const n=e?tE:eE,i=(0,u.pipe)((0,u.map)(n),u.uniq)(r);return(0,u.pipe)((0,u.filter)((e=>{let{uri:r}=e;return i.some(Lr(t,u.__,r))})),(0,u.reject)((0,u.prop)("abstract")),(0,u.map)((0,u.prop)("uri")))(t.entityTypes||[])};function dE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yE(e,t,r[t])}))}return e}function yE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return dE({},t,{[r]:{parents:n,children:i}})},TE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return dE({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},EE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t[e],a=$f(t,i),o=fE({hierarchy:n,uri:e,children:a.map((0,u.prop)("uri")),parents:r});return a.reduce(((r,n)=>EE(n.uri,t,[e],r)),o)},mE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,u.path)(YT(),n),a=t?TE({hierarchy:e,uri:t,children:[i]}):e,o=(0,u.path)(KT(),n),s=Et(o)?[o]:[],l=fE({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>EE(t,r,[i],e)),l)}),n)},hE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return mE(r,e,t,EE(e,t))},bE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return hE(t,r,n);if(Ot(e)){const t=rE(n,e);return t&&mE([t],null,r)}return r[e]?EE(e,r):void 0},OE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>OE(e,t))))},vE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>vE(e,t))))},gE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=bt(t),l=hE(r,n,i),c=((e,t,r)=>{let{entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[];let s;for(let e=0;e<t.length;e++){const l=t[e],c=t[e+1]||r;if(Ot(c)){if(s=rE(i,c),!s)return null;o.push({type:ge.relationConnection,value:s,valueType:ui(a,(0,u.path)(BT(),s))});continue}if(Ot(l)){const e=n[c];if(!e)return null;o.push({type:ge.tempEntity,value:e,valueType:Ur(a,e.type)});continue}const p=n[l],d=Ls(p,c),y=n[c];if(!d||!y)return null;o.push({type:ge.attributeValue,value:d,valueType:ir(a,It(d.uri,p.type))}),o.push({type:ge.tempEntity,value:y,valueType:Ur(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},vE(l,s).reverse(),s);if(!c)return null;o.push(...c);const p=Ot(s),d=p?nE(i,s):n[s],[y,f]=t!==s?(e=>{const t=e.split("/attributes/").slice(1).join("/attributes/");if(!t)return[];const[r,n]=t.split("/").reduce(((e,t,r)=>(e[r%2==0?0:1].push(t),e)),[[],[]]);return r.length!==n.length?[]:[r,n]})(t):[[],[]];if(!d||!y||!f)return null;let T,E=p?ui(a,d.type):Ur(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:ar(a,E);if(E=null==t?void 0:t.find((0,u.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:ge.tempEntity,value:T,valueType:Ur(a,T.type)}),o.push({type:ge.attributeValue,value:s,valueType:E}),m=s.value;const l=Ts(s);T=l&&Et(l)?n[l]:null}}return o},_E=e=>e.every((e=>{let{type:t}=e;return[ge.attributeValue,ge.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ge.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,AE=e=>{let t=[];var r;return e&&(t.push({uri:e.uri,crosswalks:e.crosswalks,merges:e.merges}),null===(r=e.merges)||void 0===r||r.forEach((e=>{e.losers.forEach((e=>{t=t.concat(AE(e))}))}))),t},NE=(e,t)=>(0,u.find)((e=>(0,u.find)((0,u.eqBy)(wE,t),(0,u.propOr)([],"crosswalks",e))),e),PE=(e,t)=>{let r=e.crosswalks||[];var n;return t||null===(n=e.merges)||void 0===n||n.forEach((e=>{var t;null===(t=e.losers)||void 0===t||t.forEach((e=>{r=r.concat(PE(e))}))})),r},RE=e=>{let t=0;var r;return e?(null===(r=e.merges)||void 0===r||r.forEach((e=>{var r;null===(r=e.losers)||void 0===r||r.forEach((e=>{const r=RE(e);r>t&&(t=r)}))})),t+1):t},SE=(e,t)=>{if(Et(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},wE=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},IE=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},UE=e=>{let{deleteDate:t}=e;return!!t&&T().utc(t).valueOf()<Date.now()},CE=(e,t)=>{const r=t.reduce(((e,t)=>(e["configuration/sources/"+t.name]=t,e)),{}),n=t.reduce(((e,t)=>(e[t.id]=t,e)),{});return(0,u.pipe)((0,u.map)((e=>{var t,i;if(r[e.type])return r[e.type];const a=null===(t=e.crosswalkExternalInfo)||void 0===t||null===(i=t.dtssInfo)||void 0===i?void 0:i.tenantId;return a&&n[a]?n[a]:void 0})),(0,u.reject)(u.isNil),u.uniq,(0,u.ifElse)((e=>{let{length:t}=e;return 1===t}),u.head,(()=>{})))(e)},LE=(0,u.eqBy)(wE),DE=(0,u.pipe)((0,u.propOr)({},"attributes"),u.values,u.flatten,(0,u.filter)((0,u.has)("refRelation")),(0,u.chain)((e=>(0,u.pipe)(us,(0,u.propOr)([],"crosswalks"),(0,u.map)((0,u.when)((0,u.pipe)((0,u.prop)("attributeURIs"),m),(0,u.assoc)("attributeURIs",[e.uri]))))(e))));function jE(e){return e&&void 0!==e.uri}function kE(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function FE(e,t){function r(r){if(e[r]&&t[r])if(Array.isArray(e[r])&&Array.isArray(t[r])){if(e[r].length!==t[r].length)return!1;if(e[r][0]&&t[r][0]&&e[r][0].objectURI!==t[r][0].objectURI)return!1}else if(e[r].objectURI!==t[r].objectURI)return!1;return!0}return r("refEntity")&&r("refRelation")}function ME(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var l=e[s];if(void 0===t[s])for(var c in l)l.hasOwnProperty(c)&&o.push.apply(o,m(l[c]));else for(var p in l)if(l.hasOwnProperty(p)){var d=l[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,u.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(ME(d.value,y.value,r)):"Reference"===g(d)?FE(d,y)?o.push.apply(o,ME(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,u.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ce(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ce(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function xE(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||jE(r)&&jE(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function $E(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,u.isNil)(t)?"":t+""),r}}function VE(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=GE(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?WE(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=GE(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const GE=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),WE=(e,t,r)=>(0,u.pipe)(Ds,(0,u.defaultTo)([]),(0,u.reject)((0,u.propEq)("uri",r)),(0,u.ifElse)((0,u.allPass)([e=>1===e.length,e=>{let[r]=e;return SE(t,r)},e=>{let[t]=e;return!as(t)}]),(0,u.prop)(0),(0,u.always)(null)))(e,r);function YE(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function BE(e,t){return kE("UPDATE_TAGS").call(this,e,t)}function qE(e,t){return kE("UPDATE_ROLES").call(this,e,t)}function HE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){QE(e,t,r[t])}))}return e}function QE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var KE=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ce(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ce(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ce(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ce(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,u.difference)(t,e),n=(0,u.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,u.pipe)((0,u.map)((t=>[t,e])),u.fromPairs)(t),o=HE({},a("INSERT_ATTRIBUTE",r),a("DELETE_ATTRIBUTE",n));return[i,o]};return{computeHistoryDiff:a,computeEntityHistoryDiff:(e,t)=>{const{attributes:r,appearance:n}=e?a(e.attributes,t.attributes):{attributes:t.attributes,appearance:{}},[i,s]=o(e?e.roles:[],t.roles),[l,u]=o(e?e.tags:[],t.tags);return{attributes:r,appearance:HE({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const JE=(0,u.pipe)(u.values,u.flatten,(0,u.reduce)(((e,t)=>{const r=[t.uri,...(0,u.is)(Object,t.value)?JE(t.value):[]];return e.concat(r)}),[])),XE=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,zE=e=>e?[_d(e)]:[],ZE=e=>{const t=[...JE((null==e?void 0:e.attributes)||[]),...JE((null==e?void 0:e.analyticsAttributes)||[])];return e?[...zE(e),...t]:[]},em=(e,t)=>[e,...t.map((t=>XE(e,t)))],tm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return xT(t)}))},rm=(e,t)=>{switch(e){case _e.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case _e.ENTITY_ATTRIBUTE:case _e.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Ut(t)]})(t);case _e.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case _e.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,_d({uri:n,dataTenant:i}),r]})(t)}},nm=e=>(0,u.pipe)(u.values,(0,u.map)((0,u.map)((0,u.pipe)((0,u.prop)("replies"),u.inc))),(0,u.map)(u.sum),u.sum)(e),im=(0,u.curry)(((e,t)=>{const r=fo(e,t),n=(0,u.pipe)((0,u.prop)("memberTypes"),(0,u.chain)((0,u.prop)("name")))(r);return r.extendsTypeURI?n.concat(im(e,r.extendsTypeURI)):n})),am=(0,u.curry)(((e,t)=>(0,u.reduce)(((t,r)=>(0,u.assoc)(r,((e,t)=>(0,u.path)(["members",t],e))(e,r),t)),{},t))),om=(e,t)=>(0,u.pipe)((0,u.prop)("type"),im(e),am(t))(t);function sm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lm=e=>{let{type:t,attributeType:r,attributeTypeUri:n,parentUri:i,uri:a,message:o,source:s}=e;return{type:t,uri:a,attributeTypeUri:n,attributeType:r,parentUri:i,message:o,source:s}},um=e=>!e.deactivated,cm=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},pm=e=>cm(e)+e.message,dm=(0,u.unless)(u.isNil,(0,u.prop)("message")),ym=(0,u.unless)(u.isNil,(0,u.prop)("type")),fm=(0,u.curry)(((e,t)=>At(t.parentUri,e))),Tm=(0,u.curry)(((e,t)=>t.parentUri===e)),Em=(0,u.curry)(((e,t)=>(0,u.cond)([[(0,u.pipe)((0,u.prop)("uri"),At(t.attributeTypeUri)),u.T],[(0,u.both)((0,u.propEq)("type",ze.TYPE_REFERENCE),(0,u.pipe)(nt,(0,u.any)(At(t.attributeTypeUri)))),u.T],[u.T,u.F]])(e))),mm=(0,u.curry)(((e,t)=>t.attributeTypeUri===e)),hm=(0,u.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),bm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,u.filter)((0,u.allPass)([Rm,um,fm(e),Em(t),(0,u.complement)(hm(e,t.uri))]))(r)},Om=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,u.find)((0,u.allPass)([Rm,um,Tm(e),mm(t.uri),(0,u.complement)((0,u.prop)("uri")),(0,u.complement)((0,u.propEq)("type",he.missed))]))(r);return n&&n.message||""},vm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,u.find)((0,u.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===he.missed))},gm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.find)((0,u.allPass)([um,(0,u.propEq)("type",he.missedRefEntity),(0,u.propEq)("parentUri",(0,u.path)(YT(),e))]))(t)},_m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.find)((0,u.allPass)([um,(0,u.propEq)("type",he.missedRefEntity),(0,u.propEq)("parentUri",e.uri)]))(t)},Am=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.any)((0,u.allPass)([um,fm(t)]))(r)},Nm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.find)((0,u.allPass)([um,(0,u.propEq)("type",he.missedRefEntity),(0,u.propEq)("parentUri",(0,u.path)(["relation","uri"],e))]))(t)},Pm=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?gE(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case ge.attributeValue:{const e=a;if(Qt(a))return nd(o,e.dataLabelPattern);if(Kt(a)){const t=o,i=Ts(t),a=tt(e),s=Ur(n,a);return Et(i)?nd(r[i],s.dataLabelPattern):t.label}return""}case ge.tempEntity:return nd(o,a.dataLabelPattern);case ge.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Ur(n,null==e?void 0:e.entityType);return`${ad(i&&Et(i)?nd(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||ci(n,null==t?void 0:t.relationType)}`}}})({entitiesMap:r,metadata:n},e);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sm(e,t,r[t])}))}return e}({},e,{label:ad(t)})}))},Rm=e=>!e.severity||e.severity===Oe.ERROR,Sm=(0,u.curry)(((e,t)=>{let r=t.value;switch(e.type){case ze.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,u.propEq)("name",t));return r[t].some(Sm(n))}));case ze.TYPE_REFERENCE:return!!ls(t);case ze.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),wm=(e,t)=>e.every((0,u.complement)(Sm(t))),Im=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;const n=ho(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=Os(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!as(e.parent))))).forEach((e=>{wm(e.attrValues,n)&&r.push(lm({type:he.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:tn().text("Attribute is required"),source:be.local}))})),r}),[])},Um=(0,u.curry)(((e,t,r)=>Os(e,t,r,!1))),Cm=(e,t)=>{const r=(0,u.pipe)((0,u.prop)("type"),Ur(e),(0,u.prop)("attributes"),(0,u.defaultTo)([]),(0,u.reject)(qt),(0,u.filter)(Kt),(0,u.map)((0,u.prop)("uri")),(0,u.chain)(Um(e,t)));return(0,u.pipe)(r,(0,u.reject)(Ts),(0,u.map)((e=>{let{uri:r}=e;return lm({type:he.missedRefEntity,uri:"",attributeTypeUri:It(r,t.type),parentUri:r,message:tn().text("Entity is required"),source:be.local})})))(t)},Lm=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,u.has)("refEntity")).filter((0,u.pipe)(Ts,Et)).flatMap((n=>{const i=Ts(n),a=t[i],o=ir(e,It(n.uri,r.type));return Dm(e,t,o,a)})),Dm=(e,t,r,n)=>{const i=nt(r),a=i.map((t=>ir(e,t))).filter((0,u.both)(u.identity,(0,u.propEq)("type",ze.TYPE_REFERENCE))).flatMap(at).concat(i);return jm(e,t,n,(e=>a.some(At(e.uri))))},jm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.identity;const i=Im(e,r,n),a=Cm(e,r),o=Lm(e,t,r);return[...i,...a,...o]},km=(e,t)=>{const r=(0,u.path)(qT(),t)||{};return Im(e,r)},Fm=(e,t,r)=>{t=t||{};const n=(0,u.pipe)((0,u.path)(KT()),(0,u.ifElse)(Et,(e=>t[e]),(0,u.always)(null)))(r),i=km(e,r),a=(e=>(0,u.path)(KT(),e)?[]:[lm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,u.path)(BT(),e),parentUri:(0,u.path)(YT(),e),message:tn().text("Entity is required"),source:be.local})])(r),o=((e,t,r)=>r?jm(e,t,r):[])(e,t,n);return[...i,...a,...o]},Mm=e=>(0,u.path)(["entity","uri"],e)?[]:[lm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,u.path)(["relation","type"],e),parentUri:(0,u.path)(["relation","uri"],e),message:tn().text("Entity is required"),source:be.local})],xm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Im(e,r),i=Mm(t);return[...n,...i]};function $m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vm=(e,t)=>{var r,n;const i=Ur(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Wa(e)},Gm=e=>(0,u.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Wm=e=>{const t=r=>(0,u.ifElse)(Array.isArray,(0,u.map)(t),(0,u.pipe)(Gm(e),(0,u.evolve)({value:(0,u.when)((0,u.is)(Object),(0,u.map)(t))})))(r);return t},Ym=(e,t)=>(0,u.when)((0,u.prop)("refEntity"),(0,u.pipe)((0,u.when)((0,u.allPass)([(0,u.prop)("refRelation"),(0,u.always)("INSERT_ATTRIBUTE"===t),(0,u.pipe)(Es,Et,u.not)]),(e=>{const t=(0,u.pipe)(Es,Pt)(e);return Wm((e=>e.replace(t,t+pt)))(e)})),(0,u.when)((0,u.pipe)(Ts,Et),(t=>{const r=Ts(t),n=e[r],i=n&&qm(n,e);return null!=i&&i.attributes?(0,u.evolve)({value:e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$m(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Bm=(e,t,r)=>VE(ME((0,u.clone)(e.attributes),(0,u.clone)(t.attributes),!0),YE((0,u.clone)(t.attributes),(0,u.clone)(t.crosswalks)),e).map((e=>(0,u.evolve)({newValue:(0,u.when)(Array.isArray,(0,u.pipe)((0,u.filter)((e=>!e.refRelation||e.refEntity)),(0,u.map)(Ym(r,e.type)),(0,u.map)(Wm(kt))))})(e))).concat(eT(e,t)),qm=(e,t)=>(0,u.evolve)({attributes:Tl({valueTransformer:(0,u.pipe)(bs,Ym(t),Gm(kt)),deleteEmptyComplex:!0}),uri:kt})(e);function Hm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qm(e,t,r[t])}))}return e}function Qm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Km=(0,u.unless)(u.isNil,(e=>e.replace(new RegExp(ct,"g"),"uri$$$$").replace(new RegExp(pt,"g"),""))),Jm=e=>(0,u.pipe)((0,u.evolve)({objectUri:Km,objectParentUri:Km}),(e=>{return Hm({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?he.missed:he.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&jt(e.objectUri),uri:e.objectUri,source:be.validationService},(0,u.pick)(["message","severity"],e));var t}))(e),Xm=(e,t)=>(0,u.map)((0,u.pipe)(Jm,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:l}=e,c=Pm(t,s),p=null!=c&&c.length?c.slice(0,-1):Pm(t,l),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&ir(e,i);if(!a&&n&&t&&t.length){const e=(0,u.last)(t);e.type===ge.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Hm({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,u.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,u.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||l,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&Dt(i)){const n=(0,u.last)(a),i=n.valueType;if(Kt(i)&&ot(i).includes(o)){const i=Ts(n.value),o=i&&Et(i)?t[i]:null;return o?Hm({},e,{parentUri:o.uri,path:a.concat({type:ge.tempEntity,value:o,valueType:Ur(r,o.type),label:""})}):e}}return e}})(t)))(e),zm=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var Zm,eh=r(33164);function th(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(Zm||(Zm={}));const rh={},nh={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},ih=(0,u.curry)(((e,t)=>{const r=(e=>{if(!rh[e]){const t=nh[e]||nh.random0;rh[e]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){th(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return rh[e]})(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),ah=e=>ih(Zm.Charts,e),oh=e=>ih(Zm.Random1,e),sh=e=>(0,eh.getColor)(e)?"#FFFFFF":"#212121";var lh=r(51404),uh=r.n(lh);const ch=Array.from({length:100},((e,t)=>t/100)),ph=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},dh={},yh=new(uh())({hash:ph,saturation:ch.slice(15,71),lightness:ch.slice(50,90)}),fh=new(uh())({hash:ph,saturation:ch.slice(46,89),lightness:ch.slice(44,58)}),Th=(0,u.curry)(((e,t,r)=>{t in dh||(dh[t]={});const n=dh[t];r in n||(n[r]=((e,t)=>{const r=String(ph(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Eh=Th(yh,"crosswalks"),mh=Th(yh,"sources"),hh=Th(yh,"contributors"),bh=Th(yh,"dataValidationFunctions"),Oh=Th(fh,"entities");function vh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gh(e,t,r[t])}))}return e}function gh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _h=(0,u.has)("items"),Ah=e=>0===e,Nh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.min(Math.max(e,t),r)},Ph=e=>e.reduce(((e,t)=>e+t.width),0),Rh=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Sh=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),wh=e=>e.reduce(((e,t)=>e+t.height),0),Ih=e=>(0,u.is)(String,e)&&e.includes("%"),Uh=e=>Boolean(e.spacer),Ch=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),Lh=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(_h(t)?Lh(t):t)),[]),Dh=e=>({id:e.layout}),jh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Dh;const i=(e,t,r,n)=>{let{width:i}=e;const a=t.items.some((e=>e.flex));let o;if(a){const[e,n]=(0,u.partition)((0,u.propIs)(Number,"flex"),t.items),a=(0,u.pipe)((0,u.map)((0,u.pipe)((0,u.prop)("flex"),parseInt)),u.sum)(e),s=Math.round(i-i*(a/(a+n.length))),l=Math.max(s/Math.max((0,u.length)(n),1),1),c=(e,t,r)=>Math.max(Math.floor(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):l}else{const[e,n]=(0,u.partition)((0,u.both)((0,u.propIs)(String,"width"),(0,u.pipe)((0,u.propOr)("","width"),(0,u.includes)("%"))),t.items),a=(0,u.pipe)((0,u.map)((0,u.pipe)((0,u.prop)("width"),parseInt)),u.sum)(e),s=Math.round(i-i*(a/100)),l=Math.max(s/Math.max((0,u.length)(n),1),1);o=Ih(r.width)?Ch(i,r.width):l}return Nh(o,(0,u.prop)("minWidth",n),(0,u.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Nh(n,t,r)},o=(e,t)=>_h(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.reduce(((o,s,l)=>{const c=i(t,r,s,_h(s)?n(s.layout):e(s.view)),d=Ah(l)?t.x:(0,u.last)(o).x+(0,u.propOr)(c,"width",(0,u.last)(o));if(_h(s))return o.concat(p(vh({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(vh({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:Ph(o),height:Rh(o),items:o}},l=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=_h(i)?n(i.layout):e(i.view),l=t.width,c=a(s),d=Ah(o)?t.y:(0,u.last)(r).y+((0,u.last)(r).height||c);if(_h(i))return r.concat(p(vh({},t,{y:d,width:l}),i));{const n=e(i.view);return r.push(vh({},n,{y:d,x:t.x,height:c,width:l,minWidth:(0,u.is)(Number,n.minWidth)?Nh(n.minWidth,n.minWidth,l):void 0,maxWidth:(0,u.is)(Number,n.maxWidth)?Nh(n.maxWidth,n.maxWidth,l):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Sh(i),height:wh(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,l=a(o),c=Ah(i)?t.y:(0,u.last)(r).y+((0,u.last)(r).height||l);return vh({},o,{x:t.x,y:c,width:s,height:l})},i=(e,t)=>{const r=t.reduce(((t,r,i)=>{if("string"==typeof r)t.push(n(e,t,r,i));else if("object"==typeof r){const a=Math.round(e.width/2),o=vh({},e,{width:a}),s=vh({},e,{x:e.x+a,width:a}),l=(0,u.has)("left",r)&&n(o,t,r.left,i),c=(0,u.has)("right",r)&&n(s,t,r.right,i),p=(0,u.propOr)(0,"height"),d=Math.max(p(l),p(c));t.push(vh({},e,{height:d,items:(0,u.filter)(u.identity,[l,c])}))}return t}),[]);return vh({},e,{height:wh(r),items:r})},o=i(t,(0,u.propOr)([],"top",r)),s=Math.round(.66*t.width),l=(0,u.isEmpty)(o)?t.y:t.y+o.height,c=i(vh({},t,{y:l,width:s}),(0,u.propOr)([],"center",r)),p=i({x:t.x+s,y:l,width:t.width-s},(0,u.propOr)([],"right",r)),d=o.height+Math.max(c.height,p.height),y=(0,u.pipe)((0,u.prop)("items"),u.length,(0,u.equals)(0));return vh({},t,{height:d,items:(0,u.reject)(y,[o,c,p])})},p=(e,t)=>{const r=vh({},t,{items:(0,u.reject)(Uh,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return l(e,r);default:return null}},d=(0,u.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return Lh(f)},kh=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Fh=[We.FilteredEntitiesViewFacet,We.ActivitiesViewFacet,We.ProfileStatsFacet,We.FilteredSavedSearchesFacet],Mh=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=Fh.includes(a.component)?8:4;return vh({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function xh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$h(e,t,r[t])}))}return e}function $h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vh={BarChart:Ge.BAR,BarChartGrouped:Ge.BAR,BarChartHorizontal:Ge.BAR,LineChart:Ge.LINE,Map:Ge.MAP,Pie:Ge.PIE},Gh=(e,t)=>Ct(e)?St(e,t):e,Wh=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Vh[r];return xh({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Yh=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return xh({findPublic:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["findShared"]))},Bh=(e,t,r)=>{const n=(e=>e&&ie(e).map((e=>{const{type:t,value:r}=e;return xh({},e,{value:[Gr,Wr,xr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Br(t),fieldName:r,values:n?ie(n):void 0}})))(e);return t&&Ct(t)||!r?n:(n||[]).concat((i=r,{filter:xr.EQUALS,fieldName:"type",values:[i]}));var i},qh=["https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/world.countries.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/usa_prefix_latlng.topo.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/us-10m.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/zips-us-topo.json"],Hh={"com.reltio.plugins.dashboard.BarChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:Gh(n,r),filters:Bh(a,n,r),chartType:Ge.BAR,component:We.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:Gh(n,r),filters:Bh(a,n,r),chartType:Ge.BUBBLE,component:We.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:We.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ie(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return xh({id:t,count:o,canRead:u,orderType:s,attributeUri:Gh(r,p),filters:Bh(a,r,p),component:We.DashboardFacet,title:i,showOthers:!0},Wh(l))},"com.reltio.plugins.dashboard.MapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,mapType:l,canRead:u}=e;return{id:t,count:o,canRead:u,orderType:s,attributeUri:Gh(n,r),filters:Bh(a,n,r),chartType:Ge.MAP,component:We.DashboardFacet,title:i,geoUrl:qh[l||0],projection:"geoMercator"}},"com.reltio.plugins.dashboard.SimpleMapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,map:s,canRead:l,options:u}=e;return xh({id:t,count:o,canRead:l,attributeUri:Gh(n,r),filters:Bh(a,n,r),component:We.DashboardFacet,title:i,geoUrl:s,chartType:Ge.MAP,projection:"geoMercator"},Wh(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:Yh(i),component:We.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:Bh(n,null,a),component:We.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:xr.GTE,fieldName:"matches",values:["1"]}],component:We.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:We.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ge.CLOUD,component:We.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ge.TREE,component:We.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.NotificationInboxFacet,title:n||tn().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.ActivitiesViewFacet,title:n||tn().text("Activity log")}}},Qh=e=>({id:e,height:10}),Kh=(0,u.pipe)((0,u.map)((e=>{const t=Hh[null==e?void 0:e.class];return t?t(e):null})),(0,u.reject)(u.isNil)),Jh=e=>{if("0.1"===e.version){const t=Kh(e.views),r=jh(Qh,e.layout,{columns:4});return{id:e.id,margin:0,layout:kh(r,t),views:t}}return e},Xh=e=>(0,u.cond)([[(0,u.propEq)("layout","profile"),(0,u.pipe)((0,u.pick)(["center","right","top"]),u.values,u.flatten,(0,u.map)((0,u.when)((0,u.is)(Object),u.values)),u.flatten)],[(0,u.has)("view"),(0,u.pipe)((0,u.prop)("view"),ie)],[(0,u.prop)("items"),(0,u.pipe)((0,u.prop)("items"),(0,u.map)((e=>Xh(e))),u.flatten)],[u.T,(0,u.always)([])]])(e);function zh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zh(e,t,r[t])}))}return e}function Zh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eb=zh({},Ye,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),tb=e=>e,rb={[eb.Attributes]:tb,[eb.HierarchyTree]:tb,[eb.HierarchyPaths]:tb,[eb.RelationsTable]:tb,[eb.Relations]:e=>zh({},(0,u.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[eb.SingleAttribute]:tb,[eb.Custom]:tb,[eb.AttributeTable]:tb,[eb.Map]:tb,[eb.OldTree]:e=>zh({},e,{class:Ye.HierarchyTree}),[eb.OldMap]:e=>zh({},e,{class:Ye.Map}),[eb.ImageAttribute]:tb,[eb.PotentialMatches]:tb},nb=(0,u.pipe)((0,u.map)((e=>{const t=rb[null==e?void 0:e.class];return t?t(e):null})),(0,u.reject)(u.isNil)),ib=(0,u.curry)(((e,t)=>(0,u.pipe)((0,u.defaultTo)([]),(0,u.find)((0,u.propEq)("id",t)),(0,u.prop)("class"))(e)===Ye.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),ab=e=>{const t=(0,u.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return zh({},t,{layout:e.newLayout});if("0.1"===e.version){const r=nb(e.views),n=jh(ib(r),e.layout,{columns:4});return zh({},t,{layout:kh(n,r),views:r})}return e},ob=(e,t)=>e.class===t||e["react-class"]===t,sb=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(ob(t,Ye.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,u.intersection)(e.excludeUris,r):r}return ob(t,Ye.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(At(n))||t.some(At(n))}},lb=(e,t)=>e.filter((e=>t.some((t=>ob(e,t))))).map((e=>{let{id:t}=e;return t})),ub=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},cb=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),pb=(e,t)=>(e||[]).find((e=>e.activator===t)),db=e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.entity.ProfileBand"))),(0,u.reject)(u.isNil),u.head)(e);function yb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fb(e,t,r[t])}))}return e}function fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tb=(e,t)=>Xh(t).map((t=>(0,u.pipe)((0,u.map)((e=>ub(e,t))),(0,u.reject)(u.isNil),u.head)(e))),Eb=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},mb=(e,t)=>{const r=(0,u.propOr)("0.1","version",t),n=t["entity-type"];if("2.0"===r&&t.newLayout){const{newLayout:e}=t,r=((e,t)=>(t||[]).map((t=>yb({},t,ib(e,t.id)))))(t.views,e);return(0,u.pipe)((0,u.pick)(["views","sidePanelViews","profileBand"]),(0,u.mergeRight)({entityType:n,layout:r}),(0,u.reject)(u.isNil))(t)}const i=Tb(e,t.layout),a=((e,t)=>{if(t.side){const r=(0,u.pipe)((0,u.chain)((e=>ub(e,t.side))),(0,u.reject)(u.isNil),u.head)(e);return Xh(r.layout||{})}})(e,t),o=ab(yb({},t,{views:i,version:"0.1"})),s=(0,u.pipe)(db,(0,u.defaultTo)({}),(0,u.pick)(["cloneAction","showEntityId"]))(e);return(0,u.reject)(u.isNil,{entityType:n,views:o.views,layout:o.layout,sidePanelViews:a,profileBand:s})},hb=(e,t)=>{if("scroll"===t.layout.layout){const r=Tb(e,t.layout),n=Jh(yb({},t,{views:r,version:"0.1"}));return{class:qe.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:qe.Dashboard,views:t.views,layout:t.layout,id:t.id}},bb=(e,t)=>{const r=Tb(e,t.layout)[0];return{class:qe.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},Ob=(e,t)=>{const r=Tb(e,t.layout)[0];return{class:qe.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},vb=(e,t)=>{const r=Tb(e,t.layout)[0];return{class:qe.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},gb=(e,t)=>{const r=Tb(e,t.layout)[0];return{class:qe.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},_b=(e,t)=>{const r=Tb(e,t.layout)[0];return{class:qe.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},Ab=(e,t)=>{const r=Tb(e,t.layout)[0];return{class:qe.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},Nb=(e,t)=>{const r=Tb(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=cb(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:qe.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},Pb=(e,t)=>({class:qe.Graph,id:t.id}),Rb=(e,t)=>{const r=Tb(e,t.layout)[0];return{class:qe.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},Sb=e=>t=>!!(0,u.intersection)(e,t).length,wb=(0,u.cond)([[Sb(["com.reltio.plugins.dashboard.BarChartView","com.reltio.plugins.dashboard.BubbleChartView","com.reltio.plugins.ui.CustomActionView","com.reltio.plugins.dashboard.FacetChartView","com.reltio.plugins.dashboard.MapView","com.reltio.plugins.dashboard.SimpleMapView","com.reltio.plugins.dashboard.ProfileStatsView","com.reltio.plugins.dashboard.FilteredSavedSearchesView","com.reltio.plugins.dashboard.FilteredEntitiesView","com.reltio.plugins.dashboard.EntitiesByTypeView","com.reltio.plugins.dashboard.EntitiesByTagView","com.reltio.plugins.dashboard.EntitiesByRoleView","com.reltio.plugins.inbox.NotificationInboxView","com.reltio.plugins.activities.ActivitiesView","com.reltio.plugins.react.ReactDashboardView"]),()=>hb],[Sb(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>bb],[Sb(["com.reltio.plugins.graph.GraphView"]),()=>Pb],[Sb(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>Ob],[Sb(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>vb],[Sb(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>gb],[Sb(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>_b],[Sb(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>Ab],[Sb(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>Nb],[Sb(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Rb],[u.T,()=>(0,u.always)(void 0)]]),Ib=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,u.pipe)((0,u.chain)(Eb),(0,u.map)((t=>mb(e,t))),(0,u.indexBy)((0,u.prop)("entityType")),(0,u.map)((0,u.pick)(["layout","views","sidePanelViews","profileBand"])))(e);return{class:qe.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:He.CustomAction,config:(0,u.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:He.ConsoleAppAction,config:(0,u.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,u.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,u.find)((0,u.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,u.pipe)((e=>ub(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,u.pick)(["id","views","layout"]),(0,u.assoc)("class",qe.Dashboard))(e)}const i=(0,u.pipe)((0,u.map)((e=>ub(e,n))),(0,u.reject)(u.isNil),u.head)(t);if((0,u.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=mb(e,r),i=(0,u.pipe)((0,u.propOr)([],"entity-types"),(0,u.map)((e=>[e,n])),u.fromPairs)(t);return{class:qe.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=Xh(i.layout),o=(0,u.pipe)((0,u.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,u.pluck)("class"),(0,u.reject)(u.isNil))(t);return wb(o)(t,i)};function Ub(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cb(e,t,r[t])}))}return e}function Cb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lb=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},Db="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var jb;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(jb||(jb={}));const kb={[qe.DQDashboard]:`${Db}DqDashboard.svg`,[qe.Dashboard]:`${Db}Dashboard.svg`,[qe.Graph]:`${Db}Graph.svg`,[qe.RelationshipSearch]:`${Db}GraphSearch.svg`,[qe.Interactions]:`${Db}Interactions.svg`,[qe.PotentialMatches]:`${Db}PotentialMatches.svg`,[qe.Profile]:`${Db}Profile.svg`,[qe.NestedProfile]:`${Db}Profile.svg`,[qe.ProfileActivityLog]:`${Db}ActivityLog.svg`,[qe.Relationships]:`${Db}Relationships.svg`,[qe.Sources]:`${Db}Crosswalk.svg`,[qe.Search]:`${Db}Search.svg`,[jb.DashboardGroup]:`${Db}DashboardGroup.svg`,[jb.ProfileGroup]:`${Db}ProfileGroup.svg`,[jb.SearchGroup]:`${Db}SearchGroup.svg`,DEFAULT:`${Db}Default.svg`},Fb=e=>kb[null==e?void 0:e.class]||kb.DEFAULT,Mb=(0,u.pipe)((0,u.pluck)("screen"),(0,u.filter)((0,u.anyPass)([(0,u.propEq)("class",qe.NestedProfile)])),(0,u.groupBy)((0,u.prop)("class")),(0,u.map)((e=>e.map(((e,t)=>Ub({},e,{nestedRoute:`${t+1}`})))))),xb=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,u.propEq)("id",t.id)))||t},$b=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?kb[jb.ProfileGroup]:null,Vb=e=>(0,u.cond)([[(0,u.any)((e=>{let{icon:t}=e;return t===kb[qe.Dashboard]||t===kb[qe.DQDashboard]})),(0,u.always)(kb[jb.DashboardGroup])],[(0,u.any)((e=>{let{icon:t}=e;return t===kb[qe.Search]||t===kb[qe.RelationshipSearch]})),(0,u.always)(kb[jb.SearchGroup])],[u.T,()=>null]])(e),Gb=e=>(0,u.pipe)((0,u.chain)(Lb),(0,u.sortBy)((0,u.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,u.pipe)((0,u.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,u.sortBy)((0,u.propOr)(1/0,"position")),(0,u.map)((e=>Ub({},e,{entityTypes:e["entity-types"],screen:Ib(e,t)}))),(0,u.filter)((e=>e.screen)))(t),n=Mb(r);return(0,u.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:Fb(r),screen:xb(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=Ib(t,e);return{label:t.label,icon:$b(t)||Vb(r)||Fb(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function Wb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yb=e=>{let{extensions:t}=e;return(t||[]).filter((0,u.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Bb=e=>({id:e,height:10}),qb=e=>{const t=(e=>(0,u.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["attribute-types"]))}))(e))(e),r=(e=>(0,u.pipe)((0,u.chain)(Yb),(0,u.pluck)("pivotingAttributes"),u.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,u.propEq)("attribute-types","*")))(t);return(0,u.pipe)((0,u.reduce)(((e,n)=>{const i=((e,t)=>e.find((e=>Array.isArray(e["attribute-types"])&&e["attribute-types"].includes(t.uri))))(t,n)||r;return null!=i&&i.id&&(e[i.id]||(e[i.id]={extension:i,attributeTypes:[]}),e[i.id].attributeTypes.push(n)),e}),{}),u.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=Kh(((e,t)=>{const r=Xh(t);return(0,u.pipe)((0,u.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,u.filter)((e=>{let{views:t}=e;return t})),(0,u.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wb(e,t,r[t])}))}return e}({id:r},t[0])})),(0,u.uniqBy)((0,u.prop)("id")))(e)})(e,t.layout)),n=jh(Bb,t.layout,{columns:4});return{views:r,layout:kh(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qb=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Kb=e=>(0,u.pipe)((e=>cb(e,"com.reltio.plugins.ui.custom_script")),(0,u.reject)(m),(0,u.map)((e=>{let{action:t}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hb(e,t,r[t])}))}return e}({},t,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["action"]))})))(e),Jb=(0,u.prop)("showLookupCode"),Xb=e=>{var t;const r=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,u.reject)(u.isNil),u.head,(0,u.omit)(["point","id"]))(e))(e),i=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,u.reject)(u.isNil),u.head,(0,u.defaultTo)({}),(0,u.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("levels"))(e))(e),o=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.entity.Validation"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("validateReadMode"))(e))(e),s=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("configuration"))(e))(e),l=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("configuration"),(0,u.defaultTo)({}),(0,u.filter)((0,u.propEq)("format","none")),(0,u.map)((0,u.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.workflow.configuration"))),(0,u.reject)(u.isNil),u.head,(0,u.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,u.pipe)((e=>pb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("default-perspective"),(0,u.ifElse)(Qb,(0,u.always)("dashboard"),(0,u.always)("search")))(e))(e),d=Kb(e),y=(e=>(0,u.pipe)((e=>pb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("checkUser"))(e))(e),f=(e=>(0,u.pipe)((e=>pb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("checkIdle"))(e))(e),T=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,u.reject)(u.isNil),u.head,(0,u.prop)("preferNewUI"),u.not)(e))(e),E=(e=>(0,u.pipe)((0,u.map)((e=>ub(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,u.reject)(u.isNil),u.head,(0,u.defaultTo)({}))(e))(e),m=void 0===(h=Jb(E))||h;var h;const b=null===(t=db(e))||void 0===t?void 0:t.showEntityId,O=(e=>(0,u.pipe)((e=>pb(e,"com.reltio.plugins.ui.Activator")),(0,u.prop)("preview"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:m},validate:{levels:a,validateReadMode:o},attributePresentations:l,workflow:c,defaultRoute:p,customScripts:d,checkUser:y,checkIdle:f,showSwitchToClassic:T,showEntityId:b,preview:O}},zb=e=>({layout:Gb(e),pivoting:qb(e),properties:Xb(e)});var Zb=r(58697),eO=r.n(Zb);function tO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rO(e,t,r[t])}))}return e}function rO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nO=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${eO()()}`;return n[e.id].push(t),i=!0,tO({},e,{id:t})}return n[e.id]=[e.id],e})),o={},s=r&&i?r.map((e=>null==o[e.id]?(o[e.id]=0,e):(o[e.id]++,tO({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function iO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aO(e,t,r[t])}))}return e}function aO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let oO={};const sO=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=z(`${r.id}: ${r.action.files.join('","')}`);if(m(oO[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}oO=iO({},oO,{[a]:iO({},oO[a]||{},{worker:i})})}else i=oO[a].worker,oO[a].innerText&&t({task:{action:Ke.SET_HTML,params:{html:oO[a].innerText}},worker:i,config:r}),i.removeEventListener("message",oO[a].onWorkerMessage);return i&&(oO[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(oO[a].innerText=n.params.html)}},i.addEventListener("message",oO[a].onWorkerMessage)),i},lO=(0,u.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),uO=(0,u.flip)(lO),cO=(0,u.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=tn().number(t));return t})),pO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,u.is)(Number,e)?e>t?tn().number(e,"0,0.0a").toUpperCase():tn().number(e,"0,0"):""},dO=(0,u.ifElse)((0,u.has)("filename"),(0,u.prop)("filename"),(0,u.pipe)((0,u.prop)("link"),(0,u.split)("/"),u.last));let yO=!0;const fO=e=>yO=e,TO=(e,t)=>e!==t&&t?yO&&e?`${t} (${e})`:t:e,EO=(e,t,r)=>(0,u.path)([t,r,"displayName"],e),mO=(e,t,r)=>{const n=EO(e,t,r);return TO(r,n)},hO=(0,u.curry)(((e,t,r)=>(0,u.hasPath)([t,r],e))),bO=(0,u.complement)(hO),OO=e=>(0,u.pipe)((0,u.propOr)({},e),Object.entries,(0,u.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),vO=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,u.pipe)((0,u.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,u.uniq)([...(0,u.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),u.values)(t)},gO=(0,u.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(bO(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),_O=(0,u.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?H(i):"L",l=a?J(a):"L LTS";switch(n.type){case ze.TYPE_NUMBER:case ze.TYPE_FLOAT:case ze.TYPE_DOUBLE:case ze.TYPE_LONG:case ze.TYPE_INT:case ze.TYPE_COUNT:return t&&cO(o,t);case ze.TYPE_BOOLEAN:case ze.TYPE_BOOLEAN_RADIO:case ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,u.isNil)(t)?t:ue(t)?tn().text("Yes"):tn().text("No");case ze.TYPE_DATE:return(0,u.is)(Number,t)&&(t=N(Number(t)).getTime()),(t=t)&&(Uu(t)?Cu(t):tn().date(t,s));case ze.TYPE_ACTIVENESS_DATE:case ze.TYPE_LOCAL_DATE:return(t=t)&&(Uu(t)?Cu(t):tn().date(t,s));case ze.TYPE_TIMESTAMP:return(t=t)&&(Uu(t)?Cu(t):tn().date(isNaN(t)?t:Number(t),l));case ze.TYPE_FILE:return(0,u.propOr)(null,"filename",t);case ze.TYPE_SELECT:{const e=n.options.find((0,u.propEq)("value",t));return(0,u.propOr)(null,"label",e)}case ze.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,u.is)(Object,t)?TO((0,u.propOr)(null,"lookupCode",t),(0,u.propOr)(null,"value",t)):t}})),AO={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},NO=e=>{const t=e=>{switch(e){case 429:case 502:case 503:case 504:return 4;default:return 0}},r=e=>{const t=Math.random()+1;return new Promise((r=>{const n=Math.min(Math.round(1e3*Math.exp(e)*t),2e4);setTimeout(r,n)}))};return(n,i)=>{const a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e(n,i).then((e=>{const n=t(e.status);return n>0&&o<n?r(o).then((()=>a(o+1))):e}))};return a()}},PO=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status}}throw r})))),RO=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)}),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,u.pipe)((e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),NO,PO);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},SO="__metadata",wO=(e=>{const t=[SO,"draft"];return(0,u.lens)((0,u.pathOr)(null,t),(0,u.assocPath)(t))})(),IO=(0,u.set)(wO),UO=(0,u.view)(wO),CO=IO(Jr.NEW),LO=IO(Jr.REMOVED),DO=IO(Jr.EDITED),jO=IO(Jr.IGNORED),kO=(0,u.pipe)(UO,(0,u.equals)(Jr.REMOVED)),FO=(0,u.pipe)(UO,(0,u.equals)(Jr.NEW)),MO=(0,u.pipe)(UO,(0,u.equals)(Jr.EDITED)),xO=(0,u.pipe)(UO,(0,u.complement)(u.isNil)),$O=(0,u.pipe)(UO,(0,u.equals)(Jr.IGNORED)),VO=(0,u.omit)([SO]),GO=(e,t)=>e===SO?void 0:t;function WO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YO=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e(t))return r.concat(t);if(t&&t.children)for(const n of t.children){const i=YO(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},BO=(e,t)=>YO((0,u.propEq)("nodeId",t),e),qO=(e,t)=>YO((0,u.pathEq)(["entity","uri"],t),e),HO=(e,t)=>{const r=BO(e,t);return r.length>1?r[r.length-2]:null},QO=(e,t)=>{const r=BO(e,t);return r.length>0?r[r.length-1]:null},KO=(e,t)=>{let{parent:r,childrenProcessing:n=(e=>e),nodeProcessing:i=(e=>e)}=t;return(e=i(e,r)).children&&(e.children=n(e.children.map((t=>KO(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},JO=()=>{},XO=(e,t)=>{let{parent:r,nodeProcessing:n=JO}=t;n(e,r),e.children&&e.children.forEach((t=>XO(t,{parent:e,nodeProcessing:n})))},zO=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ce.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case Ce.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case Ce.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){WO(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},ZO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&XO(r,{nodeProcessing:r=>{const n=(0,u.path)(["editingConnections",(0,u.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ce.addingChild||r.editingMode===Ce.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=zO({node:r,connection:n,isReversed:i}),s=oT({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ce.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=zO({node:r,isReversed:i,connection:n}),l=s?cT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):uT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},ev=(e,t)=>{if((0,u.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=ev(r,t);if(e)return e}return!1},tv=(0,u.curry)(((e,t)=>{const r=(0,u.map)(tv(e));return(0,u.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),rv=(e,t)=>{const r=(0,u.pipe)(Object.entries,(0,u.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>ev(t,e.uri))(e,r.root)}))),n=(0,u.map)((t=>{let[r,n]=t;return{id:r,root:tv(e,n.root)}}));return(0,u.pipe)(r,n)(t)},nv={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},iv={asc:"asc",desc:"desc"},av=nv.entityLabel,ov=iv.asc,sv=(0,u.always)(0),lv=e=>{let{sortField:t=av,sortOrder:r=ov,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case nv.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,u.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return wA.strings.sort(t,a,o)})(n,r);case nv.entityLabel:return(e=>(t,r)=>{const n=(0,u.path)(["entity","label"]),i=n(t),a=n(r);return wA.strings.sort(e,i,a)})(r);default:return sv}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},uv=(0,u.pipe)((0,u.defaultTo)(""),u.toLower,(0,u.ifElse)((0,u.includes)(u.__,Object.values(iv)),u.identity,(0,u.always)(ov))),cv=(0,u.pipe)((0,u.defaultTo)(""),(0,u.ifElse)((0,u.includes)(u.__,Object.values(nv)),u.identity,(0,u.always)(av)));var pv=r(91104);let dv;const yv=(e,t)=>(dv||(dv=pv.createClient({key:t})),new Promise((t=>{dv.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,u.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),fv=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,u.is)(Object,t)&&(t=""),t},Tv=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(as).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[fv(e)]),(0,u.is)(Object,e.value)&&(n=(n||[]).concat(Tv(e.value,t,r))),n})),Ev=e=>e&&e.length>0,mv=(e,t)=>[].concat(e&&e.attributes?Tv(e.attributes,t):[]).filter(u.identity),hv=(e,t,r,n,i)=>{if(e&&e.type){const t=(Ur(r,e.type).geoLocationAttributes||[]).map((t=>{return r=mv(e,t.latitude),n=mv(e,t.longitude),Ev(r)&&Ev(n)&&{lat:Number(r[0]),lng:Number(n[0])};var r,n})).filter(u.identity);if(t.length>0)return Promise.resolve(t[0])}const a=t.GeoLocation;if(a){const e=a.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(Ev(t)&&t[0].value&&Ev(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(u.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?yv(n.label,i).catch((()=>null)):Promise.resolve(null)},bv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,u.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=Ur(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(u.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return hv(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?yv(a.label,r).catch((()=>null)):e)).then((e=>{let t=Array.isArray(e)?e:[e];return e&&t.map((e=>({id:e.id||n,label:i,entity:a,point:e})))})).catch((()=>null))}))).then((e=>e.flat(1/0).filter(u.identity)))},Ov=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,u.pipe)((0,u.chain)((t=>{const r=Ur(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(ir(e,r.latitude,t.type)&&ir(e,r.longitude,t.type)){const e=mv(t,r.latitude),n=mv(t,r.longitude),i=(e,r)=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}});return(0,u.zipWith)(i,e,n)}}))})),(0,u.filter)(u.identity),(0,u.uniqBy)((0,u.prop)("id")))(t))},vv=(e,t,r)=>Promise.all([Ov(e,t),bv(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lon===e.point.lon))))]}));function gv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_v(e,t,r[t])}))}return e}function _v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Av=(e,t)=>t.values.map(no(e,t.entityTypeUri)),Nv=(e,t,r)=>Bs(t.fieldName,r)||ir(e,St(t.fieldName,(0,u.propOr)("","entityTypeUri",t)),(0,u.propOr)("","entityTypeUri",t)),Pv=(e,t)=>{const r=(0,u.propOr)([],"values",t),n=(0,u.path)([t.attrType.lookupCode],e);return(0,u.map)((e=>{const t=(0,u.prop)(e,n);return t?TO(e,t):e}),r)},Rv=(0,u.path)(["attrType","label"]),Sv=(0,u.reduce)(((e,t)=>{const r=(0,u.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>gv({},e,{[t]:!0})),{});e[r]=e[r]?gv({},e[r],n):n}return e}),{}),wv=(0,u.pipe)((0,u.prop)("values"),m),Iv=(0,u.pipe)((0,u.defaultTo)({}),(0,u.propEq)("fieldName",Tn.type.name)),Uv=e=>e.type===Dv.NUMERIC_RANGE_FACET,Cv=e=>e.type===Dv.DATE_RANGE_FACET,Lv=(0,u.either)(Uv,Cv),Dv={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},jv=e=>{switch(null==e?void 0:e.name){case Tn.type.name:return Dv.ENTITY_TYPE_FACET;case Tn.createdBy.name:case Tn.updatedBy.name:case Tn.sourceSystems.name:case Tn.tags.name:case Tn.roles.name:case Tn.matchRules.name:case Tn.MLRecommendedMatch.name:return Dv.WITH_DROPDOWN_CHECKBOXES_FACET;case Tn.createdTime.name:case Tn.updatedTime.name:case Tn.startDate.name:case Tn.endDate.name:return Dv.DATE_RANGE_FACET;case Tn.matches.name:case Tn.matchScore.name:return Dv.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return Dv.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return Dv.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return Dv.DATE_RANGE_FACET;default:return Dv.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},kv=(0,u.pipe)(Nv,jv),Fv=(0,u.pipe)((0,u.path)(["attrType","type"]),fr),Mv=(0,u.cond)([[Uv,(0,u.always)(xr.IN_RANGE)],[Cv,(0,u.always)(xr.WITHIN)],[(0,u.allPass)([Fv,e=>e.values.length>=2]),(0,u.always)(xr.EXISTS)],[u.T,(0,u.always)(xr.EQUALS)]]),xv=(0,u.cond)([[Cv,(0,u.prop)("values")],[Uv,(0,u.prop)("values")],[Fv,e=>1===e.values.length?e.values.map(ue):[]],[(0,u.pipe)((0,u.path)(["values",0]),Array.isArray),(0,u.prop)("values")],[u.T,e=>[e.values]]]);function $v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vv=(0,u.pipe)((0,u.path)(["attrType","type"]),lr),Gv=(0,u.pipe)((0,u.path)(["attrType","type"]),pr),Wv=(0,u.pipe)((0,u.prop)("attrType"),Hs),Yv=(0,u.pipe)((0,u.prop)("attrType"),qs),Bv=e=>t=>t.values.map((t=>Ur(e,t).label)).join(" , "),qv=(0,u.when)((0,u.propSatisfies)((0,u.gt)(u.__,1),"length"),(0,u.join)(" – ")),Hv=e=>{const t=(0,u.pipe)((0,u.map)((0,u.pipe)(u.uniq,(0,u.map)(tn().number),qv)),(0,u.join)(","))(e.values);return`${Rv(e)}: ${t}`},Qv=e=>{const t=(0,u.pipe)((0,u.map)((0,u.pipe)(u.uniq,(0,u.map)(I),qv)),(0,u.join)(","))(e.values);return`${Rv(e)}: ${t}`},Kv=e=>t=>`${Rv(t)}: ${Av(e,t).join(", ")}`,Jv=e=>t=>{const r=Pv(e,t);return`${Rv(t)}: ${r.join(", ")}`},Xv=(0,u.curry)(((e,t,r)=>(0,u.map)((0,u.cond)([[Yv,Bv(e)],[Gv,Hv],[Vv,Qv],[Wv,Kv(e)],[u.T,Jv(t)]]),r))),zv=(e,t,r,n)=>(0,u.pipe)(u.values,(0,u.reject)((0,u.pipe)((0,u.prop)("values"),m)),(0,u.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$v(e,t,r[t])}))}return e}({},t,{attrType:Nv(e,t,n)}))),Xv(e,r))(t),Zv=new RegExp(`^${tn().text("Search")}`),eg=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:l}=i;return(0,u.isEmpty)(s)?[...zv(e,a,r,n),...o?[o.value]:[]]:[(0,u.replace)(Zv,"",l)]},tg=(0,u.pipe)((0,u.omit)(["PICK_DATE"]),u.values)(Qr),rg=e=>(e=>tg.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=Du(t);return e.replace(r,i).replace(n,a)}),e))(e),ng=(0,u.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),ig={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},ag=e=>[ig.geoPolygon,ig.onMapMove].includes(e),og=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},sg=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},lg=(e,t)=>ag(e)?t.map(og):[sg(t)],ug=e=>ag(e)?tn().text("Geo Polygon"):tn().text("Geo Location"),cg=e=>{switch(e){case ig.geoLocation:return"geoLocation";case ig.geoPolygon:case ig.onMapMove:return"geoPolygon"}},pg={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},dg=e=>tn().text(e),yg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[xr.EQUALS]:"=",[xr.NOT_EQUALS]:"≠",[xr.STARTS_WITH]:"*",[xr.MISSING_VALUE]:tn().text("missing value"),[xr.HAS_ALL]:tn().text("has all"),[xr.IN_RANGE]:tn().text("in range"),[xr.FULL_TEXT]:tn().text("full text"),[xr.EXISTS]:tn().text("exists"),[xr.COUNT_EQUALS]:`${tn().text("count")} =`,[xr.COUNT_NOT_EQUALS]:`${tn().text("count")} ≠`,[xr.COUNT_LT]:`${tn().text("count")} <`,[xr.COUNT_LTE]:`${tn().text("count")} <=`,[xr.COUNT_GT]:`${tn().text("count")} >`,[xr.COUNT_RANGE]:tn().text("count range"),[xr.LT]:"<",[xr.LTE]:"<=",[xr.GT]:">",[xr.GTE]:">=",[xr.IN_FILE]:tn().text("in file"),[xr.NOT_IN_FILE]:tn().text("not in file"),[xr.CONTAINS]:"~",[$r.LIST_EQUALS]:"=",[$r.NOT_LIST_EQUALS]:"≠",[$r.LIST_EQUALS_CASE_SENSITIVE]:"=",[$r.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||tn().text(e.toLowerCase())},fg=e=>({type:pg.operator,text:e}),Tg=e=>({type:pg.operator,text:dg(e)}),Eg=e=>({type:pg.attributeLabel,text:e}),mg=e=>({type:pg.specialAttributeLabel,text:e}),hg=e=>({type:pg.attributeFilter,text:yg(e)}),bg=e=>({type:pg.attributeValue,text:e}),Og=e=>({type:pg.entityTypeLabel,text:e}),vg=()=>({type:pg.space,text:" "}),gg=()=>({type:pg.bracket,text:"("}),_g=()=>({type:pg.bracket,text:")"}),Ag=(0,u.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Ng=(0,u.curry)(((e,t)=>t.map(Ag(e)))),Pg=(0,u.curry)(((e,t,r)=>[e,...r,t])),Rg=Pg(gg(),_g()),Sg=Pg(vg(),vg()),wg=(0,u.curry)(((e,t)=>[e,...t])),Ig=e=>wg(Og(e)),Ug=e=>wg(Og(`${e}: `)),Cg=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=pu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=uu(s),a=cu(s);!r&&t&&n&&(i.push(gg()),r=!0),i.push(o),r&&a&&(i.push(_g()),r=!1);const l=e?Tg(s):fg(s);i.push(...Sg([l]))}else i.push(o),r&&(i.push(_g()),r=!1)}return i}},Lg=(0,u.pipe)((0,u.map)((0,u.when)((0,u.has)("text"),(0,u.prop)("text"))),(0,u.join)("")),Dg=(0,u.pipe)(Cg({localizable:!1}),Lg),jg=function(e){let{data:{title:t,pathToTitle:r}}=e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r&&n?r.slice(1).join(" / "):t},kg=e=>{let{data:t,values:r,filter:n}=e;return t&&zu({filter:n,fieldName:(0,u.prop)("fieldName",t),values:r})},Fg=(0,u.anyPass)([(0,u.pipe)((0,u.prop)("attributes"),(0,u.any)(kg)),(0,u.pipe)((0,u.path)(["entityTypes","length"]),(0,u.lt)(0))]),Mg=(0,u.pipe)((0,u.chain)((0,u.pipe)((0,u.propOr)([],"attributes"),(0,u.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&er(e.data.attrType)})(e)&&[xr.HAS_ALL,xr.EQUALS,xr.NOT_EQUALS].includes(e.filter))),(0,u.map)((e=>({type:Zt((0,u.path)(["data","attrType"],e)),codeValues:(0,u.flatten)((0,u.propOr)([],"values",e))}))),(0,u.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),vO),xg=(e,t)=>(0,u.pipe)(Mg,gO(t))(e),$g=(0,u.pathEq)(["data","fieldName"],Tn.type.name),Vg=(0,u.path)(["data","entityTypeUri"]),Gg=(0,u.pipe)((0,u.props)(["entityTypes","attributes"]),(0,u.all)(u.isEmpty)),Wg=(0,u.curry)(((e,t)=>t.map((t=>(0,u.evolve)({entityTypes:(0,u.filter)(Ho(e)),attributes:(0,u.filter)((0,u.pipe)(Vg,(0,u.anyPass)([u.isNil,Ho(e),r=>{const n=(t.entityTypes||[]).filter(Ho(e));return(n.length>1?kr(e,n):null)===r&&!!Ur(e,r)}])))})(t))))),Yg=e=>(0,u.pipe)((0,u.prop)("filter"),Jl,(0,u.equals)(e)),Bg=(0,u.curry)(((e,t,r,n,i,a)=>{const o=Bs(n.fieldName)||n.attrType,s=Su(o,i),l=_O({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,u.pipe)((0,u.cond)([[()=>er(s),()=>(0,u.is)(Object,a)&&a.lookupCode?TO(a.lookupCode,a.value):mO(r,Zt(o),a)],[()=>Hs(s),()=>no(e,n.entityTypeUri,a)],[()=>Qs(s),()=>Po(e,a)],[()=>el(s),()=>wo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[u.T,()=>l(a)]]),(0,u.unless)((()=>pr(c)||fr(c)),Au),bg)()})),qg=(e,t,r,n)=>{const i=Bg(e,t,r,n.data,n.filter);return(0,u.cond)([[Yg(0),(0,u.always)([])],[(0,u.both)(Yg(2),(2,(0,u.pipe)((0,u.prop)("values"),u.flatten,u.length,(0,u.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,u.flatten)(t);return[vg(),i(r),{type:pg.punctuationMark,text:" — "},i(n)]}],[u.T,e=>{let{values:t}=e;return[vg(),...(0,u.pipe)(u.flatten,(0,u.map)(i),Ng({type:pg.punctuationMark,text:", "}))(t)]}]])(n)},Hg=(e,t)=>{const r=!!Bs(e.data.fieldName);return(0,u.pipe)(jg,r?mg:Eg)(e,t)},Qg=(e,t,r,n,i)=>[Hg(n,i),vg(),hg(n.filter),...qg(e,t,r,n)],Kg=(0,u.addIndex)(u.map),Jg=(0,u.propEq)("length",1),Xg=(0,u.propSatisfies)((0,u.lt)(1),"length"),zg=(0,u.complement)(u.isEmpty),Zg=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,u.pipe)(fu,(0,u.filter)(kg),Tu,(0,u.map)((n=>({operand:Qg(e,t,r,n,i),operator:n.operator}))),(0,u.unless)(u.isEmpty,Cg()))(n)},e_=(0,u.pipe)(Zg,u.flatten),t_=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Pd(e,{type:t}))).join(", ");return r?t(r):u.identity},l=Zg(e,t,r,a);return(0,u.ifElse)(u.isEmpty,s(Ig),(0,u.pipe)(s(Ug),(0,u.unless)((()=>Jg(l)||i),Rg)))(l)},r_=(e,t,r,n)=>(0,u.pipe)(fu,(0,u.filter)(Fg),Tu,Kg(((n,i,a)=>({operand:t_(e,t,r,n,Jg(a)),operator:n.operator}))),Cg(),u.flatten)(n),n_=(0,u.pipe)((0,u.reject)(u.isEmpty),(0,u.map)((e=>({operand:e,operator:"and"}))),Cg(),u.flatten),i_=e=>{let{searchType:t,values:[r]}=e;return lg(t,r).join(", ")},a_=(e,t,r,n,i,a)=>{const o=(e=>e?[mg(e.isRawFilter?tn().text("Raw filter"):tn().text("Search")),...Sg([hg(xr.EQUALS)]),bg(`"${e.value}"`)]:[])(i),s=(e=>e?[mg(ug(e.searchType)),vg(),bg(i_(e))]:[])(a),l=(0,u.pipe)(r_,(0,u.when)((e=>Xg(e)&&(zg(o)||zg(s))),Rg))(e,t,r,n);return n_([o,s,l])},o_=(0,u.pipe)((0,u.map)((0,u.prop)("text")),(0,u.join)("")),s_=(0,u.pipe)(a_,o_),l_=(0,u.has)("attributes"),u_=Array.isArray,c_=(0,u.allPass)([(0,u.propEq)("length",1),(0,u.pathSatisfies)((0,u.startsWith)("not"),[0,"filter"])]),p_=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=d_(e,t,r,a,i);return(0,u.when)((0,u.always)((0,u.complement)(u.isNil)(o)),(0,u.pipe)((0,u.when)((0,u.always)((0,u.not)(c_(a))),Rg),(0,u.concat)(Sg([fg(o)]))))(s)},d_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return l_(n)?p_(e,t,r,n,i):u_(n)?n.reduce(((n,a)=>n.concat(d_(e,t,r,a,i))),[]):(0,u.when)((0,u.always)((0,u.has)("operator",n)),(0,u.concat)(Sg([fg(n.operator)])))(Qg(e,t,r,n,i))},y_=(e,t,r,n,i)=>(0,u.pipe)(d_,u.flatten)(e,t,r,n,i);function f_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T_(e,t,r[t])}))}return e}function T_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const E_=(0,u.complement)($g),m_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,u.pipe)((0,u.filter)($g),(0,u.map)((0,u.prop)("values")),u.flatten,u.uniq)(e),r=(0,u.pipe)((0,u.map)(Vg),(0,u.reject)(u.isNil),u.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,u.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},h_=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=m_(t);return(r||n)&&du(t)},b_=(0,u.ifElse)((0,u.all)((0,u.has)("entityTypes")),u.identity,(0,u.pipe)((e=>{const t=[],r=e.filter((0,u.complement)(h_)),n=e.filter((e=>{let{attributes:t=[]}=e;return t.length>0}));if(0===r.length||1===r.length&&1===n.length||t.push("Can't convert more than one complex transition advanced search group"),e.some((e=>(e.attributes||[]).filter($g).some((0,u.propEq)("filter",xr.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,u.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=m_(r);if(h_(e))t.push(f_({},e,{entityTypes:(0,u.uniq)((0,u.concat)(n,i)),attributes:r.filter(E_)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,u.pipe)((0,u.ifElse)($g,(0,u.pipe)((0,u.prop)("values"),u.flatten),(0,u.pipe)(Vg,(e=>[e]),(0,u.reject)(u.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(E_),entityTypes:n,operator:i?a:e.operator,id:eO()()}}));t.push(...n)}var a;return t})(t))),[]))),O_={[xr.EQUALS]:xr.ON,[xr.IN_RANGE]:xr.WITHIN,[xr.GTE]:xr.AFTER,[xr.GT]:xr.AFTER,[xr.LTE]:xr.BEFORE,[xr.LT]:xr.BEFORE},v_=(0,u.curry)((e=>O_[e]||e)),g_=(0,u.curry)(((e,t)=>{switch(e){case xr.LT:return[T()(t[0]).subtract(1,"day").valueOf()];case xr.GT:return[T()(t[0]).add(1,"day").valueOf()];default:return t}})),__=(0,u.pipe)((0,u.path)(["data","attrType","type"]),lr),A_=(0,u.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>f_({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return __(e)?(0,u.evolve)({filter:v_,values:g_(t)},e):e}))})))})),N_=(0,u.evolve)({values:(0,u.when)((0,u.pipe)((0,u.prop)(0),Iu),(0,u.map)(Du))}),P_=(0,u.map)((0,u.cond)([[__,N_],[u.T,u.identity]])),R_=(0,u.curryN)(3,((e,t,r,n,i)=>(0,u.pipe)((0,u.defaultTo)([]),b_,Wg(t),(0,u.map)((0,u.evolve)({attributes:(0,u.pipe)((0,u.map)((0,u.evolve)({data:e(t,n,i)})),(0,u.reject)((0,u.propSatisfies)(u.isNil,"data")),P_)})),A_,(0,u.reject)(Gg))(r)));function S_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w_(e,t,r[t])}))}return e}function w_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const I_=(e,t)=>({data:{uri:Ct(e.fieldName)?St(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||Mv(e),id:eO()(),values:xv(e)}),U_=(0,u.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Bs(a,t,r)||ir(e,i);if(!s)return null;if(Yt(s))return S_({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Pd(e,{type:o}),i=(nr(e,St(a,o),o)||[]).map((0,u.pick)(["label","name"])).slice(0,-1);return S_({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,u.chain)((0,u.prop)("label"),i),t]:[r,t]})}})),C_=(0,u.curry)(((e,t,r,n)=>R_(U_,e,n,t,r)));function L_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){D_(e,t,r[t])}))}return e}function D_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const j_=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},k_=e=>"rdmLookups.not.resolved"===e?Tn.notResolved.name:e,F_=(0,u.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Yr?xr.IN_RANGE:Br(a),l=k_(n),c=Bs(l)||ir(e,i),p=(0,u.cond)([[()=>eu(s),(0,u.map)((0,u.when)((0,u.both)((0,u.has)("link"),(0,u.complement)((0,u.has)("filename"))),(e=>L_({},e,{filename:dO(e)}))))],[()=>fr(null==c?void 0:c.type),(0,u.map)(ue)],[e=>zl(s)&&!Array.isArray(e[0])&&!lr(null==c?void 0:c.type),ae],[u.T,u.identity]])(o);return{id:eO()(),data:{uri:i,fieldName:l,entityTypeUri:t},operator:a===Yr?"and not":"and",filter:s,values:p}})),M_=(0,u.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(F_(e,kr(e,i)));return[{id:eO()(),operator:"or",attributes:a,entityTypes:i}]})),x_=e=>(0,u.pipe)((0,u.prop)(e),(0,u.is)(Number)),$_=(0,u.cond)([[(0,u.has)("values"),(0,u.prop)("values")],[(0,u.allPass)([x_("from"),x_("to")]),(0,u.pipe)((0,u.pick)(["from","to"]),u.values)],[(0,u.pipe)((0,u.prop)("rangeSelection"),m,u.not),(0,u.pipe)((0,u.prop)("rangeSelection"),(0,u.pick)(["start","end"]),u.values)],[u.T,()=>[]]]),V_=(e,t)=>{const r=(0,u.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return L_({},r,{values:$_(e),entityType:(0,u.propOr)(t,"entityType",r),fieldName:n?$s(e.fieldName,n):e.fieldName})},G_=(e,t)=>{if((0,u.has)("children")(e)){const r=V_(e,t);return e.children.reduce(((e,n)=>(e.push(G_(n,(0,u.propOr)(t,"entityType",r))),e)),[])}return V_(e,t)},W_=(0,u.cond)([[(0,u.has)("searchParameters"),e=>{const t=[];return(0,u.has)("values",e)&&t.push(V_(e)),(0,u.propOr)([],"searchParameters",e).forEach((r=>t.push(L_({fieldName:e.fieldName},V_(r,e.entityType))))),t}],[(0,u.has)("children"),(0,u.pipe)(G_,u.flatten)],[u.T,V_]]),Y_=(0,u.pipe)((0,u.map)(W_),u.flatten),B_=e=>{if(e.every((e=>Array.isArray(e))))return e;if(2===e.length)return[e.map((e=>Number(e)))];if(1===e.length){const t=Number(e[0]);return[[t,t]]}return e},q_=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=M_(e,a),[l]=((e,t)=>{if(!t)return[];const[r,n]=(0,u.pipe)((0,u.reject)((e=>"tenants"===e.fieldName)),(0,u.partition)((e=>"type"===e.fieldName)))(t),i=(0,u.chain)((0,u.propOr)([],"values"),r);return[{attributes:Y_(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>L_({},t,{type:kv(e,t)}))).map((e=>L_({},e,{values:Lv(e)?B_(e.values):e.values}))).map((e=>{let{filter:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["filter"]);return I_(r,t)})),operator:"or",id:eO()(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,u.pipe)(u.keys,(0,u.map)((t=>({[k_(t)]:e[t]}))),u.mergeAll)(e)}(o),p=[L_({},l,{entityTypes:null!=c&&c.type?(0,u.uniq)([...l.entityTypes,...s.entityTypes]):[],attributes:[...l.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return C_(e,t,r,p)},H_=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,u.pipe)(u.values,(0,u.reject)(wv),(0,u.partition)(Iv))(t),i=n.map((t=>S_({},t,{type:kv(e,t)}))).map((e=>I_(e))),a=r.values||[];return[{attributes:i,operator:"or",id:eO()(),entityTypes:a}]})(e,a);return C_(e,t,r,o)})(e,t,r,n):q_(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},Q_=e=>"2.0"===e.version?e.keyword:j_(e),K_=e=>(0,u.pathEq)(["object","uri"],e),J_=(e,t)=>(0,u.pipe)((0,u.find)(K_(e)),(0,u.prop)("object"))(t),X_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,u.pipe)((0,u.find)((0,u.allPass)([(0,u.has)("shortestTransitiveMatchPath"),K_(r.uri),(0,u.pipe)((0,u.propOr)(!1,"direct"),u.not)])),(0,u.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=J_(r.match,t)||n[r.match];return i?{label:ad((0,u.prop)("label",i)),matchRules:(0,u.propOr)([],"matchRules",r).map((function(t){return ro(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,u.pipe)((0,u.defaultTo)([]),(0,u.when)((0,u.complement)(u.isEmpty),(0,u.map)(a)),(0,u.reject)(u.isNil))(i)},z_=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,u.pick)(["uri","type","label"],r),e}),{}),Z_=(0,u.allPass)([(0,u.has)("shortestTransitiveMatchPath"),(0,u.pipe)((0,u.propOr)(!1,"direct"),u.not)]),eA=(e,t,r)=>(0,u.pipe)((0,u.propOr)([],"shortestTransitiveMatchPath"),(0,u.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,u.propOr)({},n,r);return{label:ad((0,u.prop)("label",o)),matchRules:i.concat(a).map((function(t){return ro(e,o.type,t)||{label:t,uri:t}}))}})))(t),tA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,u.pipe)((0,u.map)((0,u.prop)("shortestTransitiveMatchPath")),u.flatten,(0,u.filter)(u.identity),(0,u.map)((0,u.prop)("match")),u.uniq);return t(e)},rA=(0,u.path)(["object","uri"]),nA=e=>{let t=[];return{addChild:e=>{t=(0,u.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,u.without)([e],t)}}},iA=e=>e.getValue(),aA=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=aA(n[e],t),!r);e++);return r},oA=(e,t)=>{const r=[],n=(0,u.pipe)(iA,t),i=(0,u.pipe)(u.map,u.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,u.partialRight)(oA,[t]),a);return r.push.apply(r,o),r};function sA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lA(e,t,r[t])}))}return e}function lA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uA=(e,t)=>!!e[t],cA=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},pA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.identity;return 0===t.length&&e?e:(0,u.uniqBy)(r,[...t,...e||[]])},dA=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return sA({},t,{[r.uri]:sA({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:pA(null==o?void 0:o.parents,n),children:pA(null==o?void 0:o.children,i),values:pA(null==o?void 0:o.values,a,(0,u.prop)("uri"))})})},yA=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Ur(r,t)||ui(r,t),i=(0,u.either)((0,u.both)((0,u.prop)("dependentLookupAttributes"),(0,u.prop)("dependentLookupCode")),(0,u.prop)("children"));return ko(r,n,i).flatMap(Mo).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>ir(r,e))).filter(u.identity).filter((0,u.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,u.prop)("uri")),a=dA({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>dA({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},fA=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Et(e.uri)&&gt(e.type)&&gt(t)&&!t.startsWith(e.type))(n,t))return e;const i=Os(r,n,t)||[],a=(0,u.pipe)((0,u.filter)(as),(0,u.map)(cA))(i);return dA({structure:e,attrType:e[t].attrType,values:a})}),t)},TA=e=>{let{structure:t,attributeValue:r}=e;if((0,u.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,u.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return uA(e,r)}));return r||n?t.filter(as).reduce(((e,t)=>TA({structure:e,attributeValue:t})),e):e}),t);{const e=r;return uA(t,e.type)?dA({structure:t,attrType:t[e.type].attrType,values:[cA(e)]}):t}},EA=e=>{let{structure:t,uri:r}=e;return(0,u.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?sA({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},mA=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Os(i,n,r)||[];return a.length?dA({structure:t,attrType:t[r].attrType,values:a.filter(as).map(cA)}):t},hA=(e,t,r)=>{const n=bt(e),i=bt(t);return n===i?((e,t)=>{const r=jt(t),n=jt(e);return At(n,r)||((e,t)=>Lt(e)&&!Lt(t)&&At(t,e))(n,r)})(e,t):!(!r||!Dt(t))&&OE(r,i).includes(n)},bA=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},OA=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?hE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return hA(r,t,o)}))},vA=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,u.uniq)(n.concat(n.flatMap((r=>vA(e,t,r)))))},gA=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&bA(n,e)}},_A=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=bt(n),c=bE(u,o,i,a),p=vA("children",t,l),d=vA("parents",t,l),y=p.flatMap((e=>vA("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return hA(t,n,c)})).map((t=>gA(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return hA(n,t,c)||bt(t)!==u&&hA(t,n,c)})).map((t=>gA(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=vA("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&hA(n,t,c)}))})).map((t=>gA(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return hA(t,n,c)})).map((e=>gA(r,n,e,s))),...T,...E,...f]},AA=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=_O({attributePresentations:r,dataTypeDefinition:t}),a=(0,u.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>nd(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,u.pipe)(o,i),l=(0,u.cond)([[Qt,()=>a(n)],[er,()=>(e=>{const r=o(e),n=Zt(t);return $l([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return mO(e[0],n,r)}))})(n)],[u.T,()=>s(n)]]);return await l(t)},NA=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:xr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(PA(r,t)):i.push(RA([t],r)),i},PA=(e,t)=>{const r=Bt(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=Qt(i)?PA(i,t[r]):[RA(t[r],i)];return e.push(...a),e}}),[])},RA=(e,t)=>e&&e.length&&!(0,u.isNil)(e[0])&&""!==e[0]?{fieldName:zt(t.uri),filter:t.type===ze.TYPE_BLOB?xr.FULL_TEXT:xr.EQUALS,values:e}:{fieldName:zt(t.uri),filter:xr.MISSING_VALUE},SA={AttributesDiff:s,AttributesEditor:o,HistoryManager:l},wA={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},29524:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
2
2
  //# sourceMappingURL=5501.js.map