@reltio/remotes 1.4.994 → 1.4.998

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/1006.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[1006],{28101:(e,t,r)=>{r.d(t,{G:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(39475),s=r(79692),c=r(41128);const u=(0,s.Z)((e=>({container:{display:"flex",flexDirection:"column",flexShrink:0,width:"64px",paddingTop:"8px",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)"},active:{backgroundColor:(0,c.U1)(e.palette.primary.main,.12),"&:after":{content:'""',position:"absolute",height:"42px",width:"3px",backgroundColor:e.palette.primary.main,left:"-8px",borderRadius:"0 6px 6px 0"}},buttonWrapper:{position:"relative",width:"48px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",margin:"2px 8px",color:e.palette.text.secondary,"&$active":{color:e.palette.primary.main}}})));function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}const p=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:l}=e;const s=u();return a().createElement("div",{className:o()(s.container,n)},t.map((e=>{let{id:t}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["id"]);return a().createElement(i.k,d({},n,{size:"S",key:t,className:o()({[s.active]:r===t},s.buttonWrapper),onClick:()=>l(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},11821:(e,t,r)=>{r.d(t,{h:()=>o});var n=r(24328),a=r.n(n);const l=(0,r(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),o=e=>{let{width:t,open:r,children:n}=e;const o=l();return a().createElement("div",{className:o.contentWrapper,style:{width:`${r?t:0}px`}},r&&a().createElement(a().Fragment,null,n))}},98273:(e,t,r)=>{r.d(t,{P:()=>p});var n=r(24328),a=r.n(n),l=r(87685);const o=(0,r(79692).Z)({container:{display:"flex",flexShrink:0,height:"63px",alignItems:"center",borderBottom:"1px solid rgba(0,0,0,0.12)"},icon:{margin:"0 12px"},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"19px 17px"},secondTitle:{fontSize:"14px"}});var i=r(90436),s=r(85256),c=r(87918),u=r.n(c),d=r(39475);const p=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:c,rightContent:p}=e;const m=o();return a().createElement("div",{className:m.container},a().createElement(d.k,{size:"L",icon:l.default,onClick:t,className:m.icon,tooltipTitle:u().text("Close")}),c||a().createElement(a().Fragment,null,a().createElement(i.Z,{variant:"h6"},r),n&&a().createElement(a().Fragment,null,a().createElement(s.Z,{orientation:"vertical",flexItem:!0,className:m.divider}),a().createElement(i.Z,{variant:"body1",color:"textSecondary",className:m.secondTitle},n)),p))}},21210:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(89810),a=r(27502),l=r(24328),o=r.n(l),i=r(52730),s=r(42639);const c=e=>{let{sourceType:t,className:r,classes:l}=e;const c=(0,i.useSelector)(n.ZP.selectors.getMetadata),{label:u,icon:d}=(0,a.PWK)(c,t);return o().createElement(s.Z,{className:r,avatarText:u[0],icon:d?(0,a.vPL)("https://s3.amazonaws.com/reltio.images/api",d):null,variant:"square",rootClasses:l})}},61006:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>$p.S,ActionButton:()=>Fp,ActionButtonMode:()=>Vp,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>l.I,AddWorkflowButton:()=>Dp,ArrowExpandButton:()=>cn.Z,AsyncMountContext:()=>Em.g,AttributeListItem:()=>m.Z,AttributeTitle:()=>Dl.Z,AttributesList:()=>f.Z,AttributesPager:()=>W.ZP,AttributesTable:()=>Cs,AttributesView:()=>h.Z,AutoSizeList:()=>se.Z,AvatarWithFallback:()=>ce.Z,BarChart:()=>Yt.Z,BasicTable:()=>ue.Z,BasicTableContext:()=>pe.X,BasicTablePagination:()=>$e.Z,BasicView:()=>Gt.Z,BasicViewContent:()=>qt.Z,BasicViewHeader:()=>Kt.Z,BlockImageGalleryDialogContext:()=>wm.P,BranchDecorator:()=>g.Z,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>Yp.U,CardinalityMessage:()=>G.Z,ChartsFactory:()=>Jt.Z,ClickAwayProvider:()=>ar,CollaborationContext:()=>Om.h,CollaborationItem:()=>lr.J,CollapseButton:()=>or.Z,CollapseRowButton:()=>yt.Z,ColorBar:()=>ir.Z,ColumnFilterType:()=>he.Dq,ColumnsDataType:()=>he.uz,ColumnsSettings:()=>Be,CommentsContainer:()=>sr.Z,ConfigureColumnsPopup:()=>pr.Z,ConfirmDeleteDialog:()=>Oi,ConfirmationDialog:()=>yi.Z,ConnectionRelationTypeSelector:()=>fr,CrosswalkDragLayer:()=>_s,CrosswalkEditor:()=>tc,CrosswalkType:()=>As,CrosswalksDisplayProvider:()=>Kl,DEFAULT_OVERLAY_OPTIONS:()=>Xp.r,DataTypeValue:()=>br.Z,DataTypeValueEditor:()=>kr.Z,DateEditor:()=>Ir.Z,DateRangeEditor:()=>Cr.Z,DateRangeTypes:()=>cc.K,DefaultCellValueRenderer:()=>Xe.Z,DeltaTypes:()=>o.w,Drawer:()=>yr.Z,DropDownEditor:()=>vr.Z,DropDownMenuButton:()=>Er.Z,DropDownSelector:()=>L.Z,DropdownIndicator:()=>cr.Z,DropdownIndicatorWithIconButton:()=>ur.Z,EMPTY_STATE_ICONS:()=>Rr.B9,EMPTY_STATE_VARIANTS:()=>Rr.tC,EditableAttribute:()=>K.Z,EditableImageAttributesLine:()=>ne.Z,EmptyState:()=>Rr.ZP,EmptyStub:()=>tt.Vd,EntitiesMapContext:()=>Sm.X,EntityAvatar:()=>_r.Z,EntityCreator:()=>b.Z,EntityMarkerContext:()=>Pm.P,EntitySelector:()=>y.Z,EntityTypeBadge:()=>Ar.Z,EntityTypeIcon:()=>_.Z,EntityTypesSelector:()=>Zr.Z,EntityUriLink:()=>jr.Z,ErrorBoundary:()=>Mr.Z,ErrorMessage:()=>oc.Z,ErrorPopup:()=>Lr.Z,ErrorWrapper:()=>Vr.Z,ExpandableSearchInput:()=>Hl,ExpandedAttributesProvider:()=>di,ExpandedValueTooltip:()=>A.C,FacetViewHeader:()=>Fr.Z,FileTypeEditor:()=>Pr.Z,FilterButton:()=>Ye,FilterValueEditor:()=>wr.Z,FlipCard:()=>Gr,HideOnShrink:()=>Yr,HierarchicalAttributeTooltip:()=>$r.Z,Highlighter:()=>je.Z,HistoryActivityType:()=>sc,HistoryChangeTypes:()=>Sc,HistoryDiffContext:()=>vm.m,HistoryHeader:()=>vu,HistoryPanelEmptyState:()=>Ou,HistoryView:()=>Gc,IdContext:()=>km,ImageAttributesLine:()=>Y.Z,ImageGalleryDialog:()=>Xr.C,ImportButton:()=>Qr.Z,ImportModes:()=>Qr.E,InlineAttributesPager:()=>li,InlineImageAttribute:()=>Jo,InlineNestedAttribute:()=>fi,InlineReferenceAttribute:()=>Go,LightArrowTooltip:()=>lo,LinearLoadIndicator:()=>Jr.Z,Link:()=>tn,LoadingSpinner:()=>rn,MAP_DRAWING_MODES:()=>Xp.vl,MAP_MINIMUM_SCALE_RADIUS:()=>Xp.Pi,Marginator:()=>bi.Z,MatchRulesBlock:()=>Nn,MenuWithPopper:()=>dr.Z,MergeButton:()=>Hp,ModeSwitcher:()=>Dn.Z,ModeSwitcherSelect:()=>Mn,MoreAttributesButton:()=>E.Z,MultiSelect:()=>Xn.Z,MultiValueChip:()=>Or.Z,MultipleInput:()=>Ln.Z,NestedAttribute:()=>ae.Z,NestedAttributeEditor:()=>v.Z,NoData:()=>Nr.J,NoResults:()=>Dr.X,NotMatchButton:()=>Kp,NumberEditor:()=>Tr.Z,OvIcon:()=>Tu.Z,PieChart:()=>$t.Z,PivotingAttributeContext:()=>Cm.J,Popper:()=>Vn.Z,PopupBoundariesContext:()=>xm.p,PopupWithArrow:()=>Fn.Z,PotentialMatchReviewCard:()=>Gn,ProfileBand:()=>qn.Z,ProfileBandHistory:()=>wu,ProfileBandNavigation:()=>Wt,ProfileCard:()=>Kn.Z,ProfileMatchCard:()=>hp,ProfilePerspectiveViewContext:()=>Im,QueryBuilderAttributeDataType:()=>he.eB,QueryBuilderAttributeType:()=>he.Xw,QueryBuilderRow:()=>Yn.Z,QueryBuilderRowsGroup:()=>$n.Z,ReactSelectOptionFilters:()=>Qn.Z,ReactSortableTree:()=>al,ReactSortableTreeHandlers:()=>qa,ReactSortableTreeUtils:()=>ka,ReadOnlyAttribute:()=>q.Z,ReadOnlyAttributeValuesBlock:()=>te,ReadOnlyAttributesList:()=>re.Z,ReadOnlyAttributesPager:()=>ie.Z,ReferenceAttribute:()=>le.Z,ReferenceAttributeEditor:()=>x.Z,RelatedObjectUrisContext:()=>Nm.A,RelationEditor:()=>Nu,RelationTypeSelector:()=>H,ReltioGridLayout:()=>ll.Z,ReltioMap:()=>lc.Z,ResizablePanes:()=>ol.Z,RowCellAutoSizer:()=>bt,Score:()=>il.Z,ScoreLabel:()=>sl.Z,ScrollableTabs:()=>Wl.Z,SearchInput:()=>cl.Z,SelectionPopup:()=>Re.Z,SelectionPopupPopper:()=>fl,SelectorWithOnlyOptionAutoSelect:()=>El,SideButtonsPanel:()=>vl.G,SidePanel:()=>Cl.h,SidePanelContentHeader:()=>Il.P,SidePanelEmptyState:()=>Tl,SimpleAttribute:()=>oe.Z,SimpleAttributeEditor:()=>z.Z,SimpleDropDownSelector:()=>kl.Z,SimpleMatchRulesBlock:()=>yn,SimpleMatchRulesBuilder:()=>xn,SmallIconButton:()=>Sl.Z,SmallIconButtonWithTooltip:()=>De.k,SortingType:()=>he.nI,SourceCrosswalksRow:()=>Js,SourceIcon:()=>Pl.Z,Spacer:()=>Nl.Z,TableContext:()=>pe.X,TableWithBars:()=>Xt.Z,TextEditor:()=>xr.Z,TimestampEditor:()=>Sr.Z,TransitiveMatchBlock:()=>Pn,TreeChart:()=>Qt.Z,UsersContext:()=>Tm.s,VerticalDivider:()=>_l,VerticalHeadingsTable:()=>Ml,ViewIdContext:()=>jt.m,ViewMoreToggle:()=>Ll.Z,VirtualGroupedList:()=>_e.Z,WhiteSearchInput:()=>ul.Z,WorkflowComments:()=>td,WorkflowTaskCard:()=>Op,WorkflowTasksContext:()=>Ru,basicTableViewState:()=>pt,buildColumnsFilter:()=>et.Tz,columnFilterToMdmFilter:()=>et.su,createStandardAction:()=>tt.zD,defaultGetRowCellHeight:()=>Qe.Z,defaultRenderRowCell:()=>Je.Z,getChecked:()=>tt.IR,getValue:()=>tt.NA,groupCrosswalksByTypesAndSources:()=>ac,isIE:()=>tt.w1,mergeClasses:()=>tt.ze,noop:()=>tt.ZT,parseJSON:()=>tt.Rx,stopPropagation:()=>tt.UW,toggleSortOrder:()=>tt.Dh,useActions:()=>tm,useActivitiesLoader:()=>i.d,useAsyncMount:()=>rm.S,useAttributeExpanded:()=>pi,useBasicTableCellRenderer:()=>It,useClickableStyle:()=>tr.d,useCollaboration:()=>im,useConfigPermissions:()=>ym.l,useCrosswalkActions:()=>Ns,useCrosswalkColor:()=>Yl,useCrosswalkFocus:()=>Ql,useCrosswalkHighlight:()=>Xl,useDidUpdateEffect:()=>gt.D,useDynamicRowCellHeight:()=>xt,useHighlightedCrosswalks:()=>$l,useHistory:()=>yc,useHistoryDiff:()=>wc,useHistorySlice:()=>ic,useKeyboardNavigation:()=>Ae.t,useMarkAsNotMatchRequest:()=>Gp,useMatchesLoader:()=>pp,useMergeAllRequest:()=>Bp,useModifiedEntity:()=>Ps,usePagingSimulator:()=>dp,usePrevious:()=>sm.D,useProfileActivitiesLoader:()=>p,useRelationTypeSelector:()=>mr,useRelationsLoader:()=>pm,useRunOnceAfterValueInitialization:()=>mm,useSafePromise:()=>Mt._,useSavedState:()=>hm.a,useUsers:()=>gm,useWhyDidYouUpdate:()=>bm,useWorkflowAssignee:()=>Lu,useWorkflowCheckPermission:()=>Au,useWorkflowComments:()=>Ju,useWorkflowTasks:()=>_p,withAsyncMount:()=>Qp.Z,withContext:()=>Jp.l,withFilterAtBottom:()=>me.Z,withPercents:()=>er.Z,withTableContext:()=>de.Z,withTooltip:()=>St.Z});var n=r(56082),a=r(40023),l=r(20414),o=r(33992),i=r(7278),s=r(24328),c=r.n(s),u=r(27502),d=r(54202);const p=e=>{let{filter:t,max:r,offset:n,entityUri:a}=e;return(0,s.useCallback)((async()=>{const e=(0,d.U)(t),l=await(0,u.k6v)({filter:e,max:r,offset:n,entityUri:a}),{total:o}=await(0,u.FEC)({filter:e,entityUri:a});return{data:l,total:o}}),[t,r,n,a])};var m=r(33117),h=r(15177),g=r(52239),f=r(76141),b=r(54255),y=r(72283),E=r(89913),v=r(3853),x=r(10768),w=r(13980),O=r.n(w),T=r(87918),C=r.n(T),I=r(17440),k=r(71153),S=r.n(k),P=r(12231),N=r(90436),D=r(79692);const R=(0,D.Z)({container:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},text:{display:"flex",width:"calc(100% - 68px)"},textItem:{fontSize:"13px",lineHeight:"15px",marginRight:10},primaryTextItem:{flex:"1 0",flexBasis:0,maxWidth:"50%",overflow:"hidden",textOverflow:"ellipsis"},secondaryTextItem:{flex:"1 0",flexBasis:0,overflow:"hidden",textOverflow:"ellipsis"},icons:{transform:"scale(0.5)",position:"relative",flexShrink:0,width:"68px",bottom:"10px"},iconTop:{position:"absolute",top:0,left:0,zIndex:1},iconBottom:{position:"absolute",top:0,left:26,zIndex:0}});var _=r(42662),A=r(83088);function Z(){return Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z.apply(this,arguments)}const j=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=R(),{value:o,label:i,startObject:s,endObject:u}=a,d=s.objectType.label+" ↔ "+u.objectType.label;return c().createElement(P.Z,Z({className:l.container,ref:t,key:o,onClick:()=>n({label:i,value:o,startObject:s,endObject:u})},r),c().createElement("div",{className:l.icons},c().createElement(_.Z,{className:l.iconTop,entityType:s.objectType}),c().createElement(_.Z,{className:l.iconBottom,entityType:u.objectType})),c().createElement("div",{className:l.text},c().createElement(A.C,{value:i},c().createElement(N.Z,{className:S()(l.textItem,l.primaryTextItem)},i)),c().createElement(A.C,{value:d},c().createElement(N.Z,{color:"textSecondary",className:S()(l.textItem,l.secondaryTextItem)},d))))};j.propTypes={innerRef:O().oneOfType([O().oneOf([null]),O().func,O().shape({current:O().any.isRequired})]),innerProps:O().object.isRequired,selectOption:O().func.isRequired,data:O().shape({value:O().string.isRequired,label:O().string.isRequired,startObject:O().object,endObject:O().object})};const M=j;var L=r(84425);function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V.apply(this,arguments)}function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const B=e=>{let{value:t={},options:r=[],onChange:n=I.identity,TextFieldProps:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","options","onChange","TextFieldProps"]);const o=(0,s.useMemo)((()=>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){F(e,t,r[t])}))}return e}({},(0,I.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return c().createElement(L.Z,V({value:t,options:r,onChange:n,label:C().text("Select relationship type "),components:{Option:M},TextFieldProps:o},l))},U=O().shape({label:O().string.isRequired,value:O().string.isRequired,startObject:O().object,endObject:O().object});B.propTypes={value:U,options:O().arrayOf(U),onChange:O().func};const H=B;var z=r(39390),W=r(92203),G=r(63928),q=r(11013),K=r(30410),Y=r(61347);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){X(e,t,r[t])}))}return e}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q(){return Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Q.apply(this,arguments)}function J(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const ee=e=>{let{values:t,valueContainerClassName:r}=e,n=J(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(q.Z,Q({attributeValue:e},n))))))},te=(0,s.memo)((e=>{let{expanded:t}=e,r=J(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:l}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return ee($({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:l},c().createElement(Y.Z,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return ee($({},r))}}));var re=r(89978),ne=r(66078),ae=r(88610),le=r(95492),oe=r(81489),ie=r(47972),se=r(44938),ce=r(42639),ue=r(45108),de=r(30488),pe=r(38748),me=r(25843),he=r(53862);function ge(){return ge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ge.apply(this,arguments)}const fe=e=>c().createElement("svg",ge({width:20,height:18,viewBox:"0 0 20 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M16 7.24V6h-4v1.24a8.417 8.417 0 00-2 .768V6H6v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H2c-1.1 0-2-.9-2-2V2C0 .9.9 0 2 0h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM4 12V6H2v6h2zm0-8V2H2v2h2zm6 0V2H6v2h4zm6 0V2h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0014 9zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero",stroke:"none",strokeWidth:1,opacity:.54}));function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ye(e,t,r[t])}))}return e}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ee=e=>e.id===e.groupId,ve=(0,I.curry)(((e,t)=>{let{id:r,groupId:n}=e;return t.groupId===n&&(r===t.id||r.startsWith(`${t.id}.`))})),xe=(0,I.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),we=(0,I.propOr)(!0,"hideable"),Oe=(e,t)=>{const r=((e,t)=>e.find((0,I.either)(xe(t),ve(t))))(e,t);return r?(r.children=Oe(r.children||[],t),e):e.concat(t)},Te=(0,I.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(Te(e)))),Ce=(0,I.reduce)(((e,t)=>Oe(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),Ie=(0,I.curry)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,I.pipe)((0,I.filter)(Te(e)),(0,I.chain)((t=>[{item:be({},t,{filterText:e}),level:r},...t.children?Ie(e,t.children,r+1):[]])))(t)})),ke=(0,I.has)("columns"),Se=e=>{let{id:t,label:r,columns:n}=e;return[{id:t,groupId:t,label:r},...n.map((0,I.assoc)("groupId",t))]},Pe=e=>e.children?(0,I.chain)(Pe,e.children):[e],Ne=(e,t)=>{const r=Pe(t),n=t=>e.includes(t.id);return Ee(t)?r.every(n):r.some(n)};var De=r(39475),Re=r(38442),_e=r(63485),Ae=r(44876),Ze=r(41008),je=r(94792);const Me=(0,D.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Le=e=>{let{item:t,onClick:r,checked:n,level:a,style:l,isFocused:o,isGroupItem:i}=e;const s=Me();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(je.Z,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:l,isFocused:o,hideIcon:i,className:S()({[s.groupItem]:i})})};Le.propTypes={item:O().shape({label:O().string,filterText:O().string}),level:O().number,onClick:O().func,checked:O().bool,style:O().object,isGroupItem:O().bool,isFocused:O().bool};const Ve=Le,Fe=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:l}=e;const o=Me(),[i,d]=(0,s.useState)(null),[p,m]=(0,s.useState)(""),h=(0,s.useMemo)((()=>((e,t)=>(0,I.pipe)((0,I.chain)((0,I.when)(ke,Se)),(0,I.filter)((0,I.either)(Ee,we)),Ce,Ie(t))(e))(t,p)),[t,p]),g=(0,u.fW1)("label")(h)||308,f=(0,s.useMemo)((()=>(0,Ze.LG)(h)),[h]),b=(0,s.useCallback)((e=>{const t=(0,I.pipe)(Pe,(0,I.pluck)("id"))(e),a=Ne(r,e);n(a?(0,I.difference)(r,t):(0,I.uniq)((0,I.concat)(r,t)))}),[r,n]),y=(0,s.useCallback)((e=>{let{item:t}=e;return b(t)}),[b]),{focusIndex:E,handleKeyDown:v}=(0,Ae.t)({items:f,open,onSelectFocusedItem:y,selectedItems:r}),x=Math.min(300,32*f.length),w=Math.max(140,x+108);return c().createElement(c().Fragment,null,c().createElement(De.k,{tooltipTitle:l||C().text("Show/hide columns"),size:"L",icon:fe,onClick:e=>d(e.currentTarget)}),c().createElement(Re.Z,{className:o.popup,open:!!i,anchorEl:i,onClose:(0,I.pipe)((()=>d(null)),(()=>m(""))),onSearch:m,title:a||C().text("Show/hide columns"),containerWidth:g,containerHeight:w,searchInputOnKeyDown:v},c().createElement(_e.Z,{fixedTitle:!1,height:x,renderItem:(e,t,n)=>{let{item:a,level:l=0}=t;return c().createElement(Ve,{style:e,item:a,level:l,isFocused:E===n,checked:Ne(r,a),isGroupItem:Ee(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:g,focusIndex:E})))};Fe.propTypes={columnsData:he.uz,selectedColumns:O().arrayOf(O().string),onChangeColumns:O().func,title:O().string,tooltipTitle:O().string};const Be=Fe;var Ue=r(61837),He=r(87685),ze=r(80030);function We(){return We=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(this,arguments)}const Ge=e=>c().createElement("svg",We({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M18 2V0H0v2l7 8v8l4-2v-6z",fill:"currentColor",fillRule:"nonzero",stroke:"none",strokeWidth:1})),qe=(0,D.Z)((e=>({"filterIcon--enabled":{color:e.palette.primary.main},closeIcon:{position:"absolute",right:"3px",bottom:"3px",transform:"scale(0.5)"},button:{padding:"11px"}}))),Ke=e=>{let{enabled:t,onClick:r}=e;const n=qe();return c().createElement(ze.ZP,{title:t?C().text("Clear all filters"):C().text("Filter")},c().createElement(Ue.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(Ge,{className:n["filterIcon--enabled"]}),c().createElement(He.default,{color:"primary",className:n.closeIcon})):c().createElement(Ge,null)))};Ke.propTypes={enabled:O().bool,onClick:O().func};const Ye=Ke;var $e=r(42011),Xe=r(46728),Qe=r(85103),Je=r(1928),et=r(9377),tt=r(79573);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){nt(e,t,r[t])}))}return e}function nt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const at="CHANGE_COLUMNS",lt="TOGGLE_FILTERS",ot="CHANGE_FILTER",it="TOGGLE_SORT",st="CHANGE_PAGE",ct="CHANGE_ROWS_PER_PAGE",ut={changeColumns:(0,tt.zD)(at),toggleFilters:(0,tt.zD)(lt),changeFilter:(0,tt.zD)(ot),toggleSort:(0,tt.zD)(it),changePage:(0,tt.zD)(st),changeRowsPerPage:(0,tt.zD)(ct)},dt=(e,t)=>{const r=(0,I.difference)(e.visibleColumns,t),n=e=>r.includes(e);return(0,I.evolve)({visibleColumns:(0,I.always)(t),sorting:(0,I.when)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(e.field)}),(()=>{const[e]=t;return{field:e,order:"asc"}})),filters:e=>(0,I.keys)(e).reduce(((e,t)=>n(t)?(0,I.dissoc)(t,e):e),e)},e)},pt={reducer:(e,t)=>{switch(t.type){case at:{const r=t.payload;return dt(e,r)}case lt:{const t=!e.filters;return rt({},e,{filters:t?{}:null,page:t?e.page:0})}case ot:{const{columnId:r,filter:n}=t.payload;return(0,I.evolve)({filters:n?(0,I.assoc)(r,n):(0,I.dissoc)(r),page:(0,I.always)(0)},e)}case it:{const r=t.payload,n=(0,I.path)(["sorting","field"],e),a=(0,I.path)(["sorting","order"],e);return rt({},e,{sorting:{field:r,order:(0,tt.Dh)(r===n?a:null)},page:0})}case st:return rt({},e,{page:t.payload});case ct:return rt({},e,{rowsPerPage:t.payload});default:return e}},actions:ut,changeVisibleColumns:dt};var mt=r(44443),ht=r(76625),gt=r(55962);const ft=e=>{let{onChangeHeight:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChangeHeight","children"]);const a=(0,s.useRef)(null),{rowValue:l,rowIndex:o,columnData:i,cellIndex:u}=n,d=t({rowIndex:o,cellIndex:u,columnData:i}),p=()=>a.current&&d(a.current.clientHeight);return(0,gt.D)(p,[l.rawValue]),c().createElement("div",null,c().createElement(mt.Z,{handleHeight:!0,onResize:p}),c().createElement(ht.Z,{rootRef:a},r))};ft.propTypes={onChangeHeight:O().func,children:O().node};const bt=ft;var yt=r(91431);function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vt=e=>{let{rowIndex:t,columnData:{id:r},cellIndex:n}=e;return`${r}[${t}][${n}]`},xt=()=>{const[e,t]=(0,s.useState)({}),r=(0,s.useRef)({}),n=(0,s.useCallback)((0,u.DsO)((()=>{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){Et(e,t,r[t])}))}return e}({},r.current))})),[]),a=(0,s.useCallback)((()=>{r.current={}}),[]);return{getDynamicRowCellHeight:(0,s.useCallback)((0,I.pipe)(vt,(0,I.prop)(I.__,e)),[e]),changeRowCellHeight:(0,s.useCallback)((0,I.curry)((0,I.useWith)((0,I.pipe)(((e,t)=>{r.current[e]=t}),n),[vt,I.identity])),[]),clearHeightsCache:a}};var wt=r(21697),Ot=r(8233),Tt=r(3073);function Ct(){return Ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ct.apply(this,arguments)}const It=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=Je.Z,getRowCellHeight:a=Qe.Z,defaultRowHeight:l=48,maxRowValuesCount:o=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,Ot.Z)({rowsData:t,columnsData:r,renderRowCell:n,getRowCellHeight:a,maxRowValuesCount:o});return(0,s.useMemo)((()=>{const e=i.reduce(((e,t,r)=>{const{data:n}=t;return e[r]=(0,wt.calculateRowHeight)(n,l),e}),{}),t=(t,r,n)=>{const a=[t,"subRowHeight",r,n,"height"];return(0,I.pathOr)(0,a,e)},n=t=>(0,I.pathOr)(0,[t,"height"],e),a=e=>{let{columnId:a,rowIndex:l}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["columnId","rowIndex"]);return c().createElement(Tt.x.Provider,{value:u},c().createElement("div",Ct({},o,{style:{height:n(l)}}),i.length>0&&(0,wt.getCellContentFromRowsData)({columnIndex:r.findIndex((0,I.propEq)("id",a)),headData:r,rowsData:i,rowIndex:l,getHeightForSubRow:t})))};return a.propTypes={columnId:O().string,rowIndex:O().number},{getRowHeight:n,CellRenderer:a}}),[i,l,u,r])};var kt=r(86689),St=r(78223),Pt=r(67766),Nt=r(42767);const Dt=(0,D.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),Rt=(0,St.Z)(kt.Z),_t=e=>{let{total:t=0,onPrev:r,onNext:n,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:o}=e;const i=Dt();return c().createElement("div",{className:i.container},c().createElement(Rt,{className:i.link,component:"button",variant:"caption",onClick:a,underline:"none",tooltipTitle:C().text("Go to search results")},(0,u.k7L)(t,1e6)," ",1===t?C().text("Search result"):C().text("Search results")),c().createElement(De.k,{size:"L",icon:Pt.Z,tooltipTitle:C().text("Go to previous profile"),onClick:r,disabled:l,showForDisabled:!0}),c().createElement(De.k,{size:"L",icon:Nt.Z,tooltipTitle:C().text("Go to next profile"),onClick:n,disabled:o,showForDisabled:!0}))};var At=r(52730),Zt=r(89810),jt=r(12212),Mt=r(29627);function Lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vt(e,t,r[t])}))}return e}function Vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ft{constructor(e){var t=this;let{data:{query:r,sortField:n,sortOrder:a},tenant:l,searchTenant:o,apiPath:i,dtssPath:s,globalSearchRequestOptions:c}=e;this.query=void 0,this.sortField=void 0,this.sortOrder=void 0,this.tenant=void 0,this.searchTenant=void 0,this.apiPath=void 0,this.dtssPath=void 0,this.globalSearchRequestOptions=void 0,this.isDT=()=>this.tenant!==this.searchTenant,this.getQueryFilter=()=>({rawFilter:this.query}),this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[t.getQueryFilter(),...e],a=Lt({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},r);return t.isDT()?(0,u.uqV)({filters:n,options:a,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,u.ZOr)(n,a)},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"uri",values:[e]}],{offset:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{offset:t,max:e}),this.requestTotal=()=>{const e=[this.getQueryFilter()],t=this.globalSearchRequestOptions;return(this.isDT()?(0,u.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,u.j_Q)(e,t)).then((e=>e.total))},this.query=r,this.sortField=n,this.sortOrder=a,this.tenant=l,this.searchTenant=o,this.apiPath=i,this.dtssPath=s,this.globalSearchRequestOptions=c}}function Bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ut(e,t,r[t])}))}return e}function Ut(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ht{constructor(e){var t=this;let{data:r,tenant:n,apiPath:a}=e;this.searchBody=void 0,this.tenant=void 0,this.apiPath=void 0,this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[{rawFilter:t.searchBody.filter},...e];return(0,u.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:Bt({},t.searchBody,{filter:e.length?(0,u.Uqd)()(n):t.searchBody.filter}),options:r})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,u.BTI)({uri:e})]}],{from:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{from:t,max:e}),this.requestTotal=()=>(0,u.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=r,this.tenant=n,this.apiPath=a}}const zt=(e,t)=>(0,I.pipe)((0,I.map)((0,I.prop)("uri")),(0,I.reject)((e=>t.includes(e))))(e),Wt=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,Mt._)(),t=(0,Mt._)(),r=(0,Mt._)(),{uri:n,index:a,total:l,tenant:o,cache:i}=(0,At.useSelector)(Zt.ZP.selectors.getSearchNavigationData)||{},{type:c,data:d}=(0,At.useSelector)(Zt.ZP.selectors.getSearchProviderData)||{},p=(0,At.useSelector)(Zt.ZP.selectors.getTenant),m=(0,At.useSelector)(Zt.ZP.selectors.getApiPath),h=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),g=(0,At.useSelector)((e=>Zt.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),f=(0,s.useContext)(jt.m),b=(0,At.useDispatch)(),[y,E]=(0,s.useState)(!1),v=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new Ft(t);case"graphsearch":return new Ht(t)}})(c,{data:d,tenant:p,searchTenant:o,apiPath:m,dtssPath:h,globalSearchRequestOptions:g})),[c,d,p,o,m,h,g]),x=(0,s.useCallback)((e=>{b(Zt.yC.actions.updateSearchNavigationDataFields(e))}),[b]),w=(0,s.useCallback)((e=>{const t=p!==o?(0,u.wwR)({uri:e,dataTenant:o}):e;b(Zt.ui.actions.openEntity({uri:t,viewId:f,source:"navigation"}))}),[b,f,p,o]),O=(0,s.useCallback)((()=>{b(Zt.ui.actions.openPerspective({perspectiveId:c,viewId:f}))}),[b,c,f]);(0,s.useEffect)((()=>{a>=l?x({index:l-1}):a<0&&x({index:0})}),[l,a,x]);const T=(0,s.useCallback)(((e,n,a)=>{E(!0),t(v.requestTotal()).then((e=>x({total:e})));const l=a+1;return r(v.requestEntities(15,l)).then((t=>{if(t){if(t.length){const r=zt(t,e);if(r.length>0)return x({cache:e.concat(r),uri:r[0],index:l+t.length-r.length}),void w(r[0]);if(a+t.length<n-1)return T(e,n-t.length,a+t.length)}x({index:l})}})).finally((()=>{E(!1)}))}),[v,x,w]),C=(0,s.useCallback)(((e,n)=>{E(!0),t(v.requestTotal()).then((e=>x({total:e})));const a=n-1,l=Math.max(0,n-15),o=15+Math.min(0,n-15);return r(v.requestEntities(o,l)).then((t=>{if(t){if(t.length){const r=zt(t,e);if(r.length>0)return x({cache:r.concat(e),uri:r[r.length-1],index:a-(t.length-r.length)}),void w(r[r.length-1]);if(n-t.length>0)return C(e,n-t.length)}x({index:0})}})).finally((()=>{E(!1)}))}),[v,x,w]),I=(0,s.useCallback)(((t,r,n,a)=>{if(r<t.length){const l=t[r];return E(!0),e(v.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),I(e,r,n-1,a)}x({index:a+1,uri:l,cache:t,total:n}),w(l)})).finally((()=>{E(!1)}))}if(!(a>=n-1))return T(t,n,a);x({cache:t,total:n,index:n-1})}),[v,x,w,T]),k=(0,s.useCallback)(((t,r,n,a)=>{if(r>-1){const l=t[r];return E(!0),e(v.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),k(e,r-1,n-1,a-1)}x({index:a-1,uri:l,cache:t,total:n}),w(l)})).finally((()=>{E(!1)}))}if(!(a<=0))return C(t,a);x({index:0,cache:t,total:n})}),[v,x,w,C]),S=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)-1;k(i,e,l,a)}}),[k,i,n,l,a]),P=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)+1;I(i,e,l,a)}}),[I,i,n,l,a]);return{total:l,onPrev:S,onNext:P,onSearchResultsClick:O,isPrevDisabled:y||a<=0,isNextDisabled:y||a>=l-1}})();return(()=>{const{cache:e}=(0,At.useSelector)(Zt.ZP.selectors.getSearchNavigationData)||{},t=(0,At.useSelector)(Zt.ZP.selectors.getMode),r=(0,At.useSelector)(Zt.ZP.selectors.getEntity);return(0,u.uzs)(t)&&(null==e?void 0:e.includes(null==r?void 0:r.uri))})()?c().createElement(_t,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}):null};var Gt=r(1730),qt=r(82068),Kt=r(17998),Yt=r(72668),$t=r(38037),Xt=r(62321),Qt=r(56215),Jt=r(12960),er=r(39878),tr=r(59383),rr=r(1292);function nr(){return nr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nr.apply(this,arguments)}const ar=e=>c().createElement(rr.Z,nr({mouseEvent:"onMouseDown"},e));var lr=r(89925),or=r(28831),ir=r(89902),sr=r(72316),cr=r(78501),ur=r(59952),dr=r(51556),pr=r(80560);const mr=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,s.useCallback)(((e,r)=>{const n={},a=(0,I.pipe)(u.PjQ,(0,I.tap)((e=>n[e]=(0,I.propOr)(0,e,n)+1))),l=(0,I.ascend)((0,I.prop)("label")),o=(0,I.curry)(((e,r)=>{let{uri:n,label:l,startObject:o,endObject:i}=r;const s=e===(t?u.Nsj.OUT:u.Nsj.IN)?o:i;return{label:{directionalLabel:a(s),typeLabel:l},value:`${n},${e}`,startObject:o,endObject:i}}));return e.map(o(u.Nsj.IN)).concat(r.map(o(u.Nsj.OUT))).map((0,I.evolve)({label:e=>{let{directionalLabel:t,typeLabel:r}=e;return t?n[t]>1?`${t} (${r})`:t:r}})).sort(l)}),[t]),fromEditorValue:(0,s.useCallback)(((e,t)=>r=>{const[n,a]=r.value.split(",");return{type:(a===u.Nsj.IN?e:t).find((0,I.propEq)("uri",n)),direction:a}}),[]),toEditorValue:(0,s.useCallback)(((e,t)=>t.find((0,I.propEq)("value",`${e.relationType},${e.direction}`))),[])}};function hr(){return hr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hr.apply(this,arguments)}const gr=e=>{let{relation:t={},inRelationTypes:r=[],outRelationTypes:n=[],onChange:a=I.identity,applyFirstByDefault:l=!1,reversedContextLabels:o=!1}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:u,fromEditorValue:d,toEditorValue:p}=mr({reversedContextLabels:o}),m=(0,s.useMemo)((()=>u(r,n)),[u,r,n]),h=(0,s.useCallback)((0,I.pipe)(d(r,n),a),[d,r,n,a]);return(0,s.useEffect)((()=>{l&&m.length&&h(m[0])}),[m,l,h]),c().createElement(H,hr({value:p(t,m),options:m,onChange:h},i))};gr.propTypes={className:O().string,relation:u.bNA,inRelationTypes:O().arrayOf(u.IYE),outRelationTypes:O().arrayOf(u.IYE),applyFirstByDefault:O().bool,reversedContextLabels:O().bool,onChange:O().func};const fr=gr;var br=r(67586),yr=r(87086),Er=r(98538),vr=r(1128),xr=r(43371),wr=r(15299),Or=r(92145),Tr=r(19855),Cr=r(72466),Ir=r(39600),kr=r(65314),Sr=r(91785),Pr=r(51594),Nr=r(19304),Dr=r(6216),Rr=r(79002),_r=r(37573),Ar=r(20146),Zr=r(76773),jr=r(18527),Mr=r(7882),Lr=r(97333),Vr=r(93555),Fr=r(52194);const Br=e=>`rotateY(${e?180:0}deg)`,Ur=e=>`rotateX(${e?180:0}deg)`,Hr=e=>`rotateY(${e?0:-180}deg)`,zr=e=>`rotateX(${e?0:-180}deg)`,Wr=(0,D.Z)({back:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"relative":"absolute",top:"0",transform:"horizontal"===r?Hr(t):zr(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",display:"flex"}},container:e=>{let{cardZIndex:t}=e;return{perspective:"1000px",zIndex:t}},flipper:{height:"100%",position:"relative",width:"100%"},front:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"absolute":"relative",top:"0",transform:"horizontal"===r?Br(t):Ur(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),Gr=(0,s.forwardRef)(((e,t)=>{let{cardZIndex:r="auto",direction:n="vertical",isCardFlipped:a=!1,children:l,className:o}=e;const[i,u]=(0,s.useState)(a),d=Wr({cardZIndex:r,direction:n,isFlipped:i});return(0,s.useEffect)((()=>{a!==i&&u(a)}),[a,i]),c().createElement("div",{className:S()(d.flipper,o),ref:t},c().createElement("div",{"data-id":"front",className:d.front},l[0]),c().createElement("div",{"data-id":"back",className:d.back},l[1]))})),qr=()=>c().createElement("div",{style:{display:"none"}}),Kr=e=>{let{widthToHide:t,children:r}=e;return c().createElement(mt.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(qr,null)}})};Kr.propTypes={children:O().node,widthToHide:O().number.isRequired};const Yr=Kr;var $r=r(44363),Xr=r(95596),Qr=r(76283),Jr=r(87378);const en=(0,D.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),tn=e=>{let{to:t,children:r,onClick:n}=e;const a=en();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},rn=e=>{let{className:t}=e;return c().createElement("img",{className:t,alt:"loading",src:(0,u.Uw1)("R0lGODlhFQALAKIAAP///8Hf75vL5Van0wB4v////wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAFACwAAAIAFQAHAAADLFi6zPSQFEGpGhgXkrEUQShc1bB1wxcGYzGUZ6eKJGVy8lS1aJxJjaAiAkkAACH5BAkKAAUALAAAAwAUAAUAAAMiWLFbJRC6QakCODjBxIzDlW3dB4UBBmhPWQygwrCR9FZDAgAh+QQJCgAFACwIAAMADAAFAAADFBiqVfIvgBmaWHeC6rCklrdw0JMAACH5BAkKAAUALAAAAgAUAAcAAAMkSLpU/vCRQWmLLmg967hYAIxBV4GRSJoWlo1A6X1usXGMUkcJACH5BAkKAAUALAAAAgAOAAcAAAMdWLpF/qSMORudcYg97M2b0BHXAHIelV0pxizQkwAAOw==")})},nn=e=>{let{isMlMatch:t=!1}=e;return c().createElement(c().Fragment,null,t?C().text("Match IQ"):C().text("Match rules"))},an=(0,D.Z)({title:{fontWeight:500,marginBottom:"9px"},body:{fontWeight:"normal",marginLeft:"16px"},container:{padding:"8px",fontSize:"12px",lineHeight:"14px"}}),ln=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=an();return c().createElement("div",{className:n.container},c().createElement("div",{className:n.title},c().createElement(nn,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},on=(0,D.Z)((e=>({container:{fontSize:"13px",lineHeight:"15px"},title:{color:e.palette.text.secondary,marginBottom:"7px"},labelsContainer:{color:e.palette.text.primary,marginBottom:"8px"}}))),sn=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=on();return c().createElement("div",{className:S()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(nn,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))};var cn=r(85777);const un=(0,D.Z)((e=>({label:{backgroundColor:"rgba(43,152,240,0.12)",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,display:"flex",alignItems:"center",padding:"4px 8px"},container:{display:"flex",alignItems:"center",cursor:"pointer",marginBottom:"8px"}})));function dn(){return dn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dn.apply(this,arguments)}const pn=(0,s.forwardRef)(((e,t)=>{let{children:r,expanded:n,onExpand:a,className:l}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","expanded","onExpand","className"]);const i=un();return c().createElement("div",dn({onClick:a,ref:t,className:S()(i.container,l)},o),c().createElement(cn.Z,{expanded:n}),c().createElement("div",{className:i.label},r))}));pn.displayName="MatchRuleBadge";const mn=pn,hn=(0,D.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function gn(){return gn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gn.apply(this,arguments)}const fn=e=>c().createElement("svg",gn({width:192,height:192,viewBox:"0 0 192 192",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("linearGradient",{x1:"94.582%",y1:"6.451%",x2:"23.195%",y2:"83.323%",id:"MLMatch_svg__b"},c().createElement("stop",{stopColor:"#CDE1FF",offset:"0%"}),c().createElement("stop",{stopColor:"#AFFBF4",offset:"100%"})),c().createElement("linearGradient",{x1:"94.582%",y1:"6.594%",x2:"23.195%",y2:"83.214%",id:"MLMatch_svg__d"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FDFFFF",offset:"100%"})),c().createElement("linearGradient",{x1:"93.837%",y1:"55.274%",x2:"29.292%",y2:"-20.431%",id:"MLMatch_svg__g"},c().createElement("stop",{stopColor:"#FFFCC7",stopOpacity:0,offset:"0%"}),c().createElement("stop",{stopColor:"#FFF470",offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"98.152%",id:"MLMatch_svg__i"},c().createElement("stop",{stopColor:"#83D6FF",offset:"0%"}),c().createElement("stop",{stopColor:"#72B9EF",offset:"100%"})),c().createElement("path",{d:"M1.821 66.003L34.263 9.94C36.633 5.813 45.673.594 51.398.072l64.445-.064c5.06-.241 14.821 5.084 17.888 10.395l31.467 54.503c3.186 5.518 2.765 16.592-.13 22.117l-30.948 53.481c-3.776 5.127-14.165 11.126-19.57 11.328l-62.134.061c-5.51-.264-15.934-5.764-18.758-10.655L1.856 86.155C-.846 81.475-.37 70.648 1.82 66.003z",id:"MLMatch_svg__a"}),c().createElement("path",{d:"M11.109 67.042l28.713-49.618C41.92 13.77 49.931 9.158 55.006 8.7l57.143.005c4.486-.209 13.147 4.516 15.871 9.223l27.954 48.298c2.83 4.89 2.467 14.696-.095 19.586l-27.391 47.334c-3.343 4.537-12.55 9.84-17.342 10.013l-55.094-.004c-4.886-.24-14.134-5.12-16.643-9.454L11.16 84.889c-2.4-4.147-1.989-13.735-.05-17.847z",id:"MLMatch_svg__c"}),c().createElement("path",{d:"M.995 0c26.4.684 47.59 22.234 47.59 48.72 0 26.23-23.795 34.53-23.795 56.987 0 3.703-3.011 6.705-6.725 6.705l-17.07-.001V68.985c6.466-1.238 11.353-6.923 11.353-13.75S7.46 42.722.995 41.485V0z",id:"MLMatch_svg__e"}),c().createElement("path",{d:"M47.353 0l-.087 41.235-.225.003c-7.588.167-13.688 6.37-13.688 13.997 0 7.683 6.19 13.92 13.854 14l-.091 43.265H27.887c-1.894-.56-3.197-1.234-3.91-2.025-.712-.79-1.357-2.275-1.933-4.455l-2.335-10.733c-.354-1.265-.674-2.183-.96-2.753-.286-.57-.784-1.281-1.494-2.134L2.002 70.367c-.846-.949-1.383-1.73-1.61-2.343-.228-.613-.356-1.626-.386-3.038V31.34c-.028-.785.044-1.37.216-1.757.173-.387.566-.848 1.18-1.382L28.368.885c.37-.367.665-.601.885-.704.22-.103.557-.163 1.01-.181h17.09z",id:"MLMatch_svg__h"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("g",{transform:"translate(12 6)"},c().createElement("use",{fill:"url(#MLMatch_svg__b)",xlinkHref:"#MLMatch_svg__a"}),c().createElement("use",{fill:"url(#MLMatch_svg__d)",opacity:.5,xlinkHref:"#MLMatch_svg__c"})),c().createElement("g",{transform:"translate(69.652 30.765)"},c().createElement("rect",{fill:"#363636",x:15.457,y:132.745,width:21.151,height:23.158,rx:10.576}),c().createElement("path",{d:"M48.146 118.763v18.93c0 7.198-5.944 13.035-13.277 13.035h-16.71c-7.333 0-13.278-5.837-13.278-13.036v-18.929a13 13 0 01.023-.763h43.22a13 13 0 01.022.763z",fill:"#717171"}),c().createElement("path",{d:"M41.348 137.2c0 7.199-4.947 13.035-11.048 13.035H16.395c-6.101 0-11.047-5.836-11.047-13.035v-18.965h36V137.2z",fill:"#828282"}),c().createElement("path",{d:"M47.51 138.235a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956z",fill:"#B1B1B1"}),c().createElement("path",{d:"M24.999 138.234v8h-16v-8h16zm0-11v8h-16v-8h16zm0-11v8h-16v-8h16z",fill:"#C5C5C5"}),c().createElement("g",{transform:"translate(27)"},c().createElement("mask",{id:"MLMatch_svg__f",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__e"})),c().createElement("use",{fill:"#FFD44B",xlinkHref:"#MLMatch_svg__e"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFD347",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFDE72",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M11.965 48.645c.17-7.171 7.488-10.693 13.863-6.802 7.245 4.422 4.05 16.311-4.742 16.548l-.268.004h-3.227l-4.608 56.092-5.995-.253 4.413-51.248.185-4.592-10.592.001v-6h10.83l.139-3.585.002-.165zm10.737-1.681c-2.54-1.55-4.64-.58-4.737 1.766l-.005.284-.131 3.38 2.99.001c2.852 0 3.999-3.945 2.011-5.347l-.128-.084z",fill:"#F3BE13",mask:"url(#MLMatch_svg__f)"}),c().createElement("ellipse",{fill:"url(#MLMatch_svg__g)",mask:"url(#MLMatch_svg__f)",cx:-1.89,cy:48.245,rx:36.534,ry:36.667}))),c().createElement("g",{transform:"translate(45.647 30.765)"},c().createElement("mask",{id:"MLMatch_svg__j",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__h"})),c().createElement("use",{fill:"url(#MLMatch_svg__i)",xlinkHref:"#MLMatch_svg__h"}),c().createElement("path",{fill:"#D6FCFA",fillRule:"nonzero",opacity:.5,mask:"url(#MLMatch_svg__j)",d:"M38.24 11.235v6l-3.55-.001-22.207 22.207h-18.13v-6H9.997l22.207-22.206zM25.682 40.779l13.8 13.799H50v6H36.997L21.439 45.021zM53.311 28.235v6h-13.65l-3.935 4.246-4.4-4.08 5.718-6.166zM14.248 52.235l20.52 20.52h3.695v6h-6.18l-20.52-20.52H-.647v-6zM21.353 84.235h8.95L40.4 94.332h16.753v6H37.915L27.817 90.235z"})),c().createElement("circle",{fill:"#008FD8",cx:94,cy:86,r:9}))),bn=(0,St.Z)(mn),yn=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=hn(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement(bn,{tooltipTitle:c().createElement(ln,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(fn,{className:n.icon}),C().text("Match IQ")):C().text("Rules")),a?c().createElement(sn,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function En(){return En=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},En.apply(this,arguments)}const vn=e=>{let{matchRules:t,Component:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["matchRules","Component"]);const[a,l]=(0,u.UkJ)(t);return c().createElement(c().Fragment,null,(0,I.isEmpty)(l)?null:c().createElement(r,En({matchRules:l},n)),(0,I.isEmpty)(a)?null:c().createElement(r,En({isMlMatch:!0,matchRules:a},n)))};vn.propTypes={matchRules:u.p3$,Component:O().func};const xn=vn,wn=(0,D.Z)((e=>({label:{fontSize:"13px",lineHeight:"15px",color:e.palette.primary.light},container:{display:"flex",flexDirection:"column"},badge:{display:"flex",marginBottom:"8px",cursor:"pointer"},matchLabels:{marginLeft:"30px"}}))),On=e=>{let{label:t,matchRules:r}=e;const n=wn(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement("div",{onClick:o,className:n.badge},c().createElement(cn.Z,{expanded:a}),c().createElement("div",{className:n.label},t)),a?c().createElement(xn,{Component:sn,matchRules:r,className:n.matchLabels}):null)},Tn=(0,D.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),Cn=(0,D.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),In=e=>{let{transitiveMatchRules:t}=e;const r=Cn();return c().createElement(c().Fragment,null,t.map(((e,t)=>{let{label:n,matchRules:a}=e;return c().createElement("div",{key:t,className:r.ruleWrapper},c().createElement("div",{className:r.label},n),c().createElement(ln,{matchRules:a}))})))};function kn(){return kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kn.apply(this,arguments)}const Sn=(0,St.Z)(mn),Pn=e=>{let{transitiveMatchRules:t}=e;const r=Tn(),[n,a]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(Sn,{tooltipTitle:c().createElement(In,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:n},C().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(On,kn({key:t},e)))):null)},Nn=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(Pn,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement(xn,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:yn})};var Dn=r(4270),Rn=r(73698),_n=r(95544);const An=(0,D.Z)((e=>({root:{maxWidth:156,paddingTop:"9px",paddingBottom:"9px"},outlined:{paddingRight:32,paddingLeft:12},arrowIcon:{fontSize:"18px",top:"calc(50% - 9px)",right:"12px",color:e.palette.text.secondary},currentValue:{display:"flex",alignItems:"center"},currentValueIcon:{fontSize:"18px",marginRight:"8px",color:e.palette.text.secondary},currentValueText:{fontSize:"14px",lineHeight:"16px",textTransform:"uppercase",fontWeight:500,color:e.palette.text.primary,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},menuItem:{padding:"9px 12px 7px"},firstMenuItemButton:{borderTop:"1px solid #e4e4e4"},menuItemInner:{display:"flex",alignItems:"flex-start"},menuItemIcon:{fontSize:"18px",color:e.palette.text.secondary,marginRight:"9px"},menuItemLabel:{fontSize:"14px",lineHeight:"16px",fontWeight:500,color:e.palette.text.primary},menuItemDescription:{fontSize:"10px",lineHeight:"16px",color:e.palette.text.secondary}})));function Zn(){return Zn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zn.apply(this,arguments)}const jn=e=>"onClick"in e,Mn=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:l=!1}=e;const o=An();return c().createElement(Rn.Z,{classes:{root:o.root,icon:o.arrowIcon,outlined:o.outlined},value:n,onChange:e=>{const{value:r}=e.target;t.some((0,I.propEq)("value",r))&&a(r)},variant:"outlined",renderValue:e=>{const{icon:r,label:n=e}=t.find((0,I.propEq)("value",e))||{};return c().createElement(_n.Z,{className:o.currentValue},r&&c().createElement(r,{className:o.currentValueIcon}),c().createElement(ze.ZP,{title:n},c().createElement(N.Z,{className:o.currentValueText},n)))},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},getContentAnchorEl:null},disabled:l,"data-reltio-id":"reltio-profile-select-mode"},(e=>{const t=e.findIndex(jn);return e.map(((e,r)=>{const{value:n,description:a,icon:l}=e,i={value:n,className:o.menuItem};return jn(e)&&(i.onClick=()=>e.onClick(n),i.className=S()(i.className,{[o.firstMenuItemButton]:r===t})),c().createElement(P.Z,Zn({key:n},i,{"data-reltio-id":`reltio-profile-select-mode-${n}`}),c().createElement(_n.Z,{className:o.menuItemInner},c().createElement(l,{className:o.menuItemIcon}),c().createElement(_n.Z,null,c().createElement(N.Z,{className:o.menuItemLabel},n),c().createElement(N.Z,{className:o.menuItemDescription},a))))}))})([...t,...r]))};var Ln=r(16482),Vn=r(7421),Fn=r(80233),Bn=r(73272);function Un(){return Un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Un.apply(this,arguments)}const Hn=e=>c().createElement("svg",Un({viewBox:"0 0 20 20"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 10L14 5.5V9h-3.5L5 3.5 3.5 5l6.04 6H14v3.5l4.5-4.5zM7.04 11.455L3.5 15 5 16.5l3.54-3.545-1.5-1.5z"})),zn=(0,D.Z)((e=>({expanded:{backgroundColor:"rgba(0, 0, 0, 0.03)"},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word"},icon:{width:"32px",height:"32px",fill:"#fff",backgroundColor:"rgba(177, 92, 189, 1)",borderRadius:"50%",margin:"5px 12px 0 8px"},infoBlock:{display:"flex",flexDirection:"row"},header:{display:"flex",flexDirection:"row",paddingBottom:"5px"},flex:{flex:1},caption:{fontSize:"16px",color:"rgba(0, 0, 0, 0.87)"},title:{display:"flex",flexDirection:"row",alignItems:"center",margin:"6px 0 8px 0"},flag:{height:"12px",width:"12px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},pmReviewCard:{borderTop:"3px solid #E83D40",flexDirection:"column",width:"100%"},date:{fontSize:"13px",color:"rgba(0, 0, 0, 0.87)"},mainInfo:{display:"flex",flexDirection:"column",flex:1}}))),Wn=e=>{let{date:t,type:r,createdBy:n,step:a,children:l,Actions:o}=e;const i=zn(),[u,d]=(0,s.useState)(!1);return c().createElement("div",{className:i.pmReviewCard},c().createElement("div",{className:S()(i.header,{[i.expanded]:u})},c().createElement(Hn,{className:i.icon}),c().createElement("div",{className:i.mainInfo},c().createElement("div",{className:i.title},c().createElement("div",{className:S()(i.caption,i.flex)},C().text("Match review")),c().createElement(Bn.Z,{className:i.flag}),c().createElement("span",{className:i.date},C().date(t,"L")),c().createElement(or.Z,{isOpen:u,onClick:()=>{d(!u)}})),c().createElement("div",{className:i.infoBlock},c().createElement("div",{className:i.flex},c().createElement("div",{className:i.info},r),c().createElement("div",{className:i.info},C().text("Created by ${createdBy}",{createdBy:n})),c().createElement("div",{className:i.info},C().text("Step: ${step}",{step:a}))),o))),u?l:null)};Wn.propTypes={date:O().number,createdBy:O().string,type:O().string,step:O().string,children:O().oneOfType([O().node,O().arrayOf(O().node)]),Actions:O().node};const Gn=Wn;var qn=r(33109),Kn=r(91026),Yn=r(88357),$n=r(51586),Xn=r(15793),Qn=r(2633),Jn=r(81521),ea=r(8978),ta=r(13896),ra=r(58651),na=r(46847),aa=r(15459);function la(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const oa=(0,D.Z)((()=>({"@global .rst__node":{minWidth:"100%",whiteSpace:"nowrap",position:"relative",textAlign:"left"},"@global .rst__node.rst__rtl":{textAlign:"right"},"@global .rst__nodeContent":{position:"absolute",top:0,bottom:0},"@global .rst__lineBlock, .rst__absoluteLineBlock":{height:"100%",position:"relative",display:"inline-block"},"@global .rst__absoluteLineBlock":{position:"absolute",top:0},"@global .rst__lineHalfHorizontalRight::before, .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{position:"absolute",content:"",backgroundColor:"black"},"@global .rst__lineHalfHorizontalRight::before":{height:"1px",top:"50%",right:0,width:"50%"},"@global .rst__rtl.rst__lineHalfHorizontalRight::before":{left:0,right:"initial"},"@global .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{width:"1px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__lineFullVertical::after, .rst__rtl.rst__lineHalfVerticalTop::after, .rst__rtl.rst__lineHalfVerticalBottom::after":{right:"50%",left:"initial"},"@global .rst__lineHalfVerticalTop::after":{height:"50%"},"@global .rst__lineHalfVerticalBottom::after":{top:"auto",bottom:0,height:"50%"},"@global .rst__highlightLineVertical":{zIndex:3},"@global .rst__highlightLineVertical::before":{position:"absolute",content:"",backgroundColor:"#36c2f6",width:"8px",marginLeft:"-4px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__highlightLineVertical::before":{marginLeft:"initial",marginRight:"-4px",left:"initial",right:"50%"},"@keyframes arrow-pulse":{"0%":{transform:"translate(0, 0)",opacity:0},"30%":{transform:"translate(0, 300%)",opacity:1},"70%":{transform:"translate(0, 700%)",opacity:1},"100%":{transform:"translate(0, 1000%)",opacity:0}},"@global .rst__highlightLineVertical::after":{content:"",position:"absolute",height:0,marginLeft:"-4px",left:"50%",top:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid white",animation:"arrow-pulse 1s infinite linear both"},"@global .rst__rtl.rst__highlightLineVertical::after":{marginLeft:"initial",marginRight:"-4px",right:"50%",left:"initial"},"@global .rst__highlightTopLeftCorner::before":{zIndex:3,content:"",position:"absolute",borderTop:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(50% + 4px)",top:"50%",marginTop:"-4px",right:0,width:"calc(50% + 4px)"},"@global .rst__rtl.rst__highlightTopLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:0,right:"initial"},"@global .rst__highlightBottomLeftCorner":{zIndex:3},"@global .rst__highlightBottomLeftCorner::before":{content:"",position:"absolute",borderBottom:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(100% + 4px)",top:0,right:"12px",width:"calc(50% - 8px)"},"@global .rst__rtl.rst__highlightBottomLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:"12px",right:"initial"},"@global .rst__highlightBottomLeftCorner::after":{content:"",position:"absolute",height:0,right:0,top:"100%",marginTop:"-12px",borderTop:"12px solid transparent",borderBottom:"12px solid transparent",borderLeft:"12px solid #36c2f6"},"@global .rst__rtl.rst__highlightBottomLeftCorner::after":{left:0,right:"initial",borderRight:"12px solid #36c2f6",borderLeft:"none"}})));function ia(){return ia=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ia.apply(this,arguments)}const sa=e=>{let{children:t,listIndex:r,swapFrom:n,swapLength:a,swapDepth:l,scaffoldBlockPxWidth:o,lowerSiblingCounts:i,connectDropTarget:u,isOver:d,draggedNode:p,canDrop:m,treeIndex:h,treeId:g,getPrevRow:f,node:b,path:y,rowDirection:E}=e,v=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection"]);oa();const x="rtl"===E?"rst__rtl":null,w=i.length,O=[];let T;return i.forEach(((e,t)=>{let i="";if(e>0?i=0===r?"rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom":t===w-1?"rst__lineHalfHorizontalRight rst__lineFullVertical":"rst__lineFullVertical":0===r?i="rst__lineHalfHorizontalRight":t===w-1&&(i="rst__lineHalfVerticalTop rst__lineHalfHorizontalRight"),O.push(c().createElement("div",{key:`pre_${1+t}`,style:{width:o},className:la("rst__lineBlock",i,x)})),h!==r&&t===l){let e,l="";l=r===n+a-1?"rst__highlightBottomLeftCorner":h===n?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===E?{width:o,right:o*t}:{width:o,left:o*t},O.push(c().createElement("div",{key:t,style:e,className:la("rst__absoluteLineBlock",l,x)}))}})),T="rtl"===E?{right:o*w}:{left:o*w},u(c().createElement("div",ia({},v,{className:la("rst__node",x)}),O,c().createElement("div",{className:"rst__nodeContent",style:T},s.Children.map(t,(e=>(0,s.cloneElement)(e,{isOver:d,canDrop:m,draggedNode:p}))))))};sa.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},sa.propTypes={treeIndex:O().number.isRequired,treeId:O().string.isRequired,swapFrom:O().number,swapDepth:O().number,swapLength:O().number,scaffoldBlockPxWidth:O().number.isRequired,lowerSiblingCounts:O().arrayOf(O().number).isRequired,listIndex:O().number.isRequired,children:O().node.isRequired,connectDropTarget:O().func.isRequired,isOver:O().bool.isRequired,canDrop:O().bool,draggedNode:O().shape({}),getPrevRow:O().func.isRequired,node:O().shape({}).isRequired,path:O().arrayOf(O().oneOfType([O().string,O().number])).isRequired,rowDirection:O().string};const ca=sa;function ua(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){da(e,t,r[t])}))}return e}function da(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pa(e){let{targetIndex:t,node:r,currentIndex:n,getNodeKey:a,path:l=[],lowerSiblingCounts:o=[],ignoreCollapsed:i=!0,isPseudoRoot:s=!1}=e;const c=s?[]:[...l,a({node:r,treeIndex:n})];if(n===t)return{node:r,lowerSiblingCounts:o,path:c};if(!r.children||i&&!0!==r.expanded)return{nextIndex:n+1};let u=n+1;const d=r.children.length;for(let e=0;e<d;e+=1){const n=pa({ignoreCollapsed:i,getNodeKey:a,targetIndex:t,node:r.children[e],currentIndex:u,lowerSiblingCounts:[...o,d-e-1],path:c});if(n.node)return n;u=n.nextIndex}return{nextIndex:u}}function ma(e){let{node:t,ignoreCollapsed:r=!0}=e;return pa({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}function ha(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:l,parentNode:o=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=a?[]:[...s,r({node:l,treeIndex:i})];if(!a&&!1===t(a?null:{node:l,parentNode:o,path:u,lowerSiblingCounts:c,treeIndex:i}))return!1;if(!l.children||!0!==l.expanded&&n&&!a)return i;let d=i;const p=l.children.length;if("function"!=typeof l.children)for(let e=0;e<p;e+=1)if(d=ha({callback:t,getNodeKey:r,ignoreCollapsed:n,node:l.children[e],parentNode:a?null:l,currentIndex:d+1,lowerSiblingCounts:[...c,p-e-1],path:u}),!1===d)return!1;return d}function ga(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:l,parentNode:o=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=ua({},l),d=a?[]:[...s,r({node:u,treeIndex:i})],p={node:u,parentNode:o,path:d,lowerSiblingCounts:c,treeIndex:i};if(!u.children||!0!==u.expanded&&n&&!a)return{treeIndex:i,node:t(p)};let m=i;const h=u.children.length;return"function"!=typeof u.children&&(u.children=u.children.map(((e,l)=>{const o=ga({callback:t,getNodeKey:r,ignoreCollapsed:n,node:e,parentNode:a?null:u,currentIndex:m+1,lowerSiblingCounts:[...c,h-l-1],path:d});return m=o.treeIndex,o.node}))),{node:t(p),treeIndex:m}}function fa(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||ha({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function ba(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:ga({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function ya(e){let{treeData:t,expanded:r=!0}=e;return ba({treeData:t,callback:e=>{let{node:t}=e;return ua({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function Ea(e){let{treeData:t,path:r,newNode:n,getNodeKey:a,ignoreCollapsed:l=!0}=e;const o="RESULT_MISS",i=e=>{let{isPseudoRoot:t=!1,node:s,currentTreeIndex:c,pathIndex:u}=e;if(!t&&a({node:s,treeIndex:c})!==r[u])return o;if(u>=r.length-1)return"function"==typeof n?n({node:s,treeIndex:c}):n;if(!s.children)throw new Error("Path referenced children of node with no children.");let d=c+1;for(let e=0;e<s.children.length;e+=1){const t=i({node:s.children[e],currentTreeIndex:d,pathIndex:u+1});if(t!==o)return ua({},s,t?{children:[...s.children.slice(0,e),t,...s.children.slice(e+1)]}:{children:[...s.children.slice(0,e),...s.children.slice(e+1)]});d+=1+ma({node:s.children[e],ignoreCollapsed:l})}return o},s=i({node:{children:t},currentTreeIndex:-1,pathIndex:-1,isPseudoRoot:!0});if(s===o)throw new Error("No node found at the given path.");return s.children}function va(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null,o=null;return{treeData:Ea({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return l=t,o=r,null}}),node:l,treeIndex:o}}function xa(e){let{targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isPseudoRoot:o=!1,isLastChild:i,node:s,currentIndex:c,currentDepth:u,getNodeKey:d,path:p=[]}=e;const m=e=>o?[]:[...p,d({node:e,treeIndex:c})];if(c>=r-1||i&&(!s.children||!s.children.length)){if("function"==typeof s.children)throw new Error("Cannot add to children defined by a function");{const e=ua({},s,l?{expanded:!0}:{},{children:s.children?[n,...s.children]:[n]});return{node:e,nextIndex:c+2,insertedTreeIndex:c+1,parentPath:m(e),parentNode:o?null:e}}}if(u>=t-1){if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!o)return{node:s,nextIndex:c+1};let e=c+1,t=null,l=null;for(let n=0;n<s.children.length;n+=1){if(e>=r){t=e,l=n;break}e+=1+ma({node:s.children[n],ignoreCollapsed:a})}if(null===l){if(e<r&&!i)return{node:s,nextIndex:e};t=e,l=s.children.length}const u=ua({},s,{children:[...s.children.slice(0,l),n,...s.children.slice(l)]});return{node:u,nextIndex:e,insertedTreeIndex:t,parentPath:m(u),parentNode:o?null:u}}if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!o)return{node:s,nextIndex:c+1};let h=null,g=null,f=null,b=c+1,y=s.children;"function"!=typeof y&&(y=y.map(((e,o)=>{if(null!==h)return e;const s=xa({targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isLastChild:i&&o===y.length-1,node:e,currentIndex:b,currentDepth:u+1,getNodeKey:d,path:[]});return"insertedTreeIndex"in s&&({insertedTreeIndex:h,parentNode:f,parentPath:g}=s),b=s.nextIndex,s.node})));const E=ua({},s,{children:y}),v={node:E,nextIndex:b};return null!==h&&(v.insertedTreeIndex=h,v.parentPath=[...m(E),...g],v.parentNode=f),v}function wa(e){let{treeData:t,depth:r,minimumTreeIndex:n,newNode:a,getNodeKey:l=(()=>{}),ignoreCollapsed:o=!0,expandParent:i=!1}=e;if(!t&&0===r)return{treeData:[a],treeIndex:0,path:[l({node:a,treeIndex:0})],parentNode:null};const s=xa({targetDepth:r,minimumTreeIndex:n,newNode:a,ignoreCollapsed:o,expandParent:i,getNodeKey:l,isPseudoRoot:!0,isLastChild:!0,node:{children:t},currentIndex:-1,currentDepth:-1});if(!("insertedTreeIndex"in s))throw new Error("No suitable position found to insert.");const c=s.insertedTreeIndex;return{treeData:s.node.children,treeIndex:c,path:[...s.parentPath,l({node:a,treeIndex:c})],parentNode:s.parentNode}}function Oa(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return fa({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function Ta(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||Ta(e,t)))}function Ca(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.children?"function"==typeof e.children?t+1:e.children.reduce(((e,r)=>Math.max(e,Ca(r,t+1))),t):t}function Ia(e){let{getNodeKey:t,treeData:r,searchQuery:n,searchMethod:a,searchFocusOffset:l,expandAllMatchPaths:o=!1,expandFocusMatchPaths:i=!0}=e,s=0;const c=e=>{let{isPseudoRoot:r=!1,node:u,currentIndex:d,path:p=[]}=e,m=[],h=!1,g=!1;const f=r?[]:[...p,t({node:u,treeIndex:d})],b=r?null:{path:f,treeIndex:d},y=u.children&&"function"!=typeof u.children&&u.children.length>0;!r&&a(ua({},b,{node:u,searchQuery:n}))&&(s===l&&(g=!0),s+=1,h=!0);let E=d;const v=ua({},u);return y&&(v.children=v.children.map((e=>{const t=c({node:e,currentIndex:E+1,path:f});return t.node.expanded?E=t.treeIndex:E+=1,(t.matches.length>0||t.hasFocusMatch)&&(m=[...m,...t.matches],t.hasFocusMatch&&(g=!0),(o&&t.matches.length>0||(o||i)&&t.hasFocusMatch)&&(v.expanded=!0)),t.node}))),r||v.expanded||(m=m.map((e=>ua({},e,{treeIndex:null})))),h&&(m=[ua({},b,{node:v}),...m]),{node:m.length>0?v:u,matches:m,hasFocusMatch:g,treeIndex:E}},u=c({node:{children:r},isPseudoRoot:!0,currentIndex:-1});return{matches:u.matches,treeData:u.node.children}}const ka={find:Ia,getDepth:Ca,isDescendant:Ta,getTreeFromFlatData:function(e){let{flatData:t,getKey:r=(e=>e.id),getParentKey:n=(e=>e.parentId),rootKey:a="0"}=e;if(!t)return[];const l={};if(t.forEach((e=>{const t=n(e);t in l?l[t].push(e):l[t]=[e]})),!(a in l))return[];const o=e=>{const t=r(e);return t in l?ua({},e,{children:l[t].map((e=>o(e)))}):ua({},e)};return l[a].map((e=>o(e)))},getFlatDataFromTree:Oa,insertNode:wa,addNodeUnderParent:function(e){let{treeData:t,newNode:r,parentKey:n=null,getNodeKey:a,ignoreCollapsed:l=!0,expandParent:o=!1,addAsFirstChild:i=!1}=e;if(null===n)return i?{treeData:[r,...t||[]],treeIndex:0}:{treeData:[...t||[],r],treeIndex:(t||[]).length};let s=null,c=!1;const u=ba({treeData:t,getNodeKey:a,ignoreCollapsed:l,callback:e=>{let{node:t,treeIndex:a,path:u}=e;const d=u?u[u.length-1]:null;if(c||d!==n)return t;c=!0;const p=ua({},t);if(o&&(p.expanded=!0),!p.children)return s=a+1,ua({},p,{children:[r]});if("function"==typeof p.children)throw new Error("Cannot add to children defined by a function");let m=a+1;for(let e=0;e<p.children.length;e+=1)m+=1+ma({node:p.children[e],ignoreCollapsed:l});return s=m,ua({},p,{children:i?[r,...p.children]:[...p.children,r]})}});if(!c)throw new Error("No node found with the given key.");return{treeData:u,treeIndex:s}},getNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null;try{Ea({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return l={node:t,treeIndex:r},t}})}catch(e){}return l},removeNode:va,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return Ea({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:Ea,toggleExpandedForAll:ya,map:ba,walk:fa,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=pa({targetIndex:r,getNodeKey:n,node:{children:t,expanded:!0},currentIndex:-1,path:[],lowerSiblingCounts:[],isPseudoRoot:!0});return a.node?a:null},getVisibleNodeCount:function(e){let{treeData:t}=e;const r=e=>e.children&&!0===e.expanded&&"function"!=typeof e.children?1+e.children.reduce(((e,t)=>e+r(t)),0):1;return t.reduce(((e,t)=>e+r(t)),0)},getDescendantCount:ma};function Sa(){return Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sa.apply(this,arguments)}function Pa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Na(e,t,r[t])}))}return e}function Na(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Da=e=>{let{scaffoldBlockPxWidth:t,toggleChildrenVisibility:r,connectDragPreview:n,connectDragSource:a,isDragging:l,canDrop:o,canDrag:i,node:s,title:u,subtitle:d,draggedNode:p,path:m,treeIndex:h,isSearchMatch:g,isSearchFocus:f,buttons:b,className:y,style:E,didDrop:v,treeId:x,isOver:w,parentNode:O,rowDirection:T}=e,C=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["scaffoldBlockPxWidth","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","node","title","subtitle","draggedNode","path","treeIndex","isSearchMatch","isSearchFocus","buttons","className","style","didDrop","treeId","isOver","parentNode","rowDirection"]);const I=u||s.title,k=d||s.subtitle,S="rtl"===T?"rst__rtl":null;let P;i&&(P="function"==typeof s.children&&s.expanded?c().createElement("div",{className:"rst__loadingHandle"},c().createElement("div",{className:"rst__loadingCircle"},[...new Array(12)].map(((e,t)=>c().createElement("div",{key:t,className:la("rst__loadingCirclePoint",S)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const N=p&&Ta(p,s),D=!v&&l;let R={left:-.5*t};return"rtl"===T&&(R={right:-.5*t}),c().createElement("div",Sa({style:{height:"100%"}},C),r&&s.children&&(s.children.length>0||"function"==typeof s.children)&&c().createElement("div",null,c().createElement("button",{type:"button","aria-label":s.expanded?"Collapse":"Expand",className:la(s.expanded?"rst__collapseButton":"rst__expandButton",S),style:R,onClick:()=>r({node:s,path:m,treeIndex:h})}),s.expanded&&!l&&c().createElement("div",{style:{width:t},className:la("rst__lineChildren",S)})),c().createElement("div",{className:la("rst__rowWrapper",S)},n(c().createElement("div",{className:la("rst__row",D&&"rst__rowLandingPad",D&&!o&&"rst__rowCancelPad",g&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",S,y),style:Pa({opacity:N?.5:1},E)},P,c().createElement("div",{className:la("rst__rowContents",!i&&"rst__rowContentsDragDisabled",S)},c().createElement("div",{className:la("rst__rowLabel",S)},c().createElement("span",{className:la("rst__rowTitle",s.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof I?I({node:s,path:m,treeIndex:h}):I),k&&c().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof k?k({node:s,path:m,treeIndex:h}):k)),c().createElement("div",{className:"rst__rowToolbar"},b.map(((e,t)=>c().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))))))};Da.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},Da.propTypes={node:O().shape({}).isRequired,title:O().oneOfType([O().func,O().node]),subtitle:O().oneOfType([O().func,O().node]),path:O().arrayOf(O().oneOfType([O().string,O().number])).isRequired,treeIndex:O().number.isRequired,treeId:O().string.isRequired,isSearchMatch:O().bool,isSearchFocus:O().bool,canDrag:O().bool,scaffoldBlockPxWidth:O().number.isRequired,toggleChildrenVisibility:O().func,buttons:O().arrayOf(O().node),className:O().string,style:O().shape({}),connectDragPreview:O().func.isRequired,connectDragSource:O().func.isRequired,parentNode:O().shape({}),isDragging:O().bool.isRequired,didDrop:O().bool.isRequired,draggedNode:O().shape({}),isOver:O().bool.isRequired,canDrop:O().bool,rowDirection:O().string};const Ra=Da;function _a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Aa extends s.Component{render(){const e=this.props,{children:t,connectDropTarget:r,treeId:n,drop:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","connectDropTarget","treeId","drop"]);return r(c().createElement("div",null,s.Children.map(t,(e=>(0,s.cloneElement)(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){_a(e,t,r[t])}))}return e}({},l))))))}}Aa.defaultProps={canDrop:!1,draggedNode:null},Aa.propTypes={children:O().node.isRequired,connectDropTarget:O().func.isRequired,isOver:O().bool.isRequired,canDrop:O().bool,draggedNode:O().shape({}),treeId:O().string.isRequired,drop:O().func.isRequired};const Za=Aa,ja=(0,D.Z)((()=>({"@global .rst__placeholder":{position:"relative",height:"68px",maxWidth:"300px",padding:"10px"},"@global .rst__placeholder, .rst__placeholder > *":{boxSizing:"border-box"},"@global .rst__placeholder::before":{border:"3px dashed #d9d9d9",content:"",position:"absolute",top:"5px",right:"5px",bottom:"5px",left:"5px",zIndex:-1},"@global .rst__placeholderLandingPad, .rst__placeholderCancelPad":{border:"none !important",boxShadow:"none !important",outline:"none !important"},"@global .rst__placeholderLandingPad *, .rst__placeholderCancelPad *":{opacity:"0 !important"},"@global .rst__placeholderLandingPad::before, .rst__placeholderCancelPad::before":{backgroundColor:"lightblue",borderColor:"white"},"@global .rst__placeholderCancelPad::before":{backgroundColor:"#e6a8ad"}}))),Ma=e=>{let{isOver:t,canDrop:r}=e;return ja(),c().createElement("div",{className:la("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};Ma.defaultProps={isOver:!1,canDrop:!1},Ma.propTypes={isOver:O().bool,canDrop:O().bool};const La=Ma,Va=e=>{let t=[],r=[],n=null;return a=>{const l=Object.keys(a).sort(),o=l.map((e=>a[e]));return(o.length!==t.length||o.some(((e,r)=>e!==t[r]))||l.some(((e,t)=>e!==r[t])))&&(t=o,r=l,n=e(a)),n}},Fa=Va(wa),Ba=Va(Oa),Ua=Va(ma);function Ha(e){let{treeIndex:t}=e;return t}function za(e){return"string"==typeof e?e:null===e||"object"!=typeof e||!e.props||!e.props.children||"string"!=typeof e.props.children&&"object"!=typeof e.props.children?"":"string"==typeof e.props.children?e.props.children:e.props.children.map((e=>za(e))).join("")}function Wa(e,t,r,n,a){return"function"==typeof r[e]?String(r[e]({node:r,path:n,treeIndex:a})).indexOf(t)>-1:"object"==typeof r[e]?za(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Ga(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return Wa("title",a,t,r,n)||Wa("subtitle",a,t,r,n)}const qa={defaultSearchMethod:Ga,defaultGetNodeKey:Ha};var Ka=r(75047);class Ya{constructor(e){this.hoverHandler=()=>{if(null===this.hoverProps)return;const{dropTargetProps:e,monitor:t,component:r}=this.hoverProps,n=t.getItem();if(!n)return;const a=this.getTargetDepth(e,t,r),l=n.node;(e.node!==this.lastDropTargetNode||a!==this.lastDropTargetDepth)&&(this.lastDropTargetNode=e.node,this.lastDropTargetDepth=a,this.dragHover({node:l,path:n.path,minimumTreeIndex:e.listIndex,depth:a}),this.hoverProps=null)},this.deferredCallHoverHandler=()=>{if(this.shouldSkipMoreFrames)return this.shouldSkipMoreFrames=!1,void(this.rafId=requestAnimationFrame(this.deferredCallHoverHandler));this.rafId=null,this.hoverHandler()},this.treeRef=e,this.resetDragVariables()}get startDrag(){return this.treeRef.startDrag}get dragHover(){return this.treeRef.dragHover}get endDrag(){return this.treeRef.endDrag}get drop(){return this.treeRef.drop}get treeId(){return this.treeRef.treeId}get dndType(){return this.treeRef.dndType}get treeData(){return this.treeRef.state.draggingTreeData||this.treeRef.props.treeData}get getNodeKey(){return this.treeRef.props.getNodeKey}get customCanDrop(){return this.treeRef.props.canDrop}get maxDepth(){return this.treeRef.props.maxDepth}resetDragVariables(){this.lastDropTargetNode=null,this.lastDropTargetDepth=null,this.hoverProps=null,this.lastCanDropResult=null,this.lastCanDropProps=null,this.shouldSkipMoreFrames=!1,this.rafId=null}getTargetDepth(e,t,r){let n=0;const a=e.getPrevRow();if(a){let{path:t}=a;!this.treeRef.canNodeHaveChildren(a.node)&&(t=t.slice(0,t.length-1)),n=Math.min(t.length,e.path.length)}let l,o=(t.getItem().path||[]).length;if(t.getItem().treeId!==this.treeId)if(o=0,r){const n=(0,Ka.findDOMNode)(r).getBoundingClientRect(),a=t.getSourceClientOffset().x-n.left;l=Math.round(a/e.scaffoldBlockPxWidth)}else l=e.path.length;else{const r="rtl"===e.rowDirection?-1:1;l=Math.round(r*t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth)}let i=Math.min(n,Math.max(0,o+l-1));if(void 0!==this.maxDepth&&null!==this.maxDepth){const e=Ca(t.getItem().node);i=Math.max(0,Math.min(i,this.maxDepth-e-1))}return i}canDrop(e,t){if(!t.isOver())return!1;const r=e.getPrevRow(),n=r?r.path:[],a=r?r.node:{},l=Math.round(t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth),o={nodeId:void 0!==e.node.nodeId?e.node.nodeId:e.node,rowAbove:r,abovePath:n,aboveNodeId:void 0!==a.nodeId?a.nodeId:a,blocksOffset:l};if((0,I.equals)(this.lastCanDropProps,o))return this.lastCanDropResult;this.lastCanDropProps=o;const i=this.getTargetDepth(e,t,null);if(i>=n.length&&"function"==typeof a.children)return this.lastCanDropResult=!1;if("function"==typeof this.customCanDrop){const{node:r}=t.getItem(),n=Fa({treeData:this.treeData,newNode:r,depth:i,getNodeKey:this.getNodeKey,minimumTreeIndex:e.listIndex,expandParent:!0});return this.lastCanDropResult=this.customCanDrop({node:r,prevPath:t.getItem().path,prevParent:t.getItem().parentNode,prevTreeIndex:t.getItem().treeIndex,nextPath:n.path,nextParent:n.parentNode,nextTreeIndex:n.treeIndex})}return this.lastCanDropResult=!0}wrapSource(e){const t={beginDrag:e=>(this.startDrag(e),{node:e.node,parentNode:e.parentNode,path:e.path,treeIndex:e.treeIndex,treeId:e.treeId}),endDrag:(e,t)=>{this.rafId&&cancelAnimationFrame(this.rafId),this.endDrag(t.getDropResult()),this.resetDragVariables()},isDragging:(e,t)=>{const r=t.getItem().node;return e.node===r}};return(0,ta.DragSource)(this.dndType,t,(function(e,t){return{connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview(),isDragging:t.isDragging(),didDrop:t.didDrop()}}))(e)}wrapTarget(e){const t={drop:(e,t,r)=>{this.rafId&&cancelAnimationFrame(this.rafId);const n={node:t.getItem().node,path:t.getItem().path,treeIndex:t.getItem().treeIndex,treeId:this.treeId,minimumTreeIndex:e.treeIndex,depth:this.getTargetDepth(e,t,r)};return this.lastDropTargetNode=null,this.drop(n),n},hover:(e,t,r)=>{this.rafId?this.shouldSkipMoreFrames=!0:(this.shouldSkipMoreFrames=!1,this.hoverProps={dropTargetProps:e,monitor:t,component:r},this.rafId=requestAnimationFrame(this.deferredCallHoverHandler))},canDrop:this.canDrop.bind(this)};return(0,ta.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}wrapPlaceholder(e){const t={drop:(e,t)=>{const{node:r,path:n,treeIndex:a}=t.getItem(),l={node:r,path:n,treeIndex:a,treeId:this.treeId,minimumTreeIndex:0,depth:0};return this.drop(l),l}};return(0,ta.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}}function $a(){return $a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$a.apply(this,arguments)}function Xa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qa(e,t,r[t])}))}return e}function Qa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Ja=1;const el=e=>{const t=Xa({},e,{style:Xa({},e.theme.style,e.style),innerStyle:Xa({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Xa({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:Ra,placeholderRenderer:La,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:ca};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class tl extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:l}=el(e);this.dndManager=new Ya(this),this.treeId=`rst__${Ja}`,Ja+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(Za),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(ea._t||ea.ZP)(Jn.aV),this.vStrength=(0,ea.Kx)(l),this.hStrength=(0,ea.v7)(l)),this.state={draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,searchMatches:[],searchFocusTreeIndex:null,dragging:!1,draggingExpandedPaths:[],ignoreOneTreeUpdate:!1,instanceProps:{treeData:this.props.treeData||[],searchQuery:null,searchFocusOffset:null,ignoreTreeChanges:!1}},this.toggleChildrenVisibility=this.toggleChildrenVisibility.bind(this),this.moveNode=this.moveNode.bind(this),this.startDrag=this.startDrag.bind(this),this.dragHover=this.dragHover.bind(this),this.endDrag=this.endDrag.bind(this),this.drop=this.drop.bind(this),this.handleDndMonitorChange=this.handleDndMonitorChange.bind(this)}componentDidMount(){tl.loadLazyChildren(this.props);const e=tl.search(this.props,this.state,!0,!0,!1);this.setState(e),this.clearMonitorSubscription=this.props.dragDropManager.getMonitor().subscribeToStateChange(this.handleDndMonitorChange)}static getDerivedStateFromProps(e,t){const{instanceProps:r}=t,n={};return(0,I.equals)(r.searchQuery,e.searchQuery)?r.searchFocusOffset!==e.searchFocusOffset&&Object.assign(n,tl.search(e,t,!0,!0,!0)):Object.assign(n,tl.search(e,t,!0,!0,!1)),r.searchQuery=e.searchQuery,r.searchFocusOffset=e.searchFocusOffset,n.instanceProps=r,n}componentDidUpdate(e,t){if(this.state.dragging!==t.dragging&&this.props.onDragStateChanged&&this.props.onDragStateChanged({isDragging:this.state.dragging,draggedNode:this.state.draggedNode}),this.state.dragging)if((0,I.equals)(this.props.treeData,e.treeData))this.state.draggingTreeData&&t.draggingTreeData!==this.state.draggingTreeData&&fa({treeData:this.state.draggingTreeData,getNodeKey:this.props.getNodeKey,callback:e=>{let{node:t,path:r,lowerSiblingCounts:n,treeIndex:a}=e;t.pending&&t.expanded&&this.props.onLazyLoadChildren({node:t,path:r,lowerSiblingCounts:n,treeIndex:a})}});else{const{treeData:e}=va({treeData:this.props.treeData,path:t.draggedPath,getNodeKey:this.props.getNodeKey});this.setState((t=>{let{draggingExpandedPaths:r}=t;return{draggingTreeData:r.reduce(((e,t)=>{let r;try{r=Ea({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Xa({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey})}catch(t){r=e}return r}),e)}}))}else if(this.props.treeData!==e.treeData){const t=(0,I.equals)(this.props.treeData,e.treeData),{ignoreOneTreeUpdate:r,instanceProps:n}=this.state,a={};t||(r?a.ignoreOneTreeUpdate=!1:(a.searchFocusTreeIndex=null,tl.loadLazyChildren(this.props),Object.assign(a,tl.search(this.props,this.state,!1,!1,!1))),a.draggingTreeData=null,a.draggedNode=null,a.draggedMinimumTreeIndex=null,a.draggedDepth=null,a.dragging=!1,a.draggingExpandedPaths=[],a.instanceProps=Xa({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Ba({ignoreCollapsed:!0,getNodeKey:this.props.getNodeKey,treeData:e})}handleDndMonitorChange(){!this.props.dragDropManager.getMonitor().isDragging()&&this.state.draggingTreeData&&this.endDrag()}toggleChildrenVisibility(e){let{node:t,path:r}=e;const{instanceProps:n}=this.state,a=Ea({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Xa({},t,{expanded:!t.expanded})},getNodeKey:this.props.getNodeKey});this.props.onChange(a),this.props.onVisibilityToggle({treeData:a,node:t,expanded:!t.expanded,path:r})}moveNode(e){let{node:t,path:r,treeIndex:n,depth:a,minimumTreeIndex:l}=e;const{treeData:o,treeIndex:i,path:s,parentNode:c}=wa({treeData:this.state.draggingTreeData,newNode:t,depth:a,minimumTreeIndex:l,expandParent:!0,getNodeKey:this.props.getNodeKey});this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1,draggingExpandedPaths:[]},(()=>{this.props.onChange(o),this.props.onMoveNode({treeData:o,node:t,treeIndex:i,path:s,nextPath:s,nextTreeIndex:i,prevPath:r,prevTreeIndex:n,nextParentNode:c})}))}static search(e,t,r,n,a){const{onChange:l,getNodeKey:o,searchFinishCallback:i,searchQuery:s,searchMethod:c,searchFocusOffset:u,onlyExpandSearchedNodes:d}=e,{instanceProps:p}=t;if(!s&&!c)return i&&i([]),{searchMatches:[]};const m={},{treeData:h,matches:g}=Ia({getNodeKey:o,treeData:d?ya({treeData:p.treeData,expanded:!1}):p.treeData,searchQuery:s,searchMethod:c||Ga,searchFocusOffset:u,expandAllMatchPaths:n&&!a,expandFocusMatchPaths:!!n});n&&(m.ignoreOneTreeUpdate=!0,l(h)),i&&i(g);let f=null;return r&&null!==u&&u<g.length&&(f=g[u].treeIndex),m.searchMatches=g,m.searchFocusTreeIndex=f,m}startDrag(e){let{path:t}=e;this.setState((e=>{const{treeData:r,node:n,treeIndex:a}=va({treeData:e.instanceProps.treeData,path:t,getNodeKey:this.props.getNodeKey});return{draggingTreeData:r,draggedNode:n,draggedDepth:t.length-1,draggedMinimumTreeIndex:a,draggedPath:t,dragging:!0}}))}dragHover(e){let{node:t,depth:r,minimumTreeIndex:n}=e;this.state.draggedDepth===r&&this.state.draggedMinimumTreeIndex===n||this.setState((e=>{let{draggingTreeData:a,instanceProps:l,draggingExpandedPaths:o}=e;const i=a||l.treeData,s=Fa({treeData:i,newNode:t,depth:r,minimumTreeIndex:n,expandParent:!0,getNodeKey:this.props.getNodeKey}),c=this.getRows(s.treeData)[s.treeIndex].path.slice(0,-1),u=(0,I.pipe)((0,I.when)((0,I.always)((0,I.gt)(c.length,0)),(0,I.append)(c)),(0,I.uniqWith)((0,I.eqBy)(String)))(o);return{draggedNode:t,draggedDepth:r,draggedMinimumTreeIndex:n,draggingTreeData:Ea({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Xa({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey}),searchFocusTreeIndex:null,dragging:!0,draggingExpandedPaths:u}}))}endDrag(e){const{instanceProps:t}=this.state;if(e){if(e.treeId!==this.treeId){const{node:r,path:n,treeIndex:a}=e;let l=this.props.shouldCopyOnOutsideDrop;"function"==typeof l&&(l=l({node:r,prevTreeIndex:a,prevPath:n}));let o=this.state.draggingTreeData||t.treeData;l&&(o=Ea({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Xa({},t)},getNodeKey:this.props.getNodeKey})),this.props.onChange(o),this.props.onMoveNode({treeData:o,node:r,treeIndex:null,path:null,nextPath:null,nextTreeIndex:null,prevPath:n,prevTreeIndex:a})}}else(()=>{this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1})})()}drop(e){this.moveNode(e)}canNodeHaveChildren(e){const{canNodeHaveChildren:t}=this.props;return!t||t(e)}static loadLazyChildren(e){fa({treeData:e.treeData,getNodeKey:e.getNodeKey,callback:t=>{let{node:r,path:n,lowerSiblingCounts:a,treeIndex:l}=t;r.pending&&(r.expanded||e.loadCollapsedLazyChildren)&&e.onLazyLoadChildren({node:r,path:n,lowerSiblingCounts:a,treeIndex:l,done:t=>e.onChange(Ea({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Xa({},n,{children:t}):n},getNodeKey:e.getNodeKey}),!0)})}})}renderRow(e,t){let{listIndex:r,style:n,getPrevRow:a,matchKeys:l,swapFrom:o,swapDepth:i,swapLength:s}=t;const{node:u,parentNode:d,path:p,lowerSiblingCounts:m,treeIndex:h}=e,{canDrag:g,generateNodeProps:f,scaffoldBlockPxWidth:b,searchFocusOffset:y,rowDirection:E}=el(this.props),v=this.treeNodeRenderer,x=this.nodeContentRenderer,w=p[p.length-1],O=w in l,T=O&&l[w]===y,C={node:u,parentNode:d,path:p,lowerSiblingCounts:m,treeIndex:h,isSearchMatch:O,isSearchFocus:T},I=f?f(C):{},k="function"!=typeof g?g:g(C),S={treeIndex:h,scaffoldBlockPxWidth:b,node:u,path:p,treeId:this.treeId,rowDirection:E};return c().createElement(v,$a({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:o,swapLength:s,swapDepth:i},S),c().createElement(x,$a({parentNode:d,isSearchMatch:O,isSearchFocus:T,canDrag:k,toggleChildrenVisibility:this.toggleChildrenVisibility},S,I)))}render(){const{dragDropManager:e,style:t,className:r,innerStyle:n,rowHeight:a,isVirtualized:l,placeholderRenderer:o,reactVirtualizedListProps:i,getNodeKey:s,rowDirection:u}=el(this.props),{searchMatches:d,searchFocusTreeIndex:p,draggedNode:m,draggedDepth:h,draggedMinimumTreeIndex:g}=this.state,f=this.state.draggingTreeData||this.props.treeData,b="rtl"===u?"rst__rtl":null;let y,E=null,v=null;if(m&&null!==g){const e=Fa({treeData:f,newNode:m,depth:h,minimumTreeIndex:g,expandParent:!0,getNodeKey:s}),t=g;E=e.treeIndex,v=1+Ua({node:m}),y=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=[...e.slice(0,t),...e.slice(t+n)];return[...a.slice(0,r),...e.slice(t,t+n),...a.slice(r)]}(this.getRows(e.treeData),E,t,v)}else y=this.getRows(f);const x={};d.forEach(((e,t)=>{let{path:r}=e;x[r[r.length-1]]=t}));const w=null!==p?{scrollToIndex:p}:{};let O,T=t;if(y.length<1){const e=this.treePlaceholderRenderer,t=o;O=c().createElement(e,{treeId:this.treeId,drop:this.drop},c().createElement(t,null))}else if(l){T=Xa({height:"100%"},T);const t=this.scrollZoneVirtualList;O=c().createElement(Jn.qj,null,(r=>{let{height:l,width:o}=r;return c().createElement(t,$a({},w,{dragDropManager:e,verticalStrength:this.vStrength,horizontalStrength:this.hStrength,speed:30,scrollToAlignment:"start",className:this.props.classes.rst__virtualScrollOverride,width:o,onScroll:e=>{let{scrollTop:t}=e;this.scrollTop=t},height:l,style:n,rowCount:y.length,estimatedRowSize:"function"!=typeof a?a:void 0,rowHeight:"function"!=typeof a?a:e=>{let{index:t}=e;return a({index:t,treeIndex:t,node:y[t].node,path:y[t].path})},rowRenderer:e=>{let{index:t,style:r}=e;return this.renderRow(y[t],{listIndex:t,style:r,getPrevRow:()=>y[t-1]||null,matchKeys:x,swapFrom:E,swapDepth:h,swapLength:v})}},i))}))}else O=y.map(((e,t)=>this.renderRow(e,{listIndex:t,style:{height:"function"!=typeof a?a:a({index:t,treeIndex:t,node:e.node,path:e.path})},getPrevRow:()=>y[t-1]||null,matchKeys:x,swapFrom:E,swapDepth:h,swapLength:v})));return c().createElement("div",{className:la("rst__tree",r,b),style:T},O)}}tl.propTypes={classes:O().object,dragDropManager:O().shape({getMonitor:O().func}).isRequired,treeData:O().arrayOf(O().object).isRequired,style:O().shape({}),className:O().string,innerStyle:O().shape({}),rowHeight:O().oneOfType([O().number,O().func]),slideRegionSize:O().number,reactVirtualizedListProps:O().shape({}),scaffoldBlockPxWidth:O().number,maxDepth:O().number,searchMethod:O().func,searchQuery:O().any,searchFocusOffset:O().number,searchFinishCallback:O().func,generateNodeProps:O().func,isVirtualized:O().bool,treeNodeRenderer:O().func,nodeContentRenderer:O().func,placeholderRenderer:O().func,theme:O().shape({style:O().shape({}),innerStyle:O().shape({}),reactVirtualizedListProps:O().shape({}),scaffoldBlockPxWidth:O().number,slideRegionSize:O().number,rowHeight:O().oneOfType([O().number,O().func]),treeNodeRenderer:O().func,nodeContentRenderer:O().func,placeholderRenderer:O().func}),getNodeKey:O().func,onChange:O().func.isRequired,onMoveNode:O().func,canDrag:O().oneOfType([O().func,O().bool]),canDrop:O().func,canNodeHaveChildren:O().func,shouldCopyOnOutsideDrop:O().oneOfType([O().func,O().bool]),onVisibilityToggle:O().func,dndType:O().string,onDragStateChanged:O().func,onlyExpandSearchedNodes:O().bool,rowDirection:O().string,onLazyLoadChildren:O().func,ignoreTreeChanges:O().bool},tl.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:Ha,innerStyle:{},isVirtualized:!0,maxDepth:null,treeNodeRenderer:null,nodeContentRenderer:null,onMoveNode:()=>{},onVisibilityToggle:()=>{},placeholderRenderer:null,reactVirtualizedListProps:{},rowHeight:null,scaffoldBlockPxWidth:null,searchFinishCallback:null,searchFocusOffset:null,searchMethod:null,searchQuery:null,shouldCopyOnOutsideDrop:!1,slideRegionSize:null,style:{},theme:{},onDragStateChanged:()=>{},onlyExpandSearchedNodes:!1,rowDirection:"ltr",onLazyLoadChildren:()=>{},ignoreTreeChanges:!1},(0,na.polyfill)(tl);const rl=(0,aa.Z)((()=>({"@global .ReactVirtualized__Grid__innerScrollContainer":{overflow:"visible !important"},"@global .ReactVirtualized__Grid":{outline:"none"},"@global .ReactVirtualized__List":{},rst__virtualScrollOverride:{overflow:"auto !important"},"@global .rst__rtl .ReactVirtualized__Grid__innerScrollContainer":{direction:"rtl"}})))(tl),nl=e=>c().createElement(ta.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(rl,$a({},e,{dragDropManager:r}))})),al=e=>c().createElement(ta.DndProvider,{backend:ra.default},c().createElement(nl,e));var ll=r(17822),ol=r(64435),il=r(63127),sl=r(74139),cl=r(33662),ul=r(87356),dl=r(54275),pl=r(72654),ml=r(27556);function hl(){return hl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hl.apply(this,arguments)}const gl=e=>{let{open:t,anchorEl:r,className:n,onClose:a,containerWidth:l,containerHeight:o,paperProps:i,listContent:s,externalInputField:u,classes:d={}}=e;const p=(0,dl.Z)({containerWidth:l,containerHeight:o});return c().createElement("div",{className:d.root},u,c().createElement(Vn.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(pl.Z,t,c().createElement(ml.Z,hl({elevation:2},i),c().createElement("div",{className:S()(p.container,n),style:{width:l}},c().createElement("div",{className:p.list},s))))})))};gl.propTypes={open:O().bool,anchorEl:O().object,className:O().string,onClose:O().func,containerWidth:O().number,containerHeight:O().number,paperProps:O().object,listContent:O().element,externalInputField:O().element,classes:O().shape({root:O().string})},gl.defaultProps={popoverAnchorOrigin:{vertical:"top",horizontal:"right"}};const fl=gl,bl=(0,D.Z)({onlyValue:{color:"rgba(0,0,0,.6)",fontSize:"13px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},select:{fontSize:"13px",color:"rgba(0,0,0,.6)",paddingLeft:"15px","&&":{paddingRight:"35px"}},selectMenu:{"& li":{fontSize:"13px",height:"32px"}},textField:{maxWidth:"100%"}}),yl=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:l}=e;const o=bl(),[i,...u]=n,d=0===u.length;(0,s.useEffect)((()=>{d&&t!==i.value&&r(i.value)}),[i.value]);const p=!!l;return c().createElement("div",{className:a.root},d?c().createElement(N.Z,{className:a.onlyValue||o.onlyValue,variant:"h6"},i.label):c().createElement(vr.Z,{displayEmpty:p,disableUnderline:!0,classes:{select:a.select||o.select},TextFieldProps:{classes:{root:a.textField||o.textField}},MenuProps:{classes:{list:a.selectMenu||o.selectMenu}},value:t||"",entries:p?[{value:"",label:l},...n]:n,onChange:e=>r(e||null)}))};yl.propTypes={value:O().string,onChange:O().func,options:O().arrayOf(O().shape({value:O().string,label:O().string})),classes:O().shape({root:O().string,onlyValue:O().string,select:O().string,selectMenu:O().string,textField:O().string}),emptyLabel:O().string};const El=yl;var vl=r(28101);function xl(){return xl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xl.apply(this,arguments)}const wl=e=>c().createElement("svg",xl({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),c().createElement("mask",{id:"AttributesList_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},c().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),c().createElement("g",{mask:"url(#AttributesList_svg__a)"},c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#AttributesList_svg__b)"}),c().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#AttributesList_svg__c)"}),c().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2v40.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),c().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),c().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zm90 0a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),c().createElement("defs",null,c().createElement("linearGradient",{id:"AttributesList_svg__b",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),c().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),c().createElement("linearGradient",{id:"AttributesList_svg__c",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopOpacity:.01}),c().createElement("stop",{offset:1})))),Ol=(0,D.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box",padding:"40px"},logo:{width:"190px",height:"190px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:400,marginTop:"24px"},text:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"23px",textAlign:"center"},secondaryText:{color:e.palette.text.primary,fontSize:"14px",fontWeight:"normal",lineHeight:"16px",letterSpacing:"0.24px",textAlign:"center",paddingTop:"8px"}}))),Tl=e=>{let{IconRenderer:t=wl,text:r,secondaryText:n}=e;const a=Ol();return c().createElement("div",{className:a.root},c().createElement(t,{className:a.logo}),c().createElement("div",{className:a.textBox},c().createElement(N.Z,{className:a.text},r),n&&c().createElement(N.Z,{className:a.secondaryText},n)))};var Cl=r(11821),Il=r(98273),kl=r(90590),Sl=r(40435),Pl=r(21210),Nl=r(79935),Dl=r(92985);const Rl=e=>{let{height:t,margin:r}=e;return c().createElement("div",{style:{width:"1px",height:`${t}px`,borderLeft:"1px solid rgba(0,0,0,0.38)",margin:`0 ${r}px`,flexShrink:"0"}})};Rl.propTypes={height:O().number,margin:O().number};const _l=Rl,Al=e=>{let{label:t}=e;return t||null},Zl=e=>{let{value:t}=e;return t||null},jl=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const l=e=>{const t=e.cellRenderer||Zl,r=e.headCellRenderer||Al;return c().createElement("tr",{key:e.id},c().createElement("th",{key:e.id},c().createElement(r,e)),n.map(((r,n)=>c().createElement("td",{key:n},c().createElement(t,{value:r[e.id],columnValue:r,rowData:e})))))};return c().createElement("table",{className:t},a>0&&c().createElement("thead",null,r.slice(0,a).map(l)),c().createElement("tbody",null,r.slice(a).map(l)))};jl.propTypes={rowsData:O().arrayOf(O().shape({id:O().string,label:O().string,headCellRenderer:O().func,cellRenderer:O().func})),columnsData:O().arrayOf(O().object),theadRowsNumber:O().number,className:O().string};const Ml=(0,s.memo)(jl);var Ll=r(57412),Vl=r(29611),Fl=r(50581),Bl=r(21853);const Ul=(0,D.Z)({searchButton:{marginLeft:"auto !important",marginRight:"-4px",padding:"8px"},input:{flex:"1 0 200px",marginLeft:"70px",fontSize:"14px",background:"rgba(0,0,0,0.03) 2px",padding:"4px 0",marginRight:"4px"},startAdornment:{color:"rgba(0,0,0,0.54)",paddingLeft:"8px"}}),Hl=e=>{let{query:t,onChange:r}=e;const[n,a]=(0,s.useState)(t),[l,o]=(0,s.useState)(!!t);(0,s.useEffect)((()=>{a(t)}),[t]);const i=Ul(),u=n&&n.length;return l?c().createElement(Vl.Z,{className:i.input,value:n,autoFocus:!0,placeholder:C().text("Search"),disableUnderline:!0,onChange:(0,I.pipe)(tt.NA,a),startAdornment:c().createElement(Fl.Z,{position:"start"},c().createElement(Bl.default,{className:i.startAdornment})),endAdornment:c().createElement(Fl.Z,{position:"end"},u&&c().createElement(Sl.Z,{size:"S",icon:He.default,onClick:(0,I.pipe)(I.F,o,(0,I.always)(""),(0,I.tap)(r),a)})),onKeyPress:(0,I.when)((0,I.propEq)("key","Enter"),(0,I.pipe)((0,I.always)(n),I.trim,r))}):c().createElement(Ue.Z,{className:i.searchButton,onClick:(0,I.pipe)(I.T,o)},c().createElement(Bl.default,null))};var zl,Wl=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(zl||(zl={}));const Gl=()=>{const[e,t]=(0,s.useState)(null),r=e===zl.READING,n=e===zl.EDITING,a=e===zl.HOVERED;(0,s.useEffect)((()=>{t(zl.READING)}),[]);const l=(0,s.useCallback)((0,u.DsO)(t,50),[]),o=(0,s.useCallback)((()=>{n||l(zl.HOVERED)}),[l,n]),i=(0,s.useCallback)((()=>{n||l(zl.READING)}),[l,n]);return{setReadingMode:(0,s.useCallback)((()=>t(zl.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(zl.EDITING)),[t]),onMouseLeave:i,onMouseEnter:o,isReadingMode:r,isEditingMode:n,isHovered:a}};const ql=(0,s.createContext)(null),Kl=e=>{let{children:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children"]);return c().createElement(ql.Provider,{value:r},t)},Yl=e=>{const{getCrosswalkColor:t=(0,I.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(ql)||{};return e?t(e):""},$l=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(ql)||{};return e},Xl=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=tt.ZT}=(0,s.useContext)(ql)||{},n=!!e&&!!t.find((0,I.eqBy)(u.uKF,e));return{isHighlighted:n,isDimmed:t.length>0&&!n,highlightCrosswalk:(0,s.useCallback)((()=>r(e,!0)),[e,r]),removeHighlight:(0,s.useCallback)((()=>r(e,!1)),[e,r])}},Ql=e=>{const{toggleCrosswalkFocus:t=tt.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(ql)||{};return{isFocused:!!e&&r.some((0,I.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var Jl=r(72753);const eo=(0,D.Z)({sourceItem:{display:"flex",overflow:"hidden"},eyeIcon:e=>{let{isFocused:t}=e;return{marginLeft:"10px",color:t?"#000":"rgba(0, 0, 0, 0.54)"}},label:{color:"rgba(0, 0, 0, 0.87)",verticalAlign:"top",fontSize:"13px",lineHeight:"16px"},sourceInfo:{overflow:"hidden"},crosswalkValue:{color:"rgba(0, 0, 0, 0.54)",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},sourceIcon:e=>{let{color:t}=e;return{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px",backgroundColor:t}},crosswalkIcon:e=>{let{color:t,isOpaque:r}=e;return{backgroundColor:t,height:"12px",width:"12px",borderRadius:"30px",opacity:r?1:.38,transition:"opacity 0.3s"}}}),to=(0,D.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),ro=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:l,isFocused:o}=Ql(t),i=eo({color:r,isFocused:o}),s=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),{label:d}=(0,u.PWK)(s,t.type);return c().createElement("div",{className:S()(i.sourceItem,n)},c().createElement(Pl.Z,{className:i.sourceIcon,sourceType:t.type}),c().createElement("div",{className:i.sourceInfo},c().createElement("div",null,c().createElement("span",{className:i.label},d),a&&c().createElement(De.k,{icon:Jl.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:C().text("Focus"),onClick:()=>l()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},no=(0,D.Z)((e=>({tooltip:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,filter:"drop-shadow(0px 1px 5px #00000033) drop-shadow(0px 3px 1px #0000001F) drop-shadow(0px 2px 2px #00000024)",padding:"10px",maxWidth:"none"},arrow:{color:e.palette.background.paper}})));function ao(){return ao=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ao.apply(this,arguments)}const lo=e=>{const t=no();return c().createElement(ze.ZP,ao({},e,{classes:t,arrow:!0}))},oo=e=>{let{crosswalk:t,className:r}=e;const n=Yl(t),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Xl(t),i=eo({isOpaque:!a,color:n});return c().createElement(lo,{title:c().createElement(ro,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:S()(i.crosswalkIcon,r),onMouseEnter:()=>l(),onMouseLeave:()=>o()}))};var io=r(35039),so=r(31992),co=r(22983),uo=r(27604),po=r(43054),mo=r(79784),ho=r(12980);const go=(0,D.Z)((()=>({textField:{margin:0},input:{borderRadius:0},inputMultiline:{"&$input":{paddingTop:0,paddingBottom:0}},booleanEditor:{paddingLeft:"10px"},timestampEditor:{"&$paper":{minWidth:"255px"}},paper:e=>{let{color:t,containerWidth:r}=e;return{border:`3px solid ${t}`,borderRadius:"4px",width:r,minWidth:"160px"}},popoverRoot:{zIndex:"10!important"}})));function fo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bo=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],yo=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:l,onEdit:o}=e;const i=go({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),d=(0,u.PFL)(t),p=(0,ho.AG)(r,d),[m,h]=(0,s.useState)(p),g={className:i.textField,InputProps:{disableUnderline:!0,classes:{root:i.input,multiline:i.inputMultiline}}},f=()=>{const e=(0,ho.Ho)(t,m);if(!(0,I.isNil)(m)&&!(0,I.equals)(m,p)){const n=(0,u.CwH)(t)?{value:e.value,lookupCode:e.lookupCode}:{value:""===m&&(0,u.FVt)(d.type)?null:e};o(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){fo(e,t,r[t])}))}return e}({},r,n))}l()};return c().createElement(mo.ZP,{open:!!a,anchorEl:a.current,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},classes:{paper:S()(i.paper,{[i.booleanEditor]:(0,u.T6Y)(d.type),[i.timestampEditor]:(0,u.j5n)(d.type)}),root:i.popoverRoot},onKeyUp:e=>{"Enter"!==e.key||bo.includes(d.type)?"Escape"===e.key&&l():f()},onBackdropClick:f},c().createElement(kr.Z,{autoFocus:!0,dataTypeDefinition:d,fieldName:(0,u.Tde)(t.uri),onChange:h,TextFieldProps:g,value:m,fullWidth:!0}))};function Eo(){return Eo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eo.apply(this,arguments)}const vo=e=>c().createElement("svg",Eo({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3.5A8.503 8.503 0 003.5 12c0 4.692 3.808 8.5 8.5 8.5s8.5-3.808 8.5-8.5-3.808-8.5-8.5-8.5zM6.1 12c0-3.26 2.64-5.9 5.9-5.9 1.161 0 2.24.336 3.149.917L7.017 15.15A5.821 5.821 0 016.101 12zm5.9 5.9c-1.16 0-2.24-.336-3.148-.917l8.131-8.131c.581.908.917 1.987.917 3.148 0 3.26-2.64 5.9-5.9 5.9z",fill:"#000",fillOpacity:.54}));function xo(){return xo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xo.apply(this,arguments)}const wo=e=>c().createElement("svg",xo({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.847 9.402a6.34 6.34 0 00-.8-1.322L8.08 17.048A6.34 6.34 0 0012 18.4a6.398 6.398 0 005.847-8.998zm-7.283 7.283l6.121-6.121a4.898 4.898 0 01-6.121 6.121zm1.437-11.084a6.334 6.334 0 013.92 1.352L6.953 15.92A6.334 6.334 0 015.6 12c0-3.536 2.864-6.4 6.4-6.4zm0 1.5c.5 0 .982.075 1.436.215l-6.121 6.12A4.898 4.898 0 0112 7.1zM6.6 17.903A7.967 7.967 0 0012 20c4.417-.001 8.001-3.585 8.001-8.001a7.967 7.967 0 00-2.601-5.902A7.988 7.988 0 0012 4c-4.416 0-8 3.584-8 8a7.967 7.967 0 002.602 5.902zM12 2.5c-5.244 0-9.5 4.256-9.5 9.5s4.256 9.5 9.5 9.5 9.5-4.256 9.5-9.5-4.256-9.5-9.5-9.5z",fill:"#000",fillOpacity:.54})),Oo=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(De.k,{disabled:n,showForDisabled:!0,icon:t?vo:wo,tooltipTitle:n?C().text("You don't have permissions to ignore"):C().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};function To(){return To=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},To.apply(this,arguments)}const Co=e=>c().createElement("svg",To({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4v6l2 2v2h-5v7l-.992 1L11 21v-7H6v-2l2-2V4H7V2h10v2h-1z",fill:"#000",fillOpacity:.54}));function Io(){return Io=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Io.apply(this,arguments)}const ko=e=>c().createElement("svg",Io({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 10V4h1V2H7v2h1v6l-2 2v2h5v7l1.008 1L13 21v-7h5v-2l-2-2zm-6-6h4v7l1 1H9l1-1V4z",fill:"#000",fillOpacity:.54})),So=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(De.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?Co:ko,tooltipTitle:n?"You don't have permissions to pin":C().text("Pin"),size:"XS",disableRipple:!0})},Po=(0,D.Z)((e=>({menuItem:{minHeight:"32px",color:e.palette.text.secondary},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"16px"},sourceItem:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)",paddingBottom:"8px",paddingLeft:"16px",maxWidth:"200px"}}))),No=(0,St.Z)(P.Z),Do=e=>{let{styles:t,icon:r,text:n}=e;return c().createElement(c().Fragment,null,r,c().createElement(N.Z,{classes:{root:t.menuText}},n))},Ro=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=Po(),{disabled:l,text:o,tooltip:i,onClick:s,id:u="",icon:d,crosswalk:p,color:m}=r;return p?c().createElement(ro,{className:a.sourceItem,color:m,crosswalk:p,focusable:!0}):c().createElement(No,{tooltipTitle:i,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:l,ref:t,"data-reltio-id":`crosswalk-menu-item${u}`},c().createElement(Do,{icon:d,text:o,styles:a}))}));Ro.displayName="CrosswalkMenuItem";const _o=Ro;function Ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zo=(0,D.Z)((()=>({root:e=>{let{fullyColored:t,opaque:r,color:n,variant:a}=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){Ao(e,t,r[t])}))}return e}({height:"28px"},"filled"===a&&{borderRadius:"4px",background:t?n:`linear-gradient(to right, ${n} 8px, rgba(0,0,0,0.05) 8px)`},"outlined"===a&&{"&::after":{content:'""',position:"absolute",background:n,borderRadius:"4px 0px 0px 4px",width:"8px",height:"100%",pointerEvents:"none"},"&::before":{content:'""',position:"absolute",boxSizing:"border-box",borderRadius:"4px",border:t?`${n} solid 2px`:"rgba(0,0,0,0.12) solid 1px",width:"100%",height:"100%",pointerEvents:"none"}},{display:"flex",alignItems:"center",maxWidth:"230px",opacity:r?1:.38,transition:"opacity 0.3s",position:"relative"})},attributeValue:{marginLeft:"16px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:1},actions:{display:"flex",width:"71px",justifyContent:"flex-end",marginRight:"4px"}}))),jo=e=>{let{className:t,dataReltioId:r,attributeType:n=null,attributeValue:a,crosswalk:l,disableEdit:o,disableDelete:i,onIgnore:d,onEdit:p,onPin:m,onDelete:h}=e;const{isReadingMode:g,isEditingMode:f,isHovered:b,onMouseEnter:y,onMouseLeave:E,setReadingMode:v,setEditingMode:x}=Gl(),w=(0,s.useRef)(),O=(0,u.nIW)(a.uri),T=(0,u.x_)(l),I=!n.system&&!T,k=I&&!o&&(0,u.Z5t)(u.fO_.EDITING,n),P=I&&!i&&(0,u.Edd)(u.fO_.EDITING,n),N=(0,u.ZiX)(a.uri),D=!N&&(!g&&k||a.pin),R=!N&&(!g&&k||a.ignored),_=Yl(l),{isHighlighted:A,isDimmed:Z,highlightCrosswalk:j,removeHighlight:M}=Xl(l),L=Zo({variant:T?"outlined":"filled",opaque:!Z,fullyColored:A,color:_}),V=[{crosswalk:l,color:_},{disabled:!k,text:C().text("Edit"),icon:c().createElement(uo.Z,null),tooltip:k?null:C().text("You don't have permissions to edit"),onClick:()=>x(),id:"edit"},{disabled:!P,text:C().text("Delete"),icon:c().createElement(co.Z,null),tooltip:P?null:C().text("You don't have permissions to delete"),onClick:()=>h({attributeType:n,attributeValue:a,crosswalks:[l]}),id:"delete"}],F=()=>{M(),v()};return c().createElement("div",{ref:w,className:S()(t,L.root),onMouseEnter:()=>{j(),y()},onMouseLeave:()=>{M(),E()},"data-reltio-id":r},c().createElement("div",{className:L.attributeValue},c().createElement(br.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:L.actions},D&&c().createElement(So,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!k}),R&&c().createElement(Oo,{isIgnored:a.ignored,onClick:()=>d({attributeValue:a}),disabled:!k}),b&&c().createElement(Er.Z,{MenuItemRenderer:_o,menuId:`simple-attribute-additional-actions-${O}`,buttonComponent:De.k,buttonProps:{icon:po.Z,size:"XS",tooltipTitle:C().text("More actions")},onMenuClose:F,menuItems:V})),f&&c().createElement(yo,{attributeType:n,attributeValue:a,color:_,onClose:F,onEdit:e=>p({attributeType:n,attributeValue:e,crosswalk:l}),containerRef:w}))},Mo=(0,D.Z)((()=>({simpleAttributesWrapper:{display:"flex",flexWrap:"wrap",gap:"4px",width:"100%",minHeight:"28px"},dropIndicator:{height:"28px",color:"#828282",fontSize:"13px",lineHeight:"28px",background:"rgba(0, 0, 0, 0.04)",border:"1px dashed #828282",borderRadius:"4px",boxSizing:"border-box",padding:"0 12px"}})));function Lo(){return Lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lo.apply(this,arguments)}const Vo=e=>{let{attributeValues:t,attributeType:r,parentUri:n,disableEdit:a,crosswalksMap:l,onAdd:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","attributeType","parentUri","disableEdit","crosswalksMap","onAdd"]);const s=Mo(),[{isDragItemOver:d},p]=(0,ta.useDrop)({accept:"Crosswalk",canDrop:e=>{let{crosswalk:t}=e;const n=(0,u.bC9)(t.uri)||"relation"===t.ownerType,l=(0,u.WgC)(t.uri)&&"entity"===t.ownerType;return(0,u.d89)(u.fO_.EDITING,r)&&!a&&(n&&(0,u.$NE)(r.uri)||l&&(0,u.EdS)(r.uri))},collect:e=>({isDragItemOver:e.isOver()&&e.canDrop()}),drop:(e,a)=>{let{crosswalk:l}=e;o({attributeType:r,crosswalk:l,parentUri:n,index:t.length})}});let m=0;return c().createElement("div",{ref:p,className:s.simpleAttributesWrapper},t.map((e=>{var t;return null===(t=l[e.uri])||void 0===t?void 0:t.map((t=>c().createElement(jo,Lo({key:e.uri+t.uri,attributeType:r,attributeValue:e,crosswalk:t,disableEdit:a,dataReltioId:"value-index-"+m++},i))))})),d&&c().createElement("div",{className:s.dropIndicator},C().text("Drop here")))};var Fo=r(77277);function Bo(){return Bo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bo.apply(this,arguments)}const Uo=e=>{let{className:t,attributeValues:r,attributeType:n,onAdd:a,parentUri:l,disableEdit:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues","attributeType","onAdd","parentUri","disableEdit"]);const s=!o&&(0,u.d89)(u.fO_.EDITING,n);return 0===r.length&&s?c().createElement(Fo.Z,{variant:"text",color:"primary",onClick:()=>a({parentUri:l,attributeType:n,index:0})},C().text("Create attribute")):c().createElement("div",{className:t},r.map((e=>c().createElement(fi,Bo({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:o},i)))))},Ho=e=>{let{children:t}=e;const r=to();return c().createElement(N.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},zo=(0,D.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));function Wo(){return Wo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wo.apply(this,arguments)}const Go=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=zo(),l=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),o=(0,At.useSelector)(Zt.ZP.selectors.getUIPath),i=c().createElement(Ho,null,c().createElement("a",{href:(0,u.ChB)({uiPath:o,uri:(0,u.bwT)(t)}),className:a.label},(0,u.idV)(t.label),t.relationshipLabel&&c().createElement("span",{className:a.relationshipLabel},t.relationshipLabel))),s=(0,I.pipe)(u.tF$,(0,I.map)((e=>(0,u.zeJ)(l,e))),(0,I.reject)(I.isNil))(r);return c().createElement(hi,Wo({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},n))};function qo(){return qo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qo.apply(this,arguments)}const Ko=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(Go,qo({key:e.uri,attributeValue:e},n)))))};var Yo=r(26729);const $o=(0,D.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function Xo(){return Xo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xo.apply(this,arguments)}const Qo={imageWidth:55,imageHeight:45},Jo=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=$o();return c().createElement(hi,Xo({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(Yo.Z,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Qo})},n))};function ei(){return ei=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ei.apply(this,arguments)}const ti=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(Jo,ei({key:e.uri,attributeValue:e},n)))))},ri=(0,D.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));function ni(){return ni=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ni.apply(this,arguments)}function ai(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const li=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:l}=e,o=ai(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=ri(),[d,p]=(0,s.useState)(a),m=(0,I.propOr)(r.length,"totalValues",n),h=a<m,g=h&&d<m,f=h&&d>=m,b=r.slice(0,d),y=m-d;return c().createElement("div",{className:i.wrapper},(e=>{switch(t.type){case u.oS0.TYPE_NESTED:return c().createElement(Uo,ni({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=o,n=ai(o,["crosswalksMap"]);return c().createElement(Ko,ni({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(ti,ni({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));default:return c().createElement(Vo,ni({attributeValues:e,attributeType:t},o))}})(b),g&&c().createElement(io.Z,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&l(),p(d+a)}}),f&&c().createElement(so.Z,{onClick:()=>{p(a)}}))},oi=(0,D.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function ii(){return ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ii.apply(this,arguments)}const si=e=>{let{attributeTypes:t,attributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeTypes","attributes"]);const a=oi();return c().createElement(c().Fragment,null,t.filter(u.Uty).map((e=>c().createElement(g.Z,{key:e.uri,enabled:!0},c().createElement(Dl.Z,{className:a.title,label:e.label,attributeType:e}),c().createElement(li,ii({attributeType:e,attributeValues:r[e.name],paging:(0,I.path)(["paging",e.uri],r)},n))))))},ci=e=>{let{onClick:t}=e;return c().createElement(De.k,{icon:co.Z,tooltipTitle:C().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},ui=(0,s.createContext)(null),di=e=>{let{children:t,attributeUris:r}=e;return c().createElement(ui.Provider,{value:r},t)},pi=e=>((0,s.useContext)(ui)||[]).some((t=>(0,u.sOy)(t,e))),mi=(0,D.Z)((()=>({root:{display:"flex",minHeight:"20px"},actions:{display:"flex",width:"65px",justifyContent:"flex-end",flexShrink:0,alignSelf:"center"},crosswalkIcon:{display:"inline-block",verticalAlign:"middle","& + &":{marginLeft:"4px"}}}))),hi=e=>{let{attributeType:t,attributeValue:r,attributeTypesList:n,label:a,crosswalksMap:l,disableEdit:o,disableDelete:i,onPin:d,onIgnore:p,onDelete:m,onEdit:h,onAdd:g}=e;const f=mi(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:E}=Gl(),v=!o&&(0,u.Z5t)(u.fO_.EDITING,t),x=!i&&(0,u.Edd)(u.fO_.EDITING,t),w=(0,u.ZiX)(r.uri),O=!w&&(!b&&v||r.pin),T=!w&&(!b&&v||r.ignored),C=!b&&x,k=pi(r.uri),[S,P]=(0,s.useState)(k||w);(0,gt.D)((()=>{k&&P(k)}),[k]);const N=(0,I.pipe)((0,I.pickBy)(((e,t)=>(0,u.sOy)(t,null==r?void 0:r.uri))),I.values,I.flatten,(0,I.uniqBy)((0,I.prop)("uri")))(l);return c().createElement(c().Fragment,null,c().createElement("div",{className:f.root,onMouseEnter:y,onMouseLeave:E},c().createElement(cn.Z,{onClick:()=>P((e=>!e)),expanded:S}),c().createElement("span",null,a,N.map((e=>c().createElement(oo,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(Nl.Z,null),c().createElement("div",{className:f.actions},O&&c().createElement(So,{disabled:!v,isPinned:r.pin,onClick:()=>d({attributeValue:r})}),T&&c().createElement(Oo,{disabled:!v,isIgnored:r.ignored,onClick:()=>p({attributeValue:r})}),C&&c().createElement(ci,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:l[r.uri]})}))),S&&c().createElement(si,{attributeTypes:n,attributes:r.value,parentUri:r.uri,crosswalksMap:l,disableEdit:!v,disableDelete:!x,onPin:d,onIgnore:p,onDelete:m,onEdit:h,onAdd:g}))};function gi(){return gi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gi.apply(this,arguments)}const fi=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=c().createElement(Ho,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(hi,gi({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var bi=r(33286),yi=r(22118),Ei=r(8629),vi=r(49429),xi=r(38724),wi=r(55999);const Oi=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(Ei.Z,{open:t},c().createElement(xi.Z,null,c().createElement(wi.Z,null,C().text("Are you sure you want to delete this?"))),c().createElement(vi.Z,null,c().createElement(Fo.Z,{onClick:r,color:"primary"},C().text("No")),c().createElement(Fo.Z,{onClick:()=>{n(),r()},color:"primary"},C().text("Yes"))))};var Ti=r(92332);const Ci=(0,D.Z)((e=>({coloredCell:{"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.06)",pointerEvents:"none"}},headCell:{display:"flex",alignItems:"center",fontSize:"12px",height:"100%",color:e.palette.text.secondary},rowCell:{fontSize:"13px",overflow:"hidden"},cellValueWrapper:{padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"}},attributeTitle:{display:"block",marginLeft:"3px","&:not(:last-child)":{marginBottom:"5px"}},ovValue:{"& + &":{marginTop:"4px"}},count:{textAlign:"center"},ruleType:{display:"flex",alignItems:"center"},ruleTypeLabel:{marginRight:"5px"},rulePopup:{width:"270px",overflowY:"hidden"},popupItem:{paddingBottom:"5px",paddingTop:"5px"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},closeButton:{height:24,width:24},popupTitle:{fontWeight:500,marginLeft:"12px"},popupTitleWrapper:{display:"flex",paddingLeft:16,paddingTop:16},popupItemsWrapper:{overflowY:"auto",maxHeight:"280px"},winnerSourceItemWrapper:{paddingBottom:"2px",paddingTop:"2px"},winnerSourceItem:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"8px"},winnerSourceItemLabel:{fontSize:13}}))),Ii=e=>{const t=Ci();return c().createElement("div",{className:S()(t.headCell,t.coloredCell)},c().createElement(Ti.default,e),e.children)},ki=(0,D.Z)({root:{marginBottom:"-6px"}}),Si=(0,de.Z)((0,I.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:l}=e;const o=ki(),i=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),s=[...i.entityTypes,...i.relationTypes||[]].find((0,I.propEq)("uri",t)),d=e=>!(null!=n&&n.find((0,I.propEq)("uri",e.uri))),p=(0,I.pipe)((0,I.propOr)([],"attributes"),(0,I.reject)((0,I.either)(u.YkG,u.Or$)),(0,I.filter)((0,I.either)(u.QZu,d)),(0,I.filter)((0,I.both)(u.Uty,(e=>(0,u.Vg3)({attributeType:e,mode:u.fO_.EDITING})))))(s);return c().createElement("div",{className:o.root},c().createElement(E.Z,{label:C().text("Attribute"),popupTitle:C().text("Add attributes"),data:p,onApply:e=>{const t=e.filter(d);t.length>0&&a([...t,...n]),e.filter(u.QZu).forEach((e=>{l({attributeType:e,parentUri:r})}))}}))}));const Pi=(0,de.Z)((0,I.pick)(["readOnly"]))((e=>{let{readOnly:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readOnly"]);return t?c().createElement(Ii,r):c().createElement(Ii,r,c().createElement(Nl.Z,null),c().createElement(Si,null))})),Ni=e=>{let{value:t}=e;const r=Ci();return c().createElement("div",{className:r.cellValueWrapper},t)},Di=(0,D.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function Ri(){return Ri=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ri.apply(this,arguments)}const _i=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Di();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(li,Ri({attributeValues:t},r)))};function Ai(){return Ai=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ai.apply(this,arguments)}const Zi=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Di(),a=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(fi,Ai({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function ji(){return ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ji.apply(this,arguments)}const Mi=e=>{let{attributeValues:t,crosswalksMap:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","crosswalksMap"]);const a=Di(),l=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:a.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(Go,ji({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,l)};function Li(){return Li=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Li.apply(this,arguments)}const Vi=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Di();return c().createElement(c().Fragment,null,null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(Jo,Li({attributeValue:e},r))))))};function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bi=(0,de.Z)((0,I.pick)(["onDelete","onPin","onIgnore","onEdit","onAdd","parentUri","readOnly"]))((e=>{let{value:t,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,parentUri:i,readOnly:s}=e;return class{static build(e,t){switch(e){case u.oS0.TYPE_NESTED:return c().createElement(Zi,t);case u.oS0.TYPE_REFERENCE:return c().createElement(Mi,t);case u.oS0.TYPE_IMAGE:return c().createElement(Vi,t);default:return c().createElement(_i,t)}}}.build(t.attributeType.type,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){Fi(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,disableEdit:s,disableDelete:s}))})),Ui=e=>{let{value:{values:t,attributeType:r}}=e;const n=Ci();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(Dl.Z,{className:n.attributeTitle,label:r.label,attributeType:r}),c().createElement(te,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},Hi=e=>{let{value:t}=e;const r=Ci();return c().createElement("div",{className:S()(r.cellValueWrapper,r.count)},t)};var zi=r(11776),Wi=r(38402),Gi=r(49378),qi=r(99144);const Ki=e=>{let{sourcesUriOrder:t}=e;const r=Ci(),n=(0,At.useSelector)(Zt.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Wi.Z,{key:e,className:r.popupItem},c().createElement(Pl.Z,{className:r.sourceIcon,sourceType:e}),c().createElement(Gi.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Yi=e=>{let{attributeUri:t}=e;const r=Ci(),n=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Wi.Z,{key:a.uri,className:r.popupItem},c().createElement(Gi.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},$i=(0,I.cond)([[(0,I.prop)("sourcesUriOrder"),()=>C().text("Source sequence")],[(0,I.prop)("primaryAttributeUri"),()=>C().text("Attribute winner")],[(0,I.prop)("comparisonAttributeUri"),()=>C().text("Comparison attribute")]]),Xi=(0,I.cond)([[(0,I.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(Ki,{sourcesUriOrder:t})}],[(0,I.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Yi,{attributeUri:t})}],[(0,I.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Yi,{attributeUri:t})}]]),Qi=e=>{let{info:t}=e;const r=Ci(),[n,a]=(0,s.useState)(null),l=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(De.k,{icon:qi.Z,tooltipTitle:C().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(mo.ZP,{classes:{paper:r.rulePopup},open:!!n,anchorEl:n,onClose:l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:r.popupTitleWrapper},c().createElement(Ue.Z,{className:r.closeButton,onClick:l},c().createElement(He.default,null)),c().createElement(N.Z,{variant:"subtitle1",className:r.popupTitle},$i(t))),c().createElement(zi.Z,{component:"div",className:r.popupItemsWrapper},Xi(t))))},Ji=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const l=Ci(),o=r||n||a;return c().createElement("div",{className:S()(l.cellValueWrapper,l.ruleType)},c().createElement("div",{className:l.ruleTypeLabel},t.label),o&&c().createElement(Qi,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function es(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ts=(0,D.Z)({item:e=>{let{color:t,opacity:r,variant: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){es(e,t,r[t])}))}return e}({},"filled"===n&&{backgroundColor:t},"outlined"===n&&{border:`${t} solid 2px`},{opacity:r,transition:"opacity 0.3s",boxSizing:"border-box"})}});function rs(){return rs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rs.apply(this,arguments)}const ns=(0,s.forwardRef)(((e,t)=>{let{color:r,opacity:n,variant:a="filled",children:l,className:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["color","opacity","variant","children","className"]);const s=ts({color:r,opacity:n,variant:a});return c().createElement("div",rs({ref:t,className:S()(s.item,o)},i),l)})),as=e=>{let{crosswalk:t}=e;const r=Ci(),n=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Xl(t);return c().createElement(ns,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>l(),onMouseLeave:()=>o()},c().createElement(Pl.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(Gi.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},ls=e=>{let{value:{crosswalks:t}}=e;const r=Ci();return c().createElement(zi.Z,{component:"div"},t.map((e=>c().createElement(Wi.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(as,{crosswalk:e})))))},os=[{id:"ovValues",get label(){return C().text("Attributes & OV")},hideable:!1,initialWidth:360,minWidth:250},{id:"winnerSources",get label(){return C().text("Winner source systems")},initialWidth:220},{id:"ruleType",get label(){return C().text("Rule type")},initialWidth:200},{id:"count",get label(){return C().text("Count")},initialWidth:80,minWidth:80},{id:"values",get label(){return C().text("Attribute values")},hideable:!1}],is=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),ss=["ovValues","ruleType","values"],cs=e=>{switch(e){case"ovValues":return Ui;case"values":return Bi;case"count":return Hi;case"ruleType":return Ji;case"winnerSources":return ls;default:return Ni}},us=(0,I.pipe)(u.cwx,(0,I.sortWith)([(0,I.descend)((0,I.propOr)(-1,"priority"))]),(0,I.map)((0,I.prop)("uri"))),ds=(0,I.curry)(((e,t)=>(0,u.YkG)(e)&&t&&(0,I.pipe)(u.c31,(0,I.find)((r=>r.slice((0,u.u5q)(r).length)===t.slice(e.uri.length))))(e)||t)),ps=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return(0,I.pipe)((0,I.filter)(is),(0,I.chain)((e=>(0,I.pipe)((0,I.pickBy)(((t,r)=>{const n=(0,u.sOy)(r,e.uri),a=n?r.slice(e.uri.length+1):"",l=a&&(0,u.IM5)(e.value,a);return n&&(!l||is(l))})),I.values,I.flatten)(t))),(0,I.uniqBy)((0,I.prop)("uri")))(e)},ms=(0,I.map)((e=>{let{id:t,label:r,initialWidth:n,minWidth:a}=e;return{id:t,label:r,initialWidth:n,minWidth:a,autoResize:!n,resizable:!0,sortable:!1,headCellRenderer:"ovValues"===t?Pi:Ii,rowCellValueRenderer:cs(t)}})),hs=(e,t,r,n,a,l)=>{switch(e){case"ovValues":return{attributeType:n,values:null==l?void 0:l.filter(is)};case"values":return{attributeType:n,attributeValues:l,crosswalksMap:a};case"count":return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;switch(e){case u.oS0.TYPE_REFERENCE:case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return t.length;default:return t.reduce(((e,t)=>e+r[t.uri].length),0)}}(n.type,l,a);case"ruleType":return((e,t,r)=>{var n,a;const l=[...e.entityTypes,...e.relationTypes||[]].find((0,I.propEq)("uri",r)),o=null==l||null===(n=l.survivorshipGroups)||void 0===n?void 0:n.find((0,I.propEq)("default",!0)),i=null==o||null===(a=o.mapping)||void 0===a?void 0:a.find((0,I.propEq)("attribute",t.uri)),s=(0,u.o_J)(e,null==i?void 0:i.survivorshipStrategy)||(0,u.Xaq)(e),c=(e=>"configuration/survivorshipStrategies/SRC_SYS"===(null==e?void 0:e.uri))(s)?(0,I.uniq)([...(null==i?void 0:i.sourcesUriOrder)||[],...(null==o?void 0:o.sourcesUriOrder)||[],...us(e)]):void 0,d=ds(t),p=(e=>"configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk"===(null==e?void 0:e.uri))(s)?d(null==i?void 0:i.primaryAttributeUri):void 0,m=(0,u.YkM)(t)&&(e=>"configuration/survivorshipStrategies/MinValue"===(null==e?void 0:e.uri)||"configuration/survivorshipStrategies/MaxValue"===(null==e?void 0:e.uri))(s)?d(null==i?void 0:i.comparisonAttributeUri):void 0;return{ruleType:s,sourcesUriOrder:c,primaryAttributeUri:p,comparisonAttributeUri:m}})(t,n,r);case"winnerSources":return{crosswalks:ps(l,a)};default:return null}};function gs(){return gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gs.apply(this,arguments)}const fs=e=>{let{cell:t,CellValueRenderer:r,columnIndex:n,columnData:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["cell","CellValueRenderer","columnIndex","columnData"]);const o=Ci(),i=0===n;return c().createElement("div",{className:S()(o.rowCell,i&&o.coloredCell),"data-reltio-id":`column-name-${a.id}`},t.values.map(((e,t)=>c().createElement(r,gs({key:t,value:e},l)))))};var bs=r(44962),ys=r(2682),Es=r(5806),vs=r(42494),xs=r(84899);const ws=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[l,o]=(0,s.useState)("without");return c().createElement(Ei.Z,{open:t,onEnter:()=>o("without")},c().createElement(xi.Z,null,c().createElement(wi.Z,null,C().text("You are attempting to change a value that is presently ignored.")),c().createElement(vs.Z,{component:"fieldset"},c().createElement(xs.Z,{component:"legend"},C().text("Please choose an option:")),c().createElement(ys.Z,{value:l,onChange:(0,I.pipe)(tt.NA,o)},c().createElement(Es.Z,{value:"without",control:c().createElement(bs.Z,null),label:C().text("Save without Ignore")}),c().createElement(Es.Z,{value:"with",control:c().createElement(bs.Z,null),label:C().text("Save and apply Ignore to new value")})))),c().createElement(vi.Z,null,c().createElement(Fo.Z,{onClick:r,color:"primary"},C().text("Cancel")),c().createElement(Fo.Z,{onClick:()=>{"with"===l?a():n(),r()},color:"primary"},C().text("Ok"))))},Os=(0,D.Z)({tableContainer:{height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"},tableHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between"},tableContent:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",position:"relative"}});function Ts(){return Ts=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ts.apply(this,arguments)}const Cs=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=ss,onChangeVisibleColumns:l,readOnly:o,onDelete:i=tt.ZT,onPin:d=tt.ZT,onIgnore:p=tt.ZT,onEdit:m=tt.ZT,onAdd:h=tt.ZT,selectedAttributeTypes:g,onSelectAttributeTypes:f=tt.ZT}=e;const b=Os(),y=(0,s.useMemo)((()=>(0,I.pipe)((0,I.filter)((e=>{let{id:t}=e;return a.includes(t)})),ms)(os)),[a]),{type:E,uri:v,attributes:x={}}=t||{},w=(0,At.useSelector)(Zt.ZP.selectors.getMetadata);(0,s.useEffect)((()=>{if(t&&(0,I.isNil)(g)){const e=(0,I.pipe)(I.keys,(0,I.without)(["paging"]),(0,I.map)((0,u.tCm)(E)),(0,I.map)((e=>(0,u.zeJ)(w,e,E))),(0,I.filter)(u.Uty))(x);f(e)}}),[t,g]);const O=(0,s.useMemo)((()=>E?function(e,t){let r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).map((l=>{const o=(0,u.nIW)(l.uri),i=a[o],s=(0,u.YkG)(l)?n.relation:n.entity;return(0,I.pipe)((0,I.reduce)(((r,n)=>(0,I.assoc)(n,hs(n,e,t,l,s,i),r)),{}),(0,I.assoc)("rawValue",i))(r)}))}(w,E,g,a,n,x):[]),[w,E,g,a,x,n]),{getDynamicRowCellHeight:T,changeRowCellHeight:k}=xt(),S=(0,s.useCallback)((e=>c().createElement(bt,Ts({onChangeHeight:k},e),c().createElement(fs,e))),[k]),P=(0,s.useCallback)((0,I.either)(T,(0,I.always)(68)),[T]),[N,D]=(0,s.useState)(null),[R,_]=(0,s.useState)(null),A=(0,s.useCallback)((e=>{e.attributeValue.ignored?_(e):m(e)}),[m,_]),Z=(0,s.useMemo)((()=>({onDelete:D,onPin:d,onIgnore:p,onEdit:A,onAdd:h,parentUri:v,parentTypeUri:E,selectedAttributeTypes:g,onSelectAttributeTypes:f,readOnly:o})),[D,d,p,A,h,v,E,g,f,o]);return c().createElement("div",{className:b.tableContainer},c().createElement(Kt.Z,{classes:{root:b.tableHeader},title:C().text("Sources")},c().createElement(Be,{columnsData:os,selectedColumns:a,onChangeColumns:l})),c().createElement("div",{className:b.tableContent},r&&c().createElement(Jr.Z,null),c().createElement(ue.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:y,rowsData:O,renderRowCell:S,getRowCellHeight:P,context:Z})),c().createElement(Oi,{open:!!N,onClose:()=>D(null),onConfirm:()=>i(N)}),c().createElement(ws,{open:!!R,onClose:()=>_(null),onConfirmEditWithIgnore:()=>m(R),onConfirmEditWithoutIgnore:()=>{p({attributeValue:R.attributeValue}),m(R)}}))}));function Is(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ks(e,t,r[t])}))}return e}function ks(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ss=[],Ps=e=>{let{entity:t,onLoad:r=tt.ZT,onModify:n=tt.ZT,onError:a=tt.ZT}=e;const[l,o]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),d=(0,s.useRef)([]),p=(0,s.useRef)(null),m=(0,s.useCallback)((()=>{p.current=null}),[]),[h,g]=(0,s.useState)(Ss),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>((0,u.sJj)(t).forEach((r=>{e[r]=[...e[r]||[],t]})),e)),{})};(0,s.useEffect)((()=>{const e={entity:f(null==t?void 0:t.crosswalks),relation:(0,I.pipe)(u.HQx,f)(t)};if((null==l?void 0:l.uri)===(null==t?void 0:t.uri)&&p.current){const{ownerType:t}=p.current,r=Object.keys(e[t]),n=Object.keys(i[t]);g((0,I.difference)(r,n))}else g(Ss);m(),o(t),c(e),d.current=[]}),[t]);const b=(0,s.useCallback)((0,I.pipe)(a,m),[a,m]),{deleteAttribute:y,ignoreAttribute:E,pinAttribute:v,createAttribute:x,updateAttribute:w}=(e=>{let{onSuccess:t=tt.ZT,onError:r=tt.ZT,onLoad:n=tt.ZT}=e;const a=(0,s.useCallback)((e=>{n(),e.then((()=>{t()})).catch(r)}),[r,t,n]),l=(0,s.useCallback)((e=>e.then((e=>{if("error"in e)throw e.error;return e}))),[]);return{deleteAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalks:n}=e;const o=(0,u.YkG)(r)?(0,I.pipe)(u.o96,(0,I.prop)("objectURI"),u.VGk,l)(t):Promise.all((n||[]).map((e=>{let{type:r,value:n,sourceTable:a}=e;return l((0,u.xZs)({attributeUri:t.uri,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:a}))})));a(o)}),[a,l]),pinAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,I.pipe)(u.xkv,l,a)({attributeUri:t.uri,value:!t.pin})}),[a,l]),ignoreAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,I.pipe)(u.P8_,l,a)({attributeUri:t.uri,value:!t.ignored})}),[a,l]),updateAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalk:n}=e;(0,u.YkM)(r)||(0,u.Or$)(r)||(0,I.pipe)(u.tCj,l,a)({attributeUri:t.uri,sourceUri:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,value:(0,u.CwH)(r)?t.lookupCode:t.value})}),[a,l]),createAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,crosswalk:r}=e;(0,I.pipe)(u.JV_,(0,I.andThen)((e=>{let[{errors:t}]=e;if(t)throw t})),a)({attributeUri:t.uri,sourceUri:r.type,crosswalkValue:r.value,crosswalkSourceTable:r.sourceTable,value:t.value})}),[a])}})({onLoad:r,onSuccess:n,onError:b}),O=(0,s.useCallback)((e=>{let{attributeType:t,parentUri:r,crosswalk:n,index:a}=e;const l=(0,u.gjI)({parentUri:r,attributeType:t}),{uri:i}=l;if(n){const{ownerType:e}=n;c((t=>Is({},t,{[e]:Is({},t[e],{[i]:[n]})})))}o((e=>{var n;return(0,I.isNil)(a)&&(a=null===(n=(0,u.JQy)(e,r,t.name))||void 0===n?void 0:n.length),(0,u.wLZ)({entity:e,attributeType:t,newAttribute:l,index:a})})),d.current.some((e=>(0,u.sOy)(i,e)))||d.current.push(i)}),[]),T=(0,s.useCallback)((e=>{const{attributeValue:{uri:t},attributeType:r}=e;(0,u.ZiX)(t)?(o((e=>(0,u.d$I)({entity:e,attributeType:r,uri:t}))),c((0,I.evolve)({entity:(0,I.dissoc)(t),relation:(0,I.dissoc)(t)})),d.current=(0,I.without)([t],d.current)):y(e)}),[y]),C=(0,s.useCallback)((e=>{if((0,u.ZiX)(e.attributeValue.uri)){const{attributeValue:t,attributeType:r,crosswalk:n}=e;if(!(0,I.isNil)(t.value)){const{uri:e}=t,a=d.current.find((t=>(0,u.sOy)(e,t))),o=(0,u.ww$)({entity:l,attributeType:r,uri:e,value:(0,u.kDl)(t)});x({attributeValue:(0,u.dLR)(o,a),crosswalk:n}),p.current=n}}else w(e)}),[x,w,l]);return{modifiedEntity:l,crosswalksMap:i,onAddAttribute:O,onDeleteAttribute:T,onPinAttribute:v,onIgnoreAttribute:E,onEditAttribute:C,newlyCreatedAttributes:h}},Ns=e=>{let{onLoad:t=tt.ZT,onSuccess:r=tt.ZT,onError:n=tt.ZT}=e;const a=(0,s.useCallback)((e=>{t(),e.then((e=>{let{errors:t}=e;if(t)throw t;r()})).catch(n)}),[t,n,r]);return{addCrosswalk:(0,s.useCallback)((e=>{let{entity:t,contributorCrosswalk:r,crosswalk:n}=e;const l=r?(0,u.psB)({entityTypeUri:t.type,contributorCrosswalkType:r.type,contributorCrosswalkValue:r.value,contributorCrosswalkSourceTable:r.sourceTable,crosswalkType:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,crosswalkDeleteDate:n.deleteDate}):(0,u.kRE)({entityUri:t.uri,crosswalk:n});(0,I.pipe)((0,I.andThen)((e=>{let[t]=e;return t})),a)(l)}),[a]),editCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:l}=e;(0,I.pipe)((0,I.ifElse)((e=>{let{value:t}=e;return(0,I.isNil)(t)}),u.K$w,u.WVU),(0,I.andThen)((e=>{let[t]=e;return t})),a)({entityUri:t,crosswalkId:r,attributeName:n,value:l})}),[a]),deleteCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r}=e;(0,I.pipe)(u.Gmt,a)({entityUri:t,crosswalkId:r})}),[a])}},Ds=(0,D.Z)({dragLayer:{position:"fixed",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",zIndex:1300,pointerEvents:"none"},crosswalkPreview:{height:"28px",maxWidth:"394px",display:"flex",overflow:"hidden",padding:"6px",alignItems:"center",boxSizing:"border-box"},sourceLabel:{fontSize:"13px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},sourceIcon:{width:"16px",height:"16px",marginRight:"9px"}}),Rs=e=>{let{crosswalk:t}=e;const r=Ds(),n=Yl(t),a=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),l=(0,u.tH7)(a,t.type);return c().createElement(ns,{color:n,className:r.crosswalkPreview},c().createElement(Pl.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(N.Z,{className:r.sourceLabel,variant:"body2"},l))},_s=(0,s.memo)((()=>{var e;const t=Ds(),{isDragging:r,clientOffset:n,item:a}=(0,ta.useDragLayer)((e=>({isDragging:e.isDragging(),clientOffset:e.getClientOffset(),item:e.getItem()}))),l=(0,s.useRef)(),o=(null===(e=l.current)||void 0===e?void 0:e.getBoundingClientRect())||{x:0,y:0},i=`translate(${(null==n?void 0:n.x)-(null==o?void 0:o.x)}px, ${(null==n?void 0:n.y)-(null==o?void 0:o.y)}px`;return r&&c().createElement("div",{ref:l,className:t.dragLayer},c().createElement("div",{style:{display:"flex",transform:i,WebkitTransform:i}},"Crosswalk"===a.type&&c().createElement(Rs,{crosswalk:a.crosswalk})))}));let As;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(As||(As={}));const Zs=(0,D.Z)((()=>({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.38,transition:"opacity 0.3s"}},wrapper:{width:"100%",display:"flex",alignItems:"center",height:28,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDcvMjYvMTMEw7WpAAAAeElEQVQ4ja3VuwrAIBBE0aup0uX/v9ImCCGSdIL4WF136+EwxcC6+3k/hAsxSREArvPAW2LAGFzFhqAG64JarAnuYBW4ixWgBZZBKwzAW2Ig7HAVCzHJ4AoGQsNVbAhqsC6oxZrgDlaBu1gBWmAZtMIA3MwLmMUAfmyqQ9/LD+oDAAAAAElFTkSuQmCC)"},focusedIcon:{width:28,height:28,backgroundColor:"rgba(0, 0, 0, 0.12)",borderRadius:0,borderRight:"1px solid #fff"},sourceIcon:{height:"16px",width:"16px",marginLeft:"16px",marginRight:"9px",fontSize:"14px"}}))),js=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Xl(),a=Zs({isOpaque:!n}),l=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),o=(0,u.tH7)(l,t);return c().createElement("div",{className:a.root},c().createElement(Sl.Z,{size:"XXS",className:a.focusedIcon,icon:r&&Jl.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(Pl.Z,{className:a.sourceIcon,sourceType:t}),c().createElement(N.Z,{variant:"body2"},o)))}));var Ms=r(19540),Ls=r(42484);function Vs(){return Vs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vs.apply(this,arguments)}const Fs=e=>c().createElement("svg",Vs({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"Copy_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Copy_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Copy_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#Copy_svg__b)",d:"M0 0h24v24H0z"}))),Bs=(0,D.Z)((()=>({root:{display:"flex",justifyContent:"space-between",alignItems:"center",overflowWrap:"anywhere"},text:{fontSize:13},button:{flexShrink:0,marginLeft:8,padding:0,textTransform:"none"}}))),Us=e=>{let{value:t}=e;const r=Bs();return c().createElement("div",{className:r.root},c().createElement(N.Z,{className:r.text,variant:"body2"},t),c().createElement(Sl.Z,{size:"XXS",icon:Fs,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},Hs=(0,D.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),zs=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const l=Hs(),[o,i]=(0,s.useState)(!1),u=e=>a(e.valueOf());return c().createElement(Sr.Z,{variant:"filled",value:t?new Date(t):null,disabled:n,onChange:(0,I.unless)((0,I.always)(o),u),onAccept:u,onOpen:()=>i(!0),onClose:()=>i(!1),InputProps:{disableUnderline:!0,classes:{input:l.timestampEditorInput,root:S()(l.timestampEditor,r.root)}}})};var Ws=r(95038),Gs=r.n(Ws);const qs=(0,D.Z)((e=>({text:{fontSize:13},attributeWrapper:{display:"flex",alignItems:"center",paddingTop:5,paddingBottom:5,marginLeft:12},attributeTitle:{fontSize:13,width:135,color:e.palette.text.secondary},attributeValue:{paddingLeft:10,display:"flex",alignItems:"center",flexGrow:1},input:{paddingTop:14,paddingBottom:14,fontSize:13},editor:{flexGrow:1},moreButton:{marginLeft:24},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"}}))),Ks=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const l=qs(),o=!("uri"in t),i=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),[d,p]=(0,s.useState)([]),[m,h]=(0,s.useState)(null),g=(0,s.useMemo)((()=>[{label:u.G39.sourceSystems.label,uri:"type"},{label:u.G39.value.label,uri:"value"},{label:u.G39.sourceTable.label,uri:"sourceTable",canBeAdded:o,canBeDeleted:o},{label:u.G39.createDate.label,uri:"createDate"},{label:u.G39.updateDate.label,uri:"updateDate"},{label:u.G39.deleteDate.label,uri:"deleteDate",canBeAdded:!0,canBeDeleted:!0},{label:u.G39.reltioLoadDate.label,uri:"reltioLoadDate"},{label:u.G39.publishDate.label,uri:"sourcePublishDate"}]),[]),f=(0,I.pipe)((0,I.filter)((0,I.propEq)("canBeAdded",!0)),(0,I.filter)((e=>!(0,I.has)(e.uri,t))),(0,I.filter)((e=>!d.includes(e.uri))))(g);return c().createElement(c().Fragment,null,f.length>0&&r&&c().createElement(E.Z,{label:C().text("Add attributes"),onApply:e=>{e.length>0&&p((t=>t.concat((0,I.map)((0,I.prop)("uri"),e))))},data:f}),g.map((e=>e.uri in t||d.includes(e.uri)?c().createElement("div",{key:e.uri,className:l.attributeWrapper},c().createElement(N.Z,{variant:"body2",className:l.attributeTitle},`${e.label}:`),c().createElement("div",{className:l.attributeValue},((e,t)=>{switch(e){case"type":{const r=(0,u.tH7)(i,t);return o?c().createElement(kl.Z,{label:"",placeholder:t,className:l.editor,value:{value:t,label:r},options:(0,u.cwx)(i).sort((0,I.ascend)((0,I.prop)("label"))).map((e=>{let{uri:t,label:r}=e;return{value:t,label:r}})),onChange:t=>{let{value:r}=t;return n(e,r)},TextFieldProps:{InputProps:{disableUnderline:!0}}}):c().createElement(c().Fragment,null,c().createElement(Pl.Z,{className:l.sourceIcon,sourceType:t}),c().createElement(N.Z,{className:l.text,variant:"body2"},r))}case"sourceTable":return o?c().createElement(xr.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:l.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:l.input}}}):c().createElement(N.Z,{className:l.text,variant:"body2"},t);case"value":return o?c().createElement(xr.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:l.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:l.input}}}):c().createElement(Us,{value:t});case"deleteDate":return c().createElement(zs,{value:t&&Gs().utc((0,u.ZBU)(t)).valueOf(),onChange:t=>n(e,t.toString()),classes:{root:l.editor},disabled:!r});case"sourcePublishDate":case"createDate":case"updateDate":case"reltioLoadDate":return c().createElement(N.Z,{className:l.text,variant:"body2"},(0,u.o0x)(t));default:return null}})(e.uri,t[e.uri]),e.canBeDeleted&&c().createElement(De.k,{icon:co.Z,disabled:!r,onClick:()=>h(e.uri),size:"XS",tooltipTitle:C().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(Oi,{open:!!m,onClose:()=>h(null),onConfirm:()=>{return e=m,p((t=>(0,I.without)([e],t))),void((0,I.isNil)(t[e])||a(e));var e}}))},Ys=(0,D.Z)({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.19,transition:"opacity 0.3s"}},header:{width:"100%",display:"flex",alignItems:"center",height:"28px"},focusedIcon:e=>{let{isFocused:t}=e;return{width:"26px","&:not([disabled])":{border:"1px solid rgba(0, 0, 0, 0.12)"},height:"28px",color:t?"#000":"rgba(0, 0, 0, 0.54)",borderRadius:0,margin:"0px 1px"}},crosswalkWrapper:{width:"100%",overflow:"hidden"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},attributesWrapper:e=>{let{color:t}=e;return{border:"1px solid",borderColor:t,position:"relative"}},deleteCrosswalkButton:{position:"absolute",top:5,right:5},labelValue:{marginLeft:5,marginRight:8},dependentIcon:{width:"16px",height:"16px",fillOpacity:.38}}),$s=(0,s.memo)((e=>{let{crosswalk:t,isDependent:r,isEmpty:n=!1,isColored:a=!0,focusable:l=!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p}=e;const m=(0,s.useRef)(null),h=Yl(t),{toggleCrosswalkFocus:g,isFocused:f}=Ql(t),b=n?"#FFF":a?h:"#CACCD1",{isDimmed:y,highlightCrosswalk:E,removeHighlight:v}=Xl(t),[x]=$l(),w=Ys({color:b,isOpaque:!y,isFocused:f}),[O,T]=(0,s.useState)(!1),[I,k]=(0,s.useState)(!1),S=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),P=(0,u.tH7)(S,t.type),D=(0,u.nIW)(t.uri),R=(0,u.x_)(t),[,_,Z]=(0,ta.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!R}),j=!R&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{Z((0,Ls.r)(),{captureDraggingState:!0})}),[]),(0,s.useEffect)((()=>{var e;l&&x&&(0,u.aFF)(x,t)&&x!==t&&(null==m||null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[x]),c().createElement("div",{className:w.root,ref:m},c().createElement(De.k,{size:"XXS",className:w.focusedIcon,icon:l&&Jl.Z,onClick:()=>g(),disabled:!l,tooltipTitle:l&&C().text("Focus")}),c().createElement("div",{className:w.crosswalkWrapper},c().createElement(ns,{ref:_,className:w.header,color:b,variant:R?"outlined":"filled",onMouseEnter:()=>E(),onMouseLeave:()=>v()},r&&c().createElement(Ms.Z,{className:w.dependentIcon}),c().createElement(cn.Z,{onClick:()=>T((e=>!e)),expanded:O}),c().createElement(Pl.Z,{className:w.sourceIcon,sourceType:t.type}),c().createElement(A.C,{value:P},c().createElement(N.Z,{variant:"body2",noWrap:!0},P)),c().createElement(Nl.Z,null),c().createElement(A.C,{value:t.value},c().createElement(N.Z,{variant:"body2",className:w.labelValue,noWrap:!0},t.value))),O&&c().createElement("div",{className:w.attributesWrapper},j&&c().createElement("div",{className:w.deleteCrosswalkButton},c().createElement(De.k,{icon:co.Z,disabled:i,onClick:()=>k(!0),size:"XS",tooltipTitle:i?C().text("You don't have permissions to delete"):C().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(Oi,{open:I,onConfirm:()=>{f&&g(),d(D)},onClose:()=>k(!1)})),c().createElement(Ks,{crosswalk:t,canEditAttribute:!o,onEditAttribute:(e,t)=>{p({crosswalkId:D,attributeName:e,value:t})},onDeleteAttribute:e=>{p({crosswalkId:D,attributeName:e})}}))))})),Xs=(0,D.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Qs=e=>{let{showMore:t,onClick:r}=e;const n=Xs();return c().createElement(kt.Z,{className:n.root,component:"button",variant:"caption",underline:"none",onClick:r},c().createElement("span",null,t?C().text("View dependent crosswalks"):C().text("Hide dependent crosswalks")))},Js=e=>{let{source:t,crosswalksByTypes:r,showCrosswalkColors:n=!0,crosswalksFocusEnabled:a=!0,expanded:l,disableEditCrosswalk:o,disableDeleteCrosswalk:i,onEdit:d,onDelete:p,onToggleExpanded:m}=e;const h=$l();return(0,s.useEffect)((()=>{!l&&a&&r[As.Dependent].some((e=>h.some((0,u.aFF)(e))))&&m()}),[h]),c().createElement(c().Fragment,null,0===r[As.Simple].length&&0===r[As.Empty].length&&c().createElement(js,{crosswalkType:t,focusable:a}),r[As.Simple].map((e=>c().createElement($s,{key:e.uri,crosswalk:e,focusable:a,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d,isColored:n}))),r[As.Empty].map((e=>c().createElement($s,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d,isColored:n}))),l&&r[As.Dependent].map((e=>c().createElement($s,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d,focusable:a,isColored:n}))),r[As.Dependent].length>0&&c().createElement(Qs,{showMore:!l,onClick:()=>m()}))},ec=(0,D.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),tc=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=ec(),[l,o]=(0,s.useState)({type:"",value:""});return c().createElement("div",{className:t},c().createElement(N.Z,{variant:"body1",className:a.caption},C().text("Add crosswalk")),c().createElement(Ks,{crosswalk:l,onDeleteAttribute:e=>{o((0,I.dissoc)(e))},onEditAttribute:(e,t)=>{o((0,I.assoc)(e,t))}}),c().createElement("div",{className:a.controlButtons},c().createElement(Fo.Z,{className:a.cancelButton,onClick:n},C().text("Cancel")),c().createElement(Fo.Z,{color:"primary",onClick:()=>{r(l),n()},disabled:!l.type||!l.value},C().text("Add"))))},rc=e=>e[As.Simple].length>0?1:e[As.Dependent].length>0?e[As.Empty].length>0?2:3:4,nc=(0,I.evolve)({[As.Dependent]:(0,I.sort)(((e,t)=>{const r=e.sourceTable||"",n=t.sourceTable||"";return r===n?0:r?n?r<n?-1:1:-1:1}))}),ac=(0,I.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[As.Simple]:[],[As.Empty]:[],[As.Dependent]:[]}),"relation"===n.ownerType?r[n.type][As.Dependent].push(n):((e,t,r)=>0===(0,u.sJj)(r).filter((r=>{const n=(0,u.AFK)(r,e);return t.some((0,I.propEq)("uri",n))})).length)(e,t,n)?r[n.type][As.Empty].push(n):((e,t,r)=>!(0,u.sJj)(r).some((r=>{const n=(0,u.AFK)(r,e),a=t.find((0,I.propEq)("uri",n));return a&&!(0,u.YkM)(a)})))(e,t,n)?r[n.type][As.Dependent].push(n):r[n.type][As.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>rc(n[e])-rc(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:nc(n[e])})))}));var lc=r(62116),oc=r(55401);const ic=e=>{let{entity:t,historyEvent:r}=e;const[n,a]=(0,s.useState)(!1),l=(0,At.useSelector)(Zt.ZP.selectors.getHistorySlice),o=(0,At.useDispatch)(),i=(0,Mt._)(),{aStamp:c,bStamp:d,overrideUri:p}=r||{},m=p||(null==t?void 0:t.uri);return(0,s.useEffect)((()=>{r&&m&&(a(!0),i(Promise.all([(0,u.lrH)(m,c),d&&1!==d?(0,u.lrH)(m,d):Promise.resolve(null)])).then((e=>{let[t,r]=e;o(Zt.N5.history.actions.setHistorySlice({aEntity:t,bEntity:r}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{a(!1)})))}),[c,d,m]),{isLoading:n,historySlice:l}};let sc;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(sc||(sc={}));var cc=r(39034);const uc=e=>(0,I.pipe)((0,I.map)(e),(0,I.join)(" or ")),dc=e=>{const[t,r]=e;return Gs()().subtract(t,r).valueOf()},pc=(0,I.chain)((0,I.cond)([[(0,I.equals)(sc.MERGE),()=>[l.I.ENTITIES_MERGED,l.I.ENTITIES_MERGED_MANUALLY,l.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,I.equals)(sc.UNMERGE),()=>[l.I.ENTITIES_SPLITTED]],[(0,I.equals)(sc.UPDATE),()=>[l.I.ENTITY_CHANGED]]])),mc=(0,I.pipe)((0,I.defaultTo)([]),pc,(0,I.concat)([l.I.ENTITY_CREATED,l.I.ENTITY_REMOVED,l.I.ENTITY_LOST_MERGE]),uc((e=>`equals(type, '${e}')`))),hc=(0,I.pipe)((0,I.defaultTo)({}),(0,I.reject)(u.O27),(0,I.evolve)({users:uc((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:uc((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case cc.K.WITHIN:return`gte(timestamp, ${dc(r)})`;case cc.K.AGO:return`lte(timestamp, ${dc(r)})`;case cc.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${Gs()(t).endOf("date").valueOf()})`}default:return""}}}),(0,I.over)((0,I.lensProp)("activities"),mc),I.values,(0,I.reject)(u.O27),(0,I.append)("not equals(user, 'collaboration-service')"),(0,I.map)((e=>`(${e})`)),(0,I.join)(" and "));function gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 bc={activities:[sc.MERGE,sc.UNMERGE,sc.UPDATE]},yc=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)(bc),[l,o]=(0,s.useState)(0),i=(0,s.useMemo)((()=>hc(n)),[n]),[c,d]=(0,s.useState)(null),[p,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(!1),f=(0,Mt._)(),b=null==t?void 0:t.uri,y={max:32,order:"desc"},E=(0,u.O27)(null==n?void 0:n.attributes)||void 0;(0,s.useEffect)((()=>{b&&r&&(g(!0),f((0,u.kgP)(gc({entityUri:b,historicUris:c,filter:i,showAll:E},y))).then(m).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{g(!1)})))}),[i,E,c]),(0,s.useEffect)((()=>{b&&r&&(g(!0),f((0,u.wdF)({entityUri:b})).then((e=>{d(e)})).catch((e=>{console.warn("Failed to load history data",e),d(null)})).finally((()=>{g(!1)})),o(0))}),[b,null==t?void 0:t.updatedTime,r]);const v=(0,s.useCallback)((e=>{b&&c&&r&&(g(!0),f((0,u.kgP)(gc({entityUri:b,historicUris:c,filter:i,showAll:E,offset:e},y))).then((e=>{m((t=>gc({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{g(!1)})))}),[c,i,r]),x=(0,s.useMemo)((()=>32*(l+1)<(null==p?void 0:p.total)),[p,l]),w=(0,s.useCallback)((e=>{o(0),a(e)}),[]),O=(0,s.useCallback)((()=>{w(gc({},bc))}),[]),T=(0,s.useCallback)((()=>{x&&(v(32*(l+1)),o(l+1))}),[v,l,x]);return{isLoading:h,canLoadMore:x,onLoadMore:T,onApplyFilter:w,onClearFilter:O,historicUris:c,historyWithTotal:p,historyFilter:n}},Ec={appearance:{},attributes:{},roles:[],tags:[]},vc=(0,I.evolve)({refEntity:u.VGB,refRelation:u.VGB}),xc=e=>e?(0,I.evolve)({attributes:(0,I.map)((0,I.map)(vc))})(e):e,wc=()=>{const e=(0,At.useDispatch)(),t=(0,At.useSelector)(Zt.ZP.selectors.getHistorySlice),r=(0,At.useSelector)(Zt.ZP.selectors.getHistoryDiff),n=(0,At.useSelector)(Zt.ZP.selectors.getHistoryMode),a=(0,At.useSelector)(Zt.ZP.selectors.getEntity);return(0,s.useEffect)((()=>{if(t){const{aEntity:r,bEntity:l}=t,o=u.nwO.HistoryManager.createHistoryManager(u.nwO.AttributesDiff).computeEntityHistoryDiff(xc(n===Zt.Z9.Current?a:l),xc(r));e(Zt.N5.history.actions.setHistoryDiff(o))}}),[t,n,e,a]),r||Ec};var Oc=r(57312);const Tc=(0,D.Z)((()=>({historyRow:{position:"relative",padding:"8px 12px 16px",cursor:"pointer"},selected:{background:"rgba(0,0,0,0.05)","&:before":{content:'""',background:"rgba(0,0,0,0.05)",width:"100%",height:"100%",position:"absolute",left:"-100%",top:0}},rowHeader:{display:"flex",position:"relative"},badge:e=>{let{color:t}=e;return{position:"absolute",width:"2px",height:"100%",left:"-9px",pointerEvents:"none",background:t,"&:before":{height:"100%",width:"3px",content:'""',left:"-3px",background:t,position:"absolute",opacity:.06}}},title:{color:"rgba(0,0,0,0.87)",fontSize:"13px",letterSpacing:0,lineHeight:"16px",fontWeight:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&.bold":{fontWeight:500}},date:{marginLeft:"auto",color:"rgba(0,0,0,0.54)",fontSize:"11px",letterSpacing:0,lineHeight:"16px"},user:{color:"rgba(0,0,0,0.38)",fontSize:"12px",letterSpacing:0,lineHeight:"14px"}}))),Cc=e=>{let{change:t,isCurrent:r,isSelected:n,onClick:a}=e;const{uri:l,type:o,matchGroups:i,user:s,timestamp:d}=t,p=(0,u.GtP)(l),m=Tc({color:p});return c().createElement("div",{className:S()(m.historyRow,{[m.selected]:n}),onClick:a},c().createElement("div",{className:m.rowHeader},c().createElement("div",{className:m.badge}),c().createElement(N.Z,{className:S()(m.title,{bold:r})},r?C().text("Current view"):(0,Oc.Xr)(o)),!r&&c().createElement(N.Z,{className:m.date},C().date(d,"L LT"))),i&&c().createElement(N.Z,{className:m.title},C().text("Match rule:")," ",i.join(", ")),c().createElement(N.Z,{className:m.user},s))};function Ic(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var kc;!function(e){e.FAKE_NAVIGATE_PROFILE="FAKE_NAVIGATE_PROFILE",e.FAKE_FILTERED_INCOMING="FAKE_FILTERED_INCOMING",e.FAKE_FILTERED_OUTGOING="FAKE_FILTERED_OUTGOING",e.FAKE_UPDATE="FAKE_UPDATE"}(kc||(kc={}));const Sc=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){Ic(e,t,r[t])}))}return e}({},l.I,kc),Pc=e=>e===Sc.FAKE_FILTERED_INCOMING||e===Sc.FAKE_FILTERED_OUTGOING,Nc=e=>{let{x:t,y:r,toX:n,toY:a,color:l,isDashed:o}=e;const i=((e,t,r,n)=>{const a=t>n,l=e<r,o=a?-6:6;return`M${e} ${t} L${l?r-12:r+12} ${t} ${l?`c 6 0 12 ${o} 12`:`c -6 0 -12 ${o} -12`} ${a?-12:12} L${r} ${n}`})(t,r,n,a);return c().createElement("path",{d:i,stroke:l,strokeWidth:2,fill:"none",strokeDasharray:o?"3,3":void 0})};function Dc(){return Dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dc.apply(this,arguments)}const Rc=(0,s.forwardRef)(((e,t)=>{let{x:r,y:n,color:a,isDashed:l,isCollapsed:o,showCollapseIcon:i,showLine:s}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["x","y","color","isDashed","isCollapsed","showCollapseIcon","showLine"]);const d=i?6:3;return c().createElement("g",Dc({},u,{ref:t}),s&&c().createElement("rect",{id:"line",x:r-d-4,y:n-d-4,width:2*d+8,height:2,fill:a}),c().createElement("circle",{cx:r,cy:n,r:d,fill:l?"#fff":a,stroke:a,strokeDasharray:l?"1,1":void 0,strokeWidth:2}),i&&c().createElement("g",{id:"icon"},c().createElement("rect",{x:r-4,y:n-1,width:8,height:2,fill:"#fff"}),o&&c().createElement("rect",{x:r-1,y:n-4,width:2,height:8,fill:"#fff"})))})),_c=(0,St.Z)(Rc),Ac=(0,s.memo)((e=>{let{graphData:t,onHistoryCircleMouseOver:r}=e;const{historyLanes:n,rows:a}=t,l=[16],{links:o,rowLines:i,circles:s}=a.reduce(((e,t,o)=>{let{uri:i,height:s,uris:d,type:p,fakeType:m,index:h,timestamp:g,label:f}=t;const b=16*n[i].index+24,y=l[o];l.push(y+s);const E=Pc(m),v=E?d[0]:i,x=!(null!=d&&d.some((e=>n[e])));e.circles.push(c().createElement(_c,{tooltipTitle:f,tooltipPlacement:"top",onMouseOver:r?()=>r(i,g,h):void 0,key:`circle-${v}-${o}`,x:b,y,color:(0,u.GtP)(v),isDashed:E,isCollapsed:x,showCollapseIcon:!!d,showLine:m===Sc.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(c().createElement("rect",{key:`${v}-${h}`,x:b,y:y-8,width:"100%",height:16,fill:(0,u.GtP)(v),opacity:.06}));const w=p===Sc.ENTITIES_SPLITTED;return null==d||d.forEach((t=>{const r=n[t];if(!r)return;const l=a[o].height,i=16*r.index+24,s=w?y-l:y+l;b!==i&&e.links.push(c().createElement(Nc,{key:`link-${t}-${h}`,x:b,y,toX:i,toY:s,isDashed:Pc(m),color:(0,u.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),d=16*Object.keys(n).length+24,p=l[l.length-1]-16;return Object.entries(n).forEach((e=>{let[t,r]=e;const n=16*r.index+24;r.lifeTime.forEach(((e,i)=>{var d;let{start:p,end:m}=e;if((null===(d=a[null==m?void 0:m.index])||void 0===d?void 0:d.type)===Sc.ENTITIES_SPLITTED)return;const h=(null==p?void 0:p.type)===Sc.ENTITIES_SPLITTED?(null==p?void 0:p.index)-1:null==p?void 0:p.index,g=(null==m?void 0:m.type)===Sc.ENTITIES_MERGED_MANUALLY||(null==m?void 0:m.type)===Sc.ENTITIES_MERGED?(null==m?void 0:m.index)+1:null==m?void 0:m.index,f=l[h]||l[l.length-2],b=l[g]||16;if(f<=b)return;const y=(0,u.GtP)(t);!m&&r.index>0&&s.push(c().createElement(Rc,{key:`initCircle-${t}-${i}`,x:n,y:b,color:y,showLine:!0})),o.unshift(c().createElement("path",{key:`line-${t}-${i}`,d:`M${n} ${f} L${n} ${b}`,stroke:y,strokeWidth:2}))}))})),c().createElement("svg",{className:"chart",width:d,height:p},c().createElement("g",{id:"rowLines"},i),c().createElement("g",{id:"links"},o),c().createElement("g",{id:"circles"},s))})),Zc=(0,D.Z)({historyTree:{display:"grid",gridTemplateColumns:"auto 1fr",overflowY:"auto"},graph:{overflowX:"scroll",overflowY:"hidden"},history:{minWidth:344},buttonContainer:{gridColumnStart:1,gridColumnEnd:3,padding:"8px 16px"},shadow:{boxShadow:"inset -8px 0px 5px -5px rgba(0,0,0,0.1)"}});function jc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mc(e,t,r[t])}))}return e}function Mc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lc=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:l,historyEvent:o,findPreviousChange:i}=e;const d=Zc(),p=(0,At.useDispatch)(),m=(0,At.useSelector)(Zt.ZP.selectors.getIsEditableMode),h=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),[g,f]=(0,s.useState)({historyLanes:{},rows:[]}),[b,y]=(0,s.useState)(!1),[E,v]=(0,s.useState)(-1);(0,s.useEffect)((()=>{if((0,I.isNil)(o))return void v(0);const e=e=>(null==e?void 0:e.uri)===((null==o?void 0:o.overrideUri)||l)&&(null==e?void 0:e.timestamp)===(null==o?void 0:o.aStamp),r=-1!==E?t.rows[E]:null,n=t.rows.findIndex((t=>e(t)));v(e(r)?E:n)}),[t.rows,o]);const x=(0,s.useRef)(null),w=(0,s.useCallback)((e=>{if(!(0,I.isNil)(e)){var r;const n=null===(r=t.rows)||void 0===r?void 0:r.map(((t,r)=>{var n;return jc({},t,{height:null===(n=e.childNodes[r])||void 0===n?void 0:n.clientHeight})}));f({historyLanes:t.historyLanes,rows:n})}}),[t]),O=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:r}=(null==x?void 0:x.current)||{};y(r<e-t)};return c().createElement("div",{className:d.historyTree},r&&c().createElement(Jr.Z,null),c().createElement("div",{className:S()(d.graph,{[d.shadow]:b}),onScroll:O,ref:x},c().createElement(Ac,{onHistoryCircleMouseOver:(e,t,r)=>{if((0,I.isNil)(g.rows[r].label)){const n={time:t,select:"crosswalks"};(0,u.HvW)(e,n).then((e=>{let{crosswalks:t}=e;const n=t?(0,I.uniqBy)((0,I.prop)("type"),t).map((e=>{const t=(0,u.s5)(h,e.type);return t?t.label:null})).filter(I.identity).join(", "):C().text("No data");f((e=>jc({},e,{rows:e.rows.map((e=>e.index===r?jc({},e,{label:n}):e))})))}))}},graphData:g}),c().createElement(mt.Z,{handleWidth:!0,onResize:O})),c().createElement("div",{ref:w,className:d.history},t.rows.map(((e,t)=>{const r=t===E,n=0===t;return c().createElement(Cc,{key:`row-${t}`,change:e,isCurrent:n,isSelected:r,onClick:()=>((e,t,r,n)=>{if(m){if(!window.confirm(C().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;p(Zt.N5.mode.actions.modeUpdated(u.ARY.Viewing))}if(n&&!r||!n&&r)p(Zt.N5.history.actions.clearHistoryEvent()),v(0);else if(!n&&!r){const r=i(e-1,t.uri||l),n=i(e,t.uri||l),a=null==r?void 0:r.timestamp,o=null==n?void 0:n.timestamp,s=(null==t?void 0:t.uri)===l?null:null==t?void 0:t.uri;p(Zt.N5.history.actions.setHistoryEvent({aStamp:a,bStamp:o,overrideUri:s})),v(e)}})(t,e,r,n)})}))),n&&c().createElement("div",{className:d.buttonContainer},c().createElement(Fo.Z,{color:"primary",onClick:()=>a()},C().text("Show more"))))},Vc=(0,D.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),Fc=(0,D.Z)({icon:e=>{let{color:t}=e;return{boxSizing:"border-box",borderWidth:2,borderStyle:"solid",borderColor:t,height:12,width:12,borderRadius:30,transition:"opacity 0.3s",margin:4}},active:e=>{let{color:t}=e;return{backgroundColor:t}},inactive:{backgroundColor:"white"},clickable:{cursor:"pointer"}}),Bc=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),l=Fc({color:a});return c().createElement("div",{className:S()(l.icon,{[l.inactive]:!r,[l.active]:r,[l.clickable]:!!n}),onClick:n})},Uc=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:l}=e;const o=Vc();return c().createElement("div",{className:S()(o.root,l)},c().createElement(Bc,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement(Bc,{key:e,value:e,isSelected:null==r?void 0:r.includes(e),onClick:()=>(e=>{null!=r&&r.includes(e)?a((0,I.without)([e],r)):a([...r||[],e])})(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 zc=(e,t)=>e.reduce(((e,r,n)=>{let{start:a,end:l}=r;if(a){const r=t-a.timestamp;((0,I.isNil)(e.startDistance)||Math.abs(e.startDistance)>Math.abs(r)&&r>0)&&(e.startIndex=n,e.startDistance=r)}if(l){const r=t-l.timestamp;((0,I.isNil)(e.endDistance)||Math.abs(e.endDistance)>Math.abs(r)&&r<0)&&(e.endIndex=n,e.endDistance=r)}return e}),{startIndex:null,endIndex:null,startDistance:null,endDistance:null}),Wc=(0,D.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),Gc=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:l,onLoadMore:o,historyEvent:i}=e;const u=Wc(),[d,p]=(0,s.useState)(null);(0,s.useEffect)((()=>{p(n)}),[n]);const{historyData:m,findPreviousChange:h}=(e=>{let{entityUri:t,historyChanges:r,selectedUris:n}=e;return(0,s.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},a=[{user:"",timestamp:0,uri:t}],l=(0,I.curry)(((e,r,n)=>{const a=n.uri||t;if(e)if(Array.isArray(e)){if(n.type!==Sc.ENTITY_LOST_MERGE)return null;if(e.includes(a))return n;if(r&&n.uris)return e.some((e=>n.uris.includes(e)))?n:null}else{var l;if(a===e||r&&null!==(l=n.uris)&&void 0!==l&&l.includes(e))return n}return null})),o=(e,t,n)=>(0,I.pipe)((0,I.drop)(e+1),(0,I.find)(l(t,n)))(r),i=t=>(e[t]||n&&!n.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),e[t]),s=(e,t)=>{const r=e[e.length-1];!r||r.start&&(r.start.type!==Sc.ENTITY_CREATED||t.type!==Sc.ENTITIES_SPLITTED)?e.push({start:t,end:null}):r.start=t},c=(e,t)=>{let r=!0;if(e.length){const n=e[e.length-1];r=!((!n.start||n.start.timestamp<t.timestamp)&&(!n.end||n.end.timestamp>t.timestamp))}r&&e.push({start:null,end:null})},u=(e,t)=>{if(e.length){const r=e[e.length-1];r.start||(r.start=t)}e.push({start:null,end:t})},d=[];return null==r||r.forEach(((r,n)=>{var l;switch(r.type){case Sc.ENTITIES_SPLITTED:if(!o(n,r.uri||t,!1))return;{const e=r.uri,t=r.uris?[r.uris,e]:[e],a=o(n,t,!0);if(a&&(!e||e===a.uri))return}break;case Sc.ENTITY_LOST_MERGE:case Sc.RELATIONSHIP_CREATED:case Sc.RELATIONSHIP_REMOVED:case Sc.RELATIONSHIP_CHANGED:return}let p=!1;null===(l=r.uris)||void 0===l||l.forEach((e=>{i(e)||(p=!0)}));const m=i(r.uri||t);if(!m)return;const h=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}({},r);((t,r)=>{var n,l;switch(r.type){case Sc.ENTITY_CREATED:s(t,r);break;case Sc.ENTITIES_MERGED_ON_THE_FLY:case Sc.ENTITY_CHANGED:c(t,r);break;case Sc.ENTITY_LOST_MERGE:case Sc.ENTITY_REMOVED:u(t,r);break;case Sc.ENTITIES_SPLITTED:c(t,r),null===(n=r.uris)||void 0===n||n.forEach((t=>{const n=e[t];if(!n)return;const l=n.lifeTime.length;l?s(n.lifeTime,r):u(n.lifeTime,r),a.push({uri:t,user:r.user,type:r.type,fakeType:l?Sc.FAKE_UPDATE:Sc.FAKE_NAVIGATE_PROFILE,timestamp:r.timestamp})}));break;case Sc.ENTITIES_MERGED:case Sc.ENTITIES_MERGED_MANUALLY:c(t,r),null===(l=r.uris)||void 0===l||l.forEach((t=>{const n=e[t];n&&u(n.lifeTime,r)}))}})(m.lifeTime,h),p&&d.push(h),a.push(h)})),d.forEach((t=>{t.uris.forEach((n=>{e[n]||r.forEach((r=>{let{uri:l,uris:o,timestamp:i,user:s,type:c}=r;l===n&&(null==o||o.forEach((r=>{const n=e[r];if(!n)return;let l=null;switch(c){case Sc.ENTITIES_MERGED:case Sc.ENTITIES_MERGED_MANUALLY:l=Sc.FAKE_FILTERED_INCOMING;break;case Sc.ENTITIES_SPLITTED:l=Sc.FAKE_FILTERED_OUTGOING;break;default:return}const o={fakeType:l,uri:t.uri,uris:[r],type:c,user:s,timestamp:i},u=zc(n.lifeTime,t.timestamp);l===Sc.FAKE_FILTERED_INCOMING?(0,I.isNil)(u.endIndex)||(n.lifeTime[u.endIndex].end=o):(0,I.isNil)(u.startIndex)||(n.lifeTime[u.startIndex].start=o),a.splice(a.indexOf(t),0,o)})))}))}))})),a.forEach(((e,r)=>{e.index=r,e.uri=e.uri||t})),{historyData:{historyLanes:e,rows:a},findPreviousChange:(e,t)=>(0,I.pipe)((0,I.slice)(e+1,1/0),(0,I.find)(l(t,!1)))(a)}}),[t,r,n])})({entityUri:a,historyChanges:null==r?void 0:r.changes,selectedUris:d});return c().createElement("div",{className:u.root},c().createElement(Uc,{values:n,selectedValues:d,onSelectValues:p,entityUri:a,className:u.borderBottom}),c().createElement(Lc,{historyData:m,isLoading:t,onLoadMore:o,canLoadMore:l,entityUri:a,historyEvent:i,findPreviousChange:h}))}));var qc=r(85256),Kc=r(36444),Yc=r(15791),$c=r(55234);const Xc=[cc.K.WITHIN,cc.K.AGO,cc.K.BETWEEN],Qc=e=>({[cc.K.WITHIN]:C().text("Within the last"),[cc.K.AGO]:C().text("More than"),[cc.K.BETWEEN]:C().text("Date range")}[e]||"");var Jc=r(77875),eu=r(27446);const tu=(0,D.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),ru=[null,null],nu=[null,"hours"],au=e=>{let{value:t,onChange:r,className:n}=e;const a=tu(),l=e=>e===cc.K.WITHIN||e===cc.K.AGO,o=e=>e===cc.K.BETWEEN,i=o(null==t?void 0:t.type)?t.period:ru,u=l(null==t?void 0:t.type)?t.period:nu,[d,p]=(0,s.useState)(i),[m,h]=(0,s.useState)(u),g=(null==t?void 0:t.type)||cc.K.WITHIN,f=e=>l(e)?m:o(e)?d:void 0,b=e=>{r({type:g,period:e})};return(0,gt.D)((()=>{t?l(t.type)?h(t.period):o(t.type)&&p(t.period):(p(ru),h(nu))}),[t]),c().createElement("div",{className:S()(a.root,n)},c().createElement(N.Z,{className:a.title,variant:"subtitle1"},C().text("Date")),c().createElement("div",{className:a.intervalContainer},c().createElement(kl.Z,{label:"",className:a.typeInput,value:{value:g,label:Qc(g)},options:Xc.map((e=>({value:e,label:Qc(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),l(g)?c().createElement(Jc.Z,{interval:m,onChange:b}):c().createElement(eu.Z,{values:d,onChange:b})))},lu=[sc.UPDATE,sc.MERGE,sc.UNMERGE];function ou(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iu(e,t,r[t])}))}return e}function iu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const su={input:e=>ou({},e,{fontSize:"14px"}),menuPortal:e=>ou({},e,{zIndex:1300})},cu=(0,D.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},valueContainer:{overflowY:"auto",height:44},option:{fontSize:"14px",height:"32px"}}),uu=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=cu(),l=e=>{return{value:e,label:(t=e,{[sc.UPDATE]:C().text("Update"),[sc.MERGE]:C().text("Merge"),[sc.UNMERGE]:C().text("Unmerge")}[t]||"")};var t},o=e=>e.map(l),i=o(lu);return c().createElement("div",{className:S()(a.root,n)},c().createElement(N.Z,{className:a.title,variant:"subtitle1"},C().text("Activity")),c().createElement(Xn.Z,{value:o(t),onChange:(0,I.pipe)((0,I.defaultTo)([]),(0,I.pluck)("value"),r),options:i,TextFieldProps:{classes:{root:a.dropDownInput}},components:{DropdownIndicator:ur.Z},styles:su,classes:a,menuPlacement:"bottom",menuPortalTarget:document.body}))},du=(0,D.Z)({popup:{width:500,height:500,overflowY:"hidden",display:"flex",flexDirection:"column"},filterContainer:{padding:20,height:410,display:"flex",flexDirection:"column"},filterContainerScrollable:{overflowY:"auto"},filterItem:{marginTop:15},filterControls:{display:"flex",padding:"10px 12px 0",borderTop:"solid 1px rgba(0, 0, 0, 0.12)"},clearButton:{marginRight:"auto"},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px"}});function pu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mu=e=>{let{className:t,filter:r,onApplyFilter:n,onClearFilter:a,entityType:l}=e;const o=du(),[i,u]=(0,s.useState)(null),d=()=>u(null),[p,m]=(0,s.useState)(r);(0,s.useEffect)((()=>{m(r)}),[r]);const h=(0,I.curry)(((e,t)=>{m((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pu(e,t,r[t])}))}return e}({},r,{[e]:t})))})),{activities:g=[],attributes:f=[],dateRange:b=null,users:y=[]}=p||{};return c().createElement(c().Fragment,null,c().createElement(Sl.Z,{icon:Kc.Z,size:"L",onClick:e=>u(e.currentTarget),className:t}),c().createElement(mo.ZP,{classes:{paper:o.popup},open:!!i,anchorEl:i,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:o.filterContainer},c().createElement(N.Z,{variant:"h6"},C().text("Filter")),c().createElement("div",{className:o.filterContainerScrollable},c().createElement(au,{value:b,onChange:h("dateRange"),className:o.filterItem}),c().createElement(Yc.Z,{selectedUsers:y,onChange:h("users"),className:o.filterItem}),c().createElement(uu,{selectedHistoryActivityTypes:g,onChange:h("activities"),className:o.filterItem}),c().createElement($c.Z,{selectedAttributes:f,entityType:l,onChange:h("attributes"),className:o.filterItem,title:C().text("Attribute updated")}))),c().createElement("div",{className:o.filterControls},c().createElement(Fo.Z,{onClick:a,className:o.clearButton},C().text("Clear all")),c().createElement(Fo.Z,{onClick:d},C().text("Cancel")),c().createElement(Fo.Z,{color:"primary",onClick:()=>{b&&(e=>{if(e.type===cc.K.AGO||e.type===cc.K.WITHIN){const[t,r]=e.period;return"Number"===(0,I.type)(t)&&"String"===(0,I.type)(r)&&t>0}if(e.type===cc.K.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}})(b)?n(p):n((0,I.dissoc)("dateRange",p)),d()}},C().text("Apply")))))};var hu=r(98281);const gu=(0,D.Z)({menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),fu=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=tt.ZT}=e;const a=gu(),{text:l,selected:o,onClick:i}=r;return c().createElement(P.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},o&&c().createElement(hu.Z,{className:a.checkIcon}),c().createElement(N.Z,{classes:{root:a.menuText}},l))}));fu.displayName="MenuItemRenderer";const bu=fu,yu=()=>{const e=(0,At.useSelector)(Zt.ZP.selectors.getHistoryMode),t=(0,At.useDispatch)(),r=e=>{t(Zt.N5.history.actions.setHistoryMode(e))},n=[{text:C().text("Compare to Current view"),selected:e===Zt.Z9.Current,onClick:()=>r(Zt.Z9.Current)},{text:C().text("Compare to Previous view"),selected:e===Zt.Z9.Previous,onClick:()=>r(Zt.Z9.Previous)}];return c().createElement(Er.Z,{MenuItemRenderer:bu,buttonComponent:Sl.Z,buttonProps:{icon:po.Z,size:"L"},menuId:"history-menu",menuItems:n})},Eu=(0,D.Z)({root:{display:"flex",flex:1,alignItems:"center"},icon:{margin:4},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"3px 19px"},count:{fontSize:14},filterButton:{marginRight:"-4px"}}),vu=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}=e;const o=Eu();return c().createElement("div",{className:o.root},c().createElement(N.Z,{variant:"h6"},C().text("History")),!(0,I.isNil)(t)&&c().createElement(c().Fragment,null,c().createElement(qc.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),c().createElement(N.Z,{variant:"body1",color:"textSecondary",className:o.count},1===t?C().text("${count} contributing profile",{count:t}):C().text("${count} contributing profiles",{count:t}))),c().createElement(Nl.Z,null),c().createElement(mu,{className:o.filterButton,entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}),c().createElement(yu,null))},xu=(0,D.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),wu=()=>{const e=xu(),t=(0,At.useSelector)(Zt.ZP.selectors.getHistoryEvent),r=(0,At.useDispatch)(),n=(0,I.pipe)(Zt.N5.history.actions.clearHistoryEvent,r);return t?c().createElement("div",{className:e.root},c().createElement(N.Z,{component:"div"},C().text("You are viewing a historic slice:")," ",c().createElement("span",{className:e.slice},C().date(t.aStamp,"llll"))),c().createElement(Fo.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},C().text("Cancel"))):null},Ou=()=>c().createElement(Tl,{text:C().text("History in the making"),secondaryText:C().text("When you create an event or perform an activity, it will show up here.")});var Tu=r(37457);const Cu=(0,D.Z)({editor:{display:"flex",flexDirection:"column",padding:"0 24px 5px"},title:{color:"rgba(0, 0, 0, 0.6)",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",margin:"17px 0 24px"},item:{marginBottom:"20px"},dense:{marginBottom:0},actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}});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){ku(e,t,r[t])}))}return e}function ku(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Su=e=>{let{connection:t,modifiedEntity:r,allModifiedEntities:n,dispatch:a,config:l,mode:o,metadata:i,globalSearchRequestOptions:d,error:p}=e;const{relationUri:m,relationType:h,direction:g}=t.relation,b=t.isNew,E=Cu(),{inRelations:v=[],outRelations:x=[]}=(0,s.useMemo)((()=>(0,u.ocC)({content:t.parentEntityUri?l.contentSecondLevel:l.content,direction:g,relationType:h,mode:o,metadata:i})),[l,g,h,o,i,t.parentEntityUri]),w=(0,s.useMemo)((()=>(0,u.xF8)(i,h)),[h,i]),O=(0,s.useMemo)((()=>Iu({attributes:Iu({},Zt.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,u.p2l)(t.relation))),[t]),T=(0,s.useRef)(t),k=(0,s.useRef)(r),P=(0,s.useMemo)((()=>(0,u.SAs)(n,r)),[n,r]),D=(0,s.useRef)([]);(0,s.useEffect)((()=>{D.current=(0,I.pipe)((0,I.concat)(P.map((0,I.prop)("uri"))),I.uniq)(D.current)}),[P]);const R=(0,s.useRef)(P),_=(0,u.z7d)(v,x),A=T.current!==t||k.current!==r||(Z=R.current,j=P,Z.length!==j.length||Z.some(((e,t)=>Z[t]!==j[t])))||t.isNew&&!(0,u.O27)((0,I.path)(["relation","object","attributes"],t));var Z,j;const M=b?Zt.N5.relations.actions.addRelation:Zt.N5.relations.actions.editRelation,L=(0,s.useCallback)((0,I.pipe)(Zt.N5.relations.actions.setRelationType(l.id,m),a),[l,m,a]),V=(0,s.useCallback)((()=>(0,I.pipe)(Zt.N5.relations.actions.closeRelationEditor,a)(l.id,m)),[l,m,a]),F=(0,s.useCallback)((e=>{if(r){const t=(0,u.nt9)(i,r.type);return(0,u.wx9)(t,r,e)}return e}),[r,i]),B=(0,s.useCallback)((e=>a(Zt.N5.modifiedEntities.actions.entityCreated(e))),[a]),U=(0,s.useCallback)((e=>a(Zt.N5.modifiedEntities.actions.entityDeleted(e))),[a]),H=(0,s.useCallback)((e=>{r&&U(r.uri),a(Zt.N5.relations.actions.setRelationEntity(l.id,m,e)),p&&a(Zt.N5.errors.actions.errorDeactivated((0,u.iFp)(p)))}),[l.id,m,a,r,U,p]),z=(0,s.useCallback)((()=>{const e=(0,u.Bd_)(i,n,t);return a(Zt.N5.errors.actions.errorsSet(e)),0===e.length}),[t,i,n,a]),W=(0,s.useCallback)((()=>a(Zt.N5.errors.actions.errorsSet([]))),[a]),G=(0,s.useCallback)((0,I.pipe)((0,I.always)(t),(0,I.when)(z,(0,I.pipe)(u.zhn,F,M(l.id),a,(0,I.always)((0,I.differenceWith)(I.equals,D.current,P.map((0,I.prop)("uri")))),(0,I.forEach)(U),V))),[t,l,a,F,z,P]),q=(0,s.useCallback)((()=>{const e=k.current;r!==e&&(e?(B(e),r&&r.uri!==e.uri&&U(r.uri)):U(r.uri));const t=R.current;(0,I.differenceWith)(I.equals,D.current,t.map((0,I.prop)("uri"))).forEach(U),t.forEach(B),W(),V()}),[V,B,U,W,r]),K=(0,s.useCallback)((e=>(0,I.pipe)(Zt.N5.actions.addAttributes,a)(e.map((e=>Iu({},e,{viewId:l.id}))))),[l.id,a]),Y=(0,s.useCallback)((e=>(0,I.pipe)(Zt.N5.actions.modifyAttribute,a)(Iu({},e,{viewId:l.id}))),[l.id,a]),$=(0,s.useCallback)((e=>(0,I.pipe)(Zt.N5.actions.removeAttribute,a)(Iu({},e,{viewId:l.id}))),[l.id,a]),X=(0,s.useCallback)(((e,t)=>{const r=(0,u.nt9)(i,e),n=(0,I.pipe)(u.wcJ,(0,u._kX)(o))(r),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:o});H(a),B(a)}),[B,H,o,i]),Q=(0,u.e$p)(p),J=(0,s.useCallback)((()=>{const{content:e,contentSecondLevel:r}=l;return r&&t.parentEntityUri?r.entityTypes:e.entityTypes}),[l,t.parentEntityUri]);return c().createElement(c().Fragment,null,c().createElement("div",{className:E.editor},c().createElement(N.Z,{className:E.title},b?C().text("Add new item"):C().text("Edit item")),null===_&&c().createElement(fr,{className:E.item,relation:t.relation,inRelationTypes:v,outRelationTypes:x,onChange:L}),Boolean(h)&&c().createElement(c().Fragment,null,c().createElement(Vr.Z,{errorMessage:Q},c().createElement(y.Z,{className:S()(E.item,{[E.dense]:Q||t.entity&&(0,u.ZiX)(t.entity.entityUri)}),entity:t.entity||{},entityTypesUris:J()||[],max:l.max||20,globalSearchRequestOptions:d,mode:o,onChange:H,onCreate:X,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(f.Z,{className:E.item,attrTypes:w,entity:O,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:o,parentUri:m,onAddAttributes:K,onChangeAttribute:Y,onDeleteAttribute:$}))),c().createElement("div",{className:E.actionButtons},c().createElement(Fo.Z,{onClick:q},C().text("Cancel")),c().createElement(Fo.Z,{color:"primary",disabled:!A,onClick:G},C().text("Apply"))),c().createElement(qc.Z,null))};Su.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:O().object,dispatch:O().func,config:u.PiC,mode:O().string,metadata:u.pGS,globalSearchRequestOptions:O().object,error:u.wfT,parentEntityUri:O().string};const Pu=Su,Nu=(0,At.connect)(((e,t)=>{const r=(n=t,Zt.N5.relations.selectors.getEntityUriFromConnection(n.connection));var n;const a=(0,u.ZiX)(r);return{modifiedEntity:a?Zt.ZP.selectors.getModifiedEntity(e,r):null,allModifiedEntities:a?Zt.ZP.selectors.getModifiedEntities(e):null,globalSearchRequestOptions:Zt.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]),error:(0,u.ATu)(t.connection,Zt.ZP.selectors.getProfileErrors(e))}}))(Pu),Du=(0,D.Z)((e=>({card:{borderBottom:"1px solid rgba(0,0,0,0.06)"},withBackground:{backgroundColor:"rgba(0, 0, 0, 0.03)"},lineWrapper:{position:"relative"},icon:{position:"absolute",top:"8px",left:"16px",width:"32px",height:"32px",zIndex:1},line:e=>{let{color:t}=e;return{borderLeft:`3px solid ${t}`,position:"absolute",left:0,top:0,bottom:0}},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word",lineHeight:"15px"},commentsInfo:{display:"flex",alignItems:"center",marginBottom:"-4px",marginTop:"7px"},commentsIcon:{width:"11px",height:"11px",marginLeft:"2px",marginRight:"6px",marginTop:"-2px"},infoValue:{color:e.palette.text.primary},infoBlock:{display:"flex",flexDirection:"row",marginBottom:"5px"},header:{display:"flex",flexDirection:"row",paddingBottom:"12px"},flex:{flex:1},caption:{fontSize:"16px",color:e.palette.text.primary},title:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:"-4px"},flag:{height:"13px",width:"13px",marginTop:"-2px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},date:{fontSize:"13px",color:e.palette.text.primary},mainInfo:{display:"flex",flexDirection:"column",flex:1},controlsBox:{marginRight:"16px",marginBottom:"12px",marginTop:"13px"},controlsInRow:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},priority:{width:"162px"},comments:{marginLeft:"11px"}}))),Ru=c().createContext(null);Ru.displayName="WorkflowTasksContext";const _u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{errorMessage:t,errorCode:r}=e;r!==u.Xt7.WORKFLOW_IS_NOT_REGISTERED_ERROR&&(console.error(e),Lr.Z.addError({title:C().text("Error"),message:t||C().text("Something went wrong...")}))},Au=()=>{const e=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),t=(0,At.useSelector)(Zt.ZP.selectors.getCanUserStartProcessFromQuery),r=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowJobs),n=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowEnvironmentConfigJar),a=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowDefinition),l=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowConfigJar),o=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewProcessInstanceSearchQuery),i=(0,At.useSelector)(Zt.ZP.selectors.getCanUserUpdateWorkflowDataTask),s=(0,At.useSelector)(Zt.ZP.selectors.getCanUserUpdateProcessInstance),c=(0,At.useSelector)(Zt.ZP.selectors.getCanUserReadWorkflowDataTask),u=(0,At.useSelector)(Zt.ZP.selectors.getCanUserManageWorkflowEnvironmentDefinition),d=(0,At.useSelector)(Zt.ZP.selectors.getCanUserManageWorkflowDefinition),p=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsValidateTasks),m=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsUpdateTasks),h=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsTerminateProcessInstance),g=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsSyncBusinessProcessData),f=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobs),b=(0,At.useSelector)(Zt.ZP.selectors.getCanUserCreateWorkflowEnvironmentConfigJar),y=(0,At.useSelector)(Zt.ZP.selectors.getCanUserRegisterConfigEnvironments),E=(0,At.useSelector)(Zt.ZP.selectors.getCanUserCreateWorkflowConfigJar);return v=>{if(!e)return!1;switch(v){case"VIEW_PROCESS_DEFINITIONS":return a;case"DEPLOY_GENERIC_PROCESS_DEFINITION":return u;case"VIEW_JOBS":return r;case"START_JOB":return f||g&&h&&m&&p;case"VIEW_CUSTOM_JARS":return l||n;case"UPDATE_PROCESS_INSTANCE":return s;case"VIEW_TASKS":return c;case"REGISTER_TENANT":return y;case"START_PROCESS_INSTANCE":case"START_PROCESS_INSTANCE_SEARCH_QUERY":return t;case"VIEW_PROCESS_INSTANCE_COMMENTS":case"VIEW_PROCESS_INSTANCES":case"VIEW_PROCESS_INSTANCE_COUNT":return o;case"UPDATE_TASK":return i;case"DEPLOY_TENANT_PROCESS_DEFINITION":return d;case"DEPLOY_CUSTOM_JAR":return E&&b}return!1}},Zu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,I.startsWith)("changeRequests/"))},ju=e=>void 0===e||!0===e,Mu=e=>({label:e,value:e}),Lu=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),d=(0,Mt._)(),[p,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(),[f,b]=(0,s.useState)(!1),y=Au()("UPDATE_TASK")&&ju(n);(0,s.useEffect)((()=>{m(Mu(t))}),[t]);const E=(0,s.useCallback)((e=>{if(l&&y&&r){const t=(0,I.filter)((t=>t.value.toLowerCase().includes(e)));return h?Promise.resolve(t(h)):d((0,u.j2$)({taskId:r,workflowPath:l,environment:o,tenant:i})).then((e=>{const{data:r}=e,n=r.sort(((e,t)=>u.P6Y.strings.sort("asc",e,t))).map(Mu);return g(n),t(n)})).catch(_u)}}),[l,r,o,i,h,g,y]),v=(0,s.useCallback)((e=>{if(l&&y&&r){const{value:t}=e;b(!0),c((0,u._C4)({taskId:r,workflowPath:l,environment:o,tenant:i,assignee:t})).then((()=>{m(Mu(t)),null==a||a(r,{assignee:t})})).catch(_u).finally((()=>{b(!1)}))}}),[l,r,o,i,y]);return{assignee:p,getAssignees:E,updateAssignee:v,updateRequestIsInProgress:f,readOnly:!y}},Vu=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:l,updateAssignee:o,updateRequestIsInProgress:i,readOnly:s}=Lu({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(L.Z,{isDisabled:u,getOptions:l,onChange:o,hideSelectedOptions:!1,label:C().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},Fu=(0,D.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),Bu=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const l=Fu(),{updateDueDate:o,updateRequestIsInProgress:i,readOnly:d}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),[d,p]=(0,s.useState)(!1),m=Au()("UPDATE_TASK")&&ju(n);return{updateDueDate:(0,s.useCallback)((e=>{l&&m&&r&&e&&t!==e&&(p(!0),c((0,u.KF3)({taskId:r,workflowPath:l,environment:o,tenant:i,dueDate:e})).then((()=>{null==a||a(r,{dueDate:e})})).catch(_u).finally((()=>{p(!1)})))}),[l,r,o,i,a,c,t,m]),updateRequestIsInProgress:d,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(Ir.Z,{className:S()(l.dueDate,a),disabled:i||d,value:r,label:C().text("Due date"),onChange:(0,I.pipe)((e=>e&&e.getTime()),o),margin:"dense",InputProps:{className:l.dueDateInput},InputLabelProps:{classes:{root:l.inputLabel}}})},Uu=e=>{let{taskId:t,priority:r,isTaskOpen:n,className:a}=e;const{priorities:l,updatePriority:o,updateRequestIsInProgress:i,readOnly:d}=(e=>{let{priority:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),[d,p]=(0,s.useState)(!1),m=Au()("UPDATE_TASK")&&ju(n),h=(0,s.useCallback)((e=>{const{value:n}=e;l&&m&&r&&t!==n&&(p(!0),c((0,u.ax9)({taskId:r,workflowPath:l,environment:o,tenant:i,priority:n})).then((()=>{null==a||a(r,{priority:n})})).catch(_u).finally((()=>{p(!1)})))}),[l,r,o,i,a,c,t,m]);return{priorities:(0,s.useMemo)((()=>[{label:C().text("Low"),value:u.NVC.low},{label:C().text("Medium"),value:u.NVC.medium},{label:C().text("High"),value:u.NVC.high},{label:C().text("Urgent"),value:u.NVC.urgent}]),[]),updatePriority:h,updateRequestIsInProgress:d,readOnly:!m}})({taskId:t,priority:r,isOpen:n}),p=i||d;return c().createElement(L.Z,{className:a,isDisabled:p,options:l,onChange:o,hideSelectedOptions:!1,label:C().text("Priority"),value:l.find((0,I.propEq)("value",r)),TextFieldProps:{disabled:p},height:40})};var Hu=r(94842),zu=r(43434),Wu=r(98685);const Gu=(0,D.Z)((e=>({comment:{display:"flex",flexDirection:"row",flex:1,marginLeft:"6px"},avatar:{height:"24px",width:"24px",margin:"3px 13px 0 0"},icon:{fill:"#537280",backgroundColor:"#EAEDEE"},firstLine:{display:"flex",flexDirection:"row"},info:{flex:1},author:{flex:1,fontWeight:"500",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px"},date:{color:"rgba(0, 0, 0, 0.54)",fontSize:"11px",marginRight:"17px",lineHeight:"15px"},text:{color:"rgba(0, 0, 0, 0.6)",fontSize:"13px",wordWrap:"break-word",wordBreak:"break-all",paddingRight:"10px"}}))),qu=(0,D.Z)((e=>({circleButton:{maxWidth:"14px",maxHeight:"14px",border:"1px solid rgba(0, 0, 0, 0.3)",fontSize:"13px",color:"rgba(0, 0, 0, 0.6)",position:"absolute",top:"-11px",left:"5px",backgroundColor:"#ffffff","&:hover":{backgroundColor:"#f7f7f7"},"&.focused":{backgroundColor:"#f7f7f7"}},delimiter:{position:"relative",height:"4px",borderTop:"1px solid rgba(0, 0, 0, 0.3)",borderBottom:"1px solid rgba(0, 0, 0, 0.3)",margin:"15px 0 24px 0"}}))),Ku=(0,D.Z)((e=>({container:{padding:"5px 0",display:"flex",flexDirection:"column"},commentsContainer:{maxHeight:"300px",overflowY:"auto"},title:{margin:"0 0 8px 5px",fontSize:"14px",color:"rgba(0, 0, 0, 0.87)"},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"0 6px",height:"40px",margin:"10px 17px 0 6px",fontSize:"14px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}}))),Yu=(0,D.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),$u=e=>{let{author:t,classes:r,message:n,time:a}=e;const l=Gu();return c().createElement("div",{className:l.comment},c().createElement(zu.Z,{className:l.avatar},c().createElement(Wu.Z,{className:l.icon})),c().createElement("div",{className:S()(l.info,r.messageContainer)},c().createElement("div",{className:l.firstLine},c().createElement("div",{className:l.author},t),c().createElement("span",{className:l.date},C().date(a,"L LT"))),c().createElement("div",{className:l.text},n)))};$u.defaultProps={classes:{}},$u.propTypes={classes:O().object,author:O().string,id:O().string,message:O().string,time:O().number};const Xu=e=>{let{comments:t,onClick:r}=e;const n=qu();return c().createElement(c().Fragment,null,c().createElement($u,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Ue.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement($u,t[t.length-1]))};Xu.propTypes={comments:O().arrayOf(O().shape({author:O().string,id:O().string,message:O().string,time:O().number})),onClick:O().func};const Qu=e=>{let{comments:t}=e;const r=Yu();return t.map((e=>{let{author:t,id:n,message:a,time:l}=e;return c().createElement($u,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:l})}))};Qu.propTypes={comments:O().arrayOf(O().shape({author:O().string,id:O().string,message:O().string,time:O().number}))};const Ju=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),[d,p]=(0,s.useState)([]),[m,h]=(0,s.useState)(!1),g=Au()("UPDATE_TASK")&&ju(n);(0,s.useEffect)((()=>{p(t||[])}),[t]);const f=(0,s.useCallback)((e=>{g&&(h(!0),c((0,u.tZe)({workflowPath:l,environment:o,tenant:i,taskId:r,comment:e}).then((()=>(0,u.yW4)({workflowPath:l,environment:o,tenant:i,taskId:r})))).then((e=>{let{processInstanceComments:t}=e;p(t||[]),null==a||a(r,{processInstanceComments:t})})).catch(_u).finally((()=>h(!1))))}),[o,r,i,l,c,a,g]);return{comments:d,requestIsInProgress:m,writeComment:f,readOnly:!g}},ed=e=>e.target.value,td=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Ku(),[l,o]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:d,writeComment:p,readOnly:m}=Ju({processInstanceComments:t,taskId:r,isOpen:n}),h=(0,s.useCallback)((()=>{p(i),u("")}),[i,p]),g=(0,I.pipe)(ed,u);return c().createElement("div",{className:a.container},c().createElement("div",{className:a.title}," ",C().text("Comments")," "),c().createElement("div",{className:a.commentsContainer},l||d.length<3?c().createElement(Qu,{comments:d}):c().createElement(Xu,{onClick:()=>o(!0),comments:d})),!m&&c().createElement(Vl.Z,{endAdornment:c().createElement(Fl.Z,{position:"end"},c().createElement(Sl.Z,{icon:Hu.Z,disabled:0===i.length,onClick:h})),classes:{root:a.filledInputRoot},placeholder:C().text("Write a comment"),value:i,onKeyPress:(0,I.when)((0,I.propEq)("key","Enter"),h),onChange:g,disableUnderline:!0}))};td.propTypes={processInstanceComments:O().arrayOf(O().shape({author:O().string,id:O().string,message:O().string,time:O().number})),taskId:O().string};const rd=e=>{let{taskId:t,possibleActions:r,assignee:n,isTaskOpen:a}=e;const{actions:l,actionRequestIsInProgress:o}=(e=>{let{possibleActions:t,assignee:r,taskId:n,isOpen:a}=e;const{loadWorkflowTasks:l}=(0,s.useContext)(Ru)||{},o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),i=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),c=(0,At.useSelector)(Zt.ZP.selectors.getTenant),d=(0,At.useSelector)(Zt.ZP.selectors.getUserName),p=(0,At.useSelector)(Zt.ZP.selectors.getEntityUri),[m,h]=(0,s.useState)(!1),g=(0,s.useContext)(jt.m),f=(0,At.useDispatch)(),b=(0,s.useCallback)((e=>()=>{o&&n&&(h(!0),(0,u.TZ_)({taskId:n,workflowPath:o,environment:i,tenant:c,action:e}).then((()=>{"Delete"===e?f(Zt.ui.actions.entityDeletionFinished()):(f(Zt.N5.entity.actions.loadEntity({viewId:g,uri:p})),null==l||l())})).catch(_u).finally((()=>{h(!1)})))}),[o,n,i,c,f,p,g,l]);return{actions:(0,s.useMemo)((()=>d===r&&ju(a)?(t||[]).map((e=>{let{action:t,label:r}=e;return{text:r,onClick:b(t)}})):[]),[t,b,d,r,a]),actionRequestIsInProgress:m}})({taskId:t,possibleActions:r,assignee:n,isOpen:a});return l.length>0?c().createElement(Er.Z,{buttonComponent:Sl.Z,buttonProps:{icon:po.Z,size:"L",disabled:o},menuId:"workflow-actions",menuItems:l}):null},nd=(0,D.Z)({decorator:{display:"flex",alignItems:"stretch"},lineBlock:{width:"56px",flexShrink:0},withLinePadding:{"& $noLine":{height:"10px"},"& $line":{height:"calc(100% - 10px)"}},noLine:{height:"0"},line:{height:"100%",position:"relative",marginLeft:"31px",borderLeft:"2px solid rgba(0,0,0,0.06)","&:before":{position:"absolute",height:6,width:6,borderRadius:"50%",left:-5,top:"15px",background:"#d8d8d8",content:'""',display:"block",border:"1px solid white"},"&$plain":{"&:before":{width:0,border:"none"}},"&$last":{height:"15px"}},content:{flex:1,minWidth:0},plain:{},last:{},rowDivider:{marginLeft:0}}),ad=e=>{let{className:t,children:r,plain:n,first:a,last:l,transparent:o,divider:i}=e;const s=nd();return c().createElement("div",{className:S()(t,s.decorator)},c().createElement("div",{className:S()(s.lineBlock,{[s.withLinePadding]:a})},!o&&c().createElement(c().Fragment,null,c().createElement("div",{className:s.noLine}),c().createElement("div",{className:S()(s.line,{[s.plain]:n},{[s.last]:l})}))),c().createElement("div",{className:s.content},r,i&&c().createElement(qc.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let ld={};const od=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let id=0;function sd(){return sd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sd.apply(this,arguments)}const cd=e=>c().createElement("svg",sd({width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"CollaborationIcon_svg__a"})),c().createElement("g",{transform:"translate(-2 -2)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"CollaborationIcon_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#CollaborationIcon_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#CollaborationIcon_svg__b)",d:"M0 0h24v24H0z"}))),ud=e=>{let{task:t,children:r,actions:n,Icon:a}=e;const{taskId:l,dueDate:o,priority:i,assignee:u,createdBy:d,createTime:p,displayName:m,processDefinitionDisplayName:h,objectURIs:g,processInstanceComments:f,possibleActions:b,isOpen:y}=t,E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,I.pipe)(Zu,(0,I.unless)(I.isNil,(0,I.pipe)((0,I.split)("/"),(0,I.nth)(1))))(e)}(g),v=(e=>{let{processDefinitionDisplayName:t}=e;const r=t;return ld[r]||(ld[r]=od[id],id++,id>od.length-1&&(id=0)),ld[r]})({processDefinitionDisplayName:h}),x=Du({color:v}),[w,O]=(0,s.useState)(!1),T=Au()("VIEW_PROCESS_INSTANCE_COMMENTS");return c().createElement("div",{className:x.card},c().createElement("div",{className:S()({[x.withBackground]:w})},c().createElement("div",{className:x.lineWrapper},c().createElement("div",{className:x.line}),a&&c().createElement(a,{className:x.icon}),c().createElement(ad,{plain:!0,first:!0,transparent:!w},c().createElement("div",{className:x.mainInfo},c().createElement("div",{className:x.title},c().createElement("div",{className:S()(x.caption,x.flex)},h),c().createElement(Bn.Z,{className:x.flag}),c().createElement(ze.ZP,{title:C().text("Due date")},c().createElement("span",{className:x.date},C().date(o,"L"))),c().createElement(or.Z,{isOpen:w,size:"L",onClick:()=>{O(!w)}})),c().createElement("div",{className:x.infoBlock},c().createElement("div",{className:x.flex},E&&c().createElement("div",{className:x.info},C().text("DCR ID"),": ",c().createElement("span",{className:x.infoValue},E)),c().createElement("div",{className:x.info},C().text("Created by"),": ",c().createElement("span",{className:x.infoValue},d)," ",C().text("on")," ",c().createElement("span",{className:x.infoValue},C().date(p,"L"))),c().createElement("div",{className:x.info},C().text("Step"),": ",c().createElement("span",{className:x.infoValue},m)),T&&(null==f?void 0:f.length)>0&&c().createElement("div",{className:x.commentsInfo},c().createElement(cd,{className:x.commentsIcon}),c().createElement("div",{className:x.infoValue},f.length))),n||c().createElement(rd,{taskId:l,possibleActions:b,assignee:u,isTaskOpen:y}))))),w&&c().createElement(ad,{plain:!0},c().createElement("div",{className:x.controlsBox},c().createElement("div",{className:x.controlsInRow},c().createElement(Bu,{taskId:l,dueDate:o,isTaskOpen:y}),c().createElement(Uu,{taskId:l,priority:i,className:x.priority,isTaskOpen:y})),c().createElement(Vu,{taskId:l,assignee:u,isTaskOpen:y})))),w&&c().createElement(c().Fragment,null,r,T&&c().createElement("div",{className:x.comments},c().createElement(td,{taskId:l,processInstanceComments:f,isTaskOpen:y}))))};function dd(){return dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dd.apply(this,arguments)}const pd=e=>c().createElement("svg",dd({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#42A5F5",cx:14,cy:14,r:14}),c().createElement("path",{d:"M16.43 9.87c0 1.59 1.25 2.87 2.79 2.87 1.53 0 2.78-1.28 2.78-2.87C22 8.29 20.75 7 19.22 7c-1.54 0-2.79 1.29-2.79 2.87zm1.4 0c0-.79.62-1.43 1.39-1.43.77 0 1.39.64 1.39 1.43 0 .79-.62 1.44-1.39 1.44-.77 0-1.39-.65-1.39-1.44zm-6.26 8.26c0-1.59-1.25-2.87-2.79-2.87-1.53 0-2.78 1.28-2.78 2.87C6 19.71 7.25 21 8.78 21c1.54 0 2.79-1.29 2.79-2.87zM8.09 9.15v4.31h1.39v-2.87h2.78v2.15l2.78-2.87L12.26 7v2.15H8.09zm11.82 9.7v-4.31h-1.39v2.87h-2.78v-2.15l-2.78 2.87L15.74 21v-2.15h4.17z",fill:"#FFF",opacity:.87})));let md,hd;!function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(md||(md={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(hd||(hd={}));var gd=r(26978);const fd=(e,t)=>{switch(e){case hd.CREATE_RELATIONSHIP:case hd.INSERT_ATTRIBUTE:return md.ADDED;case hd.UPDATE_TAGS:case hd.UPDATE_ROLES:case hd.UPDATE_ATTRIBUTE:return md.EDITED;case hd.DELETE_ATTRIBUTE:case hd.DELETE_RELATIONSHIP:return md.DELETED;case hd.PIN_ATTRIBUTE:return null!=t&&t.pin?md.PIN_DELETED:md.PINNED;case hd.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?md.IGNORE_DELETED:md.IGNORED}},bd=e=>({[md.ADDED]:C().text("added"),[md.EDITED]:C().text("edited"),[md.DELETED]:C().text("deleted"),[md.PINNED]:C().text("pinned"),[md.PIN_DELETED]:C().text("pin deleted"),[md.IGNORED]:C().text("ignored"),[md.IGNORE_DELETED]:C().text("ignore deleted")}[e]||""),yd=(e,t)=>(0,I.when)((0,I.allPass)([(0,I.pipe)((0,I.prop)("type"),(0,I.equals)(u.oS0.TYPE_STRING)),()=>(0,u.CBv)(t)]),(0,I.evolve)({type:(0,I.always)(u.oS0.TYPE_URL)}))((0,u.PFL)(e));function Ed(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vd(e,t,r[t])}))}return e}function vd(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,t)=>{if("newValue"in e||"oldValue"in e){const{newValue:r,oldValue:n,type:a}=e,l=(0,I.pathOr)([],["value",t.name])(r),o=(0,I.pathOr)([],["value",t.name])(n),i=Math.max(l.length,o.length);return(0,I.times)((e=>[{value:{newValue:l[e],oldValue:o[e],type:a}}]),i)}const r=e[t.name];return r?[r]:[]},wd=(0,I.curry)(((e,t,r)=>{const n=(0,gd.U)(e,t.type,[],[]);return Td(e,n,r)})),Od=(0,I.curry)(((e,t,r,n)=>{const a=(0,u.V3K)(e,t.type),l=(0,u.xF8)(e,t.type);return(0,I.flatten)([Ed({level:1,label:(0,I.propOr)("","label",a),attributeType:a,attributeValue:Ed({},t,r)},((e,t)=>{if(t===hd.CREATE_RELATIONSHIP||(0,u.O27)(e)){const e=fd(t);return e?{operation:e}:{}}return{}})(r,n)),Td(e,l,r,2)])})),Td=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,I.flatten)(t.map((t=>xd(r,t).map((r=>r.map((r=>Cd(e,t,r,n))))))).filter((0,I.complement)(I.isEmpty)))},Cd=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return Id(e,t,r,n);case u.oS0.TYPE_REFERENCE:return kd(e,t,r,n);default:{const e=((e,t)=>{const r=(0,u.kqr)(e)?t:t.value;return(0,I.is)(Object,r)?r:{newValue:t,type:hd.INSERT_ATTRIBUTE}})(t,r);return Sd(t,e,n)}}},Id=(e,t,r,n)=>{const a=(0,u.EUG)({},t);return[{level:n,label:(0,u.idV)((null==t?void 0:t.label)||(null==t?void 0:t.name)),attributeType:t,attributeValue:r},Td(e,a,r.value,n+1)]},kd=(e,t,r,n)=>{const a=(0,u.EUG)(e,t);return[{level:n,label:(null==t?void 0:t.label)||(null==t?void 0:t.name),attributeType:t,attributeValue:r},Td(e,a,r.value,n+1)]},Sd=(e,t,r)=>{const{newValue:n,oldValue:a,type:l}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===hd.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t);return{attributeType:e,newValue:n,oldValue:a,operation:fd(l,a),label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function Pd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Nd(e,t,r[t])}))}return e}function Nd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dd=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],Rd=e=>{let{newValue:t,oldValue:r}=e;const n=e=>isNaN(e)||(0,u.O27)(e)?e:parseInt(e),a=e=>(null==e?void 0:e.length)&&!(0,u.O27)(e)&&!(0,u.O27)(e[0]),l=a(t),o=a(r);return l&&o?[{type:hd.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:l?[{type:hd.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:o?[{type:hd.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},_d=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,l=a===hd.UPDATE_ROLES?(0,u.xqc)(e):I.identity,o=(0,I.difference)(r,n),i=(0,I.difference)(n,r),s=[];return o.length&&s.push({type:hd.INSERT_ATTRIBUTE,newValue:{value:o.map(l).join(", ")}}),i.length&&s.push({type:hd.DELETE_ATTRIBUTE,oldValue:{value:i.map(l).join(", ")}}),s},Ad=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,l=t===hd.INSERT_ATTRIBUTE?(0,u.Zmi)(r):r;if(n){const e=a.split("/attributes/"),t=n.split("/")[1];return[e[1],t,l].join("/")}return l})(t),n=r.split("/");let a=e;for(let e=0;e<n.length-1;e+=2){var l;const r=n[e],o=n[e+1],i=(a[r]||[]).find((0,I.propEq)("id",o)),s=n.length===e+2?t:{},c=i||{id:o,value:s},u=(null===(l=t.refObjectURI)||void 0===l?void 0:l.indexOf(o))>=0&&t.refObjectURI;u&&(c.refObjectURI=u),(0,I.isNil)(i)&&(a[r]=(a[r]||[]).concat(c)),a=c.value}return e},Zd=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:l,tags:o,defaultProfilePicValue:i}=t,s=Pd({},r);return i&&(s.defaultProfilePicValue=[i]),l&&(s[u.xPW.roles.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:l.map((0,u.xqc)(e)).join(", ")}}]),o&&(s[u.xPW.tags.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:o.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},jd=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case hd.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case hd.UPDATE_TAGS:n[u.xPW.tags.name]=_d(e,r);break;case hd.UPDATE_ROLES:n[u.xPW.roles.name]=_d(e,r);break;case hd.UPDATE_START_DATE:n[u.xPW.startDate.name]=Rd(r);break;case hd.UPDATE_END_DATE:n[u.xPW.endDate.name]=Rd(r);break;case hd.CREATE_RELATIONSHIP:case hd.CREATE_ENTITY:return Pd({},n,Zd(e,r.newValue));case hd.INSERT_ATTRIBUTE:case hd.UPDATE_ATTRIBUTE:case hd.DELETE_ATTRIBUTE:case hd.PIN_ATTRIBUTE:case hd.IGNORE_ATTRIBUTE:Ad(n,r)}return n},Md=(0,D.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Ld=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const l=Md();return c().createElement(kt.Z,{component:"button",variant:"caption",underline:"none",onClick:n,className:a},c().createElement("span",{className:l.linkLabel},r?C().text("View less suggestions"):C().text("View ${suggestionsCount} more suggestions",{suggestionsCount:t})))};var Vd=r(43525),Fd=r(7089);const Bd=(0,D.Z)((e=>({field:{fontSize:"12px",lineHeight:"20px",color:e.palette.text.primary,marginTop:"6px",overflow:"hidden",wordBreak:"break-word"},fieldName:{color:e.palette.text.secondary,marginRight:"8px"},difference:{marginRight:"8px"},arrow:{margin:"0 4px",fontSize:"12px",color:e.palette.text.primary},chip:{height:"20px",fontSize:"10px",fontWeight:500,lineHeight:"16px",letterSpacing:0,flexShrink:0,textTransform:"capitalize",color:e.palette.primary.main,borderColor:e.palette.primary.main,"&.edited":{color:"#CC7500",borderColor:"#CC7500"},"&.added":{color:"#599E0E",borderColor:"#599E0E"},"&.deleted":{color:"#CF0E26",borderColor:"#CF0E26"}}}))),Ud=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:l}=e;const o=Bd(),i=r||n;return c().createElement("div",{className:S()(o.field,l)},c().createElement("span",{className:o.fieldName},t,":"),!(0,I.isNil)(i)&&c().createElement("span",{className:o.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(Vd.Z,{className:o.arrow}),n)),a&&c().createElement(Fd.Z,{variant:"outlined",label:bd(a),className:S()(o.chip,a)}))},Hd=c().createContext(null);Hd.displayName="AttributesChangesContext";const zd=(0,D.Z)((e=>({linkContainer:{textDecoration:"none",cursor:"pointer",marginLeft:"4px"},linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},disabledLink:{pointerEvents:"none",cursor:"default"},label:{color:e.palette.text.primary},change:e=>{let{level:t=0}=e;return{marginLeft:16*t+"px"}}}))),Wd=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:l,newValue:o,operation:i}=e;const d=zd({level:r}),p=(0,At.useSelector)(Zt.ZP.selectors.getEntityUri),m=(0,s.useContext)(Hd),h=(0,s.useCallback)((()=>{if((0,u.YkG)(n)){const e=(0,I.when)((0,I.anyPass)([(0,I.hasPath)(["value","newValue"]),(0,I.hasPath)(["value","oldValue"])]),(0,I.ifElse)((0,I.hasPath)(["value","newValue"]),(0,I.path)(["value","newValue"]),(0,I.path)(["value","oldValue"])))(a);return function(e,t,r){let n,a,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=l[t.refObjectURI];return o?(a=r===o.startObjectUri?o.endObjectUri:o.startObjectUri,n=r===o.startObjectUri?o.endObjectLabel:o.startObjectLabel):t.refEntity&&(a=t.refEntity.objectURI,n=l[a].label),{objectUri:a,objectLabel:n}}(n,e,p,m)}if("endObject"in n){const{endObjectUri:e,endObjectLabel:t}=a;return{objectUri:e,objectLabel:t}}}),[n,a,p,m]),g=(0,s.useCallback)((()=>{const{objectUri:e,objectLabel:t}=h()||{};if(!(0,I.isNil)(e)&&!(0,I.isNil)(t)){var r;const n=!1===(null===(r=m[e])||void 0===r?void 0:r.isExist);return c().createElement(jr.Z,{value:e,className:S()(d.linkContainer,{[d.disabledLink]:n})},c().createElement("span",{className:S()(d.linkLabel,{[d.label]:n})},(0,u.idV)(t)))}return null}),[h,m,d]),f=(0,s.useMemo)((()=>c().createElement("span",null,t,g())),[t,g]),b=(0,s.useCallback)((e=>{const t=(0,u.kDl)(e);return c().createElement(br.Z,{value:t,dataTypeDefinition:yd(n,t)})}),[n]);return c().createElement(Ud,{className:d.change,label:f,oldValue:l&&b(l),newValue:o&&b(o),operation:i})},Gd=(0,D.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function qd(){return qd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qd.apply(this,arguments)}const Kd=e=>{let{changes:t}=e;const r=Gd();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,I.has)("level",e)?c().createElement(Wd,qd({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Yd=(0,I.pipe)((0,I.filter)((0,I.has)("operation")),I.length),$d=(0,D.Z)((e=>({container:{boxSizing:"border-box",border:"1px solid rgba(0,0,0,0.03)",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.03)",padding:"10px",margin:"12px 16px 12px 0"},uri:{color:e.palette.primary.main,textDecoration:"none",cursor:"pointer"},label:{fontSize:"12px",letterSpacing:0,lineHeight:"16px"},showMoreLink:{marginTop:"8px"}}))),Xd=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:l}=e;const o=$d(),i=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),[d,p]=(0,s.useMemo)((()=>((e,t,r,n)=>{const a=t=>(0,I.pipe)((0,I.pick)([t]),wd(e,r)),l=(0,I.curry)(((e,t)=>(0,I.reduce)(((e,r)=>(0,I.concat)(e,r(t))),[],e))),o=(0,I.propOr)([],r.uri)(t).reduce(((t,n)=>jd(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,I.propOr)([],r.uri)(t).reduce(((t,n)=>jd(e,r,n,t)),{}))(e,t,r)));return[l([(0,I.pipe)((0,I.omit)(Dd),wd(e,r)),a(u.xPW.roles.name),a(u.xPW.tags.name),a(u.xPW.startDate.name),a(u.xPW.endDate.name)],o),(0,I.flatten)(n.map(((r,n)=>{const a=(0,I.path)([r.uri,0,"type"],t);return Od(e,r,i[n],a)})))]})(i,t,n,a)),[i,t,n,a]),m=(0,s.useMemo)((()=>{const e={label:C().text("Relationships")};return p.length>0?(0,I.flatten)([d,e,p]):d}),[d,p]),{isExpanded:h,onToggle:g,itemsToShow:f,collapsedSuggestionsCount:b}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const[r,n]=(0,s.useState)(!1),a=(0,s.useCallback)((()=>n((e=>!e))),[]),l=(0,s.useMemo)((()=>e.slice(0,t)),[e,t]),o=(0,s.useMemo)((()=>Yd(e)),[e]),i=(0,s.useMemo)((()=>Yd(l)),[l]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:l,collapsedSuggestionsCount:o-i}}(m,l);return c().createElement(Hd.Provider,{value:r},c().createElement("div",{className:o.container},c().createElement(jr.Z,{className:o.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:o.label},(0,u.idV)(n.label))),c().createElement(Kd,{changes:f}),b>0&&c().createElement(Ld,{onClick:g,suggestionsCount:b,isExpanded:h,className:o.showMoreLink})))};function Qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jd(e,t,r[t])}))}return e}function Jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ep=(0,I.filter)((0,I.pipe)((0,I.prop)("uri"),u.WgC)),tp=(0,I.filter)((0,I.pipe)((0,I.prop)("uri"),u.bC9)),rp=(e,t)=>(0,I.filter)((0,I.allPass)([(0,I.pipe)((0,I.prop)("uri"),u.bC9),(0,I.pipe)((0,I.prop)("startObjectUri"),(0,I.equals)(t))]))(e),np=(0,I.curry)(((e,t)=>({entity:t,relations:rp(e,t.uri)}))),ap=(0,I.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:Qd({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),lp=(e,t)=>{const{entity:r,relations:n}=t,{uri:a}=r,l=(0,I.pipe)((0,I.pathOr)([],[a,"relations"]),(0,I.concat)(n),I.uniq)(e);return e[a]={entity:r,relations:l},e};function op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ip=e=>{let{task:t}=e;const{objectURIs:r}=t,n=Zu(r),{dcr:a,groupedObjects:l}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),l=(0,Mt._)(),o=(0,s.useCallback)((e=>(0,I.isEmpty)(e)?Promise.resolve([]):l((0,u.DnY)(e,{searchOptions:"ovOnly",defaultMaxValues:1}))),[]);return(0,s.useEffect)((()=>{(0,u.E6I)(e).then((e=>{const{changes:t,objectsInfo:n}=e,l=((e,t)=>(0,I.pipe)(I.keys,(0,I.filter)((t=>(0,I.prop)([t],e))),(0,I.map)((e=>Qd({},t[e],{uri:e}))))(t))(t,n),i=(0,I.pipe)(ep,(0,I.map)(np(l)))(l),s=(0,I.pipe)(tp,(0,I.map)(ap(n)))(l),[c,u]=(0,I.partition)((0,I.has)("entity"),s),d=u.map((0,I.path)(["relations",0,"startObjectUri"]));o(d).then((e=>{const t=u.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){op(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,I.pipe)(I.flatten,(0,I.reduce)(lp,{}),I.values,r)([i,c,t])})).catch(_u),a(e)})).catch(_u)}),[e,o]),{dcr:n,groupedObjects:t}})(n);return c().createElement(ud,{task:t,Icon:pd},a&&l.map(((e,t)=>c().createElement(ad,{key:t,last:t===l.length-1,divider:!0},c().createElement(Xd,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},sp=(0,D.Z)({pmCard:{marginLeft:"-15px"}});function cp(){return cp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cp.apply(this,arguments)}const up=e=>c().createElement("svg",cp({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#1976D2",cx:14,cy:14,r:14}),c().createElement("path",{d:"M22.5 14L18 9.5V13h-3.5L9 7.5 7.5 9l6.04 6H18v3.5l4.5-4.5zm-11.46 1.46L7.5 19 9 20.5l3.54-3.54-1.5-1.5z",fill:"#FFF",opacity:.87})));const dp=e=>(0,s.useCallback)((e=>{let t={},r=[];return async n=>{let{max:a,offset:l,force:o}=n,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(n,["max","offset","force"]),s=o;const c=Object.keys(t);if(s=s||!(0,I.equals)(Object.keys(i),c),!s)for(const e of c)s=s||!(0,I.equals)(t[e],i[e]);return s&&(r=await e(i),t=i),{response:r.slice(l,l+a),total:r.length,originalResponse:r}}})(e),[e]),pp=e=>{let{enabled:t,entity:r,filter:n,onFinishLoading:a,onStartLoading:l,options:o,page:i,rowsPerPage:c,sorting:d}=e;const{order:p,field:m}=d||{},[h,g]=(0,s.useState)(0),[f,b]=(0,s.useState)([]),[y,E]=(0,s.useState)({}),v=(0,At.useSelector)(Zt.ZP.selectors.getTenant),x=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),w=(0,At.useSelector)(Zt.ZP.selectors.getDataTenants),O=(0,s.useMemo)((()=>({dtssPath:x,dataTenants:w,entity:r,customerTenant:v,dtssRequest:u.Rgl})),[x,w,r,v]),T=(0,s.useCallback)((0,u.U_T)(O,u.SP6),[O]),C=dp(T),k=dp(u.bFH),S=(0,I.prop)("uri",r),P=(0,Mt._)(),N=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t||(0,u.ZiX)(S))return g(0),b([]),void E({});null==l||l(),P((0,u.biM)(r)?k({dtssPath:x,entity:r,customerTenant:v,offset:i*c,max:c,force:e}):C({entityUri:S,offset:i*c,max:c,filter:n,sort:m,order:p,force:e,deep:o.showTransitiveMatches?void 0:1,activeness:o.showInactiveEntities?u.YJ7.ALL:u.YJ7.ACTIVE_ONLY})).then((e=>{const{response:t,total:r,originalResponse:n}=e;g(r),b(t),(0,u.B1H)(n).length>0&&E((0,u.KPC)(n))})).finally((()=>{null==a||a()}))}),[x,t,S,m,n,k,C,a,l,o,p,i,c,P,v]);return(0,s.useEffect)((()=>{N()}),[N]),{total:h,matches:f,entitiesMap:y,loadMatches:(0,s.useCallback)((()=>{N(!0)}),[N])}},mp=(0,D.Z)({root:{display:"flex",flexDirection:"column",paddingRight:"12px",paddingTop:"8px",paddingBottom:"8px","& + &":{borderTop:"1px solid rgba(0,0,0, 0.12)"}},profileCardWrapper:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},profileCardContainer:{flexGrow:1},rulesContainer:{paddingLeft:"40px"}}),hp=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:l,className:o}=e;const i=mp();return c().createElement("div",{className:S()(i.root,o)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Kn.Z,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(Nn,{match:a,metadata:l,entitiesMap:r,entity:n})))},gp={showTransitiveMatches:!0,showInactiveEntities:!1},fp=e=>{let{task:t}=e;const r=sp(),{objectURIs:n}=t,a=(0,At.useSelector)(Zt.ZP.selectors.getEntity),l=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),{matches:o,entitiesMap:i}=pp({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:gp}),s=null==o?void 0:o.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(ud,{task:t,Icon:up},s&&c().createElement(ad,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(hp,{metadata:l,entity:a,match:s,entitiesMap:i}))))};function bp(){return bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bp.apply(this,arguments)}const yp=e=>c().createElement("svg",bp({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#205191",cx:14,cy:14,r:14}),c().createElement("path",{d:"M9.667 20.622c-.92 0-1.667-.744-1.667-1.662V8.99c0-.916.747-1.66 1.667-1.66h2.446A1.993 1.993 0 0114 6l.162.006a1.992 1.992 0 011.725 1.323h2.446c.92 0 1.667.745 1.667 1.662v9.97c0 .917-.747 1.661-1.667 1.661zm9-1.33V8.66h-1.334v1.993h-6.666V8.66H9.333v10.634h9.334zM15.86 14.46v1.302h-5.206V14.46h5.206zm1.494-2v1.302h-6.7V12.46h6.7zM14 7.33c.367 0 .667.298.667.664a.668.668 0 01-1.334 0c0-.366.3-.665.667-.665z",fill:"#FFF",opacity:.87})));function Ep(){return Ep=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ep.apply(this,arguments)}const vp=e=>c().createElement("svg",Ep({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",opacity:.87},c().createElement("circle",{fill:"#0D47A1",cx:14,cy:14,r:14}),c().createElement("path",{d:"M8.17 9.824v8.995c0 .886.72 1.606 1.607 1.606h8.352c.192 0 .375-.035.546-.097l1.38 1.382.804-.804-1.32-1.32-1.09-1.089-8.993-8.994-1.092-1.092-1.317-1.317-.803.803L8.17 9.824zm9.316 9.316h-8.03v-8.03l8.03 8.03zM9.777 7.575c-.192 0-.376.033-.55.094L10.42 8.86h.32v.322l1.607 1.606h4.819V8.86h1.284v8.03l1.285 1.286V9.182c0-.887-.72-1.607-1.606-1.607h-2.358a1.931 1.931 0 00-1.818-1.285 1.93 1.93 0 00-1.818 1.285H9.777zm3.533.643c0-.353.29-.643.643-.643.353 0 .642.29.642.643a.644.644 0 01-.642.642.644.644 0 01-.643-.642z",fill:"#FFF"})));class xp{}xp.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement(ip,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(fp,{task:t});case u.Yj_.recommendForDelete:return c().createElement(ud,{task:t,Icon:vp});default:return c().createElement(ud,{task:t,Icon:yp})}};const wp=xp,Op=e=>{let{task:t}=e;return wp.build({task:t})};var Tp=r(65549),Cp=r(86619),Ip=r(8560),kp=r(37265);const Sp=(0,D.Z)((e=>({popoverPaper:{width:"464px"},title:{fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",color:e.palette.text.primary,marginBottom:"17px"},content:{display:"flex",flexDirection:"column",padding:"23px 24px 14px 24px"},simpleDropDownSelector:{marginBottom:"20px"},inputRoot:{paddingTop:"0 !important",paddingBottom:"0 !important"},select:{fontSize:"14px"},footer:{display:"flex",justifyContent:"flex-end",padding:"5px 8px 8px",borderTop:"1px solid rgba(0,0,0,0.12)"},cancelButton:{marginRight:"8px"},input:{fontSize:"14px"}}))),Pp=e=>{let{anchorEl:t,onClose:r}=e;const n=Sp(),[a,l]=(0,s.useState)(""),[o,i]=(0,s.useState)(null),[d,p]=(0,s.useState)(!1),{definitions:m}=(()=>{const[e,t]=(0,s.useState)([]),r=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),n=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,At.useSelector)(Zt.ZP.selectors.getTenant),l=(0,At.useSelector)(Zt.ZP.selectors.getEntity).type;return(0,s.useEffect)((()=>{(0,u.IU6)({workflowPath:r,environment:n,tenant:a}).then((e=>{let{data:r}=e;return t(((e,t)=>e.filter((e=>{let{manualStart:r,objectTypes:n}=e;return r&&(!n||(null==n?void 0:n.some((e=>e===t))))})))(r,l))}))}),[l,r,n,a]),{definitions:e}})(),{processInstance:h,loading:g}=(()=>{const{loadWorkflowTasks:e}=(0,s.useContext)(Ru),t=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),r=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),n=(0,At.useSelector)(Zt.ZP.selectors.getTenant),a=(0,At.useSelector)(Zt.ZP.selectors.getEntity).uri,[l,o]=(0,s.useState)(!1);return{processInstance:(0,s.useCallback)(((l,i)=>(o(!0),(0,u.$ju)({workflowPath:t,tenant:n,environment:r,processType:i,comment:l,objectURIs:[a]}).then((()=>{e()})).catch((e=>{throw _u(e),e})).finally((()=>{o(!1)})))),[a,r,e,n,t]),loading:l}})(),f=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(mo.ZP,{open:f,anchorEl:t,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},classes:{paper:n.popoverPaper}},c().createElement("div",{className:n.content},c().createElement(N.Z,{className:n.title},C().text("Add new workflow")),c().createElement(kl.Z,{className:n.simpleDropDownSelector,variant:"filled",height:40,TextFieldProps:{InputProps:{disableUnderline:!0}},placeholder:C().text("Select task type"),value:o,onChange:e=>{i(e)},label:"",options:m.map((e=>({value:e.type,label:e.displayName})))}),c().createElement(Cp.Z,{variant:"filled",hiddenLabel:!0,size:"small",placeholder:"Type a comment",InputProps:{disableUnderline:!0,classes:{input:n.input,root:n.inputRoot}},value:a,onChange:e=>{l(e.target.value)},multiline:!0})),c().createElement("div",{className:n.footer},c().createElement(Fo.Z,{disabled:g,className:n.cancelButton,onClick:r},C().text("Cancel")),c().createElement(Fo.Z,{disabled:g,color:"primary",onClick:()=>{h(a,null==o?void 0:o.value).then((()=>{p(!0),l(""),i(null),r()})).catch((()=>{}))}},C().text("Start")))),c().createElement(Ip.Z,{container:document.body},c().createElement(kp.Z,{open:d,autoHideDuration:5e3,onClose:()=>{p(!1)},message:C().text("A new workflow has started")})))},Np=(0,D.Z)({button:{padding:"9px 16px 9px 12px",marginLeft:"auto",marginRight:"8px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),Dp=()=>{const e=Np(),[t,r]=(0,s.useState)(null),n=Au(),a=n("START_PROCESS_INSTANCE"),l=n("VIEW_PROCESS_DEFINITIONS");return a&&l?c().createElement(c().Fragment,null,c().createElement(Fo.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement(Tp.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},C().text("Add"))),c().createElement(Pp,{anchorEl:t,onClose:()=>r(null)})):null};function Rp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _p=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,Mt._)(),l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.isWorkflowEnabled),c=(0,At.useSelector)(Zt.ZP.selectors.getTenant),d=(0,At.useSelector)(Zt.ZP.selectors.getEntityUri),p=(0,At.useSelector)(Zt.ZP.selectors.getIsEditableMode),m=Au()("VIEW_TASKS"),h=!(!l||!o)&&i&&m,[g,f]=(0,s.useState)(null),[b,y]=(0,s.useState)(0),[E,v]=(0,s.useState)(!1),x=(0,s.useCallback)((()=>{v(!0);const e=!Array.isArray(t)||t.includes("*")?null:t,i=(e||[null]).map((e=>(0,u.uT0)({entityUri:d,workflowPath:l,environment:o,tenant:c,filter:{assignee:r,processType:e},includeClosed:!!n})));a(Promise.all(i)).then((t=>{const n=(0,I.pipe)((0,I.map)((0,I.prop)("data")),(0,I.reject)(I.isNil),I.flatten,(0,I.uniqBy)((0,I.prop)("taskId")),(0,I.filter)(Ap(e,r)))(t);f(n),y(n.length)})).catch((e=>{console.warn("Workflow error",e)})).finally((()=>{v(!1)}))}),[d,o,a,c,l,r,n,t]);(0,s.useEffect)((()=>{d&&h&&!(0,u.ZiX)(d)?x():(f(null),y(0))}),[h,d,x,p]);const w=(0,s.useCallback)(((e,t)=>{f((r=>r.map((r=>r.taskId===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){Rp(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:g,total:b,loading:E,updateTaskState:w,loadWorkflowTasks:x}},Ap=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function Zp(){return Zp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zp.apply(this,arguments)}const jp=e=>c().createElement("svg",Zp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M17.045 20.455l1.41-1.41-3.41-3.41-1.41 1.41 3.41 3.41zm-9.5-12.41h3.5v5.59l-5.41 5.41 1.41 1.41 6-6v-6.41h3.5l-4.5-4.5-4.5 4.5z",id:"MergeDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"MergeDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#MergeDark_svg__a",transform:"rotate(90 12.045 12)"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#MergeDark_svg__b)",d:"M0 0h24v24H0z"}))),Mp=(0,D.Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));function Lp(){return Lp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lp.apply(this,arguments)}let Vp;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(Vp||(Vp={}));const Fp=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Vp.iconButton,label:a,disabled:l,icon:o,onClick:i=tt.ZT,onMenuClose:s=tt.ZT}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const d=Mp();return(()=>{switch(n){case"iconButton":return c().createElement(De.k,Lp({disabled:l,className:S()(d.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:o},u));case"button":return c().createElement(Fo.Z,Lp({className:S()(d.button,r),disabled:l,startIcon:c().createElement(o,null),onClick:i,color:"primary",classes:{startIcon:d.startIcon,label:d.label}},u),c().createElement(A.C,{value:a},c().createElement("div",{className:d.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(P.Z,Lp({classes:{root:d.menuItem},onClick:e,disabled:l,ref:t},u),c().createElement(c().Fragment,null,c().createElement(o,{className:d.menuIcon}),c().createElement(N.Z,{classes:{root:d.menuText}},a)))}}})()}));Fp.displayName="ActionButton";const Bp=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:l=tt.ZT}=e;const o=(0,At.useSelector)(Zt.ZP.selectors.getTenant),i=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),[c,d]=(0,s.useState)(!1);return{isPending:c,sendMergeAllRequest:(0,s.useCallback)((()=>{null==a||a(),d(!0);const e={dtssPath:i,customerTenant:o,entity:r,entities:t};((0,u.biM)(r)?(0,u.uJQ)(e):(0,u.OxG)(e)).catch(l).finally((()=>{null==n||n(),d(!1)}))}),[i,t,r,n,a,o])}};function Up(){return Up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Up.apply(this,arguments)}const Hp=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Vp.iconButton,onMenuClose:a=tt.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:d}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest","onError"]);const{sendMergeAllRequest:m}=Bp({entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:d});return c().createElement(Fp,Up({className:r,disabled:l,mode:n,label:C().text("Merge"),icon:jp,onClick:m,onMenuClose:a,ref:t},p))}));function zp(){return zp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zp.apply(this,arguments)}Hp.displayName="mergeButton";const Wp=e=>c().createElement("svg",zp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M17 13.138l4.5 4.5-4.5 4.5V18.5h-1.247l-3.488-3.479 1.413-1.414 2.901 2.893H17v-3.362zM17 1.5L21.5 6 17 10.5V7.138h-.421l-11.03 11H2v-2h2.723l11.03-11H17V1.5zm-11.45 4l3.294 3.286-1.414 1.413L4.723 7.5H2v-2h3.55z",id:"NotMatchDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"NotMatchDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#NotMatchDark_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#NotMatchDark_svg__b)",d:"M0 0h24v24H0z"}))),Gp=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a}=e;const l=(0,At.useSelector)(Zt.ZP.selectors.getTenant),o=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),[i,c]=(0,s.useState)(!1);return{isPending:i,sendMarkAsNotMatchRequest:(0,s.useCallback)((()=>{null==a||a(),c(!0);const e={dtssPath:o,customerTenant:l,entity:r,entities:t};((0,u.biM)(r)?(0,u.bMg)(e):(0,u.fZN)(e)).finally((()=>{null==n||n(),c(!1)}))}),[o,t,r,n,a,l])}};function qp(){return qp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qp.apply(this,arguments)}const Kp=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Vp.iconButton,onMenuClose:a=tt.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest"]);const{sendMarkAsNotMatchRequest:p}=Gp({entity:o,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(Fp,qp({className:r,disabled:l,mode:n,label:C().text("Not a match"),icon:Wp,onClick:p,onMenuClose:a,ref:t},d))}));Kp.displayName="notMatchButton";var Yp=r(62901),$p=r(86602),Xp=r(53857),Qp=r(67462),Jp=r(50548);function em(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tm=e=>{let{actions:t,dispatch:r}=e;return(0,s.useMemo)((()=>Object.entries(t).reduce(((e,t)=>{let[n,a]=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){em(e,t,r[t])}))}return e}({},e,{[n]:(0,I.pipe)(a,r)})}),{})),[r,t])};var rm=r(27536);function nm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){am(e,t,r[t])}))}return e}function am(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lm=[],om=e=>console.error("Collaboration error",e),im=e=>{let{objectIds:t=lm,objectTypes:r,enabled:n=!0}=e;const a=(0,At.useSelector)(Zt.ZP.selectors.getEntity),l=(0,At.useSelector)(Zt.ZP.selectors.getTenant),o=(0,At.useSelector)(Zt.ZP.selectors.getCollaborationPath),i=(0,At.useSelector)(Zt.ZP.selectors.isCollaborationEnabled)&&n,[c,d]=(0,s.useState)(null),[p,m]=(0,s.useState)([]),[h,g]=(0,s.useState)(null),[f,b]=(0,s.useState)(null),[y,E]=(0,s.useState)(!1),[v,x]=(0,s.useState)(!1),w=(0,s.useCallback)((e=>{g((t=>nm({},t,e)))}),[]),O=null==a?void 0:a.uri,T=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&O&&!(0,u.ZiX)(O)){const r=e=>{console.warn("Collaboration error",e),g(null)};(0,I.pipe)(u.$oF,(0,I.andThen)((0,I.map)((0,I.props)(["objectId","comments"]))),(0,I.andThen)(I.fromPairs),(0,I.andThen)(t?g:w),(0,I.otherwise)(r))({uris:e,tenant:l,collaborationPath:o})}else g(null)}),[w,o,O,i,l]);(0,s.useEffect)((()=>{T(t,!0)}),[t,T]);const C=(0,s.useCallback)(((e,t)=>{(0,u.liG)({collaborationPath:o,tenant:l,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:r,nextPageToken:n}=e;m((e=>t?(0,I.uniqBy)((0,I.prop)("commentId"),[...e,...r]):r)),d(n)})).catch(om)}),[o,l]),k=(0,s.useCallback)((e=>{x(!0),(0,u.d7q)({collaborationPath:o,tenant:l,commentId:e}).then(b).catch(om).finally((()=>x(!1)))}),[o,l]),S=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i}=e;E(!0);const s={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:""};return(0,u.Yrx)({collaborationPath:o,tenant:l,data:s}).then((e=>{let[t]=e;return((e,t)=>{b(e),g((r=>nm({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),m((t=>[e,...t]))})(t,a)})).catch(om).finally((()=>E(!1)))}),[o,l]),P=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i,commentId:s,replies:c}=e;E(!0);const d={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:"",commentId:s,replies:c};return(0,u.uAg)({collaborationPath:o,tenant:l,data:d}).then((e=>(e=>{b(e),m((0,I.map)((0,I.when)((0,I.propEq)("commentId",e.commentId),(0,I.always)(e))))})(nm({},e,{replies:c})))).catch(om).finally((()=>E(!1)))}),[o,l]),N=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;E(!0),(0,u.YFy)({collaborationPath:o,tenant:l,commentId:r}).then((()=>((e,t)=>{b(null),g((r=>{const n=r[t]||[];return nm({},r,{[t]:n.filter((t=>t.commentId!==e))})})),m((t=>t.filter((t=>t.commentId!==e))))})(r,t))).catch(om).finally((()=>E(!1)))}),[o,l]),D=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";b("resolved"===n?e=>{if(e)return null}:t=>{if(t)return nm({},t,{replies:[...t.replies,e]})}),g((e=>nm({},e,{[t]:(e[t]||[]).map((e=>e.commentId===r?nm({},e,{status:n,replies:e.replies+1}):e))}))),m((t=>t.map((t=>t.commentId===r?nm({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),R=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,commentId:n,action:a,uri:i}=e;E(!0);const s={content:t,action:a,namedUsers:r};return(0,u.PP2)({collaborationPath:o,tenant:l,commentId:n,data:s}).then((e=>{let[t]=e;return D(t,i,n)})).catch(om).finally((()=>E(!1)))}),[o,l,D]),_=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;R({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[R]),A=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;R({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[R]);return{clearCurrentComment:(0,s.useCallback)((()=>{b(null)}),[]),comments:p,commentsMap:h,createComment:S,createReply:R,currentComment:f,deleteComment:N,editComment:P,getComment:k,getComments:C,getCommentsCount:T,loading:v,objectTypes:r,pageToken:c,reOpenThread:A,resolveThread:_,sending:y}};var sm=r(90690);function cm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){um(e,t,r[t])}))}return 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 dm=(0,I.when)(I.identity,(0,I.pipe)(u.VGB,I.length,(0,I.times)((e=>e+1)))),pm=e=>{let{sorting:t,filter:r,page:n,rowsPerPage:a,config:l,entity:o,relationActivityFilter:i,mode:c}=e;const[d,p]=(0,s.useState)(!1),m=(0,At.useDispatch)(),h=(0,At.useSelector)(Zt.ZP.selectors.getTenant),g=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),{activityFilter:f,globalFilter:b}=(0,At.useSelector)(Zt.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(0,Mt._)(),E=l.suggested,v=(0,s.useCallback)((()=>{if(null!=o&&o.uri){const e=cm({},l.content,{sortBy:null==t?void 0:t.field,order:null==t?void 0:t.order,returnDates:!0,returnObjects:!0,activeness:{relation:i||u.Ng6.ALL,entity:f},max:a,offset:n*a,filter:(0,u.vyX)(b,r)||void 0,suggested:dm(E)}),s=[e].concat((0,I.ifElse)(I.identity,(0,I.pipe)(u.VGB,(t=>t.map(((t,r)=>cm({},t,{id:e.suggested[r]}))))),(0,I.always)([]))(E)),c=(0,I.cond)([[(0,I.pipe)((0,I.prop)("uri"),u.ZiX),()=>Promise.resolve([{total:0}])],[u.biM,e=>(0,u.n_1)({entityUri:e.uri,configs:s,customerTenant:h,dataTenant:e.dataTenant,dtssPath:g})],[I.T,e=>(0,u.N6e)(e.uri,s)]]);p(!0),y(c(o)).then((e=>{let[{connections:t,total:r}]=e;m(Zt.N5.relations.actions.relationsLoaded({id:l.id,connections:t,total:r}))})).finally((()=>{p(!1)}))}}),[f,l,m,g,null==o?void 0:o.uri,null==o?void 0:o.dataTenant,r,b,n,i,a,y,t,h]),x=(0,s.useRef)(!1);x.current=!1,(0,s.useEffect)((()=>{x.current=!0,v()}),[v]);const w=(0,sm.D)(c);return(0,s.useEffect)((()=>{c!==u.ARY.Viewing||x.current||w===c||(x.current=!0,v())}),[v,c,w]),{isLoading:d,reload:v}},mm=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var hm=r(11326);const gm=()=>{const[e,t]=(0,s.useState)([]),r=(0,At.useSelector)(Zt.ZP.selectors.getTenant),n=(0,At.useSelector)(Zt.ZP.selectors.getUIPath),a=e=>{console.warn("Users error",e),t([])};return(0,s.useEffect)((()=>{(0,u.kz_)(r,n).then((e=>{let{array:r}=e;return t(r)})).catch(a)}),[r,n]),e};function fm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bm=(e,t)=>{const r=(0,s.useRef)();(0,s.useEffect)((()=>{if(r.current){const n=Object.keys(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){fm(e,t,r[t])}))}return e}({},r.current,t)),a={};n.forEach((e=>{r.current[e]!==t[e]&&(a[e]={from:r.current[e],to:t[e]})})),Object.keys(a).length&&console.log("[why-did-you-update]",e,a)}r.current=t}))};var ym=r(47081),Em=r(76572),vm=r(62228),xm=r(8007),wm=r(65510),Om=r(58142),Tm=r(89575),Cm=r(80687);const Im=c().createContext(!1);Im.displayName="ProfilePerspectiveViewContext";const km=c().createContext("");km.displayName="IdContext";var Sm=r(63929),Pm=r(3064),Nm=r(38309)}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[1006],{28101:(e,t,r)=>{r.d(t,{G:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(39475),s=r(79692),c=r(41128);const u=(0,s.Z)((e=>({container:{display:"flex",flexDirection:"column",flexShrink:0,width:"64px",paddingTop:"8px",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)"},active:{backgroundColor:(0,c.U1)(e.palette.primary.main,.12),"&:after":{content:'""',position:"absolute",height:"42px",width:"3px",backgroundColor:e.palette.primary.main,left:"-8px",borderRadius:"0 6px 6px 0"}},buttonWrapper:{position:"relative",width:"48px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",margin:"2px 8px",color:e.palette.text.secondary,"&$active":{color:e.palette.primary.main}}})));function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}const p=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:l}=e;const s=u();return a().createElement("div",{className:o()(s.container,n)},t.map((e=>{let{id:t}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["id"]);return a().createElement(i.k,d({},n,{size:"S",key:t,className:o()({[s.active]:r===t},s.buttonWrapper),onClick:()=>l(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},11821:(e,t,r)=>{r.d(t,{h:()=>o});var n=r(24328),a=r.n(n);const l=(0,r(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),o=e=>{let{width:t,open:r,children:n}=e;const o=l();return a().createElement("div",{className:o.contentWrapper,style:{width:`${r?t:0}px`}},r&&a().createElement(a().Fragment,null,n))}},98273:(e,t,r)=>{r.d(t,{P:()=>p});var n=r(24328),a=r.n(n),l=r(87685);const o=(0,r(79692).Z)({container:{display:"flex",flexShrink:0,height:"63px",alignItems:"center",borderBottom:"1px solid rgba(0,0,0,0.12)"},icon:{margin:"0 12px"},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"19px 17px"},secondTitle:{fontSize:"14px"}});var i=r(90436),s=r(85256),c=r(87918),u=r.n(c),d=r(39475);const p=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:c,rightContent:p}=e;const m=o();return a().createElement("div",{className:m.container},a().createElement(d.k,{size:"L",icon:l.default,onClick:t,className:m.icon,tooltipTitle:u().text("Close")}),c||a().createElement(a().Fragment,null,a().createElement(i.Z,{variant:"h6"},r),n&&a().createElement(a().Fragment,null,a().createElement(s.Z,{orientation:"vertical",flexItem:!0,className:m.divider}),a().createElement(i.Z,{variant:"body1",color:"textSecondary",className:m.secondTitle},n)),p))}},21210:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(89810),a=r(79779),l=r(24328),o=r.n(l),i=r(52730),s=r(42639);const c=e=>{let{sourceType:t,className:r,classes:l}=e;const c=(0,i.useSelector)(n.ZP.selectors.getMetadata),{label:u,icon:d}=(0,a.PWK)(c,t);return o().createElement(s.Z,{className:r,avatarText:u[0],icon:d?(0,a.vPL)("https://s3.amazonaws.com/reltio.images/api",d):null,variant:"square",rootClasses:l})}},61006:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>Xp.S,ActionButton:()=>Fp,ActionButtonMode:()=>Vp,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>l.I,AddWorkflowButton:()=>Dp,ArrowExpandButton:()=>cn.Z,AsyncMountContext:()=>vm.g,AttributeListItem:()=>m.Z,AttributeTitle:()=>Dl.Z,AttributesList:()=>f.Z,AttributesPager:()=>W.ZP,AttributesTable:()=>Cs,AttributesView:()=>h.Z,AutoSizeList:()=>se.Z,AvatarWithFallback:()=>ce.Z,BarChart:()=>Yt.Z,BasicTable:()=>ue.Z,BasicTableContext:()=>pe.X,BasicTablePagination:()=>$e.Z,BasicView:()=>Gt.Z,BasicViewContent:()=>qt.Z,BasicViewHeader:()=>Kt.Z,BlockImageGalleryDialogContext:()=>Om.P,BranchDecorator:()=>g.Z,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>$p.U,CardinalityMessage:()=>G.Z,ChartsFactory:()=>Jt.Z,ClickAwayProvider:()=>ar,CollaborationContext:()=>Tm.h,CollaborationItem:()=>lr.J,CollapseButton:()=>or.Z,CollapseRowButton:()=>yt.Z,ColorBar:()=>ir.Z,ColumnFilterType:()=>he.Dq,ColumnsDataType:()=>he.uz,ColumnsSettings:()=>Be,CommentsContainer:()=>sr.Z,ConfigureColumnsPopup:()=>pr.Z,ConfirmDeleteDialog:()=>Oi,ConfirmationDialog:()=>yi.Z,ConnectionRelationTypeSelector:()=>fr,CrosswalkDragLayer:()=>_s,CrosswalkEditor:()=>tc,CrosswalkType:()=>As,CrosswalksDisplayProvider:()=>Kl,DEFAULT_OVERLAY_OPTIONS:()=>Qp.r,DataTypeValue:()=>br.Z,DataTypeValueEditor:()=>kr.Z,DateEditor:()=>Ir.Z,DateRangeEditor:()=>Cr.Z,DateRangeTypes:()=>cc.K,DefaultCellValueRenderer:()=>Xe.Z,DeltaTypes:()=>o.w,Drawer:()=>yr.Z,DropDownEditor:()=>vr.Z,DropDownMenuButton:()=>Er.Z,DropDownSelector:()=>L.Z,DropdownIndicator:()=>cr.Z,DropdownIndicatorWithIconButton:()=>ur.Z,EMPTY_STATE_ICONS:()=>Rr.B9,EMPTY_STATE_VARIANTS:()=>Rr.tC,EditableAttribute:()=>K.Z,EditableImageAttributesLine:()=>ne.Z,EmptyState:()=>Rr.ZP,EmptyStub:()=>tt.Vd,EntitiesMapContext:()=>Pm.X,EntityAvatar:()=>_r.Z,EntityContext:()=>Rm.u,EntityCreator:()=>b.Z,EntityMarkerContext:()=>Nm.P,EntitySelector:()=>y.Z,EntityTypeBadge:()=>Ar.Z,EntityTypeIcon:()=>_.Z,EntityTypesSelector:()=>Zr.Z,EntityUriLink:()=>jr.Z,ErrorBoundary:()=>Mr.Z,ErrorMessage:()=>oc.Z,ErrorPopup:()=>Lr.Z,ErrorWrapper:()=>Vr.Z,ExpandableSearchInput:()=>Hl,ExpandedAttributesProvider:()=>di,ExpandedValueTooltip:()=>A.C,FacetViewHeader:()=>Fr.Z,FileTypeEditor:()=>Pr.Z,FilterButton:()=>Ye,FilterValueEditor:()=>wr.Z,FlipCard:()=>Gr,HideOnShrink:()=>Yr,HierarchicalAttributeTooltip:()=>$r.Z,Highlighter:()=>je.Z,HistoryActivityType:()=>sc,HistoryChangeTypes:()=>Sc,HistoryDiffContext:()=>xm.m,HistoryHeader:()=>vu,HistoryPanelEmptyState:()=>Ou,HistoryView:()=>Gc,IdContext:()=>Sm,ImageAttributesLine:()=>Y.Z,ImageGalleryDialog:()=>Xr.C,ImportButton:()=>Qr.Z,ImportModes:()=>Qr.E,InlineAttributesPager:()=>li,InlineImageAttribute:()=>Jo,InlineNestedAttribute:()=>fi,InlineReferenceAttribute:()=>Go,LightArrowTooltip:()=>lo,LinearLoadIndicator:()=>Jr.Z,Link:()=>tn,LoadingSpinner:()=>rn,MAP_DRAWING_MODES:()=>Qp.vl,MAP_MINIMUM_SCALE_RADIUS:()=>Qp.Pi,Marginator:()=>bi.Z,MatchRulesBlock:()=>Nn,MenuWithPopper:()=>dr.Z,MergeButton:()=>Hp,ModeSwitcher:()=>Dn.Z,ModeSwitcherSelect:()=>Mn,MoreAttributesButton:()=>E.Z,MultiSelect:()=>Xn.Z,MultiValueChip:()=>Or.Z,MultipleInput:()=>Ln.Z,NestedAttribute:()=>ae.Z,NestedAttributeEditor:()=>v.Z,NoData:()=>Nr.J,NoResults:()=>Dr.X,NotMatchButton:()=>Kp,NumberEditor:()=>Tr.Z,OvIcon:()=>Tu.Z,PieChart:()=>$t.Z,PivotingAttributeContext:()=>Im.J,Popper:()=>Vn.Z,PopupBoundariesContext:()=>wm.p,PopupWithArrow:()=>Fn.Z,PotentialMatchReviewCard:()=>Gn,ProfileBand:()=>qn.Z,ProfileBandHistory:()=>wu,ProfileBandNavigation:()=>Wt,ProfileCard:()=>Kn.Z,ProfileMatchCard:()=>hp,ProfilePerspectiveViewContext:()=>km,ProfilesList:()=>Yp.Z,QueryBuilderAttributeDataType:()=>he.eB,QueryBuilderAttributeType:()=>he.Xw,QueryBuilderRow:()=>Yn.Z,QueryBuilderRowsGroup:()=>$n.Z,ReactSelectOptionFilters:()=>Qn.Z,ReactSortableTree:()=>al,ReactSortableTreeHandlers:()=>qa,ReactSortableTreeUtils:()=>ka,ReadOnlyAttribute:()=>q.Z,ReadOnlyAttributeValuesBlock:()=>te,ReadOnlyAttributesList:()=>re.Z,ReadOnlyAttributesPager:()=>ie.Z,ReferenceAttribute:()=>le.Z,ReferenceAttributeEditor:()=>x.Z,RelatedObjectUrisContext:()=>Dm.A,RelationEditor:()=>Nu,RelationTypeSelector:()=>H,ReltioGridLayout:()=>ll.Z,ReltioMap:()=>lc.Z,ResizablePanes:()=>ol.Z,RowCellAutoSizer:()=>bt,Score:()=>il.Z,ScoreLabel:()=>sl.Z,ScrollableTabs:()=>Wl.Z,SearchInput:()=>cl.Z,SelectionPopup:()=>Re.Z,SelectionPopupPopper:()=>fl,SelectorWithOnlyOptionAutoSelect:()=>El,SideButtonsPanel:()=>vl.G,SidePanel:()=>Cl.h,SidePanelContentHeader:()=>Il.P,SidePanelEmptyState:()=>Tl,SimpleAttribute:()=>oe.Z,SimpleAttributeEditor:()=>z.Z,SimpleDropDownSelector:()=>kl.Z,SimpleMatchRulesBlock:()=>yn,SimpleMatchRulesBuilder:()=>xn,SmallIconButton:()=>Sl.Z,SmallIconButtonWithTooltip:()=>De.k,SortingType:()=>he.nI,SourceCrosswalksRow:()=>Js,SourceIcon:()=>Pl.Z,Spacer:()=>Nl.Z,TableContext:()=>pe.X,TableWithBars:()=>Xt.Z,TextEditor:()=>xr.Z,TimestampEditor:()=>Sr.Z,TransitiveMatchBlock:()=>Pn,TreeChart:()=>Qt.Z,UsersContext:()=>Cm.s,VerticalDivider:()=>_l,VerticalHeadingsTable:()=>Ml,ViewIdContext:()=>jt.m,ViewMoreToggle:()=>Ll.Z,VirtualGroupedList:()=>_e.Z,WhiteSearchInput:()=>ul.Z,WorkflowComments:()=>td,WorkflowTaskCard:()=>Op,WorkflowTasksContext:()=>Ru,basicTableViewState:()=>pt,buildColumnsFilter:()=>et.Tz,columnFilterToMdmFilter:()=>et.su,createStandardAction:()=>tt.zD,defaultGetRowCellHeight:()=>Qe.Z,defaultRenderRowCell:()=>Je.Z,getChecked:()=>tt.IR,getValue:()=>tt.NA,groupCrosswalksByTypesAndSources:()=>ac,isIE:()=>tt.w1,mergeClasses:()=>tt.ze,noop:()=>tt.ZT,parseJSON:()=>tt.Rx,stopPropagation:()=>tt.UW,toggleSortOrder:()=>tt.Dh,useActions:()=>rm,useActivitiesLoader:()=>i.d,useAsyncMount:()=>nm.S,useAttributeExpanded:()=>pi,useBasicTableCellRenderer:()=>It,useClickableStyle:()=>tr.d,useCollaboration:()=>sm,useConfigPermissions:()=>Em.l,useCrosswalkActions:()=>Ns,useCrosswalkColor:()=>Yl,useCrosswalkFocus:()=>Ql,useCrosswalkHighlight:()=>Xl,useDidUpdateEffect:()=>gt.D,useDynamicRowCellHeight:()=>xt,useHighlightedCrosswalks:()=>$l,useHistory:()=>yc,useHistoryDiff:()=>wc,useHistorySlice:()=>ic,useKeyboardNavigation:()=>Ae.t,useMarkAsNotMatchRequest:()=>Gp,useMatchesLoader:()=>pp,useMergeAllRequest:()=>Bp,useModifiedEntity:()=>Ps,usePagingSimulator:()=>dp,usePrevious:()=>cm.D,useProfileActivitiesLoader:()=>p,useRelationTypeSelector:()=>mr,useRelationsLoader:()=>mm,useRunOnceAfterValueInitialization:()=>hm,useSafePromise:()=>Mt._,useSavedState:()=>gm.a,useUsers:()=>fm,useWhyDidYouUpdate:()=>ym,useWorkflowAssignee:()=>Lu,useWorkflowCheckPermission:()=>Au,useWorkflowComments:()=>Ju,useWorkflowTasks:()=>_p,withAsyncMount:()=>Jp.Z,withContext:()=>em.l,withFilterAtBottom:()=>me.Z,withPercents:()=>er.Z,withTableContext:()=>de.Z,withTooltip:()=>St.Z});var n=r(56082),a=r(40023),l=r(20414),o=r(33992),i=r(7278),s=r(24328),c=r.n(s),u=r(79779),d=r(54202);const p=e=>{let{filter:t,max:r,offset:n,entityUri:a}=e;return(0,s.useCallback)((async()=>{const e=(0,d.U)(t),l=await(0,u.k6v)({filter:e,max:r,offset:n,entityUri:a}),{total:o}=await(0,u.FEC)({filter:e,entityUri:a});return{data:l,total:o}}),[t,r,n,a])};var m=r(33117),h=r(15177),g=r(52239),f=r(76141),b=r(54255),y=r(72283),E=r(89913),v=r(3853),x=r(10768),w=r(13980),O=r.n(w),T=r(87918),C=r.n(T),I=r(17440),k=r(71153),S=r.n(k),P=r(12231),N=r(90436),D=r(79692);const R=(0,D.Z)({container:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},text:{display:"flex",width:"calc(100% - 68px)"},textItem:{fontSize:"13px",lineHeight:"15px",marginRight:10},primaryTextItem:{flex:"1 0",flexBasis:0,maxWidth:"50%",overflow:"hidden",textOverflow:"ellipsis"},secondaryTextItem:{flex:"1 0",flexBasis:0,overflow:"hidden",textOverflow:"ellipsis"},icons:{transform:"scale(0.5)",position:"relative",flexShrink:0,width:"68px",bottom:"10px"},iconTop:{position:"absolute",top:0,left:0,zIndex:1},iconBottom:{position:"absolute",top:0,left:26,zIndex:0}});var _=r(42662),A=r(83088);function Z(){return Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z.apply(this,arguments)}const j=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=R(),{value:o,label:i,startObject:s,endObject:u}=a,d=s.objectType.label+" ↔ "+u.objectType.label;return c().createElement(P.Z,Z({className:l.container,ref:t,key:o,onClick:()=>n({label:i,value:o,startObject:s,endObject:u})},r),c().createElement("div",{className:l.icons},c().createElement(_.Z,{className:l.iconTop,entityType:s.objectType}),c().createElement(_.Z,{className:l.iconBottom,entityType:u.objectType})),c().createElement("div",{className:l.text},c().createElement(A.C,{value:i},c().createElement(N.Z,{className:S()(l.textItem,l.primaryTextItem)},i)),c().createElement(A.C,{value:d},c().createElement(N.Z,{color:"textSecondary",className:S()(l.textItem,l.secondaryTextItem)},d))))};j.propTypes={innerRef:O().oneOfType([O().oneOf([null]),O().func,O().shape({current:O().any.isRequired})]),innerProps:O().object.isRequired,selectOption:O().func.isRequired,data:O().shape({value:O().string.isRequired,label:O().string.isRequired,startObject:O().object,endObject:O().object})};const M=j;var L=r(84425);function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V.apply(this,arguments)}function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const B=e=>{let{value:t={},options:r=[],onChange:n=I.identity,TextFieldProps:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","options","onChange","TextFieldProps"]);const o=(0,s.useMemo)((()=>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){F(e,t,r[t])}))}return e}({},(0,I.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return c().createElement(L.Z,V({value:t,options:r,onChange:n,label:C().text("Select relationship type "),components:{Option:M},TextFieldProps:o},l))},U=O().shape({label:O().string.isRequired,value:O().string.isRequired,startObject:O().object,endObject:O().object});B.propTypes={value:U,options:O().arrayOf(U),onChange:O().func};const H=B;var z=r(39390),W=r(92203),G=r(63928),q=r(11013),K=r(30410),Y=r(61347);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){X(e,t,r[t])}))}return e}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q(){return Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Q.apply(this,arguments)}function J(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const ee=e=>{let{values:t,valueContainerClassName:r}=e,n=J(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(q.Z,Q({attributeValue:e},n))))))},te=(0,s.memo)((e=>{let{expanded:t}=e,r=J(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:l}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return ee($({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:l},c().createElement(Y.Z,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return ee($({},r))}}));var re=r(89978),ne=r(66078),ae=r(88610),le=r(95492),oe=r(81489),ie=r(47972),se=r(44938),ce=r(42639),ue=r(45108),de=r(30488),pe=r(38748),me=r(25843),he=r(53862);function ge(){return ge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ge.apply(this,arguments)}const fe=e=>c().createElement("svg",ge({width:20,height:18,viewBox:"0 0 20 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M16 7.24V6h-4v1.24a8.417 8.417 0 00-2 .768V6H6v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H2c-1.1 0-2-.9-2-2V2C0 .9.9 0 2 0h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM4 12V6H2v6h2zm0-8V2H2v2h2zm6 0V2H6v2h4zm6 0V2h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0014 9zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero",stroke:"none",strokeWidth:1,opacity:.54}));function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ye(e,t,r[t])}))}return e}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ee=e=>e.id===e.groupId,ve=(0,I.curry)(((e,t)=>{let{id:r,groupId:n}=e;return t.groupId===n&&(r===t.id||r.startsWith(`${t.id}.`))})),xe=(0,I.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),we=(0,I.propOr)(!0,"hideable"),Oe=(e,t)=>{const r=((e,t)=>e.find((0,I.either)(xe(t),ve(t))))(e,t);return r?(r.children=Oe(r.children||[],t),e):e.concat(t)},Te=(0,I.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(Te(e)))),Ce=(0,I.reduce)(((e,t)=>Oe(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),Ie=(0,I.curry)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,I.pipe)((0,I.filter)(Te(e)),(0,I.chain)((t=>[{item:be({},t,{filterText:e}),level:r},...t.children?Ie(e,t.children,r+1):[]])))(t)})),ke=(0,I.has)("columns"),Se=e=>{let{id:t,label:r,columns:n}=e;return[{id:t,groupId:t,label:r},...n.map((0,I.assoc)("groupId",t))]},Pe=e=>e.children?(0,I.chain)(Pe,e.children):[e],Ne=(e,t)=>{const r=Pe(t),n=t=>e.includes(t.id);return Ee(t)?r.every(n):r.some(n)};var De=r(39475),Re=r(38442),_e=r(63485),Ae=r(44876),Ze=r(41008),je=r(94792);const Me=(0,D.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Le=e=>{let{item:t,onClick:r,checked:n,level:a,style:l,isFocused:o,isGroupItem:i}=e;const s=Me();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(je.Z,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:l,isFocused:o,hideIcon:i,className:S()({[s.groupItem]:i})})};Le.propTypes={item:O().shape({label:O().string,filterText:O().string}),level:O().number,onClick:O().func,checked:O().bool,style:O().object,isGroupItem:O().bool,isFocused:O().bool};const Ve=Le,Fe=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:l}=e;const o=Me(),[i,d]=(0,s.useState)(null),[p,m]=(0,s.useState)(""),h=(0,s.useMemo)((()=>((e,t)=>(0,I.pipe)((0,I.chain)((0,I.when)(ke,Se)),(0,I.filter)((0,I.either)(Ee,we)),Ce,Ie(t))(e))(t,p)),[t,p]),g=(0,u.fW1)("label")(h)||308,f=(0,s.useMemo)((()=>(0,Ze.LG)(h)),[h]),b=(0,s.useCallback)((e=>{const t=(0,I.pipe)(Pe,(0,I.pluck)("id"))(e),a=Ne(r,e);n(a?(0,I.difference)(r,t):(0,I.uniq)((0,I.concat)(r,t)))}),[r,n]),y=(0,s.useCallback)((e=>{let{item:t}=e;return b(t)}),[b]),{focusIndex:E,handleKeyDown:v}=(0,Ae.t)({items:f,open,onSelectFocusedItem:y,selectedItems:r}),x=Math.min(300,32*f.length),w=Math.max(140,x+108);return c().createElement(c().Fragment,null,c().createElement(De.k,{tooltipTitle:l||C().text("Show/hide columns"),size:"L",icon:fe,onClick:e=>d(e.currentTarget)}),c().createElement(Re.Z,{className:o.popup,open:!!i,anchorEl:i,onClose:(0,I.pipe)((()=>d(null)),(()=>m(""))),onSearch:m,title:a||C().text("Show/hide columns"),containerWidth:g,containerHeight:w,searchInputOnKeyDown:v},c().createElement(_e.Z,{fixedTitle:!1,height:x,renderItem:(e,t,n)=>{let{item:a,level:l=0}=t;return c().createElement(Ve,{style:e,item:a,level:l,isFocused:E===n,checked:Ne(r,a),isGroupItem:Ee(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:g,focusIndex:E})))};Fe.propTypes={columnsData:he.uz,selectedColumns:O().arrayOf(O().string),onChangeColumns:O().func,title:O().string,tooltipTitle:O().string};const Be=Fe;var Ue=r(61837),He=r(87685),ze=r(80030);function We(){return We=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(this,arguments)}const Ge=e=>c().createElement("svg",We({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M18 2V0H0v2l7 8v8l4-2v-6z",fill:"currentColor",fillRule:"nonzero",stroke:"none",strokeWidth:1})),qe=(0,D.Z)((e=>({"filterIcon--enabled":{color:e.palette.primary.main},closeIcon:{position:"absolute",right:"3px",bottom:"3px",transform:"scale(0.5)"},button:{padding:"11px"}}))),Ke=e=>{let{enabled:t,onClick:r}=e;const n=qe();return c().createElement(ze.ZP,{title:t?C().text("Clear all filters"):C().text("Filter")},c().createElement(Ue.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(Ge,{className:n["filterIcon--enabled"]}),c().createElement(He.default,{color:"primary",className:n.closeIcon})):c().createElement(Ge,null)))};Ke.propTypes={enabled:O().bool,onClick:O().func};const Ye=Ke;var $e=r(42011),Xe=r(46728),Qe=r(85103),Je=r(1928),et=r(9377),tt=r(79573);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){nt(e,t,r[t])}))}return e}function nt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const at="CHANGE_COLUMNS",lt="TOGGLE_FILTERS",ot="CHANGE_FILTER",it="TOGGLE_SORT",st="CHANGE_PAGE",ct="CHANGE_ROWS_PER_PAGE",ut={changeColumns:(0,tt.zD)(at),toggleFilters:(0,tt.zD)(lt),changeFilter:(0,tt.zD)(ot),toggleSort:(0,tt.zD)(it),changePage:(0,tt.zD)(st),changeRowsPerPage:(0,tt.zD)(ct)},dt=(e,t)=>{const r=(0,I.difference)(e.visibleColumns,t),n=e=>r.includes(e);return(0,I.evolve)({visibleColumns:(0,I.always)(t),sorting:(0,I.when)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(e.field)}),(()=>{const[e]=t;return{field:e,order:"asc"}})),filters:e=>(0,I.keys)(e).reduce(((e,t)=>n(t)?(0,I.dissoc)(t,e):e),e)},e)},pt={reducer:(e,t)=>{switch(t.type){case at:{const r=t.payload;return dt(e,r)}case lt:{const t=!e.filters;return rt({},e,{filters:t?{}:null,page:t?e.page:0})}case ot:{const{columnId:r,filter:n}=t.payload;return(0,I.evolve)({filters:n?(0,I.assoc)(r,n):(0,I.dissoc)(r),page:(0,I.always)(0)},e)}case it:{const r=t.payload,n=(0,I.path)(["sorting","field"],e),a=(0,I.path)(["sorting","order"],e);return rt({},e,{sorting:{field:r,order:(0,tt.Dh)(r===n?a:null)},page:0})}case st:return rt({},e,{page:t.payload});case ct:return rt({},e,{rowsPerPage:t.payload});default:return e}},actions:ut,changeVisibleColumns:dt};var mt=r(44443),ht=r(76625),gt=r(55962);const ft=e=>{let{onChangeHeight:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChangeHeight","children"]);const a=(0,s.useRef)(null),{rowValue:l,rowIndex:o,columnData:i,cellIndex:u}=n,d=t({rowIndex:o,cellIndex:u,columnData:i}),p=()=>a.current&&d(a.current.clientHeight);return(0,gt.D)(p,[l.rawValue]),c().createElement("div",null,c().createElement(mt.Z,{handleHeight:!0,onResize:p}),c().createElement(ht.Z,{rootRef:a},r))};ft.propTypes={onChangeHeight:O().func,children:O().node};const bt=ft;var yt=r(91431);function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vt=e=>{let{rowIndex:t,columnData:{id:r},cellIndex:n}=e;return`${r}[${t}][${n}]`},xt=()=>{const[e,t]=(0,s.useState)({}),r=(0,s.useRef)({}),n=(0,s.useCallback)((0,u.DsO)((()=>{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){Et(e,t,r[t])}))}return e}({},r.current))})),[]),a=(0,s.useCallback)((()=>{r.current={}}),[]);return{getDynamicRowCellHeight:(0,s.useCallback)((0,I.pipe)(vt,(0,I.prop)(I.__,e)),[e]),changeRowCellHeight:(0,s.useCallback)((0,I.curry)((0,I.useWith)((0,I.pipe)(((e,t)=>{r.current[e]=t}),n),[vt,I.identity])),[]),clearHeightsCache:a}};var wt=r(21697),Ot=r(8233),Tt=r(3073);function Ct(){return Ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ct.apply(this,arguments)}const It=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=Je.Z,getRowCellHeight:a=Qe.Z,defaultRowHeight:l=48,maxRowValuesCount:o=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,Ot.Z)({rowsData:t,columnsData:r,renderRowCell:n,getRowCellHeight:a,maxRowValuesCount:o});return(0,s.useMemo)((()=>{const e=i.reduce(((e,t,r)=>{const{data:n}=t;return e[r]=(0,wt.calculateRowHeight)(n,l),e}),{}),t=(t,r,n)=>{const a=[t,"subRowHeight",r,n,"height"];return(0,I.pathOr)(0,a,e)},n=t=>(0,I.pathOr)(0,[t,"height"],e),a=e=>{let{columnId:a,rowIndex:l}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["columnId","rowIndex"]);return c().createElement(Tt.x.Provider,{value:u},c().createElement("div",Ct({},o,{style:{height:n(l)}}),i.length>0&&(0,wt.getCellContentFromRowsData)({columnIndex:r.findIndex((0,I.propEq)("id",a)),headData:r,rowsData:i,rowIndex:l,getHeightForSubRow:t})))};return a.propTypes={columnId:O().string,rowIndex:O().number},{getRowHeight:n,CellRenderer:a}}),[i,l,u,r])};var kt=r(86689),St=r(78223),Pt=r(67766),Nt=r(42767);const Dt=(0,D.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),Rt=(0,St.Z)(kt.Z),_t=e=>{let{total:t=0,onPrev:r,onNext:n,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:o}=e;const i=Dt();return c().createElement("div",{className:i.container},c().createElement(Rt,{className:i.link,component:"button",variant:"caption",onClick:a,underline:"none",tooltipTitle:C().text("Go to search results")},(0,u.k7L)(t,1e6)," ",1===t?C().text("Search result"):C().text("Search results")),c().createElement(De.k,{size:"L",icon:Pt.Z,tooltipTitle:C().text("Go to previous profile"),onClick:r,disabled:l,showForDisabled:!0}),c().createElement(De.k,{size:"L",icon:Nt.Z,tooltipTitle:C().text("Go to next profile"),onClick:n,disabled:o,showForDisabled:!0}))};var At=r(52730),Zt=r(89810),jt=r(12212),Mt=r(29627);function Lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vt(e,t,r[t])}))}return e}function Vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ft{constructor(e){var t=this;let{data:{query:r,sortField:n,sortOrder:a},tenant:l,searchTenant:o,apiPath:i,dtssPath:s,globalSearchRequestOptions:c}=e;this.query=void 0,this.sortField=void 0,this.sortOrder=void 0,this.tenant=void 0,this.searchTenant=void 0,this.apiPath=void 0,this.dtssPath=void 0,this.globalSearchRequestOptions=void 0,this.isDT=()=>this.tenant!==this.searchTenant,this.getQueryFilter=()=>({rawFilter:this.query}),this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[t.getQueryFilter(),...e],a=Lt({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},r);return t.isDT()?(0,u.uqV)({filters:n,options:a,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,u.ZOr)(n,a)},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"uri",values:[e]}],{offset:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{offset:t,max:e}),this.requestTotal=()=>{const e=[this.getQueryFilter()],t=this.globalSearchRequestOptions;return(this.isDT()?(0,u.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,u.j_Q)(e,t)).then((e=>e.total))},this.query=r,this.sortField=n,this.sortOrder=a,this.tenant=l,this.searchTenant=o,this.apiPath=i,this.dtssPath=s,this.globalSearchRequestOptions=c}}function Bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ut(e,t,r[t])}))}return e}function Ut(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ht{constructor(e){var t=this;let{data:r,tenant:n,apiPath:a}=e;this.searchBody=void 0,this.tenant=void 0,this.apiPath=void 0,this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[{rawFilter:t.searchBody.filter},...e];return(0,u.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:Bt({},t.searchBody,{filter:e.length?(0,u.Uqd)()(n):t.searchBody.filter}),options:r})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,u.BTI)({uri:e})]}],{from:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{from:t,max:e}),this.requestTotal=()=>(0,u.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=r,this.tenant=n,this.apiPath=a}}const zt=(e,t)=>(0,I.pipe)((0,I.map)((0,I.prop)("uri")),(0,I.reject)((e=>t.includes(e))))(e),Wt=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,Mt._)(),t=(0,Mt._)(),r=(0,Mt._)(),{uri:n,index:a,total:l,tenant:o,cache:i}=(0,At.useSelector)(Zt.ZP.selectors.getSearchNavigationData)||{},{type:c,data:d}=(0,At.useSelector)(Zt.ZP.selectors.getSearchProviderData)||{},p=(0,At.useSelector)(Zt.ZP.selectors.getTenant),m=(0,At.useSelector)(Zt.ZP.selectors.getApiPath),h=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),g=(0,At.useSelector)((e=>Zt.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),f=(0,s.useContext)(jt.m),b=(0,At.useDispatch)(),[y,E]=(0,s.useState)(!1),v=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new Ft(t);case"graphsearch":return new Ht(t)}})(c,{data:d,tenant:p,searchTenant:o,apiPath:m,dtssPath:h,globalSearchRequestOptions:g})),[c,d,p,o,m,h,g]),x=(0,s.useCallback)((e=>{b(Zt.yC.actions.updateSearchNavigationDataFields(e))}),[b]),w=(0,s.useCallback)((e=>{const t=p!==o?(0,u.wwR)({uri:e,dataTenant:o}):e;b(Zt.ui.actions.openEntity({uri:t,viewId:f,source:"navigation"}))}),[b,f,p,o]),O=(0,s.useCallback)((()=>{b(Zt.ui.actions.openPerspective({perspectiveId:c,viewId:f}))}),[b,c,f]);(0,s.useEffect)((()=>{a>=l?x({index:l-1}):a<0&&x({index:0})}),[l,a,x]);const T=(0,s.useCallback)(((e,n,a)=>{E(!0),t(v.requestTotal()).then((e=>x({total:e})));const l=a+1;return r(v.requestEntities(15,l)).then((t=>{if(t){if(t.length){const r=zt(t,e);if(r.length>0)return x({cache:e.concat(r),uri:r[0],index:l+t.length-r.length}),void w(r[0]);if(a+t.length<n-1)return T(e,n-t.length,a+t.length)}x({index:l})}})).finally((()=>{E(!1)}))}),[v,x,w]),C=(0,s.useCallback)(((e,n)=>{E(!0),t(v.requestTotal()).then((e=>x({total:e})));const a=n-1,l=Math.max(0,n-15),o=15+Math.min(0,n-15);return r(v.requestEntities(o,l)).then((t=>{if(t){if(t.length){const r=zt(t,e);if(r.length>0)return x({cache:r.concat(e),uri:r[r.length-1],index:a-(t.length-r.length)}),void w(r[r.length-1]);if(n-t.length>0)return C(e,n-t.length)}x({index:0})}})).finally((()=>{E(!1)}))}),[v,x,w]),I=(0,s.useCallback)(((t,r,n,a)=>{if(r<t.length){const l=t[r];return E(!0),e(v.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),I(e,r,n-1,a)}x({index:a+1,uri:l,cache:t,total:n}),w(l)})).finally((()=>{E(!1)}))}if(!(a>=n-1))return T(t,n,a);x({cache:t,total:n,index:n-1})}),[v,x,w,T]),k=(0,s.useCallback)(((t,r,n,a)=>{if(r>-1){const l=t[r];return E(!0),e(v.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),k(e,r-1,n-1,a-1)}x({index:a-1,uri:l,cache:t,total:n}),w(l)})).finally((()=>{E(!1)}))}if(!(a<=0))return C(t,a);x({index:0,cache:t,total:n})}),[v,x,w,C]),S=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)-1;k(i,e,l,a)}}),[k,i,n,l,a]),P=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)+1;I(i,e,l,a)}}),[I,i,n,l,a]);return{total:l,onPrev:S,onNext:P,onSearchResultsClick:O,isPrevDisabled:y||a<=0,isNextDisabled:y||a>=l-1}})();return(()=>{const{cache:e}=(0,At.useSelector)(Zt.ZP.selectors.getSearchNavigationData)||{},t=(0,At.useSelector)(Zt.ZP.selectors.getMode),r=(0,At.useSelector)(Zt.ZP.selectors.getEntity);return(0,u.uzs)(t)&&(null==e?void 0:e.includes(null==r?void 0:r.uri))})()?c().createElement(_t,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}):null};var Gt=r(1730),qt=r(82068),Kt=r(17998),Yt=r(72668),$t=r(38037),Xt=r(62321),Qt=r(56215),Jt=r(12960),er=r(39878),tr=r(59383),rr=r(1292);function nr(){return nr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nr.apply(this,arguments)}const ar=e=>c().createElement(rr.Z,nr({mouseEvent:"onMouseDown"},e));var lr=r(89925),or=r(28831),ir=r(89902),sr=r(72316),cr=r(78501),ur=r(59952),dr=r(51556),pr=r(80560);const mr=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,s.useCallback)(((e,r)=>{const n={},a=(0,I.pipe)(u.PjQ,(0,I.tap)((e=>n[e]=(0,I.propOr)(0,e,n)+1))),l=(0,I.ascend)((0,I.prop)("label")),o=(0,I.curry)(((e,r)=>{let{uri:n,label:l,startObject:o,endObject:i}=r;const s=e===(t?u.Nsj.OUT:u.Nsj.IN)?o:i;return{label:{directionalLabel:a(s),typeLabel:l},value:`${n},${e}`,startObject:o,endObject:i}}));return e.map(o(u.Nsj.IN)).concat(r.map(o(u.Nsj.OUT))).map((0,I.evolve)({label:e=>{let{directionalLabel:t,typeLabel:r}=e;return t?n[t]>1?`${t} (${r})`:t:r}})).sort(l)}),[t]),fromEditorValue:(0,s.useCallback)(((e,t)=>r=>{const[n,a]=r.value.split(",");return{type:(a===u.Nsj.IN?e:t).find((0,I.propEq)("uri",n)),direction:a}}),[]),toEditorValue:(0,s.useCallback)(((e,t)=>t.find((0,I.propEq)("value",`${e.relationType},${e.direction}`))),[])}};function hr(){return hr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hr.apply(this,arguments)}const gr=e=>{let{relation:t={},inRelationTypes:r=[],outRelationTypes:n=[],onChange:a=I.identity,applyFirstByDefault:l=!1,reversedContextLabels:o=!1}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:u,fromEditorValue:d,toEditorValue:p}=mr({reversedContextLabels:o}),m=(0,s.useMemo)((()=>u(r,n)),[u,r,n]),h=(0,s.useCallback)((0,I.pipe)(d(r,n),a),[d,r,n,a]);return(0,s.useEffect)((()=>{l&&m.length&&h(m[0])}),[m,l,h]),c().createElement(H,hr({value:p(t,m),options:m,onChange:h},i))};gr.propTypes={className:O().string,relation:u.bNA,inRelationTypes:O().arrayOf(u.IYE),outRelationTypes:O().arrayOf(u.IYE),applyFirstByDefault:O().bool,reversedContextLabels:O().bool,onChange:O().func};const fr=gr;var br=r(67586),yr=r(87086),Er=r(98538),vr=r(1128),xr=r(43371),wr=r(15299),Or=r(92145),Tr=r(19855),Cr=r(72466),Ir=r(39600),kr=r(65314),Sr=r(91785),Pr=r(51594),Nr=r(19304),Dr=r(6216),Rr=r(79002),_r=r(37573),Ar=r(20146),Zr=r(76773),jr=r(18527),Mr=r(7882),Lr=r(97333),Vr=r(93555),Fr=r(52194);const Br=e=>`rotateY(${e?180:0}deg)`,Ur=e=>`rotateX(${e?180:0}deg)`,Hr=e=>`rotateY(${e?0:-180}deg)`,zr=e=>`rotateX(${e?0:-180}deg)`,Wr=(0,D.Z)({back:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"relative":"absolute",top:"0",transform:"horizontal"===r?Hr(t):zr(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",display:"flex"}},container:e=>{let{cardZIndex:t}=e;return{perspective:"1000px",zIndex:t}},flipper:{height:"100%",position:"relative",width:"100%"},front:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"absolute":"relative",top:"0",transform:"horizontal"===r?Br(t):Ur(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),Gr=(0,s.forwardRef)(((e,t)=>{let{cardZIndex:r="auto",direction:n="vertical",isCardFlipped:a=!1,children:l,className:o}=e;const[i,u]=(0,s.useState)(a),d=Wr({cardZIndex:r,direction:n,isFlipped:i});return(0,s.useEffect)((()=>{a!==i&&u(a)}),[a,i]),c().createElement("div",{className:S()(d.flipper,o),ref:t},c().createElement("div",{"data-id":"front",className:d.front},l[0]),c().createElement("div",{"data-id":"back",className:d.back},l[1]))})),qr=()=>c().createElement("div",{style:{display:"none"}}),Kr=e=>{let{widthToHide:t,children:r}=e;return c().createElement(mt.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(qr,null)}})};Kr.propTypes={children:O().node,widthToHide:O().number.isRequired};const Yr=Kr;var $r=r(44363),Xr=r(95596),Qr=r(76283),Jr=r(87378);const en=(0,D.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),tn=e=>{let{to:t,children:r,onClick:n}=e;const a=en();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},rn=e=>{let{className:t}=e;return c().createElement("img",{className:t,alt:"loading",src:(0,u.Uw1)("R0lGODlhFQALAKIAAP///8Hf75vL5Van0wB4v////wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAFACwAAAIAFQAHAAADLFi6zPSQFEGpGhgXkrEUQShc1bB1wxcGYzGUZ6eKJGVy8lS1aJxJjaAiAkkAACH5BAkKAAUALAAAAwAUAAUAAAMiWLFbJRC6QakCODjBxIzDlW3dB4UBBmhPWQygwrCR9FZDAgAh+QQJCgAFACwIAAMADAAFAAADFBiqVfIvgBmaWHeC6rCklrdw0JMAACH5BAkKAAUALAAAAgAUAAcAAAMkSLpU/vCRQWmLLmg967hYAIxBV4GRSJoWlo1A6X1usXGMUkcJACH5BAkKAAUALAAAAgAOAAcAAAMdWLpF/qSMORudcYg97M2b0BHXAHIelV0pxizQkwAAOw==")})},nn=e=>{let{isMlMatch:t=!1}=e;return c().createElement(c().Fragment,null,t?C().text("Match IQ"):C().text("Match rules"))},an=(0,D.Z)({title:{fontWeight:500,marginBottom:"9px"},body:{fontWeight:"normal",marginLeft:"16px"},container:{padding:"8px",fontSize:"12px",lineHeight:"14px"}}),ln=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=an();return c().createElement("div",{className:n.container},c().createElement("div",{className:n.title},c().createElement(nn,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},on=(0,D.Z)((e=>({container:{fontSize:"13px",lineHeight:"15px"},title:{color:e.palette.text.secondary,marginBottom:"7px"},labelsContainer:{color:e.palette.text.primary,marginBottom:"8px"}}))),sn=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=on();return c().createElement("div",{className:S()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(nn,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))};var cn=r(85777);const un=(0,D.Z)((e=>({label:{backgroundColor:"rgba(43,152,240,0.12)",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,display:"flex",alignItems:"center",padding:"4px 8px"},container:{display:"flex",alignItems:"center",cursor:"pointer",marginBottom:"8px"}})));function dn(){return dn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dn.apply(this,arguments)}const pn=(0,s.forwardRef)(((e,t)=>{let{children:r,expanded:n,onExpand:a,className:l}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","expanded","onExpand","className"]);const i=un();return c().createElement("div",dn({onClick:a,ref:t,className:S()(i.container,l)},o),c().createElement(cn.Z,{expanded:n}),c().createElement("div",{className:i.label},r))}));pn.displayName="MatchRuleBadge";const mn=pn,hn=(0,D.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function gn(){return gn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gn.apply(this,arguments)}const fn=e=>c().createElement("svg",gn({width:192,height:192,viewBox:"0 0 192 192",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("linearGradient",{x1:"94.582%",y1:"6.451%",x2:"23.195%",y2:"83.323%",id:"MLMatch_svg__b"},c().createElement("stop",{stopColor:"#CDE1FF",offset:"0%"}),c().createElement("stop",{stopColor:"#AFFBF4",offset:"100%"})),c().createElement("linearGradient",{x1:"94.582%",y1:"6.594%",x2:"23.195%",y2:"83.214%",id:"MLMatch_svg__d"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FDFFFF",offset:"100%"})),c().createElement("linearGradient",{x1:"93.837%",y1:"55.274%",x2:"29.292%",y2:"-20.431%",id:"MLMatch_svg__g"},c().createElement("stop",{stopColor:"#FFFCC7",stopOpacity:0,offset:"0%"}),c().createElement("stop",{stopColor:"#FFF470",offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"98.152%",id:"MLMatch_svg__i"},c().createElement("stop",{stopColor:"#83D6FF",offset:"0%"}),c().createElement("stop",{stopColor:"#72B9EF",offset:"100%"})),c().createElement("path",{d:"M1.821 66.003L34.263 9.94C36.633 5.813 45.673.594 51.398.072l64.445-.064c5.06-.241 14.821 5.084 17.888 10.395l31.467 54.503c3.186 5.518 2.765 16.592-.13 22.117l-30.948 53.481c-3.776 5.127-14.165 11.126-19.57 11.328l-62.134.061c-5.51-.264-15.934-5.764-18.758-10.655L1.856 86.155C-.846 81.475-.37 70.648 1.82 66.003z",id:"MLMatch_svg__a"}),c().createElement("path",{d:"M11.109 67.042l28.713-49.618C41.92 13.77 49.931 9.158 55.006 8.7l57.143.005c4.486-.209 13.147 4.516 15.871 9.223l27.954 48.298c2.83 4.89 2.467 14.696-.095 19.586l-27.391 47.334c-3.343 4.537-12.55 9.84-17.342 10.013l-55.094-.004c-4.886-.24-14.134-5.12-16.643-9.454L11.16 84.889c-2.4-4.147-1.989-13.735-.05-17.847z",id:"MLMatch_svg__c"}),c().createElement("path",{d:"M.995 0c26.4.684 47.59 22.234 47.59 48.72 0 26.23-23.795 34.53-23.795 56.987 0 3.703-3.011 6.705-6.725 6.705l-17.07-.001V68.985c6.466-1.238 11.353-6.923 11.353-13.75S7.46 42.722.995 41.485V0z",id:"MLMatch_svg__e"}),c().createElement("path",{d:"M47.353 0l-.087 41.235-.225.003c-7.588.167-13.688 6.37-13.688 13.997 0 7.683 6.19 13.92 13.854 14l-.091 43.265H27.887c-1.894-.56-3.197-1.234-3.91-2.025-.712-.79-1.357-2.275-1.933-4.455l-2.335-10.733c-.354-1.265-.674-2.183-.96-2.753-.286-.57-.784-1.281-1.494-2.134L2.002 70.367c-.846-.949-1.383-1.73-1.61-2.343-.228-.613-.356-1.626-.386-3.038V31.34c-.028-.785.044-1.37.216-1.757.173-.387.566-.848 1.18-1.382L28.368.885c.37-.367.665-.601.885-.704.22-.103.557-.163 1.01-.181h17.09z",id:"MLMatch_svg__h"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("g",{transform:"translate(12 6)"},c().createElement("use",{fill:"url(#MLMatch_svg__b)",xlinkHref:"#MLMatch_svg__a"}),c().createElement("use",{fill:"url(#MLMatch_svg__d)",opacity:.5,xlinkHref:"#MLMatch_svg__c"})),c().createElement("g",{transform:"translate(69.652 30.765)"},c().createElement("rect",{fill:"#363636",x:15.457,y:132.745,width:21.151,height:23.158,rx:10.576}),c().createElement("path",{d:"M48.146 118.763v18.93c0 7.198-5.944 13.035-13.277 13.035h-16.71c-7.333 0-13.278-5.837-13.278-13.036v-18.929a13 13 0 01.023-.763h43.22a13 13 0 01.022.763z",fill:"#717171"}),c().createElement("path",{d:"M41.348 137.2c0 7.199-4.947 13.035-11.048 13.035H16.395c-6.101 0-11.047-5.836-11.047-13.035v-18.965h36V137.2z",fill:"#828282"}),c().createElement("path",{d:"M47.51 138.235a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956z",fill:"#B1B1B1"}),c().createElement("path",{d:"M24.999 138.234v8h-16v-8h16zm0-11v8h-16v-8h16zm0-11v8h-16v-8h16z",fill:"#C5C5C5"}),c().createElement("g",{transform:"translate(27)"},c().createElement("mask",{id:"MLMatch_svg__f",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__e"})),c().createElement("use",{fill:"#FFD44B",xlinkHref:"#MLMatch_svg__e"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFD347",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFDE72",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M11.965 48.645c.17-7.171 7.488-10.693 13.863-6.802 7.245 4.422 4.05 16.311-4.742 16.548l-.268.004h-3.227l-4.608 56.092-5.995-.253 4.413-51.248.185-4.592-10.592.001v-6h10.83l.139-3.585.002-.165zm10.737-1.681c-2.54-1.55-4.64-.58-4.737 1.766l-.005.284-.131 3.38 2.99.001c2.852 0 3.999-3.945 2.011-5.347l-.128-.084z",fill:"#F3BE13",mask:"url(#MLMatch_svg__f)"}),c().createElement("ellipse",{fill:"url(#MLMatch_svg__g)",mask:"url(#MLMatch_svg__f)",cx:-1.89,cy:48.245,rx:36.534,ry:36.667}))),c().createElement("g",{transform:"translate(45.647 30.765)"},c().createElement("mask",{id:"MLMatch_svg__j",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__h"})),c().createElement("use",{fill:"url(#MLMatch_svg__i)",xlinkHref:"#MLMatch_svg__h"}),c().createElement("path",{fill:"#D6FCFA",fillRule:"nonzero",opacity:.5,mask:"url(#MLMatch_svg__j)",d:"M38.24 11.235v6l-3.55-.001-22.207 22.207h-18.13v-6H9.997l22.207-22.206zM25.682 40.779l13.8 13.799H50v6H36.997L21.439 45.021zM53.311 28.235v6h-13.65l-3.935 4.246-4.4-4.08 5.718-6.166zM14.248 52.235l20.52 20.52h3.695v6h-6.18l-20.52-20.52H-.647v-6zM21.353 84.235h8.95L40.4 94.332h16.753v6H37.915L27.817 90.235z"})),c().createElement("circle",{fill:"#008FD8",cx:94,cy:86,r:9}))),bn=(0,St.Z)(mn),yn=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=hn(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement(bn,{tooltipTitle:c().createElement(ln,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(fn,{className:n.icon}),C().text("Match IQ")):C().text("Rules")),a?c().createElement(sn,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function En(){return En=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},En.apply(this,arguments)}const vn=e=>{let{matchRules:t,Component:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["matchRules","Component"]);const[a,l]=(0,u.UkJ)(t);return c().createElement(c().Fragment,null,(0,I.isEmpty)(l)?null:c().createElement(r,En({matchRules:l},n)),(0,I.isEmpty)(a)?null:c().createElement(r,En({isMlMatch:!0,matchRules:a},n)))};vn.propTypes={matchRules:u.p3$,Component:O().func};const xn=vn,wn=(0,D.Z)((e=>({label:{fontSize:"13px",lineHeight:"15px",color:e.palette.primary.light},container:{display:"flex",flexDirection:"column"},badge:{display:"flex",marginBottom:"8px",cursor:"pointer"},matchLabels:{marginLeft:"30px"}}))),On=e=>{let{label:t,matchRules:r}=e;const n=wn(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement("div",{onClick:o,className:n.badge},c().createElement(cn.Z,{expanded:a}),c().createElement("div",{className:n.label},t)),a?c().createElement(xn,{Component:sn,matchRules:r,className:n.matchLabels}):null)},Tn=(0,D.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),Cn=(0,D.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),In=e=>{let{transitiveMatchRules:t}=e;const r=Cn();return c().createElement(c().Fragment,null,t.map(((e,t)=>{let{label:n,matchRules:a}=e;return c().createElement("div",{key:t,className:r.ruleWrapper},c().createElement("div",{className:r.label},n),c().createElement(ln,{matchRules:a}))})))};function kn(){return kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kn.apply(this,arguments)}const Sn=(0,St.Z)(mn),Pn=e=>{let{transitiveMatchRules:t}=e;const r=Tn(),[n,a]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(Sn,{tooltipTitle:c().createElement(In,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:n},C().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(On,kn({key:t},e)))):null)},Nn=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(Pn,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement(xn,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:yn})};var Dn=r(4270),Rn=r(73698),_n=r(95544);const An=(0,D.Z)((e=>({root:{maxWidth:156,paddingTop:"9px",paddingBottom:"9px"},outlined:{paddingRight:32,paddingLeft:12},arrowIcon:{fontSize:"18px",top:"calc(50% - 9px)",right:"12px",color:e.palette.text.secondary},currentValue:{display:"flex",alignItems:"center"},currentValueIcon:{fontSize:"18px",marginRight:"8px",color:e.palette.text.secondary},currentValueText:{fontSize:"14px",lineHeight:"16px",textTransform:"uppercase",fontWeight:500,color:e.palette.text.primary,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},menuItem:{padding:"9px 12px 7px"},firstMenuItemButton:{borderTop:"1px solid #e4e4e4"},menuItemInner:{display:"flex",alignItems:"flex-start"},menuItemIcon:{fontSize:"18px",color:e.palette.text.secondary,marginRight:"9px"},menuItemLabel:{fontSize:"14px",lineHeight:"16px",fontWeight:500,color:e.palette.text.primary},menuItemDescription:{fontSize:"10px",lineHeight:"16px",color:e.palette.text.secondary}})));function Zn(){return Zn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zn.apply(this,arguments)}const jn=e=>"onClick"in e,Mn=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:l=!1}=e;const o=An();return c().createElement(Rn.Z,{classes:{root:o.root,icon:o.arrowIcon,outlined:o.outlined},value:n,onChange:e=>{const{value:r}=e.target;t.some((0,I.propEq)("value",r))&&a(r)},variant:"outlined",renderValue:e=>{const{icon:r,label:n=e}=t.find((0,I.propEq)("value",e))||{};return c().createElement(_n.Z,{className:o.currentValue},r&&c().createElement(r,{className:o.currentValueIcon}),c().createElement(ze.ZP,{title:n},c().createElement(N.Z,{className:o.currentValueText},n)))},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},getContentAnchorEl:null},disabled:l,"data-reltio-id":"reltio-profile-select-mode"},(e=>{const t=e.findIndex(jn);return e.map(((e,r)=>{const{value:n,description:a,icon:l}=e,i={value:n,className:o.menuItem};return jn(e)&&(i.onClick=()=>e.onClick(n),i.className=S()(i.className,{[o.firstMenuItemButton]:r===t})),c().createElement(P.Z,Zn({key:n},i,{"data-reltio-id":`reltio-profile-select-mode-${n}`}),c().createElement(_n.Z,{className:o.menuItemInner},c().createElement(l,{className:o.menuItemIcon}),c().createElement(_n.Z,null,c().createElement(N.Z,{className:o.menuItemLabel},n),c().createElement(N.Z,{className:o.menuItemDescription},a))))}))})([...t,...r]))};var Ln=r(16482),Vn=r(7421),Fn=r(80233),Bn=r(73272);function Un(){return Un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Un.apply(this,arguments)}const Hn=e=>c().createElement("svg",Un({viewBox:"0 0 20 20"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 10L14 5.5V9h-3.5L5 3.5 3.5 5l6.04 6H14v3.5l4.5-4.5zM7.04 11.455L3.5 15 5 16.5l3.54-3.545-1.5-1.5z"})),zn=(0,D.Z)((e=>({expanded:{backgroundColor:"rgba(0, 0, 0, 0.03)"},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word"},icon:{width:"32px",height:"32px",fill:"#fff",backgroundColor:"rgba(177, 92, 189, 1)",borderRadius:"50%",margin:"5px 12px 0 8px"},infoBlock:{display:"flex",flexDirection:"row"},header:{display:"flex",flexDirection:"row",paddingBottom:"5px"},flex:{flex:1},caption:{fontSize:"16px",color:"rgba(0, 0, 0, 0.87)"},title:{display:"flex",flexDirection:"row",alignItems:"center",margin:"6px 0 8px 0"},flag:{height:"12px",width:"12px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},pmReviewCard:{borderTop:"3px solid #E83D40",flexDirection:"column",width:"100%"},date:{fontSize:"13px",color:"rgba(0, 0, 0, 0.87)"},mainInfo:{display:"flex",flexDirection:"column",flex:1}}))),Wn=e=>{let{date:t,type:r,createdBy:n,step:a,children:l,Actions:o}=e;const i=zn(),[u,d]=(0,s.useState)(!1);return c().createElement("div",{className:i.pmReviewCard},c().createElement("div",{className:S()(i.header,{[i.expanded]:u})},c().createElement(Hn,{className:i.icon}),c().createElement("div",{className:i.mainInfo},c().createElement("div",{className:i.title},c().createElement("div",{className:S()(i.caption,i.flex)},C().text("Match review")),c().createElement(Bn.Z,{className:i.flag}),c().createElement("span",{className:i.date},C().date(t,"L")),c().createElement(or.Z,{isOpen:u,onClick:()=>{d(!u)}})),c().createElement("div",{className:i.infoBlock},c().createElement("div",{className:i.flex},c().createElement("div",{className:i.info},r),c().createElement("div",{className:i.info},C().text("Created by ${createdBy}",{createdBy:n})),c().createElement("div",{className:i.info},C().text("Step: ${step}",{step:a}))),o))),u?l:null)};Wn.propTypes={date:O().number,createdBy:O().string,type:O().string,step:O().string,children:O().oneOfType([O().node,O().arrayOf(O().node)]),Actions:O().node};const Gn=Wn;var qn=r(33109),Kn=r(91026),Yn=r(88357),$n=r(51586),Xn=r(15793),Qn=r(2633),Jn=r(81521),ea=r(8978),ta=r(13896),ra=r(58651),na=r(46847),aa=r(15459);function la(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const oa=(0,D.Z)((()=>({"@global .rst__node":{minWidth:"100%",whiteSpace:"nowrap",position:"relative",textAlign:"left"},"@global .rst__node.rst__rtl":{textAlign:"right"},"@global .rst__nodeContent":{position:"absolute",top:0,bottom:0},"@global .rst__lineBlock, .rst__absoluteLineBlock":{height:"100%",position:"relative",display:"inline-block"},"@global .rst__absoluteLineBlock":{position:"absolute",top:0},"@global .rst__lineHalfHorizontalRight::before, .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{position:"absolute",content:"",backgroundColor:"black"},"@global .rst__lineHalfHorizontalRight::before":{height:"1px",top:"50%",right:0,width:"50%"},"@global .rst__rtl.rst__lineHalfHorizontalRight::before":{left:0,right:"initial"},"@global .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{width:"1px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__lineFullVertical::after, .rst__rtl.rst__lineHalfVerticalTop::after, .rst__rtl.rst__lineHalfVerticalBottom::after":{right:"50%",left:"initial"},"@global .rst__lineHalfVerticalTop::after":{height:"50%"},"@global .rst__lineHalfVerticalBottom::after":{top:"auto",bottom:0,height:"50%"},"@global .rst__highlightLineVertical":{zIndex:3},"@global .rst__highlightLineVertical::before":{position:"absolute",content:"",backgroundColor:"#36c2f6",width:"8px",marginLeft:"-4px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__highlightLineVertical::before":{marginLeft:"initial",marginRight:"-4px",left:"initial",right:"50%"},"@keyframes arrow-pulse":{"0%":{transform:"translate(0, 0)",opacity:0},"30%":{transform:"translate(0, 300%)",opacity:1},"70%":{transform:"translate(0, 700%)",opacity:1},"100%":{transform:"translate(0, 1000%)",opacity:0}},"@global .rst__highlightLineVertical::after":{content:"",position:"absolute",height:0,marginLeft:"-4px",left:"50%",top:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid white",animation:"arrow-pulse 1s infinite linear both"},"@global .rst__rtl.rst__highlightLineVertical::after":{marginLeft:"initial",marginRight:"-4px",right:"50%",left:"initial"},"@global .rst__highlightTopLeftCorner::before":{zIndex:3,content:"",position:"absolute",borderTop:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(50% + 4px)",top:"50%",marginTop:"-4px",right:0,width:"calc(50% + 4px)"},"@global .rst__rtl.rst__highlightTopLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:0,right:"initial"},"@global .rst__highlightBottomLeftCorner":{zIndex:3},"@global .rst__highlightBottomLeftCorner::before":{content:"",position:"absolute",borderBottom:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(100% + 4px)",top:0,right:"12px",width:"calc(50% - 8px)"},"@global .rst__rtl.rst__highlightBottomLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:"12px",right:"initial"},"@global .rst__highlightBottomLeftCorner::after":{content:"",position:"absolute",height:0,right:0,top:"100%",marginTop:"-12px",borderTop:"12px solid transparent",borderBottom:"12px solid transparent",borderLeft:"12px solid #36c2f6"},"@global .rst__rtl.rst__highlightBottomLeftCorner::after":{left:0,right:"initial",borderRight:"12px solid #36c2f6",borderLeft:"none"}})));function ia(){return ia=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ia.apply(this,arguments)}const sa=e=>{let{children:t,listIndex:r,swapFrom:n,swapLength:a,swapDepth:l,scaffoldBlockPxWidth:o,lowerSiblingCounts:i,connectDropTarget:u,isOver:d,draggedNode:p,canDrop:m,treeIndex:h,treeId:g,getPrevRow:f,node:b,path:y,rowDirection:E}=e,v=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection"]);oa();const x="rtl"===E?"rst__rtl":null,w=i.length,O=[];let T;return i.forEach(((e,t)=>{let i="";if(e>0?i=0===r?"rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom":t===w-1?"rst__lineHalfHorizontalRight rst__lineFullVertical":"rst__lineFullVertical":0===r?i="rst__lineHalfHorizontalRight":t===w-1&&(i="rst__lineHalfVerticalTop rst__lineHalfHorizontalRight"),O.push(c().createElement("div",{key:`pre_${1+t}`,style:{width:o},className:la("rst__lineBlock",i,x)})),h!==r&&t===l){let e,l="";l=r===n+a-1?"rst__highlightBottomLeftCorner":h===n?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===E?{width:o,right:o*t}:{width:o,left:o*t},O.push(c().createElement("div",{key:t,style:e,className:la("rst__absoluteLineBlock",l,x)}))}})),T="rtl"===E?{right:o*w}:{left:o*w},u(c().createElement("div",ia({},v,{className:la("rst__node",x)}),O,c().createElement("div",{className:"rst__nodeContent",style:T},s.Children.map(t,(e=>(0,s.cloneElement)(e,{isOver:d,canDrop:m,draggedNode:p}))))))};sa.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},sa.propTypes={treeIndex:O().number.isRequired,treeId:O().string.isRequired,swapFrom:O().number,swapDepth:O().number,swapLength:O().number,scaffoldBlockPxWidth:O().number.isRequired,lowerSiblingCounts:O().arrayOf(O().number).isRequired,listIndex:O().number.isRequired,children:O().node.isRequired,connectDropTarget:O().func.isRequired,isOver:O().bool.isRequired,canDrop:O().bool,draggedNode:O().shape({}),getPrevRow:O().func.isRequired,node:O().shape({}).isRequired,path:O().arrayOf(O().oneOfType([O().string,O().number])).isRequired,rowDirection:O().string};const ca=sa;function ua(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){da(e,t,r[t])}))}return e}function da(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pa(e){let{targetIndex:t,node:r,currentIndex:n,getNodeKey:a,path:l=[],lowerSiblingCounts:o=[],ignoreCollapsed:i=!0,isPseudoRoot:s=!1}=e;const c=s?[]:[...l,a({node:r,treeIndex:n})];if(n===t)return{node:r,lowerSiblingCounts:o,path:c};if(!r.children||i&&!0!==r.expanded)return{nextIndex:n+1};let u=n+1;const d=r.children.length;for(let e=0;e<d;e+=1){const n=pa({ignoreCollapsed:i,getNodeKey:a,targetIndex:t,node:r.children[e],currentIndex:u,lowerSiblingCounts:[...o,d-e-1],path:c});if(n.node)return n;u=n.nextIndex}return{nextIndex:u}}function ma(e){let{node:t,ignoreCollapsed:r=!0}=e;return pa({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}function ha(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:l,parentNode:o=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=a?[]:[...s,r({node:l,treeIndex:i})];if(!a&&!1===t(a?null:{node:l,parentNode:o,path:u,lowerSiblingCounts:c,treeIndex:i}))return!1;if(!l.children||!0!==l.expanded&&n&&!a)return i;let d=i;const p=l.children.length;if("function"!=typeof l.children)for(let e=0;e<p;e+=1)if(d=ha({callback:t,getNodeKey:r,ignoreCollapsed:n,node:l.children[e],parentNode:a?null:l,currentIndex:d+1,lowerSiblingCounts:[...c,p-e-1],path:u}),!1===d)return!1;return d}function ga(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:l,parentNode:o=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=ua({},l),d=a?[]:[...s,r({node:u,treeIndex:i})],p={node:u,parentNode:o,path:d,lowerSiblingCounts:c,treeIndex:i};if(!u.children||!0!==u.expanded&&n&&!a)return{treeIndex:i,node:t(p)};let m=i;const h=u.children.length;return"function"!=typeof u.children&&(u.children=u.children.map(((e,l)=>{const o=ga({callback:t,getNodeKey:r,ignoreCollapsed:n,node:e,parentNode:a?null:u,currentIndex:m+1,lowerSiblingCounts:[...c,h-l-1],path:d});return m=o.treeIndex,o.node}))),{node:t(p),treeIndex:m}}function fa(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||ha({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function ba(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:ga({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function ya(e){let{treeData:t,expanded:r=!0}=e;return ba({treeData:t,callback:e=>{let{node:t}=e;return ua({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function Ea(e){let{treeData:t,path:r,newNode:n,getNodeKey:a,ignoreCollapsed:l=!0}=e;const o="RESULT_MISS",i=e=>{let{isPseudoRoot:t=!1,node:s,currentTreeIndex:c,pathIndex:u}=e;if(!t&&a({node:s,treeIndex:c})!==r[u])return o;if(u>=r.length-1)return"function"==typeof n?n({node:s,treeIndex:c}):n;if(!s.children)throw new Error("Path referenced children of node with no children.");let d=c+1;for(let e=0;e<s.children.length;e+=1){const t=i({node:s.children[e],currentTreeIndex:d,pathIndex:u+1});if(t!==o)return ua({},s,t?{children:[...s.children.slice(0,e),t,...s.children.slice(e+1)]}:{children:[...s.children.slice(0,e),...s.children.slice(e+1)]});d+=1+ma({node:s.children[e],ignoreCollapsed:l})}return o},s=i({node:{children:t},currentTreeIndex:-1,pathIndex:-1,isPseudoRoot:!0});if(s===o)throw new Error("No node found at the given path.");return s.children}function va(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null,o=null;return{treeData:Ea({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return l=t,o=r,null}}),node:l,treeIndex:o}}function xa(e){let{targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isPseudoRoot:o=!1,isLastChild:i,node:s,currentIndex:c,currentDepth:u,getNodeKey:d,path:p=[]}=e;const m=e=>o?[]:[...p,d({node:e,treeIndex:c})];if(c>=r-1||i&&(!s.children||!s.children.length)){if("function"==typeof s.children)throw new Error("Cannot add to children defined by a function");{const e=ua({},s,l?{expanded:!0}:{},{children:s.children?[n,...s.children]:[n]});return{node:e,nextIndex:c+2,insertedTreeIndex:c+1,parentPath:m(e),parentNode:o?null:e}}}if(u>=t-1){if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!o)return{node:s,nextIndex:c+1};let e=c+1,t=null,l=null;for(let n=0;n<s.children.length;n+=1){if(e>=r){t=e,l=n;break}e+=1+ma({node:s.children[n],ignoreCollapsed:a})}if(null===l){if(e<r&&!i)return{node:s,nextIndex:e};t=e,l=s.children.length}const u=ua({},s,{children:[...s.children.slice(0,l),n,...s.children.slice(l)]});return{node:u,nextIndex:e,insertedTreeIndex:t,parentPath:m(u),parentNode:o?null:u}}if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!o)return{node:s,nextIndex:c+1};let h=null,g=null,f=null,b=c+1,y=s.children;"function"!=typeof y&&(y=y.map(((e,o)=>{if(null!==h)return e;const s=xa({targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isLastChild:i&&o===y.length-1,node:e,currentIndex:b,currentDepth:u+1,getNodeKey:d,path:[]});return"insertedTreeIndex"in s&&({insertedTreeIndex:h,parentNode:f,parentPath:g}=s),b=s.nextIndex,s.node})));const E=ua({},s,{children:y}),v={node:E,nextIndex:b};return null!==h&&(v.insertedTreeIndex=h,v.parentPath=[...m(E),...g],v.parentNode=f),v}function wa(e){let{treeData:t,depth:r,minimumTreeIndex:n,newNode:a,getNodeKey:l=(()=>{}),ignoreCollapsed:o=!0,expandParent:i=!1}=e;if(!t&&0===r)return{treeData:[a],treeIndex:0,path:[l({node:a,treeIndex:0})],parentNode:null};const s=xa({targetDepth:r,minimumTreeIndex:n,newNode:a,ignoreCollapsed:o,expandParent:i,getNodeKey:l,isPseudoRoot:!0,isLastChild:!0,node:{children:t},currentIndex:-1,currentDepth:-1});if(!("insertedTreeIndex"in s))throw new Error("No suitable position found to insert.");const c=s.insertedTreeIndex;return{treeData:s.node.children,treeIndex:c,path:[...s.parentPath,l({node:a,treeIndex:c})],parentNode:s.parentNode}}function Oa(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return fa({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function Ta(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||Ta(e,t)))}function Ca(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.children?"function"==typeof e.children?t+1:e.children.reduce(((e,r)=>Math.max(e,Ca(r,t+1))),t):t}function Ia(e){let{getNodeKey:t,treeData:r,searchQuery:n,searchMethod:a,searchFocusOffset:l,expandAllMatchPaths:o=!1,expandFocusMatchPaths:i=!0}=e,s=0;const c=e=>{let{isPseudoRoot:r=!1,node:u,currentIndex:d,path:p=[]}=e,m=[],h=!1,g=!1;const f=r?[]:[...p,t({node:u,treeIndex:d})],b=r?null:{path:f,treeIndex:d},y=u.children&&"function"!=typeof u.children&&u.children.length>0;!r&&a(ua({},b,{node:u,searchQuery:n}))&&(s===l&&(g=!0),s+=1,h=!0);let E=d;const v=ua({},u);return y&&(v.children=v.children.map((e=>{const t=c({node:e,currentIndex:E+1,path:f});return t.node.expanded?E=t.treeIndex:E+=1,(t.matches.length>0||t.hasFocusMatch)&&(m=[...m,...t.matches],t.hasFocusMatch&&(g=!0),(o&&t.matches.length>0||(o||i)&&t.hasFocusMatch)&&(v.expanded=!0)),t.node}))),r||v.expanded||(m=m.map((e=>ua({},e,{treeIndex:null})))),h&&(m=[ua({},b,{node:v}),...m]),{node:m.length>0?v:u,matches:m,hasFocusMatch:g,treeIndex:E}},u=c({node:{children:r},isPseudoRoot:!0,currentIndex:-1});return{matches:u.matches,treeData:u.node.children}}const ka={find:Ia,getDepth:Ca,isDescendant:Ta,getTreeFromFlatData:function(e){let{flatData:t,getKey:r=(e=>e.id),getParentKey:n=(e=>e.parentId),rootKey:a="0"}=e;if(!t)return[];const l={};if(t.forEach((e=>{const t=n(e);t in l?l[t].push(e):l[t]=[e]})),!(a in l))return[];const o=e=>{const t=r(e);return t in l?ua({},e,{children:l[t].map((e=>o(e)))}):ua({},e)};return l[a].map((e=>o(e)))},getFlatDataFromTree:Oa,insertNode:wa,addNodeUnderParent:function(e){let{treeData:t,newNode:r,parentKey:n=null,getNodeKey:a,ignoreCollapsed:l=!0,expandParent:o=!1,addAsFirstChild:i=!1}=e;if(null===n)return i?{treeData:[r,...t||[]],treeIndex:0}:{treeData:[...t||[],r],treeIndex:(t||[]).length};let s=null,c=!1;const u=ba({treeData:t,getNodeKey:a,ignoreCollapsed:l,callback:e=>{let{node:t,treeIndex:a,path:u}=e;const d=u?u[u.length-1]:null;if(c||d!==n)return t;c=!0;const p=ua({},t);if(o&&(p.expanded=!0),!p.children)return s=a+1,ua({},p,{children:[r]});if("function"==typeof p.children)throw new Error("Cannot add to children defined by a function");let m=a+1;for(let e=0;e<p.children.length;e+=1)m+=1+ma({node:p.children[e],ignoreCollapsed:l});return s=m,ua({},p,{children:i?[r,...p.children]:[...p.children,r]})}});if(!c)throw new Error("No node found with the given key.");return{treeData:u,treeIndex:s}},getNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null;try{Ea({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return l={node:t,treeIndex:r},t}})}catch(e){}return l},removeNode:va,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return Ea({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:Ea,toggleExpandedForAll:ya,map:ba,walk:fa,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=pa({targetIndex:r,getNodeKey:n,node:{children:t,expanded:!0},currentIndex:-1,path:[],lowerSiblingCounts:[],isPseudoRoot:!0});return a.node?a:null},getVisibleNodeCount:function(e){let{treeData:t}=e;const r=e=>e.children&&!0===e.expanded&&"function"!=typeof e.children?1+e.children.reduce(((e,t)=>e+r(t)),0):1;return t.reduce(((e,t)=>e+r(t)),0)},getDescendantCount:ma};function Sa(){return Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sa.apply(this,arguments)}function Pa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Na(e,t,r[t])}))}return e}function Na(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Da=e=>{let{scaffoldBlockPxWidth:t,toggleChildrenVisibility:r,connectDragPreview:n,connectDragSource:a,isDragging:l,canDrop:o,canDrag:i,node:s,title:u,subtitle:d,draggedNode:p,path:m,treeIndex:h,isSearchMatch:g,isSearchFocus:f,buttons:b,className:y,style:E,didDrop:v,treeId:x,isOver:w,parentNode:O,rowDirection:T}=e,C=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["scaffoldBlockPxWidth","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","node","title","subtitle","draggedNode","path","treeIndex","isSearchMatch","isSearchFocus","buttons","className","style","didDrop","treeId","isOver","parentNode","rowDirection"]);const I=u||s.title,k=d||s.subtitle,S="rtl"===T?"rst__rtl":null;let P;i&&(P="function"==typeof s.children&&s.expanded?c().createElement("div",{className:"rst__loadingHandle"},c().createElement("div",{className:"rst__loadingCircle"},[...new Array(12)].map(((e,t)=>c().createElement("div",{key:t,className:la("rst__loadingCirclePoint",S)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const N=p&&Ta(p,s),D=!v&&l;let R={left:-.5*t};return"rtl"===T&&(R={right:-.5*t}),c().createElement("div",Sa({style:{height:"100%"}},C),r&&s.children&&(s.children.length>0||"function"==typeof s.children)&&c().createElement("div",null,c().createElement("button",{type:"button","aria-label":s.expanded?"Collapse":"Expand",className:la(s.expanded?"rst__collapseButton":"rst__expandButton",S),style:R,onClick:()=>r({node:s,path:m,treeIndex:h})}),s.expanded&&!l&&c().createElement("div",{style:{width:t},className:la("rst__lineChildren",S)})),c().createElement("div",{className:la("rst__rowWrapper",S)},n(c().createElement("div",{className:la("rst__row",D&&"rst__rowLandingPad",D&&!o&&"rst__rowCancelPad",g&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",S,y),style:Pa({opacity:N?.5:1},E)},P,c().createElement("div",{className:la("rst__rowContents",!i&&"rst__rowContentsDragDisabled",S)},c().createElement("div",{className:la("rst__rowLabel",S)},c().createElement("span",{className:la("rst__rowTitle",s.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof I?I({node:s,path:m,treeIndex:h}):I),k&&c().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof k?k({node:s,path:m,treeIndex:h}):k)),c().createElement("div",{className:"rst__rowToolbar"},b.map(((e,t)=>c().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))))))};Da.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},Da.propTypes={node:O().shape({}).isRequired,title:O().oneOfType([O().func,O().node]),subtitle:O().oneOfType([O().func,O().node]),path:O().arrayOf(O().oneOfType([O().string,O().number])).isRequired,treeIndex:O().number.isRequired,treeId:O().string.isRequired,isSearchMatch:O().bool,isSearchFocus:O().bool,canDrag:O().bool,scaffoldBlockPxWidth:O().number.isRequired,toggleChildrenVisibility:O().func,buttons:O().arrayOf(O().node),className:O().string,style:O().shape({}),connectDragPreview:O().func.isRequired,connectDragSource:O().func.isRequired,parentNode:O().shape({}),isDragging:O().bool.isRequired,didDrop:O().bool.isRequired,draggedNode:O().shape({}),isOver:O().bool.isRequired,canDrop:O().bool,rowDirection:O().string};const Ra=Da;function _a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Aa extends s.Component{render(){const e=this.props,{children:t,connectDropTarget:r,treeId:n,drop:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","connectDropTarget","treeId","drop"]);return r(c().createElement("div",null,s.Children.map(t,(e=>(0,s.cloneElement)(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){_a(e,t,r[t])}))}return e}({},l))))))}}Aa.defaultProps={canDrop:!1,draggedNode:null},Aa.propTypes={children:O().node.isRequired,connectDropTarget:O().func.isRequired,isOver:O().bool.isRequired,canDrop:O().bool,draggedNode:O().shape({}),treeId:O().string.isRequired,drop:O().func.isRequired};const Za=Aa,ja=(0,D.Z)((()=>({"@global .rst__placeholder":{position:"relative",height:"68px",maxWidth:"300px",padding:"10px"},"@global .rst__placeholder, .rst__placeholder > *":{boxSizing:"border-box"},"@global .rst__placeholder::before":{border:"3px dashed #d9d9d9",content:"",position:"absolute",top:"5px",right:"5px",bottom:"5px",left:"5px",zIndex:-1},"@global .rst__placeholderLandingPad, .rst__placeholderCancelPad":{border:"none !important",boxShadow:"none !important",outline:"none !important"},"@global .rst__placeholderLandingPad *, .rst__placeholderCancelPad *":{opacity:"0 !important"},"@global .rst__placeholderLandingPad::before, .rst__placeholderCancelPad::before":{backgroundColor:"lightblue",borderColor:"white"},"@global .rst__placeholderCancelPad::before":{backgroundColor:"#e6a8ad"}}))),Ma=e=>{let{isOver:t,canDrop:r}=e;return ja(),c().createElement("div",{className:la("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};Ma.defaultProps={isOver:!1,canDrop:!1},Ma.propTypes={isOver:O().bool,canDrop:O().bool};const La=Ma,Va=e=>{let t=[],r=[],n=null;return a=>{const l=Object.keys(a).sort(),o=l.map((e=>a[e]));return(o.length!==t.length||o.some(((e,r)=>e!==t[r]))||l.some(((e,t)=>e!==r[t])))&&(t=o,r=l,n=e(a)),n}},Fa=Va(wa),Ba=Va(Oa),Ua=Va(ma);function Ha(e){let{treeIndex:t}=e;return t}function za(e){return"string"==typeof e?e:null===e||"object"!=typeof e||!e.props||!e.props.children||"string"!=typeof e.props.children&&"object"!=typeof e.props.children?"":"string"==typeof e.props.children?e.props.children:e.props.children.map((e=>za(e))).join("")}function Wa(e,t,r,n,a){return"function"==typeof r[e]?String(r[e]({node:r,path:n,treeIndex:a})).indexOf(t)>-1:"object"==typeof r[e]?za(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Ga(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return Wa("title",a,t,r,n)||Wa("subtitle",a,t,r,n)}const qa={defaultSearchMethod:Ga,defaultGetNodeKey:Ha};var Ka=r(75047);class Ya{constructor(e){this.hoverHandler=()=>{if(null===this.hoverProps)return;const{dropTargetProps:e,monitor:t,component:r}=this.hoverProps,n=t.getItem();if(!n)return;const a=this.getTargetDepth(e,t,r),l=n.node;(e.node!==this.lastDropTargetNode||a!==this.lastDropTargetDepth)&&(this.lastDropTargetNode=e.node,this.lastDropTargetDepth=a,this.dragHover({node:l,path:n.path,minimumTreeIndex:e.listIndex,depth:a}),this.hoverProps=null)},this.deferredCallHoverHandler=()=>{if(this.shouldSkipMoreFrames)return this.shouldSkipMoreFrames=!1,void(this.rafId=requestAnimationFrame(this.deferredCallHoverHandler));this.rafId=null,this.hoverHandler()},this.treeRef=e,this.resetDragVariables()}get startDrag(){return this.treeRef.startDrag}get dragHover(){return this.treeRef.dragHover}get endDrag(){return this.treeRef.endDrag}get drop(){return this.treeRef.drop}get treeId(){return this.treeRef.treeId}get dndType(){return this.treeRef.dndType}get treeData(){return this.treeRef.state.draggingTreeData||this.treeRef.props.treeData}get getNodeKey(){return this.treeRef.props.getNodeKey}get customCanDrop(){return this.treeRef.props.canDrop}get maxDepth(){return this.treeRef.props.maxDepth}resetDragVariables(){this.lastDropTargetNode=null,this.lastDropTargetDepth=null,this.hoverProps=null,this.lastCanDropResult=null,this.lastCanDropProps=null,this.shouldSkipMoreFrames=!1,this.rafId=null}getTargetDepth(e,t,r){let n=0;const a=e.getPrevRow();if(a){let{path:t}=a;!this.treeRef.canNodeHaveChildren(a.node)&&(t=t.slice(0,t.length-1)),n=Math.min(t.length,e.path.length)}let l,o=(t.getItem().path||[]).length;if(t.getItem().treeId!==this.treeId)if(o=0,r){const n=(0,Ka.findDOMNode)(r).getBoundingClientRect(),a=t.getSourceClientOffset().x-n.left;l=Math.round(a/e.scaffoldBlockPxWidth)}else l=e.path.length;else{const r="rtl"===e.rowDirection?-1:1;l=Math.round(r*t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth)}let i=Math.min(n,Math.max(0,o+l-1));if(void 0!==this.maxDepth&&null!==this.maxDepth){const e=Ca(t.getItem().node);i=Math.max(0,Math.min(i,this.maxDepth-e-1))}return i}canDrop(e,t){if(!t.isOver())return!1;const r=e.getPrevRow(),n=r?r.path:[],a=r?r.node:{},l=Math.round(t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth),o={nodeId:void 0!==e.node.nodeId?e.node.nodeId:e.node,rowAbove:r,abovePath:n,aboveNodeId:void 0!==a.nodeId?a.nodeId:a,blocksOffset:l};if((0,I.equals)(this.lastCanDropProps,o))return this.lastCanDropResult;this.lastCanDropProps=o;const i=this.getTargetDepth(e,t,null);if(i>=n.length&&"function"==typeof a.children)return this.lastCanDropResult=!1;if("function"==typeof this.customCanDrop){const{node:r}=t.getItem(),n=Fa({treeData:this.treeData,newNode:r,depth:i,getNodeKey:this.getNodeKey,minimumTreeIndex:e.listIndex,expandParent:!0});return this.lastCanDropResult=this.customCanDrop({node:r,prevPath:t.getItem().path,prevParent:t.getItem().parentNode,prevTreeIndex:t.getItem().treeIndex,nextPath:n.path,nextParent:n.parentNode,nextTreeIndex:n.treeIndex})}return this.lastCanDropResult=!0}wrapSource(e){const t={beginDrag:e=>(this.startDrag(e),{node:e.node,parentNode:e.parentNode,path:e.path,treeIndex:e.treeIndex,treeId:e.treeId}),endDrag:(e,t)=>{this.rafId&&cancelAnimationFrame(this.rafId),this.endDrag(t.getDropResult()),this.resetDragVariables()},isDragging:(e,t)=>{const r=t.getItem().node;return e.node===r}};return(0,ta.DragSource)(this.dndType,t,(function(e,t){return{connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview(),isDragging:t.isDragging(),didDrop:t.didDrop()}}))(e)}wrapTarget(e){const t={drop:(e,t,r)=>{this.rafId&&cancelAnimationFrame(this.rafId);const n={node:t.getItem().node,path:t.getItem().path,treeIndex:t.getItem().treeIndex,treeId:this.treeId,minimumTreeIndex:e.treeIndex,depth:this.getTargetDepth(e,t,r)};return this.lastDropTargetNode=null,this.drop(n),n},hover:(e,t,r)=>{this.rafId?this.shouldSkipMoreFrames=!0:(this.shouldSkipMoreFrames=!1,this.hoverProps={dropTargetProps:e,monitor:t,component:r},this.rafId=requestAnimationFrame(this.deferredCallHoverHandler))},canDrop:this.canDrop.bind(this)};return(0,ta.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}wrapPlaceholder(e){const t={drop:(e,t)=>{const{node:r,path:n,treeIndex:a}=t.getItem(),l={node:r,path:n,treeIndex:a,treeId:this.treeId,minimumTreeIndex:0,depth:0};return this.drop(l),l}};return(0,ta.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}}function $a(){return $a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$a.apply(this,arguments)}function Xa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qa(e,t,r[t])}))}return e}function Qa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Ja=1;const el=e=>{const t=Xa({},e,{style:Xa({},e.theme.style,e.style),innerStyle:Xa({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Xa({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:Ra,placeholderRenderer:La,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:ca};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class tl extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:l}=el(e);this.dndManager=new Ya(this),this.treeId=`rst__${Ja}`,Ja+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(Za),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(ea._t||ea.ZP)(Jn.aV),this.vStrength=(0,ea.Kx)(l),this.hStrength=(0,ea.v7)(l)),this.state={draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,searchMatches:[],searchFocusTreeIndex:null,dragging:!1,draggingExpandedPaths:[],ignoreOneTreeUpdate:!1,instanceProps:{treeData:this.props.treeData||[],searchQuery:null,searchFocusOffset:null,ignoreTreeChanges:!1}},this.toggleChildrenVisibility=this.toggleChildrenVisibility.bind(this),this.moveNode=this.moveNode.bind(this),this.startDrag=this.startDrag.bind(this),this.dragHover=this.dragHover.bind(this),this.endDrag=this.endDrag.bind(this),this.drop=this.drop.bind(this),this.handleDndMonitorChange=this.handleDndMonitorChange.bind(this)}componentDidMount(){tl.loadLazyChildren(this.props);const e=tl.search(this.props,this.state,!0,!0,!1);this.setState(e),this.clearMonitorSubscription=this.props.dragDropManager.getMonitor().subscribeToStateChange(this.handleDndMonitorChange)}static getDerivedStateFromProps(e,t){const{instanceProps:r}=t,n={};return(0,I.equals)(r.searchQuery,e.searchQuery)?r.searchFocusOffset!==e.searchFocusOffset&&Object.assign(n,tl.search(e,t,!0,!0,!0)):Object.assign(n,tl.search(e,t,!0,!0,!1)),r.searchQuery=e.searchQuery,r.searchFocusOffset=e.searchFocusOffset,n.instanceProps=r,n}componentDidUpdate(e,t){if(this.state.dragging!==t.dragging&&this.props.onDragStateChanged&&this.props.onDragStateChanged({isDragging:this.state.dragging,draggedNode:this.state.draggedNode}),this.state.dragging)if((0,I.equals)(this.props.treeData,e.treeData))this.state.draggingTreeData&&t.draggingTreeData!==this.state.draggingTreeData&&fa({treeData:this.state.draggingTreeData,getNodeKey:this.props.getNodeKey,callback:e=>{let{node:t,path:r,lowerSiblingCounts:n,treeIndex:a}=e;t.pending&&t.expanded&&this.props.onLazyLoadChildren({node:t,path:r,lowerSiblingCounts:n,treeIndex:a})}});else{const{treeData:e}=va({treeData:this.props.treeData,path:t.draggedPath,getNodeKey:this.props.getNodeKey});this.setState((t=>{let{draggingExpandedPaths:r}=t;return{draggingTreeData:r.reduce(((e,t)=>{let r;try{r=Ea({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Xa({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey})}catch(t){r=e}return r}),e)}}))}else if(this.props.treeData!==e.treeData){const t=(0,I.equals)(this.props.treeData,e.treeData),{ignoreOneTreeUpdate:r,instanceProps:n}=this.state,a={};t||(r?a.ignoreOneTreeUpdate=!1:(a.searchFocusTreeIndex=null,tl.loadLazyChildren(this.props),Object.assign(a,tl.search(this.props,this.state,!1,!1,!1))),a.draggingTreeData=null,a.draggedNode=null,a.draggedMinimumTreeIndex=null,a.draggedDepth=null,a.dragging=!1,a.draggingExpandedPaths=[],a.instanceProps=Xa({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Ba({ignoreCollapsed:!0,getNodeKey:this.props.getNodeKey,treeData:e})}handleDndMonitorChange(){!this.props.dragDropManager.getMonitor().isDragging()&&this.state.draggingTreeData&&this.endDrag()}toggleChildrenVisibility(e){let{node:t,path:r}=e;const{instanceProps:n}=this.state,a=Ea({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Xa({},t,{expanded:!t.expanded})},getNodeKey:this.props.getNodeKey});this.props.onChange(a),this.props.onVisibilityToggle({treeData:a,node:t,expanded:!t.expanded,path:r})}moveNode(e){let{node:t,path:r,treeIndex:n,depth:a,minimumTreeIndex:l}=e;const{treeData:o,treeIndex:i,path:s,parentNode:c}=wa({treeData:this.state.draggingTreeData,newNode:t,depth:a,minimumTreeIndex:l,expandParent:!0,getNodeKey:this.props.getNodeKey});this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1,draggingExpandedPaths:[]},(()=>{this.props.onChange(o),this.props.onMoveNode({treeData:o,node:t,treeIndex:i,path:s,nextPath:s,nextTreeIndex:i,prevPath:r,prevTreeIndex:n,nextParentNode:c})}))}static search(e,t,r,n,a){const{onChange:l,getNodeKey:o,searchFinishCallback:i,searchQuery:s,searchMethod:c,searchFocusOffset:u,onlyExpandSearchedNodes:d}=e,{instanceProps:p}=t;if(!s&&!c)return i&&i([]),{searchMatches:[]};const m={},{treeData:h,matches:g}=Ia({getNodeKey:o,treeData:d?ya({treeData:p.treeData,expanded:!1}):p.treeData,searchQuery:s,searchMethod:c||Ga,searchFocusOffset:u,expandAllMatchPaths:n&&!a,expandFocusMatchPaths:!!n});n&&(m.ignoreOneTreeUpdate=!0,l(h)),i&&i(g);let f=null;return r&&null!==u&&u<g.length&&(f=g[u].treeIndex),m.searchMatches=g,m.searchFocusTreeIndex=f,m}startDrag(e){let{path:t}=e;this.setState((e=>{const{treeData:r,node:n,treeIndex:a}=va({treeData:e.instanceProps.treeData,path:t,getNodeKey:this.props.getNodeKey});return{draggingTreeData:r,draggedNode:n,draggedDepth:t.length-1,draggedMinimumTreeIndex:a,draggedPath:t,dragging:!0}}))}dragHover(e){let{node:t,depth:r,minimumTreeIndex:n}=e;this.state.draggedDepth===r&&this.state.draggedMinimumTreeIndex===n||this.setState((e=>{let{draggingTreeData:a,instanceProps:l,draggingExpandedPaths:o}=e;const i=a||l.treeData,s=Fa({treeData:i,newNode:t,depth:r,minimumTreeIndex:n,expandParent:!0,getNodeKey:this.props.getNodeKey}),c=this.getRows(s.treeData)[s.treeIndex].path.slice(0,-1),u=(0,I.pipe)((0,I.when)((0,I.always)((0,I.gt)(c.length,0)),(0,I.append)(c)),(0,I.uniqWith)((0,I.eqBy)(String)))(o);return{draggedNode:t,draggedDepth:r,draggedMinimumTreeIndex:n,draggingTreeData:Ea({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Xa({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey}),searchFocusTreeIndex:null,dragging:!0,draggingExpandedPaths:u}}))}endDrag(e){const{instanceProps:t}=this.state;if(e){if(e.treeId!==this.treeId){const{node:r,path:n,treeIndex:a}=e;let l=this.props.shouldCopyOnOutsideDrop;"function"==typeof l&&(l=l({node:r,prevTreeIndex:a,prevPath:n}));let o=this.state.draggingTreeData||t.treeData;l&&(o=Ea({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Xa({},t)},getNodeKey:this.props.getNodeKey})),this.props.onChange(o),this.props.onMoveNode({treeData:o,node:r,treeIndex:null,path:null,nextPath:null,nextTreeIndex:null,prevPath:n,prevTreeIndex:a})}}else(()=>{this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1})})()}drop(e){this.moveNode(e)}canNodeHaveChildren(e){const{canNodeHaveChildren:t}=this.props;return!t||t(e)}static loadLazyChildren(e){fa({treeData:e.treeData,getNodeKey:e.getNodeKey,callback:t=>{let{node:r,path:n,lowerSiblingCounts:a,treeIndex:l}=t;r.pending&&(r.expanded||e.loadCollapsedLazyChildren)&&e.onLazyLoadChildren({node:r,path:n,lowerSiblingCounts:a,treeIndex:l,done:t=>e.onChange(Ea({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Xa({},n,{children:t}):n},getNodeKey:e.getNodeKey}),!0)})}})}renderRow(e,t){let{listIndex:r,style:n,getPrevRow:a,matchKeys:l,swapFrom:o,swapDepth:i,swapLength:s}=t;const{node:u,parentNode:d,path:p,lowerSiblingCounts:m,treeIndex:h}=e,{canDrag:g,generateNodeProps:f,scaffoldBlockPxWidth:b,searchFocusOffset:y,rowDirection:E}=el(this.props),v=this.treeNodeRenderer,x=this.nodeContentRenderer,w=p[p.length-1],O=w in l,T=O&&l[w]===y,C={node:u,parentNode:d,path:p,lowerSiblingCounts:m,treeIndex:h,isSearchMatch:O,isSearchFocus:T},I=f?f(C):{},k="function"!=typeof g?g:g(C),S={treeIndex:h,scaffoldBlockPxWidth:b,node:u,path:p,treeId:this.treeId,rowDirection:E};return c().createElement(v,$a({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:o,swapLength:s,swapDepth:i},S),c().createElement(x,$a({parentNode:d,isSearchMatch:O,isSearchFocus:T,canDrag:k,toggleChildrenVisibility:this.toggleChildrenVisibility},S,I)))}render(){const{dragDropManager:e,style:t,className:r,innerStyle:n,rowHeight:a,isVirtualized:l,placeholderRenderer:o,reactVirtualizedListProps:i,getNodeKey:s,rowDirection:u}=el(this.props),{searchMatches:d,searchFocusTreeIndex:p,draggedNode:m,draggedDepth:h,draggedMinimumTreeIndex:g}=this.state,f=this.state.draggingTreeData||this.props.treeData,b="rtl"===u?"rst__rtl":null;let y,E=null,v=null;if(m&&null!==g){const e=Fa({treeData:f,newNode:m,depth:h,minimumTreeIndex:g,expandParent:!0,getNodeKey:s}),t=g;E=e.treeIndex,v=1+Ua({node:m}),y=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=[...e.slice(0,t),...e.slice(t+n)];return[...a.slice(0,r),...e.slice(t,t+n),...a.slice(r)]}(this.getRows(e.treeData),E,t,v)}else y=this.getRows(f);const x={};d.forEach(((e,t)=>{let{path:r}=e;x[r[r.length-1]]=t}));const w=null!==p?{scrollToIndex:p}:{};let O,T=t;if(y.length<1){const e=this.treePlaceholderRenderer,t=o;O=c().createElement(e,{treeId:this.treeId,drop:this.drop},c().createElement(t,null))}else if(l){T=Xa({height:"100%"},T);const t=this.scrollZoneVirtualList;O=c().createElement(Jn.qj,null,(r=>{let{height:l,width:o}=r;return c().createElement(t,$a({},w,{dragDropManager:e,verticalStrength:this.vStrength,horizontalStrength:this.hStrength,speed:30,scrollToAlignment:"start",className:this.props.classes.rst__virtualScrollOverride,width:o,onScroll:e=>{let{scrollTop:t}=e;this.scrollTop=t},height:l,style:n,rowCount:y.length,estimatedRowSize:"function"!=typeof a?a:void 0,rowHeight:"function"!=typeof a?a:e=>{let{index:t}=e;return a({index:t,treeIndex:t,node:y[t].node,path:y[t].path})},rowRenderer:e=>{let{index:t,style:r}=e;return this.renderRow(y[t],{listIndex:t,style:r,getPrevRow:()=>y[t-1]||null,matchKeys:x,swapFrom:E,swapDepth:h,swapLength:v})}},i))}))}else O=y.map(((e,t)=>this.renderRow(e,{listIndex:t,style:{height:"function"!=typeof a?a:a({index:t,treeIndex:t,node:e.node,path:e.path})},getPrevRow:()=>y[t-1]||null,matchKeys:x,swapFrom:E,swapDepth:h,swapLength:v})));return c().createElement("div",{className:la("rst__tree",r,b),style:T},O)}}tl.propTypes={classes:O().object,dragDropManager:O().shape({getMonitor:O().func}).isRequired,treeData:O().arrayOf(O().object).isRequired,style:O().shape({}),className:O().string,innerStyle:O().shape({}),rowHeight:O().oneOfType([O().number,O().func]),slideRegionSize:O().number,reactVirtualizedListProps:O().shape({}),scaffoldBlockPxWidth:O().number,maxDepth:O().number,searchMethod:O().func,searchQuery:O().any,searchFocusOffset:O().number,searchFinishCallback:O().func,generateNodeProps:O().func,isVirtualized:O().bool,treeNodeRenderer:O().func,nodeContentRenderer:O().func,placeholderRenderer:O().func,theme:O().shape({style:O().shape({}),innerStyle:O().shape({}),reactVirtualizedListProps:O().shape({}),scaffoldBlockPxWidth:O().number,slideRegionSize:O().number,rowHeight:O().oneOfType([O().number,O().func]),treeNodeRenderer:O().func,nodeContentRenderer:O().func,placeholderRenderer:O().func}),getNodeKey:O().func,onChange:O().func.isRequired,onMoveNode:O().func,canDrag:O().oneOfType([O().func,O().bool]),canDrop:O().func,canNodeHaveChildren:O().func,shouldCopyOnOutsideDrop:O().oneOfType([O().func,O().bool]),onVisibilityToggle:O().func,dndType:O().string,onDragStateChanged:O().func,onlyExpandSearchedNodes:O().bool,rowDirection:O().string,onLazyLoadChildren:O().func,ignoreTreeChanges:O().bool},tl.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:Ha,innerStyle:{},isVirtualized:!0,maxDepth:null,treeNodeRenderer:null,nodeContentRenderer:null,onMoveNode:()=>{},onVisibilityToggle:()=>{},placeholderRenderer:null,reactVirtualizedListProps:{},rowHeight:null,scaffoldBlockPxWidth:null,searchFinishCallback:null,searchFocusOffset:null,searchMethod:null,searchQuery:null,shouldCopyOnOutsideDrop:!1,slideRegionSize:null,style:{},theme:{},onDragStateChanged:()=>{},onlyExpandSearchedNodes:!1,rowDirection:"ltr",onLazyLoadChildren:()=>{},ignoreTreeChanges:!1},(0,na.polyfill)(tl);const rl=(0,aa.Z)((()=>({"@global .ReactVirtualized__Grid__innerScrollContainer":{overflow:"visible !important"},"@global .ReactVirtualized__Grid":{outline:"none"},"@global .ReactVirtualized__List":{},rst__virtualScrollOverride:{overflow:"auto !important"},"@global .rst__rtl .ReactVirtualized__Grid__innerScrollContainer":{direction:"rtl"}})))(tl),nl=e=>c().createElement(ta.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(rl,$a({},e,{dragDropManager:r}))})),al=e=>c().createElement(ta.DndProvider,{backend:ra.default},c().createElement(nl,e));var ll=r(17822),ol=r(64435),il=r(63127),sl=r(74139),cl=r(33662),ul=r(87356),dl=r(54275),pl=r(72654),ml=r(27556);function hl(){return hl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hl.apply(this,arguments)}const gl=e=>{let{open:t,anchorEl:r,className:n,onClose:a,containerWidth:l,containerHeight:o,paperProps:i,listContent:s,externalInputField:u,classes:d={}}=e;const p=(0,dl.Z)({containerWidth:l,containerHeight:o});return c().createElement("div",{className:d.root},u,c().createElement(Vn.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(pl.Z,t,c().createElement(ml.Z,hl({elevation:2},i),c().createElement("div",{className:S()(p.container,n),style:{width:l}},c().createElement("div",{className:p.list},s))))})))};gl.propTypes={open:O().bool,anchorEl:O().object,className:O().string,onClose:O().func,containerWidth:O().number,containerHeight:O().number,paperProps:O().object,listContent:O().element,externalInputField:O().element,classes:O().shape({root:O().string})},gl.defaultProps={popoverAnchorOrigin:{vertical:"top",horizontal:"right"}};const fl=gl,bl=(0,D.Z)({onlyValue:{color:"rgba(0,0,0,.6)",fontSize:"13px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},select:{fontSize:"13px",color:"rgba(0,0,0,.6)",paddingLeft:"15px","&&":{paddingRight:"35px"}},selectMenu:{"& li":{fontSize:"13px",height:"32px"}},textField:{maxWidth:"100%"}}),yl=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:l}=e;const o=bl(),[i,...u]=n,d=0===u.length;(0,s.useEffect)((()=>{d&&t!==i.value&&r(i.value)}),[i.value]);const p=!!l;return c().createElement("div",{className:a.root},d?c().createElement(N.Z,{className:a.onlyValue||o.onlyValue,variant:"h6"},i.label):c().createElement(vr.Z,{displayEmpty:p,disableUnderline:!0,classes:{select:a.select||o.select},TextFieldProps:{classes:{root:a.textField||o.textField}},MenuProps:{classes:{list:a.selectMenu||o.selectMenu}},value:t||"",entries:p?[{value:"",label:l},...n]:n,onChange:e=>r(e||null)}))};yl.propTypes={value:O().string,onChange:O().func,options:O().arrayOf(O().shape({value:O().string,label:O().string})),classes:O().shape({root:O().string,onlyValue:O().string,select:O().string,selectMenu:O().string,textField:O().string}),emptyLabel:O().string};const El=yl;var vl=r(28101);function xl(){return xl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xl.apply(this,arguments)}const wl=e=>c().createElement("svg",xl({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),c().createElement("mask",{id:"AttributesList_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},c().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),c().createElement("g",{mask:"url(#AttributesList_svg__a)"},c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#AttributesList_svg__b)"}),c().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#AttributesList_svg__c)"}),c().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2v40.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),c().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),c().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zm90 0a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),c().createElement("defs",null,c().createElement("linearGradient",{id:"AttributesList_svg__b",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),c().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),c().createElement("linearGradient",{id:"AttributesList_svg__c",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopOpacity:.01}),c().createElement("stop",{offset:1})))),Ol=(0,D.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box",padding:"40px"},logo:{width:"190px",height:"190px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:400,marginTop:"24px"},text:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"23px",textAlign:"center"},secondaryText:{color:e.palette.text.primary,fontSize:"14px",fontWeight:"normal",lineHeight:"16px",letterSpacing:"0.24px",textAlign:"center",paddingTop:"8px"}}))),Tl=e=>{let{IconRenderer:t=wl,text:r,secondaryText:n}=e;const a=Ol();return c().createElement("div",{className:a.root},c().createElement(t,{className:a.logo}),c().createElement("div",{className:a.textBox},c().createElement(N.Z,{className:a.text},r),n&&c().createElement(N.Z,{className:a.secondaryText},n)))};var Cl=r(11821),Il=r(98273),kl=r(90590),Sl=r(40435),Pl=r(21210),Nl=r(79935),Dl=r(92985);const Rl=e=>{let{height:t,margin:r}=e;return c().createElement("div",{style:{width:"1px",height:`${t}px`,borderLeft:"1px solid rgba(0,0,0,0.38)",margin:`0 ${r}px`,flexShrink:"0"}})};Rl.propTypes={height:O().number,margin:O().number};const _l=Rl,Al=e=>{let{label:t}=e;return t||null},Zl=e=>{let{value:t}=e;return t||null},jl=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const l=e=>{const t=e.cellRenderer||Zl,r=e.headCellRenderer||Al;return c().createElement("tr",{key:e.id},c().createElement("th",{key:e.id},c().createElement(r,e)),n.map(((r,n)=>c().createElement("td",{key:n},c().createElement(t,{value:r[e.id],columnValue:r,rowData:e})))))};return c().createElement("table",{className:t},a>0&&c().createElement("thead",null,r.slice(0,a).map(l)),c().createElement("tbody",null,r.slice(a).map(l)))};jl.propTypes={rowsData:O().arrayOf(O().shape({id:O().string,label:O().string,headCellRenderer:O().func,cellRenderer:O().func})),columnsData:O().arrayOf(O().object),theadRowsNumber:O().number,className:O().string};const Ml=(0,s.memo)(jl);var Ll=r(57412),Vl=r(29611),Fl=r(50581),Bl=r(21853);const Ul=(0,D.Z)({searchButton:{marginLeft:"auto !important",marginRight:"-4px",padding:"8px"},input:{flex:"1 0 200px",marginLeft:"70px",fontSize:"14px",background:"rgba(0,0,0,0.03) 2px",padding:"4px 0",marginRight:"4px"},startAdornment:{color:"rgba(0,0,0,0.54)",paddingLeft:"8px"}}),Hl=e=>{let{query:t,onChange:r}=e;const[n,a]=(0,s.useState)(t),[l,o]=(0,s.useState)(!!t);(0,s.useEffect)((()=>{a(t)}),[t]);const i=Ul(),u=n&&n.length;return l?c().createElement(Vl.Z,{className:i.input,value:n,autoFocus:!0,placeholder:C().text("Search"),disableUnderline:!0,onChange:(0,I.pipe)(tt.NA,a),startAdornment:c().createElement(Fl.Z,{position:"start"},c().createElement(Bl.default,{className:i.startAdornment})),endAdornment:c().createElement(Fl.Z,{position:"end"},u&&c().createElement(Sl.Z,{size:"S",icon:He.default,onClick:(0,I.pipe)(I.F,o,(0,I.always)(""),(0,I.tap)(r),a)})),onKeyPress:(0,I.when)((0,I.propEq)("key","Enter"),(0,I.pipe)((0,I.always)(n),I.trim,r))}):c().createElement(Ue.Z,{className:i.searchButton,onClick:(0,I.pipe)(I.T,o)},c().createElement(Bl.default,null))};var zl,Wl=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(zl||(zl={}));const Gl=()=>{const[e,t]=(0,s.useState)(null),r=e===zl.READING,n=e===zl.EDITING,a=e===zl.HOVERED;(0,s.useEffect)((()=>{t(zl.READING)}),[]);const l=(0,s.useCallback)((0,u.DsO)(t,50),[]),o=(0,s.useCallback)((()=>{n||l(zl.HOVERED)}),[l,n]),i=(0,s.useCallback)((()=>{n||l(zl.READING)}),[l,n]);return{setReadingMode:(0,s.useCallback)((()=>t(zl.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(zl.EDITING)),[t]),onMouseLeave:i,onMouseEnter:o,isReadingMode:r,isEditingMode:n,isHovered:a}};const ql=(0,s.createContext)(null),Kl=e=>{let{children:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children"]);return c().createElement(ql.Provider,{value:r},t)},Yl=e=>{const{getCrosswalkColor:t=(0,I.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(ql)||{};return e?t(e):""},$l=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(ql)||{};return e},Xl=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=tt.ZT}=(0,s.useContext)(ql)||{},n=!!e&&!!t.find((0,I.eqBy)(u.uKF,e));return{isHighlighted:n,isDimmed:t.length>0&&!n,highlightCrosswalk:(0,s.useCallback)((()=>r(e,!0)),[e,r]),removeHighlight:(0,s.useCallback)((()=>r(e,!1)),[e,r])}},Ql=e=>{const{toggleCrosswalkFocus:t=tt.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(ql)||{};return{isFocused:!!e&&r.some((0,I.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var Jl=r(72753);const eo=(0,D.Z)({sourceItem:{display:"flex",overflow:"hidden"},eyeIcon:e=>{let{isFocused:t}=e;return{marginLeft:"10px",color:t?"#000":"rgba(0, 0, 0, 0.54)"}},label:{color:"rgba(0, 0, 0, 0.87)",verticalAlign:"top",fontSize:"13px",lineHeight:"16px"},sourceInfo:{overflow:"hidden"},crosswalkValue:{color:"rgba(0, 0, 0, 0.54)",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},sourceIcon:e=>{let{color:t}=e;return{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px",backgroundColor:t}},crosswalkIcon:e=>{let{color:t,isOpaque:r}=e;return{backgroundColor:t,height:"12px",width:"12px",borderRadius:"30px",opacity:r?1:.38,transition:"opacity 0.3s"}}}),to=(0,D.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),ro=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:l,isFocused:o}=Ql(t),i=eo({color:r,isFocused:o}),s=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),{label:d}=(0,u.PWK)(s,t.type);return c().createElement("div",{className:S()(i.sourceItem,n)},c().createElement(Pl.Z,{className:i.sourceIcon,sourceType:t.type}),c().createElement("div",{className:i.sourceInfo},c().createElement("div",null,c().createElement("span",{className:i.label},d),a&&c().createElement(De.k,{icon:Jl.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:C().text("Focus"),onClick:()=>l()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},no=(0,D.Z)((e=>({tooltip:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,filter:"drop-shadow(0px 1px 5px #00000033) drop-shadow(0px 3px 1px #0000001F) drop-shadow(0px 2px 2px #00000024)",padding:"10px",maxWidth:"none"},arrow:{color:e.palette.background.paper}})));function ao(){return ao=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ao.apply(this,arguments)}const lo=e=>{const t=no();return c().createElement(ze.ZP,ao({},e,{classes:t,arrow:!0}))},oo=e=>{let{crosswalk:t,className:r}=e;const n=Yl(t),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Xl(t),i=eo({isOpaque:!a,color:n});return c().createElement(lo,{title:c().createElement(ro,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:S()(i.crosswalkIcon,r),onMouseEnter:()=>l(),onMouseLeave:()=>o()}))};var io=r(35039),so=r(31992),co=r(22983),uo=r(27604),po=r(43054),mo=r(79784),ho=r(12980);const go=(0,D.Z)((()=>({textField:{margin:0},input:{borderRadius:0},inputMultiline:{"&$input":{paddingTop:0,paddingBottom:0}},booleanEditor:{paddingLeft:"10px"},timestampEditor:{"&$paper":{minWidth:"255px"}},paper:e=>{let{color:t,containerWidth:r}=e;return{border:`3px solid ${t}`,borderRadius:"4px",width:r,minWidth:"160px"}},popoverRoot:{zIndex:"10!important"}})));function fo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bo=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],yo=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:l,onEdit:o}=e;const i=go({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),d=(0,u.PFL)(t),p=(0,ho.AG)(r,d),[m,h]=(0,s.useState)(p),g={className:i.textField,InputProps:{disableUnderline:!0,classes:{root:i.input,multiline:i.inputMultiline}}},f=()=>{const e=(0,ho.Ho)(t,m);if(!(0,I.isNil)(m)&&!(0,I.equals)(m,p)){const n=(0,u.CwH)(t)?{value:e.value,lookupCode:e.lookupCode}:{value:""===m&&(0,u.FVt)(d.type)?null:e};o(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){fo(e,t,r[t])}))}return e}({},r,n))}l()};return c().createElement(mo.ZP,{open:!!a,anchorEl:a.current,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},classes:{paper:S()(i.paper,{[i.booleanEditor]:(0,u.T6Y)(d.type),[i.timestampEditor]:(0,u.j5n)(d.type)}),root:i.popoverRoot},onKeyUp:e=>{"Enter"!==e.key||bo.includes(d.type)?"Escape"===e.key&&l():f()},onBackdropClick:f},c().createElement(kr.Z,{autoFocus:!0,dataTypeDefinition:d,fieldName:(0,u.Tde)(t.uri),onChange:h,TextFieldProps:g,value:m,fullWidth:!0}))};function Eo(){return Eo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eo.apply(this,arguments)}const vo=e=>c().createElement("svg",Eo({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3.5A8.503 8.503 0 003.5 12c0 4.692 3.808 8.5 8.5 8.5s8.5-3.808 8.5-8.5-3.808-8.5-8.5-8.5zM6.1 12c0-3.26 2.64-5.9 5.9-5.9 1.161 0 2.24.336 3.149.917L7.017 15.15A5.821 5.821 0 016.101 12zm5.9 5.9c-1.16 0-2.24-.336-3.148-.917l8.131-8.131c.581.908.917 1.987.917 3.148 0 3.26-2.64 5.9-5.9 5.9z",fill:"#000",fillOpacity:.54}));function xo(){return xo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xo.apply(this,arguments)}const wo=e=>c().createElement("svg",xo({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.847 9.402a6.34 6.34 0 00-.8-1.322L8.08 17.048A6.34 6.34 0 0012 18.4a6.398 6.398 0 005.847-8.998zm-7.283 7.283l6.121-6.121a4.898 4.898 0 01-6.121 6.121zm1.437-11.084a6.334 6.334 0 013.92 1.352L6.953 15.92A6.334 6.334 0 015.6 12c0-3.536 2.864-6.4 6.4-6.4zm0 1.5c.5 0 .982.075 1.436.215l-6.121 6.12A4.898 4.898 0 0112 7.1zM6.6 17.903A7.967 7.967 0 0012 20c4.417-.001 8.001-3.585 8.001-8.001a7.967 7.967 0 00-2.601-5.902A7.988 7.988 0 0012 4c-4.416 0-8 3.584-8 8a7.967 7.967 0 002.602 5.902zM12 2.5c-5.244 0-9.5 4.256-9.5 9.5s4.256 9.5 9.5 9.5 9.5-4.256 9.5-9.5-4.256-9.5-9.5-9.5z",fill:"#000",fillOpacity:.54})),Oo=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(De.k,{disabled:n,showForDisabled:!0,icon:t?vo:wo,tooltipTitle:n?C().text("You don't have permissions to ignore"):C().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};function To(){return To=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},To.apply(this,arguments)}const Co=e=>c().createElement("svg",To({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4v6l2 2v2h-5v7l-.992 1L11 21v-7H6v-2l2-2V4H7V2h10v2h-1z",fill:"#000",fillOpacity:.54}));function Io(){return Io=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Io.apply(this,arguments)}const ko=e=>c().createElement("svg",Io({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 10V4h1V2H7v2h1v6l-2 2v2h5v7l1.008 1L13 21v-7h5v-2l-2-2zm-6-6h4v7l1 1H9l1-1V4z",fill:"#000",fillOpacity:.54})),So=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(De.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?Co:ko,tooltipTitle:n?"You don't have permissions to pin":C().text("Pin"),size:"XS",disableRipple:!0})},Po=(0,D.Z)((e=>({menuItem:{minHeight:"32px",color:e.palette.text.secondary},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"16px"},sourceItem:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)",paddingBottom:"8px",paddingLeft:"16px",maxWidth:"200px"}}))),No=(0,St.Z)(P.Z),Do=e=>{let{styles:t,icon:r,text:n}=e;return c().createElement(c().Fragment,null,r,c().createElement(N.Z,{classes:{root:t.menuText}},n))},Ro=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=Po(),{disabled:l,text:o,tooltip:i,onClick:s,id:u="",icon:d,crosswalk:p,color:m}=r;return p?c().createElement(ro,{className:a.sourceItem,color:m,crosswalk:p,focusable:!0}):c().createElement(No,{tooltipTitle:i,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:l,ref:t,"data-reltio-id":`crosswalk-menu-item${u}`},c().createElement(Do,{icon:d,text:o,styles:a}))}));Ro.displayName="CrosswalkMenuItem";const _o=Ro;function Ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zo=(0,D.Z)((()=>({root:e=>{let{fullyColored:t,opaque:r,color:n,variant:a}=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){Ao(e,t,r[t])}))}return e}({height:"28px"},"filled"===a&&{borderRadius:"4px",background:t?n:`linear-gradient(to right, ${n} 8px, rgba(0,0,0,0.05) 8px)`},"outlined"===a&&{"&::after":{content:'""',position:"absolute",background:n,borderRadius:"4px 0px 0px 4px",width:"8px",height:"100%",pointerEvents:"none"},"&::before":{content:'""',position:"absolute",boxSizing:"border-box",borderRadius:"4px",border:t?`${n} solid 2px`:"rgba(0,0,0,0.12) solid 1px",width:"100%",height:"100%",pointerEvents:"none"}},{display:"flex",alignItems:"center",maxWidth:"230px",opacity:r?1:.38,transition:"opacity 0.3s",position:"relative"})},attributeValue:{marginLeft:"16px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:1},actions:{display:"flex",width:"71px",justifyContent:"flex-end",marginRight:"4px"}}))),jo=e=>{let{className:t,dataReltioId:r,attributeType:n=null,attributeValue:a,crosswalk:l,disableEdit:o,disableDelete:i,onIgnore:d,onEdit:p,onPin:m,onDelete:h}=e;const{isReadingMode:g,isEditingMode:f,isHovered:b,onMouseEnter:y,onMouseLeave:E,setReadingMode:v,setEditingMode:x}=Gl(),w=(0,s.useRef)(),O=(0,u.nIW)(a.uri),T=(0,u.x_)(l),I=!n.system&&!T,k=I&&!o&&(0,u.Z5t)(u.fO_.EDITING,n),P=I&&!i&&(0,u.Edd)(u.fO_.EDITING,n),N=(0,u.ZiX)(a.uri),D=!N&&(!g&&k||a.pin),R=!N&&(!g&&k||a.ignored),_=Yl(l),{isHighlighted:A,isDimmed:Z,highlightCrosswalk:j,removeHighlight:M}=Xl(l),L=Zo({variant:T?"outlined":"filled",opaque:!Z,fullyColored:A,color:_}),V=[{crosswalk:l,color:_},{disabled:!k,text:C().text("Edit"),icon:c().createElement(uo.Z,null),tooltip:k?null:C().text("You don't have permissions to edit"),onClick:()=>x(),id:"edit"},{disabled:!P,text:C().text("Delete"),icon:c().createElement(co.Z,null),tooltip:P?null:C().text("You don't have permissions to delete"),onClick:()=>h({attributeType:n,attributeValue:a,crosswalks:[l]}),id:"delete"}],F=()=>{M(),v()};return c().createElement("div",{ref:w,className:S()(t,L.root),onMouseEnter:()=>{j(),y()},onMouseLeave:()=>{M(),E()},"data-reltio-id":r},c().createElement("div",{className:L.attributeValue},c().createElement(br.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:L.actions},D&&c().createElement(So,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!k}),R&&c().createElement(Oo,{isIgnored:a.ignored,onClick:()=>d({attributeValue:a}),disabled:!k}),b&&c().createElement(Er.Z,{MenuItemRenderer:_o,menuId:`simple-attribute-additional-actions-${O}`,buttonComponent:De.k,buttonProps:{icon:po.Z,size:"XS",tooltipTitle:C().text("More actions")},onMenuClose:F,menuItems:V})),f&&c().createElement(yo,{attributeType:n,attributeValue:a,color:_,onClose:F,onEdit:e=>p({attributeType:n,attributeValue:e,crosswalk:l}),containerRef:w}))},Mo=(0,D.Z)((()=>({simpleAttributesWrapper:{display:"flex",flexWrap:"wrap",gap:"4px",width:"100%",minHeight:"28px"},dropIndicator:{height:"28px",color:"#828282",fontSize:"13px",lineHeight:"28px",background:"rgba(0, 0, 0, 0.04)",border:"1px dashed #828282",borderRadius:"4px",boxSizing:"border-box",padding:"0 12px"}})));function Lo(){return Lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lo.apply(this,arguments)}const Vo=e=>{let{attributeValues:t,attributeType:r,parentUri:n,disableEdit:a,crosswalksMap:l,onAdd:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","attributeType","parentUri","disableEdit","crosswalksMap","onAdd"]);const s=Mo(),[{isDragItemOver:d},p]=(0,ta.useDrop)({accept:"Crosswalk",canDrop:e=>{let{crosswalk:t}=e;const n=(0,u.bC9)(t.uri)||"relation"===t.ownerType,l=(0,u.WgC)(t.uri)&&"entity"===t.ownerType;return(0,u.d89)(u.fO_.EDITING,r)&&!a&&(n&&(0,u.$NE)(r.uri)||l&&(0,u.EdS)(r.uri))},collect:e=>({isDragItemOver:e.isOver()&&e.canDrop()}),drop:(e,a)=>{let{crosswalk:l}=e;o({attributeType:r,crosswalk:l,parentUri:n,index:t.length})}});let m=0;return c().createElement("div",{ref:p,className:s.simpleAttributesWrapper},t.map((e=>{var t;return null===(t=l[e.uri])||void 0===t?void 0:t.map((t=>c().createElement(jo,Lo({key:e.uri+t.uri,attributeType:r,attributeValue:e,crosswalk:t,disableEdit:a,dataReltioId:"value-index-"+m++},i))))})),d&&c().createElement("div",{className:s.dropIndicator},C().text("Drop here")))};var Fo=r(77277);function Bo(){return Bo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bo.apply(this,arguments)}const Uo=e=>{let{className:t,attributeValues:r,attributeType:n,onAdd:a,parentUri:l,disableEdit:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues","attributeType","onAdd","parentUri","disableEdit"]);const s=!o&&(0,u.d89)(u.fO_.EDITING,n);return 0===r.length&&s?c().createElement(Fo.Z,{variant:"text",color:"primary",onClick:()=>a({parentUri:l,attributeType:n,index:0})},C().text("Create attribute")):c().createElement("div",{className:t},r.map((e=>c().createElement(fi,Bo({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:o},i)))))},Ho=e=>{let{children:t}=e;const r=to();return c().createElement(N.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},zo=(0,D.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));function Wo(){return Wo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wo.apply(this,arguments)}const Go=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=zo(),l=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),o=(0,At.useSelector)(Zt.ZP.selectors.getUIPath),i=c().createElement(Ho,null,c().createElement("a",{href:(0,u.ChB)({uiPath:o,uri:(0,u.bwT)(t)}),className:a.label},(0,u.idV)(t.label),t.relationshipLabel&&c().createElement("span",{className:a.relationshipLabel},t.relationshipLabel))),s=(0,I.pipe)(u.tF$,(0,I.map)((e=>(0,u.zeJ)(l,e))),(0,I.reject)(I.isNil))(r);return c().createElement(hi,Wo({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},n))};function qo(){return qo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qo.apply(this,arguments)}const Ko=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(Go,qo({key:e.uri,attributeValue:e},n)))))};var Yo=r(26729);const $o=(0,D.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function Xo(){return Xo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xo.apply(this,arguments)}const Qo={imageWidth:55,imageHeight:45},Jo=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=$o();return c().createElement(hi,Xo({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(Yo.Z,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Qo})},n))};function ei(){return ei=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ei.apply(this,arguments)}const ti=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(Jo,ei({key:e.uri,attributeValue:e},n)))))},ri=(0,D.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));function ni(){return ni=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ni.apply(this,arguments)}function ai(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const li=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:l}=e,o=ai(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=ri(),[d,p]=(0,s.useState)(a),m=(0,I.propOr)(r.length,"totalValues",n),h=a<m,g=h&&d<m,f=h&&d>=m,b=r.slice(0,d),y=m-d;return c().createElement("div",{className:i.wrapper},(e=>{switch(t.type){case u.oS0.TYPE_NESTED:return c().createElement(Uo,ni({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=o,n=ai(o,["crosswalksMap"]);return c().createElement(Ko,ni({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(ti,ni({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));default:return c().createElement(Vo,ni({attributeValues:e,attributeType:t},o))}})(b),g&&c().createElement(io.Z,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&l(),p(d+a)}}),f&&c().createElement(so.Z,{onClick:()=>{p(a)}}))},oi=(0,D.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function ii(){return ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ii.apply(this,arguments)}const si=e=>{let{attributeTypes:t,attributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeTypes","attributes"]);const a=oi();return c().createElement(c().Fragment,null,t.filter(u.Uty).map((e=>c().createElement(g.Z,{key:e.uri,enabled:!0},c().createElement(Dl.Z,{className:a.title,label:e.label,attributeType:e}),c().createElement(li,ii({attributeType:e,attributeValues:r[e.name],paging:(0,I.path)(["paging",e.uri],r)},n))))))},ci=e=>{let{onClick:t}=e;return c().createElement(De.k,{icon:co.Z,tooltipTitle:C().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},ui=(0,s.createContext)(null),di=e=>{let{children:t,attributeUris:r}=e;return c().createElement(ui.Provider,{value:r},t)},pi=e=>((0,s.useContext)(ui)||[]).some((t=>(0,u.sOy)(t,e))),mi=(0,D.Z)((()=>({root:{display:"flex",minHeight:"20px"},actions:{display:"flex",width:"65px",justifyContent:"flex-end",flexShrink:0,alignSelf:"center"},crosswalkIcon:{display:"inline-block",verticalAlign:"middle","& + &":{marginLeft:"4px"}}}))),hi=e=>{let{attributeType:t,attributeValue:r,attributeTypesList:n,label:a,crosswalksMap:l,disableEdit:o,disableDelete:i,onPin:d,onIgnore:p,onDelete:m,onEdit:h,onAdd:g}=e;const f=mi(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:E}=Gl(),v=!o&&(0,u.Z5t)(u.fO_.EDITING,t),x=!i&&(0,u.Edd)(u.fO_.EDITING,t),w=(0,u.ZiX)(r.uri),O=!w&&(!b&&v||r.pin),T=!w&&(!b&&v||r.ignored),C=!b&&x,k=pi(r.uri),[S,P]=(0,s.useState)(k||w);(0,gt.D)((()=>{k&&P(k)}),[k]);const N=(0,I.pipe)((0,I.pickBy)(((e,t)=>(0,u.sOy)(t,null==r?void 0:r.uri))),I.values,I.flatten,(0,I.uniqBy)((0,I.prop)("uri")))(l);return c().createElement(c().Fragment,null,c().createElement("div",{className:f.root,onMouseEnter:y,onMouseLeave:E},c().createElement(cn.Z,{onClick:()=>P((e=>!e)),expanded:S}),c().createElement("span",null,a,N.map((e=>c().createElement(oo,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(Nl.Z,null),c().createElement("div",{className:f.actions},O&&c().createElement(So,{disabled:!v,isPinned:r.pin,onClick:()=>d({attributeValue:r})}),T&&c().createElement(Oo,{disabled:!v,isIgnored:r.ignored,onClick:()=>p({attributeValue:r})}),C&&c().createElement(ci,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:l[r.uri]})}))),S&&c().createElement(si,{attributeTypes:n,attributes:r.value,parentUri:r.uri,crosswalksMap:l,disableEdit:!v,disableDelete:!x,onPin:d,onIgnore:p,onDelete:m,onEdit:h,onAdd:g}))};function gi(){return gi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gi.apply(this,arguments)}const fi=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=c().createElement(Ho,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(hi,gi({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var bi=r(33286),yi=r(22118),Ei=r(8629),vi=r(49429),xi=r(38724),wi=r(55999);const Oi=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(Ei.Z,{open:t},c().createElement(xi.Z,null,c().createElement(wi.Z,null,C().text("Are you sure you want to delete this?"))),c().createElement(vi.Z,null,c().createElement(Fo.Z,{onClick:r,color:"primary"},C().text("No")),c().createElement(Fo.Z,{onClick:()=>{n(),r()},color:"primary"},C().text("Yes"))))};var Ti=r(92332);const Ci=(0,D.Z)((e=>({coloredCell:{"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.06)",pointerEvents:"none"}},headCell:{display:"flex",alignItems:"center",fontSize:"12px",height:"100%",color:e.palette.text.secondary},rowCell:{fontSize:"13px",overflow:"hidden"},cellValueWrapper:{padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"}},attributeTitle:{display:"block",marginLeft:"3px","&:not(:last-child)":{marginBottom:"5px"}},ovValue:{"& + &":{marginTop:"4px"}},count:{textAlign:"center"},ruleType:{display:"flex",alignItems:"center"},ruleTypeLabel:{marginRight:"5px"},rulePopup:{width:"270px",overflowY:"hidden"},popupItem:{paddingBottom:"5px",paddingTop:"5px"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},closeButton:{height:24,width:24},popupTitle:{fontWeight:500,marginLeft:"12px"},popupTitleWrapper:{display:"flex",paddingLeft:16,paddingTop:16},popupItemsWrapper:{overflowY:"auto",maxHeight:"280px"},winnerSourceItemWrapper:{paddingBottom:"2px",paddingTop:"2px"},winnerSourceItem:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"8px"},winnerSourceItemLabel:{fontSize:13}}))),Ii=e=>{const t=Ci();return c().createElement("div",{className:S()(t.headCell,t.coloredCell)},c().createElement(Ti.default,e),e.children)},ki=(0,D.Z)({root:{marginBottom:"-6px"}}),Si=(0,de.Z)((0,I.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:l}=e;const o=ki(),i=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),s=[...i.entityTypes,...i.relationTypes||[]].find((0,I.propEq)("uri",t)),d=e=>!(null!=n&&n.find((0,I.propEq)("uri",e.uri))),p=(0,I.pipe)((0,I.propOr)([],"attributes"),(0,I.reject)((0,I.either)(u.YkG,u.Or$)),(0,I.filter)((0,I.either)(u.QZu,d)),(0,I.filter)((0,I.both)(u.Uty,(e=>(0,u.Vg3)({attributeType:e,mode:u.fO_.EDITING})))))(s);return c().createElement("div",{className:o.root},c().createElement(E.Z,{label:C().text("Attribute"),popupTitle:C().text("Add attributes"),data:p,onApply:e=>{const t=e.filter(d);t.length>0&&a([...t,...n]),e.filter(u.QZu).forEach((e=>{l({attributeType:e,parentUri:r})}))}}))}));const Pi=(0,de.Z)((0,I.pick)(["readOnly"]))((e=>{let{readOnly:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readOnly"]);return t?c().createElement(Ii,r):c().createElement(Ii,r,c().createElement(Nl.Z,null),c().createElement(Si,null))})),Ni=e=>{let{value:t}=e;const r=Ci();return c().createElement("div",{className:r.cellValueWrapper},t)},Di=(0,D.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function Ri(){return Ri=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ri.apply(this,arguments)}const _i=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Di();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(li,Ri({attributeValues:t},r)))};function Ai(){return Ai=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ai.apply(this,arguments)}const Zi=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Di(),a=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(fi,Ai({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function ji(){return ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ji.apply(this,arguments)}const Mi=e=>{let{attributeValues:t,crosswalksMap:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","crosswalksMap"]);const a=Di(),l=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:a.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(Go,ji({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,l)};function Li(){return Li=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Li.apply(this,arguments)}const Vi=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Di();return c().createElement(c().Fragment,null,null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(Jo,Li({attributeValue:e},r))))))};function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bi=(0,de.Z)((0,I.pick)(["onDelete","onPin","onIgnore","onEdit","onAdd","parentUri","readOnly"]))((e=>{let{value:t,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,parentUri:i,readOnly:s}=e;return class{static build(e,t){switch(e){case u.oS0.TYPE_NESTED:return c().createElement(Zi,t);case u.oS0.TYPE_REFERENCE:return c().createElement(Mi,t);case u.oS0.TYPE_IMAGE:return c().createElement(Vi,t);default:return c().createElement(_i,t)}}}.build(t.attributeType.type,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){Fi(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,disableEdit:s,disableDelete:s}))})),Ui=e=>{let{value:{values:t,attributeType:r}}=e;const n=Ci();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(Dl.Z,{className:n.attributeTitle,label:r.label,attributeType:r}),c().createElement(te,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},Hi=e=>{let{value:t}=e;const r=Ci();return c().createElement("div",{className:S()(r.cellValueWrapper,r.count)},t)};var zi=r(11776),Wi=r(38402),Gi=r(49378),qi=r(99144);const Ki=e=>{let{sourcesUriOrder:t}=e;const r=Ci(),n=(0,At.useSelector)(Zt.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Wi.Z,{key:e,className:r.popupItem},c().createElement(Pl.Z,{className:r.sourceIcon,sourceType:e}),c().createElement(Gi.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Yi=e=>{let{attributeUri:t}=e;const r=Ci(),n=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Wi.Z,{key:a.uri,className:r.popupItem},c().createElement(Gi.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},$i=(0,I.cond)([[(0,I.prop)("sourcesUriOrder"),()=>C().text("Source sequence")],[(0,I.prop)("primaryAttributeUri"),()=>C().text("Attribute winner")],[(0,I.prop)("comparisonAttributeUri"),()=>C().text("Comparison attribute")]]),Xi=(0,I.cond)([[(0,I.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(Ki,{sourcesUriOrder:t})}],[(0,I.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Yi,{attributeUri:t})}],[(0,I.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Yi,{attributeUri:t})}]]),Qi=e=>{let{info:t}=e;const r=Ci(),[n,a]=(0,s.useState)(null),l=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(De.k,{icon:qi.Z,tooltipTitle:C().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(mo.ZP,{classes:{paper:r.rulePopup},open:!!n,anchorEl:n,onClose:l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:r.popupTitleWrapper},c().createElement(Ue.Z,{className:r.closeButton,onClick:l},c().createElement(He.default,null)),c().createElement(N.Z,{variant:"subtitle1",className:r.popupTitle},$i(t))),c().createElement(zi.Z,{component:"div",className:r.popupItemsWrapper},Xi(t))))},Ji=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const l=Ci(),o=r||n||a;return c().createElement("div",{className:S()(l.cellValueWrapper,l.ruleType)},c().createElement("div",{className:l.ruleTypeLabel},t.label),o&&c().createElement(Qi,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function es(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ts=(0,D.Z)({item:e=>{let{color:t,opacity:r,variant: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){es(e,t,r[t])}))}return e}({},"filled"===n&&{backgroundColor:t},"outlined"===n&&{border:`${t} solid 2px`},{opacity:r,transition:"opacity 0.3s",boxSizing:"border-box"})}});function rs(){return rs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rs.apply(this,arguments)}const ns=(0,s.forwardRef)(((e,t)=>{let{color:r,opacity:n,variant:a="filled",children:l,className:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["color","opacity","variant","children","className"]);const s=ts({color:r,opacity:n,variant:a});return c().createElement("div",rs({ref:t,className:S()(s.item,o)},i),l)})),as=e=>{let{crosswalk:t}=e;const r=Ci(),n=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Xl(t);return c().createElement(ns,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>l(),onMouseLeave:()=>o()},c().createElement(Pl.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(Gi.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},ls=e=>{let{value:{crosswalks:t}}=e;const r=Ci();return c().createElement(zi.Z,{component:"div"},t.map((e=>c().createElement(Wi.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(as,{crosswalk:e})))))},os=[{id:"ovValues",get label(){return C().text("Attributes & OV")},hideable:!1,initialWidth:360,minWidth:250},{id:"winnerSources",get label(){return C().text("Winner source systems")},initialWidth:220},{id:"ruleType",get label(){return C().text("Rule type")},initialWidth:200},{id:"count",get label(){return C().text("Count")},initialWidth:80,minWidth:80},{id:"values",get label(){return C().text("Attribute values")},hideable:!1}],is=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),ss=["ovValues","ruleType","values"],cs=e=>{switch(e){case"ovValues":return Ui;case"values":return Bi;case"count":return Hi;case"ruleType":return Ji;case"winnerSources":return ls;default:return Ni}},us=(0,I.pipe)(u.cwx,(0,I.sortWith)([(0,I.descend)((0,I.propOr)(-1,"priority"))]),(0,I.map)((0,I.prop)("uri"))),ds=(0,I.curry)(((e,t)=>(0,u.YkG)(e)&&t&&(0,I.pipe)(u.c31,(0,I.find)((r=>r.slice((0,u.u5q)(r).length)===t.slice(e.uri.length))))(e)||t)),ps=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return(0,I.pipe)((0,I.filter)(is),(0,I.chain)((e=>(0,I.pipe)((0,I.pickBy)(((t,r)=>{const n=(0,u.sOy)(r,e.uri),a=n?r.slice(e.uri.length+1):"",l=a&&(0,u.IM5)(e.value,a);return n&&(!l||is(l))})),I.values,I.flatten)(t))),(0,I.uniqBy)((0,I.prop)("uri")))(e)},ms=(0,I.map)((e=>{let{id:t,label:r,initialWidth:n,minWidth:a}=e;return{id:t,label:r,initialWidth:n,minWidth:a,autoResize:!n,resizable:!0,sortable:!1,headCellRenderer:"ovValues"===t?Pi:Ii,rowCellValueRenderer:cs(t)}})),hs=(e,t,r,n,a,l)=>{switch(e){case"ovValues":return{attributeType:n,values:null==l?void 0:l.filter(is)};case"values":return{attributeType:n,attributeValues:l,crosswalksMap:a};case"count":return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;switch(e){case u.oS0.TYPE_REFERENCE:case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return t.length;default:return t.reduce(((e,t)=>e+r[t.uri].length),0)}}(n.type,l,a);case"ruleType":return((e,t,r)=>{var n,a;const l=[...e.entityTypes,...e.relationTypes||[]].find((0,I.propEq)("uri",r)),o=null==l||null===(n=l.survivorshipGroups)||void 0===n?void 0:n.find((0,I.propEq)("default",!0)),i=null==o||null===(a=o.mapping)||void 0===a?void 0:a.find((0,I.propEq)("attribute",t.uri)),s=(0,u.o_J)(e,null==i?void 0:i.survivorshipStrategy)||(0,u.Xaq)(e),c=(e=>"configuration/survivorshipStrategies/SRC_SYS"===(null==e?void 0:e.uri))(s)?(0,I.uniq)([...(null==i?void 0:i.sourcesUriOrder)||[],...(null==o?void 0:o.sourcesUriOrder)||[],...us(e)]):void 0,d=ds(t),p=(e=>"configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk"===(null==e?void 0:e.uri))(s)?d(null==i?void 0:i.primaryAttributeUri):void 0,m=(0,u.YkM)(t)&&(e=>"configuration/survivorshipStrategies/MinValue"===(null==e?void 0:e.uri)||"configuration/survivorshipStrategies/MaxValue"===(null==e?void 0:e.uri))(s)?d(null==i?void 0:i.comparisonAttributeUri):void 0;return{ruleType:s,sourcesUriOrder:c,primaryAttributeUri:p,comparisonAttributeUri:m}})(t,n,r);case"winnerSources":return{crosswalks:ps(l,a)};default:return null}};function gs(){return gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gs.apply(this,arguments)}const fs=e=>{let{cell:t,CellValueRenderer:r,columnIndex:n,columnData:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["cell","CellValueRenderer","columnIndex","columnData"]);const o=Ci(),i=0===n;return c().createElement("div",{className:S()(o.rowCell,i&&o.coloredCell),"data-reltio-id":`column-name-${a.id}`},t.values.map(((e,t)=>c().createElement(r,gs({key:t,value:e},l)))))};var bs=r(44962),ys=r(2682),Es=r(5806),vs=r(42494),xs=r(84899);const ws=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[l,o]=(0,s.useState)("without");return c().createElement(Ei.Z,{open:t,onEnter:()=>o("without")},c().createElement(xi.Z,null,c().createElement(wi.Z,null,C().text("You are attempting to change a value that is presently ignored.")),c().createElement(vs.Z,{component:"fieldset"},c().createElement(xs.Z,{component:"legend"},C().text("Please choose an option:")),c().createElement(ys.Z,{value:l,onChange:(0,I.pipe)(tt.NA,o)},c().createElement(Es.Z,{value:"without",control:c().createElement(bs.Z,null),label:C().text("Save without Ignore")}),c().createElement(Es.Z,{value:"with",control:c().createElement(bs.Z,null),label:C().text("Save and apply Ignore to new value")})))),c().createElement(vi.Z,null,c().createElement(Fo.Z,{onClick:r,color:"primary"},C().text("Cancel")),c().createElement(Fo.Z,{onClick:()=>{"with"===l?a():n(),r()},color:"primary"},C().text("Ok"))))},Os=(0,D.Z)({tableContainer:{height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"},tableHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between"},tableContent:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",position:"relative"}});function Ts(){return Ts=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ts.apply(this,arguments)}const Cs=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=ss,onChangeVisibleColumns:l,readOnly:o,onDelete:i=tt.ZT,onPin:d=tt.ZT,onIgnore:p=tt.ZT,onEdit:m=tt.ZT,onAdd:h=tt.ZT,selectedAttributeTypes:g,onSelectAttributeTypes:f=tt.ZT}=e;const b=Os(),y=(0,s.useMemo)((()=>(0,I.pipe)((0,I.filter)((e=>{let{id:t}=e;return a.includes(t)})),ms)(os)),[a]),{type:E,uri:v,attributes:x={}}=t||{},w=(0,At.useSelector)(Zt.ZP.selectors.getMetadata);(0,s.useEffect)((()=>{if(t&&(0,I.isNil)(g)){const e=(0,I.pipe)(I.keys,(0,I.without)(["paging"]),(0,I.map)((0,u.tCm)(E)),(0,I.map)((e=>(0,u.zeJ)(w,e,E))),(0,I.filter)(u.Uty))(x);f(e)}}),[t,g]);const O=(0,s.useMemo)((()=>E?function(e,t){let r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).map((l=>{const o=(0,u.nIW)(l.uri),i=a[o],s=(0,u.YkG)(l)?n.relation:n.entity;return(0,I.pipe)((0,I.reduce)(((r,n)=>(0,I.assoc)(n,hs(n,e,t,l,s,i),r)),{}),(0,I.assoc)("rawValue",i))(r)}))}(w,E,g,a,n,x):[]),[w,E,g,a,x,n]),{getDynamicRowCellHeight:T,changeRowCellHeight:k}=xt(),S=(0,s.useCallback)((e=>c().createElement(bt,Ts({onChangeHeight:k},e),c().createElement(fs,e))),[k]),P=(0,s.useCallback)((0,I.either)(T,(0,I.always)(68)),[T]),[N,D]=(0,s.useState)(null),[R,_]=(0,s.useState)(null),A=(0,s.useCallback)((e=>{e.attributeValue.ignored?_(e):m(e)}),[m,_]),Z=(0,s.useMemo)((()=>({onDelete:D,onPin:d,onIgnore:p,onEdit:A,onAdd:h,parentUri:v,parentTypeUri:E,selectedAttributeTypes:g,onSelectAttributeTypes:f,readOnly:o})),[D,d,p,A,h,v,E,g,f,o]);return c().createElement("div",{className:b.tableContainer},c().createElement(Kt.Z,{classes:{root:b.tableHeader},title:C().text("Sources")},c().createElement(Be,{columnsData:os,selectedColumns:a,onChangeColumns:l})),c().createElement("div",{className:b.tableContent},r&&c().createElement(Jr.Z,null),c().createElement(ue.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:y,rowsData:O,renderRowCell:S,getRowCellHeight:P,context:Z})),c().createElement(Oi,{open:!!N,onClose:()=>D(null),onConfirm:()=>i(N)}),c().createElement(ws,{open:!!R,onClose:()=>_(null),onConfirmEditWithIgnore:()=>m(R),onConfirmEditWithoutIgnore:()=>{p({attributeValue:R.attributeValue}),m(R)}}))}));function Is(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ks(e,t,r[t])}))}return e}function ks(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ss=[],Ps=e=>{let{entity:t,onLoad:r=tt.ZT,onModify:n=tt.ZT,onError:a=tt.ZT}=e;const[l,o]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),d=(0,s.useRef)([]),p=(0,s.useRef)(null),m=(0,s.useCallback)((()=>{p.current=null}),[]),[h,g]=(0,s.useState)(Ss),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>((0,u.sJj)(t).forEach((r=>{e[r]=[...e[r]||[],t]})),e)),{})};(0,s.useEffect)((()=>{const e={entity:f(null==t?void 0:t.crosswalks),relation:(0,I.pipe)(u.HQx,f)(t)};if((null==l?void 0:l.uri)===(null==t?void 0:t.uri)&&p.current){const{ownerType:t}=p.current,r=Object.keys(e[t]),n=Object.keys(i[t]);g((0,I.difference)(r,n))}else g(Ss);m(),o(t),c(e),d.current=[]}),[t]);const b=(0,s.useCallback)((0,I.pipe)(a,m),[a,m]),{deleteAttribute:y,ignoreAttribute:E,pinAttribute:v,createAttribute:x,updateAttribute:w}=(e=>{let{onSuccess:t=tt.ZT,onError:r=tt.ZT,onLoad:n=tt.ZT}=e;const a=(0,s.useCallback)((e=>{n(),e.then((()=>{t()})).catch(r)}),[r,t,n]),l=(0,s.useCallback)((e=>e.then((e=>{if("error"in e)throw e.error;return e}))),[]);return{deleteAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalks:n}=e;const o=(0,u.YkG)(r)?(0,I.pipe)(u.o96,(0,I.prop)("objectURI"),u.VGk,l)(t):Promise.all((n||[]).map((e=>{let{type:r,value:n,sourceTable:a}=e;return l((0,u.xZs)({attributeUri:t.uri,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:a}))})));a(o)}),[a,l]),pinAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,I.pipe)(u.xkv,l,a)({attributeUri:t.uri,value:!t.pin})}),[a,l]),ignoreAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,I.pipe)(u.P8_,l,a)({attributeUri:t.uri,value:!t.ignored})}),[a,l]),updateAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalk:n}=e;(0,u.YkM)(r)||(0,u.Or$)(r)||(0,I.pipe)(u.tCj,l,a)({attributeUri:t.uri,sourceUri:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,value:(0,u.CwH)(r)?t.lookupCode:t.value})}),[a,l]),createAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,crosswalk:r}=e;(0,I.pipe)(u.JV_,(0,I.andThen)((e=>{let[{errors:t}]=e;if(t)throw t})),a)({attributeUri:t.uri,sourceUri:r.type,crosswalkValue:r.value,crosswalkSourceTable:r.sourceTable,value:t.value})}),[a])}})({onLoad:r,onSuccess:n,onError:b}),O=(0,s.useCallback)((e=>{let{attributeType:t,parentUri:r,crosswalk:n,index:a}=e;const l=(0,u.gjI)({parentUri:r,attributeType:t}),{uri:i}=l;if(n){const{ownerType:e}=n;c((t=>Is({},t,{[e]:Is({},t[e],{[i]:[n]})})))}o((e=>{var n;return(0,I.isNil)(a)&&(a=null===(n=(0,u.JQy)(e,r,t.name))||void 0===n?void 0:n.length),(0,u.wLZ)({entity:e,attributeType:t,newAttribute:l,index:a})})),d.current.some((e=>(0,u.sOy)(i,e)))||d.current.push(i)}),[]),T=(0,s.useCallback)((e=>{const{attributeValue:{uri:t},attributeType:r}=e;(0,u.ZiX)(t)?(o((e=>(0,u.d$I)({entity:e,attributeType:r,uri:t}))),c((0,I.evolve)({entity:(0,I.dissoc)(t),relation:(0,I.dissoc)(t)})),d.current=(0,I.without)([t],d.current)):y(e)}),[y]),C=(0,s.useCallback)((e=>{if((0,u.ZiX)(e.attributeValue.uri)){const{attributeValue:t,attributeType:r,crosswalk:n}=e;if(!(0,I.isNil)(t.value)){const{uri:e}=t,a=d.current.find((t=>(0,u.sOy)(e,t))),o=(0,u.ww$)({entity:l,attributeType:r,uri:e,value:(0,u.kDl)(t)});x({attributeValue:(0,u.dLR)(o,a),crosswalk:n}),p.current=n}}else w(e)}),[x,w,l]);return{modifiedEntity:l,crosswalksMap:i,onAddAttribute:O,onDeleteAttribute:T,onPinAttribute:v,onIgnoreAttribute:E,onEditAttribute:C,newlyCreatedAttributes:h}},Ns=e=>{let{onLoad:t=tt.ZT,onSuccess:r=tt.ZT,onError:n=tt.ZT}=e;const a=(0,s.useCallback)((e=>{t(),e.then((e=>{let{errors:t}=e;if(t)throw t;r()})).catch(n)}),[t,n,r]);return{addCrosswalk:(0,s.useCallback)((e=>{let{entity:t,contributorCrosswalk:r,crosswalk:n}=e;const l=r?(0,u.psB)({entityTypeUri:t.type,contributorCrosswalkType:r.type,contributorCrosswalkValue:r.value,contributorCrosswalkSourceTable:r.sourceTable,crosswalkType:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,crosswalkDeleteDate:n.deleteDate}):(0,u.kRE)({entityUri:t.uri,crosswalk:n});(0,I.pipe)((0,I.andThen)((e=>{let[t]=e;return t})),a)(l)}),[a]),editCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:l}=e;(0,I.pipe)((0,I.ifElse)((e=>{let{value:t}=e;return(0,I.isNil)(t)}),u.K$w,u.WVU),(0,I.andThen)((e=>{let[t]=e;return t})),a)({entityUri:t,crosswalkId:r,attributeName:n,value:l})}),[a]),deleteCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r}=e;(0,I.pipe)(u.Gmt,a)({entityUri:t,crosswalkId:r})}),[a])}},Ds=(0,D.Z)({dragLayer:{position:"fixed",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",zIndex:1300,pointerEvents:"none"},crosswalkPreview:{height:"28px",maxWidth:"394px",display:"flex",overflow:"hidden",padding:"6px",alignItems:"center",boxSizing:"border-box"},sourceLabel:{fontSize:"13px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},sourceIcon:{width:"16px",height:"16px",marginRight:"9px"}}),Rs=e=>{let{crosswalk:t}=e;const r=Ds(),n=Yl(t),a=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),l=(0,u.tH7)(a,t.type);return c().createElement(ns,{color:n,className:r.crosswalkPreview},c().createElement(Pl.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(N.Z,{className:r.sourceLabel,variant:"body2"},l))},_s=(0,s.memo)((()=>{var e;const t=Ds(),{isDragging:r,clientOffset:n,item:a}=(0,ta.useDragLayer)((e=>({isDragging:e.isDragging(),clientOffset:e.getClientOffset(),item:e.getItem()}))),l=(0,s.useRef)(),o=(null===(e=l.current)||void 0===e?void 0:e.getBoundingClientRect())||{x:0,y:0},i=`translate(${(null==n?void 0:n.x)-(null==o?void 0:o.x)}px, ${(null==n?void 0:n.y)-(null==o?void 0:o.y)}px`;return r&&c().createElement("div",{ref:l,className:t.dragLayer},c().createElement("div",{style:{display:"flex",transform:i,WebkitTransform:i}},"Crosswalk"===a.type&&c().createElement(Rs,{crosswalk:a.crosswalk})))}));let As;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(As||(As={}));const Zs=(0,D.Z)((()=>({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.38,transition:"opacity 0.3s"}},wrapper:{width:"100%",display:"flex",alignItems:"center",height:28,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDcvMjYvMTMEw7WpAAAAeElEQVQ4ja3VuwrAIBBE0aup0uX/v9ImCCGSdIL4WF136+EwxcC6+3k/hAsxSREArvPAW2LAGFzFhqAG64JarAnuYBW4ixWgBZZBKwzAW2Ig7HAVCzHJ4AoGQsNVbAhqsC6oxZrgDlaBu1gBWmAZtMIA3MwLmMUAfmyqQ9/LD+oDAAAAAElFTkSuQmCC)"},focusedIcon:{width:28,height:28,backgroundColor:"rgba(0, 0, 0, 0.12)",borderRadius:0,borderRight:"1px solid #fff"},sourceIcon:{height:"16px",width:"16px",marginLeft:"16px",marginRight:"9px",fontSize:"14px"}}))),js=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Xl(),a=Zs({isOpaque:!n}),l=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),o=(0,u.tH7)(l,t);return c().createElement("div",{className:a.root},c().createElement(Sl.Z,{size:"XXS",className:a.focusedIcon,icon:r&&Jl.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(Pl.Z,{className:a.sourceIcon,sourceType:t}),c().createElement(N.Z,{variant:"body2"},o)))}));var Ms=r(19540),Ls=r(42484);function Vs(){return Vs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vs.apply(this,arguments)}const Fs=e=>c().createElement("svg",Vs({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"Copy_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Copy_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Copy_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#Copy_svg__b)",d:"M0 0h24v24H0z"}))),Bs=(0,D.Z)((()=>({root:{display:"flex",justifyContent:"space-between",alignItems:"center",overflowWrap:"anywhere"},text:{fontSize:13},button:{flexShrink:0,marginLeft:8,padding:0,textTransform:"none"}}))),Us=e=>{let{value:t}=e;const r=Bs();return c().createElement("div",{className:r.root},c().createElement(N.Z,{className:r.text,variant:"body2"},t),c().createElement(Sl.Z,{size:"XXS",icon:Fs,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},Hs=(0,D.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),zs=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const l=Hs(),[o,i]=(0,s.useState)(!1),u=e=>a(e.valueOf());return c().createElement(Sr.Z,{variant:"filled",value:t?new Date(t):null,disabled:n,onChange:(0,I.unless)((0,I.always)(o),u),onAccept:u,onOpen:()=>i(!0),onClose:()=>i(!1),InputProps:{disableUnderline:!0,classes:{input:l.timestampEditorInput,root:S()(l.timestampEditor,r.root)}}})};var Ws=r(95038),Gs=r.n(Ws);const qs=(0,D.Z)((e=>({text:{fontSize:13},attributeWrapper:{display:"flex",alignItems:"center",paddingTop:5,paddingBottom:5,marginLeft:12},attributeTitle:{fontSize:13,width:135,color:e.palette.text.secondary},attributeValue:{paddingLeft:10,display:"flex",alignItems:"center",flexGrow:1},input:{paddingTop:14,paddingBottom:14,fontSize:13},editor:{flexGrow:1},moreButton:{marginLeft:24},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"}}))),Ks=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const l=qs(),o=!("uri"in t),i=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),[d,p]=(0,s.useState)([]),[m,h]=(0,s.useState)(null),g=(0,s.useMemo)((()=>[{label:u.G39.sourceSystems.label,uri:"type"},{label:u.G39.value.label,uri:"value"},{label:u.G39.sourceTable.label,uri:"sourceTable",canBeAdded:o,canBeDeleted:o},{label:u.G39.createDate.label,uri:"createDate"},{label:u.G39.updateDate.label,uri:"updateDate"},{label:u.G39.deleteDate.label,uri:"deleteDate",canBeAdded:!0,canBeDeleted:!0},{label:u.G39.reltioLoadDate.label,uri:"reltioLoadDate"},{label:u.G39.publishDate.label,uri:"sourcePublishDate"}]),[]),f=(0,I.pipe)((0,I.filter)((0,I.propEq)("canBeAdded",!0)),(0,I.filter)((e=>!(0,I.has)(e.uri,t))),(0,I.filter)((e=>!d.includes(e.uri))))(g);return c().createElement(c().Fragment,null,f.length>0&&r&&c().createElement(E.Z,{label:C().text("Add attributes"),onApply:e=>{e.length>0&&p((t=>t.concat((0,I.map)((0,I.prop)("uri"),e))))},data:f}),g.map((e=>e.uri in t||d.includes(e.uri)?c().createElement("div",{key:e.uri,className:l.attributeWrapper},c().createElement(N.Z,{variant:"body2",className:l.attributeTitle},`${e.label}:`),c().createElement("div",{className:l.attributeValue},((e,t)=>{switch(e){case"type":{const r=(0,u.tH7)(i,t);return o?c().createElement(kl.Z,{label:"",placeholder:t,className:l.editor,value:{value:t,label:r},options:(0,u.cwx)(i).sort((0,I.ascend)((0,I.prop)("label"))).map((e=>{let{uri:t,label:r}=e;return{value:t,label:r}})),onChange:t=>{let{value:r}=t;return n(e,r)},TextFieldProps:{InputProps:{disableUnderline:!0}}}):c().createElement(c().Fragment,null,c().createElement(Pl.Z,{className:l.sourceIcon,sourceType:t}),c().createElement(N.Z,{className:l.text,variant:"body2"},r))}case"sourceTable":return o?c().createElement(xr.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:l.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:l.input}}}):c().createElement(N.Z,{className:l.text,variant:"body2"},t);case"value":return o?c().createElement(xr.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:l.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:l.input}}}):c().createElement(Us,{value:t});case"deleteDate":return c().createElement(zs,{value:t&&Gs().utc((0,u.ZBU)(t)).valueOf(),onChange:t=>n(e,t.toString()),classes:{root:l.editor},disabled:!r});case"sourcePublishDate":case"createDate":case"updateDate":case"reltioLoadDate":return c().createElement(N.Z,{className:l.text,variant:"body2"},(0,u.o0x)(t));default:return null}})(e.uri,t[e.uri]),e.canBeDeleted&&c().createElement(De.k,{icon:co.Z,disabled:!r,onClick:()=>h(e.uri),size:"XS",tooltipTitle:C().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(Oi,{open:!!m,onClose:()=>h(null),onConfirm:()=>{return e=m,p((t=>(0,I.without)([e],t))),void((0,I.isNil)(t[e])||a(e));var e}}))},Ys=(0,D.Z)({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.19,transition:"opacity 0.3s"}},header:{width:"100%",display:"flex",alignItems:"center",height:"28px"},focusedIcon:e=>{let{isFocused:t}=e;return{width:"26px","&:not([disabled])":{border:"1px solid rgba(0, 0, 0, 0.12)"},height:"28px",color:t?"#000":"rgba(0, 0, 0, 0.54)",borderRadius:0,margin:"0px 1px"}},crosswalkWrapper:{width:"100%",overflow:"hidden"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},attributesWrapper:e=>{let{color:t}=e;return{border:"1px solid",borderColor:t,position:"relative"}},deleteCrosswalkButton:{position:"absolute",top:5,right:5},labelValue:{marginLeft:5,marginRight:8},dependentIcon:{width:"16px",height:"16px",fillOpacity:.38}}),$s=(0,s.memo)((e=>{let{crosswalk:t,isDependent:r,isEmpty:n=!1,isColored:a=!0,focusable:l=!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p}=e;const m=(0,s.useRef)(null),h=Yl(t),{toggleCrosswalkFocus:g,isFocused:f}=Ql(t),b=n?"#FFF":a?h:"#CACCD1",{isDimmed:y,highlightCrosswalk:E,removeHighlight:v}=Xl(t),[x]=$l(),w=Ys({color:b,isOpaque:!y,isFocused:f}),[O,T]=(0,s.useState)(!1),[I,k]=(0,s.useState)(!1),S=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),P=(0,u.tH7)(S,t.type),D=(0,u.nIW)(t.uri),R=(0,u.x_)(t),[,_,Z]=(0,ta.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!R}),j=!R&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{Z((0,Ls.r)(),{captureDraggingState:!0})}),[]),(0,s.useEffect)((()=>{var e;l&&x&&(0,u.aFF)(x,t)&&x!==t&&(null==m||null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[x]),c().createElement("div",{className:w.root,ref:m},c().createElement(De.k,{size:"XXS",className:w.focusedIcon,icon:l&&Jl.Z,onClick:()=>g(),disabled:!l,tooltipTitle:l&&C().text("Focus")}),c().createElement("div",{className:w.crosswalkWrapper},c().createElement(ns,{ref:_,className:w.header,color:b,variant:R?"outlined":"filled",onMouseEnter:()=>E(),onMouseLeave:()=>v()},r&&c().createElement(Ms.Z,{className:w.dependentIcon}),c().createElement(cn.Z,{onClick:()=>T((e=>!e)),expanded:O}),c().createElement(Pl.Z,{className:w.sourceIcon,sourceType:t.type}),c().createElement(A.C,{value:P},c().createElement(N.Z,{variant:"body2",noWrap:!0},P)),c().createElement(Nl.Z,null),c().createElement(A.C,{value:t.value},c().createElement(N.Z,{variant:"body2",className:w.labelValue,noWrap:!0},t.value))),O&&c().createElement("div",{className:w.attributesWrapper},j&&c().createElement("div",{className:w.deleteCrosswalkButton},c().createElement(De.k,{icon:co.Z,disabled:i,onClick:()=>k(!0),size:"XS",tooltipTitle:i?C().text("You don't have permissions to delete"):C().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(Oi,{open:I,onConfirm:()=>{f&&g(),d(D)},onClose:()=>k(!1)})),c().createElement(Ks,{crosswalk:t,canEditAttribute:!o,onEditAttribute:(e,t)=>{p({crosswalkId:D,attributeName:e,value:t})},onDeleteAttribute:e=>{p({crosswalkId:D,attributeName:e})}}))))})),Xs=(0,D.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Qs=e=>{let{showMore:t,onClick:r}=e;const n=Xs();return c().createElement(kt.Z,{className:n.root,component:"button",variant:"caption",underline:"none",onClick:r},c().createElement("span",null,t?C().text("View dependent crosswalks"):C().text("Hide dependent crosswalks")))},Js=e=>{let{source:t,crosswalksByTypes:r,showCrosswalkColors:n=!0,crosswalksFocusEnabled:a=!0,expanded:l,disableEditCrosswalk:o,disableDeleteCrosswalk:i,onEdit:d,onDelete:p,onToggleExpanded:m}=e;const h=$l();return(0,s.useEffect)((()=>{!l&&a&&r[As.Dependent].some((e=>h.some((0,u.aFF)(e))))&&m()}),[h]),c().createElement(c().Fragment,null,0===r[As.Simple].length&&0===r[As.Empty].length&&c().createElement(js,{crosswalkType:t,focusable:a}),r[As.Simple].map((e=>c().createElement($s,{key:e.uri,crosswalk:e,focusable:a,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d,isColored:n}))),r[As.Empty].map((e=>c().createElement($s,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d,isColored:n}))),l&&r[As.Dependent].map((e=>c().createElement($s,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d,focusable:a,isColored:n}))),r[As.Dependent].length>0&&c().createElement(Qs,{showMore:!l,onClick:()=>m()}))},ec=(0,D.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),tc=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=ec(),[l,o]=(0,s.useState)({type:"",value:""});return c().createElement("div",{className:t},c().createElement(N.Z,{variant:"body1",className:a.caption},C().text("Add crosswalk")),c().createElement(Ks,{crosswalk:l,onDeleteAttribute:e=>{o((0,I.dissoc)(e))},onEditAttribute:(e,t)=>{o((0,I.assoc)(e,t))}}),c().createElement("div",{className:a.controlButtons},c().createElement(Fo.Z,{className:a.cancelButton,onClick:n},C().text("Cancel")),c().createElement(Fo.Z,{color:"primary",onClick:()=>{r(l),n()},disabled:!l.type||!l.value},C().text("Add"))))},rc=e=>e[As.Simple].length>0?1:e[As.Dependent].length>0?e[As.Empty].length>0?2:3:4,nc=(0,I.evolve)({[As.Dependent]:(0,I.sort)(((e,t)=>{const r=e.sourceTable||"",n=t.sourceTable||"";return r===n?0:r?n?r<n?-1:1:-1:1}))}),ac=(0,I.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[As.Simple]:[],[As.Empty]:[],[As.Dependent]:[]}),"relation"===n.ownerType?r[n.type][As.Dependent].push(n):((e,t,r)=>0===(0,u.sJj)(r).filter((r=>{const n=(0,u.AFK)(r,e);return t.some((0,I.propEq)("uri",n))})).length)(e,t,n)?r[n.type][As.Empty].push(n):((e,t,r)=>!(0,u.sJj)(r).some((r=>{const n=(0,u.AFK)(r,e),a=t.find((0,I.propEq)("uri",n));return a&&!(0,u.YkM)(a)})))(e,t,n)?r[n.type][As.Dependent].push(n):r[n.type][As.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>rc(n[e])-rc(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:nc(n[e])})))}));var lc=r(62116),oc=r(55401);const ic=e=>{let{entity:t,historyEvent:r}=e;const[n,a]=(0,s.useState)(!1),l=(0,At.useSelector)(Zt.ZP.selectors.getHistorySlice),o=(0,At.useDispatch)(),i=(0,Mt._)(),{aStamp:c,bStamp:d,overrideUri:p}=r||{},m=p||(null==t?void 0:t.uri);return(0,s.useEffect)((()=>{r&&m&&(a(!0),i(Promise.all([(0,u.lrH)(m,c),d&&1!==d?(0,u.lrH)(m,d):Promise.resolve(null)])).then((e=>{let[t,r]=e;o(Zt.N5.history.actions.setHistorySlice({aEntity:t,bEntity:r}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{a(!1)})))}),[c,d,m]),{isLoading:n,historySlice:l}};let sc;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(sc||(sc={}));var cc=r(39034);const uc=e=>(0,I.pipe)((0,I.map)(e),(0,I.join)(" or ")),dc=e=>{const[t,r]=e;return Gs()().subtract(t,r).valueOf()},pc=(0,I.chain)((0,I.cond)([[(0,I.equals)(sc.MERGE),()=>[l.I.ENTITIES_MERGED,l.I.ENTITIES_MERGED_MANUALLY,l.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,I.equals)(sc.UNMERGE),()=>[l.I.ENTITIES_SPLITTED]],[(0,I.equals)(sc.UPDATE),()=>[l.I.ENTITY_CHANGED]]])),mc=(0,I.pipe)((0,I.defaultTo)([]),pc,(0,I.concat)([l.I.ENTITY_CREATED,l.I.ENTITY_REMOVED,l.I.ENTITY_LOST_MERGE]),uc((e=>`equals(type, '${e}')`))),hc=(0,I.pipe)((0,I.defaultTo)({}),(0,I.reject)(u.O27),(0,I.evolve)({users:uc((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:uc((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case cc.K.WITHIN:return`gte(timestamp, ${dc(r)})`;case cc.K.AGO:return`lte(timestamp, ${dc(r)})`;case cc.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${Gs()(t).endOf("date").valueOf()})`}default:return""}}}),(0,I.over)((0,I.lensProp)("activities"),mc),I.values,(0,I.reject)(u.O27),(0,I.append)("not equals(user, 'collaboration-service')"),(0,I.map)((e=>`(${e})`)),(0,I.join)(" and "));function gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 bc={activities:[sc.MERGE,sc.UNMERGE,sc.UPDATE]},yc=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)(bc),[l,o]=(0,s.useState)(0),i=(0,s.useMemo)((()=>hc(n)),[n]),[c,d]=(0,s.useState)(null),[p,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(!1),f=(0,Mt._)(),b=null==t?void 0:t.uri,y={max:32,order:"desc"},E=(0,u.O27)(null==n?void 0:n.attributes)||void 0;(0,s.useEffect)((()=>{b&&r&&(g(!0),f((0,u.kgP)(gc({entityUri:b,historicUris:c,filter:i,showAll:E},y))).then(m).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{g(!1)})))}),[i,E,c]),(0,s.useEffect)((()=>{b&&r&&(g(!0),f((0,u.wdF)({entityUri:b})).then((e=>{d(e)})).catch((e=>{console.warn("Failed to load history data",e),d(null)})).finally((()=>{g(!1)})),o(0))}),[b,null==t?void 0:t.updatedTime,r]);const v=(0,s.useCallback)((e=>{b&&c&&r&&(g(!0),f((0,u.kgP)(gc({entityUri:b,historicUris:c,filter:i,showAll:E,offset:e},y))).then((e=>{m((t=>gc({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{g(!1)})))}),[c,i,r]),x=(0,s.useMemo)((()=>32*(l+1)<(null==p?void 0:p.total)),[p,l]),w=(0,s.useCallback)((e=>{o(0),a(e)}),[]),O=(0,s.useCallback)((()=>{w(gc({},bc))}),[]),T=(0,s.useCallback)((()=>{x&&(v(32*(l+1)),o(l+1))}),[v,l,x]);return{isLoading:h,canLoadMore:x,onLoadMore:T,onApplyFilter:w,onClearFilter:O,historicUris:c,historyWithTotal:p,historyFilter:n}},Ec={appearance:{},attributes:{},roles:[],tags:[]},vc=(0,I.evolve)({refEntity:u.VGB,refRelation:u.VGB}),xc=e=>e?(0,I.evolve)({attributes:(0,I.map)((0,I.map)(vc))})(e):e,wc=()=>{const e=(0,At.useDispatch)(),t=(0,At.useSelector)(Zt.ZP.selectors.getHistorySlice),r=(0,At.useSelector)(Zt.ZP.selectors.getHistoryDiff),n=(0,At.useSelector)(Zt.ZP.selectors.getHistoryMode),a=(0,At.useSelector)(Zt.ZP.selectors.getEntity);return(0,s.useEffect)((()=>{if(t){const{aEntity:r,bEntity:l}=t,o=u.nwO.HistoryManager.createHistoryManager(u.nwO.AttributesDiff).computeEntityHistoryDiff(xc(n===Zt.Z9.Current?a:l),xc(r));e(Zt.N5.history.actions.setHistoryDiff(o))}}),[t,n,e,a]),r||Ec};var Oc=r(57312);const Tc=(0,D.Z)((()=>({historyRow:{position:"relative",padding:"8px 12px 16px",cursor:"pointer"},selected:{background:"rgba(0,0,0,0.05)","&:before":{content:'""',background:"rgba(0,0,0,0.05)",width:"100%",height:"100%",position:"absolute",left:"-100%",top:0}},rowHeader:{display:"flex",position:"relative"},badge:e=>{let{color:t}=e;return{position:"absolute",width:"2px",height:"100%",left:"-9px",pointerEvents:"none",background:t,"&:before":{height:"100%",width:"3px",content:'""',left:"-3px",background:t,position:"absolute",opacity:.06}}},title:{color:"rgba(0,0,0,0.87)",fontSize:"13px",letterSpacing:0,lineHeight:"16px",fontWeight:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&.bold":{fontWeight:500}},date:{marginLeft:"auto",color:"rgba(0,0,0,0.54)",fontSize:"11px",letterSpacing:0,lineHeight:"16px"},user:{color:"rgba(0,0,0,0.38)",fontSize:"12px",letterSpacing:0,lineHeight:"14px"}}))),Cc=e=>{let{change:t,isCurrent:r,isSelected:n,onClick:a}=e;const{uri:l,type:o,matchGroups:i,user:s,timestamp:d}=t,p=(0,u.GtP)(l),m=Tc({color:p});return c().createElement("div",{className:S()(m.historyRow,{[m.selected]:n}),onClick:a},c().createElement("div",{className:m.rowHeader},c().createElement("div",{className:m.badge}),c().createElement(N.Z,{className:S()(m.title,{bold:r})},r?C().text("Current view"):(0,Oc.Xr)(o)),!r&&c().createElement(N.Z,{className:m.date},C().date(d,"L LT"))),i&&c().createElement(N.Z,{className:m.title},C().text("Match rule:")," ",i.join(", ")),c().createElement(N.Z,{className:m.user},s))};function Ic(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var kc;!function(e){e.FAKE_NAVIGATE_PROFILE="FAKE_NAVIGATE_PROFILE",e.FAKE_FILTERED_INCOMING="FAKE_FILTERED_INCOMING",e.FAKE_FILTERED_OUTGOING="FAKE_FILTERED_OUTGOING",e.FAKE_UPDATE="FAKE_UPDATE"}(kc||(kc={}));const Sc=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){Ic(e,t,r[t])}))}return e}({},l.I,kc),Pc=e=>e===Sc.FAKE_FILTERED_INCOMING||e===Sc.FAKE_FILTERED_OUTGOING,Nc=e=>{let{x:t,y:r,toX:n,toY:a,color:l,isDashed:o}=e;const i=((e,t,r,n)=>{const a=t>n,l=e<r,o=a?-6:6;return`M${e} ${t} L${l?r-12:r+12} ${t} ${l?`c 6 0 12 ${o} 12`:`c -6 0 -12 ${o} -12`} ${a?-12:12} L${r} ${n}`})(t,r,n,a);return c().createElement("path",{d:i,stroke:l,strokeWidth:2,fill:"none",strokeDasharray:o?"3,3":void 0})};function Dc(){return Dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dc.apply(this,arguments)}const Rc=(0,s.forwardRef)(((e,t)=>{let{x:r,y:n,color:a,isDashed:l,isCollapsed:o,showCollapseIcon:i,showLine:s}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["x","y","color","isDashed","isCollapsed","showCollapseIcon","showLine"]);const d=i?6:3;return c().createElement("g",Dc({},u,{ref:t}),s&&c().createElement("rect",{id:"line",x:r-d-4,y:n-d-4,width:2*d+8,height:2,fill:a}),c().createElement("circle",{cx:r,cy:n,r:d,fill:l?"#fff":a,stroke:a,strokeDasharray:l?"1,1":void 0,strokeWidth:2}),i&&c().createElement("g",{id:"icon"},c().createElement("rect",{x:r-4,y:n-1,width:8,height:2,fill:"#fff"}),o&&c().createElement("rect",{x:r-1,y:n-4,width:2,height:8,fill:"#fff"})))})),_c=(0,St.Z)(Rc),Ac=(0,s.memo)((e=>{let{graphData:t,onHistoryCircleMouseOver:r}=e;const{historyLanes:n,rows:a}=t,l=[16],{links:o,rowLines:i,circles:s}=a.reduce(((e,t,o)=>{let{uri:i,height:s,uris:d,type:p,fakeType:m,index:h,timestamp:g,label:f}=t;const b=16*n[i].index+24,y=l[o];l.push(y+s);const E=Pc(m),v=E?d[0]:i,x=!(null!=d&&d.some((e=>n[e])));e.circles.push(c().createElement(_c,{tooltipTitle:f,tooltipPlacement:"top",onMouseOver:r?()=>r(i,g,h):void 0,key:`circle-${v}-${o}`,x:b,y,color:(0,u.GtP)(v),isDashed:E,isCollapsed:x,showCollapseIcon:!!d,showLine:m===Sc.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(c().createElement("rect",{key:`${v}-${h}`,x:b,y:y-8,width:"100%",height:16,fill:(0,u.GtP)(v),opacity:.06}));const w=p===Sc.ENTITIES_SPLITTED;return null==d||d.forEach((t=>{const r=n[t];if(!r)return;const l=a[o].height,i=16*r.index+24,s=w?y-l:y+l;b!==i&&e.links.push(c().createElement(Nc,{key:`link-${t}-${h}`,x:b,y,toX:i,toY:s,isDashed:Pc(m),color:(0,u.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),d=16*Object.keys(n).length+24,p=l[l.length-1]-16;return Object.entries(n).forEach((e=>{let[t,r]=e;const n=16*r.index+24;r.lifeTime.forEach(((e,i)=>{var d;let{start:p,end:m}=e;if((null===(d=a[null==m?void 0:m.index])||void 0===d?void 0:d.type)===Sc.ENTITIES_SPLITTED)return;const h=(null==p?void 0:p.type)===Sc.ENTITIES_SPLITTED?(null==p?void 0:p.index)-1:null==p?void 0:p.index,g=(null==m?void 0:m.type)===Sc.ENTITIES_MERGED_MANUALLY||(null==m?void 0:m.type)===Sc.ENTITIES_MERGED?(null==m?void 0:m.index)+1:null==m?void 0:m.index,f=l[h]||l[l.length-2],b=l[g]||16;if(f<=b)return;const y=(0,u.GtP)(t);!m&&r.index>0&&s.push(c().createElement(Rc,{key:`initCircle-${t}-${i}`,x:n,y:b,color:y,showLine:!0})),o.unshift(c().createElement("path",{key:`line-${t}-${i}`,d:`M${n} ${f} L${n} ${b}`,stroke:y,strokeWidth:2}))}))})),c().createElement("svg",{className:"chart",width:d,height:p},c().createElement("g",{id:"rowLines"},i),c().createElement("g",{id:"links"},o),c().createElement("g",{id:"circles"},s))})),Zc=(0,D.Z)({historyTree:{display:"grid",gridTemplateColumns:"auto 1fr",overflowY:"auto"},graph:{overflowX:"scroll",overflowY:"hidden"},history:{minWidth:344},buttonContainer:{gridColumnStart:1,gridColumnEnd:3,padding:"8px 16px"},shadow:{boxShadow:"inset -8px 0px 5px -5px rgba(0,0,0,0.1)"}});function jc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mc(e,t,r[t])}))}return e}function Mc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lc=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:l,historyEvent:o,findPreviousChange:i}=e;const d=Zc(),p=(0,At.useDispatch)(),m=(0,At.useSelector)(Zt.ZP.selectors.getIsEditableMode),h=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),[g,f]=(0,s.useState)({historyLanes:{},rows:[]}),[b,y]=(0,s.useState)(!1),[E,v]=(0,s.useState)(-1);(0,s.useEffect)((()=>{if((0,I.isNil)(o))return void v(0);const e=e=>(null==e?void 0:e.uri)===((null==o?void 0:o.overrideUri)||l)&&(null==e?void 0:e.timestamp)===(null==o?void 0:o.aStamp),r=-1!==E?t.rows[E]:null,n=t.rows.findIndex((t=>e(t)));v(e(r)?E:n)}),[t.rows,o]);const x=(0,s.useRef)(null),w=(0,s.useCallback)((e=>{if(!(0,I.isNil)(e)){var r;const n=null===(r=t.rows)||void 0===r?void 0:r.map(((t,r)=>{var n;return jc({},t,{height:null===(n=e.childNodes[r])||void 0===n?void 0:n.clientHeight})}));f({historyLanes:t.historyLanes,rows:n})}}),[t]),O=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:r}=(null==x?void 0:x.current)||{};y(r<e-t)};return c().createElement("div",{className:d.historyTree},r&&c().createElement(Jr.Z,null),c().createElement("div",{className:S()(d.graph,{[d.shadow]:b}),onScroll:O,ref:x},c().createElement(Ac,{onHistoryCircleMouseOver:(e,t,r)=>{if((0,I.isNil)(g.rows[r].label)){const n={time:t,select:"crosswalks"};(0,u.HvW)(e,n).then((e=>{let{crosswalks:t}=e;const n=t?(0,I.uniqBy)((0,I.prop)("type"),t).map((e=>{const t=(0,u.s5)(h,e.type);return t?t.label:null})).filter(I.identity).join(", "):C().text("No data");f((e=>jc({},e,{rows:e.rows.map((e=>e.index===r?jc({},e,{label:n}):e))})))}))}},graphData:g}),c().createElement(mt.Z,{handleWidth:!0,onResize:O})),c().createElement("div",{ref:w,className:d.history},t.rows.map(((e,t)=>{const r=t===E,n=0===t;return c().createElement(Cc,{key:`row-${t}`,change:e,isCurrent:n,isSelected:r,onClick:()=>((e,t,r,n)=>{if(m){if(!window.confirm(C().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;p(Zt.N5.mode.actions.modeUpdated(u.ARY.Viewing))}if(n&&!r||!n&&r)p(Zt.N5.history.actions.clearHistoryEvent()),v(0);else if(!n&&!r){const r=i(e-1,t.uri||l),n=i(e,t.uri||l),a=null==r?void 0:r.timestamp,o=null==n?void 0:n.timestamp,s=(null==t?void 0:t.uri)===l?null:null==t?void 0:t.uri;p(Zt.N5.history.actions.setHistoryEvent({aStamp:a,bStamp:o,overrideUri:s})),v(e)}})(t,e,r,n)})}))),n&&c().createElement("div",{className:d.buttonContainer},c().createElement(Fo.Z,{color:"primary",onClick:()=>a()},C().text("Show more"))))},Vc=(0,D.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),Fc=(0,D.Z)({icon:e=>{let{color:t}=e;return{boxSizing:"border-box",borderWidth:2,borderStyle:"solid",borderColor:t,height:12,width:12,borderRadius:30,transition:"opacity 0.3s",margin:4}},active:e=>{let{color:t}=e;return{backgroundColor:t}},inactive:{backgroundColor:"white"},clickable:{cursor:"pointer"}}),Bc=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),l=Fc({color:a});return c().createElement("div",{className:S()(l.icon,{[l.inactive]:!r,[l.active]:r,[l.clickable]:!!n}),onClick:n})},Uc=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:l}=e;const o=Vc();return c().createElement("div",{className:S()(o.root,l)},c().createElement(Bc,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement(Bc,{key:e,value:e,isSelected:null==r?void 0:r.includes(e),onClick:()=>(e=>{null!=r&&r.includes(e)?a((0,I.without)([e],r)):a([...r||[],e])})(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 zc=(e,t)=>e.reduce(((e,r,n)=>{let{start:a,end:l}=r;if(a){const r=t-a.timestamp;((0,I.isNil)(e.startDistance)||Math.abs(e.startDistance)>Math.abs(r)&&r>0)&&(e.startIndex=n,e.startDistance=r)}if(l){const r=t-l.timestamp;((0,I.isNil)(e.endDistance)||Math.abs(e.endDistance)>Math.abs(r)&&r<0)&&(e.endIndex=n,e.endDistance=r)}return e}),{startIndex:null,endIndex:null,startDistance:null,endDistance:null}),Wc=(0,D.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),Gc=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:l,onLoadMore:o,historyEvent:i}=e;const u=Wc(),[d,p]=(0,s.useState)(null);(0,s.useEffect)((()=>{p(n)}),[n]);const{historyData:m,findPreviousChange:h}=(e=>{let{entityUri:t,historyChanges:r,selectedUris:n}=e;return(0,s.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},a=[{user:"",timestamp:0,uri:t}],l=(0,I.curry)(((e,r,n)=>{const a=n.uri||t;if(e)if(Array.isArray(e)){if(n.type!==Sc.ENTITY_LOST_MERGE)return null;if(e.includes(a))return n;if(r&&n.uris)return e.some((e=>n.uris.includes(e)))?n:null}else{var l;if(a===e||r&&null!==(l=n.uris)&&void 0!==l&&l.includes(e))return n}return null})),o=(e,t,n)=>(0,I.pipe)((0,I.drop)(e+1),(0,I.find)(l(t,n)))(r),i=t=>(e[t]||n&&!n.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),e[t]),s=(e,t)=>{const r=e[e.length-1];!r||r.start&&(r.start.type!==Sc.ENTITY_CREATED||t.type!==Sc.ENTITIES_SPLITTED)?e.push({start:t,end:null}):r.start=t},c=(e,t)=>{let r=!0;if(e.length){const n=e[e.length-1];r=!((!n.start||n.start.timestamp<t.timestamp)&&(!n.end||n.end.timestamp>t.timestamp))}r&&e.push({start:null,end:null})},u=(e,t)=>{if(e.length){const r=e[e.length-1];r.start||(r.start=t)}e.push({start:null,end:t})},d=[];return null==r||r.forEach(((r,n)=>{var l;switch(r.type){case Sc.ENTITIES_SPLITTED:if(!o(n,r.uri||t,!1))return;{const e=r.uri,t=r.uris?[r.uris,e]:[e],a=o(n,t,!0);if(a&&(!e||e===a.uri))return}break;case Sc.ENTITY_LOST_MERGE:case Sc.RELATIONSHIP_CREATED:case Sc.RELATIONSHIP_REMOVED:case Sc.RELATIONSHIP_CHANGED:return}let p=!1;null===(l=r.uris)||void 0===l||l.forEach((e=>{i(e)||(p=!0)}));const m=i(r.uri||t);if(!m)return;const h=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}({},r);((t,r)=>{var n,l;switch(r.type){case Sc.ENTITY_CREATED:s(t,r);break;case Sc.ENTITIES_MERGED_ON_THE_FLY:case Sc.ENTITY_CHANGED:c(t,r);break;case Sc.ENTITY_LOST_MERGE:case Sc.ENTITY_REMOVED:u(t,r);break;case Sc.ENTITIES_SPLITTED:c(t,r),null===(n=r.uris)||void 0===n||n.forEach((t=>{const n=e[t];if(!n)return;const l=n.lifeTime.length;l?s(n.lifeTime,r):u(n.lifeTime,r),a.push({uri:t,user:r.user,type:r.type,fakeType:l?Sc.FAKE_UPDATE:Sc.FAKE_NAVIGATE_PROFILE,timestamp:r.timestamp})}));break;case Sc.ENTITIES_MERGED:case Sc.ENTITIES_MERGED_MANUALLY:c(t,r),null===(l=r.uris)||void 0===l||l.forEach((t=>{const n=e[t];n&&u(n.lifeTime,r)}))}})(m.lifeTime,h),p&&d.push(h),a.push(h)})),d.forEach((t=>{t.uris.forEach((n=>{e[n]||r.forEach((r=>{let{uri:l,uris:o,timestamp:i,user:s,type:c}=r;l===n&&(null==o||o.forEach((r=>{const n=e[r];if(!n)return;let l=null;switch(c){case Sc.ENTITIES_MERGED:case Sc.ENTITIES_MERGED_MANUALLY:l=Sc.FAKE_FILTERED_INCOMING;break;case Sc.ENTITIES_SPLITTED:l=Sc.FAKE_FILTERED_OUTGOING;break;default:return}const o={fakeType:l,uri:t.uri,uris:[r],type:c,user:s,timestamp:i},u=zc(n.lifeTime,t.timestamp);l===Sc.FAKE_FILTERED_INCOMING?(0,I.isNil)(u.endIndex)||(n.lifeTime[u.endIndex].end=o):(0,I.isNil)(u.startIndex)||(n.lifeTime[u.startIndex].start=o),a.splice(a.indexOf(t),0,o)})))}))}))})),a.forEach(((e,r)=>{e.index=r,e.uri=e.uri||t})),{historyData:{historyLanes:e,rows:a},findPreviousChange:(e,t)=>(0,I.pipe)((0,I.slice)(e+1,1/0),(0,I.find)(l(t,!1)))(a)}}),[t,r,n])})({entityUri:a,historyChanges:null==r?void 0:r.changes,selectedUris:d});return c().createElement("div",{className:u.root},c().createElement(Uc,{values:n,selectedValues:d,onSelectValues:p,entityUri:a,className:u.borderBottom}),c().createElement(Lc,{historyData:m,isLoading:t,onLoadMore:o,canLoadMore:l,entityUri:a,historyEvent:i,findPreviousChange:h}))}));var qc=r(85256),Kc=r(36444),Yc=r(15791),$c=r(55234);const Xc=[cc.K.WITHIN,cc.K.AGO,cc.K.BETWEEN],Qc=e=>({[cc.K.WITHIN]:C().text("Within the last"),[cc.K.AGO]:C().text("More than"),[cc.K.BETWEEN]:C().text("Date range")}[e]||"");var Jc=r(77875),eu=r(27446);const tu=(0,D.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),ru=[null,null],nu=[null,"hours"],au=e=>{let{value:t,onChange:r,className:n}=e;const a=tu(),l=e=>e===cc.K.WITHIN||e===cc.K.AGO,o=e=>e===cc.K.BETWEEN,i=o(null==t?void 0:t.type)?t.period:ru,u=l(null==t?void 0:t.type)?t.period:nu,[d,p]=(0,s.useState)(i),[m,h]=(0,s.useState)(u),g=(null==t?void 0:t.type)||cc.K.WITHIN,f=e=>l(e)?m:o(e)?d:void 0,b=e=>{r({type:g,period:e})};return(0,gt.D)((()=>{t?l(t.type)?h(t.period):o(t.type)&&p(t.period):(p(ru),h(nu))}),[t]),c().createElement("div",{className:S()(a.root,n)},c().createElement(N.Z,{className:a.title,variant:"subtitle1"},C().text("Date")),c().createElement("div",{className:a.intervalContainer},c().createElement(kl.Z,{label:"",className:a.typeInput,value:{value:g,label:Qc(g)},options:Xc.map((e=>({value:e,label:Qc(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),l(g)?c().createElement(Jc.Z,{interval:m,onChange:b}):c().createElement(eu.Z,{values:d,onChange:b})))},lu=[sc.UPDATE,sc.MERGE,sc.UNMERGE];function ou(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iu(e,t,r[t])}))}return e}function iu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const su={input:e=>ou({},e,{fontSize:"14px"}),menuPortal:e=>ou({},e,{zIndex:1300})},cu=(0,D.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},valueContainer:{overflowY:"auto",height:44},option:{fontSize:"14px",height:"32px"}}),uu=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=cu(),l=e=>{return{value:e,label:(t=e,{[sc.UPDATE]:C().text("Update"),[sc.MERGE]:C().text("Merge"),[sc.UNMERGE]:C().text("Unmerge")}[t]||"")};var t},o=e=>e.map(l),i=o(lu);return c().createElement("div",{className:S()(a.root,n)},c().createElement(N.Z,{className:a.title,variant:"subtitle1"},C().text("Activity")),c().createElement(Xn.Z,{value:o(t),onChange:(0,I.pipe)((0,I.defaultTo)([]),(0,I.pluck)("value"),r),options:i,TextFieldProps:{classes:{root:a.dropDownInput}},components:{DropdownIndicator:ur.Z},styles:su,classes:a,menuPlacement:"bottom",menuPortalTarget:document.body}))},du=(0,D.Z)({popup:{width:500,height:500,overflowY:"hidden",display:"flex",flexDirection:"column"},filterContainer:{padding:20,height:410,display:"flex",flexDirection:"column"},filterContainerScrollable:{overflowY:"auto"},filterItem:{marginTop:15},filterControls:{display:"flex",padding:"10px 12px 0",borderTop:"solid 1px rgba(0, 0, 0, 0.12)"},clearButton:{marginRight:"auto"},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px"}});function pu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mu=e=>{let{className:t,filter:r,onApplyFilter:n,onClearFilter:a,entityType:l}=e;const o=du(),[i,u]=(0,s.useState)(null),d=()=>u(null),[p,m]=(0,s.useState)(r);(0,s.useEffect)((()=>{m(r)}),[r]);const h=(0,I.curry)(((e,t)=>{m((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pu(e,t,r[t])}))}return e}({},r,{[e]:t})))})),{activities:g=[],attributes:f=[],dateRange:b=null,users:y=[]}=p||{};return c().createElement(c().Fragment,null,c().createElement(Sl.Z,{icon:Kc.Z,size:"L",onClick:e=>u(e.currentTarget),className:t}),c().createElement(mo.ZP,{classes:{paper:o.popup},open:!!i,anchorEl:i,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:o.filterContainer},c().createElement(N.Z,{variant:"h6"},C().text("Filter")),c().createElement("div",{className:o.filterContainerScrollable},c().createElement(au,{value:b,onChange:h("dateRange"),className:o.filterItem}),c().createElement(Yc.Z,{selectedUsers:y,onChange:h("users"),className:o.filterItem}),c().createElement(uu,{selectedHistoryActivityTypes:g,onChange:h("activities"),className:o.filterItem}),c().createElement($c.Z,{selectedAttributes:f,entityType:l,onChange:h("attributes"),className:o.filterItem,title:C().text("Attribute updated")}))),c().createElement("div",{className:o.filterControls},c().createElement(Fo.Z,{onClick:a,className:o.clearButton},C().text("Clear all")),c().createElement(Fo.Z,{onClick:d},C().text("Cancel")),c().createElement(Fo.Z,{color:"primary",onClick:()=>{b&&(e=>{if(e.type===cc.K.AGO||e.type===cc.K.WITHIN){const[t,r]=e.period;return"Number"===(0,I.type)(t)&&"String"===(0,I.type)(r)&&t>0}if(e.type===cc.K.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}})(b)?n(p):n((0,I.dissoc)("dateRange",p)),d()}},C().text("Apply")))))};var hu=r(98281);const gu=(0,D.Z)({menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),fu=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=tt.ZT}=e;const a=gu(),{text:l,selected:o,onClick:i}=r;return c().createElement(P.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},o&&c().createElement(hu.Z,{className:a.checkIcon}),c().createElement(N.Z,{classes:{root:a.menuText}},l))}));fu.displayName="MenuItemRenderer";const bu=fu,yu=()=>{const e=(0,At.useSelector)(Zt.ZP.selectors.getHistoryMode),t=(0,At.useDispatch)(),r=e=>{t(Zt.N5.history.actions.setHistoryMode(e))},n=[{text:C().text("Compare to Current view"),selected:e===Zt.Z9.Current,onClick:()=>r(Zt.Z9.Current)},{text:C().text("Compare to Previous view"),selected:e===Zt.Z9.Previous,onClick:()=>r(Zt.Z9.Previous)}];return c().createElement(Er.Z,{MenuItemRenderer:bu,buttonComponent:Sl.Z,buttonProps:{icon:po.Z,size:"L"},menuId:"history-menu",menuItems:n})},Eu=(0,D.Z)({root:{display:"flex",flex:1,alignItems:"center"},icon:{margin:4},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"3px 19px"},count:{fontSize:14},filterButton:{marginRight:"-4px"}}),vu=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}=e;const o=Eu();return c().createElement("div",{className:o.root},c().createElement(N.Z,{variant:"h6"},C().text("History")),!(0,I.isNil)(t)&&c().createElement(c().Fragment,null,c().createElement(qc.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),c().createElement(N.Z,{variant:"body1",color:"textSecondary",className:o.count},1===t?C().text("${count} contributing profile",{count:t}):C().text("${count} contributing profiles",{count:t}))),c().createElement(Nl.Z,null),c().createElement(mu,{className:o.filterButton,entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}),c().createElement(yu,null))},xu=(0,D.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),wu=()=>{const e=xu(),t=(0,At.useSelector)(Zt.ZP.selectors.getHistoryEvent),r=(0,At.useDispatch)(),n=(0,I.pipe)(Zt.N5.history.actions.clearHistoryEvent,r);return t?c().createElement("div",{className:e.root},c().createElement(N.Z,{component:"div"},C().text("You are viewing a historic slice:")," ",c().createElement("span",{className:e.slice},C().date(t.aStamp,"llll"))),c().createElement(Fo.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},C().text("Cancel"))):null},Ou=()=>c().createElement(Tl,{text:C().text("History in the making"),secondaryText:C().text("When you create an event or perform an activity, it will show up here.")});var Tu=r(37457);const Cu=(0,D.Z)({editor:{display:"flex",flexDirection:"column",padding:"0 24px 5px"},title:{color:"rgba(0, 0, 0, 0.6)",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",margin:"17px 0 24px"},item:{marginBottom:"20px"},dense:{marginBottom:0},actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}});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){ku(e,t,r[t])}))}return e}function ku(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Su=e=>{let{connection:t,modifiedEntity:r,allModifiedEntities:n,dispatch:a,config:l,mode:o,metadata:i,globalSearchRequestOptions:d,error:p}=e;const{relationUri:m,relationType:h,direction:g}=t.relation,b=t.isNew,E=Cu(),{inRelations:v=[],outRelations:x=[]}=(0,s.useMemo)((()=>(0,u.ocC)({content:t.parentEntityUri?l.contentSecondLevel:l.content,direction:g,relationType:h,mode:o,metadata:i})),[l,g,h,o,i,t.parentEntityUri]),w=(0,s.useMemo)((()=>(0,u.xF8)(i,h)),[h,i]),O=(0,s.useMemo)((()=>Iu({attributes:Iu({},Zt.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,u.p2l)(t.relation))),[t]),T=(0,s.useRef)(t),k=(0,s.useRef)(r),P=(0,s.useMemo)((()=>(0,u.SAs)(n,r)),[n,r]),D=(0,s.useRef)([]);(0,s.useEffect)((()=>{D.current=(0,I.pipe)((0,I.concat)(P.map((0,I.prop)("uri"))),I.uniq)(D.current)}),[P]);const R=(0,s.useRef)(P),_=(0,u.z7d)(v,x),A=T.current!==t||k.current!==r||(Z=R.current,j=P,Z.length!==j.length||Z.some(((e,t)=>Z[t]!==j[t])))||t.isNew&&!(0,u.O27)((0,I.path)(["relation","object","attributes"],t));var Z,j;const M=b?Zt.N5.relations.actions.addRelation:Zt.N5.relations.actions.editRelation,L=(0,s.useCallback)((0,I.pipe)(Zt.N5.relations.actions.setRelationType(l.id,m),a),[l,m,a]),V=(0,s.useCallback)((()=>(0,I.pipe)(Zt.N5.relations.actions.closeRelationEditor,a)(l.id,m)),[l,m,a]),F=(0,s.useCallback)((e=>{if(r){const t=(0,u.nt9)(i,r.type);return(0,u.wx9)(t,r,e)}return e}),[r,i]),B=(0,s.useCallback)((e=>a(Zt.N5.modifiedEntities.actions.entityCreated(e))),[a]),U=(0,s.useCallback)((e=>a(Zt.N5.modifiedEntities.actions.entityDeleted(e))),[a]),H=(0,s.useCallback)((e=>{r&&U(r.uri),a(Zt.N5.relations.actions.setRelationEntity(l.id,m,e)),p&&a(Zt.N5.errors.actions.errorDeactivated((0,u.iFp)(p)))}),[l.id,m,a,r,U,p]),z=(0,s.useCallback)((()=>{const e=(0,u.Bd_)(i,n,t);return a(Zt.N5.errors.actions.errorsSet(e)),0===e.length}),[t,i,n,a]),W=(0,s.useCallback)((()=>a(Zt.N5.errors.actions.errorsSet([]))),[a]),G=(0,s.useCallback)((0,I.pipe)((0,I.always)(t),(0,I.when)(z,(0,I.pipe)(u.zhn,F,M(l.id),a,(0,I.always)((0,I.differenceWith)(I.equals,D.current,P.map((0,I.prop)("uri")))),(0,I.forEach)(U),V))),[t,l,a,F,z,P]),q=(0,s.useCallback)((()=>{const e=k.current;r!==e&&(e?(B(e),r&&r.uri!==e.uri&&U(r.uri)):U(r.uri));const t=R.current;(0,I.differenceWith)(I.equals,D.current,t.map((0,I.prop)("uri"))).forEach(U),t.forEach(B),W(),V()}),[V,B,U,W,r]),K=(0,s.useCallback)((e=>(0,I.pipe)(Zt.N5.actions.addAttributes,a)(e.map((e=>Iu({},e,{viewId:l.id}))))),[l.id,a]),Y=(0,s.useCallback)((e=>(0,I.pipe)(Zt.N5.actions.modifyAttribute,a)(Iu({},e,{viewId:l.id}))),[l.id,a]),$=(0,s.useCallback)((e=>(0,I.pipe)(Zt.N5.actions.removeAttribute,a)(Iu({},e,{viewId:l.id}))),[l.id,a]),X=(0,s.useCallback)(((e,t)=>{const r=(0,u.nt9)(i,e),n=(0,I.pipe)(u.wcJ,(0,u._kX)(o))(r),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:o});H(a),B(a)}),[B,H,o,i]),Q=(0,u.e$p)(p),J=(0,s.useCallback)((()=>{const{content:e,contentSecondLevel:r}=l;return r&&t.parentEntityUri?r.entityTypes:e.entityTypes}),[l,t.parentEntityUri]);return c().createElement(c().Fragment,null,c().createElement("div",{className:E.editor},c().createElement(N.Z,{className:E.title},b?C().text("Add new item"):C().text("Edit item")),null===_&&c().createElement(fr,{className:E.item,relation:t.relation,inRelationTypes:v,outRelationTypes:x,onChange:L}),Boolean(h)&&c().createElement(c().Fragment,null,c().createElement(Vr.Z,{errorMessage:Q},c().createElement(y.Z,{className:S()(E.item,{[E.dense]:Q||t.entity&&(0,u.ZiX)(t.entity.entityUri)}),entity:t.entity||{},entityTypesUris:J()||[],max:l.max||20,globalSearchRequestOptions:d,mode:o,onChange:H,onCreate:X,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(f.Z,{className:E.item,attrTypes:w,entity:O,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:o,parentUri:m,onAddAttributes:K,onChangeAttribute:Y,onDeleteAttribute:$}))),c().createElement("div",{className:E.actionButtons},c().createElement(Fo.Z,{onClick:q},C().text("Cancel")),c().createElement(Fo.Z,{color:"primary",disabled:!A,onClick:G},C().text("Apply"))),c().createElement(qc.Z,null))};Su.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:O().object,dispatch:O().func,config:u.PiC,mode:O().string,metadata:u.pGS,globalSearchRequestOptions:O().object,error:u.wfT,parentEntityUri:O().string};const Pu=Su,Nu=(0,At.connect)(((e,t)=>{const r=(n=t,Zt.N5.relations.selectors.getEntityUriFromConnection(n.connection));var n;const a=(0,u.ZiX)(r);return{modifiedEntity:a?Zt.ZP.selectors.getModifiedEntity(e,r):null,allModifiedEntities:a?Zt.ZP.selectors.getModifiedEntities(e):null,globalSearchRequestOptions:Zt.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]),error:(0,u.ATu)(t.connection,Zt.ZP.selectors.getProfileErrors(e))}}))(Pu),Du=(0,D.Z)((e=>({card:{borderBottom:"1px solid rgba(0,0,0,0.06)"},withBackground:{backgroundColor:"rgba(0, 0, 0, 0.03)"},lineWrapper:{position:"relative"},icon:{position:"absolute",top:"8px",left:"16px",width:"32px",height:"32px",zIndex:1},line:e=>{let{color:t}=e;return{borderLeft:`3px solid ${t}`,position:"absolute",left:0,top:0,bottom:0}},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word",lineHeight:"15px"},commentsInfo:{display:"flex",alignItems:"center",marginBottom:"-4px",marginTop:"7px"},commentsIcon:{width:"11px",height:"11px",marginLeft:"2px",marginRight:"6px",marginTop:"-2px"},infoValue:{color:e.palette.text.primary},infoBlock:{display:"flex",flexDirection:"row",marginBottom:"5px"},header:{display:"flex",flexDirection:"row",paddingBottom:"12px"},flex:{flex:1},caption:{fontSize:"16px",color:e.palette.text.primary},title:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:"-4px"},flag:{height:"13px",width:"13px",marginTop:"-2px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},date:{fontSize:"13px",color:e.palette.text.primary},mainInfo:{display:"flex",flexDirection:"column",flex:1},controlsBox:{marginRight:"16px",marginBottom:"12px",marginTop:"13px"},controlsInRow:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},priority:{width:"162px"},comments:{marginLeft:"11px"}}))),Ru=c().createContext(null);Ru.displayName="WorkflowTasksContext";const _u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{errorMessage:t,errorCode:r}=e;r!==u.Xt7.WORKFLOW_IS_NOT_REGISTERED_ERROR&&(console.error(e),Lr.Z.addError({title:C().text("Error"),message:t||C().text("Something went wrong...")}))},Au=()=>{const e=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),t=(0,At.useSelector)(Zt.ZP.selectors.getCanUserStartProcessFromQuery),r=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowJobs),n=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowEnvironmentConfigJar),a=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowDefinition),l=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewWorkflowConfigJar),o=(0,At.useSelector)(Zt.ZP.selectors.getCanUserViewProcessInstanceSearchQuery),i=(0,At.useSelector)(Zt.ZP.selectors.getCanUserUpdateWorkflowDataTask),s=(0,At.useSelector)(Zt.ZP.selectors.getCanUserUpdateProcessInstance),c=(0,At.useSelector)(Zt.ZP.selectors.getCanUserReadWorkflowDataTask),u=(0,At.useSelector)(Zt.ZP.selectors.getCanUserManageWorkflowEnvironmentDefinition),d=(0,At.useSelector)(Zt.ZP.selectors.getCanUserManageWorkflowDefinition),p=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsValidateTasks),m=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsUpdateTasks),h=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsTerminateProcessInstance),g=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobsSyncBusinessProcessData),f=(0,At.useSelector)(Zt.ZP.selectors.getCanUserExecuteWorkflowJobs),b=(0,At.useSelector)(Zt.ZP.selectors.getCanUserCreateWorkflowEnvironmentConfigJar),y=(0,At.useSelector)(Zt.ZP.selectors.getCanUserRegisterConfigEnvironments),E=(0,At.useSelector)(Zt.ZP.selectors.getCanUserCreateWorkflowConfigJar);return v=>{if(!e)return!1;switch(v){case"VIEW_PROCESS_DEFINITIONS":return a;case"DEPLOY_GENERIC_PROCESS_DEFINITION":return u;case"VIEW_JOBS":return r;case"START_JOB":return f||g&&h&&m&&p;case"VIEW_CUSTOM_JARS":return l||n;case"UPDATE_PROCESS_INSTANCE":return s;case"VIEW_TASKS":return c;case"REGISTER_TENANT":return y;case"START_PROCESS_INSTANCE":case"START_PROCESS_INSTANCE_SEARCH_QUERY":return t;case"VIEW_PROCESS_INSTANCE_COMMENTS":case"VIEW_PROCESS_INSTANCES":case"VIEW_PROCESS_INSTANCE_COUNT":return o;case"UPDATE_TASK":return i;case"DEPLOY_TENANT_PROCESS_DEFINITION":return d;case"DEPLOY_CUSTOM_JAR":return E&&b}return!1}},Zu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,I.startsWith)("changeRequests/"))},ju=e=>void 0===e||!0===e,Mu=e=>({label:e,value:e}),Lu=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),d=(0,Mt._)(),[p,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(),[f,b]=(0,s.useState)(!1),y=Au()("UPDATE_TASK")&&ju(n);(0,s.useEffect)((()=>{m(Mu(t))}),[t]);const E=(0,s.useCallback)((e=>{if(l&&y&&r){const t=(0,I.filter)((t=>t.value.toLowerCase().includes(e)));return h?Promise.resolve(t(h)):d((0,u.j2$)({taskId:r,workflowPath:l,environment:o,tenant:i})).then((e=>{const{data:r}=e,n=r.sort(((e,t)=>u.P6Y.strings.sort("asc",e,t))).map(Mu);return g(n),t(n)})).catch(_u)}}),[l,r,o,i,h,g,y]),v=(0,s.useCallback)((e=>{if(l&&y&&r){const{value:t}=e;b(!0),c((0,u._C4)({taskId:r,workflowPath:l,environment:o,tenant:i,assignee:t})).then((()=>{m(Mu(t)),null==a||a(r,{assignee:t})})).catch(_u).finally((()=>{b(!1)}))}}),[l,r,o,i,y]);return{assignee:p,getAssignees:E,updateAssignee:v,updateRequestIsInProgress:f,readOnly:!y}},Vu=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:l,updateAssignee:o,updateRequestIsInProgress:i,readOnly:s}=Lu({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(L.Z,{isDisabled:u,getOptions:l,onChange:o,hideSelectedOptions:!1,label:C().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},Fu=(0,D.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),Bu=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const l=Fu(),{updateDueDate:o,updateRequestIsInProgress:i,readOnly:d}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),[d,p]=(0,s.useState)(!1),m=Au()("UPDATE_TASK")&&ju(n);return{updateDueDate:(0,s.useCallback)((e=>{l&&m&&r&&e&&t!==e&&(p(!0),c((0,u.KF3)({taskId:r,workflowPath:l,environment:o,tenant:i,dueDate:e})).then((()=>{null==a||a(r,{dueDate:e})})).catch(_u).finally((()=>{p(!1)})))}),[l,r,o,i,a,c,t,m]),updateRequestIsInProgress:d,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(Ir.Z,{className:S()(l.dueDate,a),disabled:i||d,value:r,label:C().text("Due date"),onChange:(0,I.pipe)((e=>e&&e.getTime()),o),margin:"dense",InputProps:{className:l.dueDateInput},InputLabelProps:{classes:{root:l.inputLabel}}})},Uu=e=>{let{taskId:t,priority:r,isTaskOpen:n,className:a}=e;const{priorities:l,updatePriority:o,updateRequestIsInProgress:i,readOnly:d}=(e=>{let{priority:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),[d,p]=(0,s.useState)(!1),m=Au()("UPDATE_TASK")&&ju(n),h=(0,s.useCallback)((e=>{const{value:n}=e;l&&m&&r&&t!==n&&(p(!0),c((0,u.ax9)({taskId:r,workflowPath:l,environment:o,tenant:i,priority:n})).then((()=>{null==a||a(r,{priority:n})})).catch(_u).finally((()=>{p(!1)})))}),[l,r,o,i,a,c,t,m]);return{priorities:(0,s.useMemo)((()=>[{label:C().text("Low"),value:u.NVC.low},{label:C().text("Medium"),value:u.NVC.medium},{label:C().text("High"),value:u.NVC.high},{label:C().text("Urgent"),value:u.NVC.urgent}]),[]),updatePriority:h,updateRequestIsInProgress:d,readOnly:!m}})({taskId:t,priority:r,isOpen:n}),p=i||d;return c().createElement(L.Z,{className:a,isDisabled:p,options:l,onChange:o,hideSelectedOptions:!1,label:C().text("Priority"),value:l.find((0,I.propEq)("value",r)),TextFieldProps:{disabled:p},height:40})};var Hu=r(94842),zu=r(43434),Wu=r(98685);const Gu=(0,D.Z)((e=>({comment:{display:"flex",flexDirection:"row",flex:1,marginLeft:"6px"},avatar:{height:"24px",width:"24px",margin:"3px 13px 0 0"},icon:{fill:"#537280",backgroundColor:"#EAEDEE"},firstLine:{display:"flex",flexDirection:"row"},info:{flex:1},author:{flex:1,fontWeight:"500",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px"},date:{color:"rgba(0, 0, 0, 0.54)",fontSize:"11px",marginRight:"17px",lineHeight:"15px"},text:{color:"rgba(0, 0, 0, 0.6)",fontSize:"13px",wordWrap:"break-word",wordBreak:"break-all",paddingRight:"10px"}}))),qu=(0,D.Z)((e=>({circleButton:{maxWidth:"14px",maxHeight:"14px",border:"1px solid rgba(0, 0, 0, 0.3)",fontSize:"13px",color:"rgba(0, 0, 0, 0.6)",position:"absolute",top:"-11px",left:"5px",backgroundColor:"#ffffff","&:hover":{backgroundColor:"#f7f7f7"},"&.focused":{backgroundColor:"#f7f7f7"}},delimiter:{position:"relative",height:"4px",borderTop:"1px solid rgba(0, 0, 0, 0.3)",borderBottom:"1px solid rgba(0, 0, 0, 0.3)",margin:"15px 0 24px 0"}}))),Ku=(0,D.Z)((e=>({container:{padding:"5px 0",display:"flex",flexDirection:"column"},commentsContainer:{maxHeight:"300px",overflowY:"auto"},title:{margin:"0 0 8px 5px",fontSize:"14px",color:"rgba(0, 0, 0, 0.87)"},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"0 6px",height:"40px",margin:"10px 17px 0 6px",fontSize:"14px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}}))),Yu=(0,D.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),$u=e=>{let{author:t,classes:r,message:n,time:a}=e;const l=Gu();return c().createElement("div",{className:l.comment},c().createElement(zu.Z,{className:l.avatar},c().createElement(Wu.Z,{className:l.icon})),c().createElement("div",{className:S()(l.info,r.messageContainer)},c().createElement("div",{className:l.firstLine},c().createElement("div",{className:l.author},t),c().createElement("span",{className:l.date},C().date(a,"L LT"))),c().createElement("div",{className:l.text},n)))};$u.defaultProps={classes:{}},$u.propTypes={classes:O().object,author:O().string,id:O().string,message:O().string,time:O().number};const Xu=e=>{let{comments:t,onClick:r}=e;const n=qu();return c().createElement(c().Fragment,null,c().createElement($u,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Ue.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement($u,t[t.length-1]))};Xu.propTypes={comments:O().arrayOf(O().shape({author:O().string,id:O().string,message:O().string,time:O().number})),onClick:O().func};const Qu=e=>{let{comments:t}=e;const r=Yu();return t.map((e=>{let{author:t,id:n,message:a,time:l}=e;return c().createElement($u,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:l})}))};Qu.propTypes={comments:O().arrayOf(O().shape({author:O().string,id:O().string,message:O().string,time:O().number}))};const Ju=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Ru)||{},l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.getTenant),c=(0,Mt._)(),[d,p]=(0,s.useState)([]),[m,h]=(0,s.useState)(!1),g=Au()("UPDATE_TASK")&&ju(n);(0,s.useEffect)((()=>{p(t||[])}),[t]);const f=(0,s.useCallback)((e=>{g&&(h(!0),c((0,u.tZe)({workflowPath:l,environment:o,tenant:i,taskId:r,comment:e}).then((()=>(0,u.yW4)({workflowPath:l,environment:o,tenant:i,taskId:r})))).then((e=>{let{processInstanceComments:t}=e;p(t||[]),null==a||a(r,{processInstanceComments:t})})).catch(_u).finally((()=>h(!1))))}),[o,r,i,l,c,a,g]);return{comments:d,requestIsInProgress:m,writeComment:f,readOnly:!g}},ed=e=>e.target.value,td=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Ku(),[l,o]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:d,writeComment:p,readOnly:m}=Ju({processInstanceComments:t,taskId:r,isOpen:n}),h=(0,s.useCallback)((()=>{p(i),u("")}),[i,p]),g=(0,I.pipe)(ed,u);return c().createElement("div",{className:a.container},c().createElement("div",{className:a.title}," ",C().text("Comments")," "),c().createElement("div",{className:a.commentsContainer},l||d.length<3?c().createElement(Qu,{comments:d}):c().createElement(Xu,{onClick:()=>o(!0),comments:d})),!m&&c().createElement(Vl.Z,{endAdornment:c().createElement(Fl.Z,{position:"end"},c().createElement(Sl.Z,{icon:Hu.Z,disabled:0===i.length,onClick:h})),classes:{root:a.filledInputRoot},placeholder:C().text("Write a comment"),value:i,onKeyPress:(0,I.when)((0,I.propEq)("key","Enter"),h),onChange:g,disableUnderline:!0}))};td.propTypes={processInstanceComments:O().arrayOf(O().shape({author:O().string,id:O().string,message:O().string,time:O().number})),taskId:O().string};const rd=e=>{let{taskId:t,possibleActions:r,assignee:n,isTaskOpen:a}=e;const{actions:l,actionRequestIsInProgress:o}=(e=>{let{possibleActions:t,assignee:r,taskId:n,isOpen:a}=e;const{loadWorkflowTasks:l}=(0,s.useContext)(Ru)||{},o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),i=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),c=(0,At.useSelector)(Zt.ZP.selectors.getTenant),d=(0,At.useSelector)(Zt.ZP.selectors.getUserName),p=(0,At.useSelector)(Zt.ZP.selectors.getEntityUri),[m,h]=(0,s.useState)(!1),g=(0,s.useContext)(jt.m),f=(0,At.useDispatch)(),b=(0,s.useCallback)((e=>()=>{o&&n&&(h(!0),(0,u.TZ_)({taskId:n,workflowPath:o,environment:i,tenant:c,action:e}).then((()=>{"Delete"===e?f(Zt.ui.actions.entityDeletionFinished()):(f(Zt.N5.entity.actions.loadEntity({viewId:g,uri:p})),null==l||l())})).catch(_u).finally((()=>{h(!1)})))}),[o,n,i,c,f,p,g,l]);return{actions:(0,s.useMemo)((()=>d===r&&ju(a)?(t||[]).map((e=>{let{action:t,label:r}=e;return{text:r,onClick:b(t)}})):[]),[t,b,d,r,a]),actionRequestIsInProgress:m}})({taskId:t,possibleActions:r,assignee:n,isOpen:a});return l.length>0?c().createElement(Er.Z,{buttonComponent:Sl.Z,buttonProps:{icon:po.Z,size:"L",disabled:o},menuId:"workflow-actions",menuItems:l}):null},nd=(0,D.Z)({decorator:{display:"flex",alignItems:"stretch"},lineBlock:{width:"56px",flexShrink:0},withLinePadding:{"& $noLine":{height:"10px"},"& $line":{height:"calc(100% - 10px)"}},noLine:{height:"0"},line:{height:"100%",position:"relative",marginLeft:"31px",borderLeft:"2px solid rgba(0,0,0,0.06)","&:before":{position:"absolute",height:6,width:6,borderRadius:"50%",left:-5,top:"15px",background:"#d8d8d8",content:'""',display:"block",border:"1px solid white"},"&$plain":{"&:before":{width:0,border:"none"}},"&$last":{height:"15px"}},content:{flex:1,minWidth:0},plain:{},last:{},rowDivider:{marginLeft:0}}),ad=e=>{let{className:t,children:r,plain:n,first:a,last:l,transparent:o,divider:i}=e;const s=nd();return c().createElement("div",{className:S()(t,s.decorator)},c().createElement("div",{className:S()(s.lineBlock,{[s.withLinePadding]:a})},!o&&c().createElement(c().Fragment,null,c().createElement("div",{className:s.noLine}),c().createElement("div",{className:S()(s.line,{[s.plain]:n},{[s.last]:l})}))),c().createElement("div",{className:s.content},r,i&&c().createElement(qc.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let ld={};const od=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let id=0;function sd(){return sd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sd.apply(this,arguments)}const cd=e=>c().createElement("svg",sd({width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"CollaborationIcon_svg__a"})),c().createElement("g",{transform:"translate(-2 -2)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"CollaborationIcon_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#CollaborationIcon_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#CollaborationIcon_svg__b)",d:"M0 0h24v24H0z"}))),ud=e=>{let{task:t,children:r,actions:n,Icon:a}=e;const{taskId:l,dueDate:o,priority:i,assignee:u,createdBy:d,createTime:p,displayName:m,processDefinitionDisplayName:h,objectURIs:g,processInstanceComments:f,possibleActions:b,isOpen:y}=t,E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,I.pipe)(Zu,(0,I.unless)(I.isNil,(0,I.pipe)((0,I.split)("/"),(0,I.nth)(1))))(e)}(g),v=(e=>{let{processDefinitionDisplayName:t}=e;const r=t;return ld[r]||(ld[r]=od[id],id++,id>od.length-1&&(id=0)),ld[r]})({processDefinitionDisplayName:h}),x=Du({color:v}),[w,O]=(0,s.useState)(!1),T=Au()("VIEW_PROCESS_INSTANCE_COMMENTS");return c().createElement("div",{className:x.card},c().createElement("div",{className:S()({[x.withBackground]:w})},c().createElement("div",{className:x.lineWrapper},c().createElement("div",{className:x.line}),a&&c().createElement(a,{className:x.icon}),c().createElement(ad,{plain:!0,first:!0,transparent:!w},c().createElement("div",{className:x.mainInfo},c().createElement("div",{className:x.title},c().createElement("div",{className:S()(x.caption,x.flex)},h),c().createElement(Bn.Z,{className:x.flag}),c().createElement(ze.ZP,{title:C().text("Due date")},c().createElement("span",{className:x.date},C().date(o,"L"))),c().createElement(or.Z,{isOpen:w,size:"L",onClick:()=>{O(!w)}})),c().createElement("div",{className:x.infoBlock},c().createElement("div",{className:x.flex},E&&c().createElement("div",{className:x.info},C().text("DCR ID"),": ",c().createElement("span",{className:x.infoValue},E)),c().createElement("div",{className:x.info},C().text("Created by"),": ",c().createElement("span",{className:x.infoValue},d)," ",C().text("on")," ",c().createElement("span",{className:x.infoValue},C().date(p,"L"))),c().createElement("div",{className:x.info},C().text("Step"),": ",c().createElement("span",{className:x.infoValue},m)),T&&(null==f?void 0:f.length)>0&&c().createElement("div",{className:x.commentsInfo},c().createElement(cd,{className:x.commentsIcon}),c().createElement("div",{className:x.infoValue},f.length))),n||c().createElement(rd,{taskId:l,possibleActions:b,assignee:u,isTaskOpen:y}))))),w&&c().createElement(ad,{plain:!0},c().createElement("div",{className:x.controlsBox},c().createElement("div",{className:x.controlsInRow},c().createElement(Bu,{taskId:l,dueDate:o,isTaskOpen:y}),c().createElement(Uu,{taskId:l,priority:i,className:x.priority,isTaskOpen:y})),c().createElement(Vu,{taskId:l,assignee:u,isTaskOpen:y})))),w&&c().createElement(c().Fragment,null,r,T&&c().createElement("div",{className:x.comments},c().createElement(td,{taskId:l,processInstanceComments:f,isTaskOpen:y}))))};function dd(){return dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dd.apply(this,arguments)}const pd=e=>c().createElement("svg",dd({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#42A5F5",cx:14,cy:14,r:14}),c().createElement("path",{d:"M16.43 9.87c0 1.59 1.25 2.87 2.79 2.87 1.53 0 2.78-1.28 2.78-2.87C22 8.29 20.75 7 19.22 7c-1.54 0-2.79 1.29-2.79 2.87zm1.4 0c0-.79.62-1.43 1.39-1.43.77 0 1.39.64 1.39 1.43 0 .79-.62 1.44-1.39 1.44-.77 0-1.39-.65-1.39-1.44zm-6.26 8.26c0-1.59-1.25-2.87-2.79-2.87-1.53 0-2.78 1.28-2.78 2.87C6 19.71 7.25 21 8.78 21c1.54 0 2.79-1.29 2.79-2.87zM8.09 9.15v4.31h1.39v-2.87h2.78v2.15l2.78-2.87L12.26 7v2.15H8.09zm11.82 9.7v-4.31h-1.39v2.87h-2.78v-2.15l-2.78 2.87L15.74 21v-2.15h4.17z",fill:"#FFF",opacity:.87})));let md,hd;!function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(md||(md={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(hd||(hd={}));var gd=r(26978);const fd=(e,t)=>{switch(e){case hd.CREATE_RELATIONSHIP:case hd.INSERT_ATTRIBUTE:return md.ADDED;case hd.UPDATE_TAGS:case hd.UPDATE_ROLES:case hd.UPDATE_ATTRIBUTE:return md.EDITED;case hd.DELETE_ATTRIBUTE:case hd.DELETE_RELATIONSHIP:return md.DELETED;case hd.PIN_ATTRIBUTE:return null!=t&&t.pin?md.PIN_DELETED:md.PINNED;case hd.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?md.IGNORE_DELETED:md.IGNORED}},bd=e=>({[md.ADDED]:C().text("added"),[md.EDITED]:C().text("edited"),[md.DELETED]:C().text("deleted"),[md.PINNED]:C().text("pinned"),[md.PIN_DELETED]:C().text("pin deleted"),[md.IGNORED]:C().text("ignored"),[md.IGNORE_DELETED]:C().text("ignore deleted")}[e]||""),yd=(e,t)=>(0,I.when)((0,I.allPass)([(0,I.pipe)((0,I.prop)("type"),(0,I.equals)(u.oS0.TYPE_STRING)),()=>(0,u.CBv)(t)]),(0,I.evolve)({type:(0,I.always)(u.oS0.TYPE_URL)}))((0,u.PFL)(e));function Ed(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vd(e,t,r[t])}))}return e}function vd(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,t)=>{if("newValue"in e||"oldValue"in e){const{newValue:r,oldValue:n,type:a}=e,l=(0,I.pathOr)([],["value",t.name])(r),o=(0,I.pathOr)([],["value",t.name])(n),i=Math.max(l.length,o.length);return(0,I.times)((e=>[{value:{newValue:l[e],oldValue:o[e],type:a}}]),i)}const r=e[t.name];return r?[r]:[]},wd=(0,I.curry)(((e,t,r)=>{const n=(0,gd.U)(e,t.type,[],[]);return Td(e,n,r)})),Od=(0,I.curry)(((e,t,r,n)=>{const a=(0,u.V3K)(e,t.type),l=(0,u.xF8)(e,t.type);return(0,I.flatten)([Ed({level:1,label:(0,I.propOr)("","label",a),attributeType:a,attributeValue:Ed({},t,r)},((e,t)=>{if(t===hd.CREATE_RELATIONSHIP||(0,u.O27)(e)){const e=fd(t);return e?{operation:e}:{}}return{}})(r,n)),Td(e,l,r,2)])})),Td=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,I.flatten)(t.map((t=>xd(r,t).map((r=>r.map((r=>Cd(e,t,r,n))))))).filter((0,I.complement)(I.isEmpty)))},Cd=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return Id(e,t,r,n);case u.oS0.TYPE_REFERENCE:return kd(e,t,r,n);default:{const e=((e,t)=>{const r=(0,u.kqr)(e)?t:t.value;return(0,I.is)(Object,r)?r:{newValue:t,type:hd.INSERT_ATTRIBUTE}})(t,r);return Sd(t,e,n)}}},Id=(e,t,r,n)=>{const a=(0,u.EUG)({},t);return[{level:n,label:(0,u.idV)((null==t?void 0:t.label)||(null==t?void 0:t.name)),attributeType:t,attributeValue:r},Td(e,a,r.value,n+1)]},kd=(e,t,r,n)=>{const a=(0,u.EUG)(e,t);return[{level:n,label:(null==t?void 0:t.label)||(null==t?void 0:t.name),attributeType:t,attributeValue:r},Td(e,a,r.value,n+1)]},Sd=(e,t,r)=>{const{newValue:n,oldValue:a,type:l}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===hd.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t);return{attributeType:e,newValue:n,oldValue:a,operation:fd(l,a),label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function Pd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Nd(e,t,r[t])}))}return e}function Nd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dd=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],Rd=e=>{let{newValue:t,oldValue:r}=e;const n=e=>isNaN(e)||(0,u.O27)(e)?e:parseInt(e),a=e=>(null==e?void 0:e.length)&&!(0,u.O27)(e)&&!(0,u.O27)(e[0]),l=a(t),o=a(r);return l&&o?[{type:hd.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:l?[{type:hd.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:o?[{type:hd.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},_d=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,l=a===hd.UPDATE_ROLES?(0,u.xqc)(e):I.identity,o=(0,I.difference)(r,n),i=(0,I.difference)(n,r),s=[];return o.length&&s.push({type:hd.INSERT_ATTRIBUTE,newValue:{value:o.map(l).join(", ")}}),i.length&&s.push({type:hd.DELETE_ATTRIBUTE,oldValue:{value:i.map(l).join(", ")}}),s},Ad=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,l=t===hd.INSERT_ATTRIBUTE?(0,u.Zmi)(r):r;if(n){const e=a.split("/attributes/"),t=n.split("/")[1];return[e[1],t,l].join("/")}return l})(t),n=r.split("/");let a=e;for(let e=0;e<n.length-1;e+=2){var l;const r=n[e],o=n[e+1],i=(a[r]||[]).find((0,I.propEq)("id",o)),s=n.length===e+2?t:{},c=i||{id:o,value:s},u=(null===(l=t.refObjectURI)||void 0===l?void 0:l.indexOf(o))>=0&&t.refObjectURI;u&&(c.refObjectURI=u),(0,I.isNil)(i)&&(a[r]=(a[r]||[]).concat(c)),a=c.value}return e},Zd=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:l,tags:o,defaultProfilePicValue:i}=t,s=Pd({},r);return i&&(s.defaultProfilePicValue=[i]),l&&(s[u.xPW.roles.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:l.map((0,u.xqc)(e)).join(", ")}}]),o&&(s[u.xPW.tags.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:o.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:hd.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},jd=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case hd.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case hd.UPDATE_TAGS:n[u.xPW.tags.name]=_d(e,r);break;case hd.UPDATE_ROLES:n[u.xPW.roles.name]=_d(e,r);break;case hd.UPDATE_START_DATE:n[u.xPW.startDate.name]=Rd(r);break;case hd.UPDATE_END_DATE:n[u.xPW.endDate.name]=Rd(r);break;case hd.CREATE_RELATIONSHIP:case hd.CREATE_ENTITY:return Pd({},n,Zd(e,r.newValue));case hd.INSERT_ATTRIBUTE:case hd.UPDATE_ATTRIBUTE:case hd.DELETE_ATTRIBUTE:case hd.PIN_ATTRIBUTE:case hd.IGNORE_ATTRIBUTE:Ad(n,r)}return n},Md=(0,D.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Ld=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const l=Md();return c().createElement(kt.Z,{component:"button",variant:"caption",underline:"none",onClick:n,className:a},c().createElement("span",{className:l.linkLabel},r?C().text("View less suggestions"):C().text("View ${suggestionsCount} more suggestions",{suggestionsCount:t})))};var Vd=r(43525),Fd=r(7089);const Bd=(0,D.Z)((e=>({field:{fontSize:"12px",lineHeight:"20px",color:e.palette.text.primary,marginTop:"6px",overflow:"hidden",wordBreak:"break-word"},fieldName:{color:e.palette.text.secondary,marginRight:"8px"},difference:{marginRight:"8px"},arrow:{margin:"0 4px",fontSize:"12px",color:e.palette.text.primary},chip:{height:"20px",fontSize:"10px",fontWeight:500,lineHeight:"16px",letterSpacing:0,flexShrink:0,textTransform:"capitalize",color:e.palette.primary.main,borderColor:e.palette.primary.main,"&.edited":{color:"#CC7500",borderColor:"#CC7500"},"&.added":{color:"#599E0E",borderColor:"#599E0E"},"&.deleted":{color:"#CF0E26",borderColor:"#CF0E26"}}}))),Ud=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:l}=e;const o=Bd(),i=r||n;return c().createElement("div",{className:S()(o.field,l)},c().createElement("span",{className:o.fieldName},t,":"),!(0,I.isNil)(i)&&c().createElement("span",{className:o.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(Vd.Z,{className:o.arrow}),n)),a&&c().createElement(Fd.Z,{variant:"outlined",label:bd(a),className:S()(o.chip,a)}))},Hd=c().createContext(null);Hd.displayName="AttributesChangesContext";const zd=(0,D.Z)((e=>({linkContainer:{textDecoration:"none",cursor:"pointer",marginLeft:"4px"},linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},disabledLink:{pointerEvents:"none",cursor:"default"},label:{color:e.palette.text.primary},change:e=>{let{level:t=0}=e;return{marginLeft:16*t+"px"}}}))),Wd=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:l,newValue:o,operation:i}=e;const d=zd({level:r}),p=(0,At.useSelector)(Zt.ZP.selectors.getEntityUri),m=(0,s.useContext)(Hd),h=(0,s.useCallback)((()=>{if((0,u.YkG)(n)){const e=(0,I.when)((0,I.anyPass)([(0,I.hasPath)(["value","newValue"]),(0,I.hasPath)(["value","oldValue"])]),(0,I.ifElse)((0,I.hasPath)(["value","newValue"]),(0,I.path)(["value","newValue"]),(0,I.path)(["value","oldValue"])))(a);return function(e,t,r){let n,a,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=l[t.refObjectURI];return o?(a=r===o.startObjectUri?o.endObjectUri:o.startObjectUri,n=r===o.startObjectUri?o.endObjectLabel:o.startObjectLabel):t.refEntity&&(a=t.refEntity.objectURI,n=l[a].label),{objectUri:a,objectLabel:n}}(n,e,p,m)}if("endObject"in n){const{endObjectUri:e,endObjectLabel:t}=a;return{objectUri:e,objectLabel:t}}}),[n,a,p,m]),g=(0,s.useCallback)((()=>{const{objectUri:e,objectLabel:t}=h()||{};if(!(0,I.isNil)(e)&&!(0,I.isNil)(t)){var r;const n=!1===(null===(r=m[e])||void 0===r?void 0:r.isExist);return c().createElement(jr.Z,{value:e,className:S()(d.linkContainer,{[d.disabledLink]:n})},c().createElement("span",{className:S()(d.linkLabel,{[d.label]:n})},(0,u.idV)(t)))}return null}),[h,m,d]),f=(0,s.useMemo)((()=>c().createElement("span",null,t,g())),[t,g]),b=(0,s.useCallback)((e=>{const t=(0,u.kDl)(e);return c().createElement(br.Z,{value:t,dataTypeDefinition:yd(n,t)})}),[n]);return c().createElement(Ud,{className:d.change,label:f,oldValue:l&&b(l),newValue:o&&b(o),operation:i})},Gd=(0,D.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function qd(){return qd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qd.apply(this,arguments)}const Kd=e=>{let{changes:t}=e;const r=Gd();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,I.has)("level",e)?c().createElement(Wd,qd({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Yd=(0,I.pipe)((0,I.filter)((0,I.has)("operation")),I.length),$d=(0,D.Z)((e=>({container:{boxSizing:"border-box",border:"1px solid rgba(0,0,0,0.03)",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.03)",padding:"10px",margin:"12px 16px 12px 0"},uri:{color:e.palette.primary.main,textDecoration:"none",cursor:"pointer"},label:{fontSize:"12px",letterSpacing:0,lineHeight:"16px"},showMoreLink:{marginTop:"8px"}}))),Xd=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:l}=e;const o=$d(),i=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),[d,p]=(0,s.useMemo)((()=>((e,t,r,n)=>{const a=t=>(0,I.pipe)((0,I.pick)([t]),wd(e,r)),l=(0,I.curry)(((e,t)=>(0,I.reduce)(((e,r)=>(0,I.concat)(e,r(t))),[],e))),o=(0,I.propOr)([],r.uri)(t).reduce(((t,n)=>jd(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,I.propOr)([],r.uri)(t).reduce(((t,n)=>jd(e,r,n,t)),{}))(e,t,r)));return[l([(0,I.pipe)((0,I.omit)(Dd),wd(e,r)),a(u.xPW.roles.name),a(u.xPW.tags.name),a(u.xPW.startDate.name),a(u.xPW.endDate.name)],o),(0,I.flatten)(n.map(((r,n)=>{const a=(0,I.path)([r.uri,0,"type"],t);return Od(e,r,i[n],a)})))]})(i,t,n,a)),[i,t,n,a]),m=(0,s.useMemo)((()=>{const e={label:C().text("Relationships")};return p.length>0?(0,I.flatten)([d,e,p]):d}),[d,p]),{isExpanded:h,onToggle:g,itemsToShow:f,collapsedSuggestionsCount:b}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const[r,n]=(0,s.useState)(!1),a=(0,s.useCallback)((()=>n((e=>!e))),[]),l=(0,s.useMemo)((()=>e.slice(0,t)),[e,t]),o=(0,s.useMemo)((()=>Yd(e)),[e]),i=(0,s.useMemo)((()=>Yd(l)),[l]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:l,collapsedSuggestionsCount:o-i}}(m,l);return c().createElement(Hd.Provider,{value:r},c().createElement("div",{className:o.container},c().createElement(jr.Z,{className:o.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:o.label},(0,u.idV)(n.label))),c().createElement(Kd,{changes:f}),b>0&&c().createElement(Ld,{onClick:g,suggestionsCount:b,isExpanded:h,className:o.showMoreLink})))};function Qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jd(e,t,r[t])}))}return e}function Jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ep=(0,I.filter)((0,I.pipe)((0,I.prop)("uri"),u.WgC)),tp=(0,I.filter)((0,I.pipe)((0,I.prop)("uri"),u.bC9)),rp=(e,t)=>(0,I.filter)((0,I.allPass)([(0,I.pipe)((0,I.prop)("uri"),u.bC9),(0,I.pipe)((0,I.prop)("startObjectUri"),(0,I.equals)(t))]))(e),np=(0,I.curry)(((e,t)=>({entity:t,relations:rp(e,t.uri)}))),ap=(0,I.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:Qd({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),lp=(e,t)=>{const{entity:r,relations:n}=t,{uri:a}=r,l=(0,I.pipe)((0,I.pathOr)([],[a,"relations"]),(0,I.concat)(n),I.uniq)(e);return e[a]={entity:r,relations:l},e};function op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ip=e=>{let{task:t}=e;const{objectURIs:r}=t,n=Zu(r),{dcr:a,groupedObjects:l}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),l=(0,Mt._)(),o=(0,s.useCallback)((e=>(0,I.isEmpty)(e)?Promise.resolve([]):l((0,u.DnY)(e,{searchOptions:"ovOnly",defaultMaxValues:1}))),[]);return(0,s.useEffect)((()=>{(0,u.E6I)(e).then((e=>{const{changes:t,objectsInfo:n}=e,l=((e,t)=>(0,I.pipe)(I.keys,(0,I.filter)((t=>(0,I.prop)([t],e))),(0,I.map)((e=>Qd({},t[e],{uri:e}))))(t))(t,n),i=(0,I.pipe)(ep,(0,I.map)(np(l)))(l),s=(0,I.pipe)(tp,(0,I.map)(ap(n)))(l),[c,u]=(0,I.partition)((0,I.has)("entity"),s),d=u.map((0,I.path)(["relations",0,"startObjectUri"]));o(d).then((e=>{const t=u.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){op(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,I.pipe)(I.flatten,(0,I.reduce)(lp,{}),I.values,r)([i,c,t])})).catch(_u),a(e)})).catch(_u)}),[e,o]),{dcr:n,groupedObjects:t}})(n);return c().createElement(ud,{task:t,Icon:pd},a&&l.map(((e,t)=>c().createElement(ad,{key:t,last:t===l.length-1,divider:!0},c().createElement(Xd,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},sp=(0,D.Z)({pmCard:{marginLeft:"-15px"}});function cp(){return cp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cp.apply(this,arguments)}const up=e=>c().createElement("svg",cp({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#1976D2",cx:14,cy:14,r:14}),c().createElement("path",{d:"M22.5 14L18 9.5V13h-3.5L9 7.5 7.5 9l6.04 6H18v3.5l4.5-4.5zm-11.46 1.46L7.5 19 9 20.5l3.54-3.54-1.5-1.5z",fill:"#FFF",opacity:.87})));const dp=e=>(0,s.useCallback)((e=>{let t={},r=[];return async n=>{let{max:a,offset:l,force:o}=n,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(n,["max","offset","force"]),s=o;const c=Object.keys(t);if(s=s||!(0,I.equals)(Object.keys(i),c),!s)for(const e of c)s=s||!(0,I.equals)(t[e],i[e]);return s&&(r=await e(i),t=i),{response:r.slice(l,l+a),total:r.length,originalResponse:r}}})(e),[e]),pp=e=>{let{enabled:t,entity:r,filter:n,onFinishLoading:a,onStartLoading:l,options:o,page:i,rowsPerPage:c,sorting:d}=e;const{order:p,field:m}=d||{},[h,g]=(0,s.useState)(0),[f,b]=(0,s.useState)([]),[y,E]=(0,s.useState)({}),v=(0,At.useSelector)(Zt.ZP.selectors.getTenant),x=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),w=(0,At.useSelector)(Zt.ZP.selectors.getDataTenants),O=(0,s.useMemo)((()=>({dtssPath:x,dataTenants:w,entity:r,customerTenant:v,dtssRequest:u.Rgl})),[x,w,r,v]),T=(0,s.useCallback)((0,u.U_T)(O,u.SP6),[O]),C=dp(T),k=dp(u.bFH),S=(0,I.prop)("uri",r),P=(0,Mt._)(),N=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t||(0,u.ZiX)(S))return g(0),b([]),void E({});null==l||l(),P((0,u.biM)(r)?k({dtssPath:x,entity:r,customerTenant:v,offset:i*c,max:c,force:e}):C({entityUri:S,offset:i*c,max:c,filter:n,sort:m,order:p,force:e,deep:o.showTransitiveMatches?void 0:1,activeness:o.showInactiveEntities?u.YJ7.ALL:u.YJ7.ACTIVE_ONLY})).then((e=>{const{response:t,total:r,originalResponse:n}=e;g(r),b(t),(0,u.B1H)(n).length>0&&E((0,u.KPC)(n))})).finally((()=>{null==a||a()}))}),[x,t,S,m,n,k,C,a,l,o,p,i,c,P,v]);return(0,s.useEffect)((()=>{N()}),[N]),{total:h,matches:f,entitiesMap:y,loadMatches:(0,s.useCallback)((()=>{N(!0)}),[N])}},mp=(0,D.Z)({root:{display:"flex",flexDirection:"column",paddingRight:"12px",paddingTop:"8px",paddingBottom:"8px","& + &":{borderTop:"1px solid rgba(0,0,0, 0.12)"}},profileCardWrapper:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},profileCardContainer:{flexGrow:1},rulesContainer:{paddingLeft:"40px"}}),hp=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:l,className:o}=e;const i=mp();return c().createElement("div",{className:S()(i.root,o)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Kn.Z,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(Nn,{match:a,metadata:l,entitiesMap:r,entity:n})))},gp={showTransitiveMatches:!0,showInactiveEntities:!1},fp=e=>{let{task:t}=e;const r=sp(),{objectURIs:n}=t,a=(0,At.useSelector)(Zt.ZP.selectors.getEntity),l=(0,At.useSelector)(Zt.ZP.selectors.getMetadata),{matches:o,entitiesMap:i}=pp({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:gp}),s=null==o?void 0:o.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(ud,{task:t,Icon:up},s&&c().createElement(ad,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(hp,{metadata:l,entity:a,match:s,entitiesMap:i}))))};function bp(){return bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bp.apply(this,arguments)}const yp=e=>c().createElement("svg",bp({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#205191",cx:14,cy:14,r:14}),c().createElement("path",{d:"M9.667 20.622c-.92 0-1.667-.744-1.667-1.662V8.99c0-.916.747-1.66 1.667-1.66h2.446A1.993 1.993 0 0114 6l.162.006a1.992 1.992 0 011.725 1.323h2.446c.92 0 1.667.745 1.667 1.662v9.97c0 .917-.747 1.661-1.667 1.661zm9-1.33V8.66h-1.334v1.993h-6.666V8.66H9.333v10.634h9.334zM15.86 14.46v1.302h-5.206V14.46h5.206zm1.494-2v1.302h-6.7V12.46h6.7zM14 7.33c.367 0 .667.298.667.664a.668.668 0 01-1.334 0c0-.366.3-.665.667-.665z",fill:"#FFF",opacity:.87})));function Ep(){return Ep=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ep.apply(this,arguments)}const vp=e=>c().createElement("svg",Ep({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",opacity:.87},c().createElement("circle",{fill:"#0D47A1",cx:14,cy:14,r:14}),c().createElement("path",{d:"M8.17 9.824v8.995c0 .886.72 1.606 1.607 1.606h8.352c.192 0 .375-.035.546-.097l1.38 1.382.804-.804-1.32-1.32-1.09-1.089-8.993-8.994-1.092-1.092-1.317-1.317-.803.803L8.17 9.824zm9.316 9.316h-8.03v-8.03l8.03 8.03zM9.777 7.575c-.192 0-.376.033-.55.094L10.42 8.86h.32v.322l1.607 1.606h4.819V8.86h1.284v8.03l1.285 1.286V9.182c0-.887-.72-1.607-1.606-1.607h-2.358a1.931 1.931 0 00-1.818-1.285 1.93 1.93 0 00-1.818 1.285H9.777zm3.533.643c0-.353.29-.643.643-.643.353 0 .642.29.642.643a.644.644 0 01-.642.642.644.644 0 01-.643-.642z",fill:"#FFF"})));class xp{}xp.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement(ip,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(fp,{task:t});case u.Yj_.recommendForDelete:return c().createElement(ud,{task:t,Icon:vp});default:return c().createElement(ud,{task:t,Icon:yp})}};const wp=xp,Op=e=>{let{task:t}=e;return wp.build({task:t})};var Tp=r(65549),Cp=r(86619),Ip=r(8560),kp=r(37265);const Sp=(0,D.Z)((e=>({popoverPaper:{width:"464px"},title:{fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",color:e.palette.text.primary,marginBottom:"17px"},content:{display:"flex",flexDirection:"column",padding:"23px 24px 14px 24px"},simpleDropDownSelector:{marginBottom:"20px"},inputRoot:{paddingTop:"0 !important",paddingBottom:"0 !important"},select:{fontSize:"14px"},footer:{display:"flex",justifyContent:"flex-end",padding:"5px 8px 8px",borderTop:"1px solid rgba(0,0,0,0.12)"},cancelButton:{marginRight:"8px"},input:{fontSize:"14px"}}))),Pp=e=>{let{anchorEl:t,onClose:r}=e;const n=Sp(),[a,l]=(0,s.useState)(""),[o,i]=(0,s.useState)(null),[d,p]=(0,s.useState)(!1),{definitions:m}=(()=>{const[e,t]=(0,s.useState)([]),r=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),n=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,At.useSelector)(Zt.ZP.selectors.getTenant),l=(0,At.useSelector)(Zt.ZP.selectors.getEntity).type;return(0,s.useEffect)((()=>{(0,u.IU6)({workflowPath:r,environment:n,tenant:a}).then((e=>{let{data:r}=e;return t(((e,t)=>e.filter((e=>{let{manualStart:r,objectTypes:n}=e;return r&&(!n||(null==n?void 0:n.some((e=>e===t))))})))(r,l))}))}),[l,r,n,a]),{definitions:e}})(),{processInstance:h,loading:g}=(()=>{const{loadWorkflowTasks:e}=(0,s.useContext)(Ru),t=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),r=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),n=(0,At.useSelector)(Zt.ZP.selectors.getTenant),a=(0,At.useSelector)(Zt.ZP.selectors.getEntity).uri,[l,o]=(0,s.useState)(!1);return{processInstance:(0,s.useCallback)(((l,i)=>(o(!0),(0,u.$ju)({workflowPath:t,tenant:n,environment:r,processType:i,comment:l,objectURIs:[a]}).then((()=>{e()})).catch((e=>{throw _u(e),e})).finally((()=>{o(!1)})))),[a,r,e,n,t]),loading:l}})(),f=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(mo.ZP,{open:f,anchorEl:t,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},classes:{paper:n.popoverPaper}},c().createElement("div",{className:n.content},c().createElement(N.Z,{className:n.title},C().text("Add new workflow")),c().createElement(kl.Z,{className:n.simpleDropDownSelector,variant:"filled",height:40,TextFieldProps:{InputProps:{disableUnderline:!0}},placeholder:C().text("Select task type"),value:o,onChange:e=>{i(e)},label:"",options:m.map((e=>({value:e.type,label:e.displayName})))}),c().createElement(Cp.Z,{variant:"filled",hiddenLabel:!0,size:"small",placeholder:"Type a comment",InputProps:{disableUnderline:!0,classes:{input:n.input,root:n.inputRoot}},value:a,onChange:e=>{l(e.target.value)},multiline:!0})),c().createElement("div",{className:n.footer},c().createElement(Fo.Z,{disabled:g,className:n.cancelButton,onClick:r},C().text("Cancel")),c().createElement(Fo.Z,{disabled:g,color:"primary",onClick:()=>{h(a,null==o?void 0:o.value).then((()=>{p(!0),l(""),i(null),r()})).catch((()=>{}))}},C().text("Start")))),c().createElement(Ip.Z,{container:document.body},c().createElement(kp.Z,{open:d,autoHideDuration:5e3,onClose:()=>{p(!1)},message:C().text("A new workflow has started")})))},Np=(0,D.Z)({button:{padding:"9px 16px 9px 12px",marginLeft:"auto",marginRight:"8px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),Dp=()=>{const e=Np(),[t,r]=(0,s.useState)(null),n=Au(),a=n("START_PROCESS_INSTANCE"),l=n("VIEW_PROCESS_DEFINITIONS");return a&&l?c().createElement(c().Fragment,null,c().createElement(Fo.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement(Tp.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},C().text("Add"))),c().createElement(Pp,{anchorEl:t,onClose:()=>r(null)})):null};function Rp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _p=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,Mt._)(),l=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowPath),o=(0,At.useSelector)(Zt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,At.useSelector)(Zt.ZP.selectors.isWorkflowEnabled),c=(0,At.useSelector)(Zt.ZP.selectors.getTenant),d=(0,At.useSelector)(Zt.ZP.selectors.getEntityUri),p=(0,At.useSelector)(Zt.ZP.selectors.getIsEditableMode),m=Au()("VIEW_TASKS"),h=!(!l||!o)&&i&&m,[g,f]=(0,s.useState)(null),[b,y]=(0,s.useState)(0),[E,v]=(0,s.useState)(!1),x=(0,s.useCallback)((()=>{v(!0);const e=!Array.isArray(t)||t.includes("*")?null:t,i=(e||[null]).map((e=>(0,u.uT0)({entityUri:d,workflowPath:l,environment:o,tenant:c,filter:{assignee:r,processType:e},includeClosed:!!n})));a(Promise.all(i)).then((t=>{const n=(0,I.pipe)((0,I.map)((0,I.prop)("data")),(0,I.reject)(I.isNil),I.flatten,(0,I.uniqBy)((0,I.prop)("taskId")),(0,I.filter)(Ap(e,r)))(t);f(n),y(n.length)})).catch((e=>{console.warn("Workflow error",e)})).finally((()=>{v(!1)}))}),[d,o,a,c,l,r,n,t]);(0,s.useEffect)((()=>{d&&h&&!(0,u.ZiX)(d)?x():(f(null),y(0))}),[h,d,x,p]);const w=(0,s.useCallback)(((e,t)=>{f((r=>r.map((r=>r.taskId===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){Rp(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:g,total:b,loading:E,updateTaskState:w,loadWorkflowTasks:x}},Ap=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function Zp(){return Zp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zp.apply(this,arguments)}const jp=e=>c().createElement("svg",Zp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M17.045 20.455l1.41-1.41-3.41-3.41-1.41 1.41 3.41 3.41zm-9.5-12.41h3.5v5.59l-5.41 5.41 1.41 1.41 6-6v-6.41h3.5l-4.5-4.5-4.5 4.5z",id:"MergeDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"MergeDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#MergeDark_svg__a",transform:"rotate(90 12.045 12)"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#MergeDark_svg__b)",d:"M0 0h24v24H0z"}))),Mp=(0,D.Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));function Lp(){return Lp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lp.apply(this,arguments)}let Vp;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(Vp||(Vp={}));const Fp=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Vp.iconButton,label:a,disabled:l,icon:o,onClick:i=tt.ZT,onMenuClose:s=tt.ZT}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const d=Mp();return(()=>{switch(n){case"iconButton":return c().createElement(De.k,Lp({disabled:l,className:S()(d.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:o},u));case"button":return c().createElement(Fo.Z,Lp({className:S()(d.button,r),disabled:l,startIcon:c().createElement(o,null),onClick:i,color:"primary",classes:{startIcon:d.startIcon,label:d.label}},u),c().createElement(A.C,{value:a},c().createElement("div",{className:d.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(P.Z,Lp({classes:{root:d.menuItem},onClick:e,disabled:l,ref:t},u),c().createElement(c().Fragment,null,c().createElement(o,{className:d.menuIcon}),c().createElement(N.Z,{classes:{root:d.menuText}},a)))}}})()}));Fp.displayName="ActionButton";const Bp=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:l=tt.ZT}=e;const o=(0,At.useSelector)(Zt.ZP.selectors.getTenant),i=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),[c,d]=(0,s.useState)(!1);return{isPending:c,sendMergeAllRequest:(0,s.useCallback)((()=>{null==a||a(),d(!0);const e={dtssPath:i,customerTenant:o,entity:r,entities:t};((0,u.biM)(r)?(0,u.uJQ)(e):(0,u.OxG)(e)).catch(l).finally((()=>{null==n||n(),d(!1)}))}),[i,t,r,n,a,o])}};function Up(){return Up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Up.apply(this,arguments)}const Hp=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Vp.iconButton,onMenuClose:a=tt.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:d}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest","onError"]);const{sendMergeAllRequest:m}=Bp({entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:d});return c().createElement(Fp,Up({className:r,disabled:l,mode:n,label:C().text("Merge"),icon:jp,onClick:m,onMenuClose:a,ref:t},p))}));function zp(){return zp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zp.apply(this,arguments)}Hp.displayName="mergeButton";const Wp=e=>c().createElement("svg",zp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M17 13.138l4.5 4.5-4.5 4.5V18.5h-1.247l-3.488-3.479 1.413-1.414 2.901 2.893H17v-3.362zM17 1.5L21.5 6 17 10.5V7.138h-.421l-11.03 11H2v-2h2.723l11.03-11H17V1.5zm-11.45 4l3.294 3.286-1.414 1.413L4.723 7.5H2v-2h3.55z",id:"NotMatchDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"NotMatchDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#NotMatchDark_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#NotMatchDark_svg__b)",d:"M0 0h24v24H0z"}))),Gp=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a}=e;const l=(0,At.useSelector)(Zt.ZP.selectors.getTenant),o=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),[i,c]=(0,s.useState)(!1);return{isPending:i,sendMarkAsNotMatchRequest:(0,s.useCallback)((()=>{null==a||a(),c(!0);const e={dtssPath:o,customerTenant:l,entity:r,entities:t};((0,u.biM)(r)?(0,u.bMg)(e):(0,u.fZN)(e)).finally((()=>{null==n||n(),c(!1)}))}),[o,t,r,n,a,l])}};function qp(){return qp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qp.apply(this,arguments)}const Kp=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Vp.iconButton,onMenuClose:a=tt.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest"]);const{sendMarkAsNotMatchRequest:p}=Gp({entity:o,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(Fp,qp({className:r,disabled:l,mode:n,label:C().text("Not a match"),icon:Wp,onClick:p,onMenuClose:a,ref:t},d))}));Kp.displayName="notMatchButton";var Yp=r(66072),$p=r(62901),Xp=r(86602),Qp=r(53857),Jp=r(67462),em=r(50548);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=e=>{let{actions:t,dispatch:r}=e;return(0,s.useMemo)((()=>Object.entries(t).reduce(((e,t)=>{let[n,a]=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){tm(e,t,r[t])}))}return e}({},e,{[n]:(0,I.pipe)(a,r)})}),{})),[r,t])};var nm=r(27536);function am(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lm(e,t,r[t])}))}return e}function lm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const om=[],im=e=>console.error("Collaboration error",e),sm=e=>{let{objectIds:t=om,objectTypes:r,enabled:n=!0}=e;const a=(0,At.useSelector)(Zt.ZP.selectors.getEntity),l=(0,At.useSelector)(Zt.ZP.selectors.getTenant),o=(0,At.useSelector)(Zt.ZP.selectors.getCollaborationPath),i=(0,At.useSelector)(Zt.ZP.selectors.isCollaborationEnabled)&&n,[c,d]=(0,s.useState)(null),[p,m]=(0,s.useState)([]),[h,g]=(0,s.useState)(null),[f,b]=(0,s.useState)(null),[y,E]=(0,s.useState)(!1),[v,x]=(0,s.useState)(!1),w=(0,s.useCallback)((e=>{g((t=>am({},t,e)))}),[]),O=null==a?void 0:a.uri,T=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&O&&!(0,u.ZiX)(O)){const r=e=>{console.warn("Collaboration error",e),g(null)};(0,I.pipe)(u.$oF,(0,I.andThen)((0,I.map)((0,I.props)(["objectId","comments"]))),(0,I.andThen)(I.fromPairs),(0,I.andThen)(t?g:w),(0,I.otherwise)(r))({uris:e,tenant:l,collaborationPath:o})}else g(null)}),[w,o,O,i,l]);(0,s.useEffect)((()=>{T(t,!0)}),[t,T]);const C=(0,s.useCallback)(((e,t)=>{(0,u.liG)({collaborationPath:o,tenant:l,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:r,nextPageToken:n}=e;m((e=>t?(0,I.uniqBy)((0,I.prop)("commentId"),[...e,...r]):r)),d(n)})).catch(im)}),[o,l]),k=(0,s.useCallback)((e=>{x(!0),(0,u.d7q)({collaborationPath:o,tenant:l,commentId:e}).then(b).catch(im).finally((()=>x(!1)))}),[o,l]),S=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i}=e;E(!0);const s={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:""};return(0,u.Yrx)({collaborationPath:o,tenant:l,data:s}).then((e=>{let[t]=e;return((e,t)=>{b(e),g((r=>am({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),m((t=>[e,...t]))})(t,a)})).catch(im).finally((()=>E(!1)))}),[o,l]),P=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i,commentId:s,replies:c}=e;E(!0);const d={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:"",commentId:s,replies:c};return(0,u.uAg)({collaborationPath:o,tenant:l,data:d}).then((e=>(e=>{b(e),m((0,I.map)((0,I.when)((0,I.propEq)("commentId",e.commentId),(0,I.always)(e))))})(am({},e,{replies:c})))).catch(im).finally((()=>E(!1)))}),[o,l]),N=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;E(!0),(0,u.YFy)({collaborationPath:o,tenant:l,commentId:r}).then((()=>((e,t)=>{b(null),g((r=>{const n=r[t]||[];return am({},r,{[t]:n.filter((t=>t.commentId!==e))})})),m((t=>t.filter((t=>t.commentId!==e))))})(r,t))).catch(im).finally((()=>E(!1)))}),[o,l]),D=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";b("resolved"===n?e=>{if(e)return null}:t=>{if(t)return am({},t,{replies:[...t.replies,e]})}),g((e=>am({},e,{[t]:(e[t]||[]).map((e=>e.commentId===r?am({},e,{status:n,replies:e.replies+1}):e))}))),m((t=>t.map((t=>t.commentId===r?am({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),R=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,commentId:n,action:a,uri:i}=e;E(!0);const s={content:t,action:a,namedUsers:r};return(0,u.PP2)({collaborationPath:o,tenant:l,commentId:n,data:s}).then((e=>{let[t]=e;return D(t,i,n)})).catch(im).finally((()=>E(!1)))}),[o,l,D]),_=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;R({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[R]),A=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;R({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[R]);return{clearCurrentComment:(0,s.useCallback)((()=>{b(null)}),[]),comments:p,commentsMap:h,createComment:S,createReply:R,currentComment:f,deleteComment:N,editComment:P,getComment:k,getComments:C,getCommentsCount:T,loading:v,objectTypes:r,pageToken:c,reOpenThread:A,resolveThread:_,sending:y}};var cm=r(90690);function um(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dm(e,t,r[t])}))}return e}function dm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pm=(0,I.when)(I.identity,(0,I.pipe)(u.VGB,I.length,(0,I.times)((e=>e+1)))),mm=e=>{let{sorting:t,filter:r,page:n,rowsPerPage:a,config:l,entity:o,relationActivityFilter:i,mode:c}=e;const[d,p]=(0,s.useState)(!1),m=(0,At.useDispatch)(),h=(0,At.useSelector)(Zt.ZP.selectors.getTenant),g=(0,At.useSelector)(Zt.ZP.selectors.getDtssPath),{activityFilter:f,globalFilter:b}=(0,At.useSelector)(Zt.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(0,Mt._)(),E=l.suggested,v=(0,s.useCallback)((()=>{if(null!=o&&o.uri){const e=um({},l.content,{sortBy:null==t?void 0:t.field,order:null==t?void 0:t.order,returnDates:!0,returnObjects:!0,activeness:{relation:i||u.Ng6.ALL,entity:f},max:a,offset:n*a,filter:(0,u.vyX)(b,r)||void 0,suggested:pm(E)}),s=[e].concat((0,I.ifElse)(I.identity,(0,I.pipe)(u.VGB,(t=>t.map(((t,r)=>um({},t,{id:e.suggested[r]}))))),(0,I.always)([]))(E)),c=(0,I.cond)([[(0,I.pipe)((0,I.prop)("uri"),u.ZiX),()=>Promise.resolve([{total:0}])],[u.biM,e=>(0,u.n_1)({entityUri:e.uri,configs:s,customerTenant:h,dataTenant:e.dataTenant,dtssPath:g})],[I.T,e=>(0,u.N6e)(e.uri,s)]]);p(!0),y(c(o)).then((e=>{let[{connections:t,total:r}]=e;m(Zt.N5.relations.actions.relationsLoaded({id:l.id,connections:t,total:r}))})).finally((()=>{p(!1)}))}}),[f,l,m,g,null==o?void 0:o.uri,null==o?void 0:o.dataTenant,r,b,n,i,a,y,t,h]),x=(0,s.useRef)(!1);x.current=!1,(0,s.useEffect)((()=>{x.current=!0,v()}),[v]);const w=(0,cm.D)(c);return(0,s.useEffect)((()=>{c!==u.ARY.Viewing||x.current||w===c||(x.current=!0,v())}),[v,c,w]),{isLoading:d,reload:v}},hm=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var gm=r(11326);const fm=()=>{const[e,t]=(0,s.useState)([]),r=(0,At.useSelector)(Zt.ZP.selectors.getTenant),n=(0,At.useSelector)(Zt.ZP.selectors.getUIPath),a=e=>{console.warn("Users error",e),t([])};return(0,s.useEffect)((()=>{(0,u.kz_)(r,n).then((e=>{let{array:r}=e;return t(r)})).catch(a)}),[r,n]),e};function bm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ym=(e,t)=>{const r=(0,s.useRef)();(0,s.useEffect)((()=>{if(r.current){const n=Object.keys(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bm(e,t,r[t])}))}return e}({},r.current,t)),a={};n.forEach((e=>{r.current[e]!==t[e]&&(a[e]={from:r.current[e],to:t[e]})})),Object.keys(a).length&&console.log("[why-did-you-update]",e,a)}r.current=t}))};var Em=r(47081),vm=r(76572),xm=r(62228),wm=r(8007),Om=r(65510),Tm=r(58142),Cm=r(89575),Im=r(80687);const km=c().createContext(!1);km.displayName="ProfilePerspectiveViewContext";const Sm=c().createContext("");Sm.displayName="IdContext";var Pm=r(63929),Nm=r(3064),Dm=r(38309),Rm=r(10609)}}]);