@reltio/remotes 1.4.1034 → 1.4.1035

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/80.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[80],{8513:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>ks,PY2:()=>St,Ng6:()=>tr,YJ7:()=>vt,NlI:()=>pt,Xt7:()=>zt,wfT:()=>Br,EMD:()=>Dr,HAc:()=>Zt,PEf:()=>Dt,oA3:()=>Cr,$XE:()=>Tr,eWf:()=>Ut,q7e:()=>er,KVe:()=>qr,WVQ:()=>ii,oZZ:()=>rn,bNA:()=>nn,Rjq:()=>an,G39:()=>Lt,dZX:()=>Er,bQt:()=>sn,oS0:()=>bt,lL_:()=>mt,Nsj:()=>_t,psV:()=>Ot,xPW:()=>wt,pyR:()=>Mr,p8l:()=>Lr,Wkf:()=>Xt,zHr:()=>Jt,NIO:()=>Qt,$26:()=>hb,Esk:()=>Pr,s9T:()=>cr,MEy:()=>Yl,j5E:()=>ct,vAw:()=>Ur,NMQ:()=>Ir,mNm:()=>Fr,rwv:()=>en,s_5:()=>$r,RgZ:()=>kr,unl:()=>tn,Qy0:()=>on,pYu:()=>Rr,wIJ:()=>Gb,GFH:()=>nr,S91:()=>kt,p3$:()=>pn,wSh:()=>z,BDP:()=>_i,pGS:()=>xr,ARY:()=>Or,XGc:()=>Yr,fO_:()=>Yt,wwy:()=>sr,_XL:()=>gt,j2V:()=>Hr,dMV:()=>Gr,NBX:()=>Yv,OXy:()=>vr,BXd:()=>dr,CJB:()=>Jr,lXI:()=>br,nqG:()=>un,C68:()=>jt,yxQ:()=>ln,Yj_:()=>lr,D25:()=>ar,ZIY:()=>mr,Tl4:()=>Qb,lwr:()=>Ct,NkU:()=>Kr,Rtp:()=>Wr,YGx:()=>yr,uTS:()=>Vr,IYE:()=>jr,PiC:()=>Zr,tJI:()=>rr,fDt:()=>ir,cNQ:()=>Qr,SwE:()=>Sr,ZHR:()=>zr,lD1:()=>Ft,lVm:()=>fr,vnX:()=>Wh,$x5:()=>Yh,_R1:()=>Vh,wUm:()=>Gh,z7V:()=>cn,dC6:()=>pr,MBD:()=>or,GmF:()=>ea,cKm:()=>hr,iP_:()=>It,NVC:()=>ur,tPT:()=>Ps,tZe:()=>cp,kRE:()=>py,psB:()=>dy,X0$:()=>Rs,Wm5:()=>zs,vyX:()=>ju,wLZ:()=>Ss,W4V:()=>oe,EtK:()=>cs,Wtd:()=>As,asT:()=>ng,kGs:()=>ve,ewt:()=>Pf,O_f:()=>bO,sOy:()=>Ze,Tde:()=>Fn,LMI:()=>hu,skb:()=>WO,sPt:()=>uu,sH1:()=>cu,RPM:()=>hT,h27:()=>Su,Uqd:()=>Du,xG:()=>rv,Z2f:()=>sh,fgW:()=>_O,I69:()=>KO,ZxB:()=>JO,mdt:()=>yT,Qbq:()=>Bm,rny:()=>Fi,UEY:()=>va,Q0T:()=>Oa,Lyr:()=>Sa,sBn:()=>ba,itK:()=>Ta,H9$:()=>ha,KPc:()=>ma,zos:()=>Ea,ELQ:()=>wa,dZs:()=>aa,Cz4:()=>ia,z_L:()=>Ra,fGe:()=>na,iuF:()=>ya,Wib:()=>fa,Hn0:()=>Pa,obS:()=>Ia,E$L:()=>oa,XUh:()=>da,Qp_:()=>ca,_jk:()=>sa,sKE:()=>la,WmG:()=>pa,QKx:()=>Na,Oik:()=>_a,s0A:()=>ua,o9m:()=>ga,MCd:()=>Aa,tGK:()=>gl,Vg3:()=>Yi,mkC:()=>Ui,xv5:()=>qi,a14:()=>Di,yv0:()=>Bi,Zm0:()=>Ci,Nxd:()=>Ii,$mM:()=>Wi,ifj:()=>oi,NWi:()=>Rh,xr3:()=>Ah,wNf:()=>Cl,iJH:()=>Ph,d89:()=>Pi,Edd:()=>Si,Z5t:()=>wi,uGe:()=>Ai,UoR:()=>Ni,xvW:()=>Nh,$qe:()=>_h,yPM:()=>ra,$cp:()=>Ls,vKJ:()=>Ds,AID:()=>af,B1H:()=>Gv,b7X:()=>Gm,$uE:()=>ge,keo:()=>Ym,C_p:()=>tE,G27:()=>ZE,JA0:()=>ey,b3T:()=>Oe,oC6:()=>he,_Zs:()=>be,epC:()=>Ne,YYG:()=>_e,f_2:()=>ry,w3l:()=>Nv,QHB:()=>zE,Jso:()=>Uv,RXH:()=>ME,Vr9:()=>sm,lMm:()=>km,fmQ:()=>rs,yRD:()=>yv,NcL:()=>sE,QK6:()=>pe,ymd:()=>Hc,JV_:()=>Ny,XiW:()=>hf,Yrx:()=>Wd,GPx:()=>Ns,gjI:()=>_s,vlo:()=>Bf,E_P:()=>lT,aAL:()=>jc,NBq:()=>ns,wp9:()=>dT,DsR:()=>Sc,MPc:()=>cf,gWE:()=>pf,DT_:()=>df,ipn:()=>ff,ORg:()=>Oi,_wz:()=>yf,RYR:()=>Nf,PP2:()=>qd,wS7:()=>fh,cBQ:()=>yc,pBq:()=>Wy,DsO:()=>Z,X78:()=>Ry,xZs:()=>Oy,YFy:()=>Bd,Gmt:()=>Ey,K$w:()=>Ty,DSj:()=>Lc,k9j:()=>Tc,ww$:()=>ws,WVU:()=>fy,hxF:()=>el,nwO:()=>dg,Mzk:()=>lc,aFF:()=>Xm,HRH:()=>Hl,EZK:()=>gp,Kxm:()=>hp,Z9i:()=>kT,CrF:()=>sy,DNd:()=>Ca,vUy:()=>lg,lJh:()=>Jl,zHo:()=>Xl,sEJ:()=>qv,UO$:()=>Qy,zeJ:()=>Wn,dLR:()=>fs,JQy:()=>bs,XtP:()=>ds,Ug0:()=>di,A1W:()=>Wm,sw:()=>vp,nv3:()=>Lh,JgD:()=>jh,nve:()=>Hv,SkP:()=>Os,SAs:()=>By,PWK:()=>Uo,IM5:()=>ys,Mfk:()=>Vm,mB6:()=>ch,p6d:()=>S,o0x:()=>I,ufS:()=>Zm,k7L:()=>eh,mrB:()=>w,ncP:()=>He,Zmi:()=>Ge,hm5:()=>Ye,ECL:()=>Gt,vPL:()=>Ap,qmL:()=>oT,hXd:()=>Mi,OCS:()=>$i,p2l:()=>xs,qF1:()=>Kc,_X$:()=>Qc,yj2:()=>xb,bzh:()=>ET,k66:()=>$o,kiP:()=>ro,pSg:()=>ue,kz_:()=>Jd,H_U:()=>Go,t9e:()=>Ma,j2$:()=>pp,PFL:()=>Rn,aJ3:()=>ub,To9:()=>xn,wpo:()=>Bp,ADq:()=>UT,UUb:()=>wT,tQX:()=>IT,xy8:()=>In,EUG:()=>Yn,AFK:()=>it,X3M:()=>Gn,WN0:()=>Vo,kDl:()=>Ts,uDV:()=>aT,IhQ:()=>ms,R$r:()=>sT,w80:()=>bo,Pfu:()=>Fa,Gtj:()=>fl,fyF:()=>yl,u5q:()=>Ke,O$n:()=>Wp,ptG:()=>Yp,f4_:()=>fE,uap:()=>yE,d7q:()=>Gd,liG:()=>Hd,$oF:()=>Vd,avf:()=>Lf,DiQ:()=>jf,cfX:()=>Df,vD3:()=>Ff,Qrb:()=>Cf,EJQ:()=>kf,HWy:()=>Uf,y6v:()=>If,JUW:()=>ny,GtP:()=>NE,_kX:()=>ja,u1e:()=>La,sJj:()=>Km,CJp:()=>gE,uKF:()=>Hm,wo0:()=>cy,s5:()=>jo,cwx:()=>Do,Y6b:()=>Cd,TTx:()=>hy,UtR:()=>Dd,HaQ:()=>by,E6I:()=>oy,vTU:()=>Id,Nsy:()=>Dp,KMQ:()=>Jm,Do$:()=>Fp,CSV:()=>Vs,TMe:()=>jd,l1V:()=>Zl,VQ1:()=>nu,z7d:()=>qf,Xaq:()=>Bo,Sj8:()=>pg,PJj:()=>bl,k3T:()=>fi,PjQ:()=>gi,s7l:()=>tc,GGR:()=>Vf,j5q:()=>Mf,DnY:()=>zu,RY5:()=>Zf,Px$:()=>Af,KPC:()=>Mv,NIY:()=>oc,HvW:()=>nc,Fof:()=>$a,BTI:()=>Mp,uie:()=>Sp,ChB:()=>_p,q27:()=>Hp,fAQ:()=>Iy,XkT:()=>Xu,lrH:()=>Uy,nt9:()=>si,XH8:()=>Gp,XH2:()=>yi,jFi:()=>Vp,qhs:()=>ho,wwR:()=>xp,Uk3:()=>at,ev7:()=>Wv,RB9:()=>Zd,iFp:()=>OT,e$p:()=>gT,PcX:()=>_T,SpP:()=>vT,R6_:()=>pb,CY1:()=>bb,Ajk:()=>Hu,Yiz:()=>qu,FK9:()=>Gu,UOo:()=>th,aTW:()=>my,uug:()=>Ul,P$2:()=>gb,XS2:()=>_l,Hyb:()=>Wl,d3Y:()=>xu,Klp:()=>$u,WxZ:()=>_b,Gzu:()=>zl,ZOr:()=>Ju,uqV:()=>Pd,Pm4:()=>te,nVD:()=>tT,dED:()=>Md,P2h:()=>xd,jrr:()=>za,mmY:()=>eo,T6O:()=>Wo,h6J:()=>sp,hM2:()=>jv,XR6:()=>J,jmz:()=>iT,IHt:()=>nT,NZI:()=>LT,wdF:()=>Sy,kgP:()=>wy,ZYI:()=>Wc,QXK:()=>ul,efz:()=>cl,Q5d:()=>ll,Ysv:()=>pl,ocC:()=>Kf,io3:()=>ci,Sbt:()=>vo,roS:()=>Oo,Ww1:()=>go,QaS:()=>uc,ERZ:()=>gv,CL1:()=>Lv,idV:()=>Op,nIW:()=>tt,fjE:()=>db,sG0:()=>rh,tV7:()=>Ol,g8o:()=>Hb,Qy:()=>qb,t2P:()=>lb,wId:()=>uo,LS0:()=>co,bFH:()=>fd,Rgl:()=>Ed,fW1:()=>lE,Ywp:()=>$h,pg:()=>Xp,WSA:()=>md,fed:()=>Cv,tT_:()=>hs,KbL:()=>ec,JBA:()=>lt,aNC:()=>Dh,RFJ:()=>Gc,Zeh:()=>Ky,OT5:()=>Mh,mC3:()=>nl,NVY:()=>cT,k6v:()=>Jc,FEC:()=>Xc,Ob5:()=>Kp,KUV:()=>Qp,dvH:()=>uT,V3i:()=>cm,VD3:()=>pi,mm2:()=>ru,rou:()=>xy,izH:()=>ka,DK$:()=>xa,KMp:()=>Dc,c31:()=>Tn,mbo:()=>DT,gT8:()=>hn,CZ8:()=>es,uGi:()=>os,Poc:()=>yn,_9k:()=>us,ZTM:()=>is,bwT:()=>ss,tzW:()=>On,tF$:()=>mn,o96:()=>ts,M4S:()=>ls,_vs:()=>Rc,xF8:()=>Rf,HQx:()=>zm,ATu:()=>CT,j1S:()=>hi,V3K:()=>Ei,Lmx:()=>mi,ZaZ:()=>fn,n_1:()=>wd,N6e:()=>Ic,SxO:()=>Za,w3p:()=>pT,xU7:()=>ce,Y_p:()=>Ao,$k6:()=>No,Gdl:()=>ih,U6P:()=>nh,OwB:()=>cb,hTh:()=>rT,xqc:()=>Lo,JvE:()=>ko,i29:()=>_u,dzT:()=>Li,uPS:()=>dc,cZV:()=>pc,n3B:()=>IO,e6O:()=>NO,s7j:()=>Vb,j$Q:()=>iy,kW2:()=>_E,tH7:()=>Co,Yxg:()=>qs,MaZ:()=>$f,nqN:()=>xf,o_J:()=>qo,hgZ:()=>Np,yW4:()=>lp,uT0:()=>ap,C82:()=>op,u9Z:()=>Fy,J$m:()=>Sd,j_Q:()=>Yu,wB1:()=>Vv,SP6:()=>Jp,ZYr:()=>xv,IMU:()=>Vc,FoU:()=>ty,DVz:()=>uh,mxe:()=>SO,FHr:()=>qy,D1g:()=>My,VO3:()=>Kh,de5:()=>Hh,Uw1:()=>fe,J6q:()=>jT,XCe:()=>Qa,Ir:()=>ao,XQO:()=>oo,QXb:()=>sd,P8_:()=>gy,iiD:()=>Cc,MOC:()=>ld,WF:()=>od,xE1:()=>vi,idW:()=>tg,YL3:()=>sc,Fn9:()=>T,j2U:()=>Fs,MpE:()=>vn,kQw:()=>Sn,mfm:()=>EO,vZp:()=>ot,E8K:()=>Jv,VSb:()=>zo,vr_:()=>Pn,Vmh:()=>sg,FgW:()=>um,oDv:()=>Ko,kuw:()=>Jo,Tt2:()=>Ho,T6Y:()=>Zn,_26:()=>$l,YkM:()=>kn,J6y:()=>Rl,njU:()=>jl,TBP:()=>Qo,IT0:()=>FT,x_:()=>Qm,biM:()=>Lp,TMl:()=>kp,Vkd:()=>Fl,WiY:()=>Eb,_zi:()=>xl,J6D:()=>tu,Lt4:()=>Hn,QEi:()=>$n,whI:()=>qt,KIu:()=>Kt,JhM:()=>ae,C_0:()=>ri,qIF:()=>UO,O27:()=>E,aBi:()=>qp,xOX:()=>Xs,EdS:()=>Xe,WgC:()=>Je,eEv:()=>Nn,A4t:()=>Ll,YOQ:()=>st,Wos:()=>Xn,jWr:()=>Ua,Or$:()=>Ln,lhE:()=>ui,CwH:()=>Mn,pzC:()=>Ks,ymH:()=>Dl,QZu:()=>Dn,rYH:()=>Tb,FVt:()=>Jn,Kn2:()=>le,OXP:()=>Xo,lS4:()=>Vn,g5f:()=>mb,fp6:()=>wl,Uty:()=>Qi,YkG:()=>jn,xdS:()=>bn,$NE:()=>ze,bC9:()=>Qe,KVV:()=>qm,q9e:()=>_o,iIf:()=>ah,ian:()=>tl,m6e:()=>ni,OFd:()=>Qs,kqr:()=>wn,fnZ:()=>Bt,VFZ:()=>rl,ZiX:()=>Be,j5n:()=>Kn,zkt:()=>g,Pcm:()=>$v,QDV:()=>Hs,M5u:()=>fb,laD:()=>wO,mtq:()=>_n,CtB:()=>oh,CBv:()=>ie,I0t:()=>ti,u1G:()=>Yf,gk1:()=>RO,Bgb:()=>AO,uzs:()=>Ht,v0l:()=>ou,Zqp:()=>Ld,j0k:()=>Io,tCm:()=>nt,gmx:()=>Nl,mOr:()=>Bl,TwZ:()=>Kb,GyU:()=>kh,zGm:()=>ed,bMg:()=>vd,EyD:()=>vh,FQA:()=>gh,fZN:()=>Nd,xsF:()=>bh,Lxg:()=>Oh,O3l:()=>mc,Wni:()=>Ec,wRx:()=>wh,OxG:()=>pd,uJQ:()=>cd,qWg:()=>lh,i96:()=>zp,zhn:()=>Sh,G8q:()=>dn,A9Y:()=>ee,Y5F:()=>fv,gxP:()=>se,c$P:()=>Al,BBN:()=>Xa,ZBU:()=>Q,UkJ:()=>po,xkv:()=>vy,z$M:()=>rg,KAm:()=>zd,lCl:()=>of,rkF:()=>rE,IU6:()=>Ep,aYu:()=>m,ije:()=>hl,Buf:()=>Uc,YLu:()=>ml,ct9:()=>Po,XkY:()=>gd,T5R:()=>td,uQS:()=>Ad,wcJ:()=>Ro,d$I:()=>Is,rSp:()=>jp,Sx:()=>ac,Ki6:()=>Zs,VGk:()=>Pc,sFD:()=>$E,eWN:()=>ig,dWE:()=>$b,Lkd:()=>bf,aDL:()=>Jy,yaA:()=>Rd,lOh:()=>Vy,DBr:()=>ab,hK$:()=>vl,TZ_:()=>Tp,CMB:()=>CO,FU8:()=>ic,J$p:()=>ef,b5s:()=>Zy,h2W:()=>rt,SL_:()=>jy,oUH:()=>rp,ck9:()=>rd,Xs0:()=>El,u7I:()=>$y,oCZ:()=>XT,MjG:()=>qh,FuV:()=>tp,$ju:()=>ip,t6d:()=>np,m5F:()=>ye,sx:()=>ag,rSc:()=>ph,L8n:()=>yy,R9X:()=>Ud,rj2:()=>Ay,_C4:()=>dp,tCj:()=>_y,uAg:()=>Yd,wx9:()=>Sf,KF3:()=>yp,ax9:()=>fp,HH7:()=>wc,_6y:()=>fc,AJo:()=>cc,Ixr:()=>ay,P6Y:()=>yg,Bd_:()=>HT,xkB:()=>qT,W41:()=>ky,WkI:()=>Ly,sSE:()=>BT,GMd:()=>bu,Bxm:()=>QT,FVh:()=>$T,U_T:()=>hd,FTe:()=>ne,VGB:()=>re,Wfe:()=>Ql,Ls5:()=>Kl});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:()=>v,formatDate:()=>S,formatDateTime:()=>I,formatTime:()=>w,getEndOfDay:()=>P,getMomentFormatFromDateMask:()=>B,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>H,getStartOfDay:()=>R,isToday:()=>g,isValidMomentDate:()=>h,isValidMomentDateOrNull:()=>b,momentToDate:()=>O,parseTimestamp:()=>Q,toLocalDate:()=>_,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ve,collectCrosswalksFromAttributes:()=>ge,compareActivenessAttributes:()=>Oe,compareAttributes:()=>he,compareImages:()=>be,compareRoles:()=>Ne,compareTags:()=>_e});var o={};r.r(o),r.d(o,{addAttribute:()=>Pe,editAttribute:()=>Se,editEndDate:()=>je,editRoles:()=>Ue,editStartDate:()=>De,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(),v=e=>(e&&e.setHours(0,0,0,0),e),g=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"),S=e=>f()(e).format(f().localeData().longDateFormat("L")),w=e=>f()(e).format(f().localeData().longDateFormat("LTS")),I=e=>`${S(e)} ${w(e)}`,U=(0,l.equals)("9"),C=(0,l.equals)("99"),D=(0,l.equals)("9999"),j=(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")],[j,(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")]]),$=(0,l.cond)([[U,(0,l.always)("y")],[C,(0,l.always)("YY")],[D,(0,l.always)("YYYY")],[k,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),V=(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,$(a),o])}return e},q=/(9+)([^9]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(q)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[V(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},K=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${B(t)} ${H(r)}`},Q=e=>{const t=Number(e);return Number.isNaN(t)?e:t},J=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"===g(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"===g(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),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(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 ve(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 ge(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 Se(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()?(we(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(we.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=Se(e,o,o.valueUri,{},i,a);Se(c,t,r,n,i,a+1)}function we(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 De(e,t){e.startDate=t||""}function je(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",$e="1Tepmo4Rel",Ve=(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=Ve(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Ge(n)},Be=e=>e&&e.includes("uri$$"),qe=We("entities"),He=We("relations"),Ke=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Qe=(0,l.startsWith)("relations/"),Je=(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={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},dt={[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"},yt="in",ft="notIn",Tt="not range",Et=e=>({[yt]:ct.EQUALS,[ft]:ct.NOT_EQUALS}[e]||e),mt={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},ht={[mt.LAST_DAY]:"Last 24 hours",[mt.LAST_3DAYS]:"Last 3 days",[mt.LAST_WEEK]:"Last week",[mt.LAST_MONTH]:"Last month",[mt.LAST_YEAR]:"Last year",[mt.PICK_DATE]:"Pick date"},bt={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"},Ot={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},vt={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},gt="<No label>",_t={IN:"in",OUT:"out"};var Nt=r(87918),At=r.n(Nt);function Rt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pt(e,t,r[t])}))}return e}function Pt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const St={startDate:{type:bt.TYPE_ACTIVENESS_DATE,get label(){return At().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:bt.TYPE_ACTIVENESS_DATE,get label(){return At().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},wt=Rt({id:{type:bt.TYPE_ENTITY_ID,get label(){return At().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},St,{roles:{type:bt.TYPE_STRING,get label(){return At().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:bt.TYPE_STRING,get label(){return At().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),It={workflow:{type:bt.TYPE_STRING,get label(){return At().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:bt.TYPE_STRING,get label(){return At().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:bt.TYPE_STRING,get label(){return At().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Ut={commenter:{type:bt.TYPE_STRING,get label(){return At().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Ct={notResolved:{type:bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return At().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Dt={createdBy:{type:bt.TYPE_STRING,get label(){return At().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:bt.TYPE_STRING,get label(){return At().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},jt={matches:{type:bt.TYPE_COUNT,get label(){return At().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:bt.TYPE_COUNT,get label(){return At().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Lt={sourceSystems:{type:bt.TYPE_STRING,get label(){return At().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:bt.TYPE_STRING,get label(){return At().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:bt.TYPE_INT,get label(){return At().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:bt.TYPE_STRING,get label(){return At().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},kt={matchRules:{type:bt.TYPE_STRING,get label(){return At().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:bt.TYPE_STRING,get label(){return At().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Ft=Rt({},wt,It,Ut,Ct,Dt,jt,Lt,kt,{type:{type:bt.TYPE_STRING,get label(){return At().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var xt=r(13980),Mt=r.n(xt);const $t=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Vt=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),$t),Gt=(0,l.pipe)((0,l.reject)(E),Vt),Wt=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("?")?"&":"?")+$t(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}},Yt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Bt=(0,l.equals)(Yt.SUGGESTING),qt=(0,l.equals)(Yt.EDITING),Ht=(0,l.equals)(Yt.VIEWING),Kt=(0,l.either)(qt,Bt);let Qt,Jt,Xt,zt,Zt,er,tr,rr,nr,ir,ar,or,sr,lr,ur,cr,pr,dr,yr,fr,Tr,Er,mr,hr,br,Or,vr;function gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_r(e,t,r[t])}))}return e}function _r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(Qt||(Qt={})),function(e){e.local="local",e.validationService="validationService"}(Jt||(Jt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Xt||(Xt={})),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"}(zt||(zt={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Zt||(Zt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch"}(er||(er={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(tr||(tr={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(rr||(rr={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(nr||(nr={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(ir||(ir={})),function(e){e.PROFILE="profile",e.MAP="map"}(ar||(ar={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(or||(or={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(sr||(sr={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(lr||(lr={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(ur||(ur={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(cr||(cr={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(pr||(pr={})),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"}(dr||(dr={})),function(e){e.IN="in",e.OUT="out"}(yr||(yr={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(fr||(fr={})),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"}(Tr||(Tr={})),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"}(Er||(Er={})),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"}(mr||(mr={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(hr||(hr={})),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"}(br||(br={})),function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Or||(Or={})),function(e){e.Saving="Saving"}(vr||(vr={}));const Nr=Mt().oneOf(["mobile","tablet","desktop"]),Ar=Mt().shape({deviceTypes:Mt().oneOfType([Nr,Mt().arrayOf(Nr)]),roles:Mt().arrayOf(Mt().string)}),Rr=Mt().shape({value:Mt().string,lookupCode:Mt().string}),Pr=Mt().shape({link:Mt().string,filename:Mt().string}),Sr=Mt().shape({displayName:Mt().string,parent:Mt().string}),wr=Mt().oneOfType([Mt().string,Mt().number,Mt().bool,Rr]),Ir=Mt().oneOfType([wr,Mt().arrayOf(wr)]),Ur=Mt().shape({fieldName:Mt().string,values:Mt().arrayOf(Ir),filter:Mt().string,type:Mt().string}),Cr=Mt().shape({minValue:Mt().number,maxValue:Mt().number}),Dr=Mt().shape({label:Mt().string,name:Mt().string,description:Mt().string,type:Mt().string,hidden:Mt().bool,faceted:Mt().bool,searchable:Mt().bool,uri:Mt().string,access:Mt().arrayOf(Mt().string),cardinality:Cr}),jr=Mt().shape({label:Mt().string,uri:Mt().string,typeColor:Mt().string,direction:Mt().string,startObject:Mt().object,endObject:Mt().object}),Lr=Mt().shape({typeColor:Mt().string,typeIcon:Mt().string,typeImage:Mt().string,label:Mt().string,uri:Mt().string,attributes:Mt().arrayOf(Dr)}),kr=Mt().shape({uri:Mt().string,label:Mt().string,memberTypes:Mt().array,extendsTypeUri:Mt().string,attributes:Mt().arrayOf(Dr)}),Fr=Mt().shape({uri:Mt().string,label:Mt().string,extendsTypeUri:Mt().string,relationshipTypeURIs:Mt().arrayOf(Mt().string)}),xr=Mt().shape({uri:Mt().string,description:Mt().string,label:Mt().string,schemaVersion:Mt().string,entityTypes:Mt().arrayOf(Lr),roles:Mt().arrayOf(Mt().object),groupTypes:Mt().arrayOf(Mt().object),relationTypes:Mt().arrayOf(jr),graphTypes:Mt().arrayOf(Fr),interactionTypes:Mt().arrayOf(kr),sources:Mt().arrayOf(Mt().object)}),Mr=Mt().shape({uri:Mt().string,type:Mt().string}),$r=Mt().shape({uri:Mt().string,attributes:Mt().object,type:Mt().string,timestamp:Mt().number,members:Mt().object}),Vr=Mt().shape({uri:Mt().string,type:Mt().string}),Gr=Mt().shape({value:Mt().object,ov:Mt().bool,type:Mt().string,uri:Mt().string}),Wr=Mt().shape({refEntity:Mt().oneOfType([Mt().array,Mt().object]),refRelation:Mt().oneOfType([Mt().array,Mt().object]),value:Mt().object,ov:Mt().bool,type:Mt().string,uri:Mt().string}),Yr=Mt().oneOf((0,l.values)(Yt)),Br=Mt().shape({type:Mt().oneOf(Object.values(Qt)).isRequired,attributeTypeUri:Mt().string.isRequired,parentUri:Mt().string.isRequired,uri:Mt().string,message:Mt().string}),qr={attributeType:Dr,showEmptyEditors:Mt().bool,lazy:Mt().bool,mode:Yr,metadata:xr,ownError:Br,errors:Mt().arrayOf(Br),crosswalks:Mt().array,onAddAttributes:Mt().func,onAddOneMore:Mt().func,onDeleteAttribute:Mt().func,onChangeAttribute:Mt().func,additionalControlsRenderer:Mt().func,hideDeleteButton:Mt().bool,showNonOv:Mt().bool,state:Mt().oneOf(["deleted","edited"])},Hr=gr({attributeValue:Gr},qr),Kr=gr({attributeValue:Wr},qr),Qr=Mt().shape({value:Mt().oneOfType([Mt().string,Mt().bool,Mt().number]),ov:Mt().bool,type:Mt().string,uri:Mt().string,lookupCode:Mt().string,lookupRawValue:Mt().string}),Jr=Mt().shape({totalOvValues:Mt().number,totalValues:Mt().number}),Xr=Mt().shape({inRelations:Mt().arrayOf(Mt().oneOfType([Mt().object,Mt().string])),outRelations:Mt().arrayOf(Mt().oneOfType([Mt().object,Mt().string])),groups:Mt().arrayOf(Mt().string),entityTypes:Mt().arrayOf(Mt().string),nextEntry:Mt().object}),zr=Mt().oneOf(["asc","desc"]),Zr=Mt().shape({id:Mt().string,content:Xr,allowOnlyCreateNew:Mt().bool,sortColumn:Mt().string,sortOrder:zr,"text-empty":Mt().string,max:Mt().number,icon:Mt().string,caption:Mt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,editingEnabled:Mt().bool}),en=Mt().shape({id:Mt().string,graph:Mt().shape({type:Mt().string,layout:Mt().number,deep:Mt().number,limit:Mt().number,uri:Mt().string,options:Mt().shape({reverseRelations:Mt().bool})}),sortBy:Mt().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:zr,max:Mt().number,icon:Mt().string,caption:Mt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar}),tn=Mt().shape({id:Mt().string,caption:Mt().string,pageSize:Mt().number,icon:Mt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,attributes:Mt().object}),rn=Mt().shape({entityUri:Mt().string,entityType:Mt().string,entityLabel:Mt().string,object:Mr}),nn=Mt().shape({relationUri:Mt().string,relationType:Mt().string,relationLabel:Mt().string,direction:Mt().string,object:Vr}),an=Mt().shape({entity:rn,relation:nn}),on=Mt().shape({value:Mt().string,isRawFilter:Mt().bool}),sn=Mt().shape({id:Mt().string,label:Mt().string,name:Mt().string,availableEntityTypes:Mt().array}),ln=Mt().shape({id:Mt().string,allowMergeAll:Mt().bool,matchActions:Mt().object,availableTabs:Mt().arrayOf(Mt().oneOf(["findMatches","potentialMatches","notAMatch"]))}),un=Mt().shape({matchRules:Mt().arrayOf(Mt().string),object:Mr,shortestTransitiveMatchPath:Mt().arrayOf(Mt().shape({matchRules:Mt().arrayOf(Mt().string),match:Mt().string})),direct:Mt().bool,matchScore:Mt().number}),cn=Mt().arrayOf(un),pn=Mt().arrayOf(Mt().shape({uri:Mt().string,label:Mt().string})),dn=[{label:At().text("And"),value:"and"},{label:At().text("Or"),value:"or"},{label:At().text("And not"),value:"and not"},{label:At().text("Or not"),value:"or not"}],yn=(0,l.prop)("referencedEntityTypeURI"),fn=(0,l.prop)("relationshipTypeURI"),Tn=(0,l.prop)("referencedAttributeURIs"),En=(0,l.curry)(((e,t)=>(0,l.pipe)(Tn,(0,l.filter)((0,l.startsWith)(e)))(t))),mn=En("configuration/relationTypes"),hn=En("configuration/entityTypes"),bn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),On=(0,l.filter)(bn),vn=(e,t)=>!t||t.some((t=>t===e.uri));function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _n=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Xe),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",bt.TYPE_STRING),(0,l.propEq)("type",bt.TYPE_BLOB))]),Nn=(0,l.has)("values"),An=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(bt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(bt.TYPE_LOOKUP)],[Nn,(0,l.always)(bt.TYPE_ENUM)],[_n,(0,l.always)(bt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",bt.TYPE_BOOLEAN),(0,l.always)(bt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Rn=(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){gn(e,t,r[t])}))}return e}({},e,{type:An(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Pn=e=>!!e&&(!!e.autoGenerated&&e.type!==bt.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\//)),wn=(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),In=e=>Sn(e)?"analyticsAttributes":"attributes",Un=(0,l.propEq)("hidden",!0),Cn=(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=Cn(bt.TYPE_NESTED),jn=Cn(bt.TYPE_REFERENCE),Ln=Cn(bt.TYPE_IMAGE),kn=(0,l.either)(Dn,jn),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(".")},xn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Mn=(0,l.pipe)(xn,Boolean),$n=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Vn=(0,l.both)(Mn,(0,l.pipe)(xn,("rdm",(0,l.pipe)(et,(0,l.equals)("rdm")))));const Gn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=In({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]||Yn(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:[]},Wn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Gn(e,t,r);return n.length?(0,l.last)(n):null},Yn=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",bt.TYPE_NESTED),(0,l.propEq)("type",bt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",bt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.map)((t=>Wn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Bn=[bt.TYPE_ACTIVENESS_DATE,bt.TYPE_DATE,bt.TYPE_TIMESTAMP,bt.TYPE_LOCAL_DATE],qn=[bt.TYPE_ACTIVENESS_DATE,bt.TYPE_TIMESTAMP,bt.TYPE_LOCAL_DATE],Hn=e=>Bn.includes(e),Kn=e=>qn.includes(e),Qn=[bt.TYPE_INT,bt.TYPE_LONG,bt.TYPE_NUMBER,bt.TYPE_FLOAT,bt.TYPE_DOUBLE,bt.TYPE_COUNT],Jn=e=>Qn.includes(e),Xn=e=>[bt.TYPE_FLOAT,bt.TYPE_DOUBLE].includes(e),zn=[bt.TYPE_BOOLEAN,bt.TYPE_BOOLEAN_RADIO,bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Zn=e=>zn.includes(e),ei=[bt.TYPE_URL,bt.TYPE_BLOG_URL,bt.TYPE_IMAGE_URL],ti=e=>ei.includes(e),ri=Cn(bt.TYPE_EMAIL),ni=e=>bt.TYPE_SSN===e;var ii,ai=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(ii||(ii={}));const oi=(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)))})),si=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),li=(0,l.curry)(((e,t)=>(0,l.pipe)(si(e),(0,l.prop)("extendsTypeURI"))(t))),ui=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(li(e,r)));return n(r)})),ci=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=li(e,n);return r})),pi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?pi(e,si(e,t.extendsTypeURI),r):void 0,di=(e,t)=>{const r=t.map(ci(e));return(r.length?r.reduce(l.intersection):[])[0]},yi=(e,t)=>pi(e,(0,l.is)(Object,t)?t:si(e,t),"typeImage"),fi=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&ui(e,t,n.uri)?r.concat(n.uri):r),[]);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 ui(e,n,t)||ui(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})}),{})),vi=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?_t.OUT:_t.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(_t.IN),i=r(_t.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},gi=(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=Pn(t);return!t||(!t.access||t.access.includes(e))&&(e===_i.READ||!r)})),Ri=(0,l.curry)(((e,t,r)=>Ai(_i.READ,r)&&(Bt(t)?Ai(_i.INITIATE_CHANGE_REQUEST,r):Ai(e,r)))),Pi=Ri(_i.CREATE),Si=Ri(_i.DELETE),wi=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]),Di=Ni([_i.DELETE,_i.UPDATE,_i.READ]),ji=(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)(ji(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)&&ui(e,a,t.type)&&ui(e,o,r.type)})),xi=(e,t,r,n,i)=>{const a=si(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=si(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)}},$i=(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),Vi=Sn,Gi=(0,l.complement)(Vi),Wi=Ai(_i.READ),Yi=e=>{let{attributeType:t,mode:r}=e;return Gi(t)&&Pi(r,t)&&!Un(t)},Bi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Be(r.uri),o=wi(n),s=Pi(n);return(0,l.cond)([[Vi,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=wi(n),u=Si(n),c=Ki(_i.UPDATE,n,a,r),p=Ki(_i.DELETE,n,a,r);return(0,l.cond)([[Vi,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)},Hi=(0,l.curry)(((e,t,r,n)=>{const i=Yn(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)||!Hi(e,t,r[n.name],n)))))})),Ki=(0,l.curry)(((e,t,r,n,i)=>Bt(t)?Hi(_i.INITIATE_CHANGE_REQUEST,r,n,i):Hi(e,r,n,i))),Qi=(0,l.both)((0,l.complement)(Un),Wi),Ji="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===Ji})).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===Ji){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_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},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_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[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"]},[ea.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],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_READ_ENTITIES_FROM_DT]),sa=ra([ea.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),la=ra([ea.CAN_UPDATE_PROCESS_INSTANCE]),ua=ra([ea.CAN_VIEW_WORKFLOW_DEFINITION]),ca=ra([ea.CAN_CONFIG_ENVIRONMENT_REGISTER]),pa=ra([ea.CAN_UPDATE_WORKFLOW_DATA_TASK]),da=ra([ea.CAN_READ_WORKFLOW_DATA_TASK]),ya=ra([ea.CAN_MANAGE_WORKFLOW_DEFINITION]),fa=ra([ea.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Ta=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Ea=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),ma=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ha=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ba=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS]),Oa=ra([ea.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),va=ra([ea.CAN_CREATE_CONFIG_JAR]),ga=ra([ea.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),_a=ra([ea.CAN_VIEW_CONFIG_JAR]),Na=ra([ea.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Aa=ra([ea.CAN_VIEW_WORKFLOW_JOBS]),Ra=ra([ea.CAN_MAKE_BULK_UPDATE]),Pa=ra([ea.CAN_OPEN_DATA_LOADER_EXECUTE,ea.CAN_OPEN_DATA_LOADER_READ]),Sa=ra([ea.CAN_BULK_DELETE_PROFILES]),wa=ra([ea.CAN_READ_MDM_DATA_ENTITIES]),Ia=ra([ea.CAN_READ_DVF]),Ua=ra([ea.IS_FREEMIUM_ADMIN]),Ca=(0,l.reject)(Un),Da=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ca,(0,l.filter)(e))(t),ja=(0,l.curry)(((e,t)=>Da((t=>Yi({attributeType:t,mode:e})),t))),La=(0,l.curry)(((e,t)=>Da((t=>Yi({attributeType:t,mode:e})||Qi(t)),t))),ka=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Qi)),Fa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Fa(e)])))),xa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Qi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...xa(e)])))),Ma=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Ma(e)])))),$a=(0,l.pipe)(si,(0,l.converge)(l.concat,[xa,Ma]));function Va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ga(e,t,r[t])}))}return e}function Ga(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wa=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Wa(e)))},t))),Ya=e=>{var t;return Va({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Ba=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),qa=(0,l.when)(Ba,(0,l.dissoc)("values")),Ha=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Va({},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})})),Ka=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Qa=(0,ai.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Fa,t).concat((0,l.chain)(Fa,r)).some(Ka)})),Ja=e=>{let t=!1;const r=Wa((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Va({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Xa=e=>{const t=Qa(e),r=(0,l.map)((e=>Wa((0,l.pipe)(qa,(0,l.when)((0,l.always)(e),Ha))))(t)),n=(0,l.map)(Ya),i=(0,l.map)(Ja);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},za=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Za=(0,l.prop)("relationshipTypeURIs"),eo=(0,l.curry)(((e,t)=>e.graphTypes.filter(to(e,t)))),to=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(bi(e,t))},ro=(e,t)=>(0,l.pipe)(za,(0,l.defaultTo)({}),Za,(0,l.defaultTo)([]),(0,l.chain)(hi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(si(e)))(e,t),no=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),io=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),ao=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return io((0,l.complement)(no))(e)},oo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return io(no)(e)},so=(0,l.pipe)(si,(0,l.propOr)([],"matchGroups")),lo=(e,t,r)=>(0,l.pipe)(so,(0,l.find)((0,l.propEq)("uri",r)))(e,t),uo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(lo,(0,l.propOr)(r,"label"))(e,t,r))),co=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(so,(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]})),po=e=>(0,l.partition)(no,e),yo=(0,l.includes)(l.__,["and","or","not"]),fo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),To=(0,l.includes)(l.__,["equals","notEquals","in"]),Eo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return yo(t)?Eo(r):fo(t)?r.filter(Xe):To(t)?r.map((0,l.prop)("uri")).filter(Xe):[]})),l.uniq),mo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Eo),l.uniq),ho=(0,l.pipe)(so,mo),bo=(0,l.pipe)(co,mo),Oo=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},vo=(0,l.pipe)(Oo,xa),go=(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||ui(e,n,t)})(e,t))})(e,t)),_o=e=>!!e.required,No=(e,t,r)=>{const n=(0,l.cond)([[Xe,si(e)],[ze,Ei(e)]])(t);return Ao(e,n,r)},Ao=(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&&!Pn(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===bt.TYPE_REFERENCE){const n=fn(t),a=Tn(t);i=No(e,n,r).filter((e=>a.some(Ze(e.uri))))}else t.attributes&&(i=Ao(e,t,r));i&&n.push(...i)}return n})):t.type===bt.TYPE_REFERENCE?No(e,fn(t),r):[],Ro=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),_o]),e.attributes||[])},Po=(e,t)=>{const r=hn(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},So=(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)?At().text(n):n};return r(null,t)})),wo=["label","description","abbreviation","caption","toolTip"],Io=e=>So(wo,e),Uo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=tt(t);return r.find((e=>{let{uri:t}=e;return tt(t)===n}))})),Co=(0,l.curry)(((e,t)=>{const r=tt(t);return(0,l.pipe)(Uo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Do=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"})},jo=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},Lo=(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)})),ko=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=si(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Fo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xo(e,t,r[t])}))}return e}function xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mo=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:Yn(e,t)).map((t=>t.map((t=>{const i=Mo(e,t,r,n);return i.length?Fo({},t,{children:i}):t})))).orSome([]).filter((0,l.either)((0,l.complement)(kn),(0,l.prop)("children"))).filter(Qi).filter(r).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},$o=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Mo(e,t,r,["attributes","analyticsAttributes"])},Vo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Mo(e,t,r,["attributes"])},Go=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Mo(e,t,r,["analyticsAttributes"])},Wo=(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)})),Yo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return tt(r)===e})))),Bo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Yo("LUD")),(0,l.defaultTo)(r))(t||[])},qo=(e,t)=>{let{survivorshipStrategies:r}=e;return Yo(t,r)},Ho=(0,l.allPass)([(0,l.complement)(l.isNil),Ai(_i.READ)]),Ko=(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.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ai(_i.CREATE)]),Jo=(0,l.curryN)(2,(0,l.pipe)(si,Ko)),Xo=e=>{let{ov:t}=e;return!1!==t},zo=(e,t)=>((e,t)=>ti(e.type)&&ie(t))(e,t)||((e,t)=>ri(e.type)&&ae(t))(e,t),Zo=(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))),es=Zo("refEntity"),ts=Zo("refRelation"),rs=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ns=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},is=(0,l.prop)("objectURI"),as=(0,l.prop)("objectURI"),os=(0,l.prop)("type"),ss=(0,l.pipe)(es,(0,l.defaultTo)({}),is),ls=(0,l.pipe)(ts,(0,l.defaultTo)({}),as),us=(0,l.pipe)(es,(0,l.defaultTo)({}),os),cs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},ps=(0,l.evolve)({refEntity:te,refRelation:te}),ds=(e,t,r,n)=>{const i=Gn(e,r),a=si(e,t.type)||Ei(e,t.type);if(0===i.length)return null;const o=In(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=>fn(e)===r.uri||yn(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},ys=(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?ys(a.value,o):a},fs=(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 ys(e[r],i)})),Ts=(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")]]),Es=(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)(Ts),(0,l.when)((()=>i.length>0),(0,l.map)(Es(e,i))))(r)})),ms=Es(null),hs=Es(Xo),bs=(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=fs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Os=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ss,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{});function vs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gs(e,t,r[t])}))}return e}function gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _s=e=>{let{parentUri:t,attributeType:r}=e;return vs({uri:Ye(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[kn,(0,l.always)({value:{}})],[Mn,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},Ns=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(ja(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=_s({parentUri:r,attributeType:e});let s=Yn(n,e);s&&(e.type===bt.TYPE_REFERENCE&&(s=On(s)),a.value=Ns({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!$n(e)||(o[t]=[a])}return o},As=e=>{let{entity:t,metadata:r}=e;return No(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}]:ds(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:Ps({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Rs=(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===bt.TYPE_NESTED?vs({},e,{value:Rs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return vs({},s(t),Ns({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Ps=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=_s({parentUri:n,attributeType:r}),u=Ts(l);return(0,xe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ss=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,Ts(n),a,o,i)}))},ws=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,xe.ZP)(t,(e=>{Se(e.attributes||e.value,r,n,i,a,o)}))},Is=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)}))},Us=(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"))),Cs=(0,l.reject)(Us),Ds=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=>Ds({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Cs)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},js=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ds({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),ps),deleteEmptyComplex:e})},Ls=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(js(e),(0,l.reject)(l.isEmpty))},ks=Object.values(St),Fs=(0,l.includes)(l.__,ks),xs=e=>ks.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$s(e,t,r[t])}))}return e}function $s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vs=(e,t)=>`${e}_${t}`,Gs=[Ft.matches.name,Ft.matchRules.name],Ws=(0,l.values)(It).map((e=>e.name)),Ys=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ws)))),Bs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Gs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Vs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),qs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Ys(r),Bs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Vs(`dtPotentialMatches.${t.name}`,"")))))(Ft)},Hs=(0,l.propEq)("uri",Ft.type.uri),Ks=e=>(0,l.values)(kt).some((0,l.propEq)("uri",e.uri)),Qs=(0,l.propEq)("uri",Lt.sourceSystems.uri),Js=Object.values(wt),Xs=(0,l.includes)(l.__,Js),zs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Zs=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},el=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:n})},tl=(0,l.propEq)("uri",wt.roles.uri),rl=(0,l.propEq)("uri",wt.tags.uri),nl=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)},il="UrlThumbnail",al="CdnUrlThumbnail",ol=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Xo):(0,l.head)(n);return e&&e.value}return null})),sl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>ol(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),ll=sl(["CdnUrl","Url"],!0),ul=sl(["CdnUrlPreview","UrlPreview"],!0),cl=sl([al,il],!0),pl=sl([al,il]),dl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[wn,(0,l.always)(t)],[(0,l.both)(Sn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=wn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Fs(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)}),[])},yl=(e,t,r)=>{const n=ka(e),i=(0,l.any)(r?l.T:Xo);return dl(n,t,i)},fl=(e,t,r,n,i,a)=>{const o=Be(null==r?void 0:r.uri)?ja(t,e):La(t,e);return dl(o,r,((e,o)=>{const s=Yi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Xo,e)||wn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Tl;const El=e=>{Tl=e};function ml(e,t){return Tl(e,t)}const hl=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)})),bl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return ml("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},Ol=(0,l.once)((()=>ml("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),vl=e=>ml("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),gl=(e,t)=>ml("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),_l=e=>z.fromNull(dt[e]).map(At().text).orSome(""),Nl=(0,l.curry)(((e,t)=>`${e}_${t}`)),Al=(0,l.split)("_"),Rl=(0,l.includes)("_"),Pl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Sl=(0,l.curry)(((e,t)=>e.some(Pl(t)))),wl=Sl([ct.IN_RANGE,ct.COUNT_RANGE,ct.WITHIN]),Il=Sl([ct.EXISTS,ct.MISSING_VALUE]),Ul=(0,l.cond)([[Il,(0,l.always)(0)],[wl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),Cl=(0,l.complement)(Il),Dl=Sl([ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS]),jl=Sl([ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE]),Ll=Sl([ct.IN_FILE,ct.NOT_IN_FILE]),kl=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}},Fl=Sl([ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS]),xl=Sl([ct.WITHIN]),Ml=[[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]],$l=(e,t)=>Ml.some((r=>r.includes(e)&&r.includes(t))),Vl=(0,l.pipe)(l.omit,l.values),Gl={OPTIONS_FOR_STRING:Vl(["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:Vl(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_BLOB:Vl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_NUMBER:Vl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_LOOKUP:Vl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ct),OPTIONS_FOR_ENUM:Vl(["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]},Wl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case bt.TYPE_TYPEAHEAD:case bt.TYPE_STRING:case bt.TYPE_PASSWORD:case bt.TYPE_TEXT:case bt.TYPE_CIK_ID:case bt.TYPE_URL:case bt.TYPE_BLOG_URL:case bt.TYPE_IMAGE_URL:case bt.TYPE_EMAIL:return Gl.OPTIONS_FOR_STRING;case bt.TYPE_LOOKUP:case bt.TYPE_DEPENDENT_LOOKUP:return Gl.OPTIONS_FOR_LOOKUP;case bt.TYPE_ENUM:return Gl.OPTIONS_FOR_ENUM;case bt.TYPE_DATE:case bt.TYPE_ACTIVENESS_DATE:case bt.TYPE_TIMESTAMP:case bt.TYPE_LOCAL_DATE:return Gl.OPTIONS_FOR_DATE;case bt.TYPE_BOOLEAN:case bt.TYPE_BOOLEAN_RADIO:return Gl.OPTIONS_FOR_BOOLEAN;case bt.TYPE_BLOB:return Gl.OPTIONS_FOR_BLOB;case bt.TYPE_LONG:case bt.TYPE_INT:case bt.TYPE_FLOAT:case bt.TYPE_DOUBLE:case bt.TYPE_NUMBER:return Gl.OPTIONS_FOR_NUMBER;case bt.TYPE_ENTITY_ID:return Gl.OPTIONS_FOR_ID;case bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ct.EQUALS];case bt.TYPE_COUNT:return Gl.OPTIONS_FOR_COUNT;case bt.TYPE_NESTED:case bt.TYPE_REFERENCE:case bt.TYPE_IMAGE:return Gl.OPTIONS_FOR_COMPLEX;default:return Gl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(jl,n):n},Yl=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)}`}),"")}},Bl=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),ql=e=>Array.isArray(e)?e.map(ql).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Hl=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Kl=e=>`'${e}'`,Ql=e=>`"${e}"`,Jl=(0,l.pipe)(ql,Hl),Xl=(0,l.pipe)(Jl,Kl),zl=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(wl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Zl=(e,t)=>jl(t)?{type:bt.TYPE_INT}:Ll(t)?{type:bt.TYPE_FILE}:Fl(t)&&!xl(t)&&Kn(e.type)?{type:bt.TYPE_LOCAL_DATE}:e,eu=Object.values(mt),tu=e=>eu.includes(e),ru=e=>At().text(ht[e]),nu=e=>{const t=f()();switch(e){case mt.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case mt.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case mt.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case mt.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case mt.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function iu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){au(e,t,r[t])}))}return e}function au(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ou=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),su=(0,l.curry)(((e,t,r)=>{const n=r.map(wl(e)||t.endsWith(".count")?Jl:Xl).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),lu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},uu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ul(t);return(0,l.pipe)(lu(i),(0,l.map)(su(t,r)),ou(" or "))(n)},cu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Xl).join(",")})`},pu=e=>`*${e}*`,du=e=>`URL:${e}`,yu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,fu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ct.IN_FILE?r:`not ${r}`},Tu=(e,t)=>[R(e,t),P(e,t)],Eu=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!mu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ct.ON:return iu({},e,n?{filter:ct.EQUALS}:{filter:ct.IN_RANGE,values:[Tu(i,n)]});case ct.BEFORE:return iu({},e,{filter:ct.LTE,values:[[P(i,n)]]});case ct.AFTER:return iu({},e,{filter:ct.GTE,values:[[R(i,n)]]});case ct.WITHIN:return iu({},e,{filter:ct.IN_RANGE,values:[nu(i)]})}}return e}),uu),mu=(0,l.propSatisfies)(Kn,"type"),hu=[[(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(uu({filter:ct.EQUALS,fieldName:t,values:[r]}))),new Yl).build())),ou(" or "))(r)}],[(0,l.propEq)("filter",ct.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return uu({fieldName:r,filter:t,values:n.map((0,l.pipe)(ql,pu))})}],[(0,l.propEq)("filter",ct.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?uu(iu({},e,{values:(0,l.flatten)(r)})):yu(r)?cu(iu({},e,{filter:"listEquals"})):uu(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=Ul(t);return(0,l.pipe)(lu(i),(0,l.map)(su(t,r)),ou(" and "))(n)})(iu({},e,{values:(0,l.flatten)(e.values)})):mu(e)?(e=>{const{values:t}=e,r=!mu(e),[n]=t;return(new Yl).addClause(uu(iu({},e,{filter:ct.LT,values:[R(n,r)]}))).addClause(uu(iu({},e,{filter:ct.GT,values:[P(n,r)]}))).orBuild()})(e):yu(t)?cu(iu({},e,{filter:"not listEquals"})):uu(e)}],[(0,l.propSatisfies)(Ll,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return uu({fieldName:r,filter:fu(t,r),values:n.map((0,l.prop)("link")).map(du)})}],[(0,l.propSatisfies)(jl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return uu({fieldName:`${r}.count`,values:n,filter:kl(t)})}],[(0,l.propSatisfies)(Fl,"filter"),Eu],[(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 su(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return su(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,uu]],bu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Cl(e)||vu(r))},Ou=e=>Array.isArray(e)?vu(e):null!=e&&ql(e).length>0,vu=e=>e&&e.length>0&&e.every(Ou);function gu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _u=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Nu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Au=(e,t,r)=>"children"===e?Pu(r,[...t][0],!0):r,Ru=(e,t,r)=>"values"===e?[...r,...t]:r,Pu=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)(Au,t),e);if(!r&&Dl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Ru,t),e)}return(0,l.append)(t,e)},Su=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=_u(e),r=e=>e.fieldName===t?e:r({fieldName:Nu(e),children:[e]});return r(e)})(t);return Pu(e,r)}),[]),wu=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")),Iu=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&&wu(n)&&!t?`inSameAttributeValue(${r(n,!1)})`:r(n,i)}],...e])(a))),new Yl).buildWithOperators(n.map((0,l.prop)("operator")))}},Uu=(0,l.pipe)((0,l.propOr)("","filter"),Rl),Cu=(0,l.map)((0,l.when)(Uu,(e=>{const[t,r]=Al(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Du=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)(bu),Cu,Su,Iu([...e,...hu],t))},ju=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Lu=[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS],ku=[ct.EQUALS,ct.NOT_EQUALS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.FULL_TEXT,ct.EXISTS],Fu=[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],xu=(e,t)=>{const r=Rn(e);return(e=>{switch(e){case St.startDate.name:case St.endDate.name:case It.dueDate.name:case Dt.createdTime.name:case Dt.updatedTime.name:case Lt.reltioLoadDate.name:case Lt.createDate.name:case Lt.updateDate.name:case Lt.deleteDate.name:case Lt.publishDate.name:return Lu;case jt.matches.name:case Lt.count.name:return Fu;case It.workflow.name:case It.assignee.name:case It.step.name:case Ut.commenter.name:case Dt.createdBy.name:case Dt.updatedBy.name:case Lt.sourceSystems.name:case Lt.value.name:return ku;default:return null}})(t)||Wl(r)},Mu=[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],$u=(0,l.pipe)(xu,(0,l.filter)((0,l.includes)(l.__,Mu))),Vu=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Gu=e=>{let{query:t,body:r}=e;return t=Vu(t),ml(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Wu=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)(Du(),ju(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Gt(i)}`},Yu=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=Wu(e,t,r);return ml(n)},Bu=(0,l.pipe)((0,l.reject)(l.isNil),Vt),qu=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(Du(),ju(i))(r),c=Bu({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return Gu({query:c,body:p})},Hu=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return qu({fieldName:t,searchParams:i,options:n})},Ku="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Qu=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)(Du(),ju(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Ku,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Gt(i)}`},Ju=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=Qu(e,t,r);return ml(n)},Xu=e=>nc(e,{select:"secondaryLabel"}),zu=(e,t)=>{const{select:r=Ku,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),ml("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Zu=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Be)),ec=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=Zu(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)(Du(),ju(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),ml(`${s}/api/${o}/${t}/_object`,m)},tc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,rc={options:"sendHidden,addRefAttrUriToCrosswalk"},nc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rc;return ml(`/${e}${Gt(t)}`)},ic=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 ml(n,r)},ac=e=>ml(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),oc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return ml(`/entities/_events/_total${Vt({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},sc=(e,t)=>ml(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),lc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return ml(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},uc=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return ml(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Vt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cc=e=>{const t=new FormData;return t.append("file",e),ml("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ce(e,At().text("Can't upload file"));return Promise.reject(t)}))},pc=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 ml(`/personal/findSavedSearches${Vt({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"}})},dc=e=>ml(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),yc=e=>ml("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),fc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return ml(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Tc=e=>{let{uri:t}=e;return ml(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ec=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),fc)(e),mc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),fc)(e);function hc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bc=["max","offset","filter"],Oc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Oc(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){hc(e,t,r[t])}))}return e}({},t,(0,l.pick)(bc,e)))),vc=(0,l.omit)(["activeness"]),gc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],tr.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],tr.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Oc(e),(0,l.omit)(bc))(e))),vc,(0,l.omit)(["labels"])))(t),{url:`/${e}/_connections${Gt({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},_c=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Nc=(0,l.reject)(l.isNil),Ac=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Rc=e=>ml(Ac(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Pc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Ac);return ml(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Sc=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?Ls()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Nc,re,JSON.stringify);return ml(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},wc=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"),Ac,n),o=he(i(t),i(r)).concat(Oe(t,r));return ml(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Ic=(e,t)=>{const{url:r,options:n}=gc(e,t);return ml(r,n).then(_c)},Uc=(e,t)=>ml(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Cc=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===_t.IN?a.inRelations=[n]:a.outRelations=[n],ml(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Dc=(e,t)=>ml(`/recentSearches/?environment=${e}&tenant=${t}`,{method:"GET",application:"explorer",headers:{"Content-Type":"application/json"}}),jc=e=>ml("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Lc=e=>{let{environment:t,tenant:r,createdDate:n}=e;return ml(`/recentSearches?environment=${t}&tenant=${r}&createdDate=${n}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function kc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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 xc={select:"label,secondaryLabel,name,type,startDate,endDate"},Mc=(0,l.reject)(l.isNil),$c=(0,l.pipe)(Mc,Vt),Vc=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=kc({},xc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return ml(`/${t}/_tree${$c(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Gc=e=>{let{uri:t,graphUri:r}=e;const n=kc({},xc,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return ml(`/${t}/_parents${$c(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Wc=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=kc({},xc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return ml(`/${t}/_hops${$c(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Yc(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 Bc=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},qc="/activities",Hc=e=>{let{label:t,description:r}=e;return ml(qc,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:Bc()}})},Kc=e=>{const t=Gt(e);return ml(qc+t,{method:"GET"})},Qc=e=>ml(`/activities/_total${Gt(e)}`,{method:"GET"}),Jc=e=>{const{entityUri:t}=e,r=Yc(e,["entityUri"]);return ml(`/${t}/_activities${Gt(r)}`,{method:"GET"})},Xc=e=>{const{entityUri:t}=e,r=Yc(e,["entityUri"]);return ml(`/${t}/_activities/_total${Gt(r)}`,{method:"GET"})};function zc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zc(e,t,r[t])}))}return e}function Zc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ep=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},tp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return ml(ep({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},rp=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=ep({url:r,workflowPath:t,tenant:n})),ml(s,{method:i||"GET",body:JSON.stringify(a),headers:zc({"Content-Type":"application/json"},null!=o?o:{})})},np=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=ep({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return ml(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)},ip=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=ep({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?zc({},l,{comment:o}):l;return ml(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},ap=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=ep({url:`/tasks${s?Gt(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(zc({objectURIs:[i]},(0,l.reject)(E,a)))};return ml(u,zc({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},op=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i}=e;const a={assignee:i};return ml(ep({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},sp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i}=e;return ml(ep({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:JSON.stringify(i)})},lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return ml(ep({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return ml(ep({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},pp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return ml(ep({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},dp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},yp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},fp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},Tp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return ml(ep({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Ep=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return ml(ep({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},mp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Xo);return a&&a[0]&&(r=n.length>0&&a[0].value?mp(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),hp=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=mp(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},bp=/[,\s]*$/,Op=e=>{const t=At().text(gt);if(!e)return t;const r=e.replace(bp,"");return""===r.toString().trim()?t:r},vp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},gp=(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=vp(e,r.referencedEntityTypeURI);if(n)return hp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return hp({attributes:t||{}},r.dataLabelPattern);return""},_p=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Np=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Ap=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",Rp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),cl,(0,l.prop)("value"))),Pp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),Rp),Sp=(e,t,r)=>{const n=Pp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(fs(e),Rp)))(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")])})(si(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ds(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,Rp))(r)})(e,r)||yi(e,r.type);return Ap(t,n)};function wp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ip(e,t,r[t])}))}return e}function Ip(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Up="DTSS/",Cp=(0,l.replace)(new RegExp("^entities/"),""),Dp=e=>Up+e.dataTenant+"/"+e.uri,jp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Lp=e=>!(!e||!e.dataTenant),kp=(0,l.startsWith)(Up),Fp=(0,l.pipe)((0,l.ifElse)(kp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),xp=(0,l.ifElse)(Lp,Dp,(0,l.prop)("uri")),Mp=e=>e&&e.uri?e.dataTenant?Dp(e):Cp(e.uri):"",$p=(0,l.curry)(((e,t,r)=>(si(t,r.type)||{})[e]||"")),Vp=$p("label"),Gp=$p("typeGraphIcon"),Wp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=si(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(Xo)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:gp(e,o,i),uri:a.uri}})).filter(l.identity):[]},Yp=(0,l.pipe)(Wp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Bp=(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=Bp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Bp(e.slice(1),r)}})),qp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Hp=e=>(0,l.propOr)([],"matchRules",e),Kp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?wp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Qp=(e,t,r)=>t&&r?r.aEntity:e,Jp=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 ml(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Vt)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Xp=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 ml(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Vt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},zp=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return ml("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Zp=(e,t,r)=>Promise.all(t.map((async t=>{await ml(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),ed=async(e,t)=>await Zp(e,t,"NOT"),td=async(e,t)=>await Zp(e,t,"MATCH"),rd=async(e,t)=>await Promise.all(t.map((async t=>{await ml(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function nd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){id(e,t,r[t])}))}return e}function id(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ad(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 od=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return ml(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},sd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Rd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},ld=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Rd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},ud=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return ml(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},cd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return ud({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},pd=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?zp(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return ud({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},dd=(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=ad(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)}),[])),yd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),dd),fd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return ml(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(yd)},Td=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)},Ed=Td((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return ml(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(yd)})),md=Td((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return ml(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),hd=(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)}},bd=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return ml(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Od=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 bd(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},vd=Od("NOT"),gd=Od("MATCH"),_d=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([Zp(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return bd(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},Nd=_d("NOT"),Ad=_d("MATCH");function Rd(e){let{requestProvider:t=ml,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,nd({},ad(s,["headers"]),{headers:nd({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Pd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Rd({url:Qu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Sd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Rd({url:Wu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},wd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=gc(t,r);return Rd({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(_c,(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)))}))))},Id=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Rd({url:`${tc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Ud=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return ml(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Cd=e=>{let{dtssPath:t,tenant:r}=e;return ml(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},Dd=e=>{let{dtssPath:t,customerTenant:r}=e;return ml(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},jd=e=>{let{dtssPath:t,tenants:r}=e;return ml(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},Ld=()=>ml("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fd(e,t,r[t])}))}return e}function Fd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xd=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=kd({},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 ml(`${t}/api/${r}/graph/search${Gt({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Md=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return ml(`${t}/api/${r}/graph/search/count`,{method:"POST",body:kd({},n,i),headers:{"Content-Type":"application/json"}})},$d=(e,t)=>`${e}/${t}/comments`,Vd=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return ml(`${$d(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Gd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ml(`${$d(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Wd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ml($d(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Yd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ml(`${$d(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Bd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ml(`${$d(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},qd=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return ml(`${$d(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Hd=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Gt({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return ml(`${$d(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qd(e,t,r[t])}))}return e}function Qd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jd=e=>{let{tenant:t,servicesPath:r}=e;return ml(`${r}/oauth/proxy${Gt({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Xd="graphExport",zd=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await ry({servicesPath:e,tenant:t,environment:r,namespace:Xd,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Kd({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await ry({servicesPath:e,tenant:t,environment:r,namespace:Xd,options:Kd({method:"PUT"},o)})}catch(e){s=null}return s||(s=await ry({servicesPath:e,tenant:t,environment:r,namespace:Xd,options:Kd({method:"POST"},o)})),s},Zd=e=>{let{servicesPath:t,key:r}=e;return ml(`${t}/settings${Gt({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ey=e=>{let{servicesPath:t}=e;return ml(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},ty=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return ml(`${n}/plugins${Gt({tenant:t,user:r})}`,{method:"GET"})},ry=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return ml(`${n}/configService${Gt({tenant:t,environment:r,namespace:a,projection:o})}`,i)},ny=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return ry({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},iy=e=>{let{servicesPath:t,stateHash:r}=e;return ml(`${t}/searchLink?key=${r}`,{method:"GET"})},ay=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),ml(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},oy=e=>ml(`/${e}?showObjectsInfo=true`,{method:"GET"}),sy=e=>{let{exportPath:t,tenant:r,options:n}=e;return ml(`${t}/${r}/activities${Gt(n)}`,{method:"POST"})};function ly(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uy(e,t,r[t])}))}return e}function uy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cy=e=>{const{entityUri:t}=e;return ml(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},py=e=>{let{entityUri:t,crosswalk:r}=e;return ml(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},dy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return ml("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[ly({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),ly({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},yy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return ml(`/${r}/_${n}${Gt({contributorURI:t})}`,{method:"POST"})},fy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return ml(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},Ty=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return ml(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ey=e=>{let{entityUri:t,crosswalkId:r}=e;return ml(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},my=e=>{let{entityTypeUri:t}=e;return ml(`/dataQuality/fillRates${Vt({entityType:tt(t)})}`,{method:"GET"})},hy=e=>{let{entityTypeUri:t,attributeFieldName:r}=e;return ml(`/dataQuality/statistic${Vt({entityType:tt(t),attribute:r})}`,{method:"GET"})},by=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return ml(`${t}/api/${r}/dataValidationFunctions/entityTypes/${tt(n)}`,{method:"GET",headers:{env:i}})},Oy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return ml(`/${t}${Gt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},vy=e=>{let{attributeUri:t,value:r}=e;return ml(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},gy=e=>{let{attributeUri:t,value:r}=e;return ml(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},_y=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return ml(`/${t}${Gt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Ny=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Gt({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Ls()([[{value:a}]]);return ml(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Ay=e=>{let{entityUri:t,attributeName:r,value:n}=e;return ml(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Ry=e=>{let{entityUri:t,attributeName:r}=e;return ml(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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 Sy=e=>{let{entityUri:t}=e;return ml(`/${t}/_historicURIs`,{method:"GET"})},wy=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 ml(`/${t}/_changesWithTotal${Gt(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){Py(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Iy=(e,t)=>ml(`/${e}/_previousChange${Gt({timestamp:t})}`,{method:"GET"}),Uy=(e,t)=>ml(`/${e}${Gt({time:t})}`,{method:"GET"});function Cy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Dy(e,t,r[t])}))}return e}function Dy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jy=e=>{let{url:t,method:r,data:n,headers:i}=e;return ml(t,Cy({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:Cy({"Content-Type":"application/json"},null!=i?i:{})}))},Ly=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Gt({options:a.join(","),severity:o.join(",")});return ml(`${t}/validate/${i}/entity/${Mp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},ky=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return ml(`${t}/validate/${n}/entity${Gt({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Fy=e=>{let{tenant:t,apiPath:r}=e;return ml(`${r}/tenants/${t}/name`,{method:"GET"})},xy=e=>{let{tenant:t,apiPath:r}=e;return ml(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},My=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return ml(`${a}/preferences${Gt({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},$y=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return ml(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Vy=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return ml(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})};var Gy=r(47485);const Wy=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=qe(),s={attributes:Ns({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=ds(r,e,n.uri)[0];return i&&i.value?ws({entity:e,attributeType:n,uri:i.uri,value:t}):Ps({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Yy=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ss),(0,l.filter)(Be),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),By=(0,l.curry)(((e,t)=>{const r=Yy(e=e||{},t=t||{});return r.concat((0,l.chain)(By(e),r))})),qy=(0,l.curry)(((e,t)=>(0,l.pipe)(ue,(0,l.filter)(e))(t))),Hy=qy((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Ky=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Be)),Qy=e=>(0,l.pipe)(Hy,Ky(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Jy=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Hy,(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})),Xy=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Be),(0,l.omit)(["uri","timestamp"])),zy=(0,l.pipe)(Xy,(0,l.evolve)({attributes:Ls(!0)})),Zy=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=Qy(i);if(a.length>0)for(const t of a)e=Jy(t,r[t].uri,e);const o=(s=await ic(zy(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},ef=async(e,t,r)=>{const n=rf(e,t),i={};for(const t of n)i[t]=await Zy(e,t,i,r);return i},tf=(0,l.curry)(((e,t)=>{const r=Gy.Node(t);return Qy(e[t]).forEach((t=>{const n=tf(e,t);r.addEdge(n)})),r})),rf=(e,t)=>(0,l.pipe)((0,l.map)(tf(e)),(0,l.map)(Gy.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),nf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Xy))})),af=(e,t)=>{const r=_e(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=be(e,t),a=Oe(e,t);return[...ve(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),ge((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},of=(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 Jy(r,n,e)}),e))))}),t)}),nf),sf=(0,l.curry)(((e,t)=>(0,l.when)(Be,(0,l.propOr)(l.__,t,e),t)));function lf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uf(e,t,r[t])}))}return e}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cf=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:dr.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},pf=e=>{let{relationUri:t}=e;return{type:dr.DELETE_RELATION,parameters:{relationUri:t}}},df=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:dr.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},yf=e=>{let{oldRelation:t,newRelation:r}=e;return{type:dr.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},ff=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:dr.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Tf=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Ef=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case dr.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Sc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case dr.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Pc(e,i).then(o)};case dr.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Cc(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case dr.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return wc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case dr.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[pf({relationUri:o}),cf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(mf(n)),(0,l.map)(Ef),Tf)(s)}}},mf=e=>t=>lf({dcrProcessor:e},t),hf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Wt({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(mf(r)),(0,l.map)(Ef),Tf,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},bf=e=>t=>(0,l.map)((t=>lf({},t,{parameters:(0,l.evolve)({parentUri:sf(e),entityUri:sf(e),newEntityUri:sf(e)},t.parameters)})),t);function Of(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 gf=e=>Of({},(0,l.path)(Cf(),e),{startDate:(0,l.path)(kf(),e),endDate:(0,l.path)(Ff(),e)}),_f=(e,t)=>(0,l.pipe)((0,l.path)(Lf()),sf(t))(e),Nf=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=_f(e,r),i=(0,l.path)(Df(),e)===yr.IN,a=e.parentEntityUri||n;return cf({parentUri:i?t:a,relation:gf(e),entityUri:i?a:t})})),...o.map((t=>{const i=_f(t,r),a=(0,l.path)(Df(),t)===yr.IN,o=i!==(0,l.pipe)((0,l.path)(Cf()),a?xf:Mf)(t),s=Gf(e,(0,l.path)(If(),t)),u=t.parentEntityUri||n,c=sf(r,i);return o?ff({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Cf(),t),isReversed:!1}):yf({oldRelation:(0,l.path)(Cf(),s),newRelation:gf(t)})})),...i.map((e=>pf({relationUri:e}))),...s.map((e=>df({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},Af=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;return Of({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType}})}),{}),Rf=(e,t)=>(0,l.pipe)(Ei,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(ks),Ca)(e,t),Pf=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)}},Sf=(e,t,r)=>{const n=hp(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)},wf="relation",If=(0,l.always)([wf,"relationUri"]),Uf=(0,l.always)([wf,"relationType"]),Cf=(0,l.always)([wf,"object"]),Df=(0,l.always)([wf,"direction"]),jf=(0,l.always)([wf,"object","attributes"]),Lf=(0,l.always)(["entity","entityUri"]),kf=(0,l.always)([wf,"startDate"]),Ff=(0,l.always)([wf,"endDate"]),xf=(0,l.path)(["startObject","objectURI"]),Mf=(0,l.path)(["endObject","objectURI"]),$f=(0,l.path)(["startObject","objectTypeURI"]),Vf=(0,l.path)(["endObject","objectTypeURI"]),Gf=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(If()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Gf(r.connections,t);if(e)return e}}},Wf=(0,l.pipe)(Gf,(0,l.path)(Cf())),Yf=(0,l.allPass)([(0,l.pipe)((0,l.path)(Lf()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(Uf()),(0,l.complement)(E))]),Bf=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:He()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Kf({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=qf(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?Pf(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},qf=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:_t.IN}:{type:t[0],direction:_t.OUT}:null},Hf=e=>e.uri||e,Kf=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===_t.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"],si(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],si(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Hf,Ei(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(_t.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(_t.OUT)),(0,l.map)(u))},t)||{}};function Qf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jf(e,t,r[t])}))}return e}function Jf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Qf({},t,{[r]:{parents:n,children:i}})},zf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Qf({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},Zf=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=Yy(t,i),o=Xf({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>Zf(n.uri,t,[e],r)),o)},eT=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)(If(),n),a=t?zf({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Lf(),n),s=Be(o)?[o]:[],u=Xf({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>Zf(t,r,[i],e)),u)}),n)},tT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return eT(r,e,t,Zf(e,t))},rT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return tT(t,r,n);if(Qe(e)){const t=Gf(n,e);return t&&eT([t],null,r)}return r[e]?Zf(e,r):void 0},nT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>nT(e,t))))},iT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>iT(e,t))))},aT=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ke(t),u=tT(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(Qe(c)){if(s=Gf(i,c),!s)return null;o.push({type:Zt.relationConnection,value:s,valueType:Ei(a,(0,l.path)(Uf(),s))});continue}if(Qe(u)){const e=n[c];if(!e)return null;o.push({type:Zt.tempEntity,value:e,valueType:si(a,e.type)});continue}const p=n[u],d=Os(p,c),y=n[c];if(!d||!y)return null;o.push({type:Zt.attributeValue,value:d,valueType:Wn(a,it(d.uri,p.type))}),o.push({type:Zt.tempEntity,value:y,valueType:si(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},iT(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Qe(s),d=p?Wf(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):si(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Yn(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:Zt.tempEntity,value:T,valueType:si(a,T.type)}),o.push({type:Zt.attributeValue,value:s,valueType:E}),m=s.value;const l=ss(s);T=l&&Be(l)?n[l]:null}}return o},oT=e=>e.every((e=>{let{type:t}=e;return[Zt.attributeValue,Zt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Zt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,sT=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?sT(t.value):[]];return e.concat(r)}),[])),lT=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,uT=e=>{const t=[...sT((null==e?void 0:e.attributes)||[]),...sT((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},cT=(e,t)=>[e,...t.map((t=>lT(e,t)))],pT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},dT=(e,t)=>{switch(e){case er.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case er.ENTITY_ATTRIBUTE:return(e=>{let{uri:t}=e;return[at(t)]})(t);case er.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case er.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},yT=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),fT=(0,l.curry)(((e,t)=>{const r=Oo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(fT(e,r.extendsTypeURI)):n})),TT=(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))),ET=(e,t)=>(0,l.pipe)((0,l.prop)("type"),fT(e),TT(t))(t);function mT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hT=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}},bT=e=>!e.deactivated,OT=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},vT=e=>OT(e)+e.message,gT=(0,l.unless)(l.isNil,(0,l.prop)("message")),_T=(0,l.unless)(l.isNil,(0,l.prop)("type")),NT=(0,l.curry)(((e,t)=>Ze(t.parentUri,e))),AT=(0,l.curry)(((e,t)=>t.parentUri===e)),RT=(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",bt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.any)(Ze(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),PT=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),ST=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),wT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([FT,bT,NT(e),RT(t),(0,l.complement)(ST(e,t.uri))]))(r)},IT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([FT,bT,AT(e),PT(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",Qt.missed))]))(r);return n&&n.message||""},UT=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===Qt.missed))},CT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([bT,(0,l.propEq)("type",Qt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(If(),e))]))(t)},DT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([bT,(0,l.propEq)("type",Qt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},jT=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([bT,NT(t)]))(r)},LT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([bT,(0,l.propEq)("type",Qt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},kT=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?aT(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 Zt.attributeValue:{const e=a;if(Dn(a))return hp(o,e.dataLabelPattern);if(jn(a)){const t=o,i=ss(t),a=yn(e),s=si(n,a);return Be(i)?hp(r[i],s.dataLabelPattern):t.label}return""}case Zt.tempEntity:return hp(o,a.dataLabelPattern);case Zt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=si(n,null==e?void 0:e.entityType);return`${Op(i&&Be(i)?hp(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){mT(e,t,r[t])}))}return e}({},e,{label:Op(t)})}))},FT=e=>!e.severity||e.severity===Xt.ERROR,xT=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case bt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(xT(n))}));case bt.TYPE_REFERENCE:return!!es(t);case bt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),MT=(e,t)=>e.every((0,l.complement)(xT(t))),$T=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=No(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ds(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Xo(e.parent))))).forEach((e=>{MT(e.attrValues,n)&&r.push(hT({type:Qt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:At().text("Attribute is required"),source:Jt.local}))})),r}),[])},VT=(0,l.curry)(((e,t,r)=>ds(e,t,r,!1))),GT=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),si(e),(0,l.prop)("attributes"),(0,l.reject)(Un),(0,l.filter)(jn),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(VT(e,t)));return(0,l.pipe)(r,(0,l.reject)(ss),(0,l.map)((e=>{let{uri:r}=e;return hT({type:Qt.missedRefEntity,uri:"",attributeTypeUri:it(r,t.type),parentUri:r,message:At().text("Entity is required"),source:Jt.local})})))(t)},WT=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ss,Be)).flatMap((n=>{const i=ss(n),a=t[i],o=Wn(e,it(n.uri,r.type));return YT(e,t,o,a)})),YT=(e,t,r,n)=>{const i=Tn(r),a=i.map((t=>Wn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",bt.TYPE_REFERENCE))).flatMap(mn).concat(i);return BT(e,t,n,(e=>a.some(Ze(e.uri))))},BT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=$T(e,r,n),a=GT(e,r),o=WT(e,t,r);return[...i,...a,...o]},qT=(e,t)=>{const r=(0,l.path)(Cf(),t)||{};return $T(e,r)},HT=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Lf()),(0,l.ifElse)(Be,(e=>t[e]),(0,l.always)(null)))(r),i=qT(e,r),a=(e=>(0,l.path)(Lf(),e)?[]:[hT({type:Qt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(Uf(),e),parentUri:(0,l.path)(If(),e),message:At().text("Entity is required"),source:Jt.local})])(r),o=((e,t,r)=>r?BT(e,t,r):[])(e,t,n);return[...i,...a,...o]},KT=e=>(0,l.path)(["entity","uri"],e)?[]:[hT({type:Qt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:At().text("Entity is required"),source:Jt.local})],QT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=$T(e,r),i=KT(t);return[...n,...i]};function JT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XT=(e,t)=>{var r,n;const i=si(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Qa(e)},zT=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),ZT=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(zT(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},eE=(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)(ls,Be,l.not)]),(e=>{const t=(0,l.pipe)(ls,tt)(e);return ZT((e=>e.replace(t,t+$e)))(e)})),(0,l.when)((0,l.pipe)(ss,Be),(t=>{const r=ss(t),n=e[r],i=n&&rE(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){JT(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),tE=(e,t,r)=>ve(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),ge((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)(eE(r,e.type)),(0,l.map)(ZT(ut))))})(e))),rE=(e,t)=>(0,l.evolve)({attributes:Ds({valueTransformer:(0,l.pipe)(ps,eE(t),zT(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function nE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iE(e,t,r[t])}))}return e}function iE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aE=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Me,"g"),"uri$$$$").replace(new RegExp($e,"g"),""))),oE=e=>(0,l.pipe)((0,l.evolve)({objectUri:aE,objectParentUri:aE}),(e=>{return nE({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?Qt.missed:Qt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&lt(e.objectUri),uri:e.objectUri,source:Jt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),sE=(e,t)=>(0,l.map)((0,l.pipe)(oE,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=kT(t,s),p=null!=c&&c.length?c.slice(0,-1):kT(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Wn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Zt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return nE({},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(jn(i)&&hn(i).includes(o)){const i=ss(n.value),o=i&&Be(i)?t[i]:null;return o?nE({},e,{parentUri:o.uri,path:a.concat({type:Zt.tempEntity,value:o,valueType:si(r,o.type),label:""})}):e}}return e}})(t)))(e),lE=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 uE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cE;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(cE||(cE={}));const pE={},dE={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"]}},yE=(0,l.curry)(((e,t)=>{const r=(e=>{if(!pE[e]){const t=dE[e]||dE.random0;pE[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){uE(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return pE[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]})),fE=e=>yE(cE.Charts,e);var TE=r(51404),EE=r.n(TE);const mE=Array.from({length:100},((e,t)=>t/100)),hE=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)},bE={},OE=new(EE())({hash:hE,saturation:mE.slice(15,71),lightness:mE.slice(50,90)}),vE=(0,l.curry)(((e,t,r)=>{t in bE||(bE[t]={});const n=bE[t];r in n||(n[r]=((e,t)=>{const r=String(hE(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),gE=vE(OE,"crosswalks"),_E=vE(OE,"sources"),NE=vE(OE,"contributors");function AE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){RE(e,t,r[t])}))}return e}function RE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PE=(0,l.has)("items"),SE=e=>0===e,wE=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)},IE=e=>e.reduce(((e,t)=>e+t.width),0),UE=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),CE=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),DE=e=>e.reduce(((e,t)=>e+t.height),0),jE=e=>(0,l.is)(String,e)&&e.includes("%"),LE=e=>Boolean(e.spacer),kE=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),FE=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(PE(t)?FE(t):t)),[]),xE=e=>({id:e.layout}),ME=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xE;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=jE(r.width)?kE(i,r.width):u}return wE(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return wE(n,t,r)},o=(e,t)=>PE(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,PE(s)?n(s.layout):e(s.view)),d=SE(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(PE(s))return o.concat(p(AE({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(AE({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:IE(o),height:UE(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=PE(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=SE(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(PE(i))return r.concat(p(AE({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(AE({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?wE(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?wE(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:CE(i),height:DE(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=SE(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return AE({},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=AE({},e,{width:a}),s=AE({},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(AE({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return AE({},e,{height:DE(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(AE({},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 AE({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=AE({},t,{items:(0,l.reject)(LE,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 FE(f)},$E=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id))));function VE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){GE(e,t,r[t])}))}return e}function GE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WE={BarChart:Tr.BAR,BarChartGrouped:Tr.BAR,BarChartHorizontal:Tr.BAR,LineChart:Tr.LINE,Map:Tr.MAP,Pie:Tr.PIE},YE=(e,t)=>ot(e)?rt(e,t):e,BE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=WE[r];return VE({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},qE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return VE({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"]))},HE=(e,t,r)=>{const n=(e=>e&&re(e).map((e=>{const{type:t,value:r}=e;return VE({},e,{value:[yt,ft,ct.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Et(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},KE=["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"],QE={"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:YE(n,r),filters:HE(a,n,r),chartType:Tr.BAR,component:Er.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:YE(n,r),filters:HE(a,n,r),chartType:Tr.BUBBLE,component:Er.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:Er.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 VE({id:t,count:o,canRead:u,orderType:s,attributeUri:YE(r,p),filters:HE(a,r,p),component:Er.DashboardFacet,title:i,showOthers:!0},BE(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:YE(n,r),filters:HE(a,n,r),chartType:Tr.MAP,component:Er.DashboardFacet,title:i,geoUrl:KE[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 VE({id:t,count:o,canRead:l,attributeUri:YE(n,r),filters:HE(a,n,r),component:Er.DashboardFacet,title:i,geoUrl:s,chartType:Tr.MAP,projection:"geoMercator"},BE(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Er.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:qE(i),component:Er.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:HE(n,null,a),component:Er.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:Er.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:Er.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:Tr.CLOUD,component:Er.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:Tr.TREE,component:Er.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Er.NotificationInboxFacet,title:n||At().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Er.ActivitiesViewFacet,title:n||At().text("Activity log")}}},JE=e=>({id:e,height:10}),XE=(0,l.pipe)((0,l.map)((e=>{const t=QE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),zE=e=>{if("0.1"===e.version){const t=XE(e.views),r=ME(JE,e.layout,{columns:4});return{id:e.id,margin:0,layout:$E(r,t),views:t}}return e},ZE=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=>ZE(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function em(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tm(e,t,r[t])}))}return e}function tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rm=em({},mr,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),nm=e=>e,im={[rm.Attributes]:nm,[rm.HierarchyTree]:nm,[rm.HierarchyPaths]:nm,[rm.RelationsTable]:nm,[rm.Relations]:e=>em({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[rm.SingleAttributeView]:nm,[rm.CustomView]:nm,[rm.TableAttributeView]:nm,[rm.MapView]:nm,[rm.OldTreeView]:e=>em({},e,{class:mr.HierarchyTree}),[rm.OldMapView]:e=>em({},e,{class:mr.MapView}),[rm.ImageAttributeView]:nm,[rm.PotentialMatchesView]:nm},am=(0,l.pipe)((0,l.map)((e=>{const t=im[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),om=(0,l.curry)(((e,t)=>{switch((0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)){case mr.MapView:return{id:t,height:5,minHeight:5};case mr.Relations:return{id:t,autosizing:!0,minWidth:2};default:return{id:t,autosizing:!0}}})),sm=e=>{if("0.1"===e.version){const t=am(e.views),r=ME(om(t),e.layout,{columns:4});return{id:e.id,layout:$E(r,t),views:t,workflow:e.workflow,maxWidth:e.maxWidth}}return e},lm=(e,t)=>e.class===t||e["react-class"]===t,um=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(lm(t,mr.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 lm(t,mr.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)}},cm=(e,t)=>e.filter((e=>t.some((t=>lm(e,t))))).map((e=>{let{id:t}=e;return t})),pm=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))};function dm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ym(e,t,r[t])}))}return e}function ym(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fm=(e,t)=>ZE(t).map((t=>(0,l.pipe)((0,l.map)((e=>pm(e,t))),(0,l.reject)(l.isNil),l.head)(e))),Tm=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},Em=(e,t)=>{if("scroll"===t.layout.layout){const r=fm(e,t.layout),n=zE(dm({},t,{views:r,version:"0.1"}));return{class:br.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:br.Dashboard,views:t.views,layout:t.layout,id:t.id}},mm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},hm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},bm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},Om=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},vm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},gm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},_m=(e,t)=>{const r=fm(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=((e,t)=>e.flatMap((e=>{let{extensions:t=[]}=e;return t.filter((e=>{let{point:t}=e;return"com.reltio.plugins.search.toolbar.component"===t}))})))(e).filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:br.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"]}},Nm=(e,t)=>({class:br.Graph,id:t.id}),Am=(e,t)=>({class:br.ProfileActivityLog,id:t.id}),Rm=e=>t=>!!(0,l.intersection)(e,t).length,Pm=(0,l.cond)([[Rm(["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"]),()=>Em],[Rm(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>mm],[Rm(["com.reltio.plugins.graph.GraphView"]),()=>Nm],[Rm(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>hm],[Rm(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>bm],[Rm(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>Om],[Rm(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>vm],[Rm(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>gm],[Rm(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>_m],[Rm(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Am],[l.T,()=>(0,l.always)(void 0)]]),Sm=(e,t)=>{if("com.reltio.plugins.entity.ProfileAction"===e.class)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(Tm),(0,l.map)((t=>((e,t)=>{const r=fm(e,t.layout),n=sm(dm({},t,{views:r,version:"0.1"}));return{entityType:t["entity-type"],views:n.views,layout:n.layout}})(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views"])))(e);return{class:br.Profile,id:t.id,entityTypes:r}})(t,e);const r=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(r))return;const n=(0,l.pipe)((0,l.map)((e=>pm(e,r))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(n))return;const i=ZE(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 Pm(a)(t,n)},wm=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))},Im=e=>(0,l.pipe)((0,l.chain)(wm),(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:Sm(e,t)}))))(t))(t,e);return{label:t.label,icon:t.icon,menu:r.length?{type:"side",items:r}:void 0,screen:Sm(t,e)}}));function Um(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cm=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Dm=e=>({id:e,height:10}),jm=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)(Cm),(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=XE(((e,t)=>ZE(t).map((t=>(0,l.pipe)((0,l.map)((e=>pm(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){Um(e,t,r[t])}))}return e}({},e,{id:t})))(e))))(e,t.layout)),n=ME(Dm,t.layout,{columns:4});return{views:r,layout:$E(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Lm=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>pm(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=>pm(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=>pm(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=>pm(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=>pm(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=>pm(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=>pm(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}}},km=e=>({layout:Im(e),pivoting:jm(e),properties:Lm(e)});var Fm=r(58697),xm=r.n(Fm);function Mm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$m(e,t,r[t])}))}return e}function $m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vm=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${xm()()}`;return n[e.id].push(t),i=!0,Mm({},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]++,Mm({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},Gm=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(Gm(e))}))}))),t},Wm=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Hm,t),(0,l.propOr)([],"crosswalks",e))),e),Ym=(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(Ym(e))}))})),r},Bm=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=Bm(e);r>t&&(t=r)}))})),t+1):t},qm=(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},Hm=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Km=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Qm=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Jm=(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)},Xm=(0,l.eqBy)(Hm),zm=(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)(ts,(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)))),Zm=(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=At().number(t));return t})),eh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?At().number(e,"0,0.0a").toUpperCase():At().number(e,"0,0"):""},th=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),rh=(e,t)=>t&&e!==t?`${t} (${e})`:e,nh=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),ih=(e,t,r)=>{const n=nh(e,t,r);return rh(r,n)},ah=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),oh=(0,l.complement)(ah),sh=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),lh=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)},uh=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(oh(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),ch=(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?K(a):"L LTS";switch(n.type){case bt.TYPE_NUMBER:case bt.TYPE_FLOAT:case bt.TYPE_DOUBLE:case bt.TYPE_LONG:case bt.TYPE_INT:case bt.TYPE_COUNT:return t&&Zm(o,t);case bt.TYPE_BOOLEAN:case bt.TYPE_BOOLEAN_RADIO:case bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:se(t)?At().text("yes"):At().text("no");case bt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=_(Number(t)).getTime()),t&&(tu(t)?ru(t):At().date(t,s));case bt.TYPE_ACTIVENESS_DATE:case bt.TYPE_LOCAL_DATE:return t&&(tu(t)?ru(t):At().date(t,s));case bt.TYPE_TIMESTAMP:return t&&(tu(t)?ru(t):At().date(isNaN(t)?t:Number(t),u));case bt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case bt.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)?rh((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),ph={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},dh=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()}},yh=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})))),fh=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n}=t,i=e.onResponse.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),dh,yh);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}},Th="__metadata",Eh=(e=>{const t=[Th,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),mh=(0,l.set)(Eh),hh=(0,l.view)(Eh),bh=mh(Ot.NEW),Oh=mh(Ot.REMOVED),vh=mh(Ot.EDITED),gh=mh(Ot.IGNORED),_h=(0,l.pipe)(hh,(0,l.equals)(Ot.REMOVED)),Nh=(0,l.pipe)(hh,(0,l.equals)(Ot.NEW)),Ah=(0,l.pipe)(hh,(0,l.equals)(Ot.EDITED)),Rh=(0,l.pipe)(hh,(0,l.complement)(l.isNil)),Ph=(0,l.pipe)(hh,(0,l.equals)(Ot.IGNORED)),Sh=(0,l.omit)([Th]),wh=(e,t)=>e===Th?void 0:t;function Ih(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uh=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=Uh(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Ch=(e,t)=>Uh((0,l.propEq)("nodeId",t),e),Dh=(e,t)=>Uh((0,l.pathEq)(["entity","uri"],t),e),jh=(e,t)=>{const r=Ch(e,t);return r.length>1?r[r.length-2]:null},Lh=(e,t)=>{const r=Ch(e,t);return r.length>0?r[r.length-1]:null},kh=(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=>kh(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Fh=()=>{},xh=(e,t)=>{let{parent:r,nodeProcessing:n=Fh}=t;n(e,r),e.children&&e.children.forEach((t=>xh(t,{parent:e,nodeProcessing:n})))},Mh=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case sr.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case sr.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case sr.editing:{var d,y;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=t.entity)||void 0===d?void 0:d.uri,a=null===(y=r.entity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ih(e,t,r[t])}))}return e}({},e,i===a?{}:{entityUri:i,newEntityUri:a})}}},$h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&xh(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===sr.addingChild||r.editingMode===sr.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Mh({node:r,connection:n,isReversed:i}),s=cf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===sr.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Mh({node:r,isReversed:i,connection:n}),l=s?ff({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):yf({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Vh={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Gh={asc:"asc",desc:"desc"},Wh=Vh.entityLabel,Yh=Gh.asc,Bh=(0,l.always)(0),qh=e=>{let{sortField:t=Wh,sortOrder:r=Yh,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Vh.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return yg.strings.sort(t,a,o)})(n,r);case Vh.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return yg.strings.sort(e,i,a)})(r);default:return Bh}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Hh=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Gh)),l.identity,(0,l.always)(Yh))),Kh=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Vh)),l.identity,(0,l.always)(Wh)));var Qh=r(91104);let Jh;const Xh=(e,t)=>(Jh||(Jh=Qh.createClient({key:t})),new Promise((t=>{Jh.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)}))}))),zh=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Zh=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Xo).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[zh(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(Zh(e.value,t,r))),n})),eb=e=>e&&e.length>0,tb=(e,t)=>[].concat(e&&e.attributes?Zh(e.attributes,t):[]).filter(l.identity),rb=(e,t,r,n,i)=>{if(e&&e.type){const t=(si(r,e.type).geoLocationAttributes||[]).map((t=>{return r=tb(e,t.latitude),n=tb(e,t.longitude),eb(r)&&eb(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(eb(t)&&t[0].value&&eb(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?Xh(n.label,i).catch((()=>null)):Promise.resolve(null)},nb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=si(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return rb(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?Xh(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)))},ib=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=si(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Wn(e,r.latitude,t.type)&&Wn(e,r.longitude,t.type)){const e=tb(t,r.latitude),n=tb(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))},ab=(e,t,r)=>Promise.all([ib(e,t),nb(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 ob(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sb(e,t,r[t])}))}return e}function sb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lb=(e,t)=>t.values.map(uo(e,t.entityTypeUri)),ub=(e,t,r)=>qs(t.fieldName,r)||Wn(e,rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),cb=(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?rh(e,t):e}),r)},pb=(0,l.path)(["attrType","label"]),db=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>ob({},e,{[t]:!0})),{});e[r]=e[r]?ob({},e[r],n):n}return e}),{}),yb=(0,l.pipe)((0,l.prop)("values"),E),fb=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Ft.type.name)),Tb=e=>e.type===hb.NUMERIC_RANGE_FACET,Eb=e=>e.type===hb.DATE_RANGE_FACET,mb=(0,l.either)(Tb,Eb),hb={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},bb=e=>{switch(null==e?void 0:e.name){case Ft.type.name:return hb.ENTITY_TYPE_FACET;case Ft.createdBy.name:case Ft.updatedBy.name:case Ft.sourceSystems.name:case Ft.tags.name:case Ft.roles.name:case Ft.matchRules.name:case Ft.MLRecommendedMatch.name:return hb.WITH_DROPDOWN_CHECKBOXES_FACET;case Ft.createdTime.name:case Ft.updatedTime.name:case Ft.startDate.name:case Ft.endDate.name:return hb.DATE_RANGE_FACET;case Ft.matches.name:case Ft.matchScore.name:return hb.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return hb.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return hb.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return hb.DATE_RANGE_FACET;default:return hb.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Ob=(0,l.pipe)(ub,bb),vb=(0,l.pipe)((0,l.path)(["attrType","type"]),Zn),gb=(0,l.cond)([[Tb,(0,l.always)(ct.IN_RANGE)],[Eb,(0,l.always)(ct.WITHIN)],[(0,l.allPass)([vb,e=>e.values.length>=2]),(0,l.always)(ct.EXISTS)],[l.T,(0,l.always)(ct.EQUALS)]]),_b=(0,l.cond)([[Eb,(0,l.prop)("values")],[Tb,(0,l.prop)("values")],[vb,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 Nb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ab=(0,l.pipe)((0,l.path)(["attrType","type"]),Hn),Rb=(0,l.pipe)((0,l.path)(["attrType","type"]),Jn),Pb=(0,l.pipe)((0,l.prop)("attrType"),Ks),Sb=(0,l.pipe)((0,l.prop)("attrType"),Hs),wb=e=>t=>t.values.map((t=>si(e,t).label)).join(" , "),Ib=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),Ub=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(At().number),Ib)),(0,l.join)(","))(e.values);return`${pb(e)}: ${t}`},Cb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(S),Ib)),(0,l.join)(","))(e.values);return`${pb(e)}: ${t}`},Db=e=>t=>`${pb(t)}: ${lb(e,t).join(", ")}`,jb=e=>t=>{const r=cb(e,t);return`${pb(t)}: ${r.join(", ")}`},Lb=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[Sb,wb(e)],[Rb,Ub],[Ab,Cb],[Pb,Db(e)],[l.T,jb(t)]]),r))),kb=(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){Nb(e,t,r[t])}))}return e}({},t,{attrType:ub(e,t,n)}))),Lb(e,r))(t),Fb=new RegExp(`^${At().text("Search")}`),xb=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...kb(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Fb,"",u)]},Mb=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(mt),$b=e=>(e=>Mb.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]=nu(t);return e.replace(r,i).replace(n,a)}),e))(e),Vb=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),Gb={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Wb=e=>[Gb.geoPolygon,Gb.onMapMove].includes(e),Yb=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Bb=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},qb=(e,t)=>Wb(e)?t.map(Yb):[Bb(t)],Hb=e=>Wb(e)?At().text("Geo Polygon"):At().text("Geo Location"),Kb=e=>{switch(e){case Gb.geoLocation:return"geoLocation";case Gb.geoPolygon:case Gb.onMapMove:return"geoPolygon"}},Qb={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},Jb=e=>At().text(e),Xb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ct.EQUALS]:"=",[ct.NOT_EQUALS]:"≠",[ct.STARTS_WITH]:"*",[ct.MISSING_VALUE]:At().text("missing value"),[ct.HAS_ALL]:At().text("has all"),[ct.IN_RANGE]:At().text("in range"),[ct.FULL_TEXT]:At().text("full text"),[ct.EXISTS]:At().text("exists"),[ct.COUNT_EQUALS]:`${At().text("count")} =`,[ct.COUNT_NOT_EQUALS]:`${At().text("count")} ≠`,[ct.COUNT_LT]:`${At().text("count")} <`,[ct.COUNT_LTE]:`${At().text("count")} <=`,[ct.COUNT_GT]:`${At().text("count")} >`,[ct.COUNT_RANGE]:At().text("count range"),[ct.LT]:"<",[ct.LTE]:"<=",[ct.GT]:">",[ct.GTE]:">=",[ct.IN_FILE]:At().text("in file"),[ct.NOT_IN_FILE]:At().text("not in file"),[ct.CONTAINS]:"~",[pt.LIST_EQUALS]:"=",[pt.NOT_LIST_EQUALS]:"≠",[pt.LIST_EQUALS_CASE_SENSITIVE]:"=",[pt.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||At().text(e.toLowerCase())},zb=e=>({type:Qb.operator,text:e}),Zb=e=>({type:Qb.operator,text:Jb(e)}),eO=e=>({type:Qb.attributeLabel,text:e}),tO=e=>({type:Qb.specialAttributeLabel,text:e}),rO=e=>({type:Qb.attributeFilter,text:Xb(e)}),nO=e=>({type:Qb.attributeValue,text:e}),iO=e=>({type:Qb.entityTypeLabel,text:e}),aO=()=>({type:Qb.space,text:" "}),oO=()=>({type:Qb.bracket,text:"("}),sO=()=>({type:Qb.bracket,text:")"}),lO=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),uO=(0,l.curry)(((e,t)=>t.map(lO(e)))),cO=(0,l.curry)(((e,t,r)=>[e,...r,t])),pO=cO(oO(),sO()),dO=cO(aO(),aO()),yO=(0,l.curry)(((e,t)=>[e,...t])),fO=e=>yO(iO(e)),TO=e=>yO(iO(`${e}: `)),EO=e=>["and","and not"].includes(e),mO=e=>["or","or not"].includes(e),hO=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),mO)),bO=(OO=["and"],e=>e.slice(0,-1).every((e=>OO.includes(e.operator))));var OO;const vO=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=hO(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=EO(s),a=mO(s);!r&&t&&n&&(i.push(oO()),r=!0),i.push(o),r&&a&&(i.push(sO()),r=!1);const l=e?Zb(s):zb(s);i.push(...dO([l]))}else i.push(o),r&&(i.push(sO()),r=!1)}return i}},gO=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),_O=(0,l.pipe)(vO({localizable:!1}),gO),NO=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},AO=e=>{let{data:t,values:r,filter:n}=e;return t&&bu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},RO=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(AO)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),PO=(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)&&Mn(e.data.attrType)})(e)&&[ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:xn((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})))),lh),SO=(e,t)=>(0,l.pipe)(PO,uh(t))(e),wO=(0,l.pathEq)(["data","fieldName"],Ft.type.name),IO=(0,l.path)(["data","entityTypeUri"]),UO=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),CO=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Jo(e)),attributes:(0,l.filter)((0,l.pipe)(IO,(0,l.anyPass)([l.isNil,Jo(e),r=>{const n=(t.entityTypes||[]).filter(Jo(e));return(n.length>1?di(e,n):null)===r&&!!si(e,r)}])))})(t))))),DO=e=>(0,l.pipe)((0,l.prop)("filter"),Ul,(0,l.equals)(e)),jO=(0,l.curry)(((e,t,r,n,i,a)=>{const o=qs(n.fieldName)||n.attrType,s=Zl(o,i),u=ch({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Mn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?rh(a.lookupCode,a.value):ih(r,xn(o),a)],[()=>Ks(s),()=>uo(e,n.entityTypeUri,a)],[()=>Qs(s),()=>Co(e,a)],[()=>tl(s),()=>Lo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Jn(c)||Zn(c)),Ql),nO)()})),LO=(e,t,r,n)=>{const i=jO(e,t,r,n.data,n.filter);return(0,l.cond)([[DO(0),(0,l.always)([])],[(0,l.both)(DO(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[aO(),i(r),{type:Qb.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[aO(),...(0,l.pipe)(l.flatten,(0,l.map)(i),uO({type:Qb.punctuationMark,text:", "}))(t)]}]])(n)},kO=(e,t)=>{const r=!!qs(e.data.fieldName);return(0,l.pipe)(NO,r?tO:eO)(e,t)},FO=(e,t,r,n,i)=>[kO(n,i),aO(),rO(n.filter),...LO(e,t,r,n)],xO=(0,l.addIndex)(l.map),MO=(0,l.propEq)("length",1),$O=(0,l.propSatisfies)((0,l.lt)(1),"length"),VO=(0,l.complement)(l.isEmpty),GO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)((0,l.filter)(AO),(0,l.map)((n=>({operand:FO(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,vO()))(n)},WO=(0,l.pipe)(GO,l.flatten),YO=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Vp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=GO(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(fO),(0,l.pipe)(s(TO),(0,l.unless)((()=>MO(u)||i),pO)))(u)},BO=(e,t,r,n)=>(0,l.pipe)((0,l.filter)(RO),xO(((n,i,a)=>({operand:YO(e,t,r,n,MO(a)),operator:n.operator}))),vO(),l.flatten)(n),qO=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),vO(),l.flatten),HO=e=>{let{searchType:t,values:[r]}=e;return qb(t,r).join(", ")},KO=(e,t,r,n,i,a)=>{const o=(e=>e?[tO(e.isRawFilter?At().text("Raw filter"):At().text("Search")),...dO([rO(ct.EQUALS)]),nO(`"${e.value}"`)]:[])(i),s=(e=>e?[tO(Hb(e.searchType)),aO(),nO(HO(e))]:[])(a),u=(0,l.pipe)(BO,(0,l.when)((e=>$O(e)&&(VO(o)||VO(s))),pO))(e,t,r,n);return qO([o,s,u])},QO=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),JO=(0,l.pipe)(KO,QO),XO=(0,l.has)("attributes"),zO=Array.isArray,ZO=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),ev=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=tv(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)(ZO(a))),pO),(0,l.concat)(dO([zb(o)]))))(s)},tv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return XO(n)?ev(e,t,r,n,i):zO(n)?n.reduce(((n,a)=>n.concat(tv(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(dO([zb(n.operator)])))(FO(e,t,r,n,i))},rv=(e,t,r,n,i)=>(0,l.pipe)(tv,l.flatten)(e,t,r,n,i);function nv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iv(e,t,r[t])}))}return e}function iv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const av=(0,l.complement)(wO),ov=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(wO),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(IO),(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}},sv=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=ov(t);return(r||n)&&bO(t)},lv=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(sv)),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(wO).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}=ov(r);if(sv(e))t.push(nv({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(av)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(wO,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(IO,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(av),entityTypes:n,operator:i?a:e.operator,id:xm()()}}));t.push(...n)}var a;return t})(t))),[]))),uv={[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},cv=(0,l.curry)((e=>uv[e]||e)),pv=(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}})),dv=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Hn),yv=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>nv({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return dv(e)?(0,l.evolve)({filter:cv,values:pv(t)},e):e}))})))})),fv=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),lv,CO(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")))})),yv,(0,l.reject)(UO))(r)));function Tv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ev(e,t,r[t])}))}return e}function Ev(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mv=(e,t)=>({data:{uri:ot(e.fieldName)?rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||gb(e),id:xm()(),values:_b(e)}),hv=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=qs(a,t,r)||Wn(e,i);if(!s)return null;if(wn(s))return Tv({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Vp(e,{type:o}),i=(Gn(e,rt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return Tv({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),bv=(0,l.curry)(((e,t,r,n)=>fv(hv,e,n,t,r)));function Ov(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vv(e,t,r[t])}))}return e}function vv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gv=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},_v=e=>"rdmLookups.not.resolved"===e?Ft.notResolved.name:e,Nv=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Tt?ct.IN_RANGE:Et(a),u=_v(n),c=qs(u)||Wn(e,i),p=(0,l.cond)([[()=>Ll(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>Ov({},e,{filename:th(e)}))))],[()=>Zn(null==c?void 0:c.type),(0,l.map)(se)],[e=>Dl(s)&&!Array.isArray(e[0])&&!Hn(null==c?void 0:c.type),ne],[l.T,l.identity]])(o);return{id:xm()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Tt?"and not":"and",filter:s,values:p}})),Av=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(Nv(e,di(e,i)));return[{id:xm()(),operator:"or",attributes:a,entityTypes:i}]})),Rv=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),Pv=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([Rv("from"),Rv("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,()=>[]]]),Sv=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return Ov({},r,{values:Pv(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Vs(e.fieldName,n):e.fieldName})},wv=(e,t)=>{if((0,l.has)("children")(e)){const r=Sv(e,t);return e.children.reduce(((e,n)=>(e.push(wv(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return Sv(e,t)},Iv=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(Sv(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(Ov({fieldName:e.fieldName},Sv(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(wv,l.flatten)],[l.T,Sv]]),Uv=(0,l.pipe)((0,l.map)(Iv),l.flatten),Cv=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},Dv=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=Av(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:Uv(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>Ov({},t,{type:Ob(e,t)}))).map((e=>Ov({},e,{values:mb(e)?Cv(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 mv(r,t)})),operator:"or",id:xm()(),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=>({[_v(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[Ov({},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 bv(e,t,r,p)},jv=(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)(yb),(0,l.partition)(fb))(t),i=n.map((t=>Tv({},t,{type:Ob(e,t)}))).map((e=>mv(e))),a=r.values||[];return[{attributes:i,operator:"or",id:xm()(),entityTypes:a}]})(e,a);return bv(e,t,r,o)})(e,t,r,n):Dv(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},Lv=e=>"2.0"===e.version?e.keyword:gv(e),kv=e=>(0,l.pathEq)(["object","uri"],e),Fv=(e,t)=>(0,l.pipe)((0,l.find)(kv(e)),(0,l.prop)("object"))(t),xv=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"),kv(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Fv(r.match,t)||n[r.match];return{label:Op((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return lo(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)},Mv=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),$v=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),Vv=(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:Op((0,l.prop)("label",a)),matchRules:i.map((function(t){return lo(e,a.type,t)||{label:t,uri:t}}))}})))(t),Gv=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)},Wv=(0,l.path)(["object","uri"]),Yv=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Bv=e=>e.getValue(),qv=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=qv(n[e],t),!r);e++);return r},Hv=(e,t)=>{const r=[],n=(0,l.pipe)(Bv,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(Hv,[t]),a);return r.push.apply(r,o),r};function Kv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qv(e,t,r[t])}))}return e}function Qv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jv=(e,t)=>!!e[t],Xv=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},zv=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||[]])},Zv=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Kv({},t,{[r.uri]:Kv({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:zv(null==o?void 0:o.parents,n),children:zv(null==o?void 0:o.children,i),values:zv(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},eg=e=>e.children?e.children.flatMap(eg):e,tg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=si(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 Vo(r,n,i).flatMap(eg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Wn(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=Zv({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Zv({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},rg=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=ds(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Xo),(0,l.map)(Xv))(i);return Zv({structure:e,attrType:e[t].attrType,values:a})}),t)},ng=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 Jv(e,r)}));return r||n?t.filter(Xo).reduce(((e,t)=>ng({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Jv(t,e.type)?Zv({structure:t,attrType:t[e.type].attrType,values:[Xv(e)]}):t}},ig=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Kv({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},ag=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ds(i,n,r)||[];return a.length?Zv({structure:t,attrType:t[r].attrType,values:a.filter(Xo).map(Xv)}):t},og=(e,t,r)=>{const n=Ke(e),i=Ke(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Ze(n,r)})(e,t):!(!r||!st(t))&&nT(r,i).includes(n)},sg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},lg=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?tT(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return og(r,t,o)}))},ug=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>ug(e,t,r)))))},cg=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&sg(n,e)}},pg=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ke(n),c=rT(u,o,i,a),p=ug("children",t,l),d=ug("parents",t,l),y=p.flatMap((e=>ug("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return og(t,n,c)})).map((t=>cg(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return og(n,t,c)||Ke(t)!==u&&og(t,n,c)})).map((t=>cg(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=ug("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)&&og(n,t,c)}))})).map((t=>cg(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return og(t,n,c)})).map((e=>cg(r,n,e,s))),...T,...E,...f]},dg={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},yg={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([[80],{8513:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>ks,PY2:()=>St,Ng6:()=>tr,YJ7:()=>vt,NlI:()=>pt,Xt7:()=>zt,wfT:()=>Br,EMD:()=>Dr,HAc:()=>Zt,PEf:()=>Dt,oA3:()=>Cr,$XE:()=>Tr,eWf:()=>Ut,q7e:()=>er,KVe:()=>qr,WVQ:()=>ii,oZZ:()=>rn,bNA:()=>nn,Rjq:()=>an,G39:()=>Lt,dZX:()=>Er,bQt:()=>sn,oS0:()=>bt,lL_:()=>mt,Nsj:()=>_t,psV:()=>Ot,xPW:()=>wt,pyR:()=>Mr,p8l:()=>Lr,Wkf:()=>Xt,zHr:()=>Jt,NIO:()=>Qt,$26:()=>hb,Esk:()=>Pr,s9T:()=>cr,MEy:()=>Yl,j5E:()=>ct,vAw:()=>Ur,NMQ:()=>Ir,mNm:()=>Fr,rwv:()=>en,s_5:()=>$r,RgZ:()=>kr,unl:()=>tn,Qy0:()=>on,pYu:()=>Rr,wIJ:()=>Gb,GFH:()=>nr,S91:()=>kt,p3$:()=>pn,wSh:()=>z,BDP:()=>_i,pGS:()=>xr,ARY:()=>Or,XGc:()=>Yr,fO_:()=>Yt,wwy:()=>sr,_XL:()=>gt,j2V:()=>Hr,dMV:()=>Gr,NBX:()=>Yv,OXy:()=>vr,BXd:()=>dr,CJB:()=>Jr,lXI:()=>br,nqG:()=>un,C68:()=>jt,yxQ:()=>ln,Yj_:()=>lr,D25:()=>ar,ZIY:()=>mr,Tl4:()=>Qb,lwr:()=>Ct,NkU:()=>Kr,Rtp:()=>Wr,YGx:()=>yr,uTS:()=>Vr,IYE:()=>jr,PiC:()=>Zr,tJI:()=>rr,fDt:()=>ir,cNQ:()=>Qr,SwE:()=>Sr,ZHR:()=>zr,lD1:()=>Ft,lVm:()=>fr,vnX:()=>Wh,$x5:()=>Yh,_R1:()=>Vh,wUm:()=>Gh,z7V:()=>cn,dC6:()=>pr,MBD:()=>or,GmF:()=>ea,cKm:()=>hr,iP_:()=>It,NVC:()=>ur,tPT:()=>Ps,tZe:()=>cp,kRE:()=>py,psB:()=>dy,X0$:()=>Rs,Wm5:()=>zs,vyX:()=>ju,wLZ:()=>Ss,W4V:()=>oe,EtK:()=>cs,Wtd:()=>As,asT:()=>ng,kGs:()=>ve,ewt:()=>Pf,O_f:()=>bO,sOy:()=>Ze,Tde:()=>Fn,LMI:()=>hu,skb:()=>WO,sPt:()=>uu,sH1:()=>cu,RPM:()=>hT,h27:()=>Su,Uqd:()=>Du,xG:()=>rv,Z2f:()=>sh,fgW:()=>_O,I69:()=>KO,ZxB:()=>JO,mdt:()=>yT,Qbq:()=>Bm,rny:()=>Fi,UEY:()=>va,Q0T:()=>Oa,Lyr:()=>Sa,sBn:()=>ba,itK:()=>Ta,H9$:()=>ha,KPc:()=>ma,zos:()=>Ea,ELQ:()=>wa,dZs:()=>aa,Cz4:()=>ia,z_L:()=>Ra,fGe:()=>na,iuF:()=>ya,Wib:()=>fa,Hn0:()=>Pa,obS:()=>Ia,E$L:()=>oa,XUh:()=>da,Qp_:()=>ca,_jk:()=>sa,sKE:()=>la,WmG:()=>pa,QKx:()=>Na,Oik:()=>_a,s0A:()=>ua,o9m:()=>ga,MCd:()=>Aa,tGK:()=>gl,Vg3:()=>Yi,mkC:()=>Ui,xv5:()=>qi,a14:()=>Di,yv0:()=>Bi,Zm0:()=>Ci,Nxd:()=>Ii,$mM:()=>Wi,ifj:()=>oi,NWi:()=>Rh,xr3:()=>Ah,wNf:()=>Cl,iJH:()=>Ph,d89:()=>Pi,Edd:()=>Si,Z5t:()=>wi,uGe:()=>Ai,UoR:()=>Ni,xvW:()=>Nh,$qe:()=>_h,yPM:()=>ra,$cp:()=>Ls,vKJ:()=>Ds,AID:()=>af,B1H:()=>Gv,b7X:()=>Gm,$uE:()=>ge,keo:()=>Ym,C_p:()=>tE,G27:()=>ZE,JA0:()=>ey,b3T:()=>Oe,oC6:()=>he,_Zs:()=>be,epC:()=>Ne,YYG:()=>_e,f_2:()=>ry,w3l:()=>Nv,QHB:()=>zE,Jso:()=>Uv,RXH:()=>ME,Vr9:()=>sm,lMm:()=>km,fmQ:()=>rs,yRD:()=>yv,NcL:()=>sE,QK6:()=>pe,ymd:()=>Hc,JV_:()=>Ny,XiW:()=>hf,Yrx:()=>Wd,GPx:()=>Ns,gjI:()=>_s,vlo:()=>Bf,E_P:()=>lT,aAL:()=>jc,NBq:()=>ns,wp9:()=>dT,DsR:()=>Sc,MPc:()=>cf,gWE:()=>pf,DT_:()=>df,ipn:()=>ff,ORg:()=>Oi,_wz:()=>yf,RYR:()=>Nf,PP2:()=>qd,wS7:()=>fh,cBQ:()=>yc,pBq:()=>Wy,DsO:()=>Z,X78:()=>Ry,xZs:()=>Oy,YFy:()=>Bd,Gmt:()=>Ey,K$w:()=>Ty,DSj:()=>Lc,k9j:()=>Tc,ww$:()=>ws,WVU:()=>fy,hxF:()=>el,nwO:()=>dg,Mzk:()=>lc,aFF:()=>Xm,HRH:()=>Hl,EZK:()=>gp,Kxm:()=>hp,Z9i:()=>kT,CrF:()=>sy,DNd:()=>Ca,vUy:()=>lg,lJh:()=>Jl,zHo:()=>Xl,sEJ:()=>qv,UO$:()=>Qy,zeJ:()=>Wn,dLR:()=>fs,JQy:()=>bs,XtP:()=>ds,Ug0:()=>di,A1W:()=>Wm,sw:()=>vp,nv3:()=>Lh,JgD:()=>jh,nve:()=>Hv,SkP:()=>Os,SAs:()=>By,PWK:()=>Uo,IM5:()=>ys,Mfk:()=>Vm,mB6:()=>ch,p6d:()=>S,o0x:()=>I,ufS:()=>Zm,k7L:()=>eh,mrB:()=>w,ncP:()=>He,Zmi:()=>Ge,hm5:()=>Ye,ECL:()=>Gt,vPL:()=>Ap,qmL:()=>oT,hXd:()=>Mi,OCS:()=>$i,p2l:()=>xs,qF1:()=>Kc,_X$:()=>Qc,yj2:()=>xb,bzh:()=>ET,k66:()=>$o,kiP:()=>ro,pSg:()=>ue,kz_:()=>Jd,H_U:()=>Go,t9e:()=>Ma,j2$:()=>pp,PFL:()=>Rn,aJ3:()=>ub,To9:()=>xn,wpo:()=>Bp,ADq:()=>UT,UUb:()=>wT,tQX:()=>IT,xy8:()=>In,EUG:()=>Yn,AFK:()=>it,X3M:()=>Gn,WN0:()=>Vo,kDl:()=>Ts,uDV:()=>aT,IhQ:()=>ms,R$r:()=>sT,w80:()=>bo,Pfu:()=>Fa,Gtj:()=>fl,fyF:()=>yl,u5q:()=>Ke,O$n:()=>Wp,ptG:()=>Yp,f4_:()=>fE,uap:()=>yE,d7q:()=>Gd,liG:()=>Hd,$oF:()=>Vd,avf:()=>Lf,DiQ:()=>jf,cfX:()=>Df,vD3:()=>Ff,Qrb:()=>Cf,EJQ:()=>kf,HWy:()=>Uf,y6v:()=>If,JUW:()=>ny,GtP:()=>NE,_kX:()=>ja,u1e:()=>La,sJj:()=>Km,CJp:()=>gE,uKF:()=>Hm,wo0:()=>cy,s5:()=>jo,cwx:()=>Do,Y6b:()=>Cd,TTx:()=>hy,UtR:()=>Dd,HaQ:()=>by,E6I:()=>oy,vTU:()=>Id,Nsy:()=>Dp,KMQ:()=>Jm,Do$:()=>Fp,CSV:()=>Vs,TMe:()=>jd,l1V:()=>Zl,VQ1:()=>nu,z7d:()=>qf,Xaq:()=>Bo,Sj8:()=>pg,PJj:()=>bl,k3T:()=>fi,PjQ:()=>gi,s7l:()=>tc,GGR:()=>Vf,j5q:()=>Mf,DnY:()=>zu,RY5:()=>Zf,Px$:()=>Af,KPC:()=>Mv,NIY:()=>oc,HvW:()=>nc,Fof:()=>$a,BTI:()=>Mp,uie:()=>Sp,ChB:()=>_p,q27:()=>Hp,fAQ:()=>Iy,XkT:()=>Xu,lrH:()=>Uy,nt9:()=>si,XH8:()=>Gp,XH2:()=>yi,jFi:()=>Vp,qhs:()=>ho,wwR:()=>xp,Uk3:()=>at,ev7:()=>Wv,RB9:()=>Zd,iFp:()=>OT,e$p:()=>gT,PcX:()=>_T,SpP:()=>vT,R6_:()=>pb,CY1:()=>bb,Ajk:()=>Hu,Yiz:()=>qu,FK9:()=>Gu,UOo:()=>th,aTW:()=>my,uug:()=>Ul,P$2:()=>gb,XS2:()=>_l,Hyb:()=>Wl,d3Y:()=>xu,Klp:()=>$u,WxZ:()=>_b,Gzu:()=>zl,ZOr:()=>Ju,uqV:()=>Pd,Pm4:()=>te,nVD:()=>tT,dED:()=>Md,P2h:()=>xd,jrr:()=>za,mmY:()=>eo,T6O:()=>Wo,h6J:()=>sp,hM2:()=>jv,XR6:()=>J,jmz:()=>iT,IHt:()=>nT,NZI:()=>LT,wdF:()=>Sy,kgP:()=>wy,ZYI:()=>Wc,QXK:()=>ul,efz:()=>cl,Q5d:()=>ll,Ysv:()=>pl,ocC:()=>Kf,io3:()=>ci,Sbt:()=>vo,roS:()=>Oo,Ww1:()=>go,QaS:()=>uc,ERZ:()=>gv,CL1:()=>Lv,idV:()=>Op,nIW:()=>tt,fjE:()=>db,sG0:()=>rh,tV7:()=>Ol,g8o:()=>Hb,Qy:()=>qb,t2P:()=>lb,wId:()=>uo,LS0:()=>co,bFH:()=>fd,Rgl:()=>Ed,fW1:()=>lE,Ywp:()=>$h,pg:()=>Xp,WSA:()=>md,fed:()=>Cv,tT_:()=>hs,KbL:()=>ec,JBA:()=>lt,aNC:()=>Dh,RFJ:()=>Gc,Zeh:()=>Ky,OT5:()=>Mh,mC3:()=>nl,NVY:()=>cT,k6v:()=>Jc,FEC:()=>Xc,Ob5:()=>Kp,KUV:()=>Qp,dvH:()=>uT,V3i:()=>cm,VD3:()=>pi,mm2:()=>ru,rou:()=>xy,izH:()=>ka,DK$:()=>xa,KMp:()=>Dc,c31:()=>Tn,mbo:()=>DT,gT8:()=>hn,CZ8:()=>es,uGi:()=>os,Poc:()=>yn,_9k:()=>us,ZTM:()=>is,bwT:()=>ss,tzW:()=>On,tF$:()=>mn,o96:()=>ts,M4S:()=>ls,_vs:()=>Rc,xF8:()=>Rf,HQx:()=>zm,ATu:()=>CT,j1S:()=>hi,V3K:()=>Ei,Lmx:()=>mi,ZaZ:()=>fn,n_1:()=>wd,N6e:()=>Ic,SxO:()=>Za,w3p:()=>pT,xU7:()=>ce,Y_p:()=>Ao,$k6:()=>No,Gdl:()=>ih,U6P:()=>nh,OwB:()=>cb,hTh:()=>rT,xqc:()=>Lo,JvE:()=>ko,i29:()=>_u,dzT:()=>Li,uPS:()=>dc,cZV:()=>pc,n3B:()=>IO,e6O:()=>NO,s7j:()=>Vb,j$Q:()=>iy,kW2:()=>_E,tH7:()=>Co,Yxg:()=>qs,MaZ:()=>$f,nqN:()=>xf,o_J:()=>qo,hgZ:()=>Np,yW4:()=>lp,uT0:()=>ap,C82:()=>op,u9Z:()=>Fy,J$m:()=>Sd,j_Q:()=>Yu,wB1:()=>Vv,SP6:()=>Jp,ZYr:()=>xv,IMU:()=>Vc,FoU:()=>ty,DVz:()=>uh,mxe:()=>SO,FHr:()=>qy,D1g:()=>My,VO3:()=>Kh,de5:()=>Hh,Uw1:()=>fe,J6q:()=>jT,XCe:()=>Qa,Ir:()=>ao,XQO:()=>oo,QXb:()=>sd,P8_:()=>gy,iiD:()=>Cc,MOC:()=>ld,WF:()=>od,xE1:()=>vi,idW:()=>tg,YL3:()=>sc,Fn9:()=>T,j2U:()=>Fs,MpE:()=>vn,kQw:()=>Sn,mfm:()=>EO,vZp:()=>ot,E8K:()=>Jv,VSb:()=>zo,vr_:()=>Pn,Vmh:()=>sg,FgW:()=>um,oDv:()=>Ko,kuw:()=>Jo,Tt2:()=>Ho,T6Y:()=>Zn,_26:()=>$l,YkM:()=>kn,J6y:()=>Rl,njU:()=>jl,TBP:()=>Qo,IT0:()=>FT,x_:()=>Qm,biM:()=>Lp,TMl:()=>kp,Vkd:()=>Fl,WiY:()=>Eb,_zi:()=>xl,J6D:()=>tu,Lt4:()=>Hn,QEi:()=>$n,whI:()=>qt,KIu:()=>Kt,JhM:()=>ae,C_0:()=>ri,qIF:()=>UO,O27:()=>E,aBi:()=>qp,xOX:()=>Xs,EdS:()=>Xe,WgC:()=>Je,eEv:()=>Nn,A4t:()=>Ll,YOQ:()=>st,Wos:()=>Xn,jWr:()=>Ua,Or$:()=>Ln,lhE:()=>ui,CwH:()=>Mn,pzC:()=>Ks,ymH:()=>Dl,QZu:()=>Dn,rYH:()=>Tb,FVt:()=>Jn,Kn2:()=>le,OXP:()=>Xo,lS4:()=>Vn,g5f:()=>mb,fp6:()=>wl,Uty:()=>Qi,YkG:()=>jn,xdS:()=>bn,$NE:()=>ze,bC9:()=>Qe,KVV:()=>qm,q9e:()=>_o,iIf:()=>ah,ian:()=>tl,m6e:()=>ni,OFd:()=>Qs,kqr:()=>wn,fnZ:()=>Bt,VFZ:()=>rl,ZiX:()=>Be,j5n:()=>Kn,zkt:()=>g,Pcm:()=>$v,QDV:()=>Hs,M5u:()=>fb,laD:()=>wO,mtq:()=>_n,CtB:()=>oh,CBv:()=>ie,I0t:()=>ti,u1G:()=>Yf,gk1:()=>RO,Bgb:()=>AO,uzs:()=>Ht,v0l:()=>ou,Zqp:()=>Ld,j0k:()=>Io,tCm:()=>nt,gmx:()=>Nl,mOr:()=>Bl,TwZ:()=>Kb,GyU:()=>kh,zGm:()=>ed,bMg:()=>vd,EyD:()=>vh,FQA:()=>gh,fZN:()=>Nd,xsF:()=>bh,Lxg:()=>Oh,O3l:()=>mc,Wni:()=>Ec,wRx:()=>wh,OxG:()=>pd,uJQ:()=>cd,qWg:()=>lh,i96:()=>zp,zhn:()=>Sh,G8q:()=>dn,A9Y:()=>ee,Y5F:()=>fv,gxP:()=>se,c$P:()=>Al,BBN:()=>Xa,ZBU:()=>Q,UkJ:()=>po,xkv:()=>vy,z$M:()=>rg,KAm:()=>zd,lCl:()=>of,rkF:()=>rE,IU6:()=>Ep,aYu:()=>m,ije:()=>hl,Buf:()=>Uc,YLu:()=>ml,ct9:()=>Po,XkY:()=>gd,T5R:()=>td,uQS:()=>Ad,wcJ:()=>Ro,d$I:()=>Is,rSp:()=>jp,Sx:()=>ac,Ki6:()=>Zs,VGk:()=>Pc,sFD:()=>$E,eWN:()=>ig,dWE:()=>$b,Lkd:()=>bf,aDL:()=>Jy,yaA:()=>Rd,lOh:()=>Vy,DBr:()=>ab,hK$:()=>vl,TZ_:()=>Tp,CMB:()=>CO,FU8:()=>ic,J$p:()=>ef,b5s:()=>Zy,h2W:()=>rt,SL_:()=>jy,oUH:()=>rp,ck9:()=>rd,Xs0:()=>El,u7I:()=>$y,oCZ:()=>XT,MjG:()=>qh,FuV:()=>tp,$ju:()=>ip,t6d:()=>np,m5F:()=>ye,sx:()=>ag,rSc:()=>ph,L8n:()=>yy,R9X:()=>Ud,rj2:()=>Ay,_C4:()=>dp,tCj:()=>_y,uAg:()=>Yd,wx9:()=>Sf,KF3:()=>yp,ax9:()=>fp,HH7:()=>wc,_6y:()=>fc,AJo:()=>cc,Ixr:()=>ay,P6Y:()=>yg,Bd_:()=>HT,xkB:()=>qT,W41:()=>ky,WkI:()=>Ly,sSE:()=>BT,GMd:()=>bu,Bxm:()=>QT,FVh:()=>$T,U_T:()=>hd,FTe:()=>ne,VGB:()=>re,Wfe:()=>Ql,Ls5:()=>Kl});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:()=>v,formatDate:()=>S,formatDateTime:()=>I,formatTime:()=>w,getEndOfDay:()=>P,getMomentFormatFromDateMask:()=>B,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>H,getStartOfDay:()=>R,isToday:()=>g,isValidMomentDate:()=>h,isValidMomentDateOrNull:()=>b,momentToDate:()=>O,parseTimestamp:()=>Q,toLocalDate:()=>_,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ve,collectCrosswalksFromAttributes:()=>ge,compareActivenessAttributes:()=>Oe,compareAttributes:()=>he,compareImages:()=>be,compareRoles:()=>Ne,compareTags:()=>_e});var o={};r.r(o),r.d(o,{addAttribute:()=>Pe,editAttribute:()=>Se,editEndDate:()=>je,editRoles:()=>Ue,editStartDate:()=>De,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(),v=e=>(e&&e.setHours(0,0,0,0),e),g=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"),S=e=>f()(e).format(f().localeData().longDateFormat("L")),w=e=>f()(e).format(f().localeData().longDateFormat("LTS")),I=e=>`${S(e)} ${w(e)}`,U=(0,l.equals)("9"),C=(0,l.equals)("99"),D=(0,l.equals)("9999"),j=(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")],[j,(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")]]),$=(0,l.cond)([[U,(0,l.always)("y")],[C,(0,l.always)("YY")],[D,(0,l.always)("YYYY")],[k,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),V=(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,$(a),o])}return e},q=/(9+)([^9]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(q)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[V(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},K=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${B(t)} ${H(r)}`},Q=e=>{const t=Number(e);return Number.isNaN(t)?e:t},J=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"===g(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"===g(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),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(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 ve(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 ge(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 Se(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()?(we(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(we.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=Se(e,o,o.valueUri,{},i,a);Se(c,t,r,n,i,a+1)}function we(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 De(e,t){e.startDate=t||""}function je(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",$e="1Tepmo4Rel",Ve=(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=Ve(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Ge(n)},Be=e=>e&&e.includes("uri$$"),qe=We("entities"),He=We("relations"),Ke=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Qe=(0,l.startsWith)("relations/"),Je=(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={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},dt={[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"},yt="in",ft="notIn",Tt="not range",Et=e=>({[yt]:ct.EQUALS,[ft]:ct.NOT_EQUALS}[e]||e),mt={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},ht={[mt.LAST_DAY]:"Last 24 hours",[mt.LAST_3DAYS]:"Last 3 days",[mt.LAST_WEEK]:"Last week",[mt.LAST_MONTH]:"Last month",[mt.LAST_YEAR]:"Last year",[mt.PICK_DATE]:"Pick date"},bt={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"},Ot={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},vt={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},gt="<No label>",_t={IN:"in",OUT:"out"};var Nt=r(87918),At=r.n(Nt);function Rt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pt(e,t,r[t])}))}return e}function Pt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const St={startDate:{type:bt.TYPE_ACTIVENESS_DATE,get label(){return At().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:bt.TYPE_ACTIVENESS_DATE,get label(){return At().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},wt=Rt({id:{type:bt.TYPE_ENTITY_ID,get label(){return At().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},St,{roles:{type:bt.TYPE_STRING,get label(){return At().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:bt.TYPE_STRING,get label(){return At().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),It={workflow:{type:bt.TYPE_STRING,get label(){return At().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:bt.TYPE_STRING,get label(){return At().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:bt.TYPE_STRING,get label(){return At().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Ut={commenter:{type:bt.TYPE_STRING,get label(){return At().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Ct={notResolved:{type:bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return At().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Dt={createdBy:{type:bt.TYPE_STRING,get label(){return At().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:bt.TYPE_STRING,get label(){return At().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},jt={matches:{type:bt.TYPE_COUNT,get label(){return At().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:bt.TYPE_COUNT,get label(){return At().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Lt={sourceSystems:{type:bt.TYPE_STRING,get label(){return At().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:bt.TYPE_STRING,get label(){return At().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:bt.TYPE_INT,get label(){return At().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:bt.TYPE_TIMESTAMP,get label(){return At().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:bt.TYPE_STRING,get label(){return At().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},kt={matchRules:{type:bt.TYPE_STRING,get label(){return At().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:bt.TYPE_STRING,get label(){return At().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Ft=Rt({},wt,It,Ut,Ct,Dt,jt,Lt,kt,{type:{type:bt.TYPE_STRING,get label(){return At().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var xt=r(13980),Mt=r.n(xt);const $t=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Vt=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),$t),Gt=(0,l.pipe)((0,l.reject)(E),Vt),Wt=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("?")?"&":"?")+$t(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}},Yt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Bt=(0,l.equals)(Yt.SUGGESTING),qt=(0,l.equals)(Yt.EDITING),Ht=(0,l.equals)(Yt.VIEWING),Kt=(0,l.either)(qt,Bt);let Qt,Jt,Xt,zt,Zt,er,tr,rr,nr,ir,ar,or,sr,lr,ur,cr,pr,dr,yr,fr,Tr,Er,mr,hr,br,Or,vr;function gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_r(e,t,r[t])}))}return e}function _r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(Qt||(Qt={})),function(e){e.local="local",e.validationService="validationService"}(Jt||(Jt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Xt||(Xt={})),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"}(zt||(zt={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Zt||(Zt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch"}(er||(er={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(tr||(tr={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(rr||(rr={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(nr||(nr={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(ir||(ir={})),function(e){e.PROFILE="profile",e.MAP="map"}(ar||(ar={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(or||(or={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(sr||(sr={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(lr||(lr={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(ur||(ur={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(cr||(cr={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(pr||(pr={})),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"}(dr||(dr={})),function(e){e.IN="in",e.OUT="out"}(yr||(yr={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(fr||(fr={})),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"}(Tr||(Tr={})),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"}(Er||(Er={})),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"}(mr||(mr={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(hr||(hr={})),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"}(br||(br={})),function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Or||(Or={})),function(e){e.Saving="Saving"}(vr||(vr={}));const Nr=Mt().oneOf(["mobile","tablet","desktop"]),Ar=Mt().shape({deviceTypes:Mt().oneOfType([Nr,Mt().arrayOf(Nr)]),roles:Mt().arrayOf(Mt().string)}),Rr=Mt().shape({value:Mt().string,lookupCode:Mt().string}),Pr=Mt().shape({link:Mt().string,filename:Mt().string}),Sr=Mt().shape({displayName:Mt().string,parent:Mt().string}),wr=Mt().oneOfType([Mt().string,Mt().number,Mt().bool,Rr]),Ir=Mt().oneOfType([wr,Mt().arrayOf(wr)]),Ur=Mt().shape({fieldName:Mt().string,values:Mt().arrayOf(Ir),filter:Mt().string,type:Mt().string}),Cr=Mt().shape({minValue:Mt().number,maxValue:Mt().number}),Dr=Mt().shape({label:Mt().string,name:Mt().string,description:Mt().string,type:Mt().string,hidden:Mt().bool,faceted:Mt().bool,searchable:Mt().bool,uri:Mt().string,access:Mt().arrayOf(Mt().string),cardinality:Cr}),jr=Mt().shape({label:Mt().string,uri:Mt().string,typeColor:Mt().string,direction:Mt().string,startObject:Mt().object,endObject:Mt().object}),Lr=Mt().shape({typeColor:Mt().string,typeIcon:Mt().string,typeImage:Mt().string,label:Mt().string,uri:Mt().string,attributes:Mt().arrayOf(Dr)}),kr=Mt().shape({uri:Mt().string,label:Mt().string,memberTypes:Mt().array,extendsTypeUri:Mt().string,attributes:Mt().arrayOf(Dr)}),Fr=Mt().shape({uri:Mt().string,label:Mt().string,extendsTypeUri:Mt().string,relationshipTypeURIs:Mt().arrayOf(Mt().string)}),xr=Mt().shape({uri:Mt().string,description:Mt().string,label:Mt().string,schemaVersion:Mt().string,entityTypes:Mt().arrayOf(Lr),roles:Mt().arrayOf(Mt().object),groupTypes:Mt().arrayOf(Mt().object),relationTypes:Mt().arrayOf(jr),graphTypes:Mt().arrayOf(Fr),interactionTypes:Mt().arrayOf(kr),sources:Mt().arrayOf(Mt().object)}),Mr=Mt().shape({uri:Mt().string,type:Mt().string}),$r=Mt().shape({uri:Mt().string,attributes:Mt().object,type:Mt().string,timestamp:Mt().number,members:Mt().object}),Vr=Mt().shape({uri:Mt().string,type:Mt().string}),Gr=Mt().shape({value:Mt().object,ov:Mt().bool,type:Mt().string,uri:Mt().string}),Wr=Mt().shape({refEntity:Mt().oneOfType([Mt().array,Mt().object]),refRelation:Mt().oneOfType([Mt().array,Mt().object]),value:Mt().object,ov:Mt().bool,type:Mt().string,uri:Mt().string}),Yr=Mt().oneOf((0,l.values)(Yt)),Br=Mt().shape({type:Mt().oneOf(Object.values(Qt)).isRequired,attributeTypeUri:Mt().string.isRequired,parentUri:Mt().string.isRequired,uri:Mt().string,message:Mt().string}),qr={attributeType:Dr,showEmptyEditors:Mt().bool,lazy:Mt().bool,mode:Yr,metadata:xr,ownError:Br,errors:Mt().arrayOf(Br),crosswalks:Mt().array,onAddAttributes:Mt().func,onAddOneMore:Mt().func,onDeleteAttribute:Mt().func,onChangeAttribute:Mt().func,additionalControlsRenderer:Mt().func,hideDeleteButton:Mt().bool,showNonOv:Mt().bool,state:Mt().oneOf(["deleted","edited"])},Hr=gr({attributeValue:Gr},qr),Kr=gr({attributeValue:Wr},qr),Qr=Mt().shape({value:Mt().oneOfType([Mt().string,Mt().bool,Mt().number]),ov:Mt().bool,type:Mt().string,uri:Mt().string,lookupCode:Mt().string,lookupRawValue:Mt().string}),Jr=Mt().shape({totalOvValues:Mt().number,totalValues:Mt().number}),Xr=Mt().shape({inRelations:Mt().arrayOf(Mt().oneOfType([Mt().object,Mt().string])),outRelations:Mt().arrayOf(Mt().oneOfType([Mt().object,Mt().string])),groups:Mt().arrayOf(Mt().string),entityTypes:Mt().arrayOf(Mt().string),nextEntry:Mt().object}),zr=Mt().oneOf(["asc","desc"]),Zr=Mt().shape({id:Mt().string,content:Xr,allowOnlyCreateNew:Mt().bool,sortColumn:Mt().string,sortOrder:zr,"text-empty":Mt().string,max:Mt().number,icon:Mt().string,caption:Mt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,editingEnabled:Mt().bool}),en=Mt().shape({id:Mt().string,graph:Mt().shape({type:Mt().string,layout:Mt().number,deep:Mt().number,limit:Mt().number,uri:Mt().string,options:Mt().shape({reverseRelations:Mt().bool})}),sortBy:Mt().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:zr,max:Mt().number,icon:Mt().string,caption:Mt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar}),tn=Mt().shape({id:Mt().string,caption:Mt().string,pageSize:Mt().number,icon:Mt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,attributes:Mt().object}),rn=Mt().shape({entityUri:Mt().string,entityType:Mt().string,entityLabel:Mt().string,object:Mr}),nn=Mt().shape({relationUri:Mt().string,relationType:Mt().string,relationLabel:Mt().string,direction:Mt().string,object:Vr}),an=Mt().shape({entity:rn,relation:nn}),on=Mt().shape({value:Mt().string,isRawFilter:Mt().bool}),sn=Mt().shape({id:Mt().string,label:Mt().string,name:Mt().string,availableEntityTypes:Mt().array}),ln=Mt().shape({id:Mt().string,allowMergeAll:Mt().bool,matchActions:Mt().object,availableTabs:Mt().arrayOf(Mt().oneOf(["findMatches","potentialMatches","notAMatch"]))}),un=Mt().shape({matchRules:Mt().arrayOf(Mt().string),object:Mr,shortestTransitiveMatchPath:Mt().arrayOf(Mt().shape({matchRules:Mt().arrayOf(Mt().string),match:Mt().string})),direct:Mt().bool,matchScore:Mt().number}),cn=Mt().arrayOf(un),pn=Mt().arrayOf(Mt().shape({uri:Mt().string,label:Mt().string})),dn=[{label:At().text("And"),value:"and"},{label:At().text("Or"),value:"or"},{label:At().text("And not"),value:"and not"},{label:At().text("Or not"),value:"or not"}],yn=(0,l.prop)("referencedEntityTypeURI"),fn=(0,l.prop)("relationshipTypeURI"),Tn=(0,l.prop)("referencedAttributeURIs"),En=(0,l.curry)(((e,t)=>(0,l.pipe)(Tn,(0,l.filter)((0,l.startsWith)(e)))(t))),mn=En("configuration/relationTypes"),hn=En("configuration/entityTypes"),bn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),On=(0,l.filter)(bn),vn=(e,t)=>!t||t.some((t=>t===e.uri));function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _n=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Xe),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",bt.TYPE_STRING),(0,l.propEq)("type",bt.TYPE_BLOB))]),Nn=(0,l.has)("values"),An=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(bt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(bt.TYPE_LOOKUP)],[Nn,(0,l.always)(bt.TYPE_ENUM)],[_n,(0,l.always)(bt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",bt.TYPE_BOOLEAN),(0,l.always)(bt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Rn=(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){gn(e,t,r[t])}))}return e}({},e,{type:An(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Pn=e=>!!e&&(!!e.autoGenerated&&e.type!==bt.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\//)),wn=(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),In=e=>Sn(e)?"analyticsAttributes":"attributes",Un=(0,l.propEq)("hidden",!0),Cn=(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=Cn(bt.TYPE_NESTED),jn=Cn(bt.TYPE_REFERENCE),Ln=Cn(bt.TYPE_IMAGE),kn=(0,l.either)(Dn,jn),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(".")},xn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Mn=(0,l.pipe)(xn,Boolean),$n=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Vn=(0,l.both)(Mn,(0,l.pipe)(xn,("rdm",(0,l.pipe)(et,(0,l.equals)("rdm")))));const Gn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=In({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]||Yn(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:[]},Wn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Gn(e,t,r);return n.length?(0,l.last)(n):null},Yn=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",bt.TYPE_NESTED),(0,l.propEq)("type",bt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",bt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.map)((t=>Wn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Bn=[bt.TYPE_ACTIVENESS_DATE,bt.TYPE_DATE,bt.TYPE_TIMESTAMP,bt.TYPE_LOCAL_DATE],qn=[bt.TYPE_ACTIVENESS_DATE,bt.TYPE_TIMESTAMP,bt.TYPE_LOCAL_DATE],Hn=e=>Bn.includes(e),Kn=e=>qn.includes(e),Qn=[bt.TYPE_INT,bt.TYPE_LONG,bt.TYPE_NUMBER,bt.TYPE_FLOAT,bt.TYPE_DOUBLE,bt.TYPE_COUNT],Jn=e=>Qn.includes(e),Xn=e=>[bt.TYPE_FLOAT,bt.TYPE_DOUBLE].includes(e),zn=[bt.TYPE_BOOLEAN,bt.TYPE_BOOLEAN_RADIO,bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Zn=e=>zn.includes(e),ei=[bt.TYPE_URL,bt.TYPE_BLOG_URL,bt.TYPE_IMAGE_URL],ti=e=>ei.includes(e),ri=Cn(bt.TYPE_EMAIL),ni=e=>bt.TYPE_SSN===e;var ii,ai=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(ii||(ii={}));const oi=(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)))})),si=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),li=(0,l.curry)(((e,t)=>(0,l.pipe)(si(e),(0,l.prop)("extendsTypeURI"))(t))),ui=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(li(e,r)));return n(r)})),ci=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=li(e,n);return r})),pi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?pi(e,si(e,t.extendsTypeURI),r):void 0,di=(e,t)=>{const r=t.map(ci(e));return(r.length?r.reduce(l.intersection):[])[0]},yi=(e,t)=>pi(e,(0,l.is)(Object,t)?t:si(e,t),"typeImage"),fi=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&ui(e,t,n.uri)?r.concat(n.uri):r),[]);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 ui(e,n,t)||ui(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})}),{})),vi=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?_t.OUT:_t.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(_t.IN),i=r(_t.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},gi=(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=Pn(t);return!t||(!t.access||t.access.includes(e))&&(e===_i.READ||!r)})),Ri=(0,l.curry)(((e,t,r)=>Ai(_i.READ,r)&&(Bt(t)?Ai(_i.INITIATE_CHANGE_REQUEST,r):Ai(e,r)))),Pi=Ri(_i.CREATE),Si=Ri(_i.DELETE),wi=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]),Di=Ni([_i.DELETE,_i.UPDATE,_i.READ]),ji=(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)(ji(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)&&ui(e,a,t.type)&&ui(e,o,r.type)})),xi=(e,t,r,n,i)=>{const a=si(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=si(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)}},$i=(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),Vi=Sn,Gi=(0,l.complement)(Vi),Wi=Ai(_i.READ),Yi=e=>{let{attributeType:t,mode:r}=e;return Gi(t)&&Pi(r,t)&&!Un(t)},Bi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Be(r.uri),o=wi(n),s=Pi(n);return(0,l.cond)([[Vi,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=wi(n),u=Si(n),c=Ki(_i.UPDATE,n,a,r),p=Ki(_i.DELETE,n,a,r);return(0,l.cond)([[Vi,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)},Hi=(0,l.curry)(((e,t,r,n)=>{const i=Yn(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)||!Hi(e,t,r[n.name],n)))))})),Ki=(0,l.curry)(((e,t,r,n,i)=>Bt(t)?Hi(_i.INITIATE_CHANGE_REQUEST,r,n,i):Hi(e,r,n,i))),Qi=(0,l.both)((0,l.complement)(Un),Wi),Ji="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===Ji})).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===Ji){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_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},ta={[ea.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ea.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ea.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ea.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[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"]},[ea.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],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_READ_ENTITIES_FROM_DT]),sa=ra([ea.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),la=ra([ea.CAN_UPDATE_PROCESS_INSTANCE]),ua=ra([ea.CAN_VIEW_WORKFLOW_DEFINITION]),ca=ra([ea.CAN_CONFIG_ENVIRONMENT_REGISTER]),pa=ra([ea.CAN_UPDATE_WORKFLOW_DATA_TASK]),da=ra([ea.CAN_READ_WORKFLOW_DATA_TASK]),ya=ra([ea.CAN_MANAGE_WORKFLOW_DEFINITION]),fa=ra([ea.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Ta=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Ea=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),ma=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ha=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ba=ra([ea.CAN_EXECUTE_WORKFLOW_JOBS]),Oa=ra([ea.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),va=ra([ea.CAN_CREATE_CONFIG_JAR]),ga=ra([ea.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),_a=ra([ea.CAN_VIEW_CONFIG_JAR]),Na=ra([ea.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Aa=ra([ea.CAN_VIEW_WORKFLOW_JOBS]),Ra=ra([ea.CAN_MAKE_BULK_UPDATE]),Pa=ra([ea.CAN_OPEN_DATA_LOADER_EXECUTE,ea.CAN_OPEN_DATA_LOADER_READ]),Sa=ra([ea.CAN_BULK_DELETE_PROFILES]),wa=ra([ea.CAN_READ_MDM_DATA_ENTITIES]),Ia=ra([ea.CAN_READ_DVF]),Ua=ra([ea.IS_FREEMIUM_ADMIN]),Ca=(0,l.reject)(Un),Da=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ca,(0,l.filter)(e))(t),ja=(0,l.curry)(((e,t)=>Da((t=>Yi({attributeType:t,mode:e})),t))),La=(0,l.curry)(((e,t)=>Da((t=>Yi({attributeType:t,mode:e})||Qi(t)),t))),ka=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Qi)),Fa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Fa(e)])))),xa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Qi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...xa(e)])))),Ma=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Ma(e)])))),$a=(0,l.pipe)(si,(0,l.converge)(l.concat,[xa,Ma]));function Va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ga(e,t,r[t])}))}return e}function Ga(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wa=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Wa(e)))},t))),Ya=e=>{var t;return Va({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Ba=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),qa=(0,l.when)(Ba,(0,l.dissoc)("values")),Ha=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Va({},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})})),Ka=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Qa=(0,ai.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Fa,t).concat((0,l.chain)(Fa,r)).some(Ka)})),Ja=e=>{let t=!1;const r=Wa((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Va({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Xa=e=>{const t=Qa(e),r=(0,l.map)((e=>Wa((0,l.pipe)(qa,(0,l.when)((0,l.always)(e),Ha))))(t)),n=(0,l.map)(Ya),i=(0,l.map)(Ja);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},za=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Za=(0,l.prop)("relationshipTypeURIs"),eo=(0,l.curry)(((e,t)=>e.graphTypes.filter(to(e,t)))),to=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(bi(e,t))},ro=(e,t)=>(0,l.pipe)(za,(0,l.defaultTo)({}),Za,(0,l.defaultTo)([]),(0,l.chain)(hi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(si(e)))(e,t),no=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),io=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),ao=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return io((0,l.complement)(no))(e)},oo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return io(no)(e)},so=(0,l.pipe)(si,(0,l.propOr)([],"matchGroups")),lo=(e,t,r)=>(0,l.pipe)(so,(0,l.find)((0,l.propEq)("uri",r)))(e,t),uo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(lo,(0,l.propOr)(r,"label"))(e,t,r))),co=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(so,(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]})),po=e=>(0,l.partition)(no,e),yo=(0,l.includes)(l.__,["and","or","not"]),fo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),To=(0,l.includes)(l.__,["equals","notEquals","in"]),Eo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return yo(t)?Eo(r):fo(t)?r.filter(Xe):To(t)?r.map((0,l.prop)("uri")).filter(Xe):[]})),l.uniq),mo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Eo),l.uniq),ho=(0,l.pipe)(so,mo),bo=(0,l.pipe)(co,mo),Oo=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},vo=(0,l.pipe)(Oo,xa),go=(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||ui(e,n,t)})(e,t))})(e,t)),_o=e=>!!e.required,No=(e,t,r)=>{const n=(0,l.cond)([[Xe,si(e)],[ze,Ei(e)]])(t);return Ao(e,n,r)},Ao=(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&&!Pn(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===bt.TYPE_REFERENCE){const n=fn(t),a=Tn(t);i=No(e,n,r).filter((e=>a.some(Ze(e.uri))))}else t.attributes&&(i=Ao(e,t,r));i&&n.push(...i)}return n})):t.type===bt.TYPE_REFERENCE?No(e,fn(t),r):[],Ro=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),_o]),e.attributes||[])},Po=(e,t)=>{const r=hn(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},So=(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)?At().text(n):n};return r(null,t)})),wo=["label","description","abbreviation","caption","toolTip"],Io=e=>So(wo,e),Uo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=tt(t);return r.find((e=>{let{uri:t}=e;return tt(t)===n}))})),Co=(0,l.curry)(((e,t)=>{const r=tt(t);return(0,l.pipe)(Uo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Do=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"})},jo=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},Lo=(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)})),ko=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=si(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Fo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xo(e,t,r[t])}))}return e}function xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mo=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:Yn(e,t)).map((t=>t.map((t=>{const i=Mo(e,t,r,n);return i.length?Fo({},t,{children:i}):t})))).orSome([]).filter((0,l.either)((0,l.complement)(kn),(0,l.prop)("children"))).filter(Qi).filter(r).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},$o=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Mo(e,t,r,["attributes","analyticsAttributes"])},Vo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Mo(e,t,r,["attributes"])},Go=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Mo(e,t,r,["analyticsAttributes"])},Wo=(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)})),Yo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return tt(r)===e})))),Bo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Yo("LUD")),(0,l.defaultTo)(r))(t||[])},qo=(e,t)=>{let{survivorshipStrategies:r}=e;return Yo(t,r)},Ho=(0,l.allPass)([(0,l.complement)(l.isNil),Ai(_i.READ)]),Ko=(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.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ai(_i.CREATE)]),Jo=(0,l.curryN)(2,(0,l.pipe)(si,Ko)),Xo=e=>{let{ov:t}=e;return!1!==t},zo=(e,t)=>((e,t)=>ti(e.type)&&ie(t))(e,t)||((e,t)=>ri(e.type)&&ae(t))(e,t),Zo=(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))),es=Zo("refEntity"),ts=Zo("refRelation"),rs=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ns=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},is=(0,l.prop)("objectURI"),as=(0,l.prop)("objectURI"),os=(0,l.prop)("type"),ss=(0,l.pipe)(es,(0,l.defaultTo)({}),is),ls=(0,l.pipe)(ts,(0,l.defaultTo)({}),as),us=(0,l.pipe)(es,(0,l.defaultTo)({}),os),cs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},ps=(0,l.evolve)({refEntity:te,refRelation:te}),ds=(e,t,r,n)=>{const i=Gn(e,r),a=si(e,t.type)||Ei(e,t.type);if(0===i.length)return null;const o=In(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=>fn(e)===r.uri||yn(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},ys=(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?ys(a.value,o):a},fs=(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 ys(e[r],i)})),Ts=(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")]]),Es=(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)(Ts),(0,l.when)((()=>i.length>0),(0,l.map)(Es(e,i))))(r)})),ms=Es(null),hs=Es(Xo),bs=(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=fs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Os=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ss,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{});function vs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gs(e,t,r[t])}))}return e}function gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _s=e=>{let{parentUri:t,attributeType:r}=e;return vs({uri:Ye(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[kn,(0,l.always)({value:{}})],[Mn,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},Ns=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(ja(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=_s({parentUri:r,attributeType:e});let s=Yn(n,e);s&&(e.type===bt.TYPE_REFERENCE&&(s=On(s)),a.value=Ns({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!$n(e)||(o[t]=[a])}return o},As=e=>{let{entity:t,metadata:r}=e;return No(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}]:ds(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:Ps({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Rs=(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===bt.TYPE_NESTED?vs({},e,{value:Rs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return vs({},s(t),Ns({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Ps=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=_s({parentUri:n,attributeType:r}),u=Ts(l);return(0,xe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ss=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,Ts(n),a,o,i)}))},ws=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,xe.ZP)(t,(e=>{Se(e.attributes||e.value,r,n,i,a,o)}))},Is=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)}))},Us=(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"))),Cs=(0,l.reject)(Us),Ds=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=>Ds({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Cs)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},js=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ds({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),ps),deleteEmptyComplex:e})},Ls=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(js(e),(0,l.reject)(l.isEmpty))},ks=Object.values(St),Fs=(0,l.includes)(l.__,ks),xs=e=>ks.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$s(e,t,r[t])}))}return e}function $s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vs=(e,t)=>`${e}_${t}`,Gs=[Ft.matches.name,Ft.matchRules.name],Ws=(0,l.values)(It).map((e=>e.name)),Ys=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ws)))),Bs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Gs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Vs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),qs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Ys(r),Bs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Vs(`dtPotentialMatches.${t.name}`,"")))))(Ft)},Hs=(0,l.propEq)("uri",Ft.type.uri),Ks=e=>(0,l.values)(kt).some((0,l.propEq)("uri",e.uri)),Qs=(0,l.propEq)("uri",Lt.sourceSystems.uri),Js=Object.values(wt),Xs=(0,l.includes)(l.__,Js),zs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Zs=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},el=e=>{let{entity:t,attributeType:r,value:n}=e;return Ms({},t,{[r.uri]:n})},tl=(0,l.propEq)("uri",wt.roles.uri),rl=(0,l.propEq)("uri",wt.tags.uri),nl=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)},il="UrlThumbnail",al="CdnUrlThumbnail",ol=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Xo):(0,l.head)(n);return e&&e.value}return null})),sl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>ol(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),ll=sl(["CdnUrl","Url"],!0),ul=sl(["CdnUrlPreview","UrlPreview"],!0),cl=sl([al,il],!0),pl=sl([al,il]),dl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[wn,(0,l.always)(t)],[(0,l.both)(Sn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=wn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Fs(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)}),[])},yl=(e,t,r)=>{const n=ka(e),i=(0,l.any)(r?l.T:Xo);return dl(n,t,i)},fl=(e,t,r,n,i,a)=>{const o=Be(null==r?void 0:r.uri)?ja(t,e):La(t,e);return dl(o,r,((e,o)=>{const s=Yi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Xo,e)||wn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Tl;const El=e=>{Tl=e};function ml(e,t){return Tl(e,t)}const hl=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)})),bl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return ml("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},Ol=(0,l.once)((()=>ml("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),vl=e=>ml("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),gl=(e,t)=>ml("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),_l=e=>z.fromNull(dt[e]).map(At().text).orSome(""),Nl=(0,l.curry)(((e,t)=>`${e}_${t}`)),Al=(0,l.split)("_"),Rl=(0,l.includes)("_"),Pl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Sl=(0,l.curry)(((e,t)=>e.some(Pl(t)))),wl=Sl([ct.IN_RANGE,ct.COUNT_RANGE,ct.WITHIN]),Il=Sl([ct.EXISTS,ct.MISSING_VALUE]),Ul=(0,l.cond)([[Il,(0,l.always)(0)],[wl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),Cl=(0,l.complement)(Il),Dl=Sl([ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS]),jl=Sl([ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE]),Ll=Sl([ct.IN_FILE,ct.NOT_IN_FILE]),kl=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}},Fl=Sl([ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS]),xl=Sl([ct.WITHIN]),Ml=[[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]],$l=(e,t)=>Ml.some((r=>r.includes(e)&&r.includes(t))),Vl=(0,l.pipe)(l.omit,l.values),Gl={OPTIONS_FOR_STRING:Vl(["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:Vl(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_BLOB:Vl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_NUMBER:Vl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_LOOKUP:Vl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ct),OPTIONS_FOR_ENUM:Vl(["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]},Wl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case bt.TYPE_TYPEAHEAD:case bt.TYPE_STRING:case bt.TYPE_PASSWORD:case bt.TYPE_TEXT:case bt.TYPE_CIK_ID:case bt.TYPE_URL:case bt.TYPE_BLOG_URL:case bt.TYPE_IMAGE_URL:case bt.TYPE_EMAIL:return Gl.OPTIONS_FOR_STRING;case bt.TYPE_LOOKUP:case bt.TYPE_DEPENDENT_LOOKUP:return Gl.OPTIONS_FOR_LOOKUP;case bt.TYPE_ENUM:return Gl.OPTIONS_FOR_ENUM;case bt.TYPE_DATE:case bt.TYPE_ACTIVENESS_DATE:case bt.TYPE_TIMESTAMP:case bt.TYPE_LOCAL_DATE:return Gl.OPTIONS_FOR_DATE;case bt.TYPE_BOOLEAN:case bt.TYPE_BOOLEAN_RADIO:return Gl.OPTIONS_FOR_BOOLEAN;case bt.TYPE_BLOB:return Gl.OPTIONS_FOR_BLOB;case bt.TYPE_LONG:case bt.TYPE_INT:case bt.TYPE_FLOAT:case bt.TYPE_DOUBLE:case bt.TYPE_NUMBER:return Gl.OPTIONS_FOR_NUMBER;case bt.TYPE_ENTITY_ID:return Gl.OPTIONS_FOR_ID;case bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ct.EQUALS];case bt.TYPE_COUNT:return Gl.OPTIONS_FOR_COUNT;case bt.TYPE_NESTED:case bt.TYPE_REFERENCE:case bt.TYPE_IMAGE:return Gl.OPTIONS_FOR_COMPLEX;default:return Gl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(jl,n):n},Yl=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)}`}),"")}},Bl=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),ql=e=>Array.isArray(e)?e.map(ql).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Hl=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Kl=e=>`'${e}'`,Ql=e=>`"${e}"`,Jl=(0,l.pipe)(ql,Hl),Xl=(0,l.pipe)(Jl,Kl),zl=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(wl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Zl=(e,t)=>jl(t)?{type:bt.TYPE_INT}:Ll(t)?{type:bt.TYPE_FILE}:Fl(t)&&!xl(t)&&Kn(e.type)?{type:bt.TYPE_LOCAL_DATE}:e,eu=Object.values(mt),tu=e=>eu.includes(e),ru=e=>At().text(ht[e]),nu=e=>{const t=f()();switch(e){case mt.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case mt.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case mt.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case mt.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case mt.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function iu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){au(e,t,r[t])}))}return e}function au(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ou=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),su=(0,l.curry)(((e,t,r)=>{const n=r.map(wl(e)||t.endsWith(".count")?Jl:Xl).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),lu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},uu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ul(t);return(0,l.pipe)(lu(i),(0,l.map)(su(t,r)),ou(" or "))(n)},cu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Xl).join(",")})`},pu=e=>`*${e}*`,du=e=>`URL:${e}`,yu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,fu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ct.IN_FILE?r:`not ${r}`},Tu=(e,t)=>[R(e,t),P(e,t)],Eu=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!mu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ct.ON:return iu({},e,n?{filter:ct.EQUALS}:{filter:ct.IN_RANGE,values:[Tu(i,n)]});case ct.BEFORE:return iu({},e,{filter:ct.LTE,values:[[P(i,n)]]});case ct.AFTER:return iu({},e,{filter:ct.GTE,values:[[R(i,n)]]});case ct.WITHIN:return iu({},e,{filter:ct.IN_RANGE,values:[nu(i)]})}}return e}),uu),mu=(0,l.propSatisfies)(Kn,"type"),hu=[[(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(uu({filter:ct.EQUALS,fieldName:t,values:[r]}))),new Yl).build())),ou(" or "))(r)}],[(0,l.propEq)("filter",ct.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return uu({fieldName:r,filter:t,values:n.map((0,l.pipe)(ql,pu))})}],[(0,l.propEq)("filter",ct.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?uu(iu({},e,{values:(0,l.flatten)(r)})):yu(r)?cu(iu({},e,{filter:"listEquals"})):uu(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=Ul(t);return(0,l.pipe)(lu(i),(0,l.map)(su(t,r)),ou(" and "))(n)})(iu({},e,{values:(0,l.flatten)(e.values)})):mu(e)?(e=>{const{values:t}=e,r=!mu(e),[n]=t;return(new Yl).addClause(uu(iu({},e,{filter:ct.LT,values:[R(n,r)]}))).addClause(uu(iu({},e,{filter:ct.GT,values:[P(n,r)]}))).orBuild()})(e):yu(t)?cu(iu({},e,{filter:"not listEquals"})):uu(e)}],[(0,l.propSatisfies)(Ll,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return uu({fieldName:r,filter:fu(t,r),values:n.map((0,l.prop)("link")).map(du)})}],[(0,l.propSatisfies)(jl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return uu({fieldName:`${r}.count`,values:n,filter:kl(t)})}],[(0,l.propSatisfies)(Fl,"filter"),Eu],[(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 su(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return su(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,uu]],bu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Cl(e)||vu(r))},Ou=e=>Array.isArray(e)?vu(e):null!=e&&ql(e).length>0,vu=e=>e&&e.length>0&&e.every(Ou);function gu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _u=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Nu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Au=(e,t,r)=>"children"===e?Pu(r,[...t][0],!0):r,Ru=(e,t,r)=>"values"===e?[...r,...t]:r,Pu=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)(Au,t),e);if(!r&&Dl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Ru,t),e)}return(0,l.append)(t,e)},Su=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=_u(e),r=e=>e.fieldName===t?e:r({fieldName:Nu(e),children:[e]});return r(e)})(t);return Pu(e,r)}),[]),wu=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")),Iu=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&&wu(n)&&!t?`inSameAttributeValue(${r(n,!1)})`:r(n,i)}],...e])(a))),new Yl).buildWithOperators(n.map((0,l.prop)("operator")))}},Uu=(0,l.pipe)((0,l.propOr)("","filter"),Rl),Cu=(0,l.map)((0,l.when)(Uu,(e=>{const[t,r]=Al(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Du=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)(bu),Cu,Su,Iu([...e,...hu],t))},ju=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Lu=[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS],ku=[ct.EQUALS,ct.NOT_EQUALS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.FULL_TEXT,ct.EXISTS],Fu=[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],xu=(e,t)=>{const r=Rn(e);return(e=>{switch(e){case St.startDate.name:case St.endDate.name:case It.dueDate.name:case Dt.createdTime.name:case Dt.updatedTime.name:case Lt.reltioLoadDate.name:case Lt.createDate.name:case Lt.updateDate.name:case Lt.deleteDate.name:case Lt.publishDate.name:return Lu;case jt.matches.name:case Lt.count.name:return Fu;case It.workflow.name:case It.assignee.name:case It.step.name:case Ut.commenter.name:case Dt.createdBy.name:case Dt.updatedBy.name:case Lt.sourceSystems.name:case Lt.value.name:return ku;default:return null}})(t)||Wl(r)},Mu=[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],$u=(0,l.pipe)(xu,(0,l.filter)((0,l.includes)(l.__,Mu))),Vu=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Gu=e=>{let{query:t,body:r}=e;return t=Vu(t),ml(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Wu=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)(Du(),ju(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Gt(i)}`},Yu=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=Wu(e,t,r);return ml(n)},Bu=(0,l.pipe)((0,l.reject)(l.isNil),Vt),qu=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(Du(),ju(i))(r),c=Bu({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return Gu({query:c,body:p})},Hu=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return qu({fieldName:t,searchParams:i,options:n})},Ku="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Qu=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)(Du(),ju(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Ku,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Gt(i)}`},Ju=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=Qu(e,t,r);return ml(n)},Xu=e=>nc(e,{select:"secondaryLabel"}),zu=(e,t)=>{const{select:r=Ku,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),ml("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Zu=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Be)),ec=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=Zu(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)(Du(),ju(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),ml(`${s}/api/${o}/${t}/_object`,m)},tc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,rc={options:"sendHidden,addRefAttrUriToCrosswalk"},nc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rc;return ml(`/${e}${Gt(t)}`)},ic=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 ml(n,r)},ac=e=>ml(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),oc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return ml(`/entities/_events/_total${Vt({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},sc=(e,t)=>ml(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),lc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return ml(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},uc=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return ml(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Vt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cc=e=>{const t=new FormData;return t.append("file",e),ml("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ce(e,At().text("Can't upload file"));return Promise.reject(t)}))},pc=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 ml(`/personal/findSavedSearches${Vt({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"}})},dc=e=>ml(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),yc=e=>ml("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),fc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return ml(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Tc=e=>{let{uri:t}=e;return ml(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ec=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),fc)(e),mc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),fc)(e);function hc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bc=["max","offset","filter"],Oc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Oc(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){hc(e,t,r[t])}))}return e}({},t,(0,l.pick)(bc,e)))),vc=(0,l.omit)(["activeness"]),gc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],tr.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],tr.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Oc(e),(0,l.omit)(bc))(e))),vc,(0,l.omit)(["labels"])))(t),{url:`/${e}/_connections${Gt({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},_c=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Nc=(0,l.reject)(l.isNil),Ac=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Rc=e=>ml(Ac(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Pc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Ac);return ml(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Sc=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?Ls()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Nc,re,JSON.stringify);return ml(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},wc=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"),Ac,n),o=he(i(t),i(r)).concat(Oe(t,r));return ml(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Ic=(e,t)=>{const{url:r,options:n}=gc(e,t);return ml(r,n).then(_c)},Uc=(e,t)=>ml(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Cc=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===_t.IN?a.inRelations=[n]:a.outRelations=[n],ml(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Dc=(e,t)=>ml(`/recentSearches/?environment=${e}&tenant=${t}`,{method:"GET",application:"explorer",headers:{"Content-Type":"application/json"}}),jc=e=>ml("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Lc=e=>{let{environment:t,tenant:r,createdDate:n}=e;return ml(`/recentSearches?environment=${t}&tenant=${r}&createdDate=${n}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function kc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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 xc={select:"label,secondaryLabel,name,type,startDate,endDate"},Mc=(0,l.reject)(l.isNil),$c=(0,l.pipe)(Mc,Vt),Vc=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=kc({},xc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return ml(`/${t}/_tree${$c(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Gc=e=>{let{uri:t,graphUri:r}=e;const n=kc({},xc,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return ml(`/${t}/_parents${$c(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Wc=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=kc({},xc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return ml(`/${t}/_hops${$c(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Yc(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 Bc=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},qc="/activities",Hc=e=>{let{label:t,description:r}=e;return ml(qc,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:Bc()}})},Kc=e=>{const t=Gt(e);return ml(qc+t,{method:"GET"})},Qc=e=>ml(`/activities/_total${Gt(e)}`,{method:"GET"}),Jc=e=>{const{entityUri:t}=e,r=Yc(e,["entityUri"]);return ml(`/${t}/_activities${Gt(r)}`,{method:"GET"})},Xc=e=>{const{entityUri:t}=e,r=Yc(e,["entityUri"]);return ml(`/${t}/_activities/_total${Gt(r)}`,{method:"GET"})};function zc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zc(e,t,r[t])}))}return e}function Zc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ep=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},tp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return ml(ep({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},rp=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=ep({url:r,workflowPath:t,tenant:n})),ml(s,{method:i||"GET",body:JSON.stringify(a),headers:zc({"Content-Type":"application/json"},null!=o?o:{})})},np=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=ep({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return ml(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)},ip=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=ep({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?zc({},l,{comment:o}):l;return ml(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},ap=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=ep({url:`/tasks${s?Gt(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(zc({objectURIs:[i]},(0,l.reject)(E,a)))};return ml(u,zc({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},op=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i}=e;const a={assignee:i};return ml(ep({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},sp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i}=e;return ml(ep({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:JSON.stringify(i)})},lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return ml(ep({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return ml(ep({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},pp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return ml(ep({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},dp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},yp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},fp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return up({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},Tp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return ml(ep({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Ep=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return ml(ep({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},mp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Xo);return a&&a[0]&&(r=n.length>0&&a[0].value?mp(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),hp=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=mp(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},bp=/[,\s]*$/,Op=e=>{const t=At().text(gt);if(!e)return t;const r=e.replace(bp,"");return""===r.toString().trim()?t:r},vp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},gp=(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=vp(e,r.referencedEntityTypeURI);if(n)return hp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return hp({attributes:t||{}},r.dataLabelPattern);return""},_p=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Np=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Ap=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",Rp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),cl,(0,l.prop)("value"))),Pp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),Rp),Sp=(e,t,r)=>{const n=Pp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(fs(e),Rp)))(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")])})(si(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ds(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,Rp))(r)})(e,r)||yi(e,r.type);return Ap(t,n)};function wp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ip(e,t,r[t])}))}return e}function Ip(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Up="DTSS/",Cp=(0,l.replace)(new RegExp("^entities/"),""),Dp=e=>Up+e.dataTenant+"/"+e.uri,jp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Lp=e=>!(!e||!e.dataTenant),kp=(0,l.startsWith)(Up),Fp=(0,l.pipe)((0,l.ifElse)(kp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),xp=(0,l.ifElse)(Lp,Dp,(0,l.prop)("uri")),Mp=e=>e&&e.uri?e.dataTenant?Dp(e):Cp(e.uri):"",$p=(0,l.curry)(((e,t,r)=>(si(t,r.type)||{})[e]||"")),Vp=$p("label"),Gp=$p("typeGraphIcon"),Wp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=si(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(Xo)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:gp(e,o,i),uri:a.uri}})).filter(l.identity):[]},Yp=(0,l.pipe)(Wp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Bp=(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=Bp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Bp(e.slice(1),r)}})),qp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Hp=e=>(0,l.propOr)([],"matchRules",e),Kp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?wp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Qp=(e,t,r)=>t&&r?r.aEntity:e,Jp=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 ml(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Vt)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Xp=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 ml(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Vt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},zp=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return ml("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Zp=(e,t,r)=>Promise.all(t.map((async t=>{await ml(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),ed=async(e,t)=>await Zp(e,t,"NOT"),td=async(e,t)=>await Zp(e,t,"MATCH"),rd=async(e,t)=>await Promise.all(t.map((async t=>{await ml(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function nd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){id(e,t,r[t])}))}return e}function id(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ad(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 od=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return ml(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},sd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Rd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},ld=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Rd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},ud=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return ml(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},cd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return ud({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},pd=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?zp(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return ud({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},dd=(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=ad(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)}),[])),yd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),dd),fd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return ml(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(yd)},Td=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)},Ed=Td((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return ml(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(yd)})),md=Td((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return ml(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),hd=(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)}},bd=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return ml(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Od=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 bd(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},vd=Od("NOT"),gd=Od("MATCH"),_d=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([Zp(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return bd(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},Nd=_d("NOT"),Ad=_d("MATCH");function Rd(e){let{requestProvider:t=ml,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,nd({},ad(s,["headers"]),{headers:nd({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Pd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Rd({url:Qu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Sd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Rd({url:Wu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},wd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=gc(t,r);return Rd({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(_c,(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)))}))))},Id=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Rd({url:`${tc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Ud=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return ml(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Cd=e=>{let{dtssPath:t,tenant:r}=e;return ml(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},Dd=e=>{let{dtssPath:t,customerTenant:r}=e;return ml(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},jd=e=>{let{dtssPath:t,tenants:r}=e;return ml(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},Ld=()=>ml("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fd(e,t,r[t])}))}return e}function Fd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xd=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=kd({},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 ml(`${t}/api/${r}/graph/search${Gt({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Md=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return ml(`${t}/api/${r}/graph/search/count`,{method:"POST",body:kd({},n,i),headers:{"Content-Type":"application/json"}})},$d=(e,t)=>`${e}/${t}/comments`,Vd=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return ml(`${$d(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Gd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ml(`${$d(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Wd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ml($d(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Yd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ml(`${$d(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Bd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ml(`${$d(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},qd=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return ml(`${$d(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Hd=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Gt({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return ml(`${$d(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qd(e,t,r[t])}))}return e}function Qd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jd=e=>{let{tenant:t,servicesPath:r}=e;return ml(`${r}/oauth/proxy${Gt({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Xd="graphExport",zd=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await ry({servicesPath:e,tenant:t,environment:r,namespace:Xd,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Kd({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await ry({servicesPath:e,tenant:t,environment:r,namespace:Xd,options:Kd({method:"PUT"},o)})}catch(e){s=null}return s||(s=await ry({servicesPath:e,tenant:t,environment:r,namespace:Xd,options:Kd({method:"POST"},o)})),s},Zd=e=>{let{servicesPath:t,key:r}=e;return ml(`${t}/settings${Gt({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ey=e=>{let{servicesPath:t}=e;return ml(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},ty=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return ml(`${n}/plugins${Gt({tenant:t,user:r})}`,{method:"GET"})},ry=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return ml(`${n}/configService${Gt({tenant:t,environment:r,namespace:a,projection:o})}`,i)},ny=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return ry({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},iy=e=>{let{servicesPath:t,stateHash:r}=e;return ml(`${t}/searchLink?key=${r}`,{method:"GET"})},ay=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),ml(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},oy=e=>ml(`/${e}?showObjectsInfo=true`,{method:"GET"}),sy=e=>{let{exportPath:t,tenant:r,options:n}=e;return ml(`${t}/${r}/activities${Gt(n)}`,{method:"POST"})};function ly(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uy(e,t,r[t])}))}return e}function uy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cy=e=>{const{entityUri:t}=e;return ml(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},py=e=>{let{entityUri:t,crosswalk:r}=e;return ml(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},dy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return ml("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[ly({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),ly({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},yy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return ml(`/${r}/_${n}${Gt({contributorURI:t})}`,{method:"POST"})},fy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return ml(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},Ty=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return ml(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ey=e=>{let{entityUri:t,crosswalkId:r}=e;return ml(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},my=e=>{let{entityTypeUri:t}=e;return ml(`/dataQuality/fillRates${Vt({entityType:tt(t)})}`,{method:"GET"})},hy=e=>{let{entityTypeUri:t,attributeFieldName:r}=e;return ml(`/dataQuality/statistic${Vt({entityType:tt(t),attribute:r})}`,{method:"GET"})},by=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return ml(`${t}/api/${r}/dataValidationFunctions/entityTypes/${tt(n)}`,{method:"GET",headers:{env:i}})},Oy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return ml(`/${t}${Gt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},vy=e=>{let{attributeUri:t,value:r}=e;return ml(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},gy=e=>{let{attributeUri:t,value:r}=e;return ml(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},_y=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return ml(`/${t}${Gt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Ny=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Gt({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Ls()([[{value:a}]]);return ml(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Ay=e=>{let{entityUri:t,attributeName:r,value:n}=e;return ml(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Ry=e=>{let{entityUri:t,attributeName:r}=e;return ml(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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 Sy=e=>{let{entityUri:t}=e;return ml(`/${t}/_historicURIs`,{method:"GET"})},wy=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 ml(`/${t}/_changesWithTotal${Gt(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){Py(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Iy=(e,t)=>ml(`/${e}/_previousChange${Gt({timestamp:t})}`,{method:"GET"}),Uy=(e,t)=>ml(`/${e}${Gt({time:t})}`,{method:"GET"});function Cy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Dy(e,t,r[t])}))}return e}function Dy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jy=e=>{let{url:t,method:r,data:n,headers:i}=e;return ml(t,Cy({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:Cy({"Content-Type":"application/json"},null!=i?i:{})}))},Ly=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Gt({options:a.join(","),severity:o.join(",")});return ml(`${t}/validate/${i}/entity/${Mp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},ky=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return ml(`${t}/validate/${n}/entity${Gt({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Fy=e=>{let{tenant:t,apiPath:r}=e;return ml(`${r}/tenants/${t}/name`,{method:"GET"})},xy=e=>{let{tenant:t,apiPath:r}=e;return ml(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},My=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return ml(`${a}/preferences${Gt({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},$y=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return ml(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Vy=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return ml(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})};var Gy=r(47485);const Wy=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=qe(),s={attributes:Ns({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=ds(r,e,n.uri)[0];return i&&i.value?ws({entity:e,attributeType:n,uri:i.uri,value:t}):Ps({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Yy=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ss),(0,l.filter)(Be),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),By=(0,l.curry)(((e,t)=>{const r=Yy(e=e||{},t=t||{});return r.concat((0,l.chain)(By(e),r))})),qy=(0,l.curry)(((e,t)=>(0,l.pipe)(ue,(0,l.filter)(e))(t))),Hy=qy((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Ky=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Be)),Qy=e=>(0,l.pipe)(Hy,Ky(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Jy=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Hy,(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})),Xy=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Be),(0,l.omit)(["uri","timestamp"])),zy=(0,l.pipe)(Xy,(0,l.evolve)({attributes:Ls(!0)})),Zy=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=Qy(i);if(a.length>0)for(const t of a)e=Jy(t,r[t].uri,e);const o=(s=await ic(zy(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},ef=async(e,t,r)=>{const n=rf(e,t),i={};for(const t of n)i[t]=await Zy(e,t,i,r);return i},tf=(0,l.curry)(((e,t)=>{const r=Gy.Node(t);return Qy(e[t]).forEach((t=>{const n=tf(e,t);r.addEdge(n)})),r})),rf=(e,t)=>(0,l.pipe)((0,l.map)(tf(e)),(0,l.map)(Gy.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),nf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Xy))})),af=(e,t)=>{const r=_e(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=be(e,t),a=Oe(e,t);return[...ve(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),ge((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},of=(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 Jy(r,n,e)}),e))))}),t)}),nf),sf=(0,l.curry)(((e,t)=>(0,l.when)(Be,(0,l.propOr)(l.__,t,e),t)));function lf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uf(e,t,r[t])}))}return e}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cf=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:dr.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},pf=e=>{let{relationUri:t}=e;return{type:dr.DELETE_RELATION,parameters:{relationUri:t}}},df=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:dr.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},yf=e=>{let{oldRelation:t,newRelation:r}=e;return{type:dr.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},ff=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:dr.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Tf=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Ef=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case dr.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Sc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case dr.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Pc(e,i).then(o)};case dr.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Cc(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case dr.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return wc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case dr.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[pf({relationUri:o}),cf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(mf(n)),(0,l.map)(Ef),Tf)(s)}}},mf=e=>t=>lf({dcrProcessor:e},t),hf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Wt({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(mf(r)),(0,l.map)(Ef),Tf,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},bf=e=>t=>(0,l.map)((t=>lf({},t,{parameters:(0,l.evolve)({parentUri:sf(e),entityUri:sf(e),newEntityUri:sf(e)},t.parameters)})),t);function Of(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 gf=e=>Of({},(0,l.path)(Cf(),e),{startDate:(0,l.path)(kf(),e),endDate:(0,l.path)(Ff(),e)}),_f=(e,t)=>(0,l.pipe)((0,l.path)(Lf()),sf(t))(e),Nf=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=_f(e,r),i=(0,l.path)(Df(),e)===yr.IN,a=e.parentEntityUri||n;return cf({parentUri:i?t:a,relation:gf(e),entityUri:i?a:t})})),...o.map((t=>{const i=_f(t,r),a=(0,l.path)(Df(),t)===yr.IN,o=i!==(0,l.pipe)((0,l.path)(Cf()),a?xf:Mf)(t),s=Gf(e,(0,l.path)(If(),t)),u=t.parentEntityUri||n,c=sf(r,i);return o?ff({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Cf(),t),isReversed:!1}):yf({oldRelation:(0,l.path)(Cf(),s),newRelation:gf(t)})})),...i.map((e=>pf({relationUri:e}))),...s.map((e=>df({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},Af=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;return Of({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType}})}),{}),Rf=(e,t)=>(0,l.pipe)(Ei,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(ks),Ca)(e,t),Pf=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)}},Sf=(e,t,r)=>{const n=hp(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)},wf="relation",If=(0,l.always)([wf,"relationUri"]),Uf=(0,l.always)([wf,"relationType"]),Cf=(0,l.always)([wf,"object"]),Df=(0,l.always)([wf,"direction"]),jf=(0,l.always)([wf,"object","attributes"]),Lf=(0,l.always)(["entity","entityUri"]),kf=(0,l.always)([wf,"startDate"]),Ff=(0,l.always)([wf,"endDate"]),xf=(0,l.path)(["startObject","objectURI"]),Mf=(0,l.path)(["endObject","objectURI"]),$f=(0,l.path)(["startObject","objectTypeURI"]),Vf=(0,l.path)(["endObject","objectTypeURI"]),Gf=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(If()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Gf(r.connections,t);if(e)return e}}},Wf=(0,l.pipe)(Gf,(0,l.path)(Cf())),Yf=(0,l.allPass)([(0,l.pipe)((0,l.path)(Lf()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(Uf()),(0,l.complement)(E))]),Bf=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:He()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Kf({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=qf(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?Pf(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},qf=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:_t.IN}:{type:t[0],direction:_t.OUT}:null},Hf=e=>e.uri||e,Kf=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===_t.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"],si(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],si(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Hf,Ei(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(_t.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(_t.OUT)),(0,l.map)(u))},t)||{}};function Qf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jf(e,t,r[t])}))}return e}function Jf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Qf({},t,{[r]:{parents:n,children:i}})},zf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Qf({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},Zf=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=Yy(t,i),o=Xf({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>Zf(n.uri,t,[e],r)),o)},eT=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)(If(),n),a=t?zf({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Lf(),n),s=Be(o)?[o]:[],u=Xf({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>Zf(t,r,[i],e)),u)}),n)},tT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return eT(r,e,t,Zf(e,t))},rT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return tT(t,r,n);if(Qe(e)){const t=Gf(n,e);return t&&eT([t],null,r)}return r[e]?Zf(e,r):void 0},nT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>nT(e,t))))},iT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>iT(e,t))))},aT=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ke(t),u=tT(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(Qe(c)){if(s=Gf(i,c),!s)return null;o.push({type:Zt.relationConnection,value:s,valueType:Ei(a,(0,l.path)(Uf(),s))});continue}if(Qe(u)){const e=n[c];if(!e)return null;o.push({type:Zt.tempEntity,value:e,valueType:si(a,e.type)});continue}const p=n[u],d=Os(p,c),y=n[c];if(!d||!y)return null;o.push({type:Zt.attributeValue,value:d,valueType:Wn(a,it(d.uri,p.type))}),o.push({type:Zt.tempEntity,value:y,valueType:si(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},iT(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Qe(s),d=p?Wf(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):si(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Yn(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:Zt.tempEntity,value:T,valueType:si(a,T.type)}),o.push({type:Zt.attributeValue,value:s,valueType:E}),m=s.value;const l=ss(s);T=l&&Be(l)?n[l]:null}}return o},oT=e=>e.every((e=>{let{type:t}=e;return[Zt.attributeValue,Zt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Zt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,sT=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?sT(t.value):[]];return e.concat(r)}),[])),lT=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,uT=e=>{const t=[...sT((null==e?void 0:e.attributes)||[]),...sT((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},cT=(e,t)=>[e,...t.map((t=>lT(e,t)))],pT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},dT=(e,t)=>{switch(e){case er.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case er.ENTITY_ATTRIBUTE:return(e=>{let{uri:t}=e;return[at(t)]})(t);case er.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case er.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},yT=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),fT=(0,l.curry)(((e,t)=>{const r=Oo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(fT(e,r.extendsTypeURI)):n})),TT=(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))),ET=(e,t)=>(0,l.pipe)((0,l.prop)("type"),fT(e),TT(t))(t);function mT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hT=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}},bT=e=>!e.deactivated,OT=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},vT=e=>OT(e)+e.message,gT=(0,l.unless)(l.isNil,(0,l.prop)("message")),_T=(0,l.unless)(l.isNil,(0,l.prop)("type")),NT=(0,l.curry)(((e,t)=>Ze(t.parentUri,e))),AT=(0,l.curry)(((e,t)=>t.parentUri===e)),RT=(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",bt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.any)(Ze(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),PT=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),ST=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),wT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([FT,bT,NT(e),RT(t),(0,l.complement)(ST(e,t.uri))]))(r)},IT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([FT,bT,AT(e),PT(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",Qt.missed))]))(r);return n&&n.message||""},UT=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===Qt.missed))},CT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([bT,(0,l.propEq)("type",Qt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(If(),e))]))(t)},DT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([bT,(0,l.propEq)("type",Qt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},jT=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([bT,NT(t)]))(r)},LT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([bT,(0,l.propEq)("type",Qt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},kT=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?aT(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 Zt.attributeValue:{const e=a;if(Dn(a))return hp(o,e.dataLabelPattern);if(jn(a)){const t=o,i=ss(t),a=yn(e),s=si(n,a);return Be(i)?hp(r[i],s.dataLabelPattern):t.label}return""}case Zt.tempEntity:return hp(o,a.dataLabelPattern);case Zt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=si(n,null==e?void 0:e.entityType);return`${Op(i&&Be(i)?hp(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){mT(e,t,r[t])}))}return e}({},e,{label:Op(t)})}))},FT=e=>!e.severity||e.severity===Xt.ERROR,xT=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case bt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(xT(n))}));case bt.TYPE_REFERENCE:return!!es(t);case bt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),MT=(e,t)=>e.every((0,l.complement)(xT(t))),$T=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=No(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ds(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Xo(e.parent))))).forEach((e=>{MT(e.attrValues,n)&&r.push(hT({type:Qt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:At().text("Attribute is required"),source:Jt.local}))})),r}),[])},VT=(0,l.curry)(((e,t,r)=>ds(e,t,r,!1))),GT=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),si(e),(0,l.prop)("attributes"),(0,l.reject)(Un),(0,l.filter)(jn),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(VT(e,t)));return(0,l.pipe)(r,(0,l.reject)(ss),(0,l.map)((e=>{let{uri:r}=e;return hT({type:Qt.missedRefEntity,uri:"",attributeTypeUri:it(r,t.type),parentUri:r,message:At().text("Entity is required"),source:Jt.local})})))(t)},WT=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ss,Be)).flatMap((n=>{const i=ss(n),a=t[i],o=Wn(e,it(n.uri,r.type));return YT(e,t,o,a)})),YT=(e,t,r,n)=>{const i=Tn(r),a=i.map((t=>Wn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",bt.TYPE_REFERENCE))).flatMap(mn).concat(i);return BT(e,t,n,(e=>a.some(Ze(e.uri))))},BT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=$T(e,r,n),a=GT(e,r),o=WT(e,t,r);return[...i,...a,...o]},qT=(e,t)=>{const r=(0,l.path)(Cf(),t)||{};return $T(e,r)},HT=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Lf()),(0,l.ifElse)(Be,(e=>t[e]),(0,l.always)(null)))(r),i=qT(e,r),a=(e=>(0,l.path)(Lf(),e)?[]:[hT({type:Qt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(Uf(),e),parentUri:(0,l.path)(If(),e),message:At().text("Entity is required"),source:Jt.local})])(r),o=((e,t,r)=>r?BT(e,t,r):[])(e,t,n);return[...i,...a,...o]},KT=e=>(0,l.path)(["entity","uri"],e)?[]:[hT({type:Qt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:At().text("Entity is required"),source:Jt.local})],QT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=$T(e,r),i=KT(t);return[...n,...i]};function JT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XT=(e,t)=>{var r,n;const i=si(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Qa(e)},zT=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),ZT=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(zT(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},eE=(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)(ls,Be,l.not)]),(e=>{const t=(0,l.pipe)(ls,tt)(e);return ZT((e=>e.replace(t,t+$e)))(e)})),(0,l.when)((0,l.pipe)(ss,Be),(t=>{const r=ss(t),n=e[r],i=n&&rE(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){JT(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),tE=(e,t,r)=>ve(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),ge((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)(eE(r,e.type)),(0,l.map)(ZT(ut))))})(e))),rE=(e,t)=>(0,l.evolve)({attributes:Ds({valueTransformer:(0,l.pipe)(ps,eE(t),zT(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function nE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iE(e,t,r[t])}))}return e}function iE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aE=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Me,"g"),"uri$$$$").replace(new RegExp($e,"g"),""))),oE=e=>(0,l.pipe)((0,l.evolve)({objectUri:aE,objectParentUri:aE}),(e=>{return nE({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?Qt.missed:Qt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&lt(e.objectUri),uri:e.objectUri,source:Jt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),sE=(e,t)=>(0,l.map)((0,l.pipe)(oE,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=kT(t,s),p=null!=c&&c.length?c.slice(0,-1):kT(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Wn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Zt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return nE({},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(jn(i)&&hn(i).includes(o)){const i=ss(n.value),o=i&&Be(i)?t[i]:null;return o?nE({},e,{parentUri:o.uri,path:a.concat({type:Zt.tempEntity,value:o,valueType:si(r,o.type),label:""})}):e}}return e}})(t)))(e),lE=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 uE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cE;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(cE||(cE={}));const pE={},dE={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"]}},yE=(0,l.curry)(((e,t)=>{const r=(e=>{if(!pE[e]){const t=dE[e]||dE.random0;pE[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){uE(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return pE[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]})),fE=e=>yE(cE.Charts,e);var TE=r(51404),EE=r.n(TE);const mE=Array.from({length:100},((e,t)=>t/100)),hE=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)},bE={},OE=new(EE())({hash:hE,saturation:mE.slice(15,71),lightness:mE.slice(50,90)}),vE=(0,l.curry)(((e,t,r)=>{t in bE||(bE[t]={});const n=bE[t];r in n||(n[r]=((e,t)=>{const r=String(hE(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),gE=vE(OE,"crosswalks"),_E=vE(OE,"sources"),NE=vE(OE,"contributors");function AE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){RE(e,t,r[t])}))}return e}function RE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PE=(0,l.has)("items"),SE=e=>0===e,wE=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)},IE=e=>e.reduce(((e,t)=>e+t.width),0),UE=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),CE=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),DE=e=>e.reduce(((e,t)=>e+t.height),0),jE=e=>(0,l.is)(String,e)&&e.includes("%"),LE=e=>Boolean(e.spacer),kE=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),FE=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(PE(t)?FE(t):t)),[]),xE=e=>({id:e.layout}),ME=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xE;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=jE(r.width)?kE(i,r.width):u}return wE(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return wE(n,t,r)},o=(e,t)=>PE(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,PE(s)?n(s.layout):e(s.view)),d=SE(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(PE(s))return o.concat(p(AE({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(AE({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:IE(o),height:UE(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=PE(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=SE(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(PE(i))return r.concat(p(AE({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(AE({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?wE(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?wE(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:CE(i),height:DE(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=SE(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return AE({},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=AE({},e,{width:a}),s=AE({},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(AE({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return AE({},e,{height:DE(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(AE({},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 AE({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=AE({},t,{items:(0,l.reject)(LE,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 FE(f)},$E=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id))));function VE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){GE(e,t,r[t])}))}return e}function GE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WE={BarChart:Tr.BAR,BarChartGrouped:Tr.BAR,BarChartHorizontal:Tr.BAR,LineChart:Tr.LINE,Map:Tr.MAP,Pie:Tr.PIE},YE=(e,t)=>ot(e)?rt(e,t):e,BE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=WE[r];return VE({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},qE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return VE({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"]))},HE=(e,t,r)=>{const n=(e=>e&&re(e).map((e=>{const{type:t,value:r}=e;return VE({},e,{value:[yt,ft,ct.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Et(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},KE=["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"],QE={"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:YE(n,r),filters:HE(a,n,r),chartType:Tr.BAR,component:Er.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:YE(n,r),filters:HE(a,n,r),chartType:Tr.BUBBLE,component:Er.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:Er.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 VE({id:t,count:o,canRead:u,orderType:s,attributeUri:YE(r,p),filters:HE(a,r,p),component:Er.DashboardFacet,title:i,showOthers:!0},BE(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:YE(n,r),filters:HE(a,n,r),chartType:Tr.MAP,component:Er.DashboardFacet,title:i,geoUrl:KE[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 VE({id:t,count:o,canRead:l,attributeUri:YE(n,r),filters:HE(a,n,r),component:Er.DashboardFacet,title:i,geoUrl:s,chartType:Tr.MAP,projection:"geoMercator"},BE(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Er.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:qE(i),component:Er.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:HE(n,null,a),component:Er.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:Er.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:Er.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:Tr.CLOUD,component:Er.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:Tr.TREE,component:Er.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Er.NotificationInboxFacet,title:n||At().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Er.ActivitiesViewFacet,title:n||At().text("Activity log")}}},JE=e=>({id:e,height:10}),XE=(0,l.pipe)((0,l.map)((e=>{const t=QE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),zE=e=>{if("0.1"===e.version){const t=XE(e.views),r=ME(JE,e.layout,{columns:4});return{id:e.id,margin:0,layout:$E(r,t),views:t}}return e},ZE=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=>ZE(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function em(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tm(e,t,r[t])}))}return e}function tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rm=em({},mr,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),nm=e=>e,im={[rm.Attributes]:nm,[rm.HierarchyTree]:nm,[rm.HierarchyPaths]:nm,[rm.RelationsTable]:nm,[rm.Relations]:e=>em({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[rm.SingleAttributeView]:nm,[rm.CustomView]:nm,[rm.TableAttributeView]:nm,[rm.MapView]:nm,[rm.OldTreeView]:e=>em({},e,{class:mr.HierarchyTree}),[rm.OldMapView]:e=>em({},e,{class:mr.MapView}),[rm.ImageAttributeView]:nm,[rm.PotentialMatchesView]:nm},am=(0,l.pipe)((0,l.map)((e=>{const t=im[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),om=(0,l.curry)(((e,t)=>{switch((0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)){case mr.MapView:return{id:t,height:5,minHeight:5};case mr.Relations:return{id:t,autosizing:!0,minWidth:2};default:return{id:t,autosizing:!0}}})),sm=e=>{if("0.1"===e.version){const t=am(e.views),r=ME(om(t),e.layout,{columns:4});return{id:e.id,layout:$E(r,t),views:t,workflow:e.workflow,maxWidth:e.maxWidth}}return e},lm=(e,t)=>e.class===t||e["react-class"]===t,um=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(lm(t,mr.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 lm(t,mr.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)}},cm=(e,t)=>e.filter((e=>t.some((t=>lm(e,t))))).map((e=>{let{id:t}=e;return t})),pm=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))};function dm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ym(e,t,r[t])}))}return e}function ym(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fm=(e,t)=>ZE(t).map((t=>(0,l.pipe)((0,l.map)((e=>pm(e,t))),(0,l.reject)(l.isNil),l.head)(e))),Tm=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},Em=(e,t)=>{if("scroll"===t.layout.layout){const r=fm(e,t.layout),n=zE(dm({},t,{views:r,version:"0.1"}));return{class:br.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:br.Dashboard,views:t.views,layout:t.layout,id:t.id}},mm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},hm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},bm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},Om=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},vm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},gm=(e,t)=>{const r=fm(e,t.layout)[0];return{class:br.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},_m=(e,t)=>{const r=fm(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=((e,t)=>e.flatMap((e=>{let{extensions:t=[]}=e;return t.filter((e=>{let{point:t}=e;return"com.reltio.plugins.search.toolbar.component"===t}))})))(e).filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:br.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"]}},Nm=(e,t)=>({class:br.Graph,id:t.id}),Am=(e,t)=>({class:br.ProfileActivityLog,id:t.id}),Rm=e=>t=>!!(0,l.intersection)(e,t).length,Pm=(0,l.cond)([[Rm(["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"]),()=>Em],[Rm(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>mm],[Rm(["com.reltio.plugins.graph.GraphView"]),()=>Nm],[Rm(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>hm],[Rm(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>bm],[Rm(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>Om],[Rm(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>vm],[Rm(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>gm],[Rm(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>_m],[Rm(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Am],[l.T,()=>(0,l.always)(void 0)]]),Sm=(e,t)=>{if("com.reltio.plugins.entity.ProfileAction"===e.class)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(Tm),(0,l.map)((t=>((e,t)=>{const r=fm(e,t.layout),n=sm(dm({},t,{views:r,version:"0.1"}));return{entityType:t["entity-type"],views:n.views,layout:n.layout}})(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views"])))(e);return{class:br.Profile,id:t.id,entityTypes:r}})(t,e);const r=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(r))return;const n=(0,l.pipe)((0,l.map)((e=>pm(e,r))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(n))return;const i=ZE(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 Pm(a)(t,n)},wm=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))},Im=e=>(0,l.pipe)((0,l.chain)(wm),(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:Sm(e,t)}))))(t))(t,e);return{label:t.label,icon:t.icon,menu:r.length?{type:"side",items:r}:void 0,screen:Sm(t,e)}}));function Um(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cm=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Dm=e=>({id:e,height:10}),jm=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)(Cm),(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=XE(((e,t)=>ZE(t).map((t=>(0,l.pipe)((0,l.map)((e=>pm(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){Um(e,t,r[t])}))}return e}({},e,{id:t})))(e))))(e,t.layout)),n=ME(Dm,t.layout,{columns:4});return{views:r,layout:$E(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Lm=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>pm(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=>pm(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>pm(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>pm(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>pm(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>pm(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e);return{i18n:o,entity:{requestSettings:{defaultMaxValues:t}},image:{attributeFieldsOrder:r},lookups:{autocomplete:n},validate:{levels:i,validateReadMode:a}}},km=e=>({layout:Im(e),pivoting:jm(e),properties:Lm(e)});var Fm=r(58697),xm=r.n(Fm);function Mm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$m(e,t,r[t])}))}return e}function $m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vm=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${xm()()}`;return n[e.id].push(t),i=!0,Mm({},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]++,Mm({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},Gm=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(Gm(e))}))}))),t},Wm=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Hm,t),(0,l.propOr)([],"crosswalks",e))),e),Ym=(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(Ym(e))}))})),r},Bm=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=Bm(e);r>t&&(t=r)}))})),t+1):t},qm=(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},Hm=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Km=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Qm=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Jm=(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)},Xm=(0,l.eqBy)(Hm),zm=(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)(ts,(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)))),Zm=(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=At().number(t));return t})),eh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?At().number(e,"0,0.0a").toUpperCase():At().number(e,"0,0"):""},th=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),rh=(e,t)=>t&&e!==t?`${t} (${e})`:e,nh=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),ih=(e,t,r)=>{const n=nh(e,t,r);return rh(r,n)},ah=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),oh=(0,l.complement)(ah),sh=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),lh=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)},uh=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(oh(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),ch=(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?K(a):"L LTS";switch(n.type){case bt.TYPE_NUMBER:case bt.TYPE_FLOAT:case bt.TYPE_DOUBLE:case bt.TYPE_LONG:case bt.TYPE_INT:case bt.TYPE_COUNT:return t&&Zm(o,t);case bt.TYPE_BOOLEAN:case bt.TYPE_BOOLEAN_RADIO:case bt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:se(t)?At().text("yes"):At().text("no");case bt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=_(Number(t)).getTime()),t&&(tu(t)?ru(t):At().date(t,s));case bt.TYPE_ACTIVENESS_DATE:case bt.TYPE_LOCAL_DATE:return t&&(tu(t)?ru(t):At().date(t,s));case bt.TYPE_TIMESTAMP:return t&&(tu(t)?ru(t):At().date(isNaN(t)?t:Number(t),u));case bt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case bt.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)?rh((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),ph={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},dh=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()}},yh=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})))),fh=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n}=t,i=e.onResponse.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),dh,yh);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}},Th="__metadata",Eh=(e=>{const t=[Th,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),mh=(0,l.set)(Eh),hh=(0,l.view)(Eh),bh=mh(Ot.NEW),Oh=mh(Ot.REMOVED),vh=mh(Ot.EDITED),gh=mh(Ot.IGNORED),_h=(0,l.pipe)(hh,(0,l.equals)(Ot.REMOVED)),Nh=(0,l.pipe)(hh,(0,l.equals)(Ot.NEW)),Ah=(0,l.pipe)(hh,(0,l.equals)(Ot.EDITED)),Rh=(0,l.pipe)(hh,(0,l.complement)(l.isNil)),Ph=(0,l.pipe)(hh,(0,l.equals)(Ot.IGNORED)),Sh=(0,l.omit)([Th]),wh=(e,t)=>e===Th?void 0:t;function Ih(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uh=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=Uh(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Ch=(e,t)=>Uh((0,l.propEq)("nodeId",t),e),Dh=(e,t)=>Uh((0,l.pathEq)(["entity","uri"],t),e),jh=(e,t)=>{const r=Ch(e,t);return r.length>1?r[r.length-2]:null},Lh=(e,t)=>{const r=Ch(e,t);return r.length>0?r[r.length-1]:null},kh=(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=>kh(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Fh=()=>{},xh=(e,t)=>{let{parent:r,nodeProcessing:n=Fh}=t;n(e,r),e.children&&e.children.forEach((t=>xh(t,{parent:e,nodeProcessing:n})))},Mh=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case sr.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case sr.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case sr.editing:{var d,y;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=t.entity)||void 0===d?void 0:d.uri,a=null===(y=r.entity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ih(e,t,r[t])}))}return e}({},e,i===a?{}:{entityUri:i,newEntityUri:a})}}},$h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&xh(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===sr.addingChild||r.editingMode===sr.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Mh({node:r,connection:n,isReversed:i}),s=cf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===sr.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Mh({node:r,isReversed:i,connection:n}),l=s?ff({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):yf({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Vh={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Gh={asc:"asc",desc:"desc"},Wh=Vh.entityLabel,Yh=Gh.asc,Bh=(0,l.always)(0),qh=e=>{let{sortField:t=Wh,sortOrder:r=Yh,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Vh.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return yg.strings.sort(t,a,o)})(n,r);case Vh.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return yg.strings.sort(e,i,a)})(r);default:return Bh}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Hh=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Gh)),l.identity,(0,l.always)(Yh))),Kh=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Vh)),l.identity,(0,l.always)(Wh)));var Qh=r(91104);let Jh;const Xh=(e,t)=>(Jh||(Jh=Qh.createClient({key:t})),new Promise((t=>{Jh.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)}))}))),zh=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Zh=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Xo).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[zh(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(Zh(e.value,t,r))),n})),eb=e=>e&&e.length>0,tb=(e,t)=>[].concat(e&&e.attributes?Zh(e.attributes,t):[]).filter(l.identity),rb=(e,t,r,n,i)=>{if(e&&e.type){const t=(si(r,e.type).geoLocationAttributes||[]).map((t=>{return r=tb(e,t.latitude),n=tb(e,t.longitude),eb(r)&&eb(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(eb(t)&&t[0].value&&eb(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?Xh(n.label,i).catch((()=>null)):Promise.resolve(null)},nb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=si(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return rb(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?Xh(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)))},ib=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=si(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Wn(e,r.latitude,t.type)&&Wn(e,r.longitude,t.type)){const e=tb(t,r.latitude),n=tb(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))},ab=(e,t,r)=>Promise.all([ib(e,t),nb(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 ob(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sb(e,t,r[t])}))}return e}function sb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lb=(e,t)=>t.values.map(uo(e,t.entityTypeUri)),ub=(e,t,r)=>qs(t.fieldName,r)||Wn(e,rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),cb=(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?rh(e,t):e}),r)},pb=(0,l.path)(["attrType","label"]),db=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>ob({},e,{[t]:!0})),{});e[r]=e[r]?ob({},e[r],n):n}return e}),{}),yb=(0,l.pipe)((0,l.prop)("values"),E),fb=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Ft.type.name)),Tb=e=>e.type===hb.NUMERIC_RANGE_FACET,Eb=e=>e.type===hb.DATE_RANGE_FACET,mb=(0,l.either)(Tb,Eb),hb={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},bb=e=>{switch(null==e?void 0:e.name){case Ft.type.name:return hb.ENTITY_TYPE_FACET;case Ft.createdBy.name:case Ft.updatedBy.name:case Ft.sourceSystems.name:case Ft.tags.name:case Ft.roles.name:case Ft.matchRules.name:case Ft.MLRecommendedMatch.name:return hb.WITH_DROPDOWN_CHECKBOXES_FACET;case Ft.createdTime.name:case Ft.updatedTime.name:case Ft.startDate.name:case Ft.endDate.name:return hb.DATE_RANGE_FACET;case Ft.matches.name:case Ft.matchScore.name:return hb.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return hb.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return hb.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return hb.DATE_RANGE_FACET;default:return hb.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Ob=(0,l.pipe)(ub,bb),vb=(0,l.pipe)((0,l.path)(["attrType","type"]),Zn),gb=(0,l.cond)([[Tb,(0,l.always)(ct.IN_RANGE)],[Eb,(0,l.always)(ct.WITHIN)],[(0,l.allPass)([vb,e=>e.values.length>=2]),(0,l.always)(ct.EXISTS)],[l.T,(0,l.always)(ct.EQUALS)]]),_b=(0,l.cond)([[Eb,(0,l.prop)("values")],[Tb,(0,l.prop)("values")],[vb,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 Nb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ab=(0,l.pipe)((0,l.path)(["attrType","type"]),Hn),Rb=(0,l.pipe)((0,l.path)(["attrType","type"]),Jn),Pb=(0,l.pipe)((0,l.prop)("attrType"),Ks),Sb=(0,l.pipe)((0,l.prop)("attrType"),Hs),wb=e=>t=>t.values.map((t=>si(e,t).label)).join(" , "),Ib=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),Ub=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(At().number),Ib)),(0,l.join)(","))(e.values);return`${pb(e)}: ${t}`},Cb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(S),Ib)),(0,l.join)(","))(e.values);return`${pb(e)}: ${t}`},Db=e=>t=>`${pb(t)}: ${lb(e,t).join(", ")}`,jb=e=>t=>{const r=cb(e,t);return`${pb(t)}: ${r.join(", ")}`},Lb=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[Sb,wb(e)],[Rb,Ub],[Ab,Cb],[Pb,Db(e)],[l.T,jb(t)]]),r))),kb=(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){Nb(e,t,r[t])}))}return e}({},t,{attrType:ub(e,t,n)}))),Lb(e,r))(t),Fb=new RegExp(`^${At().text("Search")}`),xb=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...kb(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Fb,"",u)]},Mb=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(mt),$b=e=>(e=>Mb.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]=nu(t);return e.replace(r,i).replace(n,a)}),e))(e),Vb=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),Gb={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Wb=e=>[Gb.geoPolygon,Gb.onMapMove].includes(e),Yb=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Bb=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},qb=(e,t)=>Wb(e)?t.map(Yb):[Bb(t)],Hb=e=>Wb(e)?At().text("Geo Polygon"):At().text("Geo Location"),Kb=e=>{switch(e){case Gb.geoLocation:return"geoLocation";case Gb.geoPolygon:case Gb.onMapMove:return"geoPolygon"}},Qb={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},Jb=e=>At().text(e),Xb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ct.EQUALS]:"=",[ct.NOT_EQUALS]:"≠",[ct.STARTS_WITH]:"*",[ct.MISSING_VALUE]:At().text("missing value"),[ct.HAS_ALL]:At().text("has all"),[ct.IN_RANGE]:At().text("in range"),[ct.FULL_TEXT]:At().text("full text"),[ct.EXISTS]:At().text("exists"),[ct.COUNT_EQUALS]:`${At().text("count")} =`,[ct.COUNT_NOT_EQUALS]:`${At().text("count")} ≠`,[ct.COUNT_LT]:`${At().text("count")} <`,[ct.COUNT_LTE]:`${At().text("count")} <=`,[ct.COUNT_GT]:`${At().text("count")} >`,[ct.COUNT_RANGE]:At().text("count range"),[ct.LT]:"<",[ct.LTE]:"<=",[ct.GT]:">",[ct.GTE]:">=",[ct.IN_FILE]:At().text("in file"),[ct.NOT_IN_FILE]:At().text("not in file"),[ct.CONTAINS]:"~",[pt.LIST_EQUALS]:"=",[pt.NOT_LIST_EQUALS]:"≠",[pt.LIST_EQUALS_CASE_SENSITIVE]:"=",[pt.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||At().text(e.toLowerCase())},zb=e=>({type:Qb.operator,text:e}),Zb=e=>({type:Qb.operator,text:Jb(e)}),eO=e=>({type:Qb.attributeLabel,text:e}),tO=e=>({type:Qb.specialAttributeLabel,text:e}),rO=e=>({type:Qb.attributeFilter,text:Xb(e)}),nO=e=>({type:Qb.attributeValue,text:e}),iO=e=>({type:Qb.entityTypeLabel,text:e}),aO=()=>({type:Qb.space,text:" "}),oO=()=>({type:Qb.bracket,text:"("}),sO=()=>({type:Qb.bracket,text:")"}),lO=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),uO=(0,l.curry)(((e,t)=>t.map(lO(e)))),cO=(0,l.curry)(((e,t,r)=>[e,...r,t])),pO=cO(oO(),sO()),dO=cO(aO(),aO()),yO=(0,l.curry)(((e,t)=>[e,...t])),fO=e=>yO(iO(e)),TO=e=>yO(iO(`${e}: `)),EO=e=>["and","and not"].includes(e),mO=e=>["or","or not"].includes(e),hO=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),mO)),bO=(OO=["and"],e=>e.slice(0,-1).every((e=>OO.includes(e.operator))));var OO;const vO=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=hO(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=EO(s),a=mO(s);!r&&t&&n&&(i.push(oO()),r=!0),i.push(o),r&&a&&(i.push(sO()),r=!1);const l=e?Zb(s):zb(s);i.push(...dO([l]))}else i.push(o),r&&(i.push(sO()),r=!1)}return i}},gO=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),_O=(0,l.pipe)(vO({localizable:!1}),gO),NO=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},AO=e=>{let{data:t,values:r,filter:n}=e;return t&&bu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},RO=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(AO)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),PO=(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)&&Mn(e.data.attrType)})(e)&&[ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:xn((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})))),lh),SO=(e,t)=>(0,l.pipe)(PO,uh(t))(e),wO=(0,l.pathEq)(["data","fieldName"],Ft.type.name),IO=(0,l.path)(["data","entityTypeUri"]),UO=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),CO=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Jo(e)),attributes:(0,l.filter)((0,l.pipe)(IO,(0,l.anyPass)([l.isNil,Jo(e),r=>{const n=(t.entityTypes||[]).filter(Jo(e));return(n.length>1?di(e,n):null)===r&&!!si(e,r)}])))})(t))))),DO=e=>(0,l.pipe)((0,l.prop)("filter"),Ul,(0,l.equals)(e)),jO=(0,l.curry)(((e,t,r,n,i,a)=>{const o=qs(n.fieldName)||n.attrType,s=Zl(o,i),u=ch({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Mn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?rh(a.lookupCode,a.value):ih(r,xn(o),a)],[()=>Ks(s),()=>uo(e,n.entityTypeUri,a)],[()=>Qs(s),()=>Co(e,a)],[()=>tl(s),()=>Lo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Jn(c)||Zn(c)),Ql),nO)()})),LO=(e,t,r,n)=>{const i=jO(e,t,r,n.data,n.filter);return(0,l.cond)([[DO(0),(0,l.always)([])],[(0,l.both)(DO(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[aO(),i(r),{type:Qb.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[aO(),...(0,l.pipe)(l.flatten,(0,l.map)(i),uO({type:Qb.punctuationMark,text:", "}))(t)]}]])(n)},kO=(e,t)=>{const r=!!qs(e.data.fieldName);return(0,l.pipe)(NO,r?tO:eO)(e,t)},FO=(e,t,r,n,i)=>[kO(n,i),aO(),rO(n.filter),...LO(e,t,r,n)],xO=(0,l.addIndex)(l.map),MO=(0,l.propEq)("length",1),$O=(0,l.propSatisfies)((0,l.lt)(1),"length"),VO=(0,l.complement)(l.isEmpty),GO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)((0,l.filter)(AO),(0,l.map)((n=>({operand:FO(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,vO()))(n)},WO=(0,l.pipe)(GO,l.flatten),YO=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Vp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=GO(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(fO),(0,l.pipe)(s(TO),(0,l.unless)((()=>MO(u)||i),pO)))(u)},BO=(e,t,r,n)=>(0,l.pipe)((0,l.filter)(RO),xO(((n,i,a)=>({operand:YO(e,t,r,n,MO(a)),operator:n.operator}))),vO(),l.flatten)(n),qO=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),vO(),l.flatten),HO=e=>{let{searchType:t,values:[r]}=e;return qb(t,r).join(", ")},KO=(e,t,r,n,i,a)=>{const o=(e=>e?[tO(e.isRawFilter?At().text("Raw filter"):At().text("Search")),...dO([rO(ct.EQUALS)]),nO(`"${e.value}"`)]:[])(i),s=(e=>e?[tO(Hb(e.searchType)),aO(),nO(HO(e))]:[])(a),u=(0,l.pipe)(BO,(0,l.when)((e=>$O(e)&&(VO(o)||VO(s))),pO))(e,t,r,n);return qO([o,s,u])},QO=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),JO=(0,l.pipe)(KO,QO),XO=(0,l.has)("attributes"),zO=Array.isArray,ZO=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),ev=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=tv(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)(ZO(a))),pO),(0,l.concat)(dO([zb(o)]))))(s)},tv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return XO(n)?ev(e,t,r,n,i):zO(n)?n.reduce(((n,a)=>n.concat(tv(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(dO([zb(n.operator)])))(FO(e,t,r,n,i))},rv=(e,t,r,n,i)=>(0,l.pipe)(tv,l.flatten)(e,t,r,n,i);function nv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iv(e,t,r[t])}))}return e}function iv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const av=(0,l.complement)(wO),ov=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(wO),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(IO),(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}},sv=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=ov(t);return(r||n)&&bO(t)},lv=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(sv)),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(wO).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}=ov(r);if(sv(e))t.push(nv({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(av)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(wO,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(IO,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(av),entityTypes:n,operator:i?a:e.operator,id:xm()()}}));t.push(...n)}var a;return t})(t))),[]))),uv={[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},cv=(0,l.curry)((e=>uv[e]||e)),pv=(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}})),dv=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Hn),yv=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>nv({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return dv(e)?(0,l.evolve)({filter:cv,values:pv(t)},e):e}))})))})),fv=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),lv,CO(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")))})),yv,(0,l.reject)(UO))(r)));function Tv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ev(e,t,r[t])}))}return e}function Ev(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mv=(e,t)=>({data:{uri:ot(e.fieldName)?rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||gb(e),id:xm()(),values:_b(e)}),hv=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=qs(a,t,r)||Wn(e,i);if(!s)return null;if(wn(s))return Tv({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Vp(e,{type:o}),i=(Gn(e,rt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return Tv({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),bv=(0,l.curry)(((e,t,r,n)=>fv(hv,e,n,t,r)));function Ov(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vv(e,t,r[t])}))}return e}function vv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gv=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},_v=e=>"rdmLookups.not.resolved"===e?Ft.notResolved.name:e,Nv=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Tt?ct.IN_RANGE:Et(a),u=_v(n),c=qs(u)||Wn(e,i),p=(0,l.cond)([[()=>Ll(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>Ov({},e,{filename:th(e)}))))],[()=>Zn(null==c?void 0:c.type),(0,l.map)(se)],[e=>Dl(s)&&!Array.isArray(e[0])&&!Hn(null==c?void 0:c.type),ne],[l.T,l.identity]])(o);return{id:xm()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Tt?"and not":"and",filter:s,values:p}})),Av=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(Nv(e,di(e,i)));return[{id:xm()(),operator:"or",attributes:a,entityTypes:i}]})),Rv=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),Pv=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([Rv("from"),Rv("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,()=>[]]]),Sv=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return Ov({},r,{values:Pv(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Vs(e.fieldName,n):e.fieldName})},wv=(e,t)=>{if((0,l.has)("children")(e)){const r=Sv(e,t);return e.children.reduce(((e,n)=>(e.push(wv(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return Sv(e,t)},Iv=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(Sv(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(Ov({fieldName:e.fieldName},Sv(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(wv,l.flatten)],[l.T,Sv]]),Uv=(0,l.pipe)((0,l.map)(Iv),l.flatten),Cv=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},Dv=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=Av(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:Uv(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>Ov({},t,{type:Ob(e,t)}))).map((e=>Ov({},e,{values:mb(e)?Cv(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 mv(r,t)})),operator:"or",id:xm()(),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=>({[_v(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[Ov({},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 bv(e,t,r,p)},jv=(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)(yb),(0,l.partition)(fb))(t),i=n.map((t=>Tv({},t,{type:Ob(e,t)}))).map((e=>mv(e))),a=r.values||[];return[{attributes:i,operator:"or",id:xm()(),entityTypes:a}]})(e,a);return bv(e,t,r,o)})(e,t,r,n):Dv(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},Lv=e=>"2.0"===e.version?e.keyword:gv(e),kv=e=>(0,l.pathEq)(["object","uri"],e),Fv=(e,t)=>(0,l.pipe)((0,l.find)(kv(e)),(0,l.prop)("object"))(t),xv=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"),kv(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Fv(r.match,t)||n[r.match];return{label:Op((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return lo(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)},Mv=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),$v=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),Vv=(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:Op((0,l.prop)("label",a)),matchRules:i.map((function(t){return lo(e,a.type,t)||{label:t,uri:t}}))}})))(t),Gv=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)},Wv=(0,l.path)(["object","uri"]),Yv=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Bv=e=>e.getValue(),qv=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=qv(n[e],t),!r);e++);return r},Hv=(e,t)=>{const r=[],n=(0,l.pipe)(Bv,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(Hv,[t]),a);return r.push.apply(r,o),r};function Kv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qv(e,t,r[t])}))}return e}function Qv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jv=(e,t)=>!!e[t],Xv=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},zv=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||[]])},Zv=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Kv({},t,{[r.uri]:Kv({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:zv(null==o?void 0:o.parents,n),children:zv(null==o?void 0:o.children,i),values:zv(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},eg=e=>e.children?e.children.flatMap(eg):e,tg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=si(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 Vo(r,n,i).flatMap(eg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Wn(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=Zv({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Zv({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},rg=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=ds(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Xo),(0,l.map)(Xv))(i);return Zv({structure:e,attrType:e[t].attrType,values:a})}),t)},ng=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 Jv(e,r)}));return r||n?t.filter(Xo).reduce(((e,t)=>ng({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Jv(t,e.type)?Zv({structure:t,attrType:t[e.type].attrType,values:[Xv(e)]}):t}},ig=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Kv({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},ag=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ds(i,n,r)||[];return a.length?Zv({structure:t,attrType:t[r].attrType,values:a.filter(Xo).map(Xv)}):t},og=(e,t,r)=>{const n=Ke(e),i=Ke(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Ze(n,r)})(e,t):!(!r||!st(t))&&nT(r,i).includes(n)},sg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},lg=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?tT(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return og(r,t,o)}))},ug=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>ug(e,t,r)))))},cg=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&sg(n,e)}},pg=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ke(n),c=rT(u,o,i,a),p=ug("children",t,l),d=ug("parents",t,l),y=p.flatMap((e=>ug("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return og(t,n,c)})).map((t=>cg(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return og(n,t,c)||Ke(t)!==u&&og(t,n,c)})).map((t=>cg(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=ug("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)&&og(n,t,c)}))})).map((t=>cg(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return og(t,n,c)})).map((e=>cg(r,n,e,s))),...T,...E,...f]},dg={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},yg={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:()=>{}}]);