@reltio/remotes 1.4.1581 → 1.4.1583

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.
package/6856.js CHANGED
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6856],{88832:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Ys,IL3:()=>uT,PY2:()=>bt,Ng6:()=>ke,YJ7:()=>_e,NlI:()=>fe,XYV:()=>Oe,Xt7:()=>we,wfT:()=>ar,EMD:()=>Jt,HAc:()=>Ce,PEf:()=>At,oA3:()=>Ht,$XE:()=>ze,eWf:()=>gt,q7e:()=>De,KVe:()=>or,WVQ:()=>yi,oZZ:()=>yr,bNA:()=>fr,Rjq:()=>Tr,G39:()=>Pt,W0P:()=>st,X1H:()=>it,hdG:()=>ct,ws7:()=>pt,VI$:()=>ut,yn8:()=>Je,N0y:()=>He,dZX:()=>Ze,bQt:()=>mr,oS0:()=>ft,KfU:()=>Ue,bZE:()=>he,Nsj:()=>Pe,psV:()=>ge,xPW:()=>Ot,pyR:()=>er,p8l:()=>Qt,Wkf:()=>Ie,zHr:()=>Se,NIO:()=>Re,$26:()=>y_,s9T:()=>Ye,MEy:()=>Du,j5E:()=>ye,vAw:()=>qt,NMQ:()=>Yt,eVu:()=>zu,YGb:()=>ot,Y1q:()=>dh,RgZ:()=>Xt,Qy0:()=>Er,Q26:()=>Ne,pYu:()=>Vt,wIJ:()=>g_,GFH:()=>Me,Ury:()=>Rt,S91:()=>St,wSh:()=>Z,BDP:()=>Di,pGS:()=>Zt,ARY:()=>Tt,XGc:()=>ir,fO_:()=>Dt,wwy:()=>Ve,h_8:()=>wt,_XL:()=>Ae,j2V:()=>sr,dMV:()=>rr,xYD:()=>dt,OXy:()=>Et,BXd:()=>Ke,KM9:()=>je,lXI:()=>rt,C68:()=>Nt,Yj_:()=>Be,D25:()=>$e,ZIY:()=>et,Tl4:()=>I_,lwr:()=>_t,NkU:()=>lr,Rtp:()=>nr,YGx:()=>Qe,uTS:()=>tr,MCv:()=>Le,IYE:()=>Kt,PiC:()=>dr,MVv:()=>lt,Q_m:()=>br,h_m:()=>nt,DUe:()=>be,tJI:()=>Fe,fDt:()=>xe,cNQ:()=>ur,SwE:()=>Bt,ZHR:()=>pr,PYu:()=>at,lD1:()=>It,lVm:()=>Xe,vnX:()=>Fg,$x5:()=>Mg,_R1:()=>jg,wUm:()=>kg,dC6:()=>qe,MBD:()=>Ge,GmF:()=>pa,cKm:()=>tt,iP_:()=>vt,NVC:()=>We,tPT:()=>bl,tZe:()=>PT,kRE:()=>zE,psB:()=>ZE,X0$:()=>hl,$vY:()=>ml,zE1:()=>Il,Wm5:()=>sl,vyX:()=>jc,wLZ:()=>Ol,W4V:()=>se,EtK:()=>Ps,ayi:()=>El,asT:()=>CN,kGs:()=>Gh,RLE:()=>wv,ewt:()=>_d,O_f:()=>Nu,sOy:()=>an,kP7:()=>Iv,Tde:()=>Yn,LMI:()=>mc,skb:()=>hA,sPt:()=>lc,sH1:()=>uc,lPZ:()=>qy,bG8:()=>Yy,_LJ:()=>Hy,RPM:()=>Kd,h27:()=>Sc,Uqd:()=>Lc,xG:()=>UA,Z2f:()=>Kv,fgW:()=>z_,I69:()=>_A,ZxB:()=>NA,dwd:()=>Wy,F$g:()=>By,mdt:()=>nb,Qbq:()=>Nh,rny:()=>Ji,UEY:()=>Ca,Q0T:()=>Ua,Lyr:()=>xa,sBn:()=>wa,itK:()=>Pa,H9$:()=>Ia,KPc:()=>Sa,zos:()=>Ra,ELQ:()=>$a,dZs:()=>Ea,Cz4:()=>Ta,z_L:()=>Fa,fGe:()=>fa,iuF:()=>Aa,Wib:()=>Na,Hn0:()=>Ma,obS:()=>Ga,E$L:()=>ma,XUh:()=>_a,Qp_:()=>va,_jk:()=>ha,sKE:()=>ba,WmG:()=>ga,QKx:()=>ja,Oik:()=>La,s0A:()=>Oa,o9m:()=>Da,MCd:()=>ka,RsS:()=>Ic,tGK:()=>Xl,lIv:()=>wl,Vg3:()=>ta,mkC:()=>Vi,xv5:()=>na,a14:()=>Wi,yv0:()=>ra,Zm0:()=>Bi,Nxd:()=>Gi,$mM:()=>ea,ifj:()=>Ti,NWi:()=>mg,xr3:()=>Eg,wNf:()=>cu,iJH:()=>hg,KB$:()=>gN,d89:()=>Mi,Edd:()=>xi,Z5t:()=>$i,uGe:()=>ji,UoR:()=>Li,xvW:()=>Tg,$qe:()=>fg,yPM:()=>ya,$cp:()=>Sl,vKJ:()=>Pl,VtG:()=>hf,AID:()=>Xm,B1H:()=>bN,b7X:()=>gh,$uE:()=>Wh,keo:()=>Ah,C_p:()=>jy,G27:()=>lO,O8b:()=>Qy,JA0:()=>GE,b3T:()=>$h,oC6:()=>Mh,_Zs:()=>xh,epC:()=>qh,YYG:()=>Yh,f_2:()=>BE,w3l:()=>tN,QHB:()=>sO,Jso:()=>lN,RXH:()=>qb,Vr9:()=>mO,lMm:()=>Tv,BlA:()=>BN,fmQ:()=>hs,yRD:()=>VA,NcL:()=>Gy,QK6:()=>Ar,ymd:()=>lT,JV_:()=>Tm,XiW:()=>qp,Yrx:()=>SE,BiY:()=>Rp,GPx:()=>Tl,gjI:()=>fl,vlo:()=>Gd,E_P:()=>Xh,aAL:()=>Kf,NBq:()=>bs,wp9:()=>rb,DsR:()=>Bf,MPc:()=>Cp,gWE:()=>Dp,DT_:()=>Lp,ipn:()=>kp,ORg:()=>Ii,_wz:()=>jp,RYR:()=>ld,PP2:()=>DE,wS7:()=>ag,cBQ:()=>Rf,pBq:()=>jm,DsO:()=>ee,X78:()=>mm,xZs:()=>pm,YFy:()=>wE,Gmt:()=>nm,K$w:()=>rm,DSj:()=>Qf,Mfr:()=>UE,k9j:()=>If,EjS:()=>X,ww$:()=>vl,WVU:()=>tm,hxF:()=>ul,n6p:()=>Sp,E7G:()=>Ap,nwO:()=>JN,Mzk:()=>vf,aFF:()=>Uh,HRH:()=>ku,EZK:()=>Hc,Kxm:()=>Bc,Z9i:()=>yy,CrF:()=>JE,DNd:()=>Ba,vUy:()=>FN,lJh:()=>$u,zHo:()=>Gu,UO$:()=>Gm,zeJ:()=>Xn,dLR:()=>ws,JQy:()=>Vs,XtP:()=>Ss,Ug0:()=>vi,A1W:()=>_h,sw:()=>qc,nv3:()=>Pg,JgD:()=>Ng,SkP:()=>Bs,SAs:()=>Fm,i5L:()=>Ws,PWK:()=>Bo,IM5:()=>Is,Aup:()=>EO,Mfk:()=>hv,HQx:()=>ns,oN$:()=>rs,mB6:()=>zv,p6d:()=>I,o0x:()=>U,ufS:()=>xv,k7L:()=>$v,ped:()=>_N,mrB:()=>w,OuZ:()=>Jc,ncP:()=>zr,FQ2:()=>Kc,W$R:()=>Qc,JOV:()=>qr,Zmi:()=>Hr,hm5:()=>Kr,ECL:()=>eu,vPL:()=>Xc,qmL:()=>ph,hPi:()=>Dm,hXd:()=>Qi,OCS:()=>Xi,p2l:()=>Hs,qF1:()=>cT,_X$:()=>pT,bzh:()=>ob,k66:()=>Zo,kiP:()=>fo,pSg:()=>ce,kz_:()=>FE,H_U:()=>ts,t9e:()=>Qa,j2$:()=>RT,PFL:()=>Ln,aJ3:()=>i_,To9:()=>qn,wpo:()=>mp,ADq:()=>ly,UUb:()=>oy,tQX:()=>sy,xy8:()=>Mn,EUG:()=>zn,AFK:()=>pn,X3M:()=>Qn,WN0:()=>es,kDl:()=>Us,uDV:()=>ch,IhQ:()=>Fs,pfb:()=>xs,R$r:()=>Qh,w80:()=>wo,Pfu:()=>Ja,Gtj:()=>Vl,fyF:()=>Gl,kkq:()=>zo,u5q:()=>Zr,O$n:()=>Tp,ptG:()=>Ep,f4_:()=>Tb,uap:()=>fb,d7q:()=>RE,liG:()=>LE,$oF:()=>PE,avf:()=>Ud,DiQ:()=>wd,cfX:()=>Id,vD3:()=>Dd,Qrb:()=>Sd,EJQ:()=>Cd,HWy:()=>Rd,gjS:()=>pd,y6v:()=>Pd,JUW:()=>WE,GtP:()=>Sb,_kX:()=>Ya,u1e:()=>qa,sJj:()=>Sh,CJp:()=>Pb,uKF:()=>Rh,wo0:()=>XE,s5:()=>qo,cwx:()=>Yo,Y6b:()=>EE,TTx:()=>sm,UtR:()=>mE,HaQ:()=>lm,E6I:()=>HE,Won:()=>bE,vTU:()=>fE,Nsy:()=>ap,KMQ:()=>wh,Do$:()=>up,CSV:()=>Qs,TMe:()=>hE,l1V:()=>Bu,RHh:()=>Xu,VQ1:()=>Ku,cGG:()=>Ju,z7d:()=>Vd,Xaq:()=>os,Sj8:()=>GN,PJj:()=>Jl,k3T:()=>_i,PjQ:()=>Ui,s7l:()=>df,jLA:()=>Ib,BoX:()=>Zn,GGR:()=>Fd,j5q:()=>jd,DnY:()=>uf,RY5:()=>ih,Px$:()=>ud,KPC:()=>EN,NIY:()=>bf,HvW:()=>ff,Fof:()=>Xa,BXy:()=>Tf,fX:()=>wb,BTI:()=>pp,uie:()=>ep,q27:()=>bp,vrC:()=>wO,fAQ:()=>vm,XkT:()=>lf,lrH:()=>gm,nt9:()=>Ei,XH8:()=>fp,XH2:()=>gi,jFi:()=>yp,qhs:()=>Io,GBJ:()=>gf,wwR:()=>cp,Uk3:()=>dn,$Rg:()=>On,ev7:()=>ON,RB9:()=>$E,iFp:()=>Xd,e$p:()=>Zd,PcX:()=>ey,SpP:()=>zd,R6_:()=>o_,CY1:()=>f_,Ajk:()=>rf,Yiz:()=>tf,FK9:()=>Ky,UOo:()=>Gv,aTW:()=>am,uug:()=>uu,P$2:()=>m_,XS2:()=>tu,Hyb:()=>vu,d3Y:()=>xc,Klp:()=>Gc,WxZ:()=>h_,Gzu:()=>Vu,ZOr:()=>sf,uqV:()=>pE,Pm4:()=>re,hWO:()=>ln,nHA:()=>hb,nVD:()=>oh,_tF:()=>tc,dED:()=>AE,P2h:()=>_E,jrr:()=>uo,mmY:()=>po,T6O:()=>is,h6J:()=>_T,hM2:()=>pN,XR6:()=>z,jmz:()=>uh,IHt:()=>lh,NZI:()=>dy,wdF:()=>bm,YNv:()=>vh,IFm:()=>Oh,o_F:()=>fh,kgP:()=>Om,ZYI:()=>iT,QXK:()=>Fl,efz:()=>Ml,Q5d:()=>kl,Ysv:()=>xl,UWq:()=>Yd,ocC:()=>Wd,io3:()=>bi,Sbt:()=>Co,roS:()=>Uo,Ww1:()=>Do,QaS:()=>_f,wsP:()=>Sr,ERZ:()=>ZA,CL1:()=>dN,idV:()=>Yc,nIW:()=>sn,fjE:()=>s_,sG0:()=>Wv,tV7:()=>Kl,g8o:()=>R_,Qy:()=>P_,t2P:()=>n_,KbW:()=>bo,wId:()=>vo,TAC:()=>vN,LS0:()=>go,bFH:()=>zT,Rgl:()=>eE,fW1:()=>sb,GFW:()=>um,Ywp:()=>Ug,pg:()=>LT,WSA:()=>tE,ffJ:()=>Cv,gEI:()=>Lv,fed:()=>uN,tT_:()=>Ms,BgZ:()=>$s,xIV:()=>Gs,KbL:()=>pf,JBA:()=>En,aNC:()=>Ag,RFJ:()=>nT,Zeh:()=>$m,OT5:()=>wg,mC3:()=>Cl,kR6:()=>VN,gFw:()=>Eb,NVY:()=>eb,k6v:()=>dT,FEC:()=>yT,L5S:()=>zh,Ob5:()=>Op,KUV:()=>vp,dvH:()=>Zh,V3i:()=>OO,VD3:()=>Oi,mm2:()=>Hu,rou:()=>Im,izH:()=>Ha,DK$:()=>Ka,KMp:()=>Jf,c31:()=>_n,mbo:()=>cy,gT8:()=>Pn,CZ8:()=>Es,uGi:()=>gs,Poc:()=>vn,_9k:()=>Ns,ZTM:()=>Os,bwT:()=>_s,tF$:()=>Nn,o96:()=>ms,M4S:()=>As,_vs:()=>Gf,xF8:()=>dd,PUO:()=>Ch,ATu:()=>uy,j1S:()=>Ri,V3K:()=>Ni,Lmx:()=>Pi,oSN:()=>Ci,ZaZ:()=>gn,n_1:()=>yE,N6e:()=>Yf,SxO:()=>co,w3p:()=>tb,xU7:()=>gr,hAq:()=>vr,Y_p:()=>ko,$k6:()=>jo,Gdl:()=>qv,U6P:()=>Yv,OwB:()=>a_,hTh:()=>sh,xqc:()=>Ho,JvE:()=>Jo,i29:()=>_c,dzT:()=>qi,uPS:()=>Pf,cZV:()=>Nf,n3B:()=>aA,e6O:()=>Z_,s7j:()=>v_,j$Q:()=>YE,PeS:()=>Ay,kW2:()=>Rb,tH7:()=>Wo,Yxg:()=>tl,bOT:()=>Dv,MaZ:()=>kd,nqN:()=>Ld,jWj:()=>Hd,o_J:()=>ss,yW4:()=>AT,uT0:()=>vT,C82:()=>gT,bsH:()=>mb,u9Z:()=>Sm,LCU:()=>cm,J$m:()=>dE,j_Q:()=>Xy,OaI:()=>zy,wB1:()=>hN,SP6:()=>DT,ZYr:()=>TN,IMU:()=>rT,FoU:()=>VE,DVz:()=>Xv,mxe:()=>nA,FHr:()=>Mm,D1g:()=>wm,VO3:()=>Vg,de5:()=>Gg,Uw1:()=>Rr,J6q:()=>py,XCe:()=>oo,fbl:()=>Cg,Ir:()=>mo,XQO:()=>ho,QXb:()=>YT,zXF:()=>yh,P8_:()=>ym,iiD:()=>Hf,MOC:()=>qT,WF:()=>WT,xE1:()=>wi,idW:()=>wN,QWZ:()=>gv,YL3:()=>Of,NW9:()=>Mv,D_E:()=>_r,Fn9:()=>T,j2U:()=>qs,MpE:()=>In,kQw:()=>kn,mfm:()=>gu,vZp:()=>yn,Wah:()=>Ty,E8K:()=>PN,VSb:()=>fs,vr_:()=>jn,Vmh:()=>kN,FgW:()=>bO,oDv:()=>us,fGG:()=>_v,kuw:()=>ps,eHk:()=>qd,Tt2:()=>ls,pQZ:()=>ds,oZ7:()=>Av,T6Y:()=>li,VRd:()=>hn,_26:()=>hu,YkM:()=>Wn,J6y:()=>iu,njU:()=>du,TBP:()=>cs,IT0:()=>fy,x_:()=>Ih,FP6:()=>bn,biM:()=>sp,TMl:()=>lp,Vkd:()=>Tu,WiY:()=>p_,_zi:()=>Eu,RZp:()=>Vy,J6D:()=>qu,Lt4:()=>ri,QEi:()=>Jn,whI:()=>jt,KIu:()=>Ft,JhM:()=>oe,C_0:()=>pi,lzc:()=>_p,qIF:()=>oA,O27:()=>E,aBi:()=>hp,xOX:()=>ol,EdS:()=>rn,WgC:()=>tn,eEv:()=>Cn,A4t:()=>yu,YOQ:()=>Tn,Wos:()=>oi,jWr:()=>Va,Or$:()=>Bn,lhE:()=>hi,CwH:()=>Hn,pzC:()=>nl,ymH:()=>pu,QZu:()=>Gn,rYH:()=>c_,FVt:()=>ai,Kn2:()=>ue,jgw:()=>_u,Qgr:()=>Yu,OXP:()=>ys,nsY:()=>ny,vyG:()=>ty,lS4:()=>Kn,g5f:()=>d_,fp6:()=>su,Uty:()=>oa,YkG:()=>Vn,xdS:()=>Rn,kMF:()=>Fp,$NE:()=>nn,bC9:()=>en,Ian:()=>Si,KVV:()=>Ph,q9e:()=>Lo,iIf:()=>Hv,ian:()=>cl,m6e:()=>di,OFd:()=>il,kqr:()=>Fn,fnZ:()=>Lt,VFZ:()=>pl,ZiX:()=>Qr,j5n:()=>ni,zkt:()=>_,Pcm:()=>mN,QDV:()=>rl,M5u:()=>u_,laD:()=>iA,mtq:()=>Un,CtB:()=>Jv,CBv:()=>ae,I0t:()=>ci,u1G:()=>$d,gk1:()=>tA,Bgb:()=>eA,uzs:()=>kt,v0l:()=>ac,Zqp:()=>OE,j0k:()=>Go,l22:()=>qN,tCm:()=>cn,gmx:()=>ru,mOr:()=>Lu,TwZ:()=>S_,GyU:()=>Rg,zGm:()=>FT,bMg:()=>aE,EyD:()=>dg,FQA:()=>yg,fZN:()=>lE,xsF:()=>cg,Lxg:()=>pg,O3l:()=>Uf,Wni:()=>wf,wRx:()=>Og,OxG:()=>KT,Jwg:()=>HT,uJQ:()=>JT,qWg:()=>Qv,i96:()=>jT,NPd:()=>xu,MrZ:()=>Vo,zhn:()=>bg,G8q:()=>hr,Jct:()=>nd,A9Y:()=>te,Y5F:()=>YA,gxP:()=>le,c$P:()=>nu,M7o:()=>Dc,BBN:()=>lo,fS6:()=>gd,ZBU:()=>Q,UkJ:()=>_o,xkv:()=>dm,z$M:()=>UN,KAm:()=>xE,lCl:()=>zm,rkF:()=>ky,IU6:()=>CT,RGr:()=>h,aYu:()=>m,ije:()=>ql,Buf:()=>qf,YLu:()=>Yl,ct9:()=>Mo,XkY:()=>oE,T5R:()=>MT,uQS:()=>uE,wcJ:()=>Fo,d$I:()=>gl,rSp:()=>op,Sx:()=>mf,Ilm:()=>Ul,Ki6:()=>ll,VGk:()=>Vf,sFD:()=>Hb,eWN:()=>DN,dWE:()=>O_,Lkd:()=>Hp,aDL:()=>Vm,yaA:()=>cE,lOh:()=>Cm,DBr:()=>e_,hK$:()=>Ql,uKH:()=>Uv,TZ_:()=>UT,CMB:()=>sA,FU8:()=>Ef,J$p:()=>qm,b5s:()=>Ym,h2W:()=>un,SL_:()=>Nm,oUH:()=>hT,ck9:()=>xT,RAb:()=>ec,nL:()=>Bv,k$p:()=>Kb,Xs0:()=>Wl,u7I:()=>Um,rxg:()=>Ru,bji:()=>Su,oCZ:()=>Uy,MjG:()=>$g,FuV:()=>mT,$ju:()=>OT,t6d:()=>bT,m5F:()=>Pr,sx:()=>LN,rSc:()=>Zv,U10:()=>Zy,L8n:()=>em,R9X:()=>TE,rj2:()=>Em,_C4:()=>ST,tCj:()=>fm,uAg:()=>IE,wx9:()=>Ad,KF3:()=>IT,ax9:()=>wT,HH7:()=>Wf,ufV:()=>CE,_6y:()=>Sf,XTh:()=>Lg,AJo:()=>Af,Ixr:()=>qE,oss:()=>HN,P6Y:()=>KN,q5j:()=>Ny,Bd_:()=>Ry,xkB:()=>Py,W41:()=>Rm,WkI:()=>Pm,sSE:()=>_y,GMd:()=>hc,jtL:()=>bc,Bxm:()=>Iy,FVh:()=>hy,inb:()=>Ig,U_T:()=>rE,FTe:()=>ie,VGB:()=>ne,tM8:()=>Iu,Wfe:()=>Mu,Ls5:()=>Fu,$bd:()=>Uu});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>g,durationToTimestamp:()=>X,formatDate:()=>I,formatDateTime:()=>U,formatTime:()=>w,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>J,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>Q,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Cr,editAttribute:()=>Dr,editEndDate:()=>xr,editRoles:()=>kr,editStartDate:()=>Mr,editTags:()=>Fr,removeAttribute:()=>jr});var o={};r.r(o),r.d(o,{EventType:()=>Lh,applyCrosswalks:()=>Gh,collectCrosswalksFromAttributes:()=>Wh,compareActivenessAttributes:()=>$h,compareAttributes:()=>Mh,compareImages:()=>xh,compareRoles:()=>qh,compareTags:()=>Yh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Kh});var l=r(50914);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.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})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=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)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date("2023-01-05");return r.setFullYear(t.getUTCFullYear()),r.setMonth(t.getUTCMonth()),r.setDate(t.getUTCDate()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},N=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)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),I=e=>f()(e).format(f().localeData().longDateFormat("L")),w=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${I(e)} ${w(e)}`,C=(0,l.equals)("9"),D=(0,l.equals)("99"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),G=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),V=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),B=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),W=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,G(a),o])}return e},H=/(9+)([^9]+)*/g,J=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[V(e,s),r,B(n),i,a?W(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},K=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${J(r)}`},Q=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt(0))).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0";class Z{constructor(e){this.value=void 0,this.value=e}isNone(){return(0,l.isNil)(this.value)}extract(){return this.value}orSome(e){return(0,l.isNil)(this.value)?e:this.value}map(e){return(0,l.isNil)(this.value)?Z.None():Z.Some(e(this.value))}static Some(e){return new Z(e)}static None(){return new Z(null)}static fromFalsy(e){return e?Z.Some(e):Z.None()}static fromNull(e){return(e=>null==e)(e)?Z.None():Z.Some(e)}static fromUndefined(e){return void 0===e?Z.None():Z.Some(e)}static fromEmpty(e){return E(e)?Z.None():Z.Some(e)}}const ee=(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)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=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)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var pe=r(2507),de=r.n(pe);const ye={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"},fe={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},Te={[ye.EQUALS]:"equals",[ye.NOT_EQUALS]:"not",[ye.STARTS_WITH]:"starts with",[ye.MISSING_VALUE]:"missing value",[ye.IN_RANGE]:"in range",[ye.HAS_ALL]:"has all",[ye.FULL_TEXT]:"full text",[ye.EXISTS]:"exists",[ye.COUNT_EQUALS]:"count equals",[ye.COUNT_NOT_EQUALS]:"count not equal",[ye.COUNT_LT]:"count less",[ye.COUNT_LTE]:"count less or equal",[ye.COUNT_GT]:"count greater",[ye.COUNT_GTE]:"count greater or equal",[ye.COUNT_RANGE]:"count in range",[ye.LT]:"less than",[ye.LTE]:"less than or equal",[ye.GT]:"greater than",[ye.GTE]:"greater than or equal",[ye.IN_FILE]:"in file",[ye.NOT_IN_FILE]:"not in file",[ye.CONTAINS]:"contains",[ye.ON]:"on",[ye.BEFORE]:"before",[ye.AFTER]:"after",[ye.WITHIN]:"within"};var Ee;!function(e){e.IN="in",e.NOT_IN="notIn",e.NOT_IN_RANGE="not range"}(Ee||(Ee={}));const me=e=>({[Ee.IN]:ye.EQUALS,[Ee.NOT_IN]:ye.NOT_EQUALS}[e]||e);var he,be;!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"}(he||(he={})),function(e){e.LAST_3DAYS="last3Days"}(be||(be={}));const Oe=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=he[t]||be[t],e)),{}),ve={[he.LAST_DAY]:"Last 24 hours",[be.LAST_3DAYS]:"Last 3 days",[he.LAST_WEEK]:"Last 7 days",[he.LAST_MONTH]:"Last month",[he.LAST_6MONTHS]:"Last 6 months",[he.LAST_YEAR]:"Last year",[he.PICK_DATE]:"Pick date"},ge={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},_e={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Ae="<No label>",Ne="__number";var Pe;let Re,Se,Ie,we,Ue,Ce,De,Le,je,ke,Fe,Me,xe,$e,Ge,Ve,Be,We,Ye,qe,He,Je,Ke,Qe,Xe,ze,Ze,et,tt,rt,nt,it,at,ot,st,lt,ut,ct,pt,dt;var yt;!function(e){e.IN="in",e.OUT="out"}(Pe||(Pe={})),function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(Re||(Re={})),function(e){e.local="local",e.validationService="validationService"}(Se||(Se={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Ie||(Ie={})),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"}(we||(we={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Ue||(Ue={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Ce||(Ce={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(De||(De={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(Le||(Le={})),function(e){e.asc="asc",e.desc="desc"}(je||(je={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(ke||(ke={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Fe||(Fe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Me||(Me={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(xe||(xe={})),function(e){e.PROFILE="profile",e.MAP="map"}($e||($e={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ge||(Ge={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ve||(Ve={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Be||(Be={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(We||(We={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(Ye||(Ye={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(qe||(qe={})),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"}(He||(He={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Je||(Je={})),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"}(Ke||(Ke={})),function(e){e.IN="in",e.OUT="out"}(Qe||(Qe={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Xe||(Xe={})),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"}(ze||(ze={})),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"}(Ze||(Ze={})),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"}(et||(et={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(tt||(tt={})),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",e.DCRReview="DCRReview"}(rt||(rt={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(nt||(nt={})),function(e){e.NEW="new",e.CLASSIC="classic"}(it||(it={})),function(e){e.ASC_BY_NAME="ascByName"}(at||(at={})),function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network",e.TREE="Tree"}(ot||(ot={})),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"}(st||(st={})),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"}(lt||(lt={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(ut||(ut={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(ct||(ct={})),function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(pt||(pt={})),function(e){e.percent="percent"}(dt||(dt={})),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"}(yt||(yt={}));const ft=yt;let Tt,Et;function mt(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){ht(e,t,r[t])}))}return e}function ht(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.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Tt||(Tt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(Et||(Et={}));const bt={startDate:{type:ft.TYPE_ACTIVENESS_DATE,get label(){return de().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:ft.TYPE_ACTIVENESS_DATE,get label(){return de().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Ot=mt({id:{type:ft.TYPE_ENTITY_ID,get label(){return de().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},bt,{roles:{type:ft.TYPE_STRING,get label(){return de().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:ft.TYPE_STRING,get label(){return de().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),vt={workflow:{type:ft.TYPE_STRING,get label(){return de().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:ft.TYPE_STRING,get label(){return de().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:ft.TYPE_STRING,get label(){return de().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},gt={commenter:{type:ft.TYPE_STRING,get label(){return de().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},_t={notResolved:{type:ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return de().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},At={createdBy:{type:ft.TYPE_STRING,get label(){return de().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:ft.TYPE_STRING,get label(){return de().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Nt={matches:{type:ft.TYPE_COUNT,get label(){return de().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:ft.TYPE_COUNT,get label(){return de().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0},relevanceScore:{type:ft.TYPE_FLOAT,get label(){return de().text("Relevance scores")},uri:"relevanceScore",name:"relevanceScores.relevance",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchAction:{type:ft.TYPE_STRING,get label(){return de().text("Match action")},uri:"matchAction",name:"relevanceScores.actionLabel",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Pt={sourceSystems:{type:ft.TYPE_STRING,get label(){return de().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:ft.TYPE_STRING,get label(){return de().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:ft.TYPE_INT,get label(){return de().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:ft.TYPE_STRING,get label(){return de().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Rt;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Rt||(Rt={}));const St={[Rt.matchRules]:{type:ft.TYPE_STRING,get label(){return de().text("Match Rules")},uri:Rt.matchRules,name:Rt.matchRules,faceted:!0,hideForDataTenant:!0},[Rt.MLRecommendedMatch]:{type:ft.TYPE_STRING,get label(){return de().text("Match IQ")},uri:Rt.MLRecommendedMatch,name:Rt.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},It=mt({},Ot,vt,gt,_t,At,Nt,Pt,St,{type:{type:ft.TYPE_STRING,get label(){return de().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),wt="NOT_MATCH";var Ut=r(13980),Ct=r.n(Ut);const Dt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Lt=(0,l.equals)(Dt.SUGGESTING),jt=(0,l.equals)(Dt.EDITING),kt=(0,l.equals)(Dt.VIEWING),Ft=(0,l.either)(jt,Lt);function Mt(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){xt(e,t,r[t])}))}return e}function xt(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=Ct().oneOf(["mobile","tablet","desktop"]),Gt=Ct().shape({deviceTypes:Ct().oneOfType([$t,Ct().arrayOf($t)]),roles:Ct().arrayOf(Ct().string)}),Vt=Ct().shape({value:Ct().string,lookupCode:Ct().string}),Bt=Ct().shape({displayName:Ct().string,parent:Ct().string}),Wt=Ct().oneOfType([Ct().string,Ct().number,Ct().bool,Vt]),Yt=Ct().oneOfType([Wt,Ct().arrayOf(Wt)]),qt=Ct().shape({fieldName:Ct().string,values:Ct().arrayOf(Yt),filter:Ct().string,type:Ct().string}),Ht=Ct().shape({minValue:Ct().number,maxValue:Ct().number}),Jt=Ct().shape({label:Ct().string,name:Ct().string,description:Ct().string,type:Ct().string,hidden:Ct().bool,faceted:Ct().bool,searchable:Ct().bool,uri:Ct().string,access:Ct().arrayOf(Ct().string),cardinality:Ht}),Kt=Ct().shape({label:Ct().string,uri:Ct().string,typeColor:Ct().string,direction:Ct().string,startObject:Ct().object,endObject:Ct().object}),Qt=Ct().shape({typeColor:Ct().string,typeIcon:Ct().string,typeImage:Ct().string,label:Ct().string,uri:Ct().string,attributes:Ct().arrayOf(Jt)}),Xt=Ct().shape({uri:Ct().string,label:Ct().string,memberTypes:Ct().array,extendsTypeUri:Ct().string,attributes:Ct().arrayOf(Jt)}),zt=Ct().shape({uri:Ct().string,label:Ct().string,extendsTypeUri:Ct().string,relationshipTypeURIs:Ct().arrayOf(Ct().string)}),Zt=Ct().shape({uri:Ct().string,description:Ct().string,label:Ct().string,schemaVersion:Ct().string,entityTypes:Ct().arrayOf(Qt),roles:Ct().arrayOf(Ct().object),groupTypes:Ct().arrayOf(Ct().object),relationTypes:Ct().arrayOf(Kt),graphTypes:Ct().arrayOf(zt),interactionTypes:Ct().arrayOf(Xt),sources:Ct().arrayOf(Ct().object)}),er=Ct().shape({uri:Ct().string,type:Ct().string}),tr=Ct().shape({uri:Ct().string,type:Ct().string}),rr=Ct().shape({value:Ct().object,ov:Ct().bool,type:Ct().string,uri:Ct().string}),nr=Ct().shape({refEntity:Ct().oneOfType([Ct().array,Ct().object]),refRelation:Ct().oneOfType([Ct().array,Ct().object]),value:Ct().object,ov:Ct().bool,type:Ct().string,uri:Ct().string}),ir=Ct().oneOf((0,l.values)(Dt)),ar=Ct().shape({type:Ct().oneOf(Object.values(Re)).isRequired,attributeTypeUri:Ct().string.isRequired,parentUri:Ct().string.isRequired,uri:Ct().string,message:Ct().string}),or={attributeType:Jt,showEmptyEditors:Ct().bool,lazy:Ct().bool,mode:ir,metadata:Zt,ownError:ar,errors:Ct().arrayOf(ar),crosswalks:Ct().array,onAddAttributes:Ct().func,onAddOneMore:Ct().func,onDeleteAttribute:Ct().func,onChangeAttribute:Ct().func,additionalControlsRenderer:Ct().func,hideDeleteButton:Ct().bool,showNonOv:Ct().bool,state:Ct().oneOf(["deleted","edited"]),expanded:Ct().bool},sr=Mt({attributeValue:rr},or),lr=Mt({attributeValue:nr},or),ur=Ct().shape({value:Ct().oneOfType([Ct().string,Ct().bool,Ct().number]),ov:Ct().bool,type:Ct().string,uri:Ct().string,lookupCode:Ct().string,lookupRawValue:Ct().string}),cr=Ct().shape({inRelations:Ct().arrayOf(Ct().oneOfType([Ct().object,Ct().string])),outRelations:Ct().arrayOf(Ct().oneOfType([Ct().object,Ct().string])),groups:Ct().arrayOf(Ct().string),entityTypes:Ct().arrayOf(Ct().string),nextEntry:Ct().object}),pr=Ct().oneOf(["asc","desc"]),dr=Ct().shape({id:Ct().string,content:cr,allowOnlyCreateNew:Ct().bool,sortColumn:Ct().string,sortOrder:pr,"text-empty":Ct().string,max:Ct().number,icon:Ct().string,caption:Ct().string,canCreate:Gt,canRead:Gt,canUpdate:Gt,canDelete:Gt,editingEnabled:Ct().bool}),yr=Ct().shape({entityUri:Ct().string,entityType:Ct().string,entityLabel:Ct().string,object:er}),fr=Ct().shape({relationUri:Ct().string,relationType:Ct().string,relationLabel:Ct().string,direction:Ct().string,object:tr}),Tr=Ct().shape({entity:yr,relation:fr}),Er=Ct().shape({value:Ct().string,isRawFilter:Ct().bool}),mr=Ct().shape({id:Ct().string,label:Ct().string,name:Ct().string,availableEntityTypes:Ct().array}),hr=[{label:de().text("And"),value:"and"},{label:de().text("Or"),value:"or"},{label:de().text("And not"),value:"and not"},{label:de().text("Or not"),value:"or not"}],br="___!status_code!___",Or=(0,l.when)((0,l.is)(Object),JSON.stringify),vr=e=>{var t;return(null==e?void 0:e[br])||(null==e||null===(t=e.originalResponse)||void 0===t?void 0:t.status)},gr=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([[(0,l.prop)("originalResponse"),(0,l.pipe)((0,l.path)(["originalResponse","status"]),(e=>((e,t)=>{switch(e){case 400:return de().text("Bad Request");case 403:return de().text("Forbidden");case 404:return de().text("Not Found");case 405:return de().text("Method Not Allowed");case 408:return de().text("Request Timeout");case 500:return de().text("Internal Server Error");case 502:return de().text("Bad Gateway");case 503:return de().text("Service Unavailable");case 504:return de().text("Gateway Timeout");default:return t||de().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),Or)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,Or]])(e)},_r=e=>"AbortError"===e.name,Ar=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.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,l.pluck)("percent",i);const s=Math.sign(o),u=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<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},Nr=/[\n\r%#()<>?[\\\]^`{}|]/g,Pr=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(Nr,encodeURIComponent)}`,Rr=e=>`data:image/gif;base64,${e}`,Sr=e=>{switch(e){case"minutes":return de().text("minutes");case"hours":return de().text("hours");case"days":return de().text("days");case"weeks":return de().text("weeks");case"months":return de().text("months");case"years":return de().text("years");default:return""}};var Ir=r(76665);function wr(e,t,r,n){if(null==t){const i=`\n Uri is null or undefined.\n getPartInfo parameters when the error occurred:\n 1. name - ${e}\n 2. uri - ${t}\n 3. fullUri - ${r}\n 4. attrType - ${ue(n)?JSON.stringify(n):n}\n `;console.error(i)}const 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 Ur(e,t){const r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[];for(let i=0;i<r.length;i+=2)n.push(wr(r[i],r[i+1],e,t));return n}function Cr(e,t,r,n,i,a,o){void 0===a&&(a=0);const s=Ur(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ur(r,t))}\n addAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n index: ${o}\n `;console.error(s)}if(s.hasChildren)return e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]),Cr(e[s.name].find((function(e){return e.uri===s.valueUri})).value,t,r,n,i,a+1,o);{if(e[s.name]||(e[s.name]=[]),null==n)return;const a=e[t.name],l=n,u=n;let c={value:n.refEntity||ue(l.value)&&!Array.isArray(l.value)?l.value:n,uri:r,type:t.uri};if(n.lookupCode){const e=c,t=n;e.value=t.value,e.lookupCode=t.lookupCode,c=e}if(u.refEntity){const e=c;e.refEntity=u.refEntity,e.label=u.label,c=e}if(u.refRelation){const e=c;e.refRelation=u.refRelation,c=e}return i&&(c.crosswalks=i),a.splice(o||0,0,c),n}}function Dr(e,t,r,n,i,a){void 0===a&&(a=0);const o=Ur(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ur(r,t))}\n editAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n `;console.error(o)}if(!o.hasChildren){const o=e[t.name];let s,l=o&&o.find((function(e){return e.uri===r}));if(l){if("[object Object]"!==l.value.toString())Lr(n,l),i&&(l.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&o.filter((function(e){return!1===e.ov})).forEach(Lr.bind(null,n));else if(function(e){return void 0!==e.refEntity}(n)){const e=l;e.refRelation=n.refRelation,e.refEntity=n.refEntity,e.value=n.value,e.label=n.label,l=e}else null!==n.value&&void 0!==n.value&&null!==l.value&&"object"==typeof l.value&&(l.value=n.value,l.label=n.label);s=l.value}else s=Cr(e,t,r,n,i,a);return s}{const s=Dr(e,o,o.valueUri,{},i,a);Dr(s,t,r,n,i,a+1)}}function Lr(e,t){!function(e){return ue(e)}(e)?(t.value=e,t.lookupCode&&(t.lookupCode=e)):(t.value=e.value,t.lookupCode=e.lookupCode)}function jr(e,t,r,n){void 0===n&&(n=0);const i=Ur(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ur(r,t))}\n removeAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n nestingLevel: ${n}\n `;console.error(i)}if(i.hasChildren){const a=(e[i.name]||[]).find((function(e){return e.uri===i.valueUri}));a&&jr(a.value,t,r,n+1)}else{const n=e[t.name];n&&(n.forEach((function(e,t){e.uri===r&&n.splice(t,1)})),0===n.length&&delete e[t.name])}}function kr(e,t){e.roles=t||[]}function Fr(e,t){e.tags=t||[]}function Mr(e,t){e.startDate=t}function xr(e,t){e.endDate=t}var $r=r(37164);const Gr="1Tempo4rary",Vr="1Tepmo4Rel",Br=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Wr=(0,$r.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Yr=()=>`${Wr()}${Date.now()}`,qr=()=>`1Tempo4DCR${Yr()}`,Hr=e=>`${e}/uri$$${Yr()}`,Jr=e=>()=>Hr(e),Kr=(e,t)=>{const r=Br(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Hr(n)},Qr=e=>e&&e.includes("uri$$"),Xr=Jr("entities"),zr=Jr("relations"),Zr=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),en=(0,l.startsWith)("relations/"),tn=(0,l.startsWith)("entities/"),rn=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),nn=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),an=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),on=(0,l.pipe)((0,l.split)("/"),l.head),sn=(0,l.pipe)((0,l.split)("/"),l.last),ln=e=>e.split(".").slice(0,2).join("."),un=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},cn=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),pn=(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("/")},dn=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},yn=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),fn=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},Tn=e=>5===e.split("/").length,En=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},mn=e=>e.replace(/uri\$\$/g,Gr),hn=e=>null==e?void 0:e.startsWith("changeRequests/"),bn=e=>hn(e)&&e.includes("/changes/"),On=e=>e.split("/changes/")[1],vn=(0,l.prop)("referencedEntityTypeURI"),gn=(0,l.prop)("relationshipTypeURI"),_n=(0,l.prop)("referencedAttributeURIs"),An=(0,l.curry)(((e,t)=>(0,l.pipe)(_n,(0,l.filter)((0,l.startsWith)(e)))(t))),Nn=An("configuration/relationTypes"),Pn=An("configuration/entityTypes"),Rn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),Sn=(0,l.filter)(Rn),In=(e,t)=>!t||t.some((t=>an(e.uri,t)));function wn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Un=e=>(0,l.allPass)([(0,l.propSatisfies)((0,l.anyPass)([l.isNil,Fn,rn]),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",ft.TYPE_STRING)])(e),Cn=(0,l.has)("values"),Dn=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(ft.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(ft.TYPE_LOOKUP)],[Cn,(0,l.always)(ft.TYPE_ENUM)],[Un,(0,l.always)(ft.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",ft.TYPE_BOOLEAN),(0,l.always)(ft.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Ln=(0,l.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){wn(e,t,r[t])}))}return e}({},e,{type:Dn(e)})),(0,l.pick)(["type","values","lookupCode","uri","name","dependentLookupCode","singleValue"])),jn=e=>!!e&&(!!e.autoGenerated&&e.type!==ft.TYPE_NESTED||!!e.parentAutoGenerated),kn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Fn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.startsWith)("configuration/"),l.not),Mn=e=>kn(e)?"analyticsAttributes":"attributes",xn=(0,l.propEq)("hidden",!0),$n=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),Gn=$n(ft.TYPE_NESTED),Vn=$n(ft.TYPE_REFERENCE),Bn=$n(ft.TYPE_IMAGE),Wn=(0,l.either)(Gn,Vn),Yn=(e,t)=>{const r=kn(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,l.chain)((0,l.prop)("name"),t),(0,l.last)(n)]:[...n.slice(1)]].join(".")},qn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Hn=(0,l.pipe)(qn,Boolean),Jn=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Kn=(0,l.both)(Hn,(0,l.pipe)(qn,("rdm",(0,l.pipe)(on,(0,l.equals)("rdm")))));const Qn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Mn({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,l.propEq)("uri",r)):null,s=o?i(o.uri):0,u=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,l.last)(o.split(`/${n}/`)),c=(r?r[n]||zn(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(...u(c,i+1)),p},c=u(o,s),p=c.length===i(t)-s;return p?c:[]},Xn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Qn(e,t,r);return n.length?(0,l.last)(n):null},zn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,l.cond)([[(0,l.has)("analyticsAttributes"),(0,l.prop)("analyticsAttributes")],[(0,l.anyPass)([(0,l.propEq)("type",ft.TYPE_NESTED),(0,l.propEq)("type",ft.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",ft.TYPE_REFERENCE),(0,l.pipe)(_n,(0,l.map)((t=>Xn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Zn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;const r=zn(e,t);return r&&Vn(t)?Sn(r):r},ei=[ft.TYPE_ACTIVENESS_DATE,ft.TYPE_DATE,ft.TYPE_TIMESTAMP,ft.TYPE_LOCAL_DATE],ti=[ft.TYPE_ACTIVENESS_DATE,ft.TYPE_TIMESTAMP,ft.TYPE_LOCAL_DATE],ri=e=>ei.includes(e),ni=e=>ti.includes(e),ii=[ft.TYPE_INT,ft.TYPE_LONG,ft.TYPE_NUMBER,ft.TYPE_FLOAT,ft.TYPE_DOUBLE,ft.TYPE_COUNT],ai=e=>ii.includes(e),oi=e=>[ft.TYPE_FLOAT,ft.TYPE_DOUBLE].includes(e),si=[ft.TYPE_BOOLEAN,ft.TYPE_BOOLEAN_RADIO,ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED],li=e=>si.includes(e),ui=[ft.TYPE_URL,ft.TYPE_BLOG_URL,ft.TYPE_IMAGE_URL],ci=e=>ui.includes(e),pi=$n(ft.TYPE_EMAIL),di=e=>ft.TYPE_SSN===e;var yi,fi=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(yi||(yi={}));const Ti=(0,l.curry)(((e,t,r)=>{var n;const i=e===yi.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)))})),Ei=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),mi=(0,l.curry)(((e,t)=>(0,l.pipe)(Ei(e),(0,l.prop)("extendsTypeURI"))(t))),hi=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(mi(e,r)));return n(r)})),bi=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=mi(e,n);return r})),Oi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Oi(e,Ei(e,t.extendsTypeURI),r):void 0,vi=(e,t)=>{const r=t.map(bi(e));return(r.length?r.reduce(l.intersection):[])[0]},gi=(e,t)=>Oi(e,"string"==typeof t?Ei(e,t):t,"typeImage"),_i=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&hi(e,t,n.uri)?r.concat(n.uri):r),[]);function Ai(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ni=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Pi=(0,l.pipe)(Ni,(0,l.propOr)("","label")),Ri=(0,l.curry)(((e,t)=>{const r=Ni(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Si=(0,l.curry)(((e,t,r)=>{const[n,i]=Ri(e,r);return hi(e,n,t)||hi(e,i,t)})),Ii=(0,l.pipe)((0,l.propOr)([],"relationTypes"),(0,l.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){Ai(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),wi=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?Pe.OUT:Pe.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Pe.IN),i=r(Pe.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ui=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Ci=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Ci(e,Ni(e,t.extendsTypeURI),r):void 0;var Di;!function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE",e.INITIATE_CHANGE_REQUEST="INITIATE_CHANGE_REQUEST",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(Di||(Di={}));const Li=(0,l.curry)(((e,t)=>e.every((e=>ji(e,t))))),ji=(0,l.curry)(((e,t)=>{const r=jn(t);return ki(e,t)&&(e===Di.READ||!r)})),ki=(e,t)=>!t||!t.access||t.access.includes(e),Fi=(0,l.curry)(((e,t,r)=>ji(Di.READ,r)&&(Lt(t)?ji(Di.INITIATE_CHANGE_REQUEST,r):ji(e,r)))),Mi=Fi(Di.CREATE),xi=Fi(Di.DELETE),$i=Fi(Di.UPDATE),Gi=Li([Di.CREATE,Di.MERGE,Di.READ,Di.UPDATE]),Vi=Li([Di.UPDATE,Di.READ,Di.CREATE]),Bi=Li([Di.UPDATE,Di.READ]),Wi=Li([Di.DELETE,Di.UPDATE,Di.READ]),Yi=(0,l.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,l.pipe)((0,l.propOr)([],"matchGroups"),(0,l.find)((0,l.propEq)("uri",t)),(0,l.defaultTo)({}),(0,l.prop)("type"))(e))(t,r)]||e["*"])),qi=(e,t,r)=>(0,l.pipe)((0,l.map)(Yi(e,t)),(0,l.filter)(l.identity))(r),Hi=(e,t,r)=>{const n=qi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&ji(Di.MERGE,r)},Ji=(0,l.curry)(((e,t,r,n)=>{const i=Ni(e,n),[a,o]=Ri(e,n);return i&&ji(Di.CREATE,i)&&hi(e,a,t.type)&&hi(e,o,r.type)})),Ki=(e,t,r,n,i)=>{const a=Ei(e,n.type),o=qi(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(l.identity);return o.some((t=>{let{inRelations:r=[],outRelations:a=[]}=t;return r.some(Ji(e,n,i))||a.some(Ji(e,i,n))}))},Qi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Ei(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Hi(o,i,a),canAddRelation:Ki(e,o,i,r,n),canMark:ji(Di.UPDATE,a)&&ji(Di.READ,a)}},Xi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Qi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),zi=kn,Zi=(0,l.complement)(zi),ea=ji(Di.READ),ta=e=>{let{attributeType:t,mode:r}=e;return Zi(t)&&Mi(r,t)&&!xn(t)},ra=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Qr(r.uri),o=$i(n),s=Mi(n);return(0,l.cond)([[zi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},na=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Qr(r.uri),s=$i(n),u=xi(n),c=aa(Di.UPDATE,n,a,r),p=aa(Di.DELETE,n,a,r);return(0,l.cond)([[zi,l.F],[(0,l.always)(o),l.T],[(0,l.always)(i),(0,l.allPass)([u,p])],[l.T,(0,l.allPass)([s,u,c,p])]])(t)},ia=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&zn(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!ki(e,n)||!ia(e,t,r[n.name],n)))))})),aa=(0,l.curry)(((e,t,r,n,i)=>Lt(t)?ia(Di.INITIATE_CHANGE_REQUEST,r,n,i):ia(e,r,n,i))),oa=(0,l.both)((0,l.complement)(xn),ea),sa="SuperUser",la="allTenants",ua=[la,"allCustomers"],ca=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions||void 0!==(null==e?void 0:e.roles);case r.ADMIN:return(e=>t=>((null==t?void 0:t.roles)||[]).includes(e))(r.ADMIN);default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,l.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===sa})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,l.endsWith)(["*"],o)?o.slice(0,-1):o,(0,l.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===sa){const e=r?ua.concat(r.map((e=>`allTenants.${e}`))):ua,n=r&&t[0]===la?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.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)}:l.F}var t}))},pa={NON_SECURED:"NON_SECURED",SECURED:"SECURED",ADMIN:"ROLE_ADMIN",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",CAN_READ_PREFERENCES:"CAN_READ_PREFERENCES",CAN_UPDATE_PREFERENCES:"CAN_UPDATE_PREFERENCES",CAN_CREATE_PREFERENCES:"CAN_CREATE_PREFERENCES",CAN_DELETE_PREFERENCES:"CAN_DELETE_PREFERENCES"},da={[pa.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[pa.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[pa.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[pa.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[pa.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[pa.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[pa.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[pa.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[pa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[pa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[pa.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[pa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[pa.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[pa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[pa.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[pa.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[pa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[pa.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[pa.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[pa.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[pa.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[pa.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[pa.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[pa.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[pa.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[pa.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[pa.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[pa.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[pa.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},ya=(0,l.curry)(((e,t,r)=>ca({allowedPermissionsNames:e,permissionsNames:pa,permissionsConfig:da}).some((e=>e(t,{params:{tenant:r}}))))),fa=ya([pa.CAN_EXPORT]),Ta=ya([pa.CAN_EXPORT_ACTIVITIES]),Ea=ya([pa.CAN_IMPORT_ENTITIES_FROM_DT]),ma=ya([pa.CAN_READ_ENTITIES_FROM_DT]),ha=ya([pa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ba=ya([pa.CAN_UPDATE_PROCESS_INSTANCE]),Oa=ya([pa.CAN_VIEW_WORKFLOW_DEFINITION]),va=ya([pa.CAN_CONFIG_ENVIRONMENT_REGISTER]),ga=ya([pa.CAN_UPDATE_WORKFLOW_DATA_TASK]),_a=ya([pa.CAN_READ_WORKFLOW_DATA_TASK]),Aa=ya([pa.CAN_MANAGE_WORKFLOW_DEFINITION]),Na=ya([pa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Pa=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Ra=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Sa=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ia=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),wa=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS]),Ua=ya([pa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ca=ya([pa.CAN_CREATE_CONFIG_JAR]),Da=ya([pa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),La=ya([pa.CAN_VIEW_CONFIG_JAR]),ja=ya([pa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),ka=ya([pa.CAN_VIEW_WORKFLOW_JOBS]),Fa=ya([pa.CAN_MAKE_BULK_UPDATE]),Ma=ya([pa.CAN_OPEN_DATA_LOADER_EXECUTE,pa.CAN_OPEN_DATA_LOADER_READ]),xa=ya([pa.CAN_BULK_DELETE_PROFILES]),$a=ya([pa.CAN_READ_MDM_DATA_ENTITIES]),Ga=ya([pa.CAN_READ_DVF]),Va=ya([pa.IS_FREEMIUM_ADMIN]),Ba=(0,l.reject)(xn),Wa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ba,(0,l.filter)(e))(t),Ya=(0,l.curry)(((e,t)=>Wa((t=>ta({attributeType:t,mode:e})),t))),qa=(0,l.curry)(((e,t)=>Wa((t=>ta({attributeType:t,mode:e})||oa(t)),t))),Ha=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(oa)),Ja=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ja(e)])))),Ka=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(oa),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ka(e)])))),Qa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Qa(e)])))),Xa=(0,l.pipe)(Ei,(0,l.converge)(l.concat,[Ka,Qa]));function za(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){Za(e,t,r[t])}))}return e}function Za(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eo=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,eo(e)))},t))),to=e=>{var t;return za({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},ro=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),no=(0,l.when)(ro,(0,l.dissoc)("values")),io=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return za({},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})})),ao=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},oo=(0,fi.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Ja,t).concat((0,l.chain)(Ja,r)).some(ao)})),so=e=>{let t=!1;const r=eo((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?za({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},lo=e=>{const t=oo(e),r=(0,l.map)((e=>eo((0,l.pipe)(no,(0,l.when)((0,l.always)(e),io))))(t)),n=(0,l.map)(to),i=(0,l.map)(so);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},uo=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),co=(0,l.prop)("relationshipTypeURIs"),po=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(yo(e,t)))||[]})),yo=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Si(e,t))},fo=(e,t)=>(0,l.pipe)(uo,(0,l.defaultTo)({}),co,(0,l.defaultTo)([]),(0,l.chain)(Ri(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Ei(e)))(e,t),To=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Eo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),mo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Eo((0,l.complement)(To))(e)},ho=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Eo(To)(e)},bo=(0,l.pipe)(Ei,(0,l.propOr)([],"matchGroups")),Oo=(e,t,r)=>(0,l.pipe)(bo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),vo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(Oo,(0,l.propOr)(r,"label"))(e,t,r))),go=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(bo,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),_o=e=>(0,l.partition)(To,e),Ao=(0,l.includes)(l.__,["and","or","not"]),No=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Po=(0,l.includes)(l.__,["equals","notEquals","in"]),Ro=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return Ao(t)?Ro(r):No(t)?r.filter(rn):Po(t)?r.map((0,l.prop)("uri")).filter(rn):[]})),l.uniq),So=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Ro),l.uniq),Io=(0,l.pipe)(bo,So),wo=(0,l.pipe)(go,So),Uo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Co=(0,l.pipe)(Uo,Ka),Do=(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||hi(e,n,t)})(e,t))})(e,t)),Lo=e=>!!e.required,jo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=(0,l.cond)([[rn,Ei(e)],[nn,Ni(e)]])(t);return ko(e,a,r,n,i)},ko=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&rn(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!jn(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===ft.TYPE_REFERENCE){const a=gn(t),s=_n(t);o=jo(e,a,r,n,[...i,t]).filter((e=>s.some(an(e.uri))))}else t.attributes&&(o=ko(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===ft.TYPE_REFERENCE?jo(e,gn(t),r,n,[...i,t]):[]},Fo=e=>{const t=(0,l.pipe)((0,l.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),l.values,(0,l.filter)(l.identity))(e);return(0,l.filter)((0,l.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,l.any)((0,l.anyPass)([(0,l.includes)(n),(0,l.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),Lo]),e.attributes||[])},Mo=(e,t)=>{const r=Pn(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},xo=(0,l.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)?de().text(n):n};return r(null,t)})),$o=["label","description","abbreviation","caption","toolTip"],Go=e=>xo($o,e),Vo=(0,l.mergeRight)({attributeTypes:[],categoryTypes:[],changeRequestTypes:[],entityTypes:[],graphTypes:[],groupTypes:[],interactionTypes:[],relationTypes:[],roles:[],sources:[],survivorshipStrategies:[]}),Bo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=sn(t);return r.find((e=>{let{uri:t}=e;return sn(t)===n}))})),Wo=(0,l.curry)(((e,t)=>{const r=sn(t);return(0,l.pipe)(Bo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Yo=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,l.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"})},qo=(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}))},Ho=(0,l.curry)(((e,t)=>{let{roles:r=[]}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Jo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Ei(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Ko(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){Qo(e,t,r[t])}))}return e}function Qo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return zo(i,e,t,r,n)},zo=function(e,t,r){var n;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return Z.fromNull(e&&e.length?e:null===(n=zn(t,r))||void 0===n?void 0:n.filter((0,l.complement)(Vn))).map((e=>e.map((e=>{const r=Xo(t,e,i,a);return r.length?Ko({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Wn),(0,l.prop)("children"))).filter(oa).filter(i).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes","analyticsAttributes"])},es=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes"])},ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["analyticsAttributes"])},rs=e=>e.children?e.children.flatMap(rs):e,ns=e=>e.children?[e,...e.children.flatMap(ns)]:e,is=(0,l.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),as=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return sn(r)===e})))),os=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),as("LUD")),(0,l.defaultTo)(r))(t||[])},ss=(e,t)=>{let{survivorshipStrategies:r}=e;return as(t,r)},ls=(0,l.allPass)([(0,l.complement)(l.isNil),ji(Di.READ)]),us=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),ji(Di.READ)]),cs=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([ji(Di.CREATE),ji(Di.INITIATE_CHANGE_REQUEST)])]),ps=(0,l.curryN)(2,(0,l.pipe)(Ei,us)),ds=(0,l.curryN)(2,(0,l.pipe)(Ni,ls)),ys=e=>{let{ov:t}=e;return!1!==t},fs=(e,t)=>((e,t)=>ci(e.type)&&ae(t))(e,t)||((e,t)=>pi(e.type)&&oe(t))(e,t),Ts=e=>t=>(0,l.cond)([[l.isNil,(0,l.always)(null)],[(0,l.pipe)((0,l.prop)(e),Array.isArray),(0,l.path)([e,0])],[l.T,(0,l.prop)(e)]])(t),Es=Ts("refEntity"),ms=Ts("refRelation"),hs=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],bs=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Os=(0,l.prop)("objectURI"),vs=(0,l.prop)("objectURI"),gs=(0,l.prop)("type"),_s=(0,l.pipe)(Es,(0,l.defaultTo)({}),Os),As=(0,l.pipe)(ms,(0,l.defaultTo)({}),vs),Ns=(0,l.pipe)(Es,(0,l.defaultTo)({}),gs),Ps=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type,uri:e.uri,value:e.value})));return(e||[]).concat(r)},Rs=(0,l.evolve)({refEntity:re,refRelation:re});function Ss(e,t,r,n){const i=Qn(e,r),a=Ei(e,t.type)||Ni(e,t.type);if(0===i.length)return null;const o=Mn(r);let s=[t],u=1;i[0].uri!==t.type&&(u=0);let c=null;const p=n?[]:null;let d=null;for(let e=u;e<i.length;++e){const t=e===i.length-1,r=i[e];let u=[];if(!In(r,d)){c=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const c=s.value||s[o]||{};let y=[];r.startObject&&r.endObject||(0,l.both)(fn,nn)(r.uri)?(y=((null==a?void 0:a.attributes)||[]).filter((e=>gn(e)===r.uri||vn(e)===r.uri)),d=y.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(y.push(r),d=null),y.forEach((a=>{const o=c[a.name];o&&(u=u.concat(o)),n&&t&&p.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=u),t&&(c=s)}return p||c}const Is=(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?Is(a.value,o):a},ws=(0,l.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return Is(e[r],i)}));function Us(e){return(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]])(e)}const Cs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),Ds=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","uri"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","uri"])],[l.T,(0,l.pick)(["value","uri"])]]),Ls=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(Ls(e,i)))))(r)})),js=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(js(e)),e)(t))),ks=(e,t)=>(0,l.curry)(((r,n)=>(0,l.pipe)(Ls(e,r),js(t))(n))),Fs=ks(null,Us),Ms=ks(ys,Us),xs=ks(null,Cs),$s=ks(ys,Cs),Gs=ks(ys,Ds),Vs=(e,t,r)=>{var n,i,a;return e.uri===t?null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=ws(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Bs=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(_s,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Ws=(e,t)=>{const r=En(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Vs(e,r,n)},Ys=Object.values(bt),qs=(0,l.includes)(l.__,Ys),Hs=e=>Ys.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Js(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){Ks(e,t,r[t])}))}return e}function Ks(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qs=(e,t)=>`${e}_${t}`,Xs=[It.matches.name,It.matchRules.name],zs=(0,l.values)(vt).map((e=>e.name)),Zs=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,zs)))),el=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Xs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Qs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),tl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Zs(r),el(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Qs(`dtPotentialMatches.${t.name}`,"")))))(It)},rl=(0,l.propEq)("uri",It.type.uri),nl=e=>(0,l.values)(St).some((0,l.propEq)("uri",null==e?void 0:e.uri)),il=(0,l.propEq)("uri",Pt.sourceSystems.uri),al=Object.values(Ot),ol=(0,l.includes)(l.__,al),sl=e=>{let{entity:t,attributeType:r,value:n}=e;return Js({},t,{[r.uri]:void 0===n?r.defaultValue:n})},ll=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},ul=e=>{let{entity:t,attributeType:r,value:n}=e;return Js({},t,{[r.uri]:n})},cl=(0,l.propEq)("uri",Ot.roles.uri),pl=(0,l.propEq)("uri",Ot.tags.uri);function dl(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){yl(e,t,r[t])}))}return e}function yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fl=e=>{let{parentUri:t,attributeType:r}=e;return dl({uri:Kr(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(Wn,Bn),(0,l.always)({value:{}})],[Hn,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),ri)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Tl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ya(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Jn,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=fl({parentUri:r,attributeType:e}),s=Zn(n,e);s&&(a.value=Tl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Jn(e))&&(o[t]=[a])}return o},El=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return jo(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=En(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Ss(r,e,a)||[]).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,a)=>{let{parentUri:o,attributes:s}=a;if(!s[i]||0===s[i].length){let i=bl({entity:e,attributeType:t,parentUri:o,index:0});if(Wn(t)){const e=Zn(r,t);i=ml({attributeType:t,subAttributes:e,metadata:r,mode:n,parentUri:o},i)}return i}return e}),e)}),t)},ml=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a,parentUri:o}=e;const s=Ss(i,t,r.uri).find((e=>{let{uri:t}=e;return an(t,o)})),l=dl({},s,{value:Tl({attributeTypes:n,parentUri:s.uri,mode:a,metadata:i})});return vl({entity:t,attributeType:r,uri:s.uri,value:l})})),hl=(0,l.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,l.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===ft.TYPE_NESTED?dl({},e,{value:hl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return dl({},s(t),Tl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),bl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=fl({parentUri:n,attributeType:r}),u=Us(l);return(0,Ir.ZP)(t,(e=>{Cr(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ol=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Ir.ZP)(t,(e=>{Cr(e.attributes||e.value,r,n.uri,Us(n),a,o,i)}))},vl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Ir.ZP)(t,(e=>{Dr(e.attributes||e.value,r,n,i,a,o)}))},gl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Ir.ZP)(t,(e=>{jr(e.attributes||e.value,r,n,i)}))},_l=e=>""===e,Al=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([_l,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([_l,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),Nl=(0,l.reject)(Al),Pl=e=>{let{deleteEmptyComplex:t,valueTransformer:r=l.identity}=e;return(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.map)((0,l.pipe)(r,(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(e=>Pl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Nl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Rl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Pl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Rs),deleteEmptyComplex:e})},Sl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Rl(e),(0,l.reject)(l.isEmpty))},Il=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return qs(r)?sl({entity:e,attributeType:r}):bl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),wl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return qs(r)?ul({entity:e,attributeType:r,value:i}):vl({entity:e,attributeType:r,uri:n,value:i})})),Ul=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return qs(r)?ll({entity:e,attributeType:r}):gl({entity:e,attributeType:r,uri:n})})),Cl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.pipe)((0,l.filter)((0,l.pipe)((0,l.pathOr)([],["roles"]),(0,l.either)((0,l.propEq)("length",0),(0,l.any)((e=>t.includes(e)))))),(0,l.map)((0,l.pathOr)([],["attributes"])),l.flatten)(e)},Dl="UrlThumbnail",Ll="CdnUrlThumbnail",jl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(ys):(0,l.head)(n);return e&&e.value}return null})(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),kl=jl(["CdnUrl","Url"],!0),Fl=jl(["CdnUrlPreview","UrlPreview"],!0),Ml=jl([Ll,Dl],!0),xl=jl([Ll,Dl],!1),$l=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Fn,(0,l.always)(t)],[(0,l.both)(kn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Fn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(qs(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Gl=(e,t,r)=>{const n=Ha(e),i=(0,l.any)(r?l.T:ys);return $l(n,t,i)},Vl=(e,t,r,n,i,a)=>{const o=Qr(null==r?void 0:r.uri)?Ya(t,e):qa(t,e);return $l(o,r,((e,o)=>{const s=ta({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:ys,e)||Fn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Bl;const Wl=e=>{Bl=e};function Yl(e,t){return Bl(e,t)}const ql=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,l.when)((0,l.is)(String),(0,l.always)({errorMessage:e,errorCode:t}))(e))}),null)})),Hl=50,Jl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Hl,offset:a=0,sortByDisplayName:o=!0,sortOrder:s=je.asc}=e;return Yl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a,sortByDisplayName:o,sortOrder:s}),headers:{"Content-Type":"application/json"}})},Kl=(0,l.once)((()=>Yl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),Ql=e=>Yl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Xl=(e,t)=>Yl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),zl=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Zl=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),zl),eu=(0,l.pipe)((0,l.reject)(E),Zl),tu=e=>Z.fromNull(Te[e]).map(de().text).orSome(""),ru=(0,l.curry)(((e,t)=>`${e}_${t}`)),nu=(0,l.split)("_"),iu=(0,l.includes)("_"),au=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),ou=(0,l.curry)(((e,t)=>e.some(au(t)))),su=ou([ye.IN_RANGE,ye.COUNT_RANGE,ye.WITHIN]),lu=ou([ye.EXISTS,ye.MISSING_VALUE]),uu=(0,l.cond)([[lu,(0,l.always)(0)],[su,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),cu=(0,l.complement)(lu),pu=ou([ye.HAS_ALL,ye.EQUALS,ye.NOT_EQUALS]),du=ou([ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE,ye.COUNT_RANGE]),yu=ou([ye.IN_FILE,ye.NOT_IN_FILE]),fu=e=>{switch(e){case ye.COUNT_EQUALS:return ye.EQUALS;case ye.COUNT_NOT_EQUALS:return ye.NOT_EQUALS;case ye.COUNT_LT:return ye.LT;case ye.COUNT_LTE:return ye.LTE;case ye.COUNT_GT:return ye.GT;case ye.COUNT_GTE:return ye.GTE;case ye.COUNT_RANGE:return ye.IN_RANGE}},Tu=ou([ye.ON,ye.BEFORE,ye.AFTER,ye.WITHIN,ye.NOT_EQUALS]),Eu=ou([ye.WITHIN]),mu=[[ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE],[ye.NOT_IN_FILE,ye.IN_FILE],[ye.EQUALS,ye.NOT_EQUALS,ye.HAS_ALL],[ye.LT,ye.LTE,ye.GT,ye.GTE],[ye.MISSING_VALUE,ye.EXISTS],[ye.COUNT_RANGE],[ye.IN_RANGE],[ye.STARTS_WITH,ye.CONTAINS],[ye.FULL_TEXT],[ye.ON,ye.BEFORE,ye.AFTER,ye.NOT_EQUALS],[ye.WITHIN]],hu=(e,t)=>mu.some((r=>r.includes(e)&&r.includes(t))),bu=(0,l.pipe)(l.omit,l.values),Ou={OPTIONS_FOR_STRING:bu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_DATE:[ye.ON,ye.BEFORE,ye.AFTER,ye.WITHIN,ye.NOT_EQUALS,ye.MISSING_VALUE,ye.EXISTS,ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE,ye.COUNT_RANGE,ye.IN_FILE,ye.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:bu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_BLOB:bu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_NUMBER:bu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_LOOKUP:bu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ye),OPTIONS_FOR_ENUM:bu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_ID:[ye.EQUALS,ye.NOT_EQUALS,ye.IN_FILE,ye.NOT_IN_FILE],OPTIONS_FOR_COUNT:[ye.EQUALS,ye.NOT_EQUALS,ye.LT,ye.LTE,ye.GT,ye.GTE,ye.IN_RANGE],OPTIONS_FOR_COMPLEX:[ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE,ye.COUNT_RANGE,ye.EXISTS,ye.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[ye.EQUALS,ye.NOT_EQUALS,ye.EXISTS,ye.MISSING_VALUE]},vu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case ft.TYPE_TYPEAHEAD:case ft.TYPE_STRING:case ft.TYPE_PASSWORD:case ft.TYPE_TEXT:case ft.TYPE_CIK_ID:case ft.TYPE_URL:case ft.TYPE_BLOG_URL:case ft.TYPE_IMAGE_URL:case ft.TYPE_EMAIL:return Ou.OPTIONS_FOR_STRING;case ft.TYPE_LOOKUP:case ft.TYPE_DEPENDENT_LOOKUP:return Ou.OPTIONS_FOR_LOOKUP;case ft.TYPE_ENUM:return Ou.OPTIONS_FOR_ENUM;case ft.TYPE_DATE:case ft.TYPE_ACTIVENESS_DATE:case ft.TYPE_TIMESTAMP:case ft.TYPE_LOCAL_DATE:return Ou.OPTIONS_FOR_DATE;case ft.TYPE_BOOLEAN:case ft.TYPE_BOOLEAN_RADIO:return Ou.OPTIONS_FOR_BOOLEAN;case ft.TYPE_BLOB:return Ou.OPTIONS_FOR_BLOB;case ft.TYPE_LONG:case ft.TYPE_INT:case ft.TYPE_FLOAT:case ft.TYPE_DOUBLE:case ft.TYPE_NUMBER:return Ou.OPTIONS_FOR_NUMBER;case ft.TYPE_ENTITY_ID:return Ou.OPTIONS_FOR_ID;case ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ye.EQUALS];case ft.TYPE_COUNT:return Ou.OPTIONS_FOR_COUNT;case ft.TYPE_NESTED:case ft.TYPE_REFERENCE:case ft.TYPE_IMAGE:return Ou.OPTIONS_FOR_COMPLEX;default:return Ou.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(du,n):n},gu=e=>[Fe.and,Fe.andNot].includes(e),_u=e=>[Fe.or,Fe.orNot].includes(e),Au=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),_u)),Nu=(Pu=[Fe.and],e=>e.slice(0,-1).every((e=>Pu.includes(e.operator))));var Pu;const Ru=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Su=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Iu=e=>`(${e})`,wu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.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},Uu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Fe.or,Fe.orNot],n=t?[Fe.and,Fe.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&wu(e.slice(1,-1));return!i&&!a||o?e:Iu(e)},Cu="and",Du=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,l.propOr)(Cu,n,e),o=(e=>[Fe.andNot,Fe.orNot].includes(e))(a)?Uu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Lu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),ju=e=>Array.isArray(e)?e.map(ju).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),ku=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Fu=e=>`'${e}'`,Mu=e=>`"${e}"`,xu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),$u=(0,l.pipe)(ju,ku),Gu=(0,l.pipe)($u,Fu),Vu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(su(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Bu=(e,t)=>du(t)?{type:ft.TYPE_INT}:yu(t)?{type:ft.TYPE_FILE}:Tu(t)&&!Eu(t)&&ni(e.type)?{type:ft.TYPE_LOCAL_DATE}:e,Wu=Object.values(Oe),Yu=e=>!Object.values(Oe).includes(e),qu=e=>Wu.includes(e),Hu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ve;return de().text(t[e])},Ju=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(he),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ve;return e.map((e=>({value:e,get label(){return Hu(e,t)}})))},Ku=e=>{const t=f()().startOf("minute");switch(e){case he.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case he.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case he.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case he.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case he.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case be.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},Qu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},Xu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ku;return(0,l.is)(String,e)?t(e):Qu(e)};let zu;!function(e){e.CurrentUser="currentUser"}(zu||(zu={}));const Zu={},ec=(e,t)=>{Zu[e]=t},tc=e=>Zu[e];function rc(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){nc(e,t,r[t])}))}return e}function nc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ic=e=>e.split("{CurrentUser}").join(tc(zu.CurrentUser)||""),ac=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),oc=(0,l.curry)(((e,t,r)=>{const n=r.map(su(e)||t.endsWith(".count")?$u:Gu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),sc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},lc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=uu(t);return(0,l.pipe)(sc(i),(0,l.map)(oc(t,r)),ac(" or "))(n)},uc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Gu).join(",")})`},cc=e=>`*${e}*`,pc=e=>`URL:${e}`,dc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,yc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ye.IN_FILE?r:`not ${r}`},fc=(e,t)=>[R(e,t),S(e,t)],Tc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Ec(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ye.ON:return rc({},e,n?{filter:ye.EQUALS}:{filter:ye.IN_RANGE,values:[fc(i,n)]});case ye.BEFORE:return rc({},e,{filter:ye.LTE,values:[[S(i,n)]]});case ye.AFTER:return rc({},e,{filter:ye.GTE,values:[[R(i,n)]]});case ye.WITHIN:return rc({},e,{filter:ye.IN_RANGE,values:[Ku(i)]})}}return e}),lc),Ec=(0,l.propSatisfies)(ni,"type"),mc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),ic)],[(0,l.propEq)("filter",ye.HAS_ALL),(0,l.pipe)((e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(lc({filter:ye.EQUALS,fieldName:t,values:[r]}))),new Du).build())),ac(" or "))(r)}),ic)],[(0,l.propEq)("filter",ye.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return lc({fieldName:r,filter:t,values:n.map((0,l.pipe)(ju,cc))})}),ic)],[(0,l.propEq)("filter",ye.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?lc(rc({},e,{values:(0,l.flatten)(r)})):dc(r)?uc(rc({},e,{filter:"listEquals"})):lc(e)}),ic)],[(0,l.propEq)("filter",ye.NOT_EQUALS),(0,l.pipe)((e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=uu(t);return(0,l.pipe)(sc(i),(0,l.map)(oc(t,r)),ac(" and "))(n)})(rc({},e,{values:(0,l.flatten)(e.values)})):Ec(e)?(e=>{const{values:t}=e,r=!Ec(e),[n]=t;return(new Du).addClause(lc(rc({},e,{filter:ye.LT,values:[R(n,r)]}))).addClause(lc(rc({},e,{filter:ye.GT,values:[S(n,r)]}))).orBuild()})(e):dc(t)?uc(rc({},e,{filter:"not listEquals"})):lc(e)}),ic)],[(0,l.propSatisfies)(yu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return lc({fieldName:r,filter:yc(t,r),values:n.map((0,l.prop)("link")).map(pc)})}],[(0,l.propSatisfies)(du,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return lc({fieldName:`${r}.count`,values:n,filter:fu(t)})}],[(0,l.propSatisfies)(Tu,"filter"),Tc],[(0,l.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,l.pipe)((0,l.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,l.join)(";"))(r);return oc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return oc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(lc,ic)]],hc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!cu(e)||Oc(e,r))},bc=(e,t)=>Array.isArray(t)?Oc(e,t):e===ye.WITHIN?qu(t)||Number.isInteger(t):!(0,l.isNil)(t)&&ju(t).length>0,Oc=(e,t)=>t&&t.length>0&&t.every((t=>bc(e,t)));function vc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gc=["relevanceScores"],_c=e=>{let{fieldName:t=""}=e;const r=t.split(".");if(gc.includes(r[0]))return r[0];const n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Ac=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Nc=(e,t,r)=>"children"===e?Rc(r,[...t][0],!0):r,Pc=(e,t,r)=>"values"===e?[...r,...t]:r,Rc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,l.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Nc,t),e);if(!r&&pu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Pc,t),e)}return(0,l.append)(t,e)},Sc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=_c(e),r=e=>e.fieldName===t?e:r({fieldName:Ac(e),children:[e]});return r(e)})(t);return Rc(e,r)}),[]),Ic=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),wc=e=>{let[t]=e;return t.children?wc(t.children):t.operator},Uc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=wc(t)===Fe.andNot,a=n(t,!1),o=i?`not ${Uu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${wc(r)||Cu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&Ic(i)&&!t?r(i):n(i,a)}],...e])(o))),new Du).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Cc=(0,l.pipe)((0,l.propOr)("","filter"),iu),Dc=(0,l.map)((0,l.when)(Cc,(e=>{const[t,r]=nu(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){vc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Lc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,l.pipe)((0,l.filter)(hc),Dc,Sc,Uc([...e,...mc],t))},jc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),kc=[ye.ON,ye.BEFORE,ye.AFTER,ye.WITHIN,ye.NOT_EQUALS,ye.MISSING_VALUE,ye.EXISTS],Fc=[ye.EQUALS,ye.NOT_EQUALS,ye.STARTS_WITH,ye.MISSING_VALUE,ye.HAS_ALL,ye.FULL_TEXT,ye.EXISTS],Mc=[ye.EQUALS,ye.NOT_EQUALS,ye.LT,ye.LTE,ye.GT,ye.GTE,ye.IN_RANGE],xc=(e,t)=>{const r=Ln(e);return(e=>{switch(e){case bt.startDate.name:case bt.endDate.name:case vt.dueDate.name:case At.createdTime.name:case At.updatedTime.name:case Pt.reltioLoadDate.name:case Pt.createDate.name:case Pt.updateDate.name:case Pt.deleteDate.name:case Pt.publishDate.name:return kc;case Nt.matches.name:case Pt.count.name:return Mc;case vt.workflow.name:case vt.assignee.name:case vt.step.name:case gt.commenter.name:case At.createdBy.name:case At.updatedBy.name:case Pt.sourceSystems.name:case Pt.value.name:return Fc;default:return null}})(t)||vu(r)},$c=[ye.EQUALS,ye.NOT_EQUALS,ye.CONTAINS,ye.STARTS_WITH,ye.MISSING_VALUE,ye.HAS_ALL,ye.IN_RANGE,ye.WITHIN,ye.EXISTS,ye.ON],Gc=(0,l.pipe)(xc,(0,l.filter)((0,l.includes)(l.__,$c))),Vc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(ys);return a&&a[0]&&(r=n.length>0&&a[0].value?Vc(a[0].value,[n.join(".")])[0].value:"label"in a[0]&&"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),Bc=(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=Vc(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},Wc=/[,\s]*$/,Yc=e=>{const t=de().text(Ae);if(!e)return t;const r=e.replace(Wc,"");return""===r.toString().trim()?t:r},qc=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Hc=(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=qc(e,r.referencedEntityTypeURI);if(n)return Bc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Bc({attributes:t||{}},r.dataLabelPattern);return""},Jc=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Kc=e=>{let{uiPath:t,value:r,uri:n}=e;return`${t}#p~com.reltio.plugins.pivoting.default.DefaultPivotingPerspective_ps~pivoting_a~${encodeURIComponent(n)}_v~${encodeURIComponent(r)}`},Qc=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Xc=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),zc=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Ml,(0,l.prop)("value"))),Zc=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),zc),ep=(e,t,r)=>{const n=Zc(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(ws(e),zc)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,l.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(Ei(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ss(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,zc))(r)})(e,r)||gi(e,r.type);return Xc(t,n)};function tp(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){rp(e,t,r[t])}))}return e}function rp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const np="DTSS/",ip=(0,l.replace)(new RegExp("^entities/"),""),ap=e=>np+e.dataTenant+"/"+e.uri,op=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),sp=e=>!(!e||!e.dataTenant),lp=(0,l.startsWith)(np),up=(0,l.pipe)((0,l.ifElse)(lp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),cp=(0,l.ifElse)(sp,ap,(0,l.prop)("uri")),pp=e=>e&&e.uri?e.dataTenant?ap(e):ip(e.uri):"",dp=(0,l.curry)(((e,t,r)=>(Ei(t,r.type)||{})[e]||"")),yp=dp("label"),fp=dp("typeGraphIcon"),Tp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Ei(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(ys)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Hc(e,o,i),uri:a.uri}})).filter(l.identity):[]},Ep=(0,l.pipe)(Tp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),mp=(0,l.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,l.is)(Object,r.value)){const n=mp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):mp(e.slice(1),r)}})),hp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,bp=e=>(0,l.propOr)([],"matchRules",e),Op=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?tp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},vp=(e,t,r)=>t&&r?r.aEntity:e,gp=(0,l.evolve)({attributes:Sl(!0)}),_p=(0,l.pipe)(gp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Ap=e=>(0,l.assoc)("dataTenant",e);function Np(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){Pp(e,t,r[t])}))}return e}function Pp(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=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,l.propSatisfies)(n,"uri"),a=(0,l.pipe)((0,l.prop)("changes"),l.keys),o=(0,l.when)(i,(0,l.applySpec)({dcrObjectUris:a,dcrUri:(0,l.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},u=(0,l.pipe)(o,s,(()=>E())),c=(0,l.pipe)((0,l.prop)("dcrUri"),(0,l.unless)(l.isNil,(0,l.pipe)((0,l.split)("/"),(0,l.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+zl(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=l.identity;const m=()=>!e||f()||T?T||Promise.resolve():(T=new Promise((e=>{E=e})),Promise.resolve());return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f,getDcrUriAwait:m}},Sp=e=>{const t=(t,n)=>i=>{if(!(e=>!ue(e.value))(i)){var a,o;const s=`${n}/${null!==(a=i.refEntity)&&void 0!==a&&a.objectURI?sn(i.refEntity.objectURI):qr()}`;let u;const c=e.objectsInfo[null===(o=i.refEntity)||void 0===o?void 0:o.objectURI];return c&&(u=c.label,c.isExist||(i.refEntity.objectURI=`${e.uri}/changes/${i.refEntity.objectURI}`)),Np({},i,{label:u,uri:s,value:(0,l.fromPairs)((0,l.map)(r(t,s),(0,l.toPairs)(i.value)))})}return Np({},i,{uri:`${n}/${qr()}`})},r=(e,r)=>n=>{let[i,a]=n;return[i,(0,l.map)(t(`${e}/attributes/${i}`,`${r}/${i}`),a)]};return(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",ut.CREATE_ENTITY),(0,l.evolve)({newValue:e=>{const{uri:t,type:n}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(r(n,`${t}/attributes`)),l.fromPairs)},e)}}))))},e)},Ip=()=>{const e={newUriMap:{}};return{getUri:t=>(0,l.pathOr)(t,["newUriMap",t],e),addUriFromCreateRequest:t=>r=>{var n;return null!=r&&null!==(n=r[0])&&void 0!==n&&n.successful&&((t,r)=>{e.newUriMap=(0,l.assoc)(t,r,e.newUriMap)})(t,r[0].object.uri),r},hasNewUri:()=>!(0,l.isEmpty)(e.newUriMap)}};function wp(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){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Ke.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Dp=e=>{let{relationUri:t}=e;return{type:Ke.DELETE_RELATION,parameters:{relationUri:t}}},Lp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Ke.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},jp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Ke.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},kp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Ke.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Fp=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),Mp=e=>e.type===Ke.DELETE_RELATION,xp=e=>e.type===Ke.CREATE_RELATION,$p=e=>e.type===Ke.REPOINT_RELATION,Gp=e=>e.type===Ke.UPDATE_RELATION,Vp=async e=>{const t=[];for(const r of e){const e=await r();t.push(e);const n=Array.isArray(e)&&e.find((0,l.has)("errors"));if(n)throw n.errors}return t.flat()},Bp=e=>{let{type:t,parameters:r,dcrProcessor:n,relationUriProcessor:i}=e;const{enhanceUriWithDCR:a,updateDCRUriFromResponse:o}=n,s=e=>(o(e),e);switch(t){case Ke.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:o,attributes:l,startDate:u,endDate:c}=t;return Bf({startEntityUri:e,endEntityUri:n,relationType:o,attributes:l,startDate:u,endDate:c,uriPreprocessor:a}).then(s).then(i.addUriFromCreateRequest(t.uri))};case Ke.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Vf(e,a).then(s)};case Ke.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Hf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(s)};case Ke.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Wf({oldRelation:e,newRelation:t,uriPreprocessor:a}).then(s)};case Ke.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:a,isReversed:o}=r,{uri:s}=a,u=[Dp({relationUri:s}),Cp({parentUri:o?e:t,relation:a,entityUri:o?t:e})];return(0,l.pipe)((0,l.map)(Yp(n,i)),(0,l.map)(Bp),Vp)(u)}}},Wp=e=>t=>()=>e().then(t),Yp=(e,t)=>r=>wp({dcrProcessor:e,relationUriProcessor:t},r),qp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Rp({alwaysCreateDCR:e,dcrUri:t}),n=Ip();return{commandExecutor:e=>(0,l.pipe)(l.flatten,(0,l.map)(Yp(r,n)),(0,l.map)(Bp),(0,l.map)(Wp(r.getDcrUriAwait)),Vp)(e),dcrProcessor:r,relationUriProcessor:n}},Hp=e=>t=>(0,l.map)((t=>wp({},t,{parameters:(0,l.evolve)({parentUri:Zm(e),entityUri:Zm(e),newEntityUri:Zm(e)},t.parameters)})),t),Jp=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Kp=(e,t)=>{const r=e.filter(xp).find(Fp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Gp(o)&&Fp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!$p(o)||!Fp(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(Jp({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},Qp=(e,t)=>{const r=e.filter($p).filter(Fp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Gp(i)||!Fp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Jp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Xp=(e,t)=>{const r=e.filter(Mp).filter(Fp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Fp(t,e)))},zp=(e,t)=>{const r=e.filter(Gp).filter(Fp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Gp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Jp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},Zp=e=>{const t=e.filter(Mp).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Xp,e)},ed=e=>{const t=e.filter(xp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Kp,e)},td=e=>{const t=e.filter($p).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Qp,e)},rd=e=>{const t=e.filter(Gp).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(zp,e))(t)},nd=e=>(0,l.pipe)(Zp,ed,td,rd)(e);function id(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){ad(e,t,r[t])}))}return e}function ad(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const od=e=>id({},(0,l.path)(Sd(),e),{startDate:(0,l.path)(Cd(),e),endDate:(0,l.path)(Dd(),e)}),sd=(e,t)=>(0,l.pipe)((0,l.path)(Ud()),Zm(t))(e),ld=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=sd(e,r),i=(0,l.path)(Id(),e)===Qe.IN,a=e.parentEntityUri||n;return Cp({parentUri:i?t:a,relation:od(e),entityUri:i?a:t})})),...o.map((t=>{const i=sd(t,r),a=(0,l.path)(Id(),t)===Qe.IN,o=i!==(0,l.pipe)((0,l.path)(Sd()),a?Ld:jd)(t),s=Md(e,(0,l.path)(Pd(),t)),u=t.parentEntityUri||n,c=Zm(r,i);return o?kp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Sd(),t),isReversed:!1}):jp({oldRelation:(0,l.path)(Sd(),s),newRelation:od(t)})})),...i.map((e=>Dp({relationUri:e}))),...s.map((e=>Lp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},ud=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return id({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),cd=(0,l.has)("dataTenant"),pd=(0,l.ifElse)(cd,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),dd=(e,t)=>(0,l.pipe)(Ni,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Ys),Ba)(e,t);function yd(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){fd(e,t,r[t])}))}return e}function fd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Td=e=>(0,l.prop)("uri",e),Ed=e=>Td(e)?e.uri:e,md=e=>t=>Ed(t)===e,hd=(0,l.curry)(((e,t)=>{const r=(n,i)=>{var a;let o=Ed(i),s=!1;o.startsWith("!")&&(o=o.slice(1),s=!0);const u=e[o]&&ji(Di.READ,e[o]),c=n.find(md(o))||!u?n:n.concat(Td(i)?yd({},i,{uri:o}):null!==(a=t.find(md(o)))&&void 0!==a?a:o);return s?c:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==o||t.find(md(n))?t:r(t,n)),c)};return t.reduce(r,[])})),bd=(0,l.curry)(((e,t)=>{const r=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r.reduce(((r,n)=>{const i=Ed(n),a=(0,l.path)([i,t,"objectTypeUri"],e);return!a||r.find(md(a))?r:r.concat(a)}),[])};return yd({},t,{entityTypes:[...r("startObject",t.inRelations),...r("endObject",t.outRelations)]})})),Od=(0,l.indexBy)((0,l.prop)("uri")),vd=(0,l.curry)(((e,t)=>{const r=Od(e.relationTypes),n=Od(e.entityTypes),i=e=>(0,l.evolve)({inRelations:hd(r),outRelations:hd(r),entityTypes:hd(n),nextEntry:i},e);return(0,l.pipe)((0,l.unless)((0,l.either)((0,l.prop)("nextEntry"),(0,l.prop)("entityTypes")),bd(r)),i)(t)})),gd=(e,t)=>(0,l.evolve)({content:vd(e)},t),_d=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,l.pipe)((0,l.assoc)("relationType",t),(0,l.assoc)("relationLabel",r),(0,l.assoc)("object",{type:t,attributes:{},uri:i}),(0,l.assoc)("direction",n))(e)}},Ad=(e,t,r)=>{const n=Bc(t,e.dataLabelPattern),i=(0,l.lensProp)("entity");return(0,l.over)(i,(0,l.evolve)({entityLabel:(0,l.always)(n),object:{label:(0,l.always)(n)}}),r)},Nd="relation",Pd=(0,l.always)([Nd,"relationUri"]),Rd=(0,l.always)([Nd,"relationType"]),Sd=(0,l.always)([Nd,"object"]),Id=(0,l.always)([Nd,"direction"]),wd=(0,l.always)([Nd,"object","attributes"]),Ud=(0,l.always)(["entity","entityUri"]),Cd=(0,l.always)([Nd,"startDate"]),Dd=(0,l.always)([Nd,"endDate"]),Ld=(0,l.path)(["startObject","objectURI"]),jd=(0,l.path)(["endObject","objectURI"]),kd=(0,l.path)(["startObject","objectTypeURI"]),Fd=(0,l.path)(["endObject","objectTypeURI"]),Md=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Pd()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Md(r.connections,t);if(e)return e}}},xd=(0,l.pipe)(Md,(0,l.path)(Sd())),$d=(0,l.allPass)([(0,l.pipe)((0,l.path)(Ud()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(Rd()),(0,l.complement)(E))]),Gd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:zr()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Wd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Vd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?_d(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Vd=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:Pe.IN}:{type:t[0],direction:Pe.OUT}:null},Bd=e=>e.uri||e,Wd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Mi(i,t)&&$i(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Pe.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Ei(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ei(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Bd,Ni(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Pe.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Pe.OUT)),(0,l.map)(u))},t)||{}},Yd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=wi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Ri(e,n.uri);return n&&(!t||hi(e,i,t))&&(!r||hi(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Ei(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ei(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(ls,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},qd=(0,l.curry)(((e,t,r,n,i)=>{const a=hi(n,l.__,t.type),o=e?Fd:kd,s=hi(n,l.__,r.type),u=e?kd:Fd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Hd=(e,t,r)=>{const n=e?Fd:kd,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(hi(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kd=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}},Qd=e=>!e.deactivated,Xd=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},zd=e=>Xd(e)+e.message,Zd=(0,l.unless)(l.isNil,(0,l.prop)("message")),ey=(0,l.unless)(l.isNil,(0,l.prop)("type")),ty=(0,l.curry)(((e,t)=>an(t.parentUri,e))),ry=(0,l.curry)(((e,t)=>t.parentUri===e)),ny=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),an(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",ft.TYPE_REFERENCE),(0,l.pipe)(_n,(0,l.any)(an(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),iy=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),ay=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),oy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([fy,Qd,ty(e),ny(t),(0,l.complement)(ay(e,t.uri))]))(r)},sy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([fy,Qd,ry(e),iy(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",Re.missed))]))(r);return n&&n.message||""},ly=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===Re.missed))},uy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Qd,(0,l.propEq)("type",Re.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Pd(),e))]))(t)},cy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Qd,(0,l.propEq)("type",Re.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},py=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([Qd,ty(t)]))(r)},dy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Qd,(0,l.propEq)("type",Re.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},yy=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?ch(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 Ce.attributeValue:{const e=a;if(Gn(a))return Bc(o,e.dataLabelPattern);if(Vn(a)){const t=o,i=_s(t),a=vn(e),s=Ei(n,a);return Qr(i)?Bc(r[i],s.dataLabelPattern):t.label}return""}case Ce.tempEntity:return Bc(o,a.dataLabelPattern);case Ce.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Ei(n,null==e?void 0:e.entityType);return`${Yc(i&&Qr(i)?Bc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Pi(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){Jd(e,t,r[t])}))}return e}({},e,{label:Yc(t)})}))},fy=e=>!e.severity||e.severity===Ie.ERROR,Ty=(e,t,r)=>(0,l.allPass)([(0,l.pipe)((0,l.prop)("uri"),E),(0,l.propEq)("parentUri",t),(0,l.propEq)("attributeTypeUri",r)])(e),Ey=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case ft.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(Ey(n))}));case ft.TYPE_REFERENCE:return!!Es(t);case ft.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),my=(e,t)=>e.every((0,l.complement)(Ey(t))),hy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=jo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Ss(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!ys(e.parent))))).forEach((e=>{my(e.attrValues,n)&&r.push(Kd({type:Re.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:de().text("Attribute is required"),source:Se.local}))})),r}),[])},by=(0,l.curry)(((e,t,r)=>Ss(e,t,r,!1))),Oy=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Ei(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(xn),(0,l.filter)(Vn),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(by(e,t)));return(0,l.pipe)(r,(0,l.reject)(_s),(0,l.map)((e=>{let{uri:r}=e;return Kd({type:Re.missedRefEntity,uri:"",attributeTypeUri:pn(r,t.type),parentUri:r,message:de().text("Entity is required"),source:Se.local})})))(t)},vy=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(_s,Qr)).flatMap((n=>{const i=_s(n),a=t[i],o=Xn(e,pn(n.uri,r.type));return gy(e,t,o,a)})),gy=(e,t,r,n)=>{const i=_n(r),a=i.map((t=>Xn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",ft.TYPE_REFERENCE))).flatMap(Nn).concat(i);return _y(e,t,n,(e=>a.some(an(e.uri))))},_y=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=hy(e,r,n),a=Oy(e,r),o=vy(e,t,r);return[...i,...a,...o]},Ay=(e,t)=>({attributes:{[e.name]:[t]},type:dn(e.uri),uri:dn(t.uri)}),Ny=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Ay(t,r),a=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(r[0]||e).uri;return t.uri===n};return _y(e,n,i,a)},Py=(e,t)=>{const r=(0,l.path)(Sd(),t)||{};return hy(e,r)},Ry=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Ud()),(0,l.ifElse)(Qr,(e=>t[e]),(0,l.always)(null)))(r),i=Py(e,r),a=(e=>(0,l.path)(Ud(),e)?[]:[Kd({type:Re.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(Rd(),e),parentUri:(0,l.path)(Pd(),e),message:de().text("Entity is required"),source:Se.local})])(r),o=((e,t,r)=>r?_y(e,t,r):[])(e,t,n);return[...i,...a,...o]},Sy=e=>(0,l.path)(["entity","uri"],e)?[]:[Kd({type:Re.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:de().text("Entity is required"),source:Se.local})],Iy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=hy(e,r),i=Sy(t);return[...n,...i]};function wy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uy=(e,t)=>{var r,n;const i=Ei(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||oo(e)},Cy=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Dy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(Cy(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},Ly=(e,t)=>(0,l.when)((0,l.prop)("refEntity"),(0,l.pipe)((0,l.when)((0,l.allPass)([(0,l.prop)("refRelation"),(0,l.always)("INSERT_ATTRIBUTE"===t),(0,l.pipe)(As,Qr,l.not)]),(e=>{const t=(0,l.pipe)(As,sn)(e);return Dy((e=>e.replace(t,t+Vr)))(e)})),(0,l.when)((0,l.pipe)(_s,Qr),(t=>{const r=_s(t),n=e[r],i=n&&ky(n,e);return null!=i&&i.attributes?(0,l.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){wy(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),jy=(e,t,r,n)=>Gh(Mh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Wh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,n).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(Ly(r,e.type)),(0,l.map)(Dy(mn))))})(e))).concat(Qm(e,t)),ky=(e,t)=>(0,l.evolve)({attributes:Pl({valueTransformer:(0,l.pipe)(Rs,Ly(t),Cy(mn)),deleteEmptyComplex:!0}),uri:mn})(e);function Fy(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){My(e,t,r[t])}))}return e}function My(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Gr,"g"),"uri$$$$").replace(new RegExp(Vr,"g"),""))),$y=e=>(0,l.pipe)((0,l.evolve)({objectUri:xy,objectParentUri:xy}),(e=>{return Fy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?Re.missed:Re.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&En(e.objectUri),uri:e.objectUri,source:Se.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Gy=(e,t)=>(0,l.map)((0,l.pipe)($y,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=yy(t,s),p=null!=c&&c.length?c.slice(0,-1):yy(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Xn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Ce.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Fy({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,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&&Tn(i)){const n=(0,l.last)(a),i=n.valueType;if(Vn(i)&&Pn(i).includes(o)){const i=_s(n.value),o=i&&Qr(i)?t[i]:null;return o?Fy({},e,{parentUri:o.uri,path:a.concat({type:Ce.tempEntity,value:o,valueType:Ei(r,o.type),label:""})}):e}}return e}})(t)))(e),Vy=e=>{if(e.type===Ue.AGO||e.type===Ue.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Ue.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},By=e=>`equals(user, '${ku(e)}')`,Wy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Yy=e=>`equals(items.objectType, '${e.uri}')`,qy=e=>{const{period:t,type:r}=e;if(!Vy(e))return"";switch(r){case Ue.WITHIN:return`gte(timestamp, ${X(t)})`;case Ue.AGO:return`lte(timestamp, ${X(t)})`;case Ue.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},Hy=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Jy=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Ky=e=>{let{query:t,body:r}=e;return t=Jy(t),Yl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Qy=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,l.pipe)(Lc(),jc(t.globalFilter))(n),activeness:t.activityFilter||_e.ACTIVE_ONLY,options:t.searchOptions};return(0,l.reject)(E,i)},Xy=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;return Yl("/entities/_total",{method:"POST",body:JSON.stringify(Qy(e,t,r))})},zy=e=>Yl("/entities/_total",{method:"POST",body:JSON.stringify(Object.fromEntries(new URLSearchParams(e).entries()))}),Zy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(us),(0,l.map)((0,l.prop)("uri")))(e),i={filter:ye.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(Lc(),jc(r.globalFilter))([i,a]),s=(0,l.reject)(E,{filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||_e.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return Yl("/entities/_typeAheadSearch",{method:"POST",body:JSON.stringify(s)})},ef=(0,l.pipe)((0,l.reject)(l.isNil),Zl),tf=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(Lc(),jc(i))(r),p=ef({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Ky({query:p,body:d})},rf=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return tf({fieldName:t,searchParams:i,options:n})};function nf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const af="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",of=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=(0,l.reject)(E,{filter:(0,l.pipe)(Lc(),jc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||af,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null,options:t.searchOptions});return i},sf=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=of(e,t,r);return Yl("/entities/_search",{method:"POST",body:JSON.stringify(n)})},lf=e=>ff(e,{select:"secondaryLabel"}),uf=(e,t)=>{const{select:r=af,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Yl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},cf=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Qr)),pf=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:u,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=cf(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Yn(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(Lc(),jc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),Yl(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},df=e=>`entities?filter=equals(uri,'${e}')&offset=0`,yf={options:"sendHidden,addRefAttrUriToCrosswalk"},ff=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yf;return Yl(`/${e}${eu(t)}`)},Tf=(e,t)=>ff(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){nf(e,t,r[t])}))}return e}({},yf,{explicitSurvivorshipGroup:t})),Ef=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",body:JSON.stringify([e])},n=t("/entities");return Yl(n,r)},mf=e=>Yl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),hf=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return Yl(`/${e}/_clone${eu({executeLCA:!1,valuesToCopy:r})}`,n)},bf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Yl(`/entities/_events/_total${Zl({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Of=(e,t)=>Yl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),vf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Yl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},gf=e=>ff(e,{select:"updatedTime"}),_f=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 Yl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Zl)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Af=e=>{const t=new FormData;return t.append("file",e),Yl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=gr(e,de().text("Can't upload file"));return Promise.reject(t)}))},Nf=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 Yl(`/personal/findSavedSearches${Zl({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"}})},Pf=e=>Yl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Rf=e=>Yl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Sf=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Yl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},If=e=>{let{uri:t}=e;return Yl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},wf=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Sf)(e),Uf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Sf)(e);function Cf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Df=["max","offset","filter"],Lf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Lf(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){Cf(e,t,r[t])}))}return e}({},t,(0,l.pick)(Df,e)))),jf=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],ke.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],ke.ALL,e)))return!1},kf=(0,l.omit)(["activeness"]),Ff=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=jf(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Lf(e),(0,l.omit)(Df))(e))),kf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${eu(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Mf=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),xf=(0,l.reject)(l.isNil),$f=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Gf=e=>Yl($f(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Vf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,$f);return Yl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Bf=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=l.identity}=e;const u={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?Sl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(xf,ne,JSON.stringify);return Yl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Wf=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=l.identity}=e;const i=(0,l.prop)("attributes"),a=(0,l.pipe)((0,l.prop)("uri"),(0,l.concat)(l.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),$f,n),o=Mh(i(t),i(r),!1).concat($h(t,r));return Yl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Yf=(e,t,r)=>{const{url:n,options:i}=Ff(e,t,r);return Yl(n,i).then(Mf)},qf=(e,t)=>Yl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Hf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Pe.IN?a.inRelations=[n]:a.outRelations=[n],Yl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Jf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Yl(`${t}/recentSearches${eu({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Kf=e=>Yl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Qf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Yl(`/recentSearches${eu({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Xf(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){zf(e,t,r[t])}))}return e}function zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zf={select:"label,secondaryLabel,name,type,startDate,endDate"},eT=(0,l.reject)(l.isNil),tT=(0,l.pipe)(eT,Zl),rT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=Xf({},Zf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Yl(`/${t}/_tree${tT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},nT=e=>{let{uri:t,graphUri:r}=e;const n=Xf({},Zf,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Yl(`/${t}/_parents${tT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},iT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s,signal:l}=e;const u=Xf({},Zf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Yl(`/${t}/_hops${tT(u)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:l})};function aT(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 oT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},sT="/activities",lT=e=>{let{label:t,description:r}=e;return Yl(sT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:oT()}})};var uT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(uT||(uT={}));const cT=e=>{const t=eu(e);return Yl(sT+t,{method:"GET"})},pT=e=>Yl(`/activities/_total${eu(e)}`,{method:"GET"}),dT=e=>{const{entityUri:t}=e,r=aT(e,["entityUri"]);return Yl(`/${t}/_activities${eu(r)}`,{method:"GET"})},yT=e=>{const{entityUri:t}=e,r=aT(e,["entityUri"]);return Yl(`/${t}/_activities/_total${eu(r)}`,{method:"GET"})};function fT(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){TT(e,t,r[t])}))}return e}function TT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ET=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},mT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Yl(ET({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},hT=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=ET({url:r,workflowPath:t,tenant:n})),Yl(s,{method:i||"GET",body:JSON.stringify(a),headers:fT({"Content-Type":"application/json"},null!=o?o:{})})},bT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=ET({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Yl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},OT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=ET({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?fT({},l,{comment:o}):l;return Yl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},vT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=ET({url:`/tasks${s?eu(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(fT({objectURIs:[i]},(0,l.reject)(E,a)))};return Yl(u,fT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},gT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Yl(ET({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},_T=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Yl(ET({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(fT({max:a,offset:o},i))})},AT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Yl(ET({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},NT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Yl(ET({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},RT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Yl(ET({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a,processInstanceComment:o}=e;return Yl(ET({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a,processInstanceComment:o})})},CT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Yl(ET({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},DT=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return Yl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Zl)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},LT=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 Yl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Zl)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},jT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Yl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},kT=(e,t,r)=>Promise.all(t.map((async t=>await Yl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),FT=async(e,t)=>await kT(e,t,"NOT"),MT=async(e,t)=>await kT(e,t,"MATCH"),xT=async(e,t)=>await Promise.all(t.map((async t=>await Yl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function $T(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){GT(e,t,r[t])}))}return e}function GT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VT(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 BT=3e4,WT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Yl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},YT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return cE({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},qT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return cE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},HT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Yl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},JT=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 HT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},KT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(sp,i);return Promise.all([s.length?jT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return HT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},QT=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return r.map((0,l.assoc)("matchRule",t))})),(0,l.reduce)(((e,t)=>{let{matchRule:r}=t,n=VT(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,l.adjust)(i,(0,l.evolve)({matchRules:(0,l.append)(r)}),e)}),[])),XT=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),QT),zT=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return Yl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(XT)},ZT=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,l.map)((0,l.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(l.flatten)},eE=ZT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Yl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json",SearchMetadata:"AUTO"},body:JSON.stringify([{uri:a,type:o}])}).then(XT)})),tE=ZT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Yl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),rE=(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(l.flatten)}return t(...arguments)}},nE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Yl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},iE=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 nE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},aE=iE("NOT"),oE=iE("MATCH"),sE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(sp,a);return Promise.all([kT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return nE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},lE=sE("NOT"),uE=sE("MATCH");function cE(e){let{requestProvider:t=Yl,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}`,$T({},VT(s,["headers"]),{headers:$T({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const pE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;const s=function(e){const t=of(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:"");return`/entities${eu(t)}`}(t,r,n);return cE({url:s,dataTenant:i,customerTenant:a,dtssPath:o})},dE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return cE({url:"/entities/_total",dataTenant:i,customerTenant:a,dtssPath:o,options:{method:"POST",body:JSON.stringify(Qy(t,r,n))}})},yE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Ff(t,r);return cE({url:`entities/_connections/_getConnections${eu({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Mf,(0,l.map)((0,l.evolve)({connections:(0,l.map)((0,l.pipe)((0,l.assocPath)(["entity","dataTenant"],n),(0,l.assocPath)(["relation","dataTenant"],n)))}))))},fE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return cE({url:`${df(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},TE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Yl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},EE=e=>{let{dtssPath:t,tenant:r}=e;return Yl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:BT})},mE=e=>{let{dtssPath:t,customerTenant:r}=e;return Yl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:BT})},hE=e=>{let{dtssPath:t,tenants:r}=e;return Yl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:BT})},bE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return cE({url:df(t),dataTenant:r,customerTenant:n,dtssPath:i})},OE=()=>Yl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function vE(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){gE(e,t,r[t])}))}return e}function gE(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=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=vE({},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 Yl(`${t}/api/${r}/graph/search${eu({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},AE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Yl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:vE({},n,i),headers:{"Content-Type":"application/json"}})},NE=(e,t)=>`${e}/${t}/comments`,PE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Yl(`${NE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},RE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Yl(`${NE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},SE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Yl(NE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},IE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Yl(`${NE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},wE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Yl(`${NE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},UE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return Yl(`${NE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},CE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return Yl(`${NE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},DE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Yl(`${NE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},LE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=eu({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Yl(`${NE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function jE(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){kE(e,t,r[t])}))}return e}function kE(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{tenant:t,servicesPath:r}=e;return Yl(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ME="graphExport",xE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await BE({servicesPath:e,tenant:t,environment:r,namespace:ME,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(jE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await BE({servicesPath:e,tenant:t,environment:r,namespace:ME,options:jE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await BE({servicesPath:e,tenant:t,environment:r,namespace:ME,options:jE({method:"POST"},o)})),s},$E=e=>{let{servicesPath:t,key:r}=e;return Yl(`${t}/settings${eu({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},GE=e=>{let{servicesPath:t}=e;return Yl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},VE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Yl(`${n}/plugins${eu({tenant:t,user:r})}`,{method:"GET"})},BE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Yl(`${n}/configService${eu({tenant:t,environment:r,namespace:a,projection:o})}`,i)},WE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return BE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},YE=e=>{let{servicesPath:t,stateHash:r}=e;return Yl(`${t}/searchLink?key=${r}`,{method:"GET"})},qE=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),Yl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},HE=e=>Yl(`/${e}?showObjectsInfo=true`,{method:"GET"}),JE=e=>{let{exportPath:t,tenant:r,options:n}=e;return Yl(`${t}/${r}/activities${eu(n)}`,{method:"POST"})};function KE(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}const XE=e=>{const{entityUri:t}=e;return Yl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},zE=e=>{let{entityUri:t,crosswalk:r}=e;return Yl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},ZE=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Yl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[KE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),KE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},em=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Yl(`/${r}/_${n}${eu({contributorURI:t})}`,{method:"POST"})},tm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Yl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},rm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Yl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},nm=e=>{let{entityUri:t,crosswalkId:r}=e;return Yl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function im(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const am=e=>{let{entityTypeUri:t}=e;return Yl(`/dataQuality/fillRates${Zl({entityType:sn(t)})}`,{method:"GET"})},om=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},sm=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){im(e,t,r[t])}))}return e}({},n===Je.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Je.ATTRIBUTE_TYPE?Zl({numberOfThreads:om({attributes:r,metrics:i})||1}):"";return Yl(`/entityType/${sn(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},lm=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Yl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${sn(n)}`,{method:"GET",headers:{env:i}})},um=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Je.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u,anomaly:c}=e;const p={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u,anomaly:c};return Yl(`${t}/${r}/entityType/${sn(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(p)})},cm=e=>{let{tenant:t,apiPath:r}=e;return Yl(`${r}/permissions/${t}`,{method:"GET"})},pm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Yl(`/${t}${eu({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},dm=e=>{let{attributeUri:t,value:r}=e;return Yl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},ym=e=>{let{attributeUri:t,value:r}=e;return Yl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},fm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Yl(`/${t}${eu({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Tm=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=eu({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Sl()([[{value:a}]]);return Yl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Em=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Yl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},mm=e=>{let{entityUri:t,attributeName:r}=e;return Yl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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 bm=e=>{let{entityUri:t}=e;return Yl(`/${t}/_historicURIs`,{method:"GET"})},Om=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 Yl(`/${t}/_changesWithTotal${eu(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){hm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},vm=(e,t)=>Yl(`/${e}/_previousChange${eu({timestamp:t})}`,{method:"GET"}),gm=(e,t)=>Yl(`/${e}${eu({time:t})}`,{method:"GET"});function _m(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){Am(e,t,r[t])}))}return e}function Am(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ue(n)?JSON.stringify(n):n),Yl(t,{method:o,body:s,headers:_m({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Pm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=eu({options:a.join(","),severity:o.join(",")});return Yl(`${t}/validate/${i}/entity/${pp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Rm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Yl(`${t}/validate/${n}/entity${eu({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Sm=e=>{let{tenant:t,apiPath:r}=e;return Yl(`${r}/tenants/${t}/name`,{method:"GET"})},Im=e=>{let{tenant:t,apiPath:r}=e;return Yl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},wm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Yl(`${a}/preferences${eu({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Um=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 Yl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Cm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Yl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Dm=e=>{const{servicesPath:t}=e;return Yl(`${t}/getTokenForWorker`,{method:"GET"})};var Lm=r(29524);const jm=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Xr(),s={attributes:Tl({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=Ss(r,e,n.uri)[0];return i&&i.value?vl({entity:e,attributeType:n,uri:i.uri,value:t}):bl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},km=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(_s),(0,l.filter)(Qr),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Fm=(0,l.curry)(((e,t)=>{const r=km(e=e||{},t=t||{});return r.concat((0,l.chain)(Fm(e),r))})),Mm=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),xm=Mm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),$m=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Qr)),Gm=e=>(0,l.pipe)(xm,$m(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Vm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(xm,(0,l.find)((t=>(0,l.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,l.set)((0,l.lensPath)(n),t,r):r})),Bm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Qr),(0,l.omit)(["uri","timestamp"])),Wm=(0,l.pipe)(Bm,gp),Ym=async(e,t,r)=>{if(!e)return null;const n=Gm(e);if(n.length>0)for(const r of n)e=Vm(r,t[r],e);const i=await Ef(Wm(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},qm=async(e,t,r)=>{const n=Jm(e,t),i={};for(const t of n)i[t]=await Ym(e[t],i,r);return i},Hm=(0,l.curry)(((e,t)=>{const r=Lm.Node(t);return Gm(e[t]).forEach((t=>{const n=Hm(e,t);r.addEdge(n)})),r})),Jm=(e,t)=>(0,l.pipe)((0,l.map)(Hm(e)),(0,l.map)(Lm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Km=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Bm))})),Qm=(e,t)=>[...Yh(e.tags||[],t.tags||[]),...qh(e.roles||[],t.roles||[]),...xh(e,t),...$h(e,t)],Xm=(e,t,r)=>[...Gh(Mh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Wh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,r),...Qm(e,t)],zm=(0,l.pipe)(((e,t)=>{const r=(0,l.toPairs)(e);return(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return Vm(r,n,e)}),e))))}),t)}),Km),Zm=(0,l.curry)(((e,t)=>(0,l.when)(Qr,(0,l.propOr)(l.__,t,e),t)));function eh(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}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}const rh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return eh({},t,{[r]:{parents:n,children:i}})},nh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return eh({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},ih=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=km(t,i),o=rh({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>ih(n.uri,t,[e],r)),o)},ah=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,l.path)(Pd(),n),a=t?nh({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Ud(),n),s=Qr(o)?[o]:[],u=rh({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>ih(t,r,[i],e)),u)}),n)},oh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return ah(r,e,t,ih(e,t))},sh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return oh(t,r,n);if(en(e)){const t=Md(n,e);return t&&ah([t],null,r)}return r[e]?ih(e,r):void 0},lh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>lh(e,t))))},uh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>uh(e,t))))},ch=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Zr(t),u=oh(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 u=t[e],c=t[e+1]||r;if(en(c)){if(s=Md(i,c),!s)return null;o.push({type:Ce.relationConnection,value:s,valueType:Ni(a,(0,l.path)(Rd(),s))});continue}if(en(u)){const e=n[c];if(!e)return null;o.push({type:Ce.tempEntity,value:e,valueType:Ei(a,e.type)});continue}const p=n[u],d=Bs(p,c),y=n[c];if(!d||!y)return null;o.push({type:Ce.attributeValue,value:d,valueType:Xn(a,pn(d.uri,p.type))}),o.push({type:Ce.tempEntity,value:y,valueType:Ei(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},uh(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=en(s),d=p?xd(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?Ni(a,d.type):Ei(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:zn(a,E);if(E=null==t?void 0:t.find((0,l.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:Ce.tempEntity,value:T,valueType:Ei(a,T.type)}),o.push({type:Ce.attributeValue,value:s,valueType:E}),m=s.value;const l=_s(s);T=l&&Qr(l)?n[l]:null}}return o},ph=e=>e.every((e=>{let{type:t}=e;return[Ce.attributeValue,Ce.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Ce.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let dh;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(dh||(dh={}));const yh={[dh.insertAttribute]:{color:"#599E0E"},[dh.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[dh.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},fh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return dh.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return dh.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return dh.deleteAttribute;default:return""}},Th="/",Eh=(0,l.pipe)((0,l.split)(Th),(0,l.propSatisfies)((0,l.lte)(2),"length")),mh=(0,l.pipe)((0,l.split)(Th),(0,l.slice)(0,-2),(0,l.join)(Th)),hh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>Eh(e),hh(mh(e))]])(t))),bh=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+Th))),Oh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=hh(e,t);return(0,l.isNil)(r)?bh(e)(t)?"UPDATE_ATTRIBUTE":"":r},vh=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]},gh=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(gh(e))}))}))),t},_h=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Rh,t),(0,l.propOr)([],"crosswalks",e))),e),Ah=(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(Ah(e))}))})),r},Nh=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=Nh(e);r>t&&(t=r)}))})),t+1):t},Ph=(e,t)=>{if(Qr(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Rh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Sh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Ih=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},wh=(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,l.pipe)((0,l.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,l.reject)(l.isNil),l.uniq,(0,l.ifElse)((e=>{let{length:t}=e;return 1===t}),l.head,(()=>{})))(e)},Uh=(0,l.eqBy)(Rh),Ch=(0,l.pipe)((0,l.propOr)({},"attributes"),l.values,l.flatten,(0,l.filter)((0,l.has)("refRelation")),(0,l.chain)((e=>(0,l.pipe)(ms,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function Dh(e){return e&&void 0!==e.uri}let Lh;function jh(e){return function(t,r){const n=[];return a=r,!(i=t)&&!a||!(!i||!a)&&i.length===a.length&&i.every((function(e,t){return e===a[t]}))||n.push({type:e,newValue:r}),n;var i,a}}function kh(e){return void 0!==e.refEntity}function Fh(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 Mh(e,t,r){const n=[];for(const a in e)if(e.hasOwnProperty(a)){if("paging"===a)continue;const p=e[a];if(void 0===t[a])for(const e in p)p.hasOwnProperty(e)&&n.push(...o(p[e]));else for(const e in p)if(p.hasOwnProperty(e)){const f=p[e],T=y(f,t[a]);void 0===T?n.push(...o(f)):f.value===T.value||f.lookupCode&&f.lookupCode===T.lookupCode?f.ignored!==T.ignored&&n.push(...s(T)):null==T.value||""===T.value?n.push(...o(f)):"Nested"===d(f)?f.ignored!==T.ignored&&(0,l.equals)(f.value,T.value)?n.push(...s(T)):n.push(...Mh(f.value,T.value,r)):"Reference"===d(f)?Fh(f,T)?n.push(...Mh(f.value,T.value,r)):(n.push(...o(f)),n.push(c([T]))):""!==T.value&&(!1===T.ov?n.push(...u(T)):n.push(...(i=T,[{type:Lh.UPDATE_ATTRIBUTE,uri:i.uri,newValue:{value:i.lookupCode||i.value}}])))}}var i;for(const r in t)if(t.hasOwnProperty(r)){if("paging"===r)continue;let i=(t[r]||[]).filter((function(t){return void 0===y(t,e[r])}));i=a((0,l.clone)(i)),i.length&&n.push(c(i))}return n;function a(e){return e?e.map((function(e){let t;if(e){const r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){const n=a(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 o(e){return[{type:Lh.DELETE_ATTRIBUTE,uri:e.uri}]}function s(e){return e&&(e.ignored?function(e){return[{type:Lh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:Lh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!1}}]}(e))}function u(e){const t=e.uri.lastIndexOf("/"),r=e.uri.substr(0,t);return[{type:Lh._UPDATE_NON_OV_ATTRIBUTE,uri:e.uri,typeUri:r,value:e.lookupCode||e.value}]}function c(e){let t=e[0].uri;const n=t.lastIndexOf("/");return t=t.substr(0,n),{type:Lh.INSERT_ATTRIBUTE,uri:t,newValue:e.map((function(e){let t;const n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),p(n.value),kh(e)&&(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}))}}function p(e){if(null!==e&&"[object Object]"===e.toString())for(const t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,p(e.value)}))}function d(e){const t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function y(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function xh(e,t){const r=[];var n,i;return e.defaultProfilePic!==t.defaultProfilePic?r.push({type:Lh.UPDATE_PROFILE_PIC_BY_URI,newValue:{value:t.defaultProfilePic}}):(n=e.defaultProfilePicValue)===(i=t.defaultProfilePicValue)||Dh(n)&&Dh(i)&&n.uri===i.uri||r.push({type:Lh.UPDATE_PROFILE_PIC_BY_URL,newValue:{value:t.defaultProfilePicValue}}),r}function $h(e,t){const r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:Lh.UPDATE_START_DATE,newValue:{value:n}});const i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:Lh.UPDATE_END_DATE,newValue:{value:i}}),r;function a(e,t){let r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Gh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i="configuration/sources/Reltio",a="configuration/sources/ReltioCleanser";function o(e,t){return e.crosswalk={type:t.type,value:t.value},e}function s(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function l(e){return e.removeIt=!0}const u=e.map((function(e){if(e.crosswalk)return[e];const s=Vh(t,e.uri),l=s.filter((function(e){return e.type===i})),u=s.filter((function(e){return e.type!==i}));let c=[];switch(e.type){case Lh.INSERT_ATTRIBUTE:c.push(e);break;case Lh._UPDATE_NON_OV_ATTRIBUTE:c=c.concat(s.map((function(t){return o(e,t)})));break;case Lh.DELETE_ATTRIBUTE:(u.length||0==l.length)&&c.push({type:Lh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}),c=c.concat(l.map((function(t){return o({type:Lh.DELETE_ATTRIBUTE,uri:e.uri},t)})));break;case Lh.UPDATE_ATTRIBUTE:{const s=u.some((e=>{let{type:t}=e;return t===a}))&&r?Bh(r,t,e.uri):null;if(s||l.length){if(l.length)c=c.concat(l.map((function(t){return o({type:Lh.UPDATE_ATTRIBUTE,uri:e.uri,newValue:e.newValue},t)})));else if(s){const r=Vh(t,s.uri).filter((e=>{let{type:t}=e;return t===i}));c=c.concat(r.map((t=>o({type:Lh.UPDATE_ATTRIBUTE,uri:s.uri,newValue:e.newValue},t))))}}else c.push({type:Lh.INSERT_ATTRIBUTE,uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});u.length&&n&&c.push({type:Lh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}});break}}return c}));let c=u.flat();const p=s(c,"typeUri");for(const e in p){if("undefined"===e)continue;const t=p[e],r=c.filter((function(e){return e.type!==Lh._UPDATE_NON_OV_ATTRIBUTE})).filter((function(t){return t.uri.substr(0,t.uri.lastIndexOf("/"))===e||"INSERT_ATTRIBUTE"===t.type&&t.uri===e})),n=t.find((function(e){const{crosswalk:t}=e;return t&&t.type===i}));!r.find((function(e){return"UPDATE_ATTRIBUTE"===e.type}))&&n&&(c.push({type:Lh.UPDATE_ATTRIBUTE,uri:n.uri,newValue:{value:n.value},crosswalk:n.crosswalk}),r.forEach(l)),t.forEach(l)}return c=c.filter((function(e){return!e.removeIt})),c.forEach((function(e){delete e.insteadOfUpdate})),c}!function(e){e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_TAGS="UPDATE_TAGS",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e._UPDATE_NON_OV_ATTRIBUTE="_UPDATE_NON_OV_ATTRIBUTE"}(Lh||(Lh={}));const Vh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Bh=(e,t,r)=>(0,l.pipe)(Ws,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return Ph(t,r)},e=>{let[t]=e;return!ys(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Wh(e,t){t=t||[];for(const r in e)if(e.hasOwnProperty(r)){const n=e[r];for(let e=0;e<n.length;e++){const r=n[e];if(kh(r)&&r.refRelation){const e=r.refRelation[0]||r.refRelation;if(e.crosswalks){const r=e.crosswalks.filter((function(e){return e.attributes||e.attributeURIs}));for(let e=0;e<r.length;e++){let n=!0;for(let i=0;i<t.length;i++)if(t[i].type===r[e].type&&t[i].value===r[e].value){t[i].attributes=t[i].attributes||t[i].attributeURIs,t[i].attributes=t[i].attributes.concat(r[e].attributes||r[e].attributeURIs),t[i].attributes=Object.keys(t[i].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[i].attributeURIs,n=!1;break}n&&t.push(r[e])}}}}}return t}function Yh(e,t){return jh(Lh.UPDATE_TAGS).call(this,e,t)}function qh(e,t){return jh(Lh.UPDATE_ROLES).call(this,e,t)}function Hh(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){Jh(e,t,r[t])}))}return e}function Jh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Kh=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(ue(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:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(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,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Hh({},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:Hh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Qh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Qh(t.value):[]];return e.concat(r)}),[])),Xh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,zh=e=>e?[cp(e)]:[],Zh=e=>{const t=[...Qh((null==e?void 0:e.attributes)||[]),...Qh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...zh(e),...t]:[]},eb=(e,t)=>[e,...t.map((t=>Xh(e,t)))],tb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return pd(t)}))},rb=(e,t)=>{switch(e){case De.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case De.ENTITY_ATTRIBUTE:case De.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[dn(t)]})(t);case De.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case De.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,cp({uri:n,dataTenant:i}),r]})(t)}},nb=e=>(0,l.pipe)(l.values,(0,l.map)((0,l.map)((0,l.pipe)((0,l.prop)("replies"),l.inc))),(0,l.map)(l.sum),l.sum)(e),ib=(0,l.curry)(((e,t)=>{const r=Uo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(ib(e,r.extendsTypeURI)):n})),ab=(0,l.curry)(((e,t)=>(0,l.reduce)(((t,r)=>(0,l.assoc)(r,((e,t)=>(0,l.path)(["members",t],e))(e,r),t)),{},t))),ob=(e,t)=>(0,l.pipe)((0,l.prop)("type"),ib(e),ab(t))(t),sb=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 lb,ub=r(33164);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}!function(e){e.PotentialMatches="potentialMatches",e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(lb||(lb={}));const pb={},db={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},potentialMatches:{colors:["#fec92f","#ee4272","#6d9a35","#555962","#2d9ecf"]},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"]}},yb=e=>{if(!pb[e]){const t=db[e]||db.random0;pb[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){cb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return pb[e]},fb=(0,l.curry)(((e,t)=>{const r=yb(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]})),Tb=e=>fb(lb.Charts,e),Eb=()=>yb(lb.PotentialMatches).colors,mb=e=>fb(lb.Random1,e),hb=e=>(0,ub.getColor)(e)?"#FFFFFF":"#212121";var bb=r(73116);const Ob=Array.from({length:100},((e,t)=>t/100)),vb=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)},gb={},_b=new bb.Z({hash:vb,saturation:Ob.slice(15,71),lightness:Ob.slice(50,90)}),Ab=new bb.Z({hash:vb,saturation:Ob.slice(46,89),lightness:Ob.slice(44,58)}),Nb=(0,l.curry)(((e,t,r)=>{t in gb||(gb[t]={});const n=gb[t];r in n||(n[r]=((e,t)=>{const r=String(vb(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Pb=Nb(_b,"crosswalks"),Rb=Nb(_b,"sources"),Sb=Nb(_b,"contributors"),Ib=Nb(_b,"dataValidationFunctions"),wb=Nb(Ab,"entities");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 Db=(0,l.has)("items"),Lb=e=>0===e,jb=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)},kb=e=>e.reduce(((e,t)=>e+t.width),0),Fb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Mb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),xb=e=>e.reduce(((e,t)=>e+t.height),0),$b=e=>(0,l.is)(String,e)&&e.includes("%"),Gb=(0,l.has)("spacer"),Vb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Bb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Db(t)?Bb(t):t)),[]),Wb=(e,t)=>{const r=[...t];for(;(0,l.sum)(r)>e;){const e=Math.max(...r);if(1===e)break;const t=r.indexOf(e);r[t]--}return r},Yb=e=>({id:e.layout}),qb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yb;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,l.partition)((0,l.propIs)(Number,"flex"),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("flex"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/(a+n.length))),u=Math.max(s/Math.max((0,l.length)(n),1),1),c=(e,t,r)=>Math.max(Math.round(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):u}else{const[e,n]=(0,l.partition)((0,l.both)((0,l.propIs)(String,"width"),(0,l.pipe)((0,l.propOr)("","width"),(0,l.includes)("%"))),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("width"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/100)),u=Math.max(s/Math.max((0,l.length)(n),1),1);o=$b(r.width)?Vb(i,r.width):u}return jb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return jb(n,t,r)},o=(e,t)=>Db(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Db(a)?n(a.layout):e(a.view)))),s=Wb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=Lb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Db(n))return r.concat(p(Ub({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Ub({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:kb(u),height:Fb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Db(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Lb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Db(i))return r.concat(p(Ub({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Ub({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?jb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?jb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Mb(i),height:xb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>Lb(r)?e.y:(0,l.last)(t).y+((0,l.last)(t).height||n),i=(t,r,i,o)=>{const s=e(i),l=t.width,u=a(s),c=n(t,r,o,u);return Ub({},s,{x:t.x,y:c,width:l,height:u})},o=(e,t)=>{const r=t.reduce(((t,r,a)=>{if("string"==typeof r)t.push(i(e,t,r,a));else if("object"==typeof r){const o=Math.max(Math.round(e.width/2),1),s=Wb(e.width,[o,o]),u=Ub({},e,{width:s[0]}),c=Ub({},e,{x:e.x+s[0],width:s[1]}),p=(0,l.has)("left",r)&&i(u,t,r.left,a),d=(0,l.has)("right",r)&&i(c,t,r.right,a),y=(0,l.propOr)(0,"height"),f=Math.max(y(p),y(d));t.push(Ub({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Ub({},e,{height:xb(r),items:r})},s=o(t,(0,l.propOr)([],"top",r)),u=Math.round(.66*t.width),c=(0,l.isEmpty)(s)?t.y:t.y+s.height,p=o(Ub({},t,{y:c,width:u}),(0,l.propOr)([],"center",r)),d=o({x:t.x+u,y:c,width:t.width-u},(0,l.propOr)([],"right",r)),y=s.height+Math.max(p.height,d.height),f=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Ub({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Ub({},t,{items:(0,l.reject)(Gb,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return u(e,r);default:return null}},d=(0,l.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return Bb(f)},Hb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Jb=[Ze.FilteredEntitiesViewFacet,Ze.ActivitiesViewFacet,Ze.ProfileStatsFacet,Ze.FilteredSavedSearchesFacet],Kb=(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=Jb.includes(a.component)?8:4;return Ub({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Qb(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){Xb(e,t,r[t])}))}return e}function Xb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zb={BarChart:ze.BAR,BarChartGrouped:ze.BAR,BarChartHorizontal:ze.BAR,LineChart:ze.LINE,Map:ze.MAP,Pie:ze.PIE},Zb=(e,t)=>yn(e)?un(e,t):e,eO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=zb[r];return Qb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},tO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Qb({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"]))},rO=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Qb({},e,{value:[Ee.IN,Ee.NOT_IN,ye.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:me(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&yn(t)||!r?n:(n||[]).concat((i=r,{filter:ye.EQUALS,fieldName:"type",values:[i]}));var i},nO=["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"],iO={"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:Zb(n,r),filters:rO(a,n,r),chartType:ze.BAR,component:Ze.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:Zb(n,r),filters:rO(a,n,r),chartType:ze.BUBBLE,component:Ze.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:Ze.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=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Qb({id:t,count:o,canRead:u,orderType:s,attributeUri:Zb(r,p),filters:rO(a,r,p),component:Ze.DashboardFacet,title:i,showOthers:!0},eO(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:Zb(n,r),filters:rO(a,n,r),chartType:ze.MAP,component:Ze.DashboardFacet,title:i,geoUrl:nO[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 Qb({id:t,count:o,canRead:l,attributeUri:Zb(n,r),filters:rO(a,n,r),component:Ze.DashboardFacet,title:i,geoUrl:s,chartType:ze.MAP,projection:"geoMercator"},eO(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ze.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:tO(i),component:Ze.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:rO(n,null,a),component:Ze.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:ye.GTE,fieldName:"matches",values:["1"]}],component:Ze.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:Ze.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:ze.CLOUD,component:Ze.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:ze.TREE,component:Ze.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ze.NotificationInboxFacet,title:n||de().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ze.ActivitiesViewFacet,title:n||de().text("Activity log")}}},aO=e=>({id:e,height:10}),oO=(0,l.pipe)((0,l.map)((e=>{const t=iO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),sO=e=>{if("0.1"===e.version){const t=oO(e.views),r=qb(aO,e.layout,{columns:4});return{id:e.id,margin:0,layout:Hb(r,t),views:t}}return e},lO=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>lO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);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 pO=uO({},et,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),dO=e=>e,yO={[pO.Attributes]:dO,[pO.HierarchyTree]:dO,[pO.HierarchyPaths]:dO,[pO.RelationsTable]:dO,[pO.Relations]:e=>uO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[pO.SingleAttribute]:dO,[pO.Custom]:dO,[pO.AttributeTable]:dO,[pO.Map]:dO,[pO.OldTree]:e=>uO({},e,{class:et.HierarchyTree}),[pO.OldMap]:e=>uO({},e,{class:et.Map}),[pO.ImageAttribute]:dO,[pO.PotentialMatches]:dO},fO=(0,l.pipe)((0,l.map)((e=>{const t=yO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),TO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===et.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),EO=(e,t)=>(t||[]).map((t=>uO({},t,TO(e,t.id)))),mO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return uO({},t,{layout:EO(t.views,e.newLayout)});if("0.1"===e.version){const r=fO(e.views),n=qb(TO(r),e.layout,{columns:3});return uO({},t,{layout:Hb(n,r),views:r})}return e},hO=(e,t)=>e.class===t||e["react-class"]===t,bO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(hO(t,et.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return(hO(t,et.SingleAttribute)||hO(t,et.AttributeTable))&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=(n[0]||e).uri;return r&&!r.some(an(i))||t.some(an(i))}},OO=(e,t)=>e.filter((e=>t.some((t=>hO(e,t))))).map((e=>{let{id:t}=e;return t})),vO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},gO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),_O=e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function AO(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){NO(e,t,r[t])}))}return e}function NO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PO=(0,l.curry)(((e,t)=>lO(t).map((t=>(0,l.pipe)((0,l.map)((e=>vO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),RO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),SO=(0,l.propEq)("class",et.Custom),IO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},wO=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];let i;if("2.0"===r&&t.newLayout){const{newLayout:r}=t,a=EO(t.views,r);return i=(0,l.when)((0,l.pipe)(l.head,(0,l.is)(String)),(0,l.pipe)((0,l.map)((t=>(0,l.pipe)((0,l.map)((e=>vO(e,t))),(0,l.reject)(l.isNil),l.head)(e))),(0,l.reject)(l.isNil),(e=>[{id:"common",views:e}])))(t.sidePanelViews),(0,l.pipe)((0,l.pick)(["views","profileBand","workflow","frozen"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=PO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>vO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(RO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(PO(e),(0,l.filter)(SO))(AO({},n,{items:i})),s=[{id:"common",views:PO(e,AO({},n,{items:a}))}];return o.length>0&&s.push({id:"D&B",views:o}),s}})(e,t);const o=(e=>(0,l.pipe)((0,l.chain)((e=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.entity.side.WorkflowsView"===e.class))})(e))),l.head,(0,l.unless)(l.isNil,(0,l.pick)(["showClosedTasks","assignee","processTypes"])))(e))(e),s=mO(AO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(_O,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:s.views,layout:s.layout,sidePanelViews:i,profileBand:u,workflow:o})},UO=(e,t)=>{if("scroll"===t.layout.layout){const r=PO(e,t.layout),n=sO(AO({},t,{views:r,version:"0.1"}));return{class:rt.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:rt.Dashboard,views:t.views,layout:t.layout,id:t.id}},CO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:rt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries,showErrorBands:r.showErrorBands}},DO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:rt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},LO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:rt.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},jO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:rt.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},kO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:rt.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},FO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:rt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},MO=(e,t)=>{const r=PO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=gO(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:rt.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}},xO=(e,t)=>({class:rt.Graph,id:t.id}),$O=(e,t)=>{const r=PO(e,t.layout)[0];return{class:rt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},GO=e=>t=>!!(0,l.intersection)(e,t).length,VO=(0,l.cond)([[GO(["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"]),()=>UO],[GO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>CO],[GO(["com.reltio.plugins.graph.GraphView"]),()=>xO],[GO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>DO],[GO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>LO],[GO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>jO],[GO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>kO],[GO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>FO],[GO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>MO],[GO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>$O],[l.T,()=>(0,l.always)(void 0)]]),BO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(IO),(0,l.map)((t=>wO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow","frozen"])))(e);return{class:rt.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:nt.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:nt.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>vO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",rt.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>vO(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=wO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:rt.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=lO(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return VO(o)(t,i)};function WO(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){YO(e,t,r[t])}))}return e}function YO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qO=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))},HO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var JO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(JO||(JO={}));const KO={[rt.DQDashboard]:`${HO}DqDashboard.svg`,[rt.Dashboard]:`${HO}Dashboard.svg`,[rt.Graph]:`${HO}Graph.svg`,[rt.RelationshipSearch]:`${HO}GraphSearch.svg`,[rt.Interactions]:`${HO}Interactions.svg`,[rt.PotentialMatches]:`${HO}PotentialMatches.svg`,[rt.Profile]:`${HO}Profile.svg`,[rt.NestedProfile]:`${HO}Profile.svg`,[rt.ProfileActivityLog]:`${HO}ActivityLog.svg`,[rt.Relationships]:`${HO}Relationships.svg`,[rt.Sources]:`${HO}Crosswalk.svg`,[rt.Search]:`${HO}Search.svg`,[JO.DashboardGroup]:`${HO}DashboardGroup.svg`,[JO.ProfileGroup]:`${HO}ProfileGroup.svg`,[JO.SearchGroup]:`${HO}SearchGroup.svg`,DEFAULT:`${HO}Default.svg`},QO=e=>KO[null==e?void 0:e.class]||KO.DEFAULT,XO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",rt.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>WO({},e,{nestedRoute:`${t+1}`})))))),zO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},ZO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?KO[JO.ProfileGroup]:null,ev=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===KO[rt.Dashboard]||t===KO[rt.DQDashboard]})),(0,l.always)(KO[JO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===KO[rt.Search]||t===KO[rt.RelationshipSearch]})),(0,l.always)(KO[JO.SearchGroup])],[l.T,()=>null]])(e),tv=e=>(0,l.pipe)((0,l.chain)(qO),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.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,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>WO({},e,{entityTypes:e["entity-types"],screen:BO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=XO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:QO(r),screen:zO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=BO(t,e);return{label:t.label,icon:ZO(t)||ev(r)||QO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function rv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nv=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},iv=e=>({id:e,height:10}),av=e=>{const t=(e=>(0,l.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,l.pipe)((0,l.chain)(nv),(0,l.pluck)("pivotingAttributes"),l.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,l.propEq)("attribute-types","*")))(t);return(0,l.pipe)((0,l.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}),{}),l.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=oO(((e,t)=>{const r=lO(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.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){rv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=qb(iv,t.layout,{columns:4});return{views:r,layout:Hb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function ov(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){sv(e,t,r[t])}))}return e}function sv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lv(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 uv=(0,l.curry)(((e,t)=>(0,l.pipe)((e=>((e,t)=>(e||[]).find((e=>"com.reltio.plugins.ui.Activator"===e.activator)))(e)),(0,l.prop)(e))(t))),cv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,pv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),dv=(0,l.pipe)(uv("top-logo"),pv),yv=(0,l.prop)("showLookupCode"),fv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propSatisfies)((0,l.either)(ue,(0,l.equals)("none")),"format")),(0,l.map)((e=>{let{format:t}=e;if("none"===t)return{thousandSeparator:""};const{groupSeparator:r,digitsAfterDecimalSeparator:n}=t;return ov({thousandSeparator:r,decimalScale:n},lv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,l.pipe)(uv("default-perspective"),(0,l.ifElse)(cv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=(e=>(0,l.pipe)((e=>gO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return ov({},t,lv(e,["action"]))})))(e))(e),f=(e=>uv("checkUser",e))(e),T=(e=>uv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),h=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=yv(h))||O;var O;const v=null===(t=_O(e))||void 0===t?void 0:t.showEntityId,g=(e=>uv("preview",e))(e),_=dv(e),A=(e=>uv("showAttributeDescription",e))(e),N=(e=>uv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e),R=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.network.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["id","point"]))(e))(e),S=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(e))(e),I=0===Object.keys(P).length?void 0:P,w=(e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.ui.ProfileCheckUpdate"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.omit)(["id","point"]))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:I,requestProvider:R,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:S,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N,profileCheckUpdate:w}},Tv=e=>({layout:tv(e),pivoting:av(e),properties:fv(e)});function Ev(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){mv(e,t,r[t])}))}return e}function mv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hv=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}_${(0,$r.x0)()}`;return n[e.id].push(t),i=!0,Ev({},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]++,Ev({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function bv(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){Ov(e,t,r[t])}))}return e}function Ov(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let vv={};const gv=(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(E(vv[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))}vv=bv({},vv,{[a]:bv({},vv[a]||{},{worker:i})})}else i=vv[a].worker,vv[a].innerText&&t({task:{action:st.SET_HTML,params:{html:vv[a].innerText}},worker:i,config:r}),i.removeEventListener("message",vv[a].onWorkerMessage);return i&&(vv[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||(vv[a].innerText=n.params.html)}},i.addEventListener("message",vv[a].onWorkerMessage)),i},_v=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Av=(0,l.flip)(_v);var Nv=r(83926);const Pv=(e,t)=>{let r;try{r=t(e)}catch(t){return e}return"number"==typeof e?r.toNumber():r.toString()};function Rv(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){Sv(e,t,r[t])}))}return e}function Sv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Iv={[dt.percent]:{valueConverters:{in:e=>Pv(e,(e=>new Nv.Decimal(e).mul(1e4).floor().div(100))),out:e=>Pv(e,(e=>new Nv.Decimal(e).mul(100).floor().div(1e4)))}}},wv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Iv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.in)||l.identity)(t)})),Uv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Iv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.out)||l.identity)(t)})),Cv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const{uri:n,name:i}=e||{},a=!n||Fn(e)?i:n;return t[a]||t[Ne]||Lv(r)},Dv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{[Nt.relevanceScore.name]:Rv({},Cv(Nt.relevanceScore,e,t),{strategy:dt.percent})}},Lv=(0,fi.Z)((e=>{var t;e=null===(t=e)||void 0===t?void 0:t.replace(/_/g,"-");const r=new Intl.NumberFormat(e).formatToParts(1000000.1),n=e=>{var t;return null===(t=r.find((t=>{let{type:r}=t;return r===e})))||void 0===t?void 0:t.value};return{thousandSeparator:n("group"),decimalSeparator:n("decimal"),groupSize:("integer",(null===(i=r.filter((e=>{let{type:t}=e;return"integer"===t})).map((e=>{let{value:t}=e;return t})).sort(((e,t)=>t.length-e.length)))||void 0===i?void 0:i[0])||"000").length};var i})),jv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s,strategy:l}=e;t=wv(l,t);const u=null!=s?new Nv.Decimal(t).toFixed(s):t,[c,p]=u.split("."),d=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),y=c.replace(d,r),f=null==p?void 0:p.replace(/(0|\.)+$/,"");return i+y+(f?n+f:"")+a};let kv;const Fv=()=>kv,Mv={setLocale:e=>{kv=e},getLocale:Fv,number:e=>((e,t)=>{const r=String(t);try{const t=Lv(e);return jv(t,r)}catch(e){return console.warn("Number localization error"),r}})(Fv(),e),applyFormatToNumber:jv},xv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Mv.applyFormatToNumber(e,t):(!e&&t&&(t=Mv.number(t)),t)))),$v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?de().number(e,"0,0.0a").toUpperCase():de().number(e,"0,0"):""},Gv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Vv=!0;const Bv=e=>Vv=e,Wv=(e,t)=>e!==t&&t?Vv&&e?`${t} (${e})`:t:e,Yv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),qv=(e,t,r)=>{const n=Yv(e,t,r);return Wv(r,n)},Hv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Jv=(0,l.complement)(Hv),Kv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Qv=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.pipe)((0,l.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,l.uniq)([...(0,l.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),l.values)(t)},Xv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Jv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),zv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=i?q(i):"L",s=a?K(a):"L LTS";switch(n.type){case ft.TYPE_NUMBER:case ft.TYPE_FLOAT:case ft.TYPE_DOUBLE:case ft.TYPE_LONG:case ft.TYPE_INT:case ft.TYPE_COUNT:{const e=Cv(n,r,Mv.getLocale());return t&&xv(e,t)}case ft.TYPE_BOOLEAN:case ft.TYPE_BOOLEAN_RADIO:case ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?de().text("Yes"):de().text("No");case ft.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(qu(t)?Hu(t):de().date(t,o));case ft.TYPE_ACTIVENESS_DATE:case ft.TYPE_LOCAL_DATE:return(t=t)&&(qu(t)?Hu(t):de().date(t,o));case ft.TYPE_TIMESTAMP:return(t=t)&&(qu(t)?Hu(t):de().date(isNaN(t)?t:Number(t),s));case ft.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case ft.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case ft.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?Wv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),Zv={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},success:{main:"#3B873E"},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)"};function eg(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){tg(e,t,r[t])}))}return e}function tg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rg=e=>(t,r)=>{const{timeout:n}=r,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}(r,["timeout"]);if(AbortController&&n){const r=new AbortController,a=setTimeout((()=>r.abort()),n);return e(t,eg({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},ng=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()}},ig=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=eg({},JSON.parse(t),{[br]:e.status})}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),ag=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,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(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={},u=(0,l.pipe)(rg,(e=>{const t={},r={};return n=>{var i,a;const o=null!==(i=e.attemptsThreshold)&&void 0!==i?i:10,s=null!==(a=e.attemptsTimeWindowSize)&&void 0!==a?a:5e3;return(i,a)=>{const l=(e=>{const[t]=e.split("?");return t.split("/")[2]})(i),u=t[l],c=()=>Promise.reject({errorMessage:`service ${l} was disabled (authorization issues)`});if(u)return c();if(r[l]){const e=r[l].length;if(e>o){const n=e-o-1;if(r[l][e-1]-r[l][n]<=s)return t[l]=!0,c();r[l]=r[l].slice(n)}}return n(i,a).then((t=>{var n;return!e.excludedServices||null!==(n=e.excludedServices)&&void 0!==n&&n.includes(l)||(401===t.status?(r[l]||(r[l]=[]),u||r[l].push(Date.now())):r[l]&&t.ok&&(r[l].length=0)),t}))}}})(s),(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),ng,ig);let c=0,p=[];return{request:(e,n)=>{const i=u(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const 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))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(c){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return p.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,setRequestProviderConfiguration:e=>{Object.assign(s,e)},startInterceptorInit:()=>{c+=1},finishInterceptorInit:()=>{c=Math.max(c-1,0),0===c&&(p.forEach((e=>e())),p=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},og="__metadata",sg=(e=>{const t=[og,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),lg=(0,l.set)(sg),ug=(0,l.view)(sg),cg=lg(ge.NEW),pg=lg(ge.REMOVED),dg=lg(ge.EDITED),yg=lg(ge.IGNORED),fg=(0,l.pipe)(ug,(0,l.equals)(ge.REMOVED)),Tg=(0,l.pipe)(ug,(0,l.equals)(ge.NEW)),Eg=(0,l.pipe)(ug,(0,l.equals)(ge.EDITED)),mg=(0,l.pipe)(ug,(0,l.complement)(l.isNil)),hg=(0,l.pipe)(ug,(0,l.equals)(ge.IGNORED)),bg=(0,l.omit)([og]),Og=(e,t)=>e===og?void 0:t;function vg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gg=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=gg(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},_g=(e,t)=>gg((0,l.propEq)("nodeId",t),e),Ag=(e,t)=>gg((0,l.pathEq)(["entity","uri"],t),e),Ng=(e,t)=>{const r=_g(e,t);return r.length>1?r[r.length-2]:null},Pg=(e,t)=>{const r=_g(e,t);return r.length>0?r[r.length-1]:null},Rg=(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=>Rg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Sg=()=>{},Ig=(e,t)=>{let{parent:r,nodeProcessing:n=Sg}=t;n(e,r),e.children&&e.children.forEach((t=>Ig(t,{parent:e,nodeProcessing:n})))},wg=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ve.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 Ve.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 Ve.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){vg(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})}}},Ug=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&&Ig(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ve.addingChild||r.editingMode===Ve.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=wg({node:r,connection:n,isReversed:i}),s=Cp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ve.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=wg({node:r,isReversed:i,connection:n}),l=s?kp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):jp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Cg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Cg(r,t);if(e)return e}return!1},Dg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Dg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Lg=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Cg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Dg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},jg={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},kg={asc:"asc",desc:"desc"},Fg=jg.entityLabel,Mg=kg.asc,xg=(0,l.always)(0),$g=e=>{let{sortField:t=Fg,sortOrder:r=Mg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case jg.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return KN.strings.sort(t,a,o)})(n,r);case jg.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return KN.strings.sort(e,i,a)})(r);default:return xg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Gg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(kg)),l.identity,(0,l.always)(Mg))),Vg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(jg)),l.identity,(0,l.always)(Fg)));var Bg=r(91104);let Wg;const Yg=(e,t)=>(Wg||(Wg=Bg.createClient({key:t})),new Promise((t=>{Wg.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,l.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),qg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Hg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(ys).flatMap((e=>{let r;return e.type==t&&(r=[qg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Hg(e.value,t))),r})),Jg=e=>e&&e.length>0,Kg=(e,t)=>[].concat(e&&e.attributes?Hg(e.attributes,t):[]).filter(l.identity);function Qg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xg=(e,t,r,n,i,a)=>{if(e&&e.type){const t=Ei(r,e.type);n&&(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){Qg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Kg(e,t.latitude),n=Kg(e,t.longitude),Jg(r)&&Jg(n)&&(0,l.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),r,n);var r,n})).filter(l.identity);if(a.length>0)return Promise.resolve(a[0])}const o=t.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(Jg(t)&&t[0].value&&Jg(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?Yg(n.label,a).catch((()=>null)):Promise.resolve(null)},zg=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,l.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=Ei(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=>[e,t.attributes[e]])).filter((e=>{let[,t]=e;return t})).flatMap((e=>{let[r,n]=e;return n.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e,name:r})))})));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s,name:u}=t;return Xg(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?Yg(a.label,r).catch((()=>null)):e)).then((e=>ne(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},Zg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,l.pipe)((0,l.chain)((t=>{const r=Ei(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Xn(e,r.latitude,t.type)&&Xn(e,r.longitude,t.type)){const e=Kg(t,r.latitude),n=Kg(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,l.zipWith)(i,e,n)}}))})),(0,l.filter)(l.identity),(0,l.uniqBy)((0,l.prop)("id")))(t))},e_=(e,t,r)=>Promise.all([Zg(e,t),zg(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.lng===e.point.lng))))]}));function t_(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){r_(e,t,r[t])}))}return e}function r_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const n_=(e,t)=>t.values.map(vo(e,t.entityTypeUri)),i_=(e,t,r)=>tl(t.fieldName,r)||Xn(e,un(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),a_=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?Wv(e,t):e}),r)},o_=(0,l.path)(["attrType","label"]),s_=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>t_({},e,{[t]:!0})),{});e[r]=e[r]?t_({},e[r],n):n}return e}),{}),l_=(0,l.pipe)((0,l.prop)("values"),E),u_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",It.type.name)),c_=e=>e.type===y_.NUMERIC_RANGE_FACET,p_=e=>e.type===y_.DATE_RANGE_FACET,d_=(0,l.either)(c_,p_),y_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},f_=e=>{switch(null==e?void 0:e.name){case It.type.name:return y_.ENTITY_TYPE_FACET;case It.createdBy.name:case It.updatedBy.name:case It.sourceSystems.name:case It.tags.name:case It.roles.name:case It.matchRules.name:case It.MLRecommendedMatch.name:return y_.WITH_DROPDOWN_CHECKBOXES_FACET;case It.createdTime.name:case It.updatedTime.name:case It.startDate.name:case It.endDate.name:return y_.DATE_RANGE_FACET;case It.matches.name:case It.matchScore.name:return y_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return y_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return y_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return y_.DATE_RANGE_FACET;default:return y_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},T_=(0,l.pipe)(i_,f_),E_=(0,l.pipe)((0,l.path)(["attrType","type"]),li),m_=(0,l.cond)([[c_,(0,l.always)(ye.IN_RANGE)],[p_,(0,l.always)(ye.WITHIN)],[(0,l.allPass)([E_,e=>e.values.length>=2]),(0,l.always)(ye.EXISTS)],[l.T,(0,l.always)(ye.EQUALS)]]),h_=(0,l.cond)([[p_,(0,l.prop)("values")],[c_,(0,l.prop)("values")],[E_,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]),b_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Oe),O_=e=>(e=>b_.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]=Ku(t);return e.replace(r,i).replace(n,a)}),e))(e),v_=(0,l.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}`})),g_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},__=e=>[g_.geoPolygon,g_.onMapMove].includes(e),A_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},N_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},P_=(e,t)=>__(e)?t.map(A_):[N_(t)],R_=e=>__(e)?de().text("Geo Polygon"):de().text("Geo Location"),S_=e=>{switch(e){case g_.geoLocation:return"geoLocation";case g_.geoPolygon:case g_.onMapMove:return"geoPolygon"}},I_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},w_=e=>de().text(e),U_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ye.EQUALS]:"=",[ye.NOT_EQUALS]:"≠",[ye.STARTS_WITH]:"*",[ye.MISSING_VALUE]:de().text("missing value"),[ye.HAS_ALL]:de().text("has all"),[ye.IN_RANGE]:de().text("in range"),[ye.FULL_TEXT]:de().text("full text"),[ye.EXISTS]:de().text("exists"),[ye.COUNT_EQUALS]:`${de().text("count")} =`,[ye.COUNT_NOT_EQUALS]:`${de().text("count")} ≠`,[ye.COUNT_LT]:`${de().text("count")} <`,[ye.COUNT_LTE]:`${de().text("count")} <=`,[ye.COUNT_GT]:`${de().text("count")} >`,[ye.COUNT_RANGE]:de().text("count range"),[ye.LT]:"<",[ye.LTE]:"<=",[ye.GT]:">",[ye.GTE]:">=",[ye.IN_FILE]:de().text("in file"),[ye.NOT_IN_FILE]:de().text("not in file"),[ye.CONTAINS]:"~",[fe.LIST_EQUALS]:"=",[fe.NOT_LIST_EQUALS]:"≠",[fe.LIST_EQUALS_CASE_SENSITIVE]:"=",[fe.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||de().text(e.toLowerCase())},C_=e=>({type:I_.operator,text:e}),D_=e=>({type:I_.operator,text:w_(e)}),L_=e=>({type:I_.attributeLabel,text:e}),j_=e=>({type:I_.specialAttributeLabel,text:e}),k_=e=>({type:I_.attributeFilter,text:U_(e)}),F_=e=>({type:I_.attributeValue,text:e}),M_=e=>({type:I_.entityTypeLabel,text:e}),x_=()=>({type:I_.space,text:" "}),$_=()=>({type:I_.bracket,text:"("}),G_=()=>({type:I_.bracket,text:")"}),V_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),B_=(0,l.curry)(((e,t)=>t.map(V_(e)))),W_=(0,l.curry)(((e,t,r)=>[e,...r,t])),Y_=W_($_(),G_()),q_=W_(x_(),x_()),H_=(0,l.curry)(((e,t)=>[e,...t])),J_=e=>H_(M_(e)),K_=e=>H_(M_(`${e}: `)),Q_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Au(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=gu(s),a=_u(s);!r&&t&&n&&(i.push($_()),r=!0),i.push(o),r&&a&&(i.push(G_()),r=!1);const l=e?D_(s):C_(s);i.push(...q_([l]))}else i.push(o),r&&(i.push(G_()),r=!1)}return i}},X_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),z_=(0,l.pipe)(Q_({localizable:!1}),X_),Z_=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},eA=e=>{let{data:t,values:r,filter:n}=e;return t&&hc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},tA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(eA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),rA=(0,l.pipe)((0,l.chain)((0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&Hn(e.data.attrType)})(e)&&[ye.HAS_ALL,ye.EQUALS,ye.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:qn((0,l.path)(["data","attrType"],e)),codeValues:(0,l.flatten)((0,l.propOr)([],"values",e))}))),(0,l.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),Qv),nA=(e,t)=>(0,l.pipe)(rA,Xv(t))(e),iA=(0,l.pathEq)(["data","fieldName"],It.type.name),aA=(0,l.path)(["data","entityTypeUri"]),oA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),sA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ps(e)),attributes:(0,l.filter)((0,l.pipe)(aA,(0,l.anyPass)([l.isNil,ps(e),r=>{const n=(t.entityTypes||[]).filter(ps(e));return(n.length>1?vi(e,n):null)===r&&!!Ei(e,r)}])))})(t))))),lA=e=>(0,l.pipe)((0,l.prop)("filter"),uu,(0,l.equals)(e)),uA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=tl(n.fieldName)||n.attrType,s=Bu(o,i),u=zv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Hn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Wv(a.lookupCode,a.value):qv(r,qn(o),a)],[()=>nl(s),()=>vo(e,n.entityTypeUri,a)],[()=>il(s),()=>Wo(e,a)],[()=>cl(s),()=>Ho(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>ai(c)||li(c)),Mu),F_)()})),cA=(e,t,r,n)=>{const i=uA(e,t,r,n.data,n.filter);return(0,l.cond)([[lA(0),(0,l.always)([])],[(0,l.both)(lA(2),(2,(0,l.pipe)((0,l.prop)("values"),l.flatten,l.length,(0,l.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,l.flatten)(t);return[x_(),i(r),{type:I_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[x_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),B_({type:I_.punctuationMark,text:", "}))(t)]}]])(n)},pA=(e,t)=>{const r=!!tl(e.data.fieldName);return(0,l.pipe)(Z_,r?j_:L_)(e,t)},dA=(e,t,r,n,i)=>[pA(n,i),x_(),k_(n.filter),...cA(e,t,r,n)],yA=(0,l.addIndex)(l.map),fA=(0,l.propEq)("length",1),TA=(0,l.propSatisfies)((0,l.lt)(1),"length"),EA=(0,l.complement)(l.isEmpty),mA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(Ru,(0,l.filter)(eA),Su,(0,l.map)((n=>({operand:dA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,Q_()))(n)},hA=(0,l.pipe)(mA,l.flatten),bA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>yp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=mA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(J_),(0,l.pipe)(s(K_),(0,l.unless)((()=>fA(u)||i),Y_)))(u)},OA=(e,t,r,n)=>(0,l.pipe)(Ru,(0,l.filter)(tA),Su,yA(((n,i,a)=>({operand:bA(e,t,r,n,fA(a)),operator:n.operator}))),Q_(),l.flatten)(n),vA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),Q_(),l.flatten),gA=e=>{let{searchType:t,values:[r]}=e;return P_(t,r).join(", ")},_A=(e,t,r,n,i,a)=>{const o=(e=>e?[j_(e.isRawFilter?de().text("Raw filter"):de().text("Search")),...q_([k_(ye.EQUALS)]),F_(`"${e.value}"`)]:[])(i),s=(e=>e?[j_(R_(e.searchType)),x_(),F_(gA(e))]:[])(a),u=(0,l.pipe)(OA,(0,l.when)((e=>TA(e)&&(EA(o)||EA(s))),Y_))(e,t,r,n);return vA([o,s,u])},AA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),NA=(0,l.pipe)(_A,AA),PA=(0,l.has)("attributes"),RA=Array.isArray,SA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),IA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=wA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(SA(a))),Y_),(0,l.concat)(q_([C_(o)]))))(s)},wA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return PA(n)?IA(e,t,r,n,i):RA(n)?n.reduce(((n,a)=>n.concat(wA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(q_([C_(n.operator)])))(dA(e,t,r,n,i))},UA=(e,t,r,n,i)=>(0,l.pipe)(wA,l.flatten)(e,t,r,n,i);function CA(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){DA(e,t,r[t])}))}return e}function DA(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=(0,l.complement)(iA),jA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(iA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(aA),(0,l.reject)(l.isNil),l.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,l.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},kA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=jA(t);return(r||n)&&Nu(t)},FA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(kA)),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(iA).some((0,l.propEq)("filter",ye.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,l.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=jA(r);if(kA(e))t.push(CA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(LA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(iA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(aA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(LA),entityTypes:n,operator:i?a:e.operator,id:(0,$r.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),MA={[ye.EQUALS]:ye.ON,[ye.IN_RANGE]:ye.WITHIN,[ye.GTE]:ye.AFTER,[ye.GT]:ye.AFTER,[ye.LTE]:ye.BEFORE,[ye.LT]:ye.BEFORE},xA=(0,l.curry)((e=>MA[e]||e)),$A=(0,l.curry)(((e,t)=>{switch(e){case ye.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case ye.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),GA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),ri),VA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>CA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return GA(e)?(0,l.evolve)({filter:xA,values:$A(t)},e):e}))})))})),BA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Yu),(0,l.map)(Ku))}),WA=(0,l.map)((0,l.cond)([[GA,BA],[l.T,l.identity]])),YA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),FA,sA(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),WA)})),VA,(0,l.reject)(oA))(r)));function qA(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){HA(e,t,r[t])}))}return e}function HA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JA=(e,t)=>({data:{uri:yn(e.fieldName)?un(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||m_(e),id:(0,$r.x0)(),values:h_(e)}),KA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=tl(a,t,r)||Xn(e,i);if(!s)return null;if(Fn(s))return qA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=yp(e,{type:o}),i=(Qn(e,un(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return qA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),QA=(0,l.curry)(((e,t,r,n)=>YA(KA,e,n,t,r)));function XA(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){zA(e,t,r[t])}))}return e}function zA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZA=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},eN=e=>"rdmLookups.not.resolved"===e?It.notResolved.name:e,tN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Ee.NOT_IN_RANGE?ye.IN_RANGE:me(a),u=eN(n),c=tl(u)||Xn(e,i),p=(0,l.cond)([[()=>yu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>XA({},e,{filename:Gv(e)}))))],[()=>li(null==c?void 0:c.type),(0,l.map)(le)],[e=>pu(s)&&!Array.isArray(e[0])&&!ri(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:(0,$r.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Ee.NOT_IN_RANGE?"and not":"and",filter:s,values:p}})),rN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(tN(e,vi(e,i)));return[{id:(0,$r.x0)(),operator:"or",attributes:a,entityTypes:i}]})),nN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),iN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([nN("from"),nN("to")]),(0,l.pipe)((0,l.pick)(["from","to"]),l.values)],[(0,l.pipe)((0,l.prop)("rangeSelection"),E,l.not),(0,l.pipe)((0,l.prop)("rangeSelection"),(0,l.pick)(["start","end"]),l.values)],[l.T,()=>[]]]),aN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return XA({},r,{values:iN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Qs(e.fieldName,n):e.fieldName})},oN=(e,t)=>{if((0,l.has)("children")(e)){const r=aN(e,t);return e.children.reduce(((e,n)=>(e.push(oN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return aN(e,t)},sN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(aN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(XA({fieldName:e.fieldName},aN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(oN,l.flatten)],[l.T,aN]]),lN=(0,l.pipe)((0,l.map)(sN),l.flatten),uN=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},cN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=rN(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:lN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>XA({},t,{type:T_(e,t)}))).map((e=>XA({},e,{values:d_(e)?uN(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 JA(r,t)})),operator:"or",id:(0,$r.x0)(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[eN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[XA({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return QA(e,t,r,p)},pN=(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,l.pipe)(l.values,(0,l.reject)(l_),(0,l.partition)(u_))(t),i=n.map((t=>qA({},t,{type:T_(e,t)}))).map((e=>JA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,$r.x0)(),entityTypes:a}]})(e,a);return QA(e,t,r,o)})(e,t,r,n):cN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},dN=e=>"2.0"===e.version?e.keyword:ZA(e),yN=e=>(0,l.pathEq)(["object","uri"],e),fN=(e,t)=>(0,l.pipe)((0,l.find)(yN(e)),(0,l.prop)("object"))(t),TN=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,l.pipe)((0,l.find)((0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),yN(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=fN(r.match,t)||n[r.match];return i?{label:Yc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return Oo(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},EN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),mN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),hN=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,l.propOr)({},n,r);return{label:Yc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return Oo(e,o.type,t)||{label:t,uri:t}}))}})))(t),bN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},ON=(0,l.path)(["object","uri"]),vN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.find((e=>{let{uri:r}=e;return r===t}))},gN=e=>void 0!==(null==e?void 0:e.relevance),_N=e=>gN(e)?100*e.relevance+"%":"";function AN(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 PN=(e,t)=>!!e[t],RN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},SN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},IN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return AN({},t,{[r.uri]:AN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:SN(null==o?void 0:o.parents,n),children:SN(null==o?void 0:o.children,i),values:SN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},wN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Ei(r,t)||Ni(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return es(r,n,i).flatMap(rs).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Xn(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=IN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>IN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},UN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Qr(e.uri)&&rn(e.type)&&rn(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ss(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(ys),(0,l.map)(RN))(i);return IN({structure:e,attrType:e[t].attrType,values:a})}),t)},CN=e=>{let{structure:t,attributeValue:r}=e;if((0,l.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,l.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return PN(e,r)}));return r||n?t.filter(ys).reduce(((e,t)=>CN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return PN(t,e.type)?IN({structure:t,attrType:t[e.type].attrType,values:[RN(e)]}):t}},DN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?AN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},LN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ss(i,n,r)||[];return a.length?IN({structure:t,attrType:t[r].attrType,values:a.filter(ys).map(RN)}):t},jN=(e,t,r)=>{const n=Zr(e),i=Zr(t);return n===i?((e,t)=>{const r=En(t),n=En(e);return an(n,r)||((e,t)=>fn(e)&&!fn(t)&&an(t,e))(n,r)})(e,t):!(!r||!Tn(t))&&lh(r,i).includes(n)},kN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},FN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?oh(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return jN(r,t,o)}))},MN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>MN(e,t,r)))))},xN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},$N=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&kN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!xN(i,a)}},GN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=Zr(n),p=sh(c,o,i,a),d=MN("children",t,u),y=MN("parents",t,u),f=d.flatMap((e=>MN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return jN(t,n,p)})).map((t=>$N(e.attrType.uri,n,t,s,l)))));if(!T.length)return[];const E=y.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return jN(n,t,p)||Zr(t)!==c&&jN(t,n,p)})).map((t=>$N(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=MN("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return T.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&jN(n,t,p)}))})).map((t=>$N(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return jN(t,n,p)})).map((e=>$N(r,n,e,s,l))),...E,...m,...T]},VN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=zv({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.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=>Bc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Gn,()=>a(n)],[Hn,()=>(e=>{const r=o(e),n=qn(t);return Ql([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return qv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},BN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:ye.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(WN(r,t)):i.push(YN([t],r)),i},WN=(e,t)=>{const r=Mn(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=Gn(i)?WN(i,t[r]):[YN(t[r],i)];return e.push(...a),e}}),[])},YN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Yn(t.uri),filter:t.type===ft.TYPE_BLOB?ye.FULL_TEXT:ye.EQUALS,values:e}:{fieldName:Yn(t.uri),filter:ye.MISSING_VALUE},qN=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),HN=new class{constructor(){this.comparators=void 0,this.comparators={}}register(e,t){this.comparators[e]=t}get(e){var t;return null!==(t=this.comparators[e])&&void 0!==t?t:qN}},JN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},KN={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([[6856],{88832:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Ys,IL3:()=>uT,PY2:()=>bt,Ng6:()=>ke,YJ7:()=>_e,NlI:()=>fe,XYV:()=>Oe,Xt7:()=>Ie,wfT:()=>ar,EMD:()=>Jt,HAc:()=>Ce,PEf:()=>At,oA3:()=>Ht,$XE:()=>ze,eWf:()=>gt,q7e:()=>De,KVe:()=>or,WVQ:()=>yi,oZZ:()=>yr,bNA:()=>fr,Rjq:()=>Tr,G39:()=>Pt,W0P:()=>st,X1H:()=>it,hdG:()=>ct,ws7:()=>pt,VI$:()=>ut,yn8:()=>Je,N0y:()=>He,dZX:()=>Ze,bQt:()=>mr,oS0:()=>ft,KfU:()=>Ue,bZE:()=>he,Nsj:()=>Pe,psV:()=>ge,xPW:()=>Ot,pyR:()=>er,p8l:()=>Qt,Wkf:()=>we,zHr:()=>Se,NIO:()=>Re,$26:()=>f_,s9T:()=>Ye,MEy:()=>Du,j5E:()=>ye,vAw:()=>qt,NMQ:()=>Yt,eVu:()=>zu,YGb:()=>ot,Y1q:()=>yh,RgZ:()=>Xt,Qy0:()=>Er,Q26:()=>Ne,pYu:()=>Vt,wIJ:()=>__,GFH:()=>Me,Ury:()=>Rt,S91:()=>St,wSh:()=>Z,BDP:()=>Di,pGS:()=>Zt,ARY:()=>Tt,XGc:()=>ir,fO_:()=>Dt,wwy:()=>Ve,h_8:()=>It,_XL:()=>Ae,j2V:()=>sr,dMV:()=>rr,xYD:()=>dt,OXy:()=>Et,BXd:()=>Ke,KM9:()=>je,lXI:()=>rt,C68:()=>Nt,Yj_:()=>Be,D25:()=>$e,ZIY:()=>et,Tl4:()=>I_,lwr:()=>_t,NkU:()=>lr,Rtp:()=>nr,YGx:()=>Qe,uTS:()=>tr,MCv:()=>Le,IYE:()=>Kt,PiC:()=>dr,MVv:()=>lt,Q_m:()=>br,h_m:()=>nt,DUe:()=>be,tJI:()=>Fe,fDt:()=>xe,cNQ:()=>ur,SwE:()=>Bt,ZHR:()=>pr,PYu:()=>at,lD1:()=>wt,lVm:()=>Xe,vnX:()=>Mg,$x5:()=>xg,_R1:()=>kg,wUm:()=>Fg,dC6:()=>qe,MBD:()=>Ge,GmF:()=>pa,cKm:()=>tt,iP_:()=>vt,NVC:()=>We,tPT:()=>bl,tZe:()=>PT,kRE:()=>zE,psB:()=>ZE,X0$:()=>hl,$vY:()=>ml,zE1:()=>wl,Wm5:()=>sl,vyX:()=>jc,wLZ:()=>Ol,W4V:()=>se,EtK:()=>Ps,ayi:()=>El,asT:()=>DN,kGs:()=>Vh,RLE:()=>Uv,ewt:()=>_d,O_f:()=>Nu,sOy:()=>an,kP7:()=>Iv,Tde:()=>Yn,LMI:()=>mc,skb:()=>bA,sPt:()=>lc,sH1:()=>uc,lPZ:()=>qy,bG8:()=>Yy,_LJ:()=>Hy,RPM:()=>Kd,h27:()=>Sc,Uqd:()=>Lc,xG:()=>CA,Z2f:()=>Qv,fgW:()=>Z_,I69:()=>AA,ZxB:()=>PA,dwd:()=>Wy,F$g:()=>By,mdt:()=>ib,Qbq:()=>Ph,rny:()=>Ji,UEY:()=>Ca,Q0T:()=>Ua,Lyr:()=>xa,sBn:()=>Ia,itK:()=>Pa,H9$:()=>wa,KPc:()=>Sa,zos:()=>Ra,ELQ:()=>$a,dZs:()=>Ea,Cz4:()=>Ta,z_L:()=>Fa,fGe:()=>fa,iuF:()=>Aa,Wib:()=>Na,Hn0:()=>Ma,obS:()=>Ga,E$L:()=>ma,XUh:()=>_a,Qp_:()=>va,_jk:()=>ha,sKE:()=>ba,WmG:()=>ga,QKx:()=>ja,Oik:()=>La,s0A:()=>Oa,o9m:()=>Da,MCd:()=>ka,RsS:()=>wc,tGK:()=>Xl,lIv:()=>Il,Vg3:()=>ta,mkC:()=>Vi,xv5:()=>na,a14:()=>Wi,yv0:()=>ra,Zm0:()=>Bi,Nxd:()=>Gi,$mM:()=>ea,ifj:()=>Ti,NWi:()=>hg,xr3:()=>mg,wNf:()=>cu,iJH:()=>bg,KB$:()=>_N,d89:()=>Mi,Edd:()=>xi,Z5t:()=>$i,uGe:()=>ji,UoR:()=>Li,xvW:()=>Eg,$qe:()=>Tg,yPM:()=>ya,$cp:()=>Sl,vKJ:()=>Pl,VtG:()=>hf,AID:()=>zm,B1H:()=>ON,b7X:()=>_h,$uE:()=>Yh,keo:()=>Nh,C_p:()=>jy,G27:()=>uO,O8b:()=>Qy,JA0:()=>GE,b3T:()=>Gh,oC6:()=>xh,_Zs:()=>$h,epC:()=>Hh,YYG:()=>qh,f_2:()=>BE,w3l:()=>rN,QHB:()=>lO,Jso:()=>uN,RXH:()=>Hb,Vr9:()=>hO,lMm:()=>Ev,BlA:()=>WN,fmQ:()=>hs,yRD:()=>BA,NcL:()=>Gy,QK6:()=>Ar,ymd:()=>lT,JV_:()=>Em,XiW:()=>qp,Yrx:()=>SE,BiY:()=>Rp,GPx:()=>Tl,gjI:()=>fl,vlo:()=>Gd,E_P:()=>zh,aAL:()=>Kf,NBq:()=>bs,wp9:()=>nb,DsR:()=>Bf,MPc:()=>Cp,gWE:()=>Dp,DT_:()=>Lp,ipn:()=>kp,ORg:()=>wi,_wz:()=>jp,RYR:()=>ld,PP2:()=>DE,wS7:()=>og,cBQ:()=>Rf,pBq:()=>km,DsO:()=>ee,X78:()=>hm,xZs:()=>dm,YFy:()=>IE,Gmt:()=>nm,K$w:()=>rm,DSj:()=>Qf,Mfr:()=>UE,k9j:()=>wf,EjS:()=>X,ww$:()=>vl,WVU:()=>tm,hxF:()=>ul,n6p:()=>Sp,E7G:()=>Ap,nwO:()=>KN,Mzk:()=>vf,aFF:()=>Ch,HRH:()=>ku,EZK:()=>Hc,Kxm:()=>Bc,Z9i:()=>yy,CrF:()=>JE,DNd:()=>Ba,vUy:()=>MN,lJh:()=>$u,zHo:()=>Gu,UO$:()=>Vm,zeJ:()=>Xn,dLR:()=>Is,JQy:()=>Vs,XtP:()=>Ss,Ug0:()=>vi,A1W:()=>Ah,sw:()=>qc,nv3:()=>Rg,JgD:()=>Pg,SkP:()=>Bs,SAs:()=>Mm,i5L:()=>Ws,PWK:()=>Bo,IM5:()=>ws,Aup:()=>mO,Mfk:()=>bv,HQx:()=>ns,oN$:()=>rs,mB6:()=>Zv,p6d:()=>w,o0x:()=>U,ufS:()=>$v,k7L:()=>Gv,ped:()=>AN,mrB:()=>I,OuZ:()=>Jc,ncP:()=>zr,FQ2:()=>Kc,W$R:()=>Qc,JOV:()=>qr,Zmi:()=>Hr,hm5:()=>Kr,ECL:()=>eu,vPL:()=>Xc,qmL:()=>dh,hPi:()=>Lm,hXd:()=>Qi,OCS:()=>Xi,p2l:()=>Hs,qF1:()=>cT,_X$:()=>pT,bzh:()=>sb,k66:()=>Zo,kiP:()=>fo,pSg:()=>ce,kz_:()=>FE,H_U:()=>ts,t9e:()=>Qa,j2$:()=>RT,PFL:()=>Ln,aJ3:()=>a_,To9:()=>qn,wpo:()=>mp,ADq:()=>ly,UUb:()=>oy,tQX:()=>sy,xy8:()=>Mn,EUG:()=>zn,AFK:()=>pn,X3M:()=>Qn,WN0:()=>es,kDl:()=>Us,uDV:()=>ph,IhQ:()=>Fs,pfb:()=>xs,R$r:()=>Xh,w80:()=>Io,Pfu:()=>Ja,Gtj:()=>Vl,fyF:()=>Gl,kkq:()=>zo,u5q:()=>Zr,O$n:()=>Tp,ptG:()=>Ep,f4_:()=>Eb,uap:()=>Tb,d7q:()=>RE,liG:()=>LE,$oF:()=>PE,avf:()=>Ud,DiQ:()=>Id,cfX:()=>wd,vD3:()=>Dd,Qrb:()=>Sd,EJQ:()=>Cd,HWy:()=>Rd,gjS:()=>pd,y6v:()=>Pd,JUW:()=>WE,GtP:()=>wb,_kX:()=>Ya,u1e:()=>qa,sJj:()=>wh,CJp:()=>Rb,uKF:()=>Sh,wo0:()=>XE,s5:()=>qo,cwx:()=>Yo,Y6b:()=>EE,TTx:()=>lm,UtR:()=>mE,HaQ:()=>um,E6I:()=>HE,Won:()=>bE,vTU:()=>fE,Nsy:()=>ap,KMQ:()=>Uh,Do$:()=>up,CSV:()=>Qs,TMe:()=>hE,l1V:()=>Bu,RHh:()=>Xu,VQ1:()=>Ku,cGG:()=>Ju,z7d:()=>Vd,Xaq:()=>os,Sj8:()=>VN,PJj:()=>Jl,k3T:()=>_i,PjQ:()=>Ui,s7l:()=>df,jLA:()=>Ib,BoX:()=>Zn,GGR:()=>Fd,j5q:()=>jd,DnY:()=>uf,RY5:()=>ah,Px$:()=>ud,KPC:()=>mN,NIY:()=>bf,HvW:()=>ff,Fof:()=>Xa,BXy:()=>Tf,fX:()=>Ub,BTI:()=>pp,uie:()=>ep,q27:()=>bp,vrC:()=>UO,fAQ:()=>gm,XkT:()=>lf,lrH:()=>_m,nt9:()=>Ei,XH8:()=>fp,XH2:()=>gi,jFi:()=>yp,qhs:()=>wo,GBJ:()=>gf,wwR:()=>cp,Uk3:()=>dn,$Rg:()=>On,ev7:()=>vN,RB9:()=>$E,iFp:()=>Xd,e$p:()=>Zd,PcX:()=>ey,SpP:()=>zd,R6_:()=>s_,CY1:()=>T_,Ajk:()=>rf,Yiz:()=>tf,FK9:()=>Ky,UOo:()=>Vv,aTW:()=>om,uug:()=>uu,P$2:()=>h_,XS2:()=>tu,Hyb:()=>vu,d3Y:()=>xc,Klp:()=>Gc,WxZ:()=>b_,Gzu:()=>Vu,ZOr:()=>sf,uqV:()=>pE,Pm4:()=>re,hWO:()=>ln,nHA:()=>bb,nVD:()=>sh,_tF:()=>tc,dED:()=>AE,P2h:()=>_E,jrr:()=>uo,mmY:()=>po,T6O:()=>is,h6J:()=>_T,hM2:()=>dN,XR6:()=>z,jmz:()=>ch,IHt:()=>uh,NZI:()=>dy,wdF:()=>Om,YNv:()=>gh,IFm:()=>vh,o_F:()=>Th,kgP:()=>vm,ZYI:()=>iT,QXK:()=>Fl,efz:()=>Ml,Q5d:()=>kl,Ysv:()=>xl,UWq:()=>Yd,ocC:()=>Wd,io3:()=>bi,Sbt:()=>Co,roS:()=>Uo,Ww1:()=>Do,QaS:()=>_f,wsP:()=>Sr,ERZ:()=>eN,CL1:()=>yN,idV:()=>Yc,nIW:()=>sn,fjE:()=>l_,sG0:()=>Yv,tV7:()=>Kl,g8o:()=>S_,Qy:()=>R_,t2P:()=>i_,KbW:()=>bo,wId:()=>vo,TAC:()=>gN,LS0:()=>go,bFH:()=>zT,Rgl:()=>eE,fW1:()=>lb,GFW:()=>cm,Ywp:()=>Cg,pg:()=>LT,WSA:()=>tE,ffJ:()=>Dv,gEI:()=>jv,fed:()=>cN,tT_:()=>Ms,BgZ:()=>$s,xIV:()=>Gs,KbL:()=>pf,JBA:()=>En,aNC:()=>Ng,RFJ:()=>nT,Zeh:()=>Gm,OT5:()=>Ug,mC3:()=>Cl,kR6:()=>BN,gFw:()=>mb,NVY:()=>tb,k6v:()=>dT,FEC:()=>yT,L5S:()=>Zh,Ob5:()=>Op,KUV:()=>vp,dvH:()=>eb,V3i:()=>vO,VD3:()=>Oi,mm2:()=>Hu,rou:()=>Im,izH:()=>Ha,DK$:()=>Ka,KMp:()=>Jf,c31:()=>_n,mbo:()=>cy,gT8:()=>Pn,CZ8:()=>Es,uGi:()=>gs,Poc:()=>vn,_9k:()=>Ns,ZTM:()=>Os,bwT:()=>_s,tF$:()=>Nn,o96:()=>ms,M4S:()=>As,_vs:()=>Gf,xF8:()=>dd,PUO:()=>Dh,ATu:()=>uy,j1S:()=>Ri,V3K:()=>Ni,Lmx:()=>Pi,oSN:()=>Ci,ZaZ:()=>gn,n_1:()=>yE,N6e:()=>Yf,SxO:()=>co,w3p:()=>rb,xU7:()=>gr,hAq:()=>vr,Y_p:()=>ko,$k6:()=>jo,Gdl:()=>Hv,U6P:()=>qv,OwB:()=>o_,hTh:()=>lh,xqc:()=>Ho,JvE:()=>Jo,i29:()=>_c,dzT:()=>qi,uPS:()=>Pf,cZV:()=>Nf,n3B:()=>oA,e6O:()=>eA,s7j:()=>g_,j$Q:()=>YE,PeS:()=>Ay,kW2:()=>Sb,tH7:()=>Wo,Yxg:()=>tl,bOT:()=>Lv,MaZ:()=>kd,nqN:()=>Ld,jWj:()=>Hd,o_J:()=>ss,yW4:()=>AT,uT0:()=>vT,C82:()=>gT,bsH:()=>hb,u9Z:()=>wm,LCU:()=>pm,J$m:()=>dE,j_Q:()=>Xy,OaI:()=>zy,wB1:()=>bN,SP6:()=>DT,ZYr:()=>EN,IMU:()=>rT,FoU:()=>VE,DVz:()=>zv,mxe:()=>iA,FHr:()=>xm,D1g:()=>Um,VO3:()=>Bg,de5:()=>Vg,Uw1:()=>Rr,J6q:()=>py,XCe:()=>oo,fbl:()=>Dg,Ir:()=>mo,XQO:()=>ho,QXb:()=>YT,zXF:()=>fh,P8_:()=>fm,iiD:()=>Hf,MOC:()=>qT,WF:()=>WT,xE1:()=>Ii,idW:()=>UN,QWZ:()=>_v,YL3:()=>Of,NW9:()=>xv,D_E:()=>_r,Fn9:()=>T,j2U:()=>qs,MpE:()=>wn,kQw:()=>kn,mfm:()=>gu,vZp:()=>yn,Wah:()=>Ty,E8K:()=>RN,VSb:()=>fs,vr_:()=>jn,Vmh:()=>FN,FgW:()=>OO,oDv:()=>us,fGG:()=>Av,kuw:()=>ps,eHk:()=>qd,Tt2:()=>ls,pQZ:()=>ds,oZ7:()=>Nv,T6Y:()=>li,VRd:()=>hn,_26:()=>hu,YkM:()=>Wn,J6y:()=>iu,njU:()=>du,TBP:()=>cs,IT0:()=>fy,x_:()=>Ih,FP6:()=>bn,biM:()=>sp,TMl:()=>lp,Vkd:()=>Tu,WiY:()=>d_,_zi:()=>Eu,RZp:()=>Vy,J6D:()=>qu,Lt4:()=>ri,QEi:()=>Jn,whI:()=>jt,KIu:()=>Ft,JhM:()=>oe,C_0:()=>pi,lzc:()=>_p,qIF:()=>sA,O27:()=>E,aBi:()=>hp,xOX:()=>ol,EdS:()=>rn,WgC:()=>tn,eEv:()=>Cn,A4t:()=>yu,YOQ:()=>Tn,Wos:()=>oi,jWr:()=>Va,Or$:()=>Bn,lhE:()=>hi,CwH:()=>Hn,pzC:()=>nl,ymH:()=>pu,QZu:()=>Gn,rYH:()=>p_,FVt:()=>ai,Kn2:()=>ue,jgw:()=>_u,Qgr:()=>Yu,OXP:()=>ys,nsY:()=>ny,vyG:()=>ty,lS4:()=>Kn,g5f:()=>y_,fp6:()=>su,Uty:()=>oa,YkG:()=>Vn,xdS:()=>Rn,kMF:()=>Fp,$NE:()=>nn,bC9:()=>en,Ian:()=>Si,KVV:()=>Rh,q9e:()=>Lo,iIf:()=>Jv,ian:()=>cl,m6e:()=>di,OFd:()=>il,kqr:()=>Fn,fnZ:()=>Lt,VFZ:()=>pl,ZiX:()=>Qr,j5n:()=>ni,zkt:()=>_,Pcm:()=>hN,QDV:()=>rl,M5u:()=>c_,laD:()=>aA,mtq:()=>Un,CtB:()=>Kv,CBv:()=>ae,I0t:()=>ci,u1G:()=>$d,gk1:()=>rA,Bgb:()=>tA,uzs:()=>kt,v0l:()=>ac,Zqp:()=>OE,j0k:()=>Go,l22:()=>HN,tCm:()=>cn,gmx:()=>ru,mOr:()=>Lu,TwZ:()=>w_,GyU:()=>Sg,zGm:()=>FT,bMg:()=>aE,EyD:()=>yg,FQA:()=>fg,fZN:()=>lE,xsF:()=>pg,Lxg:()=>dg,O3l:()=>Uf,Wni:()=>If,wRx:()=>vg,OxG:()=>KT,Jwg:()=>HT,uJQ:()=>JT,qWg:()=>Xv,i96:()=>jT,NPd:()=>xu,MrZ:()=>Vo,zhn:()=>Og,G8q:()=>hr,Jct:()=>nd,A9Y:()=>te,Y5F:()=>qA,gxP:()=>le,c$P:()=>nu,M7o:()=>Dc,BBN:()=>lo,fS6:()=>gd,ZBU:()=>Q,UkJ:()=>_o,xkv:()=>ym,z$M:()=>CN,KAm:()=>xE,lCl:()=>Zm,rkF:()=>ky,IU6:()=>CT,RGr:()=>h,aYu:()=>m,ije:()=>ql,Buf:()=>qf,YLu:()=>Yl,ct9:()=>Mo,XkY:()=>oE,T5R:()=>MT,uQS:()=>uE,wcJ:()=>Fo,d$I:()=>gl,rSp:()=>op,Sx:()=>mf,Ilm:()=>Ul,Ki6:()=>ll,VGk:()=>Vf,sFD:()=>Jb,eWN:()=>LN,dWE:()=>v_,Lkd:()=>Hp,aDL:()=>Bm,yaA:()=>cE,lOh:()=>Dm,DBr:()=>t_,hK$:()=>Ql,uKH:()=>Cv,TZ_:()=>UT,CMB:()=>lA,FU8:()=>Ef,J$p:()=>Hm,b5s:()=>qm,h2W:()=>un,SL_:()=>Pm,oUH:()=>hT,ck9:()=>xT,RAb:()=>ec,nL:()=>Wv,k$p:()=>Qb,Xs0:()=>Wl,u7I:()=>Cm,rxg:()=>Ru,bji:()=>Su,oCZ:()=>Uy,MjG:()=>Gg,FuV:()=>mT,$ju:()=>OT,t6d:()=>bT,m5F:()=>Pr,sx:()=>jN,rSc:()=>eg,U10:()=>Zy,L8n:()=>em,R9X:()=>TE,rj2:()=>mm,_C4:()=>ST,tCj:()=>Tm,uAg:()=>wE,wx9:()=>Ad,KF3:()=>wT,ax9:()=>IT,HH7:()=>Wf,ufV:()=>CE,_6y:()=>Sf,XTh:()=>jg,AJo:()=>Af,Ixr:()=>qE,oss:()=>JN,P6Y:()=>QN,q5j:()=>Ny,Bd_:()=>Ry,xkB:()=>Py,W41:()=>Sm,WkI:()=>Rm,sSE:()=>_y,GMd:()=>hc,jtL:()=>bc,Bxm:()=>wy,FVh:()=>hy,inb:()=>Ig,U_T:()=>rE,FTe:()=>ie,VGB:()=>ne,tM8:()=>wu,Wfe:()=>Mu,Ls5:()=>Fu,$bd:()=>Uu});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>g,durationToTimestamp:()=>X,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>J,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>Q,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Cr,editAttribute:()=>Dr,editEndDate:()=>xr,editRoles:()=>kr,editStartDate:()=>Mr,editTags:()=>Fr,removeAttribute:()=>jr});var o={};r.r(o),r.d(o,{EventType:()=>jh,applyCrosswalks:()=>Vh,collectCrosswalksFromAttributes:()=>Yh,compareActivenessAttributes:()=>Gh,compareAttributes:()=>xh,compareImages:()=>$h,compareRoles:()=>Hh,compareTags:()=>qh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Qh});var l=r(50914);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.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})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=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)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date("2023-01-05");return r.setFullYear(t.getUTCFullYear()),r.setMonth(t.getUTCMonth()),r.setDate(t.getUTCDate()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},N=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)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),I=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${w(e)} ${I(e)}`,C=(0,l.equals)("9"),D=(0,l.equals)("99"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),G=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),V=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),B=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),W=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,G(a),o])}return e},H=/(9+)([^9]+)*/g,J=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[V(e,s),r,B(n),i,a?W(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},K=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${J(r)}`},Q=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt(0))).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0";class Z{constructor(e){this.value=void 0,this.value=e}isNone(){return(0,l.isNil)(this.value)}extract(){return this.value}orSome(e){return(0,l.isNil)(this.value)?e:this.value}map(e){return(0,l.isNil)(this.value)?Z.None():Z.Some(e(this.value))}static Some(e){return new Z(e)}static None(){return new Z(null)}static fromFalsy(e){return e?Z.Some(e):Z.None()}static fromNull(e){return(e=>null==e)(e)?Z.None():Z.Some(e)}static fromUndefined(e){return void 0===e?Z.None():Z.Some(e)}static fromEmpty(e){return E(e)?Z.None():Z.Some(e)}}const ee=(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)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=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)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var pe=r(2507),de=r.n(pe);const ye={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"},fe={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},Te={[ye.EQUALS]:"equals",[ye.NOT_EQUALS]:"not",[ye.STARTS_WITH]:"starts with",[ye.MISSING_VALUE]:"missing value",[ye.IN_RANGE]:"in range",[ye.HAS_ALL]:"has all",[ye.FULL_TEXT]:"full text",[ye.EXISTS]:"exists",[ye.COUNT_EQUALS]:"count equals",[ye.COUNT_NOT_EQUALS]:"count not equal",[ye.COUNT_LT]:"count less",[ye.COUNT_LTE]:"count less or equal",[ye.COUNT_GT]:"count greater",[ye.COUNT_GTE]:"count greater or equal",[ye.COUNT_RANGE]:"count in range",[ye.LT]:"less than",[ye.LTE]:"less than or equal",[ye.GT]:"greater than",[ye.GTE]:"greater than or equal",[ye.IN_FILE]:"in file",[ye.NOT_IN_FILE]:"not in file",[ye.CONTAINS]:"contains",[ye.ON]:"on",[ye.BEFORE]:"before",[ye.AFTER]:"after",[ye.WITHIN]:"within"};var Ee;!function(e){e.IN="in",e.NOT_IN="notIn",e.NOT_IN_RANGE="not range"}(Ee||(Ee={}));const me=e=>({[Ee.IN]:ye.EQUALS,[Ee.NOT_IN]:ye.NOT_EQUALS}[e]||e);var he,be;!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"}(he||(he={})),function(e){e.LAST_3DAYS="last3Days"}(be||(be={}));const Oe=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=he[t]||be[t],e)),{}),ve={[he.LAST_DAY]:"Last 24 hours",[be.LAST_3DAYS]:"Last 3 days",[he.LAST_WEEK]:"Last 7 days",[he.LAST_MONTH]:"Last month",[he.LAST_6MONTHS]:"Last 6 months",[he.LAST_YEAR]:"Last year",[he.PICK_DATE]:"Pick date"},ge={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},_e={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Ae="<No label>",Ne="__number";var Pe;let Re,Se,we,Ie,Ue,Ce,De,Le,je,ke,Fe,Me,xe,$e,Ge,Ve,Be,We,Ye,qe,He,Je,Ke,Qe,Xe,ze,Ze,et,tt,rt,nt,it,at,ot,st,lt,ut,ct,pt,dt;var yt;!function(e){e.IN="in",e.OUT="out"}(Pe||(Pe={})),function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(Re||(Re={})),function(e){e.local="local",e.validationService="validationService"}(Se||(Se={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(we||(we={})),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"}(Ie||(Ie={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Ue||(Ue={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Ce||(Ce={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(De||(De={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(Le||(Le={})),function(e){e.asc="asc",e.desc="desc"}(je||(je={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(ke||(ke={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Fe||(Fe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Me||(Me={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(xe||(xe={})),function(e){e.PROFILE="profile",e.MAP="map"}($e||($e={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ge||(Ge={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ve||(Ve={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Be||(Be={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(We||(We={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(Ye||(Ye={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(qe||(qe={})),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"}(He||(He={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Je||(Je={})),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"}(Ke||(Ke={})),function(e){e.IN="in",e.OUT="out"}(Qe||(Qe={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Xe||(Xe={})),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"}(ze||(ze={})),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"}(Ze||(Ze={})),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"}(et||(et={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(tt||(tt={})),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",e.DCRReview="DCRReview"}(rt||(rt={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(nt||(nt={})),function(e){e.NEW="new",e.CLASSIC="classic"}(it||(it={})),function(e){e.ASC_BY_NAME="ascByName"}(at||(at={})),function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network",e.TREE="Tree"}(ot||(ot={})),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"}(st||(st={})),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"}(lt||(lt={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(ut||(ut={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(ct||(ct={})),function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(pt||(pt={})),function(e){e.percent="percent"}(dt||(dt={})),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"}(yt||(yt={}));const ft=yt;let Tt,Et;function mt(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){ht(e,t,r[t])}))}return e}function ht(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.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Tt||(Tt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(Et||(Et={}));const bt={startDate:{type:ft.TYPE_ACTIVENESS_DATE,get label(){return de().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:ft.TYPE_ACTIVENESS_DATE,get label(){return de().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Ot=mt({id:{type:ft.TYPE_ENTITY_ID,get label(){return de().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},bt,{roles:{type:ft.TYPE_STRING,get label(){return de().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:ft.TYPE_STRING,get label(){return de().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),vt={workflow:{type:ft.TYPE_STRING,get label(){return de().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:ft.TYPE_STRING,get label(){return de().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:ft.TYPE_STRING,get label(){return de().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},gt={commenter:{type:ft.TYPE_STRING,get label(){return de().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},_t={notResolved:{type:ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return de().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},At={createdBy:{type:ft.TYPE_STRING,get label(){return de().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:ft.TYPE_STRING,get label(){return de().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Nt={matches:{type:ft.TYPE_COUNT,get label(){return de().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:ft.TYPE_COUNT,get label(){return de().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0},relevanceScore:{type:ft.TYPE_FLOAT,get label(){return de().text("Relevance scores")},uri:"relevanceScore",name:"relevanceScores.relevance",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchAction:{type:ft.TYPE_STRING,get label(){return de().text("Match action")},uri:"matchAction",name:"relevanceScores.actionLabel",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Pt={sourceSystems:{type:ft.TYPE_STRING,get label(){return de().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:ft.TYPE_STRING,get label(){return de().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:ft.TYPE_INT,get label(){return de().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:ft.TYPE_TIMESTAMP,get label(){return de().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:ft.TYPE_STRING,get label(){return de().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Rt;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Rt||(Rt={}));const St={[Rt.matchRules]:{type:ft.TYPE_STRING,get label(){return de().text("Match Rules")},uri:Rt.matchRules,name:Rt.matchRules,faceted:!0,hideForDataTenant:!0},[Rt.MLRecommendedMatch]:{type:ft.TYPE_STRING,get label(){return de().text("Match IQ")},uri:Rt.MLRecommendedMatch,name:Rt.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},wt=mt({},Ot,vt,gt,_t,At,Nt,Pt,St,{type:{type:ft.TYPE_STRING,get label(){return de().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),It="NOT_MATCH";var Ut=r(13980),Ct=r.n(Ut);const Dt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Lt=(0,l.equals)(Dt.SUGGESTING),jt=(0,l.equals)(Dt.EDITING),kt=(0,l.equals)(Dt.VIEWING),Ft=(0,l.either)(jt,Lt);function Mt(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){xt(e,t,r[t])}))}return e}function xt(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=Ct().oneOf(["mobile","tablet","desktop"]),Gt=Ct().shape({deviceTypes:Ct().oneOfType([$t,Ct().arrayOf($t)]),roles:Ct().arrayOf(Ct().string)}),Vt=Ct().shape({value:Ct().string,lookupCode:Ct().string}),Bt=Ct().shape({displayName:Ct().string,parent:Ct().string}),Wt=Ct().oneOfType([Ct().string,Ct().number,Ct().bool,Vt]),Yt=Ct().oneOfType([Wt,Ct().arrayOf(Wt)]),qt=Ct().shape({fieldName:Ct().string,values:Ct().arrayOf(Yt),filter:Ct().string,type:Ct().string}),Ht=Ct().shape({minValue:Ct().number,maxValue:Ct().number}),Jt=Ct().shape({label:Ct().string,name:Ct().string,description:Ct().string,type:Ct().string,hidden:Ct().bool,faceted:Ct().bool,searchable:Ct().bool,uri:Ct().string,access:Ct().arrayOf(Ct().string),cardinality:Ht}),Kt=Ct().shape({label:Ct().string,uri:Ct().string,typeColor:Ct().string,direction:Ct().string,startObject:Ct().object,endObject:Ct().object}),Qt=Ct().shape({typeColor:Ct().string,typeIcon:Ct().string,typeImage:Ct().string,label:Ct().string,uri:Ct().string,attributes:Ct().arrayOf(Jt)}),Xt=Ct().shape({uri:Ct().string,label:Ct().string,memberTypes:Ct().array,extendsTypeUri:Ct().string,attributes:Ct().arrayOf(Jt)}),zt=Ct().shape({uri:Ct().string,label:Ct().string,extendsTypeUri:Ct().string,relationshipTypeURIs:Ct().arrayOf(Ct().string)}),Zt=Ct().shape({uri:Ct().string,description:Ct().string,label:Ct().string,schemaVersion:Ct().string,entityTypes:Ct().arrayOf(Qt),roles:Ct().arrayOf(Ct().object),groupTypes:Ct().arrayOf(Ct().object),relationTypes:Ct().arrayOf(Kt),graphTypes:Ct().arrayOf(zt),interactionTypes:Ct().arrayOf(Xt),sources:Ct().arrayOf(Ct().object)}),er=Ct().shape({uri:Ct().string,type:Ct().string}),tr=Ct().shape({uri:Ct().string,type:Ct().string}),rr=Ct().shape({value:Ct().object,ov:Ct().bool,type:Ct().string,uri:Ct().string}),nr=Ct().shape({refEntity:Ct().oneOfType([Ct().array,Ct().object]),refRelation:Ct().oneOfType([Ct().array,Ct().object]),value:Ct().object,ov:Ct().bool,type:Ct().string,uri:Ct().string}),ir=Ct().oneOf((0,l.values)(Dt)),ar=Ct().shape({type:Ct().oneOf(Object.values(Re)).isRequired,attributeTypeUri:Ct().string.isRequired,parentUri:Ct().string.isRequired,uri:Ct().string,message:Ct().string}),or={attributeType:Jt,showEmptyEditors:Ct().bool,lazy:Ct().bool,mode:ir,metadata:Zt,ownError:ar,errors:Ct().arrayOf(ar),crosswalks:Ct().array,onAddAttributes:Ct().func,onAddOneMore:Ct().func,onDeleteAttribute:Ct().func,onChangeAttribute:Ct().func,additionalControlsRenderer:Ct().func,hideDeleteButton:Ct().bool,showNonOv:Ct().bool,state:Ct().oneOf(["deleted","edited"]),expanded:Ct().bool},sr=Mt({attributeValue:rr},or),lr=Mt({attributeValue:nr},or),ur=Ct().shape({value:Ct().oneOfType([Ct().string,Ct().bool,Ct().number]),ov:Ct().bool,type:Ct().string,uri:Ct().string,lookupCode:Ct().string,lookupRawValue:Ct().string}),cr=Ct().shape({inRelations:Ct().arrayOf(Ct().oneOfType([Ct().object,Ct().string])),outRelations:Ct().arrayOf(Ct().oneOfType([Ct().object,Ct().string])),groups:Ct().arrayOf(Ct().string),entityTypes:Ct().arrayOf(Ct().string),nextEntry:Ct().object}),pr=Ct().oneOf(["asc","desc"]),dr=Ct().shape({id:Ct().string,content:cr,allowOnlyCreateNew:Ct().bool,sortColumn:Ct().string,sortOrder:pr,"text-empty":Ct().string,max:Ct().number,icon:Ct().string,caption:Ct().string,canCreate:Gt,canRead:Gt,canUpdate:Gt,canDelete:Gt,editingEnabled:Ct().bool}),yr=Ct().shape({entityUri:Ct().string,entityType:Ct().string,entityLabel:Ct().string,object:er}),fr=Ct().shape({relationUri:Ct().string,relationType:Ct().string,relationLabel:Ct().string,direction:Ct().string,object:tr}),Tr=Ct().shape({entity:yr,relation:fr}),Er=Ct().shape({value:Ct().string,isRawFilter:Ct().bool}),mr=Ct().shape({id:Ct().string,label:Ct().string,name:Ct().string,availableEntityTypes:Ct().array}),hr=[{label:de().text("And"),value:"and"},{label:de().text("Or"),value:"or"},{label:de().text("And not"),value:"and not"},{label:de().text("Or not"),value:"or not"}],br="___!status_code!___",Or=(0,l.when)((0,l.is)(Object),JSON.stringify),vr=e=>{var t;return(null==e?void 0:e[br])||(null==e||null===(t=e.originalResponse)||void 0===t?void 0:t.status)},gr=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([[(0,l.prop)("originalResponse"),(0,l.pipe)((0,l.path)(["originalResponse","status"]),(e=>((e,t)=>{switch(e){case 400:return de().text("Bad Request");case 403:return de().text("Forbidden");case 404:return de().text("Not Found");case 405:return de().text("Method Not Allowed");case 408:return de().text("Request Timeout");case 500:return de().text("Internal Server Error");case 502:return de().text("Bad Gateway");case 503:return de().text("Service Unavailable");case 504:return de().text("Gateway Timeout");default:return t||de().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),Or)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,Or]])(e)},_r=e=>"AbortError"===e.name,Ar=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.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,l.pluck)("percent",i);const s=Math.sign(o),u=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<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},Nr=/[\n\r%#()<>?[\\\]^`{}|]/g,Pr=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(Nr,encodeURIComponent)}`,Rr=e=>`data:image/gif;base64,${e}`,Sr=e=>{switch(e){case"minutes":return de().text("minutes");case"hours":return de().text("hours");case"days":return de().text("days");case"weeks":return de().text("weeks");case"months":return de().text("months");case"years":return de().text("years");default:return""}};var wr=r(76665);function Ir(e,t,r,n){if(null==t){const i=`\n Uri is null or undefined.\n getPartInfo parameters when the error occurred:\n 1. name - ${e}\n 2. uri - ${t}\n 3. fullUri - ${r}\n 4. attrType - ${ue(n)?JSON.stringify(n):n}\n `;console.error(i)}const 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 Ur(e,t){const r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[];for(let i=0;i<r.length;i+=2)n.push(Ir(r[i],r[i+1],e,t));return n}function Cr(e,t,r,n,i,a,o){void 0===a&&(a=0);const s=Ur(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ur(r,t))}\n addAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n index: ${o}\n `;console.error(s)}if(s.hasChildren)return e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]),Cr(e[s.name].find((function(e){return e.uri===s.valueUri})).value,t,r,n,i,a+1,o);{if(e[s.name]||(e[s.name]=[]),null==n)return;const a=e[t.name],l=n,u=n;let c={value:n.refEntity||ue(l.value)&&!Array.isArray(l.value)?l.value:n,uri:r,type:t.uri};if(n.lookupCode){const e=c,t=n;e.value=t.value,e.lookupCode=t.lookupCode,c=e}if(u.refEntity){const e=c;e.refEntity=u.refEntity,e.label=u.label,c=e}if(u.refRelation){const e=c;e.refRelation=u.refRelation,c=e}return i&&(c.crosswalks=i),a.splice(o||0,0,c),n}}function Dr(e,t,r,n,i,a){void 0===a&&(a=0);const o=Ur(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ur(r,t))}\n editAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n `;console.error(o)}if(!o.hasChildren){const o=e[t.name];let s,l=o&&o.find((function(e){return e.uri===r}));if(l){if("[object Object]"!==l.value.toString())Lr(n,l),i&&(l.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&o.filter((function(e){return!1===e.ov})).forEach(Lr.bind(null,n));else if(function(e){return void 0!==e.refEntity}(n)){const e=l;e.refRelation=n.refRelation,e.refEntity=n.refEntity,e.value=n.value,e.label=n.label,l=e}else null!==n.value&&void 0!==n.value&&null!==l.value&&"object"==typeof l.value&&(l.value=n.value,l.label=n.label);s=l.value}else s=Cr(e,t,r,n,i,a);return s}{const s=Dr(e,o,o.valueUri,{},i,a);Dr(s,t,r,n,i,a+1)}}function Lr(e,t){!function(e){return ue(e)}(e)?(t.value=e,t.lookupCode&&(t.lookupCode=e)):(t.value=e.value,t.lookupCode=e.lookupCode)}function jr(e,t,r,n){void 0===n&&(n=0);const i=Ur(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ur(r,t))}\n removeAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n nestingLevel: ${n}\n `;console.error(i)}if(i.hasChildren){const a=(e[i.name]||[]).find((function(e){return e.uri===i.valueUri}));a&&jr(a.value,t,r,n+1)}else{const n=e[t.name];n&&(n.forEach((function(e,t){e.uri===r&&n.splice(t,1)})),0===n.length&&delete e[t.name])}}function kr(e,t){e.roles=t||[]}function Fr(e,t){e.tags=t||[]}function Mr(e,t){e.startDate=t}function xr(e,t){e.endDate=t}var $r=r(37164);const Gr="1Tempo4rary",Vr="1Tepmo4Rel",Br=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Wr=(0,$r.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Yr=()=>`${Wr()}${Date.now()}`,qr=()=>`1Tempo4DCR${Yr()}`,Hr=e=>`${e}/uri$$${Yr()}`,Jr=e=>()=>Hr(e),Kr=(e,t)=>{const r=Br(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Hr(n)},Qr=e=>e&&e.includes("uri$$"),Xr=Jr("entities"),zr=Jr("relations"),Zr=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),en=(0,l.startsWith)("relations/"),tn=(0,l.startsWith)("entities/"),rn=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),nn=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),an=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),on=(0,l.pipe)((0,l.split)("/"),l.head),sn=(0,l.pipe)((0,l.split)("/"),l.last),ln=e=>e.split(".").slice(0,2).join("."),un=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},cn=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),pn=(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("/")},dn=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},yn=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),fn=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},Tn=e=>5===e.split("/").length,En=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},mn=e=>e.replace(/uri\$\$/g,Gr),hn=e=>null==e?void 0:e.startsWith("changeRequests/"),bn=e=>hn(e)&&e.includes("/changes/"),On=e=>e.split("/changes/")[1],vn=(0,l.prop)("referencedEntityTypeURI"),gn=(0,l.prop)("relationshipTypeURI"),_n=(0,l.prop)("referencedAttributeURIs"),An=(0,l.curry)(((e,t)=>(0,l.pipe)(_n,(0,l.filter)((0,l.startsWith)(e)))(t))),Nn=An("configuration/relationTypes"),Pn=An("configuration/entityTypes"),Rn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),Sn=(0,l.filter)(Rn),wn=(e,t)=>!t||t.some((t=>an(e.uri,t)));function In(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Un=e=>(0,l.allPass)([(0,l.propSatisfies)((0,l.anyPass)([l.isNil,Fn,rn]),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",ft.TYPE_STRING)])(e),Cn=(0,l.has)("values"),Dn=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(ft.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(ft.TYPE_LOOKUP)],[Cn,(0,l.always)(ft.TYPE_ENUM)],[Un,(0,l.always)(ft.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",ft.TYPE_BOOLEAN),(0,l.always)(ft.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Ln=(0,l.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){In(e,t,r[t])}))}return e}({},e,{type:Dn(e)})),(0,l.pick)(["type","values","lookupCode","uri","name","dependentLookupCode","singleValue"])),jn=e=>!!e&&(!!e.autoGenerated&&e.type!==ft.TYPE_NESTED||!!e.parentAutoGenerated),kn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Fn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.startsWith)("configuration/"),l.not),Mn=e=>kn(e)?"analyticsAttributes":"attributes",xn=(0,l.propEq)("hidden",!0),$n=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),Gn=$n(ft.TYPE_NESTED),Vn=$n(ft.TYPE_REFERENCE),Bn=$n(ft.TYPE_IMAGE),Wn=(0,l.either)(Gn,Vn),Yn=(e,t)=>{const r=kn(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,l.chain)((0,l.prop)("name"),t),(0,l.last)(n)]:[...n.slice(1)]].join(".")},qn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Hn=(0,l.pipe)(qn,Boolean),Jn=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Kn=(0,l.both)(Hn,(0,l.pipe)(qn,("rdm",(0,l.pipe)(on,(0,l.equals)("rdm")))));const Qn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Mn({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,l.propEq)("uri",r)):null,s=o?i(o.uri):0,u=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,l.last)(o.split(`/${n}/`)),c=(r?r[n]||zn(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(...u(c,i+1)),p},c=u(o,s),p=c.length===i(t)-s;return p?c:[]},Xn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Qn(e,t,r);return n.length?(0,l.last)(n):null},zn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,l.cond)([[(0,l.has)("analyticsAttributes"),(0,l.prop)("analyticsAttributes")],[(0,l.anyPass)([(0,l.propEq)("type",ft.TYPE_NESTED),(0,l.propEq)("type",ft.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",ft.TYPE_REFERENCE),(0,l.pipe)(_n,(0,l.map)((t=>Xn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Zn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;const r=zn(e,t);return r&&Vn(t)?Sn(r):r},ei=[ft.TYPE_ACTIVENESS_DATE,ft.TYPE_DATE,ft.TYPE_TIMESTAMP,ft.TYPE_LOCAL_DATE],ti=[ft.TYPE_ACTIVENESS_DATE,ft.TYPE_TIMESTAMP,ft.TYPE_LOCAL_DATE],ri=e=>ei.includes(e),ni=e=>ti.includes(e),ii=[ft.TYPE_INT,ft.TYPE_LONG,ft.TYPE_NUMBER,ft.TYPE_FLOAT,ft.TYPE_DOUBLE,ft.TYPE_COUNT],ai=e=>ii.includes(e),oi=e=>[ft.TYPE_FLOAT,ft.TYPE_DOUBLE].includes(e),si=[ft.TYPE_BOOLEAN,ft.TYPE_BOOLEAN_RADIO,ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED],li=e=>si.includes(e),ui=[ft.TYPE_URL,ft.TYPE_BLOG_URL,ft.TYPE_IMAGE_URL],ci=e=>ui.includes(e),pi=$n(ft.TYPE_EMAIL),di=e=>ft.TYPE_SSN===e;var yi,fi=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(yi||(yi={}));const Ti=(0,l.curry)(((e,t,r)=>{var n;const i=e===yi.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)))})),Ei=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),mi=(0,l.curry)(((e,t)=>(0,l.pipe)(Ei(e),(0,l.prop)("extendsTypeURI"))(t))),hi=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(mi(e,r)));return n(r)})),bi=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=mi(e,n);return r})),Oi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Oi(e,Ei(e,t.extendsTypeURI),r):void 0,vi=(e,t)=>{const r=t.map(bi(e));return(r.length?r.reduce(l.intersection):[])[0]},gi=(e,t)=>Oi(e,"string"==typeof t?Ei(e,t):t,"typeImage"),_i=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&hi(e,t,n.uri)?r.concat(n.uri):r),[]);function Ai(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ni=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Pi=(0,l.pipe)(Ni,(0,l.propOr)("","label")),Ri=(0,l.curry)(((e,t)=>{const r=Ni(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Si=(0,l.curry)(((e,t,r)=>{const[n,i]=Ri(e,r);return hi(e,n,t)||hi(e,i,t)})),wi=(0,l.pipe)((0,l.propOr)([],"relationTypes"),(0,l.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){Ai(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ii=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?Pe.OUT:Pe.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Pe.IN),i=r(Pe.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ui=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Ci=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Ci(e,Ni(e,t.extendsTypeURI),r):void 0;var Di;!function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE",e.INITIATE_CHANGE_REQUEST="INITIATE_CHANGE_REQUEST",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(Di||(Di={}));const Li=(0,l.curry)(((e,t)=>e.every((e=>ji(e,t))))),ji=(0,l.curry)(((e,t)=>{const r=jn(t);return ki(e,t)&&(e===Di.READ||!r)})),ki=(e,t)=>!t||!t.access||t.access.includes(e),Fi=(0,l.curry)(((e,t,r)=>ji(Di.READ,r)&&(Lt(t)?ji(Di.INITIATE_CHANGE_REQUEST,r):ji(e,r)))),Mi=Fi(Di.CREATE),xi=Fi(Di.DELETE),$i=Fi(Di.UPDATE),Gi=Li([Di.CREATE,Di.MERGE,Di.READ,Di.UPDATE]),Vi=Li([Di.UPDATE,Di.READ,Di.CREATE]),Bi=Li([Di.UPDATE,Di.READ]),Wi=Li([Di.DELETE,Di.UPDATE,Di.READ]),Yi=(0,l.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,l.pipe)((0,l.propOr)([],"matchGroups"),(0,l.find)((0,l.propEq)("uri",t)),(0,l.defaultTo)({}),(0,l.prop)("type"))(e))(t,r)]||e["*"])),qi=(e,t,r)=>(0,l.pipe)((0,l.map)(Yi(e,t)),(0,l.filter)(l.identity))(r),Hi=(e,t,r)=>{const n=qi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&ji(Di.MERGE,r)},Ji=(0,l.curry)(((e,t,r,n)=>{const i=Ni(e,n),[a,o]=Ri(e,n);return i&&ji(Di.CREATE,i)&&hi(e,a,t.type)&&hi(e,o,r.type)})),Ki=(e,t,r,n,i)=>{const a=Ei(e,n.type),o=qi(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(l.identity);return o.some((t=>{let{inRelations:r=[],outRelations:a=[]}=t;return r.some(Ji(e,n,i))||a.some(Ji(e,i,n))}))},Qi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Ei(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Hi(o,i,a),canAddRelation:Ki(e,o,i,r,n),canMark:ji(Di.UPDATE,a)&&ji(Di.READ,a)}},Xi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Qi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),zi=kn,Zi=(0,l.complement)(zi),ea=ji(Di.READ),ta=e=>{let{attributeType:t,mode:r}=e;return Zi(t)&&Mi(r,t)&&!xn(t)},ra=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Qr(r.uri),o=$i(n),s=Mi(n);return(0,l.cond)([[zi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},na=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Qr(r.uri),s=$i(n),u=xi(n),c=aa(Di.UPDATE,n,a,r),p=aa(Di.DELETE,n,a,r);return(0,l.cond)([[zi,l.F],[(0,l.always)(o),l.T],[(0,l.always)(i),(0,l.allPass)([u,p])],[l.T,(0,l.allPass)([s,u,c,p])]])(t)},ia=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&zn(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!ki(e,n)||!ia(e,t,r[n.name],n)))))})),aa=(0,l.curry)(((e,t,r,n,i)=>Lt(t)?ia(Di.INITIATE_CHANGE_REQUEST,r,n,i):ia(e,r,n,i))),oa=(0,l.both)((0,l.complement)(xn),ea),sa="SuperUser",la="allTenants",ua=[la,"allCustomers"],ca=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions||void 0!==(null==e?void 0:e.roles);case r.ADMIN:return(e=>t=>((null==t?void 0:t.roles)||[]).includes(e))(r.ADMIN);default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,l.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===sa})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,l.endsWith)(["*"],o)?o.slice(0,-1):o,(0,l.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===sa){const e=r?ua.concat(r.map((e=>`allTenants.${e}`))):ua,n=r&&t[0]===la?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.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)}:l.F}var t}))},pa={NON_SECURED:"NON_SECURED",SECURED:"SECURED",ADMIN:"ROLE_ADMIN",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",CAN_READ_PREFERENCES:"CAN_READ_PREFERENCES",CAN_UPDATE_PREFERENCES:"CAN_UPDATE_PREFERENCES",CAN_CREATE_PREFERENCES:"CAN_CREATE_PREFERENCES",CAN_DELETE_PREFERENCES:"CAN_DELETE_PREFERENCES"},da={[pa.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[pa.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[pa.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[pa.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[pa.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[pa.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[pa.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[pa.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[pa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[pa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[pa.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[pa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[pa.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[pa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[pa.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[pa.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[pa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[pa.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[pa.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[pa.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[pa.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[pa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[pa.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[pa.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[pa.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[pa.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[pa.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[pa.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[pa.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[pa.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},ya=(0,l.curry)(((e,t,r)=>ca({allowedPermissionsNames:e,permissionsNames:pa,permissionsConfig:da}).some((e=>e(t,{params:{tenant:r}}))))),fa=ya([pa.CAN_EXPORT]),Ta=ya([pa.CAN_EXPORT_ACTIVITIES]),Ea=ya([pa.CAN_IMPORT_ENTITIES_FROM_DT]),ma=ya([pa.CAN_READ_ENTITIES_FROM_DT]),ha=ya([pa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ba=ya([pa.CAN_UPDATE_PROCESS_INSTANCE]),Oa=ya([pa.CAN_VIEW_WORKFLOW_DEFINITION]),va=ya([pa.CAN_CONFIG_ENVIRONMENT_REGISTER]),ga=ya([pa.CAN_UPDATE_WORKFLOW_DATA_TASK]),_a=ya([pa.CAN_READ_WORKFLOW_DATA_TASK]),Aa=ya([pa.CAN_MANAGE_WORKFLOW_DEFINITION]),Na=ya([pa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Pa=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Ra=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Sa=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),wa=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Ia=ya([pa.CAN_EXECUTE_WORKFLOW_JOBS]),Ua=ya([pa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ca=ya([pa.CAN_CREATE_CONFIG_JAR]),Da=ya([pa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),La=ya([pa.CAN_VIEW_CONFIG_JAR]),ja=ya([pa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),ka=ya([pa.CAN_VIEW_WORKFLOW_JOBS]),Fa=ya([pa.CAN_MAKE_BULK_UPDATE]),Ma=ya([pa.CAN_OPEN_DATA_LOADER_EXECUTE,pa.CAN_OPEN_DATA_LOADER_READ]),xa=ya([pa.CAN_BULK_DELETE_PROFILES]),$a=ya([pa.CAN_READ_MDM_DATA_ENTITIES]),Ga=ya([pa.CAN_READ_DVF]),Va=ya([pa.IS_FREEMIUM_ADMIN]),Ba=(0,l.reject)(xn),Wa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ba,(0,l.filter)(e))(t),Ya=(0,l.curry)(((e,t)=>Wa((t=>ta({attributeType:t,mode:e})),t))),qa=(0,l.curry)(((e,t)=>Wa((t=>ta({attributeType:t,mode:e})||oa(t)),t))),Ha=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(oa)),Ja=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ja(e)])))),Ka=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(oa),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ka(e)])))),Qa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Qa(e)])))),Xa=(0,l.pipe)(Ei,(0,l.converge)(l.concat,[Ka,Qa]));function za(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){Za(e,t,r[t])}))}return e}function Za(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eo=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,eo(e)))},t))),to=e=>{var t;return za({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},ro=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),no=(0,l.when)(ro,(0,l.dissoc)("values")),io=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return za({},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})})),ao=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},oo=(0,fi.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Ja,t).concat((0,l.chain)(Ja,r)).some(ao)})),so=e=>{let t=!1;const r=eo((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?za({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},lo=e=>{const t=oo(e),r=(0,l.map)((e=>eo((0,l.pipe)(no,(0,l.when)((0,l.always)(e),io))))(t)),n=(0,l.map)(to),i=(0,l.map)(so);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},uo=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),co=(0,l.prop)("relationshipTypeURIs"),po=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(yo(e,t)))||[]})),yo=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Si(e,t))},fo=(e,t)=>(0,l.pipe)(uo,(0,l.defaultTo)({}),co,(0,l.defaultTo)([]),(0,l.chain)(Ri(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Ei(e)))(e,t),To=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Eo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),mo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Eo((0,l.complement)(To))(e)},ho=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Eo(To)(e)},bo=(0,l.pipe)(Ei,(0,l.propOr)([],"matchGroups")),Oo=(e,t,r)=>(0,l.pipe)(bo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),vo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(Oo,(0,l.propOr)(r,"label"))(e,t,r))),go=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(bo,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),_o=e=>(0,l.partition)(To,e),Ao=(0,l.includes)(l.__,["and","or","not"]),No=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Po=(0,l.includes)(l.__,["equals","notEquals","in"]),Ro=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return Ao(t)?Ro(r):No(t)?r.filter(rn):Po(t)?r.map((0,l.prop)("uri")).filter(rn):[]})),l.uniq),So=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Ro),l.uniq),wo=(0,l.pipe)(bo,So),Io=(0,l.pipe)(go,So),Uo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Co=(0,l.pipe)(Uo,Ka),Do=(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||hi(e,n,t)})(e,t))})(e,t)),Lo=e=>!!e.required,jo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=(0,l.cond)([[rn,Ei(e)],[nn,Ni(e)]])(t);return ko(e,a,r,n,i)},ko=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&rn(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!jn(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===ft.TYPE_REFERENCE){const a=gn(t),s=_n(t);o=jo(e,a,r,n,[...i,t]).filter((e=>s.some(an(e.uri))))}else t.attributes&&(o=ko(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===ft.TYPE_REFERENCE?jo(e,gn(t),r,n,[...i,t]):[]},Fo=e=>{const t=(0,l.pipe)((0,l.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),l.values,(0,l.filter)(l.identity))(e);return(0,l.filter)((0,l.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,l.any)((0,l.anyPass)([(0,l.includes)(n),(0,l.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),Lo]),e.attributes||[])},Mo=(e,t)=>{const r=Pn(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},xo=(0,l.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)?de().text(n):n};return r(null,t)})),$o=["label","description","abbreviation","caption","toolTip"],Go=e=>xo($o,e),Vo=(0,l.mergeRight)({attributeTypes:[],categoryTypes:[],changeRequestTypes:[],entityTypes:[],graphTypes:[],groupTypes:[],interactionTypes:[],relationTypes:[],roles:[],sources:[],survivorshipStrategies:[]}),Bo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=sn(t);return r.find((e=>{let{uri:t}=e;return sn(t)===n}))})),Wo=(0,l.curry)(((e,t)=>{const r=sn(t);return(0,l.pipe)(Bo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Yo=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,l.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"})},qo=(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}))},Ho=(0,l.curry)(((e,t)=>{let{roles:r=[]}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Jo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Ei(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Ko(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){Qo(e,t,r[t])}))}return e}function Qo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return zo(i,e,t,r,n)},zo=function(e,t,r){var n;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return Z.fromNull(e&&e.length?e:null===(n=zn(t,r))||void 0===n?void 0:n.filter((0,l.complement)(Vn))).map((e=>e.map((e=>{const r=Xo(t,e,i,a);return r.length?Ko({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Wn),(0,l.prop)("children"))).filter(oa).filter(i).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes","analyticsAttributes"])},es=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes"])},ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["analyticsAttributes"])},rs=e=>e.children?e.children.flatMap(rs):e,ns=e=>e.children?[e,...e.children.flatMap(ns)]:e,is=(0,l.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),as=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return sn(r)===e})))),os=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),as("LUD")),(0,l.defaultTo)(r))(t||[])},ss=(e,t)=>{let{survivorshipStrategies:r}=e;return as(t,r)},ls=(0,l.allPass)([(0,l.complement)(l.isNil),ji(Di.READ)]),us=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),ji(Di.READ)]),cs=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([ji(Di.CREATE),ji(Di.INITIATE_CHANGE_REQUEST)])]),ps=(0,l.curryN)(2,(0,l.pipe)(Ei,us)),ds=(0,l.curryN)(2,(0,l.pipe)(Ni,ls)),ys=e=>{let{ov:t}=e;return!1!==t},fs=(e,t)=>((e,t)=>ci(e.type)&&ae(t))(e,t)||((e,t)=>pi(e.type)&&oe(t))(e,t),Ts=e=>t=>(0,l.cond)([[l.isNil,(0,l.always)(null)],[(0,l.pipe)((0,l.prop)(e),Array.isArray),(0,l.path)([e,0])],[l.T,(0,l.prop)(e)]])(t),Es=Ts("refEntity"),ms=Ts("refRelation"),hs=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],bs=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Os=(0,l.prop)("objectURI"),vs=(0,l.prop)("objectURI"),gs=(0,l.prop)("type"),_s=(0,l.pipe)(Es,(0,l.defaultTo)({}),Os),As=(0,l.pipe)(ms,(0,l.defaultTo)({}),vs),Ns=(0,l.pipe)(Es,(0,l.defaultTo)({}),gs),Ps=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type,uri:e.uri,value:e.value})));return(e||[]).concat(r)},Rs=(0,l.evolve)({refEntity:re,refRelation:re});function Ss(e,t,r,n){const i=Qn(e,r),a=Ei(e,t.type)||Ni(e,t.type);if(0===i.length)return null;const o=Mn(r);let s=[t],u=1;i[0].uri!==t.type&&(u=0);let c=null;const p=n?[]:null;let d=null;for(let e=u;e<i.length;++e){const t=e===i.length-1,r=i[e];let u=[];if(!wn(r,d)){c=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const c=s.value||s[o]||{};let y=[];r.startObject&&r.endObject||(0,l.both)(fn,nn)(r.uri)?(y=((null==a?void 0:a.attributes)||[]).filter((e=>gn(e)===r.uri||vn(e)===r.uri)),d=y.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(y.push(r),d=null),y.forEach((a=>{const o=c[a.name];o&&(u=u.concat(o)),n&&t&&p.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=u),t&&(c=s)}return p||c}const ws=(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?ws(a.value,o):a},Is=(0,l.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return ws(e[r],i)}));function Us(e){return(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]])(e)}const Cs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),Ds=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","uri"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","uri"])],[l.T,(0,l.pick)(["value","uri"])]]),Ls=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(Ls(e,i)))))(r)})),js=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(js(e)),e)(t))),ks=(e,t)=>(0,l.curry)(((r,n)=>(0,l.pipe)(Ls(e,r),js(t))(n))),Fs=ks(null,Us),Ms=ks(ys,Us),xs=ks(null,Cs),$s=ks(ys,Cs),Gs=ks(ys,Ds),Vs=(e,t,r)=>{var n,i,a;return e.uri===t?null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=Is(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Bs=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(_s,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Ws=(e,t)=>{const r=En(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Vs(e,r,n)},Ys=Object.values(bt),qs=(0,l.includes)(l.__,Ys),Hs=e=>Ys.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Js(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){Ks(e,t,r[t])}))}return e}function Ks(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qs=(e,t)=>`${e}_${t}`,Xs=[wt.matches.name,wt.matchRules.name],zs=(0,l.values)(vt).map((e=>e.name)),Zs=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,zs)))),el=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Xs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Qs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),tl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Zs(r),el(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Qs(`dtPotentialMatches.${t.name}`,"")))))(wt)},rl=(0,l.propEq)("uri",wt.type.uri),nl=e=>(0,l.values)(St).some((0,l.propEq)("uri",null==e?void 0:e.uri)),il=(0,l.propEq)("uri",Pt.sourceSystems.uri),al=Object.values(Ot),ol=(0,l.includes)(l.__,al),sl=e=>{let{entity:t,attributeType:r,value:n}=e;return Js({},t,{[r.uri]:void 0===n?r.defaultValue:n})},ll=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},ul=e=>{let{entity:t,attributeType:r,value:n}=e;return Js({},t,{[r.uri]:n})},cl=(0,l.propEq)("uri",Ot.roles.uri),pl=(0,l.propEq)("uri",Ot.tags.uri);function dl(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){yl(e,t,r[t])}))}return e}function yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fl=e=>{let{parentUri:t,attributeType:r}=e;return dl({uri:Kr(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(Wn,Bn),(0,l.always)({value:{}})],[Hn,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),ri)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Tl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ya(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Jn,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=fl({parentUri:r,attributeType:e}),s=Zn(n,e);s&&(a.value=Tl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Jn(e))&&(o[t]=[a])}return o},El=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return jo(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=En(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Ss(r,e,a)||[]).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,a)=>{let{parentUri:o,attributes:s}=a;if(!s[i]||0===s[i].length){let i=bl({entity:e,attributeType:t,parentUri:o,index:0});if(Wn(t)){const e=Zn(r,t);i=ml({attributeType:t,subAttributes:e,metadata:r,mode:n,parentUri:o},i)}return i}return e}),e)}),t)},ml=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a,parentUri:o}=e;const s=Ss(i,t,r.uri).find((e=>{let{uri:t}=e;return an(t,o)})),l=dl({},s,{value:Tl({attributeTypes:n,parentUri:s.uri,mode:a,metadata:i})});return vl({entity:t,attributeType:r,uri:s.uri,value:l})})),hl=(0,l.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,l.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===ft.TYPE_NESTED?dl({},e,{value:hl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return dl({},s(t),Tl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),bl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=fl({parentUri:n,attributeType:r}),u=Us(l);return(0,wr.ZP)(t,(e=>{Cr(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ol=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,wr.ZP)(t,(e=>{Cr(e.attributes||e.value,r,n.uri,Us(n),a,o,i)}))},vl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,wr.ZP)(t,(e=>{Dr(e.attributes||e.value,r,n,i,a,o)}))},gl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,wr.ZP)(t,(e=>{jr(e.attributes||e.value,r,n,i)}))},_l=e=>""===e,Al=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([_l,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([_l,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),Nl=(0,l.reject)(Al),Pl=e=>{let{deleteEmptyComplex:t,valueTransformer:r=l.identity}=e;return(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.map)((0,l.pipe)(r,(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(e=>Pl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Nl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Rl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Pl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Rs),deleteEmptyComplex:e})},Sl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Rl(e),(0,l.reject)(l.isEmpty))},wl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return qs(r)?sl({entity:e,attributeType:r}):bl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Il=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return qs(r)?ul({entity:e,attributeType:r,value:i}):vl({entity:e,attributeType:r,uri:n,value:i})})),Ul=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return qs(r)?ll({entity:e,attributeType:r}):gl({entity:e,attributeType:r,uri:n})})),Cl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.pipe)((0,l.filter)((0,l.pipe)((0,l.pathOr)([],["roles"]),(0,l.either)((0,l.propEq)("length",0),(0,l.any)((e=>t.includes(e)))))),(0,l.map)((0,l.pathOr)([],["attributes"])),l.flatten)(e)},Dl="UrlThumbnail",Ll="CdnUrlThumbnail",jl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(ys):(0,l.head)(n);return e&&e.value}return null})(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),kl=jl(["CdnUrl","Url"],!0),Fl=jl(["CdnUrlPreview","UrlPreview"],!0),Ml=jl([Ll,Dl],!0),xl=jl([Ll,Dl],!1),$l=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Fn,(0,l.always)(t)],[(0,l.both)(kn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Fn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(qs(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Gl=(e,t,r)=>{const n=Ha(e),i=(0,l.any)(r?l.T:ys);return $l(n,t,i)},Vl=(e,t,r,n,i,a)=>{const o=Qr(null==r?void 0:r.uri)?Ya(t,e):qa(t,e);return $l(o,r,((e,o)=>{const s=ta({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:ys,e)||Fn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Bl;const Wl=e=>{Bl=e};function Yl(e,t){return Bl(e,t)}const ql=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,l.when)((0,l.is)(String),(0,l.always)({errorMessage:e,errorCode:t}))(e))}),null)})),Hl=50,Jl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Hl,offset:a=0,sortByDisplayName:o=!0,sortOrder:s=je.asc}=e;return Yl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a,sortByDisplayName:o,sortOrder:s}),headers:{"Content-Type":"application/json"}})},Kl=(0,l.once)((()=>Yl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),Ql=e=>Yl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Xl=(e,t)=>Yl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),zl=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Zl=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),zl),eu=(0,l.pipe)((0,l.reject)(E),Zl),tu=e=>Z.fromNull(Te[e]).map(de().text).orSome(""),ru=(0,l.curry)(((e,t)=>`${e}_${t}`)),nu=(0,l.split)("_"),iu=(0,l.includes)("_"),au=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),ou=(0,l.curry)(((e,t)=>e.some(au(t)))),su=ou([ye.IN_RANGE,ye.COUNT_RANGE,ye.WITHIN]),lu=ou([ye.EXISTS,ye.MISSING_VALUE]),uu=(0,l.cond)([[lu,(0,l.always)(0)],[su,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),cu=(0,l.complement)(lu),pu=ou([ye.HAS_ALL,ye.EQUALS,ye.NOT_EQUALS]),du=ou([ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE,ye.COUNT_RANGE]),yu=ou([ye.IN_FILE,ye.NOT_IN_FILE]),fu=e=>{switch(e){case ye.COUNT_EQUALS:return ye.EQUALS;case ye.COUNT_NOT_EQUALS:return ye.NOT_EQUALS;case ye.COUNT_LT:return ye.LT;case ye.COUNT_LTE:return ye.LTE;case ye.COUNT_GT:return ye.GT;case ye.COUNT_GTE:return ye.GTE;case ye.COUNT_RANGE:return ye.IN_RANGE}},Tu=ou([ye.ON,ye.BEFORE,ye.AFTER,ye.WITHIN,ye.NOT_EQUALS]),Eu=ou([ye.WITHIN]),mu=[[ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE],[ye.NOT_IN_FILE,ye.IN_FILE],[ye.EQUALS,ye.NOT_EQUALS,ye.HAS_ALL],[ye.LT,ye.LTE,ye.GT,ye.GTE],[ye.MISSING_VALUE,ye.EXISTS],[ye.COUNT_RANGE],[ye.IN_RANGE],[ye.STARTS_WITH,ye.CONTAINS],[ye.FULL_TEXT],[ye.ON,ye.BEFORE,ye.AFTER,ye.NOT_EQUALS],[ye.WITHIN]],hu=(e,t)=>mu.some((r=>r.includes(e)&&r.includes(t))),bu=(0,l.pipe)(l.omit,l.values),Ou={OPTIONS_FOR_STRING:bu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_DATE:[ye.ON,ye.BEFORE,ye.AFTER,ye.WITHIN,ye.NOT_EQUALS,ye.MISSING_VALUE,ye.EXISTS,ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE,ye.COUNT_RANGE,ye.IN_FILE,ye.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:bu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_BLOB:bu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_NUMBER:bu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_LOOKUP:bu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ye),OPTIONS_FOR_ENUM:bu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ye),OPTIONS_FOR_ID:[ye.EQUALS,ye.NOT_EQUALS,ye.IN_FILE,ye.NOT_IN_FILE],OPTIONS_FOR_COUNT:[ye.EQUALS,ye.NOT_EQUALS,ye.LT,ye.LTE,ye.GT,ye.GTE,ye.IN_RANGE],OPTIONS_FOR_COMPLEX:[ye.COUNT_EQUALS,ye.COUNT_NOT_EQUALS,ye.COUNT_LT,ye.COUNT_LTE,ye.COUNT_GT,ye.COUNT_GTE,ye.COUNT_RANGE,ye.EXISTS,ye.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[ye.EQUALS,ye.NOT_EQUALS,ye.EXISTS,ye.MISSING_VALUE]},vu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case ft.TYPE_TYPEAHEAD:case ft.TYPE_STRING:case ft.TYPE_PASSWORD:case ft.TYPE_TEXT:case ft.TYPE_CIK_ID:case ft.TYPE_URL:case ft.TYPE_BLOG_URL:case ft.TYPE_IMAGE_URL:case ft.TYPE_EMAIL:return Ou.OPTIONS_FOR_STRING;case ft.TYPE_LOOKUP:case ft.TYPE_DEPENDENT_LOOKUP:return Ou.OPTIONS_FOR_LOOKUP;case ft.TYPE_ENUM:return Ou.OPTIONS_FOR_ENUM;case ft.TYPE_DATE:case ft.TYPE_ACTIVENESS_DATE:case ft.TYPE_TIMESTAMP:case ft.TYPE_LOCAL_DATE:return Ou.OPTIONS_FOR_DATE;case ft.TYPE_BOOLEAN:case ft.TYPE_BOOLEAN_RADIO:return Ou.OPTIONS_FOR_BOOLEAN;case ft.TYPE_BLOB:return Ou.OPTIONS_FOR_BLOB;case ft.TYPE_LONG:case ft.TYPE_INT:case ft.TYPE_FLOAT:case ft.TYPE_DOUBLE:case ft.TYPE_NUMBER:return Ou.OPTIONS_FOR_NUMBER;case ft.TYPE_ENTITY_ID:return Ou.OPTIONS_FOR_ID;case ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ye.EQUALS];case ft.TYPE_COUNT:return Ou.OPTIONS_FOR_COUNT;case ft.TYPE_NESTED:case ft.TYPE_REFERENCE:case ft.TYPE_IMAGE:return Ou.OPTIONS_FOR_COMPLEX;default:return Ou.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(du,n):n},gu=e=>[Fe.and,Fe.andNot].includes(e),_u=e=>[Fe.or,Fe.orNot].includes(e),Au=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),_u)),Nu=(Pu=[Fe.and],e=>e.slice(0,-1).every((e=>Pu.includes(e.operator))));var Pu;const Ru=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Su=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),wu=e=>`(${e})`,Iu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.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},Uu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Fe.or,Fe.orNot],n=t?[Fe.and,Fe.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&Iu(e.slice(1,-1));return!i&&!a||o?e:wu(e)},Cu="and",Du=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,l.propOr)(Cu,n,e),o=(e=>[Fe.andNot,Fe.orNot].includes(e))(a)?Uu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Lu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),ju=e=>Array.isArray(e)?e.map(ju).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),ku=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Fu=e=>`'${e}'`,Mu=e=>`"${e}"`,xu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),$u=(0,l.pipe)(ju,ku),Gu=(0,l.pipe)($u,Fu),Vu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(su(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Bu=(e,t)=>du(t)?{type:ft.TYPE_INT}:yu(t)?{type:ft.TYPE_FILE}:Tu(t)&&!Eu(t)&&ni(e.type)?{type:ft.TYPE_LOCAL_DATE}:e,Wu=Object.values(Oe),Yu=e=>!Object.values(Oe).includes(e),qu=e=>Wu.includes(e),Hu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ve;return de().text(t[e])},Ju=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(he),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ve;return e.map((e=>({value:e,get label(){return Hu(e,t)}})))},Ku=e=>{const t=f()().startOf("minute");switch(e){case he.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case he.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case he.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case he.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case he.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case be.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},Qu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},Xu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ku;return(0,l.is)(String,e)?t(e):Qu(e)};let zu;!function(e){e.CurrentUser="currentUser"}(zu||(zu={}));const Zu={},ec=(e,t)=>{Zu[e]=t},tc=e=>Zu[e];function rc(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){nc(e,t,r[t])}))}return e}function nc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ic=e=>e.split("{CurrentUser}").join(tc(zu.CurrentUser)||""),ac=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),oc=(0,l.curry)(((e,t,r)=>{const n=r.map(su(e)||t.endsWith(".count")?$u:Gu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),sc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},lc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=uu(t);return(0,l.pipe)(sc(i),(0,l.map)(oc(t,r)),ac(" or "))(n)},uc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Gu).join(",")})`},cc=e=>`*${e}*`,pc=e=>`URL:${e}`,dc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,yc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ye.IN_FILE?r:`not ${r}`},fc=(e,t)=>[R(e,t),S(e,t)],Tc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Ec(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ye.ON:return rc({},e,n?{filter:ye.EQUALS}:{filter:ye.IN_RANGE,values:[fc(i,n)]});case ye.BEFORE:return rc({},e,{filter:ye.LTE,values:[[S(i,n)]]});case ye.AFTER:return rc({},e,{filter:ye.GTE,values:[[R(i,n)]]});case ye.WITHIN:return rc({},e,{filter:ye.IN_RANGE,values:[Ku(i)]})}}return e}),lc),Ec=(0,l.propSatisfies)(ni,"type"),mc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),ic)],[(0,l.propEq)("filter",ye.HAS_ALL),(0,l.pipe)((e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(lc({filter:ye.EQUALS,fieldName:t,values:[r]}))),new Du).build())),ac(" or "))(r)}),ic)],[(0,l.propEq)("filter",ye.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return lc({fieldName:r,filter:t,values:n.map((0,l.pipe)(ju,cc))})}),ic)],[(0,l.propEq)("filter",ye.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?lc(rc({},e,{values:(0,l.flatten)(r)})):dc(r)?uc(rc({},e,{filter:"listEquals"})):lc(e)}),ic)],[(0,l.propEq)("filter",ye.NOT_EQUALS),(0,l.pipe)((e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=uu(t);return(0,l.pipe)(sc(i),(0,l.map)(oc(t,r)),ac(" and "))(n)})(rc({},e,{values:(0,l.flatten)(e.values)})):Ec(e)?(e=>{const{values:t}=e,r=!Ec(e),[n]=t;return(new Du).addClause(lc(rc({},e,{filter:ye.LT,values:[R(n,r)]}))).addClause(lc(rc({},e,{filter:ye.GT,values:[S(n,r)]}))).orBuild()})(e):dc(t)?uc(rc({},e,{filter:"not listEquals"})):lc(e)}),ic)],[(0,l.propSatisfies)(yu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return lc({fieldName:r,filter:yc(t,r),values:n.map((0,l.prop)("link")).map(pc)})}],[(0,l.propSatisfies)(du,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return lc({fieldName:`${r}.count`,values:n,filter:fu(t)})}],[(0,l.propSatisfies)(Tu,"filter"),Tc],[(0,l.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,l.pipe)((0,l.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,l.join)(";"))(r);return oc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return oc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(lc,ic)]],hc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!cu(e)||Oc(e,r))},bc=(e,t)=>Array.isArray(t)?Oc(e,t):e===ye.WITHIN?qu(t)||Number.isInteger(t):!(0,l.isNil)(t)&&ju(t).length>0,Oc=(e,t)=>t&&t.length>0&&t.every((t=>bc(e,t)));function vc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gc=["relevanceScores"],_c=e=>{let{fieldName:t=""}=e;const r=t.split(".");if(gc.includes(r[0]))return r[0];const n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Ac=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Nc=(e,t,r)=>"children"===e?Rc(r,[...t][0],!0):r,Pc=(e,t,r)=>"values"===e?[...r,...t]:r,Rc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,l.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Nc,t),e);if(!r&&pu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Pc,t),e)}return(0,l.append)(t,e)},Sc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=_c(e),r=e=>e.fieldName===t?e:r({fieldName:Ac(e),children:[e]});return r(e)})(t);return Rc(e,r)}),[]),wc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),Ic=e=>{let[t]=e;return t.children?Ic(t.children):t.operator},Uc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=Ic(t)===Fe.andNot,a=n(t,!1),o=i?`not ${Uu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Ic(r)||Cu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&wc(i)&&!t?r(i):n(i,a)}],...e])(o))),new Du).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Cc=(0,l.pipe)((0,l.propOr)("","filter"),iu),Dc=(0,l.map)((0,l.when)(Cc,(e=>{const[t,r]=nu(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){vc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Lc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,l.pipe)((0,l.filter)(hc),Dc,Sc,Uc([...e,...mc],t))},jc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),kc=[ye.ON,ye.BEFORE,ye.AFTER,ye.WITHIN,ye.NOT_EQUALS,ye.MISSING_VALUE,ye.EXISTS],Fc=[ye.EQUALS,ye.NOT_EQUALS,ye.STARTS_WITH,ye.MISSING_VALUE,ye.HAS_ALL,ye.FULL_TEXT,ye.EXISTS],Mc=[ye.EQUALS,ye.NOT_EQUALS,ye.LT,ye.LTE,ye.GT,ye.GTE,ye.IN_RANGE],xc=(e,t)=>{const r=Ln(e);return(e=>{switch(e){case bt.startDate.name:case bt.endDate.name:case vt.dueDate.name:case At.createdTime.name:case At.updatedTime.name:case Pt.reltioLoadDate.name:case Pt.createDate.name:case Pt.updateDate.name:case Pt.deleteDate.name:case Pt.publishDate.name:return kc;case Nt.matches.name:case Pt.count.name:return Mc;case vt.workflow.name:case vt.assignee.name:case vt.step.name:case gt.commenter.name:case At.createdBy.name:case At.updatedBy.name:case Pt.sourceSystems.name:case Pt.value.name:return Fc;default:return null}})(t)||vu(r)},$c=[ye.EQUALS,ye.NOT_EQUALS,ye.CONTAINS,ye.STARTS_WITH,ye.MISSING_VALUE,ye.HAS_ALL,ye.IN_RANGE,ye.WITHIN,ye.EXISTS,ye.ON],Gc=(0,l.pipe)(xc,(0,l.filter)((0,l.includes)(l.__,$c))),Vc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(ys);return a&&a[0]&&(r=n.length>0&&a[0].value?Vc(a[0].value,[n.join(".")])[0].value:"label"in a[0]&&"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),Bc=(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=Vc(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},Wc=/[,\s]*$/,Yc=e=>{const t=de().text(Ae);if(!e)return t;const r=e.replace(Wc,"");return""===r.toString().trim()?t:r},qc=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Hc=(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=qc(e,r.referencedEntityTypeURI);if(n)return Bc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Bc({attributes:t||{}},r.dataLabelPattern);return""},Jc=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Kc=e=>{let{uiPath:t,value:r,uri:n}=e;return`${t}#p~com.reltio.plugins.pivoting.default.DefaultPivotingPerspective_ps~pivoting_a~${encodeURIComponent(n)}_v~${encodeURIComponent(r)}`},Qc=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Xc=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),zc=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Ml,(0,l.prop)("value"))),Zc=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),zc),ep=(e,t,r)=>{const n=Zc(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Is(e),zc)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,l.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(Ei(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ss(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,zc))(r)})(e,r)||gi(e,r.type);return Xc(t,n)};function tp(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){rp(e,t,r[t])}))}return e}function rp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const np="DTSS/",ip=(0,l.replace)(new RegExp("^entities/"),""),ap=e=>np+e.dataTenant+"/"+e.uri,op=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),sp=e=>!(!e||!e.dataTenant),lp=(0,l.startsWith)(np),up=(0,l.pipe)((0,l.ifElse)(lp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),cp=(0,l.ifElse)(sp,ap,(0,l.prop)("uri")),pp=e=>e&&e.uri?e.dataTenant?ap(e):ip(e.uri):"",dp=(0,l.curry)(((e,t,r)=>(Ei(t,r.type)||{})[e]||"")),yp=dp("label"),fp=dp("typeGraphIcon"),Tp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Ei(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(ys)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Hc(e,o,i),uri:a.uri}})).filter(l.identity):[]},Ep=(0,l.pipe)(Tp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),mp=(0,l.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,l.is)(Object,r.value)){const n=mp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):mp(e.slice(1),r)}})),hp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,bp=e=>(0,l.propOr)([],"matchRules",e),Op=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?tp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},vp=(e,t,r)=>t&&r?r.aEntity:e,gp=(0,l.evolve)({attributes:Sl(!0)}),_p=(0,l.pipe)(gp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Ap=e=>(0,l.assoc)("dataTenant",e);function Np(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){Pp(e,t,r[t])}))}return e}function Pp(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=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,l.propSatisfies)(n,"uri"),a=(0,l.pipe)((0,l.prop)("changes"),l.keys),o=(0,l.when)(i,(0,l.applySpec)({dcrObjectUris:a,dcrUri:(0,l.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},u=(0,l.pipe)(o,s,(()=>E())),c=(0,l.pipe)((0,l.prop)("dcrUri"),(0,l.unless)(l.isNil,(0,l.pipe)((0,l.split)("/"),(0,l.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+zl(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=l.identity;const m=()=>!e||f()||T?T||Promise.resolve():(T=new Promise((e=>{E=e})),Promise.resolve());return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f,getDcrUriAwait:m}},Sp=e=>{const t=(t,n)=>i=>{if(!(e=>!ue(e.value))(i)){var a,o;const s=`${n}/${null!==(a=i.refEntity)&&void 0!==a&&a.objectURI?sn(i.refEntity.objectURI):qr()}`;let u;const c=e.objectsInfo[null===(o=i.refEntity)||void 0===o?void 0:o.objectURI];return c&&(u=c.label,c.isExist||(i.refEntity.objectURI=`${e.uri}/changes/${i.refEntity.objectURI}`)),Np({},i,{label:u,uri:s,value:(0,l.fromPairs)((0,l.map)(r(t,s),(0,l.toPairs)(i.value)))})}return Np({},i,{uri:`${n}/${qr()}`})},r=(e,r)=>n=>{let[i,a]=n;return[i,(0,l.map)(t(`${e}/attributes/${i}`,`${r}/${i}`),a)]};return(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",ut.CREATE_ENTITY),(0,l.evolve)({newValue:e=>{const{uri:t,type:n}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(r(n,`${t}/attributes`)),l.fromPairs)},e)}}))))},e)},wp=()=>{const e={newUriMap:{}};return{getUri:t=>(0,l.pathOr)(t,["newUriMap",t],e),addUriFromCreateRequest:t=>r=>{var n;return null!=r&&null!==(n=r[0])&&void 0!==n&&n.successful&&((t,r)=>{e.newUriMap=(0,l.assoc)(t,r,e.newUriMap)})(t,r[0].object.uri),r},hasNewUri:()=>!(0,l.isEmpty)(e.newUriMap)}};function Ip(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){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Ke.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Dp=e=>{let{relationUri:t}=e;return{type:Ke.DELETE_RELATION,parameters:{relationUri:t}}},Lp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Ke.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},jp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Ke.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},kp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Ke.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Fp=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),Mp=e=>e.type===Ke.DELETE_RELATION,xp=e=>e.type===Ke.CREATE_RELATION,$p=e=>e.type===Ke.REPOINT_RELATION,Gp=e=>e.type===Ke.UPDATE_RELATION,Vp=async e=>{const t=[];for(const r of e){const e=await r();t.push(e);const n=Array.isArray(e)&&e.find((0,l.has)("errors"));if(n)throw n.errors}return t.flat()},Bp=e=>{let{type:t,parameters:r,dcrProcessor:n,relationUriProcessor:i}=e;const{enhanceUriWithDCR:a,updateDCRUriFromResponse:o}=n,s=e=>(o(e),e);switch(t){case Ke.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:o,attributes:l,startDate:u,endDate:c}=t;return Bf({startEntityUri:e,endEntityUri:n,relationType:o,attributes:l,startDate:u,endDate:c,uriPreprocessor:a}).then(s).then(i.addUriFromCreateRequest(t.uri))};case Ke.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Vf(e,a).then(s)};case Ke.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Hf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(s)};case Ke.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Wf({oldRelation:e,newRelation:t,uriPreprocessor:a}).then(s)};case Ke.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:a,isReversed:o}=r,{uri:s}=a,u=[Dp({relationUri:s}),Cp({parentUri:o?e:t,relation:a,entityUri:o?t:e})];return(0,l.pipe)((0,l.map)(Yp(n,i)),(0,l.map)(Bp),Vp)(u)}}},Wp=e=>t=>()=>e().then(t),Yp=(e,t)=>r=>Ip({dcrProcessor:e,relationUriProcessor:t},r),qp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Rp({alwaysCreateDCR:e,dcrUri:t}),n=wp();return{commandExecutor:e=>(0,l.pipe)(l.flatten,(0,l.map)(Yp(r,n)),(0,l.map)(Bp),(0,l.map)(Wp(r.getDcrUriAwait)),Vp)(e),dcrProcessor:r,relationUriProcessor:n}},Hp=e=>t=>(0,l.map)((t=>Ip({},t,{parameters:(0,l.evolve)({parentUri:eh(e),entityUri:eh(e),newEntityUri:eh(e)},t.parameters)})),t),Jp=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Kp=(e,t)=>{const r=e.filter(xp).find(Fp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Gp(o)&&Fp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!$p(o)||!Fp(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(Jp({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},Qp=(e,t)=>{const r=e.filter($p).filter(Fp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Gp(i)||!Fp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Jp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Xp=(e,t)=>{const r=e.filter(Mp).filter(Fp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Fp(t,e)))},zp=(e,t)=>{const r=e.filter(Gp).filter(Fp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Gp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Jp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},Zp=e=>{const t=e.filter(Mp).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Xp,e)},ed=e=>{const t=e.filter(xp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Kp,e)},td=e=>{const t=e.filter($p).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Qp,e)},rd=e=>{const t=e.filter(Gp).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(zp,e))(t)},nd=e=>(0,l.pipe)(Zp,ed,td,rd)(e);function id(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){ad(e,t,r[t])}))}return e}function ad(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const od=e=>id({},(0,l.path)(Sd(),e),{startDate:(0,l.path)(Cd(),e),endDate:(0,l.path)(Dd(),e)}),sd=(e,t)=>(0,l.pipe)((0,l.path)(Ud()),eh(t))(e),ld=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=sd(e,r),i=(0,l.path)(wd(),e)===Qe.IN,a=e.parentEntityUri||n;return Cp({parentUri:i?t:a,relation:od(e),entityUri:i?a:t})})),...o.map((t=>{const i=sd(t,r),a=(0,l.path)(wd(),t)===Qe.IN,o=i!==(0,l.pipe)((0,l.path)(Sd()),a?Ld:jd)(t),s=Md(e,(0,l.path)(Pd(),t)),u=t.parentEntityUri||n,c=eh(r,i);return o?kp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Sd(),t),isReversed:!1}):jp({oldRelation:(0,l.path)(Sd(),s),newRelation:od(t)})})),...i.map((e=>Dp({relationUri:e}))),...s.map((e=>Lp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},ud=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return id({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),cd=(0,l.has)("dataTenant"),pd=(0,l.ifElse)(cd,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),dd=(e,t)=>(0,l.pipe)(Ni,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Ys),Ba)(e,t);function yd(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){fd(e,t,r[t])}))}return e}function fd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Td=e=>(0,l.prop)("uri",e),Ed=e=>Td(e)?e.uri:e,md=e=>t=>Ed(t)===e,hd=(0,l.curry)(((e,t)=>{const r=(n,i)=>{var a;let o=Ed(i),s=!1;o.startsWith("!")&&(o=o.slice(1),s=!0);const u=e[o]&&ji(Di.READ,e[o]),c=n.find(md(o))||!u?n:n.concat(Td(i)?yd({},i,{uri:o}):null!==(a=t.find(md(o)))&&void 0!==a?a:o);return s?c:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==o||t.find(md(n))?t:r(t,n)),c)};return t.reduce(r,[])})),bd=(0,l.curry)(((e,t)=>{const r=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r.reduce(((r,n)=>{const i=Ed(n),a=(0,l.path)([i,t,"objectTypeUri"],e);return!a||r.find(md(a))?r:r.concat(a)}),[])};return yd({},t,{entityTypes:[...r("startObject",t.inRelations),...r("endObject",t.outRelations)]})})),Od=(0,l.indexBy)((0,l.prop)("uri")),vd=(0,l.curry)(((e,t)=>{const r=Od(e.relationTypes),n=Od(e.entityTypes),i=e=>(0,l.evolve)({inRelations:hd(r),outRelations:hd(r),entityTypes:hd(n),nextEntry:i},e);return(0,l.pipe)((0,l.unless)((0,l.either)((0,l.prop)("nextEntry"),(0,l.prop)("entityTypes")),bd(r)),i)(t)})),gd=(e,t)=>(0,l.evolve)({content:vd(e)},t),_d=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,l.pipe)((0,l.assoc)("relationType",t),(0,l.assoc)("relationLabel",r),(0,l.assoc)("object",{type:t,attributes:{},uri:i}),(0,l.assoc)("direction",n))(e)}},Ad=(e,t,r)=>{const n=Bc(t,e.dataLabelPattern),i=(0,l.lensProp)("entity");return(0,l.over)(i,(0,l.evolve)({entityLabel:(0,l.always)(n),object:{label:(0,l.always)(n)}}),r)},Nd="relation",Pd=(0,l.always)([Nd,"relationUri"]),Rd=(0,l.always)([Nd,"relationType"]),Sd=(0,l.always)([Nd,"object"]),wd=(0,l.always)([Nd,"direction"]),Id=(0,l.always)([Nd,"object","attributes"]),Ud=(0,l.always)(["entity","entityUri"]),Cd=(0,l.always)([Nd,"startDate"]),Dd=(0,l.always)([Nd,"endDate"]),Ld=(0,l.path)(["startObject","objectURI"]),jd=(0,l.path)(["endObject","objectURI"]),kd=(0,l.path)(["startObject","objectTypeURI"]),Fd=(0,l.path)(["endObject","objectTypeURI"]),Md=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Pd()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Md(r.connections,t);if(e)return e}}},xd=(0,l.pipe)(Md,(0,l.path)(Sd())),$d=(0,l.allPass)([(0,l.pipe)((0,l.path)(Ud()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(Rd()),(0,l.complement)(E))]),Gd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:zr()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Wd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Vd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?_d(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Vd=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:Pe.IN}:{type:t[0],direction:Pe.OUT}:null},Bd=e=>e.uri||e,Wd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Mi(i,t)&&$i(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Pe.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Ei(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ei(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Bd,Ni(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Pe.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Pe.OUT)),(0,l.map)(u))},t)||{}},Yd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ii({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Ri(e,n.uri);return n&&(!t||hi(e,i,t))&&(!r||hi(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Ei(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ei(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(ls,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},qd=(0,l.curry)(((e,t,r,n,i)=>{const a=hi(n,l.__,t.type),o=e?Fd:kd,s=hi(n,l.__,r.type),u=e?kd:Fd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Hd=(e,t,r)=>{const n=e?Fd:kd,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(hi(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kd=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}},Qd=e=>!e.deactivated,Xd=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},zd=e=>Xd(e)+e.message,Zd=(0,l.unless)(l.isNil,(0,l.prop)("message")),ey=(0,l.unless)(l.isNil,(0,l.prop)("type")),ty=(0,l.curry)(((e,t)=>an(t.parentUri,e))),ry=(0,l.curry)(((e,t)=>t.parentUri===e)),ny=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),an(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",ft.TYPE_REFERENCE),(0,l.pipe)(_n,(0,l.any)(an(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),iy=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),ay=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),oy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([fy,Qd,ty(e),ny(t),(0,l.complement)(ay(e,t.uri))]))(r)},sy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([fy,Qd,ry(e),iy(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",Re.missed))]))(r);return n&&n.message||""},ly=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===Re.missed))},uy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Qd,(0,l.propEq)("type",Re.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Pd(),e))]))(t)},cy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Qd,(0,l.propEq)("type",Re.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},py=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([Qd,ty(t)]))(r)},dy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Qd,(0,l.propEq)("type",Re.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},yy=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?ph(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 Ce.attributeValue:{const e=a;if(Gn(a))return Bc(o,e.dataLabelPattern);if(Vn(a)){const t=o,i=_s(t),a=vn(e),s=Ei(n,a);return Qr(i)?Bc(r[i],s.dataLabelPattern):t.label}return""}case Ce.tempEntity:return Bc(o,a.dataLabelPattern);case Ce.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Ei(n,null==e?void 0:e.entityType);return`${Yc(i&&Qr(i)?Bc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Pi(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){Jd(e,t,r[t])}))}return e}({},e,{label:Yc(t)})}))},fy=e=>!e.severity||e.severity===we.ERROR,Ty=(e,t,r)=>(0,l.allPass)([(0,l.pipe)((0,l.prop)("uri"),E),(0,l.propEq)("parentUri",t),(0,l.propEq)("attributeTypeUri",r)])(e),Ey=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case ft.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(Ey(n))}));case ft.TYPE_REFERENCE:return!!Es(t);case ft.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),my=(e,t)=>e.every((0,l.complement)(Ey(t))),hy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=jo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Ss(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!ys(e.parent))))).forEach((e=>{my(e.attrValues,n)&&r.push(Kd({type:Re.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:de().text("Attribute is required"),source:Se.local}))})),r}),[])},by=(0,l.curry)(((e,t,r)=>Ss(e,t,r,!1))),Oy=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Ei(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(xn),(0,l.filter)(Vn),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(by(e,t)));return(0,l.pipe)(r,(0,l.reject)(_s),(0,l.map)((e=>{let{uri:r}=e;return Kd({type:Re.missedRefEntity,uri:"",attributeTypeUri:pn(r,t.type),parentUri:r,message:de().text("Entity is required"),source:Se.local})})))(t)},vy=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(_s,Qr)).flatMap((n=>{const i=_s(n),a=t[i],o=Xn(e,pn(n.uri,r.type));return gy(e,t,o,a)})),gy=(e,t,r,n)=>{const i=_n(r),a=i.map((t=>Xn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",ft.TYPE_REFERENCE))).flatMap(Nn).concat(i);return _y(e,t,n,(e=>a.some(an(e.uri))))},_y=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=hy(e,r,n),a=Oy(e,r),o=vy(e,t,r);return[...i,...a,...o]},Ay=(e,t)=>({attributes:{[e.name]:[t]},type:dn(e.uri),uri:dn(t.uri)}),Ny=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Ay(t,r),a=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(r[0]||e).uri;return t.uri===n};return _y(e,n,i,a)},Py=(e,t)=>{const r=(0,l.path)(Sd(),t)||{};return hy(e,r)},Ry=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Ud()),(0,l.ifElse)(Qr,(e=>t[e]),(0,l.always)(null)))(r),i=Py(e,r),a=(e=>(0,l.path)(Ud(),e)?[]:[Kd({type:Re.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(Rd(),e),parentUri:(0,l.path)(Pd(),e),message:de().text("Entity is required"),source:Se.local})])(r),o=((e,t,r)=>r?_y(e,t,r):[])(e,t,n);return[...i,...a,...o]},Sy=e=>(0,l.path)(["entity","uri"],e)?[]:[Kd({type:Re.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:de().text("Entity is required"),source:Se.local})],wy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=hy(e,r),i=Sy(t);return[...n,...i]};function Iy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uy=(e,t)=>{var r,n;const i=Ei(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||oo(e)},Cy=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Dy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(Cy(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},Ly=(e,t)=>(0,l.when)((0,l.prop)("refEntity"),(0,l.pipe)((0,l.when)((0,l.allPass)([(0,l.prop)("refRelation"),(0,l.always)("INSERT_ATTRIBUTE"===t),(0,l.pipe)(As,Qr,l.not)]),(e=>{const t=(0,l.pipe)(As,sn)(e);return Dy((e=>e.replace(t,t+Vr)))(e)})),(0,l.when)((0,l.pipe)(_s,Qr),(t=>{const r=_s(t),n=e[r],i=n&&ky(n,e);return null!=i&&i.attributes?(0,l.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){Iy(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),jy=(e,t,r,n)=>Vh(xh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Yh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,n).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(Ly(r,e.type)),(0,l.map)(Dy(mn))))})(e))).concat(Xm(e,t)),ky=(e,t)=>(0,l.evolve)({attributes:Pl({valueTransformer:(0,l.pipe)(Rs,Ly(t),Cy(mn)),deleteEmptyComplex:!0}),uri:mn})(e);function Fy(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){My(e,t,r[t])}))}return e}function My(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Gr,"g"),"uri$$$$").replace(new RegExp(Vr,"g"),""))),$y=e=>(0,l.pipe)((0,l.evolve)({objectUri:xy,objectParentUri:xy}),(e=>{return Fy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?Re.missed:Re.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&En(e.objectUri),uri:e.objectUri,source:Se.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Gy=(e,t)=>(0,l.map)((0,l.pipe)($y,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=yy(t,s),p=null!=c&&c.length?c.slice(0,-1):yy(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Xn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Ce.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Fy({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,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&&Tn(i)){const n=(0,l.last)(a),i=n.valueType;if(Vn(i)&&Pn(i).includes(o)){const i=_s(n.value),o=i&&Qr(i)?t[i]:null;return o?Fy({},e,{parentUri:o.uri,path:a.concat({type:Ce.tempEntity,value:o,valueType:Ei(r,o.type),label:""})}):e}}return e}})(t)))(e),Vy=e=>{if(e.type===Ue.AGO||e.type===Ue.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Ue.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},By=e=>`equals(user, '${ku(e)}')`,Wy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Yy=e=>`equals(items.objectType, '${e.uri}')`,qy=e=>{const{period:t,type:r}=e;if(!Vy(e))return"";switch(r){case Ue.WITHIN:return`gte(timestamp, ${X(t)})`;case Ue.AGO:return`lte(timestamp, ${X(t)})`;case Ue.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},Hy=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Jy=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Ky=e=>{let{query:t,body:r}=e;return t=Jy(t),Yl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Qy=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,l.pipe)(Lc(),jc(t.globalFilter))(n),activeness:t.activityFilter||_e.ACTIVE_ONLY,options:t.searchOptions};return(0,l.reject)(E,i)},Xy=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;return Yl("/entities/_total",{method:"POST",body:JSON.stringify(Qy(e,t,r))})},zy=e=>Yl("/entities/_total",{method:"POST",body:JSON.stringify(Object.fromEntries(new URLSearchParams(e).entries()))}),Zy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(us),(0,l.map)((0,l.prop)("uri")))(e),i={filter:ye.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(Lc(),jc(r.globalFilter))([i,a]),s=(0,l.reject)(E,{filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||_e.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return Yl("/entities/_typeAheadSearch",{method:"POST",body:JSON.stringify(s)})},ef=(0,l.pipe)((0,l.reject)(l.isNil),Zl),tf=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(Lc(),jc(i))(r),p=ef({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Ky({query:p,body:d})},rf=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return tf({fieldName:t,searchParams:i,options:n})};function nf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const af="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",of=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=(0,l.reject)(E,{filter:(0,l.pipe)(Lc(),jc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||af,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null,options:t.searchOptions});return i},sf=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=of(e,t,r);return Yl("/entities/_search",{method:"POST",body:JSON.stringify(n)})},lf=e=>ff(e,{select:"secondaryLabel"}),uf=(e,t)=>{const{select:r=af,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Yl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},cf=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Qr)),pf=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:u,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=cf(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Yn(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(Lc(),jc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),Yl(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},df=e=>`entities?filter=equals(uri,'${e}')&offset=0`,yf={options:"sendHidden,addRefAttrUriToCrosswalk"},ff=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yf;return Yl(`/${e}${eu(t)}`)},Tf=(e,t)=>ff(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){nf(e,t,r[t])}))}return e}({},yf,{explicitSurvivorshipGroup:t})),Ef=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",body:JSON.stringify([e])},n=t("/entities");return Yl(n,r)},mf=e=>Yl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),hf=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return Yl(`/${e}/_clone${eu({executeLCA:!1,valuesToCopy:r})}`,n)},bf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Yl(`/entities/_events/_total${Zl({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Of=(e,t)=>Yl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),vf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Yl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},gf=e=>ff(e,{select:"updatedTime"}),_f=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 Yl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Zl)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Af=e=>{const t=new FormData;return t.append("file",e),Yl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=gr(e,de().text("Can't upload file"));return Promise.reject(t)}))},Nf=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 Yl(`/personal/findSavedSearches${Zl({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"}})},Pf=e=>Yl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Rf=e=>Yl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Sf=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Yl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},wf=e=>{let{uri:t}=e;return Yl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},If=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Sf)(e),Uf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Sf)(e);function Cf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Df=["max","offset","filter"],Lf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Lf(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){Cf(e,t,r[t])}))}return e}({},t,(0,l.pick)(Df,e)))),jf=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],ke.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],ke.ALL,e)))return!1},kf=(0,l.omit)(["activeness"]),Ff=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=jf(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Lf(e),(0,l.omit)(Df))(e))),kf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${eu(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Mf=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),xf=(0,l.reject)(l.isNil),$f=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Gf=e=>Yl($f(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Vf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,$f);return Yl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Bf=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=l.identity}=e;const u={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?Sl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(xf,ne,JSON.stringify);return Yl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Wf=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=l.identity}=e;const i=(0,l.prop)("attributes"),a=(0,l.pipe)((0,l.prop)("uri"),(0,l.concat)(l.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),$f,n),o=xh(i(t),i(r),!1).concat(Gh(t,r));return Yl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Yf=(e,t,r)=>{const{url:n,options:i}=Ff(e,t,r);return Yl(n,i).then(Mf)},qf=(e,t)=>Yl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Hf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Pe.IN?a.inRelations=[n]:a.outRelations=[n],Yl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Jf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Yl(`${t}/recentSearches${eu({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Kf=e=>Yl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Qf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Yl(`/recentSearches${eu({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Xf(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){zf(e,t,r[t])}))}return e}function zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zf={select:"label,secondaryLabel,name,type,startDate,endDate"},eT=(0,l.reject)(l.isNil),tT=(0,l.pipe)(eT,Zl),rT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=Xf({},Zf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Yl(`/${t}/_tree${tT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},nT=e=>{let{uri:t,graphUri:r}=e;const n=Xf({},Zf,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Yl(`/${t}/_parents${tT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},iT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s,signal:l}=e;const u=Xf({},Zf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Yl(`/${t}/_hops${tT(u)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:l})};function aT(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 oT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},sT="/activities",lT=e=>{let{label:t,description:r}=e;return Yl(sT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:oT()}})};var uT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(uT||(uT={}));const cT=e=>{const t=eu(e);return Yl(sT+t,{method:"GET"})},pT=e=>Yl(`/activities/_total${eu(e)}`,{method:"GET"}),dT=e=>{const{entityUri:t}=e,r=aT(e,["entityUri"]);return Yl(`/${t}/_activities${eu(r)}`,{method:"GET"})},yT=e=>{const{entityUri:t}=e,r=aT(e,["entityUri"]);return Yl(`/${t}/_activities/_total${eu(r)}`,{method:"GET"})};function fT(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){TT(e,t,r[t])}))}return e}function TT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ET=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},mT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Yl(ET({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},hT=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=ET({url:r,workflowPath:t,tenant:n})),Yl(s,{method:i||"GET",body:JSON.stringify(a),headers:fT({"Content-Type":"application/json"},null!=o?o:{})})},bT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=ET({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Yl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},OT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=ET({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?fT({},l,{comment:o}):l;return Yl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},vT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=ET({url:`/tasks${s?eu(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(fT({objectURIs:[i]},(0,l.reject)(E,a)))};return Yl(u,fT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},gT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Yl(ET({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},_T=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Yl(ET({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(fT({max:a,offset:o},i))})},AT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Yl(ET({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},NT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Yl(ET({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},RT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Yl(ET({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return NT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a,processInstanceComment:o}=e;return Yl(ET({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a,processInstanceComment:o})})},CT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Yl(ET({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},DT=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return Yl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Zl)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},LT=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 Yl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Zl)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},jT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Yl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},kT=(e,t,r)=>Promise.all(t.map((async t=>await Yl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),FT=async(e,t)=>await kT(e,t,"NOT"),MT=async(e,t)=>await kT(e,t,"MATCH"),xT=async(e,t)=>await Promise.all(t.map((async t=>await Yl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function $T(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){GT(e,t,r[t])}))}return e}function GT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VT(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 BT=3e4,WT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Yl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},YT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return cE({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},qT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return cE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},HT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Yl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},JT=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 HT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},KT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(sp,i);return Promise.all([s.length?jT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return HT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},QT=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return r.map((0,l.assoc)("matchRule",t))})),(0,l.reduce)(((e,t)=>{let{matchRule:r}=t,n=VT(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,l.adjust)(i,(0,l.evolve)({matchRules:(0,l.append)(r)}),e)}),[])),XT=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),QT),zT=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return Yl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(XT)},ZT=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,l.map)((0,l.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(l.flatten)},eE=ZT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Yl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json",SearchMetadata:"AUTO"},body:JSON.stringify([{uri:a,type:o}])}).then(XT)})),tE=ZT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Yl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),rE=(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(l.flatten)}return t(...arguments)}},nE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Yl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},iE=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 nE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},aE=iE("NOT"),oE=iE("MATCH"),sE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(sp,a);return Promise.all([kT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return nE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},lE=sE("NOT"),uE=sE("MATCH");function cE(e){let{requestProvider:t=Yl,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}`,$T({},VT(s,["headers"]),{headers:$T({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const pE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;const s=function(e){const t=of(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:"");return`/entities${eu(t)}`}(t,r,n);return cE({url:s,dataTenant:i,customerTenant:a,dtssPath:o})},dE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return cE({url:"/entities/_total",dataTenant:i,customerTenant:a,dtssPath:o,options:{method:"POST",body:JSON.stringify(Qy(t,r,n))}})},yE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Ff(t,r);return cE({url:`entities/_connections/_getConnections${eu({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Mf,(0,l.map)((0,l.evolve)({connections:(0,l.map)((0,l.pipe)((0,l.assocPath)(["entity","dataTenant"],n),(0,l.assocPath)(["relation","dataTenant"],n)))}))))},fE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return cE({url:`${df(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},TE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Yl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},EE=e=>{let{dtssPath:t,tenant:r}=e;return Yl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:BT})},mE=e=>{let{dtssPath:t,customerTenant:r}=e;return Yl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:BT})},hE=e=>{let{dtssPath:t,tenants:r}=e;return Yl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:BT})},bE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return cE({url:df(t),dataTenant:r,customerTenant:n,dtssPath:i})},OE=()=>Yl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function vE(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){gE(e,t,r[t])}))}return e}function gE(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=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=vE({},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 Yl(`${t}/api/${r}/graph/search${eu({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},AE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Yl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:vE({},n,i),headers:{"Content-Type":"application/json"}})},NE=(e,t)=>`${e}/${t}/comments`,PE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Yl(`${NE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},RE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Yl(`${NE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},SE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Yl(NE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},wE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Yl(`${NE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},IE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Yl(`${NE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},UE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return Yl(`${NE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},CE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return Yl(`${NE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},DE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Yl(`${NE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},LE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=eu({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Yl(`${NE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function jE(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){kE(e,t,r[t])}))}return e}function kE(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{tenant:t,servicesPath:r}=e;return Yl(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ME="graphExport",xE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await BE({servicesPath:e,tenant:t,environment:r,namespace:ME,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(jE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await BE({servicesPath:e,tenant:t,environment:r,namespace:ME,options:jE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await BE({servicesPath:e,tenant:t,environment:r,namespace:ME,options:jE({method:"POST"},o)})),s},$E=e=>{let{servicesPath:t,key:r}=e;return Yl(`${t}/settings${eu({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},GE=e=>{let{servicesPath:t}=e;return Yl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},VE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Yl(`${n}/plugins${eu({tenant:t,user:r})}`,{method:"GET"})},BE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Yl(`${n}/configService${eu({tenant:t,environment:r,namespace:a,projection:o})}`,i)},WE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return BE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},YE=e=>{let{servicesPath:t,stateHash:r}=e;return Yl(`${t}/searchLink?key=${r}`,{method:"GET"})},qE=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),Yl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},HE=e=>Yl(`/${e}?showObjectsInfo=true`,{method:"GET"}),JE=e=>{let{exportPath:t,tenant:r,options:n}=e;return Yl(`${t}/${r}/activities${eu(n)}`,{method:"POST"})};function KE(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}const XE=e=>{const{entityUri:t}=e;return Yl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},zE=e=>{let{entityUri:t,crosswalk:r}=e;return Yl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},ZE=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Yl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[KE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),KE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},em=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Yl(`/${r}/_${n}${eu({contributorURI:t})}`,{method:"POST"})},tm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Yl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},rm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Yl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},nm=e=>{let{entityUri:t,crosswalkId:r}=e;return Yl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function im(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){am(e,t,r[t])}))}return e}function am(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const om=e=>{let{entityTypeUri:t}=e;return Yl(`/dataQuality/fillRates${Zl({entityType:sn(t)})}`,{method:"GET"})},sm=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},lm=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i,searchByOv:a}=e;const o=im({},n===Je.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),s=Zl(im({},n===Je.ATTRIBUTE_TYPE?{numberOfThreads:sm({attributes:r,metrics:i})||1}:{},a?{options:"searchByOv"}:{}));return Yl(`/entityType/${sn(t)}/dataQuality/${n}${s}`,{method:"POST",body:JSON.stringify(o)})},um=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Yl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${sn(n)}`,{method:"GET",headers:{env:i}})},cm=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Je.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u,anomaly:c}=e;const p={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u,anomaly:c};return Yl(`${t}/${r}/entityType/${sn(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(p)})},pm=e=>{let{tenant:t,apiPath:r}=e;return Yl(`${r}/permissions/${t}`,{method:"GET"})},dm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Yl(`/${t}${eu({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},ym=e=>{let{attributeUri:t,value:r}=e;return Yl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},fm=e=>{let{attributeUri:t,value:r}=e;return Yl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Tm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Yl(`/${t}${eu({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Em=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=eu({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Sl()([[{value:a}]]);return Yl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},mm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Yl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},hm=e=>{let{entityUri:t,attributeName:r}=e;return Yl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function bm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Om=e=>{let{entityUri:t}=e;return Yl(`/${t}/_historicURIs`,{method:"GET"})},vm=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 Yl(`/${t}/_changesWithTotal${eu(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){bm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},gm=(e,t)=>Yl(`/${e}/_previousChange${eu({timestamp:t})}`,{method:"GET"}),_m=(e,t)=>Yl(`/${e}${eu({time:t})}`,{method:"GET"});function Am(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){Nm(e,t,r[t])}))}return e}function Nm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ue(n)?JSON.stringify(n):n),Yl(t,{method:o,body:s,headers:Am({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Rm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=eu({options:a.join(","),severity:o.join(",")});return Yl(`${t}/validate/${i}/entity/${pp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Sm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Yl(`${t}/validate/${n}/entity${eu({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},wm=e=>{let{tenant:t,apiPath:r}=e;return Yl(`${r}/tenants/${t}/name`,{method:"GET"})},Im=e=>{let{tenant:t,apiPath:r}=e;return Yl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Um=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Yl(`${a}/preferences${eu({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Cm=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 Yl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Dm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Yl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Lm=e=>{const{servicesPath:t}=e;return Yl(`${t}/getTokenForWorker`,{method:"GET"})};var jm=r(29524);const km=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Xr(),s={attributes:Tl({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=Ss(r,e,n.uri)[0];return i&&i.value?vl({entity:e,attributeType:n,uri:i.uri,value:t}):bl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Fm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(_s),(0,l.filter)(Qr),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Mm=(0,l.curry)(((e,t)=>{const r=Fm(e=e||{},t=t||{});return r.concat((0,l.chain)(Mm(e),r))})),xm=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),$m=xm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Gm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Qr)),Vm=e=>(0,l.pipe)($m,Gm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Bm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)($m,(0,l.find)((t=>(0,l.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,l.set)((0,l.lensPath)(n),t,r):r})),Wm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Qr),(0,l.omit)(["uri","timestamp"])),Ym=(0,l.pipe)(Wm,gp),qm=async(e,t,r)=>{if(!e)return null;const n=Vm(e);if(n.length>0)for(const r of n)e=Bm(r,t[r],e);const i=await Ef(Ym(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},Hm=async(e,t,r)=>{const n=Km(e,t),i={};for(const t of n)i[t]=await qm(e[t],i,r);return i},Jm=(0,l.curry)(((e,t)=>{const r=jm.Node(t);return Vm(e[t]).forEach((t=>{const n=Jm(e,t);r.addEdge(n)})),r})),Km=(e,t)=>(0,l.pipe)((0,l.map)(Jm(e)),(0,l.map)(jm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Qm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Wm))})),Xm=(e,t)=>[...qh(e.tags||[],t.tags||[]),...Hh(e.roles||[],t.roles||[]),...$h(e,t),...Gh(e,t)],zm=(e,t,r)=>[...Vh(xh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Yh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,r),...Xm(e,t)],Zm=(0,l.pipe)(((e,t)=>{const r=(0,l.toPairs)(e);return(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return Bm(r,n,e)}),e))))}),t)}),Qm),eh=(0,l.curry)(((e,t)=>(0,l.when)(Qr,(0,l.propOr)(l.__,t,e),t)));function th(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){rh(e,t,r[t])}))}return e}function rh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return th({},t,{[r]:{parents:n,children:i}})},ih=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return th({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},ah=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=Fm(t,i),o=nh({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>ah(n.uri,t,[e],r)),o)},oh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,l.path)(Pd(),n),a=t?ih({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Ud(),n),s=Qr(o)?[o]:[],u=nh({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>ah(t,r,[i],e)),u)}),n)},sh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return oh(r,e,t,ah(e,t))},lh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return sh(t,r,n);if(en(e)){const t=Md(n,e);return t&&oh([t],null,r)}return r[e]?ah(e,r):void 0},uh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>uh(e,t))))},ch=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>ch(e,t))))},ph=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Zr(t),u=sh(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 u=t[e],c=t[e+1]||r;if(en(c)){if(s=Md(i,c),!s)return null;o.push({type:Ce.relationConnection,value:s,valueType:Ni(a,(0,l.path)(Rd(),s))});continue}if(en(u)){const e=n[c];if(!e)return null;o.push({type:Ce.tempEntity,value:e,valueType:Ei(a,e.type)});continue}const p=n[u],d=Bs(p,c),y=n[c];if(!d||!y)return null;o.push({type:Ce.attributeValue,value:d,valueType:Xn(a,pn(d.uri,p.type))}),o.push({type:Ce.tempEntity,value:y,valueType:Ei(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},ch(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=en(s),d=p?xd(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?Ni(a,d.type):Ei(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:zn(a,E);if(E=null==t?void 0:t.find((0,l.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:Ce.tempEntity,value:T,valueType:Ei(a,T.type)}),o.push({type:Ce.attributeValue,value:s,valueType:E}),m=s.value;const l=_s(s);T=l&&Qr(l)?n[l]:null}}return o},dh=e=>e.every((e=>{let{type:t}=e;return[Ce.attributeValue,Ce.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Ce.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let yh;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(yh||(yh={}));const fh={[yh.insertAttribute]:{color:"#599E0E"},[yh.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[yh.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Th=e=>{switch(e){case"UPDATE_ATTRIBUTE":return yh.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return yh.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return yh.deleteAttribute;default:return""}},Eh="/",mh=(0,l.pipe)((0,l.split)(Eh),(0,l.propSatisfies)((0,l.lte)(2),"length")),hh=(0,l.pipe)((0,l.split)(Eh),(0,l.slice)(0,-2),(0,l.join)(Eh)),bh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>mh(e),bh(hh(e))]])(t))),Oh=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+Eh))),vh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=bh(e,t);return(0,l.isNil)(r)?Oh(e)(t)?"UPDATE_ATTRIBUTE":"":r},gh=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]},_h=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(_h(e))}))}))),t},Ah=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Sh,t),(0,l.propOr)([],"crosswalks",e))),e),Nh=(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(Nh(e))}))})),r},Ph=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=Ph(e);r>t&&(t=r)}))})),t+1):t},Rh=(e,t)=>{if(Qr(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Sh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},wh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Ih=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Uh=(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,l.pipe)((0,l.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,l.reject)(l.isNil),l.uniq,(0,l.ifElse)((e=>{let{length:t}=e;return 1===t}),l.head,(()=>{})))(e)},Ch=(0,l.eqBy)(Sh),Dh=(0,l.pipe)((0,l.propOr)({},"attributes"),l.values,l.flatten,(0,l.filter)((0,l.has)("refRelation")),(0,l.chain)((e=>(0,l.pipe)(ms,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function Lh(e){return e&&void 0!==e.uri}let jh;function kh(e){return function(t,r){const n=[];return a=r,!(i=t)&&!a||!(!i||!a)&&i.length===a.length&&i.every((function(e,t){return e===a[t]}))||n.push({type:e,newValue:r}),n;var i,a}}function Fh(e){return void 0!==e.refEntity}function Mh(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 xh(e,t,r){const n=[];for(const a in e)if(e.hasOwnProperty(a)){if("paging"===a)continue;const p=e[a];if(void 0===t[a])for(const e in p)p.hasOwnProperty(e)&&n.push(...o(p[e]));else for(const e in p)if(p.hasOwnProperty(e)){const f=p[e],T=y(f,t[a]);void 0===T?n.push(...o(f)):f.value===T.value||f.lookupCode&&f.lookupCode===T.lookupCode?f.ignored!==T.ignored&&n.push(...s(T)):null==T.value||""===T.value?n.push(...o(f)):"Nested"===d(f)?f.ignored!==T.ignored&&(0,l.equals)(f.value,T.value)?n.push(...s(T)):n.push(...xh(f.value,T.value,r)):"Reference"===d(f)?Mh(f,T)?n.push(...xh(f.value,T.value,r)):(n.push(...o(f)),n.push(c([T]))):""!==T.value&&(!1===T.ov?n.push(...u(T)):n.push(...(i=T,[{type:jh.UPDATE_ATTRIBUTE,uri:i.uri,newValue:{value:i.lookupCode||i.value}}])))}}var i;for(const r in t)if(t.hasOwnProperty(r)){if("paging"===r)continue;let i=(t[r]||[]).filter((function(t){return void 0===y(t,e[r])}));i=a((0,l.clone)(i)),i.length&&n.push(c(i))}return n;function a(e){return e?e.map((function(e){let t;if(e){const r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){const n=a(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 o(e){return[{type:jh.DELETE_ATTRIBUTE,uri:e.uri}]}function s(e){return e&&(e.ignored?function(e){return[{type:jh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:jh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!1}}]}(e))}function u(e){const t=e.uri.lastIndexOf("/"),r=e.uri.substr(0,t);return[{type:jh._UPDATE_NON_OV_ATTRIBUTE,uri:e.uri,typeUri:r,value:e.lookupCode||e.value}]}function c(e){let t=e[0].uri;const n=t.lastIndexOf("/");return t=t.substr(0,n),{type:jh.INSERT_ATTRIBUTE,uri:t,newValue:e.map((function(e){let t;const n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),p(n.value),Fh(e)&&(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}))}}function p(e){if(null!==e&&"[object Object]"===e.toString())for(const t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,p(e.value)}))}function d(e){const t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function y(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function $h(e,t){const r=[];var n,i;return e.defaultProfilePic!==t.defaultProfilePic?r.push({type:jh.UPDATE_PROFILE_PIC_BY_URI,newValue:{value:t.defaultProfilePic}}):(n=e.defaultProfilePicValue)===(i=t.defaultProfilePicValue)||Lh(n)&&Lh(i)&&n.uri===i.uri||r.push({type:jh.UPDATE_PROFILE_PIC_BY_URL,newValue:{value:t.defaultProfilePicValue}}),r}function Gh(e,t){const r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:jh.UPDATE_START_DATE,newValue:{value:n}});const i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:jh.UPDATE_END_DATE,newValue:{value:i}}),r;function a(e,t){let r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Vh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i="configuration/sources/Reltio",a="configuration/sources/ReltioCleanser";function o(e,t){return e.crosswalk={type:t.type,value:t.value},e}function s(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function l(e){return e.removeIt=!0}const u=e.map((function(e){if(e.crosswalk)return[e];const s=Bh(t,e.uri),l=s.filter((function(e){return e.type===i})),u=s.filter((function(e){return e.type!==i}));let c=[];switch(e.type){case jh.INSERT_ATTRIBUTE:c.push(e);break;case jh._UPDATE_NON_OV_ATTRIBUTE:c=c.concat(s.map((function(t){return o(e,t)})));break;case jh.DELETE_ATTRIBUTE:(u.length||0==l.length)&&c.push({type:jh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}),c=c.concat(l.map((function(t){return o({type:jh.DELETE_ATTRIBUTE,uri:e.uri},t)})));break;case jh.UPDATE_ATTRIBUTE:{const s=u.some((e=>{let{type:t}=e;return t===a}))&&r?Wh(r,t,e.uri):null;if(s||l.length){if(l.length)c=c.concat(l.map((function(t){return o({type:jh.UPDATE_ATTRIBUTE,uri:e.uri,newValue:e.newValue},t)})));else if(s){const r=Bh(t,s.uri).filter((e=>{let{type:t}=e;return t===i}));c=c.concat(r.map((t=>o({type:jh.UPDATE_ATTRIBUTE,uri:s.uri,newValue:e.newValue},t))))}}else c.push({type:jh.INSERT_ATTRIBUTE,uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});u.length&&n&&c.push({type:jh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}});break}}return c}));let c=u.flat();const p=s(c,"typeUri");for(const e in p){if("undefined"===e)continue;const t=p[e],r=c.filter((function(e){return e.type!==jh._UPDATE_NON_OV_ATTRIBUTE})).filter((function(t){return t.uri.substr(0,t.uri.lastIndexOf("/"))===e||"INSERT_ATTRIBUTE"===t.type&&t.uri===e})),n=t.find((function(e){const{crosswalk:t}=e;return t&&t.type===i}));!r.find((function(e){return"UPDATE_ATTRIBUTE"===e.type}))&&n&&(c.push({type:jh.UPDATE_ATTRIBUTE,uri:n.uri,newValue:{value:n.value},crosswalk:n.crosswalk}),r.forEach(l)),t.forEach(l)}return c=c.filter((function(e){return!e.removeIt})),c.forEach((function(e){delete e.insteadOfUpdate})),c}!function(e){e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_TAGS="UPDATE_TAGS",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e._UPDATE_NON_OV_ATTRIBUTE="_UPDATE_NON_OV_ATTRIBUTE"}(jh||(jh={}));const Bh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Wh=(e,t,r)=>(0,l.pipe)(Ws,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return Rh(t,r)},e=>{let[t]=e;return!ys(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Yh(e,t){t=t||[];for(const r in e)if(e.hasOwnProperty(r)){const n=e[r];for(let e=0;e<n.length;e++){const r=n[e];if(Fh(r)&&r.refRelation){const e=r.refRelation[0]||r.refRelation;if(e.crosswalks){const r=e.crosswalks.filter((function(e){return e.attributes||e.attributeURIs}));for(let e=0;e<r.length;e++){let n=!0;for(let i=0;i<t.length;i++)if(t[i].type===r[e].type&&t[i].value===r[e].value){t[i].attributes=t[i].attributes||t[i].attributeURIs,t[i].attributes=t[i].attributes.concat(r[e].attributes||r[e].attributeURIs),t[i].attributes=Object.keys(t[i].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[i].attributeURIs,n=!1;break}n&&t.push(r[e])}}}}}return t}function qh(e,t){return kh(jh.UPDATE_TAGS).call(this,e,t)}function Hh(e,t){return kh(jh.UPDATE_ROLES).call(this,e,t)}function Jh(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){Kh(e,t,r[t])}))}return e}function Kh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Qh=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(ue(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:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(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,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Jh({},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:Jh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Xh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Xh(t.value):[]];return e.concat(r)}),[])),zh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Zh=e=>e?[cp(e)]:[],eb=e=>{const t=[...Xh((null==e?void 0:e.attributes)||[]),...Xh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...Zh(e),...t]:[]},tb=(e,t)=>[e,...t.map((t=>zh(e,t)))],rb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return pd(t)}))},nb=(e,t)=>{switch(e){case De.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case De.ENTITY_ATTRIBUTE:case De.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[dn(t)]})(t);case De.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case De.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,cp({uri:n,dataTenant:i}),r]})(t)}},ib=e=>(0,l.pipe)(l.values,(0,l.map)((0,l.map)((0,l.pipe)((0,l.prop)("replies"),l.inc))),(0,l.map)(l.sum),l.sum)(e),ab=(0,l.curry)(((e,t)=>{const r=Uo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(ab(e,r.extendsTypeURI)):n})),ob=(0,l.curry)(((e,t)=>(0,l.reduce)(((t,r)=>(0,l.assoc)(r,((e,t)=>(0,l.path)(["members",t],e))(e,r),t)),{},t))),sb=(e,t)=>(0,l.pipe)((0,l.prop)("type"),ab(e),ob(t))(t),lb=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 ub,cb=r(33164);function pb(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.PotentialMatches="potentialMatches",e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(ub||(ub={}));const db={},yb={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},potentialMatches:{colors:["#fec92f","#ee4272","#6d9a35","#555962","#2d9ecf"]},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"]}},fb=e=>{if(!db[e]){const t=yb[e]||yb.random0;db[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){pb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return db[e]},Tb=(0,l.curry)(((e,t)=>{const r=fb(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]})),Eb=e=>Tb(ub.Charts,e),mb=()=>fb(ub.PotentialMatches).colors,hb=e=>Tb(ub.Random1,e),bb=e=>(0,cb.getColor)(e)?"#FFFFFF":"#212121";var Ob=r(73116);const vb=Array.from({length:100},((e,t)=>t/100)),gb=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)},_b={},Ab=new Ob.Z({hash:gb,saturation:vb.slice(15,71),lightness:vb.slice(50,90)}),Nb=new Ob.Z({hash:gb,saturation:vb.slice(46,89),lightness:vb.slice(44,58)}),Pb=(0,l.curry)(((e,t,r)=>{t in _b||(_b[t]={});const n=_b[t];r in n||(n[r]=((e,t)=>{const r=String(gb(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Rb=Pb(Ab,"crosswalks"),Sb=Pb(Ab,"sources"),wb=Pb(Ab,"contributors"),Ib=Pb(Ab,"dataValidationFunctions"),Ub=Pb(Nb,"entities");function Cb(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){Db(e,t,r[t])}))}return e}function Db(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=(0,l.has)("items"),jb=e=>0===e,kb=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)},Fb=e=>e.reduce(((e,t)=>e+t.width),0),Mb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),xb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),$b=e=>e.reduce(((e,t)=>e+t.height),0),Gb=e=>(0,l.is)(String,e)&&e.includes("%"),Vb=(0,l.has)("spacer"),Bb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Wb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Lb(t)?Wb(t):t)),[]),Yb=(e,t)=>{const r=[...t];for(;(0,l.sum)(r)>e;){const e=Math.max(...r);if(1===e)break;const t=r.indexOf(e);r[t]--}return r},qb=e=>({id:e.layout}),Hb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qb;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,l.partition)((0,l.propIs)(Number,"flex"),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("flex"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/(a+n.length))),u=Math.max(s/Math.max((0,l.length)(n),1),1),c=(e,t,r)=>Math.max(Math.round(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):u}else{const[e,n]=(0,l.partition)((0,l.both)((0,l.propIs)(String,"width"),(0,l.pipe)((0,l.propOr)("","width"),(0,l.includes)("%"))),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("width"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/100)),u=Math.max(s/Math.max((0,l.length)(n),1),1);o=Gb(r.width)?Bb(i,r.width):u}return kb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return kb(n,t,r)},o=(e,t)=>Lb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Lb(a)?n(a.layout):e(a.view)))),s=Yb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=jb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Lb(n))return r.concat(p(Cb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Cb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:Fb(u),height:Mb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Lb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=jb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Lb(i))return r.concat(p(Cb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Cb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?kb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?kb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:xb(i),height:$b(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>jb(r)?e.y:(0,l.last)(t).y+((0,l.last)(t).height||n),i=(t,r,i,o)=>{const s=e(i),l=t.width,u=a(s),c=n(t,r,o,u);return Cb({},s,{x:t.x,y:c,width:l,height:u})},o=(e,t)=>{const r=t.reduce(((t,r,a)=>{if("string"==typeof r)t.push(i(e,t,r,a));else if("object"==typeof r){const o=Math.max(Math.round(e.width/2),1),s=Yb(e.width,[o,o]),u=Cb({},e,{width:s[0]}),c=Cb({},e,{x:e.x+s[0],width:s[1]}),p=(0,l.has)("left",r)&&i(u,t,r.left,a),d=(0,l.has)("right",r)&&i(c,t,r.right,a),y=(0,l.propOr)(0,"height"),f=Math.max(y(p),y(d));t.push(Cb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Cb({},e,{height:$b(r),items:r})},s=o(t,(0,l.propOr)([],"top",r)),u=Math.round(.66*t.width),c=(0,l.isEmpty)(s)?t.y:t.y+s.height,p=o(Cb({},t,{y:c,width:u}),(0,l.propOr)([],"center",r)),d=o({x:t.x+u,y:c,width:t.width-u},(0,l.propOr)([],"right",r)),y=s.height+Math.max(p.height,d.height),f=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Cb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Cb({},t,{items:(0,l.reject)(Vb,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return u(e,r);default:return null}},d=(0,l.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return Wb(f)},Jb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Kb=[Ze.FilteredEntitiesViewFacet,Ze.ActivitiesViewFacet,Ze.ProfileStatsFacet,Ze.FilteredSavedSearchesFacet],Qb=(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=Kb.includes(a.component)?8:4;return Cb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Xb(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){zb(e,t,r[t])}))}return e}function zb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zb={BarChart:ze.BAR,BarChartGrouped:ze.BAR,BarChartHorizontal:ze.BAR,LineChart:ze.LINE,Map:ze.MAP,Pie:ze.PIE},eO=(e,t)=>yn(e)?un(e,t):e,tO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Zb[r];return Xb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},rO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Xb({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"]))},nO=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Xb({},e,{value:[Ee.IN,Ee.NOT_IN,ye.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:me(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&yn(t)||!r?n:(n||[]).concat((i=r,{filter:ye.EQUALS,fieldName:"type",values:[i]}));var i},iO=["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"],aO={"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:eO(n,r),filters:nO(a,n,r),chartType:ze.BAR,component:Ze.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:eO(n,r),filters:nO(a,n,r),chartType:ze.BUBBLE,component:Ze.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:Ze.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=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Xb({id:t,count:o,canRead:u,orderType:s,attributeUri:eO(r,p),filters:nO(a,r,p),component:Ze.DashboardFacet,title:i,showOthers:!0},tO(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:eO(n,r),filters:nO(a,n,r),chartType:ze.MAP,component:Ze.DashboardFacet,title:i,geoUrl:iO[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 Xb({id:t,count:o,canRead:l,attributeUri:eO(n,r),filters:nO(a,n,r),component:Ze.DashboardFacet,title:i,geoUrl:s,chartType:ze.MAP,projection:"geoMercator"},tO(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ze.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:rO(i),component:Ze.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:nO(n,null,a),component:Ze.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:ye.GTE,fieldName:"matches",values:["1"]}],component:Ze.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:Ze.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:ze.CLOUD,component:Ze.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:ze.TREE,component:Ze.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ze.NotificationInboxFacet,title:n||de().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ze.ActivitiesViewFacet,title:n||de().text("Activity log")}}},oO=e=>({id:e,height:10}),sO=(0,l.pipe)((0,l.map)((e=>{const t=aO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),lO=e=>{if("0.1"===e.version){const t=sO(e.views),r=Hb(oO,e.layout,{columns:4});return{id:e.id,margin:0,layout:Jb(r,t),views:t}}return e},uO=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>uO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function cO(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){pO(e,t,r[t])}))}return e}function pO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dO=cO({},et,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),yO=e=>e,fO={[dO.Attributes]:yO,[dO.HierarchyTree]:yO,[dO.HierarchyPaths]:yO,[dO.RelationsTable]:yO,[dO.Relations]:e=>cO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[dO.SingleAttribute]:yO,[dO.Custom]:yO,[dO.AttributeTable]:yO,[dO.Map]:yO,[dO.OldTree]:e=>cO({},e,{class:et.HierarchyTree}),[dO.OldMap]:e=>cO({},e,{class:et.Map}),[dO.ImageAttribute]:yO,[dO.PotentialMatches]:yO},TO=(0,l.pipe)((0,l.map)((e=>{const t=fO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),EO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===et.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),mO=(e,t)=>(t||[]).map((t=>cO({},t,EO(e,t.id)))),hO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return cO({},t,{layout:mO(t.views,e.newLayout)});if("0.1"===e.version){const r=TO(e.views),n=Hb(EO(r),e.layout,{columns:3});return cO({},t,{layout:Jb(n,r),views:r})}return e},bO=(e,t)=>e.class===t||e["react-class"]===t,OO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(bO(t,et.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return(bO(t,et.SingleAttribute)||bO(t,et.AttributeTable))&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=(n[0]||e).uri;return r&&!r.some(an(i))||t.some(an(i))}},vO=(e,t)=>e.filter((e=>t.some((t=>bO(e,t))))).map((e=>{let{id:t}=e;return t})),gO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},_O=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),AO=e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);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){PO(e,t,r[t])}))}return e}function PO(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=(0,l.curry)(((e,t)=>uO(t).map((t=>(0,l.pipe)((0,l.map)((e=>gO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),SO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),wO=(0,l.propEq)("class",et.Custom),IO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},UO=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];let i;if("2.0"===r&&t.newLayout){const{newLayout:r}=t,a=mO(t.views,r);return i=(0,l.when)((0,l.pipe)(l.head,(0,l.is)(String)),(0,l.pipe)((0,l.map)((t=>(0,l.pipe)((0,l.map)((e=>gO(e,t))),(0,l.reject)(l.isNil),l.head)(e))),(0,l.reject)(l.isNil),(e=>[{id:"common",views:e}])))(t.sidePanelViews),(0,l.pipe)((0,l.pick)(["views","profileBand","workflow","frozen"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=RO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>gO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(SO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(RO(e),(0,l.filter)(wO))(NO({},n,{items:i})),s=[{id:"common",views:RO(e,NO({},n,{items:a}))}];return o.length>0&&s.push({id:"D&B",views:o}),s}})(e,t);const o=(e=>(0,l.pipe)((0,l.chain)((e=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.entity.side.WorkflowsView"===e.class))})(e))),l.head,(0,l.unless)(l.isNil,(0,l.pick)(["showClosedTasks","assignee","processTypes"])))(e))(e),s=hO(NO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(AO,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:s.views,layout:s.layout,sidePanelViews:i,profileBand:u,workflow:o})},CO=(e,t)=>{if("scroll"===t.layout.layout){const r=RO(e,t.layout),n=lO(NO({},t,{views:r,version:"0.1"}));return{class:rt.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:rt.Dashboard,views:t.views,layout:t.layout,id:t.id}},DO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:rt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries,showOVSwitcher:r.showOVSwitcher,showErrorBands:r.showErrorBands}},LO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:rt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},jO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:rt.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},kO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:rt.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},FO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:rt.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},MO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:rt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},xO=(e,t)=>{const r=RO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=_O(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:rt.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}},$O=(e,t)=>({class:rt.Graph,id:t.id}),GO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:rt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},VO=e=>t=>!!(0,l.intersection)(e,t).length,BO=(0,l.cond)([[VO(["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"]),()=>CO],[VO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>DO],[VO(["com.reltio.plugins.graph.GraphView"]),()=>$O],[VO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>LO],[VO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>jO],[VO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>kO],[VO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>FO],[VO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>MO],[VO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>xO],[VO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>GO],[l.T,()=>(0,l.always)(void 0)]]),WO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(IO),(0,l.map)((t=>UO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow","frozen"])))(e);return{class:rt.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:nt.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:nt.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>gO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",rt.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>gO(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=UO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:rt.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=uO(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return BO(o)(t,i)};function YO(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){qO(e,t,r[t])}))}return e}function qO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HO=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))},JO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var KO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(KO||(KO={}));const QO={[rt.DQDashboard]:`${JO}DqDashboard.svg`,[rt.Dashboard]:`${JO}Dashboard.svg`,[rt.Graph]:`${JO}Graph.svg`,[rt.RelationshipSearch]:`${JO}GraphSearch.svg`,[rt.Interactions]:`${JO}Interactions.svg`,[rt.PotentialMatches]:`${JO}PotentialMatches.svg`,[rt.Profile]:`${JO}Profile.svg`,[rt.NestedProfile]:`${JO}Profile.svg`,[rt.ProfileActivityLog]:`${JO}ActivityLog.svg`,[rt.Relationships]:`${JO}Relationships.svg`,[rt.Sources]:`${JO}Crosswalk.svg`,[rt.Search]:`${JO}Search.svg`,[KO.DashboardGroup]:`${JO}DashboardGroup.svg`,[KO.ProfileGroup]:`${JO}ProfileGroup.svg`,[KO.SearchGroup]:`${JO}SearchGroup.svg`,DEFAULT:`${JO}Default.svg`},XO=e=>QO[null==e?void 0:e.class]||QO.DEFAULT,zO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",rt.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>YO({},e,{nestedRoute:`${t+1}`})))))),ZO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},ev=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?QO[KO.ProfileGroup]:null,tv=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===QO[rt.Dashboard]||t===QO[rt.DQDashboard]})),(0,l.always)(QO[KO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===QO[rt.Search]||t===QO[rt.RelationshipSearch]})),(0,l.always)(QO[KO.SearchGroup])],[l.T,()=>null]])(e),rv=e=>(0,l.pipe)((0,l.chain)(HO),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.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,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>YO({},e,{entityTypes:e["entity-types"],screen:WO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=zO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:XO(r),screen:ZO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=WO(t,e);return{label:t.label,icon:ev(t)||tv(r)||XO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function nv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iv=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},av=e=>({id:e,height:10}),ov=e=>{const t=(e=>(0,l.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,l.pipe)((0,l.chain)(iv),(0,l.pluck)("pivotingAttributes"),l.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,l.propEq)("attribute-types","*")))(t);return(0,l.pipe)((0,l.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}),{}),l.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=sO(((e,t)=>{const r=uO(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.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){nv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Hb(av,t.layout,{columns:4});return{views:r,layout:Jb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function sv(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){lv(e,t,r[t])}))}return e}function lv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uv(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 cv=(0,l.curry)(((e,t)=>(0,l.pipe)((e=>((e,t)=>(e||[]).find((e=>"com.reltio.plugins.ui.Activator"===e.activator)))(e)),(0,l.prop)(e))(t))),pv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,dv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),yv=(0,l.pipe)(cv("top-logo"),dv),fv=(0,l.prop)("showLookupCode"),Tv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propSatisfies)((0,l.either)(ue,(0,l.equals)("none")),"format")),(0,l.map)((e=>{let{format:t}=e;if("none"===t)return{thousandSeparator:""};const{groupSeparator:r,digitsAfterDecimalSeparator:n}=t;return sv({thousandSeparator:r,decimalScale:n},uv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,l.pipe)(cv("default-perspective"),(0,l.ifElse)(pv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=(e=>(0,l.pipe)((e=>_O(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return sv({},t,uv(e,["action"]))})))(e))(e),f=(e=>cv("checkUser",e))(e),T=(e=>cv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),h=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=fv(h))||O;var O;const v=null===(t=AO(e))||void 0===t?void 0:t.showEntityId,g=(e=>cv("preview",e))(e),_=yv(e),A=(e=>cv("showAttributeDescription",e))(e),N=(e=>cv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e),R=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.network.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["id","point"]))(e))(e),S=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(e))(e),w=0===Object.keys(P).length?void 0:P,I=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.ProfileCheckUpdate"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.omit)(["id","point"]))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:w,requestProvider:R,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:S,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N,profileCheckUpdate:I}},Ev=e=>({layout:rv(e),pivoting:ov(e),properties:Tv(e)});function mv(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){hv(e,t,r[t])}))}return e}function hv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bv=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}_${(0,$r.x0)()}`;return n[e.id].push(t),i=!0,mv({},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]++,mv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function Ov(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){vv(e,t,r[t])}))}return e}function vv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let gv={};const _v=(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(E(gv[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))}gv=Ov({},gv,{[a]:Ov({},gv[a]||{},{worker:i})})}else i=gv[a].worker,gv[a].innerText&&t({task:{action:st.SET_HTML,params:{html:gv[a].innerText}},worker:i,config:r}),i.removeEventListener("message",gv[a].onWorkerMessage);return i&&(gv[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||(gv[a].innerText=n.params.html)}},i.addEventListener("message",gv[a].onWorkerMessage)),i},Av=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Nv=(0,l.flip)(Av);var Pv=r(83926);const Rv=(e,t)=>{let r;try{r=t(e)}catch(t){return e}return"number"==typeof e?r.toNumber():r.toString()};function Sv(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){wv(e,t,r[t])}))}return e}function wv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Iv={[dt.percent]:{valueConverters:{in:e=>Rv(e,(e=>new Pv.Decimal(e).mul(1e4).floor().div(100))),out:e=>Rv(e,(e=>new Pv.Decimal(e).mul(100).floor().div(1e4)))}}},Uv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Iv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.in)||l.identity)(t)})),Cv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Iv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.out)||l.identity)(t)})),Dv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const{uri:n,name:i}=e||{},a=!n||Fn(e)?i:n;return t[a]||t[Ne]||jv(r)},Lv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{[Nt.relevanceScore.name]:Sv({},Dv(Nt.relevanceScore,e,t),{strategy:dt.percent})}},jv=(0,fi.Z)((e=>{var t;e=null===(t=e)||void 0===t?void 0:t.replace(/_/g,"-");const r=new Intl.NumberFormat(e).formatToParts(1000000.1),n=e=>{var t;return null===(t=r.find((t=>{let{type:r}=t;return r===e})))||void 0===t?void 0:t.value};return{thousandSeparator:n("group"),decimalSeparator:n("decimal"),groupSize:("integer",(null===(i=r.filter((e=>{let{type:t}=e;return"integer"===t})).map((e=>{let{value:t}=e;return t})).sort(((e,t)=>t.length-e.length)))||void 0===i?void 0:i[0])||"000").length};var i})),kv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s,strategy:l}=e;t=Uv(l,t);const u=null!=s?new Pv.Decimal(t).toFixed(s):t,[c,p]=u.split("."),d=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),y=c.replace(d,r),f=null==p?void 0:p.replace(/(0|\.)+$/,"");return i+y+(f?n+f:"")+a};let Fv;const Mv=()=>Fv,xv={setLocale:e=>{Fv=e},getLocale:Mv,number:e=>((e,t)=>{const r=String(t);try{const t=jv(e);return kv(t,r)}catch(e){return console.warn("Number localization error"),r}})(Mv(),e),applyFormatToNumber:kv},$v=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?xv.applyFormatToNumber(e,t):(!e&&t&&(t=xv.number(t)),t)))),Gv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?de().number(e,"0,0.0a").toUpperCase():de().number(e,"0,0"):""},Vv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Bv=!0;const Wv=e=>Bv=e,Yv=(e,t)=>e!==t&&t?Bv&&e?`${t} (${e})`:t:e,qv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Hv=(e,t,r)=>{const n=qv(e,t,r);return Yv(r,n)},Jv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Kv=(0,l.complement)(Jv),Qv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Xv=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.pipe)((0,l.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,l.uniq)([...(0,l.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),l.values)(t)},zv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Kv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Zv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=i?q(i):"L",s=a?K(a):"L LTS";switch(n.type){case ft.TYPE_NUMBER:case ft.TYPE_FLOAT:case ft.TYPE_DOUBLE:case ft.TYPE_LONG:case ft.TYPE_INT:case ft.TYPE_COUNT:{const e=Dv(n,r,xv.getLocale());return t&&$v(e,t)}case ft.TYPE_BOOLEAN:case ft.TYPE_BOOLEAN_RADIO:case ft.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?de().text("Yes"):de().text("No");case ft.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(qu(t)?Hu(t):de().date(t,o));case ft.TYPE_ACTIVENESS_DATE:case ft.TYPE_LOCAL_DATE:return(t=t)&&(qu(t)?Hu(t):de().date(t,o));case ft.TYPE_TIMESTAMP:return(t=t)&&(qu(t)?Hu(t):de().date(isNaN(t)?t:Number(t),s));case ft.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case ft.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case ft.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?Yv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),eg={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},success:{main:"#3B873E"},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)"};function tg(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){rg(e,t,r[t])}))}return e}function rg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ng=e=>(t,r)=>{const{timeout:n}=r,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}(r,["timeout"]);if(AbortController&&n){const r=new AbortController,a=setTimeout((()=>r.abort()),n);return e(t,tg({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},ig=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()}},ag=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=tg({},JSON.parse(t),{[br]:e.status})}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),og=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,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(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={},u=(0,l.pipe)(ng,(e=>{const t={},r={};return n=>{var i,a;const o=null!==(i=e.attemptsThreshold)&&void 0!==i?i:10,s=null!==(a=e.attemptsTimeWindowSize)&&void 0!==a?a:5e3;return(i,a)=>{const l=(e=>{const[t]=e.split("?");return t.split("/")[2]})(i),u=t[l],c=()=>Promise.reject({errorMessage:`service ${l} was disabled (authorization issues)`});if(u)return c();if(r[l]){const e=r[l].length;if(e>o){const n=e-o-1;if(r[l][e-1]-r[l][n]<=s)return t[l]=!0,c();r[l]=r[l].slice(n)}}return n(i,a).then((t=>{var n;return!e.excludedServices||null!==(n=e.excludedServices)&&void 0!==n&&n.includes(l)||(401===t.status?(r[l]||(r[l]=[]),u||r[l].push(Date.now())):r[l]&&t.ok&&(r[l].length=0)),t}))}}})(s),(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),ig,ag);let c=0,p=[];return{request:(e,n)=>{const i=u(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const 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))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(c){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return p.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,setRequestProviderConfiguration:e=>{Object.assign(s,e)},startInterceptorInit:()=>{c+=1},finishInterceptorInit:()=>{c=Math.max(c-1,0),0===c&&(p.forEach((e=>e())),p=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},sg="__metadata",lg=(e=>{const t=[sg,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),ug=(0,l.set)(lg),cg=(0,l.view)(lg),pg=ug(ge.NEW),dg=ug(ge.REMOVED),yg=ug(ge.EDITED),fg=ug(ge.IGNORED),Tg=(0,l.pipe)(cg,(0,l.equals)(ge.REMOVED)),Eg=(0,l.pipe)(cg,(0,l.equals)(ge.NEW)),mg=(0,l.pipe)(cg,(0,l.equals)(ge.EDITED)),hg=(0,l.pipe)(cg,(0,l.complement)(l.isNil)),bg=(0,l.pipe)(cg,(0,l.equals)(ge.IGNORED)),Og=(0,l.omit)([sg]),vg=(e,t)=>e===sg?void 0:t;function gg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _g=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=_g(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Ag=(e,t)=>_g((0,l.propEq)("nodeId",t),e),Ng=(e,t)=>_g((0,l.pathEq)(["entity","uri"],t),e),Pg=(e,t)=>{const r=Ag(e,t);return r.length>1?r[r.length-2]:null},Rg=(e,t)=>{const r=Ag(e,t);return r.length>0?r[r.length-1]:null},Sg=(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=>Sg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},wg=()=>{},Ig=(e,t)=>{let{parent:r,nodeProcessing:n=wg}=t;n(e,r),e.children&&e.children.forEach((t=>Ig(t,{parent:e,nodeProcessing:n})))},Ug=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ve.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 Ve.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 Ve.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){gg(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})}}},Cg=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&&Ig(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ve.addingChild||r.editingMode===Ve.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Ug({node:r,connection:n,isReversed:i}),s=Cp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ve.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Ug({node:r,isReversed:i,connection:n}),l=s?kp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):jp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Dg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Dg(r,t);if(e)return e}return!1},Lg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Lg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),jg=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Dg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Lg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},kg={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Fg={asc:"asc",desc:"desc"},Mg=kg.entityLabel,xg=Fg.asc,$g=(0,l.always)(0),Gg=e=>{let{sortField:t=Mg,sortOrder:r=xg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case kg.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return QN.strings.sort(t,a,o)})(n,r);case kg.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return QN.strings.sort(e,i,a)})(r);default:return $g}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Vg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Fg)),l.identity,(0,l.always)(xg))),Bg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(kg)),l.identity,(0,l.always)(Mg)));var Wg=r(91104);let Yg;const qg=(e,t)=>(Yg||(Yg=Wg.createClient({key:t})),new Promise((t=>{Yg.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,l.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),Hg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Jg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(ys).flatMap((e=>{let r;return e.type==t&&(r=[Hg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Jg(e.value,t))),r})),Kg=e=>e&&e.length>0,Qg=(e,t)=>[].concat(e&&e.attributes?Jg(e.attributes,t):[]).filter(l.identity);function Xg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zg=(e,t,r,n,i,a)=>{if(e&&e.type){const t=Ei(r,e.type);n&&(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){Xg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Qg(e,t.latitude),n=Qg(e,t.longitude),Kg(r)&&Kg(n)&&(0,l.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),r,n);var r,n})).filter(l.identity);if(a.length>0)return Promise.resolve(a[0])}const o=t.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(Kg(t)&&t[0].value&&Kg(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?qg(n.label,a).catch((()=>null)):Promise.resolve(null)},Zg=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,l.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=Ei(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=>[e,t.attributes[e]])).filter((e=>{let[,t]=e;return t})).flatMap((e=>{let[r,n]=e;return n.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e,name:r})))})));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s,name:u}=t;return zg(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?qg(a.label,r).catch((()=>null)):e)).then((e=>ne(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},e_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,l.pipe)((0,l.chain)((t=>{const r=Ei(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Xn(e,r.latitude,t.type)&&Xn(e,r.longitude,t.type)){const e=Qg(t,r.latitude),n=Qg(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,l.zipWith)(i,e,n)}}))})),(0,l.filter)(l.identity),(0,l.uniqBy)((0,l.prop)("id")))(t))},t_=(e,t,r)=>Promise.all([e_(e,t),Zg(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.lng===e.point.lng))))]}));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){n_(e,t,r[t])}))}return e}function n_(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)=>t.values.map(vo(e,t.entityTypeUri)),a_=(e,t,r)=>tl(t.fieldName,r)||Xn(e,un(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),o_=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?Yv(e,t):e}),r)},s_=(0,l.path)(["attrType","label"]),l_=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>r_({},e,{[t]:!0})),{});e[r]=e[r]?r_({},e[r],n):n}return e}),{}),u_=(0,l.pipe)((0,l.prop)("values"),E),c_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",wt.type.name)),p_=e=>e.type===f_.NUMERIC_RANGE_FACET,d_=e=>e.type===f_.DATE_RANGE_FACET,y_=(0,l.either)(p_,d_),f_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},T_=e=>{switch(null==e?void 0:e.name){case wt.type.name:return f_.ENTITY_TYPE_FACET;case wt.createdBy.name:case wt.updatedBy.name:case wt.sourceSystems.name:case wt.tags.name:case wt.roles.name:case wt.matchRules.name:case wt.MLRecommendedMatch.name:return f_.WITH_DROPDOWN_CHECKBOXES_FACET;case wt.createdTime.name:case wt.updatedTime.name:case wt.startDate.name:case wt.endDate.name:return f_.DATE_RANGE_FACET;case wt.matches.name:case wt.matchScore.name:return f_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return f_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return f_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return f_.DATE_RANGE_FACET;default:return f_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},E_=(0,l.pipe)(a_,T_),m_=(0,l.pipe)((0,l.path)(["attrType","type"]),li),h_=(0,l.cond)([[p_,(0,l.always)(ye.IN_RANGE)],[d_,(0,l.always)(ye.WITHIN)],[(0,l.allPass)([m_,e=>e.values.length>=2]),(0,l.always)(ye.EXISTS)],[l.T,(0,l.always)(ye.EQUALS)]]),b_=(0,l.cond)([[d_,(0,l.prop)("values")],[p_,(0,l.prop)("values")],[m_,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]),O_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Oe),v_=e=>(e=>O_.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]=Ku(t);return e.replace(r,i).replace(n,a)}),e))(e),g_=(0,l.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}`})),__={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},A_=e=>[__.geoPolygon,__.onMapMove].includes(e),N_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},P_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},R_=(e,t)=>A_(e)?t.map(N_):[P_(t)],S_=e=>A_(e)?de().text("Geo Polygon"):de().text("Geo Location"),w_=e=>{switch(e){case __.geoLocation:return"geoLocation";case __.geoPolygon:case __.onMapMove:return"geoPolygon"}},I_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},U_=e=>de().text(e),C_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ye.EQUALS]:"=",[ye.NOT_EQUALS]:"≠",[ye.STARTS_WITH]:"*",[ye.MISSING_VALUE]:de().text("missing value"),[ye.HAS_ALL]:de().text("has all"),[ye.IN_RANGE]:de().text("in range"),[ye.FULL_TEXT]:de().text("full text"),[ye.EXISTS]:de().text("exists"),[ye.COUNT_EQUALS]:`${de().text("count")} =`,[ye.COUNT_NOT_EQUALS]:`${de().text("count")} ≠`,[ye.COUNT_LT]:`${de().text("count")} <`,[ye.COUNT_LTE]:`${de().text("count")} <=`,[ye.COUNT_GT]:`${de().text("count")} >`,[ye.COUNT_RANGE]:de().text("count range"),[ye.LT]:"<",[ye.LTE]:"<=",[ye.GT]:">",[ye.GTE]:">=",[ye.IN_FILE]:de().text("in file"),[ye.NOT_IN_FILE]:de().text("not in file"),[ye.CONTAINS]:"~",[fe.LIST_EQUALS]:"=",[fe.NOT_LIST_EQUALS]:"≠",[fe.LIST_EQUALS_CASE_SENSITIVE]:"=",[fe.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||de().text(e.toLowerCase())},D_=e=>({type:I_.operator,text:e}),L_=e=>({type:I_.operator,text:U_(e)}),j_=e=>({type:I_.attributeLabel,text:e}),k_=e=>({type:I_.specialAttributeLabel,text:e}),F_=e=>({type:I_.attributeFilter,text:C_(e)}),M_=e=>({type:I_.attributeValue,text:e}),x_=e=>({type:I_.entityTypeLabel,text:e}),$_=()=>({type:I_.space,text:" "}),G_=()=>({type:I_.bracket,text:"("}),V_=()=>({type:I_.bracket,text:")"}),B_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),W_=(0,l.curry)(((e,t)=>t.map(B_(e)))),Y_=(0,l.curry)(((e,t,r)=>[e,...r,t])),q_=Y_(G_(),V_()),H_=Y_($_(),$_()),J_=(0,l.curry)(((e,t)=>[e,...t])),K_=e=>J_(x_(e)),Q_=e=>J_(x_(`${e}: `)),X_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Au(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=gu(s),a=_u(s);!r&&t&&n&&(i.push(G_()),r=!0),i.push(o),r&&a&&(i.push(V_()),r=!1);const l=e?L_(s):D_(s);i.push(...H_([l]))}else i.push(o),r&&(i.push(V_()),r=!1)}return i}},z_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),Z_=(0,l.pipe)(X_({localizable:!1}),z_),eA=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},tA=e=>{let{data:t,values:r,filter:n}=e;return t&&hc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},rA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(tA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),nA=(0,l.pipe)((0,l.chain)((0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&Hn(e.data.attrType)})(e)&&[ye.HAS_ALL,ye.EQUALS,ye.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:qn((0,l.path)(["data","attrType"],e)),codeValues:(0,l.flatten)((0,l.propOr)([],"values",e))}))),(0,l.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),Xv),iA=(e,t)=>(0,l.pipe)(nA,zv(t))(e),aA=(0,l.pathEq)(["data","fieldName"],wt.type.name),oA=(0,l.path)(["data","entityTypeUri"]),sA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),lA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ps(e)),attributes:(0,l.filter)((0,l.pipe)(oA,(0,l.anyPass)([l.isNil,ps(e),r=>{const n=(t.entityTypes||[]).filter(ps(e));return(n.length>1?vi(e,n):null)===r&&!!Ei(e,r)}])))})(t))))),uA=e=>(0,l.pipe)((0,l.prop)("filter"),uu,(0,l.equals)(e)),cA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=tl(n.fieldName)||n.attrType,s=Bu(o,i),u=Zv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Hn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Yv(a.lookupCode,a.value):Hv(r,qn(o),a)],[()=>nl(s),()=>vo(e,n.entityTypeUri,a)],[()=>il(s),()=>Wo(e,a)],[()=>cl(s),()=>Ho(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>ai(c)||li(c)),Mu),M_)()})),pA=(e,t,r,n)=>{const i=cA(e,t,r,n.data,n.filter);return(0,l.cond)([[uA(0),(0,l.always)([])],[(0,l.both)(uA(2),(2,(0,l.pipe)((0,l.prop)("values"),l.flatten,l.length,(0,l.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,l.flatten)(t);return[$_(),i(r),{type:I_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[$_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),W_({type:I_.punctuationMark,text:", "}))(t)]}]])(n)},dA=(e,t)=>{const r=!!tl(e.data.fieldName);return(0,l.pipe)(eA,r?k_:j_)(e,t)},yA=(e,t,r,n,i)=>[dA(n,i),$_(),F_(n.filter),...pA(e,t,r,n)],fA=(0,l.addIndex)(l.map),TA=(0,l.propEq)("length",1),EA=(0,l.propSatisfies)((0,l.lt)(1),"length"),mA=(0,l.complement)(l.isEmpty),hA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(Ru,(0,l.filter)(tA),Su,(0,l.map)((n=>({operand:yA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,X_()))(n)},bA=(0,l.pipe)(hA,l.flatten),OA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>yp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=hA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(K_),(0,l.pipe)(s(Q_),(0,l.unless)((()=>TA(u)||i),q_)))(u)},vA=(e,t,r,n)=>(0,l.pipe)(Ru,(0,l.filter)(rA),Su,fA(((n,i,a)=>({operand:OA(e,t,r,n,TA(a)),operator:n.operator}))),X_(),l.flatten)(n),gA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),X_(),l.flatten),_A=e=>{let{searchType:t,values:[r]}=e;return R_(t,r).join(", ")},AA=(e,t,r,n,i,a)=>{const o=(e=>e?[k_(e.isRawFilter?de().text("Raw filter"):de().text("Search")),...H_([F_(ye.EQUALS)]),M_(`"${e.value}"`)]:[])(i),s=(e=>e?[k_(S_(e.searchType)),$_(),M_(_A(e))]:[])(a),u=(0,l.pipe)(vA,(0,l.when)((e=>EA(e)&&(mA(o)||mA(s))),q_))(e,t,r,n);return gA([o,s,u])},NA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),PA=(0,l.pipe)(AA,NA),RA=(0,l.has)("attributes"),SA=Array.isArray,wA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),IA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=UA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(wA(a))),q_),(0,l.concat)(H_([D_(o)]))))(s)},UA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return RA(n)?IA(e,t,r,n,i):SA(n)?n.reduce(((n,a)=>n.concat(UA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(H_([D_(n.operator)])))(yA(e,t,r,n,i))},CA=(e,t,r,n,i)=>(0,l.pipe)(UA,l.flatten)(e,t,r,n,i);function DA(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 jA=(0,l.complement)(aA),kA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(aA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(oA),(0,l.reject)(l.isNil),l.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,l.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},FA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=kA(t);return(r||n)&&Nu(t)},MA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(FA)),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(aA).some((0,l.propEq)("filter",ye.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,l.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=kA(r);if(FA(e))t.push(DA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(jA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(aA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(oA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(jA),entityTypes:n,operator:i?a:e.operator,id:(0,$r.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),xA={[ye.EQUALS]:ye.ON,[ye.IN_RANGE]:ye.WITHIN,[ye.GTE]:ye.AFTER,[ye.GT]:ye.AFTER,[ye.LTE]:ye.BEFORE,[ye.LT]:ye.BEFORE},$A=(0,l.curry)((e=>xA[e]||e)),GA=(0,l.curry)(((e,t)=>{switch(e){case ye.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case ye.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),VA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),ri),BA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>DA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return VA(e)?(0,l.evolve)({filter:$A,values:GA(t)},e):e}))})))})),WA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Yu),(0,l.map)(Ku))}),YA=(0,l.map)((0,l.cond)([[VA,WA],[l.T,l.identity]])),qA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),MA,lA(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),YA)})),BA,(0,l.reject)(sA))(r)));function HA(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){JA(e,t,r[t])}))}return e}function JA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KA=(e,t)=>({data:{uri:yn(e.fieldName)?un(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||h_(e),id:(0,$r.x0)(),values:b_(e)}),QA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=tl(a,t,r)||Xn(e,i);if(!s)return null;if(Fn(s))return HA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=yp(e,{type:o}),i=(Qn(e,un(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return HA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),XA=(0,l.curry)(((e,t,r,n)=>qA(QA,e,n,t,r)));function zA(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){ZA(e,t,r[t])}))}return e}function ZA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},tN=e=>"rdmLookups.not.resolved"===e?wt.notResolved.name:e,rN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Ee.NOT_IN_RANGE?ye.IN_RANGE:me(a),u=tN(n),c=tl(u)||Xn(e,i),p=(0,l.cond)([[()=>yu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>zA({},e,{filename:Vv(e)}))))],[()=>li(null==c?void 0:c.type),(0,l.map)(le)],[e=>pu(s)&&!Array.isArray(e[0])&&!ri(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:(0,$r.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Ee.NOT_IN_RANGE?"and not":"and",filter:s,values:p}})),nN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(rN(e,vi(e,i)));return[{id:(0,$r.x0)(),operator:"or",attributes:a,entityTypes:i}]})),iN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),aN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([iN("from"),iN("to")]),(0,l.pipe)((0,l.pick)(["from","to"]),l.values)],[(0,l.pipe)((0,l.prop)("rangeSelection"),E,l.not),(0,l.pipe)((0,l.prop)("rangeSelection"),(0,l.pick)(["start","end"]),l.values)],[l.T,()=>[]]]),oN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return zA({},r,{values:aN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Qs(e.fieldName,n):e.fieldName})},sN=(e,t)=>{if((0,l.has)("children")(e)){const r=oN(e,t);return e.children.reduce(((e,n)=>(e.push(sN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return oN(e,t)},lN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(oN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(zA({fieldName:e.fieldName},oN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(sN,l.flatten)],[l.T,oN]]),uN=(0,l.pipe)((0,l.map)(lN),l.flatten),cN=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},pN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=nN(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:uN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>zA({},t,{type:E_(e,t)}))).map((e=>zA({},e,{values:y_(e)?cN(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 KA(r,t)})),operator:"or",id:(0,$r.x0)(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[tN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[zA({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return XA(e,t,r,p)},dN=(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,l.pipe)(l.values,(0,l.reject)(u_),(0,l.partition)(c_))(t),i=n.map((t=>HA({},t,{type:E_(e,t)}))).map((e=>KA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,$r.x0)(),entityTypes:a}]})(e,a);return XA(e,t,r,o)})(e,t,r,n):pN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},yN=e=>"2.0"===e.version?e.keyword:eN(e),fN=e=>(0,l.pathEq)(["object","uri"],e),TN=(e,t)=>(0,l.pipe)((0,l.find)(fN(e)),(0,l.prop)("object"))(t),EN=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,l.pipe)((0,l.find)((0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),fN(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=TN(r.match,t)||n[r.match];return i?{label:Yc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return Oo(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},mN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),hN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),bN=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,l.propOr)({},n,r);return{label:Yc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return Oo(e,o.type,t)||{label:t,uri:t}}))}})))(t),ON=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},vN=(0,l.path)(["object","uri"]),gN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.find((e=>{let{uri:r}=e;return r===t}))},_N=e=>void 0!==(null==e?void 0:e.relevance),AN=e=>_N(e)?100*e.relevance+"%":"";function NN(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){PN(e,t,r[t])}))}return e}function PN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RN=(e,t)=>!!e[t],SN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},wN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},IN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return NN({},t,{[r.uri]:NN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:wN(null==o?void 0:o.parents,n),children:wN(null==o?void 0:o.children,i),values:wN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},UN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Ei(r,t)||Ni(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return es(r,n,i).flatMap(rs).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Xn(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=IN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>IN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},CN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Qr(e.uri)&&rn(e.type)&&rn(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ss(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(ys),(0,l.map)(SN))(i);return IN({structure:e,attrType:e[t].attrType,values:a})}),t)},DN=e=>{let{structure:t,attributeValue:r}=e;if((0,l.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,l.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return RN(e,r)}));return r||n?t.filter(ys).reduce(((e,t)=>DN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return RN(t,e.type)?IN({structure:t,attrType:t[e.type].attrType,values:[SN(e)]}):t}},LN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?NN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},jN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ss(i,n,r)||[];return a.length?IN({structure:t,attrType:t[r].attrType,values:a.filter(ys).map(SN)}):t},kN=(e,t,r)=>{const n=Zr(e),i=Zr(t);return n===i?((e,t)=>{const r=En(t),n=En(e);return an(n,r)||((e,t)=>fn(e)&&!fn(t)&&an(t,e))(n,r)})(e,t):!(!r||!Tn(t))&&uh(r,i).includes(n)},FN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},MN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?sh(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return kN(r,t,o)}))},xN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>xN(e,t,r)))))},$N=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},GN=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&FN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!$N(i,a)}},VN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=Zr(n),p=lh(c,o,i,a),d=xN("children",t,u),y=xN("parents",t,u),f=d.flatMap((e=>xN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return kN(t,n,p)})).map((t=>GN(e.attrType.uri,n,t,s,l)))));if(!T.length)return[];const E=y.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return kN(n,t,p)||Zr(t)!==c&&kN(t,n,p)})).map((t=>GN(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=xN("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return T.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&kN(n,t,p)}))})).map((t=>GN(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return kN(t,n,p)})).map((e=>GN(r,n,e,s,l))),...E,...m,...T]},BN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=Zv({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.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=>Bc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Gn,()=>a(n)],[Hn,()=>(e=>{const r=o(e),n=qn(t);return Ql([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Hv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},WN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:ye.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(YN(r,t)):i.push(qN([t],r)),i},YN=(e,t)=>{const r=Mn(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=Gn(i)?YN(i,t[r]):[qN(t[r],i)];return e.push(...a),e}}),[])},qN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Yn(t.uri),filter:t.type===ft.TYPE_BLOB?ye.FULL_TEXT:ye.EQUALS,values:e}:{fieldName:Yn(t.uri),filter:ye.MISSING_VALUE},HN=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),JN=new class{constructor(){this.comparators=void 0,this.comparators={}}register(e,t){this.comparators[e]=t}get(e){var t;return null!==(t=this.comparators[e])&&void 0!==t?t:HN}},KN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},QN={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=6856.js.map