@reltio/remotes 1.4.1108 → 1.4.1111

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/2864.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2864],{99493:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Ps,PY2:()=>hn,Ng6:()=>ht,YJ7:()=>pn,NlI:()=>tn,Xt7:()=>ft,wfT:()=>Zn,EMD:()=>Vn,HAc:()=>Tt,PEf:()=>_n,oA3:()=>$n,$XE:()=>jt,eWf:()=>vn,q7e:()=>Et,KVe:()=>ei,WVQ:()=>jr,oZZ:()=>ci,bNA:()=>pi,Rjq:()=>di,G39:()=>Nn,yn8:()=>It,N0y:()=>wt,dZX:()=>Dt,bQt:()=>fi,oS0:()=>$t,lL_:()=>ln,Nsj:()=>yn,psV:()=>cn,xPW:()=>bn,pyR:()=>Qn,p8l:()=>Wn,Wkf:()=>yt,zHr:()=>dt,NIO:()=>pt,$26:()=>EO,Esk:()=>Dn,s9T:()=>Pt,MEy:()=>uu,j5E:()=>en,vAw:()=>Mn,NMQ:()=>Fn,mNm:()=>Bn,rwv:()=>li,s_5:()=>Hn,RgZ:()=>Yn,unl:()=>ui,Qy0:()=>yi,pYu:()=>jn,wIJ:()=>$O,GFH:()=>Ot,S91:()=>Rn,p3$:()=>hi,wSh:()=>Z,BDP:()=>Si,pGS:()=>qn,ARY:()=>Vt,XGc:()=>zn,fO_:()=>Vr,wwy:()=>At,_XL:()=>dn,j2V:()=>ti,dMV:()=>Jn,NBX:()=>xg,OXy:()=>Gt,BXd:()=>Ut,CJB:()=>ii,lXI:()=>Ft,nqG:()=>Ei,C68:()=>An,yxQ:()=>Ti,Yj_:()=>Nt,D25:()=>gt,ZIY:()=>kt,Tl4:()=>QO,lwr:()=>gn,NkU:()=>ri,Rtp:()=>Xn,YGx:()=>Ct,uTS:()=>Kn,MCv:()=>mt,IYE:()=>Gn,PiC:()=>si,tJI:()=>bt,fDt:()=>vt,cNQ:()=>ni,SwE:()=>kn,ZHR:()=>oi,lD1:()=>Pn,lVm:()=>Lt,vnX:()=>Vb,$x5:()=>Gb,_R1:()=>Mb,wUm:()=>$b,z7V:()=>mi,dC6:()=>St,MBD:()=>_t,GmF:()=>aa,cKm:()=>xt,iP_:()=>On,NVC:()=>Rt,tPT:()=>el,tZe:()=>Cp,kRE:()=>jy,psB:()=>Dy,X0$:()=>Zs,zE1:()=>ul,Wm5:()=>Ws,vyX:()=>ec,wLZ:()=>tl,W4V:()=>se,EtK:()=>Es,Wtd:()=>zs,asT:()=>Jg,kGs:()=>ge,ewt:()=>fT,O_f:()=>ru,sOy:()=>et,Tde:()=>yr,LMI:()=>xu,skb:()=>kv,sPt:()=>Su,sH1:()=>wu,RPM:()=>lE,h27:()=>Qu,Uqd:()=>Zu,xG:()=>Kv,Z2f:()=>ab,fgW:()=>Ev,I69:()=>Vv,ZxB:()=>Wv,mdt:()=>nE,Qbq:()=>Gh,rny:()=>Gi,UEY:()=>Ra,Q0T:()=>Na,Lyr:()=>La,sBn:()=>Aa,itK:()=>Oa,H9$:()=>_a,KPc:()=>ga,zos:()=>va,ELQ:()=>ja,dZs:()=>ca,Cz4:()=>ua,z_L:()=>Ua,fGe:()=>la,iuF:()=>ha,Wib:()=>ba,Hn0:()=>Ca,obS:()=>Da,E$L:()=>pa,XUh:()=>ma,Qp_:()=>Ta,_jk:()=>da,sKE:()=>ya,WmG:()=>Ea,QKx:()=>wa,Oik:()=>Sa,s0A:()=>fa,o9m:()=>Pa,MCd:()=>Ia,RsS:()=>Hu,tGK:()=>Ul,lIv:()=>cl,Vg3:()=>Ki,mkC:()=>ki,xv5:()=>Xi,a14:()=>Fi,yv0:()=>Ji,Zm0:()=>xi,Nxd:()=>Di,$mM:()=>Hi,ifj:()=>kr,NWi:()=>Ab,xr3:()=>_b,wNf:()=>Vl,iJH:()=>Nb,d89:()=>Ci,Edd:()=>Li,Z5t:()=>ji,uGe:()=>Ii,UoR:()=>wi,xvW:()=>gb,$qe:()=>vb,yPM:()=>sa,$cp:()=>ll,vKJ:()=>ol,AID:()=>wf,B1H:()=>Dg,b7X:()=>Mh,$uE:()=>_e,keo:()=>Vh,C_p:()=>BE,G27:()=>Wm,JA0:()=>_y,b3T:()=>ve,oC6:()=>be,_Zs:()=>Oe,epC:()=>Ne,YYG:()=>Ae,f_2:()=>Ny,w3l:()=>mg,QHB:()=>Gm,Jso:()=>Ag,RXH:()=>wm,Vr9:()=>Xm,lMm:()=>Lh,BlA:()=>o_,fmQ:()=>ls,yRD:()=>og,NcL:()=>XE,QK6:()=>de,ymd:()=>Tp,JV_:()=>Hy,XiW:()=>Qf,Yrx:()=>dy,GPx:()=>Xs,gjI:()=>Js,vlo:()=>CT,E_P:()=>zT,aAL:()=>rp,NBq:()=>us,wp9:()=>rE,DsR:()=>Jc,MPc:()=>jf,gWE:()=>Df,DT_:()=>kf,ipn:()=>Ff,ORg:()=>Ni,_wz:()=>xf,RYR:()=>uT,PP2:()=>Ty,wS7:()=>db,cBQ:()=>Dc,pBq:()=>ff,DsO:()=>ee,X78:()=>Jy,xZs:()=>Yy,YFy:()=>fy,Gmt:()=>My,K$w:()=>Fy,DSj:()=>np,k9j:()=>xc,ww$:()=>rl,WVU:()=>xy,hxF:()=>Bs,nwO:()=>u_,Mzk:()=>Ic,aFF:()=>Hh,HRH:()=>du,EZK:()=>Yp,Kxm:()=>$p,Z9i:()=>RE,CrF:()=>Iy,DNd:()=>xa,vUy:()=>t_,lJh:()=>Tu,zHo:()=>Eu,sEJ:()=>Mg,UO$:()=>Of,zeJ:()=>br,dLR:()=>Os,JQy:()=>Ns,XtP:()=>hs,Ug0:()=>Xr,A1W:()=>$h,sw:()=>Wp,nv3:()=>Lb,JgD:()=>Cb,nve:()=>$g,SkP:()=>Rs,SAs:()=>Ef,PWK:()=>ko,IM5:()=>bs,Mfk:()=>Fh,mB6:()=>lb,p6d:()=>w,o0x:()=>U,ufS:()=>Xh,k7L:()=>zh,mrB:()=>I,ncP:()=>He,Zmi:()=>We,hm5:()=>Be,ECL:()=>Mr,vPL:()=>Qp,qmL:()=>JT,hXd:()=>Yi,OCS:()=>Bi,p2l:()=>ws,qF1:()=>Ep,_X$:()=>mp,yj2:()=>kO,bzh:()=>oE,k66:()=>qo,kiP:()=>so,pSg:()=>ce,kz_:()=>by,H_U:()=>Ho,t9e:()=>Ya,j2$:()=>Lp,PFL:()=>rr,aJ3:()=>sO,To9:()=>fr,wpo:()=>yd,ADq:()=>vE,UUb:()=>bE,tQX:()=>OE,xy8:()=>or,EUG:()=>Or,AFK:()=>at,X3M:()=>hr,WN0:()=>Qo,kDl:()=>vs,uDV:()=>KT,IhQ:()=>_s,R$r:()=>XT,w80:()=>Ao,Pfu:()=>Ga,Gtj:()=>_l,fyF:()=>gl,kkq:()=>Bo,u5q:()=>Ke,O$n:()=>pd,ptG:()=>dd,f4_:()=>im,uap:()=>nm,d7q:()=>py,liG:()=>Ey,$oF:()=>cy,avf:()=>gT,DiQ:()=>vT,cfX:()=>OT,vD3:()=>AT,Qrb:()=>bT,EJQ:()=>_T,HWy:()=>hT,gjS:()=>dT,y6v:()=>mT,JUW:()=>Ry,GtP:()=>fm,_kX:()=>Ma,u1e:()=>$a,sJj:()=>Bh,CJp:()=>dm,uKF:()=>Yh,wo0:()=>Ly,s5:()=>Mo,cwx:()=>Fo,Y6b:()=>ey,TTx:()=>Gy,UtR:()=>ty,HaQ:()=>Wy,E6I:()=>wy,Won:()=>ny,vTU:()=>zd,Nsy:()=>td,KMQ:()=>Qh,Do$:()=>ad,CSV:()=>Cs,TMe:()=>ry,l1V:()=>hu,VQ1:()=>gu,z7d:()=>LT,Xaq:()=>Xo,Sj8:()=>i_,PJj:()=>Sl,k3T:()=>Zr,PjQ:()=>Pi,s7l:()=>_c,GGR:()=>ST,j5q:()=>RT,DnY:()=>Oc,RY5:()=>WT,Px$:()=>cT,KPC:()=>Cg,NIY:()=>Sc,HvW:()=>Nc,Fof:()=>Ba,BTI:()=>sd,uie:()=>Jp,ChB:()=>Bp,q27:()=>Td,fAQ:()=>ef,XkT:()=>bc,lrH:()=>tf,nt9:()=>qr,XH8:()=>cd,XH2:()=>zr,jFi:()=>ud,qhs:()=>_o,wwR:()=>od,Uk3:()=>ot,ev7:()=>kg,RB9:()=>gy,iFp:()=>cE,e$p:()=>dE,PcX:()=>yE,SpP:()=>pE,R6_:()=>uO,CY1:()=>mO,Ajk:()=>Tc,Yiz:()=>fc,FK9:()=>lc,UOo:()=>Zh,aTW:()=>Vy,uug:()=>$l,P$2:()=>OO,XS2:()=>Cl,Hyb:()=>zl,d3Y:()=>ic,Klp:()=>oc,WxZ:()=>vO,Gzu:()=>mu,ZOr:()=>hc,uqV:()=>Kd,Pm4:()=>re,nVD:()=>BT,dED:()=>ly,P2h:()=>sy,jrr:()=>no,mmY:()=>ao,T6O:()=>Ko,h6J:()=>wp,hM2:()=>Pg,XR6:()=>X,jmz:()=>HT,IHt:()=>QT,NZI:()=>NE,wdF:()=>zy,kgP:()=>Zy,ZYI:()=>pp,QXK:()=>hl,efz:()=>bl,Q5d:()=>ml,Ysv:()=>Ol,UWq:()=>kT,ocC:()=>DT,io3:()=>Kr,Sbt:()=>Ro,roS:()=>No,Ww1:()=>Po,QaS:()=>Uc,ERZ:()=>Tg,CL1:()=>Sg,idV:()=>Gp,nIW:()=>rt,fjE:()=>cO,sG0:()=>eb,tV7:()=>wl,g8o:()=>BO,Qy:()=>YO,t2P:()=>oO,wId:()=>To,LS0:()=>Eo,bFH:()=>kd,Rgl:()=>Fd,fW1:()=>zE,Ywp:()=>Fb,pg:()=>bd,WSA:()=>Md,fed:()=>Ng,tT_:()=>As,KbL:()=>gc,JBA:()=>ut,aNC:()=>Ub,RFJ:()=>cp,Zeh:()=>bf,OT5:()=>xb,mC3:()=>dl,kR6:()=>a_,NVY:()=>eE,k6v:()=>hp,FEC:()=>bp,Ob5:()=>Ed,KUV:()=>md,dvH:()=>ZT,V3i:()=>eh,VD3:()=>Jr,mm2:()=>vu,rou:()=>uf,izH:()=>Va,DK$:()=>Wa,KMp:()=>tp,c31:()=>Bt,mbo:()=>_E,gT8:()=>Ht,CZ8:()=>os,uGi:()=>ds,Poc:()=>Wt,_9k:()=>Ts,ZTM:()=>cs,bwT:()=>ys,tzW:()=>Jt,tF$:()=>Qt,o96:()=>ss,M4S:()=>fs,_vs:()=>Hc,xF8:()=>yT,HQx:()=>Kh,ATu:()=>gE,j1S:()=>_i,V3K:()=>vi,Lmx:()=>gi,ZaZ:()=>Yt,n_1:()=>Xd,N6e:()=>zc,SxO:()=>io,w3p:()=>tE,xU7:()=>pe,Y_p:()=>Io,$k6:()=>wo,Gdl:()=>rb,U6P:()=>tb,OwB:()=>lO,hTh:()=>qT,xqc:()=>$o,JvE:()=>Vo,i29:()=>Gu,dzT:()=>$i,uPS:()=>jc,cZV:()=>Lc,n3B:()=>_v,e6O:()=>mv,s7j:()=>MO,j$Q:()=>Py,kW2:()=>ym,tH7:()=>xo,Yxg:()=>xs,MaZ:()=>PT,nqN:()=>NT,jWj:()=>FT,o_J:()=>zo,hgZ:()=>qp,yW4:()=>Ip,uT0:()=>Pp,C82:()=>Sp,u9Z:()=>lf,J$m:()=>Jd,j_Q:()=>cc,OaI:()=>pc,wB1:()=>jg,SP6:()=>hd,ZYr:()=>Ug,IMU:()=>up,FoU:()=>Ay,DVz:()=>sb,mxe:()=>vv,FHr:()=>mf,D1g:()=>cf,VO3:()=>qb,de5:()=>Bb,Uw1:()=>Te,J6q:()=>AE,XCe:()=>eo,Ir:()=>co,XQO:()=>po,QXb:()=>wd,P8_:()=>qy,iiD:()=>ep,MOC:()=>Id,WF:()=>Sd,xE1:()=>Ri,idW:()=>Hg,QWZ:()=>Jh,YL3:()=>wc,Fn9:()=>T,j2U:()=>Ss,MpE:()=>Xt,kQw:()=>ir,mfm:()=>Zl,vZp:()=>st,E8K:()=>Wg,VSb:()=>is,vr_:()=>nr,Vmh:()=>e_,FgW:()=>Zm,oDv:()=>es,kuw:()=>rs,eHk:()=>xT,Tt2:()=>Zo,T6Y:()=>wr,_26:()=>Kl,YkM:()=>dr,J6y:()=>Dl,njU:()=>Wl,TBP:()=>ts,IT0:()=>PE,x_:()=>qh,biM:()=>nd,TMl:()=>id,Vkd:()=>ql,WiY:()=>fO,_zi:()=>Ql,J6D:()=>Ou,Lt4:()=>_r,QEi:()=>Er,whI:()=>Wr,KIu:()=>Br,JhM:()=>oe,C_0:()=>Cr,qIF:()=>Av,O27:()=>E,aBi:()=>fd,xOX:()=>Gs,EdS:()=>ze,WgC:()=>Xe,eEv:()=>er,A4t:()=>Yl,YOQ:()=>lt,Wos:()=>Pr,jWr:()=>ka,Or$:()=>pr,lhE:()=>Hr,CwH:()=>Tr,pzC:()=>Ms,ymH:()=>Gl,QZu:()=>ur,rYH:()=>yO,FVt:()=>Rr,Kn2:()=>ue,jgw:()=>eu,OXP:()=>ns,lS4:()=>mr,g5f:()=>TO,fp6:()=>Fl,Uty:()=>ea,YkG:()=>cr,xdS:()=>Kt,kMF:()=>Mf,$NE:()=>Ze,bC9:()=>Je,KVV:()=>Wh,q9e:()=>So,iIf:()=>nb,ian:()=>qs,m6e:()=>Lr,OFd:()=>$s,kqr:()=>ar,fnZ:()=>Gr,VFZ:()=>Qs,ZiX:()=>qe,j5n:()=>Ar,zkt:()=>_,Pcm:()=>Lg,QDV:()=>Fs,M5u:()=>dO,laD:()=>gv,mtq:()=>Zt,CtB:()=>ib,CBv:()=>ae,I0t:()=>Ur,u1G:()=>UT,gk1:()=>bv,Bgb:()=>hv,uzs:()=>Yr,v0l:()=>Nu,Zqp:()=>iy,j0k:()=>Do,tCm:()=>it,gmx:()=>Ll,mOr:()=>cu,TwZ:()=>qO,GyU:()=>jb,zGm:()=>gd,bMg:()=>Wd,EyD:()=>bb,FQA:()=>Ob,fZN:()=>qd,xsF:()=>mb,Lxg:()=>hb,O3l:()=>Mc,Wni:()=>Fc,wRx:()=>Pb,OxG:()=>Ld,uJQ:()=>Cd,qWg:()=>ob,i96:()=>Od,zhn:()=>Rb,G8q:()=>bi,Jct:()=>iT,A9Y:()=>te,Y5F:()=>sg,gxP:()=>le,c$P:()=>jl,M7o:()=>zu,BBN:()=>ro,ZBU:()=>J,UkJ:()=>mo,xkv:()=>By,z$M:()=>Kg,KAm:()=>vy,lCl:()=>If,rkF:()=>qE,IU6:()=>Fp,RGr:()=>h,aYu:()=>m,ije:()=>Pl,Buf:()=>Zc,YLu:()=>Rl,ct9:()=>Co,XkY:()=>Yd,T5R:()=>_d,uQS:()=>Qd,wcJ:()=>Uo,d$I:()=>nl,rSp:()=>rd,Sx:()=>Pc,Ilm:()=>pl,Ki6:()=>Ys,VGk:()=>Kc,sFD:()=>Im,eWN:()=>Xg,dWE:()=>FO,Lkd:()=>Hf,aDL:()=>vf,yaA:()=>Hd,lOh:()=>df,DBr:()=>nO,hK$:()=>Il,TZ_:()=>xp,CMB:()=>Nv,FU8:()=>Rc,J$p:()=>Nf,b5s:()=>Af,h2W:()=>nt,SL_:()=>af,oUH:()=>Ap,ck9:()=>Ad,Xs0:()=>Nl,u7I:()=>pf,rxg:()=>iu,bji:()=>au,oCZ:()=>VE,MjG:()=>Yb,FuV:()=>_p,$ju:()=>Rp,t6d:()=>Np,m5F:()=>fe,sx:()=>zg,rSc:()=>ub,U10:()=>dc,L8n:()=>ky,R9X:()=>Zd,rj2:()=>Ky,_C4:()=>jp,tCj:()=>Qy,uAg:()=>yy,wx9:()=>TT,KF3:()=>Dp,ax9:()=>kp,HH7:()=>Xc,_6y:()=>kc,AJo:()=>Cc,Ixr:()=>Sy,P6Y:()=>c_,Bd_:()=>xE,xkB:()=>kE,W41:()=>sf,WkI:()=>of,sSE:()=>DE,GMd:()=>Fu,Bxm:()=>ME,FVh:()=>IE,U_T:()=>$d,FTe:()=>ie,VGB:()=>ne,Wfe:()=>fu,Ls5:()=>yu,$bd:()=>su});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,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>H,getStartOfDay:()=>P,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>_e,compareActivenessAttributes:()=>ve,compareAttributes:()=>be,compareImages:()=>Oe,compareRoles:()=>Ne,compareTags:()=>Ae});var o={};r.r(o),r.d(o,{addAttribute:()=>Se,editAttribute:()=>we,editEndDate:()=>De,editRoles:()=>Ce,editStartDate:()=>je,editTags:()=>Le,removeAttribute:()=>Ue});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Fe});var l=r(17440);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);return new Date(t.getTime()+60*t.getTimezoneOffset()*1e3)},N=e=>{const t=new Date(e);return new Date(t.getTime()-60*t.getTimezoneOffset()*1e3)},R=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),P=R("startOf"),S=R("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"),L=(0,l.equals)("99"),j=(0,l.equals)("9999"),D=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),x=(0,l.test)(/^9+$/),F=(0,l.test)(/^[9az]+$/),M=(0,l.cond)([[C,(0,l.always)("M")],[L,(0,l.always)("MM")],[D,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[F,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[L,(0,l.always)("DD")],[F,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[j,(0,l.always)("YYYY")],[x,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),L),(0,l.always)("hh")],[C,(0,l.always)("H")],[L,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[L,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),Y=(0,l.cond)([[C,(0,l.always)("s")],[L,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),B=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(B)];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)("",[M(e),r,$(n),i,V(a),o])}return e},Q=/(9+)([^9]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(Q)];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,[G(e,s),r,W(n),i,a?Y(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)} ${H(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?Z.None():Z.Some(t(e))}),Z={Some:z,None:()=>z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},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=>(e=(e||"").toLowerCase(),oe(e)?`mailto:${e}`:!e.includes("://")&&(e.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},pe=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.prop)(e)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,(0,l.always)(e)]])(e)},de=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)},ye=/[\n\r%#()<>?[\\\]^`{}|]/g,fe=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(ye,encodeURIComponent)}`,Te=e=>`data:image/gif;base64,${e}`;function Ee(e){return e&&void 0!==e.uri}function me(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function he(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 be(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(be(d.value,y.value,r)):"Reference"===g(d)?he(d,y)?o.push.apply(o,be(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Oe(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||Ee(r)&&Ee(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function ve(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function ge(e,t){var r="configuration/sources/Reltio";function n(e,t){return e.crosswalk={type:t.type,value:t.value},e}function i(e){return e.removeIt=!0}var a=e.map((function(e){if(e.crosswalk)return[e];var i=t.filter((function(t){return 1===(t.attributes||t.attributeURIs||[]).filter((function(t){return t===e.uri})).length})),a=i.filter((function(e){return e.type===r})),o=i.filter((function(e){return e.type!==r})),s=[];switch(e.type){case"INSERT_ATTRIBUTE":s.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":s=s.concat(i.map((function(t){return n(e,t)})));break;case"DELETE_ATTRIBUTE":(o.length||0==a.length)&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),s=s.concat(a.map((function(t){return n({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":a.length?s=s.concat(a.map((function(t){return n({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)}))):s.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0}),o.length&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}})}return s})),o=[].concat.apply([],a),s=function(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}(o,"typeUri");for(var l in s)if("undefined"!==l){var u=s[l],c=o.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===l||"INSERT_ATTRIBUTE"===e.type&&e.uri===l})),p=u.filter((function(e){return e.crosswalk&&e.crosswalk.type===r}))[0];!c.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0]&&p&&(o.push({type:"UPDATE_ATTRIBUTE",uri:p.uri,newValue:{value:p.value},crosswalk:p.crosswalk}),c.forEach(i)),u.forEach(i)}return(o=o.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),o}function _e(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function Ae(e,t){return me("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return me("UPDATE_ROLES").call(this,e,t)}function Re(e,t,r,n){var i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Pe(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Re(r[i],r[i+1],e,t));return n}function Se(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Pe(r,t)[a];if(s.hasChildren){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Se(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function we(e,t,r,n,i,a){void 0===a&&(a=0);var o=Pe(r,t)[a];if(!o.hasChildren){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Ie(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Ie.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Se(e,t,r,n,i,a),s}var c=we(e,o,o.valueUri,{},i,a);we(c,t,r,n,i,a+1)}function Ie(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ue(e,t,r,n){void 0===n&&(n=0);var i=Pe(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ue(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function Ce(e,t){e.roles=t||[]}function Le(e,t){e.tags=t||[]}function je(e,t){e.startDate=t||""}function De(e,t){e.endDate=t||""}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){xe(e,t,r[t])}))}return e}function xe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Fe=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=ke({},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:ke({},n,{roles:s,tags:u}),roles:i,tags:l}}}},Me=r(76665);const $e="1Tempo4rary",Ve="1Tepmo4Rel",Ge=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),We=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Ye=e=>()=>We(e),Be=(e,t)=>{const r=Ge(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return We(n)},qe=e=>e&&e.includes("uri$$"),Qe=Ye("entities"),He=Ye("relations"),Ke=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Xe=(0,l.startsWith)("entities/"),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),et=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),tt=(0,l.pipe)((0,l.split)("/"),l.head),rt=(0,l.pipe)((0,l.split)("/"),l.last),nt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},it=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),at=(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("/")},ot=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},st=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),lt=e=>5===e.split("/").length,ut=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ct=e=>e.replace(/uri\$\$/g,$e);let pt,dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Rt,Pt,St,wt,It,Ut,Ct,Lt,jt,Dt,kt,xt,Ft;var Mt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(pt||(pt={})),function(e){e.local="local",e.validationService="validationService"}(dt||(dt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(yt||(yt={})),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"}(ft||(ft={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Tt||(Tt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(Et||(Et={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(mt||(mt={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(ht||(ht={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(bt||(bt={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Ot||(Ot={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(vt||(vt={})),function(e){e.PROFILE="profile",e.MAP="map"}(gt||(gt={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(_t||(_t={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(At||(At={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Nt||(Nt={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Rt||(Rt={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(Pt||(Pt={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(St||(St={})),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"}(wt||(wt={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(It||(It={})),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"}(Ut||(Ut={})),function(e){e.IN="in",e.OUT="out"}(Ct||(Ct={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Lt||(Lt={})),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"}(jt||(jt={})),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"}(Dt||(Dt={})),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.SingleAttributeView="com.reltio.plugins.entity.attributes.SingleAttributeView",e.TableAttributeView="com.reltio.plugins.entity.attributes.AttributeTableView",e.CustomView="com.reltio.plugins.ui.CustomActionView",e.MapView="com.reltio.plugins.react.EntityMapView",e.ImageAttributeView="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatchesView="com.reltio.plugins.entity.PotentialMatchesView"}(kt||(kt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(xt||(xt={})),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.Search="SearchView"}(Ft||(Ft={})),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"}(Mt||(Mt={}));const $t=Mt;let Vt,Gt;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Vt||(Vt={})),function(e){e.Saving="Saving"}(Gt||(Gt={}));const Wt=(0,l.prop)("referencedEntityTypeURI"),Yt=(0,l.prop)("relationshipTypeURI"),Bt=(0,l.prop)("referencedAttributeURIs"),qt=(0,l.curry)(((e,t)=>(0,l.pipe)(Bt,(0,l.filter)((0,l.startsWith)(e)))(t))),Qt=qt("configuration/relationTypes"),Ht=qt("configuration/entityTypes"),Kt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),Jt=(0,l.filter)(Kt),Xt=(e,t)=>!t||t.some((t=>t===e.uri));function zt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,ze),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",$t.TYPE_STRING),(0,l.propEq)("type",$t.TYPE_BLOB))]),er=(0,l.has)("values"),tr=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)($t.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)($t.TYPE_LOOKUP)],[er,(0,l.always)($t.TYPE_ENUM)],[Zt,(0,l.always)($t.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",$t.TYPE_BOOLEAN),(0,l.always)($t.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),rr=(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){zt(e,t,r[t])}))}return e}({},e,{type:tr(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),nr=e=>!!e&&(!!e.autoGenerated&&e.type!==$t.TYPE_NESTED||!!e.parentAutoGenerated),ir=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),ar=(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),or=e=>ir(e)?"analyticsAttributes":"attributes",sr=(0,l.propEq)("hidden",!0),lr=(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))),ur=lr($t.TYPE_NESTED),cr=lr($t.TYPE_REFERENCE),pr=lr($t.TYPE_IMAGE),dr=(0,l.either)(ur,cr),yr=(e,t)=>{const r=ir(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(".")},fr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Tr=(0,l.pipe)(fr,Boolean),Er=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),mr=(0,l.both)(Tr,(0,l.pipe)(fr,("rdm",(0,l.pipe)(tt,(0,l.equals)("rdm")))));const hr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=or({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]||Or(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:[]},br=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=hr(e,t,r);return n.length?(0,l.last)(n):null},Or=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",$t.TYPE_NESTED),(0,l.propEq)("type",$t.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",$t.TYPE_REFERENCE),(0,l.pipe)(Bt,(0,l.map)((t=>br(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},vr=[$t.TYPE_ACTIVENESS_DATE,$t.TYPE_DATE,$t.TYPE_TIMESTAMP,$t.TYPE_LOCAL_DATE],gr=[$t.TYPE_ACTIVENESS_DATE,$t.TYPE_TIMESTAMP,$t.TYPE_LOCAL_DATE],_r=e=>vr.includes(e),Ar=e=>gr.includes(e),Nr=[$t.TYPE_INT,$t.TYPE_LONG,$t.TYPE_NUMBER,$t.TYPE_FLOAT,$t.TYPE_DOUBLE,$t.TYPE_COUNT],Rr=e=>Nr.includes(e),Pr=e=>[$t.TYPE_FLOAT,$t.TYPE_DOUBLE].includes(e),Sr=[$t.TYPE_BOOLEAN,$t.TYPE_BOOLEAN_RADIO,$t.TYPE_RDM_LOOKUPS_NOT_RESOLVED],wr=e=>Sr.includes(e),Ir=[$t.TYPE_URL,$t.TYPE_BLOG_URL,$t.TYPE_IMAGE_URL],Ur=e=>Ir.includes(e),Cr=lr($t.TYPE_EMAIL),Lr=e=>$t.TYPE_SSN===e;var jr,Dr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(jr||(jr={}));const kr=(0,l.curry)(((e,t,r)=>{var n;const i=e===jr.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)))})),xr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Fr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),xr),Mr=(0,l.pipe)((0,l.reject)(E),Fr),$r=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),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("?")?"&":"?")+xr(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f}},Vr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Gr=(0,l.equals)(Vr.SUGGESTING),Wr=(0,l.equals)(Vr.EDITING),Yr=(0,l.equals)(Vr.VIEWING),Br=(0,l.either)(Wr,Gr),qr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Qr=(0,l.curry)(((e,t)=>(0,l.pipe)(qr(e),(0,l.prop)("extendsTypeURI"))(t))),Hr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Qr(e,r)));return n(r)})),Kr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Qr(e,n);return r})),Jr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Jr(e,qr(e,t.extendsTypeURI),r):void 0,Xr=(e,t)=>{const r=t.map(Kr(e));return(r.length?r.reduce(l.intersection):[])[0]},zr=(e,t)=>Jr(e,(0,l.is)(Object,t)?t:qr(e,t),"typeImage"),Zr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Hr(e,t,n.uri)?r.concat(n.uri):r),[]),en={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"},tn={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},rn={[en.EQUALS]:"equals",[en.NOT_EQUALS]:"not",[en.STARTS_WITH]:"starts with",[en.MISSING_VALUE]:"missing value",[en.IN_RANGE]:"in range",[en.HAS_ALL]:"has all",[en.FULL_TEXT]:"full text",[en.EXISTS]:"exists",[en.COUNT_EQUALS]:"count equals",[en.COUNT_NOT_EQUALS]:"count not equal",[en.COUNT_LT]:"count less",[en.COUNT_LTE]:"count less or equal",[en.COUNT_GT]:"count greater",[en.COUNT_GTE]:"count greater or equal",[en.COUNT_RANGE]:"count in range",[en.LT]:"less than",[en.LTE]:"less than or equal",[en.GT]:"greater than",[en.GTE]:"greater than or equal",[en.IN_FILE]:"in file",[en.NOT_IN_FILE]:"not in file",[en.CONTAINS]:"contains",[en.ON]:"on",[en.BEFORE]:"before",[en.AFTER]:"after",[en.WITHIN]:"within"},nn="in",an="notIn",on="not range",sn=e=>({[nn]:en.EQUALS,[an]:en.NOT_EQUALS}[e]||e),ln={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},un={[ln.LAST_DAY]:"Last 24 hours",[ln.LAST_3DAYS]:"Last 3 days",[ln.LAST_WEEK]:"Last week",[ln.LAST_MONTH]:"Last month",[ln.LAST_YEAR]:"Last year",[ln.PICK_DATE]:"Pick date"},cn={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},pn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},dn="<No label>",yn={IN:"in",OUT:"out"};var fn=r(87918),Tn=r.n(fn);function En(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){mn(e,t,r[t])}))}return e}function mn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hn={startDate:{type:$t.TYPE_ACTIVENESS_DATE,get label(){return Tn().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:$t.TYPE_ACTIVENESS_DATE,get label(){return Tn().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},bn=En({id:{type:$t.TYPE_ENTITY_ID,get label(){return Tn().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},hn,{roles:{type:$t.TYPE_STRING,get label(){return Tn().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:$t.TYPE_STRING,get label(){return Tn().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),On={workflow:{type:$t.TYPE_STRING,get label(){return Tn().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:$t.TYPE_STRING,get label(){return Tn().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:$t.TYPE_STRING,get label(){return Tn().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},vn={commenter:{type:$t.TYPE_STRING,get label(){return Tn().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},gn={notResolved:{type:$t.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return Tn().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},_n={createdBy:{type:$t.TYPE_STRING,get label(){return Tn().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:$t.TYPE_STRING,get label(){return Tn().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},An={matches:{type:$t.TYPE_COUNT,get label(){return Tn().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:$t.TYPE_COUNT,get label(){return Tn().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Nn={sourceSystems:{type:$t.TYPE_STRING,get label(){return Tn().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:$t.TYPE_STRING,get label(){return Tn().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:$t.TYPE_INT,get label(){return Tn().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:$t.TYPE_TIMESTAMP,get label(){return Tn().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:$t.TYPE_STRING,get label(){return Tn().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Rn={matchRules:{type:$t.TYPE_STRING,get label(){return Tn().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:$t.TYPE_STRING,get label(){return Tn().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Pn=En({},bn,On,vn,gn,_n,An,Nn,Rn,{type:{type:$t.TYPE_STRING,get label(){return Tn().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var Sn=r(13980),wn=r.n(Sn);function In(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){Un(e,t,r[t])}))}return e}function Un(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cn=wn().oneOf(["mobile","tablet","desktop"]),Ln=wn().shape({deviceTypes:wn().oneOfType([Cn,wn().arrayOf(Cn)]),roles:wn().arrayOf(wn().string)}),jn=wn().shape({value:wn().string,lookupCode:wn().string}),Dn=wn().shape({link:wn().string,filename:wn().string}),kn=wn().shape({displayName:wn().string,parent:wn().string}),xn=wn().oneOfType([wn().string,wn().number,wn().bool,jn]),Fn=wn().oneOfType([xn,wn().arrayOf(xn)]),Mn=wn().shape({fieldName:wn().string,values:wn().arrayOf(Fn),filter:wn().string,type:wn().string}),$n=wn().shape({minValue:wn().number,maxValue:wn().number}),Vn=wn().shape({label:wn().string,name:wn().string,description:wn().string,type:wn().string,hidden:wn().bool,faceted:wn().bool,searchable:wn().bool,uri:wn().string,access:wn().arrayOf(wn().string),cardinality:$n}),Gn=wn().shape({label:wn().string,uri:wn().string,typeColor:wn().string,direction:wn().string,startObject:wn().object,endObject:wn().object}),Wn=wn().shape({typeColor:wn().string,typeIcon:wn().string,typeImage:wn().string,label:wn().string,uri:wn().string,attributes:wn().arrayOf(Vn)}),Yn=wn().shape({uri:wn().string,label:wn().string,memberTypes:wn().array,extendsTypeUri:wn().string,attributes:wn().arrayOf(Vn)}),Bn=wn().shape({uri:wn().string,label:wn().string,extendsTypeUri:wn().string,relationshipTypeURIs:wn().arrayOf(wn().string)}),qn=wn().shape({uri:wn().string,description:wn().string,label:wn().string,schemaVersion:wn().string,entityTypes:wn().arrayOf(Wn),roles:wn().arrayOf(wn().object),groupTypes:wn().arrayOf(wn().object),relationTypes:wn().arrayOf(Gn),graphTypes:wn().arrayOf(Bn),interactionTypes:wn().arrayOf(Yn),sources:wn().arrayOf(wn().object)}),Qn=wn().shape({uri:wn().string,type:wn().string}),Hn=wn().shape({uri:wn().string,attributes:wn().object,type:wn().string,timestamp:wn().number,members:wn().object}),Kn=wn().shape({uri:wn().string,type:wn().string}),Jn=wn().shape({value:wn().object,ov:wn().bool,type:wn().string,uri:wn().string}),Xn=wn().shape({refEntity:wn().oneOfType([wn().array,wn().object]),refRelation:wn().oneOfType([wn().array,wn().object]),value:wn().object,ov:wn().bool,type:wn().string,uri:wn().string}),zn=wn().oneOf((0,l.values)(Vr)),Zn=wn().shape({type:wn().oneOf(Object.values(pt)).isRequired,attributeTypeUri:wn().string.isRequired,parentUri:wn().string.isRequired,uri:wn().string,message:wn().string}),ei={attributeType:Vn,showEmptyEditors:wn().bool,lazy:wn().bool,mode:zn,metadata:qn,ownError:Zn,errors:wn().arrayOf(Zn),crosswalks:wn().array,onAddAttributes:wn().func,onAddOneMore:wn().func,onDeleteAttribute:wn().func,onChangeAttribute:wn().func,additionalControlsRenderer:wn().func,hideDeleteButton:wn().bool,showNonOv:wn().bool,state:wn().oneOf(["deleted","edited"])},ti=In({attributeValue:Jn},ei),ri=In({attributeValue:Xn},ei),ni=wn().shape({value:wn().oneOfType([wn().string,wn().bool,wn().number]),ov:wn().bool,type:wn().string,uri:wn().string,lookupCode:wn().string,lookupRawValue:wn().string}),ii=wn().shape({totalOvValues:wn().number,totalValues:wn().number}),ai=wn().shape({inRelations:wn().arrayOf(wn().oneOfType([wn().object,wn().string])),outRelations:wn().arrayOf(wn().oneOfType([wn().object,wn().string])),groups:wn().arrayOf(wn().string),entityTypes:wn().arrayOf(wn().string),nextEntry:wn().object}),oi=wn().oneOf(["asc","desc"]),si=wn().shape({id:wn().string,content:ai,allowOnlyCreateNew:wn().bool,sortColumn:wn().string,sortOrder:oi,"text-empty":wn().string,max:wn().number,icon:wn().string,caption:wn().string,canCreate:Ln,canRead:Ln,canUpdate:Ln,canDelete:Ln,editingEnabled:wn().bool}),li=wn().shape({id:wn().string,graph:wn().shape({type:wn().string,layout:wn().number,deep:wn().number,limit:wn().number,uri:wn().string,options:wn().shape({reverseRelations:wn().bool})}),sortBy:wn().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:oi,max:wn().number,icon:wn().string,caption:wn().string,canCreate:Ln,canRead:Ln,canUpdate:Ln,canDelete:Ln}),ui=wn().shape({id:wn().string,caption:wn().string,pageSize:wn().number,icon:wn().string,canCreate:Ln,canRead:Ln,canUpdate:Ln,canDelete:Ln,attributes:wn().object}),ci=wn().shape({entityUri:wn().string,entityType:wn().string,entityLabel:wn().string,object:Qn}),pi=wn().shape({relationUri:wn().string,relationType:wn().string,relationLabel:wn().string,direction:wn().string,object:Kn}),di=wn().shape({entity:ci,relation:pi}),yi=wn().shape({value:wn().string,isRawFilter:wn().bool}),fi=wn().shape({id:wn().string,label:wn().string,name:wn().string,availableEntityTypes:wn().array}),Ti=wn().shape({id:wn().string,allowMergeAll:wn().bool,matchActions:wn().object,availableTabs:wn().arrayOf(wn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),Ei=wn().shape({matchRules:wn().arrayOf(wn().string),object:Qn,shortestTransitiveMatchPath:wn().arrayOf(wn().shape({matchRules:wn().arrayOf(wn().string),match:wn().string})),direct:wn().bool,matchScore:wn().number}),mi=wn().arrayOf(Ei),hi=wn().arrayOf(wn().shape({uri:wn().string,label:wn().string})),bi=[{label:Tn().text("And"),value:"and"},{label:Tn().text("Or"),value:"or"},{label:Tn().text("And not"),value:"and not"},{label:Tn().text("Or not"),value:"or not"}];function Oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),gi=(0,l.pipe)(vi,(0,l.propOr)("","label")),_i=(0,l.curry)(((e,t)=>{const r=vi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Ai=(0,l.curry)(((e,t,r)=>{const[n,i]=_i(e,r);return Hr(e,n,t)||Hr(e,i,t)})),Ni=(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){Oi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ri=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?yn.OUT:yn.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(yn.IN),i=r(yn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Pi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Si={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},wi=(0,l.curry)(((e,t)=>e.every((e=>Ii(e,t))))),Ii=(0,l.curry)(((e,t)=>{const r=nr(t);return!t||(!t.access||t.access.includes(e))&&(e===Si.READ||!r)})),Ui=(0,l.curry)(((e,t,r)=>Ii(Si.READ,r)&&(Gr(t)?Ii(Si.INITIATE_CHANGE_REQUEST,r):Ii(e,r)))),Ci=Ui(Si.CREATE),Li=Ui(Si.DELETE),ji=Ui(Si.UPDATE),Di=wi([Si.CREATE,Si.MERGE,Si.READ,Si.UPDATE]),ki=wi([Si.UPDATE,Si.READ,Si.CREATE]),xi=wi([Si.UPDATE,Si.READ]),Fi=wi([Si.DELETE,Si.UPDATE,Si.READ]),Mi=(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["*"])),$i=(e,t,r)=>(0,l.pipe)((0,l.map)(Mi(e,t)),(0,l.filter)(l.identity))(r),Vi=(e,t,r)=>{const n=$i(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ii(Si.MERGE,r)},Gi=(0,l.curry)(((e,t,r,n)=>{const i=vi(e,n),[a,o]=_i(e,n);return i&&Ii(Si.CREATE,i)&&Hr(e,a,t.type)&&Hr(e,o,r.type)})),Wi=(e,t,r,n,i)=>{const a=qr(e,n.type),o=$i(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(Gi(e,n,i))||a.some(Gi(e,i,n))}))},Yi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=qr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Vi(o,i,a),canAddRelation:Wi(e,o,i,r,n),canMark:Ii(Si.UPDATE,a)&&Ii(Si.READ,a)}},Bi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Yi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),qi=ir,Qi=(0,l.complement)(qi),Hi=Ii(Si.READ),Ki=e=>{let{attributeType:t,mode:r}=e;return Qi(t)&&Ci(r,t)&&!sr(t)},Ji=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=qe(r.uri),o=ji(n),s=Ci(n);return(0,l.cond)([[qi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Xi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=qe(r.uri),s=ji(n),u=Li(n),c=Zi(Si.UPDATE,n,a,r),p=Zi(Si.DELETE,n,a,r);return(0,l.cond)([[qi,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)},zi=(0,l.curry)(((e,t,r,n)=>{const i=Or(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=>!Ii(e,n)||!zi(e,t,r[n.name],n)))))})),Zi=(0,l.curry)(((e,t,r,n,i)=>Gr(t)?zi(Si.INITIATE_CHANGE_REQUEST,r,n,i):zi(e,r,n,i))),ea=(0,l.both)((0,l.complement)(sr),Hi),ta="SuperUser",ra="allTenants",na=[ra,"allCustomers"],ia=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;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===ta})).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===ta){const e=r?na.concat(r.map((e=>`allTenants.${e}`))):na,n=r&&t[0]===ra?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}))},aa={NON_SECURED:"NON_SECURED",SECURED:"SECURED",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},oa={[aa.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[aa.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[aa.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[aa.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[aa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[aa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[aa.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[aa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[aa.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[aa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[aa.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[aa.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[aa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[aa.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[aa.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[aa.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[aa.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[aa.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[aa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[aa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[aa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[aa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[aa.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[aa.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[aa.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[aa.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[aa.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[aa.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[aa.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[aa.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},sa=(0,l.curry)(((e,t,r)=>ia({allowedPermissionsNames:e,permissionsNames:aa,permissionsConfig:oa}).some((e=>e(t,{params:{tenant:r}}))))),la=sa([aa.CAN_EXPORT]),ua=sa([aa.CAN_EXPORT_ACTIVITIES]),ca=sa([aa.CAN_IMPORT_ENTITIES_FROM_DT]),pa=sa([aa.CAN_READ_ENTITIES_FROM_DT]),da=sa([aa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ya=sa([aa.CAN_UPDATE_PROCESS_INSTANCE]),fa=sa([aa.CAN_VIEW_WORKFLOW_DEFINITION]),Ta=sa([aa.CAN_CONFIG_ENVIRONMENT_REGISTER]),Ea=sa([aa.CAN_UPDATE_WORKFLOW_DATA_TASK]),ma=sa([aa.CAN_READ_WORKFLOW_DATA_TASK]),ha=sa([aa.CAN_MANAGE_WORKFLOW_DEFINITION]),ba=sa([aa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Oa=sa([aa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),va=sa([aa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),ga=sa([aa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),_a=sa([aa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Aa=sa([aa.CAN_EXECUTE_WORKFLOW_JOBS]),Na=sa([aa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ra=sa([aa.CAN_CREATE_CONFIG_JAR]),Pa=sa([aa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Sa=sa([aa.CAN_VIEW_CONFIG_JAR]),wa=sa([aa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Ia=sa([aa.CAN_VIEW_WORKFLOW_JOBS]),Ua=sa([aa.CAN_MAKE_BULK_UPDATE]),Ca=sa([aa.CAN_OPEN_DATA_LOADER_EXECUTE,aa.CAN_OPEN_DATA_LOADER_READ]),La=sa([aa.CAN_BULK_DELETE_PROFILES]),ja=sa([aa.CAN_READ_MDM_DATA_ENTITIES]),Da=sa([aa.CAN_READ_DVF]),ka=sa([aa.IS_FREEMIUM_ADMIN]),xa=(0,l.reject)(sr),Fa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),xa,(0,l.filter)(e))(t),Ma=(0,l.curry)(((e,t)=>Fa((t=>Ki({attributeType:t,mode:e})),t))),$a=(0,l.curry)(((e,t)=>Fa((t=>Ki({attributeType:t,mode:e})||ea(t)),t))),Va=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ea)),Ga=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ga(e)])))),Wa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ea),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Wa(e)])))),Ya=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Ya(e)])))),Ba=(0,l.pipe)(qr,(0,l.converge)(l.concat,[Wa,Ya]));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){Qa(e,t,r[t])}))}return e}function Qa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ha=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Ha(e)))},t))),Ka=e=>{var t;return qa({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Ja=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Xa=(0,l.when)(Ja,(0,l.dissoc)("values")),za=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return qa({},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})})),Za=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},eo=(0,Dr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Ga,t).concat((0,l.chain)(Ga,r)).some(Za)})),to=e=>{let t=!1;const r=Ha((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?qa({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},ro=e=>{const t=eo(e),r=(0,l.map)((e=>Ha((0,l.pipe)(Xa,(0,l.when)((0,l.always)(e),za))))(t)),n=(0,l.map)(Ka),i=(0,l.map)(to);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},no=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),io=(0,l.prop)("relationshipTypeURIs"),ao=(0,l.curry)(((e,t)=>e.graphTypes.filter(oo(e,t)))),oo=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(Ai(e,t))},so=(e,t)=>(0,l.pipe)(no,(0,l.defaultTo)({}),io,(0,l.defaultTo)([]),(0,l.chain)(_i(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(qr(e)))(e,t),lo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),uo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),co=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return uo((0,l.complement)(lo))(e)},po=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return uo(lo)(e)},yo=(0,l.pipe)(qr,(0,l.propOr)([],"matchGroups")),fo=(e,t,r)=>(0,l.pipe)(yo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),To=(0,l.curry)(((e,t,r)=>(0,l.pipe)(fo,(0,l.propOr)(r,"label"))(e,t,r))),Eo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(yo,(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]})),mo=e=>(0,l.partition)(lo,e),ho=(0,l.includes)(l.__,["and","or","not"]),bo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Oo=(0,l.includes)(l.__,["equals","notEquals","in"]),vo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return ho(t)?vo(r):bo(t)?r.filter(ze):Oo(t)?r.map((0,l.prop)("uri")).filter(ze):[]})),l.uniq),go=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(vo),l.uniq),_o=(0,l.pipe)(yo,go),Ao=(0,l.pipe)(Eo,go),No=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Ro=(0,l.pipe)(No,Wa),Po=(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||Hr(e,n,t)})(e,t))})(e,t)),So=e=>!!e.required,wo=(e,t,r)=>{const n=(0,l.cond)([[ze,qr(e)],[Ze,vi(e)]])(t);return Io(e,n,r)},Io=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&ze(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!nr(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===$t.TYPE_REFERENCE){const n=Yt(t),a=Bt(t);i=wo(e,n,r).filter((e=>a.some(et(e.uri))))}else t.attributes&&(i=Io(e,t,r));i&&n.push(...i)}return n})):t.type===$t.TYPE_REFERENCE?wo(e,Yt(t),r):[],Uo=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),So]),e.attributes||[])},Co=(e,t)=>{const r=Ht(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},Lo=(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)?Tn().text(n):n};return r(null,t)})),jo=["label","description","abbreviation","caption","toolTip"],Do=e=>Lo(jo,e),ko=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=rt(t);return r.find((e=>{let{uri:t}=e;return rt(t)===n}))})),xo=(0,l.curry)(((e,t)=>{const r=rt(t);return(0,l.pipe)(ko(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Fo=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"})},Mo=(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}))},$o=(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)})),Vo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=qr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Go(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wo(e,t,r[t])}))}return e}function Wo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return Bo(i,e,t,r,n)},Bo=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]:["attributes"];return Z.fromNull(e&&e.length?e:Or(t,r)).map((e=>e.map((e=>{const r=Yo(t,e,n,i);return r.length?Go({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(dr),(0,l.prop)("children"))).filter(ea).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},qo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Yo(e,t,r,["attributes","analyticsAttributes"])},Qo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Yo(e,t,r,["attributes"])},Ho=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Yo(e,t,r,["analyticsAttributes"])},Ko=(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)})),Jo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return rt(r)===e})))),Xo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Jo("LUD")),(0,l.defaultTo)(r))(t||[])},zo=(e,t)=>{let{survivorshipStrategies:r}=e;return Jo(t,r)},Zo=(0,l.allPass)([(0,l.complement)(l.isNil),Ii(Si.READ)]),es=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ii(Si.READ)]),ts=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ii(Si.CREATE)]),rs=(0,l.curryN)(2,(0,l.pipe)(qr,es)),ns=e=>{let{ov:t}=e;return!1!==t},is=(e,t)=>((e,t)=>Ur(e.type)&&ae(t))(e,t)||((e,t)=>Cr(e.type)&&oe(t))(e,t),as=(0,l.curry)(((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))),os=as("refEntity"),ss=as("refRelation"),ls=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],us=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},cs=(0,l.prop)("objectURI"),ps=(0,l.prop)("objectURI"),ds=(0,l.prop)("type"),ys=(0,l.pipe)(os,(0,l.defaultTo)({}),cs),fs=(0,l.pipe)(ss,(0,l.defaultTo)({}),ps),Ts=(0,l.pipe)(os,(0,l.defaultTo)({}),ds),Es=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},ms=(0,l.evolve)({refEntity:re,refRelation:re}),hs=(e,t,r,n)=>{const i=hr(e,r),a=qr(e,t.type)||vi(e,t.type);if(0===i.length)return null;const o=or(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!Xt(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=a.attributes.filter((e=>Yt(e)===r.uri||Wt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},bs=(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?bs(a.value,o):a},Os=(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 bs(e[r],i)})),vs=(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")]]),gs=(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.map)(vs),(0,l.when)((()=>i.length>0),(0,l.map)(gs(e,i))))(r)})),_s=gs(null),As=gs(ns),Ns=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=Os(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Rs=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ys,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Ps=Object.values(hn),Ss=(0,l.includes)(l.__,Ps),ws=e=>Ps.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Is(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){Us(e,t,r[t])}))}return e}function Us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cs=(e,t)=>`${e}_${t}`,Ls=[Pn.matches.name,Pn.matchRules.name],js=(0,l.values)(On).map((e=>e.name)),Ds=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,js)))),ks=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ls)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Cs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),xs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Ds(r),ks(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Cs(`dtPotentialMatches.${t.name}`,"")))))(Pn)},Fs=(0,l.propEq)("uri",Pn.type.uri),Ms=e=>(0,l.values)(Rn).some((0,l.propEq)("uri",e.uri)),$s=(0,l.propEq)("uri",Nn.sourceSystems.uri),Vs=Object.values(bn),Gs=(0,l.includes)(l.__,Vs),Ws=e=>{let{entity:t,attributeType:r,value:n}=e;return Is({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Ys=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Bs=e=>{let{entity:t,attributeType:r,value:n}=e;return Is({},t,{[r.uri]:n})},qs=(0,l.propEq)("uri",bn.roles.uri),Qs=(0,l.propEq)("uri",bn.tags.uri);function Hs(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 Js=e=>{let{parentUri:t,attributeType:r}=e;return Hs({uri:Be(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[dr,(0,l.always)({value:{}})],[Tr,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},Xs=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ma(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Er,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Js({parentUri:r,attributeType:e});let s=Or(n,e);s&&(e.type===$t.TYPE_REFERENCE&&(s=Jt(s)),a.value=Xs({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!Er(e)||(o[t]=[a])}return o},zs=e=>{let{entity:t,metadata:r}=e;return wo(r,t.type,!0).filter(Er).reduce(((e,t)=>{const n=t.name,i=ut(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:hs(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:el({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Zs=(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===$t.TYPE_NESTED?Hs({},e,{value:Zs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Hs({},s(t),Xs({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),el=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Js({parentUri:n,attributeType:r}),u=vs(l);return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},tl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,n.uri,vs(n),a,o,i)}))},rl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},nl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Me.ZP)(t,(e=>{Ue(e.attributes||e.value,r,n,i)}))},il=(0,l.either)((0,l.propSatisfies)((0,l.anyPass)([e=>""===e,l.isNil]),"value"),(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity"))),al=(0,l.reject)(il),ol=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=>ol({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),al)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},sl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ol({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),ms),deleteEmptyComplex:e})},ll=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(sl(e),(0,l.reject)(l.isEmpty))},ul=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Ss(r)?Ws({entity:e,attributeType:r}):el({entity:e,attributeType:r,parentUri:n,index:i})}),e))),cl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Ss(r)?Bs({entity:e,attributeType:r,value:i}):rl({entity:e,attributeType:r,uri:n,value:i})})),pl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Ss(r)?Ys({entity:e,attributeType:r}):nl({entity:e,attributeType:r,uri:n})})),dl=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)},yl="UrlThumbnail",fl="CdnUrlThumbnail",Tl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(ns):(0,l.head)(n);return e&&e.value}return null})),El=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Tl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),ml=El(["CdnUrl","Url"],!0),hl=El(["CdnUrlPreview","UrlPreview"],!0),bl=El([fl,yl],!0),Ol=El([fl,yl]),vl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[ar,(0,l.always)(t)],[(0,l.both)(ir,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=ar(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Ss(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=Va(e),i=(0,l.any)(r?l.T:ns);return vl(n,t,i)},_l=(e,t,r,n,i,a)=>{const o=qe(null==r?void 0:r.uri)?Ma(t,e):$a(t,e);return vl(o,r,((e,o)=>{const s=Ki({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:ns,e)||ar(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Al;const Nl=e=>{Al=e};function Rl(e,t){return Al(e,t)}const Pl=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)})),Sl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return Rl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},wl=(0,l.once)((()=>Rl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),Il=e=>Rl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Ul=(e,t)=>Rl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Cl=e=>Z.fromNull(rn[e]).map(Tn().text).orSome(""),Ll=(0,l.curry)(((e,t)=>`${e}_${t}`)),jl=(0,l.split)("_"),Dl=(0,l.includes)("_"),kl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),xl=(0,l.curry)(((e,t)=>e.some(kl(t)))),Fl=xl([en.IN_RANGE,en.COUNT_RANGE,en.WITHIN]),Ml=xl([en.EXISTS,en.MISSING_VALUE]),$l=(0,l.cond)([[Ml,(0,l.always)(0)],[Fl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),Vl=(0,l.complement)(Ml),Gl=xl([en.HAS_ALL,en.EQUALS,en.NOT_EQUALS]),Wl=xl([en.COUNT_EQUALS,en.COUNT_NOT_EQUALS,en.COUNT_LT,en.COUNT_LTE,en.COUNT_GT,en.COUNT_GTE,en.COUNT_RANGE]),Yl=xl([en.IN_FILE,en.NOT_IN_FILE]),Bl=e=>{switch(e){case en.COUNT_EQUALS:return en.EQUALS;case en.COUNT_NOT_EQUALS:return en.NOT_EQUALS;case en.COUNT_LT:return en.LT;case en.COUNT_LTE:return en.LTE;case en.COUNT_GT:return en.GT;case en.COUNT_GTE:return en.GTE;case en.COUNT_RANGE:return en.IN_RANGE}},ql=xl([en.ON,en.BEFORE,en.AFTER,en.WITHIN,en.NOT_EQUALS]),Ql=xl([en.WITHIN]),Hl=[[en.COUNT_EQUALS,en.COUNT_NOT_EQUALS,en.COUNT_LT,en.COUNT_LTE,en.COUNT_GT,en.COUNT_GTE],[en.NOT_IN_FILE,en.IN_FILE],[en.EQUALS,en.NOT_EQUALS,en.HAS_ALL],[en.LT,en.LTE,en.GT,en.GTE],[en.MISSING_VALUE,en.EXISTS],[en.COUNT_RANGE],[en.IN_RANGE],[en.STARTS_WITH,en.CONTAINS],[en.FULL_TEXT],[en.ON,en.BEFORE,en.AFTER,en.NOT_EQUALS],[en.WITHIN]],Kl=(e,t)=>Hl.some((r=>r.includes(e)&&r.includes(t))),Jl=(0,l.pipe)(l.omit,l.values),Xl={OPTIONS_FOR_STRING:Jl(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],en),OPTIONS_FOR_DATE:[en.ON,en.BEFORE,en.AFTER,en.WITHIN,en.NOT_EQUALS,en.MISSING_VALUE,en.EXISTS,en.COUNT_EQUALS,en.COUNT_NOT_EQUALS,en.COUNT_LT,en.COUNT_LTE,en.COUNT_GT,en.COUNT_GTE,en.COUNT_RANGE,en.IN_FILE,en.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Jl(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],en),OPTIONS_FOR_BLOB:Jl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],en),OPTIONS_FOR_NUMBER:Jl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],en),OPTIONS_FOR_LOOKUP:Jl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],en),OPTIONS_FOR_ENUM:Jl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],en),OPTIONS_FOR_ID:[en.EQUALS,en.NOT_EQUALS,en.IN_FILE,en.NOT_IN_FILE],OPTIONS_FOR_COUNT:[en.EQUALS,en.NOT_EQUALS,en.LT,en.LTE,en.GT,en.GTE,en.IN_RANGE],OPTIONS_FOR_COMPLEX:[en.COUNT_EQUALS,en.COUNT_NOT_EQUALS,en.COUNT_LT,en.COUNT_LTE,en.COUNT_GT,en.COUNT_GTE,en.COUNT_RANGE,en.EXISTS,en.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[en.EQUALS,en.NOT_EQUALS,en.EXISTS,en.MISSING_VALUE]},zl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case $t.TYPE_TYPEAHEAD:case $t.TYPE_STRING:case $t.TYPE_PASSWORD:case $t.TYPE_TEXT:case $t.TYPE_CIK_ID:case $t.TYPE_URL:case $t.TYPE_BLOG_URL:case $t.TYPE_IMAGE_URL:case $t.TYPE_EMAIL:return Xl.OPTIONS_FOR_STRING;case $t.TYPE_LOOKUP:case $t.TYPE_DEPENDENT_LOOKUP:return Xl.OPTIONS_FOR_LOOKUP;case $t.TYPE_ENUM:return Xl.OPTIONS_FOR_ENUM;case $t.TYPE_DATE:case $t.TYPE_ACTIVENESS_DATE:case $t.TYPE_TIMESTAMP:case $t.TYPE_LOCAL_DATE:return Xl.OPTIONS_FOR_DATE;case $t.TYPE_BOOLEAN:case $t.TYPE_BOOLEAN_RADIO:return Xl.OPTIONS_FOR_BOOLEAN;case $t.TYPE_BLOB:return Xl.OPTIONS_FOR_BLOB;case $t.TYPE_LONG:case $t.TYPE_INT:case $t.TYPE_FLOAT:case $t.TYPE_DOUBLE:case $t.TYPE_NUMBER:return Xl.OPTIONS_FOR_NUMBER;case $t.TYPE_ENTITY_ID:return Xl.OPTIONS_FOR_ID;case $t.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[en.EQUALS];case $t.TYPE_COUNT:return Xl.OPTIONS_FOR_COUNT;case $t.TYPE_NESTED:case $t.TYPE_REFERENCE:case $t.TYPE_IMAGE:return Xl.OPTIONS_FOR_COMPLEX;default:return Xl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Wl,n):n},Zl=e=>[bt.and,bt.andNot].includes(e),eu=e=>[bt.or,bt.orNot].includes(e),tu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),eu)),ru=(nu=[bt.and],e=>e.slice(0,-1).every((e=>nu.includes(e.operator))));var nu;const iu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),au=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),ou=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},su=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[bt.or,bt.orNot],n=t?[bt.and,bt.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)&&ou(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},lu="and",uu=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)(lu,n,e),o=(e=>[bt.andNot,bt.orNot].includes(e))(a)?su(r):r;return i?o:`${t} ${a} ${o}`}),"")}},cu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),pu=e=>Array.isArray(e)?e.map(pu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),du=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),yu=e=>`'${e}'`,fu=e=>`"${e}"`,Tu=(0,l.pipe)(pu,du),Eu=(0,l.pipe)(Tu,yu),mu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Fl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),hu=(e,t)=>Wl(t)?{type:$t.TYPE_INT}:Yl(t)?{type:$t.TYPE_FILE}:ql(t)&&!Ql(t)&&Ar(e.type)?{type:$t.TYPE_LOCAL_DATE}:e,bu=Object.values(ln),Ou=e=>bu.includes(e),vu=e=>Tn().text(un[e]),gu=e=>{const t=f()();switch(e){case ln.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case ln.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case ln.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case ln.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case ln.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function _u(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){Au(e,t,r[t])}))}return e}function Au(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nu=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Ru=(0,l.curry)(((e,t,r)=>{const n=r.map(Fl(e)||t.endsWith(".count")?Tu:Eu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Pu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Su=e=>{let{filter:t,fieldName:r,values:n}=e;const i=$l(t);return(0,l.pipe)(Pu(i),(0,l.map)(Ru(t,r)),Nu(" or "))(n)},wu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Eu).join(",")})`},Iu=e=>`*${e}*`,Uu=e=>`URL:${e}`,Cu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Lu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===en.IN_FILE?r:`not ${r}`},ju=(e,t)=>[P(e,t),S(e,t)],Du=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!ku(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case en.ON:return _u({},e,n?{filter:en.EQUALS}:{filter:en.IN_RANGE,values:[ju(i,n)]});case en.BEFORE:return _u({},e,{filter:en.LTE,values:[[S(i,n)]]});case en.AFTER:return _u({},e,{filter:en.GTE,values:[[P(i,n)]]});case en.WITHIN:return _u({},e,{filter:en.IN_RANGE,values:[gu(i)]})}}return e}),Su),ku=(0,l.propSatisfies)(Ar,"type"),xu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",en.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(Su({filter:en.EQUALS,fieldName:t,values:[r]}))),new uu).build())),Nu(" or "))(r)}],[(0,l.propEq)("filter",en.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return Su({fieldName:r,filter:t,values:n.map((0,l.pipe)(pu,Iu))})}],[(0,l.propEq)("filter",en.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?Su(_u({},e,{values:(0,l.flatten)(r)})):Cu(r)?wu(_u({},e,{filter:"listEquals"})):Su(e)}],[(0,l.propEq)("filter",en.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=$l(t);return(0,l.pipe)(Pu(i),(0,l.map)(Ru(t,r)),Nu(" and "))(n)})(_u({},e,{values:(0,l.flatten)(e.values)})):ku(e)?(e=>{const{values:t}=e,r=!ku(e),[n]=t;return(new uu).addClause(Su(_u({},e,{filter:en.LT,values:[P(n,r)]}))).addClause(Su(_u({},e,{filter:en.GT,values:[S(n,r)]}))).orBuild()})(e):Cu(t)?wu(_u({},e,{filter:"not listEquals"})):Su(e)}],[(0,l.propSatisfies)(Yl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Su({fieldName:r,filter:Lu(t,r),values:n.map((0,l.prop)("link")).map(Uu)})}],[(0,l.propSatisfies)(Wl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Su({fieldName:`${r}.count`,values:n,filter:Bl(t)})}],[(0,l.propSatisfies)(ql,"filter"),Du],[(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 Ru(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Ru(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,Su]],Fu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Vl(e)||$u(r))},Mu=e=>Array.isArray(e)?$u(e):null!=e&&pu(e).length>0,$u=e=>e&&e.length>0&&e.every(Mu);function Vu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Wu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Yu=(e,t,r)=>"children"===e?qu(r,[...t][0],!0):r,Bu=(e,t,r)=>"values"===e?[...r,...t]:r,qu=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)(Yu,t),e);if(!r&&Gl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Bu,t),e)}return(0,l.append)(t,e)},Qu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Gu(e),r=e=>e.fieldName===t?e:r({fieldName:Wu(e),children:[e]});return r(e)})(t);return qu(e,r)}),[]),Hu=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")),Ku=e=>{let[t]=e;return t.children?Ku(t.children):t.operator},Ju=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=Ku(t)===bt.andNot,a=n(t,!1),o=i?`not ${su(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Ku(r)||lu} ${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&&Hu(i)&&!t?r(i):n(i,a)}],...e])(o))),new uu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Xu=(0,l.pipe)((0,l.propOr)("","filter"),Dl),zu=(0,l.map)((0,l.when)(Xu,(e=>{const[t,r]=jl(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){Vu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Zu=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)(Fu),zu,Qu,Ju([...e,...xu],t))},ec=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),tc=[en.ON,en.BEFORE,en.AFTER,en.WITHIN,en.NOT_EQUALS,en.MISSING_VALUE,en.EXISTS],rc=[en.EQUALS,en.NOT_EQUALS,en.STARTS_WITH,en.MISSING_VALUE,en.HAS_ALL,en.FULL_TEXT,en.EXISTS],nc=[en.EQUALS,en.NOT_EQUALS,en.LT,en.LTE,en.GT,en.GTE,en.IN_RANGE],ic=(e,t)=>{const r=rr(e);return(e=>{switch(e){case hn.startDate.name:case hn.endDate.name:case On.dueDate.name:case _n.createdTime.name:case _n.updatedTime.name:case Nn.reltioLoadDate.name:case Nn.createDate.name:case Nn.updateDate.name:case Nn.deleteDate.name:case Nn.publishDate.name:return tc;case An.matches.name:case Nn.count.name:return nc;case On.workflow.name:case On.assignee.name:case On.step.name:case vn.commenter.name:case _n.createdBy.name:case _n.updatedBy.name:case Nn.sourceSystems.name:case Nn.value.name:return rc;default:return null}})(t)||zl(r)},ac=[en.EQUALS,en.NOT_EQUALS,en.CONTAINS,en.STARTS_WITH,en.MISSING_VALUE,en.HAS_ALL,en.IN_RANGE,en.WITHIN,en.EXISTS,en.ON],oc=(0,l.pipe)(ic,(0,l.filter)((0,l.includes)(l.__,ac))),sc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),lc=e=>{let{query:t,body:r}=e;return t=sc(t),Rl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},uc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,l.pipe)(Zu(),ec(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Mr(i)}`},cc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=uc(e,t,r);return Rl(n)},pc=e=>Rl(`/entities/_total?${e}`),dc=(e,t)=>{const r=(0,l.pipe)((0,l.filter)(es),(0,l.map)((0,l.prop)("uri")))(e),n={filter:en.EQUALS,fieldName:"type",values:r},i={filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},a=Zu()([n,i]);return Rl("/entities/_typeAheadSearch"+Mr({filter:a,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,max:4}),{method:"GET"})},yc=(0,l.pipe)((0,l.reject)(l.isNil),Fr),fc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(Zu(),ec(i))(r),c=yc({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return lc({query:c,body:p})},Tc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return fc({fieldName:t,searchParams:i,options:n})},Ec="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",mc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i={filter:(0,l.pipe)(Zu(),ec(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Ec,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Mr(i)}`},hc=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=mc(e,t,r);return Rl(n)},bc=e=>Nc(e,{select:"secondaryLabel"}),Oc=(e,t)=>{const{select:r=Ec,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Rl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},vc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),qe)),gc=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=vc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=yr(r),m={method:"POST",data:{attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E}},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(Zu(),ec(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),Rl(`${s}/api/${o}/${t}/_object`,m)},_c=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Ac={options:"sendHidden,addRefAttrUriToCrosswalk"},Nc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ac;return Rl(`/${e}${Mr(t)}`)},Rc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",data:[e]},n=t("/entities");return Rl(n,r)},Pc=e=>Rl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Sc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Rl(`/entities/_events/_total${Fr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},wc=(e,t)=>Rl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),Ic=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Rl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},Uc=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 Rl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Fr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Cc=e=>{const t=new FormData;return t.append("file",e),Rl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,Tn().text("Can't upload file"));return Promise.reject(t)}))},Lc=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 Rl(`/personal/findSavedSearches${Fr({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"}})},jc=e=>Rl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Dc=e=>Rl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),kc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Rl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},xc=e=>{let{uri:t}=e;return Rl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Fc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),kc)(e),Mc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),kc)(e);function $c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vc=["max","offset","filter"],Gc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Gc(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){$c(e,t,r[t])}))}return e}({},t,(0,l.pick)(Vc,e)))),Wc=(0,l.omit)(["activeness"]),Yc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],ht.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],ht.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Gc(e),(0,l.omit)(Vc))(e))),Wc,(0,l.omit)(["labels"])))(t),{url:`/${e}/_connections${Mr({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},Bc=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),qc=(0,l.reject)(l.isNil),Qc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Hc=e=>Rl(Qc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Kc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Qc);return Rl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Jc=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?ll()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(qc,ne,JSON.stringify);return Rl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Xc=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"),Qc,n),o=be(i(t),i(r)).concat(ve(t,r));return Rl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},zc=(e,t)=>{const{url:r,options:n}=Yc(e,t);return Rl(r,n).then(Bc)},Zc=(e,t)=>Rl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),ep=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===yn.IN?a.inRelations=[n]:a.outRelations=[n],Rl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},tp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Rl(`${t}/recentSearches${Mr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},rp=e=>Rl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),np=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Rl(`/recentSearches${Mr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};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){ap(e,t,r[t])}))}return e}function ap(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const op={select:"label,secondaryLabel,name,type,startDate,endDate"},sp=(0,l.reject)(l.isNil),lp=(0,l.pipe)(sp,Fr),up=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=ip({},op,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Rl(`/${t}/_tree${lp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cp=e=>{let{uri:t,graphUri:r}=e;const n=ip({},op,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Rl(`/${t}/_parents${lp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},pp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=ip({},op,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Rl(`/${t}/_hops${lp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function dp(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 yp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},fp="/activities",Tp=e=>{let{label:t,description:r}=e;return Rl(fp,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:yp()}})},Ep=e=>{const t=Mr(e);return Rl(fp+t,{method:"GET"})},mp=e=>Rl(`/activities/_total${Mr(e)}`,{method:"GET"}),hp=e=>{const{entityUri:t}=e,r=dp(e,["entityUri"]);return Rl(`/${t}/_activities${Mr(r)}`,{method:"GET"})},bp=e=>{const{entityUri:t}=e,r=dp(e,["entityUri"]);return Rl(`/${t}/_activities/_total${Mr(r)}`,{method:"GET"})};function Op(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vp(e,t,r[t])}))}return e}function vp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},_p=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Rl(gp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},Ap=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=gp({url:r,workflowPath:t,tenant:n})),Rl(s,{method:i||"GET",body:JSON.stringify(a),headers:Op({"Content-Type":"application/json"},null!=o?o:{})})},Np=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=gp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Rl(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)},Rp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=gp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Op({},l,{comment:o}):l;return Rl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Pp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=gp({url:`/tasks${s?Mr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Op({objectURIs:[i]},(0,l.reject)(E,a)))};return Rl(u,Op({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Sp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Rl(gp({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})})},wp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Rl(gp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(Op({max:a,offset:o},i))})},Ip=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Rl(gp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Rl(gp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Rl(gp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},jp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},Dp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},kp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},xp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return Rl(gp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Fp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Rl(gp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},Mp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(ns);return a&&a[0]&&(r=n.length>0&&a[0].value?Mp(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),$p=(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=Mp(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},Vp=/[,\s]*$/,Gp=e=>{const t=Tn().text(dn);if(!e)return t;const r=e.replace(Vp,"");return""===r.toString().trim()?t:r},Wp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Yp=(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=Wp(e,r.referencedEntityTypeURI);if(n)return $p({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return $p({attributes:t||{}},r.dataLabelPattern);return""},Bp=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},qp=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Qp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",Hp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),bl,(0,l.prop)("value"))),Kp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),Hp),Jp=(e,t,r)=>{const n=Kp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Os(e),Hp)))(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")])})(qr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>hs(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,Hp))(r)})(e,r)||zr(e,r.type);return Qp(t,n)};function Xp(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){zp(e,t,r[t])}))}return e}function zp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zp="DTSS/",ed=(0,l.replace)(new RegExp("^entities/"),""),td=e=>Zp+e.dataTenant+"/"+e.uri,rd=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),nd=e=>!(!e||!e.dataTenant),id=(0,l.startsWith)(Zp),ad=(0,l.pipe)((0,l.ifElse)(id,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),od=(0,l.ifElse)(nd,td,(0,l.prop)("uri")),sd=e=>e&&e.uri?e.dataTenant?td(e):ed(e.uri):"",ld=(0,l.curry)(((e,t,r)=>(qr(t,r.type)||{})[e]||"")),ud=ld("label"),cd=ld("typeGraphIcon"),pd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=qr(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(ns)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Yp(e,o,i),uri:a.uri}})).filter(l.identity):[]},dd=(0,l.pipe)(pd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),yd=(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=yd(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):yd(e.slice(1),r)}})),fd=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Td=e=>(0,l.propOr)([],"matchRules",e),Ed=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Xp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},md=(e,t,r)=>t&&r?r.aEntity:e,hd=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,sources:u,rules:c}=e;const p={max:r,deep:n,filter:s,sort:i,order:a,activeness:o,sources:u,rules:c};return Rl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Fr)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},bd=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 Rl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Fr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Od=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Rl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},vd=(e,t,r)=>Promise.all(t.map((async t=>{await Rl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),gd=async(e,t)=>await vd(e,t,"NOT"),_d=async(e,t)=>await vd(e,t,"MATCH"),Ad=async(e,t)=>await Promise.all(t.map((async t=>{await Rl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function Nd(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){Rd(e,t,r[t])}))}return e}function Rd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pd(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 Sd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Rl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},wd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Hd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Id=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Hd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Ud=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Rl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Cd=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 Ud({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Ld=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(nd,i);return Promise.all([s.length?Od(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Ud({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},jd=(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=Pd(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)}),[])),Dd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),jd),kd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Rl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(Dd)},xd=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)},Fd=xd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Rl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(Dd)})),Md=xd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Rl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),$d=(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)}},Vd=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Rl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Gd=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 Vd(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Wd=Gd("NOT"),Yd=Gd("MATCH"),Bd=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(nd,a);return Promise.all([vd(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return Vd(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},qd=Bd("NOT"),Qd=Bd("MATCH");function Hd(e){let{requestProvider:t=Rl,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}`,Nd({},Pd(s,["headers"]),{headers:Nd({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Kd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Hd({url:mc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Jd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Hd({url:uc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Xd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=Yc(t,r);return Hd({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Bc,(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)))}))))},zd=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Hd({url:`${_c(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Zd=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Rl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},ey=e=>{let{dtssPath:t,tenant:r}=e;return Rl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},ty=e=>{let{dtssPath:t,customerTenant:r}=e;return Rl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},ry=e=>{let{dtssPath:t,tenants:r}=e;return Rl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},ny=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Hd({url:_c(t),dataTenant:r,customerTenant:n,dtssPath:i})},iy=()=>Rl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function ay(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){oy(e,t,r[t])}))}return e}function oy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=ay({},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 Rl(`${t}/api/${r}/graph/search${Mr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},ly=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Rl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:ay({},n,i),headers:{"Content-Type":"application/json"}})},uy=(e,t)=>`${e}/${t}/comments`,cy=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Rl(`${uy(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},py=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Rl(`${uy(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},dy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Rl(uy(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},yy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Rl(`${uy(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},fy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Rl(`${uy(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ty=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Rl(`${uy(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Ey=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Mr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Rl(`${uy(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function my(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){hy(e,t,r[t])}))}return e}function hy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const by=e=>{let{tenant:t,servicesPath:r}=e;return Rl(`${r}/oauth/proxy${Mr({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Oy="graphExport",vy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await Ny({servicesPath:e,tenant:t,environment:r,namespace:Oy,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(my({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await Ny({servicesPath:e,tenant:t,environment:r,namespace:Oy,options:my({method:"PUT"},o)})}catch(e){s=null}return s||(s=await Ny({servicesPath:e,tenant:t,environment:r,namespace:Oy,options:my({method:"POST"},o)})),s},gy=e=>{let{servicesPath:t,key:r}=e;return Rl(`${t}/settings${Mr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},_y=e=>{let{servicesPath:t}=e;return Rl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},Ay=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Rl(`${n}/plugins${Mr({tenant:t,user:r})}`,{method:"GET"})},Ny=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Rl(`${n}/configService${Mr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Ry=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return Ny({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Py=e=>{let{servicesPath:t,stateHash:r}=e;return Rl(`${t}/searchLink?key=${r}`,{method:"GET"})},Sy=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),Rl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},wy=e=>Rl(`/${e}?showObjectsInfo=true`,{method:"GET"}),Iy=e=>{let{exportPath:t,tenant:r,options:n}=e;return Rl(`${t}/${r}/activities${Mr(n)}`,{method:"POST"})};function Uy(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){Cy(e,t,r[t])}))}return e}function Cy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ly=e=>{const{entityUri:t}=e;return Rl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},jy=e=>{let{entityUri:t,crosswalk:r}=e;return Rl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},Dy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Rl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Uy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Uy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},ky=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Rl(`/${r}/_${n}${Mr({contributorURI:t})}`,{method:"POST"})},xy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Rl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},Fy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Rl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},My=e=>{let{entityUri:t,crosswalkId:r}=e;return Rl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function $y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vy=e=>{let{entityTypeUri:t}=e;return Rl(`/dataQuality/fillRates${Fr({entityType:rt(t)})}`,{method:"GET"})},Gy=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){$y(e,t,r[t])}))}return e}({},n===It.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{});return Rl(`/entityType/${rt(t)}/dataQuality/${n}`,{method:"POST",body:JSON.stringify(a)})},Wy=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Rl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${rt(n)}`,{method:"GET",headers:{env:i}})},Yy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Rl(`/${t}${Mr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},By=e=>{let{attributeUri:t,value:r}=e;return Rl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},qy=e=>{let{attributeUri:t,value:r}=e;return Rl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Qy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Rl(`/${t}${Mr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Hy=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Mr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=ll()([[{value:a}]]);return Rl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Ky=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Rl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Jy=e=>{let{entityUri:t,attributeName:r}=e;return Rl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function Xy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zy=e=>{let{entityUri:t}=e;return Rl(`/${t}/_historicURIs`,{method:"GET"})},Zy=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 Rl(`/${t}/_changesWithTotal${Mr(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){Xy(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},ef=(e,t)=>Rl(`/${e}/_previousChange${Mr({timestamp:t})}`,{method:"GET"}),tf=(e,t)=>Rl(`/${e}${Mr({time:t})}`,{method:"GET"});function rf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nf(e,t,r[t])}))}return e}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=e=>{let{url:t,method:r,data:n,headers:i}=e;return Rl(t,rf({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:rf({"Content-Type":"application/json"},null!=i?i:{})}))},of=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Mr({options:a.join(","),severity:o.join(",")});return Rl(`${t}/validate/${i}/entity/${sd({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},sf=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Rl(`${t}/validate/${n}/entity${Mr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},lf=e=>{let{tenant:t,apiPath:r}=e;return Rl(`${r}/tenants/${t}/name`,{method:"GET"})},uf=e=>{let{tenant:t,apiPath:r}=e;return Rl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},cf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Rl(`${a}/preferences${Mr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},pf=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 Rl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},df=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Rl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})};var yf=r(29524);const ff=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Qe(),s={attributes:Xs({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=hs(r,e,n.uri)[0];return i&&i.value?rl({entity:e,attributeType:n,uri:i.uri,value:t}):el({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Tf=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ys),(0,l.filter)(qe),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Ef=(0,l.curry)(((e,t)=>{const r=Tf(e=e||{},t=t||{});return r.concat((0,l.chain)(Ef(e),r))})),mf=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),hf=mf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),bf=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),qe)),Of=e=>(0,l.pipe)(hf,bf(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),vf=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(hf,(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})),gf=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),qe),(0,l.omit)(["uri","timestamp"])),_f=(0,l.pipe)(gf,(0,l.evolve)({attributes:ll(!0)})),Af=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=Of(i);if(a.length>0)for(const t of a)e=vf(t,r[t].uri,e);const o=(s=await Rc(_f(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},Nf=async(e,t,r)=>{const n=Pf(e,t),i={};for(const t of n)i[t]=await Af(e,t,i,r);return i},Rf=(0,l.curry)(((e,t)=>{const r=yf.Node(t);return Of(e[t]).forEach((t=>{const n=Rf(e,t);r.addEdge(n)})),r})),Pf=(e,t)=>(0,l.pipe)((0,l.map)(Rf(e)),(0,l.map)(yf.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Sf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(gf))})),wf=(e,t)=>{const r=Ae(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=Oe(e,t),a=ve(e,t);return[...ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},If=(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 vf(r,n,e)}),e))))}),t)}),Sf),Uf=(0,l.curry)(((e,t)=>(0,l.when)(qe,(0,l.propOr)(l.__,t,e),t)));function Cf(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){Lf(e,t,r[t])}))}return e}function Lf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jf=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Ut.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Df=e=>{let{relationUri:t}=e;return{type:Ut.DELETE_RELATION,parameters:{relationUri:t}}},kf=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Ut.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},xf=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Ut.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Ff=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Ut.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Mf=(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))),$f=e=>e.type===Ut.DELETE_RELATION,Vf=e=>e.type===Ut.CREATE_RELATION,Gf=e=>e.type===Ut.REPOINT_RELATION,Wf=e=>e.type===Ut.UPDATE_RELATION,Yf=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Bf=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Ut.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Jc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Ut.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Kc(e,i).then(o)};case Ut.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return ep(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Ut.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Xc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Ut.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[Df({relationUri:o}),jf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(qf(n)),(0,l.map)(Bf),Yf)(s)}}},qf=e=>t=>Cf({dcrProcessor:e},t),Qf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=$r({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(qf(r)),(0,l.map)(Bf),Yf,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Hf=e=>t=>(0,l.map)((t=>Cf({},t,{parameters:(0,l.evolve)({parentUri:Uf(e),entityUri:Uf(e),newEntityUri:Uf(e)},t.parameters)})),t),Kf=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Jf=(e,t)=>{const r=e.filter(Vf).find(Mf(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Wf(o)&&Mf(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Gf(o)||!Mf(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(Kf({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},Xf=(e,t)=>{const r=e.filter(Gf).filter(Mf(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Wf(i)||!Mf(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Kf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},zf=(e,t)=>{const r=e.filter($f).filter(Mf(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Mf(t,e)))},Zf=(e,t)=>{const r=e.filter(Wf).filter(Mf(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Wf(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Kf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},eT=e=>{const t=e.filter($f).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(zf,e)},tT=e=>{const t=e.filter(Vf).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Jf,e)},rT=e=>{const t=e.filter(Gf).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Xf,e)},nT=e=>{const t=e.filter(Wf).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)(Zf,e))(t)},iT=e=>(0,l.pipe)(eT,tT,rT,nT)(e);function aT(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){oT(e,t,r[t])}))}return e}function oT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sT=e=>aT({},(0,l.path)(bT(),e),{startDate:(0,l.path)(_T(),e),endDate:(0,l.path)(AT(),e)}),lT=(e,t)=>(0,l.pipe)((0,l.path)(gT()),Uf(t))(e),uT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=lT(e,r),i=(0,l.path)(OT(),e)===Ct.IN,a=e.parentEntityUri||n;return jf({parentUri:i?t:a,relation:sT(e),entityUri:i?a:t})})),...o.map((t=>{const i=lT(t,r),a=(0,l.path)(OT(),t)===Ct.IN,o=i!==(0,l.pipe)((0,l.path)(bT()),a?NT:RT)(t),s=wT(e,(0,l.path)(mT(),t)),u=t.parentEntityUri||n,c=Uf(r,i);return o?Ff({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(bT(),t),isReversed:!1}):xf({oldRelation:(0,l.path)(bT(),s),newRelation:sT(t)})})),...i.map((e=>Df({relationUri:e}))),...s.map((e=>kf({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},cT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return aT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),pT=(0,l.has)("dataTenant"),dT=(0,l.ifElse)(pT,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),yT=(e,t)=>(0,l.pipe)(vi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Ps),xa)(e,t),fT=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)}},TT=(e,t,r)=>{const n=$p(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)},ET="relation",mT=(0,l.always)([ET,"relationUri"]),hT=(0,l.always)([ET,"relationType"]),bT=(0,l.always)([ET,"object"]),OT=(0,l.always)([ET,"direction"]),vT=(0,l.always)([ET,"object","attributes"]),gT=(0,l.always)(["entity","entityUri"]),_T=(0,l.always)([ET,"startDate"]),AT=(0,l.always)([ET,"endDate"]),NT=(0,l.path)(["startObject","objectURI"]),RT=(0,l.path)(["endObject","objectURI"]),PT=(0,l.path)(["startObject","objectTypeURI"]),ST=(0,l.path)(["endObject","objectTypeURI"]),wT=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(mT()),(0,l.equals)(t))(r))return r;if(r.connections){const e=wT(r.connections,t);if(e)return e}}},IT=(0,l.pipe)(wT,(0,l.path)(bT())),UT=(0,l.allPass)([(0,l.pipe)((0,l.path)(gT()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(hT()),(0,l.complement)(E))]),CT=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:He()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=DT({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=LT(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?fT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},LT=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:yn.IN}:{type:t[0],direction:yn.OUT}:null},jT=e=>e.uri||e,DT=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Ci(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===yn.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"],qr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],qr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(jT,vi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(yn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(yn.OUT)),(0,l.map)(u))},t)||{}},kT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ri({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=_i(e,n.uri);return n&&(!t||Hr(e,i,t))&&(!r||Hr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],qr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],qr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(Zo,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)}},xT=(0,l.curry)(((e,t,r,n,i)=>{const a=Hr(n,l.__,t.type),o=e?ST:PT,s=Hr(n,l.__,r.type),u=e?PT:ST;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),FT=(e,t,r)=>{const n=e?ST:PT,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(Hr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};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){$T(e,t,r[t])}))}return e}function $T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VT=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return MT({},t,{[r]:{parents:n,children:i}})},GT=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return MT({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},WT=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=Tf(t,i),o=VT({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>WT(n.uri,t,[e],r)),o)},YT=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)(mT(),n),a=t?GT({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(gT(),n),s=qe(o)?[o]:[],u=VT({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>WT(t,r,[i],e)),u)}),n)},BT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return YT(r,e,t,WT(e,t))},qT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return BT(t,r,n);if(Je(e)){const t=wT(n,e);return t&&YT([t],null,r)}return r[e]?WT(e,r):void 0},QT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>QT(e,t))))},HT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>HT(e,t))))},KT=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ke(t),u=BT(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(Je(c)){if(s=wT(i,c),!s)return null;o.push({type:Tt.relationConnection,value:s,valueType:vi(a,(0,l.path)(hT(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:Tt.tempEntity,value:e,valueType:qr(a,e.type)});continue}const p=n[u],d=Rs(p,c),y=n[c];if(!d||!y)return null;o.push({type:Tt.attributeValue,value:d,valueType:br(a,at(d.uri,p.type))}),o.push({type:Tt.tempEntity,value:y,valueType:qr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},HT(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?IT(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?vi(a,d.type):qr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Or(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:Tt.tempEntity,value:T,valueType:qr(a,T.type)}),o.push({type:Tt.attributeValue,value:s,valueType:E}),m=s.value;const l=ys(s);T=l&&qe(l)?n[l]:null}}return o},JT=e=>e.every((e=>{let{type:t}=e;return[Tt.attributeValue,Tt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Tt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,XT=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?XT(t.value):[]];return e.concat(r)}),[])),zT=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,ZT=e=>{const t=[...XT((null==e?void 0:e.attributes)||[]),...XT((null==e?void 0:e.analyticsAttributes)||[])];return e?[od(e),...t]:[]},eE=(e,t)=>[e,...t.map((t=>zT(e,t)))],tE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return dT(t)}))},rE=(e,t)=>{switch(e){case Et.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case Et.ENTITY_ATTRIBUTE:case Et.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[ot(t)]})(t);case Et.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case Et.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,od({uri:n,dataTenant:i}),r]})(t)}},nE=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),iE=(0,l.curry)(((e,t)=>{const r=No(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(iE(e,r.extendsTypeURI)):n})),aE=(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))),oE=(e,t)=>(0,l.pipe)((0,l.prop)("type"),iE(e),aE(t))(t);function sE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lE=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}},uE=e=>!e.deactivated,cE=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},pE=e=>cE(e)+e.message,dE=(0,l.unless)(l.isNil,(0,l.prop)("message")),yE=(0,l.unless)(l.isNil,(0,l.prop)("type")),fE=(0,l.curry)(((e,t)=>et(t.parentUri,e))),TE=(0,l.curry)(((e,t)=>t.parentUri===e)),EE=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),et(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",$t.TYPE_REFERENCE),(0,l.pipe)(Bt,(0,l.any)(et(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),mE=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),hE=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),bE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([PE,uE,fE(e),EE(t),(0,l.complement)(hE(e,t.uri))]))(r)},OE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([PE,uE,TE(e),mE(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",pt.missed))]))(r);return n&&n.message||""},vE=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===pt.missed))},gE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(mT(),e))]))(t)},_E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},AE=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([uE,fE(t)]))(r)},NE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},RE=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?KT(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 Tt.attributeValue:{const e=a;if(ur(a))return $p(o,e.dataLabelPattern);if(cr(a)){const t=o,i=ys(t),a=Wt(e),s=qr(n,a);return qe(i)?$p(r[i],s.dataLabelPattern):t.label}return""}case Tt.tempEntity:return $p(o,a.dataLabelPattern);case Tt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=qr(n,null==e?void 0:e.entityType);return`${Gp(i&&qe(i)?$p(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||gi(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){sE(e,t,r[t])}))}return e}({},e,{label:Gp(t)})}))},PE=e=>!e.severity||e.severity===yt.ERROR,SE=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case $t.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(SE(n))}));case $t.TYPE_REFERENCE:return!!os(t);case $t.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),wE=(e,t)=>e.every((0,l.complement)(SE(t))),IE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=wo(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=hs(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!ns(e.parent))))).forEach((e=>{wE(e.attrValues,n)&&r.push(lE({type:pt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:Tn().text("Attribute is required"),source:dt.local}))})),r}),[])},UE=(0,l.curry)(((e,t,r)=>hs(e,t,r,!1))),CE=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),qr(e),(0,l.prop)("attributes"),(0,l.reject)(sr),(0,l.filter)(cr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(UE(e,t)));return(0,l.pipe)(r,(0,l.reject)(ys),(0,l.map)((e=>{let{uri:r}=e;return lE({type:pt.missedRefEntity,uri:"",attributeTypeUri:at(r,t.type),parentUri:r,message:Tn().text("Entity is required"),source:dt.local})})))(t)},LE=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ys,qe)).flatMap((n=>{const i=ys(n),a=t[i],o=br(e,at(n.uri,r.type));return jE(e,t,o,a)})),jE=(e,t,r,n)=>{const i=Bt(r),a=i.map((t=>br(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",$t.TYPE_REFERENCE))).flatMap(Qt).concat(i);return DE(e,t,n,(e=>a.some(et(e.uri))))},DE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=IE(e,r,n),a=CE(e,r),o=LE(e,t,r);return[...i,...a,...o]},kE=(e,t)=>{const r=(0,l.path)(bT(),t)||{};return IE(e,r)},xE=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(gT()),(0,l.ifElse)(qe,(e=>t[e]),(0,l.always)(null)))(r),i=kE(e,r),a=(e=>(0,l.path)(gT(),e)?[]:[lE({type:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(hT(),e),parentUri:(0,l.path)(mT(),e),message:Tn().text("Entity is required"),source:dt.local})])(r),o=((e,t,r)=>r?DE(e,t,r):[])(e,t,n);return[...i,...a,...o]},FE=e=>(0,l.path)(["entity","uri"],e)?[]:[lE({type:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:Tn().text("Entity is required"),source:dt.local})],ME=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=IE(e,r),i=FE(t);return[...n,...i]};function $E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VE=(e,t)=>{var r,n;const i=qr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||eo(e)},GE=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),WE=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(GE(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},YE=(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)(fs,qe,l.not)]),(e=>{const t=(0,l.pipe)(fs,rt)(e);return WE((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(ys,qe),(t=>{const r=ys(t),n=e[r],i=n&&qE(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){$E(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),BE=(e,t,r)=>ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))).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)(YE(r,e.type)),(0,l.map)(WE(ct))))})(e))),qE=(e,t)=>(0,l.evolve)({attributes:ol({valueTransformer:(0,l.pipe)(ms,YE(t),GE(ct)),deleteEmptyComplex:!0}),uri:ct})(e);function QE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HE(e,t,r[t])}))}return e}function HE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KE=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp($e,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),JE=e=>(0,l.pipe)((0,l.evolve)({objectUri:KE,objectParentUri:KE}),(e=>{return QE({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?pt.missed:pt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&ut(e.objectUri),uri:e.objectUri,source:dt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),XE=(e,t)=>(0,l.map)((0,l.pipe)(JE,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=RE(t,s),p=null!=c&&c.length?c.slice(0,-1):RE(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&br(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Tt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return QE({},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&&lt(i)){const n=(0,l.last)(a),i=n.valueType;if(cr(i)&&Ht(i).includes(o)){const i=ys(n.value),o=i&&qe(i)?t[i]:null;return o?QE({},e,{parentUri:o.uri,path:a.concat({type:Tt.tempEntity,value:o,valueType:qr(r,o.type),label:""})}):e}}return e}})(t)))(e),zE=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};function ZE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var em;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(em||(em={}));const tm={},rm={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},nm=(0,l.curry)(((e,t)=>{const r=(e=>{if(!tm[e]){const t=rm[e]||rm.random0;tm[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){ZE(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return tm[e]})(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),im=e=>nm(em.Charts,e);var am=r(51404),om=r.n(am);const sm=Array.from({length:100},((e,t)=>t/100)),lm=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)},um={},cm=new(om())({hash:lm,saturation:sm.slice(15,71),lightness:sm.slice(50,90)}),pm=(0,l.curry)(((e,t,r)=>{t in um||(um[t]={});const n=um[t];r in n||(n[r]=((e,t)=>{const r=String(lm(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),dm=pm(cm,"crosswalks"),ym=pm(cm,"sources"),fm=pm(cm,"contributors");function Tm(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){Em(e,t,r[t])}))}return e}function Em(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mm=(0,l.has)("items"),hm=e=>0===e,bm=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)},Om=e=>e.reduce(((e,t)=>e+t.width),0),vm=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),gm=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),_m=e=>e.reduce(((e,t)=>e+t.height),0),Am=e=>(0,l.is)(String,e)&&e.includes("%"),Nm=e=>Boolean(e.spacer),Rm=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),Pm=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(mm(t)?Pm(t):t)),[]),Sm=e=>({id:e.layout}),wm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Sm;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.floor(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=Am(r.width)?Rm(i,r.width):u}return bm(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return bm(n,t,r)},o=(e,t)=>mm(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.reduce(((o,s,u)=>{const c=i(t,r,s,mm(s)?n(s.layout):e(s.view)),d=hm(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(mm(s))return o.concat(p(Tm({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(Tm({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:Om(o),height:vm(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=mm(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=hm(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(mm(i))return r.concat(p(Tm({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Tm({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?bm(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?bm(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:gm(i),height:_m(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=hm(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return Tm({},o,{x:t.x,y:c,width:s,height:u})},i=(e,t)=>{const r=t.reduce(((t,r,i)=>{if("string"==typeof r)t.push(n(e,t,r,i));else if("object"==typeof r){const a=Math.round(e.width/2),o=Tm({},e,{width:a}),s=Tm({},e,{x:e.x+a,width:a}),u=(0,l.has)("left",r)&&n(o,t,r.left,i),c=(0,l.has)("right",r)&&n(s,t,r.right,i),p=(0,l.propOr)(0,"height"),d=Math.max(p(u),p(c));t.push(Tm({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return Tm({},e,{height:_m(r),items:r})},o=i(t,(0,l.propOr)([],"top",r)),s=Math.round(.66*t.width),u=(0,l.isEmpty)(o)?t.y:t.y+o.height,c=i(Tm({},t,{y:u,width:s}),(0,l.propOr)([],"center",r)),p=i({x:t.x+s,y:u,width:t.width-s},(0,l.propOr)([],"right",r)),d=o.height+Math.max(c.height,p.height),y=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Tm({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=Tm({},t,{items:(0,l.reject)(Nm,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 Pm(f)},Im=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id))));function Um(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){Cm(e,t,r[t])}))}return e}function Cm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lm={BarChart:jt.BAR,BarChartGrouped:jt.BAR,BarChartHorizontal:jt.BAR,LineChart:jt.LINE,Map:jt.MAP,Pie:jt.PIE},jm=(e,t)=>st(e)?nt(e,t):e,Dm=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Lm[r];return Um({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},km=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Um({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"]))},xm=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Um({},e,{value:[nn,an,en.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:sn(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&st(t)||!r?n:(n||[]).concat((i=r,{filter:en.EQUALS,fieldName:"type",values:[i]}));var i},Fm=["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"],Mm={"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:jm(n,r),filters:xm(a,n,r),chartType:jt.BAR,component:Dt.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:jm(n,r),filters:xm(a,n,r),chartType:jt.BUBBLE,component:Dt.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:Dt.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 Um({id:t,count:o,canRead:u,orderType:s,attributeUri:jm(r,p),filters:xm(a,r,p),component:Dt.DashboardFacet,title:i,showOthers:!0},Dm(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:jm(n,r),filters:xm(a,n,r),chartType:jt.MAP,component:Dt.DashboardFacet,title:i,geoUrl:Fm[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 Um({id:t,count:o,canRead:l,attributeUri:jm(n,r),filters:xm(a,n,r),component:Dt.DashboardFacet,title:i,geoUrl:s,chartType:jt.MAP,projection:"geoMercator"},Dm(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.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:km(i),component:Dt.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:xm(n,null,a),component:Dt.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:en.GTE,fieldName:"matches",values:["1"]}],component:Dt.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:Dt.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:jt.CLOUD,component:Dt.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:jt.TREE,component:Dt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.NotificationInboxFacet,title:n||Tn().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.ActivitiesViewFacet,title:n||Tn().text("Activity log")}}},$m=e=>({id:e,height:10}),Vm=(0,l.pipe)((0,l.map)((e=>{const t=Mm[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Gm=e=>{if("0.1"===e.version){const t=Vm(e.views),r=wm($m,e.layout,{columns:4});return{id:e.id,margin:0,layout:Im(r,t),views:t}}return e},Wm=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=>Wm(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function Ym(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}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 qm=Ym({},kt,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),Qm=e=>e,Hm={[qm.Attributes]:Qm,[qm.HierarchyTree]:Qm,[qm.HierarchyPaths]:Qm,[qm.RelationsTable]:Qm,[qm.Relations]:e=>Ym({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[qm.SingleAttributeView]:Qm,[qm.CustomView]:Qm,[qm.TableAttributeView]:Qm,[qm.MapView]:Qm,[qm.OldTreeView]:e=>Ym({},e,{class:kt.HierarchyTree}),[qm.OldMapView]:e=>Ym({},e,{class:kt.MapView}),[qm.ImageAttributeView]:Qm,[qm.PotentialMatchesView]:Qm},Km=(0,l.pipe)((0,l.map)((e=>{const t=Hm[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Jm=(0,l.curry)(((e,t)=>{switch((0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)){case kt.MapView:return{id:t,height:5,minHeight:5};case kt.Relations:return{id:t,autosizing:!0,minWidth:2};default:return{id:t,autosizing:!0}}})),Xm=e=>{if("0.1"===e.version){const t=Km(e.views),r=wm(Jm(t),e.layout,{columns:4});return{id:e.id,layout:Im(r,t),views:t,workflow:e.workflow,maxWidth:e.maxWidth,sidePanelViews:e.sidePanelViews}}return e},zm=(e,t)=>e.class===t||e["react-class"]===t,Zm=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(zm(t,kt.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 zm(t,kt.SingleAttributeView)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.includes(n)||t.includes(n)}},eh=(e,t)=>e.filter((e=>t.some((t=>zm(e,t))))).map((e=>{let{id:t}=e;return t})),th=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},rh=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),nh=(e,t)=>(e||[]).find((e=>e.activator===t));function ih(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){ah(e,t,r[t])}))}return e}function ah(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oh=(e,t)=>Wm(t).map((t=>(0,l.pipe)((0,l.map)((e=>th(e,t))),(0,l.reject)(l.isNil),l.head)(e))),sh=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},lh=(e,t)=>{if("scroll"===t.layout.layout){const r=oh(e,t.layout),n=Gm(ih({},t,{views:r,version:"0.1"}));return{class:Ft.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Ft.Dashboard,views:t.views,layout:t.layout,id:t.id}},uh=(e,t)=>{const r=oh(e,t.layout)[0];return{class:Ft.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},ch=(e,t)=>{const r=oh(e,t.layout)[0];return{class:Ft.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},ph=(e,t)=>{const r=oh(e,t.layout)[0];return{class:Ft.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},dh=(e,t)=>{const r=oh(e,t.layout)[0];return{class:Ft.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},yh=(e,t)=>{const r=oh(e,t.layout)[0];return{class:Ft.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},fh=(e,t)=>{const r=oh(e,t.layout)[0];return{class:Ft.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},Th=(e,t)=>{const r=oh(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=rh(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:Ft.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"]}},Eh=(e,t)=>({class:Ft.Graph,id:t.id}),mh=(e,t)=>{const r=oh(e,t.layout)[0];return{class:Ft.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},hh=e=>t=>!!(0,l.intersection)(e,t).length,bh=(0,l.cond)([[hh(["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"]),()=>lh],[hh(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>uh],[hh(["com.reltio.plugins.graph.GraphView"]),()=>Eh],[hh(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>ch],[hh(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>ph],[hh(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>dh],[hh(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>yh],[hh(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>fh],[hh(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>Th],[hh(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>mh],[l.T,()=>(0,l.always)(void 0)]]),Oh=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(sh),(0,l.map)((t=>((e,t)=>{const r=oh(e,t.layout),n=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>th(e,t.side))),(0,l.reject)(l.isNil),l.head)(e);return Wm(r.layout||{})}})(e,t),i=Xm(ih({},t,{views:r,version:"0.1"}));return{entityType:t["entity-type"],views:i.views,layout:i.layout,sidePanelViews:n}})(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews"])))(e);return{class:Ft.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:"CustomAction",config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:"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;const i=(0,l.pipe)((0,l.map)((e=>th(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;const a=Wm(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 bh(o)(t,i)},vh=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))},gh="https://reltio-ui-files.s3.amazonaws.com/new-ui/",_h={[Ft.DQDashboard]:`${gh}DqDashboard.svg`,[Ft.Dashboard]:`${gh}Dashboard.svg`,[Ft.Graph]:`${gh}Graph.svg`,[Ft.RelationshipSearch]:`${gh}GraphSearch.svg`,[Ft.Interactions]:`${gh}Interactions.svg`,[Ft.PotentialMatches]:`${gh}PotentialMatches.svg`,[Ft.Profile]:`${gh}Profile.svg`,[Ft.ProfileActivityLog]:`${gh}ActivityLog.svg`,[Ft.Relationships]:`${gh}Relationships.svg`,[Ft.Sources]:`${gh}Crosswalk.svg`,[Ft.Search]:`${gh}Search.svg`,DEFAULT:`${gh}Default.svg`},Ah=e=>_h[null==e?void 0:e.class]||_h.DEFAULT,Nh=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?_h.ProfileView:null,Rh=e=>(0,l.pipe)((0,l.chain)(vh),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>(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=>({label:e.label,icon:Ah(Oh(e,t)),screen:Oh(e,t),canRead:e.canRead}))),(0,l.filter)((e=>e.screen)))(t))(t,e),n=Oh(t,e);return{label:t.label,icon:Nh(t)||Ah(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function Ph(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sh=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},wh=e=>({id:e,height:10}),Ih=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)(Sh),(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=Vm(((e,t)=>{const r=Wm(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(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){Ph(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=wm(wh,t.layout,{columns:4});return{views:r,layout:Im(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Uh=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Ch=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>th(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),r=(e=>(0,l.pipe)((0,l.map)((e=>th(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>th(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>th(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>th(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>th(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>th(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.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>th(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("enabled"))(e))(e),c=(e=>(0,l.pipe)((e=>nh(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("default-perspective"),(0,l.ifElse)(Uh,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),p=(e=>(0,l.pipe)((e=>rh(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.pluck)(["action"]))(e))(e),d=(e=>(0,l.pipe)((e=>nh(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkUser"))(e))(e),y=(e=>(0,l.pipe)((e=>nh(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkIdle"))(e))(e);return{i18n:o,entity:{requestSettings:{defaultMaxValues:t}},image:{attributeFieldsOrder:r},lookups:{autocomplete:n},validate:{levels:i,validateReadMode:a},attributePresentations:s,workflow:{enabled:u},defaultRoute:c,customScripts:p,checkUser:d,checkIdle:y}},Lh=e=>({layout:Rh(e),pivoting:Ih(e),properties:Ch(e)});var jh=r(58697),Dh=r.n(jh);function kh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xh(e,t,r[t])}))}return e}function xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fh=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}_${Dh()()}`;return n[e.id].push(t),i=!0,kh({},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]++,kh({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},Mh=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(Mh(e))}))}))),t},$h=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Yh,t),(0,l.propOr)([],"crosswalks",e))),e),Vh=(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(Vh(e))}))})),r},Gh=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=Gh(e);r>t&&(t=r)}))})),t+1):t},Wh=(e,t)=>{if(qe(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Yh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Bh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},qh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Qh=(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)},Hh=(0,l.eqBy)(Yh),Kh=(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)(ss,(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)))),Jh=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${t.join('","')}");\n postMessage({action:'loaded'});`;let i;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))}if(i){let e="";i.addEventListener("message",(t=>{if("loaded"!==t.data.action){const n=JSON.parse(t.data);r(n,i,e),"setHtml"===n.action&&(e=n.params.html)}}))}return i},Xh=(0,l.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=Tn().number(t));return t})),zh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?Tn().number(e,"0,0.0a").toUpperCase():Tn().number(e,"0,0"):""},Zh=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),eb=(e,t)=>t&&e!==t?`${t} (${e})`:e,tb=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),rb=(e,t,r)=>{const n=tb(e,t,r);return eb(r,n)},nb=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),ib=(0,l.complement)(nb),ab=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),ob=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)},sb=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(ib(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),lb=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case $t.TYPE_NUMBER:case $t.TYPE_FLOAT:case $t.TYPE_DOUBLE:case $t.TYPE_LONG:case $t.TYPE_INT:case $t.TYPE_COUNT:return t&&Xh(o,t);case $t.TYPE_BOOLEAN:case $t.TYPE_BOOLEAN_RADIO:case $t.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:le(t)?Tn().text("yes"):Tn().text("no");case $t.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),t&&(Ou(t)?vu(t):Tn().date(t,s));case $t.TYPE_ACTIVENESS_DATE:case $t.TYPE_LOCAL_DATE:return t&&(Ou(t)?vu(t):Tn().date(t,s));case $t.TYPE_TIMESTAMP:return t&&(Ou(t)?vu(t):Tn().date(isNaN(t)?t:Number(t),u));case $t.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case $t.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}default:return(0,l.is)(Object,t)?eb((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),ub={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},cb=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()}},pb=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status}}throw r})))),db=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)}),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)((e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),cb,pb);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},yb="__metadata",fb=(e=>{const t=[yb,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),Tb=(0,l.set)(fb),Eb=(0,l.view)(fb),mb=Tb(cn.NEW),hb=Tb(cn.REMOVED),bb=Tb(cn.EDITED),Ob=Tb(cn.IGNORED),vb=(0,l.pipe)(Eb,(0,l.equals)(cn.REMOVED)),gb=(0,l.pipe)(Eb,(0,l.equals)(cn.NEW)),_b=(0,l.pipe)(Eb,(0,l.equals)(cn.EDITED)),Ab=(0,l.pipe)(Eb,(0,l.complement)(l.isNil)),Nb=(0,l.pipe)(Eb,(0,l.equals)(cn.IGNORED)),Rb=(0,l.omit)([yb]),Pb=(e,t)=>e===yb?void 0:t;function Sb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wb=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=wb(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Ib=(e,t)=>wb((0,l.propEq)("nodeId",t),e),Ub=(e,t)=>wb((0,l.pathEq)(["entity","uri"],t),e),Cb=(e,t)=>{const r=Ib(e,t);return r.length>1?r[r.length-2]:null},Lb=(e,t)=>{const r=Ib(e,t);return r.length>0?r[r.length-1]:null},jb=(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=>jb(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Db=()=>{},kb=(e,t)=>{let{parent:r,nodeProcessing:n=Db}=t;n(e,r),e.children&&e.children.forEach((t=>kb(t,{parent:e,nodeProcessing:n})))},xb=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case At.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 At.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 At.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){Sb(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})}}},Fb=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&&kb(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===At.addingChild||r.editingMode===At.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=xb({node:r,connection:n,isReversed:i}),s=jf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===At.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=xb({node:r,isReversed:i,connection:n}),l=s?Ff({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):xf({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Mb={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},$b={asc:"asc",desc:"desc"},Vb=Mb.entityLabel,Gb=$b.asc,Wb=(0,l.always)(0),Yb=e=>{let{sortField:t=Vb,sortOrder:r=Gb,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Mb.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return c_.strings.sort(t,a,o)})(n,r);case Mb.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return c_.strings.sort(e,i,a)})(r);default:return Wb}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Bb=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values($b)),l.identity,(0,l.always)(Gb))),qb=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Mb)),l.identity,(0,l.always)(Vb)));var Qb=r(91104);let Hb;const Kb=(e,t)=>(Hb||(Hb=Qb.createClient({key:t})),new Promise((t=>{Hb.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)}))}))),Jb=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Xb=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(ns).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Jb(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(Xb(e.value,t,r))),n})),zb=e=>e&&e.length>0,Zb=(e,t)=>[].concat(e&&e.attributes?Xb(e.attributes,t):[]).filter(l.identity),eO=(e,t,r,n,i)=>{if(e&&e.type){const t=(qr(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Zb(e,t.latitude),n=Zb(e,t.longitude),zb(r)&&zb(n)&&{lat:Number(r[0]),lng:Number(n[0])};var r,n})).filter(l.identity);if(t.length>0)return Promise.resolve(t[0])}const a=t.GeoLocation;if(a){const e=a.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(zb(t)&&t[0].value&&zb(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?Kb(n.label,i).catch((()=>null)):Promise.resolve(null)},tO=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=qr(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return eO(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?Kb(a.label,r).catch((()=>null)):e)).then((e=>{let t=Array.isArray(e)?e:[e];return e&&t.map((e=>({id:e.id||n,label:i,entity:a,point:e})))})).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},rO=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=qr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(br(e,r.latitude,t.type)&&br(e,r.longitude,t.type)){const e=Zb(t,r.latitude),n=Zb(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))},nO=(e,t,r)=>Promise.all([rO(e,t),tO(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lon===e.point.lon))))]}));function iO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aO(e,t,r[t])}))}return e}function aO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oO=(e,t)=>t.values.map(To(e,t.entityTypeUri)),sO=(e,t,r)=>xs(t.fieldName,r)||br(e,nt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),lO=(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?eb(e,t):e}),r)},uO=(0,l.path)(["attrType","label"]),cO=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>iO({},e,{[t]:!0})),{});e[r]=e[r]?iO({},e[r],n):n}return e}),{}),pO=(0,l.pipe)((0,l.prop)("values"),E),dO=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Pn.type.name)),yO=e=>e.type===EO.NUMERIC_RANGE_FACET,fO=e=>e.type===EO.DATE_RANGE_FACET,TO=(0,l.either)(yO,fO),EO={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},mO=e=>{switch(null==e?void 0:e.name){case Pn.type.name:return EO.ENTITY_TYPE_FACET;case Pn.createdBy.name:case Pn.updatedBy.name:case Pn.sourceSystems.name:case Pn.tags.name:case Pn.roles.name:case Pn.matchRules.name:case Pn.MLRecommendedMatch.name:return EO.WITH_DROPDOWN_CHECKBOXES_FACET;case Pn.createdTime.name:case Pn.updatedTime.name:case Pn.startDate.name:case Pn.endDate.name:return EO.DATE_RANGE_FACET;case Pn.matches.name:case Pn.matchScore.name:return EO.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return EO.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return EO.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return EO.DATE_RANGE_FACET;default:return EO.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},hO=(0,l.pipe)(sO,mO),bO=(0,l.pipe)((0,l.path)(["attrType","type"]),wr),OO=(0,l.cond)([[yO,(0,l.always)(en.IN_RANGE)],[fO,(0,l.always)(en.WITHIN)],[(0,l.allPass)([bO,e=>e.values.length>=2]),(0,l.always)(en.EXISTS)],[l.T,(0,l.always)(en.EQUALS)]]),vO=(0,l.cond)([[fO,(0,l.prop)("values")],[yO,(0,l.prop)("values")],[bO,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]]]);function gO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _O=(0,l.pipe)((0,l.path)(["attrType","type"]),_r),AO=(0,l.pipe)((0,l.path)(["attrType","type"]),Rr),NO=(0,l.pipe)((0,l.prop)("attrType"),Ms),RO=(0,l.pipe)((0,l.prop)("attrType"),Fs),PO=e=>t=>t.values.map((t=>qr(e,t).label)).join(" , "),SO=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),wO=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(Tn().number),SO)),(0,l.join)(","))(e.values);return`${uO(e)}: ${t}`},IO=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),SO)),(0,l.join)(","))(e.values);return`${uO(e)}: ${t}`},UO=e=>t=>`${uO(t)}: ${oO(e,t).join(", ")}`,CO=e=>t=>{const r=lO(e,t);return`${uO(t)}: ${r.join(", ")}`},LO=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[RO,PO(e)],[AO,wO],[_O,IO],[NO,UO(e)],[l.T,CO(t)]]),r))),jO=(e,t,r,n)=>(0,l.pipe)(l.values,(0,l.reject)((0,l.pipe)((0,l.prop)("values"),E)),(0,l.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gO(e,t,r[t])}))}return e}({},t,{attrType:sO(e,t,n)}))),LO(e,r))(t),DO=new RegExp(`^${Tn().text("Search")}`),kO=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...jO(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(DO,"",u)]},xO=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(ln),FO=e=>(e=>xO.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]=gu(t);return e.replace(r,i).replace(n,a)}),e))(e),MO=(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}`})),$O={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},VO=e=>[$O.geoPolygon,$O.onMapMove].includes(e),GO=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},WO=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},YO=(e,t)=>VO(e)?t.map(GO):[WO(t)],BO=e=>VO(e)?Tn().text("Geo Polygon"):Tn().text("Geo Location"),qO=e=>{switch(e){case $O.geoLocation:return"geoLocation";case $O.geoPolygon:case $O.onMapMove:return"geoPolygon"}},QO={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},HO=e=>Tn().text(e),KO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[en.EQUALS]:"=",[en.NOT_EQUALS]:"≠",[en.STARTS_WITH]:"*",[en.MISSING_VALUE]:Tn().text("missing value"),[en.HAS_ALL]:Tn().text("has all"),[en.IN_RANGE]:Tn().text("in range"),[en.FULL_TEXT]:Tn().text("full text"),[en.EXISTS]:Tn().text("exists"),[en.COUNT_EQUALS]:`${Tn().text("count")} =`,[en.COUNT_NOT_EQUALS]:`${Tn().text("count")} ≠`,[en.COUNT_LT]:`${Tn().text("count")} <`,[en.COUNT_LTE]:`${Tn().text("count")} <=`,[en.COUNT_GT]:`${Tn().text("count")} >`,[en.COUNT_RANGE]:Tn().text("count range"),[en.LT]:"<",[en.LTE]:"<=",[en.GT]:">",[en.GTE]:">=",[en.IN_FILE]:Tn().text("in file"),[en.NOT_IN_FILE]:Tn().text("not in file"),[en.CONTAINS]:"~",[tn.LIST_EQUALS]:"=",[tn.NOT_LIST_EQUALS]:"≠",[tn.LIST_EQUALS_CASE_SENSITIVE]:"=",[tn.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||Tn().text(e.toLowerCase())},JO=e=>({type:QO.operator,text:e}),XO=e=>({type:QO.operator,text:HO(e)}),zO=e=>({type:QO.attributeLabel,text:e}),ZO=e=>({type:QO.specialAttributeLabel,text:e}),ev=e=>({type:QO.attributeFilter,text:KO(e)}),tv=e=>({type:QO.attributeValue,text:e}),rv=e=>({type:QO.entityTypeLabel,text:e}),nv=()=>({type:QO.space,text:" "}),iv=()=>({type:QO.bracket,text:"("}),av=()=>({type:QO.bracket,text:")"}),ov=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),sv=(0,l.curry)(((e,t)=>t.map(ov(e)))),lv=(0,l.curry)(((e,t,r)=>[e,...r,t])),uv=lv(iv(),av()),cv=lv(nv(),nv()),pv=(0,l.curry)(((e,t)=>[e,...t])),dv=e=>pv(rv(e)),yv=e=>pv(rv(`${e}: `)),fv=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=tu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Zl(s),a=eu(s);!r&&t&&n&&(i.push(iv()),r=!0),i.push(o),r&&a&&(i.push(av()),r=!1);const l=e?XO(s):JO(s);i.push(...cv([l]))}else i.push(o),r&&(i.push(av()),r=!1)}return i}},Tv=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),Ev=(0,l.pipe)(fv({localizable:!1}),Tv),mv=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},hv=e=>{let{data:t,values:r,filter:n}=e;return t&&Fu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},bv=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(hv)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),Ov=(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)&&Tr(e.data.attrType)})(e)&&[en.HAS_ALL,en.EQUALS,en.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:fr((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})))),ob),vv=(e,t)=>(0,l.pipe)(Ov,sb(t))(e),gv=(0,l.pathEq)(["data","fieldName"],Pn.type.name),_v=(0,l.path)(["data","entityTypeUri"]),Av=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),Nv=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(rs(e)),attributes:(0,l.filter)((0,l.pipe)(_v,(0,l.anyPass)([l.isNil,rs(e),r=>{const n=(t.entityTypes||[]).filter(rs(e));return(n.length>1?Xr(e,n):null)===r&&!!qr(e,r)}])))})(t))))),Rv=e=>(0,l.pipe)((0,l.prop)("filter"),$l,(0,l.equals)(e)),Pv=(0,l.curry)(((e,t,r,n,i,a)=>{const o=xs(n.fieldName)||n.attrType,s=hu(o,i),u=lb({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Tr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?eb(a.lookupCode,a.value):rb(r,fr(o),a)],[()=>Ms(s),()=>To(e,n.entityTypeUri,a)],[()=>$s(s),()=>xo(e,a)],[()=>qs(s),()=>$o(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Rr(c)||wr(c)),fu),tv)()})),Sv=(e,t,r,n)=>{const i=Pv(e,t,r,n.data,n.filter);return(0,l.cond)([[Rv(0),(0,l.always)([])],[(0,l.both)(Rv(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[nv(),i(r),{type:QO.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[nv(),...(0,l.pipe)(l.flatten,(0,l.map)(i),sv({type:QO.punctuationMark,text:", "}))(t)]}]])(n)},wv=(e,t)=>{const r=!!xs(e.data.fieldName);return(0,l.pipe)(mv,r?ZO:zO)(e,t)},Iv=(e,t,r,n,i)=>[wv(n,i),nv(),ev(n.filter),...Sv(e,t,r,n)],Uv=(0,l.addIndex)(l.map),Cv=(0,l.propEq)("length",1),Lv=(0,l.propSatisfies)((0,l.lt)(1),"length"),jv=(0,l.complement)(l.isEmpty),Dv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(iu,(0,l.filter)(hv),au,(0,l.map)((n=>({operand:Iv(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,fv()))(n)},kv=(0,l.pipe)(Dv,l.flatten),xv=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>ud(e,{type:t}))).join(", ");return r?t(r):l.identity},u=Dv(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(dv),(0,l.pipe)(s(yv),(0,l.unless)((()=>Cv(u)||i),uv)))(u)},Fv=(e,t,r,n)=>(0,l.pipe)(iu,(0,l.filter)(bv),au,Uv(((n,i,a)=>({operand:xv(e,t,r,n,Cv(a)),operator:n.operator}))),fv(),l.flatten)(n),Mv=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),fv(),l.flatten),$v=e=>{let{searchType:t,values:[r]}=e;return YO(t,r).join(", ")},Vv=(e,t,r,n,i,a)=>{const o=(e=>e?[ZO(e.isRawFilter?Tn().text("Raw filter"):Tn().text("Search")),...cv([ev(en.EQUALS)]),tv(`"${e.value}"`)]:[])(i),s=(e=>e?[ZO(BO(e.searchType)),nv(),tv($v(e))]:[])(a),u=(0,l.pipe)(Fv,(0,l.when)((e=>Lv(e)&&(jv(o)||jv(s))),uv))(e,t,r,n);return Mv([o,s,u])},Gv=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),Wv=(0,l.pipe)(Vv,Gv),Yv=(0,l.has)("attributes"),Bv=Array.isArray,qv=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),Qv=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=Hv(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)(qv(a))),uv),(0,l.concat)(cv([JO(o)]))))(s)},Hv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Yv(n)?Qv(e,t,r,n,i):Bv(n)?n.reduce(((n,a)=>n.concat(Hv(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(cv([JO(n.operator)])))(Iv(e,t,r,n,i))},Kv=(e,t,r,n,i)=>(0,l.pipe)(Hv,l.flatten)(e,t,r,n,i);function Jv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xv(e,t,r[t])}))}return e}function Xv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zv=(0,l.complement)(gv),Zv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(gv),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(_v),(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}},eg=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=Zv(t);return(r||n)&&ru(t)},tg=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(eg)),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(gv).some((0,l.propEq)("filter",en.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}=Zv(r);if(eg(e))t.push(Jv({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(zv)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(gv,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(_v,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(zv),entityTypes:n,operator:i?a:e.operator,id:Dh()()}}));t.push(...n)}var a;return t})(t))),[]))),rg={[en.EQUALS]:en.ON,[en.IN_RANGE]:en.WITHIN,[en.GTE]:en.AFTER,[en.GT]:en.AFTER,[en.LTE]:en.BEFORE,[en.LT]:en.BEFORE},ng=(0,l.curry)((e=>rg[e]||e)),ig=(0,l.curry)(((e,t)=>{switch(e){case en.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case en.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),ag=(0,l.pipe)((0,l.path)(["data","attrType","type"]),_r),og=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>Jv({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return ag(e)?(0,l.evolve)({filter:ng,values:ig(t)},e):e}))})))})),sg=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),tg,Nv(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")))})),og,(0,l.reject)(Av))(r)));function lg(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){ug(e,t,r[t])}))}return e}function ug(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cg=(e,t)=>({data:{uri:st(e.fieldName)?nt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||OO(e),id:Dh()(),values:vO(e)}),pg=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=xs(a,t,r)||br(e,i);if(!s)return null;if(ar(s))return lg({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=ud(e,{type:o}),i=(hr(e,nt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return lg({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),dg=(0,l.curry)(((e,t,r,n)=>sg(pg,e,n,t,r)));function yg(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){fg(e,t,r[t])}))}return e}function fg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tg=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},Eg=e=>"rdmLookups.not.resolved"===e?Pn.notResolved.name:e,mg=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===on?en.IN_RANGE:sn(a),u=Eg(n),c=xs(u)||br(e,i),p=(0,l.cond)([[()=>Yl(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>yg({},e,{filename:Zh(e)}))))],[()=>wr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Gl(s)&&!Array.isArray(e[0])&&!_r(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:Dh()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===on?"and not":"and",filter:s,values:p}})),hg=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(mg(e,Xr(e,i)));return[{id:Dh()(),operator:"or",attributes:a,entityTypes:i}]})),bg=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),Og=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([bg("from"),bg("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,()=>[]]]),vg=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return yg({},r,{values:Og(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Cs(e.fieldName,n):e.fieldName})},gg=(e,t)=>{if((0,l.has)("children")(e)){const r=vg(e,t);return e.children.reduce(((e,n)=>(e.push(gg(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return vg(e,t)},_g=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(vg(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(yg({fieldName:e.fieldName},vg(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(gg,l.flatten)],[l.T,vg]]),Ag=(0,l.pipe)((0,l.map)(_g),l.flatten),Ng=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},Rg=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=hg(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:Ag(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>yg({},t,{type:hO(e,t)}))).map((e=>yg({},e,{values:TO(e)?Ng(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 cg(r,t)})),operator:"or",id:Dh()(),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=>({[Eg(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[yg({},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 dg(e,t,r,p)},Pg=(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)(pO),(0,l.partition)(dO))(t),i=n.map((t=>lg({},t,{type:hO(e,t)}))).map((e=>cg(e))),a=r.values||[];return[{attributes:i,operator:"or",id:Dh()(),entityTypes:a}]})(e,a);return dg(e,t,r,o)})(e,t,r,n):Rg(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},Sg=e=>"2.0"===e.version?e.keyword:Tg(e),wg=e=>(0,l.pathEq)(["object","uri"],e),Ig=(e,t)=>(0,l.pipe)((0,l.find)(wg(e)),(0,l.prop)("object"))(t),Ug=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"),wg(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Ig(r.match,t)||n[r.match];return{label:Gp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return fo(e,i.type,t)||{label:t,uri:t}}))}};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)))(i)},Cg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),Lg=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),jg=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[]}=t;const a=(0,l.propOr)({},n,r);return{label:Gp((0,l.prop)("label",a)),matchRules:i.map((function(t){return fo(e,a.type,t)||{label:t,uri:t}}))}})))(t),Dg=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)},kg=(0,l.path)(["object","uri"]),xg=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Fg=e=>e.getValue(),Mg=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=Mg(n[e],t),!r);e++);return r},$g=(e,t)=>{const r=[],n=(0,l.pipe)(Fg,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)($g,[t]),a);return r.push.apply(r,o),r};function Vg(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}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 Wg=(e,t)=>!!e[t],Yg=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},Bg=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||[]])},qg=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Vg({},t,{[r.uri]:Vg({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:Bg(null==o?void 0:o.parents,n),children:Bg(null==o?void 0:o.children,i),values:Bg(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},Qg=e=>e.children?e.children.flatMap(Qg):e,Hg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=qr(r,t)||vi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Qo(r,n,i).flatMap(Qg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>br(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=qg({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>qg({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},Kg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!qe(e.uri)&&ze(e.type)&&ze(t)&&!t.startsWith(e.type))(n,t))return e;const i=hs(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(ns),(0,l.map)(Yg))(i);return qg({structure:e,attrType:e[t].attrType,values:a})}),t)},Jg=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 Wg(e,r)}));return r||n?t.filter(ns).reduce(((e,t)=>Jg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Wg(t,e.type)?qg({structure:t,attrType:t[e.type].attrType,values:[Yg(e)]}):t}},Xg=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Vg({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},zg=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=hs(i,n,r)||[];return a.length?qg({structure:t,attrType:t[r].attrType,values:a.filter(ns).map(Yg)}):t},Zg=(e,t,r)=>{const n=Ke(e),i=Ke(t);return n===i?((e,t)=>{const r=ut(t),n=ut(e);return et(n,r)})(e,t):!(!r||!lt(t))&&QT(r,i).includes(n)},e_=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},t_=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?BT(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return Zg(r,t,o)}))},r_=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>r_(e,t,r)))))},n_=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&e_(n,e)}},i_=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ke(n),c=qT(u,o,i,a),p=r_("children",t,l),d=r_("parents",t,l),y=p.flatMap((e=>r_("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Zg(t,n,c)})).map((t=>n_(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Zg(n,t,c)||Ke(t)!==u&&Zg(t,n,c)})).map((t=>n_(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=r_("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&Zg(n,t,c)}))})).map((t=>n_(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return Zg(t,n,c)})).map((e=>n_(r,n,e,s))),...T,...E,...f]},a_=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=lb({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=>$p(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[ur,()=>a(n)],[Tr,()=>(e=>{const r=o(e),n=fr(t);return Il([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return rb(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},o_=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:en.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(s_(r,t)):i.push(l_([t],r)),i},s_=(e,t)=>{const r=or(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=ur(i)?s_(i,t[r]):[l_(t[r],i)];return e.push(...a),e}}),[])},l_=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:yr(t.uri),filter:t.type===$t.TYPE_BLOB?en.FULL_TEXT:en.EQUALS,values:e}:{fieldName:yr(t.uri),filter:en.MISSING_VALUE},u_={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},c_={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([[2864],{99493:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Ss,PY2:()=>bn,Ng6:()=>bt,YJ7:()=>dn,NlI:()=>rn,Xt7:()=>Tt,wfT:()=>ei,EMD:()=>Gn,HAc:()=>Et,PEf:()=>An,oA3:()=>Vn,$XE:()=>jt,eWf:()=>gn,q7e:()=>mt,KVe:()=>ti,WVQ:()=>jr,oZZ:()=>pi,bNA:()=>di,Rjq:()=>yi,G39:()=>Rn,yn8:()=>Ut,N0y:()=>It,dZX:()=>kt,bQt:()=>Ti,oS0:()=>Vt,lL_:()=>un,Nsj:()=>fn,psV:()=>pn,xPW:()=>On,pyR:()=>Hn,p8l:()=>Yn,Wkf:()=>ft,zHr:()=>yt,NIO:()=>dt,$26:()=>bO,Esk:()=>kn,s9T:()=>St,MEy:()=>cu,j5E:()=>tn,vAw:()=>$n,NMQ:()=>Mn,mNm:()=>qn,rwv:()=>ui,s_5:()=>Kn,RgZ:()=>Bn,unl:()=>ci,Qy0:()=>fi,pYu:()=>jn,wIJ:()=>WO,GFH:()=>vt,S91:()=>Pn,p3$:()=>bi,wSh:()=>Z,BDP:()=>wi,pGS:()=>Qn,ARY:()=>Gt,XGc:()=>Zn,fO_:()=>Gr,wwy:()=>Nt,_XL:()=>yn,j2V:()=>ri,dMV:()=>Xn,NBX:()=>$g,OXy:()=>Wt,BXd:()=>Ct,CJB:()=>ai,lXI:()=>Mt,nqG:()=>mi,C68:()=>Nn,yxQ:()=>Ei,Yj_:()=>Rt,D25:()=>_t,ZIY:()=>xt,Tl4:()=>JO,lwr:()=>_n,NkU:()=>ni,Rtp:()=>zn,YGx:()=>Lt,uTS:()=>Jn,MCv:()=>ht,IYE:()=>Wn,PiC:()=>li,tJI:()=>Ot,fDt:()=>gt,cNQ:()=>ii,SwE:()=>xn,ZHR:()=>si,lD1:()=>Sn,lVm:()=>Dt,vnX:()=>Yb,$x5:()=>Bb,_R1:()=>Gb,wUm:()=>Wb,z7V:()=>hi,dC6:()=>wt,MBD:()=>At,GmF:()=>oa,cKm:()=>Ft,iP_:()=>vn,NVC:()=>Pt,tPT:()=>tl,tZe:()=>Lp,kRE:()=>jy,psB:()=>ky,X0$:()=>el,zE1:()=>cl,Wm5:()=>Ys,vyX:()=>tc,wLZ:()=>rl,W4V:()=>se,EtK:()=>ms,Wtd:()=>Zs,asT:()=>Zg,kGs:()=>ge,ewt:()=>TT,O_f:()=>nu,sOy:()=>et,Tde:()=>fr,LMI:()=>Fu,skb:()=>Mv,sPt:()=>wu,sH1:()=>Iu,RPM:()=>uE,h27:()=>Hu,Uqd:()=>ec,xG:()=>zv,Z2f:()=>lb,fgW:()=>bv,I69:()=>Yv,ZxB:()=>qv,mdt:()=>iE,Qbq:()=>Bh,rny:()=>Wi,UEY:()=>Pa,Q0T:()=>Ra,Lyr:()=>Da,sBn:()=>Na,itK:()=>va,H9$:()=>Aa,KPc:()=>_a,zos:()=>ga,ELQ:()=>ja,dZs:()=>pa,Cz4:()=>ca,z_L:()=>Ca,fGe:()=>ua,iuF:()=>ba,Wib:()=>Oa,Hn0:()=>La,obS:()=>ka,E$L:()=>da,XUh:()=>ha,Qp_:()=>Ea,_jk:()=>ya,sKE:()=>fa,WmG:()=>ma,QKx:()=>Ia,Oik:()=>wa,s0A:()=>Ta,o9m:()=>Sa,MCd:()=>Ua,RsS:()=>Ku,tGK:()=>Cl,lIv:()=>pl,Vg3:()=>Ji,mkC:()=>xi,xv5:()=>zi,a14:()=>Mi,yv0:()=>Xi,Zm0:()=>Fi,Nxd:()=>ki,$mM:()=>Ki,ifj:()=>xr,NWi:()=>Pb,xr3:()=>Rb,wNf:()=>Gl,iJH:()=>Sb,d89:()=>Li,Edd:()=>Di,Z5t:()=>ji,uGe:()=>Ui,UoR:()=>Ii,xvW:()=>Nb,$qe:()=>Ab,yPM:()=>la,$cp:()=>ul,vKJ:()=>sl,AID:()=>If,B1H:()=>Fg,b7X:()=>Gh,$uE:()=>_e,keo:()=>Yh,C_p:()=>qE,G27:()=>Ym,JA0:()=>Ay,b3T:()=>ve,oC6:()=>be,_Zs:()=>Oe,epC:()=>Ne,YYG:()=>Ae,f_2:()=>Ry,w3l:()=>Og,QHB:()=>Wm,Jso:()=>Pg,RXH:()=>Im,Vr9:()=>zm,lMm:()=>kh,BlA:()=>u_,fmQ:()=>us,yRD:()=>ug,NcL:()=>zE,QK6:()=>de,ymd:()=>Ep,JV_:()=>Ky,XiW:()=>Hf,Yrx:()=>yy,GPx:()=>zs,gjI:()=>Xs,vlo:()=>LT,E_P:()=>ZT,aAL:()=>np,NBq:()=>cs,wp9:()=>nE,DsR:()=>Xc,MPc:()=>jf,gWE:()=>kf,DT_:()=>xf,ipn:()=>Mf,ORg:()=>Ri,_wz:()=>Ff,RYR:()=>cT,PP2:()=>Ey,wS7:()=>Tb,cBQ:()=>kc,pBq:()=>Tf,DsO:()=>ee,X78:()=>Xy,xZs:()=>By,YFy:()=>Ty,Gmt:()=>$y,K$w:()=>My,DSj:()=>ip,k9j:()=>Fc,ww$:()=>nl,WVU:()=>Fy,hxF:()=>qs,nwO:()=>d_,Mzk:()=>Uc,aFF:()=>Xh,HRH:()=>yu,EZK:()=>Bp,Kxm:()=>Vp,Z9i:()=>PE,CrF:()=>Uy,DNd:()=>Fa,vUy:()=>i_,lJh:()=>Eu,zHo:()=>mu,sEJ:()=>Gg,UO$:()=>vf,zeJ:()=>Or,dLR:()=>vs,JQy:()=>Rs,XtP:()=>bs,Ug0:()=>zr,A1W:()=>Wh,sw:()=>Yp,nv3:()=>kb,JgD:()=>jb,nve:()=>Wg,SkP:()=>Ps,SAs:()=>mf,PWK:()=>xo,IM5:()=>Os,Mfk:()=>Vh,mB6:()=>pb,p6d:()=>w,o0x:()=>U,ufS:()=>eb,k7L:()=>tb,mrB:()=>I,ncP:()=>He,Zmi:()=>We,hm5:()=>Be,ECL:()=>$r,vPL:()=>Hp,qmL:()=>XT,hXd:()=>Bi,OCS:()=>qi,p2l:()=>Is,qF1:()=>mp,_X$:()=>hp,yj2:()=>MO,bzh:()=>sE,k66:()=>Qo,kiP:()=>lo,pSg:()=>ce,kz_:()=>Oy,H_U:()=>Ko,t9e:()=>Ba,j2$:()=>Dp,PFL:()=>nr,aJ3:()=>cO,To9:()=>Tr,wpo:()=>fd,ADq:()=>gE,UUb:()=>OE,tQX:()=>vE,xy8:()=>sr,EUG:()=>vr,AFK:()=>ot,X3M:()=>br,WN0:()=>Ho,kDl:()=>gs,uDV:()=>JT,IhQ:()=>As,R$r:()=>zT,w80:()=>No,Pfu:()=>Wa,Gtj:()=>Al,fyF:()=>_l,kkq:()=>qo,u5q:()=>Ke,O$n:()=>dd,ptG:()=>yd,f4_:()=>am,uap:()=>im,d7q:()=>dy,liG:()=>my,$oF:()=>py,avf:()=>_T,DiQ:()=>gT,cfX:()=>vT,vD3:()=>NT,Qrb:()=>OT,EJQ:()=>AT,HWy:()=>bT,gjS:()=>yT,y6v:()=>hT,JUW:()=>Py,GtP:()=>Tm,_kX:()=>$a,u1e:()=>Va,sJj:()=>Hh,CJp:()=>ym,uKF:()=>Qh,wo0:()=>Dy,s5:()=>$o,cwx:()=>Mo,Y6b:()=>ty,TTx:()=>Wy,UtR:()=>ry,HaQ:()=>Yy,E6I:()=>Iy,Won:()=>iy,vTU:()=>Zd,Nsy:()=>rd,KMQ:()=>Jh,Do$:()=>od,CSV:()=>Ls,TMe:()=>ny,l1V:()=>bu,VQ1:()=>_u,z7d:()=>DT,Xaq:()=>zo,Sj8:()=>s_,PJj:()=>wl,k3T:()=>en,PjQ:()=>Si,s7l:()=>Ac,GGR:()=>wT,j5q:()=>PT,DnY:()=>vc,RY5:()=>YT,Px$:()=>pT,KPC:()=>jg,NIY:()=>wc,HvW:()=>Rc,Fof:()=>qa,BTI:()=>ld,uie:()=>Xp,ChB:()=>qp,q27:()=>Ed,fAQ:()=>tf,XkT:()=>Oc,lrH:()=>rf,nt9:()=>Qr,XH8:()=>pd,XH2:()=>Zr,jFi:()=>cd,qhs:()=>Ao,wwR:()=>sd,Uk3:()=>st,ev7:()=>Mg,RB9:()=>_y,iFp:()=>pE,e$p:()=>yE,PcX:()=>fE,SpP:()=>dE,R6_:()=>dO,CY1:()=>OO,Ajk:()=>Ec,Yiz:()=>Tc,FK9:()=>uc,UOo:()=>rb,aTW:()=>Gy,uug:()=>Vl,P$2:()=>_O,XS2:()=>Ll,Hyb:()=>Zl,d3Y:()=>ac,Klp:()=>sc,WxZ:()=>AO,Gzu:()=>hu,ZOr:()=>bc,uqV:()=>Jd,Pm4:()=>re,hWO:()=>nt,nVD:()=>qT,dED:()=>uy,P2h:()=>ly,jrr:()=>io,mmY:()=>oo,T6O:()=>Jo,h6J:()=>Ip,hM2:()=>Ig,XR6:()=>X,jmz:()=>KT,IHt:()=>HT,NZI:()=>RE,wdF:()=>Zy,kgP:()=>ef,ZYI:()=>dp,QXK:()=>bl,efz:()=>Ol,Q5d:()=>hl,Ysv:()=>vl,UWq:()=>xT,ocC:()=>kT,io3:()=>Jr,Sbt:()=>Po,roS:()=>Ro,Ww1:()=>So,QaS:()=>Cc,ERZ:()=>hg,CL1:()=>Ug,idV:()=>Wp,nIW:()=>rt,fjE:()=>yO,sG0:()=>nb,tV7:()=>Il,g8o:()=>HO,Qy:()=>QO,t2P:()=>uO,wId:()=>Eo,LS0:()=>mo,bFH:()=>xd,Rgl:()=>Md,fW1:()=>ZE,Ywp:()=>Vb,pg:()=>Od,WSA:()=>$d,fed:()=>Sg,tT_:()=>Ns,KbL:()=>_c,JBA:()=>ct,aNC:()=>Db,RFJ:()=>pp,Zeh:()=>Of,OT5:()=>$b,mC3:()=>yl,kR6:()=>l_,NVY:()=>tE,k6v:()=>bp,FEC:()=>Op,Ob5:()=>md,KUV:()=>hd,dvH:()=>eE,V3i:()=>th,VD3:()=>Xr,mm2:()=>gu,rou:()=>cf,izH:()=>Ga,DK$:()=>Ya,KMp:()=>rp,c31:()=>qt,mbo:()=>AE,gT8:()=>Kt,CZ8:()=>ss,uGi:()=>ys,Poc:()=>Yt,_9k:()=>Es,ZTM:()=>ps,bwT:()=>fs,tzW:()=>Xt,tF$:()=>Ht,o96:()=>ls,M4S:()=>Ts,_vs:()=>Kc,xF8:()=>fT,HQx:()=>zh,ATu:()=>_E,j1S:()=>Ai,V3K:()=>gi,Lmx:()=>_i,ZaZ:()=>Bt,n_1:()=>zd,N6e:()=>Zc,SxO:()=>ao,w3p:()=>rE,xU7:()=>pe,Y_p:()=>Uo,$k6:()=>Io,Gdl:()=>ab,U6P:()=>ib,OwB:()=>pO,hTh:()=>QT,xqc:()=>Vo,JvE:()=>Go,i29:()=>Wu,dzT:()=>Vi,uPS:()=>jc,cZV:()=>Dc,n3B:()=>Rv,e6O:()=>Ov,s7j:()=>GO,j$Q:()=>Sy,kW2:()=>fm,tH7:()=>Fo,Yxg:()=>Fs,MaZ:()=>ST,nqN:()=>RT,jWj:()=>MT,o_J:()=>Zo,hgZ:()=>Qp,yW4:()=>Up,uT0:()=>Sp,C82:()=>wp,u9Z:()=>uf,J$m:()=>Xd,j_Q:()=>pc,OaI:()=>dc,wB1:()=>xg,SP6:()=>bd,ZYr:()=>Dg,IMU:()=>cp,FoU:()=>Ny,DVz:()=>cb,mxe:()=>Av,FHr:()=>hf,D1g:()=>pf,VO3:()=>Kb,de5:()=>Hb,Uw1:()=>Te,J6q:()=>NE,XCe:()=>to,Ir:()=>po,XQO:()=>yo,QXb:()=>Id,P8_:()=>Qy,iiD:()=>tp,MOC:()=>Ud,WF:()=>wd,xE1:()=>Pi,idW:()=>Xg,QWZ:()=>Zh,YL3:()=>Ic,Fn9:()=>T,j2U:()=>ws,MpE:()=>zt,kQw:()=>ar,mfm:()=>eu,vZp:()=>lt,E8K:()=>qg,VSb:()=>as,vr_:()=>ir,Vmh:()=>n_,FgW:()=>eh,oDv:()=>ts,kuw:()=>ns,eHk:()=>FT,Tt2:()=>es,T6Y:()=>Ir,_26:()=>Jl,YkM:()=>yr,J6y:()=>kl,njU:()=>Yl,TBP:()=>rs,IT0:()=>SE,x_:()=>Kh,biM:()=>id,TMl:()=>ad,Vkd:()=>Ql,WiY:()=>mO,_zi:()=>Hl,J6D:()=>vu,Lt4:()=>Ar,QEi:()=>mr,whI:()=>Yr,KIu:()=>qr,JhM:()=>oe,C_0:()=>Lr,qIF:()=>Pv,O27:()=>E,aBi:()=>Td,xOX:()=>Ws,EdS:()=>ze,WgC:()=>Xe,eEv:()=>tr,A4t:()=>Bl,YOQ:()=>ut,Wos:()=>Sr,jWr:()=>xa,Or$:()=>dr,lhE:()=>Kr,CwH:()=>Er,pzC:()=>$s,ymH:()=>Wl,QZu:()=>cr,rYH:()=>EO,FVt:()=>Pr,Kn2:()=>ue,jgw:()=>tu,OXP:()=>is,lS4:()=>hr,g5f:()=>hO,fp6:()=>Ml,Uty:()=>ta,YkG:()=>pr,xdS:()=>Jt,kMF:()=>$f,$NE:()=>Ze,bC9:()=>Je,KVV:()=>qh,q9e:()=>wo,iIf:()=>ob,ian:()=>Qs,m6e:()=>Dr,OFd:()=>Vs,kqr:()=>or,fnZ:()=>Wr,VFZ:()=>Hs,ZiX:()=>qe,j5n:()=>Nr,zkt:()=>_,Pcm:()=>kg,QDV:()=>Ms,M5u:()=>TO,laD:()=>Nv,mtq:()=>er,CtB:()=>sb,CBv:()=>ae,I0t:()=>Cr,u1G:()=>CT,gk1:()=>gv,Bgb:()=>vv,uzs:()=>Br,v0l:()=>Ru,Zqp:()=>ay,j0k:()=>ko,tCm:()=>at,gmx:()=>Dl,mOr:()=>pu,TwZ:()=>KO,GyU:()=>xb,zGm:()=>_d,bMg:()=>Yd,EyD:()=>gb,FQA:()=>_b,fZN:()=>Qd,xsF:()=>Ob,Lxg:()=>vb,O3l:()=>$c,Wni:()=>Mc,wRx:()=>Ib,OxG:()=>Dd,uJQ:()=>Ld,qWg:()=>ub,i96:()=>vd,zhn:()=>wb,G8q:()=>Oi,Jct:()=>aT,A9Y:()=>te,Y5F:()=>cg,gxP:()=>le,c$P:()=>jl,M7o:()=>Zu,BBN:()=>no,ZBU:()=>J,UkJ:()=>ho,xkv:()=>qy,z$M:()=>zg,KAm:()=>gy,lCl:()=>Uf,rkF:()=>QE,IU6:()=>Mp,RGr:()=>h,aYu:()=>m,ije:()=>Sl,Buf:()=>ep,YLu:()=>Pl,ct9:()=>Lo,XkY:()=>Bd,T5R:()=>Ad,uQS:()=>Hd,wcJ:()=>Co,d$I:()=>il,rSp:()=>nd,Sx:()=>Sc,Ilm:()=>dl,Ki6:()=>Bs,VGk:()=>Jc,sFD:()=>Um,eWN:()=>e_,dWE:()=>VO,Lkd:()=>Kf,aDL:()=>gf,yaA:()=>Kd,lOh:()=>yf,DBr:()=>oO,hK$:()=>Ul,TZ_:()=>Fp,CMB:()=>Sv,FU8:()=>Pc,J$p:()=>Rf,b5s:()=>Nf,h2W:()=>it,SL_:()=>of,oUH:()=>Np,ck9:()=>Nd,Xs0:()=>Rl,u7I:()=>df,rxg:()=>au,bji:()=>ou,oCZ:()=>GE,MjG:()=>Qb,FuV:()=>Ap,$ju:()=>Pp,t6d:()=>Rp,m5F:()=>fe,sx:()=>t_,rSc:()=>db,U10:()=>yc,L8n:()=>xy,R9X:()=>ey,rj2:()=>Jy,_C4:()=>jp,tCj:()=>Hy,uAg:()=>fy,wx9:()=>ET,KF3:()=>kp,ax9:()=>xp,HH7:()=>zc,_6y:()=>xc,AJo:()=>Lc,Ixr:()=>wy,P6Y:()=>y_,Bd_:()=>FE,xkB:()=>xE,W41:()=>lf,WkI:()=>sf,sSE:()=>kE,GMd:()=>Mu,Bxm:()=>$E,FVh:()=>UE,U_T:()=>Vd,FTe:()=>ie,VGB:()=>ne,Wfe:()=>Tu,Ls5:()=>fu,$bd:()=>lu});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,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>H,getStartOfDay:()=>P,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>_e,compareActivenessAttributes:()=>ve,compareAttributes:()=>be,compareImages:()=>Oe,compareRoles:()=>Ne,compareTags:()=>Ae});var o={};r.r(o),r.d(o,{addAttribute:()=>Se,editAttribute:()=>we,editEndDate:()=>je,editRoles:()=>Ce,editStartDate:()=>De,editTags:()=>Le,removeAttribute:()=>Ue});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Fe});var l=r(17440);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);return new Date(t.getTime()+60*t.getTimezoneOffset()*1e3)},N=e=>{const t=new Date(e);return new Date(t.getTime()-60*t.getTimezoneOffset()*1e3)},R=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),P=R("startOf"),S=R("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"),L=(0,l.equals)("99"),D=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),x=(0,l.test)(/^9+$/),F=(0,l.test)(/^[9az]+$/),M=(0,l.cond)([[C,(0,l.always)("M")],[L,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[F,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[L,(0,l.always)("DD")],[F,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[D,(0,l.always)("YYYY")],[x,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),L),(0,l.always)("hh")],[C,(0,l.always)("H")],[L,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[L,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),Y=(0,l.cond)([[C,(0,l.always)("s")],[L,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),B=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(B)];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)("",[M(e),r,$(n),i,V(a),o])}return e},Q=/(9+)([^9]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(Q)];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,[G(e,s),r,W(n),i,a?Y(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)} ${H(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?Z.None():Z.Some(t(e))}),Z={Some:z,None:()=>z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},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=>(e=(e||"").toLowerCase(),oe(e)?`mailto:${e}`:!e.includes("://")&&(e.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},pe=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.prop)(e)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,(0,l.always)(e)]])(e)},de=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)},ye=/[\n\r%#()<>?[\\\]^`{}|]/g,fe=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(ye,encodeURIComponent)}`,Te=e=>`data:image/gif;base64,${e}`;function Ee(e){return e&&void 0!==e.uri}function me(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function he(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 be(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(be(d.value,y.value,r)):"Reference"===g(d)?he(d,y)?o.push.apply(o,be(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Oe(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||Ee(r)&&Ee(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function ve(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function ge(e,t){var r="configuration/sources/Reltio";function n(e,t){return e.crosswalk={type:t.type,value:t.value},e}function i(e){return e.removeIt=!0}var a=e.map((function(e){if(e.crosswalk)return[e];var i=t.filter((function(t){return 1===(t.attributes||t.attributeURIs||[]).filter((function(t){return t===e.uri})).length})),a=i.filter((function(e){return e.type===r})),o=i.filter((function(e){return e.type!==r})),s=[];switch(e.type){case"INSERT_ATTRIBUTE":s.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":s=s.concat(i.map((function(t){return n(e,t)})));break;case"DELETE_ATTRIBUTE":(o.length||0==a.length)&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),s=s.concat(a.map((function(t){return n({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":a.length?s=s.concat(a.map((function(t){return n({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)}))):s.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0}),o.length&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}})}return s})),o=[].concat.apply([],a),s=function(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}(o,"typeUri");for(var l in s)if("undefined"!==l){var u=s[l],c=o.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===l||"INSERT_ATTRIBUTE"===e.type&&e.uri===l})),p=u.filter((function(e){return e.crosswalk&&e.crosswalk.type===r}))[0];!c.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0]&&p&&(o.push({type:"UPDATE_ATTRIBUTE",uri:p.uri,newValue:{value:p.value},crosswalk:p.crosswalk}),c.forEach(i)),u.forEach(i)}return(o=o.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),o}function _e(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function Ae(e,t){return me("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return me("UPDATE_ROLES").call(this,e,t)}function Re(e,t,r,n){var i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Pe(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Re(r[i],r[i+1],e,t));return n}function Se(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Pe(r,t)[a];if(s.hasChildren){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Se(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function we(e,t,r,n,i,a){void 0===a&&(a=0);var o=Pe(r,t)[a];if(!o.hasChildren){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Ie(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Ie.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Se(e,t,r,n,i,a),s}var c=we(e,o,o.valueUri,{},i,a);we(c,t,r,n,i,a+1)}function Ie(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ue(e,t,r,n){void 0===n&&(n=0);var i=Pe(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ue(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function Ce(e,t){e.roles=t||[]}function Le(e,t){e.tags=t||[]}function De(e,t){e.startDate=t||""}function je(e,t){e.endDate=t||""}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){xe(e,t,r[t])}))}return e}function xe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Fe=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=ke({},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:ke({},n,{roles:s,tags:u}),roles:i,tags:l}}}},Me=r(76665);const $e="1Tempo4rary",Ve="1Tepmo4Rel",Ge=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),We=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Ye=e=>()=>We(e),Be=(e,t)=>{const r=Ge(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return We(n)},qe=e=>e&&e.includes("uri$$"),Qe=Ye("entities"),He=Ye("relations"),Ke=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Xe=(0,l.startsWith)("entities/"),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),et=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),tt=(0,l.pipe)((0,l.split)("/"),l.head),rt=(0,l.pipe)((0,l.split)("/"),l.last),nt=e=>e.split(".").slice(0,2).join("."),it=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},at=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),ot=(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("/")},st=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},lt=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),ut=e=>5===e.split("/").length,ct=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},pt=e=>e.replace(/uri\$\$/g,$e);let dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Rt,Pt,St,wt,It,Ut,Ct,Lt,Dt,jt,kt,xt,Ft,Mt;var $t;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(dt||(dt={})),function(e){e.local="local",e.validationService="validationService"}(yt||(yt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(ft||(ft={})),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"}(Tt||(Tt={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Et||(Et={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(mt||(mt={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(ht||(ht={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(bt||(bt={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Ot||(Ot={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(vt||(vt={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(gt||(gt={})),function(e){e.PROFILE="profile",e.MAP="map"}(_t||(_t={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(At||(At={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Nt||(Nt={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Rt||(Rt={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Pt||(Pt={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(St||(St={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(wt||(wt={})),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"}(It||(It={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Ut||(Ut={})),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"}(Ct||(Ct={})),function(e){e.IN="in",e.OUT="out"}(Lt||(Lt={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Dt||(Dt={})),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"}(jt||(jt={})),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"}(kt||(kt={})),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.SingleAttributeView="com.reltio.plugins.entity.attributes.SingleAttributeView",e.TableAttributeView="com.reltio.plugins.entity.attributes.AttributeTableView",e.CustomView="com.reltio.plugins.ui.CustomActionView",e.MapView="com.reltio.plugins.react.EntityMapView",e.ImageAttributeView="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatchesView="com.reltio.plugins.entity.PotentialMatchesView"}(xt||(xt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Ft||(Ft={})),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.Search="SearchView"}(Mt||(Mt={})),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"}($t||($t={}));const Vt=$t;let Gt,Wt;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Gt||(Gt={})),function(e){e.Saving="Saving"}(Wt||(Wt={}));const Yt=(0,l.prop)("referencedEntityTypeURI"),Bt=(0,l.prop)("relationshipTypeURI"),qt=(0,l.prop)("referencedAttributeURIs"),Qt=(0,l.curry)(((e,t)=>(0,l.pipe)(qt,(0,l.filter)((0,l.startsWith)(e)))(t))),Ht=Qt("configuration/relationTypes"),Kt=Qt("configuration/entityTypes"),Jt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),Xt=(0,l.filter)(Jt),zt=(e,t)=>!t||t.some((t=>t===e.uri));function Zt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const er=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,ze),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",Vt.TYPE_STRING),(0,l.propEq)("type",Vt.TYPE_BLOB))]),tr=(0,l.has)("values"),rr=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Vt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Vt.TYPE_LOOKUP)],[tr,(0,l.always)(Vt.TYPE_ENUM)],[er,(0,l.always)(Vt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Vt.TYPE_BOOLEAN),(0,l.always)(Vt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),nr=(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){Zt(e,t,r[t])}))}return e}({},e,{type:rr(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),ir=e=>!!e&&(!!e.autoGenerated&&e.type!==Vt.TYPE_NESTED||!!e.parentAutoGenerated),ar=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),or=(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),sr=e=>ar(e)?"analyticsAttributes":"attributes",lr=(0,l.propEq)("hidden",!0),ur=(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))),cr=ur(Vt.TYPE_NESTED),pr=ur(Vt.TYPE_REFERENCE),dr=ur(Vt.TYPE_IMAGE),yr=(0,l.either)(cr,pr),fr=(e,t)=>{const r=ar(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(".")},Tr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Er=(0,l.pipe)(Tr,Boolean),mr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),hr=(0,l.both)(Er,(0,l.pipe)(Tr,("rdm",(0,l.pipe)(tt,(0,l.equals)("rdm")))));const br=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=sr({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]||vr(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:[]},Or=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=br(e,t,r);return n.length?(0,l.last)(n):null},vr=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",Vt.TYPE_NESTED),(0,l.propEq)("type",Vt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Vt.TYPE_REFERENCE),(0,l.pipe)(qt,(0,l.map)((t=>Or(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},gr=[Vt.TYPE_ACTIVENESS_DATE,Vt.TYPE_DATE,Vt.TYPE_TIMESTAMP,Vt.TYPE_LOCAL_DATE],_r=[Vt.TYPE_ACTIVENESS_DATE,Vt.TYPE_TIMESTAMP,Vt.TYPE_LOCAL_DATE],Ar=e=>gr.includes(e),Nr=e=>_r.includes(e),Rr=[Vt.TYPE_INT,Vt.TYPE_LONG,Vt.TYPE_NUMBER,Vt.TYPE_FLOAT,Vt.TYPE_DOUBLE,Vt.TYPE_COUNT],Pr=e=>Rr.includes(e),Sr=e=>[Vt.TYPE_FLOAT,Vt.TYPE_DOUBLE].includes(e),wr=[Vt.TYPE_BOOLEAN,Vt.TYPE_BOOLEAN_RADIO,Vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Ir=e=>wr.includes(e),Ur=[Vt.TYPE_URL,Vt.TYPE_BLOG_URL,Vt.TYPE_IMAGE_URL],Cr=e=>Ur.includes(e),Lr=ur(Vt.TYPE_EMAIL),Dr=e=>Vt.TYPE_SSN===e;var jr,kr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(jr||(jr={}));const xr=(0,l.curry)(((e,t,r)=>{var n;const i=e===jr.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)))})),Fr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Mr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Fr),$r=(0,l.pipe)((0,l.reject)(E),Mr),Vr=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),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("?")?"&":"?")+Fr(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f}},Gr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Wr=(0,l.equals)(Gr.SUGGESTING),Yr=(0,l.equals)(Gr.EDITING),Br=(0,l.equals)(Gr.VIEWING),qr=(0,l.either)(Yr,Wr),Qr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Hr=(0,l.curry)(((e,t)=>(0,l.pipe)(Qr(e),(0,l.prop)("extendsTypeURI"))(t))),Kr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Hr(e,r)));return n(r)})),Jr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Hr(e,n);return r})),Xr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Xr(e,Qr(e,t.extendsTypeURI),r):void 0,zr=(e,t)=>{const r=t.map(Jr(e));return(r.length?r.reduce(l.intersection):[])[0]},Zr=(e,t)=>Xr(e,(0,l.is)(Object,t)?t:Qr(e,t),"typeImage"),en=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Kr(e,t,n.uri)?r.concat(n.uri):r),[]),tn={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"},rn={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},nn={[tn.EQUALS]:"equals",[tn.NOT_EQUALS]:"not",[tn.STARTS_WITH]:"starts with",[tn.MISSING_VALUE]:"missing value",[tn.IN_RANGE]:"in range",[tn.HAS_ALL]:"has all",[tn.FULL_TEXT]:"full text",[tn.EXISTS]:"exists",[tn.COUNT_EQUALS]:"count equals",[tn.COUNT_NOT_EQUALS]:"count not equal",[tn.COUNT_LT]:"count less",[tn.COUNT_LTE]:"count less or equal",[tn.COUNT_GT]:"count greater",[tn.COUNT_GTE]:"count greater or equal",[tn.COUNT_RANGE]:"count in range",[tn.LT]:"less than",[tn.LTE]:"less than or equal",[tn.GT]:"greater than",[tn.GTE]:"greater than or equal",[tn.IN_FILE]:"in file",[tn.NOT_IN_FILE]:"not in file",[tn.CONTAINS]:"contains",[tn.ON]:"on",[tn.BEFORE]:"before",[tn.AFTER]:"after",[tn.WITHIN]:"within"},an="in",on="notIn",sn="not range",ln=e=>({[an]:tn.EQUALS,[on]:tn.NOT_EQUALS}[e]||e),un={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},cn={[un.LAST_DAY]:"Last 24 hours",[un.LAST_3DAYS]:"Last 3 days",[un.LAST_WEEK]:"Last week",[un.LAST_MONTH]:"Last month",[un.LAST_YEAR]:"Last year",[un.PICK_DATE]:"Pick date"},pn={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},dn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},yn="<No label>",fn={IN:"in",OUT:"out"};var Tn=r(87918),En=r.n(Tn);function mn(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){hn(e,t,r[t])}))}return e}function hn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bn={startDate:{type:Vt.TYPE_ACTIVENESS_DATE,get label(){return En().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Vt.TYPE_ACTIVENESS_DATE,get label(){return En().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},On=mn({id:{type:Vt.TYPE_ENTITY_ID,get label(){return En().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},bn,{roles:{type:Vt.TYPE_STRING,get label(){return En().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Vt.TYPE_STRING,get label(){return En().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),vn={workflow:{type:Vt.TYPE_STRING,get label(){return En().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Vt.TYPE_STRING,get label(){return En().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Vt.TYPE_STRING,get label(){return En().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},gn={commenter:{type:Vt.TYPE_STRING,get label(){return En().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},_n={notResolved:{type:Vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return En().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},An={createdBy:{type:Vt.TYPE_STRING,get label(){return En().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Vt.TYPE_STRING,get label(){return En().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Nn={matches:{type:Vt.TYPE_COUNT,get label(){return En().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Vt.TYPE_COUNT,get label(){return En().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Rn={sourceSystems:{type:Vt.TYPE_STRING,get label(){return En().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Vt.TYPE_STRING,get label(){return En().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Vt.TYPE_INT,get label(){return En().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Vt.TYPE_TIMESTAMP,get label(){return En().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Vt.TYPE_STRING,get label(){return En().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Pn={matchRules:{type:Vt.TYPE_STRING,get label(){return En().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:Vt.TYPE_STRING,get label(){return En().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Sn=mn({},On,vn,gn,_n,An,Nn,Rn,Pn,{type:{type:Vt.TYPE_STRING,get label(){return En().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var wn=r(13980),In=r.n(wn);function Un(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){Cn(e,t,r[t])}))}return e}function Cn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ln=In().oneOf(["mobile","tablet","desktop"]),Dn=In().shape({deviceTypes:In().oneOfType([Ln,In().arrayOf(Ln)]),roles:In().arrayOf(In().string)}),jn=In().shape({value:In().string,lookupCode:In().string}),kn=In().shape({link:In().string,filename:In().string}),xn=In().shape({displayName:In().string,parent:In().string}),Fn=In().oneOfType([In().string,In().number,In().bool,jn]),Mn=In().oneOfType([Fn,In().arrayOf(Fn)]),$n=In().shape({fieldName:In().string,values:In().arrayOf(Mn),filter:In().string,type:In().string}),Vn=In().shape({minValue:In().number,maxValue:In().number}),Gn=In().shape({label:In().string,name:In().string,description:In().string,type:In().string,hidden:In().bool,faceted:In().bool,searchable:In().bool,uri:In().string,access:In().arrayOf(In().string),cardinality:Vn}),Wn=In().shape({label:In().string,uri:In().string,typeColor:In().string,direction:In().string,startObject:In().object,endObject:In().object}),Yn=In().shape({typeColor:In().string,typeIcon:In().string,typeImage:In().string,label:In().string,uri:In().string,attributes:In().arrayOf(Gn)}),Bn=In().shape({uri:In().string,label:In().string,memberTypes:In().array,extendsTypeUri:In().string,attributes:In().arrayOf(Gn)}),qn=In().shape({uri:In().string,label:In().string,extendsTypeUri:In().string,relationshipTypeURIs:In().arrayOf(In().string)}),Qn=In().shape({uri:In().string,description:In().string,label:In().string,schemaVersion:In().string,entityTypes:In().arrayOf(Yn),roles:In().arrayOf(In().object),groupTypes:In().arrayOf(In().object),relationTypes:In().arrayOf(Wn),graphTypes:In().arrayOf(qn),interactionTypes:In().arrayOf(Bn),sources:In().arrayOf(In().object)}),Hn=In().shape({uri:In().string,type:In().string}),Kn=In().shape({uri:In().string,attributes:In().object,type:In().string,timestamp:In().number,members:In().object}),Jn=In().shape({uri:In().string,type:In().string}),Xn=In().shape({value:In().object,ov:In().bool,type:In().string,uri:In().string}),zn=In().shape({refEntity:In().oneOfType([In().array,In().object]),refRelation:In().oneOfType([In().array,In().object]),value:In().object,ov:In().bool,type:In().string,uri:In().string}),Zn=In().oneOf((0,l.values)(Gr)),ei=In().shape({type:In().oneOf(Object.values(dt)).isRequired,attributeTypeUri:In().string.isRequired,parentUri:In().string.isRequired,uri:In().string,message:In().string}),ti={attributeType:Gn,showEmptyEditors:In().bool,lazy:In().bool,mode:Zn,metadata:Qn,ownError:ei,errors:In().arrayOf(ei),crosswalks:In().array,onAddAttributes:In().func,onAddOneMore:In().func,onDeleteAttribute:In().func,onChangeAttribute:In().func,additionalControlsRenderer:In().func,hideDeleteButton:In().bool,showNonOv:In().bool,state:In().oneOf(["deleted","edited"])},ri=Un({attributeValue:Xn},ti),ni=Un({attributeValue:zn},ti),ii=In().shape({value:In().oneOfType([In().string,In().bool,In().number]),ov:In().bool,type:In().string,uri:In().string,lookupCode:In().string,lookupRawValue:In().string}),ai=In().shape({totalOvValues:In().number,totalValues:In().number}),oi=In().shape({inRelations:In().arrayOf(In().oneOfType([In().object,In().string])),outRelations:In().arrayOf(In().oneOfType([In().object,In().string])),groups:In().arrayOf(In().string),entityTypes:In().arrayOf(In().string),nextEntry:In().object}),si=In().oneOf(["asc","desc"]),li=In().shape({id:In().string,content:oi,allowOnlyCreateNew:In().bool,sortColumn:In().string,sortOrder:si,"text-empty":In().string,max:In().number,icon:In().string,caption:In().string,canCreate:Dn,canRead:Dn,canUpdate:Dn,canDelete:Dn,editingEnabled:In().bool}),ui=In().shape({id:In().string,graph:In().shape({type:In().string,layout:In().number,deep:In().number,limit:In().number,uri:In().string,options:In().shape({reverseRelations:In().bool})}),sortBy:In().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:si,max:In().number,icon:In().string,caption:In().string,canCreate:Dn,canRead:Dn,canUpdate:Dn,canDelete:Dn}),ci=In().shape({id:In().string,caption:In().string,pageSize:In().number,icon:In().string,canCreate:Dn,canRead:Dn,canUpdate:Dn,canDelete:Dn,attributes:In().object}),pi=In().shape({entityUri:In().string,entityType:In().string,entityLabel:In().string,object:Hn}),di=In().shape({relationUri:In().string,relationType:In().string,relationLabel:In().string,direction:In().string,object:Jn}),yi=In().shape({entity:pi,relation:di}),fi=In().shape({value:In().string,isRawFilter:In().bool}),Ti=In().shape({id:In().string,label:In().string,name:In().string,availableEntityTypes:In().array}),Ei=In().shape({id:In().string,allowMergeAll:In().bool,matchActions:In().object,availableTabs:In().arrayOf(In().oneOf(["findMatches","potentialMatches","notAMatch"]))}),mi=In().shape({matchRules:In().arrayOf(In().string),object:Hn,shortestTransitiveMatchPath:In().arrayOf(In().shape({matchRules:In().arrayOf(In().string),match:In().string})),direct:In().bool,matchScore:In().number}),hi=In().arrayOf(mi),bi=In().arrayOf(In().shape({uri:In().string,label:In().string})),Oi=[{label:En().text("And"),value:"and"},{label:En().text("Or"),value:"or"},{label:En().text("And not"),value:"and not"},{label:En().text("Or not"),value:"or not"}];function vi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),_i=(0,l.pipe)(gi,(0,l.propOr)("","label")),Ai=(0,l.curry)(((e,t)=>{const r=gi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Ni=(0,l.curry)(((e,t,r)=>{const[n,i]=Ai(e,r);return Kr(e,n,t)||Kr(e,i,t)})),Ri=(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){vi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Pi=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?fn.OUT:fn.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(fn.IN),i=r(fn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Si=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),wi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ii=(0,l.curry)(((e,t)=>e.every((e=>Ui(e,t))))),Ui=(0,l.curry)(((e,t)=>{const r=ir(t);return!t||(!t.access||t.access.includes(e))&&(e===wi.READ||!r)})),Ci=(0,l.curry)(((e,t,r)=>Ui(wi.READ,r)&&(Wr(t)?Ui(wi.INITIATE_CHANGE_REQUEST,r):Ui(e,r)))),Li=Ci(wi.CREATE),Di=Ci(wi.DELETE),ji=Ci(wi.UPDATE),ki=Ii([wi.CREATE,wi.MERGE,wi.READ,wi.UPDATE]),xi=Ii([wi.UPDATE,wi.READ,wi.CREATE]),Fi=Ii([wi.UPDATE,wi.READ]),Mi=Ii([wi.DELETE,wi.UPDATE,wi.READ]),$i=(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["*"])),Vi=(e,t,r)=>(0,l.pipe)((0,l.map)($i(e,t)),(0,l.filter)(l.identity))(r),Gi=(e,t,r)=>{const n=Vi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ui(wi.MERGE,r)},Wi=(0,l.curry)(((e,t,r,n)=>{const i=gi(e,n),[a,o]=Ai(e,n);return i&&Ui(wi.CREATE,i)&&Kr(e,a,t.type)&&Kr(e,o,r.type)})),Yi=(e,t,r,n,i)=>{const a=Qr(e,n.type),o=Vi(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(Wi(e,n,i))||a.some(Wi(e,i,n))}))},Bi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Qr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Gi(o,i,a),canAddRelation:Yi(e,o,i,r,n),canMark:Ui(wi.UPDATE,a)&&Ui(wi.READ,a)}},qi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Bi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Qi=ar,Hi=(0,l.complement)(Qi),Ki=Ui(wi.READ),Ji=e=>{let{attributeType:t,mode:r}=e;return Hi(t)&&Li(r,t)&&!lr(t)},Xi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=qe(r.uri),o=ji(n),s=Li(n);return(0,l.cond)([[Qi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},zi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=qe(r.uri),s=ji(n),u=Di(n),c=ea(wi.UPDATE,n,a,r),p=ea(wi.DELETE,n,a,r);return(0,l.cond)([[Qi,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)},Zi=(0,l.curry)(((e,t,r,n)=>{const i=vr(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=>!Ui(e,n)||!Zi(e,t,r[n.name],n)))))})),ea=(0,l.curry)(((e,t,r,n,i)=>Wr(t)?Zi(wi.INITIATE_CHANGE_REQUEST,r,n,i):Zi(e,r,n,i))),ta=(0,l.both)((0,l.complement)(lr),Ki),ra="SuperUser",na="allTenants",ia=[na,"allCustomers"],aa=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;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===ra})).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===ra){const e=r?ia.concat(r.map((e=>`allTenants.${e}`))):ia,n=r&&t[0]===na?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}))},oa={NON_SECURED:"NON_SECURED",SECURED:"SECURED",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},sa={[oa.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[oa.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[oa.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[oa.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[oa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[oa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[oa.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[oa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[oa.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[oa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[oa.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[oa.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[oa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[oa.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[oa.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[oa.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[oa.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[oa.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[oa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[oa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[oa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[oa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[oa.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[oa.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[oa.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[oa.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[oa.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[oa.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[oa.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[oa.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},la=(0,l.curry)(((e,t,r)=>aa({allowedPermissionsNames:e,permissionsNames:oa,permissionsConfig:sa}).some((e=>e(t,{params:{tenant:r}}))))),ua=la([oa.CAN_EXPORT]),ca=la([oa.CAN_EXPORT_ACTIVITIES]),pa=la([oa.CAN_IMPORT_ENTITIES_FROM_DT]),da=la([oa.CAN_READ_ENTITIES_FROM_DT]),ya=la([oa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),fa=la([oa.CAN_UPDATE_PROCESS_INSTANCE]),Ta=la([oa.CAN_VIEW_WORKFLOW_DEFINITION]),Ea=la([oa.CAN_CONFIG_ENVIRONMENT_REGISTER]),ma=la([oa.CAN_UPDATE_WORKFLOW_DATA_TASK]),ha=la([oa.CAN_READ_WORKFLOW_DATA_TASK]),ba=la([oa.CAN_MANAGE_WORKFLOW_DEFINITION]),Oa=la([oa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),va=la([oa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),ga=la([oa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),_a=la([oa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Aa=la([oa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Na=la([oa.CAN_EXECUTE_WORKFLOW_JOBS]),Ra=la([oa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Pa=la([oa.CAN_CREATE_CONFIG_JAR]),Sa=la([oa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),wa=la([oa.CAN_VIEW_CONFIG_JAR]),Ia=la([oa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Ua=la([oa.CAN_VIEW_WORKFLOW_JOBS]),Ca=la([oa.CAN_MAKE_BULK_UPDATE]),La=la([oa.CAN_OPEN_DATA_LOADER_EXECUTE,oa.CAN_OPEN_DATA_LOADER_READ]),Da=la([oa.CAN_BULK_DELETE_PROFILES]),ja=la([oa.CAN_READ_MDM_DATA_ENTITIES]),ka=la([oa.CAN_READ_DVF]),xa=la([oa.IS_FREEMIUM_ADMIN]),Fa=(0,l.reject)(lr),Ma=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Fa,(0,l.filter)(e))(t),$a=(0,l.curry)(((e,t)=>Ma((t=>Ji({attributeType:t,mode:e})),t))),Va=(0,l.curry)(((e,t)=>Ma((t=>Ji({attributeType:t,mode:e})||ta(t)),t))),Ga=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ta)),Wa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Wa(e)])))),Ya=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ta),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ya(e)])))),Ba=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Ba(e)])))),qa=(0,l.pipe)(Qr,(0,l.converge)(l.concat,[Ya,Ba]));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 Ka=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Ka(e)))},t))),Ja=e=>{var t;return Qa({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Xa=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),za=(0,l.when)(Xa,(0,l.dissoc)("values")),Za=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Qa({},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})})),eo=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},to=(0,kr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Wa,t).concat((0,l.chain)(Wa,r)).some(eo)})),ro=e=>{let t=!1;const r=Ka((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Qa({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},no=e=>{const t=to(e),r=(0,l.map)((e=>Ka((0,l.pipe)(za,(0,l.when)((0,l.always)(e),Za))))(t)),n=(0,l.map)(Ja),i=(0,l.map)(ro);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},io=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),ao=(0,l.prop)("relationshipTypeURIs"),oo=(0,l.curry)(((e,t)=>e.graphTypes.filter(so(e,t)))),so=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(Ni(e,t))},lo=(e,t)=>(0,l.pipe)(io,(0,l.defaultTo)({}),ao,(0,l.defaultTo)([]),(0,l.chain)(Ai(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Qr(e)))(e,t),uo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),co=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),po=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return co((0,l.complement)(uo))(e)},yo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return co(uo)(e)},fo=(0,l.pipe)(Qr,(0,l.propOr)([],"matchGroups")),To=(e,t,r)=>(0,l.pipe)(fo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),Eo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(To,(0,l.propOr)(r,"label"))(e,t,r))),mo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(fo,(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]})),ho=e=>(0,l.partition)(uo,e),bo=(0,l.includes)(l.__,["and","or","not"]),Oo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),vo=(0,l.includes)(l.__,["equals","notEquals","in"]),go=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return bo(t)?go(r):Oo(t)?r.filter(ze):vo(t)?r.map((0,l.prop)("uri")).filter(ze):[]})),l.uniq),_o=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(go),l.uniq),Ao=(0,l.pipe)(fo,_o),No=(0,l.pipe)(mo,_o),Ro=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Po=(0,l.pipe)(Ro,Ya),So=(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||Kr(e,n,t)})(e,t))})(e,t)),wo=e=>!!e.required,Io=(e,t,r)=>{const n=(0,l.cond)([[ze,Qr(e)],[Ze,gi(e)]])(t);return Uo(e,n,r)},Uo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&ze(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!ir(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===Vt.TYPE_REFERENCE){const n=Bt(t),a=qt(t);i=Io(e,n,r).filter((e=>a.some(et(e.uri))))}else t.attributes&&(i=Uo(e,t,r));i&&n.push(...i)}return n})):t.type===Vt.TYPE_REFERENCE?Io(e,Bt(t),r):[],Co=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),wo]),e.attributes||[])},Lo=(e,t)=>{const r=Kt(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},Do=(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)?En().text(n):n};return r(null,t)})),jo=["label","description","abbreviation","caption","toolTip"],ko=e=>Do(jo,e),xo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=rt(t);return r.find((e=>{let{uri:t}=e;return rt(t)===n}))})),Fo=(0,l.curry)(((e,t)=>{const r=rt(t);return(0,l.pipe)(xo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Mo=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"})},$o=(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}))},Vo=(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)})),Go=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Qr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));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 Bo=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 qo(i,e,t,r,n)},qo=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]:["attributes"];return Z.fromNull(e&&e.length?e:vr(t,r)).map((e=>e.map((e=>{const r=Bo(t,e,n,i);return r.length?Wo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(yr),(0,l.prop)("children"))).filter(ta).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Qo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Bo(e,t,r,["attributes","analyticsAttributes"])},Ho=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Bo(e,t,r,["attributes"])},Ko=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Bo(e,t,r,["analyticsAttributes"])},Jo=(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)})),Xo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return rt(r)===e})))),zo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Xo("LUD")),(0,l.defaultTo)(r))(t||[])},Zo=(e,t)=>{let{survivorshipStrategies:r}=e;return Xo(t,r)},es=(0,l.allPass)([(0,l.complement)(l.isNil),Ui(wi.READ)]),ts=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ui(wi.READ)]),rs=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ui(wi.CREATE)]),ns=(0,l.curryN)(2,(0,l.pipe)(Qr,ts)),is=e=>{let{ov:t}=e;return!1!==t},as=(e,t)=>((e,t)=>Cr(e.type)&&ae(t))(e,t)||((e,t)=>Lr(e.type)&&oe(t))(e,t),os=(0,l.curry)(((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))),ss=os("refEntity"),ls=os("refRelation"),us=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],cs=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},ps=(0,l.prop)("objectURI"),ds=(0,l.prop)("objectURI"),ys=(0,l.prop)("type"),fs=(0,l.pipe)(ss,(0,l.defaultTo)({}),ps),Ts=(0,l.pipe)(ls,(0,l.defaultTo)({}),ds),Es=(0,l.pipe)(ss,(0,l.defaultTo)({}),ys),ms=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},hs=(0,l.evolve)({refEntity:re,refRelation:re}),bs=(e,t,r,n)=>{const i=br(e,r),a=Qr(e,t.type)||gi(e,t.type);if(0===i.length)return null;const o=sr(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!zt(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=a.attributes.filter((e=>Bt(e)===r.uri||Yt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},Os=(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?Os(a.value,o):a},vs=(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 Os(e[r],i)})),gs=(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")]]),_s=(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.map)(gs),(0,l.when)((()=>i.length>0),(0,l.map)(_s(e,i))))(r)})),As=_s(null),Ns=_s(is),Rs=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=vs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ps=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(fs,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Ss=Object.values(bn),ws=(0,l.includes)(l.__,Ss),Is=e=>Ss.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Us(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){Cs(e,t,r[t])}))}return e}function Cs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ls=(e,t)=>`${e}_${t}`,Ds=[Sn.matches.name,Sn.matchRules.name],js=(0,l.values)(vn).map((e=>e.name)),ks=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,js)))),xs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ds)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Ls(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Fs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,ks(r),xs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Ls(`dtPotentialMatches.${t.name}`,"")))))(Sn)},Ms=(0,l.propEq)("uri",Sn.type.uri),$s=e=>(0,l.values)(Pn).some((0,l.propEq)("uri",e.uri)),Vs=(0,l.propEq)("uri",Rn.sourceSystems.uri),Gs=Object.values(On),Ws=(0,l.includes)(l.__,Gs),Ys=e=>{let{entity:t,attributeType:r,value:n}=e;return Us({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Bs=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},qs=e=>{let{entity:t,attributeType:r,value:n}=e;return Us({},t,{[r.uri]:n})},Qs=(0,l.propEq)("uri",On.roles.uri),Hs=(0,l.propEq)("uri",On.tags.uri);function Ks(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){Js(e,t,r[t])}))}return e}function Js(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xs=e=>{let{parentUri:t,attributeType:r}=e;return Ks({uri:Be(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[yr,(0,l.always)({value:{}})],[Er,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},zs=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)($a(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),mr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Xs({parentUri:r,attributeType:e});let s=vr(n,e);s&&(e.type===Vt.TYPE_REFERENCE&&(s=Xt(s)),a.value=zs({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!mr(e)||(o[t]=[a])}return o},Zs=e=>{let{entity:t,metadata:r}=e;return Io(r,t.type,!0).filter(mr).reduce(((e,t)=>{const n=t.name,i=ct(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:bs(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:tl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},el=(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===Vt.TYPE_NESTED?Ks({},e,{value:el({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Ks({},s(t),zs({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),tl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Xs({parentUri:n,attributeType:r}),u=gs(l);return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},rl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,n.uri,gs(n),a,o,i)}))},nl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},il=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Me.ZP)(t,(e=>{Ue(e.attributes||e.value,r,n,i)}))},al=(0,l.either)((0,l.propSatisfies)((0,l.anyPass)([e=>""===e,l.isNil]),"value"),(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity"))),ol=(0,l.reject)(al),sl=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=>sl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),ol)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},ll=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return sl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),hs),deleteEmptyComplex:e})},ul=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(ll(e),(0,l.reject)(l.isEmpty))},cl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return ws(r)?Ys({entity:e,attributeType:r}):tl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),pl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return ws(r)?qs({entity:e,attributeType:r,value:i}):nl({entity:e,attributeType:r,uri:n,value:i})})),dl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return ws(r)?Bs({entity:e,attributeType:r}):il({entity:e,attributeType:r,uri:n})})),yl=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)},fl="UrlThumbnail",Tl="CdnUrlThumbnail",El=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(is):(0,l.head)(n);return e&&e.value}return null})),ml=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>El(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),hl=ml(["CdnUrl","Url"],!0),bl=ml(["CdnUrlPreview","UrlPreview"],!0),Ol=ml([Tl,fl],!0),vl=ml([Tl,fl]),gl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[or,(0,l.always)(t)],[(0,l.both)(ar,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=or(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(ws(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)}),[])},_l=(e,t,r)=>{const n=Ga(e),i=(0,l.any)(r?l.T:is);return gl(n,t,i)},Al=(e,t,r,n,i,a)=>{const o=qe(null==r?void 0:r.uri)?$a(t,e):Va(t,e);return gl(o,r,((e,o)=>{const s=Ji({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:is,e)||or(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Nl;const Rl=e=>{Nl=e};function Pl(e,t){return Nl(e,t)}const Sl=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)})),wl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return Pl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},Il=(0,l.once)((()=>Pl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),Ul=e=>Pl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Cl=(e,t)=>Pl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Ll=e=>Z.fromNull(nn[e]).map(En().text).orSome(""),Dl=(0,l.curry)(((e,t)=>`${e}_${t}`)),jl=(0,l.split)("_"),kl=(0,l.includes)("_"),xl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Fl=(0,l.curry)(((e,t)=>e.some(xl(t)))),Ml=Fl([tn.IN_RANGE,tn.COUNT_RANGE,tn.WITHIN]),$l=Fl([tn.EXISTS,tn.MISSING_VALUE]),Vl=(0,l.cond)([[$l,(0,l.always)(0)],[Ml,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),Gl=(0,l.complement)($l),Wl=Fl([tn.HAS_ALL,tn.EQUALS,tn.NOT_EQUALS]),Yl=Fl([tn.COUNT_EQUALS,tn.COUNT_NOT_EQUALS,tn.COUNT_LT,tn.COUNT_LTE,tn.COUNT_GT,tn.COUNT_GTE,tn.COUNT_RANGE]),Bl=Fl([tn.IN_FILE,tn.NOT_IN_FILE]),ql=e=>{switch(e){case tn.COUNT_EQUALS:return tn.EQUALS;case tn.COUNT_NOT_EQUALS:return tn.NOT_EQUALS;case tn.COUNT_LT:return tn.LT;case tn.COUNT_LTE:return tn.LTE;case tn.COUNT_GT:return tn.GT;case tn.COUNT_GTE:return tn.GTE;case tn.COUNT_RANGE:return tn.IN_RANGE}},Ql=Fl([tn.ON,tn.BEFORE,tn.AFTER,tn.WITHIN,tn.NOT_EQUALS]),Hl=Fl([tn.WITHIN]),Kl=[[tn.COUNT_EQUALS,tn.COUNT_NOT_EQUALS,tn.COUNT_LT,tn.COUNT_LTE,tn.COUNT_GT,tn.COUNT_GTE],[tn.NOT_IN_FILE,tn.IN_FILE],[tn.EQUALS,tn.NOT_EQUALS,tn.HAS_ALL],[tn.LT,tn.LTE,tn.GT,tn.GTE],[tn.MISSING_VALUE,tn.EXISTS],[tn.COUNT_RANGE],[tn.IN_RANGE],[tn.STARTS_WITH,tn.CONTAINS],[tn.FULL_TEXT],[tn.ON,tn.BEFORE,tn.AFTER,tn.NOT_EQUALS],[tn.WITHIN]],Jl=(e,t)=>Kl.some((r=>r.includes(e)&&r.includes(t))),Xl=(0,l.pipe)(l.omit,l.values),zl={OPTIONS_FOR_STRING:Xl(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],tn),OPTIONS_FOR_DATE:[tn.ON,tn.BEFORE,tn.AFTER,tn.WITHIN,tn.NOT_EQUALS,tn.MISSING_VALUE,tn.EXISTS,tn.COUNT_EQUALS,tn.COUNT_NOT_EQUALS,tn.COUNT_LT,tn.COUNT_LTE,tn.COUNT_GT,tn.COUNT_GTE,tn.COUNT_RANGE,tn.IN_FILE,tn.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Xl(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],tn),OPTIONS_FOR_BLOB:Xl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],tn),OPTIONS_FOR_NUMBER:Xl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],tn),OPTIONS_FOR_LOOKUP:Xl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],tn),OPTIONS_FOR_ENUM:Xl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],tn),OPTIONS_FOR_ID:[tn.EQUALS,tn.NOT_EQUALS,tn.IN_FILE,tn.NOT_IN_FILE],OPTIONS_FOR_COUNT:[tn.EQUALS,tn.NOT_EQUALS,tn.LT,tn.LTE,tn.GT,tn.GTE,tn.IN_RANGE],OPTIONS_FOR_COMPLEX:[tn.COUNT_EQUALS,tn.COUNT_NOT_EQUALS,tn.COUNT_LT,tn.COUNT_LTE,tn.COUNT_GT,tn.COUNT_GTE,tn.COUNT_RANGE,tn.EXISTS,tn.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[tn.EQUALS,tn.NOT_EQUALS,tn.EXISTS,tn.MISSING_VALUE]},Zl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Vt.TYPE_TYPEAHEAD:case Vt.TYPE_STRING:case Vt.TYPE_PASSWORD:case Vt.TYPE_TEXT:case Vt.TYPE_CIK_ID:case Vt.TYPE_URL:case Vt.TYPE_BLOG_URL:case Vt.TYPE_IMAGE_URL:case Vt.TYPE_EMAIL:return zl.OPTIONS_FOR_STRING;case Vt.TYPE_LOOKUP:case Vt.TYPE_DEPENDENT_LOOKUP:return zl.OPTIONS_FOR_LOOKUP;case Vt.TYPE_ENUM:return zl.OPTIONS_FOR_ENUM;case Vt.TYPE_DATE:case Vt.TYPE_ACTIVENESS_DATE:case Vt.TYPE_TIMESTAMP:case Vt.TYPE_LOCAL_DATE:return zl.OPTIONS_FOR_DATE;case Vt.TYPE_BOOLEAN:case Vt.TYPE_BOOLEAN_RADIO:return zl.OPTIONS_FOR_BOOLEAN;case Vt.TYPE_BLOB:return zl.OPTIONS_FOR_BLOB;case Vt.TYPE_LONG:case Vt.TYPE_INT:case Vt.TYPE_FLOAT:case Vt.TYPE_DOUBLE:case Vt.TYPE_NUMBER:return zl.OPTIONS_FOR_NUMBER;case Vt.TYPE_ENTITY_ID:return zl.OPTIONS_FOR_ID;case Vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[tn.EQUALS];case Vt.TYPE_COUNT:return zl.OPTIONS_FOR_COUNT;case Vt.TYPE_NESTED:case Vt.TYPE_REFERENCE:case Vt.TYPE_IMAGE:return zl.OPTIONS_FOR_COMPLEX;default:return zl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Yl,n):n},eu=e=>[Ot.and,Ot.andNot].includes(e),tu=e=>[Ot.or,Ot.orNot].includes(e),ru=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),tu)),nu=(iu=[Ot.and],e=>e.slice(0,-1).every((e=>iu.includes(e.operator))));var iu;const au=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),ou=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),su=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},lu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Ot.or,Ot.orNot],n=t?[Ot.and,Ot.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)&&su(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},uu="and",cu=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)(uu,n,e),o=(e=>[Ot.andNot,Ot.orNot].includes(e))(a)?lu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},pu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),du=e=>Array.isArray(e)?e.map(du).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),yu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),fu=e=>`'${e}'`,Tu=e=>`"${e}"`,Eu=(0,l.pipe)(du,yu),mu=(0,l.pipe)(Eu,fu),hu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Ml(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),bu=(e,t)=>Yl(t)?{type:Vt.TYPE_INT}:Bl(t)?{type:Vt.TYPE_FILE}:Ql(t)&&!Hl(t)&&Nr(e.type)?{type:Vt.TYPE_LOCAL_DATE}:e,Ou=Object.values(un),vu=e=>Ou.includes(e),gu=e=>En().text(cn[e]),_u=e=>{const t=f()();switch(e){case un.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case un.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case un.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case un.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case un.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function Au(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){Nu(e,t,r[t])}))}return e}function Nu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ru=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Pu=(0,l.curry)(((e,t,r)=>{const n=r.map(Ml(e)||t.endsWith(".count")?Eu:mu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Su=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},wu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Vl(t);return(0,l.pipe)(Su(i),(0,l.map)(Pu(t,r)),Ru(" or "))(n)},Iu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(mu).join(",")})`},Uu=e=>`*${e}*`,Cu=e=>`URL:${e}`,Lu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Du=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===tn.IN_FILE?r:`not ${r}`},ju=(e,t)=>[P(e,t),S(e,t)],ku=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!xu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case tn.ON:return Au({},e,n?{filter:tn.EQUALS}:{filter:tn.IN_RANGE,values:[ju(i,n)]});case tn.BEFORE:return Au({},e,{filter:tn.LTE,values:[[S(i,n)]]});case tn.AFTER:return Au({},e,{filter:tn.GTE,values:[[P(i,n)]]});case tn.WITHIN:return Au({},e,{filter:tn.IN_RANGE,values:[_u(i)]})}}return e}),wu),xu=(0,l.propSatisfies)(Nr,"type"),Fu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",tn.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(wu({filter:tn.EQUALS,fieldName:t,values:[r]}))),new cu).build())),Ru(" or "))(r)}],[(0,l.propEq)("filter",tn.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return wu({fieldName:r,filter:t,values:n.map((0,l.pipe)(du,Uu))})}],[(0,l.propEq)("filter",tn.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?wu(Au({},e,{values:(0,l.flatten)(r)})):Lu(r)?Iu(Au({},e,{filter:"listEquals"})):wu(e)}],[(0,l.propEq)("filter",tn.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Vl(t);return(0,l.pipe)(Su(i),(0,l.map)(Pu(t,r)),Ru(" and "))(n)})(Au({},e,{values:(0,l.flatten)(e.values)})):xu(e)?(e=>{const{values:t}=e,r=!xu(e),[n]=t;return(new cu).addClause(wu(Au({},e,{filter:tn.LT,values:[P(n,r)]}))).addClause(wu(Au({},e,{filter:tn.GT,values:[S(n,r)]}))).orBuild()})(e):Lu(t)?Iu(Au({},e,{filter:"not listEquals"})):wu(e)}],[(0,l.propSatisfies)(Bl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return wu({fieldName:r,filter:Du(t,r),values:n.map((0,l.prop)("link")).map(Cu)})}],[(0,l.propSatisfies)(Yl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return wu({fieldName:`${r}.count`,values:n,filter:ql(t)})}],[(0,l.propSatisfies)(Ql,"filter"),ku],[(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 Pu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Pu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,wu]],Mu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Gl(e)||Vu(r))},$u=e=>Array.isArray(e)?Vu(e):null!=e&&du(e).length>0,Vu=e=>e&&e.length>0&&e.every($u);function Gu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Yu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Bu=(e,t,r)=>"children"===e?Qu(r,[...t][0],!0):r,qu=(e,t,r)=>"values"===e?[...r,...t]:r,Qu=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)(Bu,t),e);if(!r&&Wl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(qu,t),e)}return(0,l.append)(t,e)},Hu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Wu(e),r=e=>e.fieldName===t?e:r({fieldName:Yu(e),children:[e]});return r(e)})(t);return Qu(e,r)}),[]),Ku=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")),Ju=e=>{let[t]=e;return t.children?Ju(t.children):t.operator},Xu=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=Ju(t)===Ot.andNot,a=n(t,!1),o=i?`not ${lu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Ju(r)||uu} ${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&&Ku(i)&&!t?r(i):n(i,a)}],...e])(o))),new cu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},zu=(0,l.pipe)((0,l.propOr)("","filter"),kl),Zu=(0,l.map)((0,l.when)(zu,(e=>{const[t,r]=jl(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){Gu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),ec=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)(Mu),Zu,Hu,Xu([...e,...Fu],t))},tc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),rc=[tn.ON,tn.BEFORE,tn.AFTER,tn.WITHIN,tn.NOT_EQUALS,tn.MISSING_VALUE,tn.EXISTS],nc=[tn.EQUALS,tn.NOT_EQUALS,tn.STARTS_WITH,tn.MISSING_VALUE,tn.HAS_ALL,tn.FULL_TEXT,tn.EXISTS],ic=[tn.EQUALS,tn.NOT_EQUALS,tn.LT,tn.LTE,tn.GT,tn.GTE,tn.IN_RANGE],ac=(e,t)=>{const r=nr(e);return(e=>{switch(e){case bn.startDate.name:case bn.endDate.name:case vn.dueDate.name:case An.createdTime.name:case An.updatedTime.name:case Rn.reltioLoadDate.name:case Rn.createDate.name:case Rn.updateDate.name:case Rn.deleteDate.name:case Rn.publishDate.name:return rc;case Nn.matches.name:case Rn.count.name:return ic;case vn.workflow.name:case vn.assignee.name:case vn.step.name:case gn.commenter.name:case An.createdBy.name:case An.updatedBy.name:case Rn.sourceSystems.name:case Rn.value.name:return nc;default:return null}})(t)||Zl(r)},oc=[tn.EQUALS,tn.NOT_EQUALS,tn.CONTAINS,tn.STARTS_WITH,tn.MISSING_VALUE,tn.HAS_ALL,tn.IN_RANGE,tn.WITHIN,tn.EXISTS,tn.ON],sc=(0,l.pipe)(ac,(0,l.filter)((0,l.includes)(l.__,oc))),lc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),uc=e=>{let{query:t,body:r}=e;return t=lc(t),Pl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},cc=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)(ec(),tc(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${$r(i)}`},pc=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=cc(e,t,r);return Pl(n)},dc=e=>Pl(`/entities/_total?${e}`),yc=(e,t)=>{const r=(0,l.pipe)((0,l.filter)(ts),(0,l.map)((0,l.prop)("uri")))(e),n={filter:tn.EQUALS,fieldName:"type",values:r},i={filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},a=ec()([n,i]);return Pl("/entities/_typeAheadSearch"+$r({filter:a,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,max:4}),{method:"GET"})},fc=(0,l.pipe)((0,l.reject)(l.isNil),Mr),Tc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(ec(),tc(i))(r),c=fc({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return uc({query:c,body:p})},Ec=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Tc({fieldName:t,searchParams:i,options:n})},mc="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",hc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i={filter:(0,l.pipe)(ec(),tc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||mc,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${$r(i)}`},bc=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=hc(e,t,r);return Pl(n)},Oc=e=>Rc(e,{select:"secondaryLabel"}),vc=(e,t)=>{const{select:r=mc,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Pl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},gc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),qe)),_c=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=gc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=fr(r),m={method:"POST",data:{attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E}},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(ec(),tc(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),Pl(`${s}/api/${o}/${t}/_object`,m)},Ac=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Nc={options:"sendHidden,addRefAttrUriToCrosswalk"},Rc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nc;return Pl(`/${e}${$r(t)}`)},Pc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",data:[e]},n=t("/entities");return Pl(n,r)},Sc=e=>Pl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),wc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Pl(`/entities/_events/_total${Mr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ic=(e,t)=>Pl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),Uc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Pl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},Cc=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 Pl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Mr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Lc=e=>{const t=new FormData;return t.append("file",e),Pl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,En().text("Can't upload file"));return Promise.reject(t)}))},Dc=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 Pl(`/personal/findSavedSearches${Mr({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"}})},jc=e=>Pl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),kc=e=>Pl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),xc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Pl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Fc=e=>{let{uri:t}=e;return Pl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Mc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),xc)(e),$c=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),xc)(e);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=["max","offset","filter"],Wc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Wc(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){Vc(e,t,r[t])}))}return e}({},t,(0,l.pick)(Gc,e)))),Yc=(0,l.omit)(["activeness"]),Bc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],bt.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],bt.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Wc(e),(0,l.omit)(Gc))(e))),Yc,(0,l.omit)(["labels"])))(t),{url:`/${e}/_connections${$r({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},qc=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Qc=(0,l.reject)(l.isNil),Hc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Kc=e=>Pl(Hc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Jc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Hc);return Pl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Xc=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?ul()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Qc,ne,JSON.stringify);return Pl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},zc=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"),Hc,n),o=be(i(t),i(r)).concat(ve(t,r));return Pl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Zc=(e,t)=>{const{url:r,options:n}=Bc(e,t);return Pl(r,n).then(qc)},ep=(e,t)=>Pl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),tp=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===fn.IN?a.inRelations=[n]:a.outRelations=[n],Pl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},rp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Pl(`${t}/recentSearches${$r({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},np=e=>Pl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ip=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Pl(`/recentSearches${$r({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function ap(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){op(e,t,r[t])}))}return e}function op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sp={select:"label,secondaryLabel,name,type,startDate,endDate"},lp=(0,l.reject)(l.isNil),up=(0,l.pipe)(lp,Mr),cp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=ap({},sp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Pl(`/${t}/_tree${up(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},pp=e=>{let{uri:t,graphUri:r}=e;const n=ap({},sp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Pl(`/${t}/_parents${up(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},dp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=ap({},sp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Pl(`/${t}/_hops${up(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function yp(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 fp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Tp="/activities",Ep=e=>{let{label:t,description:r}=e;return Pl(Tp,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:fp()}})},mp=e=>{const t=$r(e);return Pl(Tp+t,{method:"GET"})},hp=e=>Pl(`/activities/_total${$r(e)}`,{method:"GET"}),bp=e=>{const{entityUri:t}=e,r=yp(e,["entityUri"]);return Pl(`/${t}/_activities${$r(r)}`,{method:"GET"})},Op=e=>{const{entityUri:t}=e,r=yp(e,["entityUri"]);return Pl(`/${t}/_activities/_total${$r(r)}`,{method:"GET"})};function vp(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){gp(e,t,r[t])}))}return e}function gp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _p=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Ap=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Pl(_p({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},Np=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=_p({url:r,workflowPath:t,tenant:n})),Pl(s,{method:i||"GET",body:JSON.stringify(a),headers:vp({"Content-Type":"application/json"},null!=o?o:{})})},Rp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=_p({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Pl(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)},Pp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=_p({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?vp({},l,{comment:o}):l;return Pl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Sp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=_p({url:`/tasks${s?$r(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(vp({objectURIs:[i]},(0,l.reject)(E,a)))};return Pl(u,vp({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},wp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Pl(_p({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})})},Ip=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Pl(_p({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(vp({max:a,offset:o},i))})},Up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Pl(_p({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Pl(_p({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Cp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Dp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Pl(_p({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},jp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Cp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},kp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Cp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},xp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Cp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},Fp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return Pl(_p({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Mp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Pl(_p({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},$p=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(is);return a&&a[0]&&(r=n.length>0&&a[0].value?$p(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),Vp=(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=$p(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},Gp=/[,\s]*$/,Wp=e=>{const t=En().text(yn);if(!e)return t;const r=e.replace(Gp,"");return""===r.toString().trim()?t:r},Yp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Bp=(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=Yp(e,r.referencedEntityTypeURI);if(n)return Vp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Vp({attributes:t||{}},r.dataLabelPattern);return""},qp=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Qp=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Hp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",Kp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Ol,(0,l.prop)("value"))),Jp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),Kp),Xp=(e,t,r)=>{const n=Jp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(vs(e),Kp)))(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")])})(Qr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>bs(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,Kp))(r)})(e,r)||Zr(e,r.type);return Hp(t,n)};function zp(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){Zp(e,t,r[t])}))}return e}function Zp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ed="DTSS/",td=(0,l.replace)(new RegExp("^entities/"),""),rd=e=>ed+e.dataTenant+"/"+e.uri,nd=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),id=e=>!(!e||!e.dataTenant),ad=(0,l.startsWith)(ed),od=(0,l.pipe)((0,l.ifElse)(ad,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),sd=(0,l.ifElse)(id,rd,(0,l.prop)("uri")),ld=e=>e&&e.uri?e.dataTenant?rd(e):td(e.uri):"",ud=(0,l.curry)(((e,t,r)=>(Qr(t,r.type)||{})[e]||"")),cd=ud("label"),pd=ud("typeGraphIcon"),dd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Qr(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(is)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Bp(e,o,i),uri:a.uri}})).filter(l.identity):[]},yd=(0,l.pipe)(dd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),fd=(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=fd(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):fd(e.slice(1),r)}})),Td=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Ed=e=>(0,l.propOr)([],"matchRules",e),md=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?zp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},hd=(e,t,r)=>t&&r?r.aEntity:e,bd=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,sources:u,rules:c}=e;const p={max:r,deep:n,filter:s,sort:i,order:a,activeness:o,sources:u,rules:c};return Pl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Mr)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Od=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 Pl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Mr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},vd=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Pl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},gd=(e,t,r)=>Promise.all(t.map((async t=>{await Pl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),_d=async(e,t)=>await gd(e,t,"NOT"),Ad=async(e,t)=>await gd(e,t,"MATCH"),Nd=async(e,t)=>await Promise.all(t.map((async t=>{await Pl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function Rd(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){Pd(e,t,r[t])}))}return e}function Pd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sd(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 wd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Pl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Id=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Kd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Ud=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Kd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Cd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Pl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Ld=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 Cd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Dd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(id,i);return Promise.all([s.length?vd(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Cd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},jd=(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=Sd(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)}),[])),kd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),jd),xd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Pl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(kd)},Fd=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)},Md=Fd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Pl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(kd)})),$d=Fd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Pl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Vd=(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)}},Gd=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Pl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Wd=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 Gd(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Yd=Wd("NOT"),Bd=Wd("MATCH"),qd=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(id,a);return Promise.all([gd(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return Gd(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},Qd=qd("NOT"),Hd=qd("MATCH");function Kd(e){let{requestProvider:t=Pl,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}`,Rd({},Sd(s,["headers"]),{headers:Rd({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Jd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Kd({url:hc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Xd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Kd({url:cc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},zd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=Bc(t,r);return Kd({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(qc,(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)))}))))},Zd=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Kd({url:`${Ac(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},ey=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Pl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},ty=e=>{let{dtssPath:t,tenant:r}=e;return Pl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},ry=e=>{let{dtssPath:t,customerTenant:r}=e;return Pl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},ny=e=>{let{dtssPath:t,tenants:r}=e;return Pl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},iy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Kd({url:Ac(t),dataTenant:r,customerTenant:n,dtssPath:i})},ay=()=>Pl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function oy(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){sy(e,t,r[t])}))}return e}function sy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ly=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=oy({},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 Pl(`${t}/api/${r}/graph/search${$r({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},uy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Pl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:oy({},n,i),headers:{"Content-Type":"application/json"}})},cy=(e,t)=>`${e}/${t}/comments`,py=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Pl(`${cy(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},dy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Pl(`${cy(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},yy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Pl(cy(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},fy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Pl(`${cy(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Ty=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Pl(`${cy(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ey=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Pl(`${cy(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},my=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=$r({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Pl(`${cy(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function hy(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){by(e,t,r[t])}))}return e}function by(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oy=e=>{let{tenant:t,servicesPath:r}=e;return Pl(`${r}/oauth/proxy${$r({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},vy="graphExport",gy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await Ry({servicesPath:e,tenant:t,environment:r,namespace:vy,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(hy({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await Ry({servicesPath:e,tenant:t,environment:r,namespace:vy,options:hy({method:"PUT"},o)})}catch(e){s=null}return s||(s=await Ry({servicesPath:e,tenant:t,environment:r,namespace:vy,options:hy({method:"POST"},o)})),s},_y=e=>{let{servicesPath:t,key:r}=e;return Pl(`${t}/settings${$r({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ay=e=>{let{servicesPath:t}=e;return Pl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},Ny=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Pl(`${n}/plugins${$r({tenant:t,user:r})}`,{method:"GET"})},Ry=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Pl(`${n}/configService${$r({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Py=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return Ry({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Sy=e=>{let{servicesPath:t,stateHash:r}=e;return Pl(`${t}/searchLink?key=${r}`,{method:"GET"})},wy=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),Pl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Iy=e=>Pl(`/${e}?showObjectsInfo=true`,{method:"GET"}),Uy=e=>{let{exportPath:t,tenant:r,options:n}=e;return Pl(`${t}/${r}/activities${$r(n)}`,{method:"POST"})};function Cy(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){Ly(e,t,r[t])}))}return e}function Ly(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dy=e=>{const{entityUri:t}=e;return Pl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},jy=e=>{let{entityUri:t,crosswalk:r}=e;return Pl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},ky=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Pl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Cy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Cy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},xy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Pl(`/${r}/_${n}${$r({contributorURI:t})}`,{method:"POST"})},Fy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Pl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},My=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Pl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},$y=e=>{let{entityUri:t,crosswalkId:r}=e;return Pl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function Vy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gy=e=>{let{entityTypeUri:t}=e;return Pl(`/dataQuality/fillRates${Mr({entityType:rt(t)})}`,{method:"GET"})},Wy=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){Vy(e,t,r[t])}))}return e}({},n===Ut.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{});return Pl(`/entityType/${rt(t)}/dataQuality/${n}`,{method:"POST",body:JSON.stringify(a)})},Yy=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Pl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${rt(n)}`,{method:"GET",headers:{env:i}})},By=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Pl(`/${t}${$r({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},qy=e=>{let{attributeUri:t,value:r}=e;return Pl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Qy=e=>{let{attributeUri:t,value:r}=e;return Pl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Hy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Pl(`/${t}${$r({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Ky=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=$r({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=ul()([[{value:a}]]);return Pl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Jy=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Pl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Xy=e=>{let{entityUri:t,attributeName:r}=e;return Pl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function zy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zy=e=>{let{entityUri:t}=e;return Pl(`/${t}/_historicURIs`,{method:"GET"})},ef=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 Pl(`/${t}/_changesWithTotal${$r(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){zy(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},tf=(e,t)=>Pl(`/${e}/_previousChange${$r({timestamp:t})}`,{method:"GET"}),rf=(e,t)=>Pl(`/${e}${$r({time:t})}`,{method:"GET"});function nf(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){af(e,t,r[t])}))}return e}function af(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const of=e=>{let{url:t,method:r,data:n,headers:i}=e;return Pl(t,nf({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:nf({"Content-Type":"application/json"},null!=i?i:{})}))},sf=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=$r({options:a.join(","),severity:o.join(",")});return Pl(`${t}/validate/${i}/entity/${ld({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},lf=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Pl(`${t}/validate/${n}/entity${$r({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},uf=e=>{let{tenant:t,apiPath:r}=e;return Pl(`${r}/tenants/${t}/name`,{method:"GET"})},cf=e=>{let{tenant:t,apiPath:r}=e;return Pl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},pf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Pl(`${a}/preferences${$r({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},df=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 Pl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},yf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Pl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})};var ff=r(29524);const Tf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Qe(),s={attributes:zs({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=bs(r,e,n.uri)[0];return i&&i.value?nl({entity:e,attributeType:n,uri:i.uri,value:t}):tl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Ef=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(fs),(0,l.filter)(qe),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),mf=(0,l.curry)(((e,t)=>{const r=Ef(e=e||{},t=t||{});return r.concat((0,l.chain)(mf(e),r))})),hf=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),bf=hf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Of=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),qe)),vf=e=>(0,l.pipe)(bf,Of(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),gf=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(bf,(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})),_f=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),qe),(0,l.omit)(["uri","timestamp"])),Af=(0,l.pipe)(_f,(0,l.evolve)({attributes:ul(!0)})),Nf=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=vf(i);if(a.length>0)for(const t of a)e=gf(t,r[t].uri,e);const o=(s=await Pc(Af(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},Rf=async(e,t,r)=>{const n=Sf(e,t),i={};for(const t of n)i[t]=await Nf(e,t,i,r);return i},Pf=(0,l.curry)(((e,t)=>{const r=ff.Node(t);return vf(e[t]).forEach((t=>{const n=Pf(e,t);r.addEdge(n)})),r})),Sf=(e,t)=>(0,l.pipe)((0,l.map)(Pf(e)),(0,l.map)(ff.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),wf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(_f))})),If=(e,t)=>{const r=Ae(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=Oe(e,t),a=ve(e,t);return[...ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},Uf=(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 gf(r,n,e)}),e))))}),t)}),wf),Cf=(0,l.curry)(((e,t)=>(0,l.when)(qe,(0,l.propOr)(l.__,t,e),t)));function Lf(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){Df(e,t,r[t])}))}return e}function Df(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jf=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Ct.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},kf=e=>{let{relationUri:t}=e;return{type:Ct.DELETE_RELATION,parameters:{relationUri:t}}},xf=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Ct.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Ff=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Ct.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Mf=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Ct.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},$f=(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))),Vf=e=>e.type===Ct.DELETE_RELATION,Gf=e=>e.type===Ct.CREATE_RELATION,Wf=e=>e.type===Ct.REPOINT_RELATION,Yf=e=>e.type===Ct.UPDATE_RELATION,Bf=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),qf=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Ct.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Xc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Ct.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Jc(e,i).then(o)};case Ct.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return tp(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Ct.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return zc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Ct.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[kf({relationUri:o}),jf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Qf(n)),(0,l.map)(qf),Bf)(s)}}},Qf=e=>t=>Lf({dcrProcessor:e},t),Hf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Vr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Qf(r)),(0,l.map)(qf),Bf,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Kf=e=>t=>(0,l.map)((t=>Lf({},t,{parameters:(0,l.evolve)({parentUri:Cf(e),entityUri:Cf(e),newEntityUri:Cf(e)},t.parameters)})),t),Jf=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Xf=(e,t)=>{const r=e.filter(Gf).find($f(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Yf(o)&&$f(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Wf(o)||!$f(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(Jf({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},zf=(e,t)=>{const r=e.filter(Wf).filter($f(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Yf(i)||!$f(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Jf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Zf=(e,t)=>{const r=e.filter(Vf).filter($f(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!$f(t,e)))},eT=(e,t)=>{const r=e.filter(Yf).filter($f(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Yf(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Jf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},tT=e=>{const t=e.filter(Vf).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Zf,e)},rT=e=>{const t=e.filter(Gf).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Xf,e)},nT=e=>{const t=e.filter(Wf).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(zf,e)},iT=e=>{const t=e.filter(Yf).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)(eT,e))(t)},aT=e=>(0,l.pipe)(tT,rT,nT,iT)(e);function oT(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){sT(e,t,r[t])}))}return e}function sT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lT=e=>oT({},(0,l.path)(OT(),e),{startDate:(0,l.path)(AT(),e),endDate:(0,l.path)(NT(),e)}),uT=(e,t)=>(0,l.pipe)((0,l.path)(_T()),Cf(t))(e),cT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=uT(e,r),i=(0,l.path)(vT(),e)===Lt.IN,a=e.parentEntityUri||n;return jf({parentUri:i?t:a,relation:lT(e),entityUri:i?a:t})})),...o.map((t=>{const i=uT(t,r),a=(0,l.path)(vT(),t)===Lt.IN,o=i!==(0,l.pipe)((0,l.path)(OT()),a?RT:PT)(t),s=IT(e,(0,l.path)(hT(),t)),u=t.parentEntityUri||n,c=Cf(r,i);return o?Mf({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(OT(),t),isReversed:!1}):Ff({oldRelation:(0,l.path)(OT(),s),newRelation:lT(t)})})),...i.map((e=>kf({relationUri:e}))),...s.map((e=>xf({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},pT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return oT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),dT=(0,l.has)("dataTenant"),yT=(0,l.ifElse)(dT,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),fT=(e,t)=>(0,l.pipe)(gi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Ss),Fa)(e,t),TT=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)}},ET=(e,t,r)=>{const n=Vp(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)},mT="relation",hT=(0,l.always)([mT,"relationUri"]),bT=(0,l.always)([mT,"relationType"]),OT=(0,l.always)([mT,"object"]),vT=(0,l.always)([mT,"direction"]),gT=(0,l.always)([mT,"object","attributes"]),_T=(0,l.always)(["entity","entityUri"]),AT=(0,l.always)([mT,"startDate"]),NT=(0,l.always)([mT,"endDate"]),RT=(0,l.path)(["startObject","objectURI"]),PT=(0,l.path)(["endObject","objectURI"]),ST=(0,l.path)(["startObject","objectTypeURI"]),wT=(0,l.path)(["endObject","objectTypeURI"]),IT=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(hT()),(0,l.equals)(t))(r))return r;if(r.connections){const e=IT(r.connections,t);if(e)return e}}},UT=(0,l.pipe)(IT,(0,l.path)(OT())),CT=(0,l.allPass)([(0,l.pipe)((0,l.path)(_T()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(bT()),(0,l.complement)(E))]),LT=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:He()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=kT({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=DT(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?TT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},DT=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:fn.IN}:{type:t[0],direction:fn.OUT}:null},jT=e=>e.uri||e,kT=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Li(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===fn.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"],Qr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Qr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(jT,gi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(fn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(fn.OUT)),(0,l.map)(u))},t)||{}},xT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Pi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Ai(e,n.uri);return n&&(!t||Kr(e,i,t))&&(!r||Kr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Qr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Qr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(es,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)}},FT=(0,l.curry)(((e,t,r,n,i)=>{const a=Kr(n,l.__,t.type),o=e?wT:ST,s=Kr(n,l.__,r.type),u=e?ST:wT;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),MT=(e,t,r)=>{const n=e?wT:ST,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(Kr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};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){VT(e,t,r[t])}))}return e}function VT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GT=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return $T({},t,{[r]:{parents:n,children:i}})},WT=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return $T({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},YT=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=Ef(t,i),o=GT({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>YT(n.uri,t,[e],r)),o)},BT=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)(hT(),n),a=t?WT({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(_T(),n),s=qe(o)?[o]:[],u=GT({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>YT(t,r,[i],e)),u)}),n)},qT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return BT(r,e,t,YT(e,t))},QT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return qT(t,r,n);if(Je(e)){const t=IT(n,e);return t&&BT([t],null,r)}return r[e]?YT(e,r):void 0},HT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>HT(e,t))))},KT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>KT(e,t))))},JT=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ke(t),u=qT(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(Je(c)){if(s=IT(i,c),!s)return null;o.push({type:Et.relationConnection,value:s,valueType:gi(a,(0,l.path)(bT(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:Et.tempEntity,value:e,valueType:Qr(a,e.type)});continue}const p=n[u],d=Ps(p,c),y=n[c];if(!d||!y)return null;o.push({type:Et.attributeValue,value:d,valueType:Or(a,ot(d.uri,p.type))}),o.push({type:Et.tempEntity,value:y,valueType:Qr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},KT(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?UT(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?gi(a,d.type):Qr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:vr(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:Et.tempEntity,value:T,valueType:Qr(a,T.type)}),o.push({type:Et.attributeValue,value:s,valueType:E}),m=s.value;const l=fs(s);T=l&&qe(l)?n[l]:null}}return o},XT=e=>e.every((e=>{let{type:t}=e;return[Et.attributeValue,Et.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Et.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,zT=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?zT(t.value):[]];return e.concat(r)}),[])),ZT=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,eE=e=>{const t=[...zT((null==e?void 0:e.attributes)||[]),...zT((null==e?void 0:e.analyticsAttributes)||[])];return e?[sd(e),...t]:[]},tE=(e,t)=>[e,...t.map((t=>ZT(e,t)))],rE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return yT(t)}))},nE=(e,t)=>{switch(e){case mt.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case mt.ENTITY_ATTRIBUTE:case mt.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[st(t)]})(t);case mt.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case mt.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,sd({uri:n,dataTenant:i}),r]})(t)}},iE=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),aE=(0,l.curry)(((e,t)=>{const r=Ro(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(aE(e,r.extendsTypeURI)):n})),oE=(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))),sE=(e,t)=>(0,l.pipe)((0,l.prop)("type"),aE(e),oE(t))(t);function lE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uE=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}},cE=e=>!e.deactivated,pE=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},dE=e=>pE(e)+e.message,yE=(0,l.unless)(l.isNil,(0,l.prop)("message")),fE=(0,l.unless)(l.isNil,(0,l.prop)("type")),TE=(0,l.curry)(((e,t)=>et(t.parentUri,e))),EE=(0,l.curry)(((e,t)=>t.parentUri===e)),mE=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),et(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Vt.TYPE_REFERENCE),(0,l.pipe)(qt,(0,l.any)(et(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),hE=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),bE=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),OE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([SE,cE,TE(e),mE(t),(0,l.complement)(bE(e,t.uri))]))(r)},vE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([SE,cE,EE(e),hE(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",dt.missed))]))(r);return n&&n.message||""},gE=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===dt.missed))},_E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([cE,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(hT(),e))]))(t)},AE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([cE,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},NE=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([cE,TE(t)]))(r)},RE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([cE,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},PE=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?JT(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 Et.attributeValue:{const e=a;if(cr(a))return Vp(o,e.dataLabelPattern);if(pr(a)){const t=o,i=fs(t),a=Yt(e),s=Qr(n,a);return qe(i)?Vp(r[i],s.dataLabelPattern):t.label}return""}case Et.tempEntity:return Vp(o,a.dataLabelPattern);case Et.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Qr(n,null==e?void 0:e.entityType);return`${Wp(i&&qe(i)?Vp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||_i(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){lE(e,t,r[t])}))}return e}({},e,{label:Wp(t)})}))},SE=e=>!e.severity||e.severity===ft.ERROR,wE=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Vt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(wE(n))}));case Vt.TYPE_REFERENCE:return!!ss(t);case Vt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),IE=(e,t)=>e.every((0,l.complement)(wE(t))),UE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Io(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=bs(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!is(e.parent))))).forEach((e=>{IE(e.attrValues,n)&&r.push(uE({type:dt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:En().text("Attribute is required"),source:yt.local}))})),r}),[])},CE=(0,l.curry)(((e,t,r)=>bs(e,t,r,!1))),LE=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Qr(e),(0,l.prop)("attributes"),(0,l.reject)(lr),(0,l.filter)(pr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(CE(e,t)));return(0,l.pipe)(r,(0,l.reject)(fs),(0,l.map)((e=>{let{uri:r}=e;return uE({type:dt.missedRefEntity,uri:"",attributeTypeUri:ot(r,t.type),parentUri:r,message:En().text("Entity is required"),source:yt.local})})))(t)},DE=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(fs,qe)).flatMap((n=>{const i=fs(n),a=t[i],o=Or(e,ot(n.uri,r.type));return jE(e,t,o,a)})),jE=(e,t,r,n)=>{const i=qt(r),a=i.map((t=>Or(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Vt.TYPE_REFERENCE))).flatMap(Ht).concat(i);return kE(e,t,n,(e=>a.some(et(e.uri))))},kE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=UE(e,r,n),a=LE(e,r),o=DE(e,t,r);return[...i,...a,...o]},xE=(e,t)=>{const r=(0,l.path)(OT(),t)||{};return UE(e,r)},FE=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(_T()),(0,l.ifElse)(qe,(e=>t[e]),(0,l.always)(null)))(r),i=xE(e,r),a=(e=>(0,l.path)(_T(),e)?[]:[uE({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(bT(),e),parentUri:(0,l.path)(hT(),e),message:En().text("Entity is required"),source:yt.local})])(r),o=((e,t,r)=>r?kE(e,t,r):[])(e,t,n);return[...i,...a,...o]},ME=e=>(0,l.path)(["entity","uri"],e)?[]:[uE({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:En().text("Entity is required"),source:yt.local})],$E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=UE(e,r),i=ME(t);return[...n,...i]};function VE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GE=(e,t)=>{var r,n;const i=Qr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||to(e)},WE=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),YE=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(WE(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},BE=(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)(Ts,qe,l.not)]),(e=>{const t=(0,l.pipe)(Ts,rt)(e);return YE((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(fs,qe),(t=>{const r=fs(t),n=e[r],i=n&&QE(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){VE(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),qE=(e,t,r)=>ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))).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)(BE(r,e.type)),(0,l.map)(YE(pt))))})(e))),QE=(e,t)=>(0,l.evolve)({attributes:sl({valueTransformer:(0,l.pipe)(hs,BE(t),WE(pt)),deleteEmptyComplex:!0}),uri:pt})(e);function HE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){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 JE=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp($e,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),XE=e=>(0,l.pipe)((0,l.evolve)({objectUri:JE,objectParentUri:JE}),(e=>{return HE({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?dt.missed:dt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&ct(e.objectUri),uri:e.objectUri,source:yt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),zE=(e,t)=>(0,l.map)((0,l.pipe)(XE,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=PE(t,s),p=null!=c&&c.length?c.slice(0,-1):PE(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Or(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Et.attributeValue&&(a=e.valueType)}return a})(o,c,e);return HE({},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&&ut(i)){const n=(0,l.last)(a),i=n.valueType;if(pr(i)&&Kt(i).includes(o)){const i=fs(n.value),o=i&&qe(i)?t[i]:null;return o?HE({},e,{parentUri:o.uri,path:a.concat({type:Et.tempEntity,value:o,valueType:Qr(r,o.type),label:""})}):e}}return e}})(t)))(e),ZE=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};function em(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tm;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(tm||(tm={}));const rm={},nm={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},im=(0,l.curry)(((e,t)=>{const r=(e=>{if(!rm[e]){const t=nm[e]||nm.random0;rm[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){em(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return rm[e]})(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),am=e=>im(tm.Charts,e);var om=r(51404),sm=r.n(om);const lm=Array.from({length:100},((e,t)=>t/100)),um=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)},cm={},pm=new(sm())({hash:um,saturation:lm.slice(15,71),lightness:lm.slice(50,90)}),dm=(0,l.curry)(((e,t,r)=>{t in cm||(cm[t]={});const n=cm[t];r in n||(n[r]=((e,t)=>{const r=String(um(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),ym=dm(pm,"crosswalks"),fm=dm(pm,"sources"),Tm=dm(pm,"contributors");function Em(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){mm(e,t,r[t])}))}return e}function mm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hm=(0,l.has)("items"),bm=e=>0===e,Om=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)},vm=e=>e.reduce(((e,t)=>e+t.width),0),gm=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),_m=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Am=e=>e.reduce(((e,t)=>e+t.height),0),Nm=e=>(0,l.is)(String,e)&&e.includes("%"),Rm=e=>Boolean(e.spacer),Pm=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),Sm=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(hm(t)?Sm(t):t)),[]),wm=e=>({id:e.layout}),Im=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wm;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.floor(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=Nm(r.width)?Pm(i,r.width):u}return Om(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Om(n,t,r)},o=(e,t)=>hm(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.reduce(((o,s,u)=>{const c=i(t,r,s,hm(s)?n(s.layout):e(s.view)),d=bm(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(hm(s))return o.concat(p(Em({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(Em({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:vm(o),height:gm(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=hm(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=bm(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(hm(i))return r.concat(p(Em({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Em({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Om(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Om(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:_m(i),height:Am(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=bm(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return Em({},o,{x:t.x,y:c,width:s,height:u})},i=(e,t)=>{const r=t.reduce(((t,r,i)=>{if("string"==typeof r)t.push(n(e,t,r,i));else if("object"==typeof r){const a=Math.round(e.width/2),o=Em({},e,{width:a}),s=Em({},e,{x:e.x+a,width:a}),u=(0,l.has)("left",r)&&n(o,t,r.left,i),c=(0,l.has)("right",r)&&n(s,t,r.right,i),p=(0,l.propOr)(0,"height"),d=Math.max(p(u),p(c));t.push(Em({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return Em({},e,{height:Am(r),items:r})},o=i(t,(0,l.propOr)([],"top",r)),s=Math.round(.66*t.width),u=(0,l.isEmpty)(o)?t.y:t.y+o.height,c=i(Em({},t,{y:u,width:s}),(0,l.propOr)([],"center",r)),p=i({x:t.x+s,y:u,width:t.width-s},(0,l.propOr)([],"right",r)),d=o.height+Math.max(c.height,p.height),y=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Em({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=Em({},t,{items:(0,l.reject)(Rm,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 Sm(f)},Um=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id))));function Cm(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){Lm(e,t,r[t])}))}return e}function Lm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dm={BarChart:jt.BAR,BarChartGrouped:jt.BAR,BarChartHorizontal:jt.BAR,LineChart:jt.LINE,Map:jt.MAP,Pie:jt.PIE},jm=(e,t)=>lt(e)?it(e,t):e,km=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Dm[r];return Cm({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},xm=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Cm({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"]))},Fm=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Cm({},e,{value:[an,on,tn.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:ln(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&lt(t)||!r?n:(n||[]).concat((i=r,{filter:tn.EQUALS,fieldName:"type",values:[i]}));var i},Mm=["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"],$m={"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:jm(n,r),filters:Fm(a,n,r),chartType:jt.BAR,component:kt.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:jm(n,r),filters:Fm(a,n,r),chartType:jt.BUBBLE,component:kt.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:kt.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 Cm({id:t,count:o,canRead:u,orderType:s,attributeUri:jm(r,p),filters:Fm(a,r,p),component:kt.DashboardFacet,title:i,showOthers:!0},km(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:jm(n,r),filters:Fm(a,n,r),chartType:jt.MAP,component:kt.DashboardFacet,title:i,geoUrl:Mm[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 Cm({id:t,count:o,canRead:l,attributeUri:jm(n,r),filters:Fm(a,n,r),component:kt.DashboardFacet,title:i,geoUrl:s,chartType:jt.MAP,projection:"geoMercator"},km(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:kt.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:xm(i),component:kt.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:Fm(n,null,a),component:kt.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:tn.GTE,fieldName:"matches",values:["1"]}],component:kt.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:kt.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:jt.CLOUD,component:kt.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:jt.TREE,component:kt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:kt.NotificationInboxFacet,title:n||En().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:kt.ActivitiesViewFacet,title:n||En().text("Activity log")}}},Vm=e=>({id:e,height:10}),Gm=(0,l.pipe)((0,l.map)((e=>{const t=$m[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Wm=e=>{if("0.1"===e.version){const t=Gm(e.views),r=Im(Vm,e.layout,{columns:4});return{id:e.id,margin:0,layout:Um(r,t),views:t}}return e},Ym=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=>Ym(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function Bm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qm(e,t,r[t])}))}return e}function qm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qm=Bm({},xt,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),Hm=e=>e,Km={[Qm.Attributes]:Hm,[Qm.HierarchyTree]:Hm,[Qm.HierarchyPaths]:Hm,[Qm.RelationsTable]:Hm,[Qm.Relations]:e=>Bm({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Qm.SingleAttributeView]:Hm,[Qm.CustomView]:Hm,[Qm.TableAttributeView]:Hm,[Qm.MapView]:Hm,[Qm.OldTreeView]:e=>Bm({},e,{class:xt.HierarchyTree}),[Qm.OldMapView]:e=>Bm({},e,{class:xt.MapView}),[Qm.ImageAttributeView]:Hm,[Qm.PotentialMatchesView]:Hm},Jm=(0,l.pipe)((0,l.map)((e=>{const t=Km[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Xm=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===xt.MapView?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),zm=e=>{if("0.1"===e.version){const t=Jm(e.views),r=Im(Xm(t),e.layout,{columns:4});return{id:e.id,layout:Um(r,t),views:t,workflow:e.workflow,maxWidth:e.maxWidth,sidePanelViews:e.sidePanelViews}}return e},Zm=(e,t)=>e.class===t||e["react-class"]===t,eh=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Zm(t,xt.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 Zm(t,xt.SingleAttributeView)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.includes(n)||t.includes(n)}},th=(e,t)=>e.filter((e=>t.some((t=>Zm(e,t))))).map((e=>{let{id:t}=e;return t})),rh=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},nh=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),ih=(e,t)=>(e||[]).find((e=>e.activator===t));function ah(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){oh(e,t,r[t])}))}return e}function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sh=(e,t)=>Ym(t).map((t=>(0,l.pipe)((0,l.map)((e=>rh(e,t))),(0,l.reject)(l.isNil),l.head)(e))),lh=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},uh=(e,t)=>{if("scroll"===t.layout.layout){const r=sh(e,t.layout),n=Wm(ah({},t,{views:r,version:"0.1"}));return{class:Mt.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Mt.Dashboard,views:t.views,layout:t.layout,id:t.id}},ch=(e,t)=>{const r=sh(e,t.layout)[0];return{class:Mt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},ph=(e,t)=>{const r=sh(e,t.layout)[0];return{class:Mt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},dh=(e,t)=>{const r=sh(e,t.layout)[0];return{class:Mt.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},yh=(e,t)=>{const r=sh(e,t.layout)[0];return{class:Mt.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},fh=(e,t)=>{const r=sh(e,t.layout)[0];return{class:Mt.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},Th=(e,t)=>{const r=sh(e,t.layout)[0];return{class:Mt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},Eh=(e,t)=>{const r=sh(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=nh(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:Mt.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"]}},mh=(e,t)=>({class:Mt.Graph,id:t.id}),hh=(e,t)=>{const r=sh(e,t.layout)[0];return{class:Mt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},bh=e=>t=>!!(0,l.intersection)(e,t).length,Oh=(0,l.cond)([[bh(["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"]),()=>uh],[bh(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>ch],[bh(["com.reltio.plugins.graph.GraphView"]),()=>mh],[bh(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>ph],[bh(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>dh],[bh(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>yh],[bh(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>fh],[bh(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>Th],[bh(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>Eh],[bh(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>hh],[l.T,()=>(0,l.always)(void 0)]]),vh=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(lh),(0,l.map)((t=>((e,t)=>{const r=sh(e,t.layout),n=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>rh(e,t.side))),(0,l.reject)(l.isNil),l.head)(e);return Ym(r.layout||{})}})(e,t),i=zm(ah({},t,{views:r,version:"0.1"}));return{entityType:t["entity-type"],views:i.views,layout:i.layout,sidePanelViews:n}})(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews"])))(e);return{class:Mt.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:"CustomAction",config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:"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;const i=(0,l.pipe)((0,l.map)((e=>rh(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;const a=Ym(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 Oh(o)(t,i)},gh=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))},_h="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var Ah;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.SearchGroup=1]="SearchGroup"}(Ah||(Ah={}));const Nh={[Mt.DQDashboard]:`${_h}DqDashboard.svg`,[Mt.Dashboard]:`${_h}Dashboard.svg`,[Mt.Graph]:`${_h}Graph.svg`,[Mt.RelationshipSearch]:`${_h}GraphSearch.svg`,[Mt.Interactions]:`${_h}Interactions.svg`,[Mt.PotentialMatches]:`${_h}PotentialMatches.svg`,[Mt.Profile]:`${_h}Profile.svg`,[Mt.ProfileActivityLog]:`${_h}ActivityLog.svg`,[Mt.Relationships]:`${_h}Relationships.svg`,[Mt.Sources]:`${_h}Crosswalk.svg`,[Mt.Search]:`${_h}Search.svg`,[Ah.DashboardGroup]:`${_h}DashboardGroup.svg`,[Ah.SearchGroup]:`${_h}SearchGroup.svg`,DEFAULT:`${_h}Default.svg`},Rh=e=>Nh[null==e?void 0:e.class]||Nh.DEFAULT,Ph=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?Nh.ProfileView:null,Sh=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===Nh[Mt.Dashboard]||t===Nh[Mt.DQDashboard]})),(0,l.always)(Nh[Ah.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===Nh[Mt.Search]||t===Nh[Mt.RelationshipSearch]})),(0,l.always)(Nh[Ah.SearchGroup])],[l.T,()=>null]])(e),wh=e=>(0,l.pipe)((0,l.chain)(gh),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>(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=>({label:e.label,icon:Rh(vh(e,t)),screen:vh(e,t),canRead:e.canRead}))),(0,l.filter)((e=>e.screen)))(t))(t,e),n=vh(t,e);return{label:t.label,icon:Ph(t)||Sh(r)||Rh(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function Ih(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uh=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Ch=e=>({id:e,height:10}),Lh=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)(Uh),(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=Gm(((e,t)=>{const r=Ym(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(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){Ih(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Im(Ch,t.layout,{columns:4});return{views:r,layout:Um(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Dh=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,jh=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>rh(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),r=(e=>(0,l.pipe)((0,l.map)((e=>rh(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>rh(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>rh(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>rh(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>rh(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>rh(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.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>rh(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("enabled"))(e))(e),c=(e=>(0,l.pipe)((e=>ih(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("default-perspective"),(0,l.ifElse)(Dh,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),p=(e=>(0,l.pipe)((e=>nh(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.pluck)(["action"]))(e))(e),d=(e=>(0,l.pipe)((e=>ih(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkUser"))(e))(e),y=(e=>(0,l.pipe)((e=>ih(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkIdle"))(e))(e);return{i18n:o,entity:{requestSettings:{defaultMaxValues:t}},image:{attributeFieldsOrder:r},lookups:{autocomplete:n},validate:{levels:i,validateReadMode:a},attributePresentations:s,workflow:{enabled:u},defaultRoute:c,customScripts:p,checkUser:d,checkIdle:y}},kh=e=>({layout:wh(e),pivoting:Lh(e),properties:jh(e)});var xh=r(58697),Fh=r.n(xh);function Mh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$h(e,t,r[t])}))}return e}function $h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vh=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}_${Fh()()}`;return n[e.id].push(t),i=!0,Mh({},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]++,Mh({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},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},Wh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Qh,t),(0,l.propOr)([],"crosswalks",e))),e),Yh=(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(Yh(e))}))})),r},Bh=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=Bh(e);r>t&&(t=r)}))})),t+1):t},qh=(e,t)=>{if(qe(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Qh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Hh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Kh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Jh=(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)},Xh=(0,l.eqBy)(Qh),zh=(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)(ls,(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)))),Zh=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${t.join('","')}");\n postMessage({action:'loaded'});`;let i;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))}if(i){let e="";i.addEventListener("message",(t=>{if("loaded"!==t.data.action){const n=JSON.parse(t.data);r(n,i,e),"setHtml"===n.action&&(e=n.params.html)}}))}return i},eb=(0,l.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=En().number(t));return t})),tb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?En().number(e,"0,0.0a").toUpperCase():En().number(e,"0,0"):""},rb=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),nb=(e,t)=>t&&e!==t?`${t} (${e})`:e,ib=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),ab=(e,t,r)=>{const n=ib(e,t,r);return nb(r,n)},ob=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),sb=(0,l.complement)(ob),lb=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),ub=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)},cb=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(sb(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),pb=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case Vt.TYPE_NUMBER:case Vt.TYPE_FLOAT:case Vt.TYPE_DOUBLE:case Vt.TYPE_LONG:case Vt.TYPE_INT:case Vt.TYPE_COUNT:return t&&eb(o,t);case Vt.TYPE_BOOLEAN:case Vt.TYPE_BOOLEAN_RADIO:case Vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:le(t)?En().text("yes"):En().text("no");case Vt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),t&&(vu(t)?gu(t):En().date(t,s));case Vt.TYPE_ACTIVENESS_DATE:case Vt.TYPE_LOCAL_DATE:return t&&(vu(t)?gu(t):En().date(t,s));case Vt.TYPE_TIMESTAMP:return t&&(vu(t)?gu(t):En().date(isNaN(t)?t:Number(t),u));case Vt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Vt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}default:return(0,l.is)(Object,t)?nb((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),db={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},yb=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()}},fb=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status}}throw r})))),Tb=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)}),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)((e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),yb,fb);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},Eb="__metadata",mb=(e=>{const t=[Eb,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),hb=(0,l.set)(mb),bb=(0,l.view)(mb),Ob=hb(pn.NEW),vb=hb(pn.REMOVED),gb=hb(pn.EDITED),_b=hb(pn.IGNORED),Ab=(0,l.pipe)(bb,(0,l.equals)(pn.REMOVED)),Nb=(0,l.pipe)(bb,(0,l.equals)(pn.NEW)),Rb=(0,l.pipe)(bb,(0,l.equals)(pn.EDITED)),Pb=(0,l.pipe)(bb,(0,l.complement)(l.isNil)),Sb=(0,l.pipe)(bb,(0,l.equals)(pn.IGNORED)),wb=(0,l.omit)([Eb]),Ib=(e,t)=>e===Eb?void 0:t;function Ub(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cb=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=Cb(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Lb=(e,t)=>Cb((0,l.propEq)("nodeId",t),e),Db=(e,t)=>Cb((0,l.pathEq)(["entity","uri"],t),e),jb=(e,t)=>{const r=Lb(e,t);return r.length>1?r[r.length-2]:null},kb=(e,t)=>{const r=Lb(e,t);return r.length>0?r[r.length-1]:null},xb=(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=>xb(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Fb=()=>{},Mb=(e,t)=>{let{parent:r,nodeProcessing:n=Fb}=t;n(e,r),e.children&&e.children.forEach((t=>Mb(t,{parent:e,nodeProcessing:n})))},$b=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Nt.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 Nt.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 Nt.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){Ub(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})}}},Vb=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&&Mb(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Nt.addingChild||r.editingMode===Nt.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=$b({node:r,connection:n,isReversed:i}),s=jf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Nt.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=$b({node:r,isReversed:i,connection:n}),l=s?Mf({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Ff({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Gb={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Wb={asc:"asc",desc:"desc"},Yb=Gb.entityLabel,Bb=Wb.asc,qb=(0,l.always)(0),Qb=e=>{let{sortField:t=Yb,sortOrder:r=Bb,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Gb.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return y_.strings.sort(t,a,o)})(n,r);case Gb.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return y_.strings.sort(e,i,a)})(r);default:return qb}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Hb=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Wb)),l.identity,(0,l.always)(Bb))),Kb=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Gb)),l.identity,(0,l.always)(Yb)));var Jb=r(91104);let Xb;const zb=(e,t)=>(Xb||(Xb=Jb.createClient({key:t})),new Promise((t=>{Xb.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)}))}))),Zb=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},eO=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(is).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Zb(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(eO(e.value,t,r))),n})),tO=e=>e&&e.length>0,rO=(e,t)=>[].concat(e&&e.attributes?eO(e.attributes,t):[]).filter(l.identity),nO=(e,t,r,n,i)=>{if(e&&e.type){const t=(Qr(r,e.type).geoLocationAttributes||[]).map((t=>{return r=rO(e,t.latitude),n=rO(e,t.longitude),tO(r)&&tO(n)&&{lat:Number(r[0]),lng:Number(n[0])};var r,n})).filter(l.identity);if(t.length>0)return Promise.resolve(t[0])}const a=t.GeoLocation;if(a){const e=a.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(tO(t)&&t[0].value&&tO(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?zb(n.label,i).catch((()=>null)):Promise.resolve(null)},iO=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=Qr(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return nO(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?zb(a.label,r).catch((()=>null)):e)).then((e=>{let t=Array.isArray(e)?e:[e];return e&&t.map((e=>({id:e.id||n,label:i,entity:a,point:e})))})).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},aO=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=Qr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Or(e,r.latitude,t.type)&&Or(e,r.longitude,t.type)){const e=rO(t,r.latitude),n=rO(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))},oO=(e,t,r)=>Promise.all([aO(e,t),iO(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lon===e.point.lon))))]}));function sO(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){lO(e,t,r[t])}))}return e}function lO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uO=(e,t)=>t.values.map(Eo(e,t.entityTypeUri)),cO=(e,t,r)=>Fs(t.fieldName,r)||Or(e,it(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),pO=(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?nb(e,t):e}),r)},dO=(0,l.path)(["attrType","label"]),yO=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>sO({},e,{[t]:!0})),{});e[r]=e[r]?sO({},e[r],n):n}return e}),{}),fO=(0,l.pipe)((0,l.prop)("values"),E),TO=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Sn.type.name)),EO=e=>e.type===bO.NUMERIC_RANGE_FACET,mO=e=>e.type===bO.DATE_RANGE_FACET,hO=(0,l.either)(EO,mO),bO={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},OO=e=>{switch(null==e?void 0:e.name){case Sn.type.name:return bO.ENTITY_TYPE_FACET;case Sn.createdBy.name:case Sn.updatedBy.name:case Sn.sourceSystems.name:case Sn.tags.name:case Sn.roles.name:case Sn.matchRules.name:case Sn.MLRecommendedMatch.name:return bO.WITH_DROPDOWN_CHECKBOXES_FACET;case Sn.createdTime.name:case Sn.updatedTime.name:case Sn.startDate.name:case Sn.endDate.name:return bO.DATE_RANGE_FACET;case Sn.matches.name:case Sn.matchScore.name:return bO.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return bO.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return bO.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return bO.DATE_RANGE_FACET;default:return bO.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},vO=(0,l.pipe)(cO,OO),gO=(0,l.pipe)((0,l.path)(["attrType","type"]),Ir),_O=(0,l.cond)([[EO,(0,l.always)(tn.IN_RANGE)],[mO,(0,l.always)(tn.WITHIN)],[(0,l.allPass)([gO,e=>e.values.length>=2]),(0,l.always)(tn.EXISTS)],[l.T,(0,l.always)(tn.EQUALS)]]),AO=(0,l.cond)([[mO,(0,l.prop)("values")],[EO,(0,l.prop)("values")],[gO,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]]]);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 RO=(0,l.pipe)((0,l.path)(["attrType","type"]),Ar),PO=(0,l.pipe)((0,l.path)(["attrType","type"]),Pr),SO=(0,l.pipe)((0,l.prop)("attrType"),$s),wO=(0,l.pipe)((0,l.prop)("attrType"),Ms),IO=e=>t=>t.values.map((t=>Qr(e,t).label)).join(" , "),UO=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),CO=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(En().number),UO)),(0,l.join)(","))(e.values);return`${dO(e)}: ${t}`},LO=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),UO)),(0,l.join)(","))(e.values);return`${dO(e)}: ${t}`},DO=e=>t=>`${dO(t)}: ${uO(e,t).join(", ")}`,jO=e=>t=>{const r=pO(e,t);return`${dO(t)}: ${r.join(", ")}`},kO=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[wO,IO(e)],[PO,CO],[RO,LO],[SO,DO(e)],[l.T,jO(t)]]),r))),xO=(e,t,r,n)=>(0,l.pipe)(l.values,(0,l.reject)((0,l.pipe)((0,l.prop)("values"),E)),(0,l.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){NO(e,t,r[t])}))}return e}({},t,{attrType:cO(e,t,n)}))),kO(e,r))(t),FO=new RegExp(`^${En().text("Search")}`),MO=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...xO(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(FO,"",u)]},$O=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(un),VO=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]=_u(t);return e.replace(r,i).replace(n,a)}),e))(e),GO=(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}`})),WO={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},YO=e=>[WO.geoPolygon,WO.onMapMove].includes(e),BO=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},qO=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},QO=(e,t)=>YO(e)?t.map(BO):[qO(t)],HO=e=>YO(e)?En().text("Geo Polygon"):En().text("Geo Location"),KO=e=>{switch(e){case WO.geoLocation:return"geoLocation";case WO.geoPolygon:case WO.onMapMove:return"geoPolygon"}},JO={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},XO=e=>En().text(e),zO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[tn.EQUALS]:"=",[tn.NOT_EQUALS]:"≠",[tn.STARTS_WITH]:"*",[tn.MISSING_VALUE]:En().text("missing value"),[tn.HAS_ALL]:En().text("has all"),[tn.IN_RANGE]:En().text("in range"),[tn.FULL_TEXT]:En().text("full text"),[tn.EXISTS]:En().text("exists"),[tn.COUNT_EQUALS]:`${En().text("count")} =`,[tn.COUNT_NOT_EQUALS]:`${En().text("count")} ≠`,[tn.COUNT_LT]:`${En().text("count")} <`,[tn.COUNT_LTE]:`${En().text("count")} <=`,[tn.COUNT_GT]:`${En().text("count")} >`,[tn.COUNT_RANGE]:En().text("count range"),[tn.LT]:"<",[tn.LTE]:"<=",[tn.GT]:">",[tn.GTE]:">=",[tn.IN_FILE]:En().text("in file"),[tn.NOT_IN_FILE]:En().text("not in file"),[tn.CONTAINS]:"~",[rn.LIST_EQUALS]:"=",[rn.NOT_LIST_EQUALS]:"≠",[rn.LIST_EQUALS_CASE_SENSITIVE]:"=",[rn.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||En().text(e.toLowerCase())},ZO=e=>({type:JO.operator,text:e}),ev=e=>({type:JO.operator,text:XO(e)}),tv=e=>({type:JO.attributeLabel,text:e}),rv=e=>({type:JO.specialAttributeLabel,text:e}),nv=e=>({type:JO.attributeFilter,text:zO(e)}),iv=e=>({type:JO.attributeValue,text:e}),av=e=>({type:JO.entityTypeLabel,text:e}),ov=()=>({type:JO.space,text:" "}),sv=()=>({type:JO.bracket,text:"("}),lv=()=>({type:JO.bracket,text:")"}),uv=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),cv=(0,l.curry)(((e,t)=>t.map(uv(e)))),pv=(0,l.curry)(((e,t,r)=>[e,...r,t])),dv=pv(sv(),lv()),yv=pv(ov(),ov()),fv=(0,l.curry)(((e,t)=>[e,...t])),Tv=e=>fv(av(e)),Ev=e=>fv(av(`${e}: `)),mv=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=ru(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=eu(s),a=tu(s);!r&&t&&n&&(i.push(sv()),r=!0),i.push(o),r&&a&&(i.push(lv()),r=!1);const l=e?ev(s):ZO(s);i.push(...yv([l]))}else i.push(o),r&&(i.push(lv()),r=!1)}return i}},hv=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),bv=(0,l.pipe)(mv({localizable:!1}),hv),Ov=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},vv=e=>{let{data:t,values:r,filter:n}=e;return t&&Mu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},gv=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(vv)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),_v=(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)&&Er(e.data.attrType)})(e)&&[tn.HAS_ALL,tn.EQUALS,tn.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Tr((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})))),ub),Av=(e,t)=>(0,l.pipe)(_v,cb(t))(e),Nv=(0,l.pathEq)(["data","fieldName"],Sn.type.name),Rv=(0,l.path)(["data","entityTypeUri"]),Pv=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),Sv=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ns(e)),attributes:(0,l.filter)((0,l.pipe)(Rv,(0,l.anyPass)([l.isNil,ns(e),r=>{const n=(t.entityTypes||[]).filter(ns(e));return(n.length>1?zr(e,n):null)===r&&!!Qr(e,r)}])))})(t))))),wv=e=>(0,l.pipe)((0,l.prop)("filter"),Vl,(0,l.equals)(e)),Iv=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Fs(n.fieldName)||n.attrType,s=bu(o,i),u=pb({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Er(s),()=>(0,l.is)(Object,a)&&a.lookupCode?nb(a.lookupCode,a.value):ab(r,Tr(o),a)],[()=>$s(s),()=>Eo(e,n.entityTypeUri,a)],[()=>Vs(s),()=>Fo(e,a)],[()=>Qs(s),()=>Vo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Pr(c)||Ir(c)),Tu),iv)()})),Uv=(e,t,r,n)=>{const i=Iv(e,t,r,n.data,n.filter);return(0,l.cond)([[wv(0),(0,l.always)([])],[(0,l.both)(wv(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[ov(),i(r),{type:JO.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[ov(),...(0,l.pipe)(l.flatten,(0,l.map)(i),cv({type:JO.punctuationMark,text:", "}))(t)]}]])(n)},Cv=(e,t)=>{const r=!!Fs(e.data.fieldName);return(0,l.pipe)(Ov,r?rv:tv)(e,t)},Lv=(e,t,r,n,i)=>[Cv(n,i),ov(),nv(n.filter),...Uv(e,t,r,n)],Dv=(0,l.addIndex)(l.map),jv=(0,l.propEq)("length",1),kv=(0,l.propSatisfies)((0,l.lt)(1),"length"),xv=(0,l.complement)(l.isEmpty),Fv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(au,(0,l.filter)(vv),ou,(0,l.map)((n=>({operand:Lv(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,mv()))(n)},Mv=(0,l.pipe)(Fv,l.flatten),$v=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>cd(e,{type:t}))).join(", ");return r?t(r):l.identity},u=Fv(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(Tv),(0,l.pipe)(s(Ev),(0,l.unless)((()=>jv(u)||i),dv)))(u)},Vv=(e,t,r,n)=>(0,l.pipe)(au,(0,l.filter)(gv),ou,Dv(((n,i,a)=>({operand:$v(e,t,r,n,jv(a)),operator:n.operator}))),mv(),l.flatten)(n),Gv=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),mv(),l.flatten),Wv=e=>{let{searchType:t,values:[r]}=e;return QO(t,r).join(", ")},Yv=(e,t,r,n,i,a)=>{const o=(e=>e?[rv(e.isRawFilter?En().text("Raw filter"):En().text("Search")),...yv([nv(tn.EQUALS)]),iv(`"${e.value}"`)]:[])(i),s=(e=>e?[rv(HO(e.searchType)),ov(),iv(Wv(e))]:[])(a),u=(0,l.pipe)(Vv,(0,l.when)((e=>kv(e)&&(xv(o)||xv(s))),dv))(e,t,r,n);return Gv([o,s,u])},Bv=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),qv=(0,l.pipe)(Yv,Bv),Qv=(0,l.has)("attributes"),Hv=Array.isArray,Kv=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),Jv=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=Xv(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)(Kv(a))),dv),(0,l.concat)(yv([ZO(o)]))))(s)},Xv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Qv(n)?Jv(e,t,r,n,i):Hv(n)?n.reduce(((n,a)=>n.concat(Xv(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(yv([ZO(n.operator)])))(Lv(e,t,r,n,i))},zv=(e,t,r,n,i)=>(0,l.pipe)(Xv,l.flatten)(e,t,r,n,i);function Zv(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){eg(e,t,r[t])}))}return e}function eg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tg=(0,l.complement)(Nv),rg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(Nv),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(Rv),(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}},ng=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=rg(t);return(r||n)&&nu(t)},ig=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(ng)),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(Nv).some((0,l.propEq)("filter",tn.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}=rg(r);if(ng(e))t.push(Zv({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(tg)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(Nv,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(Rv,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(tg),entityTypes:n,operator:i?a:e.operator,id:Fh()()}}));t.push(...n)}var a;return t})(t))),[]))),ag={[tn.EQUALS]:tn.ON,[tn.IN_RANGE]:tn.WITHIN,[tn.GTE]:tn.AFTER,[tn.GT]:tn.AFTER,[tn.LTE]:tn.BEFORE,[tn.LT]:tn.BEFORE},og=(0,l.curry)((e=>ag[e]||e)),sg=(0,l.curry)(((e,t)=>{switch(e){case tn.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case tn.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),lg=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Ar),ug=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>Zv({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return lg(e)?(0,l.evolve)({filter:og,values:sg(t)},e):e}))})))})),cg=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),ig,Sv(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")))})),ug,(0,l.reject)(Pv))(r)));function pg(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){dg(e,t,r[t])}))}return e}function dg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yg=(e,t)=>({data:{uri:lt(e.fieldName)?it(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||_O(e),id:Fh()(),values:AO(e)}),fg=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Fs(a,t,r)||Or(e,i);if(!s)return null;if(or(s))return pg({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=cd(e,{type:o}),i=(br(e,it(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return pg({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),Tg=(0,l.curry)(((e,t,r,n)=>cg(fg,e,n,t,r)));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){mg(e,t,r[t])}))}return e}function mg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hg=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},bg=e=>"rdmLookups.not.resolved"===e?Sn.notResolved.name:e,Og=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===sn?tn.IN_RANGE:ln(a),u=bg(n),c=Fs(u)||Or(e,i),p=(0,l.cond)([[()=>Bl(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>Eg({},e,{filename:rb(e)}))))],[()=>Ir(null==c?void 0:c.type),(0,l.map)(le)],[e=>Wl(s)&&!Array.isArray(e[0])&&!Ar(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:Fh()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===sn?"and not":"and",filter:s,values:p}})),vg=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(Og(e,zr(e,i)));return[{id:Fh()(),operator:"or",attributes:a,entityTypes:i}]})),gg=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),_g=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([gg("from"),gg("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,()=>[]]]),Ag=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return Eg({},r,{values:_g(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Ls(e.fieldName,n):e.fieldName})},Ng=(e,t)=>{if((0,l.has)("children")(e)){const r=Ag(e,t);return e.children.reduce(((e,n)=>(e.push(Ng(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return Ag(e,t)},Rg=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(Ag(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(Eg({fieldName:e.fieldName},Ag(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(Ng,l.flatten)],[l.T,Ag]]),Pg=(0,l.pipe)((0,l.map)(Rg),l.flatten),Sg=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},wg=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=vg(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:Pg(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>Eg({},t,{type:vO(e,t)}))).map((e=>Eg({},e,{values:hO(e)?Sg(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 yg(r,t)})),operator:"or",id:Fh()(),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=>({[bg(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[Eg({},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 Tg(e,t,r,p)},Ig=(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)(fO),(0,l.partition)(TO))(t),i=n.map((t=>pg({},t,{type:vO(e,t)}))).map((e=>yg(e))),a=r.values||[];return[{attributes:i,operator:"or",id:Fh()(),entityTypes:a}]})(e,a);return Tg(e,t,r,o)})(e,t,r,n):wg(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},Ug=e=>"2.0"===e.version?e.keyword:hg(e),Cg=e=>(0,l.pathEq)(["object","uri"],e),Lg=(e,t)=>(0,l.pipe)((0,l.find)(Cg(e)),(0,l.prop)("object"))(t),Dg=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"),Cg(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Lg(r.match,t)||n[r.match];return i?{label:Wp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return To(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)},jg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),kg=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),xg=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[]}=t;const a=(0,l.propOr)({},n,r);return{label:Wp((0,l.prop)("label",a)),matchRules:i.map((function(t){return To(e,a.type,t)||{label:t,uri:t}}))}})))(t),Fg=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)},Mg=(0,l.path)(["object","uri"]),$g=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Vg=e=>e.getValue(),Gg=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=Gg(n[e],t),!r);e++);return r},Wg=(e,t)=>{const r=[],n=(0,l.pipe)(Vg,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(Wg,[t]),a);return r.push.apply(r,o),r};function Yg(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){Bg(e,t,r[t])}))}return e}function Bg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qg=(e,t)=>!!e[t],Qg=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},Hg=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||[]])},Kg=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Yg({},t,{[r.uri]:Yg({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:Hg(null==o?void 0:o.parents,n),children:Hg(null==o?void 0:o.children,i),values:Hg(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},Jg=e=>e.children?e.children.flatMap(Jg):e,Xg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Qr(r,t)||gi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Ho(r,n,i).flatMap(Jg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Or(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=Kg({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Kg({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},zg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!qe(e.uri)&&ze(e.type)&&ze(t)&&!t.startsWith(e.type))(n,t))return e;const i=bs(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(is),(0,l.map)(Qg))(i);return Kg({structure:e,attrType:e[t].attrType,values:a})}),t)},Zg=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 qg(e,r)}));return r||n?t.filter(is).reduce(((e,t)=>Zg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return qg(t,e.type)?Kg({structure:t,attrType:t[e.type].attrType,values:[Qg(e)]}):t}},e_=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Yg({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},t_=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=bs(i,n,r)||[];return a.length?Kg({structure:t,attrType:t[r].attrType,values:a.filter(is).map(Qg)}):t},r_=(e,t,r)=>{const n=Ke(e),i=Ke(t);return n===i?((e,t)=>{const r=ct(t),n=ct(e);return et(n,r)})(e,t):!(!r||!ut(t))&&HT(r,i).includes(n)},n_=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},i_=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?qT(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return r_(r,t,o)}))},a_=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>a_(e,t,r)))))},o_=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&n_(n,e)}},s_=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ke(n),c=QT(u,o,i,a),p=a_("children",t,l),d=a_("parents",t,l),y=p.flatMap((e=>a_("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return r_(t,n,c)})).map((t=>o_(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return r_(n,t,c)||Ke(t)!==u&&r_(t,n,c)})).map((t=>o_(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=a_("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&r_(n,t,c)}))})).map((t=>o_(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return r_(t,n,c)})).map((e=>o_(r,n,e,s))),...T,...E,...f]},l_=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=pb({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=>Vp(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[cr,()=>a(n)],[Er,()=>(e=>{const r=o(e),n=Tr(t);return Ul([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return ab(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},u_=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:tn.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(c_(r,t)):i.push(p_([t],r)),i},c_=(e,t)=>{const r=sr(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=cr(i)?c_(i,t[r]):[p_(t[r],i)];return e.push(...a),e}}),[])},p_=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:fr(t.uri),filter:t.type===Vt.TYPE_BLOB?tn.FULL_TEXT:tn.EQUALS,values:e}:{fieldName:fr(t.uri),filter:tn.MISSING_VALUE},d_={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},y_={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:()=>{}}]);