@reltio/remotes 1.4.986 → 1.4.987
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/825.js +1 -1
- package/package.json +1 -1
package/825.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[825],{27502:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Cs,PY2:()=>Ut,Ng6:()=>ir,YJ7:()=>Nt,Xt7:()=>tr,wfT:()=>qr,EMD:()=>Lr,HAc:()=>rr,PEf:()=>kt,oA3:()=>jr,$XE:()=>Er,eWf:()=>Lt,q7e:()=>nr,KVe:()=>Kr,WVQ:()=>ai,oZZ:()=>nn,bNA:()=>an,Rjq:()=>on,G39:()=>Ft,dZX:()=>mr,bQt:()=>ln,oS0:()=>vt,lL_:()=>Ot,Nsj:()=>Rt,psV:()=>_t,xPW:()=>Ct,pyR:()=>Vr,p8l:()=>kr,Wkf:()=>er,zHr:()=>Zt,NIO:()=>zt,$26:()=>lb,Esk:()=>wr,s9T:()=>pr,MEy:()=>Vl,j5E:()=>ct,vAw:()=>Cr,NMQ:()=>Ur,mNm:()=>Fr,rwv:()=>tn,s_5:()=>$r,RgZ:()=>xr,unl:()=>rn,Qy0:()=>sn,pYu:()=>Pr,wIJ:()=>Cb,GFH:()=>or,S91:()=>Mt,p3$:()=>dn,wSh:()=>z,BDP:()=>_i,pGS:()=>Mr,ARY:()=>gr,XGc:()=>Br,fO_:()=>Kt,wwy:()=>lr,_XL:()=>At,j2V:()=>Hr,dMV:()=>Wr,NBX:()=>Lg,OXy:()=>vr,BXd:()=>yr,CJB:()=>Xr,lXI:()=>Or,nqG:()=>cn,C68:()=>xt,yxQ:()=>un,Yj_:()=>ur,ZIY:()=>hr,Tl4:()=>Mb,lwr:()=>Dt,NkU:()=>Jr,Rtp:()=>Yr,YGx:()=>fr,uTS:()=>Gr,IYE:()=>Dr,PiC:()=>en,tJI:()=>ar,cNQ:()=>Qr,SwE:()=>Sr,ZHR:()=>Zr,lD1:()=>Vt,lVm:()=>Tr,vnX:()=>jh,$x5:()=>Lh,_R1:()=>Uh,wUm:()=>Ch,z7V:()=>pn,dC6:()=>dr,MBD:()=>sr,GmF:()=>ea,cKm:()=>br,iP_:()=>jt,NVC:()=>cr,tPT:()=>_s,tZe:()=>op,kRE:()=>ay,psB:()=>oy,X0$:()=>vs,Wm5:()=>Hs,vyX:()=>Iu,wLZ:()=>Ns,W4V:()=>oe,EtK:()=>os,Wtd:()=>gs,asT:()=>Kg,kGs:()=>ge,ewt:()=>mf,O_f:()=>uO,sOy:()=>Ze,Tde:()=>Fn,LMI:()=>fu,skb:()=>jO,sPt:()=>au,sH1:()=>ou,RPM:()=>lT,h27:()=>Nu,Uqd:()=>Su,xG:()=>qO,Z2f:()=>Xm,fgW:()=>yO,I69:()=>FO,ZxB:()=>VO,mdt:()=>nT,Qbq:()=>Dm,rny:()=>xi,UEY:()=>Oa,Q0T:()=>ba,Lyr:()=>Pa,sBn:()=>ha,itK:()=>fa,H9$:()=>ma,KPc:()=>Ea,zos:()=>Ta,ELQ:()=>wa,dZs:()=>aa,Cz4:()=>ia,z_L:()=>Aa,fGe:()=>na,iuF:()=>da,Wib:()=>ya,Hn0:()=>Ra,XUh:()=>pa,Qp_:()=>ua,_jk:()=>oa,sKE:()=>sa,WmG:()=>ca,QKx:()=>_a,Oik:()=>va,s0A:()=>la,o9m:()=>ga,MCd:()=>Na,tGK:()=>hl,Vg3:()=>Yi,mkC:()=>Ui,xv5:()=>qi,a14:()=>ji,yv0:()=>Bi,Zm0:()=>Ci,Nxd:()=>Ii,$mM:()=>Wi,ifj:()=>si,NWi:()=>Eh,xr3:()=>Th,wNf:()=>wl,iJH:()=>mh,d89:()=>Pi,Edd:()=>wi,Z5t:()=>Si,uGe:()=>Ai,UoR:()=>Ni,xvW:()=>fh,$qe:()=>yh,yPM:()=>ra,$cp:()=>Us,vKJ:()=>Ss,AID:()=>Hy,B1H:()=>Cg,b7X:()=>Cm,$uE:()=>ve,keo:()=>Lm,C_p:()=>BT,G27:()=>YE,JA0:()=>Qd,b3T:()=>Oe,oC6:()=>he,_Zs:()=>be,epC:()=>Ne,YYG:()=>_e,f_2:()=>zd,w3l:()=>fg,QHB:()=>WE,Jso:()=>gg,RXH:()=>IE,Vr9:()=>zE,lMm:()=>Rm,fmQ:()=>zo,yRD:()=>ng,NcL:()=>XT,QK6:()=>pe,ymd:()=>Wc,JV_:()=>hy,XiW:()=>lf,Yrx:()=>Fd,GPx:()=>Os,gjI:()=>bs,vlo:()=>Df,E_P:()=>zf,aAL:()=>Ic,NBq:()=>Zo,wp9:()=>rT,DsR:()=>Nc,MPc:()=>Zy,gWE:()=>ef,DT_:()=>tf,ipn:()=>nf,ORg:()=>Oi,_wz:()=>rf,RYR:()=>ff,PP2:()=>$d,wS7:()=>ih,cBQ:()=>uc,pBq:()=>jy,DsO:()=>Z,X78:()=>Oy,xZs:()=>fy,YFy:()=>Vd,Gmt:()=>cy,K$w:()=>uy,DSj:()=>Uc,k9j:()=>pc,ww$:()=>As,WVU:()=>ly,hxF:()=>Qs,nwO:()=>rv,Mzk:()=>ic,aFF:()=>$m,HRH:()=>Wl,EZK:()=>hp,Kxm:()=>fp,Z9i:()=>RT,CrF:()=>ty,DNd:()=>Ia,vUy:()=>zg,lJh:()=>ql,zHo:()=>Kl,sEJ:()=>kg,UO$:()=>My,zeJ:()=>Yn,dLR:()=>cs,JQy:()=>Ts,XtP:()=>ls,Ug0:()=>yi,A1W:()=>jm,sw:()=>mp,nv3:()=>Ah,JgD:()=>Nh,nve:()=>xg,SkP:()=>Es,SAs:()=>Dy,PWK:()=>So,IM5:()=>us,Mfk:()=>Um,mB6:()=>eh,p6d:()=>w,o0x:()=>I,ufS:()=>Wm,k7L:()=>Ym,mrB:()=>S,ncP:()=>Ke,Zmi:()=>Ge,hm5:()=>Ye,ECL:()=>Bt,vPL:()=>gp,qmL:()=>Qf,hXd:()=>Mi,OCS:()=>Vi,p2l:()=>Ls,qF1:()=>Yc,_X$:()=>Bc,yj2:()=>wb,bzh:()=>oT,k66:()=>xo,kiP:()=>eo,pSg:()=>ue,kz_:()=>qd,H_U:()=>Mo,t9e:()=>xa,j2$:()=>sp,PFL:()=>Pn,aJ3:()=>Zh,To9:()=>Mn,wpo:()=>Wp,ADq:()=>gT,UUb:()=>bT,tQX:()=>OT,xy8:()=>Un,EUG:()=>Bn,AFK:()=>it,X3M:()=>Wn,WN0:()=>Fo,kDl:()=>ps,uDV:()=>Jf,IhQ:()=>ys,R$r:()=>Xf,w80:()=>mo,Pfu:()=>Da,Gtj:()=>cl,fyF:()=>ul,u5q:()=>He,O$n:()=>$p,ptG:()=>Gp,f4_:()=>iE,uap:()=>nE,d7q:()=>xd,liG:()=>Gd,$oF:()=>kd,avf:()=>Af,DiQ:()=>Nf,cfX:()=>_f,vD3:()=>Pf,Qrb:()=>vf,EJQ:()=>Rf,HWy:()=>gf,y6v:()=>Of,GtP:()=>TE,_kX:()=>Ca,u1e:()=>ja,sJj:()=>Fm,CJp:()=>yE,uKF:()=>xm,wo0:()=>iy,cwx:()=>Uo,TTx:()=>dy,HaQ:()=>yy,E6I:()=>ey,vTU:()=>wd,Nsy:()=>jp,KMQ:()=>Vm,CSV:()=>xs,l1V:()=>Jl,VQ1:()=>Zl,z7d:()=>kf,Xaq:()=>Go,Sj8:()=>tv,PJj:()=>Tl,PjQ:()=>vi,s7l:()=>zu,GGR:()=>Uf,j5q:()=>Sf,DnY:()=>Hu,RY5:()=>Wf,Px$:()=>Tf,KPC:()=>Sg,NIY:()=>rc,HvW:()=>Zu,Fof:()=>Fa,BTI:()=>xp,uie:()=>Np,ChB:()=>bp,q27:()=>Bp,fAQ:()=>Ny,XkT:()=>Ku,lrH:()=>Ay,nt9:()=>li,XH8:()=>Vp,XH2:()=>fi,jFi:()=>Mp,qhs:()=>Eo,wwR:()=>kp,Uk3:()=>at,ev7:()=>jg,zsW:()=>Xu,RB9:()=>Jd,iFp:()=>cT,e$p:()=>dT,PcX:()=>yT,SpP:()=>pT,R6_:()=>tb,CY1:()=>ub,Ajk:()=>Wu,Yiz:()=>Gu,FK9:()=>Fu,UOo:()=>Bm,aTW:()=>py,uug:()=>Pl,P$2:()=>db,XS2:()=>bl,Hyb:()=>Ml,d3Y:()=>Lu,Klp:()=>ku,WxZ:()=>yb,Gzu:()=>Hl,ZOr:()=>qu,uqV:()=>Ad,Pm4:()=>te,nVD:()=>Bf,dED:()=>Ld,P2h:()=>jd,jrr:()=>Qa,mmY:()=>za,T6O:()=>Vo,h6J:()=>np,hM2:()=>Ng,XR6:()=>Q,jmz:()=>Hf,IHt:()=>Kf,NZI:()=>AT,wdF:()=>vy,kgP:()=>_y,ZYI:()=>Mc,QXK:()=>al,efz:()=>ol,Q5d:()=>il,Ysv:()=>sl,ocC:()=>Ff,io3:()=>pi,Sbt:()=>bo,roS:()=>ho,Ww1:()=>Oo,QaS:()=>ac,ERZ:()=>dg,CL1:()=>Ag,idV:()=>Ep,nIW:()=>tt,fjE:()=>rb,sG0:()=>qm,tV7:()=>El,g8o:()=>xb,Qy:()=>kb,t2P:()=>zh,wId:()=>so,LS0:()=>lo,bFH:()=>dd,Rgl:()=>fd,fW1:()=>zT,Ywp:()=>Ih,pg:()=>Jp,WSA:()=>Td,fed:()=>vg,tT_:()=>fs,KbL:()=>Qu,JBA:()=>lt,aNC:()=>_h,RFJ:()=>Fc,Zeh:()=>Fy,OT5:()=>Sh,mC3:()=>Zs,NVY:()=>eT,k6v:()=>qc,FEC:()=>Kc,Ob5:()=>qp,KUV:()=>Kp,dvH:()=>Zf,V3i:()=>tm,VD3:()=>di,mm2:()=>zl,izH:()=>La,DK$:()=>ka,KMp:()=>Sc,c31:()=>En,mbo:()=>_T,gT8:()=>bn,CZ8:()=>Qo,uGi:()=>rs,Poc:()=>fn,_9k:()=>as,ZTM:()=>es,bwT:()=>ns,tzW:()=>gn,tF$:()=>hn,o96:()=>Xo,M4S:()=>is,_vs:()=>vc,xF8:()=>Ef,HQx:()=>Gm,ATu:()=>vT,j1S:()=>hi,V3K:()=>Ei,Lmx:()=>mi,ZaZ:()=>Tn,n_1:()=>Pd,N6e:()=>Rc,SxO:()=>Xa,w3p:()=>tT,xU7:()=>ce,Y_p:()=>_o,$k6:()=>vo,Gdl:()=>Hm,U6P:()=>Km,OwB:()=>eb,hTh:()=>qf,xqc:()=>Co,JvE:()=>jo,i29:()=>bu,dzT:()=>Di,uPS:()=>lc,cZV:()=>sc,Uz2:()=>Sp,xz3:()=>wp,AET:()=>Pp,n3B:()=>OO,e6O:()=>fO,s7j:()=>Ub,kW2:()=>fE,tH7:()=>Io,Yxg:()=>Gs,MaZ:()=>If,nqN:()=>wf,o_J:()=>Wo,hgZ:()=>Op,yW4:()=>ip,uT0:()=>tp,C82:()=>rp,u9Z:()=>Uy,J$m:()=>Rd,j_Q:()=>Vu,wB1:()=>Ug,SP6:()=>Hp,ZYr:()=>wg,IMU:()=>xc,FoU:()=>Xd,DVz:()=>Zm,mxe:()=>hO,FHr:()=>ky,VO3:()=>Fh,de5:()=>xh,Uw1:()=>fe,J6q:()=>NT,XCe:()=>Ka,Ir:()=>no,XQO:()=>io,QXb:()=>ad,P8_:()=>Ey,iiD:()=>wc,MOC:()=>od,WF:()=>id,xE1:()=>gi,idW:()=>Bg,YL3:()=>nc,Fn9:()=>T,j2U:()=>js,MpE:()=>vn,kQw:()=>Sn,mfm:()=>oO,vZp:()=>ot,E8K:()=>Vg,VSb:()=>Ho,vr_:()=>wn,Vmh:()=>Xg,FgW:()=>em,oDv:()=>Bo,kuw:()=>qo,Tt2:()=>Yo,T6Y:()=>ei,_26:()=>kl,YkM:()=>xn,J6y:()=>vl,njU:()=>Il,IT0:()=>PT,x_:()=>Mm,biM:()=>Dp,Vkd:()=>jl,WiY:()=>ob,_zi:()=>Ll,J6D:()=>Xl,Lt4:()=>Hn,QEi:()=>$n,whI:()=>Jt,KIu:()=>Xt,JhM:()=>ae,C_0:()=>ni,qIF:()=>gO,O27:()=>E,aBi:()=>Yp,xOX:()=>Ks,EdS:()=>Xe,WgC:()=>Qe,eEv:()=>An,A4t:()=>Ul,hnu:()=>st,Wos:()=>zn,jWr:()=>Sa,Or$:()=>kn,lhE:()=>ci,CwH:()=>Vn,pzC:()=>Ys,ymH:()=>Sl,QZu:()=>Ln,rYH:()=>ab,FVt:()=>Xn,Kn2:()=>le,OXP:()=>Ko,lS4:()=>Gn,g5f:()=>sb,fp6:()=>Al,Uty:()=>Ji,YkG:()=>Dn,xdS:()=>On,$NE:()=>ze,bC9:()=>Je,KVV:()=>km,q9e:()=>go,iIf:()=>Jm,ian:()=>Xs,m6e:()=>ii,OFd:()=>Bs,kqr:()=>In,fnZ:()=>Ht,VFZ:()=>zs,ZiX:()=>Be,j5n:()=>Jn,zkt:()=>v,Pcm:()=>Ig,QDV:()=>Ws,M5u:()=>ib,laD:()=>bO,mtq:()=>Nn,CtB:()=>Qm,CBv:()=>ie,I0t:()=>ri,u1G:()=>Lf,gk1:()=>EO,Bgb:()=>TO,uzs:()=>Qt,v0l:()=>ru,Zqp:()=>Id,j0k:()=>wo,tCm:()=>nt,gmx:()=>Ol,mOr:()=>$l,TwZ:()=>Fb,GyU:()=>Rh,zGm:()=>zp,bMg:()=>bd,EyD:()=>ph,FQA:()=>dh,fZN:()=>vd,xsF:()=>uh,Lxg:()=>ch,O3l:()=>yc,Wni:()=>dc,wRx:()=>bh,OxG:()=>ud,uJQ:()=>ld,qWg:()=>zm,i96:()=>Qp,zhn:()=>hh,G8q:()=>yn,A9Y:()=>ee,Y5F:()=>ig,gxP:()=>se,c$P:()=>gl,BBN:()=>Ja,ZBU:()=>J,UkJ:()=>uo,xkv:()=>Ty,z$M:()=>qg,KAm:()=>Hd,lCl:()=>Jy,rkF:()=>qT,IU6:()=>dp,aYu:()=>m,ije:()=>fl,Buf:()=>Pc,YLu:()=>yl,ct9:()=>Ao,XkY:()=>Od,T5R:()=>Zp,uQS:()=>_d,wcJ:()=>No,d$I:()=>Rs,rSp:()=>Lp,Sx:()=>tc,Ki6:()=>Js,VGk:()=>_c,sFD:()=>UE,eWN:()=>Hg,dWE:()=>Ib,Lkd:()=>uf,aDL:()=>Vy,yaA:()=>Nd,DBr:()=>Jh,hK$:()=>ml,TZ_:()=>pp,CMB:()=>vO,FU8:()=>ec,J$p:()=>Yy,b5s:()=>Wy,h2W:()=>rt,SL_:()=>wy,oUH:()=>zc,ck9:()=>ed,Xs0:()=>dl,oCZ:()=>$T,MjG:()=>kh,FuV:()=>Xc,$ju:()=>ep,t6d:()=>Zc,m5F:()=>ye,sx:()=>Jg,rSc:()=>th,L8n:()=>sy,R9X:()=>Sd,rj2:()=>by,_C4:()=>lp,tCj:()=>my,uAg:()=>Md,wx9:()=>hf,KF3:()=>up,ax9:()=>cp,HH7:()=>Ac,_6y:()=>cc,AJo:()=>oc,Ixr:()=>Zd,P6Y:()=>nv,Bd_:()=>xT,xkB:()=>kT,W41:()=>Iy,WkI:()=>Sy,sSE:()=>DT,GMd:()=>Tu,Bxm:()=>MT,FVh:()=>IT,U_T:()=>Ed,FTe:()=>ne,VGB:()=>re,Wfe:()=>Bl,Ls5:()=>Yl});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:()=>I,formatTime:()=>S,getEndOfDay:()=>P,getMomentFormatFromDateMask:()=>B,getMomentFormatFromDateTimeMask:()=>H,getMomentFormatFromTimeMask:()=>K,getStartOfDay:()=>R,isToday:()=>v,isValidMomentDate:()=>h,isValidMomentDateOrNull:()=>b,momentToDate:()=>O,parseTimestamp:()=>J,toLocalDate:()=>_,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>ve,compareActivenessAttributes:()=>Oe,compareAttributes:()=>he,compareImages:()=>be,compareRoles:()=>Ne,compareTags:()=>_e});var o={};r.r(o),r.d(o,{addAttribute:()=>Pe,editAttribute:()=>we,editEndDate:()=>Le,editRoles:()=>Ue,editStartDate:()=>je,editTags:()=>Ce,removeAttribute:()=>Ie});var s={};r.r(s),r.d(s,{createHistoryManager:()=>xe});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=>e&&e.isValid(),b=(0,l.either)(h,l.isNil),O=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),v=e=>f()(e).isSame(Date.now(),"day"),_=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)},A=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=A("startOf"),P=A("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),S=e=>f()(e).format(f().localeData().longDateFormat("LTS")),I=e=>`${w(e)} ${S(e)}`,U=(0,l.equals)("9"),C=(0,l.equals)("99"),j=(0,l.equals)("9999"),L=(0,l.test)(/^[az][az][az]$/),D=(0,l.test)(/^[az][az][az][az]$/),k=(0,l.test)(/^9+$/),x=(0,l.test)(/^[9az]+$/),F=(0,l.cond)([[U,(0,l.always)("M")],[C,(0,l.always)("MM")],[L,(0,l.always)("MMM")],[D,(0,l.always)("MMMM")],[x,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),M=(0,l.cond)([[U,(0,l.always)("D")],[C,(0,l.always)("DD")],[x,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[U,(0,l.always)("y")],[C,(0,l.always)("YY")],[j,(0,l.always)("YYYY")],[k,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),$=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),U),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),C),(0,l.always)("hh")],[U,(0,l.always)("H")],[C,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),G=(0,l.cond)([[U,(0,l.always)("m")],[C,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),W=(0,l.cond)([[U,(0,l.always)("s")],[C,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,B=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[F(e),r,M(n),i,V(a),o])}return e},q=/(9+)([^9]+)*/g,K=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,[$(e,s),r,G(n),i,a?W(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},H=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${B(t)} ${K(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Q=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",X=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:X,None:()=>X(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)}},Z=(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)}},ee=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},te=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),re=e=>Array.isArray(e)?e:[e],ne=e=>[e],ie=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),ae=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),oe=e=>(e=(e||"").toLowerCase(),ae(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),se=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),le=e=>null!=e&&["object","function"].includes(typeof e),ue=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)),le(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},ce=(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)},pe=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)},de=/[\n\r%#()<>?[\\\]^`{}|]/g,ye=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(de,encodeURIComponent)}`,fe=e=>`data:image/gif;base64,${e}`;function Te(e){return e&&void 0!==e.uri}function Ee(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 me(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 he(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"===v(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(he(d.value,y.value,r)):"Reference"===v(d)?me(d,y)?o.push.apply(o,he(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(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&&(le(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),g(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 g(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,g(e.value)}))}function v(e){var t=e.value;if(le(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 be(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)||Te(r)&&Te(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function Oe(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 ve(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 _e(e,t){return Ee("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return Ee("UPDATE_ROLES").call(this,e,t)}function Ae(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 Re(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Ae(r[i],r[i+1],e,t));return n}function Pe(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Re(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 Pe(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=Re(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()?(Se(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(Se.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=Pe(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 Se(e,t){le(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ie(e,t,r,n){void 0===n&&(n=0);var i=Re(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ie(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 Ue(e,t){e.roles=t||[]}function Ce(e,t){e.tags=t||[]}function je(e,t){e.startDate=t||""}function Le(e,t){e.endDate=t||""}function De(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){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}var xe=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(le(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:le(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(le(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){le(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=De({},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:De({},n,{roles:s,tags:u}),roles:i,tags:l}}}},Fe=r(15729);const Me="1Tempo4rary",Ve="1Tepmo4Rel",$e=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Ge=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,We=e=>()=>Ge(e),Ye=(e,t)=>{const r=$e(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Ge(n)},Be=e=>e&&e.includes("uri$$"),qe=We("entities"),Ke=We("relations"),He=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Qe=(0,l.startsWith)("entities/"),Xe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ze=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),et=(0,l.pipe)((0,l.split)("/"),l.head),tt=(0,l.pipe)((0,l.split)("/"),l.last),rt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},nt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),it=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},at=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},ot=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),st=e=>5===e.split("/").length,lt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ut=e=>e.replace(/uri\$\$/g,Me),ct={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"},pt="listEquals",dt="not listEquals",yt="listEqualsCaseSensitive",ft="not listEqualsCaseSensitive",Tt={[ct.EQUALS]:"equals",[ct.NOT_EQUALS]:"not",[ct.STARTS_WITH]:"starts with",[ct.MISSING_VALUE]:"missing value",[ct.IN_RANGE]:"in range",[ct.HAS_ALL]:"has all",[ct.FULL_TEXT]:"full text",[ct.EXISTS]:"exists",[ct.COUNT_EQUALS]:"count equals",[ct.COUNT_NOT_EQUALS]:"count not equal",[ct.COUNT_LT]:"count less",[ct.COUNT_LTE]:"count less or equal",[ct.COUNT_GT]:"count greater",[ct.COUNT_GTE]:"count greater or equal",[ct.COUNT_RANGE]:"count in range",[ct.LT]:"less than",[ct.LTE]:"less than or equal",[ct.GT]:"greater than",[ct.GTE]:"greater than or equal",[ct.IN_FILE]:"in file",[ct.NOT_IN_FILE]:"not in file",[ct.CONTAINS]:"contains",[ct.ON]:"on",[ct.BEFORE]:"before",[ct.AFTER]:"after",[ct.WITHIN]:"within"},Et="in",mt="notIn",ht="not range",bt=e=>({[Et]:ct.EQUALS,[mt]:ct.NOT_EQUALS}[e]||e),Ot={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},gt={[Ot.LAST_DAY]:"Last 24 hours",[Ot.LAST_3DAYS]:"Last 3 days",[Ot.LAST_WEEK]:"Last week",[Ot.LAST_MONTH]:"Last month",[Ot.LAST_YEAR]:"Last year",[Ot.PICK_DATE]:"Pick date"},vt={TYPE_STRING:"String",TYPE_TEXT:"Text",TYPE_PASSWORD:"Password",TYPE_LONG:"Long",TYPE_INT:"Int",TYPE_DOLLAR:"Dollar",TYPE_FLOAT:"Float",TYPE_DOUBLE:"Double",TYPE_NUMBER:"Number",TYPE_BOOLEAN:"Boolean",TYPE_BOOLEAN_RADIO:"Boolean_Radio",TYPE_DATE:"Date",TYPE_TIMESTAMP:"Timestamp",TYPE_ACTIVENESS_DATE:"ActivenessDate",TYPE_LOCAL_DATE:"LocalDate",TYPE_BLOB:"Blob",TYPE_ENUM:"Enum",TYPE_CIK_ID:"cik id",TYPE_LOOKUP:"Lookup",TYPE_TYPEAHEAD:"Typeahead",TYPE_URL:"URL",TYPE_BLOG_URL:"Blog URL",TYPE_IMAGE_URL:"Image URL",TYPE_EMAIL:"Email",TYPE_DEPENDENT_LOOKUP:"DependentLookup",TYPE_ENTITY_ID:"EntityId",TYPE_RDM_LOOKUPS_NOT_RESOLVED:"RdmLookupsNotResolved",TYPE_COUNT:"Count",TYPE_FILE:"File",TYPE_SELECT:"Select",TYPE_NESTED:"Nested",TYPE_REFERENCE:"Reference",TYPE_IMAGE:"Image",TYPE_SSN:"SSN"},_t={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Nt={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},At="<No label>",Rt={IN:"in",OUT:"out"};var Pt=r(87918),wt=r.n(Pt);function St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){It(e,t,r[t])}))}return e}function It(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ut={startDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Ct=St({id:{type:vt.TYPE_ENTITY_ID,get label(){return wt().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Ut,{roles:{type:vt.TYPE_STRING,get label(){return wt().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:vt.TYPE_STRING,get label(){return wt().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),jt={workflow:{type:vt.TYPE_STRING,get label(){return wt().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:vt.TYPE_STRING,get label(){return wt().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:vt.TYPE_STRING,get label(){return wt().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Lt={commenter:{type:vt.TYPE_STRING,get label(){return wt().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Dt={notResolved:{type:vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return wt().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},kt={createdBy:{type:vt.TYPE_STRING,get label(){return wt().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:vt.TYPE_STRING,get label(){return wt().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},xt={matches:{type:vt.TYPE_COUNT,get label(){return wt().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:vt.TYPE_COUNT,get label(){return wt().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Ft={sourceSystems:{type:vt.TYPE_STRING,get label(){return wt().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:vt.TYPE_STRING,get label(){return wt().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:vt.TYPE_INT,get label(){return wt().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:vt.TYPE_STRING,get label(){return wt().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Mt={matchRules:{type:vt.TYPE_STRING,get label(){return wt().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:vt.TYPE_STRING,get label(){return wt().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Vt=St({},Ct,jt,Lt,Dt,kt,xt,Ft,Mt,{type:{type:vt.TYPE_STRING,get label(){return wt().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var $t=r(13980),Gt=r.n($t);const Wt=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Yt=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Wt),Bt=(0,l.pipe)((0,l.reject)(E),Yt),qt=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("?")?"&":"?")+Wt(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}},Kt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Ht=(0,l.equals)(Kt.SUGGESTING),Jt=(0,l.equals)(Kt.EDITING),Qt=(0,l.equals)(Kt.VIEWING),Xt=(0,l.either)(Jt,Ht);let zt,Zt,er,tr,rr,nr,ir,ar,or,sr,lr,ur,cr,pr,dr,yr,fr,Tr,Er,mr,hr,br,Or,gr,vr;function _r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Nr(e,t,r[t])}))}return e}function Nr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(zt||(zt={})),function(e){e.local="local",e.validationService="validationService"}(Zt||(Zt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(er||(er={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",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"}(tr||(tr={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(rr||(rr={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch"}(nr||(nr={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(ir||(ir={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(ar||(ar={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(or||(or={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(sr||(sr={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(lr||(lr={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(ur||(ur={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(cr||(cr={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(pr||(pr={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(dr||(dr={})),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"}(yr||(yr={})),function(e){e.IN="in",e.OUT="out"}(fr||(fr={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Tr||(Tr={})),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"}(Er||(Er={})),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"}(mr||(mr={})),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"}(hr||(hr={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(br||(br={})),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"}(Or||(Or={})),function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(gr||(gr={})),function(e){e.Saving="Saving"}(vr||(vr={}));const Ar=Gt().oneOf(["mobile","tablet","desktop"]),Rr=Gt().shape({deviceTypes:Gt().oneOfType([Ar,Gt().arrayOf(Ar)]),roles:Gt().arrayOf(Gt().string)}),Pr=Gt().shape({value:Gt().string,lookupCode:Gt().string}),wr=Gt().shape({link:Gt().string,filename:Gt().string}),Sr=Gt().shape({displayName:Gt().string,parent:Gt().string}),Ir=Gt().oneOfType([Gt().string,Gt().number,Gt().bool,Pr]),Ur=Gt().oneOfType([Ir,Gt().arrayOf(Ir)]),Cr=Gt().shape({fieldName:Gt().string,values:Gt().arrayOf(Ur),filter:Gt().string,type:Gt().string}),jr=Gt().shape({minValue:Gt().number,maxValue:Gt().number}),Lr=Gt().shape({label:Gt().string,name:Gt().string,description:Gt().string,type:Gt().string,hidden:Gt().bool,faceted:Gt().bool,searchable:Gt().bool,uri:Gt().string,access:Gt().arrayOf(Gt().string),cardinality:jr}),Dr=Gt().shape({label:Gt().string,uri:Gt().string,typeColor:Gt().string,direction:Gt().string,startObject:Gt().object,endObject:Gt().object}),kr=Gt().shape({typeColor:Gt().string,typeIcon:Gt().string,typeImage:Gt().string,label:Gt().string,uri:Gt().string,attributes:Gt().arrayOf(Lr)}),xr=Gt().shape({uri:Gt().string,label:Gt().string,memberTypes:Gt().array,extendsTypeUri:Gt().string,attributes:Gt().arrayOf(Lr)}),Fr=Gt().shape({uri:Gt().string,label:Gt().string,extendsTypeUri:Gt().string,relationshipTypeURIs:Gt().arrayOf(Gt().string)}),Mr=Gt().shape({uri:Gt().string,description:Gt().string,label:Gt().string,schemaVersion:Gt().string,entityTypes:Gt().arrayOf(kr),roles:Gt().arrayOf(Gt().object),groupTypes:Gt().arrayOf(Gt().object),relationTypes:Gt().arrayOf(Dr),graphTypes:Gt().arrayOf(Fr),interactionTypes:Gt().arrayOf(xr),sources:Gt().arrayOf(Gt().object)}),Vr=Gt().shape({uri:Gt().string,type:Gt().string}),$r=Gt().shape({uri:Gt().string,attributes:Gt().object,type:Gt().string,timestamp:Gt().number,members:Gt().object}),Gr=Gt().shape({uri:Gt().string,type:Gt().string}),Wr=Gt().shape({value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Yr=Gt().shape({refEntity:Gt().oneOfType([Gt().array,Gt().object]),refRelation:Gt().oneOfType([Gt().array,Gt().object]),value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Br=Gt().oneOf((0,l.values)(Kt)),qr=Gt().shape({type:Gt().oneOf(Object.values(zt)).isRequired,attributeTypeUri:Gt().string.isRequired,parentUri:Gt().string.isRequired,uri:Gt().string,message:Gt().string}),Kr={attributeType:Lr,showEmptyEditors:Gt().bool,lazy:Gt().bool,mode:Br,metadata:Mr,ownError:qr,errors:Gt().arrayOf(qr),crosswalks:Gt().array,onAddAttributes:Gt().func,onAddOneMore:Gt().func,onDeleteAttribute:Gt().func,onChangeAttribute:Gt().func,additionalControlsRenderer:Gt().func,hideDeleteButton:Gt().bool,showNonOv:Gt().bool,state:Gt().oneOf(["deleted","edited"])},Hr=_r({attributeValue:Wr},Kr),Jr=_r({attributeValue:Yr},Kr),Qr=Gt().shape({value:Gt().oneOfType([Gt().string,Gt().bool,Gt().number]),ov:Gt().bool,type:Gt().string,uri:Gt().string,lookupCode:Gt().string,lookupRawValue:Gt().string}),Xr=Gt().shape({totalOvValues:Gt().number,totalValues:Gt().number}),zr=Gt().shape({inRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),outRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),groups:Gt().arrayOf(Gt().string),entityTypes:Gt().arrayOf(Gt().string),nextEntry:Gt().object}),Zr=Gt().oneOf(["asc","desc"]),en=Gt().shape({id:Gt().string,content:zr,allowOnlyCreateNew:Gt().bool,sortColumn:Gt().string,sortOrder:Zr,"text-empty":Gt().string,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Rr,canRead:Rr,canUpdate:Rr,canDelete:Rr,editingEnabled:Gt().bool}),tn=Gt().shape({id:Gt().string,graph:Gt().shape({type:Gt().string,layout:Gt().number,deep:Gt().number,limit:Gt().number,uri:Gt().string,options:Gt().shape({reverseRelations:Gt().bool})}),sortBy:Gt().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:Zr,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Rr,canRead:Rr,canUpdate:Rr,canDelete:Rr}),rn=Gt().shape({id:Gt().string,caption:Gt().string,pageSize:Gt().number,icon:Gt().string,canCreate:Rr,canRead:Rr,canUpdate:Rr,canDelete:Rr,attributes:Gt().object}),nn=Gt().shape({entityUri:Gt().string,entityType:Gt().string,entityLabel:Gt().string,object:Vr}),an=Gt().shape({relationUri:Gt().string,relationType:Gt().string,relationLabel:Gt().string,direction:Gt().string,object:Gr}),on=Gt().shape({entity:nn,relation:an}),sn=Gt().shape({value:Gt().string,isRawFilter:Gt().bool}),ln=Gt().shape({id:Gt().string,label:Gt().string,name:Gt().string,availableEntityTypes:Gt().array}),un=Gt().shape({id:Gt().string,allowMergeAll:Gt().bool,matchActions:Gt().object,availableTabs:Gt().arrayOf(Gt().oneOf(["findMatches","potentialMatches","notAMatch"]))}),cn=Gt().shape({matchRules:Gt().arrayOf(Gt().string),object:Vr,shortestTransitiveMatchPath:Gt().arrayOf(Gt().shape({matchRules:Gt().arrayOf(Gt().string),match:Gt().string})),direct:Gt().bool,matchScore:Gt().number}),pn=Gt().arrayOf(cn),dn=Gt().arrayOf(Gt().shape({uri:Gt().string,label:Gt().string})),yn=[{label:wt().text("And"),value:"and"},{label:wt().text("Or"),value:"or"},{label:wt().text("And not"),value:"and not"},{label:wt().text("Or not"),value:"or not"}],fn=(0,l.prop)("referencedEntityTypeURI"),Tn=(0,l.prop)("relationshipTypeURI"),En=(0,l.prop)("referencedAttributeURIs"),mn=(0,l.curry)(((e,t)=>(0,l.pipe)(En,(0,l.filter)((0,l.startsWith)(e)))(t))),hn=mn("configuration/relationTypes"),bn=mn("configuration/entityTypes"),On=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),gn=(0,l.filter)(On),vn=(e,t)=>!t||t.some((t=>t===e.uri));function _n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nn=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Xe),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",vt.TYPE_STRING),(0,l.propEq)("type",vt.TYPE_BLOB))]),An=(0,l.has)("values"),Rn=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(vt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(vt.TYPE_LOOKUP)],[An,(0,l.always)(vt.TYPE_ENUM)],[Nn,(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")]]),Pn=(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){_n(e,t,r[t])}))}return e}({},e,{type:Rn(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),wn=e=>!!e&&(!!e.autoGenerated&&e.type!==vt.TYPE_NESTED||!!e.parentAutoGenerated),Sn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),In=(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),Un=e=>Sn(e)?"analyticsAttributes":"attributes",Cn=(0,l.propEq)("hidden",!0),jn=(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))),Ln=jn(vt.TYPE_NESTED),Dn=jn(vt.TYPE_REFERENCE),kn=jn(vt.TYPE_IMAGE),xn=(0,l.either)(Ln,Dn),Fn=(e,t)=>{const r=Sn(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(".")},Mn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Vn=(0,l.pipe)(Mn,Boolean),$n=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Gn=(0,l.both)(Vn,(0,l.pipe)(Mn,("rdm",(0,l.pipe)(et,(0,l.equals)("rdm")))));const Wn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Un({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]||Bn(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:[]},Yn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Wn(e,t,r);return n.length?(0,l.last)(n):null},Bn=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)(En,(0,l.map)((t=>Yn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},qn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],Kn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],Hn=e=>qn.includes(e),Jn=e=>Kn.includes(e),Qn=[vt.TYPE_INT,vt.TYPE_LONG,vt.TYPE_NUMBER,vt.TYPE_FLOAT,vt.TYPE_DOUBLE,vt.TYPE_COUNT],Xn=e=>Qn.includes(e),zn=e=>[vt.TYPE_FLOAT,vt.TYPE_DOUBLE].includes(e),Zn=[vt.TYPE_BOOLEAN,vt.TYPE_BOOLEAN_RADIO,vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],ei=e=>Zn.includes(e),ti=[vt.TYPE_URL,vt.TYPE_BLOG_URL,vt.TYPE_IMAGE_URL],ri=e=>ti.includes(e),ni=jn(vt.TYPE_EMAIL),ii=e=>vt.TYPE_SSN===e;var ai,oi=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(ai||(ai={}));const si=(0,l.curry)(((e,t,r)=>{var n;const i=null===(n=r[e])||void 0===n?void 0:n.roles;return!i||i.some((e=>t.includes(e)))})),li=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),ui=(0,l.curry)(((e,t)=>(0,l.pipe)(li(e),(0,l.prop)("extendsTypeURI"))(t))),ci=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(ui(e,r)));return n(r)})),pi=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=ui(e,n);return r})),di=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?di(e,li(e,t.extendsTypeURI),r):void 0,yi=(e,t)=>{const r=t.map(pi(e));return(r.length?r.reduce(l.intersection):[])[0]},fi=(e,t)=>di(e,(0,l.is)(Object,t)?t:li(e,t),"typeImage");function Ti(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ei=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),mi=(0,l.pipe)(Ei,(0,l.propOr)("","label")),hi=(0,l.curry)(((e,t)=>{const r=Ei(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),bi=(0,l.curry)(((e,t,r)=>{const[n,i]=hi(e,r);return ci(e,n,t)||ci(e,i,t)})),Oi=(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){Ti(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),gi=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?Rt.OUT:Rt.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(Rt.IN),i=r(Rt.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},vi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),_i={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ni=(0,l.curry)(((e,t)=>e.every((e=>Ai(e,t))))),Ai=(0,l.curry)(((e,t)=>{const r=wn(t);return!t||(!t.access||t.access.includes(e))&&(e===_i.READ||!r)})),Ri=(0,l.curry)(((e,t,r)=>Ai(_i.READ,r)&&(Ht(t)?Ai(_i.INITIATE_CHANGE_REQUEST,r):Ai(e,r)))),Pi=Ri(_i.CREATE),wi=Ri(_i.DELETE),Si=Ri(_i.UPDATE),Ii=Ni([_i.CREATE,_i.MERGE,_i.READ,_i.UPDATE]),Ui=Ni([_i.UPDATE,_i.READ,_i.CREATE]),Ci=Ni([_i.UPDATE,_i.READ]),ji=Ni([_i.DELETE,_i.UPDATE,_i.READ]),Li=(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["*"])),Di=(e,t,r)=>(0,l.pipe)((0,l.map)(Li(e,t)),(0,l.filter)(l.identity))(r),ki=(e,t,r)=>{const n=Di(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ai(_i.MERGE,r)},xi=(0,l.curry)(((e,t,r,n)=>{const i=Ei(e,n),[a,o]=hi(e,n);return i&&Ai(_i.CREATE,i)&&ci(e,a,t.type)&&ci(e,o,r.type)})),Fi=(e,t,r,n,i)=>{const a=li(e,n.type),o=Di(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(xi(e,n,i))||a.some(xi(e,i,n))}))},Mi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=li(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:ki(o,i,a),canAddRelation:Fi(e,o,i,r,n),canMark:Ai(_i.UPDATE,a)&&Ai(_i.READ,a)}},Vi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Mi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),$i=Sn,Gi=(0,l.complement)($i),Wi=Ai(_i.READ),Yi=e=>{let{attributeType:t,mode:r}=e;return Gi(t)&&Pi(r,t)&&!Cn(t)},Bi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Be(r.uri),o=Si(n),s=Pi(n);return(0,l.cond)([[$i,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},qi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Be(r.uri),s=Si(n),u=wi(n),c=Hi(_i.UPDATE,n,a,r),p=Hi(_i.DELETE,n,a,r);return(0,l.cond)([[$i,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)},Ki=(0,l.curry)(((e,t,r,n)=>{const i=Bn(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=>!Ai(e,n)||!Ki(e,t,r[n.name],n)))))})),Hi=(0,l.curry)(((e,t,r,n,i)=>Ht(t)?Ki(_i.INITIATE_CHANGE_REQUEST,r,n,i):Ki(e,r,n,i))),Ji=(0,l.both)((0,l.complement)(Cn),Wi),Qi="SuperUser",Xi="allTenants",zi=[Xi,"allCustomers"],Zi=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===Qi})).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===Qi){const e=r?zi.concat(r.map((e=>`allTenants.${e}`))):zi,n=r&&t[0]===Xi?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}))},ea={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_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"},ta={[ea.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ea.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activityLog"],privileges:["EXECUTE"]},[ea.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ea.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ea.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ea.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ea.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ea.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ea.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ea.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ea.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ea.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ea.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ea.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ea.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ea.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ea.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ea.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ea.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ea.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ea.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ea.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ea.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]}},ra=(0,l.curry)(((e,t,r)=>Zi({allowedPermissionsNames:e,permissionsNames:ea,permissionsConfig:ta}).some((e=>e(t,{params:{tenant:r}}))))),na=ra([ea.CAN_EXPORT]),ia=ra([ea.CAN_EXPORT_ACTIVITIES]),aa=ra([ea.CAN_IMPORT_ENTITIES_FROM_DT]),oa=ra([ea.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),sa=ra([ea.CAN_UPDATE_PROCESS_INSTANCE]),la=ra([ea.CAN_VIEW_WORKFLOW_DEFINITION]),ua=ra([ea.CAN_CONFIG_ENVIRONMENT_REGISTER]),ca=ra([ea.CAN_UPDATE_WORKFLOW_DATA_TASK]),pa=ra([ea.CAN_READ_WORKFLOW_DATA_TASK]),da=ra([ea.CAN_MANAGE_WORKFLOW_DEFINITION]),ya=ra([ea.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),fa=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Ta=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ea=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ma=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ha=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS]),ba=ra([ea.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Oa=ra([ea.CAN_CREATE_CONFIG_JAR]),ga=ra([ea.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),va=ra([ea.CAN_VIEW_CONFIG_JAR]),_a=ra([ea.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Na=ra([ea.CAN_VIEW_WORKFLOW_JOBS]),Aa=ra([ea.CAN_MAKE_BULK_UPDATE]),Ra=ra([ea.CAN_OPEN_DATA_LOADER_EXECUTE,ea.CAN_OPEN_DATA_LOADER_READ]),Pa=ra([ea.CAN_BULK_DELETE_PROFILES]),wa=ra([ea.CAN_READ_MDM_DATA_ENTITIES]),Sa=ra([ea.IS_FREEMIUM_ADMIN]),Ia=(0,l.reject)(Cn),Ua=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ia,(0,l.filter)(e))(t),Ca=(0,l.curry)(((e,t)=>Ua((t=>Yi({attributeType:t,mode:e})),t))),ja=(0,l.curry)(((e,t)=>Ua((t=>Yi({attributeType:t,mode:e})||Ji(t)),t))),La=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Ji)),Da=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Da(e)])))),ka=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Ji),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...ka(e)])))),xa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...xa(e)])))),Fa=(0,l.pipe)(li,(0,l.converge)(l.concat,[ka,xa]));function Ma(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Va(e,t,r[t])}))}return e}function Va(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $a=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,$a(e)))},t))),Ga=e=>{var t;return Ma({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Wa=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Ya=(0,l.when)(Wa,(0,l.dissoc)("values")),Ba=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Ma({},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})})),qa=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Ka=(0,oi.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Da,t).concat((0,l.chain)(Da,r)).some(qa)})),Ha=e=>{let t=!1;const r=$a((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Ma({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ja=e=>{const t=Ka(e),r=(0,l.map)((e=>$a((0,l.pipe)(Ya,(0,l.when)((0,l.always)(e),Ba))))(t)),n=(0,l.map)(Ga),i=(0,l.map)(Ha);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Qa=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Xa=(0,l.prop)("relationshipTypeURIs"),za=(0,l.curry)(((e,t)=>e.graphTypes.filter(Za(e,t)))),Za=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(bi(e,t))},eo=(e,t)=>(0,l.pipe)(Qa,(0,l.defaultTo)({}),Xa,(0,l.defaultTo)([]),(0,l.chain)(hi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(li(e)))(e,t),to=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),ro=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),no=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ro((0,l.complement)(to))(e)},io=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ro(to)(e)},ao=(0,l.pipe)(li,(0,l.propOr)([],"matchGroups")),oo=(e,t,r)=>(0,l.pipe)(ao,(0,l.find)((0,l.propEq)("uri",r)))(e,t),so=(0,l.curry)(((e,t,r)=>(0,l.pipe)(oo,(0,l.propOr)(r,"label"))(e,t,r))),lo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(ao,(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]})),uo=e=>(0,l.partition)(to,e),co=(0,l.includes)(l.__,["and","or","not"]),po=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),yo=(0,l.includes)(l.__,["equals","notEquals","in"]),fo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return co(t)?fo(r):po(t)?r.filter(Xe):yo(t)?r.map((0,l.prop)("uri")).filter(Xe):[]})),l.uniq),To=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(fo),l.uniq),Eo=(0,l.pipe)(ao,To),mo=(0,l.pipe)(lo,To),ho=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},bo=(0,l.pipe)(ho,ka),Oo=(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||ci(e,n,t)})(e,t))})(e,t)),go=e=>!!e.required,vo=(e,t,r)=>{const n=(0,l.cond)([[Xe,li(e)],[ze,Ei(e)]])(t);return _o(e,n,r)},_o=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&Xe(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!wn(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===vt.TYPE_REFERENCE){const n=Tn(t),a=En(t);i=vo(e,n,r).filter((e=>a.some(Ze(e.uri))))}else t.attributes&&(i=_o(e,t,r));i&&n.push(...i)}return n})):t.type===vt.TYPE_REFERENCE?vo(e,Tn(t),r):[],No=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),go]),e.attributes||[])},Ao=(e,t)=>{const r=bn(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},Ro=(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)?wt().text(n):n};return r(null,t)})),Po=["label","description","abbreviation","caption","toolTip"],wo=e=>Ro(Po,e),So=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=tt(t);return r.find((e=>{let{uri:t}=e;return tt(t)===n}))})),Io=(0,l.curry)(((e,t)=>{const r=tt(t);return(0,l.pipe)(So(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Uo=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"})},Co=(0,l.curry)(((e,t)=>{let{roles:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),jo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=li(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Lo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Do(e,t,r[t])}))}return e}function Do(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ko=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 z.fromNull(i&&i.length?i:Bn(e,t)).map((t=>t.map((t=>{const i=ko(e,t,r,n);return i.length?Lo({},t,{children:i}):t})))).orSome([]).filter((0,l.either)((0,l.complement)(xn),(0,l.prop)("children"))).filter(Ji).filter(r).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ko(e,t,r,["attributes","analyticsAttributes"])},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ko(e,t,r,["attributes"])},Mo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ko(e,t,r,["analyticsAttributes"])},Vo=(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)})),$o=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return tt(r)===e})))),Go=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),$o("LUD")),(0,l.defaultTo)(r))(t||[])},Wo=(e,t)=>{let{survivorshipStrategies:r}=e;return $o(t,r)},Yo=(0,l.allPass)([(0,l.complement)(l.isNil),Ai(_i.READ)]),Bo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ai(_i.READ)]),qo=(0,l.curryN)(2,(0,l.pipe)(li,Bo)),Ko=e=>{let{ov:t}=e;return!1!==t},Ho=(e,t)=>((e,t)=>ri(e.type)&&ie(t))(e,t)||((e,t)=>ni(e.type)&&ae(t))(e,t),Jo=(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))),Qo=Jo("refEntity"),Xo=Jo("refRelation"),zo=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Zo=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},es=(0,l.prop)("objectURI"),ts=(0,l.prop)("objectURI"),rs=(0,l.prop)("type"),ns=(0,l.pipe)(Qo,(0,l.defaultTo)({}),es),is=(0,l.pipe)(Xo,(0,l.defaultTo)({}),ts),as=(0,l.pipe)(Qo,(0,l.defaultTo)({}),rs),os=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},ss=(0,l.evolve)({refEntity:te,refRelation:te}),ls=(e,t,r,n)=>{const i=Wn(e,r),a=li(e,t.type)||Ei(e,t.type);if(0===i.length)return null;const o=Un(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(!vn(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=>Tn(e)===r.uri||fn(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},us=(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?us(a.value,o):a},cs=(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 us(e[r],i)})),ps=(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")]]),ds=(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)(ps),(0,l.when)((()=>i.length>0),(0,l.map)(ds(e,i))))(r)})),ys=ds(null),fs=ds(Ko),Ts=(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=cs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Es=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ns,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{});function ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hs(e,t,r[t])}))}return e}function hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bs=e=>{let{parentUri:t,attributeType:r}=e;return ms({uri:Ye(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[xn,(0,l.always)({value:{}})],[Vn,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},Os=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ca(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),$n,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=bs({parentUri:r,attributeType:e});let s=Bn(n,e);s&&(e.type===vt.TYPE_REFERENCE&&(s=gn(s)),a.value=Os({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!$n(e)||(o[t]=[a])}return o},gs=e=>{let{entity:t,metadata:r}=e;return vo(r,t.type,!0).filter($n).reduce(((e,t)=>{const n=t.name,i=lt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:ls(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:_s({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},vs=(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?ms({},e,{value:vs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return ms({},s(t),Os({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),_s=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=bs({parentUri:n,attributeType:r}),u=ps(l);return(0,Fe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ns=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Fe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,n.uri,ps(n),a,o,i)}))},As=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Fe.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},Rs=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Fe.ZP)(t,(e=>{Ie(e.attributes||e.value,r,n,i)}))},Ps=(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"))),ws=(0,l.reject)(Ps),Ss=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=>Ss({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),ws)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Is=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ss({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),ss),deleteEmptyComplex:e})},Us=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Is(e),(0,l.reject)(l.isEmpty))},Cs=Object.values(Ut),js=(0,l.includes)(l.__,Cs),Ls=e=>Cs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 xs=(e,t)=>`${e}_${t}`,Fs=[Vt.matches.name,Vt.matchRules.name],Ms=(0,l.values)(jt).map((e=>e.name)),Vs=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ms)))),$s=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Fs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>xs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Gs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Vs(r),$s(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(xs(`dtPotentialMatches.${t.name}`,"")))))(Vt)},Ws=(0,l.propEq)("uri",Vt.type.uri),Ys=e=>(0,l.values)(Mt).some((0,l.propEq)("uri",e.uri)),Bs=(0,l.propEq)("uri",Ft.sourceSystems.uri),qs=Object.values(Ct),Ks=(0,l.includes)(l.__,qs),Hs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ds({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Js=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 Ds({},t,{[r.uri]:n})},Xs=(0,l.propEq)("uri",Ct.roles.uri),zs=(0,l.propEq)("uri",Ct.tags.uri),Zs=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)},el="UrlThumbnail",tl="CdnUrlThumbnail",rl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ko):(0,l.head)(n);return e&&e.value}return null})),nl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>rl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),il=nl(["CdnUrl","Url"],!0),al=nl(["CdnUrlPreview","UrlPreview"],!0),ol=nl([tl,el],!0),sl=nl([tl,el]),ll=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[In,(0,l.always)(t)],[(0,l.both)(Sn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=In(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(js(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),re)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},ul=(e,t,r)=>{const n=La(e),i=(0,l.any)(r?l.T:Ko);return ll(n,t,i)},cl=(e,t,r,n,i,a)=>{const o=Be(null==r?void 0:r.uri)?Ca(t,e):ja(t,e);return ll(o,r,((e,o)=>{const s=Yi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ko,e)||In(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let pl;const dl=e=>{pl=e};function yl(e,t){return pl(e,t)}const fl=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)})),Tl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return yl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},El=(0,l.once)((()=>yl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),ml=e=>yl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),hl=(e,t)=>yl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),bl=e=>z.fromNull(Tt[e]).map(wt().text).orSome(""),Ol=(0,l.curry)(((e,t)=>`${e}_${t}`)),gl=(0,l.split)("_"),vl=(0,l.includes)("_"),_l=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Nl=(0,l.curry)(((e,t)=>e.some(_l(t)))),Al=Nl([ct.IN_RANGE,ct.COUNT_RANGE,ct.WITHIN]),Rl=Nl([ct.EXISTS,ct.MISSING_VALUE]),Pl=(0,l.cond)([[Rl,(0,l.always)(0)],[Al,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),wl=(0,l.complement)(Rl),Sl=Nl([ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS]),Il=Nl([ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE]),Ul=Nl([ct.IN_FILE,ct.NOT_IN_FILE]),Cl=e=>{switch(e){case ct.COUNT_EQUALS:return ct.EQUALS;case ct.COUNT_NOT_EQUALS:return ct.NOT_EQUALS;case ct.COUNT_LT:return ct.LT;case ct.COUNT_LTE:return ct.LTE;case ct.COUNT_GT:return ct.GT;case ct.COUNT_GTE:return ct.GTE;case ct.COUNT_RANGE:return ct.IN_RANGE}},jl=Nl([ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS]),Ll=Nl([ct.WITHIN]),Dl=[[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE],[ct.NOT_IN_FILE,ct.IN_FILE],[ct.EQUALS,ct.NOT_EQUALS,ct.HAS_ALL],[ct.LT,ct.LTE,ct.GT,ct.GTE],[ct.MISSING_VALUE,ct.EXISTS],[ct.COUNT_RANGE],[ct.IN_RANGE],[ct.STARTS_WITH,ct.CONTAINS],[ct.FULL_TEXT],[ct.ON,ct.BEFORE,ct.AFTER,ct.NOT_EQUALS],[ct.WITHIN]],kl=(e,t)=>Dl.some((r=>r.includes(e)&&r.includes(t))),xl=(0,l.pipe)(l.omit,l.values),Fl={OPTIONS_FOR_STRING:xl(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_DATE:[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS,ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.IN_FILE,ct.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"],ct),OPTIONS_FOR_BLOB:xl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_NUMBER:xl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_LOOKUP:xl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ct),OPTIONS_FOR_ENUM:xl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_ID:[ct.EQUALS,ct.NOT_EQUALS,ct.IN_FILE,ct.NOT_IN_FILE],OPTIONS_FOR_COUNT:[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],OPTIONS_FOR_COMPLEX:[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.EXISTS,ct.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[ct.EQUALS,ct.NOT_EQUALS,ct.EXISTS,ct.MISSING_VALUE]},Ml=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 Fl.OPTIONS_FOR_STRING;case vt.TYPE_LOOKUP:case vt.TYPE_DEPENDENT_LOOKUP:return Fl.OPTIONS_FOR_LOOKUP;case vt.TYPE_ENUM:return Fl.OPTIONS_FOR_ENUM;case vt.TYPE_DATE:case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_TIMESTAMP:case vt.TYPE_LOCAL_DATE:return Fl.OPTIONS_FOR_DATE;case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:return Fl.OPTIONS_FOR_BOOLEAN;case vt.TYPE_BLOB:return Fl.OPTIONS_FOR_BLOB;case vt.TYPE_LONG:case vt.TYPE_INT:case vt.TYPE_FLOAT:case vt.TYPE_DOUBLE:case vt.TYPE_NUMBER:return Fl.OPTIONS_FOR_NUMBER;case vt.TYPE_ENTITY_ID:return Fl.OPTIONS_FOR_ID;case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ct.EQUALS];case vt.TYPE_COUNT:return Fl.OPTIONS_FOR_COUNT;case vt.TYPE_NESTED:case vt.TYPE_REFERENCE:case vt.TYPE_IMAGE:return Fl.OPTIONS_FOR_COMPLEX;default:return Fl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Il,n):n},Vl=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=t.length>0?`${t} ${r}`:r;return n===this.clauses.length-1?i:`${i} ${(0,l.propOr)("and",n,e)}`}),"")}},$l=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Gl=e=>Array.isArray(e)?e.map(Gl).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Wl=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Yl=e=>`'${e}'`,Bl=e=>`"${e}"`,ql=(0,l.pipe)(Gl,Wl),Kl=(0,l.pipe)(ql,Yl),Hl=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Al(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Jl=(e,t)=>Il(t)?{type:vt.TYPE_INT}:Ul(t)?{type:vt.TYPE_FILE}:jl(t)&&!Ll(t)&&Jn(e.type)?{type:vt.TYPE_LOCAL_DATE}:e,Ql=Object.values(Ot),Xl=e=>Ql.includes(e),zl=e=>wt().text(gt[e]),Zl=e=>{const t=f()();switch(e){case Ot.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Ot.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case Ot.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Ot.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Ot.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function eu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tu(e,t,r[t])}))}return e}function tu(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())),nu=(0,l.curry)(((e,t,r)=>{const n=r.map(Al(e)||t.endsWith(".count")?ql:Kl).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),iu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},au=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Pl(t);return(0,l.pipe)(iu(i),(0,l.map)(nu(t,r)),ru(" or "))(n)},ou=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Kl).join(",")})`},su=e=>`*${e}*`,lu=e=>`URL:${e}`,uu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,cu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ct.IN_FILE?r:`not ${r}`},pu=(e,t)=>[R(e,t),P(e,t)],du=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!yu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ct.ON:return eu({},e,n?{filter:ct.EQUALS}:{filter:ct.IN_RANGE,values:[pu(i,n)]});case ct.BEFORE:return eu({},e,{filter:ct.LTE,values:[[P(i,n)]]});case ct.AFTER:return eu({},e,{filter:ct.GTE,values:[[R(i,n)]]});case ct.WITHIN:return eu({},e,{filter:ct.IN_RANGE,values:[Zl(i)]})}}return e}),au),yu=(0,l.propSatisfies)(Jn,"type"),fu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",ct.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(au({filter:ct.EQUALS,fieldName:t,values:[r]}))),new Vl).build())),ru(" or "))(r)}],[(0,l.propEq)("filter",ct.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return au({fieldName:r,filter:t,values:n.map((0,l.pipe)(Gl,su))})}],[(0,l.propEq)("filter",ct.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?au(eu({},e,{values:(0,l.flatten)(r)})):uu(r)?ou(eu({},e,{filter:"listEquals"})):au(e)}],[(0,l.propEq)("filter",ct.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Pl(t);return(0,l.pipe)(iu(i),(0,l.map)(nu(t,r)),ru(" and "))(n)})(eu({},e,{values:(0,l.flatten)(e.values)})):yu(e)?(e=>{const{values:t}=e,r=!yu(e),[n]=t;return(new Vl).addClause(au(eu({},e,{filter:ct.LT,values:[R(n,r)]}))).addClause(au(eu({},e,{filter:ct.GT,values:[P(n,r)]}))).orBuild()})(e):uu(t)?ou(eu({},e,{filter:"not listEquals"})):au(e)}],[(0,l.propSatisfies)(Ul,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return au({fieldName:r,filter:cu(t,r),values:n.map((0,l.prop)("link")).map(lu)})}],[(0,l.propSatisfies)(Il,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return au({fieldName:`${r}.count`,values:n,filter:Cl(t)})}],[(0,l.propSatisfies)(jl,"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 nu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return nu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,au]],Tu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!wl(e)||mu(r))},Eu=e=>Array.isArray(e)?mu(e):null!=e&&Gl(e).length>0,mu=e=>e&&e.length>0&&e.every(Eu);function hu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Ou=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),gu=(e,t,r)=>"children"===e?_u(r,[...t][0],!0):r,vu=(e,t,r)=>"values"===e?[...r,...t]:r,_u=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)(gu,t),e);if(!r&&Sl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(vu,t),e)}return(0,l.append)(t,e)},Nu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=bu(e),r=e=>e.fieldName===t?e:r({fieldName:Ou(e),children:[e]});return r(e)})(t);return _u(e,r)}),[]),Au=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")),Ru=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function r(n){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n.reduce(((n,a)=>n.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:n}=e;return i&&Au(n)&&!t?`inSameAttributeValue(${r(n,!1)})`:r(n,i)}],...e])(a))),new Vl).buildWithOperators(n.map((0,l.prop)("operator")))}},Pu=(0,l.pipe)((0,l.propOr)("","filter"),vl),wu=(0,l.map)((0,l.when)(Pu,(e=>{const[t,r]=gl(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){hu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Su=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)(Tu),wu,Nu,Ru([...e,...fu],t))},Iu=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Uu=[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS],Cu=[ct.EQUALS,ct.NOT_EQUALS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.FULL_TEXT,ct.EXISTS],ju=[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],Lu=(e,t)=>{const r=Pn(e);return(e=>{switch(e){case Ut.startDate.name:case Ut.endDate.name:case jt.dueDate.name:case kt.createdTime.name:case kt.updatedTime.name:case Ft.reltioLoadDate.name:case Ft.createDate.name:case Ft.updateDate.name:case Ft.deleteDate.name:case Ft.publishDate.name:return Uu;case xt.matches.name:case Ft.count.name:return ju;case jt.workflow.name:case jt.assignee.name:case jt.step.name:case Lt.commenter.name:case kt.createdBy.name:case kt.updatedBy.name:case Ft.sourceSystems.name:case Ft.value.name:return Cu;default:return null}})(t)||Ml(r)},Du=[ct.EQUALS,ct.NOT_EQUALS,ct.CONTAINS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.IN_RANGE,ct.WITHIN,ct.EXISTS,ct.ON],ku=(0,l.pipe)(Lu,(0,l.filter)((0,l.includes)(l.__,Du))),xu=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Fu=e=>{let{query:t,body:r}=e;return t=xu(t),yl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Mu=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)(Su(),Iu(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Bt(i)}`},Vu=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=Mu(e,t,r);return yl(n)},$u=(0,l.pipe)((0,l.reject)(l.isNil),Yt),Gu=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(Su(),Iu(i))(r),c=$u({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return Fu({query:c,body:p})},Wu=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Gu({fieldName:t,searchParams:i,options:n})},Yu="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Bu=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)(Su(),Iu(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Yu,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Bt(i)}`},qu=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=Bu(e,t,r);return yl(n)},Ku=e=>yl(`/${e}?select=secondaryLabel`),Hu=(e,t)=>{const{select:r=Yu,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),yl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Ju=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Be)),Qu=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=Ju(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Fn(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)(Su(),Iu(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),yl(`${s}/api/${o}/${t}/_object`,m)},Xu=e=>`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,zu=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Zu=e=>yl(Xu(e)),ec=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 yl(n,r)},tc=e=>yl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),rc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return yl(`/entities/_events/_total${Yt({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},nc=(e,t)=>yl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),ic=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return yl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},ac=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return yl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},oc=e=>{const t=new FormData;return t.append("file",e),yl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ce(e,wt().text("Can't upload file"));return Promise.reject(t)}))},sc=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return yl(`/personal/findSavedSearches${Yt({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"}})},lc=e=>yl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),uc=e=>yl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),cc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return yl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},pc=e=>{let{uri:t}=e;return yl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},dc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),cc)(e),yc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),cc)(e);function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tc=["max","offset","filter"],Ec=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Ec(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){fc(e,t,r[t])}))}return e}({},t,(0,l.pick)(Tc,e)))),mc=(0,l.omit)(["activeness"]),hc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],ir.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],ir.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Ec(e),(0,l.omit)(Tc))(e))),mc))(t),{url:`/${e}/_connections${Bt({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})),Oc=(0,l.reject)(l.isNil),gc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),vc=e=>yl(gc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),_c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,gc);return yl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Nc=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?Us()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Oc,re,JSON.stringify);return yl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Ac=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"),gc,n),o=he(i(t),i(r)).concat(Oe(t,r));return yl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Rc=(e,t)=>{const{url:r,options:n}=hc(e,t);return yl(r,n).then(bc)},Pc=(e,t)=>yl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),wc=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Rt.IN?a.inRelations=[n]:a.outRelations=[n],yl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Sc=(e,t)=>yl(`/recentSearches/?environment=${e}&tenant=${t}`,{method:"GET",application:"explorer",headers:{"Content-Type":"application/json"}}),Ic=e=>yl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Uc=e=>{let{environment:t,tenant:r,createdDate:n}=e;return yl(`/recentSearches?environment=${t}&tenant=${r}&createdDate=${n}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Cc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jc(e,t,r[t])}))}return e}function jc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lc={select:"label,secondaryLabel,name,type,startDate,endDate"},Dc=(0,l.reject)(l.isNil),kc=(0,l.pipe)(Dc,Yt),xc=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Cc({},Lc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return yl(`/${t}/_tree${kc(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Fc=e=>{let{uri:t,graphUri:r}=e;const n=Cc({},Lc,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return yl(`/${t}/_parents${kc(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Mc=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1}=e;const o=Cc({},Lc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},{filterLastLevel:i,deep:a});return yl(`/${t}/_hops${kc(o)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Vc(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 $c=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Gc="/activities",Wc=e=>{let{label:t,description:r}=e;return yl(Gc,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:$c()}})},Yc=e=>{const t=Bt(e);return yl(Gc+t,{method:"GET"})},Bc=e=>yl(`/activities/_total${Bt(e)}`,{method:"GET"}),qc=e=>{const{entityUri:t}=e,r=Vc(e,["entityUri"]);return yl(`/${t}/_activities${Bt(r)}`,{method:"GET"})},Kc=e=>{const{entityUri:t}=e,r=Vc(e,["entityUri"]);return yl(`/${t}/_activities/_total${Bt(r)}`,{method:"GET"})};function Hc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jc(e,t,r[t])}))}return e}function Jc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qc=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Xc=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return yl(Qc({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},zc=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=Qc({url:r,workflowPath:t,tenant:n})),yl(s,{method:i||"GET",body:JSON.stringify(a),headers:Hc({"Content-Type":"application/json"},null!=o?o:{})})},Zc=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=Qc({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return yl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},ep=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=Qc({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Hc({},l,{comment:o}):l;return yl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},tp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=Qc({url:`/tasks${s?Bt(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Hc({objectURIs:[i]},(0,l.reject)(E,a)))};return yl(u,Hc({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},rp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i}=e;const a={assignee:i};return yl(Qc({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},np=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i}=e;return yl(Qc({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:JSON.stringify(i)})},ip=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return yl(Qc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},ap=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return yl(Qc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},op=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},sp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return yl(Qc({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},pp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return yl(Qc({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},dp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return yl(Qc({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},yp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ko);return a&&a[0]&&(r=n.length>0&&a[0].value?yp(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}}),""),fp=(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=yp(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},Tp=/[,\s]*$/,Ep=e=>{const t=wt().text(At);if(!e)return t;const r=e.replace(Tp,"");return""===r.toString().trim()?t:r},mp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},hp=(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=mp(e,r.referencedEntityTypeURI);if(n)return fp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return fp({attributes:t||{}},r.dataLabelPattern);return""},bp=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Op=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},gp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",vp=(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"))),_p=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),vp),Np=(e,t,r)=>{const n=_p(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(cs(e),vp)))(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")])})(li(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ls(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,vp))(r)})(e,r)||fi(e,r.type);return gp(t,n)};var Ap=void 0;const Rp={50:"#E0233A",80:"#F5A623",100:"#62A61B"},Pp=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return r.map((r=>{r="/"===r[0]?r:"/"+r;const n=t.type+r+"/analyticsAttributes/score",i=t.type+r+"/analyticsAttributes/updatedDate",a=Yn(e,n);return{label:a&&(a.label||a.name),uri:n,value:a&&wp(e,t,n)||"-",updatedDate:a&&wp(e,t,i)||0}}),Ap).filter((e=>null!=e.label&&("-"===e.value||e.value>=0&&e.value<=100)))},wp=(e,t,r)=>{const n=ls(e,t,r);return n&&n[0]&&n[0].value},Sp=(e,t,r)=>{const n=r&&r[e]||Rp,i=Object.keys(n).map((e=>({value:+e,color:n[e]}))).filter((e=>!isNaN(e.value))).sort(((e,t)=>e.value-t.value)).map(((e,t,r)=>({start:0===t?0:r[t-1].value,end:e.value,color:e.color}))).find((e=>t>=e.start&&t<=e.end));return i&&i.color||"#666666"};function Ip(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cp=(0,l.replace)(new RegExp("^entities/"),""),jp=e=>"DTSS/"+e.dataTenant+"/"+e.uri,Lp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Dp=e=>!(!e||!e.dataTenant),kp=(0,l.ifElse)(Dp,jp,(0,l.prop)("uri")),xp=e=>e&&e.uri?e.dataTenant?jp(e):Cp(e.uri):"",Fp=(0,l.curry)(((e,t,r)=>(li(t,r.type)||{})[e]||"")),Mp=Fp("label"),Vp=Fp("typeGraphIcon"),$p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=li(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(Ko)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:hp(e,o,i),uri:a.uri}})).filter(l.identity):[]},Gp=(0,l.pipe)($p,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Wp=(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=Wp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Wp(e.slice(1),r)}})),Yp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Bp=e=>(0,l.propOr)([],"matchRules",e),qp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Ip({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Kp=(e,t,r)=>t&&r?r.aEntity:e,Hp=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 yl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Yt)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Jp=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return yl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Qp=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return yl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Xp=(e,t,r)=>Promise.all(t.map((async t=>{await yl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),zp=async(e,t)=>await Xp(e,t,"NOT"),Zp=async(e,t)=>await Xp(e,t,"MATCH"),ed=async(e,t)=>await Promise.all(t.map((async t=>{await yl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function td(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 nd(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 id=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return yl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},ad=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Nd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},od=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Nd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},sd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return yl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},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 sd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},ud=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Dp,i);return Promise.all([s.length?Qp(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return sd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},cd=(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=nd(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)}),[])),pd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),cd),dd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return yl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(pd)},yd=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=yd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return yl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(pd)})),Td=yd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return yl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Ed=(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)}},md=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return yl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},hd=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 md(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},bd=hd("NOT"),Od=hd("MATCH"),gd=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Dp,a);return Promise.all([Xp(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return md(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},vd=gd("NOT"),_d=gd("MATCH");function Nd(e){let{requestProvider:t=yl,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,td({},nd(s,["headers"]),{headers:td({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Ad=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Nd({url:Bu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Rd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Nd({url:Mu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Pd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=hc(t,r);return Nd({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)))}))))},wd=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Nd({url:`${zu(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Sd=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return yl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Id=()=>yl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET",headers:{"Content-Type":"application/json"}});function Ud(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cd(e,t,r[t])}))}return e}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jd=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Ud({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return yl(`${t}/api/${r}/graph/search${Bt({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Ld=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return yl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Ud({},n,i),headers:{"Content-Type":"application/json"}})},Dd=(e,t)=>`${e}/${t}/comments`,kd=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return yl(`${Dd(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},xd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return yl(`${Dd(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Fd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return yl(Dd(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Md=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return yl(`${Dd(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Vd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return yl(`${Dd(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},$d=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return yl(`${Dd(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Gd=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Bt({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return yl(`${Dd(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Wd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yd(e,t,r[t])}))}return e}function Yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bd=(e,t)=>{const[r]=e.split("/ui/");return`${r}/services${t.startsWith("/")?t:`/${t}`}`},qd=(e,t)=>{const r=Yt({url:"/oauth/users/tenant/{0}",params:e});return yl(Bd(t,`oauth/proxy${r}`),{method:"GET",headers:{"Content-Type":"application/json"}})},Kd="graphExport",Hd=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await zd({uiPath:e,tenant:t,environment:r,namespace:Kd,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Wd({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await zd({uiPath:e,tenant:t,environment:r,namespace:Kd,options:Wd({method:"PUT"},o)})}catch(e){s=null}return s||(s=await zd({uiPath:e,tenant:t,environment:r,namespace:Kd,options:Wd({method:"POST"},o)})),s},Jd=(e,t)=>yl(Bd(e,`/settings?key=${t}`),{method:"GET",headers:{"Content-Type":"application/json"}}),Qd=e=>yl(Bd(e,"/version/collect"),{method:"POST",headers:{"Content-Type":"application/json"}}),Xd=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return yl(`${n}/plugins${Bt({tenant:t,user:r})}`,{method:"GET"})},zd=e=>{let{tenant:t,environment:r,uiPath:n,options:i,namespace:a}=e;const o=`/configService${Bt({tenant:t,environment:r,namespace:a})}`;return yl(Bd(n,o),i)},Zd=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),yl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},ey=e=>yl(`/${e}?showObjectsInfo=true`,{method:"GET"}),ty=e=>{let{exportPath:t,options:r}=e;return yl(`${t}/activities${Bt(r)}`,{method:"POST"})};function ry(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ny(e,t,r[t])}))}return e}function ny(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iy=e=>{const{entityUri:t}=e;return yl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},ay=e=>{let{entityUri:t,crosswalk:r}=e;return yl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},oy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return yl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[ry({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),ry({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},sy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return yl(`/${r}/_${n}${Bt({contributorURI:t})}`,{method:"POST"})},ly=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return yl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},uy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return yl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},cy=e=>{let{entityUri:t,crosswalkId:r}=e;return yl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},py=e=>{let{entityTypeUri:t}=e;return yl(`/dataQuality/fillRates${Yt({entityType:tt(t)})}`,{method:"GET"})},dy=e=>{let{entityTypeUri:t,attributeFieldName:r}=e;return yl(`/dataQuality/statistic${Yt({entityType:tt(t),attribute:r})}`,{method:"GET"})},yy=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n}=e;return yl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${tt(n)}`,{method:"GET"})},fy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return yl(`/${t}${Bt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Ty=e=>{let{attributeUri:t,value:r}=e;return yl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Ey=e=>{let{attributeUri:t,value:r}=e;return yl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},my=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return yl(`/${t}${Bt({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=Bt({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Us()([[{value:a}]]);return yl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},by=e=>{let{entityUri:t,attributeName:r,value:n}=e;return yl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Oy=e=>{let{entityUri:t,attributeName:r}=e;return yl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function gy(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{entityUri:t}=e;return yl(`/${t}/_historicURIs`,{method:"GET"})},_y=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return yl(`/${t}/_changesWithTotal${Bt(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){gy(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Ny=(e,t)=>yl(`/${e}/_previousChange${Bt({timestamp:t})}`,{method:"GET"}),Ay=(e,t)=>yl(`/${e}${Bt({time:t})}`,{method:"GET"});function Ry(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Py(e,t,r[t])}))}return e}function Py(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wy=e=>{let{url:t,method:r,data:n,headers:i}=e;return yl(t,Ry({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:Ry({"Content-Type":"application/json"},null!=i?i:{})}))},Sy=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Bt({options:a.join(","),severity:o.join(",")});return yl(`${t}/validate/${i}/entity/${xp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Iy=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return yl(`${t}/validate/${n}/entity${Bt({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Uy=e=>{let{tenant:t,apiPath:r}=e;return yl(`${r}/tenants/${t}/name`,{method:"GET"})};var Cy=r(47485);const jy=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=qe(),s={attributes:Os({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=ls(r,e,n.uri)[0];return i&&i.value?As({entity:e,attributeType:n,uri:i.uri,value:t}):_s({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Ly=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ns),(0,l.filter)(Be),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),Dy=(0,l.curry)(((e,t)=>{const r=Ly(e=e||{},t=t||{});return r.concat((0,l.chain)(Dy(e),r))})),ky=(0,l.curry)(((e,t)=>(0,l.pipe)(ue,(0,l.filter)(e))(t))),xy=ky((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Fy=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Be)),My=e=>(0,l.pipe)(xy,Fy(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Vy=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(xy,(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})),$y=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Be),(0,l.omit)(["uri","timestamp"])),Gy=(0,l.pipe)($y,(0,l.evolve)({attributes:Us(!0)})),Wy=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=My(i);if(a.length>0)for(const t of a)e=Vy(t,r[t].uri,e);const o=(s=await ec(Gy(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},Yy=async(e,t,r)=>{const n=qy(e,t),i={};for(const t of n)i[t]=await Wy(e,t,i,r);return i},By=(0,l.curry)(((e,t)=>{const r=Cy.Node(t);return My(e[t]).forEach((t=>{const n=By(e,t);r.addEdge(n)})),r})),qy=(e,t)=>(0,l.pipe)((0,l.map)(By(e)),(0,l.map)(Cy.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Ky=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)($y))})),Hy=(e,t)=>{const r=_e(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=be(e,t),a=Oe(e,t);return[...ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),ve((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},Jy=(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 Vy(r,n,e)}),e))))}),t)}),Ky),Qy=(0,l.curry)(((e,t)=>(0,l.when)(Be,(0,l.propOr)(l.__,t,e),t)));function Xy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zy(e,t,r[t])}))}return e}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{parentUri:t,relation:r,entityUri:n}=e;return{type:yr.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},ef=e=>{let{relationUri:t}=e;return{type:yr.DELETE_RELATION,parameters:{relationUri:t}}},tf=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:yr.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},rf=e=>{let{oldRelation:t,newRelation:r}=e;return{type:yr.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},nf=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:yr.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},af=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),of=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case yr.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Nc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case yr.DELETE_RELATION:return()=>{const{relationUri:e}=r;return _c(e,i).then(o)};case yr.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return wc(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case yr.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Ac({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case yr.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[ef({relationUri:o}),Zy({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(sf(n)),(0,l.map)(of),af)(s)}}},sf=e=>t=>Xy({dcrProcessor:e},t),lf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=qt({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(sf(r)),(0,l.map)(of),af,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},uf=e=>t=>(0,l.map)((t=>Xy({},t,{parameters:(0,l.evolve)({parentUri:Qy(e),entityUri:Qy(e),newEntityUri:Qy(e)},t.parameters)})),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){pf(e,t,r[t])}))}return e}function pf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const df=e=>cf({},(0,l.path)(vf(),e),{startDate:(0,l.path)(Rf(),e),endDate:(0,l.path)(Pf(),e)}),yf=(e,t)=>(0,l.pipe)((0,l.path)(Af()),Qy(t))(e),ff=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=yf(e,r),i=(0,l.path)(_f(),e)===fr.IN,a=e.parentEntityUri||n;return Zy({parentUri:i?t:a,relation:df(e),entityUri:i?a:t})})),...o.map((t=>{const i=yf(t,r),a=(0,l.path)(_f(),t)===fr.IN,o=i!==(0,l.pipe)((0,l.path)(vf()),a?wf:Sf)(t),s=Cf(e,(0,l.path)(Of(),t)),u=t.parentEntityUri||n,c=Qy(r,i);return o?nf({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(vf(),t),isReversed:!1}):rf({oldRelation:(0,l.path)(vf(),s),newRelation:df(t)})})),...i.map((e=>ef({relationUri:e}))),...s.map((e=>tf({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},Tf=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;return cf({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType}})}),{}),Ef=(e,t)=>(0,l.pipe)(Ei,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Cs),Ia)(e,t),mf=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)}},hf=(e,t,r)=>{const n=fp(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)},bf="relation",Of=(0,l.always)([bf,"relationUri"]),gf=(0,l.always)([bf,"relationType"]),vf=(0,l.always)([bf,"object"]),_f=(0,l.always)([bf,"direction"]),Nf=(0,l.always)([bf,"object","attributes"]),Af=(0,l.always)(["entity","entityUri"]),Rf=(0,l.always)([bf,"startDate"]),Pf=(0,l.always)([bf,"endDate"]),wf=(0,l.path)(["startObject","objectURI"]),Sf=(0,l.path)(["endObject","objectURI"]),If=(0,l.path)(["startObject","objectTypeURI"]),Uf=(0,l.path)(["endObject","objectTypeURI"]),Cf=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Of()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Cf(r.connections,t);if(e)return e}}},jf=(0,l.pipe)(Cf,(0,l.path)(vf())),Lf=(0,l.allPass)([(0,l.pipe)((0,l.path)(Af()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(gf()),(0,l.complement)(E))]),Df=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Ke()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Ff({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=kf(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?mf(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},kf=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:Rt.IN}:{type:t[0],direction:Rt.OUT}:null},xf=e=>e.uri||e,Ff=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Pi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Rt.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"],li(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],li(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(xf,Ei(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Rt.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Rt.OUT)),(0,l.map)(u))},t)||{}};function Mf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vf(e,t,r[t])}))}return e}function Vf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $f=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Mf({},t,{[r]:{parents:n,children:i}})},Gf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Mf({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},Wf=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=Ly(t,i),o=$f({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>Wf(n.uri,t,[e],r)),o)},Yf=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)(Of(),n),a=t?Gf({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Af(),n),s=Be(o)?[o]:[],u=$f({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>Wf(t,r,[i],e)),u)}),n)},Bf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Yf(r,e,t,Wf(e,t))},qf=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return Bf(t,r,n);if(Je(e)){const t=Cf(n,e);return t&&Yf([t],null,r)}return r[e]?Wf(e,r):void 0},Kf=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>Kf(e,t))))},Hf=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>Hf(e,t))))},Jf=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=He(t),u=Bf(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=Cf(i,c),!s)return null;o.push({type:rr.relationConnection,value:s,valueType:Ei(a,(0,l.path)(gf(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:rr.tempEntity,value:e,valueType:li(a,e.type)});continue}const p=n[u],d=Es(p,c),y=n[c];if(!d||!y)return null;o.push({type:rr.attributeValue,value:d,valueType:Yn(a,it(d.uri,p.type))}),o.push({type:rr.tempEntity,value:y,valueType:li(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},Hf(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?jf(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?Ei(a,d.type):li(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Bn(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,g;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===(g=O[E.name])||void 0===g?void 0:g.find(t),s=i||r;if(!s)return null;i&&o.push({type:rr.tempEntity,value:T,valueType:li(a,T.type)}),o.push({type:rr.attributeValue,value:s,valueType:E}),m=s.value;const l=ns(s);T=l&&Be(l)?n[l]:null}}return o},Qf=e=>e.every((e=>{let{type:t}=e;return[rr.attributeValue,rr.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===rr.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,Xf=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Xf(t.value):[]];return e.concat(r)}),[])),zf=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Zf=e=>{const t=[...Xf((null==e?void 0:e.attributes)||[]),...Xf((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},eT=(e,t)=>[e,...t.map((t=>zf(e,t)))],tT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},rT=(e,t)=>{switch(e){case nr.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case nr.ENTITY_ATTRIBUTE:return(e=>{let{uri:t}=e;return[at(t)]})(t);case nr.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case nr.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},nT=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),iT=(0,l.curry)(((e,t)=>{const r=ho(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(iT(e,r.extendsTypeURI)):n})),aT=(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))),oT=(e,t)=>(0,l.pipe)((0,l.prop)("type"),iT(e),aT(t))(t);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=>{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}},uT=e=>!e.deactivated,cT=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},pT=e=>cT(e)+e.message,dT=(0,l.unless)(l.isNil,(0,l.prop)("message")),yT=(0,l.unless)(l.isNil,(0,l.prop)("type")),fT=(0,l.curry)(((e,t)=>Ze(t.parentUri,e))),TT=(0,l.curry)(((e,t)=>t.parentUri===e)),ET=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Ze(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",vt.TYPE_REFERENCE),(0,l.pipe)(En,(0,l.any)(Ze(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),mT=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),hT=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),bT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([PT,uT,fT(e),ET(t),(0,l.complement)(hT(e,t.uri))]))(r)},OT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([PT,uT,TT(e),mT(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",zt.missed))]))(r);return n&&n.message||""},gT=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===zt.missed))},vT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Of(),e))]))(t)},_T=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},NT=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([uT,fT(t)]))(r)},AT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},RT=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?Jf(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 rr.attributeValue:{const e=a;if(Ln(a))return fp(o,e.dataLabelPattern);if(Dn(a)){const t=o,i=ns(t),a=fn(e),s=li(n,a);return Be(i)?fp(r[i],s.dataLabelPattern):t.label}return""}case rr.tempEntity:return fp(o,a.dataLabelPattern);case rr.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=li(n,null==e?void 0:e.entityType);return`${Ep(i&&Be(i)?fp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||mi(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){sT(e,t,r[t])}))}return e}({},e,{label:Ep(t)})}))},PT=e=>!e.severity||e.severity===er.ERROR,wT=(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(wT(n))}));case vt.TYPE_REFERENCE:return!!Qo(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}})),ST=(e,t)=>e.every((0,l.complement)(wT(t))),IT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=vo(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ls(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ko(e.parent))))).forEach((e=>{ST(e.attrValues,n)&&r.push(lT({type:zt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:wt().text("Attribute is required"),source:Zt.local}))})),r}),[])},UT=(0,l.curry)(((e,t,r)=>ls(e,t,r,!1))),CT=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),li(e),(0,l.prop)("attributes"),(0,l.reject)(Cn),(0,l.filter)(Dn),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(UT(e,t)));return(0,l.pipe)(r,(0,l.reject)(ns),(0,l.map)((e=>{let{uri:r}=e;return lT({type:zt.missedRefEntity,uri:"",attributeTypeUri:it(r,t.type),parentUri:r,message:wt().text("Entity is required"),source:Zt.local})})))(t)},jT=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ns,Be)).flatMap((n=>{const i=ns(n),a=t[i],o=Yn(e,it(n.uri,r.type));return LT(e,t,o,a)})),LT=(e,t,r,n)=>{const i=En(r),a=i.map((t=>Yn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",vt.TYPE_REFERENCE))).flatMap(hn).concat(i);return DT(e,t,n,(e=>a.some(Ze(e.uri))))},DT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=IT(e,r,n),a=CT(e,r),o=jT(e,t,r);return[...i,...a,...o]},kT=(e,t)=>{const r=(0,l.path)(vf(),t)||{};return IT(e,r)},xT=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Af()),(0,l.ifElse)(Be,(e=>t[e]),(0,l.always)(null)))(r),i=kT(e,r),a=(e=>(0,l.path)(Af(),e)?[]:[lT({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(gf(),e),parentUri:(0,l.path)(Of(),e),message:wt().text("Entity is required"),source:Zt.local})])(r),o=((e,t,r)=>r?DT(e,t,r):[])(e,t,n);return[...i,...a,...o]},FT=e=>(0,l.path)(["entity","uri"],e)?[]:[lT({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:wt().text("Entity is required"),source:Zt.local})],MT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=IT(e,r),i=FT(t);return[...n,...i]};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 $T=(e,t)=>{var r,n;const i=li(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Ka(e)},GT=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),WT=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(GT(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},YT=(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)(is,Be,l.not)]),(e=>{const t=(0,l.pipe)(is,tt)(e);return WT((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(ns,Be),(t=>{const r=ns(t),n=e[r],i=n&&qT(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){VT(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),BT=(e,t,r)=>ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),ve((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)(YT(r,e.type)),(0,l.map)(WT(ut))))})(e))),qT=(e,t)=>(0,l.evolve)({attributes:Ss({valueTransformer:(0,l.pipe)(ss,YT(t),GT(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function KT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HT(e,t,r[t])}))}return e}function HT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JT=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Me,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),QT=e=>(0,l.pipe)((0,l.evolve)({objectUri:JT,objectParentUri:JT}),(e=>{return KT({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?zt.missed:zt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&<(e.objectUri),uri:e.objectUri,source:Zt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),XT=(e,t)=>(0,l.map)((0,l.pipe)(QT,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=RT(t,s),p=null!=c&&c.length?c.slice(0,-1):RT(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Yn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===rr.attributeValue&&(a=e.valueType)}return a})(o,c,e);return KT({},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&&st(i)){const n=(0,l.last)(a),i=n.valueType;if(Dn(i)&&bn(i).includes(o)){const i=ns(n.value),o=i&&Be(i)?t[i]:null;return o?KT({},e,{parentUri:o.uri,path:a.concat({type:rr.tempEntity,value:o,valueType:li(r,o.type),label:""})}):e}}return e}})(t)))(e),zT=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 ZT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eE;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(eE||(eE={}));const tE={},rE={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"]}},nE=(0,l.curry)(((e,t)=>{const r=(e=>{if(!tE[e]){const t=rE[e]||rE.random0;tE[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}({counter:0,granularityCounter:0,idToColor:{}},t)}return tE[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]})),iE=e=>nE(eE.Charts,e);var aE=r(51404),oE=r.n(aE);const sE=Array.from({length:100},((e,t)=>t/100)),lE=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)},uE={},cE=new(oE())({hash:lE,saturation:sE.slice(15,71),lightness:sE.slice(50,90)}),pE=(0,l.curry)(((e,t)=>{const[r,n,i]=e,[a,o,s]=t;return(Math.abs(r-a)<=27||(r+27>=360||a+27>=360)&&Math.abs(r-a-360)<=27)&&Math.abs(n-o)<=.3&&Math.abs(i-s)<=.2})),dE=(0,l.curry)(((e,t,r)=>{t in uE||(uE[t]={});const n=uE[t];r in n||(n[r]=((e,t,r)=>{const n=Object.values(t);let i;for(let t=0,a=r;t<35&&(i=e.hsl(a),n.some(pE(i)));t++,a=String(lE(a)));return i})(e,n,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),yE=dE(cE,"crosswalks"),fE=dE(cE,"sources"),TE=dE(cE,"contributors");function EE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mE(e,t,r[t])}))}return e}function mE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hE=(0,l.has)("items"),bE=e=>0===e,OE=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)},gE=e=>e.reduce(((e,t)=>e+t.width),0),vE=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),_E=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),NE=e=>e.reduce(((e,t)=>e+t.height),0),AE=e=>(0,l.is)(String,e)&&e.includes("%"),RE=e=>Boolean(e.spacer),PE=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),wE=e=>e.items.reduce(((e,t)=>e.concat(hE(t)?wE(t):t)),[]),SE=e=>({id:e.layout}),IE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:SE;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=AE(r.width)?PE(i,r.width):u}return OE(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return OE(n,t,r)},o=(e,t)=>hE(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,hE(s)?n(s.layout):e(s.view)),d=bE(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(hE(s))return o.concat(p(EE({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(EE({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:gE(o),height:vE(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=hE(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=bE(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(hE(i))return r.concat(p(EE({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(EE({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?OE(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?OE(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:_E(i),height:NE(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=bE(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return EE({},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=EE({},e,{width:a}),s=EE({},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(EE({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return EE({},e,{height:NE(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(EE({},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 EE({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=EE({},t,{items:(0,l.reject)(RE,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 wE(f)},UE=(e,t)=>e.filter((e=>t.some((t=>t.id===e.id))));function CE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jE(e,t,r[t])}))}return e}function jE(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={BarChart:Er.BAR,BarChartGrouped:Er.BAR,BarChartHorizontal:Er.BAR,LineChart:Er.LINE,Map:Er.MAP,Pie:Er.PIE},DE=(e,t)=>ot(e)?rt(e,t):e,kE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=LE[r];return CE({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},xE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return CE({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"]))},FE=(e,t,r)=>{const n=(e=>e&&re(e).map((e=>{const{type:t,value:r}=e;return CE({},e,{value:[Et,mt,ct.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:bt(t),fieldName:r,values:n?re(n):void 0}})))(e);return t&&ot(t)||!r?n:(n||[]).concat((i=r,{filter:ct.EQUALS,fieldName:"type",values:[i]}));var i},ME=["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"],VE={"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:DE(n,r),filters:FE(a,n,r),chartType:Er.BAR,component:mr.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:DE(n,r),filters:FE(a,n,r),chartType:Er.BUBBLE,component:mr.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:mr.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=re(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return CE({id:t,count:o,canRead:u,orderType:s,attributeUri:DE(r,p),filters:FE(a,r,p),component:mr.DashboardFacet,title:i,showOthers:!0},kE(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:DE(n,r),filters:FE(a,n,r),chartType:Er.MAP,component:mr.DashboardFacet,title:i,geoUrl:ME[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 CE({id:t,count:o,canRead:l,attributeUri:DE(n,r),filters:FE(a,n,r),component:mr.DashboardFacet,title:i,geoUrl:s,chartType:Er.MAP,projection:"geoMercator"},kE(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.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:xE(i),component:mr.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:FE(n,null,a),component:mr.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:ct.GTE,fieldName:"matches",values:["1"]}],component:mr.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:mr.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:Er.CLOUD,component:mr.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:Er.TREE,component:mr.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.NotificationInboxFacet,title:n||wt().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.ActivitiesViewFacet,title:n||wt().text("Activity log")}}},$E=e=>({id:e,height:10}),GE=(0,l.pipe)((0,l.map)((e=>{const t=VE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),WE=e=>{if("0.1"===e.version){const t=GE(e.views),r=IE($E,e.layout,{columns:4});return{id:e.id,margin:0,layout:UE(r,t),views:t}}return e},YE=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"),re)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>YE(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function BE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qE(e,t,r[t])}))}return e}function qE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KE=BE({},hr,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),HE=e=>e,JE={[KE.Attributes]:HE,[KE.HierarchyTree]:HE,[KE.HierarchyPaths]:HE,[KE.RelationsTable]:HE,[KE.Relations]:e=>BE({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[KE.SingleAttributeView]:HE,[KE.CustomView]:HE,[KE.TableAttributeView]:HE,[KE.MapView]:HE,[KE.OldTreeView]:e=>BE({},e,{class:hr.HierarchyTree}),[KE.OldMapView]:e=>BE({},e,{class:hr.MapView}),[KE.ImageAttributeView]:HE,[KE.PotentialMatchesView]:HE},QE=(0,l.pipe)((0,l.map)((e=>{const t=JE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),XE=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===hr.MapView?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),zE=e=>{if("0.1"===e.version){const t=QE(e.views),r=IE(XE(t),e.layout,{columns:4});return{id:e.id,layout:UE(r,t),views:t,profileBand:e.profileBand,workflow:e.workflow,maxWidth:e.maxWidth}}return e},ZE=(e,t)=>e.class===t||e["react-class"]===t,em=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(ZE(t,hr.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 ZE(t,hr.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)}},tm=(e,t)=>e.filter((e=>t.some((t=>ZE(e,t))))).map((e=>{let{id:t}=e;return t})),rm=(e,t)=>{let{extensions:r}=e;return r.find((e=>e.id===t))};function nm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){im(e,t,r[t])}))}return e}function im(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const am=(e,t)=>YE(t).map((t=>(0,l.pipe)((0,l.map)((e=>rm(e,t))),(0,l.reject)(l.isNil),l.head)(e))),om=(e,t)=>{if("scroll"===t.layout.layout){const r=am(e,t.layout),n=WE(nm({},t,{views:r,version:"0.1"}));return{class:Or.Dashboard,views:n.views,layout:n.layout}}return{class:Or.Dashboard,views:t.views,layout:t.layout}},sm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.DQDashboard,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},lm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.RelationshipSearch,options:r.options,scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp}},um=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Interactions,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},cm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Relationships,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},pm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Sources,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},dm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.PotentialMatches,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},ym=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Search,scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead}},fm=()=>({class:Or.Graph}),Tm=()=>({class:Or.ProfileActivityLog}),Em=e=>t=>!!(0,l.intersection)(e,t).length,mm=(0,l.cond)([[Em(["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"]),()=>om],[Em(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>sm],[Em(["com.reltio.plugins.graph.GraphView"]),()=>fm],[Em(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>lm],[Em(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>um],[Em(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>cm],[Em(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>pm],[Em(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>dm],[Em(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>ym],[Em(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Tm],[l.T,()=>(0,l.always)(void 0)]]),hm=(e,t)=>{const r=(e=>e.perspective?e.perspective:"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]?e.id:void 0)(e);if((0,l.isNil)(r))return;const n=(0,l.pipe)((0,l.map)((e=>rm(e,r))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(n))return;const i=YE(n.layout),a=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return t.filter((e=>i.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return n["entity-type"]?((e,t)=>{if("scroll"===t.layout.layout){const r=am(e,t.layout),n=zE(nm({},t,{views:r,version:"0.1"}));return{class:Or.Profile,views:n.views,layout:n.layout}}return{class:Or.Profile,views:t.views,layout:t.layout}})(t,n):mm(a)(t,n)},bm=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))},Om=e=>(0,l.pipe)((0,l.chain)(bm),(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.map)((e=>({label:e.label,icon:e.icon,screen:hm(e,t)}))))(t))(t,e);return{label:t.label,icon:t.icon,menu:r.length?{type:"side",items:r}:void 0,screen:hm(t,e)}}));function gm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vm=e=>{let{extensions:t}=e;return t.filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},_m=e=>({id:e,height:10}),Nm=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)(vm),(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=GE(((e,t)=>YE(t).map((t=>(0,l.pipe)((0,l.map)((e=>rm(e,t))),(0,l.pluck)("views"),l.flatten,l.head,(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){gm(e,t,r[t])}))}return e}({},e,{id:t})))(e))))(e,t.layout)),n=IE(_m,t.layout,{columns:4});return{views:r,layout:UE(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Am=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>rm(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=>rm(e,"com.reltio.plugins.entity.RangeColors"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("colors"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:t}},general:{colors:r},image:{attributeFieldsOrder:n},lookups:{autocomplete:i},validate:{levels:a,validateReadMode:o}}},Rm=e=>({layout:Om(e),pivoting:Nm(e),properties:Am(e)});var Pm=r(58697),wm=r.n(Pm);function Sm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Im(e,t,r[t])}))}return e}function Im(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Um=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}_${wm()()}`;return n[e.id].push(t),i=!0,Sm({},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]++,Sm({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},Cm=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(Cm(e))}))}))),t},jm=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(xm,t),(0,l.propOr)([],"crosswalks",e))),e),Lm=(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(Lm(e))}))})),r},Dm=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=Dm(e);r>t&&(t=r)}))})),t+1):t},km=(e,t)=>{if(Be(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},xm=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Fm=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Mm=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Vm=(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)},$m=(0,l.eqBy)(xm),Gm=(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)(Xo,(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)))),Wm=(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=wt().number(t));return t})),Ym=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?wt().number(e,"0,0.0a").toUpperCase():wt().number(e,"0,0"):""},Bm=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),qm=(e,t)=>t&&e!==t?`${t} (${e})`:e,Km=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Hm=(e,t,r)=>{const n=Km(e,t,r);return qm(r,n)},Jm=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Qm=(0,l.complement)(Jm),Xm=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),zm=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)},Zm=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Qm(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),eh=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?B(i):"L",u=a?H(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&&Wm(o,t);case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:se(t)?wt().text("yes"):wt().text("no");case vt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=_(Number(t)).getTime()),t&&(Xl(t)?zl(t):wt().date(t,s));case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_LOCAL_DATE:return t&&(Xl(t)?zl(t):wt().date(t,s));case vt.TYPE_TIMESTAMP:return t&&(Xl(t)?zl(t):wt().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)?qm((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),th={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)",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)"},rh=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()}},nh=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})))),ih=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.slice().reverse().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}=t,i=e.onResponse.slice().reverse().reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e}):e(r)}),t.next);i(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),rh,nh);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((e=>new Promise(((t,n)=>{r({response:e,next:e=>{t(e)},abort:n})})))):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}},ah="__metadata",oh=(e=>{const t=[ah,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),sh=(0,l.set)(oh),lh=(0,l.view)(oh),uh=sh(_t.NEW),ch=sh(_t.REMOVED),ph=sh(_t.EDITED),dh=sh(_t.IGNORED),yh=(0,l.pipe)(lh,(0,l.equals)(_t.REMOVED)),fh=(0,l.pipe)(lh,(0,l.equals)(_t.NEW)),Th=(0,l.pipe)(lh,(0,l.equals)(_t.EDITED)),Eh=(0,l.pipe)(lh,(0,l.complement)(l.isNil)),mh=(0,l.pipe)(lh,(0,l.equals)(_t.IGNORED)),hh=(0,l.omit)([ah]),bh=(e,t)=>e===ah?void 0:t;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 gh=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=gh(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},vh=(e,t)=>gh((0,l.propEq)("nodeId",t),e),_h=(e,t)=>gh((0,l.pathEq)(["entity","uri"],t),e),Nh=(e,t)=>{const r=vh(e,t);return r.length>1?r[r.length-2]:null},Ah=(e,t)=>{const r=vh(e,t);return r.length>0?r[r.length-1]:null},Rh=(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=>Rh(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Ph=()=>{},wh=(e,t)=>{let{parent:r,nodeProcessing:n=Ph}=t;n(e,r),e.children&&e.children.forEach((t=>wh(t,{parent:e,nodeProcessing:n})))},Sh=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case lr.addingParent:return{entityUri:n?r.entity.uri:t.relatedEntity.uri,relation:r.relation,parentEntityUri:n?t.relatedEntity.uri:r.entity.uri};case lr.addingChild:return{entityUri:n?t.relatedEntity.uri:r.entity.uri,relation:r.relation,parentEntityUri:n?r.entity.uri:t.relatedEntity.uri};case lr.editing:{const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=t.entity.uri,a=r.entity.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){Oh(e,t,r[t])}))}return e}({},e,i===a?{}:{entityUri:i,newEntityUri:a})}}},Ih=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;wh(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===lr.addingChild||r.editingMode===lr.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Sh({node:r,connection:n,isReversed:i}),s=Zy({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===lr.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Sh({node:r,isReversed:i,connection:n}),l=s?nf({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):rf({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Uh={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Ch={asc:"asc",desc:"desc"},jh=Uh.entityLabel,Lh=Ch.asc,Dh=(0,l.always)(0),kh=e=>{let{sortField:t=jh,sortOrder:r=Lh,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Uh.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return nv.strings.sort(t,a,o)})(n,r);case Uh.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return nv.strings.sort(e,i,a)})(r);default:return Dh}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},xh=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ch)),l.identity,(0,l.always)(Lh))),Fh=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Uh)),l.identity,(0,l.always)(jh)));var Mh=r(91104);let Vh;const $h=(e,t)=>(Vh||(Vh=Mh.createClient({key:t})),new Promise((t=>{Vh.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)}))}))),Gh=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Wh=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ko).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Gh(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(Wh(e.value,t,r))),n})),Yh=e=>e&&e.length>0,Bh=(e,t)=>[].concat(e&&e.attributes?Wh(e.attributes,t):[]).filter(l.identity),qh=(e,t,r,n,i)=>{if(e&&e.type){const t=(li(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Bh(e,t.latitude),n=Bh(e,t.longitude),Yh(r)&&Yh(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(Yh(t)&&t[0].value&&Yh(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?$h(n.label,i).catch((()=>null)):Promise.resolve(null)},Kh=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=>"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||li(e,t.type).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})))))))));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return qh(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?$h(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)))},Hh=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=li(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Yn(e,r.latitude,t.type)&&Yn(e,r.longitude,t.type)){const e=Bh(t,r.latitude),n=Bh(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))},Jh=(e,t,r)=>Promise.all([Hh(e,t),Kh(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 Qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 zh=(e,t)=>t.values.map(so(e,t.entityTypeUri)),Zh=(e,t,r)=>Gs(t.fieldName,r)||Yn(e,rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),eb=(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?qm(e,t):e}),r)},tb=(0,l.path)(["attrType","label"]),rb=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Qh({},e,{[t]:!0})),{});e[r]=e[r]?Qh({},e[r],n):n}return e}),{}),nb=(0,l.pipe)((0,l.prop)("values"),E),ib=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Vt.type.name)),ab=e=>e.type===lb.NUMERIC_RANGE_FACET,ob=e=>e.type===lb.DATE_RANGE_FACET,sb=(0,l.either)(ab,ob),lb={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},ub=e=>{switch(null==e?void 0:e.name){case Vt.type.name:return lb.ENTITY_TYPE_FACET;case Vt.createdBy.name:case Vt.updatedBy.name:case Vt.sourceSystems.name:case Vt.tags.name:case Vt.roles.name:case Vt.matchRules.name:case Vt.MLRecommendedMatch.name:return lb.WITH_DROPDOWN_CHECKBOXES_FACET;case Vt.createdTime.name:case Vt.updatedTime.name:case Vt.startDate.name:case Vt.endDate.name:return lb.DATE_RANGE_FACET;case Vt.matches.name:case Vt.matchScore.name:return lb.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return lb.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return lb.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return lb.DATE_RANGE_FACET;default:return lb.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},cb=(0,l.pipe)(Zh,ub),pb=(0,l.pipe)((0,l.path)(["attrType","type"]),ei),db=(0,l.cond)([[ab,(0,l.always)(ct.IN_RANGE)],[ob,(0,l.always)(ct.WITHIN)],[(0,l.allPass)([pb,e=>e.values.length>=2]),(0,l.always)(ct.EXISTS)],[l.T,(0,l.always)(ct.EQUALS)]]),yb=(0,l.cond)([[ob,(0,l.prop)("values")],[ab,(0,l.prop)("values")],[pb,e=>1===e.values.length?e.values.map(se):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tb=(0,l.pipe)((0,l.path)(["attrType","type"]),Hn),Eb=(0,l.pipe)((0,l.path)(["attrType","type"]),Xn),mb=(0,l.pipe)((0,l.prop)("attrType"),Ys),hb=(0,l.pipe)((0,l.prop)("attrType"),Ws),bb=e=>t=>t.values.map((t=>li(e,t).label)).join(" , "),Ob=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),gb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(wt().number),Ob)),(0,l.join)(","))(e.values);return`${tb(e)}: ${t}`},vb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Ob)),(0,l.join)(","))(e.values);return`${tb(e)}: ${t}`},_b=e=>t=>`${tb(t)}: ${zh(e,t).join(", ")}`,Nb=e=>t=>{const r=eb(e,t);return`${tb(t)}: ${r.join(", ")}`},Ab=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[hb,bb(e)],[Eb,gb],[Tb,vb],[mb,_b(e)],[l.T,Nb(t)]]),r))),Rb=(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){fb(e,t,r[t])}))}return e}({},t,{attrType:Zh(e,t,n)}))),Ab(e,r))(t),Pb=new RegExp(`^${wt().text("Search")}`),wb=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...Rb(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Pb,"",u)]},Sb=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Ot),Ib=e=>(e=>Sb.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]=Zl(t);return e.replace(r,i).replace(n,a)}),e))(e),Ub=(0,l.curry)(((e,t)=>`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`)),Cb={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},jb=e=>[Cb.geoPolygon,Cb.onMapMove].includes(e),Lb=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Db=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},kb=(e,t)=>jb(e)?t.map(Lb):[Db(t)],xb=e=>jb(e)?wt().text("Geo Polygon"):wt().text("Geo Location"),Fb=e=>{switch(e){case Cb.geoLocation:return"geoLocation";case Cb.geoPolygon:case Cb.onMapMove:return"geoPolygon"}},Mb={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},Vb=e=>wt().text(e),$b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ct.EQUALS]:"=",[ct.NOT_EQUALS]:"≠",[ct.STARTS_WITH]:"*",[ct.MISSING_VALUE]:wt().text("missing value"),[ct.HAS_ALL]:wt().text("has all"),[ct.IN_RANGE]:wt().text("in range"),[ct.FULL_TEXT]:wt().text("full text"),[ct.EXISTS]:wt().text("exists"),[ct.COUNT_EQUALS]:`${wt().text("count")} =`,[ct.COUNT_NOT_EQUALS]:`${wt().text("count")} ≠`,[ct.COUNT_LT]:`${wt().text("count")} <`,[ct.COUNT_LTE]:`${wt().text("count")} <=`,[ct.COUNT_GT]:`${wt().text("count")} >`,[ct.COUNT_RANGE]:wt().text("count range"),[ct.LT]:"<",[ct.LTE]:"<=",[ct.GT]:">",[ct.GTE]:">=",[ct.IN_FILE]:wt().text("in file"),[ct.NOT_IN_FILE]:wt().text("not in file"),[ct.CONTAINS]:"~",[pt]:"=",[dt]:"≠",[yt]:"=",[ft]:"≠"}[e]||wt().text(e.toLowerCase())},Gb=e=>({type:Mb.operator,text:e}),Wb=e=>({type:Mb.operator,text:Vb(e)}),Yb=e=>({type:Mb.attributeLabel,text:e}),Bb=e=>({type:Mb.specialAttributeLabel,text:e}),qb=e=>({type:Mb.attributeFilter,text:$b(e)}),Kb=e=>({type:Mb.attributeValue,text:e}),Hb=e=>({type:Mb.entityTypeLabel,text:e}),Jb=()=>({type:Mb.space,text:" "}),Qb=()=>({type:Mb.bracket,text:"("}),Xb=()=>({type:Mb.bracket,text:")"}),zb=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Zb=(0,l.curry)(((e,t)=>t.map(zb(e)))),eO=(0,l.curry)(((e,t,r)=>[e,...r,t])),tO=eO(Qb(),Xb()),rO=eO(Jb(),Jb()),nO=(0,l.curry)(((e,t)=>[e,...t])),iO=e=>nO(Hb(e)),aO=e=>nO(Hb(`${e}: `)),oO=e=>["and","and not"].includes(e),sO=e=>["or","or not"].includes(e),lO=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),sO)),uO=(cO=["and"],e=>e.slice(0,-1).every((e=>cO.includes(e.operator))));var cO;const pO=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=lO(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=oO(s),a=sO(s);!r&&t&&n&&(i.push(Qb()),r=!0),i.push(o),r&&a&&(i.push(Xb()),r=!1);const l=e?Wb(s):Gb(s);i.push(...rO([l]))}else i.push(o),r&&(i.push(Xb()),r=!1)}return i}},dO=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),yO=(0,l.pipe)(pO({localizable:!1}),dO),fO=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},TO=e=>{let{data:t,values:r,filter:n}=e;return t&&Tu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},EO=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(TO)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),mO=(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)&&Vn(e.data.attrType)})(e)&&[ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Mn((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})))),zm),hO=(e,t)=>(0,l.pipe)(mO,Zm(t))(e),bO=(0,l.pathEq)(["data","fieldName"],Vt.type.name),OO=(0,l.path)(["data","entityTypeUri"]),gO=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),vO=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(qo(e)),attributes:(0,l.filter)((0,l.pipe)(OO,(0,l.anyPass)([l.isNil,qo(e),r=>{const n=(t.entityTypes||[]).filter(qo(e));return(n.length>1?yi(e,n):null)===r&&!!li(e,r)}])))})(t))))),_O=e=>(0,l.pipe)((0,l.prop)("filter"),Pl,(0,l.equals)(e)),NO=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Gs(n.fieldName)||n.attrType,s=Jl(o,i),u=eh({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Vn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?qm(a.lookupCode,a.value):Hm(r,Mn(o),a)],[()=>Ys(s),()=>so(e,n.entityTypeUri,a)],[()=>Bs(s),()=>Io(e,a)],[()=>Xs(s),()=>Co(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Xn(c)||ei(c)),Bl),Kb)()})),AO=(e,t,r,n)=>{const i=NO(e,t,r,n.data,n.filter);return(0,l.cond)([[_O(0),(0,l.always)([])],[(0,l.both)(_O(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[Jb(),i(r),{type:Mb.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Jb(),...(0,l.pipe)(l.flatten,(0,l.map)(i),Zb({type:Mb.punctuationMark,text:", "}))(t)]}]])(n)},RO=(e,t)=>{const r=!!Gs(e.data.fieldName);return(0,l.pipe)(fO,r?Bb:Yb)(e,t)},PO=(e,t,r,n,i)=>[RO(n,i),Jb(),qb(n.filter),...AO(e,t,r,n)],wO=(0,l.addIndex)(l.map),SO=(0,l.propEq)("length",1),IO=(0,l.propSatisfies)((0,l.lt)(1),"length"),UO=(0,l.complement)(l.isEmpty),CO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)((0,l.filter)(TO),(0,l.map)((n=>({operand:PO(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,pO()))(n)},jO=(0,l.pipe)(CO,l.flatten),LO=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Mp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=CO(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(iO),(0,l.pipe)(s(aO),(0,l.unless)((()=>SO(u)||i),tO)))(u)},DO=(e,t,r,n)=>(0,l.pipe)((0,l.filter)(EO),wO(((n,i,a)=>({operand:LO(e,t,r,n,SO(a)),operator:n.operator}))),pO(),l.flatten)(n),kO=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),pO(),l.flatten),xO=e=>{let{searchType:t,values:[r]}=e;return kb(t,r).join(", ")},FO=(e,t,r,n,i,a)=>{const o=(e=>e?[Bb(e.isRawFilter?wt().text("Raw filter"):wt().text("Search")),...rO([qb(ct.EQUALS)]),Kb(`"${e.value}"`)]:[])(i),s=(e=>e?[Bb(xb(e.searchType)),Jb(),Kb(xO(e))]:[])(a),u=(0,l.pipe)(DO,(0,l.when)((e=>IO(e)&&(UO(o)||UO(s))),tO))(e,t,r,n);return kO([o,s,u])},MO=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),VO=(0,l.pipe)(FO,MO),$O=(0,l.has)("attributes"),GO=Array.isArray,WO=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),YO=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=BO(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)(WO(a))),tO),(0,l.concat)(rO([Gb(o)]))))(s)},BO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return $O(n)?YO(e,t,r,n,i):GO(n)?n.reduce(((n,a)=>n.concat(BO(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(rO([Gb(n.operator)])))(PO(e,t,r,n,i))},qO=(e,t,r,n,i)=>(0,l.pipe)(BO,l.flatten)(e,t,r,n,i);function KO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HO(e,t,r[t])}))}return e}function HO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JO=(0,l.complement)(bO),QO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(bO),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(OO),(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}},XO=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=QO(t);return(r||n)&&uO(t)},zO=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(XO)),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(bO).some((0,l.propEq)("filter",ct.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}=QO(r);if(XO(e))t.push(KO({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(JO)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(bO,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(OO,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(JO),entityTypes:n,operator:i?a:e.operator,id:wm()()}}));t.push(...n)}var a;return t})(t))),[]))),ZO={[ct.EQUALS]:ct.ON,[ct.IN_RANGE]:ct.WITHIN,[ct.GTE]:ct.AFTER,[ct.GT]:ct.AFTER,[ct.LTE]:ct.BEFORE,[ct.LT]:ct.BEFORE},eg=(0,l.curry)((e=>ZO[e]||e)),tg=(0,l.curry)(((e,t)=>{switch(e){case ct.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case ct.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),rg=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Hn),ng=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>KO({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return rg(e)?(0,l.evolve)({filter:eg,values:tg(t)},e):e}))})))})),ig=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),zO,vO(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")))})),ng,(0,l.reject)(gO))(r)));function ag(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){og(e,t,r[t])}))}return e}function og(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sg=(e,t)=>({data:{uri:ot(e.fieldName)?rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||db(e),id:wm()(),values:yb(e)}),lg=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Gs(a,t,r)||Yn(e,i);if(!s)return null;if(In(s))return ag({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Mp(e,{type:o}),i=(Wn(e,rt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return ag({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),ug=(0,l.curry)(((e,t,r,n)=>ig(lg,e,n,t,r)));function cg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pg(e,t,r[t])}))}return e}function pg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dg=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},yg=e=>"rdmLookups.not.resolved"===e?Vt.notResolved.name:e,fg=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===ht?ct.IN_RANGE:bt(a),u=yg(n),c=Gs(u)||Yn(e,i),p=(0,l.cond)([[()=>Ul(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>cg({},e,{filename:Bm(e)}))))],[()=>ei(null==c?void 0:c.type),(0,l.map)(se)],[e=>Sl(s)&&!Array.isArray(e[0])&&!Hn(null==c?void 0:c.type),ne],[l.T,l.identity]])(o);return{id:wm()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===ht?"and not":"and",filter:s,values:p}})),Tg=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(fg(e,yi(e,i)));return[{id:wm()(),operator:"or",attributes:a,entityTypes:i}]})),Eg=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),mg=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([Eg("from"),Eg("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,()=>[]]]),hg=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return cg({},r,{values:mg(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?xs(e.fieldName,n):e.fieldName})},bg=(e,t)=>{if((0,l.has)("children")(e)){const r=hg(e,t);return e.children.reduce(((e,n)=>(e.push(bg(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return hg(e,t)},Og=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(hg(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(cg({fieldName:e.fieldName},hg(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(bg,l.flatten)],[l.T,hg]]),gg=(0,l.pipe)((0,l.map)(Og),l.flatten),vg=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},_g=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=Tg(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:gg(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>cg({},t,{type:cb(e,t)}))).map((e=>cg({},e,{values:sb(e)?vg(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 sg(r,t)})),operator:"or",id:wm()(),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=>({[yg(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[cg({},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 ug(e,t,r,p)},Ng=(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)(nb),(0,l.partition)(ib))(t),i=n.map((t=>ag({},t,{type:cb(e,t)}))).map((e=>sg(e))),a=r.values||[];return[{attributes:i,operator:"or",id:wm()(),entityTypes:a}]})(e,a);return ug(e,t,r,o)})(e,t,r,n):_g(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},Ag=e=>"2.0"===e.version?e.keyword:dg(e),Rg=e=>(0,l.pathEq)(["object","uri"],e),Pg=(e,t)=>(0,l.pipe)((0,l.find)(Rg(e)),(0,l.prop)("object"))(t),wg=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"),Rg(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Pg(r.match,t)||n[r.match];return{label:Ep((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return oo(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)},Sg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),Ig=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),Ug=(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:Ep((0,l.prop)("label",a)),matchRules:i.map((function(t){return oo(e,a.type,t)||{label:t,uri:t}}))}})))(t),Cg=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)},jg=(0,l.path)(["object","uri"]),Lg=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Dg=e=>e.getValue(),kg=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=kg(n[e],t),!r);e++);return r},xg=(e,t)=>{const r=[],n=(0,l.pipe)(Dg,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(xg,[t]),a);return r.push.apply(r,o),r};function Fg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 Vg=(e,t)=>!!e[t],$g=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},Gg=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||[]])},Wg=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Fg({},t,{[r.uri]:Fg({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:Gg(null==o?void 0:o.parents,n),children:Gg(null==o?void 0:o.children,i),values:Gg(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},Yg=e=>e.children?e.children.flatMap(Yg):e,Bg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=li(r,t)||Ei(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Fo(r,n,i).flatMap(Yg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Yn(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=Wg({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Wg({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},qg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Be(e.uri)&&Xe(e.type)&&Xe(t)&&!t.startsWith(e.type))(n,t))return e;const i=ls(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ko),(0,l.map)($g))(i);return Wg({structure:e,attrType:e[t].attrType,values:a})}),t)},Kg=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 Vg(e,r)}));return r||n?t.filter(Ko).reduce(((e,t)=>Kg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Vg(t,e.type)?Wg({structure:t,attrType:t[e.type].attrType,values:[$g(e)]}):t}},Hg=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Fg({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},Jg=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ls(i,n,r)||[];return a.length?Wg({structure:t,attrType:t[r].attrType,values:a.filter(Ko).map($g)}):t},Qg=(e,t,r)=>{const n=He(e),i=He(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Ze(n,r)})(e,t):!(!r||!st(t))&&Kf(r,i).includes(n)},Xg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},zg=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?Bf(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return Qg(r,t,o)}))},Zg=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>Zg(e,t,r)))))},ev=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&Xg(n,e)}},tv=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=He(n),c=qf(u,o,i,a),p=Zg("children",t,l),d=Zg("parents",t,l),y=p.flatMap((e=>Zg("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Qg(t,n,c)})).map((t=>ev(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Qg(n,t,c)||He(t)!==u&&Qg(t,n,c)})).map((t=>ev(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=Zg("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)&&Qg(n,t,c)}))})).map((t=>ev(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return Qg(t,n,c)})).map((e=>ev(r,n,e,s))),...T,...E,...f]},rv={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},nv={Colors:r(29504),DependencyManager:r(47485),strings:n,dates:i}},29504:(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}},47485:(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([[825],{27502:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Cs,PY2:()=>Ut,Ng6:()=>ir,YJ7:()=>Nt,Xt7:()=>tr,wfT:()=>qr,EMD:()=>Dr,HAc:()=>rr,PEf:()=>kt,oA3:()=>jr,$XE:()=>Er,eWf:()=>Dt,q7e:()=>nr,KVe:()=>Kr,WVQ:()=>ai,oZZ:()=>nn,bNA:()=>an,Rjq:()=>on,G39:()=>xt,dZX:()=>mr,bQt:()=>ln,oS0:()=>vt,lL_:()=>Ot,Nsj:()=>Rt,psV:()=>_t,xPW:()=>Ct,pyR:()=>Vr,p8l:()=>kr,Wkf:()=>er,zHr:()=>Zt,NIO:()=>zt,$26:()=>lb,Esk:()=>wr,s9T:()=>pr,MEy:()=>Vl,j5E:()=>ct,vAw:()=>Cr,NMQ:()=>Ur,mNm:()=>xr,rwv:()=>tn,s_5:()=>$r,RgZ:()=>Fr,unl:()=>rn,Qy0:()=>sn,pYu:()=>Pr,wIJ:()=>Cb,GFH:()=>or,S91:()=>Mt,p3$:()=>dn,wSh:()=>z,BDP:()=>_i,pGS:()=>Mr,ARY:()=>gr,XGc:()=>Br,fO_:()=>Kt,wwy:()=>lr,_XL:()=>At,j2V:()=>Hr,dMV:()=>Wr,NBX:()=>Dg,OXy:()=>vr,BXd:()=>yr,CJB:()=>Xr,lXI:()=>Or,nqG:()=>cn,C68:()=>Ft,yxQ:()=>un,Yj_:()=>ur,ZIY:()=>hr,Tl4:()=>Mb,lwr:()=>Lt,NkU:()=>Jr,Rtp:()=>Yr,YGx:()=>fr,uTS:()=>Gr,IYE:()=>Lr,PiC:()=>en,tJI:()=>ar,cNQ:()=>Qr,SwE:()=>Sr,ZHR:()=>Zr,lD1:()=>Vt,lVm:()=>Tr,vnX:()=>jh,$x5:()=>Dh,_R1:()=>Uh,wUm:()=>Ch,z7V:()=>pn,dC6:()=>dr,MBD:()=>sr,GmF:()=>ea,cKm:()=>br,iP_:()=>jt,NVC:()=>cr,tPT:()=>_s,tZe:()=>op,kRE:()=>ay,psB:()=>oy,X0$:()=>vs,Wm5:()=>Hs,vyX:()=>Iu,wLZ:()=>Ns,W4V:()=>oe,EtK:()=>os,Wtd:()=>gs,asT:()=>Kg,kGs:()=>ge,ewt:()=>mf,O_f:()=>uO,sOy:()=>Ze,Tde:()=>xn,LMI:()=>fu,skb:()=>jO,sPt:()=>au,sH1:()=>ou,RPM:()=>lT,h27:()=>Nu,Uqd:()=>Su,xG:()=>qO,Z2f:()=>Xm,fgW:()=>yO,I69:()=>xO,ZxB:()=>VO,mdt:()=>nT,Qbq:()=>Lm,rny:()=>Fi,UEY:()=>Oa,Q0T:()=>ba,Lyr:()=>Pa,sBn:()=>ha,itK:()=>fa,H9$:()=>ma,KPc:()=>Ea,zos:()=>Ta,ELQ:()=>wa,dZs:()=>aa,Cz4:()=>ia,z_L:()=>Aa,fGe:()=>na,iuF:()=>da,Wib:()=>ya,Hn0:()=>Ra,XUh:()=>pa,Qp_:()=>ua,_jk:()=>oa,sKE:()=>sa,WmG:()=>ca,QKx:()=>_a,Oik:()=>va,s0A:()=>la,o9m:()=>ga,MCd:()=>Na,tGK:()=>hl,Vg3:()=>Yi,mkC:()=>Ui,xv5:()=>qi,a14:()=>ji,yv0:()=>Bi,Zm0:()=>Ci,Nxd:()=>Ii,$mM:()=>Wi,ifj:()=>si,NWi:()=>Eh,xr3:()=>Th,wNf:()=>wl,iJH:()=>mh,d89:()=>Pi,Edd:()=>wi,Z5t:()=>Si,uGe:()=>Ai,UoR:()=>Ni,xvW:()=>fh,$qe:()=>yh,yPM:()=>ra,$cp:()=>Us,vKJ:()=>Ss,AID:()=>Hy,B1H:()=>Cg,b7X:()=>Cm,$uE:()=>ve,keo:()=>Dm,C_p:()=>BT,G27:()=>YE,JA0:()=>Qd,b3T:()=>Oe,oC6:()=>he,_Zs:()=>be,epC:()=>Ne,YYG:()=>_e,f_2:()=>zd,w3l:()=>fg,QHB:()=>WE,Jso:()=>gg,RXH:()=>IE,Vr9:()=>zE,lMm:()=>Rm,fmQ:()=>zo,yRD:()=>ng,NcL:()=>XT,QK6:()=>pe,ymd:()=>Wc,JV_:()=>hy,XiW:()=>lf,Yrx:()=>xd,GPx:()=>Os,gjI:()=>bs,vlo:()=>Lf,E_P:()=>zf,aAL:()=>Ic,NBq:()=>Zo,wp9:()=>rT,DsR:()=>Nc,MPc:()=>Zy,gWE:()=>ef,DT_:()=>tf,ipn:()=>nf,ORg:()=>Oi,_wz:()=>rf,RYR:()=>ff,PP2:()=>$d,wS7:()=>ih,cBQ:()=>uc,pBq:()=>jy,DsO:()=>Z,X78:()=>Oy,xZs:()=>fy,YFy:()=>Vd,Gmt:()=>cy,K$w:()=>uy,DSj:()=>Uc,k9j:()=>pc,ww$:()=>As,WVU:()=>ly,hxF:()=>Qs,nwO:()=>rv,Mzk:()=>ic,aFF:()=>$m,HRH:()=>Wl,EZK:()=>hp,Kxm:()=>fp,Z9i:()=>RT,CrF:()=>ty,DNd:()=>Ia,vUy:()=>zg,lJh:()=>ql,zHo:()=>Kl,sEJ:()=>kg,UO$:()=>My,zeJ:()=>Yn,dLR:()=>cs,JQy:()=>Ts,XtP:()=>ls,Ug0:()=>yi,A1W:()=>jm,sw:()=>mp,nv3:()=>Ah,JgD:()=>Nh,nve:()=>Fg,SkP:()=>Es,SAs:()=>Ly,PWK:()=>So,IM5:()=>us,Mfk:()=>Um,mB6:()=>eh,p6d:()=>w,o0x:()=>I,ufS:()=>Wm,k7L:()=>Ym,mrB:()=>S,ncP:()=>Ke,Zmi:()=>Ge,hm5:()=>Ye,ECL:()=>Bt,vPL:()=>gp,qmL:()=>Qf,hXd:()=>Mi,OCS:()=>Vi,p2l:()=>Ds,qF1:()=>Yc,_X$:()=>Bc,yj2:()=>wb,bzh:()=>oT,k66:()=>Fo,kiP:()=>eo,pSg:()=>ue,kz_:()=>qd,H_U:()=>Mo,t9e:()=>Fa,j2$:()=>sp,PFL:()=>Pn,aJ3:()=>Zh,To9:()=>Mn,wpo:()=>Wp,ADq:()=>gT,UUb:()=>bT,tQX:()=>OT,xy8:()=>Un,EUG:()=>Bn,AFK:()=>it,X3M:()=>Wn,WN0:()=>xo,kDl:()=>ps,uDV:()=>Jf,IhQ:()=>ys,R$r:()=>Xf,w80:()=>mo,Pfu:()=>La,Gtj:()=>cl,fyF:()=>ul,u5q:()=>He,O$n:()=>$p,ptG:()=>Gp,f4_:()=>iE,uap:()=>nE,d7q:()=>Fd,liG:()=>Gd,$oF:()=>kd,avf:()=>Af,DiQ:()=>Nf,cfX:()=>_f,vD3:()=>Pf,Qrb:()=>vf,EJQ:()=>Rf,HWy:()=>gf,y6v:()=>Of,GtP:()=>TE,_kX:()=>Ca,u1e:()=>ja,sJj:()=>xm,CJp:()=>yE,uKF:()=>Fm,wo0:()=>iy,cwx:()=>Uo,TTx:()=>dy,HaQ:()=>yy,E6I:()=>ey,vTU:()=>wd,Nsy:()=>jp,KMQ:()=>Vm,CSV:()=>Fs,l1V:()=>Jl,VQ1:()=>Zl,z7d:()=>kf,Xaq:()=>Go,Sj8:()=>tv,PJj:()=>Tl,PjQ:()=>vi,s7l:()=>zu,GGR:()=>Uf,j5q:()=>Sf,DnY:()=>Hu,RY5:()=>Wf,Px$:()=>Tf,KPC:()=>Sg,NIY:()=>rc,HvW:()=>Zu,Fof:()=>xa,BTI:()=>Fp,uie:()=>Np,ChB:()=>bp,q27:()=>Bp,fAQ:()=>Ny,XkT:()=>Ku,lrH:()=>Ay,nt9:()=>li,XH8:()=>Vp,XH2:()=>fi,jFi:()=>Mp,qhs:()=>Eo,wwR:()=>kp,Uk3:()=>at,ev7:()=>jg,zsW:()=>Xu,RB9:()=>Jd,iFp:()=>cT,e$p:()=>dT,PcX:()=>yT,SpP:()=>pT,R6_:()=>tb,CY1:()=>ub,Ajk:()=>Wu,Yiz:()=>Gu,FK9:()=>xu,UOo:()=>Bm,aTW:()=>py,uug:()=>Pl,P$2:()=>db,XS2:()=>bl,Hyb:()=>Ml,d3Y:()=>Du,Klp:()=>ku,WxZ:()=>yb,Gzu:()=>Hl,ZOr:()=>qu,uqV:()=>Ad,Pm4:()=>te,nVD:()=>Bf,dED:()=>Dd,P2h:()=>jd,jrr:()=>Qa,mmY:()=>za,T6O:()=>Vo,h6J:()=>np,hM2:()=>Ng,XR6:()=>Q,jmz:()=>Hf,IHt:()=>Kf,NZI:()=>AT,wdF:()=>vy,kgP:()=>_y,ZYI:()=>Mc,QXK:()=>al,efz:()=>ol,Q5d:()=>il,Ysv:()=>sl,ocC:()=>xf,io3:()=>pi,Sbt:()=>bo,roS:()=>ho,Ww1:()=>Oo,QaS:()=>ac,ERZ:()=>dg,CL1:()=>Ag,idV:()=>Ep,nIW:()=>tt,fjE:()=>rb,sG0:()=>qm,tV7:()=>El,g8o:()=>Fb,Qy:()=>kb,t2P:()=>zh,wId:()=>so,LS0:()=>lo,bFH:()=>dd,Rgl:()=>fd,fW1:()=>zT,Ywp:()=>Ih,pg:()=>Jp,WSA:()=>Td,fed:()=>vg,tT_:()=>fs,KbL:()=>Qu,JBA:()=>lt,aNC:()=>_h,RFJ:()=>xc,Zeh:()=>xy,OT5:()=>Sh,mC3:()=>Zs,NVY:()=>eT,k6v:()=>qc,FEC:()=>Kc,Ob5:()=>qp,KUV:()=>Kp,dvH:()=>Zf,V3i:()=>tm,VD3:()=>di,mm2:()=>zl,izH:()=>Da,DK$:()=>ka,KMp:()=>Sc,c31:()=>En,mbo:()=>_T,gT8:()=>bn,CZ8:()=>Qo,uGi:()=>rs,Poc:()=>fn,_9k:()=>as,ZTM:()=>es,bwT:()=>ns,tzW:()=>gn,tF$:()=>hn,o96:()=>Xo,M4S:()=>is,_vs:()=>vc,xF8:()=>Ef,HQx:()=>Gm,ATu:()=>vT,j1S:()=>hi,V3K:()=>Ei,Lmx:()=>mi,ZaZ:()=>Tn,n_1:()=>Pd,N6e:()=>Rc,SxO:()=>Xa,w3p:()=>tT,xU7:()=>ce,Y_p:()=>_o,$k6:()=>vo,Gdl:()=>Hm,U6P:()=>Km,OwB:()=>eb,hTh:()=>qf,xqc:()=>Co,JvE:()=>jo,i29:()=>bu,dzT:()=>Li,uPS:()=>lc,cZV:()=>sc,Uz2:()=>Sp,xz3:()=>wp,AET:()=>Pp,n3B:()=>OO,e6O:()=>fO,s7j:()=>Ub,kW2:()=>fE,tH7:()=>Io,Yxg:()=>Gs,MaZ:()=>If,nqN:()=>wf,o_J:()=>Wo,hgZ:()=>Op,yW4:()=>ip,uT0:()=>tp,C82:()=>rp,u9Z:()=>Uy,J$m:()=>Rd,j_Q:()=>Vu,wB1:()=>Ug,SP6:()=>Hp,ZYr:()=>wg,IMU:()=>Fc,FoU:()=>Xd,DVz:()=>Zm,mxe:()=>hO,FHr:()=>ky,VO3:()=>xh,de5:()=>Fh,Uw1:()=>fe,J6q:()=>NT,XCe:()=>Ka,Ir:()=>no,XQO:()=>io,QXb:()=>ad,P8_:()=>Ey,iiD:()=>wc,MOC:()=>od,WF:()=>id,xE1:()=>gi,idW:()=>Bg,YL3:()=>nc,Fn9:()=>T,j2U:()=>js,MpE:()=>vn,kQw:()=>Sn,mfm:()=>oO,vZp:()=>ot,E8K:()=>Vg,VSb:()=>Ho,vr_:()=>wn,Vmh:()=>Xg,FgW:()=>em,oDv:()=>Bo,kuw:()=>qo,Tt2:()=>Yo,T6Y:()=>ei,_26:()=>kl,YkM:()=>Fn,J6y:()=>vl,njU:()=>Il,IT0:()=>PT,x_:()=>Mm,biM:()=>Lp,Vkd:()=>jl,WiY:()=>ob,_zi:()=>Dl,J6D:()=>Xl,Lt4:()=>Hn,QEi:()=>$n,whI:()=>Jt,KIu:()=>Xt,JhM:()=>ae,C_0:()=>ni,qIF:()=>gO,O27:()=>E,aBi:()=>Yp,xOX:()=>Ks,EdS:()=>Xe,WgC:()=>Qe,eEv:()=>An,A4t:()=>Ul,hnu:()=>st,Wos:()=>zn,jWr:()=>Sa,Or$:()=>kn,lhE:()=>ci,CwH:()=>Vn,pzC:()=>Ys,ymH:()=>Sl,QZu:()=>Dn,rYH:()=>ab,FVt:()=>Xn,Kn2:()=>le,OXP:()=>Ko,lS4:()=>Gn,g5f:()=>sb,fp6:()=>Al,Uty:()=>Ji,YkG:()=>Ln,xdS:()=>On,$NE:()=>ze,bC9:()=>Je,KVV:()=>km,q9e:()=>go,iIf:()=>Jm,ian:()=>Xs,m6e:()=>ii,OFd:()=>Bs,kqr:()=>In,fnZ:()=>Ht,VFZ:()=>zs,ZiX:()=>Be,j5n:()=>Jn,zkt:()=>v,Pcm:()=>Ig,QDV:()=>Ws,M5u:()=>ib,laD:()=>bO,mtq:()=>Nn,CtB:()=>Qm,CBv:()=>ie,I0t:()=>ri,u1G:()=>Df,gk1:()=>EO,Bgb:()=>TO,uzs:()=>Qt,v0l:()=>ru,Zqp:()=>Id,j0k:()=>wo,tCm:()=>nt,gmx:()=>Ol,mOr:()=>$l,TwZ:()=>xb,GyU:()=>Rh,zGm:()=>zp,bMg:()=>bd,EyD:()=>ph,FQA:()=>dh,fZN:()=>vd,xsF:()=>uh,Lxg:()=>ch,O3l:()=>yc,Wni:()=>dc,wRx:()=>bh,OxG:()=>ud,uJQ:()=>ld,qWg:()=>zm,i96:()=>Qp,zhn:()=>hh,G8q:()=>yn,A9Y:()=>ee,Y5F:()=>ig,gxP:()=>se,c$P:()=>gl,BBN:()=>Ja,ZBU:()=>J,UkJ:()=>uo,xkv:()=>Ty,z$M:()=>qg,KAm:()=>Hd,lCl:()=>Jy,rkF:()=>qT,IU6:()=>dp,aYu:()=>m,ije:()=>fl,Buf:()=>Pc,YLu:()=>yl,ct9:()=>Ao,XkY:()=>Od,T5R:()=>Zp,uQS:()=>_d,wcJ:()=>No,d$I:()=>Rs,rSp:()=>Dp,Sx:()=>tc,Ki6:()=>Js,VGk:()=>_c,sFD:()=>UE,eWN:()=>Hg,dWE:()=>Ib,Lkd:()=>uf,aDL:()=>Vy,yaA:()=>Nd,DBr:()=>Jh,hK$:()=>ml,TZ_:()=>pp,CMB:()=>vO,FU8:()=>ec,J$p:()=>Yy,b5s:()=>Wy,h2W:()=>rt,SL_:()=>wy,oUH:()=>zc,ck9:()=>ed,Xs0:()=>dl,oCZ:()=>$T,MjG:()=>kh,FuV:()=>Xc,$ju:()=>ep,t6d:()=>Zc,m5F:()=>ye,sx:()=>Jg,rSc:()=>th,L8n:()=>sy,R9X:()=>Sd,rj2:()=>by,_C4:()=>lp,tCj:()=>my,uAg:()=>Md,wx9:()=>hf,KF3:()=>up,ax9:()=>cp,HH7:()=>Ac,_6y:()=>cc,AJo:()=>oc,Ixr:()=>Zd,P6Y:()=>nv,Bd_:()=>FT,xkB:()=>kT,W41:()=>Iy,WkI:()=>Sy,sSE:()=>LT,GMd:()=>Tu,Bxm:()=>MT,FVh:()=>IT,U_T:()=>Ed,FTe:()=>ne,VGB:()=>re,Wfe:()=>Bl,Ls5:()=>Yl});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:()=>I,formatTime:()=>S,getEndOfDay:()=>P,getMomentFormatFromDateMask:()=>B,getMomentFormatFromDateTimeMask:()=>H,getMomentFormatFromTimeMask:()=>K,getStartOfDay:()=>R,isToday:()=>v,isValidMomentDate:()=>h,isValidMomentDateOrNull:()=>b,momentToDate:()=>O,parseTimestamp:()=>J,toLocalDate:()=>_,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>ve,compareActivenessAttributes:()=>Oe,compareAttributes:()=>he,compareImages:()=>be,compareRoles:()=>Ne,compareTags:()=>_e});var o={};r.r(o),r.d(o,{addAttribute:()=>Pe,editAttribute:()=>we,editEndDate:()=>De,editRoles:()=>Ue,editStartDate:()=>je,editTags:()=>Ce,removeAttribute:()=>Ie});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=>e&&e.isValid(),b=(0,l.either)(h,l.isNil),O=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),v=e=>f()(e).isSame(Date.now(),"day"),_=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)},A=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=A("startOf"),P=A("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),S=e=>f()(e).format(f().localeData().longDateFormat("LTS")),I=e=>`${w(e)} ${S(e)}`,U=(0,l.equals)("9"),C=(0,l.equals)("99"),j=(0,l.equals)("9999"),D=(0,l.test)(/^[az][az][az]$/),L=(0,l.test)(/^[az][az][az][az]$/),k=(0,l.test)(/^9+$/),F=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[U,(0,l.always)("M")],[C,(0,l.always)("MM")],[D,(0,l.always)("MMM")],[L,(0,l.always)("MMMM")],[F,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),M=(0,l.cond)([[U,(0,l.always)("D")],[C,(0,l.always)("DD")],[F,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[U,(0,l.always)("y")],[C,(0,l.always)("YY")],[j,(0,l.always)("YYYY")],[k,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),$=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),U),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),C),(0,l.always)("hh")],[U,(0,l.always)("H")],[C,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),G=(0,l.cond)([[U,(0,l.always)("m")],[C,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),W=(0,l.cond)([[U,(0,l.always)("s")],[C,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,B=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,M(n),i,V(a),o])}return e},q=/(9+)([^9]+)*/g,K=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,[$(e,s),r,G(n),i,a?W(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},H=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${B(t)} ${K(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Q=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",X=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:X,None:()=>X(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)}},Z=(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)}},ee=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},te=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),re=e=>Array.isArray(e)?e:[e],ne=e=>[e],ie=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),ae=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),oe=e=>(e=(e||"").toLowerCase(),ae(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),se=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),le=e=>null!=e&&["object","function"].includes(typeof e),ue=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)),le(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},ce=(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)},pe=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)},de=/[\n\r%#()<>?[\\\]^`{}|]/g,ye=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(de,encodeURIComponent)}`,fe=e=>`data:image/gif;base64,${e}`;function Te(e){return e&&void 0!==e.uri}function Ee(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 me(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 he(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"===v(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(he(d.value,y.value,r)):"Reference"===v(d)?me(d,y)?o.push.apply(o,he(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(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&&(le(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),g(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 g(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,g(e.value)}))}function v(e){var t=e.value;if(le(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 be(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)||Te(r)&&Te(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function Oe(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 ve(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 _e(e,t){return Ee("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return Ee("UPDATE_ROLES").call(this,e,t)}function Ae(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 Re(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Ae(r[i],r[i+1],e,t));return n}function Pe(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Re(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 Pe(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=Re(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()?(Se(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(Se.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=Pe(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 Se(e,t){le(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ie(e,t,r,n){void 0===n&&(n=0);var i=Re(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ie(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 Ue(e,t){e.roles=t||[]}function Ce(e,t){e.tags=t||[]}function je(e,t){e.startDate=t||""}function De(e,t){e.endDate=t||""}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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(le(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:le(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(le(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){le(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=Le({},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:Le({},n,{roles:s,tags:u}),roles:i,tags:l}}}},xe=r(15729);const Me="1Tempo4rary",Ve="1Tepmo4Rel",$e=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Ge=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,We=e=>()=>Ge(e),Ye=(e,t)=>{const r=$e(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Ge(n)},Be=e=>e&&e.includes("uri$$"),qe=We("entities"),Ke=We("relations"),He=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Qe=(0,l.startsWith)("entities/"),Xe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ze=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),et=(0,l.pipe)((0,l.split)("/"),l.head),tt=(0,l.pipe)((0,l.split)("/"),l.last),rt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},nt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),it=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},at=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},ot=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),st=e=>5===e.split("/").length,lt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ut=e=>e.replace(/uri\$\$/g,Me),ct={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"},pt="listEquals",dt="not listEquals",yt="listEqualsCaseSensitive",ft="not listEqualsCaseSensitive",Tt={[ct.EQUALS]:"equals",[ct.NOT_EQUALS]:"not",[ct.STARTS_WITH]:"starts with",[ct.MISSING_VALUE]:"missing value",[ct.IN_RANGE]:"in range",[ct.HAS_ALL]:"has all",[ct.FULL_TEXT]:"full text",[ct.EXISTS]:"exists",[ct.COUNT_EQUALS]:"count equals",[ct.COUNT_NOT_EQUALS]:"count not equal",[ct.COUNT_LT]:"count less",[ct.COUNT_LTE]:"count less or equal",[ct.COUNT_GT]:"count greater",[ct.COUNT_GTE]:"count greater or equal",[ct.COUNT_RANGE]:"count in range",[ct.LT]:"less than",[ct.LTE]:"less than or equal",[ct.GT]:"greater than",[ct.GTE]:"greater than or equal",[ct.IN_FILE]:"in file",[ct.NOT_IN_FILE]:"not in file",[ct.CONTAINS]:"contains",[ct.ON]:"on",[ct.BEFORE]:"before",[ct.AFTER]:"after",[ct.WITHIN]:"within"},Et="in",mt="notIn",ht="not range",bt=e=>({[Et]:ct.EQUALS,[mt]:ct.NOT_EQUALS}[e]||e),Ot={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},gt={[Ot.LAST_DAY]:"Last 24 hours",[Ot.LAST_3DAYS]:"Last 3 days",[Ot.LAST_WEEK]:"Last week",[Ot.LAST_MONTH]:"Last month",[Ot.LAST_YEAR]:"Last year",[Ot.PICK_DATE]:"Pick date"},vt={TYPE_STRING:"String",TYPE_TEXT:"Text",TYPE_PASSWORD:"Password",TYPE_LONG:"Long",TYPE_INT:"Int",TYPE_DOLLAR:"Dollar",TYPE_FLOAT:"Float",TYPE_DOUBLE:"Double",TYPE_NUMBER:"Number",TYPE_BOOLEAN:"Boolean",TYPE_BOOLEAN_RADIO:"Boolean_Radio",TYPE_DATE:"Date",TYPE_TIMESTAMP:"Timestamp",TYPE_ACTIVENESS_DATE:"ActivenessDate",TYPE_LOCAL_DATE:"LocalDate",TYPE_BLOB:"Blob",TYPE_ENUM:"Enum",TYPE_CIK_ID:"cik id",TYPE_LOOKUP:"Lookup",TYPE_TYPEAHEAD:"Typeahead",TYPE_URL:"URL",TYPE_BLOG_URL:"Blog URL",TYPE_IMAGE_URL:"Image URL",TYPE_EMAIL:"Email",TYPE_DEPENDENT_LOOKUP:"DependentLookup",TYPE_ENTITY_ID:"EntityId",TYPE_RDM_LOOKUPS_NOT_RESOLVED:"RdmLookupsNotResolved",TYPE_COUNT:"Count",TYPE_FILE:"File",TYPE_SELECT:"Select",TYPE_NESTED:"Nested",TYPE_REFERENCE:"Reference",TYPE_IMAGE:"Image",TYPE_SSN:"SSN"},_t={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Nt={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},At="<No label>",Rt={IN:"in",OUT:"out"};var Pt=r(87918),wt=r.n(Pt);function St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){It(e,t,r[t])}))}return e}function It(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ut={startDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Ct=St({id:{type:vt.TYPE_ENTITY_ID,get label(){return wt().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Ut,{roles:{type:vt.TYPE_STRING,get label(){return wt().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:vt.TYPE_STRING,get label(){return wt().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),jt={workflow:{type:vt.TYPE_STRING,get label(){return wt().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:vt.TYPE_STRING,get label(){return wt().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:vt.TYPE_STRING,get label(){return wt().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Dt={commenter:{type:vt.TYPE_STRING,get label(){return wt().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Lt={notResolved:{type:vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return wt().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},kt={createdBy:{type:vt.TYPE_STRING,get label(){return wt().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:vt.TYPE_STRING,get label(){return wt().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Ft={matches:{type:vt.TYPE_COUNT,get label(){return wt().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:vt.TYPE_COUNT,get label(){return wt().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},xt={sourceSystems:{type:vt.TYPE_STRING,get label(){return wt().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:vt.TYPE_STRING,get label(){return wt().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:vt.TYPE_INT,get label(){return wt().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:vt.TYPE_STRING,get label(){return wt().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Mt={matchRules:{type:vt.TYPE_STRING,get label(){return wt().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:vt.TYPE_STRING,get label(){return wt().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Vt=St({},Ct,jt,Dt,Lt,kt,Ft,xt,Mt,{type:{type:vt.TYPE_STRING,get label(){return wt().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var $t=r(13980),Gt=r.n($t);const Wt=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Yt=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Wt),Bt=(0,l.pipe)((0,l.reject)(E),Yt),qt=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("?")?"&":"?")+Wt(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}},Kt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Ht=(0,l.equals)(Kt.SUGGESTING),Jt=(0,l.equals)(Kt.EDITING),Qt=(0,l.equals)(Kt.VIEWING),Xt=(0,l.either)(Jt,Ht);let zt,Zt,er,tr,rr,nr,ir,ar,or,sr,lr,ur,cr,pr,dr,yr,fr,Tr,Er,mr,hr,br,Or,gr,vr;function _r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Nr(e,t,r[t])}))}return e}function Nr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(zt||(zt={})),function(e){e.local="local",e.validationService="validationService"}(Zt||(Zt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(er||(er={})),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"}(tr||(tr={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(rr||(rr={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch"}(nr||(nr={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(ir||(ir={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(ar||(ar={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(or||(or={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(sr||(sr={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(lr||(lr={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(ur||(ur={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(cr||(cr={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(pr||(pr={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(dr||(dr={})),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"}(yr||(yr={})),function(e){e.IN="in",e.OUT="out"}(fr||(fr={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Tr||(Tr={})),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"}(Er||(Er={})),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"}(mr||(mr={})),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"}(hr||(hr={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(br||(br={})),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"}(Or||(Or={})),function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(gr||(gr={})),function(e){e.Saving="Saving"}(vr||(vr={}));const Ar=Gt().oneOf(["mobile","tablet","desktop"]),Rr=Gt().shape({deviceTypes:Gt().oneOfType([Ar,Gt().arrayOf(Ar)]),roles:Gt().arrayOf(Gt().string)}),Pr=Gt().shape({value:Gt().string,lookupCode:Gt().string}),wr=Gt().shape({link:Gt().string,filename:Gt().string}),Sr=Gt().shape({displayName:Gt().string,parent:Gt().string}),Ir=Gt().oneOfType([Gt().string,Gt().number,Gt().bool,Pr]),Ur=Gt().oneOfType([Ir,Gt().arrayOf(Ir)]),Cr=Gt().shape({fieldName:Gt().string,values:Gt().arrayOf(Ur),filter:Gt().string,type:Gt().string}),jr=Gt().shape({minValue:Gt().number,maxValue:Gt().number}),Dr=Gt().shape({label:Gt().string,name:Gt().string,description:Gt().string,type:Gt().string,hidden:Gt().bool,faceted:Gt().bool,searchable:Gt().bool,uri:Gt().string,access:Gt().arrayOf(Gt().string),cardinality:jr}),Lr=Gt().shape({label:Gt().string,uri:Gt().string,typeColor:Gt().string,direction:Gt().string,startObject:Gt().object,endObject:Gt().object}),kr=Gt().shape({typeColor:Gt().string,typeIcon:Gt().string,typeImage:Gt().string,label:Gt().string,uri:Gt().string,attributes:Gt().arrayOf(Dr)}),Fr=Gt().shape({uri:Gt().string,label:Gt().string,memberTypes:Gt().array,extendsTypeUri:Gt().string,attributes:Gt().arrayOf(Dr)}),xr=Gt().shape({uri:Gt().string,label:Gt().string,extendsTypeUri:Gt().string,relationshipTypeURIs:Gt().arrayOf(Gt().string)}),Mr=Gt().shape({uri:Gt().string,description:Gt().string,label:Gt().string,schemaVersion:Gt().string,entityTypes:Gt().arrayOf(kr),roles:Gt().arrayOf(Gt().object),groupTypes:Gt().arrayOf(Gt().object),relationTypes:Gt().arrayOf(Lr),graphTypes:Gt().arrayOf(xr),interactionTypes:Gt().arrayOf(Fr),sources:Gt().arrayOf(Gt().object)}),Vr=Gt().shape({uri:Gt().string,type:Gt().string}),$r=Gt().shape({uri:Gt().string,attributes:Gt().object,type:Gt().string,timestamp:Gt().number,members:Gt().object}),Gr=Gt().shape({uri:Gt().string,type:Gt().string}),Wr=Gt().shape({value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Yr=Gt().shape({refEntity:Gt().oneOfType([Gt().array,Gt().object]),refRelation:Gt().oneOfType([Gt().array,Gt().object]),value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Br=Gt().oneOf((0,l.values)(Kt)),qr=Gt().shape({type:Gt().oneOf(Object.values(zt)).isRequired,attributeTypeUri:Gt().string.isRequired,parentUri:Gt().string.isRequired,uri:Gt().string,message:Gt().string}),Kr={attributeType:Dr,showEmptyEditors:Gt().bool,lazy:Gt().bool,mode:Br,metadata:Mr,ownError:qr,errors:Gt().arrayOf(qr),crosswalks:Gt().array,onAddAttributes:Gt().func,onAddOneMore:Gt().func,onDeleteAttribute:Gt().func,onChangeAttribute:Gt().func,additionalControlsRenderer:Gt().func,hideDeleteButton:Gt().bool,showNonOv:Gt().bool,state:Gt().oneOf(["deleted","edited"])},Hr=_r({attributeValue:Wr},Kr),Jr=_r({attributeValue:Yr},Kr),Qr=Gt().shape({value:Gt().oneOfType([Gt().string,Gt().bool,Gt().number]),ov:Gt().bool,type:Gt().string,uri:Gt().string,lookupCode:Gt().string,lookupRawValue:Gt().string}),Xr=Gt().shape({totalOvValues:Gt().number,totalValues:Gt().number}),zr=Gt().shape({inRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),outRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),groups:Gt().arrayOf(Gt().string),entityTypes:Gt().arrayOf(Gt().string),nextEntry:Gt().object}),Zr=Gt().oneOf(["asc","desc"]),en=Gt().shape({id:Gt().string,content:zr,allowOnlyCreateNew:Gt().bool,sortColumn:Gt().string,sortOrder:Zr,"text-empty":Gt().string,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Rr,canRead:Rr,canUpdate:Rr,canDelete:Rr,editingEnabled:Gt().bool}),tn=Gt().shape({id:Gt().string,graph:Gt().shape({type:Gt().string,layout:Gt().number,deep:Gt().number,limit:Gt().number,uri:Gt().string,options:Gt().shape({reverseRelations:Gt().bool})}),sortBy:Gt().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:Zr,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Rr,canRead:Rr,canUpdate:Rr,canDelete:Rr}),rn=Gt().shape({id:Gt().string,caption:Gt().string,pageSize:Gt().number,icon:Gt().string,canCreate:Rr,canRead:Rr,canUpdate:Rr,canDelete:Rr,attributes:Gt().object}),nn=Gt().shape({entityUri:Gt().string,entityType:Gt().string,entityLabel:Gt().string,object:Vr}),an=Gt().shape({relationUri:Gt().string,relationType:Gt().string,relationLabel:Gt().string,direction:Gt().string,object:Gr}),on=Gt().shape({entity:nn,relation:an}),sn=Gt().shape({value:Gt().string,isRawFilter:Gt().bool}),ln=Gt().shape({id:Gt().string,label:Gt().string,name:Gt().string,availableEntityTypes:Gt().array}),un=Gt().shape({id:Gt().string,allowMergeAll:Gt().bool,matchActions:Gt().object,availableTabs:Gt().arrayOf(Gt().oneOf(["findMatches","potentialMatches","notAMatch"]))}),cn=Gt().shape({matchRules:Gt().arrayOf(Gt().string),object:Vr,shortestTransitiveMatchPath:Gt().arrayOf(Gt().shape({matchRules:Gt().arrayOf(Gt().string),match:Gt().string})),direct:Gt().bool,matchScore:Gt().number}),pn=Gt().arrayOf(cn),dn=Gt().arrayOf(Gt().shape({uri:Gt().string,label:Gt().string})),yn=[{label:wt().text("And"),value:"and"},{label:wt().text("Or"),value:"or"},{label:wt().text("And not"),value:"and not"},{label:wt().text("Or not"),value:"or not"}],fn=(0,l.prop)("referencedEntityTypeURI"),Tn=(0,l.prop)("relationshipTypeURI"),En=(0,l.prop)("referencedAttributeURIs"),mn=(0,l.curry)(((e,t)=>(0,l.pipe)(En,(0,l.filter)((0,l.startsWith)(e)))(t))),hn=mn("configuration/relationTypes"),bn=mn("configuration/entityTypes"),On=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),gn=(0,l.filter)(On),vn=(e,t)=>!t||t.some((t=>t===e.uri));function _n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nn=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Xe),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",vt.TYPE_STRING),(0,l.propEq)("type",vt.TYPE_BLOB))]),An=(0,l.has)("values"),Rn=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(vt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(vt.TYPE_LOOKUP)],[An,(0,l.always)(vt.TYPE_ENUM)],[Nn,(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")]]),Pn=(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){_n(e,t,r[t])}))}return e}({},e,{type:Rn(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),wn=e=>!!e&&(!!e.autoGenerated&&e.type!==vt.TYPE_NESTED||!!e.parentAutoGenerated),Sn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),In=(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),Un=e=>Sn(e)?"analyticsAttributes":"attributes",Cn=(0,l.propEq)("hidden",!0),jn=(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))),Dn=jn(vt.TYPE_NESTED),Ln=jn(vt.TYPE_REFERENCE),kn=jn(vt.TYPE_IMAGE),Fn=(0,l.either)(Dn,Ln),xn=(e,t)=>{const r=Sn(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(".")},Mn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Vn=(0,l.pipe)(Mn,Boolean),$n=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Gn=(0,l.both)(Vn,(0,l.pipe)(Mn,("rdm",(0,l.pipe)(et,(0,l.equals)("rdm")))));const Wn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Un({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]||Bn(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:[]},Yn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Wn(e,t,r);return n.length?(0,l.last)(n):null},Bn=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)(En,(0,l.map)((t=>Yn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},qn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],Kn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],Hn=e=>qn.includes(e),Jn=e=>Kn.includes(e),Qn=[vt.TYPE_INT,vt.TYPE_LONG,vt.TYPE_NUMBER,vt.TYPE_FLOAT,vt.TYPE_DOUBLE,vt.TYPE_COUNT],Xn=e=>Qn.includes(e),zn=e=>[vt.TYPE_FLOAT,vt.TYPE_DOUBLE].includes(e),Zn=[vt.TYPE_BOOLEAN,vt.TYPE_BOOLEAN_RADIO,vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],ei=e=>Zn.includes(e),ti=[vt.TYPE_URL,vt.TYPE_BLOG_URL,vt.TYPE_IMAGE_URL],ri=e=>ti.includes(e),ni=jn(vt.TYPE_EMAIL),ii=e=>vt.TYPE_SSN===e;var ai,oi=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(ai||(ai={}));const si=(0,l.curry)(((e,t,r)=>{var n;const i=null===(n=r[e])||void 0===n?void 0:n.roles;return!i||i.some((e=>t.includes(e)))})),li=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),ui=(0,l.curry)(((e,t)=>(0,l.pipe)(li(e),(0,l.prop)("extendsTypeURI"))(t))),ci=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(ui(e,r)));return n(r)})),pi=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=ui(e,n);return r})),di=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?di(e,li(e,t.extendsTypeURI),r):void 0,yi=(e,t)=>{const r=t.map(pi(e));return(r.length?r.reduce(l.intersection):[])[0]},fi=(e,t)=>di(e,(0,l.is)(Object,t)?t:li(e,t),"typeImage");function Ti(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ei=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),mi=(0,l.pipe)(Ei,(0,l.propOr)("","label")),hi=(0,l.curry)(((e,t)=>{const r=Ei(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),bi=(0,l.curry)(((e,t,r)=>{const[n,i]=hi(e,r);return ci(e,n,t)||ci(e,i,t)})),Oi=(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){Ti(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),gi=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?Rt.OUT:Rt.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(Rt.IN),i=r(Rt.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},vi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),_i={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ni=(0,l.curry)(((e,t)=>e.every((e=>Ai(e,t))))),Ai=(0,l.curry)(((e,t)=>{const r=wn(t);return!t||(!t.access||t.access.includes(e))&&(e===_i.READ||!r)})),Ri=(0,l.curry)(((e,t,r)=>Ai(_i.READ,r)&&(Ht(t)?Ai(_i.INITIATE_CHANGE_REQUEST,r):Ai(e,r)))),Pi=Ri(_i.CREATE),wi=Ri(_i.DELETE),Si=Ri(_i.UPDATE),Ii=Ni([_i.CREATE,_i.MERGE,_i.READ,_i.UPDATE]),Ui=Ni([_i.UPDATE,_i.READ,_i.CREATE]),Ci=Ni([_i.UPDATE,_i.READ]),ji=Ni([_i.DELETE,_i.UPDATE,_i.READ]),Di=(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["*"])),Li=(e,t,r)=>(0,l.pipe)((0,l.map)(Di(e,t)),(0,l.filter)(l.identity))(r),ki=(e,t,r)=>{const n=Li(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ai(_i.MERGE,r)},Fi=(0,l.curry)(((e,t,r,n)=>{const i=Ei(e,n),[a,o]=hi(e,n);return i&&Ai(_i.CREATE,i)&&ci(e,a,t.type)&&ci(e,o,r.type)})),xi=(e,t,r,n,i)=>{const a=li(e,n.type),o=Li(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(Fi(e,n,i))||a.some(Fi(e,i,n))}))},Mi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=li(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:ki(o,i,a),canAddRelation:xi(e,o,i,r,n),canMark:Ai(_i.UPDATE,a)&&Ai(_i.READ,a)}},Vi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Mi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),$i=Sn,Gi=(0,l.complement)($i),Wi=Ai(_i.READ),Yi=e=>{let{attributeType:t,mode:r}=e;return Gi(t)&&Pi(r,t)&&!Cn(t)},Bi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Be(r.uri),o=Si(n),s=Pi(n);return(0,l.cond)([[$i,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},qi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Be(r.uri),s=Si(n),u=wi(n),c=Hi(_i.UPDATE,n,a,r),p=Hi(_i.DELETE,n,a,r);return(0,l.cond)([[$i,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)},Ki=(0,l.curry)(((e,t,r,n)=>{const i=Bn(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=>!Ai(e,n)||!Ki(e,t,r[n.name],n)))))})),Hi=(0,l.curry)(((e,t,r,n,i)=>Ht(t)?Ki(_i.INITIATE_CHANGE_REQUEST,r,n,i):Ki(e,r,n,i))),Ji=(0,l.both)((0,l.complement)(Cn),Wi),Qi="SuperUser",Xi="allTenants",zi=[Xi,"allCustomers"],Zi=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===Qi})).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===Qi){const e=r?zi.concat(r.map((e=>`allTenants.${e}`))):zi,n=r&&t[0]===Xi?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}))},ea={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_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"},ta={[ea.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ea.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activityLog"],privileges:["EXECUTE"]},[ea.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ea.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ea.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ea.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ea.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ea.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ea.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ea.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ea.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ea.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ea.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ea.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ea.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ea.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ea.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ea.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ea.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ea.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ea.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ea.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ea.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ea.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]}},ra=(0,l.curry)(((e,t,r)=>Zi({allowedPermissionsNames:e,permissionsNames:ea,permissionsConfig:ta}).some((e=>e(t,{params:{tenant:r}}))))),na=ra([ea.CAN_EXPORT]),ia=ra([ea.CAN_EXPORT_ACTIVITIES]),aa=ra([ea.CAN_IMPORT_ENTITIES_FROM_DT]),oa=ra([ea.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),sa=ra([ea.CAN_UPDATE_PROCESS_INSTANCE]),la=ra([ea.CAN_VIEW_WORKFLOW_DEFINITION]),ua=ra([ea.CAN_CONFIG_ENVIRONMENT_REGISTER]),ca=ra([ea.CAN_UPDATE_WORKFLOW_DATA_TASK]),pa=ra([ea.CAN_READ_WORKFLOW_DATA_TASK]),da=ra([ea.CAN_MANAGE_WORKFLOW_DEFINITION]),ya=ra([ea.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),fa=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Ta=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ea=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ma=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ha=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS]),ba=ra([ea.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Oa=ra([ea.CAN_CREATE_CONFIG_JAR]),ga=ra([ea.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),va=ra([ea.CAN_VIEW_CONFIG_JAR]),_a=ra([ea.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Na=ra([ea.CAN_VIEW_WORKFLOW_JOBS]),Aa=ra([ea.CAN_MAKE_BULK_UPDATE]),Ra=ra([ea.CAN_OPEN_DATA_LOADER_EXECUTE,ea.CAN_OPEN_DATA_LOADER_READ]),Pa=ra([ea.CAN_BULK_DELETE_PROFILES]),wa=ra([ea.CAN_READ_MDM_DATA_ENTITIES]),Sa=ra([ea.IS_FREEMIUM_ADMIN]),Ia=(0,l.reject)(Cn),Ua=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ia,(0,l.filter)(e))(t),Ca=(0,l.curry)(((e,t)=>Ua((t=>Yi({attributeType:t,mode:e})),t))),ja=(0,l.curry)(((e,t)=>Ua((t=>Yi({attributeType:t,mode:e})||Ji(t)),t))),Da=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Ji)),La=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...La(e)])))),ka=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Ji),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...ka(e)])))),Fa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Fa(e)])))),xa=(0,l.pipe)(li,(0,l.converge)(l.concat,[ka,Fa]));function Ma(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Va(e,t,r[t])}))}return e}function Va(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $a=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,$a(e)))},t))),Ga=e=>{var t;return Ma({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Wa=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Ya=(0,l.when)(Wa,(0,l.dissoc)("values")),Ba=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Ma({},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})})),qa=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Ka=(0,oi.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(La,t).concat((0,l.chain)(La,r)).some(qa)})),Ha=e=>{let t=!1;const r=$a((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Ma({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ja=e=>{const t=Ka(e),r=(0,l.map)((e=>$a((0,l.pipe)(Ya,(0,l.when)((0,l.always)(e),Ba))))(t)),n=(0,l.map)(Ga),i=(0,l.map)(Ha);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Qa=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Xa=(0,l.prop)("relationshipTypeURIs"),za=(0,l.curry)(((e,t)=>e.graphTypes.filter(Za(e,t)))),Za=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(bi(e,t))},eo=(e,t)=>(0,l.pipe)(Qa,(0,l.defaultTo)({}),Xa,(0,l.defaultTo)([]),(0,l.chain)(hi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(li(e)))(e,t),to=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),ro=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),no=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ro((0,l.complement)(to))(e)},io=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ro(to)(e)},ao=(0,l.pipe)(li,(0,l.propOr)([],"matchGroups")),oo=(e,t,r)=>(0,l.pipe)(ao,(0,l.find)((0,l.propEq)("uri",r)))(e,t),so=(0,l.curry)(((e,t,r)=>(0,l.pipe)(oo,(0,l.propOr)(r,"label"))(e,t,r))),lo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(ao,(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]})),uo=e=>(0,l.partition)(to,e),co=(0,l.includes)(l.__,["and","or","not"]),po=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),yo=(0,l.includes)(l.__,["equals","notEquals","in"]),fo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return co(t)?fo(r):po(t)?r.filter(Xe):yo(t)?r.map((0,l.prop)("uri")).filter(Xe):[]})),l.uniq),To=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(fo),l.uniq),Eo=(0,l.pipe)(ao,To),mo=(0,l.pipe)(lo,To),ho=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},bo=(0,l.pipe)(ho,ka),Oo=(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||ci(e,n,t)})(e,t))})(e,t)),go=e=>!!e.required,vo=(e,t,r)=>{const n=(0,l.cond)([[Xe,li(e)],[ze,Ei(e)]])(t);return _o(e,n,r)},_o=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&Xe(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!wn(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===vt.TYPE_REFERENCE){const n=Tn(t),a=En(t);i=vo(e,n,r).filter((e=>a.some(Ze(e.uri))))}else t.attributes&&(i=_o(e,t,r));i&&n.push(...i)}return n})):t.type===vt.TYPE_REFERENCE?vo(e,Tn(t),r):[],No=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),go]),e.attributes||[])},Ao=(e,t)=>{const r=bn(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},Ro=(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)?wt().text(n):n};return r(null,t)})),Po=["label","description","abbreviation","caption","toolTip"],wo=e=>Ro(Po,e),So=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=tt(t);return r.find((e=>{let{uri:t}=e;return tt(t)===n}))})),Io=(0,l.curry)(((e,t)=>{const r=tt(t);return(0,l.pipe)(So(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Uo=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"})},Co=(0,l.curry)(((e,t)=>{let{roles:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),jo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=li(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Do(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 ko=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 z.fromNull(i&&i.length?i:Bn(e,t)).map((t=>t.map((t=>{const i=ko(e,t,r,n);return i.length?Do({},t,{children:i}):t})))).orSome([]).filter((0,l.either)((0,l.complement)(Fn),(0,l.prop)("children"))).filter(Ji).filter(r).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ko(e,t,r,["attributes","analyticsAttributes"])},xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ko(e,t,r,["attributes"])},Mo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ko(e,t,r,["analyticsAttributes"])},Vo=(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)})),$o=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return tt(r)===e})))),Go=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),$o("LUD")),(0,l.defaultTo)(r))(t||[])},Wo=(e,t)=>{let{survivorshipStrategies:r}=e;return $o(t,r)},Yo=(0,l.allPass)([(0,l.complement)(l.isNil),Ai(_i.READ)]),Bo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ai(_i.READ)]),qo=(0,l.curryN)(2,(0,l.pipe)(li,Bo)),Ko=e=>{let{ov:t}=e;return!1!==t},Ho=(e,t)=>((e,t)=>ri(e.type)&&ie(t))(e,t)||((e,t)=>ni(e.type)&&ae(t))(e,t),Jo=(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))),Qo=Jo("refEntity"),Xo=Jo("refRelation"),zo=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Zo=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},es=(0,l.prop)("objectURI"),ts=(0,l.prop)("objectURI"),rs=(0,l.prop)("type"),ns=(0,l.pipe)(Qo,(0,l.defaultTo)({}),es),is=(0,l.pipe)(Xo,(0,l.defaultTo)({}),ts),as=(0,l.pipe)(Qo,(0,l.defaultTo)({}),rs),os=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},ss=(0,l.evolve)({refEntity:te,refRelation:te}),ls=(e,t,r,n)=>{const i=Wn(e,r),a=li(e,t.type)||Ei(e,t.type);if(0===i.length)return null;const o=Un(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(!vn(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=>Tn(e)===r.uri||fn(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},us=(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?us(a.value,o):a},cs=(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 us(e[r],i)})),ps=(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")]]),ds=(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)(ps),(0,l.when)((()=>i.length>0),(0,l.map)(ds(e,i))))(r)})),ys=ds(null),fs=ds(Ko),Ts=(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=cs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Es=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ns,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{});function ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hs(e,t,r[t])}))}return e}function hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bs=e=>{let{parentUri:t,attributeType:r}=e;return ms({uri:Ye(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[Fn,(0,l.always)({value:{}})],[Vn,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},Os=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ca(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),$n,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=bs({parentUri:r,attributeType:e});let s=Bn(n,e);s&&(e.type===vt.TYPE_REFERENCE&&(s=gn(s)),a.value=Os({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!$n(e)||(o[t]=[a])}return o},gs=e=>{let{entity:t,metadata:r}=e;return vo(r,t.type,!0).filter($n).reduce(((e,t)=>{const n=t.name,i=lt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:ls(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:_s({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},vs=(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?ms({},e,{value:vs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return ms({},s(t),Os({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),_s=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=bs({parentUri:n,attributeType:r}),u=ps(l);return(0,xe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ns=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,xe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,n.uri,ps(n),a,o,i)}))},As=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,xe.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},Rs=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,xe.ZP)(t,(e=>{Ie(e.attributes||e.value,r,n,i)}))},Ps=(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"))),ws=(0,l.reject)(Ps),Ss=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=>Ss({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),ws)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Is=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ss({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),ss),deleteEmptyComplex:e})},Us=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Is(e),(0,l.reject)(l.isEmpty))},Cs=Object.values(Ut),js=(0,l.includes)(l.__,Cs),Ds=e=>Cs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Ls(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 Fs=(e,t)=>`${e}_${t}`,xs=[Vt.matches.name,Vt.matchRules.name],Ms=(0,l.values)(jt).map((e=>e.name)),Vs=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ms)))),$s=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,xs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Fs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Gs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Vs(r),$s(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Fs(`dtPotentialMatches.${t.name}`,"")))))(Vt)},Ws=(0,l.propEq)("uri",Vt.type.uri),Ys=e=>(0,l.values)(Mt).some((0,l.propEq)("uri",e.uri)),Bs=(0,l.propEq)("uri",xt.sourceSystems.uri),qs=Object.values(Ct),Ks=(0,l.includes)(l.__,qs),Hs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ls({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Js=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 Ls({},t,{[r.uri]:n})},Xs=(0,l.propEq)("uri",Ct.roles.uri),zs=(0,l.propEq)("uri",Ct.tags.uri),Zs=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)},el="UrlThumbnail",tl="CdnUrlThumbnail",rl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ko):(0,l.head)(n);return e&&e.value}return null})),nl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>rl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),il=nl(["CdnUrl","Url"],!0),al=nl(["CdnUrlPreview","UrlPreview"],!0),ol=nl([tl,el],!0),sl=nl([tl,el]),ll=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[In,(0,l.always)(t)],[(0,l.both)(Sn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=In(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(js(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),re)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},ul=(e,t,r)=>{const n=Da(e),i=(0,l.any)(r?l.T:Ko);return ll(n,t,i)},cl=(e,t,r,n,i,a)=>{const o=Be(null==r?void 0:r.uri)?Ca(t,e):ja(t,e);return ll(o,r,((e,o)=>{const s=Yi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ko,e)||In(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let pl;const dl=e=>{pl=e};function yl(e,t){return pl(e,t)}const fl=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)})),Tl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return yl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},El=(0,l.once)((()=>yl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),ml=e=>yl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),hl=(e,t)=>yl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),bl=e=>z.fromNull(Tt[e]).map(wt().text).orSome(""),Ol=(0,l.curry)(((e,t)=>`${e}_${t}`)),gl=(0,l.split)("_"),vl=(0,l.includes)("_"),_l=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Nl=(0,l.curry)(((e,t)=>e.some(_l(t)))),Al=Nl([ct.IN_RANGE,ct.COUNT_RANGE,ct.WITHIN]),Rl=Nl([ct.EXISTS,ct.MISSING_VALUE]),Pl=(0,l.cond)([[Rl,(0,l.always)(0)],[Al,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),wl=(0,l.complement)(Rl),Sl=Nl([ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS]),Il=Nl([ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE]),Ul=Nl([ct.IN_FILE,ct.NOT_IN_FILE]),Cl=e=>{switch(e){case ct.COUNT_EQUALS:return ct.EQUALS;case ct.COUNT_NOT_EQUALS:return ct.NOT_EQUALS;case ct.COUNT_LT:return ct.LT;case ct.COUNT_LTE:return ct.LTE;case ct.COUNT_GT:return ct.GT;case ct.COUNT_GTE:return ct.GTE;case ct.COUNT_RANGE:return ct.IN_RANGE}},jl=Nl([ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS]),Dl=Nl([ct.WITHIN]),Ll=[[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE],[ct.NOT_IN_FILE,ct.IN_FILE],[ct.EQUALS,ct.NOT_EQUALS,ct.HAS_ALL],[ct.LT,ct.LTE,ct.GT,ct.GTE],[ct.MISSING_VALUE,ct.EXISTS],[ct.COUNT_RANGE],[ct.IN_RANGE],[ct.STARTS_WITH,ct.CONTAINS],[ct.FULL_TEXT],[ct.ON,ct.BEFORE,ct.AFTER,ct.NOT_EQUALS],[ct.WITHIN]],kl=(e,t)=>Ll.some((r=>r.includes(e)&&r.includes(t))),Fl=(0,l.pipe)(l.omit,l.values),xl={OPTIONS_FOR_STRING:Fl(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_DATE:[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS,ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.IN_FILE,ct.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Fl(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_BLOB:Fl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_NUMBER:Fl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_LOOKUP:Fl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ct),OPTIONS_FOR_ENUM:Fl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_ID:[ct.EQUALS,ct.NOT_EQUALS,ct.IN_FILE,ct.NOT_IN_FILE],OPTIONS_FOR_COUNT:[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],OPTIONS_FOR_COMPLEX:[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.EXISTS,ct.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[ct.EQUALS,ct.NOT_EQUALS,ct.EXISTS,ct.MISSING_VALUE]},Ml=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 xl.OPTIONS_FOR_STRING;case vt.TYPE_LOOKUP:case vt.TYPE_DEPENDENT_LOOKUP:return xl.OPTIONS_FOR_LOOKUP;case vt.TYPE_ENUM:return xl.OPTIONS_FOR_ENUM;case vt.TYPE_DATE:case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_TIMESTAMP:case vt.TYPE_LOCAL_DATE:return xl.OPTIONS_FOR_DATE;case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:return xl.OPTIONS_FOR_BOOLEAN;case vt.TYPE_BLOB:return xl.OPTIONS_FOR_BLOB;case vt.TYPE_LONG:case vt.TYPE_INT:case vt.TYPE_FLOAT:case vt.TYPE_DOUBLE:case vt.TYPE_NUMBER:return xl.OPTIONS_FOR_NUMBER;case vt.TYPE_ENTITY_ID:return xl.OPTIONS_FOR_ID;case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ct.EQUALS];case vt.TYPE_COUNT:return xl.OPTIONS_FOR_COUNT;case vt.TYPE_NESTED:case vt.TYPE_REFERENCE:case vt.TYPE_IMAGE:return xl.OPTIONS_FOR_COMPLEX;default:return xl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Il,n):n},Vl=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=t.length>0?`${t} ${r}`:r;return n===this.clauses.length-1?i:`${i} ${(0,l.propOr)("and",n,e)}`}),"")}},$l=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Gl=e=>Array.isArray(e)?e.map(Gl).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Wl=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Yl=e=>`'${e}'`,Bl=e=>`"${e}"`,ql=(0,l.pipe)(Gl,Wl),Kl=(0,l.pipe)(ql,Yl),Hl=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Al(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Jl=(e,t)=>Il(t)?{type:vt.TYPE_INT}:Ul(t)?{type:vt.TYPE_FILE}:jl(t)&&!Dl(t)&&Jn(e.type)?{type:vt.TYPE_LOCAL_DATE}:e,Ql=Object.values(Ot),Xl=e=>Ql.includes(e),zl=e=>wt().text(gt[e]),Zl=e=>{const t=f()();switch(e){case Ot.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Ot.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case Ot.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Ot.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Ot.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function eu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tu(e,t,r[t])}))}return e}function tu(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())),nu=(0,l.curry)(((e,t,r)=>{const n=r.map(Al(e)||t.endsWith(".count")?ql:Kl).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),iu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},au=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Pl(t);return(0,l.pipe)(iu(i),(0,l.map)(nu(t,r)),ru(" or "))(n)},ou=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Kl).join(",")})`},su=e=>`*${e}*`,lu=e=>`URL:${e}`,uu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,cu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ct.IN_FILE?r:`not ${r}`},pu=(e,t)=>[R(e,t),P(e,t)],du=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!yu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ct.ON:return eu({},e,n?{filter:ct.EQUALS}:{filter:ct.IN_RANGE,values:[pu(i,n)]});case ct.BEFORE:return eu({},e,{filter:ct.LTE,values:[[P(i,n)]]});case ct.AFTER:return eu({},e,{filter:ct.GTE,values:[[R(i,n)]]});case ct.WITHIN:return eu({},e,{filter:ct.IN_RANGE,values:[Zl(i)]})}}return e}),au),yu=(0,l.propSatisfies)(Jn,"type"),fu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",ct.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(au({filter:ct.EQUALS,fieldName:t,values:[r]}))),new Vl).build())),ru(" or "))(r)}],[(0,l.propEq)("filter",ct.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return au({fieldName:r,filter:t,values:n.map((0,l.pipe)(Gl,su))})}],[(0,l.propEq)("filter",ct.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?au(eu({},e,{values:(0,l.flatten)(r)})):uu(r)?ou(eu({},e,{filter:"listEquals"})):au(e)}],[(0,l.propEq)("filter",ct.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Pl(t);return(0,l.pipe)(iu(i),(0,l.map)(nu(t,r)),ru(" and "))(n)})(eu({},e,{values:(0,l.flatten)(e.values)})):yu(e)?(e=>{const{values:t}=e,r=!yu(e),[n]=t;return(new Vl).addClause(au(eu({},e,{filter:ct.LT,values:[R(n,r)]}))).addClause(au(eu({},e,{filter:ct.GT,values:[P(n,r)]}))).orBuild()})(e):uu(t)?ou(eu({},e,{filter:"not listEquals"})):au(e)}],[(0,l.propSatisfies)(Ul,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return au({fieldName:r,filter:cu(t,r),values:n.map((0,l.prop)("link")).map(lu)})}],[(0,l.propSatisfies)(Il,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return au({fieldName:`${r}.count`,values:n,filter:Cl(t)})}],[(0,l.propSatisfies)(jl,"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 nu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return nu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,au]],Tu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!wl(e)||mu(r))},Eu=e=>Array.isArray(e)?mu(e):null!=e&&Gl(e).length>0,mu=e=>e&&e.length>0&&e.every(Eu);function hu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Ou=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),gu=(e,t,r)=>"children"===e?_u(r,[...t][0],!0):r,vu=(e,t,r)=>"values"===e?[...r,...t]:r,_u=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)(gu,t),e);if(!r&&Sl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(vu,t),e)}return(0,l.append)(t,e)},Nu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=bu(e),r=e=>e.fieldName===t?e:r({fieldName:Ou(e),children:[e]});return r(e)})(t);return _u(e,r)}),[]),Au=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")),Ru=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function r(n){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n.reduce(((n,a)=>n.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:n}=e;return i&&Au(n)&&!t?`inSameAttributeValue(${r(n,!1)})`:r(n,i)}],...e])(a))),new Vl).buildWithOperators(n.map((0,l.prop)("operator")))}},Pu=(0,l.pipe)((0,l.propOr)("","filter"),vl),wu=(0,l.map)((0,l.when)(Pu,(e=>{const[t,r]=gl(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){hu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Su=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)(Tu),wu,Nu,Ru([...e,...fu],t))},Iu=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Uu=[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS],Cu=[ct.EQUALS,ct.NOT_EQUALS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.FULL_TEXT,ct.EXISTS],ju=[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],Du=(e,t)=>{const r=Pn(e);return(e=>{switch(e){case Ut.startDate.name:case Ut.endDate.name:case jt.dueDate.name:case kt.createdTime.name:case kt.updatedTime.name:case xt.reltioLoadDate.name:case xt.createDate.name:case xt.updateDate.name:case xt.deleteDate.name:case xt.publishDate.name:return Uu;case Ft.matches.name:case xt.count.name:return ju;case jt.workflow.name:case jt.assignee.name:case jt.step.name:case Dt.commenter.name:case kt.createdBy.name:case kt.updatedBy.name:case xt.sourceSystems.name:case xt.value.name:return Cu;default:return null}})(t)||Ml(r)},Lu=[ct.EQUALS,ct.NOT_EQUALS,ct.CONTAINS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.IN_RANGE,ct.WITHIN,ct.EXISTS,ct.ON],ku=(0,l.pipe)(Du,(0,l.filter)((0,l.includes)(l.__,Lu))),Fu=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),xu=e=>{let{query:t,body:r}=e;return t=Fu(t),yl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Mu=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)(Su(),Iu(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Bt(i)}`},Vu=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=Mu(e,t,r);return yl(n)},$u=(0,l.pipe)((0,l.reject)(l.isNil),Yt),Gu=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(Su(),Iu(i))(r),c=$u({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return xu({query:c,body:p})},Wu=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Gu({fieldName:t,searchParams:i,options:n})},Yu="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Bu=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)(Su(),Iu(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Yu,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Bt(i)}`},qu=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=Bu(e,t,r);return yl(n)},Ku=e=>yl(`/${e}?select=secondaryLabel`),Hu=(e,t)=>{const{select:r=Yu,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),yl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Ju=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Be)),Qu=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=Ju(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=xn(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)(Su(),Iu(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),yl(`${s}/api/${o}/${t}/_object`,m)},Xu=e=>`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,zu=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Zu=e=>yl(Xu(e)),ec=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 yl(n,r)},tc=e=>yl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),rc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return yl(`/entities/_events/_total${Yt({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},nc=(e,t)=>yl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),ic=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return yl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},ac=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return yl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},oc=e=>{const t=new FormData;return t.append("file",e),yl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ce(e,wt().text("Can't upload file"));return Promise.reject(t)}))},sc=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return yl(`/personal/findSavedSearches${Yt({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"}})},lc=e=>yl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),uc=e=>yl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),cc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return yl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},pc=e=>{let{uri:t}=e;return yl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},dc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),cc)(e),yc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),cc)(e);function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tc=["max","offset","filter"],Ec=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Ec(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){fc(e,t,r[t])}))}return e}({},t,(0,l.pick)(Tc,e)))),mc=(0,l.omit)(["activeness"]),hc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],ir.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],ir.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Ec(e),(0,l.omit)(Tc))(e))),mc))(t),{url:`/${e}/_connections${Bt({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})),Oc=(0,l.reject)(l.isNil),gc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),vc=e=>yl(gc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),_c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,gc);return yl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Nc=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?Us()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Oc,re,JSON.stringify);return yl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Ac=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"),gc,n),o=he(i(t),i(r)).concat(Oe(t,r));return yl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Rc=(e,t)=>{const{url:r,options:n}=hc(e,t);return yl(r,n).then(bc)},Pc=(e,t)=>yl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),wc=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Rt.IN?a.inRelations=[n]:a.outRelations=[n],yl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Sc=(e,t)=>yl(`/recentSearches/?environment=${e}&tenant=${t}`,{method:"GET",application:"explorer",headers:{"Content-Type":"application/json"}}),Ic=e=>yl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Uc=e=>{let{environment:t,tenant:r,createdDate:n}=e;return yl(`/recentSearches?environment=${t}&tenant=${r}&createdDate=${n}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Cc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jc(e,t,r[t])}))}return e}function jc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dc={select:"label,secondaryLabel,name,type,startDate,endDate"},Lc=(0,l.reject)(l.isNil),kc=(0,l.pipe)(Lc,Yt),Fc=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Cc({},Dc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return yl(`/${t}/_tree${kc(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xc=e=>{let{uri:t,graphUri:r}=e;const n=Cc({},Dc,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return yl(`/${t}/_parents${kc(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Mc=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1}=e;const o=Cc({},Dc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},{filterLastLevel:i,deep:a});return yl(`/${t}/_hops${kc(o)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Vc(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 $c=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Gc="/activities",Wc=e=>{let{label:t,description:r}=e;return yl(Gc,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:$c()}})},Yc=e=>{const t=Bt(e);return yl(Gc+t,{method:"GET"})},Bc=e=>yl(`/activities/_total${Bt(e)}`,{method:"GET"}),qc=e=>{const{entityUri:t}=e,r=Vc(e,["entityUri"]);return yl(`/${t}/_activities${Bt(r)}`,{method:"GET"})},Kc=e=>{const{entityUri:t}=e,r=Vc(e,["entityUri"]);return yl(`/${t}/_activities/_total${Bt(r)}`,{method:"GET"})};function Hc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jc(e,t,r[t])}))}return e}function Jc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qc=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Xc=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return yl(Qc({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},zc=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=Qc({url:r,workflowPath:t,tenant:n})),yl(s,{method:i||"GET",body:JSON.stringify(a),headers:Hc({"Content-Type":"application/json"},null!=o?o:{})})},Zc=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=Qc({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return yl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},ep=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=Qc({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Hc({},l,{comment:o}):l;return yl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},tp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=Qc({url:`/tasks${s?Bt(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Hc({objectURIs:[i]},(0,l.reject)(E,a)))};return yl(u,Hc({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},rp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i}=e;const a={assignee:i};return yl(Qc({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},np=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i}=e;return yl(Qc({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:JSON.stringify(i)})},ip=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return yl(Qc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},ap=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return yl(Qc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},op=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},sp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return yl(Qc({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return ap({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},pp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return yl(Qc({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},dp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return yl(Qc({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},yp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ko);return a&&a[0]&&(r=n.length>0&&a[0].value?yp(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}}),""),fp=(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=yp(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},Tp=/[,\s]*$/,Ep=e=>{const t=wt().text(At);if(!e)return t;const r=e.replace(Tp,"");return""===r.toString().trim()?t:r},mp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},hp=(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=mp(e,r.referencedEntityTypeURI);if(n)return fp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return fp({attributes:t||{}},r.dataLabelPattern);return""},bp=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Op=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},gp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",vp=(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"))),_p=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),vp),Np=(e,t,r)=>{const n=_p(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(cs(e),vp)))(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")])})(li(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ls(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,vp))(r)})(e,r)||fi(e,r.type);return gp(t,n)};var Ap=void 0;const Rp={50:"#E0233A",80:"#F5A623",100:"#62A61B"},Pp=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return r.map((r=>{r="/"===r[0]?r:"/"+r;const n=t.type+r+"/analyticsAttributes/score",i=t.type+r+"/analyticsAttributes/updatedDate",a=Yn(e,n);return{label:a&&(a.label||a.name),uri:n,value:a&&wp(e,t,n)||"-",updatedDate:a&&wp(e,t,i)||0}}),Ap).filter((e=>null!=e.label&&("-"===e.value||e.value>=0&&e.value<=100)))},wp=(e,t,r)=>{const n=ls(e,t,r);return n&&n[0]&&n[0].value},Sp=(e,t,r)=>{const n=r&&r[e]||Rp,i=Object.keys(n).map((e=>({value:+e,color:n[e]}))).filter((e=>!isNaN(e.value))).sort(((e,t)=>e.value-t.value)).map(((e,t,r)=>({start:0===t?0:r[t-1].value,end:e.value,color:e.color}))).find((e=>t>=e.start&&t<=e.end));return i&&i.color||"#666666"};function Ip(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cp=(0,l.replace)(new RegExp("^entities/"),""),jp=e=>"DTSS/"+e.dataTenant+"/"+e.uri,Dp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Lp=e=>!(!e||!e.dataTenant),kp=(0,l.ifElse)(Lp,jp,(0,l.prop)("uri")),Fp=e=>e&&e.uri?e.dataTenant?jp(e):Cp(e.uri):"",xp=(0,l.curry)(((e,t,r)=>(li(t,r.type)||{})[e]||"")),Mp=xp("label"),Vp=xp("typeGraphIcon"),$p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=li(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(Ko)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:hp(e,o,i),uri:a.uri}})).filter(l.identity):[]},Gp=(0,l.pipe)($p,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Wp=(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=Wp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Wp(e.slice(1),r)}})),Yp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Bp=e=>(0,l.propOr)([],"matchRules",e),qp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Ip({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Kp=(e,t,r)=>t&&r?r.aEntity:e,Hp=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 yl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Yt)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Jp=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return yl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Qp=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return yl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Xp=(e,t,r)=>Promise.all(t.map((async t=>{await yl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),zp=async(e,t)=>await Xp(e,t,"NOT"),Zp=async(e,t)=>await Xp(e,t,"MATCH"),ed=async(e,t)=>await Promise.all(t.map((async t=>{await yl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function td(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 nd(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 id=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return yl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},ad=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Nd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},od=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Nd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},sd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return yl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},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 sd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},ud=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Lp,i);return Promise.all([s.length?Qp(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return sd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},cd=(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=nd(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)}),[])),pd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),cd),dd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return yl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(pd)},yd=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=yd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return yl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(pd)})),Td=yd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return yl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Ed=(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)}},md=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return yl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},hd=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 md(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},bd=hd("NOT"),Od=hd("MATCH"),gd=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Lp,a);return Promise.all([Xp(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return md(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},vd=gd("NOT"),_d=gd("MATCH");function Nd(e){let{requestProvider:t=yl,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,td({},nd(s,["headers"]),{headers:td({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Ad=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Nd({url:Bu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Rd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Nd({url:Mu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Pd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=hc(t,r);return Nd({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)))}))))},wd=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Nd({url:`${zu(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Sd=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return yl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Id=()=>yl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function Ud(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cd(e,t,r[t])}))}return e}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jd=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Ud({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return yl(`${t}/api/${r}/graph/search${Bt({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Dd=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return yl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Ud({},n,i),headers:{"Content-Type":"application/json"}})},Ld=(e,t)=>`${e}/${t}/comments`,kd=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return yl(`${Ld(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Fd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return yl(`${Ld(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return yl(Ld(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Md=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return yl(`${Ld(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Vd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return yl(`${Ld(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},$d=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return yl(`${Ld(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Gd=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Bt({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return yl(`${Ld(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Wd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yd(e,t,r[t])}))}return e}function Yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bd=(e,t)=>{const[r]=e.split("/ui/");return`${r}/services${t.startsWith("/")?t:`/${t}`}`},qd=(e,t)=>{const r=Yt({url:"/oauth/users/tenant/{0}",params:e});return yl(Bd(t,`oauth/proxy${r}`),{method:"GET",headers:{"Content-Type":"application/json"}})},Kd="graphExport",Hd=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await zd({uiPath:e,tenant:t,environment:r,namespace:Kd,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Wd({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await zd({uiPath:e,tenant:t,environment:r,namespace:Kd,options:Wd({method:"PUT"},o)})}catch(e){s=null}return s||(s=await zd({uiPath:e,tenant:t,environment:r,namespace:Kd,options:Wd({method:"POST"},o)})),s},Jd=(e,t)=>yl(Bd(e,`/settings?key=${t}`),{method:"GET",headers:{"Content-Type":"application/json"}}),Qd=e=>yl(Bd(e,"/version/collect"),{method:"POST",headers:{"Content-Type":"application/json"}}),Xd=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return yl(`${n}/plugins${Bt({tenant:t,user:r})}`,{method:"GET"})},zd=e=>{let{tenant:t,environment:r,uiPath:n,options:i,namespace:a}=e;const o=`/configService${Bt({tenant:t,environment:r,namespace:a})}`;return yl(Bd(n,o),i)},Zd=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),yl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},ey=e=>yl(`/${e}?showObjectsInfo=true`,{method:"GET"}),ty=e=>{let{exportPath:t,options:r}=e;return yl(`${t}/activities${Bt(r)}`,{method:"POST"})};function ry(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ny(e,t,r[t])}))}return e}function ny(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iy=e=>{const{entityUri:t}=e;return yl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},ay=e=>{let{entityUri:t,crosswalk:r}=e;return yl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},oy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return yl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[ry({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),ry({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},sy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return yl(`/${r}/_${n}${Bt({contributorURI:t})}`,{method:"POST"})},ly=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return yl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},uy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return yl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},cy=e=>{let{entityUri:t,crosswalkId:r}=e;return yl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},py=e=>{let{entityTypeUri:t}=e;return yl(`/dataQuality/fillRates${Yt({entityType:tt(t)})}`,{method:"GET"})},dy=e=>{let{entityTypeUri:t,attributeFieldName:r}=e;return yl(`/dataQuality/statistic${Yt({entityType:tt(t),attribute:r})}`,{method:"GET"})},yy=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n}=e;return yl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${tt(n)}`,{method:"GET"})},fy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return yl(`/${t}${Bt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Ty=e=>{let{attributeUri:t,value:r}=e;return yl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Ey=e=>{let{attributeUri:t,value:r}=e;return yl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},my=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return yl(`/${t}${Bt({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=Bt({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Us()([[{value:a}]]);return yl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},by=e=>{let{entityUri:t,attributeName:r,value:n}=e;return yl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Oy=e=>{let{entityUri:t,attributeName:r}=e;return yl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function gy(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{entityUri:t}=e;return yl(`/${t}/_historicURIs`,{method:"GET"})},_y=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return yl(`/${t}/_changesWithTotal${Bt(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){gy(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Ny=(e,t)=>yl(`/${e}/_previousChange${Bt({timestamp:t})}`,{method:"GET"}),Ay=(e,t)=>yl(`/${e}${Bt({time:t})}`,{method:"GET"});function Ry(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Py(e,t,r[t])}))}return e}function Py(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wy=e=>{let{url:t,method:r,data:n,headers:i}=e;return yl(t,Ry({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:Ry({"Content-Type":"application/json"},null!=i?i:{})}))},Sy=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Bt({options:a.join(","),severity:o.join(",")});return yl(`${t}/validate/${i}/entity/${Fp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Iy=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return yl(`${t}/validate/${n}/entity${Bt({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Uy=e=>{let{tenant:t,apiPath:r}=e;return yl(`${r}/tenants/${t}/name`,{method:"GET"})};var Cy=r(47485);const jy=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=qe(),s={attributes:Os({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=ls(r,e,n.uri)[0];return i&&i.value?As({entity:e,attributeType:n,uri:i.uri,value:t}):_s({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Dy=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ns),(0,l.filter)(Be),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),Ly=(0,l.curry)(((e,t)=>{const r=Dy(e=e||{},t=t||{});return r.concat((0,l.chain)(Ly(e),r))})),ky=(0,l.curry)(((e,t)=>(0,l.pipe)(ue,(0,l.filter)(e))(t))),Fy=ky((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),xy=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Be)),My=e=>(0,l.pipe)(Fy,xy(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Vy=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Fy,(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})),$y=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Be),(0,l.omit)(["uri","timestamp"])),Gy=(0,l.pipe)($y,(0,l.evolve)({attributes:Us(!0)})),Wy=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=My(i);if(a.length>0)for(const t of a)e=Vy(t,r[t].uri,e);const o=(s=await ec(Gy(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},Yy=async(e,t,r)=>{const n=qy(e,t),i={};for(const t of n)i[t]=await Wy(e,t,i,r);return i},By=(0,l.curry)(((e,t)=>{const r=Cy.Node(t);return My(e[t]).forEach((t=>{const n=By(e,t);r.addEdge(n)})),r})),qy=(e,t)=>(0,l.pipe)((0,l.map)(By(e)),(0,l.map)(Cy.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Ky=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)($y))})),Hy=(e,t)=>{const r=_e(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=be(e,t),a=Oe(e,t);return[...ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),ve((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},Jy=(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 Vy(r,n,e)}),e))))}),t)}),Ky),Qy=(0,l.curry)(((e,t)=>(0,l.when)(Be,(0,l.propOr)(l.__,t,e),t)));function Xy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zy(e,t,r[t])}))}return e}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{parentUri:t,relation:r,entityUri:n}=e;return{type:yr.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},ef=e=>{let{relationUri:t}=e;return{type:yr.DELETE_RELATION,parameters:{relationUri:t}}},tf=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:yr.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},rf=e=>{let{oldRelation:t,newRelation:r}=e;return{type:yr.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},nf=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:yr.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},af=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),of=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case yr.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Nc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case yr.DELETE_RELATION:return()=>{const{relationUri:e}=r;return _c(e,i).then(o)};case yr.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return wc(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case yr.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Ac({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case yr.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[ef({relationUri:o}),Zy({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(sf(n)),(0,l.map)(of),af)(s)}}},sf=e=>t=>Xy({dcrProcessor:e},t),lf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=qt({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(sf(r)),(0,l.map)(of),af,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},uf=e=>t=>(0,l.map)((t=>Xy({},t,{parameters:(0,l.evolve)({parentUri:Qy(e),entityUri:Qy(e),newEntityUri:Qy(e)},t.parameters)})),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){pf(e,t,r[t])}))}return e}function pf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const df=e=>cf({},(0,l.path)(vf(),e),{startDate:(0,l.path)(Rf(),e),endDate:(0,l.path)(Pf(),e)}),yf=(e,t)=>(0,l.pipe)((0,l.path)(Af()),Qy(t))(e),ff=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=yf(e,r),i=(0,l.path)(_f(),e)===fr.IN,a=e.parentEntityUri||n;return Zy({parentUri:i?t:a,relation:df(e),entityUri:i?a:t})})),...o.map((t=>{const i=yf(t,r),a=(0,l.path)(_f(),t)===fr.IN,o=i!==(0,l.pipe)((0,l.path)(vf()),a?wf:Sf)(t),s=Cf(e,(0,l.path)(Of(),t)),u=t.parentEntityUri||n,c=Qy(r,i);return o?nf({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(vf(),t),isReversed:!1}):rf({oldRelation:(0,l.path)(vf(),s),newRelation:df(t)})})),...i.map((e=>ef({relationUri:e}))),...s.map((e=>tf({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},Tf=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;return cf({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType}})}),{}),Ef=(e,t)=>(0,l.pipe)(Ei,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Cs),Ia)(e,t),mf=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)}},hf=(e,t,r)=>{const n=fp(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)},bf="relation",Of=(0,l.always)([bf,"relationUri"]),gf=(0,l.always)([bf,"relationType"]),vf=(0,l.always)([bf,"object"]),_f=(0,l.always)([bf,"direction"]),Nf=(0,l.always)([bf,"object","attributes"]),Af=(0,l.always)(["entity","entityUri"]),Rf=(0,l.always)([bf,"startDate"]),Pf=(0,l.always)([bf,"endDate"]),wf=(0,l.path)(["startObject","objectURI"]),Sf=(0,l.path)(["endObject","objectURI"]),If=(0,l.path)(["startObject","objectTypeURI"]),Uf=(0,l.path)(["endObject","objectTypeURI"]),Cf=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Of()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Cf(r.connections,t);if(e)return e}}},jf=(0,l.pipe)(Cf,(0,l.path)(vf())),Df=(0,l.allPass)([(0,l.pipe)((0,l.path)(Af()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(gf()),(0,l.complement)(E))]),Lf=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Ke()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=xf({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=kf(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?mf(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},kf=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:Rt.IN}:{type:t[0],direction:Rt.OUT}:null},Ff=e=>e.uri||e,xf=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Pi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Rt.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"],li(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],li(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Ff,Ei(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Rt.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Rt.OUT)),(0,l.map)(u))},t)||{}};function Mf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vf(e,t,r[t])}))}return e}function Vf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $f=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Mf({},t,{[r]:{parents:n,children:i}})},Gf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Mf({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},Wf=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=Dy(t,i),o=$f({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>Wf(n.uri,t,[e],r)),o)},Yf=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)(Of(),n),a=t?Gf({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Af(),n),s=Be(o)?[o]:[],u=$f({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>Wf(t,r,[i],e)),u)}),n)},Bf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Yf(r,e,t,Wf(e,t))},qf=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return Bf(t,r,n);if(Je(e)){const t=Cf(n,e);return t&&Yf([t],null,r)}return r[e]?Wf(e,r):void 0},Kf=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>Kf(e,t))))},Hf=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>Hf(e,t))))},Jf=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=He(t),u=Bf(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=Cf(i,c),!s)return null;o.push({type:rr.relationConnection,value:s,valueType:Ei(a,(0,l.path)(gf(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:rr.tempEntity,value:e,valueType:li(a,e.type)});continue}const p=n[u],d=Es(p,c),y=n[c];if(!d||!y)return null;o.push({type:rr.attributeValue,value:d,valueType:Yn(a,it(d.uri,p.type))}),o.push({type:rr.tempEntity,value:y,valueType:li(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},Hf(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?jf(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?Ei(a,d.type):li(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Bn(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,g;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===(g=O[E.name])||void 0===g?void 0:g.find(t),s=i||r;if(!s)return null;i&&o.push({type:rr.tempEntity,value:T,valueType:li(a,T.type)}),o.push({type:rr.attributeValue,value:s,valueType:E}),m=s.value;const l=ns(s);T=l&&Be(l)?n[l]:null}}return o},Qf=e=>e.every((e=>{let{type:t}=e;return[rr.attributeValue,rr.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===rr.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,Xf=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Xf(t.value):[]];return e.concat(r)}),[])),zf=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Zf=e=>{const t=[...Xf((null==e?void 0:e.attributes)||[]),...Xf((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},eT=(e,t)=>[e,...t.map((t=>zf(e,t)))],tT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},rT=(e,t)=>{switch(e){case nr.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case nr.ENTITY_ATTRIBUTE:return(e=>{let{uri:t}=e;return[at(t)]})(t);case nr.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case nr.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},nT=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),iT=(0,l.curry)(((e,t)=>{const r=ho(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(iT(e,r.extendsTypeURI)):n})),aT=(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))),oT=(e,t)=>(0,l.pipe)((0,l.prop)("type"),iT(e),aT(t))(t);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=>{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}},uT=e=>!e.deactivated,cT=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},pT=e=>cT(e)+e.message,dT=(0,l.unless)(l.isNil,(0,l.prop)("message")),yT=(0,l.unless)(l.isNil,(0,l.prop)("type")),fT=(0,l.curry)(((e,t)=>Ze(t.parentUri,e))),TT=(0,l.curry)(((e,t)=>t.parentUri===e)),ET=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Ze(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",vt.TYPE_REFERENCE),(0,l.pipe)(En,(0,l.any)(Ze(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),mT=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),hT=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),bT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([PT,uT,fT(e),ET(t),(0,l.complement)(hT(e,t.uri))]))(r)},OT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([PT,uT,TT(e),mT(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",zt.missed))]))(r);return n&&n.message||""},gT=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===zt.missed))},vT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Of(),e))]))(t)},_T=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},NT=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([uT,fT(t)]))(r)},AT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([uT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},RT=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?Jf(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 rr.attributeValue:{const e=a;if(Dn(a))return fp(o,e.dataLabelPattern);if(Ln(a)){const t=o,i=ns(t),a=fn(e),s=li(n,a);return Be(i)?fp(r[i],s.dataLabelPattern):t.label}return""}case rr.tempEntity:return fp(o,a.dataLabelPattern);case rr.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=li(n,null==e?void 0:e.entityType);return`${Ep(i&&Be(i)?fp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||mi(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){sT(e,t,r[t])}))}return e}({},e,{label:Ep(t)})}))},PT=e=>!e.severity||e.severity===er.ERROR,wT=(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(wT(n))}));case vt.TYPE_REFERENCE:return!!Qo(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}})),ST=(e,t)=>e.every((0,l.complement)(wT(t))),IT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=vo(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ls(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ko(e.parent))))).forEach((e=>{ST(e.attrValues,n)&&r.push(lT({type:zt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:wt().text("Attribute is required"),source:Zt.local}))})),r}),[])},UT=(0,l.curry)(((e,t,r)=>ls(e,t,r,!1))),CT=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),li(e),(0,l.prop)("attributes"),(0,l.reject)(Cn),(0,l.filter)(Ln),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(UT(e,t)));return(0,l.pipe)(r,(0,l.reject)(ns),(0,l.map)((e=>{let{uri:r}=e;return lT({type:zt.missedRefEntity,uri:"",attributeTypeUri:it(r,t.type),parentUri:r,message:wt().text("Entity is required"),source:Zt.local})})))(t)},jT=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ns,Be)).flatMap((n=>{const i=ns(n),a=t[i],o=Yn(e,it(n.uri,r.type));return DT(e,t,o,a)})),DT=(e,t,r,n)=>{const i=En(r),a=i.map((t=>Yn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",vt.TYPE_REFERENCE))).flatMap(hn).concat(i);return LT(e,t,n,(e=>a.some(Ze(e.uri))))},LT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=IT(e,r,n),a=CT(e,r),o=jT(e,t,r);return[...i,...a,...o]},kT=(e,t)=>{const r=(0,l.path)(vf(),t)||{};return IT(e,r)},FT=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Af()),(0,l.ifElse)(Be,(e=>t[e]),(0,l.always)(null)))(r),i=kT(e,r),a=(e=>(0,l.path)(Af(),e)?[]:[lT({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(gf(),e),parentUri:(0,l.path)(Of(),e),message:wt().text("Entity is required"),source:Zt.local})])(r),o=((e,t,r)=>r?LT(e,t,r):[])(e,t,n);return[...i,...a,...o]},xT=e=>(0,l.path)(["entity","uri"],e)?[]:[lT({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:wt().text("Entity is required"),source:Zt.local})],MT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=IT(e,r),i=xT(t);return[...n,...i]};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 $T=(e,t)=>{var r,n;const i=li(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Ka(e)},GT=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),WT=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(GT(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},YT=(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)(is,Be,l.not)]),(e=>{const t=(0,l.pipe)(is,tt)(e);return WT((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(ns,Be),(t=>{const r=ns(t),n=e[r],i=n&&qT(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){VT(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),BT=(e,t,r)=>ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),ve((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)(YT(r,e.type)),(0,l.map)(WT(ut))))})(e))),qT=(e,t)=>(0,l.evolve)({attributes:Ss({valueTransformer:(0,l.pipe)(ss,YT(t),GT(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function KT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HT(e,t,r[t])}))}return e}function HT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JT=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Me,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),QT=e=>(0,l.pipe)((0,l.evolve)({objectUri:JT,objectParentUri:JT}),(e=>{return KT({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?zt.missed:zt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&<(e.objectUri),uri:e.objectUri,source:Zt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),XT=(e,t)=>(0,l.map)((0,l.pipe)(QT,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=RT(t,s),p=null!=c&&c.length?c.slice(0,-1):RT(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Yn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===rr.attributeValue&&(a=e.valueType)}return a})(o,c,e);return KT({},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&&st(i)){const n=(0,l.last)(a),i=n.valueType;if(Ln(i)&&bn(i).includes(o)){const i=ns(n.value),o=i&&Be(i)?t[i]:null;return o?KT({},e,{parentUri:o.uri,path:a.concat({type:rr.tempEntity,value:o,valueType:li(r,o.type),label:""})}):e}}return e}})(t)))(e),zT=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 ZT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eE;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(eE||(eE={}));const tE={},rE={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"]}},nE=(0,l.curry)(((e,t)=>{const r=(e=>{if(!tE[e]){const t=rE[e]||rE.random0;tE[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}({counter:0,granularityCounter:0,idToColor:{}},t)}return tE[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]})),iE=e=>nE(eE.Charts,e);var aE=r(51404),oE=r.n(aE);const sE=Array.from({length:100},((e,t)=>t/100)),lE=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)},uE={},cE=new(oE())({hash:lE,saturation:sE.slice(15,71),lightness:sE.slice(50,90)}),pE=(0,l.curry)(((e,t)=>{const[r,n,i]=e,[a,o,s]=t;return(Math.abs(r-a)<=27||(r+27>=360||a+27>=360)&&Math.abs(r-a-360)<=27)&&Math.abs(n-o)<=.3&&Math.abs(i-s)<=.2})),dE=(0,l.curry)(((e,t,r)=>{t in uE||(uE[t]={});const n=uE[t];r in n||(n[r]=((e,t,r)=>{const n=Object.values(t);let i;for(let t=0,a=r;t<35&&(i=e.hsl(a),n.some(pE(i)));t++,a=String(lE(a)));return i})(e,n,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),yE=dE(cE,"crosswalks"),fE=dE(cE,"sources"),TE=dE(cE,"contributors");function EE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mE(e,t,r[t])}))}return e}function mE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hE=(0,l.has)("items"),bE=e=>0===e,OE=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)},gE=e=>e.reduce(((e,t)=>e+t.width),0),vE=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),_E=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),NE=e=>e.reduce(((e,t)=>e+t.height),0),AE=e=>(0,l.is)(String,e)&&e.includes("%"),RE=e=>Boolean(e.spacer),PE=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),wE=e=>e.items.reduce(((e,t)=>e.concat(hE(t)?wE(t):t)),[]),SE=e=>({id:e.layout}),IE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:SE;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=AE(r.width)?PE(i,r.width):u}return OE(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return OE(n,t,r)},o=(e,t)=>hE(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,hE(s)?n(s.layout):e(s.view)),d=bE(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(hE(s))return o.concat(p(EE({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(EE({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:gE(o),height:vE(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=hE(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=bE(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(hE(i))return r.concat(p(EE({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(EE({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?OE(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?OE(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:_E(i),height:NE(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=bE(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return EE({},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=EE({},e,{width:a}),s=EE({},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(EE({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return EE({},e,{height:NE(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(EE({},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 EE({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=EE({},t,{items:(0,l.reject)(RE,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 wE(f)},UE=(e,t)=>e.filter((e=>t.some((t=>t.id===e.id))));function CE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jE(e,t,r[t])}))}return e}function jE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DE={BarChart:Er.BAR,BarChartGrouped:Er.BAR,BarChartHorizontal:Er.BAR,LineChart:Er.LINE,Map:Er.MAP,Pie:Er.PIE},LE=(e,t)=>ot(e)?rt(e,t):e,kE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=DE[r];return CE({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},FE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return CE({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"]))},xE=(e,t,r)=>{const n=(e=>e&&re(e).map((e=>{const{type:t,value:r}=e;return CE({},e,{value:[Et,mt,ct.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:bt(t),fieldName:r,values:n?re(n):void 0}})))(e);return t&&ot(t)||!r?n:(n||[]).concat((i=r,{filter:ct.EQUALS,fieldName:"type",values:[i]}));var i},ME=["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"],VE={"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:LE(n,r),filters:xE(a,n,r),chartType:Er.BAR,component:mr.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:LE(n,r),filters:xE(a,n,r),chartType:Er.BUBBLE,component:mr.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:mr.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=re(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return CE({id:t,count:o,canRead:u,orderType:s,attributeUri:LE(r,p),filters:xE(a,r,p),component:mr.DashboardFacet,title:i,showOthers:!0},kE(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:LE(n,r),filters:xE(a,n,r),chartType:Er.MAP,component:mr.DashboardFacet,title:i,geoUrl:ME[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 CE({id:t,count:o,canRead:l,attributeUri:LE(n,r),filters:xE(a,n,r),component:mr.DashboardFacet,title:i,geoUrl:s,chartType:Er.MAP,projection:"geoMercator"},kE(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.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:FE(i),component:mr.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:xE(n,null,a),component:mr.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:ct.GTE,fieldName:"matches",values:["1"]}],component:mr.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:mr.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:Er.CLOUD,component:mr.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:Er.TREE,component:mr.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.NotificationInboxFacet,title:n||wt().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.ActivitiesViewFacet,title:n||wt().text("Activity log")}}},$E=e=>({id:e,height:10}),GE=(0,l.pipe)((0,l.map)((e=>{const t=VE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),WE=e=>{if("0.1"===e.version){const t=GE(e.views),r=IE($E,e.layout,{columns:4});return{id:e.id,margin:0,layout:UE(r,t),views:t}}return e},YE=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"),re)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>YE(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function BE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qE(e,t,r[t])}))}return e}function qE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KE=BE({},hr,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),HE=e=>e,JE={[KE.Attributes]:HE,[KE.HierarchyTree]:HE,[KE.HierarchyPaths]:HE,[KE.RelationsTable]:HE,[KE.Relations]:e=>BE({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[KE.SingleAttributeView]:HE,[KE.CustomView]:HE,[KE.TableAttributeView]:HE,[KE.MapView]:HE,[KE.OldTreeView]:e=>BE({},e,{class:hr.HierarchyTree}),[KE.OldMapView]:e=>BE({},e,{class:hr.MapView}),[KE.ImageAttributeView]:HE,[KE.PotentialMatchesView]:HE},QE=(0,l.pipe)((0,l.map)((e=>{const t=JE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),XE=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===hr.MapView?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),zE=e=>{if("0.1"===e.version){const t=QE(e.views),r=IE(XE(t),e.layout,{columns:4});return{id:e.id,layout:UE(r,t),views:t,profileBand:e.profileBand,workflow:e.workflow,maxWidth:e.maxWidth}}return e},ZE=(e,t)=>e.class===t||e["react-class"]===t,em=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(ZE(t,hr.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 ZE(t,hr.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)}},tm=(e,t)=>e.filter((e=>t.some((t=>ZE(e,t))))).map((e=>{let{id:t}=e;return t})),rm=(e,t)=>{let{extensions:r}=e;return r.find((e=>e.id===t))};function nm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){im(e,t,r[t])}))}return e}function im(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const am=(e,t)=>YE(t).map((t=>(0,l.pipe)((0,l.map)((e=>rm(e,t))),(0,l.reject)(l.isNil),l.head)(e))),om=(e,t)=>{if("scroll"===t.layout.layout){const r=am(e,t.layout),n=WE(nm({},t,{views:r,version:"0.1"}));return{class:Or.Dashboard,views:n.views,layout:n.layout}}return{class:Or.Dashboard,views:t.views,layout:t.layout}},sm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.DQDashboard,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},lm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.RelationshipSearch,options:r.options,scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp}},um=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Interactions,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},cm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Relationships,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},pm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Sources,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},dm=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.PotentialMatches,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},ym=(e,t)=>{const r=am(e,t.layout)[0];return{class:Or.Search,scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead}},fm=()=>({class:Or.Graph}),Tm=()=>({class:Or.ProfileActivityLog}),Em=e=>t=>!!(0,l.intersection)(e,t).length,mm=(0,l.cond)([[Em(["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"]),()=>om],[Em(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>sm],[Em(["com.reltio.plugins.graph.GraphView"]),()=>fm],[Em(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>lm],[Em(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>um],[Em(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>cm],[Em(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>pm],[Em(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>dm],[Em(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>ym],[Em(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Tm],[l.T,()=>(0,l.always)(void 0)]]),hm=(e,t)=>{const r=(e=>e.perspective?e.perspective:"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]?e.id:void 0)(e);if((0,l.isNil)(r))return;const n=(0,l.pipe)((0,l.map)((e=>rm(e,r))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(n))return;const i=YE(n.layout),a=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return t.filter((e=>i.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return n["entity-type"]?((e,t)=>{if("scroll"===t.layout.layout){const r=am(e,t.layout),n=zE(nm({},t,{views:r,version:"0.1"}));return{class:Or.Profile,views:n.views,layout:n.layout}}return{class:Or.Profile,views:t.views,layout:t.layout}})(t,n):mm(a)(t,n)},bm=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))},Om=e=>(0,l.pipe)((0,l.chain)(bm),(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.map)((e=>({label:e.label,icon:e.icon,screen:hm(e,t)}))))(t))(t,e);return{label:t.label,icon:t.icon,menu:r.length?{type:"side",items:r}:void 0,screen:hm(t,e)}}));function gm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vm=e=>{let{extensions:t}=e;return t.filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},_m=e=>({id:e,height:10}),Nm=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)(vm),(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=GE(((e,t)=>YE(t).map((t=>(0,l.pipe)((0,l.map)((e=>rm(e,t))),(0,l.pluck)("views"),l.flatten,l.head,(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){gm(e,t,r[t])}))}return e}({},e,{id:t})))(e))))(e,t.layout)),n=IE(_m,t.layout,{columns:4});return{views:r,layout:UE(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Am=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>rm(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=>rm(e,"com.reltio.plugins.entity.RangeColors"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("colors"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>rm(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:t}},general:{colors:r},image:{attributeFieldsOrder:n},lookups:{autocomplete:i},validate:{levels:a,validateReadMode:o}}},Rm=e=>({layout:Om(e),pivoting:Nm(e),properties:Am(e)});var Pm=r(58697),wm=r.n(Pm);function Sm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Im(e,t,r[t])}))}return e}function Im(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Um=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}_${wm()()}`;return n[e.id].push(t),i=!0,Sm({},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]++,Sm({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},Cm=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(Cm(e))}))}))),t},jm=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Fm,t),(0,l.propOr)([],"crosswalks",e))),e),Dm=(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(Dm(e))}))})),r},Lm=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=Lm(e);r>t&&(t=r)}))})),t+1):t},km=(e,t)=>{if(Be(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Fm=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},xm=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Mm=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Vm=(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)},$m=(0,l.eqBy)(Fm),Gm=(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)(Xo,(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)))),Wm=(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=wt().number(t));return t})),Ym=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?wt().number(e,"0,0.0a").toUpperCase():wt().number(e,"0,0"):""},Bm=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),qm=(e,t)=>t&&e!==t?`${t} (${e})`:e,Km=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Hm=(e,t,r)=>{const n=Km(e,t,r);return qm(r,n)},Jm=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Qm=(0,l.complement)(Jm),Xm=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),zm=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)},Zm=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Qm(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),eh=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?B(i):"L",u=a?H(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&&Wm(o,t);case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:se(t)?wt().text("yes"):wt().text("no");case vt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=_(Number(t)).getTime()),t&&(Xl(t)?zl(t):wt().date(t,s));case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_LOCAL_DATE:return t&&(Xl(t)?zl(t):wt().date(t,s));case vt.TYPE_TIMESTAMP:return t&&(Xl(t)?zl(t):wt().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)?qm((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),th={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)",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)"},rh=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()}},nh=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})))),ih=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.slice().reverse().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}=t,i=e.onResponse.slice().reverse().reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e}):e(r)}),t.next);i(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),rh,nh);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((e=>new Promise(((t,n)=>{r({response:e,next:e=>{t(e)},abort:n})})))):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}},ah="__metadata",oh=(e=>{const t=[ah,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),sh=(0,l.set)(oh),lh=(0,l.view)(oh),uh=sh(_t.NEW),ch=sh(_t.REMOVED),ph=sh(_t.EDITED),dh=sh(_t.IGNORED),yh=(0,l.pipe)(lh,(0,l.equals)(_t.REMOVED)),fh=(0,l.pipe)(lh,(0,l.equals)(_t.NEW)),Th=(0,l.pipe)(lh,(0,l.equals)(_t.EDITED)),Eh=(0,l.pipe)(lh,(0,l.complement)(l.isNil)),mh=(0,l.pipe)(lh,(0,l.equals)(_t.IGNORED)),hh=(0,l.omit)([ah]),bh=(e,t)=>e===ah?void 0:t;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 gh=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=gh(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},vh=(e,t)=>gh((0,l.propEq)("nodeId",t),e),_h=(e,t)=>gh((0,l.pathEq)(["entity","uri"],t),e),Nh=(e,t)=>{const r=vh(e,t);return r.length>1?r[r.length-2]:null},Ah=(e,t)=>{const r=vh(e,t);return r.length>0?r[r.length-1]:null},Rh=(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=>Rh(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Ph=()=>{},wh=(e,t)=>{let{parent:r,nodeProcessing:n=Ph}=t;n(e,r),e.children&&e.children.forEach((t=>wh(t,{parent:e,nodeProcessing:n})))},Sh=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case lr.addingParent:return{entityUri:n?r.entity.uri:t.relatedEntity.uri,relation:r.relation,parentEntityUri:n?t.relatedEntity.uri:r.entity.uri};case lr.addingChild:return{entityUri:n?t.relatedEntity.uri:r.entity.uri,relation:r.relation,parentEntityUri:n?r.entity.uri:t.relatedEntity.uri};case lr.editing:{const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=t.entity.uri,a=r.entity.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){Oh(e,t,r[t])}))}return e}({},e,i===a?{}:{entityUri:i,newEntityUri:a})}}},Ih=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;wh(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===lr.addingChild||r.editingMode===lr.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Sh({node:r,connection:n,isReversed:i}),s=Zy({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===lr.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Sh({node:r,isReversed:i,connection:n}),l=s?nf({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):rf({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Uh={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Ch={asc:"asc",desc:"desc"},jh=Uh.entityLabel,Dh=Ch.asc,Lh=(0,l.always)(0),kh=e=>{let{sortField:t=jh,sortOrder:r=Dh,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Uh.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return nv.strings.sort(t,a,o)})(n,r);case Uh.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return nv.strings.sort(e,i,a)})(r);default:return Lh}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Fh=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ch)),l.identity,(0,l.always)(Dh))),xh=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Uh)),l.identity,(0,l.always)(jh)));var Mh=r(91104);let Vh;const $h=(e,t)=>(Vh||(Vh=Mh.createClient({key:t})),new Promise((t=>{Vh.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)}))}))),Gh=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Wh=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ko).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Gh(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(Wh(e.value,t,r))),n})),Yh=e=>e&&e.length>0,Bh=(e,t)=>[].concat(e&&e.attributes?Wh(e.attributes,t):[]).filter(l.identity),qh=(e,t,r,n,i)=>{if(e&&e.type){const t=(li(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Bh(e,t.latitude),n=Bh(e,t.longitude),Yh(r)&&Yh(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(Yh(t)&&t[0].value&&Yh(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?$h(n.label,i).catch((()=>null)):Promise.resolve(null)},Kh=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=>"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||li(e,t.type).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})))))))));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return qh(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?$h(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)))},Hh=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=li(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Yn(e,r.latitude,t.type)&&Yn(e,r.longitude,t.type)){const e=Bh(t,r.latitude),n=Bh(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))},Jh=(e,t,r)=>Promise.all([Hh(e,t),Kh(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 Qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 zh=(e,t)=>t.values.map(so(e,t.entityTypeUri)),Zh=(e,t,r)=>Gs(t.fieldName,r)||Yn(e,rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),eb=(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?qm(e,t):e}),r)},tb=(0,l.path)(["attrType","label"]),rb=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Qh({},e,{[t]:!0})),{});e[r]=e[r]?Qh({},e[r],n):n}return e}),{}),nb=(0,l.pipe)((0,l.prop)("values"),E),ib=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Vt.type.name)),ab=e=>e.type===lb.NUMERIC_RANGE_FACET,ob=e=>e.type===lb.DATE_RANGE_FACET,sb=(0,l.either)(ab,ob),lb={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},ub=e=>{switch(null==e?void 0:e.name){case Vt.type.name:return lb.ENTITY_TYPE_FACET;case Vt.createdBy.name:case Vt.updatedBy.name:case Vt.sourceSystems.name:case Vt.tags.name:case Vt.roles.name:case Vt.matchRules.name:case Vt.MLRecommendedMatch.name:return lb.WITH_DROPDOWN_CHECKBOXES_FACET;case Vt.createdTime.name:case Vt.updatedTime.name:case Vt.startDate.name:case Vt.endDate.name:return lb.DATE_RANGE_FACET;case Vt.matches.name:case Vt.matchScore.name:return lb.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return lb.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return lb.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return lb.DATE_RANGE_FACET;default:return lb.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},cb=(0,l.pipe)(Zh,ub),pb=(0,l.pipe)((0,l.path)(["attrType","type"]),ei),db=(0,l.cond)([[ab,(0,l.always)(ct.IN_RANGE)],[ob,(0,l.always)(ct.WITHIN)],[(0,l.allPass)([pb,e=>e.values.length>=2]),(0,l.always)(ct.EXISTS)],[l.T,(0,l.always)(ct.EQUALS)]]),yb=(0,l.cond)([[ob,(0,l.prop)("values")],[ab,(0,l.prop)("values")],[pb,e=>1===e.values.length?e.values.map(se):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tb=(0,l.pipe)((0,l.path)(["attrType","type"]),Hn),Eb=(0,l.pipe)((0,l.path)(["attrType","type"]),Xn),mb=(0,l.pipe)((0,l.prop)("attrType"),Ys),hb=(0,l.pipe)((0,l.prop)("attrType"),Ws),bb=e=>t=>t.values.map((t=>li(e,t).label)).join(" , "),Ob=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),gb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(wt().number),Ob)),(0,l.join)(","))(e.values);return`${tb(e)}: ${t}`},vb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Ob)),(0,l.join)(","))(e.values);return`${tb(e)}: ${t}`},_b=e=>t=>`${tb(t)}: ${zh(e,t).join(", ")}`,Nb=e=>t=>{const r=eb(e,t);return`${tb(t)}: ${r.join(", ")}`},Ab=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[hb,bb(e)],[Eb,gb],[Tb,vb],[mb,_b(e)],[l.T,Nb(t)]]),r))),Rb=(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){fb(e,t,r[t])}))}return e}({},t,{attrType:Zh(e,t,n)}))),Ab(e,r))(t),Pb=new RegExp(`^${wt().text("Search")}`),wb=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...Rb(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Pb,"",u)]},Sb=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Ot),Ib=e=>(e=>Sb.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]=Zl(t);return e.replace(r,i).replace(n,a)}),e))(e),Ub=(0,l.curry)(((e,t)=>`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`)),Cb={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},jb=e=>[Cb.geoPolygon,Cb.onMapMove].includes(e),Db=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Lb=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},kb=(e,t)=>jb(e)?t.map(Db):[Lb(t)],Fb=e=>jb(e)?wt().text("Geo Polygon"):wt().text("Geo Location"),xb=e=>{switch(e){case Cb.geoLocation:return"geoLocation";case Cb.geoPolygon:case Cb.onMapMove:return"geoPolygon"}},Mb={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},Vb=e=>wt().text(e),$b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ct.EQUALS]:"=",[ct.NOT_EQUALS]:"≠",[ct.STARTS_WITH]:"*",[ct.MISSING_VALUE]:wt().text("missing value"),[ct.HAS_ALL]:wt().text("has all"),[ct.IN_RANGE]:wt().text("in range"),[ct.FULL_TEXT]:wt().text("full text"),[ct.EXISTS]:wt().text("exists"),[ct.COUNT_EQUALS]:`${wt().text("count")} =`,[ct.COUNT_NOT_EQUALS]:`${wt().text("count")} ≠`,[ct.COUNT_LT]:`${wt().text("count")} <`,[ct.COUNT_LTE]:`${wt().text("count")} <=`,[ct.COUNT_GT]:`${wt().text("count")} >`,[ct.COUNT_RANGE]:wt().text("count range"),[ct.LT]:"<",[ct.LTE]:"<=",[ct.GT]:">",[ct.GTE]:">=",[ct.IN_FILE]:wt().text("in file"),[ct.NOT_IN_FILE]:wt().text("not in file"),[ct.CONTAINS]:"~",[pt]:"=",[dt]:"≠",[yt]:"=",[ft]:"≠"}[e]||wt().text(e.toLowerCase())},Gb=e=>({type:Mb.operator,text:e}),Wb=e=>({type:Mb.operator,text:Vb(e)}),Yb=e=>({type:Mb.attributeLabel,text:e}),Bb=e=>({type:Mb.specialAttributeLabel,text:e}),qb=e=>({type:Mb.attributeFilter,text:$b(e)}),Kb=e=>({type:Mb.attributeValue,text:e}),Hb=e=>({type:Mb.entityTypeLabel,text:e}),Jb=()=>({type:Mb.space,text:" "}),Qb=()=>({type:Mb.bracket,text:"("}),Xb=()=>({type:Mb.bracket,text:")"}),zb=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Zb=(0,l.curry)(((e,t)=>t.map(zb(e)))),eO=(0,l.curry)(((e,t,r)=>[e,...r,t])),tO=eO(Qb(),Xb()),rO=eO(Jb(),Jb()),nO=(0,l.curry)(((e,t)=>[e,...t])),iO=e=>nO(Hb(e)),aO=e=>nO(Hb(`${e}: `)),oO=e=>["and","and not"].includes(e),sO=e=>["or","or not"].includes(e),lO=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),sO)),uO=(cO=["and"],e=>e.slice(0,-1).every((e=>cO.includes(e.operator))));var cO;const pO=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=lO(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=oO(s),a=sO(s);!r&&t&&n&&(i.push(Qb()),r=!0),i.push(o),r&&a&&(i.push(Xb()),r=!1);const l=e?Wb(s):Gb(s);i.push(...rO([l]))}else i.push(o),r&&(i.push(Xb()),r=!1)}return i}},dO=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),yO=(0,l.pipe)(pO({localizable:!1}),dO),fO=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},TO=e=>{let{data:t,values:r,filter:n}=e;return t&&Tu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},EO=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(TO)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),mO=(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)&&Vn(e.data.attrType)})(e)&&[ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Mn((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})))),zm),hO=(e,t)=>(0,l.pipe)(mO,Zm(t))(e),bO=(0,l.pathEq)(["data","fieldName"],Vt.type.name),OO=(0,l.path)(["data","entityTypeUri"]),gO=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),vO=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(qo(e)),attributes:(0,l.filter)((0,l.pipe)(OO,(0,l.anyPass)([l.isNil,qo(e),r=>{const n=(t.entityTypes||[]).filter(qo(e));return(n.length>1?yi(e,n):null)===r&&!!li(e,r)}])))})(t))))),_O=e=>(0,l.pipe)((0,l.prop)("filter"),Pl,(0,l.equals)(e)),NO=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Gs(n.fieldName)||n.attrType,s=Jl(o,i),u=eh({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Vn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?qm(a.lookupCode,a.value):Hm(r,Mn(o),a)],[()=>Ys(s),()=>so(e,n.entityTypeUri,a)],[()=>Bs(s),()=>Io(e,a)],[()=>Xs(s),()=>Co(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Xn(c)||ei(c)),Bl),Kb)()})),AO=(e,t,r,n)=>{const i=NO(e,t,r,n.data,n.filter);return(0,l.cond)([[_O(0),(0,l.always)([])],[(0,l.both)(_O(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[Jb(),i(r),{type:Mb.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Jb(),...(0,l.pipe)(l.flatten,(0,l.map)(i),Zb({type:Mb.punctuationMark,text:", "}))(t)]}]])(n)},RO=(e,t)=>{const r=!!Gs(e.data.fieldName);return(0,l.pipe)(fO,r?Bb:Yb)(e,t)},PO=(e,t,r,n,i)=>[RO(n,i),Jb(),qb(n.filter),...AO(e,t,r,n)],wO=(0,l.addIndex)(l.map),SO=(0,l.propEq)("length",1),IO=(0,l.propSatisfies)((0,l.lt)(1),"length"),UO=(0,l.complement)(l.isEmpty),CO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)((0,l.filter)(TO),(0,l.map)((n=>({operand:PO(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,pO()))(n)},jO=(0,l.pipe)(CO,l.flatten),DO=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Mp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=CO(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(iO),(0,l.pipe)(s(aO),(0,l.unless)((()=>SO(u)||i),tO)))(u)},LO=(e,t,r,n)=>(0,l.pipe)((0,l.filter)(EO),wO(((n,i,a)=>({operand:DO(e,t,r,n,SO(a)),operator:n.operator}))),pO(),l.flatten)(n),kO=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),pO(),l.flatten),FO=e=>{let{searchType:t,values:[r]}=e;return kb(t,r).join(", ")},xO=(e,t,r,n,i,a)=>{const o=(e=>e?[Bb(e.isRawFilter?wt().text("Raw filter"):wt().text("Search")),...rO([qb(ct.EQUALS)]),Kb(`"${e.value}"`)]:[])(i),s=(e=>e?[Bb(Fb(e.searchType)),Jb(),Kb(FO(e))]:[])(a),u=(0,l.pipe)(LO,(0,l.when)((e=>IO(e)&&(UO(o)||UO(s))),tO))(e,t,r,n);return kO([o,s,u])},MO=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),VO=(0,l.pipe)(xO,MO),$O=(0,l.has)("attributes"),GO=Array.isArray,WO=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),YO=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=BO(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)(WO(a))),tO),(0,l.concat)(rO([Gb(o)]))))(s)},BO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return $O(n)?YO(e,t,r,n,i):GO(n)?n.reduce(((n,a)=>n.concat(BO(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(rO([Gb(n.operator)])))(PO(e,t,r,n,i))},qO=(e,t,r,n,i)=>(0,l.pipe)(BO,l.flatten)(e,t,r,n,i);function KO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HO(e,t,r[t])}))}return e}function HO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JO=(0,l.complement)(bO),QO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(bO),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(OO),(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}},XO=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=QO(t);return(r||n)&&uO(t)},zO=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(XO)),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(bO).some((0,l.propEq)("filter",ct.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}=QO(r);if(XO(e))t.push(KO({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(JO)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(bO,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(OO,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(JO),entityTypes:n,operator:i?a:e.operator,id:wm()()}}));t.push(...n)}var a;return t})(t))),[]))),ZO={[ct.EQUALS]:ct.ON,[ct.IN_RANGE]:ct.WITHIN,[ct.GTE]:ct.AFTER,[ct.GT]:ct.AFTER,[ct.LTE]:ct.BEFORE,[ct.LT]:ct.BEFORE},eg=(0,l.curry)((e=>ZO[e]||e)),tg=(0,l.curry)(((e,t)=>{switch(e){case ct.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case ct.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),rg=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Hn),ng=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>KO({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return rg(e)?(0,l.evolve)({filter:eg,values:tg(t)},e):e}))})))})),ig=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),zO,vO(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")))})),ng,(0,l.reject)(gO))(r)));function ag(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){og(e,t,r[t])}))}return e}function og(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sg=(e,t)=>({data:{uri:ot(e.fieldName)?rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||db(e),id:wm()(),values:yb(e)}),lg=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Gs(a,t,r)||Yn(e,i);if(!s)return null;if(In(s))return ag({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Mp(e,{type:o}),i=(Wn(e,rt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return ag({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),ug=(0,l.curry)(((e,t,r,n)=>ig(lg,e,n,t,r)));function cg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pg(e,t,r[t])}))}return e}function pg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dg=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},yg=e=>"rdmLookups.not.resolved"===e?Vt.notResolved.name:e,fg=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===ht?ct.IN_RANGE:bt(a),u=yg(n),c=Gs(u)||Yn(e,i),p=(0,l.cond)([[()=>Ul(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>cg({},e,{filename:Bm(e)}))))],[()=>ei(null==c?void 0:c.type),(0,l.map)(se)],[e=>Sl(s)&&!Array.isArray(e[0])&&!Hn(null==c?void 0:c.type),ne],[l.T,l.identity]])(o);return{id:wm()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===ht?"and not":"and",filter:s,values:p}})),Tg=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(fg(e,yi(e,i)));return[{id:wm()(),operator:"or",attributes:a,entityTypes:i}]})),Eg=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),mg=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([Eg("from"),Eg("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,()=>[]]]),hg=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return cg({},r,{values:mg(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Fs(e.fieldName,n):e.fieldName})},bg=(e,t)=>{if((0,l.has)("children")(e)){const r=hg(e,t);return e.children.reduce(((e,n)=>(e.push(bg(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return hg(e,t)},Og=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(hg(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(cg({fieldName:e.fieldName},hg(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(bg,l.flatten)],[l.T,hg]]),gg=(0,l.pipe)((0,l.map)(Og),l.flatten),vg=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},_g=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=Tg(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:gg(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>cg({},t,{type:cb(e,t)}))).map((e=>cg({},e,{values:sb(e)?vg(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 sg(r,t)})),operator:"or",id:wm()(),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=>({[yg(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[cg({},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 ug(e,t,r,p)},Ng=(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)(nb),(0,l.partition)(ib))(t),i=n.map((t=>ag({},t,{type:cb(e,t)}))).map((e=>sg(e))),a=r.values||[];return[{attributes:i,operator:"or",id:wm()(),entityTypes:a}]})(e,a);return ug(e,t,r,o)})(e,t,r,n):_g(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},Ag=e=>"2.0"===e.version?e.keyword:dg(e),Rg=e=>(0,l.pathEq)(["object","uri"],e),Pg=(e,t)=>(0,l.pipe)((0,l.find)(Rg(e)),(0,l.prop)("object"))(t),wg=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"),Rg(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Pg(r.match,t)||n[r.match];return{label:Ep((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return oo(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)},Sg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),Ig=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),Ug=(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:Ep((0,l.prop)("label",a)),matchRules:i.map((function(t){return oo(e,a.type,t)||{label:t,uri:t}}))}})))(t),Cg=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)},jg=(0,l.path)(["object","uri"]),Dg=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Lg=e=>e.getValue(),kg=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=kg(n[e],t),!r);e++);return r},Fg=(e,t)=>{const r=[],n=(0,l.pipe)(Lg,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(Fg,[t]),a);return r.push.apply(r,o),r};function xg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 Vg=(e,t)=>!!e[t],$g=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},Gg=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||[]])},Wg=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return xg({},t,{[r.uri]:xg({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:Gg(null==o?void 0:o.parents,n),children:Gg(null==o?void 0:o.children,i),values:Gg(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},Yg=e=>e.children?e.children.flatMap(Yg):e,Bg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=li(r,t)||Ei(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return xo(r,n,i).flatMap(Yg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Yn(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=Wg({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Wg({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},qg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Be(e.uri)&&Xe(e.type)&&Xe(t)&&!t.startsWith(e.type))(n,t))return e;const i=ls(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ko),(0,l.map)($g))(i);return Wg({structure:e,attrType:e[t].attrType,values:a})}),t)},Kg=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 Vg(e,r)}));return r||n?t.filter(Ko).reduce(((e,t)=>Kg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Vg(t,e.type)?Wg({structure:t,attrType:t[e.type].attrType,values:[$g(e)]}):t}},Hg=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?xg({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},Jg=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ls(i,n,r)||[];return a.length?Wg({structure:t,attrType:t[r].attrType,values:a.filter(Ko).map($g)}):t},Qg=(e,t,r)=>{const n=He(e),i=He(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Ze(n,r)})(e,t):!(!r||!st(t))&&Kf(r,i).includes(n)},Xg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},zg=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?Bf(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return Qg(r,t,o)}))},Zg=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>Zg(e,t,r)))))},ev=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&Xg(n,e)}},tv=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=He(n),c=qf(u,o,i,a),p=Zg("children",t,l),d=Zg("parents",t,l),y=p.flatMap((e=>Zg("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Qg(t,n,c)})).map((t=>ev(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Qg(n,t,c)||He(t)!==u&&Qg(t,n,c)})).map((t=>ev(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=Zg("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)&&Qg(n,t,c)}))})).map((t=>ev(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return Qg(t,n,c)})).map((e=>ev(r,n,e,s))),...T,...E,...f]},rv={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},nv={Colors:r(29504),DependencyManager:r(47485),strings:n,dates:i}},29504:(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}},47485:(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:()=>{}}]);
|