@reltio/remotes 1.4.959 → 1.4.960

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.
Files changed (3) hide show
  1. package/676.js +1 -1
  2. package/810.js +1 -1
  3. package/package.json +1 -1
package/676.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[676],{48676:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>Oa,ActionButton:()=>Vv,ActionButtonMode:()=>Mv,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>l.I,AddWorkflowButton:()=>Pv,ArrowExpandButton:()=>Ut,AsyncMountContext:()=>pa,AttributeListItem:()=>m.Z,AttributeTitle:()=>Q,AttributesList:()=>Pa,AttributesPager:()=>ro,AttributesTable:()=>of,AttributesView:()=>pi,AutoSizeList:()=>Ni.Z,AvatarWithFallback:()=>Ii.Z,BarChart:()=>Qs.Z,BasicTable:()=>Pi.Z,BasicTableContext:()=>Ai.X,BasicTablePagination:()=>is.Z,BasicView:()=>C.Z,BasicViewContent:()=>Xs.Z,BasicViewHeader:()=>O.Z,BlockImageGalleryDialogContext:()=>Cr,BranchDecorator:()=>D,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>J,CardinalityMessage:()=>Zl,ChartsFactory:()=>rc.Z,ClickAwayProvider:()=>oc,CollaborationContext:()=>ne,CollaborationItem:()=>qe,CollapseButton:()=>ks.Z,CollapseRowButton:()=>Ps,ColorBar:()=>ic.Z,ColumnFilterType:()=>ji.Dq,ColumnsDataType:()=>ji.uz,ColumnsSettings:()=>ts,CommentsContainer:()=>et,ConfigureColumnsPopup:()=>fc,ConfirmDeleteDialog:()=>oh,ConfirmationDialog:()=>lh,ConnectionRelationTypeSelector:()=>vc,CrosswalkDragLayer:()=>hf,CrosswalkEditor:()=>Zf,CrosswalkType:()=>ff,CrosswalksDisplayProvider:()=>Bm,DEFAULT_OVERLAY_OPTIONS:()=>ub,DataTypeValue:()=>at.Z,DataTypeValueEditor:()=>na.Z,DateEditor:()=>Dc.Z,DateRangeEditor:()=>Pc.Z,DateRangeTypes:()=>xb.K,DefaultCellValueRenderer:()=>ss.Z,DeltaTypes:()=>o.w,Drawer:()=>Tc,DropDownEditor:()=>Sc.Z,DropDownMenuButton:()=>be.Z,DropDownSelector:()=>_a.Z,DropdownIndicator:()=>sc.Z,DropdownIndicatorWithIconButton:()=>cc.Z,EMPTY_STATE_ICONS:()=>Mc.B9,EMPTY_STATE_VARIANTS:()=>Mc.tC,EditableAttribute:()=>Ol,EditableImageAttributesLine:()=>Jn,EmptyState:()=>Mc.ZP,EmptyStub:()=>Cn.Vd,EntitiesMapContext:()=>xe,EntityAvatar:()=>bt,EntityCreator:()=>al,EntityMarkerContext:()=>nb,EntitySelector:()=>gl,EntityTypeBadge:()=>Bc,EntityTypeIcon:()=>Ma.Z,EntityTypesSelector:()=>au,EntityUriLink:()=>ve.Z,ErrorBoundary:()=>lu.Z,ErrorMessage:()=>ta,ErrorPopup:()=>ou.Z,ErrorWrapper:()=>ia,ExpandableSearchInput:()=>Zm,ExpandedAttributesProvider:()=>$g,ExpandedValueTooltip:()=>mi.C,FacetViewHeader:()=>k,FileTypeEditor:()=>Rc.Z,FilterButton:()=>os,FilterValueEditor:()=>Nc.Z,FlipCard:()=>du,HideOnShrink:()=>hu,HierarchicalAttributeTooltip:()=>wu,Highlighter:()=>Xr,HistoryActivityType:()=>yb,HistoryChangeTypes:()=>Mb,HistoryDiffContext:()=>ct,HistoryHeader:()=>Sy,HistoryPanelEmptyState:()=>Iy,HistoryView:()=>Jb,IdContext:()=>pE,ImageAttributesLine:()=>Vo,ImageGalleryDialog:()=>To,ImportButton:()=>ku,ImportModes:()=>Su,InlineAttributesPager:()=>zg,InlineImageAttribute:()=>Lg,InlineNestedAttribute:()=>Jg,InlineReferenceAttribute:()=>Pg,LightArrowTooltip:()=>Xm,LinearLoadIndicator:()=>Dn,Link:()=>Iu,LoadingSpinner:()=>Pu,MAP_DRAWING_MODES:()=>cb,MAP_MINIMUM_SCALE_RADIUS:()=>pb,Marginator:()=>eh.Z,MatchRulesBlock:()=>rp,MenuWithPopper:()=>uc.Z,MergeButton:()=>zv,ModeSwitcher:()=>wo,ModeSwitcherSelect:()=>ip,MoreAttributesButton:()=>en,MultiSelect:()=>_p.Z,MultiValueChip:()=>Vl.Z,MultipleInput:()=>sp.Z,NestedAttribute:()=>Kt,NestedAttributeEditor:()=>La,NoData:()=>Lc,NoResults:()=>_c.X,NotMatchButton:()=>Gv,NumberEditor:()=>Ic.Z,OvIcon:()=>st,PieChart:()=>Js.Z,PivotingAttributeContext:()=>w,Popper:()=>Ye.Z,PopupBoundariesContext:()=>cE.p,PopupWithArrow:()=>Xe,PotentialMatchReviewCard:()=>gp,ProfileBand:()=>vp,ProfileBandHistory:()=>Ny,ProfileBandNavigation:()=>Ks,ProfileCard:()=>Cp,ProfileMatchCard:()=>fv,ProfilePerspectiveViewContext:()=>uE,QueryBuilderAttributeDataType:()=>ji.eB,QueryBuilderAttributeType:()=>ji.Xw,QueryBuilderRow:()=>Rp,QueryBuilderRowsGroup:()=>Lp,ReactSelectOptionFilters:()=>Mp,ReactSortableTree:()=>zd,ReactSortableTreeHandlers:()=>Dd,ReactSortableTreeUtils:()=>pd,ReadOnlyAttribute:()=>ar,ReadOnlyAttributeValuesBlock:()=>ki,ReadOnlyAttributesList:()=>ni,ReadOnlyAttributesPager:()=>ri,ReferenceAttribute:()=>nr,ReferenceAttributeEditor:()=>wl,RelatedObjectUrisContext:()=>ae,RelationEditor:()=>Zy,RelationTypeSelector:()=>Ei,ReltioGridLayout:()=>Fd.Z,ReltioMap:()=>fb,ResizablePanes:()=>Yd,RowCellAutoSizer:()=>Ts,Score:()=>fp,ScoreLabel:()=>K,ScrollableTabs:()=>_m.Z,SearchInput:()=>Vr.Z,SelectionPopup:()=>Ur,SelectionPopupPopper:()=>am,SelectorWithOnlyOptionAutoSelect:()=>im,SideButtonsPanel:()=>um,SidePanel:()=>fm,SidePanelContentHeader:()=>ym,SidePanelEmptyState:()=>gm,SimpleAttribute:()=>Lt,SimpleAttributeEditor:()=>wa,SimpleDropDownSelector:()=>Ml.Z,SimpleMatchRulesBlock:()=>Hu,SimpleMatchRulesBuilder:()=>Gu,SmallIconButton:()=>_t.Z,SmallIconButtonWithTooltip:()=>ye.k,SortingType:()=>ji.nI,SourceCrosswalksRow:()=>Rf,SourceIcon:()=>xm.Z,Spacer:()=>vm.Z,TableContext:()=>Ai.X,TableWithBars:()=>ec.Z,TextEditor:()=>kc.Z,TimestampEditor:()=>Ac.Z,TransitiveMatchBlock:()=>tp,TreeChart:()=>tc.Z,UsersContext:()=>Te,VerticalDivider:()=>wm,VerticalHeadingsTable:()=>Sm,ViewIdContext:()=>Ga.m,ViewMoreToggle:()=>Pm,VirtualGroupedList:()=>Gr,WhiteSearchInput:()=>em,WorkflowComments:()=>lx,WorkflowTaskCard:()=>Tv,WorkflowTasksContext:()=>_y,basicTableViewState:()=>ws,buildColumnsFilter:()=>ps.Tz,columnFilterToMdmFilter:()=>ps.su,createStandardAction:()=>Cn.zD,defaultGetRowCellHeight:()=>cs.Z,defaultRenderRowCell:()=>us.Z,getChecked:()=>Cn.IR,getValue:()=>Cn.NA,groupCrosswalksByTypesAndSources:()=>Mf,isIE:()=>Cn.w1,mergeClasses:()=>Cn.ze,noop:()=>Cn.ZT,parseJSON:()=>Cn.Rx,stopPropagation:()=>Cn.UW,toggleSortOrder:()=>Cn.Dh,useActions:()=>Yv,useActivitiesLoader:()=>i.d,useAsyncMount:()=>ma,useAttributeExpanded:()=>Yg,useBasicTableCellRenderer:()=>_s,useClickableStyle:()=>ac.d,useCollaboration:()=>eE,useConfigPermissions:()=>sE.l,useCrosswalkActions:()=>df,useCrosswalkColor:()=>Um,useCrosswalkFocus:()=>Hm,useCrosswalkHighlight:()=>Fm,useDidUpdateEffect:()=>te.D,useDynamicRowCellHeight:()=>Rs,useHighlightedCrosswalks:()=>zm,useHistory:()=>Nb,useHistoryDiff:()=>Ab,useHistorySlice:()=>bb,useKeyboardNavigation:()=>$r,useMarkAsNotMatchRequest:()=>Wv,useMatchesLoader:()=>gv,useMergeAllRequest:()=>Bv,useModifiedEntity:()=>pf,usePagingSimulator:()=>mv,usePrevious:()=>mb.D,useProfileActivitiesLoader:()=>d,useRelationTypeSelector:()=>bc,useRelationsLoader:()=>rE,useRunOnceAfterValueInitialization:()=>nE,useSafePromise:()=>ze._,useSavedState:()=>aE.a,useUsers:()=>lE,useWhyDidYouUpdate:()=>iE,useWorkflowAssignee:()=>Fy,useWorkflowCheckPermission:()=>Vy,useWorkflowComments:()=>nx,useWorkflowTasks:()=>Av,withAsyncMount:()=>ha,withFilterAtBottom:()=>Ri.Z,withPercents:()=>nc.Z,withTableContext:()=>Di.Z,withTooltip:()=>lt.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(67075),p=r(54202);const d=e=>{let{filter:t,max:r,offset:n,entityUri:a}=e;return(0,s.useCallback)((async()=>{const e=(0,p.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),g=r(52730),h=r(89810),f=r(71153),b=r.n(f),y=r(87918),x=r.n(y),v=r(95544),E=r(90436);const w=c().createContext([]);var C=r(1730),O=r(17998),T=r(79692);const S=(0,T.Z)({container:{padding:"0 16px",minHeight:"48px"},title:{fontSize:"16px",lineHeight:"19px",paddingTop:"16px",paddingBottom:"13px",justifyContent:"flex-start"}}),k=e=>{let{className:t,title:r,children:n}=e;const a=S();return c().createElement(O.Z,{title:r,classes:{root:b()(a.container,t),title:a.title}},n)};var N=r(17440);const I="1px solid #AFD4E9",P=(0,T.Z)({decorator:{marginLeft:8,borderLeft:I,"&:last-child":{borderLeft:"none","&:before":{borderLeft:I}},"&:before":{top:0,height:14,width:5,borderBottom:I,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),D=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const l=P();return a?c().createElement("div",{className:b()(l.decorator,{[l.plain]:n},t)},c().createElement("div",{className:l.wrapper},r)):c().createElement(c().Fragment,null,r)};function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){R(e,t,r[t])}))}return e}function R(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const j="13px",Z="15px",L={titleRow:{display:"block",minHeight:"16px",textIndent:"-1em",paddingLeft:"1em"},title:{whiteSpace:"nowrap"},ovIcon:{marginLeft:"8px",marginRight:"-3px",marginTop:"-1px",textIndent:0}},_=(0,T.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),M=(0,T.Z)(A({wrapper:{fontSize:j,lineHeight:Z,flex:1},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginBottom:"-3px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)"}},L)),V=(0,T.Z)(A({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:j,lineHeight:Z},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"}},L,{titleRow:A({},L.titleRow,{marginBottom:"3px"})}));var B=r(13980),U=r.n(B),z=r(32701);const F=(0,T.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"15px"}}),H=(0,T.Z)({container:{display:"flex",flexShrink:0,marginLeft:"10px",alignItems:"center"},value:{marginLeft:"4px",minWidth:"20px",textAlign:"center"}}),W=(0,T.Z)({dqiq:{width:"14px",height:"14px",lineHeight:"14px",background:"#e6605e",color:"#fff",fontSize:"10px",fontWeight:100,marginLeft:"2px",marginRight:"1px",borderRadius:"2px",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,textIndent:0}}),q=()=>{const e=W();return c().createElement(c().Fragment,null,c().createElement("span",null,"DQ"),c().createElement("span",{className:e.dqiq},"IQ"))},G=["analyticsAttributes/DQ/analyticsAttributes/score","analyticsAttributes/DQ"],$=["analyticsAttributes/IQ/analyticsAttributes/score","analyticsAttributes/IQ"],Y=e=>{let{label:t="",attrTypeUri:r=""}=e;const n=r.indexOf("analyticsAttributes/"),a=r.substr(n),l=(0,N.includes)(a,G),o=(0,N.includes)(a,$);return(0,N.cond)([[(0,N.always)(l),(0,N.always)(c().createElement(q,null))],[(0,N.always)(o),(0,N.always)(x().text("Rank"))],[N.T,(0,N.always)(t)]])()};Y.propTypes={label:U().string,attrTypeUri:U().string};const K=Y,X=e=>{let{label:t,isRequired:r,className:n,attributeType:a={}}=e;const l=F();return c().createElement(E.Z,{className:b()(l.label,n),component:"span"},c().createElement(K,{label:t,attrTypeUri:a.uri}),r&&c().createElement(z.Z,null))};X.propTypes={label:U().string,isRequired:U().bool,className:U().string,attributeType:u.EMD};const Q=X,J="commentsContainerVisibilityArea",ee=(0,T.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${J}:hover &`]:{visibility:"visible"}},showAlways:{}})));var te=r(55962);const re=()=>{},ne=c().createContext({comments:[],commentsMap:null,currentComment:null,getComment:re,getComments:()=>new Promise(re),getCommentsCount:re,createComment:()=>new Promise(re),editComment:()=>new Promise(re),createReply:()=>new Promise(re),resolveThread:re,reOpenThread:re,clearCurrentComment:re,deleteComment:re,sending:!1,loading:!1,pageToken:null});ne.displayName="CollaborationContext";const ae=c().createContext([]);ae.displayName="RelatedObjectUrisContext";var le=r(80030);function oe(){return oe=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},oe.apply(this,arguments)}const ie=e=>c().createElement("svg",oe({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),se=(0,T.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}},childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}))),ce=c().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=se();return c().createElement(le.ZP,{title:x().text("Show comment")},c().createElement("div",{ref:t,className:a.root,onClick:n},c().createElement(ie,{className:a.icon}),c().createElement("div",{className:a.childrenWrapper},r)))}));ce.displayName="CommentButton";const ue=ce;function pe(){return pe=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},pe.apply(this,arguments)}const de=e=>c().createElement("svg",pe({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),me=e=>{let{className:t,onClick:r}=e;const n=se();return c().createElement(le.ZP,{title:x().text("Add comment")},c().createElement("div",{className:b()(n.root,t),onClick:r},c().createElement(de,{className:n.icon})))};var ge=r(27291),he=r(86689),fe=r(43054),be=r(98538),ye=r(39475);const xe=c().createContext({});xe.displayName="EntitiesMapContext";var ve=r(18527);const Ee=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},we=e=>`${x().date(e,"LT")} ${x().date(e,"LL")}`,Ce=(0,T.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),Oe=e=>{let{comment:t,className:r}=e;const n=Ce(),a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,s.useContext)(xe);return c().createElement(v.Z,{className:r},(()=>{switch(t.objectType){case u.q7e.ENTITY_ATTRIBUTE:{const e=(0,u.AFK)(t.objectId,a.type),r=(0,u.zeJ)(l,e);return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected attribute:")),c().createElement(E.Z,{className:n.label},null==r?void 0:r.label))}case u.q7e.ENTITY:return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected profile:")),c().createElement(ve.Z,{className:b()(n.label,n.link),value:(0,u.wwR)(a)},(0,u.idV)(a.label)));case u.q7e.RELATION:{var e;const r=Ee(t,a.uri),l={uri:r,label:null===(e=o[r])||void 0===e?void 0:e.label};return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected relation:")),c().createElement(E.Z,{className:n.label},c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(a)},(0,u.idV)(a.label)),r&&c().createElement(c().Fragment,null,` ${x().text("to")} `,c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}case u.q7e.POTENTIAL_MATCH:{var r;const e=Ee(t,a.uri),l={uri:e,label:null===(r=o[e])||void 0===r?void 0:r.label};return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected potential match:")),c().createElement(E.Z,{className:n.label},c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(a)},(0,u.idV)(a.label)),e&&c().createElement(c().Fragment,null,` ${x().text("and")} `,c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}default:return null}})())},Te=c().createContext([]);Te.displayName="UsersContext";const Se=(0,T.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),ke=e=>{let{comment:t,className:r}=e;const n=Se(),a=(0,s.useContext)(Te);return c().createElement(E.Z,{className:b()(n.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let l="",o=!1;for(let i=0;i<=e.length;i++){const s=e[i],c=e[i+1],u=i===e.length-1;l+=s,s===n&&0===i&&(o=!0),o&&t.includes(l.slice(n.length))&&(o=!1,a.push(r(l)),l=""),c===n&&(o=!0,a.push(l),l=""),u&&a.push(l)}return a}(t.content,t.namedUsers,(e=>{const t=a.find((t=>t.username===e.slice(1)));return t?c().createElement(he.Z,{href:`mailto:${t.email}`},e):e})).map(((e,t)=>c().createElement(s.Fragment,{key:t},e))))};var Ne=r(43434);const Ie=(0,T.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function Pe(){return Pe=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},Pe.apply(this,arguments)}const De=e=>{let{className: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,["className","children"]);const a=Ie();return c().createElement(Ne.Z,Pe({},n,{className:b()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))},Ae=(0,T.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),Re=e=>{let{onReply:t,className:r,uri:n,comment:a,onStartEditing:l}=e;const o=Ae(),i=(0,g.useSelector)(h.ZP.selectors.getUserName),u=a.createdBy===i,{resolveThread:p,reOpenThread:d,sending:m,deleteComment:f}=(0,s.useContext)(ne),b=(0,s.useMemo)((()=>[{text:x().text("Edit"),onClick:l},{text:x().text("Delete"),onClick:()=>f({uri:n,commentId:a.commentId})}]),[l,f,n,a]);return c().createElement(v.Z,{className:r},c().createElement(v.Z,{className:o.header},c().createElement(De,{classes:{root:o.avatar}},a.createdBy),c().createElement(v.Z,{width:"100%"},c().createElement(E.Z,{className:o.username},a.createdBy)),c().createElement(E.Z,{className:o.createdAt},we(a.createdTime)),u&&c().createElement(be.Z,{buttonComponent:ye.k,buttonProps:{icon:fe.Z,tooltipTitle:x().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:b,menuId:"collaboration-comment-menu"})),c().createElement(v.Z,{className:o.body},c().createElement(Oe,{comment:a,className:o.commentTarget}),c().createElement(ke,{comment:a,className:o.message}),c().createElement(v.Z,{className:o.buttons},c().createElement(he.Z,{className:o.button,onClick:t,component:"button"},x().text("Reply")),"open"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{p({commentId:a.commentId,uri:n})},component:"button"},x().text("Resolve")),"resolved"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{d({commentId:a.commentId,uri:n})},component:"button"},x().text("Re-open")))))},je=(0,T.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),Ze=e=>{let{className:t,reply:r}=e;const{createdBy:n,action:a,createdTime:l}=r,o=je();return c().createElement(v.Z,{className:b()(o.root,t)},c().createElement(De,{classes:{root:o.avatar}},n),c().createElement(v.Z,null,c().createElement(v.Z,{className:o.header},c().createElement(E.Z,{className:o.username},n),"resolve"===a&&c().createElement(E.Z,{className:o.marked},x().text("Marked as resolved")),"reopen"===a&&c().createElement(E.Z,{className:o.marked},x().text("Re-opened"))),"resolve"!==a&&c().createElement(ke,{className:o.message,comment:r}),c().createElement(E.Z,{className:o.createdAt},we(l))))};var Le=r(77277),_e=r(2271);const Me=(0,T.Z)((e=>({root:{width:"100%",backgroundColor:"#fff",fontFamily:"Roboto","&__control":{fontSize:"13px"},"&__highlighter":{padding:"10px 22px",border:"1px solid transparent !important",maxHeight:"70px"},"&__input":{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,maxHeight:"70px",overflow:"auto !important"},"&__suggestions":{padding:"8px 0",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},"&__suggestions__list":{maxHeight:"200px",overflowY:"scroll"},"&__suggestions__item":{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function Ve(){return Ve=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},Ve.apply(this,arguments)}const Be=e=>{let{onChange:t,className: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,["onChange","className"]);const a=Me(),l=(0,s.useContext)(Te);return c().createElement(_e.r,Ve({},n,{onChange:(e,r,n,a)=>{t(r,n,(0,N.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:b()(a.root,r)}),c().createElement(_e.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:a.mention}))},Ue=(0,T.Z)({root:{padding:"6px 6px 6px 8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},textField:{maxWidth:"calc(100% - 40px)"},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:{marginLeft:"40px",marginTop:"8px"},button:{"& + $button":{marginLeft:"8px"}}});var ze=r(29627);const Fe=e=>{switch(e){case"open":return x().text("Reply...");case"resolved":return x().text("Adding a comment will re-open this");default:return""}},He=e=>{let{inputRef:t,className:r,uri:n,relatedObjectUris:a,objectType:l,popperRef:o,comment:i,isEditingComment:u,onCancel:p}=e;const d=Ue(),m=(0,g.useSelector)(h.ZP.selectors.getUserName),{createReply:f,createComment:y,sending:E,editComment:w}=(0,s.useContext)(ne),[C,O]=(0,s.useState)(""),[T,S]=(0,s.useState)(""),[k,I]=(0,s.useState)([]),[P,D]=(0,s.useState)(!1),A=(0,ze._)(),R=""!==C.trim(),j=P||R,Z=null==i?void 0:i.status,L=(e,t,r)=>{I(r),O(e),S(t)},_=()=>{null==p||p(),L("","",[])};return(0,s.useEffect)((()=>{o&&o.current.update()}),[o,j]),(0,s.useEffect)((()=>{u?O(i.content):_()}),[u]),c().createElement(v.Z,{className:b()(d.root,r)},c().createElement("form",{onSubmit:e=>{e.preventDefault();const t=(0,N.cond)([[(0,N.always)(!i),()=>y({content:T,namedUsers:k,objectType:l,uri:n,relatedObjectUris:a})],[(0,N.always)(u),()=>w({content:T,namedUsers:k,commentId:i.commentId,objectType:l,replies:i.replies,relatedObjectUris:a,uri:n})],[N.T,()=>f({content:T,namedUsers:k,commentId:i.commentId,action:"open"===i.status?"none":"reopen",uri:n})]]);return A(t()).then(_).catch(console.log)},className:d.form},c().createElement(v.Z,{className:d.main},c().createElement(De,{classes:{root:d.avatar}},m),c().createElement(Be,{className:d.textField,disabled:E,onChange:(e,t,r)=>{L(e,t,r)},inputRef:t,value:C,onFocus:()=>D(!0),onBlur:()=>D(!1),placeholder:Fe(Z)})),j&&c().createElement(v.Z,{className:d.buttons},c().createElement(Le.Z,{className:d.button,variant:"contained",color:"primary",disabled:!R||E,type:"submit"},((e,t)=>t?x().text("Edit"):"open"===e||"resolved"===e?x().text("Reply"):x().text("Comment"))(Z,u)),c().createElement(Le.Z,{disabled:E,onClick:()=>_(),className:d.button,variant:"outlined",color:"primary"},x().text("Cancel")))))},We=(0,T.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),qe=(0,s.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:l,messagesRef:o,comment:i}=e;const u=(0,s.useRef)(),p=We({classes:a}),[d,m]=(0,s.useState)(!1),g=c().createElement(He,{className:p.sendMessageArea,inputRef:u,popperRef:l,uri:t,relatedObjectUris:r,objectType:n,comment:i,onCancel:()=>m(!1),isEditingComment:d});return c().createElement(v.Z,{className:p.root},i&&c().createElement(c().Fragment,null,c().createElement("div",{className:p.messages,ref:o},c().createElement(Re,{comment:i,uri:t,onReply:()=>{d&&m(!1),u.current.focus()},onStartEditing:()=>{m(!0)},className:p.comment}),c().createElement(v.Z,{className:p.replies},i.replies.map((e=>c().createElement(Ze,{key:e.replyId,className:p.repliedComment,reply:e}))))),g),!i&&g)}));var Ge=r(27556),$e=r(1292),Ye=r(7421);const Ke=(0,T.Z)((e=>{const t=e.palette.background.paper;return{popoverRoot:{backgroundColor:t,maxWidth:1e3},popper:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}})),Xe=e=>{let{anchorEl:t,placement:r="top",arrow:n=!0,open:a,onClose:l=(()=>{}),children:o,className:i,popperRef:s}=e;const u=Ke(),[p,d]=c().useState(null);return c().createElement(Ye.Z,{anchorEl:t,placement:r,className:b()(u.popper,i),modifiers:{preventOverflow:{enabled:!0,boundariesElement:"window"},arrow:{enabled:n,element:p}},open:a,modal:!1,popperRef:s},c().createElement(v.Z,null,c().createElement($e.Z,{onClickAway:e=>{var t;t=e.target,Array.from(document.querySelectorAll("[data-modal]")).some((e=>e.contains(t)))||l()}},c().createElement(Ge.Z,{className:u.popoverRoot},n?c().createElement("span",{className:u.arrow,ref:d}):null,c().createElement(v.Z,null,o)))))},Qe=(0,T.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),Je=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:l,open:o,comment:i}=e;const[u,p]=(0,s.useState)(0),d=Qe({scrollWidth:u,hasScroll:0!==u}),m=(0,s.useRef)(null),{resolveThread:g,loading:h,sending:f}=(0,s.useContext)(ne),b=1+(null==i?void 0:i.replies.length);return c().createElement(Xe,{popperRef:m,anchorEl:a,open:o,placement:"right-start",onClose:l,className:d.popper},c().createElement(v.Z,{className:d.header},c().createElement(v.Z,{className:d.headerInfo},c().createElement(E.Z,{className:d.title},x().text("Comments")),i&&!h&&c().createElement(E.Z,{className:d.counter},x().number(b)," ",1===b?x().text("item"):x().text("items"))),i&&!h&&c().createElement(ye.k,{className:d.resolveButton,size:"S",onClick:()=>{g({commentId:i.commentId,uri:t})},disabled:f,showForDisabled:!0,tooltipTitle:x().text("Resolve"),icon:ge.Z,color:"primary"})),!h&&c().createElement(qe,{popperRef:m,messagesRef:e=>{e&&p(e.offsetWidth-e.clientWidth)},classes:{root:d.collaborationItem,replies:d.replies,sendMessageArea:d.sendMessageArea,messages:d.messages,comment:d.comment},uri:t,relatedObjectUris:r,objectType:n,comment:i}))},et=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:l,allowOnlyOneComment:o=!1,showAlways:i=!1}=e;const u=ee(),[p,d]=(0,s.useState)(null),[m,g]=(0,s.useState)(!1),h=m&&Boolean(p),{currentComment:f,commentsMap:y,getComment:x,clearCurrentComment:v,objectTypes:E}=(0,s.useContext)(ne),w=!!y&&(!E||E.includes(n)),C=((null==y?void 0:y[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),O=!o||o&&0===C.length,T=null===f&&h;(0,te.D)((()=>{l&&l(h)}),[h]);const S=(0,s.useContext)(ae),k=(0,s.useMemo)((()=>S?[...a,...S]:a),[S,a]);return w&&c().createElement("div",{className:b()(u.root,t)},O&&c().createElement(me,{className:b()(u.addButton,{[u.showAlways]:i||T}),onClick:e=>{d(e.currentTarget),g(!0)}}),C.map((e=>{let{replies:t,commentId:r}=e;return c().createElement(ue,{ref:r===(null==f?void 0:f.commentId)?d:null,key:r,onClick:()=>(e=>{x(e),g(!0)})(r)},1+t)})),c().createElement(Je,{anchorEl:p,open:h,onClose:()=>{d(null),v(),g(!1)},uri:r,relatedObjectUris:k,objectType:n,comment:f}))};var tt=r(7089),rt=r(41128);const nt=(0,T.Z)((e=>({container:{height:"16px",borderColor:(0,rt.U1)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}})));var at=r(67586),lt=r(78223);const ot=(0,lt.Z)(tt.Z),it=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const l=nt();if(!a)return null;const o=n.length?n.map(((e,t)=>c().createElement("div",{key:t},(0,u.YkM)(r)?(0,u.idV)(e.label):c().createElement(at.Z,{value:(0,u.kDl)(e),dataTypeDefinition:(0,u.PFL)(r),rich:!1})))):null;return c().createElement(ot,{tooltipTitle:o,tooltipPlacement:"top",label:`+ ${a}`,variant:"outlined",classes:{root:b()(l.container,t),label:l.label}})};it.propTypes={className:U().string,nonOvTotal:U().number,attributeType:u.EMD,nonOvValues:U().arrayOf(U().oneOfType([u.cNQ,u.dMV,u.Rtp]))};const st=it,ct=c().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});ct.displayName="HistoryDiffContext";const ut=(e,t)=>{const r=(0,u.xy8)(e);return t.reduce(((t,n)=>{for(const a in n){const l=(e[r]||[]).find((e=>e.uri===a));return Array.isArray(n[a])&&"object"==typeof n[a][0]?t=(t||[]).concat(ut(l,n[a])):(t.push(pt(n[a],l)),t)}}),[])},pt=(e,t)=>e&&e.length&&!(0,N.isNil)(e[0])?{fieldName:(0,u.Tde)(t.uri),filter:t.type===u.oS0.TYPE_BLOB?u.j5E.FULL_TEXT:u.j5E.EQUALS,values:e}:{fieldName:(0,u.Tde)(t.uri),filter:"missing"},dt=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let l=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(l=l.filter((e=>a.includes(e.uri)))),l.reduce(((e,a)=>{const l=mt(t[a.name],n,r);return l&&l.length&&(Array.isArray(l[0])?e.push({[a.uri]:l[0]}):e.push({[a.uri]:l})),e}),[])},mt=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,l=(0,u.zeJ)(t,n.type);a&&"object"!=typeof a&&(0,u.OXP)(n)?e.push(gt(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(dt(l,a,r,t))}return e}),[])},gt=(e,t)=>{switch(null==t?void 0:t.type){case u.oS0.TYPE_DATE:return new Date(e).getTime();case u.oS0.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function ht(){return ht=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},ht.apply(this,arguments)}const ft=e=>c().createElement("svg",ht({width:11,height:11,viewBox:"0 0 11 11"},e),c().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),bt=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,g.useSelector)(h.ZP.selectors.getAbsoluteImagePath)||"",o=(0,u.uie)(a,l,t),i=(0,u.vPL)(l,(0,u.XH2)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,u.m5F)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};return c().createElement(Ne.Z,{className:b()(r,n),src:o,imgProps:{onError:s}},c().createElement("img",{className:n,src:i,alt:"fallback entity avatar",onError:s}))},yt=(0,T.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"31px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px"},icon:{margin:"auto 8px auto 0"},content:{color:e.palette.primary.main},seeAllButton:{cursor:"pointer"}}))),xt=(0,T.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}});function vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Et=e=>{let{value:t,attributeType:r,config:n={}}=e;const[a,l]=(0,s.useState)([]),[o,i]=(0,s.useState)(0),p=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},d=(0,ze._)(),m=(0,g.useDispatch)(),f=yt(),b=(0,g.useSelector)(h.ZP.selectors.getGlobalSearchRequestOptions)||{},y=n.entityType||p.type,v=o>6;(0,s.useEffect)((()=>{const e=function(e,t){let r=[{fieldName:"type",filter:"equals",values:[arguments.length>2&&void 0!==arguments[2]?arguments[2]:""]}];return Array.isArray(e)?r=r.concat(ut(t,e)):r.push(pt([e],t)),r}(t,r,y),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vt(e,t,r[t])}))}return e}({max:6},b);d(Promise.all([(0,u.ZOr)(e,n),(0,u.j_Q)(e,n)])).then((e=>{const[t,{total:r}]=e;l(Array.isArray(t)?t:[]),i(r)})).catch((()=>{l([]),i(0)}))}),[]);const E=Boolean(n.label);return c().createElement("div",{className:f.container},c().createElement("div",{className:f.header},c().createElement("div",{className:f.title},x().text("Pivot profiles")),c().createElement("div",{className:f.divider}),c().createElement("div",{className:f.headerCount},x().number(o,"0,0")+" "+(1===o?x().text("item"):x().text("items")))),E&&c().createElement("div",{className:f.entityTypeLabel},n.label),c().createElement("div",{className:f.body},a.map((e=>c().createElement("div",{key:e.uri,className:f.entityContainer},c().createElement(bt,{entity:e,avatarClassName:f.profileIcon}),c().createElement(ve.Z,{className:f.entityLabel,value:(0,u.wwR)(e)},(0,u.idV)(e.label)))))),v&&c().createElement("div",{className:f.footer},c().createElement("a",{className:f.seeAllButton,onClick:()=>{const e=Array.isArray(t)?t.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,u.nIW)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,t);m(h.ui.actions.openPivotingPerspective({value:e,attributeType:r}))}},x().text("See all"))))},wt=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const l=xt(),o=yt(),i=(0,s.useContext)(w)||[],p=(0,u.QZu)(r),d=(0,g.useSelector)(h.ZP.selectors.getMetadata)||{},m=p?dt(r,t.value,i,d):gt(t.lookupCode||t.value,r),f=i.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(m)&&m.length||!Array.isArray(m)&&!(0,N.isNil)(m)),b=i.find((e=>{let{uri:t}=e;return t===r.uri}));return f?c().createElement(le.ZP,{interactive:!0,arrow:!0,placement:"right-start",classes:l,title:c().createElement(Et,{value:m,attributeType:r,config:b.popup})},c().createElement("span",{className:a},c().createElement(ft,{className:o.icon}),c().createElement("span",{className:o.content},n))):c().createElement(c().Fragment,null,n)};let Ct;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Ct||(Ct={}));const Ot={[Ct.insertAttribute]:{color:"#599E0E"},[Ct.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Ct.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Tt=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Ct.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Ct.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Ct.deleteAttribute;default:return""}},St="/",kt=(0,N.pipe)((0,N.split)(St),(0,N.propSatisfies)((0,N.lte)(2),"length")),Nt=(0,N.pipe)((0,N.split)(St),(0,N.slice)(0,-2),(0,N.join)(St)),It=(0,N.curry)(((e,t)=>(0,N.cond)([[(0,N.has)(e),(0,N.prop)(e)],[()=>kt(e),It(Nt(e))]])(t))),Pt=e=>(0,N.pipe)(N.keys,(0,N.any)((0,N.startsWith)(e+St))),Dt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=It(e,t);return(0,N.isNil)(r)?Pt(e)(t)?"UPDATE_ATTRIBUTE":"":r},At=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]};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){jt(e,t,r[t])}))}return e}function jt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zt=(0,T.Z)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:Rt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.updateAttribute]),insertAttribute:Rt({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:Rt({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},Ot[Ct.deleteAttribute]),multilineAttribute:{width:"fit-content"}}),Lt=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const l=Zt(),{appearance:o}=(0,s.useContext)(ct),i=Dt(n.uri,o),p=Tt(i),d=c().createElement(at.Z,{value:(0,u.kDl)(n),dataTypeDefinition:(0,u.PFL)(r)});return a||p?c().createElement("div",{className:t},c().createElement(wt,{value:n,attributeType:r,key:n.uri,className:b()({[l.multilineAttribute]:!a})},c().createElement("span",{className:l[p]},d))):c().createElement("div",{className:b()(t,l.root,J)},c().createElement(wt,{value:n,attributeType:r,key:n.uri},c().createElement("span",{className:l.attributeValue},d)),c().createElement(et,{className:l.commentsContainer,uri:n.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:n.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var _t=r(40435),Mt=r(98989);const Vt=(0,T.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function Bt(){return Bt=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},Bt.apply(this,arguments)}const Ut=e=>{const t=Vt(),{expanded:r,className:n}=e,a=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,["expanded","className"]);return c().createElement(_t.Z,Bt({icon:Mt.Z,size:"XXS",disableRipple:!0,iconClassName:b()(t.expandIcon,{[t.expanded]:r}),className:b()(n,t.expandButton)},a))},zt=(0,T.Z)({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",paddingTop:"1px",marginLeft:"2px"},spacer:{flex:1}}),Ft=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:l,showNonOv:o}=e;const i=zt(),p=r.uri,[d,m]=(0,s.useState)(!1);(0,s.useEffect)((()=>{m(a)}),[a]);const g=(t||[]).some((e=>(0,u.kQw)(e))),h=(0,s.useMemo)((()=>({attributes:g?null:r.value,analyticsAttributes:g?r.value:null})),[r,g]);return c().createElement("div",{className:i.complexContainer},c().createElement("div",{className:b()(i.labelContainer,J)},c().createElement(Ut,{onClick:()=>m((e=>!e)),expanded:d}),c().createElement(E.Z,{component:"span",variant:"body2",classes:{body2:i.label}},n),c().createElement("div",{className:i.spacer}),c().createElement(et,{uri:r.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:r.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE})),d&&c().createElement(ni,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},l))};Ft.propTypes={children:U().node,label:U().oneOfType([U().string,U().node]),attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp]),expanded:U().bool,showNonOv:U().bool};const Ht=Ft;function Wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qt(e,t,r[t])}))}return e}function qt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gt=(0,T.Z)({label:{textDecoration:"none"},updateAttribute:Wt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.updateAttribute]),insertAttribute:Wt({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:Wt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function $t(){return $t=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},$t.apply(this,arguments)}const Yt=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=Gt(),{appearance:l}=(0,s.useContext)(ct),o=(0,s.useMemo)((()=>{const e=Dt(t.uri,l),n=Tt(e),o=t.label?t.label:(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(wt,{className:a.pivotingTooltip,value:t,attributeType:r},c().createElement(v.Z,{component:"span",className:b()(a[n],a.label)},(0,u.idV)(o)))}),[l,a,t,r]);return c().createElement(Ht,$t({label:o,attributeValue:t,attributeTypesList:(0,u.EUG)({},r)},n))};Yt.propTypes=u.j2V;const Kt=(0,s.memo)(Yt);function Xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qt(e,t,r[t])}))}return e}function Qt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jt=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:Xt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.updateAttribute]),insertAttribute:Xt({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:Xt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.deleteAttribute])})));function er(){return er=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},er.apply(this,arguments)}const tr=e=>{let{attributeValue:t,metadata:r,attributeType:n,uiPath: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,["attributeValue","metadata","attributeType","uiPath"]);const o=Jt(),i=(0,u.bwT)(t),p=(0,s.useMemo)((()=>(0,u.EUG)(r,n)),[n,r]),{appearance:d}=(0,s.useContext)(ct),m=(0,s.useMemo)((()=>{const e=Dt(t.uri,d),r=Tt(e);return c().createElement("a",{href:(0,u.O27)(d)?(0,u.ChB)({uiPath:a,uri:i}):void 0,className:b()(o.label,o[r])},(0,u.idV)(t.label),t.relationshipLabel&&c().createElement("span",{className:o.relationshipLabel},t.relationshipLabel))}),[t.uri,t.label,t.relationshipLabel,d,i,o,a]);return c().createElement(Ht,er({attributeTypesList:p,attributeValue:t,label:m},l))};tr.propTypes=u.NkU;const rr=(0,s.memo)(tr),nr=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e),uiPath:h.ZP.selectors.getUIPath(e)})))(rr),ar=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case u.oS0.TYPE_NESTED:return c().createElement(Kt,t);case u.oS0.TYPE_REFERENCE:return c().createElement(nr,t);default:return c().createElement(Lt,t)}}}.build(t,e)},lr=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showNonOv:o,totalNonVisibleValues:i}=e;const s=M(),{label:p}=n;return c().createElement("div",{className:b()(s.collaborationWrapper,J)},c().createElement("div",{className:b()(s.titleRow,s.wrapper)},c().createElement(Q,{label:p,className:b()(s.title,a),attributeType:n}),c().createElement(st,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:i}),c().createElement(ar,{className:b()(s.attribute,l),attributeValue:t,attributeType:n,showNonOv:o,inlined:!0})),c().createElement(et,{uri:t.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:t.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var or=r(4426);const ir=(0,T.Z)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}}),sr=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},c().createElement(or.Z,{className:a["svg-icon__root"]}),t&&r?x().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):x().text("Show more"))};var cr=r(96971);const ur=e=>{let{onClick:t}=e;const r=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},c().createElement(cr.Z,{className:r["svg-icon__root"]}),x().text("Show less"))},pr=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:o,requestNextPageOfAttributeValues:i,titleClassName:u,contentClassName:p,showNonOv:d,totalNonVisibleValues:m}=e;const g=V(),[h,f]=(0,s.useState)(t),y=t<a,x=y&&h<a,v=y&&h>=a,{label:E}=l,w=r.slice(0,h),C=a-h;return c().createElement("div",{className:g.wrapper},c().createElement("div",{className:g.titleRow},c().createElement(Q,{label:E,className:b()(g.title,u),attributeType:l}),c().createElement(st,{nonOvValues:n,attributeType:l,className:g.ovIcon,nonOvTotal:m})),c().createElement("div",{className:g.attributes},w.map((e=>c().createElement(ar,{key:e.uri,className:b()(g.attribute,p),attributeValue:e,attributeType:l,showNonOv:d})))),x&&c().createElement(sr,{moreNumber:(0,N.min)(t,C),valueNumber:C,onClick:()=>{r.length<a&&i({parentUri:o,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),f(h+t)}}),v&&c().createElement(ur,{onClick:()=>{f(t)}}))};var dr=r(80079);function mr(){return mr=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},mr.apply(this,arguments)}const gr=e=>c().createElement("svg",mr({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("path",{d:"M0 0h24v24H0z"}),c().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"}))),hr=(0,T.Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function fr(){return fr=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},fr.apply(this,arguments)}const br="loading",yr="loaded",xr="error",vr={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},Er=(0,s.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=vr.SMALL,overlay:l=null}=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,["src","className","containerClassName","size","overlay"]),i=a||vr.SMALL,p=hr(i),[d,m]=(0,s.useState)(br);(0,s.useEffect)((()=>{m(br)}),[t]);const g=d===br,h=d===yr;return d===xr?c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(dr.Z,{className:p.defaultImage})):c().createElement("div",{className:b()(p.root,n)},!(0,u.O27)(t)&&c().createElement("img",fr({src:t,className:b()(p.image,r,{[p.hideImage]:g}),onLoad:()=>{m(yr)},onError:()=>{m(xr)},alt:"image"},o)),g&&c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(gr,{className:p.defaultImage})),h&&l)}));var wr=r(88267);const Cr=c().createContext(!1);Cr.displayName="BlockImageGalleryDialogContext";var Or=r(45203),Tr=r(15762);const Sr=(0,T.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}})));var kr=r(60905);const Nr=(0,T.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),Ir=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=Nr(),l=(0,s.useRef)(null);return(0,s.useEffect)((()=>{if(null!=l&&l.current){const e=l.current.scrollLeft,t=l.current.offsetWidth+e,r=96*n+16*n+12;t<r?l.current.scroll&&(r>t+96+16?l.current.scroll(r,0):l.current.scroll(112+e,0)):e+96>r&&l.current.scroll&&l.current.scroll(r-96,0)}}),[n,l]),c().createElement("div",{ref:l,className:a.thumbnails},c().createElement(kr.Z,{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:l,value:o}=e;return c().createElement(kr.Z,{item:!0,key:l},c().createElement(Er,{onClick:()=>r(t),className:b()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,u.efz)({value:o})}))}))))},Pr=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const l=Sr(),o=r[n],i=(0,u.QXK)(o);return c().createElement("div",{className:b()(l.root,t)},c().createElement("div",{className:l.main},n>0&&c().createElement(_t.Z,{icon:Or.Z,className:b()(l.arrowButton,l.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),c().createElement(Er,{containerClassName:l.mainImageContainer,className:l.mainImage,size:i&&vr.OVERRIDE,src:i}),n!==r.length-1&&c().createElement(_t.Z,{icon:Tr.Z,className:b()(l.arrowButton,l.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),c().createElement(Ir,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Dr=r(21324),Ar=r(5806),Rr=r(33016),jr=r(36138),Zr=r(85256);const Lr=(0,T.Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}});var _r=r(79784);const Mr=(0,T.Z)((()=>({container:e=>{let{containerHeight:t=553,containerWidth:r}=e;return{display:"flex",flexDirection:"column",height:t,width:r,flexGrow:1}},header:{marginLeft:"16px",marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:"0 16px 12px 16px",flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));var Vr=r(33662);const Br=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:l,headerPlacement:o="top",containerWidth:i,containerHeight:s,searchInputOnKeyDown:u,children:p,searchInputRef:d}=e,m=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,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef"]);const g=Mr({containerWidth:i,containerHeight:s}),h=c().createElement(c().Fragment,null,!a&&c().createElement("div",{className:g.header},t),!l&&c().createElement(Vr.Z,{onSearch:n,autofocus:!0,onKeyDown:u,inputRef:d,classes:{root:g.searchInputContainer},placeholder:x().text("Search & add attributes"),height:40}));return c().createElement(_r.ZP,m,c().createElement("div",{className:b()(g.container,r),style:{width:i}},"top"===o&&h,c().createElement("div",{className:g.list},p),"bottom"===o&&h))};Br.propTypes={className:U().string,title:U().string,headerPlacement:U().oneOf(["top","bottom"]),onSearch:U().func,searchInputOnKeyDown:U().func,containerWidth:U().number,containerHeight:U().number,hideTitle:U().bool,hideSearchInput:U().bool,searchInputRef:U().shape({current:U().instanceOf(Element)}),children:U().node},Br.defaultProps={anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};const Ur=Br,zr=e=>{const t=e=>(0,N.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let r=null;return t(e).map(((e,t)=>(e&&e.items&&(r=t),{item:e,index:t,titleItemIndex:r})))};var Fr=r(50166);const Hr=(0,T.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Wr=e=>e.titleItemIndex===e.index,qr=e=>{let{items:t,getItemSize:r,renderItem:n,renderGroupTitle:a,width:l="100%",height:o,fixedTitle:i=!0,itemKey:u=(e=>e),disableHorizontalScrollbar:p,hideSubtitles:d,focusIndex:m=null,onInnerContainerResize:g}=e;const h=Hr(),f=(0,s.useRef)(null),b=(0,s.useRef)(null),y=(0,s.useRef)(null),x=(0,s.useRef)([0]),v={topMargin:0},E=(0,s.useMemo)((()=>!d||(t||[]).some((e=>null!==e.titleItemIndex))),[t,d]),w=(0,s.useCallback)((e=>{const n=x.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const l=n+t-1;t>0&&(x.current[l]=x.current[l-1]+a),a=r(l,e.item)}))}),[r,t]),C=(0,s.useCallback)((e=>t[e].titleItemIndex),[t]),O=(0,s.useCallback)((e=>t[e]),[t]);(0,s.useEffect)((()=>{requestAnimationFrame((()=>{f.current&&f.current.scrollTo(0)}))}),[t.length]),(0,s.useEffect)((()=>{f.current&&f.current.resetAfterIndex(0),T();const e=(e=>{const t=e.findIndex((e=>e.item.moveTo));if(t>-1){w(t);const e=C(t);return{offset:x.current[t],titleHeight:r(e,O(e).item)}}})(t);if(e&&e.offset&&f.current){const{titleHeight:t}=e,r=e.offset-t;(r<f.current.state.scrollOffset||r>f.current.state.scrollOffset+o)&&requestAnimationFrame((()=>{f.current&&f.current.scrollTo(r-(o-t)/2)}))}}),[w,O,r,C,o,x,t,f]);const T=()=>{y.current&&b.current&&(y.current.style.width=b.current.offsetWidth+"px")},S=(0,s.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{w(a+10);const l=x.current[a+1];return e>=n&&e<l&&(r={index:a,offset:n,listItem:t}),n=l,r})),r}),[w,x,t]),k=(0,s.useCallback)((e=>r(e,O(e).item)),[O,r]),N=(0,s.useCallback)((e=>{let{index:t,style:r,data:l}=e;const o=O(t);return o.item&&(Wr(o)&&a(r,o.item)||n(r,o.item,t,l))}),[O,a,n]),{handleOnItemsRendered:I}=(e=>{let{focusIndex:t,listRef:r,items:n}=e;const a=(0,s.useRef)(null),l=(0,s.useRef)(null),o=(0,s.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,l.current=r}),[]);return(0,s.useEffect)((()=>{r.current&&null!==t&&0!==n.length&&(t<Math.max(a.current+3,0)?r.current.scrollToItem(Math.max(t-3,0),"start"):t>Math.min(l.current-3,n.length-1)&&r.current.scrollToItem(Math.min(t+3,n.length-1),"end"))}),[t,n.length,r]),{handleOnItemsRendered:o}})({items:t,focusIndex:m,listRef:f}),P=(0,s.useCallback)((()=>t.filter((e=>Wr(e))).map((e=>(e=>c().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},a({height:r(e.index,e.item)},e.item)))(e)))),[r,t,a]);return c().createElement(c().Fragment,null,c().createElement("div",{ref:y,className:h.stickyTitlesWrapper},i&&P()),g&&b.current&&c().createElement(wr.Z,{handleHeight:!0,onResize:g,targetDomEl:b.current}),c().createElement(Fr.VariableSizeList,{ref:f,itemCount:t.length,itemSize:k,width:l,height:o,itemKey:u,innerRef:b,onScroll:e=>{let{scrollOffset:n,scrollDirection:a}=e;if(!i||!E)return;const l=S(n),o=l&&C(l.index);var s;null!==o&&(s=o,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===s.toString()?(e.style.visibility="visible",v.index=s):e.style.visibility="hidden"}))),T();const c=null!==o&&r(o,O(o).item),u=S(n+c+v.topMargin);let p=0;if(u){switch(a){case"forward":u.offset-n>0&&Wr(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>Wr(e)&&d<t))),r=(e=>(w(e),x.current[e]))(e);e>-1&&n<r&&c>=r-n&&(p=c-(r-n))}}(e=>{y.current&&(v.topMargin=-e,y.current.style.top=-e+"px")})(p)}var d},style:p?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:I},N))};qr.propTypes={items:U().arrayOf(U().object).isRequired,getItemSize:U().func.isRequired,renderItem:U().func.isRequired,width:U().oneOfType([U().number,U().string]),height:U().number.isRequired,renderGroupTitle:U().func,fixedTitle:U().bool,hideSubtitles:U().bool,itemKey:U().func,disableHorizontalScrollbar:U().bool,focusIndex:U().number,onInnerContainerResize:U().func};const Gr=qr,$r=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:l}=e;const[o,i]=(0,s.useState)(null),c=(0,s.useRef)(!1),u=(0,s.useCallback)((e=>{let r=null===e?u(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&Wr(t[r]));)r+=1;return r!==t.length?r:u(-1)}),[t]),p=(0,s.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||Wr(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),d=(0,s.useCallback)((()=>{if(!(0,N.isNil)(o)){const e=t[o].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,o]),m=(0,s.useCallback)((e=>{if(0!==t.length)switch(e.key){case"Down":case"ArrowDown":return i(u),e.preventDefault(),!1;case"Up":case"ArrowUp":return i(p),e.preventDefault(),!1;case"Enter":c.current=!0,d();break;case"Tab":l&&l(e);break;default:return}}),[t,u,p,d,l]);return(0,s.useEffect)((()=>{if(c.current){c.current=!1;const e=t.findIndex((e=>e.item.moveTo));e>-1&&i(e)}else i(null)}),[t,r,a]),{focusIndex:o,handleKeyDown:m}};var Yr=r(65549);const Kr=(0,T.Z)({highlight:{fontWeight:600}}),Xr=e=>{let{text:t="",highlight:r="",className:n}=e;const a=Kr(),l=r&&t.split(new RegExp(`(${r})`,"gi"));return c().createElement("span",null,r?l.map(((e,t)=>c().createElement("span",{key:t,className:e.toLocaleLowerCase()===r.toLocaleLowerCase()?n||a.highlight:""},e))):t)},Qr=(0,N.curry)(((e,t)=>(0,N.filter)((t=>t.label.toLowerCase().includes(e.toLowerCase())))(t))),Jr=e=>{let{label:t,popupTitle:r=t,data:n,dense:a,onApply:l}=e;const o=Lr(),i=(0,s.useRef)(),[u,p]=(0,s.useState)(!1),[d,g]=(0,s.useState)(""),[h,f]=(0,s.useState)([]),y=(0,s.useCallback)(((e,t)=>{f((0,N.ifElse)((0,N.always)(t),(0,N.append)(e),(0,N.reject)((0,N.propEq)("id",e.id)))(h))}),[h]),x=(0,s.useMemo)((()=>(0,N.pipe)(Qr(d),(0,N.map)((e=>({item:{id:e.uri,label:e.label,attrType:e}}))))(n)),[n,d]),v=(0,s.useMemo)((()=>zr(x)),[x]),E=(0,s.useCallback)((()=>28),[]),w=(0,s.useCallback)((e=>{let{item:t}=e;y(t,(0,N.not)((0,N.any)((0,N.propEq)("id",t.id))(h)))}),[y,h]),{focusIndex:C,handleKeyDown:O}=$r({items:v,open:u,onSelectFocusedItem:w,selectedItems:h}),T=(0,s.useRef)(null);T.current=C;const S=Math.min(255,28*v.length),k=Math.max(140,S+112),I=(0,s.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const l=(0,N.any)((0,N.propEq)("id",n.id))(h),o=T.current===r;return c().createElement(m.Z,{key:n.uri,onClick:y,checked:l,level:a,data:n,label:c().createElement(Xr,{text:n.label,highlight:d}),labelInText:n.label,style:e,isFocused:o,isRequired:!!n.attrType.required,LogoIcon:n.LogoIcon})}),[d,y,h]);return c().createElement("div",{className:b()(o.moreAttributes,{[o.dense]:a})},c().createElement(Le.Z,{color:"primary",onClick:()=>p(!u),ref:i,className:o.moreButton},c().createElement(Yr.Z,{classes:{root:o.icon}}),c().createElement("div",{className:o.buttonLabel},t)),c().createElement(Ur,{open:u,className:b()(o.moreAttributesPopup,o.popupContainer),anchorEl:i.current,onClose:(0,N.pipe)((()=>{h.length>0&&l((0,N.pluck)("attrType",h))}),(()=>p(!1)),(()=>g("")),(()=>f([]))),onSearch:g,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:O},c().createElement(Gr,{getItemSize:E,renderItem:I,items:v,height:S,containerWidth:320,focusIndex:C})))};Jr.propTypes={label:U().string,popupTitle:U().string,data:U().array,dense:U().bool,onApply:U().func};const en=Jr;var tn=r(95038),rn=r.n(tn);const nn={get CreationTime(){return x().text("Creation Time")},get CreationDate(){return x().text("Creation Date")},get Dimensions(){return x().text("Dimensions")},get MimeType(){return x().text("Mime Type")},get Size(){return x().text("Size")},get Url(){return x().text("Full image URL (S3)")},get UrlPreview(){return x().text("Preview image URL (S3)")},get UrlThumbnail(){return x().text("Small image URL (S3)")},get CdnUrl(){return x().text("Full image URL (CDN)")},get CdnUrlPreview(){return x().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return x().text("Small image URL (CDN)")}},an=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,N.path)([t,0,"value"],e):"CreationDate"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?rn()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?rn()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,N.path)(["Height",0,"value"],e)&&(0,N.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${x().text("pixels")}`:"Size"===t&&(0,N.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},ln=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},on=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,l=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?l:l.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},sn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=ln(t.attributes);return on(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},cn=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),un=(0,T.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},canAdd:{}}),pn=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=un(),l=ln(t.attributes),o=Boolean(r);return c().createElement(v.Z,null,c().createElement(E.Z,{className:b()(a.title,{[a.canAdd]:o})},x().text("Meta info")),o&&c().createElement(s.Fragment,null,c().createElement(en,{label:x().text("Attributes"),data:l,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),c().createElement(Zr.Z,{className:a.divider})))},dn=(0,T.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),mn=e=>{let{title:t,content:r,isLink:n,children:a}=e;const l=dn();return c().createElement("div",{className:l.root},c().createElement("span",{className:l.title},t),n?c().createElement("a",{className:l.link,href:r},x().text("link")):c().createElement("span",{className:l.content},r||a))},gn=(0,T.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),hn=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=gn(),l=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),o=(i=t,s=n,on(Object.keys(nn),s).map((e=>an(i,e)?{title:nn[e],value:an(i,e),isLink:cn(e)}:null)).filter(Boolean));var i,s;const u=sn(t,r,n);return c().createElement(v.Z,{className:a.root},o.map((e=>{let{title:t,value:r,isLink:n}=e;return c().createElement(mn,{key:t,isLink:n,title:t,content:r})})),l&&u.map((e=>{let{attrType:r,values:n}=e;return c().createElement(ri,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))};var fn=r(94438),bn=r(52669),yn=r(81556);const xn=(0,T.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),vn=e=>{let{checked:t,className:r,onClick:n}=e;const a=xn(),l=t?yn.Z:bn.Z;return c().createElement(l,{className:b()(a.root,r),onClick:n})};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 wn=e=>c().createElement("svg",En({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),c().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Download_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Download_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var Cn=r(79573);const On=(0,T.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),Tn=(0,s.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:l=Cn.ZT,onSelect:o=Cn.ZT,onShareLink:i,onSetAsDefault:u,onDelete:p,onDownload:d=Cn.ZT,onClick:m}=e,g=On(),[h,f]=(0,s.useState)(!1),y=(0,s.useMemo)((()=>[{text:x().text("Share link"),onClick:i},{text:x().text("Set as default"),onClick:u},{text:x().text("Delete"),onClick:p}].filter((0,N.prop)("onClick"))),[i,u,p]),v=e=>()=>(0,N.ifElse)((0,N.equals)(!0),l,o)(e),E=r&&(n||h||a),w=!a&&!n&&h,C=r&&n;return c().createElement("div",{className:b()(g.overlay,{[g.selected]:n,[g.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?v(n):e=>{e.currentTarget===e.target&&m()}},E&&c().createElement(vn,{className:g.checkedIcon,checked:n,onClick:v(n)}),w&&c().createElement("div",{className:g.actions},c().createElement(_t.Z,{onClick:d,className:g.actionButton,icon:wn}),c().createElement(be.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,className:b()(g.actionButton,g.dropDownMenuButton)},menuItems:y})),C&&c().createElement(Le.Z,{className:g.button,variant:"outlined",onClick:l},x().text("Deselect")))}));var Sn=r(13896),kn=r(58651),Nn=r(8629),In=r(67358);const Pn=(0,T.Z)({loadingOverlay:{position:"absolute",width:"100%",height:"100%",top:0,left:0,opacity:.37,zIndex:10,backgroundColor:"#fff"},transparent:{backgroundColor:"transparent"},relativePosition:{"&$loadingOverlay":{position:"relative"}}}),Dn=e=>{let{transparent:t=!1,relativePosition:r=!1}=e;const n=Pn();return c().createElement(c().Fragment,null,c().createElement("div",{className:b()(n.loadingOverlay,{[n.transparent]:t,[n.relativePosition]:r})},c().createElement(In.Z,{color:"secondary"})))};var An=r(74603);const Rn=(0,T.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),jn=e=>0===e.trim().length,Zn=e=>{let{onSend:t}=e;const r=Rn(),[n,a]=(0,s.useState)(""),[l,o]=(0,s.useState)(null);return c().createElement(v.Z,{className:r.root},c().createElement(Ge.Z,{className:r.paper},c().createElement(An.Z,{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||jn(t)?o(null):o(x().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:x().text("Paste an image URL here")}),c().createElement(Le.Z,{disabled:Boolean(l)||jn(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},x().text("Send"))),l&&c().createElement(E.Z,{className:r.errorMessage},l))};var Ln=r(83997);const _n=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Mn=e=>{let{className:t,onAppendFile:r}=e;return c().createElement(c().Fragment,null,c().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:_n.join(","),id:"upload-image-button",type:"file"}),c().createElement("label",{htmlFor:"upload-image-button"},c().createElement(Le.Z,{className:t,variant:"contained",color:"primary",component:"span"},x().text("Select image"))))};function Vn(){return Vn=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},Vn.apply(this,arguments)}const Bn=e=>c().createElement("svg",Vn({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),c().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},c().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),c().createElement("stop",{stopColor:"#000",offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},c().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),c().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),c().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),c().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),c().createElement("g",{mask:"url(#UploadIcon_svg__b)"},c().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},c().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),c().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),c().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),c().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),c().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),Un=(0,T.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),zn=e=>{let{onAppendFile:t,className:r}=e;const n=Un(),[{canDrop:a,isOver:l},o]=(0,Sn.useDrop)({accept:[Ln.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),i=a&&l;return c().createElement("div",{ref:o,className:b()(n.root,{[n.isActive]:i},r)},c().createElement(Bn,{className:n.icon}),c().createElement(E.Z,{className:n.title},x().text("Drag an image here")),c().createElement(E.Z,{className:n.description},x().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),c().createElement(Mn,{onAppendFile:t}))},Fn=(0,T.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Hn=e=>{let{children:t,className:r}=e;const n=Fn();return c().createElement(v.Z,{className:b()(n.root,r)},c().createElement(v.Z,{className:n.border}),c().createElement(E.Z,{className:n.text},t),c().createElement(v.Z,{className:n.border}))};var Wn=r(87685),qn=r(37265);const Gn=(0,T.Z)({closeIcon:{color:"#fff"}}),$n=e=>{let{error:t,onClose:r}=e;const n=Gn();return c().createElement(qn.Z,{open:Boolean(t),onClose:r,message:t,action:c().createElement(ye.k,{className:n.closeIcon,tooltipTitle:x().text("Close"),icon:Wn.default,onClick:r})})},Yn=(0,T.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}}))),Kn=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=Yn(),l=(0,g.useSelector)(h.ZP.selectors.getImageServicePath),o=(0,g.useSelector)(h.ZP.selectors.getEnvironment),i=(0,g.useSelector)(h.ZP.selectors.getTenant),[p,d]=(0,s.useState)(!1),[m,f]=(0,s.useState)(null),b=e=>{d(!0),(0,u.Ixr)({image:e,imageServicePath:l,environment:o,tenant:i}).then((e=>{n(e),r()})).catch((e=>f(e.errorMessage))).finally((()=>d(!1)))};return c().createElement(Sn.DndProvider,{backend:kn.default},c().createElement(Nn.Z,{open:t,onClose:r,classes:{paper:a.dialogPaper}},c().createElement(E.Z,{className:a.title},x().text("Add new image")),c().createElement(v.Z,{className:a.body},c().createElement(zn,{className:a.targetBox,onAppendFile:e=>{const t=Number((e.size/1024/1024).toFixed(2)),r=_n.includes(e.type);t>20?f(x().text("File size exceeds configured max file size.")):r?b(e):f(x().text("File format is not supported."))}}),c().createElement(Hn,{className:a.divider},x().text("or")),c().createElement(Zn,{onSend:e=>{b(e)}})),p&&c().createElement(Dn,null),c().createElement($n,{error:m,onClose:()=>f(null)})))},Xn={imageMargin:4,imageWidth:vr.SMALL.imageWidth,imageHeight:vr.SMALL.imageHeight},Qn=(0,T.Z)((()=>({root:{width:"100%",marginBottom:"10px"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Jn=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:l,parentUri:o,paging:i,showNonOv:p,imageSize:d=Xn}=e;const m=Qn(d),f=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},b=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntityDefaultProfilePic(e,f.uri))),y=(0,g.useDispatch)(),[x,v]=(0,s.useState)(!1),E=(0,s.useCallback)((()=>{v((e=>!e))}),[]),w=(0,s.useCallback)((e=>{const r=(0,u.hm5)(o,t.name),n={};for(const a in e){const l=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));l&&(n[a]=[{uri:(0,u.hm5)(r,l.name),ov:!0,value:e[a],type:l.uri}])}a({attributeType:t,uri:r,value:n})}),[a,o,t]),C=(0,s.useCallback)((e=>{if(n(e),b===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];y(h.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:f.uri,value:n||{}}))}}),[n,f,b,r]),O=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:l,onSetAsDefault:o}=e,i=(0,u.Q5d)(r),{uri:s}=r;return c().createElement(Tn,{id:s,onShareLink:()=>l(i),onSetAsDefault:()=>o(r),onDelete:()=>C({uri:s,attributeType:t}),onDownload:()=>a([i]),onClick:()=>n(s)})};return c().createElement("div",{className:m.root},c().createElement(_o,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,u.efz)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return c().createElement("div",{className:m.image,key:n},c().createElement(Er,{src:r,overlay:O(e,t),onClick:()=>a(n),size:{imageWidth:d.imageWidth,imageHeight:d.imageHeight}}))},overlay:!0,countFixedItems:1,onUpload:E,onDeleteAttribute:C,imageSize:d,requestNextPageOfAttributeValues:l,paging:i,parentUri:o,showNonOv:p},c().createElement("div",{className:m.uploadContainer,onClick:E},c().createElement(_t.Z,{className:m.uploadButton,iconClassName:m.uploadIcon,icon:fn.Z}))),c().createElement(Kn,{open:x,onUpload:w,onClose:E}))},ea=(0,T.Z)((e=>({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"},caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),ta=e=>{let{className:t,message:r}=e;const n=ea();return r?c().createElement(E.Z,{variant:"caption",className:b()(n.caption,t)},r):null};var ra=r(22983),na=r(65314),aa=r(42494),la=r(74828);function oa(){return oa=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},oa.apply(this,arguments)}const ia=(0,s.memo)((e=>{let{errorMessage:t,children:r,className:n,classes: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,["errorMessage","children","className","classes"]);const o=ea(),i=!!t;return c().createElement(aa.Z,oa({className:b()(o.wrapper,n,null==a?void 0:a.root),error:!0},l),r,i&&c().createElement(la.Z,{className:b()(o.helperText,null==a?void 0:a.helperText)},c().createElement(ta,{message:t})))})),sa=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t}=arguments.length>1?arguments[1]:void 0;const{value:r,lookupCode:n}=e;switch(t){case u.oS0.TYPE_BOOLEAN:case u.oS0.TYPE_BOOLEAN_RADIO:case u.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,u.gxP)(r);case u.oS0.TYPE_DATE:return r&&u.P6Y.dates.toLocalDate(r)||null;case u.oS0.TYPE_LOCAL_DATE:case u.oS0.TYPE_TIMESTAMP:case u.oS0.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case u.oS0.TYPE_DEPENDENT_LOOKUP:case u.oS0.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}},ca=(e,t)=>{const{type:r}=(0,u.PFL)(e);switch(r){case u.oS0.TYPE_BOOLEAN:case u.oS0.TYPE_BOOLEAN_RADIO:case u.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case u.oS0.TYPE_DATE:return t&&rn()(t).format("YYYY-MM-DD")||"";case u.oS0.TYPE_TIMESTAMP:return t&&rn()(t).format()||"";case u.oS0.TYPE_ACTIVENESS_DATE:case u.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},ua=(0,N.curry)(((e,t,r)=>({value:ca(t,r),uri:e.uri,attributeType:t}))),pa=c().createContext({enabled:!1,queueSizeThreshold:0});pa.Provider.propTypes={value:U().shape({enabled:U().bool,queueSizeThreshold:U().number})},pa.displayName="AsyncMountContext";let da=0;const ma=()=>{const e=(0,s.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,s.useContext)(pa),[n,a]=(0,s.useState)(!t||t&&da<r);e.current&&da++;const l=(0,s.useRef)();return(0,s.useEffect)((()=>{if(da--,!n)return l.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(l.current)}),[]),e.current=!1,n};function ga(){return ga=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},ga.apply(this,arguments)}const ha=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,s.forwardRef)(((r,n)=>ma()?c().createElement(e,ga({},r,{ref:n})):t&&c().createElement(t,ga({},r,{ref:n}))));return r.displayName="WithAsyncMount",r};function fa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ba(e,t,r[t])}))}return e}function ba(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ya={},xa=(0,T.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function va(){return va=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},va.apply(this,arguments)}const Ea=e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:l,mode:o,onAddOneMore:i,onDeleteAttribute:s,onChangeAttribute:p,onDeactivateError:d,additionalControlsRenderer:m,state:f}=e,y=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","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state"]);const v=xa(),w="deleted"===f,C="edited"===f,O=(0,u.KIu)(o),T=(0,u.PFL)(n),S=sa(r,T),k=(0,u.Vg3)({attributeType:n,mode:o}),I=(0,u.yv0)({attributeType:n,attributeValue:r,mode:o,isReltioCrosswalk:a}),P=(0,u.xv5)({attributeType:n,attributeValue:r,mode:o,isReltioCrosswalk:a}),D=I&&O,A=(0,u.e$p)(l),R=(0,g.useSelector)((e=>(0,u.QEi)(n)?((e,t,r)=>{const n=h.ZP.selectors.getDependentLookupsStructureNode(e,r);if(n){const o=t.uri,{parents:i,missedParentsAttributeTypes:s}=((e,t,r)=>{const n=r.parents.flatMap((t=>{const r=h.ZP.selectors.getDependentLookupsStructureNode(e,t);return r.values.map((e=>fa({},e,{type:t,dependentLookupCode:r.attrType.dependentLookupCode})))})),a=h.ZP.selectors.getModifiedEntities(e),l=h.ZP.selectors.getEntityUri(e),o=h.ZP.selectors.getAllRelationsToAddAndEdit(e),i=(0,u.vUy)({parentValues:n,valueUri:t,entityUri:l,modifiedEntities:a,connections:o}),s=r.parents.map((t=>h.ZP.selectors.getDependentLookupsStructureNode(e,t).attrType)).filter((e=>!i.some((t=>{let{type:r,value:n}=t;return n&&r===e.uri}))));return{parents:Object.values(i.reduce(((e,t)=>{var r;return fa({},e,{[t.dependentLookupCode]:{type:t.dependentLookupCode,codeValues:(0,N.uniq)([t.value,...(null===(r=e[t.dependentLookupCode])||void 0===r?void 0:r.codeValues)||[]]).filter(Boolean).sort()}})}),{})),missedParentsAttributeTypes:s}})(e,o,n),{isBlocked:c=!1}=h.ZP.selectors.getDependentLookupEditorState(e,o)||{},p=(a=s).length?x().text("Please select value for ${labels} ${attributes}.",{labels:(l=a.map((0,N.pipe)((0,N.prop)("label"),(e=>`'${e}'`))),l.reduce(((e,t,r)=>[e,t].join(r===l.length-1?` ${x().text("and")} `:", ")))),attributes:1===a.length?x().text("attribute"):x().text("attributes")}):"",d=h.ZP.selectors.getLookupAutocomplete(e),m=(0,u.Vmh)(d,r),g=!(null!=t&&t.lookupCode||null!=t&&t.value)&&c&&x().text("Populating values...")||p||"",f={parents:i,disabled:!!p||c,placeholder:g,autopopulationId:m?o:null};return g&&(f.value=null),((e,t)=>{const r=ya[e];return(0,N.equals)(t,r)?r:((0,N.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),ya[e]=t,t)})(o,f)}var a,l})(e,r,null==n?void 0:n.uri):null)),j=()=>{l&&d((0,u.iFp)(l))},Z=!!i&&k&&!n.singleValue,L=!w&&!!s&&P,_=!!A,M=w?{disabled:!0}:{};return c().createElement("div",{className:b()(v.editor,t)},c().createElement(ia,{errorMessage:A,className:v.errorWrapper},c().createElement("div",{className:b()(v["editor-value"],{[v.deleted]:w},{[v["editor-read-only-value"]]:!D})},D?c().createElement(na.Z,va({fieldName:(0,u.Tde)(n.uri),value:S,dataTypeDefinition:T,error:_,onChange:(0,N.pipe)(ua(r,n),p,j),fullWidth:!0},R,y,M)):c().createElement(at.Z,{value:(0,u.kDl)(r),dataTypeDefinition:T}))),c().createElement("div",{className:v["editor-actions"]},C&&c().createElement(E.Z,{variant:"caption",className:v.editedLabel},"(",x().text("edited"),")"),Z&&c().createElement(_t.Z,{icon:Yr.Z,onClick:i,size:"L",className:b()(v.addButton,v.button)}),m&&m({attributeType:n,attributeValue:r}),L&&c().createElement(_t.Z,{className:v.button,icon:ra.Z,onClick:()=>{s({uri:r.uri,attributeType:n}),(0,u.PcX)(l)!==u.NIO.missed&&j()},size:"L"})))};Ea.propTypes={className:U().string,attributeValue:u.cNQ,attributeType:u.EMD,ownError:u.wfT,isReltioCrosswalk:U().bool,state:U().oneOf(["deleted","edited"]),mode:u.XGc,onAddOneMore:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func,onDeactivateError:U().func,additionalControlsRenderer:U().func};const wa=(0,s.memo)(ha(Ea,(()=>{const e=xa();return c().createElement("div",{className:e.placeholder})}))),Ca=(0,T.Z)((e=>({editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}}))),Oa=[u.xPW.roles.uri,u.xPW.tags.uri],Ta=(e,t,r,n)=>{const a=(0,N.pipe)(u.nt9,(0,N.defaultTo)({}),(0,N.props)(["attributes","analyticsAttributes"]),(0,N.reject)(N.isNil),N.flatten,(0,N.concat)(N.__,(0,N.pipe)(N.values,(0,N.reject)((0,N.propEq)("uri",u.xPW.id.uri)))(u.xPW)))(e,t);return r.length?a.filter((e=>{let{uri:t}=e;return r.includes(t)})):a.filter((e=>{let{uri:t}=e;return!n.includes(t)}))},Sa=(e,t)=>(0,N.partition)((0,N.pipe)((0,N.path)(["attrType","uri"]),(0,N.includes)(N.__,e)),t),ka=c().createContext(null);function Na(){return Na=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},Na.apply(this,arguments)}const Ia=e=>{let{attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,drawLines:i,children:p,className:d,alwaysVisibleTypeUris:m=Oa,onAddAttributes:g,onChangeAttribute:h,onDeleteAttribute:f,additionalControlsRenderer:b,showNonOv:y}=e;const{attributes:v={}}=r,E=(0,s.useMemo)((()=>(0,u._kX)(l,t)),[t,l]),w=((e,t)=>e.filter((e=>{const r=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,N.cond)([[u.kqr,(0,N.always)(t)],[(0,N.both)(u.kQw,(0,N.always)(n)),(0,N.always)(n)],[N.T,(0,N.always)(r)]])(e)})(e,t),n=(e=>(0,u.kqr)(e)?"uri":"name")(e);return!((e.singleValue||(0,u.ian)(e)||(0,u.VFZ)(e))&&(0,N.has)(e[n])(r))})))(E,r),C=(0,s.useContext)(ka),O=(0,s.useMemo)((()=>(0,u.Gtj)(t,l,r,a,y,C)),[t,l,r,a,y,C]),[T,S]=(0,s.useMemo)((()=>Sa(m,O)),[O,m]),k=(0,s.useCallback)((e=>{g(e.map((e=>({attributeType:e,parentUri:n}))))}),[g,n]),I={enabled:i};return c().createElement("div",{className:d},p&&c().createElement(D,I,p),c().createElement(D,Na({},I,{plain:!0}),E.length>0&&c().createElement(en,{label:x().text("More attributes"),onApply:k,dense:i,data:w})),S.concat(T).map((e=>{let{attrType:t,values:r}=e;return c().createElement(ro,{key:t.uri,attributeType:t,drawLines:i,values:r,paging:(0,N.path)(["paging",t.uri],v),parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,onAddAttributes:g,onChangeAttribute:h,onDeleteAttribute:f,additionalControlsRenderer:b,showNonOv:y})})))};Ia.propTypes={attrTypes:U().array,entity:U().object,parentUri:U().string,children:U().node,showEmptyEditors:U().bool,mode:u.XGc,crosswalks:U().array,drawLines:U().bool,showNonOv:U().bool,className:U().string,alwaysVisibleTypeUris:U().array,onAddAttributes:U().func,onChangeAttribute:U().func,onDeleteAttribute:U().func,additionalControlsRenderer:U().func};const Pa=(0,s.memo)(Ia);function Da(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Aa=e=>{let{label:t,attributeTypesList:r,attributeType:n,attributeValue:a,children:l,errors:o,ownError:i,mode:p,metadata:d,crosswalks:m,lazy:g,showEmptyEditors:h,onAddOneMore:f,onAddAttributes:y,onDeleteAttribute:v,onChangeAttribute:w,additionalControlsRenderer:C,hideDeleteButton:O,state:T,showNonOv:S}=e;const k=Ca(),N="deleted"===T,I="edited"===T,P=a.uri,D=(0,u.ZiX)(P),[A,R]=(0,s.useState)(D),j=(0,s.useMemo)((()=>(0,u.xv5)({attributeType:n,attributeValue:a,mode:p,metadata:d,isReltioCrosswalk:(0,u.KVV)(m,a)})),[n,a,p,d,m]),Z=!N&&!O&&!!v&&j,L=(0,s.useMemo)((()=>(0,u.J6q)(a,o)),[o,a]);(0,s.useEffect)((()=>{L&&R(!0)}),[o,L]),(0,s.useEffect)((()=>{N&&R(!1)}),[N]);const _=(r||[]).some((e=>(0,u.kQw)(e))),M=(0,s.useMemo)((()=>({attributes:_?null:a.value,analyticsAttributes:_?a.value:null})),[a,_]),V=(0,u.e$p)(i)||L&&x().text("Has an incorrect value")||"";return g?c().createElement(Le.Z,{variant:"text",color:"primary",onClick:f},"Create attribute"):c().createElement(c().Fragment,null,c().createElement("div",{className:k.editor},c().createElement("div",{className:k.titleContainer},c().createElement(Ut,{onClick:()=>R((e=>!e)),expanded:A,className:k.expandButton,disabled:N}),c().createElement(ia,{errorMessage:V,classes:{helperText:k.errorWrapperHelperText}},c().createElement("div",{className:b()(k.label,{[k.deleted]:N})},t))),c().createElement("div",{className:k.actions},I&&c().createElement(E.Z,{variant:"caption",className:k.editedLabel},"(",x().text("edited"),")"),C&&C({attributeType:n,attributeValue:a}),Z&&c().createElement(_t.Z,{icon:ra.Z,onClick:()=>v({uri:P,attributeType:n,attributeValue:a}),size:"L"}))),A&&c().createElement(Pa,{attrTypes:r,entity:M,showEmptyEditors:h||D,drawLines:!0,parentUri:P,mode:p,crosswalks:m,onAddAttributes:y,onChangeAttribute:w,onDeleteAttribute:v,additionalControlsRenderer:C,showNonOv:S},l))};Aa.propTypes=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){Da(e,t,r[t])}))}return e}({label:U().string,children:U().node,attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp])},u.KVe);const Ra=Aa;function ja(){return ja=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},ja.apply(this,arguments)}const Za=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(Ra,ja({label:(0,u.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};Za.propTypes=u.j2V;const La=(0,s.memo)(Za);var _a=r(84425),Ma=r(42662),Va=r(12231);const Ba=(0,T.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}}),Ua=(0,T.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none"}}))),za=(0,T.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),Fa=(0,T.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function Ha(){return Ha=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},Ha.apply(this,arguments)}const Wa=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=Ba(),{uri:o,entityType:i,label:s,secondaryLabel:u}=a;return""!==o?c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:i})},r),c().createElement(Ma.Z,{className:l.entityAvatar,entityType:i}),c().createElement("span",{className:l.entityLabel},s,u&&c().createElement("span",{className:l.entitySecondaryLabel},", ",u))):c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o},r,{disabled:!0}),c().createElement("span",{className:l.emptyEntityLabel},x().text("No results found")))};Wa.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({uri:U().string.isRequired,label:U().string.isRequired,entityType:u.pyR.isRequired})};const qa=Wa;var Ga=r(12212);const $a=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:l}=e,o=Ua(),i=(0,g.useDispatch)(),p=(0,s.useContext)(Ga.m),d=(0,g.useSelector)(h.ZP.selectors.getUIPath),m=(0,u.ZiX)(l.entityUri)?{className:o.singleValue,component:"span"}:{className:b()(o.singleValue,o.linkValue),onMouseDown:e=>{e.stopPropagation(),n||(0,N.pipe)((0,N.always)({uri:l.entityUri,viewId:p}),h.ui.actions.openEntity,i)()},onClick:e=>e.preventDefault(),href:(0,u.ChB)({uiPath:d,uri:l.entityUri}),component:"a"};return!r&&c().createElement(E.Z,m,(0,u.ZiX)(l.entityUri)?x().text(`New ${t.label} will be created`):(0,u.idV)(a))};$a.propTypes={children:U().string,data:U().object.isRequired,selectProps:U().object.isRequired};const Ya=$a;var Ka=r(33375),Xa=r(61837);const Qa=e=>{const{selectProps:{onClear:t}}=e,r=Fa();return c().createElement(Xa.Z,{onClick:t},c().createElement(Ka.Z,{className:r.clearIcon}))};Qa.propTypes={selectProps:U().object.isRequired};const Ja=Qa,el=e=>e&&e.attributes,tl=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=el,mode:a,onAddAttributes:l,onDeleteAttribute:o,onChangeAttribute:i}=e;const u=(0,s.useMemo)((()=>n(r)),[n,r]);return t?c().createElement(Pa,{key:t.uri,attrTypes:u,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:l,onChangeAttribute:i,onDeleteAttribute:o}):null};tl.propTypes={entityUri:U().string,parentUri:U().string,entity:U().object,entityType:U().object,attributeTypesSelectionStrategy:U().func,mode:u.XGc,onAddAttributes:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func};const rl=tl,nl={onAddAttributes:h.N5.actions.addAttributes,onDeleteAttribute:h.N5.actions.removeAttribute,onChangeAttribute:h.N5.actions.modifyAttribute},al=(0,g.connect)(((e,t)=>({entity:t.entityUri&&h.ZP.selectors.getModifiedEntity(e,t.entityUri)})),nl)(rl);var ll=r(92391);const{Group:ol}=ll.F,il=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,l=za();return c().createElement(ol,e,c().createElement("div",{className:l.groupHeading},c().createElement("span",null,n.label),r&&c().createElement("span",{onClick:()=>r(t,n.entityType),className:l.addLabel},c().createElement(Yr.Z,{className:l.addIcon}),x().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};il.propTypes={selectProps:U().object.isRequired,data:U().object,children:U().array};const sl=il,cl=(0,T.Z)({creatorWrapper:{marginTop:"20px"}});function ul(){return ul=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},ul.apply(this,arguments)}function pl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dl(e,t,r[t])}))}return e}function dl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ml=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a,onChange:l,onCreate:o,metadata:i,globalSearchRequestOptions:p,attributeTypesSelectionStrategy:d,disableLinkClick:m}=e,g=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,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const h=cl(),[f,b]=(0,s.useState)(""),y=(0,s.useMemo)((()=>r.map((e=>(0,u.nt9)(i,e)))),[r,i]),v=[{filter:"equals",fieldName:"type",values:r.map(u.nIW)}],E=pl({},p,{max:a}),w=o?(e,t)=>{o(t||r[0],e),b("")}:void 0,C=e=>{null!==e&&(b(""),l(e))},O=(0,s.useMemo)((()=>1!==y.length),[y]),T=((0,N.isEmpty)(t)?y[0]:(0,u.nt9)(i,t.entityType))||{},S=o&&x().text(`Create ${f?`"${f}" as `:""}new ${T.label}`),k=x().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),I=!(0,N.isEmpty)(t)&&(0,u.ZiX)(t.entityUri),P=O?{Group:sl,GroupHeading:Cn.Vd}:{},D=I?{ClearIndicator:Ja}:{};return c().createElement(c().Fragment,null,c().createElement(_a.Z,ul({value:(0,N.isEmpty)(t)?void 0:t,inputValue:f,onInputChange:e=>{b(e)},getOptions:e=>(0,u.ZOr)(v,E,e).then((e=>t=>{const r=t.map((t=>pl({},t,{label:(0,u.idV)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),n=e=>(0,N.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e;return e.length>1?e.map((e=>({label:e.label,entityType:e.uri,options:n(r.filter((t=>t.type===e.uri)))}))):n(r)})(y)),getOptionLabel:(0,N.prop)("entityLabel"),onChange:C,onCreate:w,onClear:()=>{C({})},label:k,createLabel:S,components:pl({Option:qa,SingleValue:Ya},P,D),currentEntityType:T,isClearable:!0,disableLinkClick:m},g)),I&&c().createElement("div",{className:h.creatorWrapper},c().createElement(al,{mode:n,attributeTypesSelectionStrategy:d,entityType:T,entityUri:t.entityUri})))};ml.propTypes={entity:u.oZZ,entityTypesUris:U().arrayOf(U().string),max:U().number,mode:u.XGc,dispatch:U().func,metadata:u.pGS,onChange:U().func.isRequired,onCreate:U().func,attributeTypesSelectionStrategy:U().func,globalSearchRequestOptions:U().object,disableLinkClick:U().bool};const gl=ml,hl=(0,T.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function fl(){return fl=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},fl.apply(this,arguments)}function bl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yl(e,t,r[t])}))}return e}function yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xl=e=>{const t=hl(),{modifiedEntity:r,metadata:n,globalSearchRequestOptions:a,onDeleteModifiedEntity:l,onUpdateModifiedEntity:o,onDeactivateError:i}=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,["modifiedEntity","metadata","globalSearchRequestOptions","onDeleteModifiedEntity","onUpdateModifiedEntity","onDeactivateError"]),{attributeValue:d,attributeType:m,mode:g,crosswalks:h,errors:f,onChangeAttribute:y}=p,x=(0,s.useRef)(d),v=(0,u.CZ8)(d),E=(0,u.o96)(d),w=(0,u.Poc)(m),C=(0,u.nt9)(n,w),O=r?(0,u.Kxm)(r,C.dataLabelPattern):d.label,T=(0,s.useMemo)((()=>[w]),[w]),S=(0,s.useMemo)((()=>(0,u.EtK)(h,E)),[h,E]),k=(0,s.useMemo)((()=>(0,u.mbo)(d,f)),[d,f]),I=(0,s.useMemo)((()=>v&&{entityUri:(0,u.ZTM)(v),entityType:(0,u.uGi)(v),entityLabel:d.label}),[v,d.label]),P=(0,s.useMemo)((()=>(0,u.tF$)(m).map((e=>(0,u.zeJ)(n,e))).filter(N.identity)),[m,n]),D=(0,s.useCallback)((e=>(0,u.ct9)(m,e)),[m]),A=(0,s.useCallback)((e=>{r&&l(r.uri);const t=x.current,n=!(0,N.isEmpty)(e)&&e.uri===(0,u.bwT)(t),a=bl({},d,{label:e.label,refEntity:n?t.refEntity:(0,u.fmQ)(e),refRelation:n?t.refRelation:(0,u.NBq)(d)});y({value:a,attributeType:m,uri:d.uri}),k&&i((0,u.iFp)(k))}),[d,m,r,y,l,i,k]),R=(0,s.useCallback)(((e,t)=>{const r=(0,N.pipe)(D,(0,u._kX)(g))(C),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:n,mode:g});A(a),o(a)}),[D,g,C,n,A,o]),j=(0,s.useMemo)((()=>(0,u.yv0)({attributeType:m,attributeValue:d,mode:g,isReltioCrosswalk:(0,u.KVV)(h,d)})),[m,d,g,h]),Z=(0,s.useMemo)((()=>(0,u.d89)(g,C)),[g,C]),L=(0,u.e$p)(k);return c().createElement(Ra,fl({},p,{label:(0,u.idV)(O),attributeTypesList:P,crosswalks:S,metadata:n}),c().createElement(ia,{errorMessage:L},c().createElement(gl,{className:b()(t.item,{[t.dense]:L||I&&(0,u.ZiX)(I.entityUri)}),entity:I||{},entityTypesUris:T,max:20,globalSearchRequestOptions:a,mode:g,onChange:j?A:void 0,onCreate:Z?R:void 0,metadata:n,attributeTypesSelectionStrategy:D})))};xl.propTypes=bl({},u.NkU,{modifiedEntity:u.pyR,metadata:u.pGS,globalSearchRequestOptions:U().object,onDeleteModifiedEntity:U().func,onUpdateModifiedEntity:U().func,onDeactivateError:U().func});const vl=(0,s.memo)(xl),El={onDeleteModifiedEntity:h.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:h.N5.modifiedEntities.actions.entityCreated,onDeactivateError:h.N5.errors.actions.errorDeactivated},wl=(0,g.connect)(((e,t)=>{const r=(0,u.bwT)(t.attributeValue);return{modifiedEntity:(0,u.ZiX)(r)?h.ZP.selectors.getModifiedEntity(e,r):null,metadata:h.ZP.selectors.getMetadata(e),globalSearchRequestOptions:h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"])}}),El)(vl);function Cl(){return Cl=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},Cl.apply(this,arguments)}const Ol=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showEmptyEditors:r,onAddAttributes:n,lazy:a,errors:l,crosswalks:o,showNonOv:i}=t,s=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}(t,["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv"]);switch(e.type){case u.oS0.TYPE_NESTED:return c().createElement(La,t);case u.oS0.TYPE_REFERENCE:return c().createElement(wl,t);default:return c().createElement(wa,Cl({isReltioCrosswalk:(0,u.KVV)(o,t.attributeValue)},s))}}}.build(t,e)},Tl=(0,T.Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},attributesWrapper:{width:"100%",marginBottom:"10px"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",marginTop:"-1px",textIndent:0},titleWrapper:{flex:1,paddingBottom:"3px"}}))),Sl=e=>x().text("${value}",{value:1===e?x().text("value"):x().text("values")}),kl=(0,N.has)("minValue"),Nl=(0,N.has)("maxValue"),Il=(0,N.pipe)(Nl,N.not),Pl=(0,N.propSatisfies)((e=>1===e),"minValue"),Dl=e=>{let{minValue:t}=e;return x().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Sl(t)})},Al=e=>{let{maxValue:t}=e;return x().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:x().number(t,"0"),maxValueCaption:Sl(t)})},Rl=(0,N.cond)([[N.isNil,(0,N.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return x().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Sl(t)})}],[(0,N.allPass)([Pl,Nl]),Al],[(0,N.allPass)([Pl,Il]),(0,N.always)("")],[(0,N.allPass)([kl,Nl]),e=>{let{minValue:t,maxValue:r}=e;return x().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:Dl({minValue:t}),maxValue:x().number(r,"0"),maxValueCaption:Sl(r)})}],[Nl,Al],[kl,Dl],[N.T,(0,N.always)("")]]),jl=e=>{let{cardinality:t}=e;const r=Tl();return c().createElement(E.Z,{variant:"caption",className:r.caption},Rl(t))};jl.propTypes={cardinality:u.oA3};const Zl=jl,Ll=(0,N.filter)((0,N.propSatisfies)(u.ZiX,"uri")),_l=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:l,drawLines:o,showEmptyEditors:i,errorMessage:p,errors:d,paging:m,crosswalks:g,showNonOv:h,nonVisibleValues:f,onAddAttributes:b,onDeleteAttribute:y,onChangeAttribute:x,onDeactivateError:v,additionalControlsRenderer:E,requestNextPageOfAttributeValues:w}=e;const C=Tl(),[O,T]=(0,s.useState)(t),[S,k]=(0,s.useState)(!1),{label:I,required:P,cardinality:A,name:R,uri:j}=n,Z=(0,u.KIu)(l),L=(0,s.useContext)(ka),_=(0,s.useMemo)((()=>null==L?void 0:L.includes(j)),[j,L]),M=(0,u.O27)(r),V=(!S&&i||P||_)&&M,B=(0,s.useRef)((0,u.gjI)({parentUri:a,attributeType:n})),U=(0,s.useCallback)((()=>{T(O+1);const e={parentUri:a,index:O,attributeType:n};return b(V&&!(0,u.YkM)(n.type)?[e,e]:[e])}),[O,b,a,n,V]),z=(0,s.useCallback)((0,N.pipe)(y,N.T,k),[y,k]);if(M&&!V)return null;if(V&&M&&(r=[B.current]),(0,u.O27)(r))return null;const F=(Ll(r)||[]).length,H=h?"totalValues":"totalOvValues",W=(0,N.ifElse)((0,N.has)(H),(0,N.pipe)((0,N.prop)(H),(0,N.add)(F)),(0,N.always)(r.length))(m),q=null!=m&&m.totalValues?m.totalValues-W:null==f?void 0:f.length,G=t<W,$=G&&O<W,Y=G&&O>=W,K=r.slice(0,O),X=K?K.length-1:0,J=W-O;return c().createElement(D,{enabled:o},c().createElement("div",{className:C.wrapper},c().createElement("div",{className:C.titleWrapper},c().createElement(Q,{label:I,isRequired:P,className:C.title,attributeType:n}),c().createElement(st,{nonOvValues:f,attributeType:n,className:C.ovIcon,nonOvTotal:q})),Z&&c().createElement(Zl,{cardinality:A}),Z&&c().createElement(ta,{message:p,className:C.typeError}),c().createElement("div",{className:C.attributesWrapper},K.map(((e,t)=>c().createElement(Ol,{key:e.uri,attributeValue:e,attributeType:n,lazy:V&&!P,showEmptyEditors:i,errors:d,ownError:(0,u.ADq)(e,t,n.uri,d),mode:l,crosswalks:g,onAddOneMore:X===t?U:null,onAddAttributes:b,onDeleteAttribute:z,onChangeAttribute:x,onDeactivateError:v,additionalControlsRenderer:E}))),$&&c().createElement(sr,{moreNumber:(0,N.min)(t,J),valueNumber:J,onClick:()=>{r.length<W&&w({parentUri:a,attributeTypeUri:j,attributeTypeName:R,values:r,defaultMaxValues:t}),T(O+t)}}),Y&&c().createElement(ur,{onClick:()=>{T(t)}}))))};var Ml=r(90590),Vl=r(92145);const Bl=(0,T.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),Ul={MultiValue:Vl.Z},zl=e=>{let{values:t,onChange:r,onDelete:n}=e;const a=Bl(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,g.useSelector)(h.ZP.selectors.getEntity),i=o.uri,p=(0,u.JvE)(l,o.type).map((e=>({value:e.uri,label:e.label}))),d=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=p.find((0,N.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,u.nIW)(e)}})),m=(0,s.useCallback)((e=>{const t=(null==e?void 0:e.map((0,N.prop)("value")))||[];r({value:t,attributeType:u.xPW.roles,uri:i})}),[i,r]),f=(0,s.useCallback)((()=>{n({uri:i,attributeType:u.xPW.roles})}),[i,n]);return c().createElement("div",{className:a.container},c().createElement(Ml.Z,{label:"",height:40,isMulti:!0,options:p,value:d,onChange:m,components:Ul,classes:a,className:a.roleContainer}),!!n&&c().createElement(_t.Z,{className:a.deleteButton,icon:ra.Z,onClick:f,size:"L"}))};var Fl=r(7766);const Hl=(0,T.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}}),Wl=e=>e?`?filter=${(0,u.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",ql=[{fieldName:"tags",orderType:"reversedCount"}],Gl=e=>(0,u.FK9)({query:Wl(e),body:ql}).then((e=>Object.keys(e.tags))),$l=e=>{let{className:t,values:r,onChange:n,onDelete:a}=e;const l=Hl(),o=(0,g.useSelector)(h.ZP.selectors.getEntityUri),i=(0,s.useCallback)((e=>{n({value:e,attributeType:u.xPW.tags,uri:o})}),[n,o]),p=(0,s.useCallback)((()=>{a({uri:o,attributeType:u.xPW.tags})}),[o,a]);return c().createElement("div",{className:l.container},c().createElement(Fl.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:i,getSuggestions:Gl}),!!a&&c().createElement(_t.Z,{className:l.deleteButton,icon:ra.Z,onClick:p,size:"L"}))};function Yl(){return Yl=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},Yl.apply(this,arguments)}function Kl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xl=e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:l,onDeleteAttribute:o,onChangeAttribute:i,showEmptyEditors:p}=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,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors"]);const m=Tl(),{label:g,required:h,cardinality:f}=r,b=(0,u.KIu)(a),[y,x]=(0,s.useState)(!1),E=(0,s.useCallback)((0,N.pipe)(o,N.T,x),[o,x]),w=(0,u.O27)(t),C=!y&&p&&w,O=(0,s.useRef)((0,u.gjI)({parentUri:n,attributeType:r}));return(0,u.j2U)(r)&&w&&!C?null:c().createElement(v.Z,{className:m.wrapper},c().createElement(Q,{label:g,isRequired:h,className:m.title,attributeType:r}),b&&c().createElement(Zl,{cardinality:f}),b&&c().createElement(ta,{message:l}),c().createElement(v.Z,{className:m.attributesWrapper},(()=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement($l,{values:t,onDelete:E,onChange:i});case u.xPW.roles.uri:return c().createElement(zl,{values:t,onDelete:E,onChange:i});default:{const 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){Kl(e,t,r[t])}))}return e}({},O.current,{value:t[0]||""});return c().createElement(Ol,Yl({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:E,onChangeAttribute:i},d))}}})()))};function Ql(){return Ql=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},Ql.apply(this,arguments)}var Jl;!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Jl||(Jl={}));const eo=(0,s.memo)((e=>{let{values:t,attributeType:r,mode:n=u.ARY.Viewing,crosswalks:a,drawLines:l,paging:o={},parentUri:i,errors:s,errorMessage:p,max:d=1/0,showEmptyEditors:m,showNonOv:g,onAddAttributes:h,onDeleteAttribute:f,onChangeAttribute:b,onDeactivateError:y,additionalControlsRenderer:x,requestNextPageOfAttributeValues:v}=e;const E=Tl(),w=(0,N.partition)(u.OXP),[C,O]=w(t),T=g?t:C,S=g?[]:O,k={errorMessage:p,errors:s,mode:n,parentUri:i,onAddAttributes:h,onDeleteAttribute:f,onChangeAttribute:b,onDeactivateError:y,additionalControlsRenderer:x,showEmptyEditors:m};return(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Jl.special)],[u.Or$,(0,N.always)(Jl.imageLine)],[N.T,(0,N.always)(Jl.default)]])(r)){case Jl.special:return c().createElement(D,{enabled:l},c().createElement(Xl,Ql({values:T,attributeType:r},k)));case Jl.imageLine:return c().createElement(D,{enabled:l},c().createElement("div",{className:E.wrapper},c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(Jn,{attributeValues:T,attributeType:r,paging:o,onDeleteAttribute:f,parentUri:i,onChangeAttribute:b,requestNextPageOfAttributeValues:v,showNonOv:g})));default:return c().createElement(_l,Ql({values:T,attributeType:r,max:d,paging:o,crosswalks:a,drawLines:l,requestNextPageOfAttributeValues:v,showNonOv:g,nonVisibleValues:S},k))}})()})),to={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:h.N5.errors.actions.errorDeactivated},ro=(0,g.connect)(((e,t)=>{let{parentUri:r,attributeType:n,max:a}=t;return{errors:h.ZP.selectors.getActiveErrorsForAttributesPager(e,r,n),errorMessage:(0,u.tQX)(r,n,h.ZP.selectors.getProfileErrors(e)),max:a||h.ZP.selectors.getDefaultMaxValues(e)}}),to)(eo),no=(0,T.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),ao=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:a,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:p,mode:d}=e;const m=no(),g=sn(n,t,r),h=0!==g.length||0===g.length&&a;return c().createElement(v.Z,{className:m.root},c().createElement(v.Z,{className:m.form},g.map((e=>{let{attrType:t,values:r}=e;return c().createElement(ro,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,u.ZiX)(n.uri),mode:d,drawLines:!1,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i})}))),h&&c().createElement(c().Fragment,null,c().createElement(Zr.Z,{className:m.divider}),c().createElement(v.Z,{className:m.actions},c().createElement(Le.Z,{disabled:!a,onClick:s,className:m.cancelButton},x().text("Cancel")),c().createElement(Le.Z,{disabled:!a,onClick:p,color:"primary"},x().text("Apply")))))},lo={palette:{type:"dark",primary:u.rSc.palette.primary,secondary:u.rSc.palette.secondary}},oo=(0,Rr.Z)(lo),io=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const{addAttributes:a,changeAttribute:l,deleteAttribute:o,clearLocalChanges:i,applyLocalChanges:p,attributeValue:d,hasChanges:m}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const n=(0,g.useDispatch)(),a=(0,s.useContext)(Ga.m),[l,o]=(0,s.useState)(t);(0,s.useEffect)((()=>{o(t)}),[t]);const i=!(0,N.equals)(l,t),c=(0,s.useCallback)((e=>{o((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,u.tPT)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),p=(0,s.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;o((e=>(0,u.ww$)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),d=(0,s.useCallback)((e=>{let{attributeType:t,uri:r}=e;o((e=>(0,u.d$I)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:c,changeAttribute:p,deleteAttribute:d,clearLocalChanges:(0,s.useCallback)((()=>{o(t)}),[t]),applyLocalChanges:(0,s.useCallback)((()=>{n(h.N5.actions.modifyAttribute({value:l,attributeType:r,uri:l.uri,viewId:a}))}),[l,r,a,n]),attributeValue:l,hasChanges:i}})({attributeType:r,initialAttributeValue:n}),f=(0,g.useSelector)(h.ZP.selectors.getMode),b=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode);return c().createElement(jr.ThemeProvider,{theme:oo},c().createElement(v.Z,null,c().createElement(pn,{attributeType:r,uri:null==d?void 0:d.uri,onAddAttributes:b?a:void 0}),c().createElement(hn,{attributeType:r,attributeValue:d,imageAttributeFieldsOrder:t}),b&&c().createElement(ao,{mode:f,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:d,hasChanges:m,onDeleteAttribute:o,onChangeAttribute:l,onAddAttributes:a,onCancel:i,onApply:p})))},so=(0,T.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),co=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const l=so(),o=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},i=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntity(e,null==o?void 0:o.uri)))||{},u=(0,g.useSelector)(h.ZP.selectors.getIsViewMode)?o:i,p=(0,g.useSelector)(h.ZP.selectors.getImageAttributesFieldsOrder)||{},d=p[null==o?void 0:o.type]||(null==p?void 0:p.default)||{},[m,f]=(0,s.useState)(!1);(0,s.useEffect)((()=>{f((null==u?void 0:u.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,u]);const y=(0,s.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return c().createElement(v.Z,{className:b()(l.root,t)},c().createElement(v.Z,{className:l.header},c().createElement(E.Z,{className:l.headerTitle},x().text("Details"))),c().createElement(v.Z,{className:l.bodyWrapper},c().createElement(v.Z,{className:l.body},c().createElement(Ar.Z,{classes:{root:l.formControlLabel,label:l.checkboxLabel},control:c().createElement(Dr.Z,{className:l.checkbox,checked:m,onChange:y,color:"default"}),label:x().text("Set as default")}),c().createElement(io,{attributeType:a,imageAttributeFieldsOrder:d,attributeValue:r}))))},uo=(0,T.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),po=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:l}=e;const[o,i]=(0,s.useState)(0);(0,s.useEffect)((()=>{u(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const u=(0,s.useCallback)((e=>{var r;i(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),p=uo();return c().createElement(v.Z,{className:p.root},c().createElement(Pr,{attributeValueIndex:o,setAttributeValueIndex:u,attributeValues:t,className:p.main}),c().createElement(co,{handleSetAsDefault:a,attributeValue:t[o],className:p.details,attributeType:l}))};var mo=r(38724),go=r(70331),ho=r(15223),fo=r(73115);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 yo=e=>c().createElement("svg",bo({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:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},c().createElement("mask",{id:"Details_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Details_svg__a"})),c().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"})));var xo=r(38592);const vo=(0,T.Z)((e=>({button:{minWidth:"30px",padding:"8px 8px",justifyContent:"start",fill:"rgba(0,0,0,0.54)",textTransform:"none",borderColor:"rgba(0,0,0,0.12)"},icon:{color:"rgba(0,0,0,0.54)",width:"20px",height:"20px",marginRight:"8px"},title:{fontSize:"13px",lineHeight:"15px",letterSpacing:0},current:{"& $icon":{color:e.palette.primary.main},backgroundColor:(0,rt.U1)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,rt.U1)(e.palette.primary.main,.24)}}}))),Eo=(0,lt.Z)(Le.Z),wo=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:l}=e;const o=vo();return c().createElement(xo.Z,{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:i,Icon:s}=e;return c().createElement(Eo,{key:String(t),className:b()(o.button,{[o.current]:a===t},r.button),tooltipTitle:i,onClick:(u=t,()=>l(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&c().createElement(s,{className:o.icon}),n&&c().createElement("div",{className:o.title},n));var u})))},Co=(0,T.Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let Oo;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(Oo||(Oo={}));const To=e=>{let{open:t,mode:r,children:n,header:a,onClose:l,onChangeMode:o}=e;const i=Co(),u=(0,s.useMemo)((()=>[{id:Oo.GALLERY_MODE,title:x().text("Gallery"),Icon:fo.Z},{id:Oo.DETAILS_MODE,title:x().text("Details"),Icon:yo}]),[]);return c().createElement(Nn.Z,{classes:{paper:i.paper},open:t,BackdropProps:{className:i.backdrop},fullScreen:!0},c().createElement(go.Z,{classes:{colorPrimary:i.appBar}},c().createElement(ho.Z,{className:i.toolbar},c().createElement(v.Z,{className:i.headerLeft},c().createElement(ye.k,{tooltipTitle:x().text("Close"),onClick:l,className:i.closeButton,iconClassName:i.closeIcon,icon:Wn.default}),null==a?void 0:a.left),c().createElement(v.Z,{className:i.headerCenter},c().createElement(wo,{modes:u,modeId:r,onChange:o,className:i.modeSwitcher})),c().createElement(v.Z,{className:i.headerRight},null==a?void 0:a.right))),c().createElement(mo.Z,{className:i.content},n))},So=(0,T.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),ko=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:l,onSetAsDefault:o,onDownload:i,onClickImage:s,onDelete:u}=e;const p=So(),d=e=>c().createElement(Tn,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>a(e),onShareLink:()=>l(e),onSetAsDefault:()=>o(e),onDownload:()=>i(e),onClick:()=>s(e),onDelete:u?()=>u(e):void 0,canBeSelected:!0});return c().createElement(v.Z,{className:p.root},c().createElement(kr.Z,{container:!0},t.map((e=>{let{id:t,src:r}=e;return c().createElement(kr.Z,{key:t,classes:{item:p.item},item:!0},c().createElement(Er,{size:vr.LARGE,onClick:()=>s(t),src:r,overlay:d(t)}))}))))},No=(0,T.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),Io=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const l=No(),o=t.length===r.length;return c().createElement(he.Z,{component:"button",underline:"none",classes:{button:l.selectButton},onClick:o?a:n},o?x().text("Clear selection"):x().text("Select all images"))};var Po=r(35292);const Do=(0,T.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),Ao=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const l=Do();return c().createElement(c().Fragment,null,n&&c().createElement(Le.Z,{variant:"contained",color:"primary",onClick:n,startIcon:c().createElement(fn.Z,null)},x().text("Upload")),t&&n&&c().createElement("div",{className:l.divider}),t&&c().createElement(ye.k,{className:l.downloadButton,tooltipTitle:x().text("Download selected items"),icon:wn,onClick:t}),r&&c().createElement(ye.k,{className:l.shareButton,tooltipTitle:x().text("Copy link"),icon:Po.Z,onClick:r}),a&&c().createElement(ye.k,{className:l.deleteButton,tooltipTitle:x().text("Delete selected items"),icon:ra.Z,onClick:a}))},Ro=e=>{let{attributeValues:t,open:r,onClose:n,currentAttributeValueUri:a,setCurrentAttributeValueUri:l,attributeType:o,onDownload:i,onShareLink:p,onSetAsDefault:d,onUpload:m,onDeleteAttribute:f}=e;const[b,y]=(0,s.useState)([]),[x,v]=(0,s.useState)(Oo.GALLERY_MODE),E=(0,g.useSelector)(h.ZP.selectors.getIsViewMode);(0,s.useEffect)((()=>{v(a?Oo.DETAILS_MODE:Oo.GALLERY_MODE)}),[a]);const w=t.map((e=>({src:(0,u.efz)(e),downloadURL:(0,u.Q5d)(e),id:e.uri}))),C=e=>{p(w.find((0,N.propEq)("id",e)).downloadURL)},O=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));d(r)},T=e=>{f({uri:e,attributeType:o})},S=x===Oo.GALLERY_MODE,k=x===Oo.DETAILS_MODE,I=b.length>0,P=k||S&&I,D=!E&&P,A=!E&&(k||S&&!I),R=S&&I&&c().createElement(Io,{items:w,selectedItems:b,onClearAll:()=>{y([])},onSelectAll:()=>{y((0,N.pluck)("id",w))}}),j=c().createElement(Ao,{onDelete:D?()=>{(S?b:[a]).forEach((e=>{T(e)})),b.length&&y([])}:void 0,onDownload:P?()=>{const e=S?(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return b.includes(t)})),(0,N.pluck)("downloadURL"))(w):[w.find((0,N.propEq)("id",a)).downloadURL];i(e)}:void 0,onShare:k?()=>{C(a)}:void 0,onUpload:A?m:void 0});return c().createElement(To,{mode:x,open:r,onChangeMode:v,header:{left:R,right:j},onClose:n},S&&c().createElement(ko,{items:w,selectedItems:b,onSelectImage:e=>{y((t=>[...t,e]))},onDeselectImage:e=>{y((t=>t.filter((t=>t!==e))))},onShareLink:C,onSetAsDefault:O,onDownload:e=>{i([w.find((0,N.propEq)("id",e)).downloadURL])},onClickImage:e=>{l(e),v(Oo.DETAILS_MODE)},onDelete:E?void 0:T}),k&&c().createElement(po,{handleSetAsDefault:O,setCurrentAttributeValueUri:l,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))};var jo=r(94079);const Zo=(0,T.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,jo.fade)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function Lo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _o=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:l=0,children:o,onUpload:i,onDeleteAttribute:p,imageSize:d=Xn,paging:m,parentUri:f,showNonOv:b,requestNextPageOfAttributeValues:y}=e;const x=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},v=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),w=(0,g.useDispatch)(),C=Zo(d);(0,s.useEffect)((()=>{if(m&&y){const e=b?m.totalOvValues:m.totalValues;e>r.length&&y({parentUri:f,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[m,y,t,f,r.length,b]);const O=(0,s.useRef)(),[T,S]=(0,s.useState)(0),[k,N]=(0,s.useState)(0),I=(0,s.useContext)(Cr),[P,D]=(0,s.useState)(!1),[A,R]=(0,s.useState)(),j=(0,s.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=d,a=Math.floor((e+t)/(n+t))-l,o=e+t-(a+l)*(n+t)<8;S(a),r.length>a?N(r.length-a+(o?1:0)):N(0)}),[r.length,l,d]),Z=(0,s.useCallback)((e=>{j(e),O.current=e}),[j]);(0,s.useEffect)((()=>{O.current&&j(O.current)}),[r.length,j]);const L=(0,s.useCallback)((e=>{I||(R(e),D(!0))}),[I]),_=(0,s.useCallback)((()=>{D(!1)}),[]),M=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),V=e=>navigator.clipboard.writeText(e),B=(0,s.useCallback)((e=>{v?(0,u.YL3)(x.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&w(h.N5.entity.actions.setDefaultProfilePic(e))})):w(h.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:x.uri,value:e}))}),[v,x.uri,w]),U=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){Lo(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:M,onShareLink:V,onSetAsDefault:B});return c().createElement(c().Fragment,null,c().createElement(wr.Z,{handleWidth:!0,onResize:Z}),c().createElement(Ro,{attributeValues:r,open:P,onClose:_,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:M,onShareLink:V,onSetAsDefault:B,onUpload:i,onDeleteAttribute:p}),c().createElement("div",{className:C.imageBox},o,r.slice(0,T).map(n(U)),k>0&&c().createElement("div",{className:C.moreButtonContainer},c().createElement("div",{className:C.moreButton,onClick:()=>L()},c().createElement(E.Z,{className:C.number},`+${k}`)))))},Mo=(0,T.Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,u.m5F)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:Ot[Ct.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:Ot[Ct.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[Ct.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[Ct.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[Ct.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),Vo=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:l,showNonOv:o,imageSize:i=Xn}=e;const p=Mo(i),{appearance:d}=(0,s.useContext)(ct);return c().createElement(_o,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,u.efz)(e),{uri:n}=e,a=Dt(n,d),l=Tt(a);return c().createElement("div",{className:b()(p.image,{[p[l+"Image"]]:l}),key:n},c().createElement(Er,{onClick:()=>t(n),className:p[l],src:r,size:{imageWidth:i.imageWidth,imageHeight:i.imageHeight}}))}},imageSize:i,requestNextPageOfAttributeValues:l,paging:n,parentUri:a,showNonOv:o})};var Bo=r(20404);const Uo=e=>{let{className:t,values:r,Component:n}=e;return c().createElement("div",{className:t},r.map(((e,t)=>c().createElement(s.Fragment,{key:e},c().createElement(n,{value:e}),t<r.length-1&&", "))))};function zo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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 Ho=(0,T.Z)({insertAttribute:zo({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:zo({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},Ot[Ct.deleteAttribute])}),Wo=e=>{let{value:t}=e;const r=Ho(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{appearance:a}=(0,s.useContext)(ct),l=At("roles",t,a),o=Tt(l);return c().createElement("span",{className:r[o]},(0,u.xqc)(n,t))},qo=e=>{let{className:t,values:r}=e;return c().createElement(Uo,{values:r,className:t,Component:Wo})},Go=e=>{let{value:t}=e;const r=Ho(),n=(0,g.useSelector)(h.ZP.selectors.getUIPath),a=(0,g.useSelector)(h.ZP.selectors.getEntity),{appearance:l}=(0,s.useContext)(ct),o=At("tags",t,l),i=Tt(o);return c().createElement(he.Z,{underline:"none",className:r[i],href:(0,u.hgZ)({uiPath:n,tag:t,entityUri:a.uri})},t)},$o=e=>{let{className:t,values:r}=e;return c().createElement(Uo,{values:r,className:t,Component:Go})},Yo=e=>{let{values:t,attributeType:r}=e;const n=M(),{label:a}=r;return c().createElement("div",{className:b()(n.titleRow,n.wrapper)},(l=n.titleIcon,r.uri===u.xPW.tags.uri?c().createElement(Bo.Z,{className:l}):null),c().createElement(Q,{label:a,className:n.title,attributeType:r}),(e=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement($o,{className:e,values:t});case u.xPW.roles.uri:return c().createElement(qo,{className:e,values:t});default:return c().createElement(ar,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(n.attribute));var l},Ko="oneLine",Xo="multiLine",Qo="imageLine",Jo="special",ei=(0,s.memo)((e=>{let{values:t,attributeType:r,drawLines:n,paging:a={},parentUri:l,max:o=1/0,requestNextPageOfAttributeValues:i,titleClassName:s,contentClassName:p,showNonOv:d}=e;const m=_(),g=(0,N.partition)(u.OXP);if(!t||!t.length)return null;const[h,f]=g(t),y=d?t:h,x=d?[]:f,v=d?"totalValues":"totalOvValues",E=(0,N.ifElse)((0,N.has)(v),(0,N.prop)(v),(0,N.always)(y.length))(a),w=null!=a&&a.totalValues?a.totalValues-E:x.length,C=1===E&&!(0,u.YkM)(r);return c().createElement(D,{enabled:n,className:b()({[m.paddingWrapperWithLines]:n})},c().createElement("div",{className:b()({[m.paddingWrapper]:!n})},(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Jo)],[u.Or$,(0,N.always)(Qo)],[(0,N.always)(C),(0,N.always)(Ko)],[N.T,(0,N.always)(Xo)]])(r)){case Ko:return c().createElement(lr,{value:y[0],nonVisibleValues:x,totalNonVisibleValues:w,attributeType:r,titleClassName:s,contentClassName:p,showNonOv:d});case Xo:return c().createElement(pr,{values:y,nonVisibleValues:x,totalVisibleValues:E,totalNonVisibleValues:w,attributeType:r,parentUri:l,max:o,requestNextPageOfAttributeValues:i,titleClassName:s,contentClassName:p,showNonOv:d});case Qo:return c().createElement(c().Fragment,null,c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(Vo,{attributeValues:y,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:i,showNonOv:d}));case Jo:return c().createElement(Yo,{values:y,attributeType:r})}})()))})),ti={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues},ri=(0,g.connect)(((e,t)=>{let{max:r}=t;return{max:r||h.ZP.selectors.getDefaultMaxValues(e)}}),ti)(ei),ni=(0,s.memo)((e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:l,className:o,max:i,alwaysVisibleTypeUris:p=Oa,showNonOv:d}=e;const[m,g]=(0,s.useState)(i||1/0),h=(0,s.useMemo)((()=>(0,u.fyF)(t,r,d)),[t,r,d]),[f,b]=(0,s.useMemo)((()=>Sa(p,h)),[h,p]),y=b.slice(0,m),x=i&&y.length<b.length,v=i&&y.length>=b.length&&i<y.length,E={enabled:a};return c().createElement("div",{className:o},l&&c().createElement(D,E,l),y.concat(f).map((e=>{let{attrType:t,values:l}=e;return c().createElement(ri,{key:t.uri,attributeType:t,drawLines:a,values:l,paging:(0,N.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:d})})),x&&c().createElement(sr,{onClick:()=>{g(1/0)}}),v&&c().createElement(ur,{onClick:()=>{g(i)}}))})),ai=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),li=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:r={},metadata:n,caption:a="",excludeUris:l=[],includeUris:o=[],attributesCount:i=16}=e;const p=ai(),d=(0,g.useSelector)(h.ZP.selectors.getPivotingAttributes),m=(0,s.useMemo)((()=>Ta(n,r.type,o,l)),[l,o,n,r.type]),f=(0,u.fyF)(m,r).filter((e=>{let{values:t}=e;return!(0,u.O27)(t)})).length>0;return f||!(0,u.O27)(a)?c().createElement(w.Provider,{value:d},c().createElement(C.Z,{className:t},a&&c().createElement(k,{className:p.header,title:a}),c().createElement(v.Z,{className:b()(p.attributesContainer,{[p.noCaption]:!a})},f?c().createElement(ni,{entity:r,attrTypes:m,parentUri:r.uri,drawLines:!1,max:i}):c().createElement(E.Z,{className:p.noData},x().text("No data found"))))):null})),oi=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function ii(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){si(e,t,r[t])}))}return e}function si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ci=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:r={},mode:n,metadata:a,caption:l="",excludeUris:o=[],includeUris:i=[],pinnedAttributes:p}=e;const d=oi(),m=(0,g.useDispatch)(),f=(0,s.useContext)(Ga.m),y=(0,g.useSelector)(h.ZP.selectors.getUserRoles),x=(0,s.useMemo)((()=>(0,u.mC3)(p,y)),[p,y]),E=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntity(e,r.uri)||{})),w=(0,s.useMemo)((()=>Ta(a,E.type,i,o)),[o,i,a,E.type]),O=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,m)(e.map((e=>ii({},e,{viewId:f}))))),[f,m]),T=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,m)(ii({},e,{viewId:f}))),[f,m]),S=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,m)(ii({},e,{viewId:f}))),[f,m]);return c().createElement(C.Z,{className:t},l&&c().createElement(k,{className:d.header,title:l}),c().createElement(v.Z,{className:b()(d.attributesContainer,{[d.noCaption]:!l})},c().createElement(ka.Provider,{value:x},c().createElement(Pa,{entity:E,attrTypes:w,parentUri:E.uri,drawLines:!1,mode:n,showEmptyEditors:(0,u.ZiX)(E.uri),crosswalks:E.crosswalks,onAddAttributes:O,onChangeAttribute:T,onDeleteAttribute:S}))))}));function ui(){return ui=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},ui.apply(this,arguments)}const pi=(0,g.connect)(((e,t)=>({entity:t.entity||h.ZP.selectors.getEntityWithDiff(e),mode:t.mode||h.ZP.selectors.getMode(e)})))((e=>{let{mode:t=u.ARY.Viewing,attributesCount:r,pinnedAttributes:n}=e,a=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,["mode","attributesCount","pinnedAttributes"]);return(0,u.uzs)(t)?c().createElement(li,ui({attributesCount:r},a)):c().createElement(ci,ui({mode:t,pinnedAttributes:n},a))})),di=(0,T.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 mi=r(83088);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 hi=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=di(),{value:o,label:i,startObject:s,endObject:u}=a,p=s.objectType.label+" ↔ "+u.objectType.label;return c().createElement(Va.Z,gi({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(Ma.Z,{className:l.iconTop,entityType:s.objectType}),c().createElement(Ma.Z,{className:l.iconBottom,entityType:u.objectType})),c().createElement("div",{className:l.text},c().createElement(mi.C,{value:i},c().createElement(E.Z,{className:b()(l.textItem,l.primaryTextItem)},i)),c().createElement(mi.C,{value:p},c().createElement(E.Z,{color:"textSecondary",className:b()(l.textItem,l.secondaryTextItem)},p))))};hi.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({value:U().string.isRequired,label:U().string.isRequired,startObject:U().object,endObject:U().object})};const fi=hi;function bi(){return bi=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},bi.apply(this,arguments)}function yi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xi=e=>{let{value:t={},options:r=[],onChange:n=N.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){yi(e,t,r[t])}))}return e}({},(0,N.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return c().createElement(_a.Z,bi({value:t,options:r,onChange:n,label:x().text("Select relationship type "),components:{Option:fi},TextFieldProps:o},l))},vi=U().shape({label:U().string.isRequired,value:U().string.isRequired,startObject:U().object,endObject:U().object});xi.propTypes={value:vi,options:U().arrayOf(vi),onChange:U().func};const Ei=xi;function wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ci(e,t,r[t])}))}return e}function Ci(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oi(){return Oi=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},Oi.apply(this,arguments)}function Ti(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 Si=e=>{let{values:t,valueContainerClassName:r}=e,n=Ti(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(ar,Oi({attributeValue:e},n))))))},ki=(0,s.memo)((e=>{let{expanded:t}=e,r=Ti(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:l}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return Si(wi({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:l},c().createElement(Vo,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return Si(wi({},r))}}));var Ni=r(44938),Ii=r(42639),Pi=r(45108),Di=r(30488),Ai=r(38748),Ri=r(25843),ji=r(53862);function Zi(){return Zi=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},Zi.apply(this,arguments)}const Li=e=>c().createElement("svg",Zi({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 _i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mi(e,t,r[t])}))}return e}function Mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vi=e=>e.id===e.groupId,Bi=(0,N.curry)(((e,t)=>{let{id:r,groupId:n}=e;return t.groupId===n&&(r===t.id||r.startsWith(`${t.id}.`))})),Ui=(0,N.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),zi=(0,N.propOr)(!0,"hideable"),Fi=(e,t)=>{const r=((e,t)=>e.find((0,N.either)(Ui(t),Bi(t))))(e,t);return r?(r.children=Fi(r.children||[],t),e):e.concat(t)},Hi=(0,N.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(Hi(e)))),Wi=(0,N.reduce)(((e,t)=>Fi(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),qi=(0,N.curry)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,N.pipe)((0,N.filter)(Hi(e)),(0,N.chain)((t=>[{item:_i({},t,{filterText:e}),level:r},...t.children?qi(e,t.children,r+1):[]])))(t)})),Gi=(0,N.has)("columns"),$i=e=>{let{id:t,label:r,columns:n}=e;return[{id:t,groupId:t,label:r},...n.map((0,N.assoc)("groupId",t))]},Yi=e=>e.children?(0,N.chain)(Yi,e.children):[e],Ki=(e,t)=>{const r=Yi(t),n=t=>e.includes(t.id);return Vi(t)?r.every(n):r.some(n)},Xi=(0,T.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Qi=e=>{let{item:t,onClick:r,checked:n,level:a,style:l,isFocused:o,isGroupItem:i}=e;const s=Xi();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(Xr,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:l,isFocused:o,hideIcon:i,className:b()({[s.groupItem]:i})})};Qi.propTypes={item:U().shape({label:U().string,filterText:U().string}),level:U().number,onClick:U().func,checked:U().bool,style:U().object,isGroupItem:U().bool,isFocused:U().bool};const Ji=Qi,es=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:l}=e;const o=Xi(),[i,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(""),g=(0,s.useMemo)((()=>((e,t)=>(0,N.pipe)((0,N.chain)((0,N.when)(Gi,$i)),(0,N.filter)((0,N.either)(Vi,zi)),Wi,qi(t))(e))(t,d)),[t,d]),h=(0,u.fW1)("label")(g)||308,f=(0,s.useMemo)((()=>zr(g)),[g]),b=(0,s.useCallback)((e=>{const t=(0,N.pipe)(Yi,(0,N.pluck)("id"))(e),a=Ki(r,e);n(a?(0,N.difference)(r,t):(0,N.uniq)((0,N.concat)(r,t)))}),[r,n]),y=(0,s.useCallback)((e=>{let{item:t}=e;return b(t)}),[b]),{focusIndex:v,handleKeyDown:E}=$r({items:f,open,onSelectFocusedItem:y,selectedItems:r}),w=Math.min(300,32*f.length),C=Math.max(140,w+108);return c().createElement(c().Fragment,null,c().createElement(ye.k,{tooltipTitle:l||x().text("Show/hide columns"),size:"L",icon:Li,onClick:e=>p(e.currentTarget)}),c().createElement(Ur,{className:o.popup,open:!!i,anchorEl:i,onClose:(0,N.pipe)((()=>p(null)),(()=>m(""))),onSearch:m,title:a||x().text("Show/hide columns"),containerWidth:h,containerHeight:C,searchInputOnKeyDown:E},c().createElement(Gr,{fixedTitle:!1,height:w,renderItem:(e,t,n)=>{let{item:a,level:l=0}=t;return c().createElement(Ji,{style:e,item:a,level:l,isFocused:v===n,checked:Ki(r,a),isGroupItem:Vi(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:h,focusIndex:v})))};es.propTypes={columnsData:ji.uz,selectedColumns:U().arrayOf(U().string),onChangeColumns:U().func,title:U().string,tooltipTitle:U().string};const ts=es;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=e=>c().createElement("svg",rs({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})),as=(0,T.Z)((e=>({"filterIcon--enabled":{color:e.palette.primary.main},closeIcon:{position:"absolute",right:"3px",bottom:"3px",transform:"scale(0.5)"},button:{padding:"11px"}}))),ls=e=>{let{enabled:t,onClick:r}=e;const n=as();return c().createElement(le.ZP,{title:t?x().text("Clear all filters"):x().text("Filter")},c().createElement(Xa.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(ns,{className:n["filterIcon--enabled"]}),c().createElement(Wn.default,{color:"primary",className:n.closeIcon})):c().createElement(ns,null)))};ls.propTypes={enabled:U().bool,onClick:U().func};const os=ls;var is=r(42011),ss=r(46728),cs=r(85103),us=r(1928),ps=r(9377);function ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ms(e,t,r[t])}))}return e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gs="CHANGE_COLUMNS",hs="TOGGLE_FILTERS",fs="CHANGE_FILTER",bs="TOGGLE_SORT",ys="CHANGE_PAGE",xs="CHANGE_ROWS_PER_PAGE",vs={changeColumns:(0,Cn.zD)(gs),toggleFilters:(0,Cn.zD)(hs),changeFilter:(0,Cn.zD)(fs),toggleSort:(0,Cn.zD)(bs),changePage:(0,Cn.zD)(ys),changeRowsPerPage:(0,Cn.zD)(xs)},Es=(e,t)=>{const r=(0,N.difference)(e.visibleColumns,t),n=e=>r.includes(e);return(0,N.evolve)({visibleColumns:(0,N.always)(t),sorting:(0,N.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,N.keys)(e).reduce(((e,t)=>n(t)?(0,N.dissoc)(t,e):e),e)},e)},ws={reducer:(e,t)=>{switch(t.type){case gs:{const r=t.payload;return Es(e,r)}case hs:{const t=!e.filters;return ds({},e,{filters:t?{}:null,page:t?e.page:0})}case fs:{const{columnId:r,filter:n}=t.payload;return(0,N.evolve)({filters:n?(0,N.assoc)(r,n):(0,N.dissoc)(r),page:(0,N.always)(0)},e)}case bs:{const r=t.payload,n=(0,N.path)(["sorting","field"],e),a=(0,N.path)(["sorting","order"],e);return ds({},e,{sorting:{field:r,order:(0,Cn.Dh)(r===n?a:null)},page:0})}case ys:return ds({},e,{page:t.payload});case xs:return ds({},e,{rowsPerPage:t.payload});default:return e}},actions:vs,changeVisibleColumns:Es};var Cs=r(76625);const Os=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,p=t({rowIndex:o,cellIndex:u,columnData:i}),d=()=>a.current&&p(a.current.clientHeight);return(0,te.D)(d,[l.rawValue]),c().createElement("div",null,c().createElement(wr.Z,{handleHeight:!0,onResize:d}),c().createElement(Cs.Z,{rootRef:a},r))};Os.propTypes={onChangeHeight:U().func,children:U().node};const Ts=Os;var Ss=r(3073),ks=r(28831);const Ns=(0,T.Z)((()=>({hidden:{visibility:"hidden"}}))),Is=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Ns(),{toggleRowCollapse:l,getIsRowCollapsible:o,getIsRowCollapsed:i}=(0,s.useContext)(Ss.x),u=o(r),p=i(t);return c().createElement(ks.Z,{className:b()(n,{[a.hidden]:!u}),isOpen:!p,onClick:e=>{l(t),e.stopPropagation()}})};Is.propTypes={rowIndex:U().number,rowValue:U().object,className:U().string};const Ps=Is;function Ds(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const As=e=>{let{rowIndex:t,columnData:{id:r},cellIndex:n}=e;return`${r}[${t}][${n}]`},Rs=()=>{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){Ds(e,t,r[t])}))}return e}({},r.current))})),[]),a=(0,s.useCallback)((()=>{r.current={}}),[]);return{getDynamicRowCellHeight:(0,s.useCallback)((0,N.pipe)(As,(0,N.prop)(N.__,e)),[e]),changeRowCellHeight:(0,s.useCallback)((0,N.curry)((0,N.useWith)((0,N.pipe)(((e,t)=>{r.current[e]=t}),n),[As,N.identity])),[]),clearHeightsCache:a}};var js=r(21697),Zs=r(8233);function Ls(){return Ls=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},Ls.apply(this,arguments)}const _s=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=us.Z,getRowCellHeight:a=cs.Z,defaultRowHeight:l=48,maxRowValuesCount:o=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,Zs.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,js.calculateRowHeight)(n,l),e}),{}),t=(t,r,n)=>{const a=[t,"subRowHeight",r,n,"height"];return(0,N.pathOr)(0,a,e)},n=t=>(0,N.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(Ss.x.Provider,{value:u},c().createElement("div",Ls({},o,{style:{height:n(l)}}),i.length>0&&(0,js.getCellContentFromRowsData)({columnIndex:r.findIndex((0,N.propEq)("id",a)),headData:r,rowsData:i,rowIndex:l,getHeightForSubRow:t})))};return a.propTypes={columnId:U().string,rowIndex:U().number},{getRowHeight:n,CellRenderer:a}}),[i,l,u,r])};var Ms=r(67766),Vs=r(42767);const Bs=(0,T.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),Us=(0,lt.Z)(he.Z),zs=e=>{let{total:t=0,onPrev:r,onNext:n,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:o}=e;const i=Bs();return c().createElement("div",{className:i.container},c().createElement(Us,{className:i.link,component:"button",variant:"caption",onClick:a,underline:"none",tooltipTitle:x().text("Go to search results")},(0,u.k7L)(t,1e6)," ",1===t?x().text("Search result"):x().text("Search results")),c().createElement(ye.k,{size:"L",icon:Ms.Z,tooltipTitle:x().text("Go to previous profile"),onClick:r,disabled:l,showForDisabled:!0}),c().createElement(ye.k,{size:"L",icon:Vs.Z,tooltipTitle:x().text("Go to next profile"),onClick:n,disabled:o,showForDisabled:!0}))};function Fs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hs(e,t,r[t])}))}return e}function Hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ws{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=Fs({},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 qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gs(e,t,r[t])}))}return e}function Gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $s{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:qs({},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 Ys=(e,t)=>(0,N.pipe)((0,N.map)((0,N.prop)("uri")),(0,N.reject)((e=>t.includes(e))))(e),Ks=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,ze._)(),t=(0,ze._)(),r=(0,ze._)(),{uri:n,index:a,total:l,tenant:o,cache:i}=(0,g.useSelector)(h.ZP.selectors.getSearchNavigationData)||{},{type:c,data:p}=(0,g.useSelector)(h.ZP.selectors.getSearchProviderData)||{},d=(0,g.useSelector)(h.ZP.selectors.getTenant),m=(0,g.useSelector)(h.ZP.selectors.getApiPath),f=(0,g.useSelector)(h.ZP.selectors.getDtssPath),b=(0,g.useSelector)((e=>h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),y=(0,s.useContext)(Ga.m),x=(0,g.useDispatch)(),[v,E]=(0,s.useState)(!1),w=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new Ws(t);case"graphsearch":return new $s(t)}})(c,{data:p,tenant:d,searchTenant:o,apiPath:m,dtssPath:f,globalSearchRequestOptions:b})),[c,p,d,o,m,f,b]),C=(0,s.useCallback)((e=>{x(h.yC.actions.updateSearchNavigationDataFields(e))}),[x]),O=(0,s.useCallback)((e=>{const t=d!==o?(0,u.wwR)({uri:e,dataTenant:o}):e;x(h.ui.actions.openEntity({uri:t,viewId:y,source:"navigation"}))}),[x,y,d,o]),T=(0,s.useCallback)((()=>{x(h.ui.actions.openPerspective({perspectiveId:c,viewId:y}))}),[x,c,y]);(0,s.useEffect)((()=>{a>=l?C({index:l-1}):a<0&&C({index:0})}),[l,a,C]);const S=(0,s.useCallback)(((e,n,a)=>{E(!0),t(w.requestTotal()).then((e=>C({total:e})));const l=a+1;return r(w.requestEntities(15,l)).then((t=>{if(t){if(t.length){const r=Ys(t,e);if(r.length>0)return C({cache:e.concat(r),uri:r[0],index:l+t.length-r.length}),void O(r[0]);if(a+t.length<n-1)return S(e,n-t.length,a+t.length)}C({index:l})}})).finally((()=>{E(!1)}))}),[w,C,O]),k=(0,s.useCallback)(((e,n)=>{E(!0),t(w.requestTotal()).then((e=>C({total:e})));const a=n-1,l=Math.max(0,n-15),o=15+Math.min(0,n-15);return r(w.requestEntities(o,l)).then((t=>{if(t){if(t.length){const r=Ys(t,e);if(r.length>0)return C({cache:r.concat(e),uri:r[r.length-1],index:a-(t.length-r.length)}),void O(r[r.length-1]);if(n-t.length>0)return k(e,n-t.length)}C({index:0})}})).finally((()=>{E(!1)}))}),[w,C,O]),N=(0,s.useCallback)(((t,r,n,a)=>{if(r<t.length){const l=t[r];return E(!0),e(w.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),N(e,r,n-1,a)}C({index:a+1,uri:l,cache:t,total:n}),O(l)})).finally((()=>{E(!1)}))}if(!(a>=n-1))return S(t,n,a);C({cache:t,total:n,index:n-1})}),[w,C,O,S]),I=(0,s.useCallback)(((t,r,n,a)=>{if(r>-1){const l=t[r];return E(!0),e(w.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),I(e,r-1,n-1,a-1)}C({index:a-1,uri:l,cache:t,total:n}),O(l)})).finally((()=>{E(!1)}))}if(!(a<=0))return k(t,a);C({index:0,cache:t,total:n})}),[w,C,O,k]),P=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)-1;I(i,e,l,a)}}),[I,i,n,l,a]),D=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)+1;N(i,e,l,a)}}),[N,i,n,l,a]);return{total:l,onPrev:P,onNext:D,onSearchResultsClick:T,isPrevDisabled:v||a<=0,isNextDisabled:v||a>=l-1}})();return(()=>{const{cache:e}=(0,g.useSelector)(h.ZP.selectors.getSearchNavigationData)||{},t=(0,g.useSelector)(h.ZP.selectors.getMode),r=(0,g.useSelector)(h.ZP.selectors.getEntity);return(0,u.uzs)(t)&&(null==e?void 0:e.includes(null==r?void 0:r.uri))})()?c().createElement(zs,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}):null};var Xs=r(82068),Qs=r(72668),Js=r(38037),ec=r(62321),tc=r(56215),rc=r(12960),nc=r(39878),ac=r(59383);function lc(){return lc=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},lc.apply(this,arguments)}const oc=e=>c().createElement($e.Z,lc({mouseEvent:"onMouseDown"},e));var ic=r(89902),sc=r(78501),cc=r(59952),uc=r(51556);const pc=(0,T.Z)((()=>({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}})));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)}function mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gc(e,t,r[t])}))}return e}function gc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hc=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:l,titleText:o,filterText:i,onListItemClick:p,selected:d,hideCheckBox:g,renderGroupTitle:h}=e,f=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,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const y=(0,s.useCallback)((e=>e.label.toLowerCase().includes(i.toLowerCase())),[i]),x=(0,s.useCallback)((e=>y(e)||(e.children||[]).some(x)),[y]),v=(0,s.useMemo)((()=>{const e=(0,N.curry)(((e,r,n,a)=>[{item:mc({},r,{filterText:i}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const l=t=>e(a,t,r,n),o=t.filter(x);return(h?N.map:N.chain)(l,o)};return t}),[i,h,x]),E=(0,s.useCallback)((e=>e.map((e=>({item:e,items:v(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[v]),w=(0,s.useCallback)((e=>{let{item:t}=e;p(t,!d.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[p,d]),C=(0,s.useMemo)((()=>(h?E:v)(n)),[n,h,E,v]),O=(0,s.useMemo)((()=>zr(C)),[C]),{focusIndex:T,handleKeyDown:S}=$r({items:O,open:t,onSelectFocusedItem:w,selectedItems:d}),k=(0,s.useRef)(null);k.current=T;const I=(0,s.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const l=!!d.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),o=k.current===r;return c().createElement(m.Z,{key:n.id,onClick:p,checked:l,level:a,data:n,label:c().createElement(Xr,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:g,isFocused:o,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[g,p,d]),P=(0,u.fW1)("label")(C)||308,D=pc();return c().createElement(Ur,dc({open:t,className:b()(D.container,D.popupContainer),anchorEl:r,onClose:l,onSearch:a,title:o,containerWidth:P,searchInputOnKeyDown:S},f),c().createElement(Gr,{height:300,renderItem:I,items:O,hideSubtitles:!0,getItemSize:()=>32,containerWidth:P,focusIndex:T,renderGroupTitle:h}))};hc.propTypes={open:U().bool,hideCheckBox:U().bool,anchorEl:U().any,selected:U().array,data:U().array,filterText:U().string,titleText:U().string,onClose:U().func,onListItemClick:U().func,onSearch:U().func,renderGroupTitle:U().func},hc.defaultProps={data:[],selected:[],titleText:x().text("Show/hide columns"),filterText:""};const fc=hc,bc=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,s.useCallback)(((e,r)=>{const n={},a=(0,N.pipe)(u.PjQ,(0,N.tap)((e=>n[e]=(0,N.propOr)(0,e,n)+1))),l=(0,N.ascend)((0,N.prop)("label")),o=(0,N.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,N.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,N.propEq)("uri",n)),direction:a}}),[]),toEditorValue:(0,s.useCallback)(((e,t)=>t.find((0,N.propEq)("value",`${e.relationType},${e.direction}`))),[])}};function yc(){return yc=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},yc.apply(this,arguments)}const xc=e=>{let{relation:t={},inRelationTypes:r=[],outRelationTypes:n=[],onChange:a=N.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:p,toEditorValue:d}=bc({reversedContextLabels:o}),m=(0,s.useMemo)((()=>u(r,n)),[u,r,n]),g=(0,s.useCallback)((0,N.pipe)(p(r,n),a),[p,r,n,a]);return(0,s.useEffect)((()=>{l&&m.length&&g(m[0])}),[m,l,g]),c().createElement(Ei,yc({value:d(t,m),options:m,onChange:g},i))};xc.propTypes={className:U().string,relation:u.bNA,inRelationTypes:U().arrayOf(u.IYE),outRelationTypes:U().arrayOf(u.IYE),applyFirstByDefault:U().bool,reversedContextLabels:U().bool,onChange:U().func};const vc=xc;var Ec=r(4190),wc=r(60364);function Cc(){return Cc=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},Cc.apply(this,arguments)}const Oc=e=>{let{open:t=!0,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,["open","children"]);const[a,l]=(0,s.useState)(t),o=(0,wc.Z)().transitions.duration.leavingScreen;return(0,s.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{l(!1)}),o);return()=>clearTimeout(e)}l(!0)}}),[t,o,a]),c().createElement(Ec.ZP,Cc({open:t},n),a&&r)};Oc.displayName="Drawer";const Tc=Oc;var Sc=r(1128),kc=r(43371),Nc=r(15299),Ic=r(19855),Pc=r(72466),Dc=r(39600),Ac=r(91785),Rc=r(51594),jc=r(7522);function Zc(){return Zc=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},Zc.apply(this,arguments)}const Lc=e=>c().createElement(jc.Z,Zc({message:x().text("No data available")},e));var _c=r(6216),Mc=r(79002);const Vc=(0,T.Z)({"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",display:"inline-flex",marginRight:"12px",borderRadius:"2px"},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",display:"inline-flex",marginRight:"16px"}}),Bc=e=>{let{entity:t,className:r,size:n="small"}=e;const a=Vc(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=t.type,i=(0,u.nt9)(l,o)||{},s=(0,u.VD3)(l,i,"typeColor")||u.rSc.palette.primary.main;return c().createElement(E.Z,{style:{backgroundColor:s,color:u.P6Y.Colors.getColor(s)?"#FFFFFF":"#212121"},className:b()(a[`entityType-${n}`],r),component:"div"},(0,u.jFi)(l,t))};var Uc=r(45767),zc=r(86619);const Fc=(0,T.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function Hc(){return Hc=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},Hc.apply(this,arguments)}const Wc=(0,N.always)(32),qc=e=>{let{selectedEntityTypes:t,onItemClick:r,focusIndex:n}=e,a=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,["selectedEntityTypes","onItemClick","focusIndex"]);return c().createElement(Gr,Hc({getItemSize:Wc,renderItem:(e,a,l)=>{let{item:o}=a;const i=!!t.find((e=>o.uri===e)),s=l===n;return c().createElement(m.Z,{key:o.uri,onClick:r,checked:i,data:o,label:c().createElement(Xr,{text:o.label,highlight:o.filterText}),labelInText:o.label,style:e,isFocused:s,hideIcon:!0,LogoIcon:o.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0},a))};qc.propTypes={selectedEntityTypes:U().array,onItemClick:U().func,focusIndex:U().number};const Gc=(0,s.memo)(qc),$c=(0,T.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),Yc=(e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=r,l=document.createRange();l.setStart(t,0);for(let r=0;r<e.length;r++){l.setEnd(t,l.endOffset+e[r].length);const{width:o}=l.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&l.setEnd(t,l.endOffset+", ".length)}}return-1},Kc=e=>e.join(", "),Xc=e=>`calc(${(0,N.isNil)(e)?"100%":`${e}px`} - 35px)`,Qc=e=>{let{list:t,maxWidth:r}=e;const n=$c(),a=(0,s.useRef)(),[l,o]=(0,s.useState)(0);(0,s.useEffect)((()=>{o(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=Yc(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(t,a.current))}),[t]);const i=Kc(t),u=l>0,p=u?Kc(t.slice(0,-l)):i;return c().createElement(le.ZP,{title:u?i:""},c().createElement("div",{className:n.listLabelContainer},c().createElement("div",{style:{width:Xc(r)},className:n.listLabel,ref:a},i),c().createElement("div",{className:n.visibleItemsLabel},p),u&&c().createElement("div",{className:n.hiddenCount},`+${l}`)))};Qc.propTypes={list:U().arrayOf(U().string).isRequired,maxWidth:U().number};const Jc=Qc;function eu(){return eu=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},eu.apply(this,arguments)}function tu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ru(e,t,r[t])}))}return e}function ru(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nu=e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:l,onChange:o,classes:i={},ListLabelProps:p={},disabled:d=!1}=e;const m=Fc(),[g,h]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>h(!0)),[]),y=(0,s.useCallback)((()=>h(!1)),[]),[v,E]=(0,s.useState)(""),w=(0,s.useCallback)((()=>E("")),[]),C=(0,s.useCallback)((0,N.pipe)(w,y),[y,w]),O=(0,s.useMemo)((()=>t.filter(u.oDv).filter((e=>{let{label:t}=e;return u.P6Y.strings.search(t,v)})).map(((e,t)=>({item:{item:tu({},e,{filterText:v})},index:t})))),[t,v]),T=(0,s.useMemo)((()=>r.map((e=>t.find((0,N.propEq)("uri",e)))).map((0,N.prop)("label"))),[r,t]),S=(0,s.useCallback)(((e,t)=>{n?(o(t?[e.uri]:[]),C()):o(t?r.concat(e.uri):r.filter((t=>t!==e.uri)))}),[r,o,n,C]),k=(0,s.useCallback)((e=>{let{item:t}=e;const n=!r.includes(t.uri);S(t,n)}),[r,S]),{focusIndex:I,handleKeyDown:P}=$r({items:O,open:g,onSelectFocusedItem:k,selectedItems:r,onClose:C}),D=(0,s.useRef)(),A=D.current?D.current.getBoundingClientRect().width:0,R=Math.max(A,255),j=0===r.length;return c().createElement(c().Fragment,null,c().createElement(zc.Z,{label:x().text("Entity type"),ref:D,InputProps:{startAdornment:j&&!a?null:c().createElement("div",{className:b()(m.inputText,i.inputText)},j?c().createElement("div",null,a):c().createElement(Jc,eu({},p,{list:T}))),classes:{root:m.inputRoot,input:b()(m.input,i.input,{[m.emptyInput]:j&&!a}),disabled:b()(m.disabledInput,{[m.disabledPointer]:d}),underline:m.disabledUnderline},endAdornment:c().createElement(_t.Z,{size:"L",icon:Uc.Z,iconClassName:b()(m.icon,{[m["popup-opened-icon"]]:g}),disabled:d}),readOnly:!0,disabled:!0,disableUnderline:j&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:b()(m.inputLabel,i.label)}},value:"",onClick:d?void 0:f,classes:{root:b()(m.root,i.root)},margin:"dense",variant:"filled",disabled:d,"data-reltio-id":"entity-type-selector"}),c().createElement(Ur,{open:g,anchorEl:D.current,onClose:C,onSearch:E,title:x().text("Select entity types"),containerWidth:R,containerHeight:355,searchInputOnKeyDown:P,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":"entity-type-selector-popup"}},c().createElement(Gc,{items:O,onItemClick:S,selectedEntityTypes:r,width:R,height:245,focusIndex:I})))};nu.propTypes={entityTypes:U().arrayOf(u.p8l),selectedEntityTypes:U().arrayOf(U().string).isRequired,onChange:U().func.isRequired,single:U().bool,enableEmptyValueUnderline:U().bool,placeholder:U().string,classes:U().shape({root:U().string,label:U().string,inputText:U().string,input:U().string}),ListLabelProps:U().shape({maxWidth:U().number}),disabled:U().bool};const au=(0,s.memo)(nu);var lu=r(7882),ou=r(97333);const iu=e=>`rotateY(${e?180:0}deg)`,su=e=>`rotateX(${e?180:0}deg)`,cu=e=>`rotateY(${e?0:-180}deg)`,uu=e=>`rotateX(${e?0:-180}deg)`,pu=(0,T.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?cu(t):uu(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?iu(t):su(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),du=(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),p=pu({cardZIndex:r,direction:n,isFlipped:i});return(0,s.useEffect)((()=>{a!==i&&u(a)}),[a,i]),c().createElement("div",{className:b()(p.flipper,o),ref:t},c().createElement("div",{"data-id":"front",className:p.front},l[0]),c().createElement("div",{"data-id":"back",className:p.back},l[1]))})),mu=()=>c().createElement("div",{style:{display:"none"}}),gu=e=>{let{widthToHide:t,children:r}=e;return c().createElement(wr.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(mu,null)}})};gu.propTypes={children:U().node,widthToHide:U().number.isRequired};const hu=gu;function fu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bu(e,t,r[t])}))}return e}function bu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yu=(0,N.range)(2,10).reduce(((e,t)=>fu({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),xu=(0,T.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":fu({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},yu,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function vu(){return vu=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},vu.apply(this,arguments)}const Eu=e=>{let{pathToTitle: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,["pathToTitle","children"]);const a=xu(),l=t&&t.length?c().createElement("div",{className:a.tooltipContent},c().createElement("p",null,(0,N.last)(t)),t.length>2&&c().createElement("ul",null,t.map((e=>c().createElement("li",{key:e},e))))):"";return c().createElement(le.ZP,vu({title:l,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};Eu.propTypes={pathToTitle:U().arrayOf(U().string).isRequired,children:U().node};const wu=Eu;var Cu=r(4614),Ou=r(61932);const Tu=(0,T.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let Su;!function(e){e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE"}(Su||(Su={}));const ku=e=>{let{classes:t={},tooltip:r="",onClick:n=Cn.ZT,mode:a=Su.INIT}=e;const l=Tu();return c().createElement("div",{className:b()(l.root,t.root)},(()=>{switch(a){case Su.INIT:return c().createElement(ye.k,{className:t.button,size:"M",tooltipTitle:r,icon:Ou.Z,onClick:n});case Su.PROGRESS:return c().createElement(Cu.Z,{className:t.spinner,size:24});case Su.SUCCESS:return c().createElement(ge.Z,{className:b()(l.check,t.check)});default:return null}})())},Nu=(0,T.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),Iu=e=>{let{to:t,children:r,onClick:n}=e;const a=Nu();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},Pu=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==")})},Du=e=>{let{isMlMatch:t=!1}=e;return c().createElement(c().Fragment,null,t?x().text("Match IQ"):x().text("Match rules"))},Au=(0,T.Z)({title:{fontWeight:500,marginBottom:"9px"},body:{fontWeight:"normal",marginLeft:"16px"},container:{padding:"8px",fontSize:"12px",lineHeight:"14px"}}),Ru=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=Au();return c().createElement("div",{className:n.container},c().createElement("div",{className:n.title},c().createElement(Du,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},ju=(0,T.Z)((e=>({container:{fontSize:"13px",lineHeight:"15px"},title:{color:e.palette.text.secondary,marginBottom:"7px"},labelsContainer:{color:e.palette.text.primary,marginBottom:"8px"}}))),Zu=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=ju();return c().createElement("div",{className:b()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(Du,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},Lu=(0,T.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 _u(){return _u=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},_u.apply(this,arguments)}const Mu=(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=Lu();return c().createElement("div",_u({onClick:a,ref:t,className:b()(i.container,l)},o),c().createElement(Ut,{expanded:n}),c().createElement("div",{className:i.label},r))}));Mu.displayName="MatchRuleBadge";const Vu=Mu,Bu=(0,T.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function Uu(){return Uu=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},Uu.apply(this,arguments)}const zu=e=>c().createElement("svg",Uu({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}))),Fu=(0,lt.Z)(Vu),Hu=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=Bu(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement(Fu,{tooltipTitle:c().createElement(Ru,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(zu,{className:n.icon}),x().text("Match IQ")):x().text("Rules")),a?c().createElement(Zu,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function Wu(){return Wu=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},Wu.apply(this,arguments)}const qu=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,N.isEmpty)(l)?null:c().createElement(r,Wu({matchRules:l},n)),(0,N.isEmpty)(a)?null:c().createElement(r,Wu({isMlMatch:!0,matchRules:a},n)))};qu.propTypes={matchRules:u.p3$,Component:U().func};const Gu=qu,$u=(0,T.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"}}))),Yu=e=>{let{label:t,matchRules:r}=e;const n=$u(),[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(Ut,{expanded:a}),c().createElement("div",{className:n.label},t)),a?c().createElement(Gu,{Component:Zu,matchRules:r,className:n.matchLabels}):null)},Ku=(0,T.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),Xu=(0,T.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),Qu=e=>{let{transitiveMatchRules:t}=e;const r=Xu();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(Ru,{matchRules:a}))})))};function Ju(){return Ju=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},Ju.apply(this,arguments)}const ep=(0,lt.Z)(Vu),tp=e=>{let{transitiveMatchRules:t}=e;const r=Ku(),[n,a]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(ep,{tooltipTitle:c().createElement(Qu,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:n},x().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(Yu,Ju({key:t},e)))):null)},rp=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(tp,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement(Gu,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:Hu})};var np=r(73698);const ap=(0,T.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 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)}const op=e=>"onClick"in e,ip=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:l=!1}=e;const o=ap();return c().createElement(np.Z,{classes:{root:o.root,icon:o.arrowIcon,outlined:o.outlined},value:n,onChange:e=>{const{value:r}=e.target;t.some((0,N.propEq)("value",r))&&a(r)},variant:"outlined",renderValue:e=>{const{icon:r,label:n}=t.find((0,N.propEq)("value",e));return c().createElement(v.Z,{className:o.currentValue},c().createElement(r,{className:o.currentValueIcon}),c().createElement(le.ZP,{title:n},c().createElement(E.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(op);return e.map(((e,r)=>{const{value:n,description:a,icon:l}=e,i={value:n,className:o.menuItem};return op(e)&&(i.onClick=()=>e.onClick(n),i.className=b()(i.className,{[o.firstMenuItemButton]:r===t})),c().createElement(Va.Z,lp({key:n},i,{"data-reltio-id":`reltio-profile-select-mode-${n}`}),c().createElement(v.Z,{className:o.menuItemInner},c().createElement(l,{className:o.menuItemIcon}),c().createElement(v.Z,null,c().createElement(E.Z,{className:o.menuItemLabel},n),c().createElement(E.Z,{className:o.menuItemDescription},a))))}))})([...t,...r]))};var sp=r(16482),cp=r(73272);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 pp=e=>c().createElement("svg",up({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"})),dp=(0,T.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}}))),mp=e=>{let{date:t,type:r,createdBy:n,step:a,children:l,Actions:o}=e;const i=dp(),[u,p]=(0,s.useState)(!1);return c().createElement("div",{className:i.pmReviewCard},c().createElement("div",{className:b()(i.header,{[i.expanded]:u})},c().createElement(pp,{className:i.icon}),c().createElement("div",{className:i.mainInfo},c().createElement("div",{className:i.title},c().createElement("div",{className:b()(i.caption,i.flex)},x().text("Match review")),c().createElement(cp.Z,{className:i.flag}),c().createElement("span",{className:i.date},x().date(t,"L")),c().createElement(ks.Z,{isOpen:u,onClick:()=>{p(!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},x().text("Created by ${createdBy}",{createdBy:n})),c().createElement("div",{className:i.info},x().text("Step: ${step}",{step:a}))),o))),u?l:null)};mp.propTypes={date:U().number,createdBy:U().string,type:U().string,step:U().string,children:U().oneOfType([U().node,U().arrayOf(U().node)]),Actions:U().node};const gp=mp,hp=e=>{let{label:t,value:r,uri:n,rangeColorsConfig:a,className:l}=e;const o=H();return c().createElement("div",{className:b()(o.container,l),key:n},c().createElement(K,{attrTypeUri:n,label:t}),c().createElement("span",{className:o.value,style:{color:(0,u.Uz2)(n,r,a)}},r))};hp.propTypes={label:U().string,value:U().oneOfType([U().string,U().number]),uri:U().string,rangeColorsConfig:U().object,className:U().string};const fp=hp,bp=(0,T.Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"inset 0 -1px 0 0 rgba(0,114,206,0.06), inset 0 1px 0 0 rgba(0,114,206,0.06);","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}},scores:{display:"flex",flexGrow:1,justifyContent:"flex-end",paddingRight:"20px"}})));function yp(){return yp=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},yp.apply(this,arguments)}const xp=e=>{let{className:t,entity:r,scoresToShow:n,rangeColorsConfig:a,children:l,classes:o}=e;const i=bp({classes:o}),p=(0,g.useSelector)(h.ZP.selectors.getMetadata),d=(0,s.useCallback)((()=>{navigator.clipboard.writeText((0,u.BTI)(r))}),[r]);if((0,N.isNil)(r))return null;const m=(0,u.idV)(r.label),f=r.secondaryLabel,y=(0,u.ptG)(p,r),v=(0,u.Fn9)(r),w=(0,u.AET)(p,r,n),C=r.uri,O=(0,u.BTI)(r);return c().createElement("div",{className:b()(i.profileBandWrapper,t)},c().createElement("div",{className:b()(i.profileBand,{[i.inactive]:!v}),"data-entity-uri":C},c().createElement(bt,{key:r.uri,entity:r,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),c().createElement("div",{className:i.profileInfo},c().createElement("div",null,c().createElement(E.Z,{variant:"h6",className:i.label},m),f&&c().createElement(E.Z,{variant:"subtitle2",className:i.secondaryLabel},f),y&&c().createElement(E.Z,{variant:"subtitle1",className:i.businessCard},y)),c().createElement("div",{className:i.specialInfo},c().createElement("div",{className:i.entityType},c().createElement(Bc,{entity:r,size:"medium",className:i.badge}),w.length>0&&c().createElement("div",{className:i.scores},w.map((e=>c().createElement(fp,yp({key:e.uri},e,{rangeColorsConfig:a}))))),!(0,u.ZiX)(C)&&c().createElement(le.ZP,{title:x().text("Copy to clipboard")},c().createElement(E.Z,{display:"inline",variant:"body2",className:i.entityId,onClick:d},x().text("Entity ID"),": ",O))))),l&&c().createElement("div",null,l)))};xp.propTypes={className:U().string,entity:U().object,scoresToShow:U().arrayOf(U().string),rangeColorsConfig:U().object,children:U().node,classes:U().object};const vp=xp,Ep=(0,T.Z)((e=>({container:{position:"relative",display:"flex",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,padding:"8px 8px 8px 0",overflow:"hidden"},colorBox:{position:"absolute",opacity:.12,top:0,left:0,bottom:0,width:"32px"},image:{width:"32px",height:"32px"},avatar:{marginRight:"8px",marginLeft:"16px",marginTop:"2px"},info:{overflow:"hidden",display:"flex",flexDirection:"column"},firstRow:{width:"100%"},label:{display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:500,color:e.palette.primary.main},link:{textDecoration:"none"},secondRow:{wordWrap:"break-word",marginTop:"4px",lineHeight:"13px",fontSize:"11px"},thirdRow:{display:"flex",alignItems:"center",fontSize:"12px",color:e.palette.text.secondary,marginTop:"auto"}})));function wp(){return wp=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},wp.apply(this,arguments)}const Cp=(0,s.memo)((e=>{let{entity:t,classes:r={},disableEntityTypeColor:n}=e,a=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,["entity","classes","disableEntityTypeColor"]);const l=Ep(),{secondaryLabel:o,label:i,container:s}=r,p=(0,g.useSelector)(h.ZP.selectors.getMetadata),d=(0,u.idV)(t.label),{secondaryLabel:m,type:f}=t,y=(0,u.nt9)(p,f)||{},x=(0,u.VD3)(p,y,"typeColor")||u.rSc.palette.primary.main;return c().createElement("div",wp({className:b()(l.container,s)},a),c().createElement("div",{className:l.colorBox,style:n?void 0:{backgroundColor:x}}),c().createElement(bt,{entity:t,avatarClassName:l.avatar,imageClassName:l.image}),c().createElement("div",{className:l.info},c().createElement("div",{className:l.firstRow},c().createElement(ve.Z,{value:(0,u.wwR)(t),className:l.link},c().createElement(mi.C,{value:d,placement:"top",showOnExceededHeight:!0},c().createElement("span",{className:b()(l.label,i)},d)))),c().createElement("div",{className:l.secondRow},m&&c().createElement(mi.C,{value:m,placement:"top",showOnExceededHeight:!0},c().createElement("span",{className:o},m))),c().createElement("div",{className:l.thirdRow},c().createElement(Bc,{entity:t}),c().createElement("div",null,(0,u.BTI)(t)))))})),Op=(0,T.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));var Tp=r(6782);const Sp="46px",kp=(0,T.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:Sp},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:Sp}}))),Np=e=>{let{className:t,rowData:r}=e;const n=kp();return c().createElement("div",{className:b()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,Tp.Z)(r.operator):x().text("Where"))};Np.propTypes={className:U().string,rowData:U().object};const Ip=Np,Pp=e=>{let{className:t,rowData:r}=e;const n=kp();return c().createElement("div",{className:b()(n.readOnlyFilter,t)},r&&r.filter?(0,u.XS2)(r.filter):x().text("equals"))};Pp.propTypes={className:U().string,rowData:U().object};const Dp=Pp;const Ap=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=Ip,AttributeSelectorComponent:l,FilterSelectorComponent:o=Dp,ValuesEditorComponent:i,ActionsComponent:s,filterSelectorRef:u,attributeSelectorProps:p={}}=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,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const m=Op();return c().createElement("div",{className:b()(m.row,t.root)},c().createElement(a,{className:t.logicOperatorContainer,rowContext:d,rowData:n}),c().createElement("div",{className:b()(m.rowItem,t.attributeSelectorContainer)},c().createElement(l,{attributeSelectorProps:p,rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,t.filterSelectorContainer)},c().createElement(o,{textFieldInputRef:u,rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,m.fullWidth,t.valuesEditorContainer)},c().createElement(i,{rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,t.actionsContainer,{[m.hidden]:!r})},c().createElement(s,{rowContext:d,rowData:r})))};Ap.propTypes={classes:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowData:ji.Xw,previousRowData:ji.Xw,LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,attributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const Rp=(0,s.memo)(Ap);function jp(){return jp=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},jp.apply(this,arguments)}const Zp=e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:l,filterSelectorRefIndex: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","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,N.path)([t-1],n):null,u=t===n.length?{attributeSelectorProps:a}:{};return c().createElement(Rp,jp({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?l:void 0},i,u))};return c().createElement("div",{className:t},n.map(s),s(null,n.length,n))};Zp.propTypes={className:U().string,rowClasses:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowsData:U().arrayOf(ji.Xw),LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,filterSelectorRefIndex:U().number,lastRowAttributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const Lp=(0,s.memo)(Zp);var _p=r(15793);const Mp={BY_LABEL:(0,r(54573).c)({stringify:(0,N.prop)("label")})};var Vp=r(81521),Bp=r(8978),Up=r(46847),zp=r(15459);function Fp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const Hp=(0,T.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 Wp(){return Wp=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},Wp.apply(this,arguments)}const qp=e=>{let{children:t,listIndex:r,swapFrom:n,swapLength:a,swapDepth:l,scaffoldBlockPxWidth:o,lowerSiblingCounts:i,connectDropTarget:u,isOver:p,draggedNode:d,canDrop:m,treeIndex:g,treeId:h,getPrevRow:f,node:b,path:y,rowDirection:x}=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"]);Hp();const E="rtl"===x?"rst__rtl":null,w=i.length,C=[];let O;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"),C.push(c().createElement("div",{key:`pre_${1+t}`,style:{width:o},className:Fp("rst__lineBlock",i,E)})),g!==r&&t===l){let e,l="";l=r===n+a-1?"rst__highlightBottomLeftCorner":g===n?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===x?{width:o,right:o*t}:{width:o,left:o*t},C.push(c().createElement("div",{key:t,style:e,className:Fp("rst__absoluteLineBlock",l,E)}))}})),O="rtl"===x?{right:o*w}:{left:o*w},u(c().createElement("div",Wp({},v,{className:Fp("rst__node",E)}),C,c().createElement("div",{className:"rst__nodeContent",style:O},s.Children.map(t,(e=>(0,s.cloneElement)(e,{isOver:p,canDrop:m,draggedNode:d}))))))};qp.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},qp.propTypes={treeIndex:U().number.isRequired,treeId:U().string.isRequired,swapFrom:U().number,swapDepth:U().number,swapLength:U().number,scaffoldBlockPxWidth:U().number.isRequired,lowerSiblingCounts:U().arrayOf(U().number).isRequired,listIndex:U().number.isRequired,children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),getPrevRow:U().func.isRequired,node:U().shape({}).isRequired,path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,rowDirection:U().string};const Gp=qp;function $p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yp(e,t,r[t])}))}return e}function Yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kp(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 p=r.children.length;for(let e=0;e<p;e+=1){const n=Kp({ignoreCollapsed:i,getNodeKey:a,targetIndex:t,node:r.children[e],currentIndex:u,lowerSiblingCounts:[...o,p-e-1],path:c});if(n.node)return n;u=n.nextIndex}return{nextIndex:u}}function Xp(e){let{node:t,ignoreCollapsed:r=!0}=e;return Kp({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}function Qp(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 p=i;const d=l.children.length;if("function"!=typeof l.children)for(let e=0;e<d;e+=1)if(p=Qp({callback:t,getNodeKey:r,ignoreCollapsed:n,node:l.children[e],parentNode:a?null:l,currentIndex:p+1,lowerSiblingCounts:[...c,d-e-1],path:u}),!1===p)return!1;return p}function Jp(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=$p({},l),p=a?[]:[...s,r({node:u,treeIndex:i})],d={node:u,parentNode:o,path:p,lowerSiblingCounts:c,treeIndex:i};if(!u.children||!0!==u.expanded&&n&&!a)return{treeIndex:i,node:t(d)};let m=i;const g=u.children.length;return"function"!=typeof u.children&&(u.children=u.children.map(((e,l)=>{const o=Jp({callback:t,getNodeKey:r,ignoreCollapsed:n,node:e,parentNode:a?null:u,currentIndex:m+1,lowerSiblingCounts:[...c,g-l-1],path:p});return m=o.treeIndex,o.node}))),{node:t(d),treeIndex:m}}function ed(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||Qp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function td(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:Jp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function rd(e){let{treeData:t,expanded:r=!0}=e;return td({treeData:t,callback:e=>{let{node:t}=e;return $p({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function nd(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 p=c+1;for(let e=0;e<s.children.length;e+=1){const t=i({node:s.children[e],currentTreeIndex:p,pathIndex:u+1});if(t!==o)return $p({},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)]});p+=1+Xp({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 ad(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null,o=null;return{treeData:nd({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 ld(e){let{targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isPseudoRoot:o=!1,isLastChild:i,node:s,currentIndex:c,currentDepth:u,getNodeKey:p,path:d=[]}=e;const m=e=>o?[]:[...d,p({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=$p({},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+Xp({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=$p({},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 g=null,h=null,f=null,b=c+1,y=s.children;"function"!=typeof y&&(y=y.map(((e,o)=>{if(null!==g)return e;const s=ld({targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isLastChild:i&&o===y.length-1,node:e,currentIndex:b,currentDepth:u+1,getNodeKey:p,path:[]});return"insertedTreeIndex"in s&&({insertedTreeIndex:g,parentNode:f,parentPath:h}=s),b=s.nextIndex,s.node})));const x=$p({},s,{children:y}),v={node:x,nextIndex:b};return null!==g&&(v.insertedTreeIndex=g,v.parentPath=[...m(x),...h],v.parentNode=f),v}function od(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=ld({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 id(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return ed({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function sd(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||sd(e,t)))}function cd(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,cd(r,t+1))),t):t}function ud(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:p,path:d=[]}=e,m=[],g=!1,h=!1;const f=r?[]:[...d,t({node:u,treeIndex:p})],b=r?null:{path:f,treeIndex:p},y=u.children&&"function"!=typeof u.children&&u.children.length>0;!r&&a($p({},b,{node:u,searchQuery:n}))&&(s===l&&(h=!0),s+=1,g=!0);let x=p;const v=$p({},u);return y&&(v.children=v.children.map((e=>{const t=c({node:e,currentIndex:x+1,path:f});return t.node.expanded?x=t.treeIndex:x+=1,(t.matches.length>0||t.hasFocusMatch)&&(m=[...m,...t.matches],t.hasFocusMatch&&(h=!0),(o&&t.matches.length>0||(o||i)&&t.hasFocusMatch)&&(v.expanded=!0)),t.node}))),r||v.expanded||(m=m.map((e=>$p({},e,{treeIndex:null})))),g&&(m=[$p({},b,{node:v}),...m]),{node:m.length>0?v:u,matches:m,hasFocusMatch:h,treeIndex:x}},u=c({node:{children:r},isPseudoRoot:!0,currentIndex:-1});return{matches:u.matches,treeData:u.node.children}}const pd={find:ud,getDepth:cd,isDescendant:sd,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?$p({},e,{children:l[t].map((e=>o(e)))}):$p({},e)};return l[a].map((e=>o(e)))},getFlatDataFromTree:id,insertNode:od,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=td({treeData:t,getNodeKey:a,ignoreCollapsed:l,callback:e=>{let{node:t,treeIndex:a,path:u}=e;const p=u?u[u.length-1]:null;if(c||p!==n)return t;c=!0;const d=$p({},t);if(o&&(d.expanded=!0),!d.children)return s=a+1,$p({},d,{children:[r]});if("function"==typeof d.children)throw new Error("Cannot add to children defined by a function");let m=a+1;for(let e=0;e<d.children.length;e+=1)m+=1+Xp({node:d.children[e],ignoreCollapsed:l});return s=m,$p({},d,{children:i?[r,...d.children]:[...d.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{nd({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:ad,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return nd({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:nd,toggleExpandedForAll:rd,map:td,walk:ed,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=Kp({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:Xp};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)}function md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gd(e,t,r[t])}))}return e}function gd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hd=e=>{let{scaffoldBlockPxWidth:t,toggleChildrenVisibility:r,connectDragPreview:n,connectDragSource:a,isDragging:l,canDrop:o,canDrag:i,node:s,title:u,subtitle:p,draggedNode:d,path:m,treeIndex:g,isSearchMatch:h,isSearchFocus:f,buttons:b,className:y,style:x,didDrop:v,treeId:E,isOver:w,parentNode:C,rowDirection:O}=e,T=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 S=u||s.title,k=p||s.subtitle,N="rtl"===O?"rst__rtl":null;let I;i&&(I="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:Fp("rst__loadingCirclePoint",N)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const P=d&&sd(d,s),D=!v&&l;let A={left:-.5*t};return"rtl"===O&&(A={right:-.5*t}),c().createElement("div",dd({style:{height:"100%"}},T),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:Fp(s.expanded?"rst__collapseButton":"rst__expandButton",N),style:A,onClick:()=>r({node:s,path:m,treeIndex:g})}),s.expanded&&!l&&c().createElement("div",{style:{width:t},className:Fp("rst__lineChildren",N)})),c().createElement("div",{className:Fp("rst__rowWrapper",N)},n(c().createElement("div",{className:Fp("rst__row",D&&"rst__rowLandingPad",D&&!o&&"rst__rowCancelPad",h&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",N,y),style:md({opacity:P?.5:1},x)},I,c().createElement("div",{className:Fp("rst__rowContents",!i&&"rst__rowContentsDragDisabled",N)},c().createElement("div",{className:Fp("rst__rowLabel",N)},c().createElement("span",{className:Fp("rst__rowTitle",s.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof S?S({node:s,path:m,treeIndex:g}):S),k&&c().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof k?k({node:s,path:m,treeIndex:g}):k)),c().createElement("div",{className:"rst__rowToolbar"},b.map(((e,t)=>c().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))))))};hd.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},hd.propTypes={node:U().shape({}).isRequired,title:U().oneOfType([U().func,U().node]),subtitle:U().oneOfType([U().func,U().node]),path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,treeIndex:U().number.isRequired,treeId:U().string.isRequired,isSearchMatch:U().bool,isSearchFocus:U().bool,canDrag:U().bool,scaffoldBlockPxWidth:U().number.isRequired,toggleChildrenVisibility:U().func,buttons:U().arrayOf(U().node),className:U().string,style:U().shape({}),connectDragPreview:U().func.isRequired,connectDragSource:U().func.isRequired,parentNode:U().shape({}),isDragging:U().bool.isRequired,didDrop:U().bool.isRequired,draggedNode:U().shape({}),isOver:U().bool.isRequired,canDrop:U().bool,rowDirection:U().string};const fd=hd;function bd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class yd 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){bd(e,t,r[t])}))}return e}({},l))))))}}yd.defaultProps={canDrop:!1,draggedNode:null},yd.propTypes={children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),treeId:U().string.isRequired,drop:U().func.isRequired};const xd=yd,vd=(0,T.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"}}))),Ed=e=>{let{isOver:t,canDrop:r}=e;return vd(),c().createElement("div",{className:Fp("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};Ed.defaultProps={isOver:!1,canDrop:!1},Ed.propTypes={isOver:U().bool,canDrop:U().bool};const wd=Ed,Cd=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}},Od=Cd(od),Td=Cd(id),Sd=Cd(Xp);function kd(e){let{treeIndex:t}=e;return t}function Nd(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=>Nd(e))).join("")}function Id(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]?Nd(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Pd(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return Id("title",a,t,r,n)||Id("subtitle",a,t,r,n)}const Dd={defaultSearchMethod:Pd,defaultGetNodeKey:kd};var Ad=r(75047);class Rd{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,Ad.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=cd(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,N.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=Od({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,Sn.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,Sn.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,Sn.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 jd(){return jd=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},jd.apply(this,arguments)}function Zd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ld(e,t,r[t])}))}return e}function Ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let _d=1;const Md=e=>{const t=Zd({},e,{style:Zd({},e.theme.style,e.style),innerStyle:Zd({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Zd({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:fd,placeholderRenderer:wd,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:Gp};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class Vd extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:l}=Md(e);this.dndManager=new Rd(this),this.treeId=`rst__${_d}`,_d+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(xd),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(Bp._t||Bp.ZP)(Vp.aV),this.vStrength=(0,Bp.Kx)(l),this.hStrength=(0,Bp.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(){Vd.loadLazyChildren(this.props);const e=Vd.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,N.equals)(r.searchQuery,e.searchQuery)?r.searchFocusOffset!==e.searchFocusOffset&&Object.assign(n,Vd.search(e,t,!0,!0,!0)):Object.assign(n,Vd.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,N.equals)(this.props.treeData,e.treeData))this.state.draggingTreeData&&t.draggingTreeData!==this.state.draggingTreeData&&ed({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}=ad({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=nd({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Zd({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey})}catch(t){r=e}return r}),e)}}))}else if(this.props.treeData!==e.treeData){const t=(0,N.equals)(this.props.treeData,e.treeData),{ignoreOneTreeUpdate:r,instanceProps:n}=this.state,a={};t||(r?a.ignoreOneTreeUpdate=!1:(a.searchFocusTreeIndex=null,Vd.loadLazyChildren(this.props),Object.assign(a,Vd.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=Zd({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Td({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=nd({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Zd({},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}=od({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:p}=e,{instanceProps:d}=t;if(!s&&!c)return i&&i([]),{searchMatches:[]};const m={},{treeData:g,matches:h}=ud({getNodeKey:o,treeData:p?rd({treeData:d.treeData,expanded:!1}):d.treeData,searchQuery:s,searchMethod:c||Pd,searchFocusOffset:u,expandAllMatchPaths:n&&!a,expandFocusMatchPaths:!!n});n&&(m.ignoreOneTreeUpdate=!0,l(g)),i&&i(h);let f=null;return r&&null!==u&&u<h.length&&(f=h[u].treeIndex),m.searchMatches=h,m.searchFocusTreeIndex=f,m}startDrag(e){let{path:t}=e;this.setState((e=>{const{treeData:r,node:n,treeIndex:a}=ad({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=Od({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,N.pipe)((0,N.when)((0,N.always)((0,N.gt)(c.length,0)),(0,N.append)(c)),(0,N.uniqWith)((0,N.eqBy)(String)))(o);return{draggedNode:t,draggedDepth:r,draggedMinimumTreeIndex:n,draggingTreeData:nd({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Zd({},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=nd({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Zd({},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){ed({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(nd({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Zd({},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:p,path:d,lowerSiblingCounts:m,treeIndex:g}=e,{canDrag:h,generateNodeProps:f,scaffoldBlockPxWidth:b,searchFocusOffset:y,rowDirection:x}=Md(this.props),v=this.treeNodeRenderer,E=this.nodeContentRenderer,w=d[d.length-1],C=w in l,O=C&&l[w]===y,T={node:u,parentNode:p,path:d,lowerSiblingCounts:m,treeIndex:g,isSearchMatch:C,isSearchFocus:O},S=f?f(T):{},k="function"!=typeof h?h:h(T),N={treeIndex:g,scaffoldBlockPxWidth:b,node:u,path:d,treeId:this.treeId,rowDirection:x};return c().createElement(v,jd({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:o,swapLength:s,swapDepth:i},N),c().createElement(E,jd({parentNode:p,isSearchMatch:C,isSearchFocus:O,canDrag:k,toggleChildrenVisibility:this.toggleChildrenVisibility},N,S)))}render(){const{dragDropManager:e,style:t,className:r,innerStyle:n,rowHeight:a,isVirtualized:l,placeholderRenderer:o,reactVirtualizedListProps:i,getNodeKey:s,rowDirection:u}=Md(this.props),{searchMatches:p,searchFocusTreeIndex:d,draggedNode:m,draggedDepth:g,draggedMinimumTreeIndex:h}=this.state,f=this.state.draggingTreeData||this.props.treeData,b="rtl"===u?"rst__rtl":null;let y,x=null,v=null;if(m&&null!==h){const e=Od({treeData:f,newNode:m,depth:g,minimumTreeIndex:h,expandParent:!0,getNodeKey:s}),t=h;x=e.treeIndex,v=1+Sd({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),x,t,v)}else y=this.getRows(f);const E={};p.forEach(((e,t)=>{let{path:r}=e;E[r[r.length-1]]=t}));const w=null!==d?{scrollToIndex:d}:{};let C,O=t;if(y.length<1){const e=this.treePlaceholderRenderer,t=o;C=c().createElement(e,{treeId:this.treeId,drop:this.drop},c().createElement(t,null))}else if(l){O=Zd({height:"100%"},O);const t=this.scrollZoneVirtualList;C=c().createElement(Vp.qj,null,(r=>{let{height:l,width:o}=r;return c().createElement(t,jd({},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:E,swapFrom:x,swapDepth:g,swapLength:v})}},i))}))}else C=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:E,swapFrom:x,swapDepth:g,swapLength:v})));return c().createElement("div",{className:Fp("rst__tree",r,b),style:O},C)}}Vd.propTypes={classes:U().object,dragDropManager:U().shape({getMonitor:U().func}).isRequired,treeData:U().arrayOf(U().object).isRequired,style:U().shape({}),className:U().string,innerStyle:U().shape({}),rowHeight:U().oneOfType([U().number,U().func]),slideRegionSize:U().number,reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,maxDepth:U().number,searchMethod:U().func,searchQuery:U().any,searchFocusOffset:U().number,searchFinishCallback:U().func,generateNodeProps:U().func,isVirtualized:U().bool,treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func,theme:U().shape({style:U().shape({}),innerStyle:U().shape({}),reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,slideRegionSize:U().number,rowHeight:U().oneOfType([U().number,U().func]),treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func}),getNodeKey:U().func,onChange:U().func.isRequired,onMoveNode:U().func,canDrag:U().oneOfType([U().func,U().bool]),canDrop:U().func,canNodeHaveChildren:U().func,shouldCopyOnOutsideDrop:U().oneOfType([U().func,U().bool]),onVisibilityToggle:U().func,dndType:U().string,onDragStateChanged:U().func,onlyExpandSearchedNodes:U().bool,rowDirection:U().string,onLazyLoadChildren:U().func,ignoreTreeChanges:U().bool},Vd.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:kd,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,Up.polyfill)(Vd);const Bd=(0,zp.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"}})))(Vd),Ud=e=>c().createElement(Sn.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(Bd,jd({},e,{dragDropManager:r}))})),zd=e=>c().createElement(Sn.DndProvider,{backend:kn.default},c().createElement(Ud,e));var Fd=r(17822),Hd=r(31396);const Wd=(0,T.Z)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),qd=e=>"horizontal"===e,Gd=e=>{let{className:t,children:r,orientation:n,defaultSize:a,size:l,minSize:o,maxSize:i,allowResize:p,onChange:d}=e;const m=Wd(),g=(0,wc.Z)(),[h,f]=(0,s.useState)(),[y,x]=(0,s.useState)(!0),v=(0,s.useCallback)((()=>x(!0)),[]),E=(0,s.useCallback)((()=>x(!1)),[]),w=()=>qd(n)?null==h?void 0:h.clientHeight:null==h?void 0:h.clientWidth,C=(0,s.useCallback)((0,u.DsO)((e=>{const t=w();d({percentageSize:e/t*100+"%",isMaxSize:i>0?e===i:e===t+i,isMinSize:e===o})}),250),[d,n,i,h]),O=(0,s.useMemo)((()=>({transition:g.transitions.create(qd(n)?"height":"width",{easing:g.transitions.easing.sharp,duration:g.transitions.duration.leavingScreen})})),[n,g]);return"number"==typeof l&&l<0&&(l=(w()||0)+l),c().createElement("div",{ref:f,className:b()(m.container,t)},c().createElement(Hd.Z,{split:n,size:l,allowResize:p,onChange:C,defaultSize:a,minSize:o,maxSize:i,onDragStarted:E,onDragFinished:v,pane1Style:y?O:void 0},r))},$d=U().oneOfType([U().number,U().string]);Gd.propTypes={className:U().string,children:U().arrayOf(U().node).isRequired,orientation:U().oneOf(["horizontal","vertical"]).isRequired,defaultSize:$d,size:$d,minSize:$d,maxSize:$d,allowResize:U().bool,onChange:U().func};const Yd=Gd;var Kd=r(15311);function Xd(){return Xd=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},Xd.apply(this,arguments)}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 em=e=>{let{classes: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,["classes"]);const n=(0,Kd.y)({});return c().createElement(Vr.Z,Xd({classes:Qd({},t,{focused:n.white})},r))};var tm=r(72654);function rm(){return rm=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},rm.apply(this,arguments)}const nm=e=>{let{open:t,anchorEl:r,className:n,onClose:a,containerWidth:l,containerHeight:o,paperProps:i,listContent:s,externalInputField:u,classes:p={}}=e;const d=Mr({containerWidth:l,containerHeight:o});return c().createElement("div",{className:p.root},u,c().createElement(Ye.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(tm.Z,t,c().createElement(Ge.Z,rm({elevation:2},i),c().createElement("div",{className:b()(d.container,n),style:{width:l}},c().createElement("div",{className:d.list},s))))})))};nm.propTypes={open:U().bool,anchorEl:U().object,className:U().string,onClose:U().func,containerWidth:U().number,containerHeight:U().number,paperProps:U().object,listContent:U().element,externalInputField:U().element,classes:U().shape({root:U().string})},nm.defaultProps={popoverAnchorOrigin:{vertical:"top",horizontal:"right"}};const am=nm,lm=(0,T.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%"}}),om=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:l}=e;const o=lm(),[i,...u]=n,p=0===u.length;(0,s.useEffect)((()=>{p&&t!==i.value&&r(i.value)}),[i.value]);const d=!!l;return c().createElement("div",{className:a.root},p?c().createElement(E.Z,{className:a.onlyValue||o.onlyValue,variant:"h6"},i.label):c().createElement(Sc.Z,{displayEmpty:d,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:d?[{value:"",label:l},...n]:n,onChange:e=>r(e||null)}))};om.propTypes={value:U().string,onChange:U().func,options:U().arrayOf(U().shape({value:U().string,label:U().string})),classes:U().shape({root:U().string,onlyValue:U().string,select:U().string,selectMenu:U().string,textField:U().string}),emptyLabel:U().string};const im=om,sm=(0,T.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,rt.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 cm(){return cm=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},cm.apply(this,arguments)}const um=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:a}=e;const l=sm();return c().createElement("div",{className:b()(l.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 c().createElement(ye.k,cm({},n,{size:"S",key:t,className:b()({[l.active]:r===t},l.buttonWrapper),onClick:()=>a(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))};function pm(){return pm=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},pm.apply(this,arguments)}const dm=e=>c().createElement("svg",pm({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})))),mm=(0,T.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"}}))),gm=e=>{let{IconRenderer:t=dm,text:r,secondaryText:n}=e;const a=mm();return c().createElement("div",{className:a.root},c().createElement(t,{className:a.logo}),c().createElement("div",{className:a.textBox},c().createElement(E.Z,{className:a.text},r),n&&c().createElement(E.Z,{className:a.secondaryText},n)))},hm=(0,T.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})}}))),fm=e=>{let{width:t,open:r,children:n}=e;const a=hm();return c().createElement("div",{className:a.contentWrapper,style:{width:`${r?t:0}px`}},r&&c().createElement(c().Fragment,null,n))},bm=(0,T.Z)({container:{display:"flex",flexShrink:0,height:"63px",alignItems:"center",borderBottom:"1px solid rgba(0,0,0,0.12)"},icon:{margin:"0 20px"},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"19px 17px"},secondTitle:{fontSize:"14px"}}),ym=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:a,rightContent:l}=e;const o=bm();return c().createElement("div",{className:o.container},c().createElement(ye.k,{size:"S",icon:Wn.default,onClick:t,className:o.icon,tooltipTitle:x().text("Close")}),a||c().createElement(c().Fragment,null,c().createElement(E.Z,{variant:"h6"},r),c().createElement(Zr.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),c().createElement(E.Z,{variant:"body1",color:"textSecondary",className:o.secondTitle},n),l))};var xm=r(21210),vm=r(79935);const Em=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"}})};Em.propTypes={height:U().number,margin:U().number};const wm=Em,Cm=e=>{let{label:t}=e;return t||null},Om=e=>{let{value:t}=e;return t||null},Tm=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const l=e=>{const t=e.cellRenderer||Om,r=e.headCellRenderer||Cm;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)))};Tm.propTypes={rowsData:U().arrayOf(U().shape({id:U().string,label:U().string,headCellRenderer:U().func,cellRenderer:U().func})),columnsData:U().arrayOf(U().object),theadRowsNumber:U().number,className:U().string};const Sm=(0,s.memo)(Tm);var km=r(83543);const Nm=(0,T.Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}}))),Im=e=>{let{active:t,onClick:r,className:n}=e;const a=Nm();return c().createElement(he.Z,{className:b()(a.viewMoreLessLink,n),onClick:r,underline:"none"},c().createElement(km.Z,{className:b()(a.arrow,{[a.rotated]:t})}),t?x().text("View less"):x().text("View more"))};Im.propTypes={active:U().bool,onClick:U().func,className:U().string};const Pm=Im;var Dm=r(29611),Am=r(50581),Rm=r(21853);const jm=(0,T.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"}}),Zm=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=jm(),u=n&&n.length;return l?c().createElement(Dm.Z,{className:i.input,value:n,autoFocus:!0,placeholder:x().text("Search"),disableUnderline:!0,onChange:(0,N.pipe)(Cn.NA,a),startAdornment:c().createElement(Am.Z,{position:"start"},c().createElement(Rm.Z,{className:i.startAdornment})),endAdornment:c().createElement(Am.Z,{position:"end"},u&&c().createElement(_t.Z,{size:"S",icon:Wn.default,onClick:(0,N.pipe)(N.F,o,(0,N.always)(""),(0,N.tap)(r),a)})),onKeyPress:(0,N.when)((0,N.propEq)("key","Enter"),(0,N.pipe)((0,N.always)(n),N.trim,r))}):c().createElement(Xa.Z,{className:i.searchButton,onClick:(0,N.pipe)(N.T,o)},c().createElement(Rm.Z,null))};var Lm,_m=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(Lm||(Lm={}));const Mm=()=>{const[e,t]=(0,s.useState)(null),r=e===Lm.READING,n=e===Lm.EDITING,a=e===Lm.HOVERED;(0,s.useEffect)((()=>{t(Lm.READING)}),[]);const l=(0,s.useCallback)((0,u.DsO)(t,50),[]),o=(0,s.useCallback)((()=>{n||l(Lm.HOVERED)}),[l,n]),i=(0,s.useCallback)((()=>{n||l(Lm.READING)}),[l,n]);return{setReadingMode:(0,s.useCallback)((()=>t(Lm.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(Lm.EDITING)),[t]),onMouseLeave:i,onMouseEnter:o,isReadingMode:r,isEditingMode:n,isHovered:a}};const Vm=(0,s.createContext)(null),Bm=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(Vm.Provider,{value:r},t)},Um=e=>{const{getCrosswalkColor:t=(0,N.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(Vm)||{};return e?t(e):""},zm=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(Vm)||{};return e},Fm=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=Cn.ZT}=(0,s.useContext)(Vm)||{},n=!!e&&!!t.find((0,N.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])}},Hm=e=>{const{toggleCrosswalkFocus:t=Cn.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(Vm)||{};return{isFocused:!!e&&r.some((0,N.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var Wm=r(72753);const qm=(0,T.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"}}}),Gm=(0,T.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),$m=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:l,isFocused:o}=Hm(t),i=qm({color:r,isFocused:o}),s=(0,g.useSelector)(h.ZP.selectors.getMetadata),{label:p}=(0,u.PWK)(s,t.type);return c().createElement("div",{className:b()(i.sourceItem,n)},c().createElement(xm.Z,{className:i.sourceIcon,sourceType:t.type}),c().createElement("div",{className:i.sourceInfo},c().createElement("div",null,c().createElement("span",{className:i.label},p),a&&c().createElement(ye.k,{icon:Wm.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:x().text("Focus"),onClick:()=>l()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},Ym=(0,T.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 Km(){return Km=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},Km.apply(this,arguments)}const Xm=e=>{const t=Ym();return c().createElement(le.ZP,Km({},e,{classes:t,arrow:!0}))},Qm=e=>{let{crosswalk:t,className:r}=e;const n=Um(t),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Fm(t),i=qm({isOpaque:!a,color:n});return c().createElement(Xm,{title:c().createElement($m,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:b()(i.crosswalkIcon,r),onMouseEnter:()=>l(),onMouseLeave:()=>o()}))};var Jm=r(27604);const eg=(0,T.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 tg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rg=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],ng=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:l,onEdit:o}=e;const i=eg({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),p=(0,u.PFL)(t),d=sa(r,p),[m,g]=(0,s.useState)(d),h={className:i.textField,InputProps:{disableUnderline:!0,classes:{root:i.input,multiline:i.inputMultiline}}},f=()=>{const e=ca(t,m);if(!(0,N.isNil)(m)&&!(0,N.equals)(m,d)){const n=(0,u.CwH)(t)?{value:e.value,lookupCode:e.lookupCode}:{value:""===m&&(0,u.FVt)(p.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){tg(e,t,r[t])}))}return e}({},r,n))}l()};return c().createElement(_r.ZP,{open:!!a,anchorEl:a.current,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},classes:{paper:b()(i.paper,{[i.booleanEditor]:(0,u.T6Y)(p.type),[i.timestampEditor]:(0,u.j5n)(p.type)}),root:i.popoverRoot},onKeyUp:e=>{"Enter"!==e.key||rg.includes(p.type)?"Escape"===e.key&&l():f()},onBackdropClick:f},c().createElement(na.Z,{autoFocus:!0,dataTypeDefinition:p,fieldName:(0,u.Tde)(t.uri),onChange:g,TextFieldProps:h,value:m,fullWidth:!0}))};function ag(){return ag=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},ag.apply(this,arguments)}const lg=e=>c().createElement("svg",ag({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 og(){return og=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},og.apply(this,arguments)}const ig=e=>c().createElement("svg",og({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})),sg=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,icon:t?lg:ig,tooltipTitle:n?x().text("You don't have permissions to ignore"):x().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};function cg(){return cg=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},cg.apply(this,arguments)}const ug=e=>c().createElement("svg",cg({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 pg(){return pg=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},pg.apply(this,arguments)}const dg=e=>c().createElement("svg",pg({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})),mg=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?ug:dg,tooltipTitle:n?"You don't have permissions to pin":x().text("Pin"),size:"XS",disableRipple:!0})},gg=(0,T.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"}}))),hg=(0,lt.Z)(Va.Z),fg=e=>{let{styles:t,icon:r,text:n}=e;return c().createElement(c().Fragment,null,r,c().createElement(E.Z,{classes:{root:t.menuText}},n))},bg=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=gg(),{disabled:l,text:o,tooltip:i,onClick:s,id:u="",icon:p,crosswalk:d,color:m}=r;return d?c().createElement($m,{className:a.sourceItem,color:m,crosswalk:d,focusable:!0}):c().createElement(hg,{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(fg,{icon:p,text:o,styles:a}))}));bg.displayName="CrosswalkMenuItem";const yg=bg;function xg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vg=(0,T.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){xg(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"}}))),Eg=e=>{let{className:t,dataReltioId:r,attributeType:n=null,attributeValue:a,crosswalk:l,disableEdit:o,disableDelete:i,onIgnore:p,onEdit:d,onPin:m,onDelete:g}=e;const{isReadingMode:h,isEditingMode:f,isHovered:y,onMouseEnter:v,onMouseLeave:E,setReadingMode:w,setEditingMode:C}=Mm(),O=(0,s.useRef)(),T=(0,u.nIW)(a.uri),S=(0,u.x_)(l),k=!n.system&&!S,N=k&&!o&&(0,u.Z5t)(u.fO_.EDITING,n),I=k&&!i&&(0,u.Edd)(u.fO_.EDITING,n),P=(0,u.ZiX)(a.uri),D=!P&&(!h&&N||a.pin),A=!P&&(!h&&N||a.ignored),R=Um(l),{isHighlighted:j,isDimmed:Z,highlightCrosswalk:L,removeHighlight:_}=Fm(l),M=vg({variant:S?"outlined":"filled",opaque:!Z,fullyColored:j,color:R}),V=[{crosswalk:l,color:R},{disabled:!N,text:x().text("Edit"),icon:c().createElement(Jm.Z,null),tooltip:N?null:x().text("You don't have permissions to edit"),onClick:()=>C(),id:"edit"},{disabled:!I,text:x().text("Delete"),icon:c().createElement(ra.Z,null),tooltip:I?null:x().text("You don't have permissions to delete"),onClick:()=>g({attributeType:n,attributeValue:a,crosswalks:[l]}),id:"delete"}],B=()=>{_(),w()};return c().createElement("div",{ref:O,className:b()(t,M.root),onMouseEnter:()=>{L(),v()},onMouseLeave:()=>{_(),E()},"data-reltio-id":r},c().createElement("div",{className:M.attributeValue},c().createElement(at.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:M.actions},D&&c().createElement(mg,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!N}),A&&c().createElement(sg,{isIgnored:a.ignored,onClick:()=>p({attributeValue:a}),disabled:!N}),y&&c().createElement(be.Z,{MenuItemRenderer:yg,menuId:`simple-attribute-additional-actions-${T}`,buttonComponent:ye.k,buttonProps:{icon:fe.Z,size:"XS",tooltipTitle:x().text("More actions")},onMenuClose:B,menuItems:V})),f&&c().createElement(ng,{attributeType:n,attributeValue:a,color:R,onClose:B,onEdit:e=>d({attributeType:n,attributeValue:e,crosswalk:l}),containerRef:O}))},wg=(0,T.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 Cg(){return Cg=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},Cg.apply(this,arguments)}const Og=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=wg(),[{isDragItemOver:p},d]=(0,Sn.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:d,className:s.simpleAttributesWrapper},t.map((e=>{var t;return null===(t=l[e.uri])||void 0===t?void 0:t.map((t=>c().createElement(Eg,Cg({key:e.uri+t.uri,attributeType:r,attributeValue:e,crosswalk:t,disableEdit:a,dataReltioId:"value-index-"+m++},i))))})),p&&c().createElement("div",{className:s.dropIndicator},x().text("Drop here")))};function Tg(){return Tg=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},Tg.apply(this,arguments)}const Sg=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(Le.Z,{variant:"text",color:"primary",onClick:()=>a({parentUri:l,attributeType:n,index:0})},x().text("Create attribute")):c().createElement("div",{className:t},r.map((e=>c().createElement(Jg,Tg({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:o},i)))))},kg=e=>{let{children:t}=e;const r=Gm();return c().createElement(E.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},Ng=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));function Ig(){return Ig=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},Ig.apply(this,arguments)}const Pg=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=Ng(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,g.useSelector)(h.ZP.selectors.getUIPath),i=c().createElement(kg,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,N.pipe)(u.tF$,(0,N.map)((e=>(0,u.zeJ)(l,e))),(0,N.reject)(N.isNil))(r);return c().createElement(Xg,Ig({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},n))};function Dg(){return Dg=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},Dg.apply(this,arguments)}const Ag=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(Pg,Dg({key:e.uri,attributeValue:e},n)))))},Rg=(0,T.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function jg(){return jg=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},jg.apply(this,arguments)}const Zg={imageWidth:55,imageHeight:45},Lg=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=Rg();return c().createElement(Xg,jg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(Er,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Zg})},n))};function _g(){return _g=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},_g.apply(this,arguments)}const Mg=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(Lg,_g({key:e.uri,attributeValue:e},n)))))},Vg=(0,T.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));function Bg(){return Bg=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},Bg.apply(this,arguments)}function Ug(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 zg=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:l}=e,o=Ug(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=Vg(),[p,d]=(0,s.useState)(a),m=(0,N.propOr)(r.length,"totalValues",n),g=a<m,h=g&&p<m,f=g&&p>=m,b=r.slice(0,p),y=m-p;return c().createElement("div",{className:i.wrapper},(e=>{switch(t.type){case u.oS0.TYPE_NESTED:return c().createElement(Sg,Bg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=o,n=Ug(o,["crosswalksMap"]);return c().createElement(Ag,Bg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(Mg,Bg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));default:return c().createElement(Og,Bg({attributeValues:e,attributeType:t},o))}})(b),h&&c().createElement(sr,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&l(),d(p+a)}}),f&&c().createElement(ur,{onClick:()=>{d(a)}}))},Fg=(0,T.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function Hg(){return Hg=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},Hg.apply(this,arguments)}const Wg=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=Fg();return c().createElement(c().Fragment,null,t.filter(u.Uty).map((e=>c().createElement(D,{key:e.uri,enabled:!0},c().createElement(Q,{className:a.title,label:e.label,attributeType:e}),c().createElement(zg,Hg({attributeType:e,attributeValues:r[e.name],paging:(0,N.path)(["paging",e.uri],r)},n))))))},qg=e=>{let{onClick:t}=e;return c().createElement(ye.k,{icon:ra.Z,tooltipTitle:x().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},Gg=(0,s.createContext)(null),$g=e=>{let{children:t,attributeUris:r}=e;return c().createElement(Gg.Provider,{value:r},t)},Yg=e=>((0,s.useContext)(Gg)||[]).some((t=>(0,u.sOy)(t,e))),Kg=(0,T.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"}}}))),Xg=e=>{let{attributeType:t,attributeValue:r,attributeTypesList:n,label:a,crosswalksMap:l,disableEdit:o,disableDelete:i,onPin:p,onIgnore:d,onDelete:m,onEdit:g,onAdd:h}=e;const f=Kg(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:x}=Mm(),v=!o&&(0,u.Z5t)(u.fO_.EDITING,t),E=!i&&(0,u.Edd)(u.fO_.EDITING,t),w=(0,u.ZiX)(r.uri),C=!w&&(!b&&v||r.pin),O=!w&&(!b&&v||r.ignored),T=!b&&E,S=Yg(r.uri),[k,I]=(0,s.useState)(S||w);(0,te.D)((()=>{S&&I(S)}),[S]);const P=(0,N.pipe)((0,N.pickBy)(((e,t)=>(0,u.sOy)(t,null==r?void 0:r.uri))),N.values,N.flatten,(0,N.uniqBy)((0,N.prop)("uri")))(l);return c().createElement(c().Fragment,null,c().createElement("div",{className:f.root,onMouseEnter:y,onMouseLeave:x},c().createElement(Ut,{onClick:()=>I((e=>!e)),expanded:k}),c().createElement("span",null,a,P.map((e=>c().createElement(Qm,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(vm.Z,null),c().createElement("div",{className:f.actions},C&&c().createElement(mg,{disabled:!v,isPinned:r.pin,onClick:()=>p({attributeValue:r})}),O&&c().createElement(sg,{disabled:!v,isIgnored:r.ignored,onClick:()=>d({attributeValue:r})}),T&&c().createElement(qg,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:l[r.uri]})}))),k&&c().createElement(Wg,{attributeTypes:n,attributes:r.value,parentUri:r.uri,crosswalksMap:l,disableEdit:!v,disableDelete:!E,onPin:p,onIgnore:d,onDelete:m,onEdit:g,onAdd:h}))};function Qg(){return Qg=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},Qg.apply(this,arguments)}const Jg=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(kg,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(Xg,Qg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var eh=r(33286),th=r(49429),rh=r(55999),nh=r(79249);const ah=(0,T.Z)({paper:{minHeight:"180px"},title:{padding:"16px 16px 10px 16px",fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px"},content:{padding:"0 16px"},contentText:{marginBottom:0,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px"},actionButtons:{display:"flex",paddingTop:"4px",fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px","& > div":{marginLeft:"auto"}},discardButton:{marginRight:"8px"}}),lh=e=>{let{open:t,title:r,content:n,onCancel:a,cancelCaption:l=x().text("Cancel"),onDiscard:o,discardCaption:i="",onSave:s,saveCaption:u=x().text("Save"),disabledSave:p=!1}=e;const d=ah();return c().createElement(Nn.Z,{open:t,onClose:a,classes:{paperScrollPaper:d.paper}},c().createElement(nh.Z,{classes:{root:d.title}},r),c().createElement(mo.Z,{classes:{root:d.content}},c().createElement(rh.Z,{classes:{root:d.contentText}},n)),c().createElement(th.Z,{className:d.actionButtons,disableSpacing:!0},a&&c().createElement(Le.Z,{onClick:a},l),c().createElement("div",null,o&&c().createElement(Le.Z,{onClick:o,classes:{root:d.discardButton}},i),c().createElement(Le.Z,{onClick:s,color:"primary",disabled:p,autoFocus:!0},u))))},oh=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(Nn.Z,{open:t},c().createElement(mo.Z,null,c().createElement(rh.Z,null,x().text("Are you sure you want to delete this?"))),c().createElement(th.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("No")),c().createElement(Le.Z,{onClick:()=>{n(),r()},color:"primary"},x().text("Yes"))))};var ih=r(92332);const sh=(0,T.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}}))),ch=e=>{const t=sh();return c().createElement("div",{className:b()(t.headCell,t.coloredCell)},c().createElement(ih.default,e),e.children)},uh=(0,T.Z)({root:{marginBottom:"-6px"}}),ph=(0,Di.Z)((0,N.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:l}=e;const o=uh(),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),s=[...i.entityTypes,...i.relationTypes||[]].find((0,N.propEq)("uri",t)),p=e=>!(null!=n&&n.find((0,N.propEq)("uri",e.uri))),d=(0,N.pipe)((0,N.propOr)([],"attributes"),(0,N.reject)((0,N.either)(u.YkG,u.Or$)),(0,N.filter)((0,N.either)(u.QZu,p)),(0,N.filter)((0,N.both)(u.Uty,(e=>(0,u.Vg3)({attributeType:e,mode:u.fO_.EDITING})))))(s);return c().createElement("div",{className:o.root},c().createElement(en,{label:x().text("Attribute"),popupTitle:x().text("Add attributes"),data:d,onApply:e=>{const t=e.filter(p);t.length>0&&a([...t,...n]),e.filter(u.QZu).forEach((e=>{l({attributeType:e,parentUri:r})}))}}))}));const dh=(0,Di.Z)((0,N.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(ch,r):c().createElement(ch,r,c().createElement(vm.Z,null),c().createElement(ph,null))})),mh=e=>{let{value:t}=e;const r=sh();return c().createElement("div",{className:r.cellValueWrapper},t)},gh=(0,T.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function hh(){return hh=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},hh.apply(this,arguments)}const fh=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=gh();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(zg,hh({attributeValues:t},r)))};function bh(){return bh=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},bh.apply(this,arguments)}const yh=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=gh(),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(Jg,bh({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function xh(){return xh=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},xh.apply(this,arguments)}const vh=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=gh(),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(Pg,xh({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,l)};function Eh(){return Eh=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},Eh.apply(this,arguments)}const wh=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=gh();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(Lg,Eh({attributeValue:e},r))))))};function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oh=(0,Di.Z)((0,N.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(yh,t);case u.oS0.TYPE_REFERENCE:return c().createElement(vh,t);case u.oS0.TYPE_IMAGE:return c().createElement(wh,t);default:return c().createElement(fh,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){Ch(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,disableEdit:s,disableDelete:s}))})),Th=e=>{let{value:{values:t,attributeType:r}}=e;const n=sh();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(Q,{className:n.attributeTitle,label:r.label,attributeType:r}),c().createElement(ki,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},Sh=e=>{let{value:t}=e;const r=sh();return c().createElement("div",{className:b()(r.cellValueWrapper,r.count)},t)};var kh=r(11776),Nh=r(38402),Ih=r(49378),Ph=r(99144);const Dh=e=>{let{sourcesUriOrder:t}=e;const r=sh(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Nh.Z,{key:e,className:r.popupItem},c().createElement(xm.Z,{className:r.sourceIcon,sourceType:e}),c().createElement(Ih.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Ah=e=>{let{attributeUri:t}=e;const r=sh(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Nh.Z,{key:a.uri,className:r.popupItem},c().createElement(Ih.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},Rh=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),()=>x().text("Source sequence")],[(0,N.prop)("primaryAttributeUri"),()=>x().text("Attribute winner")],[(0,N.prop)("comparisonAttributeUri"),()=>x().text("Comparison attribute")]]),jh=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(Dh,{sourcesUriOrder:t})}],[(0,N.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}],[(0,N.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}]]),Zh=e=>{let{info:t}=e;const r=sh(),[n,a]=(0,s.useState)(null),l=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(ye.k,{icon:Ph.Z,tooltipTitle:x().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(_r.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(Xa.Z,{className:r.closeButton,onClick:l},c().createElement(Wn.default,null)),c().createElement(E.Z,{variant:"subtitle1",className:r.popupTitle},Rh(t))),c().createElement(kh.Z,{component:"div",className:r.popupItemsWrapper},jh(t))))},Lh=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const l=sh(),o=r||n||a;return c().createElement("div",{className:b()(l.cellValueWrapper,l.ruleType)},c().createElement("div",{className:l.ruleTypeLabel},t.label),o&&c().createElement(Zh,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function _h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mh=(0,T.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){_h(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 Vh(){return Vh=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},Vh.apply(this,arguments)}const Bh=(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=Mh({color:r,opacity:n,variant:a});return c().createElement("div",Vh({ref:t,className:b()(s.item,o)},i),l)})),Uh=e=>{let{crosswalk:t}=e;const r=sh(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Fm(t);return c().createElement(Bh,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>l(),onMouseLeave:()=>o()},c().createElement(xm.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(Ih.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},zh=e=>{let{value:{crosswalks:t}}=e;const r=sh();return c().createElement(kh.Z,{component:"div"},t.map((e=>c().createElement(Nh.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(Uh,{crosswalk:e})))))},Fh=[{id:"ovValues",get label(){return x().text("Attributes & OV")},hideable:!1,initialWidth:360,minWidth:250},{id:"winnerSources",get label(){return x().text("Winner source systems")},initialWidth:220},{id:"ruleType",get label(){return x().text("Rule type")},initialWidth:200},{id:"count",get label(){return x().text("Count")},initialWidth:80,minWidth:80},{id:"values",get label(){return x().text("Attribute values")},hideable:!1}],Hh=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),Wh=["ovValues","ruleType","values"],qh=e=>{switch(e){case"ovValues":return Th;case"values":return Oh;case"count":return Sh;case"ruleType":return Lh;case"winnerSources":return zh;default:return mh}},Gh=(0,N.pipe)(u.cwx,(0,N.sortWith)([(0,N.descend)((0,N.propOr)(-1,"priority"))]),(0,N.map)((0,N.prop)("uri"))),$h=(0,N.curry)(((e,t)=>(0,u.YkG)(e)&&t&&(0,N.pipe)(u.c31,(0,N.find)((r=>r.slice((0,u.u5q)(r).length)===t.slice(e.uri.length))))(e)||t)),Yh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return(0,N.pipe)((0,N.filter)(Hh),(0,N.chain)((e=>(0,N.pipe)((0,N.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||Hh(l))})),N.values,N.flatten)(t))),(0,N.uniqBy)((0,N.prop)("uri")))(e)},Kh=(0,N.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?dh:ch,rowCellValueRenderer:qh(t)}})),Xh=(e,t,r,n,a,l)=>{switch(e){case"ovValues":return{attributeType:n,values:null==l?void 0:l.filter(Hh)};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,N.propEq)("uri",r)),o=null==l||null===(n=l.survivorshipGroups)||void 0===n?void 0:n.find((0,N.propEq)("default",!0)),i=null==o||null===(a=o.mapping)||void 0===a?void 0:a.find((0,N.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,N.uniq)([...(null==i?void 0:i.sourcesUriOrder)||[],...(null==o?void 0:o.sourcesUriOrder)||[],...Gh(e)]):void 0,p=$h(t),d=(e=>"configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk"===(null==e?void 0:e.uri))(s)?p(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)?p(null==i?void 0:i.comparisonAttributeUri):void 0;return{ruleType:s,sourcesUriOrder:c,primaryAttributeUri:d,comparisonAttributeUri:m}})(t,n,r);case"winnerSources":return{crosswalks:Yh(l,a)};default:return null}};function Qh(){return Qh=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},Qh.apply(this,arguments)}const Jh=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=sh(),i=0===n;return c().createElement("div",{className:b()(o.rowCell,i&&o.coloredCell),"data-reltio-id":`column-name-${a.id}`},t.values.map(((e,t)=>c().createElement(r,Qh({key:t,value:e},l)))))};var ef=r(44962),tf=r(2682),rf=r(84899);const nf=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[l,o]=(0,s.useState)("without");return c().createElement(Nn.Z,{open:t,onEnter:()=>o("without")},c().createElement(mo.Z,null,c().createElement(rh.Z,null,x().text("You are attempting to change a value that is presently ignored.")),c().createElement(aa.Z,{component:"fieldset"},c().createElement(rf.Z,{component:"legend"},x().text("Please choose an option:")),c().createElement(tf.Z,{value:l,onChange:(0,N.pipe)(Cn.NA,o)},c().createElement(Ar.Z,{value:"without",control:c().createElement(ef.Z,null),label:x().text("Save without Ignore")}),c().createElement(Ar.Z,{value:"with",control:c().createElement(ef.Z,null),label:x().text("Save and apply Ignore to new value")})))),c().createElement(th.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("Cancel")),c().createElement(Le.Z,{onClick:()=>{"with"===l?a():n(),r()},color:"primary"},x().text("Ok"))))},af=(0,T.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 lf(){return lf=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},lf.apply(this,arguments)}const of=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=Wh,onChangeVisibleColumns:l,readOnly:o,onDelete:i=Cn.ZT,onPin:p=Cn.ZT,onIgnore:d=Cn.ZT,onEdit:m=Cn.ZT,onAdd:f=Cn.ZT,selectedAttributeTypes:b,onSelectAttributeTypes:y=Cn.ZT}=e;const v=af(),E=(0,s.useMemo)((()=>(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return a.includes(t)})),Kh)(Fh)),[a]),{type:w,uri:C,attributes:T={}}=t||{},S=(0,g.useSelector)(h.ZP.selectors.getMetadata);(0,s.useEffect)((()=>{if(t&&(0,N.isNil)(b)){const e=(0,N.pipe)(N.keys,(0,N.without)(["paging"]),(0,N.map)((0,u.tCm)(w)),(0,N.map)((e=>(0,u.zeJ)(S,e,w))),(0,N.filter)(u.Uty))(T);y(e)}}),[t,b]);const k=(0,s.useMemo)((()=>w?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,N.pipe)((0,N.reduce)(((r,n)=>(0,N.assoc)(n,Xh(n,e,t,l,s,i),r)),{}),(0,N.assoc)("rawValue",i))(r)}))}(S,w,b,a,n,T):[]),[S,w,b,a,T,n]),{getDynamicRowCellHeight:I,changeRowCellHeight:P}=Rs(),D=(0,s.useCallback)((e=>c().createElement(Ts,lf({onChangeHeight:P},e),c().createElement(Jh,e))),[P]),A=(0,s.useCallback)((0,N.either)(I,(0,N.always)(68)),[I]),[R,j]=(0,s.useState)(null),[Z,L]=(0,s.useState)(null),_=(0,s.useCallback)((e=>{e.attributeValue.ignored?L(e):m(e)}),[m,L]),M=(0,s.useMemo)((()=>({onDelete:j,onPin:p,onIgnore:d,onEdit:_,onAdd:f,parentUri:C,parentTypeUri:w,selectedAttributeTypes:b,onSelectAttributeTypes:y,readOnly:o})),[j,p,d,_,f,C,w,b,y,o]);return c().createElement("div",{className:v.tableContainer},c().createElement(O.Z,{classes:{root:v.tableHeader},title:x().text("Sources")},c().createElement(ts,{columnsData:Fh,selectedColumns:a,onChangeColumns:l})),c().createElement("div",{className:v.tableContent},r&&c().createElement(Dn,null),c().createElement(Pi.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:E,rowsData:k,renderRowCell:D,getRowCellHeight:A,context:M})),c().createElement(oh,{open:!!R,onClose:()=>j(null),onConfirm:()=>i(R)}),c().createElement(nf,{open:!!Z,onClose:()=>L(null),onConfirmEditWithIgnore:()=>m(Z),onConfirmEditWithoutIgnore:()=>{d({attributeValue:Z.attributeValue}),m(Z)}}))}));function sf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cf(e,t,r[t])}))}return e}function cf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uf=[],pf=e=>{let{entity:t,onLoad:r=Cn.ZT,onModify:n=Cn.ZT,onError:a=Cn.ZT}=e;const[l,o]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),p=(0,s.useRef)([]),d=(0,s.useRef)(null),m=(0,s.useCallback)((()=>{d.current=null}),[]),[g,h]=(0,s.useState)(uf),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,N.pipe)(u.HQx,f)(t)};if((null==l?void 0:l.uri)===(null==t?void 0:t.uri)&&d.current){const{ownerType:t}=d.current,r=Object.keys(e[t]),n=Object.keys(i[t]);h((0,N.difference)(r,n))}else h(uf);m(),o(t),c(e),p.current=[]}),[t]);const b=(0,s.useCallback)((0,N.pipe)(a,m),[a,m]),{deleteAttribute:y,ignoreAttribute:x,pinAttribute:v,createAttribute:E,updateAttribute:w}=(e=>{let{onSuccess:t=Cn.ZT,onError:r=Cn.ZT,onLoad:n=Cn.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,N.pipe)(u.o96,(0,N.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,N.pipe)(u.xkv,l,a)({attributeUri:t.uri,value:!t.pin})}),[a,l]),ignoreAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,N.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,N.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,N.pipe)(u.JV_,(0,N.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}),C=(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=>sf({},t,{[e]:sf({},t[e],{[i]:[n]})})))}o((e=>{var n;return(0,N.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})})),p.current.some((e=>(0,u.sOy)(i,e)))||p.current.push(i)}),[]),O=(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,N.evolve)({entity:(0,N.dissoc)(t),relation:(0,N.dissoc)(t)})),p.current=(0,N.without)([t],p.current)):y(e)}),[y]),T=(0,s.useCallback)((e=>{if((0,u.ZiX)(e.attributeValue.uri)){const{attributeValue:t,attributeType:r,crosswalk:n}=e;if(!(0,N.isNil)(t.value)){const{uri:e}=t,a=p.current.find((t=>(0,u.sOy)(e,t))),o=(0,u.ww$)({entity:l,attributeType:r,uri:e,value:(0,u.kDl)(t)});E({attributeValue:(0,u.dLR)(o,a),crosswalk:n}),d.current=n}}else w(e)}),[E,w,l]);return{modifiedEntity:l,crosswalksMap:i,onAddAttribute:C,onDeleteAttribute:O,onPinAttribute:v,onIgnoreAttribute:x,onEditAttribute:T,newlyCreatedAttributes:g}},df=e=>{let{onLoad:t=Cn.ZT,onSuccess:r=Cn.ZT,onError:n=Cn.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,N.pipe)((0,N.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,N.pipe)((0,N.ifElse)((e=>{let{value:t}=e;return(0,N.isNil)(t)}),u.K$w,u.WVU),(0,N.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,N.pipe)(u.Gmt,a)({entityUri:t,crosswalkId:r})}),[a])}},mf=(0,T.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"}}),gf=e=>{let{crosswalk:t}=e;const r=mf(),n=Um(t),a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,u.tH7)(a,t.type);return c().createElement(Bh,{color:n,className:r.crosswalkPreview},c().createElement(xm.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(E.Z,{className:r.sourceLabel,variant:"body2"},l))},hf=(0,s.memo)((()=>{var e;const t=mf(),{isDragging:r,clientOffset:n,item:a}=(0,Sn.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(gf,{crosswalk:a.crosswalk})))}));let ff;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(ff||(ff={}));const bf=(0,T.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"}}))),yf=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Fm(),a=bf({isOpaque:!n}),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,u.tH7)(l,t);return c().createElement("div",{className:a.root},c().createElement(_t.Z,{size:"XXS",className:a.focusedIcon,icon:r&&Wm.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(xm.Z,{className:a.sourceIcon,sourceType:t}),c().createElement(E.Z,{variant:"body2"},o)))}));var xf=r(19540),vf=r(42484);function Ef(){return Ef=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},Ef.apply(this,arguments)}const wf=e=>c().createElement("svg",Ef({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"}))),Cf=(0,T.Z)((()=>({root:{display:"flex",justifyContent:"space-between",alignItems:"center",overflowWrap:"anywhere"},text:{fontSize:13},button:{flexShrink:0,marginLeft:8,padding:0,textTransform:"none"}}))),Of=e=>{let{value:t}=e;const r=Cf();return c().createElement("div",{className:r.root},c().createElement(E.Z,{className:r.text,variant:"body2"},t),c().createElement(_t.Z,{size:"XXS",icon:wf,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},Tf=(0,T.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),Sf=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const l=Tf(),[o,i]=(0,s.useState)(!1),u=e=>a(e.valueOf());return c().createElement(Ac.Z,{variant:"filled",value:t?new Date(t):null,disabled:n,onChange:(0,N.unless)((0,N.always)(o),u),onAccept:u,onOpen:()=>i(!0),onClose:()=>i(!1),InputProps:{disableUnderline:!0,classes:{input:l.timestampEditorInput,root:b()(l.timestampEditor,r.root)}}})},kf=(0,T.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"}}))),Nf=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const l=kf(),o=!("uri"in t),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(null),b=(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"}]),[]),y=(0,N.pipe)((0,N.filter)((0,N.propEq)("canBeAdded",!0)),(0,N.filter)((e=>!(0,N.has)(e.uri,t))),(0,N.filter)((e=>!p.includes(e.uri))))(b);return c().createElement(c().Fragment,null,y.length>0&&r&&c().createElement(en,{label:x().text("Add attributes"),onApply:e=>{e.length>0&&d((t=>t.concat((0,N.map)((0,N.prop)("uri"),e))))},data:y}),b.map((e=>e.uri in t||p.includes(e.uri)?c().createElement("div",{key:e.uri,className:l.attributeWrapper},c().createElement(E.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(Ml.Z,{label:"",placeholder:t,className:l.editor,value:{value:t,label:r},options:(0,u.cwx)(i).sort((0,N.ascend)((0,N.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(xm.Z,{className:l.sourceIcon,sourceType:t}),c().createElement(E.Z,{className:l.text,variant:"body2"},r))}case"sourceTable":return o?c().createElement(kc.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(E.Z,{className:l.text,variant:"body2"},t);case"value":return o?c().createElement(kc.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(Of,{value:t});case"deleteDate":return c().createElement(Sf,{value:t&&rn().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(E.Z,{className:l.text,variant:"body2"},(0,u.o0x)(t));default:return null}})(e.uri,t[e.uri]),e.canBeDeleted&&c().createElement(ye.k,{icon:ra.Z,disabled:!r,onClick:()=>f(e.uri),size:"XS",tooltipTitle:x().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(oh,{open:!!m,onClose:()=>f(null),onConfirm:()=>{return e=m,d((t=>(0,N.without)([e],t))),void((0,N.isNil)(t[e])||a(e));var e}}))},If=(0,T.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}}),Pf=(0,s.memo)((e=>{let{crosswalk:t,isDependent:r,isEmpty:n=!1,isColored:a=!0,focusable:l=!0,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d}=e;const m=(0,s.useRef)(null),f=Um(t),{toggleCrosswalkFocus:b,isFocused:y}=Hm(t),v=n?"#FFF":a?f:"#CACCD1",{isDimmed:w,highlightCrosswalk:C,removeHighlight:O}=Fm(t),[T]=zm(),S=If({color:v,isOpaque:!w,isFocused:y}),[k,N]=(0,s.useState)(!1),[I,P]=(0,s.useState)(!1),D=(0,g.useSelector)(h.ZP.selectors.getMetadata),A=(0,u.tH7)(D,t.type),R=(0,u.nIW)(t.uri),j=(0,u.x_)(t),[,Z,L]=(0,Sn.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!j}),_=!j&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{L((0,vf.r)(),{captureDraggingState:!0})}),[]),(0,s.useEffect)((()=>{var e;l&&T&&(0,u.aFF)(T,t)&&T!==t&&(null==m||null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[T]),c().createElement("div",{className:S.root,ref:m},c().createElement(ye.k,{size:"XXS",className:S.focusedIcon,icon:l&&Wm.Z,onClick:()=>b(),disabled:!l,tooltipTitle:l&&x().text("Focus")}),c().createElement("div",{className:S.crosswalkWrapper},c().createElement(Bh,{ref:Z,className:S.header,color:v,variant:j?"outlined":"filled",onMouseEnter:()=>C(),onMouseLeave:()=>O()},r&&c().createElement(xf.Z,{className:S.dependentIcon}),c().createElement(Ut,{onClick:()=>N((e=>!e)),expanded:k}),c().createElement(xm.Z,{className:S.sourceIcon,sourceType:t.type}),c().createElement(mi.C,{value:A},c().createElement(E.Z,{variant:"body2",noWrap:!0},A)),c().createElement(vm.Z,null),c().createElement(mi.C,{value:t.value},c().createElement(E.Z,{variant:"body2",className:S.labelValue,noWrap:!0},t.value))),k&&c().createElement("div",{className:S.attributesWrapper},_&&c().createElement("div",{className:S.deleteCrosswalkButton},c().createElement(ye.k,{icon:ra.Z,disabled:i,onClick:()=>P(!0),size:"XS",tooltipTitle:i?x().text("You don't have permissions to delete"):x().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(oh,{open:I,onConfirm:()=>{y&&b(),p(R)},onClose:()=>P(!1)})),c().createElement(Nf,{crosswalk:t,canEditAttribute:!o,onEditAttribute:(e,t)=>{d({crosswalkId:R,attributeName:e,value:t})},onDeleteAttribute:e=>{d({crosswalkId:R,attributeName:e})}}))))})),Df=(0,T.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Af=e=>{let{showMore:t,onClick:r}=e;const n=Df();return c().createElement(he.Z,{className:n.root,component:"button",variant:"caption",underline:"none",onClick:r},c().createElement("span",null,t?x().text("View dependent crosswalks"):x().text("Hide dependent crosswalks")))},Rf=e=>{let{source:t,crosswalksByTypes:r,showCrosswalkColors:n=!0,crosswalksFocusEnabled:a=!0,expanded:l,disableEditCrosswalk:o,disableDeleteCrosswalk:i,onEdit:p,onDelete:d,onToggleExpanded:m}=e;const g=zm();return(0,s.useEffect)((()=>{!l&&a&&r[ff.Dependent].some((e=>g.some((0,u.aFF)(e))))&&m()}),[g]),c().createElement(c().Fragment,null,0===r[ff.Simple].length&&0===r[ff.Empty].length&&c().createElement(yf,{crosswalkType:t,focusable:a}),r[ff.Simple].map((e=>c().createElement(Pf,{key:e.uri,crosswalk:e,focusable:a,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),r[ff.Empty].map((e=>c().createElement(Pf,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),l&&r[ff.Dependent].map((e=>c().createElement(Pf,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,focusable:a,isColored:n}))),r[ff.Dependent].length>0&&c().createElement(Af,{showMore:!l,onClick:()=>m()}))},jf=(0,T.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),Zf=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=jf(),[l,o]=(0,s.useState)({type:"",value:""});return c().createElement("div",{className:t},c().createElement(E.Z,{variant:"body1",className:a.caption},x().text("Add crosswalk")),c().createElement(Nf,{crosswalk:l,onDeleteAttribute:e=>{o((0,N.dissoc)(e))},onEditAttribute:(e,t)=>{o((0,N.assoc)(e,t))}}),c().createElement("div",{className:a.controlButtons},c().createElement(Le.Z,{className:a.cancelButton,onClick:n},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{r(l),n()},disabled:!l.type||!l.value},x().text("Add"))))},Lf=e=>e[ff.Simple].length>0?1:e[ff.Dependent].length>0?e[ff.Empty].length>0?2:3:4,_f=(0,N.evolve)({[ff.Dependent]:(0,N.sort)(((e,t)=>{const r=e.sourceTable||"",n=t.sourceTable||"";return r===n?0:r?n?r<n?-1:1:-1:1}))}),Mf=(0,N.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[ff.Simple]:[],[ff.Empty]:[],[ff.Dependent]:[]}),"relation"===n.ownerType?r[n.type][ff.Dependent].push(n):((e,t,r)=>0===(0,u.sJj)(r).filter((r=>{const n=(0,u.AFK)(r,e);return t.some((0,N.propEq)("uri",n))})).length)(e,t,n)?r[n.type][ff.Empty].push(n):((e,t,r)=>!(0,u.sJj)(r).some((r=>{const n=(0,u.AFK)(r,e),a=t.find((0,N.propEq)("uri",n));return a&&!(0,u.YkM)(a)})))(e,t,n)?r[n.type][ff.Dependent].push(n):r[n.type][ff.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>Lf(n[e])-Lf(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:_f(n[e])})))}));var Vf=r(17871);const Bf=e=>{let{children:t,className:r,position:n,map:a}=e;const[l,o]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=document.createElement("div"),t=a.controls[n].length;return a.controls[n].push(e),o(e),()=>{a.controls[n].removeAt(t)}}),[a,n]),(0,s.useEffect)((()=>{l&&r&&l.classList.add(r)}),[r,l]),l?(0,Ad.createPortal)(t,l):null};var Uf=r(41039);const zf="circle",Ff="polygon",Hf=.001;function Wf(){return Wf=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},Wf.apply(this,arguments)}const qf=e=>c().createElement("svg",Wf({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function Gf(){return Gf=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},Gf.apply(this,arguments)}const $f=e=>c().createElement("svg",Gf({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:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Draw_svg__a"})),c().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},c().createElement("path",{d:"M0 0h24v24H0z"})))),Yf=(0,T.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),Kf=(0,lt.Z)(Le.Z),Xf=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:l}=e;const o=Yf(),i=e=>()=>{a(e)};return c().createElement("div",{className:o.container},t||n?c().createElement(Kf,{tooltipTitle:x().text("Clear area"),className:o.button,onClick:n?l:i(null)},c().createElement(Uf.Z,{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case zf:return qf;case Ff:return $f;default:return null}})(e);return c().createElement(Kf,{tooltipTitle:x().text("Draw area"),key:e,className:o.button,onClick:i(e)},c().createElement(t,{className:o.icon}))})))},Qf=(0,T.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",padding:"5px","& svg":{width:"16px",height:"16px"}}}),Jf=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=Qf();return c().createElement(Ar.Z,{classes:{root:n.container,label:n.label},control:c().createElement(Dr.Z,{checked:t,onChange:e=>{r(e.target.checked)},color:"primary",className:n.checkbox}),label:x().text("Search as I move the map")})},eb=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),l=r.lng(),o=n.lat(),i=n.lng(),s=[],c=[];if(!(180===l&&-180===i||-180===l&&180===i)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,l],...s,[a,i],[o,i],...c,[o,l]]},tb=e=>{switch(e){case zf:return window.google.maps.drawing.OverlayType.CIRCLE;case Ff:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},rb=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}},nb=c().createContext({});nb.displayName="EntityMarkerContext";const ab=(0,T.Z)({popper:{maxWidth:"263px",minWidth:"150px",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)",backgroundColor:"white",borderRadius:"2px"}});function lb(){return lb=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},lb.apply(this,arguments)}const ob=(0,u.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),ib=(0,u.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),sb=(0,s.memo)((e=>{let{marker:t,onClick: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,["marker","onClick"]);const a=ab(),l=(0,s.useRef)(),[o,i]=(0,s.useState)(!1),{activeEntityUri:p}=(0,s.useContext)(nb),d=(0,N.pathEq)(["entity","uri"],p,t),m={lat:t.point.lat,lng:t.point.lng},g=(0,s.useCallback)((0,u.DsO)(i,50),[]),h=(0,s.useCallback)((()=>g(!0)),[g]),f=(0,s.useCallback)((()=>g(!1)),[g]),b=(0,s.useCallback)((()=>r(t)),[r,t]);return c().createElement(c().Fragment,null,c().createElement(Ye.Z,{anchorEl:l.current,open:o,className:a.popper,modal:!1,placement:"top"},c().createElement(Cp,{entity:t.entity,onMouseOver:h,onMouseOut:f})),c().createElement(Vf.Jx,lb({icon:{url:o||d?ob:ib,scaledSize:new google.maps.Size(22,32)},position:m,onClick:b,visible:!1!==t.visible,onMouseOver:h,onMouseOut:f},n)),c().createElement(Vf.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:m},c().createElement("span",{ref:l})))})),cb={CIRCLE:"circle",POLYGON:"polygon"},ub={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},pb=.001,db=(0,T.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});var mb=r(90690);function gb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hb=["drawing"],fb=e=>{let{markers:t=[],mapKey:r,defaultZoom:n,defaultCenter:a,loadingElement:l,isSearchOnMapMove:o,isSearchEnabled:i,activeOverlay:u,overlayOptions:p,drawingModes:d=[],markerClusterer:m,markerClustererOptions:g,mapContainerClassName:h,onMapBoundsChanged:f,onOverlayUpdated:b,onMarkerClicked:y}=e;const x=db(),{isLoaded:v,loadError:E}=(0,Vf.Ji)({googleMapsApiKey:r,libraries:hb}),w=(0,s.useRef)(null),[C,O]=(0,s.useState)(null),[T,S]=(0,s.useState)(null),[k,I]=(0,s.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const l=(0,mb.D)(t),o=(0,mb.D)(r),i=a&&window.google;(0,s.useEffect)((()=>{i&&!n&&t.length&&t!==l?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const e=n.getCenter();n.extend(new window.google.maps.LatLng(e.lat()+Hf,e.lng()+Hf)),n.extend(new window.google.maps.LatLng(e.lat()-Hf,e.lng()-Hf))}t.fitBounds(n),r&&rb(t,r,n)})(t,a,r):i&&r&&r!==o&&rb(a,r)}),[a,t,r])})({markers:t,activeOverlay:u,map:C,isSearchOnMapMove:o});const P=(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){gb(e,t,r[t])}))}return e}({},ub,p||{})),[p]),D=(0,s.useCallback)((e=>{f(e?eb(C):null),I(null),clearTimeout(w.current)}),[C,f]),A=(0,s.useCallback)((()=>{clearTimeout(w.current)}),[]),R=(0,s.useCallback)((()=>{o&&f(eb(C))}),[o,C,f]),j=(0,s.useCallback)((()=>{o&&(clearTimeout(w.current),w.current=setTimeout(R,1e3))}),[R,o]),Z=(0,s.useCallback)(((e,t)=>{const r=t||T&&{type:cb.POLYGON,overlay:T};if(!(0,N.isEmpty)(r)&&"function"==typeof b){const{overlay:e,type:t}=r,n={[cb.POLYGON]:()=>e.getPath().getArray().map((e=>[e.lat(),e.lng()])),[cb.CIRCLE]:()=>({radius:e.getRadius()/1e3,center:e.getCenter()})},a=n[t]&&n[t]();a&&b({data:a,type:t})}}),[b,T]),L=(0,s.useCallback)((e=>t=>{Z(null,{type:e,overlay:t}),t.setMap(null),I(null)}),[Z]),_=(0,s.useCallback)((()=>{b(null)}),[b]),M=e=>t.filter((0,N.prop)("point")).map((t=>c().createElement(sb,{key:t.id,marker:t,clusterer:e,onClick:y})));return E?null:v?c().createElement(Vf.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:{mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},onLoad:O,zoom:n,center:a,onZoomChanged:A,onDragStart:A,onIdle:j,mapContainerClassName:h},C&&i&&Boolean(d.length)&&c().createElement(Bf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:C},c().createElement(Xf,{hasActiveOverlay:!!u,drawingModes:d,drawingMode:k,onDrawingModeChanged:I,onClearOverlay:_})),C&&i&&c().createElement(Bf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:C},c().createElement(Jf,{onChangeIsSearchOnMapMove:D,isSearchOnMapMove:o})),m?(V=g,c().createElement(Vf.XL,{options:V},M)):M(),!tb(k)&&u&&(0,N.propEq)("type",cb.POLYGON,u)&&c().createElement(Vf.mg,{onLoad:S,path:u.path,editable:!0,options:P,onMouseUp:Z,onDragEnd:Z}),i&&Boolean(d.length)&&c().createElement(Vf.j_,{onPolygonComplete:L(cb.POLYGON),onCircleComplete:L(cb.CIRCLE),drawingMode:tb(k),options:{drawingControl:!1,circleOptions:P,polygonOptions:P}})):l;var V},bb=e=>{let{entity:t,historyEvent:r}=e;const[n,a]=(0,s.useState)(!1),l=(0,g.useSelector)(h.ZP.selectors.getHistorySlice),o=(0,g.useDispatch)(),i=(0,ze._)(),{aStamp:c,bStamp:p,overrideUri:d}=r||{},m=d||(null==t?void 0:t.uri);return(0,s.useEffect)((()=>{r&&m&&(a(!0),i(Promise.all([(0,u.lrH)(m,c),p&&1!==p?(0,u.lrH)(m,p):Promise.resolve(null)])).then((e=>{let[t,r]=e;o(h.N5.history.actions.setHistorySlice({aEntity:t,bEntity:r}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{a(!1)})))}),[c,p,m]),{isLoading:n,historySlice:l}};let yb;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(yb||(yb={}));var xb=r(39034);const vb=e=>(0,N.pipe)((0,N.map)(e),(0,N.join)(" or ")),Eb=e=>{const[t,r]=e;return rn()().subtract(t,r).valueOf()},wb=(0,N.chain)((0,N.cond)([[(0,N.equals)(yb.MERGE),()=>[l.I.ENTITIES_MERGED,l.I.ENTITIES_MERGED_MANUALLY,l.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,N.equals)(yb.UNMERGE),()=>[l.I.ENTITIES_SPLITTED]],[(0,N.equals)(yb.UPDATE),()=>[l.I.ENTITY_CHANGED]]])),Cb=(0,N.pipe)((0,N.defaultTo)([]),wb,(0,N.concat)([l.I.ENTITY_CREATED,l.I.ENTITY_REMOVED,l.I.ENTITY_LOST_MERGE]),vb((e=>`equals(type, '${e}')`))),Ob=(0,N.pipe)((0,N.defaultTo)({}),(0,N.reject)(u.O27),(0,N.evolve)({users:vb((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:vb((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case xb.K.WITHIN:return`gte(timestamp, ${Eb(r)})`;case xb.K.AGO:return`lte(timestamp, ${Eb(r)})`;case xb.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${rn()(t).endOf("date").valueOf()})`}default:return""}}}),(0,N.over)((0,N.lensProp)("activities"),Cb),N.values,(0,N.reject)(u.O27),(0,N.append)("not equals(user, 'collaboration-service')"),(0,N.map)((e=>`(${e})`)),(0,N.join)(" and "));function Tb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sb(e,t,r[t])}))}return e}function Sb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kb={activities:[yb.MERGE,yb.UNMERGE,yb.UPDATE]},Nb=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)(kb),[l,o]=(0,s.useState)(0),i=(0,s.useMemo)((()=>Ob(n)),[n]),[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),[g,h]=(0,s.useState)(!1),f=(0,ze._)(),b=null==t?void 0:t.uri,y={max:32,order:"desc"},x=(0,u.O27)(null==n?void 0:n.attributes)||void 0;(0,s.useEffect)((()=>{b&&r&&(h(!0),f((0,u.kgP)(Tb({entityUri:b,historicUris:c,filter:i,showAll:x},y))).then(m).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{h(!1)})))}),[i,x,c]),(0,s.useEffect)((()=>{b&&r&&(h(!0),f((0,u.wdF)({entityUri:b})).then((e=>{p(e)})).catch((e=>{console.warn("Failed to load history data",e),p(null)})).finally((()=>{h(!1)})),o(0))}),[b,null==t?void 0:t.updatedTime,r]);const v=(0,s.useCallback)((e=>{b&&c&&r&&(h(!0),f((0,u.kgP)(Tb({entityUri:b,historicUris:c,filter:i,showAll:x,offset:e},y))).then((e=>{m((t=>Tb({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{h(!1)})))}),[c,i,r]),E=(0,s.useMemo)((()=>32*(l+1)<(null==d?void 0:d.total)),[d,l]),w=(0,s.useCallback)((e=>{o(0),a(e)}),[]),C=(0,s.useCallback)((()=>{w(Tb({},kb))}),[]),O=(0,s.useCallback)((()=>{E&&(v(32*(l+1)),o(l+1))}),[v,l,E]);return{isLoading:g,canLoadMore:E,onLoadMore:O,onApplyFilter:w,onClearFilter:C,historicUris:c,historyWithTotal:d,historyFilter:n}},Ib={appearance:{},attributes:{},roles:[],tags:[]},Pb=(0,N.evolve)({refEntity:u.VGB,refRelation:u.VGB}),Db=e=>e?(0,N.evolve)({attributes:(0,N.map)((0,N.map)(Pb))})(e):e,Ab=()=>{const e=(0,g.useDispatch)(),t=(0,g.useSelector)(h.ZP.selectors.getHistorySlice),r=(0,g.useSelector)(h.ZP.selectors.getHistoryDiff),n=(0,g.useSelector)(h.ZP.selectors.getHistoryMode),a=(0,g.useSelector)(h.ZP.selectors.getEntity);return(0,s.useEffect)((()=>{if(t){const{aEntity:r,bEntity:l}=t,o=u.nwO.HistoryManager.createHistoryManager(u.nwO.AttributesDiff).computeEntityHistoryDiff(Db(n===h.Z9.Current?a:l),Db(r));e(h.N5.history.actions.setHistoryDiff(o))}}),[t,n,e,a]),r||Ib};var Rb=r(57312);const jb=(0,T.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"}}))),Zb=e=>{let{change:t,isCurrent:r,isSelected:n,onClick:a}=e;const{uri:l,type:o,matchGroups:i,user:s,timestamp:p}=t,d=(0,u.GtP)(l),m=jb({color:d});return c().createElement("div",{className:b()(m.historyRow,{[m.selected]:n}),onClick:a},c().createElement("div",{className:m.rowHeader},c().createElement("div",{className:m.badge}),c().createElement(E.Z,{className:b()(m.title,{bold:r})},r?x().text("Current view"):(0,Rb.Xr)(o)),!r&&c().createElement(E.Z,{className:m.date},x().date(p,"L LT"))),i&&c().createElement(E.Z,{className:m.title},x().text("Match rule:")," ",i.join(", ")),c().createElement(E.Z,{className:m.user},s))};function Lb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _b;!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"}(_b||(_b={}));const Mb=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){Lb(e,t,r[t])}))}return e}({},l.I,_b),Vb=e=>e===Mb.FAKE_FILTERED_INCOMING||e===Mb.FAKE_FILTERED_OUTGOING,Bb=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})},Ub=e=>{let{x:t,y:r,color:n,isDashed:a,isCollapsed:l,showCollapseIcon:o,showLine:i}=e;const s=o?6:3;return c().createElement("g",null,i&&c().createElement("rect",{id:"line",x:t-s-4,y:r-s-4,width:2*s+8,height:2,fill:n}),c().createElement("circle",{cx:t,cy:r,r:s,fill:a?"#fff":n,stroke:n,strokeDasharray:a?"1,1":void 0,strokeWidth:2}),o&&c().createElement("g",{id:"icon"},c().createElement("rect",{x:t-4,y:r-1,width:8,height:2,fill:"#fff"}),l&&c().createElement("rect",{x:t-1,y:r-4,width:2,height:8,fill:"#fff"})))},zb=(0,s.memo)((e=>{let{graphData:t}=e;const{historyLanes:r,rows:n}=t,a=[16],{links:l,rowLines:o,circles:i}=n.reduce(((e,t,l)=>{let{uri:o,height:i,uris:s,type:p,index:d}=t;const m=16*r[o].index+24,g=a[l];a.push(g+i);const h=Vb(p),f=h?s[0]:o,b=!(null!=s&&s.some((e=>r[e])));e.circles.push(c().createElement(Ub,{key:`circle-${f}-${l}`,x:m,y:g,color:(0,u.GtP)(f),isDashed:h,isCollapsed:b,showCollapseIcon:!!s,showLine:p===Mb.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(c().createElement("rect",{key:`${f}-${d}`,x:m,y:g-8,width:"100%",height:16,fill:(0,u.GtP)(f),opacity:.06}));const y=p===Mb.ENTITIES_SPLITTED;return null==s||s.forEach((t=>{const a=r[t];if(!a)return;const o=n[l].height,i=16*a.index+24,s=y?g-o:g+o;m!==i&&e.links.push(c().createElement(Bb,{key:`link-${t}-${d}`,x:m,y:g,toX:i,toY:s,isDashed:Vb(p),color:(0,u.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),s=16*Object.keys(r).length+24,p=a[a.length-1]-16;return Object.entries(r).forEach((e=>{let[t,r]=e;const o=16*r.index+24;r.lifeTime.forEach(((e,s)=>{var d;let{start:m,end:g}=e;if((null===(d=n[null==g?void 0:g.index])||void 0===d?void 0:d.type)===Mb.ENTITIES_SPLITTED)return;const h=a[null==m?void 0:m.index]||p,f=a[(null==g?void 0:g.index)+1]||16,b=(0,u.GtP)(t);!g&&r.index>0&&i.push(c().createElement(Ub,{key:`initCircle-${t}-${s}`,x:o,y:f,color:b,showLine:!0})),l.push(c().createElement("path",{key:`line-${t}-${s}`,d:`M${o} ${h} L${o} ${f}`,stroke:b,strokeWidth:2}))}))})),c().createElement("svg",{className:"chart",width:s,height:p},c().createElement("g",{id:"rowLines"},o),c().createElement("g",{id:"links"},l),c().createElement("g",{id:"circles"},i))})),Fb=(0,T.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 Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wb=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:l,historyEvent:o,findPreviousChange:i}=e;const p=Fb(),d=(0,g.useDispatch)(),m=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode),[f,y]=(0,s.useState)({historyLanes:{},rows:[]}),[v,E]=(0,s.useState)(!1),[w,C]=(0,s.useState)(-1);(0,s.useEffect)((()=>{if((0,N.isNil)(o))return void C(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!==w?t.rows[w]:null,n=t.rows.findIndex((t=>e(t)));C(e(r)?w:n)}),[t.rows,o]);const O=(0,s.useRef)(null),T=(0,s.useCallback)((e=>{if(!(0,N.isNil)(e)){var r;const n=null===(r=t.rows)||void 0===r?void 0:r.map(((t,r)=>{var n;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){Hb(e,t,r[t])}))}return e}({},t,{height:null===(n=e.childNodes[r])||void 0===n?void 0:n.clientHeight})}));y({historyLanes:t.historyLanes,rows:n})}}),[t]),S=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:r}=(null==O?void 0:O.current)||{};E(r<e-t)};return c().createElement("div",{className:p.historyTree},r&&c().createElement(Dn,null),c().createElement("div",{className:b()(p.graph,{[p.shadow]:v}),onScroll:S,ref:O},c().createElement(zb,{graphData:f}),c().createElement(wr.Z,{handleWidth:!0,onResize:S})),c().createElement("div",{ref:T,className:p.history},t.rows.map(((e,t)=>{const r=t===w,n=0===t;return c().createElement(Zb,{key:`row-${t}`,change:e,isCurrent:n,isSelected:r,onClick:()=>((e,t,r,n)=>{if(m){if(!window.confirm(x().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;d(h.N5.mode.actions.modeUpdated(u.ARY.Viewing))}if(n&&!r||!n&&r)d(h.N5.history.actions.clearHistoryEvent()),C(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;d(h.N5.history.actions.setHistoryEvent({aStamp:a,bStamp:o,overrideUri:s})),C(e)}})(t,e,r,n)})}))),n&&c().createElement("div",{className:p.buttonContainer},c().createElement(Le.Z,{color:"primary",onClick:()=>a()},x().text("Show more"))))},qb=(0,T.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),Gb=(0,T.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"}}),$b=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),l=Gb({color:a});return c().createElement("div",{className:b()(l.icon,{[l.inactive]:!r,[l.active]:r,[l.clickable]:!!n}),onClick:n})},Yb=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:l}=e;const o=qb();return c().createElement("div",{className:b()(o.root,l)},c().createElement($b,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement($b,{key:e,value:e,isSelected:null==r?void 0:r.includes(e),onClick:()=>(e=>{null!=r&&r.includes(e)?a((0,N.without)([e],r)):a([...r||[],e])})(e)}))))};function Kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xb=(e,t)=>e.reduce(((e,r,n)=>{let{start:a,end:l}=r;if(a){const r=t-a.timestamp;((0,N.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,N.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}),Qb=(0,T.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),Jb=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:l,onLoadMore:o,historyEvent:i}=e;const u=Qb(),[p,d]=(0,s.useState)(null);(0,s.useEffect)((()=>{d(n)}),[n]);const{historyData:m,findPreviousChange:g}=(e=>{let{entityUri:t,historyChanges:r,selectedUris:n}=e;return(0,s.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},a=[{type:Mb.FAKE_UPDATE,user:"",timestamp:0,uri:t}],l=(0,N.curry)(((e,r)=>{const n=r.uri||t;if(Array.isArray(e)){if(r.type!==Mb.ENTITY_LOST_MERGE)return null;if(e.includes(n))return r;if(r.uris)return e.some((e=>r.uris.includes(e)))?r:null}else{var a;if(n===e||null!==(a=r.uris)&&void 0!==a&&a.includes(e))return r}return null})),o=(e,t)=>(0,N.pipe)((0,N.slice)(0,e-1),N.reverse,(0,N.find)(l(t)))(r),i=t=>{const r=e[t];return r||n&&!n.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),r},s=(e,t)=>{const r=e[e.length-1];!r||r.start&&(r.start.type!==Mb.ENTITY_CREATED||t.type!==Mb.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})},p=[];return null==r||r.forEach(((r,n)=>{var l;switch(r.type){case Mb.ENTITIES_SPLITTED:if(!o(n,r.uri||t))return;{const e=r.uri,t=r.uris?[r.uris,e]:[e],a=o(n,t);if(a&&(!e||e===a.uri))return}break;case Mb.ENTITY_LOST_MERGE:case Mb.RELATIONSHIP_CREATED:case Mb.RELATIONSHIP_REMOVED:case Mb.RELATIONSHIP_CHANGED:return}let d=!1;null===(l=r.uris)||void 0===l||l.forEach((e=>{i(e)||(d=!0)}));const m=i(r.uri||t);if(!m)return;const g=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){Kb(e,t,r[t])}))}return e}({},r);((t,r)=>{var n,l;switch(r.type){case Mb.ENTITY_CREATED:s(t,r);break;case Mb.ENTITIES_MERGED_ON_THE_FLY:case Mb.ENTITY_CHANGED:c(t,r);break;case Mb.ENTITY_LOST_MERGE:case Mb.ENTITY_REMOVED:u(t,r);break;case Mb.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({type:l?Mb.FAKE_UPDATE:Mb.FAKE_NAVIGATE_PROFILE,uri:t,user:r.user,timestamp:r.timestamp})}));break;case Mb.ENTITIES_MERGED:case Mb.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,g),d&&p.push(g),a.push(g)})),p.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 Mb.ENTITIES_MERGED:case Mb.ENTITIES_MERGED_MANUALLY:l=Mb.FAKE_FILTERED_INCOMING;break;case Mb.ENTITIES_SPLITTED:l=Mb.FAKE_FILTERED_OUTGOING;break;default:return}const o={type:l,uri:t.uri,uris:[r],user:s,timestamp:i},u=Xb(n.lifeTime,t.timestamp);l===Mb.FAKE_FILTERED_INCOMING?(0,N.isNil)(u.endIndex)||(n.lifeTime[u.endIndex].end=o):(0,N.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,N.pipe)((0,N.slice)(e+1,1/0),(0,N.find)(l(t)))(a)}}),[t,r,n])})({entityUri:a,historyChanges:null==r?void 0:r.changes,selectedUris:p});return c().createElement("div",{className:u.root},c().createElement(Yb,{values:n,selectedValues:p,onSelectValues:d,entityUri:a,className:u.borderBottom}),c().createElement(Wb,{historyData:m,isLoading:t,onLoadMore:o,canLoadMore:l,entityUri:a,historyEvent:i,findPreviousChange:g}))}));var ey=r(36444),ty=r(15791),ry=r(55234);const ny=[xb.K.WITHIN,xb.K.AGO,xb.K.BETWEEN],ay=e=>({[xb.K.WITHIN]:x().text("Within the last"),[xb.K.AGO]:x().text("More than"),[xb.K.BETWEEN]:x().text("Date range")}[e]||"");var ly=r(77875),oy=r(27446);const iy=(0,T.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),sy=[null,null],cy=[null,"hours"],uy=e=>{let{value:t,onChange:r,className:n}=e;const a=iy(),l=e=>e===xb.K.WITHIN||e===xb.K.AGO,o=e=>e===xb.K.BETWEEN,i=o(null==t?void 0:t.type)?t.period:sy,u=l(null==t?void 0:t.type)?t.period:cy,[p,d]=(0,s.useState)(i),[m,g]=(0,s.useState)(u),h=(null==t?void 0:t.type)||xb.K.WITHIN,f=e=>l(e)?m:o(e)?p:void 0,y=e=>{r({type:h,period:e})};return(0,te.D)((()=>{t?l(t.type)?g(t.period):o(t.type)&&d(t.period):(d(sy),g(cy))}),[t]),c().createElement("div",{className:b()(a.root,n)},c().createElement(E.Z,{className:a.title,variant:"subtitle1"},x().text("Date")),c().createElement("div",{className:a.intervalContainer},c().createElement(Ml.Z,{label:"",className:a.typeInput,value:{value:h,label:ay(h)},options:ny.map((e=>({value:e,label:ay(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),l(h)?c().createElement(ly.Z,{interval:m,onChange:y}):c().createElement(oy.Z,{values:p,onChange:y})))},py=[yb.UPDATE,yb.MERGE,yb.UNMERGE];function dy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){my(e,t,r[t])}))}return e}function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gy={input:e=>dy({},e,{fontSize:"14px"}),menuPortal:e=>dy({},e,{zIndex:1300})},hy=(0,T.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"}}),fy=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=hy(),l=e=>{return{value:e,label:(t=e,{[yb.UPDATE]:x().text("Update"),[yb.MERGE]:x().text("Merge"),[yb.UNMERGE]:x().text("Unmerge")}[t]||"")};var t},o=e=>e.map(l),i=o(py);return c().createElement("div",{className:b()(a.root,n)},c().createElement(E.Z,{className:a.title,variant:"subtitle1"},x().text("Activity")),c().createElement(_p.Z,{value:o(t),onChange:(0,N.pipe)((0,N.defaultTo)([]),(0,N.pluck)("value"),r),options:i,TextFieldProps:{classes:{root:a.dropDownInput}},components:{DropdownIndicator:cc.Z},styles:gy,classes:a,menuPlacement:"bottom",menuPortalTarget:document.body}))},by=(0,T.Z)({icon:{margin:5},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 yy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy=e=>{let{filter:t,onApplyFilter:r,onClearFilter:n,entityType:a}=e;const l=by(),[o,i]=(0,s.useState)(null),u=()=>i(null),[p,d]=(0,s.useState)(t);(0,s.useEffect)((()=>{d(t)}),[t]);const m=(0,N.curry)(((e,t)=>{d((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){yy(e,t,r[t])}))}return e}({},r,{[e]:t})))})),{activities:g=[],attributes:h=[],dateRange:f=null,users:b=[]}=p||{};return c().createElement(c().Fragment,null,c().createElement(_t.Z,{icon:ey.Z,size:"XS",onClick:e=>i(e.currentTarget),className:l.icon}),c().createElement(_r.ZP,{classes:{paper:l.popup},open:!!o,anchorEl:o,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:l.filterContainer},c().createElement(E.Z,{variant:"h6"},x().text("Filter")),c().createElement("div",{className:l.filterContainerScrollable},c().createElement(uy,{value:f,onChange:m("dateRange"),className:l.filterItem}),c().createElement(ty.Z,{selectedUsers:b,onChange:m("users"),className:l.filterItem}),c().createElement(fy,{selectedHistoryActivityTypes:g,onChange:m("activities"),className:l.filterItem}),c().createElement(ry.Z,{selectedAttributes:h,entityType:a,onChange:m("attributes"),className:l.filterItem,title:x().text("Attribute updated")}))),c().createElement("div",{className:l.filterControls},c().createElement(Le.Z,{onClick:n,className:l.clearButton},x().text("Clear all")),c().createElement(Le.Z,{onClick:u},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{f&&(e=>{if(e.type===xb.K.AGO||e.type===xb.K.WITHIN){const[t,r]=e.period;return"Number"===(0,N.type)(t)&&"String"===(0,N.type)(r)&&t>0}if(e.type===xb.K.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}})(f)?r(p):r((0,N.dissoc)("dateRange",p)),u()}},x().text("Apply")))))};var vy=r(98281);const Ey=(0,T.Z)({icon:{margin:5},menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),wy=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=Cn.ZT}=e;const a=Ey(),{text:l,selected:o,onClick:i}=r;return c().createElement(Va.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},o&&c().createElement(vy.Z,{className:a.checkIcon}),c().createElement(E.Z,{classes:{root:a.menuText}},l))}));wy.displayName="MenuItemRenderer";const Cy=wy,Oy=()=>{const e=Ey(),t=(0,g.useSelector)(h.ZP.selectors.getHistoryMode),r=(0,g.useDispatch)(),n=e=>{r(h.N5.history.actions.setHistoryMode(e))},a=[{text:x().text("Compare to Current view"),selected:t===h.Z9.Current,onClick:()=>n(h.Z9.Current)},{text:x().text("Compare to Previous view"),selected:t===h.Z9.Previous,onClick:()=>n(h.Z9.Previous)}];return c().createElement(be.Z,{MenuItemRenderer:Cy,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",className:e.icon},menuId:"history-menu",menuItems:a})},Ty=(0,T.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}}),Sy=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}=e;const o=Ty();return c().createElement("div",{className:o.root},c().createElement(E.Z,{variant:"h6"},x().text("History")),c().createElement(Zr.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),!(0,N.isNil)(t)&&c().createElement(E.Z,{variant:"body1",color:"textSecondary",className:o.count},1===t?x().text("${count} contributing profile",{count:t}):x().text("${count} contributing profiles",{count:t})),c().createElement(vm.Z,null),c().createElement(xy,{entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}),c().createElement(Oy,null))},ky=(0,T.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),Ny=()=>{const e=ky(),t=(0,g.useSelector)(h.ZP.selectors.getHistoryEvent),r=(0,g.useDispatch)(),n=(0,N.pipe)(h.N5.history.actions.clearHistoryEvent,r);return t?c().createElement("div",{className:e.root},c().createElement(E.Z,{component:"div"},x().text("You are viewing a historic slice:")," ",c().createElement("span",{className:e.slice},x().date(t.aStamp,"llll"))),c().createElement(Le.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},x().text("Cancel"))):null},Iy=()=>c().createElement(gm,{text:x().text("History in the making"),secondaryText:x().text("When you create an event or perform an activity, it will show up here.")}),Py=(0,T.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 Dy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ay(e,t,r[t])}))}return e}function Ay(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ry=e=>{let{connection:t,modifiedEntity:r,allModifiedEntities:n,dispatch:a,config:l,mode:o,metadata:i,globalSearchRequestOptions:p,error:d}=e;const{relationUri:m,relationType:g,direction:f}=t.relation,y=t.isNew,v=Py(),{inRelations:w=[],outRelations:C=[]}=(0,s.useMemo)((()=>(0,u.ocC)({config:l,direction:f,relationType:g,mode:o,metadata:i})),[l,f,g,o,i]),O=(0,s.useMemo)((()=>(0,u.xF8)(i,g)),[g,i]),T=(0,s.useMemo)((()=>Dy({attributes:Dy({},h.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,u.p2l)(t.relation))),[t]),S=(0,s.useRef)(t),k=(0,s.useRef)(r),I=(0,s.useMemo)((()=>(0,u.SAs)(n,r)),[n,r]),P=(0,s.useRef)([]);(0,s.useEffect)((()=>{P.current=(0,N.pipe)((0,N.concat)(I.map((0,N.prop)("uri"))),N.uniq)(P.current)}),[I]);const D=(0,s.useRef)(I),A=(0,u.z7d)(w,C),R=S.current!==t||k.current!==r||(j=D.current,Z=I,j.length!==Z.length||j.some(((e,t)=>j[t]!==Z[t])))||t.isNew&&!(0,u.O27)((0,N.path)(["relation","object","attributes"],t));var j,Z;const L=y?h.N5.relations.actions.addRelation:h.N5.relations.actions.editRelation,_=(0,s.useCallback)((0,N.pipe)(h.N5.relations.actions.setRelationType(l.id,m),a),[l,m,a]),M=(0,s.useCallback)((()=>(0,N.pipe)(h.N5.relations.actions.closeRelationEditor,a)(l.id,m)),[l,m,a]),V=(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(h.N5.modifiedEntities.actions.entityCreated(e))),[a]),U=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityDeleted(e))),[a]),z=(0,s.useCallback)((e=>{r&&U(r.uri),a(h.N5.relations.actions.setRelationEntity(l.id,m,e)),d&&a(h.N5.errors.actions.errorDeactivated((0,u.iFp)(d)))}),[l.id,m,a,r,U,d]),F=(0,s.useCallback)((()=>{const e=(0,u.Bd_)(i,n,t);return a(h.N5.errors.actions.errorsSet(e)),0===e.length}),[t,i,n,a]),H=(0,s.useCallback)((()=>a(h.N5.errors.actions.errorsSet([]))),[a]),W=(0,s.useCallback)((0,N.pipe)((0,N.always)(t),(0,N.when)(F,(0,N.pipe)(u.zhn,V,L(l.id),a,(0,N.always)((0,N.differenceWith)(N.equals,P.current,I.map((0,N.prop)("uri")))),(0,N.forEach)(U),M))),[t,l,a,V,F,I]),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=D.current;(0,N.differenceWith)(N.equals,P.current,t.map((0,N.prop)("uri"))).forEach(U),t.forEach(B),H(),M()}),[M,B,U,H,r]),G=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,a)(e.map((e=>Dy({},e,{viewId:l.id}))))),[l.id,a]),$=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),Y=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),K=(0,s.useCallback)(((e,t)=>{const r=(0,u.nt9)(i,e),n=(0,N.pipe)(u.wcJ,(0,u._kX)(o))(r),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:o});z(a),B(a)}),[B,z,o,i]),X=(0,u.e$p)(d);return c().createElement(c().Fragment,null,c().createElement("div",{className:v.editor},c().createElement(E.Z,{className:v.title},y?x().text("Add new item"):x().text("Edit item")),null===A&&c().createElement(vc,{className:v.item,relation:t.relation,inRelationTypes:w,outRelationTypes:C,onChange:_}),Boolean(g)&&c().createElement(c().Fragment,null,c().createElement(ia,{errorMessage:X},c().createElement(gl,{className:b()(v.item,{[v.dense]:X||t.entity&&(0,u.ZiX)(t.entity.entityUri)}),entity:t.entity||{},entityTypesUris:l.content.entityTypes||[],max:l.max||20,globalSearchRequestOptions:p,mode:o,onChange:z,onCreate:K,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(Pa,{className:v.item,attrTypes:O,entity:T,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:o,parentUri:m,onAddAttributes:G,onChangeAttribute:$,onDeleteAttribute:Y}))),c().createElement("div",{className:v.actionButtons},c().createElement(Le.Z,{onClick:q},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",disabled:!R,onClick:W},x().text("Apply"))),c().createElement(Zr.Z,null))};Ry.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:U().object,dispatch:U().func,config:u.PiC,mode:U().string,metadata:u.pGS,globalSearchRequestOptions:U().object,error:u.wfT};const jy=Ry,Zy=(0,g.connect)(((e,t)=>{const r=(n=t,h.N5.relations.selectors.getEntityUriFromConnection(n.connection));var n;const a=(0,u.ZiX)(r);return{modifiedEntity:a?h.ZP.selectors.getModifiedEntity(e,r):null,allModifiedEntities:a?h.ZP.selectors.getModifiedEntities(e):null,globalSearchRequestOptions:h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]),error:(0,u.ATu)(t.connection,h.ZP.selectors.getProfileErrors(e))}}))(jy),Ly=(0,T.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"}}))),_y=c().createContext(null);_y.displayName="WorkflowTasksContext";const My=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),ou.Z.addError({title:x().text("Error"),message:t||x().text("Something went wrong...")}))},Vy=()=>{const e=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),t=(0,g.useSelector)(h.ZP.selectors.getCanUserStartProcessFromQuery),r=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowJobs),n=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowEnvironmentConfigJar),a=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowDefinition),l=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowConfigJar),o=(0,g.useSelector)(h.ZP.selectors.getCanUserViewProcessInstanceSearchQuery),i=(0,g.useSelector)(h.ZP.selectors.getCanUserUpdateWorkflowDataTask),s=(0,g.useSelector)(h.ZP.selectors.getCanUserUpdateProcessInstance),c=(0,g.useSelector)(h.ZP.selectors.getCanUserReadWorkflowDataTask),u=(0,g.useSelector)(h.ZP.selectors.getCanUserManageWorkflowEnvironmentDefinition),p=(0,g.useSelector)(h.ZP.selectors.getCanUserManageWorkflowDefinition),d=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsValidateTasks),m=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsUpdateTasks),f=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsTerminateProcessInstance),b=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsSyncBusinessProcessData),y=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobs),x=(0,g.useSelector)(h.ZP.selectors.getCanUserCreateWorkflowEnvironmentConfigJar),v=(0,g.useSelector)(h.ZP.selectors.getCanUserRegisterConfigEnvironments),E=(0,g.useSelector)(h.ZP.selectors.getCanUserCreateWorkflowConfigJar);return g=>{if(!e)return!1;switch(g){case"VIEW_PROCESS_DEFINITIONS":return a;case"DEPLOY_GENERIC_PROCESS_DEFINITION":return u;case"VIEW_JOBS":return r;case"START_JOB":return y||b&&f&&m&&d;case"VIEW_CUSTOM_JARS":return l||n;case"UPDATE_PROCESS_INSTANCE":return s;case"VIEW_TASKS":return c;case"REGISTER_TENANT":return v;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 p;case"DEPLOY_CUSTOM_JAR":return E&&x}return!1}},By=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,N.startsWith)("changeRequests/"))},Uy=e=>void 0===e||!0===e,zy=e=>({label:e,value:e}),Fy=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),p=(0,ze._)(),[d,m]=(0,s.useState)(null),[f,b]=(0,s.useState)(),[y,x]=(0,s.useState)(!1),v=Vy()("UPDATE_TASK")&&Uy(n);(0,s.useEffect)((()=>{m(zy(t))}),[t]);const E=(0,s.useCallback)((e=>{if(l&&v&&r){const t=(0,N.filter)((t=>t.value.toLowerCase().includes(e)));return f?Promise.resolve(t(f)):p((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(zy);return b(n),t(n)})).catch(My)}}),[l,r,o,i,f,b,v]),w=(0,s.useCallback)((e=>{if(l&&v&&r){const{value:t}=e;x(!0),c((0,u._C4)({taskId:r,workflowPath:l,environment:o,tenant:i,assignee:t})).then((()=>{m(zy(t)),null==a||a(r,{assignee:t})})).catch(My).finally((()=>{x(!1)}))}}),[l,r,o,i,v]);return{assignee:d,getAssignees:E,updateAssignee:w,updateRequestIsInProgress:y,readOnly:!v}},Hy=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:l,updateAssignee:o,updateRequestIsInProgress:i,readOnly:s}=Fy({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(_a.Z,{isDisabled:u,getOptions:l,onChange:o,hideSelectedOptions:!1,label:x().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},Wy=(0,T.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),qy=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const l=Wy(),{updateDueDate:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(n);return{updateDueDate:(0,s.useCallback)((e=>{l&&m&&r&&e&&t!==e&&(d(!0),c((0,u.KF3)({taskId:r,workflowPath:l,environment:o,tenant:i,dueDate:e})).then((()=>{null==a||a(r,{dueDate:e})})).catch(My).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]),updateRequestIsInProgress:p,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(Dc.Z,{className:b()(l.dueDate,a),disabled:i||p,value:r,label:x().text("Due date"),onChange:(0,N.pipe)((e=>e&&e.getTime()),o),margin:"dense",InputProps:{className:l.dueDateInput},InputLabelProps:{classes:{root:l.inputLabel}}})},Gy=e=>{let{taskId:t,priority:r,isTaskOpen:n,className:a}=e;const{priorities:l,updatePriority:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{priority:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(n),f=(0,s.useCallback)((e=>{const{value:n}=e;l&&m&&r&&t!==n&&(d(!0),c((0,u.ax9)({taskId:r,workflowPath:l,environment:o,tenant:i,priority:n})).then((()=>{null==a||a(r,{priority:n})})).catch(My).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]);return{priorities:(0,s.useMemo)((()=>[{label:x().text("Low"),value:u.NVC.low},{label:x().text("Medium"),value:u.NVC.medium},{label:x().text("High"),value:u.NVC.high},{label:x().text("Urgent"),value:u.NVC.urgent}]),[]),updatePriority:f,updateRequestIsInProgress:p,readOnly:!m}})({taskId:t,priority:r,isOpen:n}),d=i||p;return c().createElement(_a.Z,{className:a,isDisabled:d,options:l,onChange:o,hideSelectedOptions:!1,label:x().text("Priority"),value:l.find((0,N.propEq)("value",r)),TextFieldProps:{disabled:d},height:40})};var $y=r(94842),Yy=r(98685);const Ky=(0,T.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"}}))),Xy=(0,T.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"}}))),Qy=(0,T.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)"}}}))),Jy=(0,T.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),ex=e=>{let{author:t,classes:r,message:n,time:a}=e;const l=Ky();return c().createElement("div",{className:l.comment},c().createElement(Ne.Z,{className:l.avatar},c().createElement(Yy.Z,{className:l.icon})),c().createElement("div",{className:b()(l.info,r.messageContainer)},c().createElement("div",{className:l.firstLine},c().createElement("div",{className:l.author},t),c().createElement("span",{className:l.date},x().date(a,"L LT"))),c().createElement("div",{className:l.text},n)))};ex.defaultProps={classes:{}},ex.propTypes={classes:U().object,author:U().string,id:U().string,message:U().string,time:U().number};const tx=e=>{let{comments:t,onClick:r}=e;const n=Xy();return c().createElement(c().Fragment,null,c().createElement(ex,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Xa.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement(ex,t[t.length-1]))};tx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),onClick:U().func};const rx=e=>{let{comments:t}=e;const r=Jy();return t.map((e=>{let{author:t,id:n,message:a,time:l}=e;return c().createElement(ex,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:l})}))};rx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number}))};const nx=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),b=Vy()("UPDATE_TASK")&&Uy(n);(0,s.useEffect)((()=>{d(t||[])}),[t]);const y=(0,s.useCallback)((e=>{b&&(f(!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;d(t||[]),null==a||a(r,{processInstanceComments:t})})).catch(My).finally((()=>f(!1))))}),[o,r,i,l,c,a,b]);return{comments:p,requestIsInProgress:m,writeComment:y,readOnly:!b}},ax=e=>e.target.value,lx=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Qy(),[l,o]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:p,writeComment:d,readOnly:m}=nx({processInstanceComments:t,taskId:r,isOpen:n}),g=(0,s.useCallback)((()=>{d(i),u("")}),[i,d]),h=(0,N.pipe)(ax,u);return c().createElement("div",{className:a.container},c().createElement("div",{className:a.title}," ",x().text("Comments")," "),c().createElement("div",{className:a.commentsContainer},l||p.length<3?c().createElement(rx,{comments:p}):c().createElement(tx,{onClick:()=>o(!0),comments:p})),!m&&c().createElement(Dm.Z,{endAdornment:c().createElement(Am.Z,{position:"end"},c().createElement(_t.Z,{icon:$y.Z,disabled:0===i.length,onClick:g})),classes:{root:a.filledInputRoot},placeholder:x().text("Write a comment"),value:i,onKeyPress:(0,N.when)((0,N.propEq)("key","Enter"),g),onChange:h,disableUnderline:!0}))};lx.propTypes={processInstanceComments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),taskId:U().string};const ox=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)(_y)||{},o=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),i=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),c=(0,g.useSelector)(h.ZP.selectors.getTenant),p=(0,g.useSelector)(h.ZP.selectors.getUserName),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),[m,f]=(0,s.useState)(!1),b=(0,s.useContext)(Ga.m),y=(0,g.useDispatch)(),x=(0,s.useCallback)((e=>()=>{o&&n&&(f(!0),(0,u.TZ_)({taskId:n,workflowPath:o,environment:i,tenant:c,action:e}).then((()=>{"Delete"===e?y(h.ui.actions.entityDeletionFinished()):(y(h.N5.entity.actions.loadEntity({viewId:b,uri:d})),null==l||l())})).catch(My).finally((()=>{f(!1)})))}),[o,n,i,c,y,d,b,l]);return{actions:(0,s.useMemo)((()=>p===r&&Uy(a)?(t||[]).map((e=>{let{action:t,label:r}=e;return{text:r,onClick:x(t)}})):[]),[t,x,p,r,a]),actionRequestIsInProgress:m}})({taskId:t,possibleActions:r,assignee:n,isOpen:a});return l.length>0?c().createElement(be.Z,{buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",disabled:o},menuId:"workflow-actions",menuItems:l}):null},ix=(0,T.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}}),sx=e=>{let{className:t,children:r,plain:n,first:a,last:l,transparent:o,divider:i}=e;const s=ix();return c().createElement("div",{className:b()(t,s.decorator)},c().createElement("div",{className:b()(s.lineBlock,{[s.withLinePadding]:a})},!o&&c().createElement(c().Fragment,null,c().createElement("div",{className:s.noLine}),c().createElement("div",{className:b()(s.line,{[s.plain]:n},{[s.last]:l})}))),c().createElement("div",{className:s.content},r,i&&c().createElement(Zr.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let cx={};const ux=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let px=0;function dx(){return dx=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},dx.apply(this,arguments)}const mx=e=>c().createElement("svg",dx({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"}))),gx=e=>{let{task:t,children:r,actions:n,Icon:a}=e;const{taskId:l,dueDate:o,priority:i,assignee:u,createdBy:p,createTime:d,displayName:m,processDefinitionDisplayName:g,objectURIs:h,processInstanceComments:f,possibleActions:y,isOpen:v}=t,E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,N.pipe)(By,(0,N.unless)(N.isNil,(0,N.pipe)((0,N.split)("/"),(0,N.nth)(1))))(e)}(h),w=(e=>{let{processDefinitionDisplayName:t}=e;const r=t;return cx[r]||(cx[r]=ux[px],px++,px>ux.length-1&&(px=0)),cx[r]})({processDefinitionDisplayName:g}),C=Ly({color:w}),[O,T]=(0,s.useState)(!1),S=Vy()("VIEW_PROCESS_INSTANCE_COMMENTS");return c().createElement("div",{className:C.card},c().createElement("div",{className:b()({[C.withBackground]:O})},c().createElement("div",{className:C.lineWrapper},c().createElement("div",{className:C.line}),a&&c().createElement(a,{className:C.icon}),c().createElement(sx,{plain:!0,first:!0,transparent:!O},c().createElement("div",{className:C.mainInfo},c().createElement("div",{className:C.title},c().createElement("div",{className:b()(C.caption,C.flex)},g),c().createElement(cp.Z,{className:C.flag}),c().createElement(le.ZP,{title:x().text("Due date")},c().createElement("span",{className:C.date},x().date(o,"L"))),c().createElement(ks.Z,{isOpen:O,size:"L",onClick:()=>{T(!O)}})),c().createElement("div",{className:C.infoBlock},c().createElement("div",{className:C.flex},E&&c().createElement("div",{className:C.info},x().text("DCR ID"),": ",c().createElement("span",{className:C.infoValue},E)),c().createElement("div",{className:C.info},x().text("Created by"),": ",c().createElement("span",{className:C.infoValue},p)," ",x().text("on")," ",c().createElement("span",{className:C.infoValue},x().date(d,"L"))),c().createElement("div",{className:C.info},x().text("Step"),": ",c().createElement("span",{className:C.infoValue},m)),S&&(null==f?void 0:f.length)>0&&c().createElement("div",{className:C.commentsInfo},c().createElement(mx,{className:C.commentsIcon}),c().createElement("div",{className:C.infoValue},f.length))),n||c().createElement(ox,{taskId:l,possibleActions:y,assignee:u,isTaskOpen:v}))))),O&&c().createElement(sx,{plain:!0},c().createElement("div",{className:C.controlsBox},c().createElement("div",{className:C.controlsInRow},c().createElement(qy,{taskId:l,dueDate:o,isTaskOpen:v}),c().createElement(Gy,{taskId:l,priority:i,className:C.priority,isTaskOpen:v})),c().createElement(Hy,{taskId:l,assignee:u,isTaskOpen:v})))),O&&c().createElement(c().Fragment,null,r,S&&c().createElement("div",{className:C.comments},c().createElement(lx,{taskId:l,processInstanceComments:f,isTaskOpen:v}))))};function hx(){return hx=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},hx.apply(this,arguments)}const fx=e=>c().createElement("svg",hx({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 bx,yx;!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"}(bx||(bx={})),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"}(yx||(yx={}));const xx=(e,t)=>{switch(e){case yx.CREATE_RELATIONSHIP:case yx.INSERT_ATTRIBUTE:return bx.ADDED;case yx.UPDATE_TAGS:case yx.UPDATE_ROLES:case yx.UPDATE_ATTRIBUTE:return bx.EDITED;case yx.DELETE_ATTRIBUTE:case yx.DELETE_RELATIONSHIP:return bx.DELETED;case yx.PIN_ATTRIBUTE:return null!=t&&t.pin?bx.PIN_DELETED:bx.PINNED;case yx.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?bx.IGNORE_DELETED:bx.IGNORED}},vx=e=>({[bx.ADDED]:x().text("added"),[bx.EDITED]:x().text("edited"),[bx.DELETED]:x().text("deleted"),[bx.PINNED]:x().text("pinned"),[bx.PIN_DELETED]:x().text("pin deleted"),[bx.IGNORED]:x().text("ignored"),[bx.IGNORE_DELETED]:x().text("ignore deleted")}[e]||""),Ex=(e,t)=>(0,N.when)((0,N.allPass)([(0,N.pipe)((0,N.prop)("type"),(0,N.equals)(u.oS0.TYPE_STRING)),()=>(0,u.CBv)(t)]),(0,N.evolve)({type:(0,N.always)(u.oS0.TYPE_URL)}))((0,u.PFL)(e));function wx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cx(e,t,r[t])}))}return e}function Cx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ox=(e,t)=>{if("newValue"in e||"oldValue"in e){const{newValue:r,oldValue:n,type:a}=e,l=(0,N.pathOr)([],["value",t.name])(r),o=(0,N.pathOr)([],["value",t.name])(n),i=Math.max(l.length,o.length);return(0,N.times)((e=>[{value:{newValue:l[e],oldValue:o[e],type:a}}]),i)}const r=e[t.name];return r?[r]:[]},Tx=(0,N.curry)(((e,t,r)=>{const n=Ta(e,t.type,[],[]);return kx(e,n,r)})),Sx=(0,N.curry)(((e,t,r,n)=>{const a=(0,u.V3K)(e,t.type),l=(0,u.xF8)(e,t.type);return(0,N.flatten)([wx({level:1,label:(0,N.propOr)("","label",a),attributeType:a,attributeValue:wx({},t,r)},((e,t)=>{if(t===yx.CREATE_RELATIONSHIP||(0,u.O27)(e)){const e=xx(t);return e?{operation:e}:{}}return{}})(r,n)),kx(e,l,r,2)])})),kx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,N.flatten)(t.map((t=>Ox(r,t).map((r=>r.map((r=>Nx(e,t,r,n))))))).filter((0,N.complement)(N.isEmpty)))},Nx=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return Ix(e,t,r,n);case u.oS0.TYPE_REFERENCE:return Px(e,t,r,n);default:{const e=((e,t)=>{const r=(0,u.kqr)(e)?t:t.value;return(0,N.is)(Object,r)?r:{newValue:t,type:yx.INSERT_ATTRIBUTE}})(t,r);return Dx(t,e,n)}}},Ix=(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},kx(e,a,r.value,n+1)]},Px=(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},kx(e,a,r.value,n+1)]},Dx=(e,t,r)=>{const{newValue:n,oldValue:a,type:l}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===yx.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t);return{attributeType:e,newValue:n,oldValue:a,operation:xx(l,a),label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function Ax(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rx(e,t,r[t])}))}return e}function Rx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jx=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],Zx=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:yx.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:l?[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:o?[{type:yx.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},Lx=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,l=a===yx.UPDATE_ROLES?(0,u.xqc)(e):N.identity,o=(0,N.difference)(r,n),i=(0,N.difference)(n,r),s=[];return o.length&&s.push({type:yx.INSERT_ATTRIBUTE,newValue:{value:o.map(l).join(", ")}}),i.length&&s.push({type:yx.DELETE_ATTRIBUTE,oldValue:{value:i.map(l).join(", ")}}),s},_x=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,l=t===yx.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,N.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,N.isNil)(i)&&(a[r]=(a[r]||[]).concat(c)),a=c.value}return e},Mx=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:l,tags:o,defaultProfilePicValue:i}=t,s=Ax({},r);return i&&(s.defaultProfilePicValue=[i]),l&&(s[u.xPW.roles.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:l.map((0,u.xqc)(e)).join(", ")}}]),o&&(s[u.xPW.tags.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:o.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},Vx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case yx.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case yx.UPDATE_TAGS:n[u.xPW.tags.name]=Lx(e,r);break;case yx.UPDATE_ROLES:n[u.xPW.roles.name]=Lx(e,r);break;case yx.UPDATE_START_DATE:n[u.xPW.startDate.name]=Zx(r);break;case yx.UPDATE_END_DATE:n[u.xPW.endDate.name]=Zx(r);break;case yx.CREATE_RELATIONSHIP:case yx.CREATE_ENTITY:return Ax({},n,Mx(e,r.newValue));case yx.INSERT_ATTRIBUTE:case yx.UPDATE_ATTRIBUTE:case yx.DELETE_ATTRIBUTE:case yx.PIN_ATTRIBUTE:case yx.IGNORE_ATTRIBUTE:_x(n,r)}return n},Bx=(0,T.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Ux=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const l=Bx();return c().createElement(he.Z,{component:"button",variant:"caption",underline:"none",onClick:n,className:a},c().createElement("span",{className:l.linkLabel},r?x().text("View less suggestions"):x().text("View ${suggestionsCount} more suggestions",{suggestionsCount:t})))};var zx=r(43525);const Fx=(0,T.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"}}}))),Hx=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:l}=e;const o=Fx(),i=r||n;return c().createElement("div",{className:b()(o.field,l)},c().createElement("span",{className:o.fieldName},t,":"),!(0,N.isNil)(i)&&c().createElement("span",{className:o.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(zx.Z,{className:o.arrow}),n)),a&&c().createElement(tt.Z,{variant:"outlined",label:vx(a),className:b()(o.chip,a)}))},Wx=c().createContext(null);Wx.displayName="AttributesChangesContext";const qx=(0,T.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"}}}))),Gx=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:l,newValue:o,operation:i}=e;const p=qx({level:r}),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),m=(0,s.useContext)(Wx),f=(0,s.useCallback)((()=>{if((0,u.YkG)(n)){const e=(0,N.when)((0,N.anyPass)([(0,N.hasPath)(["value","newValue"]),(0,N.hasPath)(["value","oldValue"])]),(0,N.ifElse)((0,N.hasPath)(["value","newValue"]),(0,N.path)(["value","newValue"]),(0,N.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,d,m)}if("endObject"in n){const{endObjectUri:e,endObjectLabel:t}=a;return{objectUri:e,objectLabel:t}}}),[n,a,d,m]),y=(0,s.useCallback)((()=>{const{objectUri:e,objectLabel:t}=f()||{};if(!(0,N.isNil)(e)&&!(0,N.isNil)(t)){var r;const n=!1===(null===(r=m[e])||void 0===r?void 0:r.isExist);return c().createElement(ve.Z,{value:e,className:b()(p.linkContainer,{[p.disabledLink]:n})},c().createElement("span",{className:b()(p.linkLabel,{[p.label]:n})},(0,u.idV)(t)))}return null}),[f,m,p]),x=(0,s.useMemo)((()=>c().createElement("span",null,t,y())),[t,y]),v=(0,s.useCallback)((e=>{const t=(0,u.kDl)(e);return c().createElement(at.Z,{value:t,dataTypeDefinition:Ex(n,t)})}),[n]);return c().createElement(Hx,{className:p.change,label:x,oldValue:l&&v(l),newValue:o&&v(o),operation:i})},$x=(0,T.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function Yx(){return Yx=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},Yx.apply(this,arguments)}const Kx=e=>{let{changes:t}=e;const r=$x();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,N.has)("level",e)?c().createElement(Gx,Yx({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Xx=(0,N.pipe)((0,N.filter)((0,N.has)("operation")),N.length),Qx=(0,T.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"}}))),Jx=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:l}=e;const o=Qx(),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),[p,d]=(0,s.useMemo)((()=>((e,t,r,n)=>{const a=t=>(0,N.pipe)((0,N.pick)([t]),Tx(e,r)),l=(0,N.curry)(((e,t)=>(0,N.reduce)(((e,r)=>(0,N.concat)(e,r(t))),[],e))),o=(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Vx(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Vx(e,r,n,t)),{}))(e,t,r)));return[l([(0,N.pipe)((0,N.omit)(jx),Tx(e,r)),a(u.xPW.roles.name),a(u.xPW.tags.name),a(u.xPW.startDate.name),a(u.xPW.endDate.name)],o),(0,N.flatten)(n.map(((r,n)=>{const a=(0,N.path)([r.uri,0,"type"],t);return Sx(e,r,i[n],a)})))]})(i,t,n,a)),[i,t,n,a]),m=(0,s.useMemo)((()=>{const e={label:x().text("Relationships")};return d.length>0?(0,N.flatten)([p,e,d]):p}),[p,d]),{isExpanded:f,onToggle:b,itemsToShow:y,collapsedSuggestionsCount:v}=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)((()=>Xx(e)),[e]),i=(0,s.useMemo)((()=>Xx(l)),[l]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:l,collapsedSuggestionsCount:o-i}}(m,l);return c().createElement(Wx.Provider,{value:r},c().createElement("div",{className:o.container},c().createElement(ve.Z,{className:o.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:o.label},(0,u.idV)(n.label))),c().createElement(Kx,{changes:y}),v>0&&c().createElement(Ux,{onClick:b,suggestionsCount:v,isExpanded:f,className:o.showMoreLink})))};function ev(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tv(e,t,r[t])}))}return e}function tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.WgC)),nv=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.bC9)),av=(e,t)=>(0,N.filter)((0,N.allPass)([(0,N.pipe)((0,N.prop)("uri"),u.bC9),(0,N.pipe)((0,N.prop)("startObjectUri"),(0,N.equals)(t))]))(e),lv=(0,N.curry)(((e,t)=>({entity:t,relations:av(e,t.uri)}))),ov=(0,N.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:ev({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),iv=(e,t)=>{const{entity:r,relations:n}=t,{uri:a}=r,l=(0,N.pipe)((0,N.pathOr)([],[a,"relations"]),(0,N.concat)(n),N.uniq)(e);return e[a]={entity:r,relations:l},e};function sv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cv=e=>{let{task:t}=e;const{objectURIs:r}=t,n=By(r),{dcr:a,groupedObjects:l}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),l=(0,ze._)(),o=(0,s.useCallback)((e=>(0,N.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,N.pipe)(N.keys,(0,N.filter)((t=>(0,N.prop)([t],e))),(0,N.map)((e=>ev({},t[e],{uri:e}))))(t))(t,n),i=(0,N.pipe)(rv,(0,N.map)(lv(l)))(l),s=(0,N.pipe)(nv,(0,N.map)(ov(n)))(l),[c,u]=(0,N.partition)((0,N.has)("entity"),s),p=u.map((0,N.path)(["relations",0,"startObjectUri"]));o(p).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){sv(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,N.pipe)(N.flatten,(0,N.reduce)(iv,{}),N.values,r)([i,c,t])})).catch(My),a(e)})).catch(My)}),[e,o]),{dcr:n,groupedObjects:t}})(n);return c().createElement(gx,{task:t,Icon:fx},a&&l.map(((e,t)=>c().createElement(sx,{key:t,last:t===l.length-1,divider:!0},c().createElement(Jx,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},uv=(0,T.Z)({pmCard:{marginLeft:"-15px"}});function pv(){return pv=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},pv.apply(this,arguments)}const dv=e=>c().createElement("svg",pv({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 mv=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,N.equals)(Object.keys(i),c),!s)for(const e of c)s=s||!(0,N.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]),gv=e=>{let{enabled:t,entity:r,filter:n,onFinishLoading:a,onStartLoading:l,options:o,page:i,rowsPerPage:c,sorting:p}=e;const{order:d,field:m}=p||{},[f,b]=(0,s.useState)(0),[y,x]=(0,s.useState)([]),[v,E]=(0,s.useState)({}),w=(0,g.useSelector)(h.ZP.selectors.getTenant),C=(0,g.useSelector)(h.ZP.selectors.getDtssPath),O=(0,g.useSelector)(h.ZP.selectors.getDataTenants),T=(0,s.useMemo)((()=>({dtssPath:C,dataTenants:O,entity:r,customerTenant:w,dtssRequest:u.Rgl})),[C,O,r,w]),S=(0,s.useCallback)((0,u.U_T)(T,u.SP6),[T]),k=mv(S),I=mv(u.bFH),P=(0,N.prop)("uri",r),D=(0,ze._)(),A=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t||(0,u.ZiX)(P))return b(0),x([]),void E({});null==l||l(),D((0,u.biM)(r)?I({dtssPath:C,entity:r,customerTenant:w,offset:i*c,max:c,force:e}):k({entityUri:P,offset:i*c,max:c,filter:n,sort:m,order:d,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;b(r),x(t),(0,u.B1H)(n).length>0&&E((0,u.SvV)(n))})).finally((()=>{null==a||a()}))}),[C,t,P,m,n,I,k,a,l,o,d,i,c,D,w]);return(0,s.useEffect)((()=>{A()}),[A]),{total:f,matches:y,entitiesMap:v,loadMatches:(0,s.useCallback)((()=>{A(!0)}),[A])}},hv=(0,T.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"}}),fv=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:l,className:o}=e;const i=hv();return c().createElement("div",{className:b()(i.root,o)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Cp,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(rp,{match:a,metadata:l,entitiesMap:r,entity:n})))},bv={showTransitiveMatches:!0,showInactiveEntities:!1},yv=e=>{let{task:t}=e;const r=uv(),{objectURIs:n}=t,a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),{matches:o,entitiesMap:i}=gv({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:bv}),s=null==o?void 0:o.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(gx,{task:t,Icon:dv},s&&c().createElement(sx,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(fv,{metadata:l,entity:a,match:s,entitiesMap:i}))))};function xv(){return xv=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},xv.apply(this,arguments)}const vv=e=>c().createElement("svg",xv({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 Ev(){return Ev=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},Ev.apply(this,arguments)}const wv=e=>c().createElement("svg",Ev({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 Cv{}Cv.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement(cv,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(yv,{task:t});case u.Yj_.recommendForDelete:return c().createElement(gx,{task:t,Icon:wv});default:return c().createElement(gx,{task:t,Icon:vv})}};const Ov=Cv,Tv=e=>{let{task:t}=e;return Ov.build({task:t})};var Sv=r(8560);const kv=(0,T.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"}}))),Nv=e=>{let{anchorEl:t,onClose:r}=e;const n=kv(),[a,l]=(0,s.useState)(""),[o,i]=(0,s.useState)(null),[p,d]=(0,s.useState)(!1),{definitions:m}=(()=>{const[e,t]=(0,s.useState)([]),r=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),n=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,g.useSelector)(h.ZP.selectors.getTenant),l=(0,g.useSelector)(h.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:f,loading:b}=(()=>{const{loadWorkflowTasks:e}=(0,s.useContext)(_y),t=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),r=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),n=(0,g.useSelector)(h.ZP.selectors.getTenant),a=(0,g.useSelector)(h.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 My(e),e})).finally((()=>{o(!1)})))),[a,r,e,n,t]),loading:l}})(),y=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(_r.ZP,{open:y,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(E.Z,{className:n.title},x().text("Add new workflow")),c().createElement(Ml.Z,{className:n.simpleDropDownSelector,variant:"filled",height:40,TextFieldProps:{InputProps:{disableUnderline:!0}},placeholder:x().text("Select task type"),value:o,onChange:e=>{i(e)},label:"",options:m.map((e=>({value:e.type,label:e.displayName})))}),c().createElement(zc.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(Le.Z,{disabled:b,className:n.cancelButton,onClick:r},x().text("Cancel")),c().createElement(Le.Z,{disabled:b,color:"primary",onClick:()=>{f(a,null==o?void 0:o.value).then((()=>{d(!0),l(""),i(null)})).catch((()=>{}))}},x().text("Start")))),c().createElement(Sv.Z,{container:document.body},c().createElement(qn.Z,{open:p,autoHideDuration:5e3,onClose:()=>{d(!1)},message:x().text("A new workflow has started")})))},Iv=(0,T.Z)({button:{padding:"9px 16px 9px 12px",marginLeft:"auto",marginRight:"8px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),Pv=()=>{const e=Iv(),[t,r]=(0,s.useState)(null),n=Vy(),a=n("START_PROCESS_INSTANCE"),l=n("VIEW_PROCESS_DEFINITIONS");return a&&l?c().createElement(c().Fragment,null,c().createElement(Le.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement(Yr.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},x().text("Add"))),c().createElement(Nv,{anchorEl:t,onClose:()=>r(null)})):null};function Dv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Av=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,ze._)(),l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,g.useSelector)(h.ZP.selectors.getEntityUri),p=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode),d=Vy()("VIEW_TASKS"),m=!(!l||!o)&&d,[f,b]=(0,s.useState)(null),[y,x]=(0,s.useState)(0),[v,E]=(0,s.useState)(!1),w=(0,s.useCallback)((()=>{E(!0);const e=!Array.isArray(t)||t.includes("*")?null:t,s=(e||[null]).map((e=>(0,u.uT0)({entityUri:c,workflowPath:l,environment:o,tenant:i,filter:{assignee:r,processType:e},includeClosed:!!n})));a(Promise.all(s)).then((t=>{const n=(0,N.pipe)((0,N.map)((0,N.prop)("data")),(0,N.reject)(N.isNil),N.flatten,(0,N.uniqBy)((0,N.prop)("taskId")),(0,N.filter)(Rv(e,r)))(t);b(n),x(n.length)})).catch((e=>{console.warn("Workflow error",e)})).finally((()=>{E(!1)}))}),[c,o,a,i,l,r,n,t]);(0,s.useEffect)((()=>{c&&m&&!(0,u.ZiX)(c)&&w()}),[m,c,w,p]);const C=(0,s.useCallback)(((e,t)=>{b((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){Dv(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:f,total:y,loading:v,updateTaskState:C,loadWorkflowTasks:w}},Rv=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function jv(){return jv=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},jv.apply(this,arguments)}const Zv=e=>c().createElement("svg",jv({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"}))),Lv=(0,T.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 _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)}let Mv;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(Mv||(Mv={}));const Vv=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Mv.iconButton,label:a,disabled:l,icon:o,onClick:i=Cn.ZT,onMenuClose:s=Cn.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 p=Lv();return(()=>{switch(n){case"iconButton":return c().createElement(ye.k,_v({disabled:l,className:b()(p.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:o},u));case"button":return c().createElement(Le.Z,_v({className:b()(p.button,r),disabled:l,startIcon:c().createElement(o,null),onClick:i,color:"primary",classes:{startIcon:p.startIcon,label:p.label}},u),c().createElement(mi.C,{value:a},c().createElement("div",{className:p.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(Va.Z,_v({classes:{root:p.menuItem},onClick:e,disabled:l,ref:t},u),c().createElement(c().Fragment,null,c().createElement(o,{className:p.menuIcon}),c().createElement(E.Z,{classes:{root:p.menuText}},a)))}}})()}));Vv.displayName="ActionButton";const Bv=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:l=Cn.ZT}=e;const o=(0,g.useSelector)(h.ZP.selectors.getTenant),i=(0,g.useSelector)(h.ZP.selectors.getDtssPath),[c,p]=(0,s.useState)(!1);return{isPending:c,sendMergeAllRequest:(0,s.useCallback)((()=>{null==a||a(),p(!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(),p(!1)}))}),[i,t,r,n,a,o])}};function Uv(){return Uv=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},Uv.apply(this,arguments)}const zv=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Mv.iconButton,onMenuClose:a=Cn.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p}=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","onError"]);const{sendMergeAllRequest:m}=Bv({entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p});return c().createElement(Vv,Uv({className:r,disabled:l,mode:n,label:x().text("Merge"),icon:Zv,onClick:m,onMenuClose:a,ref:t},d))}));function Fv(){return Fv=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},Fv.apply(this,arguments)}zv.displayName="mergeButton";const Hv=e=>c().createElement("svg",Fv({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"}))),Wv=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a}=e;const l=(0,g.useSelector)(h.ZP.selectors.getTenant),o=(0,g.useSelector)(h.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 qv(){return qv=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},qv.apply(this,arguments)}const Gv=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Mv.iconButton,onMenuClose:a=Cn.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u}=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"]);const{sendMarkAsNotMatchRequest:d}=Wv({entity:o,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(Vv,qv({className:r,disabled:l,mode:n,label:x().text("Not a match"),icon:Hv,onClick:d,onMenuClose:a,ref:t},p))}));function $v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Gv.displayName="notMatchButton";const Yv=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){$v(e,t,r[t])}))}return e}({},e,{[n]:(0,N.pipe)(a,r)})}),{})),[r,t])};function Kv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xv(e,t,r[t])}))}return e}function Xv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qv=[],Jv=e=>console.error("Collaboration error",e),eE=e=>{let{objectIds:t=Qv,objectTypes:r,enabled:n=!0}=e;const a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getTenant),o=(0,g.useSelector)(h.ZP.selectors.getCollaborationPath),i=(0,g.useSelector)(h.ZP.selectors.isCollaborationEnabled)&&n,[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)([]),[f,b]=(0,s.useState)(null),[y,x]=(0,s.useState)(null),[v,E]=(0,s.useState)(!1),[w,C]=(0,s.useState)(!1),O=(0,s.useCallback)((e=>{b((t=>Kv({},t,e)))}),[]),T=null==a?void 0:a.uri,S=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&T&&!(0,u.ZiX)(T)){const r=e=>{console.warn("Collaboration error",e),b(null)};(0,N.pipe)(u.$oF,(0,N.andThen)((0,N.map)((0,N.props)(["objectId","comments"]))),(0,N.andThen)(N.fromPairs),(0,N.andThen)(t?b:O),(0,N.otherwise)(r))({uris:e,tenant:l,collaborationPath:o})}else b(null)}),[O,o,T,i,l]);(0,s.useEffect)((()=>{S(t,!0)}),[t,S]);const k=(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,N.uniqBy)((0,N.prop)("commentId"),[...e,...r]):r)),p(n)})).catch(Jv)}),[o,l]),I=(0,s.useCallback)((e=>{C(!0),(0,u.d7q)({collaborationPath:o,tenant:l,commentId:e}).then(x).catch(Jv).finally((()=>C(!1)))}),[o,l]),P=(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)=>{x(e),b((r=>Kv({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),m((t=>[e,...t]))})(t,a)})).catch(Jv).finally((()=>E(!1)))}),[o,l]),D=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i,commentId:s,replies:c}=e;E(!0);const p={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:p}).then((e=>(e=>{x(e),m((0,N.map)((0,N.when)((0,N.propEq)("commentId",e.commentId),(0,N.always)(e))))})(Kv({},e,{replies:c})))).catch(Jv).finally((()=>E(!1)))}),[o,l]),A=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;E(!0),(0,u.YFy)({collaborationPath:o,tenant:l,commentId:r}).then((()=>((e,t)=>{x(null),b((r=>{const n=r[t]||[];return Kv({},r,{[t]:n.filter((t=>t.commentId!==e))})})),m((t=>t.filter((t=>t.commentId!==e))))})(r,t))).catch(Jv).finally((()=>E(!1)))}),[o,l]),R=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";x("resolved"===n?e=>{if(e)return null}:t=>{if(t)return Kv({},t,{replies:[...t.replies,e]})}),b((e=>Kv({},e,{[t]:e[t].map((e=>e.commentId===r?Kv({},e,{status:n,replies:e.replies+1}):e))}))),m((t=>t.map((t=>t.commentId===r?Kv({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),j=(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 R(t,i,n)})).catch(Jv).finally((()=>E(!1)))}),[o,l,R]),Z=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[j]),L=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[j]);return{clearCurrentComment:(0,s.useCallback)((()=>{x(null)}),[]),comments:d,commentsMap:f,createComment:P,createReply:j,currentComment:y,deleteComment:A,editComment:D,getComment:I,getComments:k,getCommentsCount:S,loading:w,objectTypes:r,pageToken:c,reOpenThread:L,resolveThread:Z,sending:v}};function tE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rE=e=>{let{sorting:t,filter:r,page:n,rowsPerPage:a,config:l,entity:o,relationActivityFilter:i,mode:c}=e;const[p,d]=(0,s.useState)(!1),m=(0,g.useDispatch)(),f=(0,g.useSelector)(h.ZP.selectors.getTenant),b=(0,g.useSelector)(h.ZP.selectors.getDtssPath),{activityFilter:y,globalFilter:x}=(0,g.useSelector)(h.ZP.selectors.getGlobalSearchRequestOptions)||{},v=(0,ze._)(),E=(0,s.useCallback)((()=>{if(null!=o&&o.uri){const 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){tE(e,t,r[t])}))}return e}({},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:y},max:a,offset:n*a,filter:(0,u.vyX)(x,r)||void 0}),s=(0,N.cond)([[(0,N.pipe)((0,N.prop)("uri"),u.ZiX),()=>Promise.resolve([{total:0}])],[u.biM,t=>(0,u.n_1)({entityUri:t.uri,configs:[e],customerTenant:f,dataTenant:t.dataTenant,dtssPath:b})],[N.T,t=>(0,u.N6e)(t.uri,[e])]]);d(!0),v(s(o)).then((e=>{let[{connections:t,total:r}]=e;m(h.N5.relations.actions.relationsLoaded({id:l.id,connections:t,total:r}))})).finally((()=>{d(!1)}))}}),[y,l,m,b,null==o?void 0:o.uri,null==o?void 0:o.dataTenant,r,x,n,i,a,v,t,f]),w=(0,s.useRef)(!1);w.current=!1,(0,s.useEffect)((()=>{w.current=!0,E()}),[E]);const C=(0,mb.D)(c);return(0,s.useEffect)((()=>{c!==u.ARY.Viewing||w.current||C===c||(w.current=!0,E())}),[E,c,C]),{isLoading:p,reload:E}},nE=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var aE=r(11326);const lE=()=>{const[e,t]=(0,s.useState)([]),r=(0,g.useSelector)(h.ZP.selectors.getTenant),n=(0,g.useSelector)(h.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 oE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iE=(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){oE(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 sE=r(47081),cE=r(8007);const uE=c().createContext(!1);uE.displayName="ProfilePerspectiveViewContext";const pE=c().createContext("");pE.displayName="IdContext"}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[676],{48676:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>Oa,ActionButton:()=>Vv,ActionButtonMode:()=>Mv,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>l.I,AddWorkflowButton:()=>Pv,ArrowExpandButton:()=>Ut,AsyncMountContext:()=>pa,AttributeListItem:()=>m.Z,AttributeTitle:()=>Q,AttributesList:()=>Pa,AttributesPager:()=>ro,AttributesTable:()=>of,AttributesView:()=>pi,AutoSizeList:()=>Ni.Z,AvatarWithFallback:()=>Ii.Z,BarChart:()=>Qs.Z,BasicTable:()=>Pi.Z,BasicTableContext:()=>Ai.X,BasicTablePagination:()=>is.Z,BasicView:()=>C.Z,BasicViewContent:()=>Xs.Z,BasicViewHeader:()=>O.Z,BlockImageGalleryDialogContext:()=>Cr,BranchDecorator:()=>D,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>J,CardinalityMessage:()=>Zl,ChartsFactory:()=>rc.Z,ClickAwayProvider:()=>oc,CollaborationContext:()=>ne,CollaborationItem:()=>qe,CollapseButton:()=>ks.Z,CollapseRowButton:()=>Ps,ColorBar:()=>ic.Z,ColumnFilterType:()=>ji.Dq,ColumnsDataType:()=>ji.uz,ColumnsSettings:()=>ts,CommentsContainer:()=>et,ConfigureColumnsPopup:()=>fc,ConfirmDeleteDialog:()=>oh,ConfirmationDialog:()=>lh,ConnectionRelationTypeSelector:()=>vc,CrosswalkDragLayer:()=>hf,CrosswalkEditor:()=>Zf,CrosswalkType:()=>ff,CrosswalksDisplayProvider:()=>Bm,DEFAULT_OVERLAY_OPTIONS:()=>ub,DataTypeValue:()=>at.Z,DataTypeValueEditor:()=>na.Z,DateEditor:()=>Dc.Z,DateRangeEditor:()=>Pc.Z,DateRangeTypes:()=>xb.K,DefaultCellValueRenderer:()=>ss.Z,DeltaTypes:()=>o.w,Drawer:()=>Tc,DropDownEditor:()=>Sc.Z,DropDownMenuButton:()=>be.Z,DropDownSelector:()=>_a.Z,DropdownIndicator:()=>sc.Z,DropdownIndicatorWithIconButton:()=>cc.Z,EMPTY_STATE_ICONS:()=>Mc.B9,EMPTY_STATE_VARIANTS:()=>Mc.tC,EditableAttribute:()=>Ol,EditableImageAttributesLine:()=>Jn,EmptyState:()=>Mc.ZP,EmptyStub:()=>Cn.Vd,EntitiesMapContext:()=>xe,EntityAvatar:()=>bt,EntityCreator:()=>al,EntityMarkerContext:()=>nb,EntitySelector:()=>gl,EntityTypeBadge:()=>Bc,EntityTypeIcon:()=>Ma.Z,EntityTypesSelector:()=>au,EntityUriLink:()=>ve.Z,ErrorBoundary:()=>lu.Z,ErrorMessage:()=>ta,ErrorPopup:()=>ou.Z,ErrorWrapper:()=>ia,ExpandableSearchInput:()=>Zm,ExpandedAttributesProvider:()=>$g,ExpandedValueTooltip:()=>mi.C,FacetViewHeader:()=>k,FileTypeEditor:()=>Rc.Z,FilterButton:()=>os,FilterValueEditor:()=>Nc.Z,FlipCard:()=>du,HideOnShrink:()=>hu,HierarchicalAttributeTooltip:()=>wu,Highlighter:()=>Xr,HistoryActivityType:()=>yb,HistoryChangeTypes:()=>Mb,HistoryDiffContext:()=>ct,HistoryHeader:()=>Sy,HistoryPanelEmptyState:()=>Iy,HistoryView:()=>Jb,IdContext:()=>pE,ImageAttributesLine:()=>Vo,ImageGalleryDialog:()=>To,ImportButton:()=>ku,ImportModes:()=>Su,InlineAttributesPager:()=>zg,InlineImageAttribute:()=>Lg,InlineNestedAttribute:()=>Jg,InlineReferenceAttribute:()=>Pg,LightArrowTooltip:()=>Xm,LinearLoadIndicator:()=>Dn,Link:()=>Iu,LoadingSpinner:()=>Pu,MAP_DRAWING_MODES:()=>cb,MAP_MINIMUM_SCALE_RADIUS:()=>pb,Marginator:()=>eh.Z,MatchRulesBlock:()=>rp,MenuWithPopper:()=>uc.Z,MergeButton:()=>zv,ModeSwitcher:()=>wo,ModeSwitcherSelect:()=>ip,MoreAttributesButton:()=>en,MultiSelect:()=>_p.Z,MultiValueChip:()=>Vl.Z,MultipleInput:()=>sp.Z,NestedAttribute:()=>Kt,NestedAttributeEditor:()=>La,NoData:()=>Lc,NoResults:()=>_c.X,NotMatchButton:()=>Gv,NumberEditor:()=>Ic.Z,OvIcon:()=>st,PieChart:()=>Js.Z,PivotingAttributeContext:()=>w,Popper:()=>Ye.Z,PopupBoundariesContext:()=>cE.p,PopupWithArrow:()=>Xe,PotentialMatchReviewCard:()=>gp,ProfileBand:()=>vp,ProfileBandHistory:()=>Ny,ProfileBandNavigation:()=>Ks,ProfileCard:()=>Cp,ProfileMatchCard:()=>fv,ProfilePerspectiveViewContext:()=>uE,QueryBuilderAttributeDataType:()=>ji.eB,QueryBuilderAttributeType:()=>ji.Xw,QueryBuilderRow:()=>Rp,QueryBuilderRowsGroup:()=>Lp,ReactSelectOptionFilters:()=>Mp,ReactSortableTree:()=>zd,ReactSortableTreeHandlers:()=>Dd,ReactSortableTreeUtils:()=>pd,ReadOnlyAttribute:()=>ar,ReadOnlyAttributeValuesBlock:()=>ki,ReadOnlyAttributesList:()=>ni,ReadOnlyAttributesPager:()=>ri,ReferenceAttribute:()=>nr,ReferenceAttributeEditor:()=>wl,RelatedObjectUrisContext:()=>ae,RelationEditor:()=>Zy,RelationTypeSelector:()=>Ei,ReltioGridLayout:()=>Fd.Z,ReltioMap:()=>fb,ResizablePanes:()=>Yd,RowCellAutoSizer:()=>Ts,Score:()=>fp,ScoreLabel:()=>K,ScrollableTabs:()=>_m.Z,SearchInput:()=>Vr.Z,SelectionPopup:()=>Ur,SelectionPopupPopper:()=>am,SelectorWithOnlyOptionAutoSelect:()=>im,SideButtonsPanel:()=>um,SidePanel:()=>fm,SidePanelContentHeader:()=>ym,SidePanelEmptyState:()=>gm,SimpleAttribute:()=>Lt,SimpleAttributeEditor:()=>wa,SimpleDropDownSelector:()=>Ml.Z,SimpleMatchRulesBlock:()=>Hu,SimpleMatchRulesBuilder:()=>Gu,SmallIconButton:()=>_t.Z,SmallIconButtonWithTooltip:()=>ye.k,SortingType:()=>ji.nI,SourceCrosswalksRow:()=>Rf,SourceIcon:()=>xm.Z,Spacer:()=>vm.Z,TableContext:()=>Ai.X,TableWithBars:()=>ec.Z,TextEditor:()=>kc.Z,TimestampEditor:()=>Ac.Z,TransitiveMatchBlock:()=>tp,TreeChart:()=>tc.Z,UsersContext:()=>Te,VerticalDivider:()=>wm,VerticalHeadingsTable:()=>Sm,ViewIdContext:()=>Ga.m,ViewMoreToggle:()=>Pm,VirtualGroupedList:()=>Gr,WhiteSearchInput:()=>em,WorkflowComments:()=>lx,WorkflowTaskCard:()=>Tv,WorkflowTasksContext:()=>_y,basicTableViewState:()=>ws,buildColumnsFilter:()=>ps.Tz,columnFilterToMdmFilter:()=>ps.su,createStandardAction:()=>Cn.zD,defaultGetRowCellHeight:()=>cs.Z,defaultRenderRowCell:()=>us.Z,getChecked:()=>Cn.IR,getValue:()=>Cn.NA,groupCrosswalksByTypesAndSources:()=>Mf,isIE:()=>Cn.w1,mergeClasses:()=>Cn.ze,noop:()=>Cn.ZT,parseJSON:()=>Cn.Rx,stopPropagation:()=>Cn.UW,toggleSortOrder:()=>Cn.Dh,useActions:()=>Yv,useActivitiesLoader:()=>i.d,useAsyncMount:()=>ma,useAttributeExpanded:()=>Yg,useBasicTableCellRenderer:()=>_s,useClickableStyle:()=>ac.d,useCollaboration:()=>eE,useConfigPermissions:()=>sE.l,useCrosswalkActions:()=>df,useCrosswalkColor:()=>Um,useCrosswalkFocus:()=>Hm,useCrosswalkHighlight:()=>Fm,useDidUpdateEffect:()=>te.D,useDynamicRowCellHeight:()=>Rs,useHighlightedCrosswalks:()=>zm,useHistory:()=>Nb,useHistoryDiff:()=>Ab,useHistorySlice:()=>bb,useKeyboardNavigation:()=>$r,useMarkAsNotMatchRequest:()=>Wv,useMatchesLoader:()=>gv,useMergeAllRequest:()=>Bv,useModifiedEntity:()=>pf,usePagingSimulator:()=>mv,usePrevious:()=>mb.D,useProfileActivitiesLoader:()=>d,useRelationTypeSelector:()=>bc,useRelationsLoader:()=>rE,useRunOnceAfterValueInitialization:()=>nE,useSafePromise:()=>ze._,useSavedState:()=>aE.a,useUsers:()=>lE,useWhyDidYouUpdate:()=>iE,useWorkflowAssignee:()=>Fy,useWorkflowCheckPermission:()=>Vy,useWorkflowComments:()=>nx,useWorkflowTasks:()=>Av,withAsyncMount:()=>ha,withFilterAtBottom:()=>Ri.Z,withPercents:()=>nc.Z,withTableContext:()=>Di.Z,withTooltip:()=>lt.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(67075),p=r(54202);const d=e=>{let{filter:t,max:r,offset:n,entityUri:a}=e;return(0,s.useCallback)((async()=>{const e=(0,p.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),g=r(52730),h=r(89810),f=r(71153),b=r.n(f),y=r(87918),x=r.n(y),v=r(95544),E=r(90436);const w=c().createContext([]);var C=r(1730),O=r(17998),T=r(79692);const S=(0,T.Z)({container:{padding:"0 16px",minHeight:"48px"},title:{fontSize:"16px",lineHeight:"19px",paddingTop:"16px",paddingBottom:"13px",justifyContent:"flex-start"}}),k=e=>{let{className:t,title:r,children:n}=e;const a=S();return c().createElement(O.Z,{title:r,classes:{root:b()(a.container,t),title:a.title}},n)};var N=r(17440);const I="1px solid #AFD4E9",P=(0,T.Z)({decorator:{marginLeft:8,borderLeft:I,"&:last-child":{borderLeft:"none","&:before":{borderLeft:I}},"&:before":{top:0,height:14,width:5,borderBottom:I,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),D=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const l=P();return a?c().createElement("div",{className:b()(l.decorator,{[l.plain]:n},t)},c().createElement("div",{className:l.wrapper},r)):c().createElement(c().Fragment,null,r)};function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){R(e,t,r[t])}))}return e}function R(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const j="13px",Z="15px",L={titleRow:{display:"block",minHeight:"16px",textIndent:"-1em",paddingLeft:"1em"},title:{whiteSpace:"nowrap"},ovIcon:{marginLeft:"8px",marginRight:"-3px",marginTop:"-1px",textIndent:0}},_=(0,T.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),M=(0,T.Z)(A({wrapper:{fontSize:j,lineHeight:Z,flex:1},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginBottom:"-3px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)"}},L)),V=(0,T.Z)(A({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:j,lineHeight:Z},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"}},L,{titleRow:A({},L.titleRow,{marginBottom:"3px"})}));var B=r(13980),U=r.n(B),z=r(32701);const F=(0,T.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"15px"}}),H=(0,T.Z)({container:{display:"flex",flexShrink:0,marginLeft:"10px",alignItems:"center"},value:{marginLeft:"4px",minWidth:"20px",textAlign:"center"}}),W=(0,T.Z)({dqiq:{width:"14px",height:"14px",lineHeight:"14px",background:"#e6605e",color:"#fff",fontSize:"10px",fontWeight:100,marginLeft:"2px",marginRight:"1px",borderRadius:"2px",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,textIndent:0}}),q=()=>{const e=W();return c().createElement(c().Fragment,null,c().createElement("span",null,"DQ"),c().createElement("span",{className:e.dqiq},"IQ"))},G=["analyticsAttributes/DQ/analyticsAttributes/score","analyticsAttributes/DQ"],$=["analyticsAttributes/IQ/analyticsAttributes/score","analyticsAttributes/IQ"],Y=e=>{let{label:t="",attrTypeUri:r=""}=e;const n=r.indexOf("analyticsAttributes/"),a=r.substr(n),l=(0,N.includes)(a,G),o=(0,N.includes)(a,$);return(0,N.cond)([[(0,N.always)(l),(0,N.always)(c().createElement(q,null))],[(0,N.always)(o),(0,N.always)(x().text("Rank"))],[N.T,(0,N.always)(t)]])()};Y.propTypes={label:U().string,attrTypeUri:U().string};const K=Y,X=e=>{let{label:t,isRequired:r,className:n,attributeType:a={}}=e;const l=F();return c().createElement(E.Z,{className:b()(l.label,n),component:"span"},c().createElement(K,{label:t,attrTypeUri:a.uri}),r&&c().createElement(z.Z,null))};X.propTypes={label:U().string,isRequired:U().bool,className:U().string,attributeType:u.EMD};const Q=X,J="commentsContainerVisibilityArea",ee=(0,T.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${J}:hover &`]:{visibility:"visible"}},showAlways:{}})));var te=r(55962);const re=()=>{},ne=c().createContext({comments:[],commentsMap:null,currentComment:null,getComment:re,getComments:()=>new Promise(re),getCommentsCount:re,createComment:()=>new Promise(re),editComment:()=>new Promise(re),createReply:()=>new Promise(re),resolveThread:re,reOpenThread:re,clearCurrentComment:re,deleteComment:re,sending:!1,loading:!1,pageToken:null});ne.displayName="CollaborationContext";const ae=c().createContext([]);ae.displayName="RelatedObjectUrisContext";var le=r(80030);function oe(){return oe=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},oe.apply(this,arguments)}const ie=e=>c().createElement("svg",oe({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),se=(0,T.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}},childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}))),ce=c().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=se();return c().createElement(le.ZP,{title:x().text("Show comment")},c().createElement("div",{ref:t,className:a.root,onClick:n},c().createElement(ie,{className:a.icon}),c().createElement("div",{className:a.childrenWrapper},r)))}));ce.displayName="CommentButton";const ue=ce;function pe(){return pe=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},pe.apply(this,arguments)}const de=e=>c().createElement("svg",pe({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),me=e=>{let{className:t,onClick:r}=e;const n=se();return c().createElement(le.ZP,{title:x().text("Add comment")},c().createElement("div",{className:b()(n.root,t),onClick:r},c().createElement(de,{className:n.icon})))};var ge=r(27291),he=r(86689),fe=r(43054),be=r(98538),ye=r(39475);const xe=c().createContext({});xe.displayName="EntitiesMapContext";var ve=r(18527);const Ee=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},we=e=>`${x().date(e,"LT")} ${x().date(e,"LL")}`,Ce=(0,T.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),Oe=e=>{let{comment:t,className:r}=e;const n=Ce(),a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,s.useContext)(xe);return c().createElement(v.Z,{className:r},(()=>{switch(t.objectType){case u.q7e.ENTITY_ATTRIBUTE:{const e=(0,u.AFK)(t.objectId,a.type),r=(0,u.zeJ)(l,e);return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected attribute:")),c().createElement(E.Z,{className:n.label},null==r?void 0:r.label))}case u.q7e.ENTITY:return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected profile:")),c().createElement(ve.Z,{className:b()(n.label,n.link),value:(0,u.wwR)(a)},(0,u.idV)(a.label)));case u.q7e.RELATION:{var e;const r=Ee(t,a.uri),l={uri:r,label:null===(e=o[r])||void 0===e?void 0:e.label};return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected relation:")),c().createElement(E.Z,{className:n.label},c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(a)},(0,u.idV)(a.label)),r&&c().createElement(c().Fragment,null,` ${x().text("to")} `,c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}case u.q7e.POTENTIAL_MATCH:{var r;const e=Ee(t,a.uri),l={uri:e,label:null===(r=o[e])||void 0===r?void 0:r.label};return c().createElement(c().Fragment,null,c().createElement(E.Z,{className:n.title},x().text("Selected potential match:")),c().createElement(E.Z,{className:n.label},c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(a)},(0,u.idV)(a.label)),e&&c().createElement(c().Fragment,null,` ${x().text("and")} `,c().createElement(ve.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}default:return null}})())},Te=c().createContext([]);Te.displayName="UsersContext";const Se=(0,T.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),ke=e=>{let{comment:t,className:r}=e;const n=Se(),a=(0,s.useContext)(Te);return c().createElement(E.Z,{className:b()(n.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let l="",o=!1;for(let i=0;i<=e.length;i++){const s=e[i],c=e[i+1],u=i===e.length-1;l+=s,s===n&&0===i&&(o=!0),o&&t.includes(l.slice(n.length))&&(o=!1,a.push(r(l)),l=""),c===n&&(o=!0,a.push(l),l=""),u&&a.push(l)}return a}(t.content,t.namedUsers,(e=>{const t=a.find((t=>t.username===e.slice(1)));return t?c().createElement(he.Z,{href:`mailto:${t.email}`},e):e})).map(((e,t)=>c().createElement(s.Fragment,{key:t},e))))};var Ne=r(43434);const Ie=(0,T.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function Pe(){return Pe=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},Pe.apply(this,arguments)}const De=e=>{let{className: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,["className","children"]);const a=Ie();return c().createElement(Ne.Z,Pe({},n,{className:b()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))},Ae=(0,T.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),Re=e=>{let{onReply:t,className:r,uri:n,comment:a,onStartEditing:l}=e;const o=Ae(),i=(0,g.useSelector)(h.ZP.selectors.getUserName),u=a.createdBy===i,{resolveThread:p,reOpenThread:d,sending:m,deleteComment:f}=(0,s.useContext)(ne),b=(0,s.useMemo)((()=>[{text:x().text("Edit"),onClick:l},{text:x().text("Delete"),onClick:()=>f({uri:n,commentId:a.commentId})}]),[l,f,n,a]);return c().createElement(v.Z,{className:r},c().createElement(v.Z,{className:o.header},c().createElement(De,{classes:{root:o.avatar}},a.createdBy),c().createElement(v.Z,{width:"100%"},c().createElement(E.Z,{className:o.username},a.createdBy)),c().createElement(E.Z,{className:o.createdAt},we(a.createdTime)),u&&c().createElement(be.Z,{buttonComponent:ye.k,buttonProps:{icon:fe.Z,tooltipTitle:x().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:b,menuId:"collaboration-comment-menu"})),c().createElement(v.Z,{className:o.body},c().createElement(Oe,{comment:a,className:o.commentTarget}),c().createElement(ke,{comment:a,className:o.message}),c().createElement(v.Z,{className:o.buttons},c().createElement(he.Z,{className:o.button,onClick:t,component:"button"},x().text("Reply")),"open"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{p({commentId:a.commentId,uri:n})},component:"button"},x().text("Resolve")),"resolved"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{d({commentId:a.commentId,uri:n})},component:"button"},x().text("Re-open")))))},je=(0,T.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),Ze=e=>{let{className:t,reply:r}=e;const{createdBy:n,action:a,createdTime:l}=r,o=je();return c().createElement(v.Z,{className:b()(o.root,t)},c().createElement(De,{classes:{root:o.avatar}},n),c().createElement(v.Z,null,c().createElement(v.Z,{className:o.header},c().createElement(E.Z,{className:o.username},n),"resolve"===a&&c().createElement(E.Z,{className:o.marked},x().text("Marked as resolved")),"reopen"===a&&c().createElement(E.Z,{className:o.marked},x().text("Re-opened"))),"resolve"!==a&&c().createElement(ke,{className:o.message,comment:r}),c().createElement(E.Z,{className:o.createdAt},we(l))))};var Le=r(77277),_e=r(2271);const Me=(0,T.Z)((e=>({root:{width:"100%",backgroundColor:"#fff",fontFamily:"Roboto","&__control":{fontSize:"13px"},"&__highlighter":{padding:"10px 22px",border:"1px solid transparent !important",maxHeight:"70px"},"&__input":{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,maxHeight:"70px",overflow:"auto !important"},"&__suggestions":{padding:"8px 0",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},"&__suggestions__list":{maxHeight:"200px",overflowY:"scroll"},"&__suggestions__item":{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function Ve(){return Ve=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},Ve.apply(this,arguments)}const Be=e=>{let{onChange:t,className: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,["onChange","className"]);const a=Me(),l=(0,s.useContext)(Te);return c().createElement(_e.r,Ve({},n,{onChange:(e,r,n,a)=>{t(r,n,(0,N.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:b()(a.root,r)}),c().createElement(_e.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:a.mention}))},Ue=(0,T.Z)({root:{padding:"6px 6px 6px 8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},textField:{maxWidth:"calc(100% - 40px)"},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:{marginLeft:"40px",marginTop:"8px"},button:{"& + $button":{marginLeft:"8px"}}});var ze=r(29627);const Fe=e=>{switch(e){case"open":return x().text("Reply...");case"resolved":return x().text("Adding a comment will re-open this");default:return""}},He=e=>{let{inputRef:t,className:r,uri:n,relatedObjectUris:a,objectType:l,popperRef:o,comment:i,isEditingComment:u,onCancel:p}=e;const d=Ue(),m=(0,g.useSelector)(h.ZP.selectors.getUserName),{createReply:f,createComment:y,sending:E,editComment:w}=(0,s.useContext)(ne),[C,O]=(0,s.useState)(""),[T,S]=(0,s.useState)(""),[k,I]=(0,s.useState)([]),[P,D]=(0,s.useState)(!1),A=(0,ze._)(),R=""!==C.trim(),j=P||R,Z=null==i?void 0:i.status,L=(e,t,r)=>{I(r),O(e),S(t)},_=()=>{null==p||p(),L("","",[])};return(0,s.useEffect)((()=>{o&&o.current.update()}),[o,j]),(0,s.useEffect)((()=>{u?O(i.content):_()}),[u]),c().createElement(v.Z,{className:b()(d.root,r)},c().createElement("form",{onSubmit:e=>{e.preventDefault();const t=(0,N.cond)([[(0,N.always)(!i),()=>y({content:T,namedUsers:k,objectType:l,uri:n,relatedObjectUris:a})],[(0,N.always)(u),()=>w({content:T,namedUsers:k,commentId:i.commentId,objectType:l,replies:i.replies,relatedObjectUris:a,uri:n})],[N.T,()=>f({content:T,namedUsers:k,commentId:i.commentId,action:"open"===i.status?"none":"reopen",uri:n})]]);return A(t()).then(_).catch(console.log)},className:d.form},c().createElement(v.Z,{className:d.main},c().createElement(De,{classes:{root:d.avatar}},m),c().createElement(Be,{className:d.textField,disabled:E,onChange:(e,t,r)=>{L(e,t,r)},inputRef:t,value:C,onFocus:()=>D(!0),onBlur:()=>D(!1),placeholder:Fe(Z)})),j&&c().createElement(v.Z,{className:d.buttons},c().createElement(Le.Z,{className:d.button,variant:"contained",color:"primary",disabled:!R||E,type:"submit"},((e,t)=>t?x().text("Edit"):"open"===e||"resolved"===e?x().text("Reply"):x().text("Comment"))(Z,u)),c().createElement(Le.Z,{disabled:E,onClick:()=>_(),className:d.button,variant:"outlined",color:"primary"},x().text("Cancel")))))},We=(0,T.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),qe=(0,s.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:l,messagesRef:o,comment:i}=e;const u=(0,s.useRef)(),p=We({classes:a}),[d,m]=(0,s.useState)(!1),g=c().createElement(He,{className:p.sendMessageArea,inputRef:u,popperRef:l,uri:t,relatedObjectUris:r,objectType:n,comment:i,onCancel:()=>m(!1),isEditingComment:d});return c().createElement(v.Z,{className:p.root},i&&c().createElement(c().Fragment,null,c().createElement("div",{className:p.messages,ref:o},c().createElement(Re,{comment:i,uri:t,onReply:()=>{d&&m(!1),u.current.focus()},onStartEditing:()=>{m(!0)},className:p.comment}),c().createElement(v.Z,{className:p.replies},i.replies.map((e=>c().createElement(Ze,{key:e.replyId,className:p.repliedComment,reply:e}))))),g),!i&&g)}));var Ge=r(27556),$e=r(1292),Ye=r(7421);const Ke=(0,T.Z)((e=>{const t=e.palette.background.paper;return{popoverRoot:{backgroundColor:t,maxWidth:1e3},popper:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}})),Xe=e=>{let{anchorEl:t,placement:r="top",arrow:n=!0,open:a,onClose:l=(()=>{}),children:o,className:i,popperRef:s}=e;const u=Ke(),[p,d]=c().useState(null);return c().createElement(Ye.Z,{anchorEl:t,placement:r,className:b()(u.popper,i),modifiers:{preventOverflow:{enabled:!0,boundariesElement:"window"},arrow:{enabled:n,element:p}},open:a,modal:!1,popperRef:s},c().createElement(v.Z,null,c().createElement($e.Z,{onClickAway:e=>{var t;t=e.target,Array.from(document.querySelectorAll("[data-modal]")).some((e=>e.contains(t)))||l()}},c().createElement(Ge.Z,{className:u.popoverRoot},n?c().createElement("span",{className:u.arrow,ref:d}):null,c().createElement(v.Z,null,o)))))},Qe=(0,T.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),Je=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:l,open:o,comment:i}=e;const[u,p]=(0,s.useState)(0),d=Qe({scrollWidth:u,hasScroll:0!==u}),m=(0,s.useRef)(null),{resolveThread:g,loading:h,sending:f}=(0,s.useContext)(ne),b=1+(null==i?void 0:i.replies.length);return c().createElement(Xe,{popperRef:m,anchorEl:a,open:o,placement:"right-start",onClose:l,className:d.popper},c().createElement(v.Z,{className:d.header},c().createElement(v.Z,{className:d.headerInfo},c().createElement(E.Z,{className:d.title},x().text("Comments")),i&&!h&&c().createElement(E.Z,{className:d.counter},x().number(b)," ",1===b?x().text("item"):x().text("items"))),i&&!h&&c().createElement(ye.k,{className:d.resolveButton,size:"S",onClick:()=>{g({commentId:i.commentId,uri:t})},disabled:f,showForDisabled:!0,tooltipTitle:x().text("Resolve"),icon:ge.Z,color:"primary"})),!h&&c().createElement(qe,{popperRef:m,messagesRef:e=>{e&&p(e.offsetWidth-e.clientWidth)},classes:{root:d.collaborationItem,replies:d.replies,sendMessageArea:d.sendMessageArea,messages:d.messages,comment:d.comment},uri:t,relatedObjectUris:r,objectType:n,comment:i}))},et=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:l,allowOnlyOneComment:o=!1,showAlways:i=!1}=e;const u=ee(),[p,d]=(0,s.useState)(null),[m,g]=(0,s.useState)(!1),h=m&&Boolean(p),{currentComment:f,commentsMap:y,getComment:x,clearCurrentComment:v,objectTypes:E}=(0,s.useContext)(ne),w=!!y&&(!E||E.includes(n)),C=((null==y?void 0:y[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),O=!o||o&&0===C.length,T=null===f&&h;(0,te.D)((()=>{l&&l(h)}),[h]);const S=(0,s.useContext)(ae),k=(0,s.useMemo)((()=>S?[...a,...S]:a),[S,a]);return w&&c().createElement("div",{className:b()(u.root,t)},O&&c().createElement(me,{className:b()(u.addButton,{[u.showAlways]:i||T}),onClick:e=>{d(e.currentTarget),g(!0)}}),C.map((e=>{let{replies:t,commentId:r}=e;return c().createElement(ue,{ref:r===(null==f?void 0:f.commentId)?d:null,key:r,onClick:()=>(e=>{x(e),g(!0)})(r)},1+t)})),c().createElement(Je,{anchorEl:p,open:h,onClose:()=>{d(null),v(),g(!1)},uri:r,relatedObjectUris:k,objectType:n,comment:f}))};var tt=r(7089),rt=r(41128);const nt=(0,T.Z)((e=>({container:{height:"16px",borderColor:(0,rt.U1)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}})));var at=r(67586),lt=r(78223);const ot=(0,lt.Z)(tt.Z),it=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const l=nt();if(!a)return null;const o=n.length?n.map(((e,t)=>c().createElement("div",{key:t},(0,u.YkM)(r)?(0,u.idV)(e.label):c().createElement(at.Z,{value:(0,u.kDl)(e),dataTypeDefinition:(0,u.PFL)(r),rich:!1})))):null;return c().createElement(ot,{tooltipTitle:o,tooltipPlacement:"top",label:`+ ${a}`,variant:"outlined",classes:{root:b()(l.container,t),label:l.label}})};it.propTypes={className:U().string,nonOvTotal:U().number,attributeType:u.EMD,nonOvValues:U().arrayOf(U().oneOfType([u.cNQ,u.dMV,u.Rtp]))};const st=it,ct=c().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});ct.displayName="HistoryDiffContext";const ut=(e,t)=>{const r=(0,u.xy8)(e);return t.reduce(((t,n)=>{for(const a in n){const l=(e[r]||[]).find((e=>e.uri===a));return Array.isArray(n[a])&&"object"==typeof n[a][0]?t=(t||[]).concat(ut(l,n[a])):(t.push(pt(n[a],l)),t)}}),[])},pt=(e,t)=>e&&e.length&&!(0,N.isNil)(e[0])?{fieldName:(0,u.Tde)(t.uri),filter:t.type===u.oS0.TYPE_BLOB?u.j5E.FULL_TEXT:u.j5E.EQUALS,values:e}:{fieldName:(0,u.Tde)(t.uri),filter:"missing"},dt=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let l=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(l=l.filter((e=>a.includes(e.uri)))),l.reduce(((e,a)=>{const l=mt(t[a.name],n,r);return l&&l.length&&(Array.isArray(l[0])?e.push({[a.uri]:l[0]}):e.push({[a.uri]:l})),e}),[])},mt=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,l=(0,u.zeJ)(t,n.type);a&&"object"!=typeof a&&(0,u.OXP)(n)?e.push(gt(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(dt(l,a,r,t))}return e}),[])},gt=(e,t)=>{switch(null==t?void 0:t.type){case u.oS0.TYPE_DATE:return new Date(e).getTime();case u.oS0.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function ht(){return ht=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},ht.apply(this,arguments)}const ft=e=>c().createElement("svg",ht({width:11,height:11,viewBox:"0 0 11 11"},e),c().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),bt=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,g.useSelector)(h.ZP.selectors.getAbsoluteImagePath)||"",o=(0,u.uie)(a,l,t),i=(0,u.vPL)(l,(0,u.XH2)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,u.m5F)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};return c().createElement(Ne.Z,{className:b()(r,n),src:o,imgProps:{onError:s}},c().createElement("img",{className:n,src:i,alt:"fallback entity avatar",onError:s}))},yt=(0,T.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"31px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px"},icon:{margin:"auto 8px auto 0"},content:{color:e.palette.primary.main},seeAllButton:{cursor:"pointer"}}))),xt=(0,T.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}});function vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Et=e=>{let{value:t,attributeType:r,config:n={}}=e;const[a,l]=(0,s.useState)([]),[o,i]=(0,s.useState)(0),p=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},d=(0,ze._)(),m=(0,g.useDispatch)(),f=yt(),b=(0,g.useSelector)(h.ZP.selectors.getGlobalSearchRequestOptions)||{},y=n.entityType||p.type,v=o>6;(0,s.useEffect)((()=>{const e=function(e,t){let r=[{fieldName:"type",filter:"equals",values:[arguments.length>2&&void 0!==arguments[2]?arguments[2]:""]}];return Array.isArray(e)?r=r.concat(ut(t,e)):r.push(pt([e],t)),r}(t,r,y),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vt(e,t,r[t])}))}return e}({max:6},b);d(Promise.all([(0,u.ZOr)(e,n),(0,u.j_Q)(e,n)])).then((e=>{const[t,{total:r}]=e;l(Array.isArray(t)?t:[]),i(r)})).catch((()=>{l([]),i(0)}))}),[]);const E=Boolean(n.label);return c().createElement("div",{className:f.container},c().createElement("div",{className:f.header},c().createElement("div",{className:f.title},x().text("Pivot profiles")),c().createElement("div",{className:f.divider}),c().createElement("div",{className:f.headerCount},x().number(o,"0,0")+" "+(1===o?x().text("item"):x().text("items")))),E&&c().createElement("div",{className:f.entityTypeLabel},n.label),c().createElement("div",{className:f.body},a.map((e=>c().createElement("div",{key:e.uri,className:f.entityContainer},c().createElement(bt,{entity:e,avatarClassName:f.profileIcon}),c().createElement(ve.Z,{className:f.entityLabel,value:(0,u.wwR)(e)},(0,u.idV)(e.label)))))),v&&c().createElement("div",{className:f.footer},c().createElement("a",{className:f.seeAllButton,onClick:()=>{const e=Array.isArray(t)?t.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,u.nIW)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,t);m(h.ui.actions.openPivotingPerspective({value:e,attributeType:r}))}},x().text("See all"))))},wt=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const l=xt(),o=yt(),i=(0,s.useContext)(w)||[],p=(0,u.QZu)(r),d=(0,g.useSelector)(h.ZP.selectors.getMetadata)||{},m=p?dt(r,t.value,i,d):gt(t.lookupCode||t.value,r),f=i.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(m)&&m.length||!Array.isArray(m)&&!(0,N.isNil)(m)),b=i.find((e=>{let{uri:t}=e;return t===r.uri}));return f?c().createElement(le.ZP,{interactive:!0,arrow:!0,placement:"right-start",classes:l,title:c().createElement(Et,{value:m,attributeType:r,config:b.popup})},c().createElement("span",{className:a},c().createElement(ft,{className:o.icon}),c().createElement("span",{className:o.content},n))):c().createElement(c().Fragment,null,n)};let Ct;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Ct||(Ct={}));const Ot={[Ct.insertAttribute]:{color:"#599E0E"},[Ct.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Ct.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Tt=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Ct.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Ct.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Ct.deleteAttribute;default:return""}},St="/",kt=(0,N.pipe)((0,N.split)(St),(0,N.propSatisfies)((0,N.lte)(2),"length")),Nt=(0,N.pipe)((0,N.split)(St),(0,N.slice)(0,-2),(0,N.join)(St)),It=(0,N.curry)(((e,t)=>(0,N.cond)([[(0,N.has)(e),(0,N.prop)(e)],[()=>kt(e),It(Nt(e))]])(t))),Pt=e=>(0,N.pipe)(N.keys,(0,N.any)((0,N.startsWith)(e+St))),Dt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=It(e,t);return(0,N.isNil)(r)?Pt(e)(t)?"UPDATE_ATTRIBUTE":"":r},At=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]};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){jt(e,t,r[t])}))}return e}function jt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zt=(0,T.Z)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:Rt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.updateAttribute]),insertAttribute:Rt({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:Rt({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},Ot[Ct.deleteAttribute]),multilineAttribute:{width:"fit-content"}}),Lt=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const l=Zt(),{appearance:o}=(0,s.useContext)(ct),i=Dt(n.uri,o),p=Tt(i),d=c().createElement(at.Z,{value:(0,u.kDl)(n),dataTypeDefinition:(0,u.PFL)(r)});return a||p?c().createElement("div",{className:t},c().createElement(wt,{value:n,attributeType:r,key:n.uri,className:b()({[l.multilineAttribute]:!a})},c().createElement("span",{className:l[p]},d))):c().createElement("div",{className:b()(t,l.root,J)},c().createElement(wt,{value:n,attributeType:r,key:n.uri},c().createElement("span",{className:l.attributeValue},d)),c().createElement(et,{className:l.commentsContainer,uri:n.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:n.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var _t=r(40435),Mt=r(98989);const Vt=(0,T.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function Bt(){return Bt=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},Bt.apply(this,arguments)}const Ut=e=>{const t=Vt(),{expanded:r,className:n}=e,a=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,["expanded","className"]);return c().createElement(_t.Z,Bt({icon:Mt.Z,size:"XXS",disableRipple:!0,iconClassName:b()(t.expandIcon,{[t.expanded]:r}),className:b()(n,t.expandButton)},a))},zt=(0,T.Z)({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",paddingTop:"1px",marginLeft:"2px"},spacer:{flex:1}}),Ft=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:l,showNonOv:o}=e;const i=zt(),p=r.uri,[d,m]=(0,s.useState)(!1);(0,s.useEffect)((()=>{m(a)}),[a]);const g=(t||[]).some((e=>(0,u.kQw)(e))),h=(0,s.useMemo)((()=>({attributes:g?null:r.value,analyticsAttributes:g?r.value:null})),[r,g]);return c().createElement("div",{className:i.complexContainer},c().createElement("div",{className:b()(i.labelContainer,J)},c().createElement(Ut,{onClick:()=>m((e=>!e)),expanded:d}),c().createElement(E.Z,{component:"span",variant:"body2",classes:{body2:i.label}},n),c().createElement("div",{className:i.spacer}),c().createElement(et,{uri:r.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:r.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE})),d&&c().createElement(ni,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},l))};Ft.propTypes={children:U().node,label:U().oneOfType([U().string,U().node]),attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp]),expanded:U().bool,showNonOv:U().bool};const Ht=Ft;function Wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qt(e,t,r[t])}))}return e}function qt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gt=(0,T.Z)({label:{textDecoration:"none"},updateAttribute:Wt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.updateAttribute]),insertAttribute:Wt({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:Wt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function $t(){return $t=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},$t.apply(this,arguments)}const Yt=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=Gt(),{appearance:l}=(0,s.useContext)(ct),o=(0,s.useMemo)((()=>{const e=Dt(t.uri,l),n=Tt(e),o=t.label?t.label:(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(wt,{className:a.pivotingTooltip,value:t,attributeType:r},c().createElement(v.Z,{component:"span",className:b()(a[n],a.label)},(0,u.idV)(o)))}),[l,a,t,r]);return c().createElement(Ht,$t({label:o,attributeValue:t,attributeTypesList:(0,u.EUG)({},r)},n))};Yt.propTypes=u.j2V;const Kt=(0,s.memo)(Yt);function Xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qt(e,t,r[t])}))}return e}function Qt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jt=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:Xt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.updateAttribute]),insertAttribute:Xt({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:Xt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ot[Ct.deleteAttribute])})));function er(){return er=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},er.apply(this,arguments)}const tr=e=>{let{attributeValue:t,metadata:r,attributeType:n,uiPath: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,["attributeValue","metadata","attributeType","uiPath"]);const o=Jt(),i=(0,u.bwT)(t),p=(0,s.useMemo)((()=>(0,u.EUG)(r,n)),[n,r]),{appearance:d}=(0,s.useContext)(ct),m=(0,s.useMemo)((()=>{const e=Dt(t.uri,d),r=Tt(e);return c().createElement("a",{href:(0,u.O27)(d)?(0,u.ChB)({uiPath:a,uri:i}):void 0,className:b()(o.label,o[r])},(0,u.idV)(t.label),t.relationshipLabel&&c().createElement("span",{className:o.relationshipLabel},t.relationshipLabel))}),[t.uri,t.label,t.relationshipLabel,d,i,o,a]);return c().createElement(Ht,er({attributeTypesList:p,attributeValue:t,label:m},l))};tr.propTypes=u.NkU;const rr=(0,s.memo)(tr),nr=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e),uiPath:h.ZP.selectors.getUIPath(e)})))(rr),ar=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case u.oS0.TYPE_NESTED:return c().createElement(Kt,t);case u.oS0.TYPE_REFERENCE:return c().createElement(nr,t);default:return c().createElement(Lt,t)}}}.build(t,e)},lr=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showNonOv:o,totalNonVisibleValues:i}=e;const s=M(),{label:p}=n;return c().createElement("div",{className:b()(s.collaborationWrapper,J)},c().createElement("div",{className:b()(s.titleRow,s.wrapper)},c().createElement(Q,{label:p,className:b()(s.title,a),attributeType:n}),c().createElement(st,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:i}),c().createElement(ar,{className:b()(s.attribute,l),attributeValue:t,attributeType:n,showNonOv:o,inlined:!0})),c().createElement(et,{uri:t.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:t.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var or=r(4426);const ir=(0,T.Z)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}}),sr=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},c().createElement(or.Z,{className:a["svg-icon__root"]}),t&&r?x().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):x().text("Show more"))};var cr=r(96971);const ur=e=>{let{onClick:t}=e;const r=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},c().createElement(cr.Z,{className:r["svg-icon__root"]}),x().text("Show less"))},pr=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:o,requestNextPageOfAttributeValues:i,titleClassName:u,contentClassName:p,showNonOv:d,totalNonVisibleValues:m}=e;const g=V(),[h,f]=(0,s.useState)(t),y=t<a,x=y&&h<a,v=y&&h>=a,{label:E}=l,w=r.slice(0,h),C=a-h;return c().createElement("div",{className:g.wrapper},c().createElement("div",{className:g.titleRow},c().createElement(Q,{label:E,className:b()(g.title,u),attributeType:l}),c().createElement(st,{nonOvValues:n,attributeType:l,className:g.ovIcon,nonOvTotal:m})),c().createElement("div",{className:g.attributes},w.map((e=>c().createElement(ar,{key:e.uri,className:b()(g.attribute,p),attributeValue:e,attributeType:l,showNonOv:d})))),x&&c().createElement(sr,{moreNumber:(0,N.min)(t,C),valueNumber:C,onClick:()=>{r.length<a&&i({parentUri:o,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),f(h+t)}}),v&&c().createElement(ur,{onClick:()=>{f(t)}}))};var dr=r(80079);function mr(){return mr=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},mr.apply(this,arguments)}const gr=e=>c().createElement("svg",mr({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("path",{d:"M0 0h24v24H0z"}),c().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"}))),hr=(0,T.Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function fr(){return fr=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},fr.apply(this,arguments)}const br="loading",yr="loaded",xr="error",vr={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},Er=(0,s.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=vr.SMALL,overlay:l=null}=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,["src","className","containerClassName","size","overlay"]),i=a||vr.SMALL,p=hr(i),[d,m]=(0,s.useState)(br);(0,s.useEffect)((()=>{m(br)}),[t]);const g=d===br,h=d===yr;return d===xr?c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(dr.Z,{className:p.defaultImage})):c().createElement("div",{className:b()(p.root,n)},!(0,u.O27)(t)&&c().createElement("img",fr({src:t,className:b()(p.image,r,{[p.hideImage]:g}),onLoad:()=>{m(yr)},onError:()=>{m(xr)},alt:"image"},o)),g&&c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(gr,{className:p.defaultImage})),h&&l)}));var wr=r(88267);const Cr=c().createContext(!1);Cr.displayName="BlockImageGalleryDialogContext";var Or=r(45203),Tr=r(15762);const Sr=(0,T.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}})));var kr=r(60905);const Nr=(0,T.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),Ir=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=Nr(),l=(0,s.useRef)(null);return(0,s.useEffect)((()=>{if(null!=l&&l.current){const e=l.current.scrollLeft,t=l.current.offsetWidth+e,r=96*n+16*n+12;t<r?l.current.scroll&&(r>t+96+16?l.current.scroll(r,0):l.current.scroll(112+e,0)):e+96>r&&l.current.scroll&&l.current.scroll(r-96,0)}}),[n,l]),c().createElement("div",{ref:l,className:a.thumbnails},c().createElement(kr.Z,{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:l,value:o}=e;return c().createElement(kr.Z,{item:!0,key:l},c().createElement(Er,{onClick:()=>r(t),className:b()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,u.efz)({value:o})}))}))))},Pr=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const l=Sr(),o=r[n],i=(0,u.QXK)(o);return c().createElement("div",{className:b()(l.root,t)},c().createElement("div",{className:l.main},n>0&&c().createElement(_t.Z,{icon:Or.Z,className:b()(l.arrowButton,l.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),c().createElement(Er,{containerClassName:l.mainImageContainer,className:l.mainImage,size:i&&vr.OVERRIDE,src:i}),n!==r.length-1&&c().createElement(_t.Z,{icon:Tr.Z,className:b()(l.arrowButton,l.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),c().createElement(Ir,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Dr=r(21324),Ar=r(5806),Rr=r(33016),jr=r(36138),Zr=r(85256);const Lr=(0,T.Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}});var _r=r(79784);const Mr=(0,T.Z)((()=>({container:e=>{let{containerHeight:t=553,containerWidth:r}=e;return{display:"flex",flexDirection:"column",height:t,width:r,flexGrow:1}},header:{marginLeft:"16px",marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:"0 16px 12px 16px",flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));var Vr=r(33662);const Br=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:l,headerPlacement:o="top",containerWidth:i,containerHeight:s,searchInputOnKeyDown:u,children:p,searchInputRef:d}=e,m=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,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef"]);const g=Mr({containerWidth:i,containerHeight:s}),h=c().createElement(c().Fragment,null,!a&&c().createElement("div",{className:g.header},t),!l&&c().createElement(Vr.Z,{onSearch:n,autofocus:!0,onKeyDown:u,inputRef:d,classes:{root:g.searchInputContainer},placeholder:x().text("Search & add attributes"),height:40}));return c().createElement(_r.ZP,m,c().createElement("div",{className:b()(g.container,r),style:{width:i}},"top"===o&&h,c().createElement("div",{className:g.list},p),"bottom"===o&&h))};Br.propTypes={className:U().string,title:U().string,headerPlacement:U().oneOf(["top","bottom"]),onSearch:U().func,searchInputOnKeyDown:U().func,containerWidth:U().number,containerHeight:U().number,hideTitle:U().bool,hideSearchInput:U().bool,searchInputRef:U().shape({current:U().instanceOf(Element)}),children:U().node},Br.defaultProps={anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};const Ur=Br,zr=e=>{const t=e=>(0,N.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let r=null;return t(e).map(((e,t)=>(e&&e.items&&(r=t),{item:e,index:t,titleItemIndex:r})))};var Fr=r(50166);const Hr=(0,T.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Wr=e=>e.titleItemIndex===e.index,qr=e=>{let{items:t,getItemSize:r,renderItem:n,renderGroupTitle:a,width:l="100%",height:o,fixedTitle:i=!0,itemKey:u=(e=>e),disableHorizontalScrollbar:p,hideSubtitles:d,focusIndex:m=null,onInnerContainerResize:g}=e;const h=Hr(),f=(0,s.useRef)(null),b=(0,s.useRef)(null),y=(0,s.useRef)(null),x=(0,s.useRef)([0]),v={topMargin:0},E=(0,s.useMemo)((()=>!d||(t||[]).some((e=>null!==e.titleItemIndex))),[t,d]),w=(0,s.useCallback)((e=>{const n=x.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const l=n+t-1;t>0&&(x.current[l]=x.current[l-1]+a),a=r(l,e.item)}))}),[r,t]),C=(0,s.useCallback)((e=>t[e].titleItemIndex),[t]),O=(0,s.useCallback)((e=>t[e]),[t]);(0,s.useEffect)((()=>{requestAnimationFrame((()=>{f.current&&f.current.scrollTo(0)}))}),[t.length]),(0,s.useEffect)((()=>{f.current&&f.current.resetAfterIndex(0),T();const e=(e=>{const t=e.findIndex((e=>e.item.moveTo));if(t>-1){w(t);const e=C(t);return{offset:x.current[t],titleHeight:r(e,O(e).item)}}})(t);if(e&&e.offset&&f.current){const{titleHeight:t}=e,r=e.offset-t;(r<f.current.state.scrollOffset||r>f.current.state.scrollOffset+o)&&requestAnimationFrame((()=>{f.current&&f.current.scrollTo(r-(o-t)/2)}))}}),[w,O,r,C,o,x,t,f]);const T=()=>{y.current&&b.current&&(y.current.style.width=b.current.offsetWidth+"px")},S=(0,s.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{w(a+10);const l=x.current[a+1];return e>=n&&e<l&&(r={index:a,offset:n,listItem:t}),n=l,r})),r}),[w,x,t]),k=(0,s.useCallback)((e=>r(e,O(e).item)),[O,r]),N=(0,s.useCallback)((e=>{let{index:t,style:r,data:l}=e;const o=O(t);return o.item&&(Wr(o)&&a(r,o.item)||n(r,o.item,t,l))}),[O,a,n]),{handleOnItemsRendered:I}=(e=>{let{focusIndex:t,listRef:r,items:n}=e;const a=(0,s.useRef)(null),l=(0,s.useRef)(null),o=(0,s.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,l.current=r}),[]);return(0,s.useEffect)((()=>{r.current&&null!==t&&0!==n.length&&(t<Math.max(a.current+3,0)?r.current.scrollToItem(Math.max(t-3,0),"start"):t>Math.min(l.current-3,n.length-1)&&r.current.scrollToItem(Math.min(t+3,n.length-1),"end"))}),[t,n.length,r]),{handleOnItemsRendered:o}})({items:t,focusIndex:m,listRef:f}),P=(0,s.useCallback)((()=>t.filter((e=>Wr(e))).map((e=>(e=>c().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},a({height:r(e.index,e.item)},e.item)))(e)))),[r,t,a]);return c().createElement(c().Fragment,null,c().createElement("div",{ref:y,className:h.stickyTitlesWrapper},i&&P()),g&&b.current&&c().createElement(wr.Z,{handleHeight:!0,onResize:g,targetDomEl:b.current}),c().createElement(Fr.VariableSizeList,{ref:f,itemCount:t.length,itemSize:k,width:l,height:o,itemKey:u,innerRef:b,onScroll:e=>{let{scrollOffset:n,scrollDirection:a}=e;if(!i||!E)return;const l=S(n),o=l&&C(l.index);var s;null!==o&&(s=o,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===s.toString()?(e.style.visibility="visible",v.index=s):e.style.visibility="hidden"}))),T();const c=null!==o&&r(o,O(o).item),u=S(n+c+v.topMargin);let p=0;if(u){switch(a){case"forward":u.offset-n>0&&Wr(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>Wr(e)&&d<t))),r=(e=>(w(e),x.current[e]))(e);e>-1&&n<r&&c>=r-n&&(p=c-(r-n))}}(e=>{y.current&&(v.topMargin=-e,y.current.style.top=-e+"px")})(p)}var d},style:p?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:I},N))};qr.propTypes={items:U().arrayOf(U().object).isRequired,getItemSize:U().func.isRequired,renderItem:U().func.isRequired,width:U().oneOfType([U().number,U().string]),height:U().number.isRequired,renderGroupTitle:U().func,fixedTitle:U().bool,hideSubtitles:U().bool,itemKey:U().func,disableHorizontalScrollbar:U().bool,focusIndex:U().number,onInnerContainerResize:U().func};const Gr=qr,$r=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:l}=e;const[o,i]=(0,s.useState)(null),c=(0,s.useRef)(!1),u=(0,s.useCallback)((e=>{let r=null===e?u(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&Wr(t[r]));)r+=1;return r!==t.length?r:u(-1)}),[t]),p=(0,s.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||Wr(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),d=(0,s.useCallback)((()=>{if(!(0,N.isNil)(o)){const e=t[o].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,o]),m=(0,s.useCallback)((e=>{if(0!==t.length)switch(e.key){case"Down":case"ArrowDown":return i(u),e.preventDefault(),!1;case"Up":case"ArrowUp":return i(p),e.preventDefault(),!1;case"Enter":c.current=!0,d();break;case"Tab":l&&l(e);break;default:return}}),[t,u,p,d,l]);return(0,s.useEffect)((()=>{if(c.current){c.current=!1;const e=t.findIndex((e=>e.item.moveTo));e>-1&&i(e)}else i(null)}),[t,r,a]),{focusIndex:o,handleKeyDown:m}};var Yr=r(65549);const Kr=(0,T.Z)({highlight:{fontWeight:600}}),Xr=e=>{let{text:t="",highlight:r="",className:n}=e;const a=Kr(),l=r&&t.split(new RegExp(`(${r})`,"gi"));return c().createElement("span",null,r?l.map(((e,t)=>c().createElement("span",{key:t,className:e.toLocaleLowerCase()===r.toLocaleLowerCase()?n||a.highlight:""},e))):t)},Qr=(0,N.curry)(((e,t)=>(0,N.filter)((t=>t.label.toLowerCase().includes(e.toLowerCase())))(t))),Jr=e=>{let{label:t,popupTitle:r=t,data:n,dense:a,onApply:l}=e;const o=Lr(),i=(0,s.useRef)(),[u,p]=(0,s.useState)(!1),[d,g]=(0,s.useState)(""),[h,f]=(0,s.useState)([]),y=(0,s.useCallback)(((e,t)=>{f((0,N.ifElse)((0,N.always)(t),(0,N.append)(e),(0,N.reject)((0,N.propEq)("id",e.id)))(h))}),[h]),x=(0,s.useMemo)((()=>(0,N.pipe)(Qr(d),(0,N.map)((e=>({item:{id:e.uri,label:e.label,attrType:e}}))))(n)),[n,d]),v=(0,s.useMemo)((()=>zr(x)),[x]),E=(0,s.useCallback)((()=>28),[]),w=(0,s.useCallback)((e=>{let{item:t}=e;y(t,(0,N.not)((0,N.any)((0,N.propEq)("id",t.id))(h)))}),[y,h]),{focusIndex:C,handleKeyDown:O}=$r({items:v,open:u,onSelectFocusedItem:w,selectedItems:h}),T=(0,s.useRef)(null);T.current=C;const S=Math.min(255,28*v.length),k=Math.max(140,S+112),I=(0,s.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const l=(0,N.any)((0,N.propEq)("id",n.id))(h),o=T.current===r;return c().createElement(m.Z,{key:n.uri,onClick:y,checked:l,level:a,data:n,label:c().createElement(Xr,{text:n.label,highlight:d}),labelInText:n.label,style:e,isFocused:o,isRequired:!!n.attrType.required,LogoIcon:n.LogoIcon})}),[d,y,h]);return c().createElement("div",{className:b()(o.moreAttributes,{[o.dense]:a})},c().createElement(Le.Z,{color:"primary",onClick:()=>p(!u),ref:i,className:o.moreButton},c().createElement(Yr.Z,{classes:{root:o.icon}}),c().createElement("div",{className:o.buttonLabel},t)),c().createElement(Ur,{open:u,className:b()(o.moreAttributesPopup,o.popupContainer),anchorEl:i.current,onClose:(0,N.pipe)((()=>{h.length>0&&l((0,N.pluck)("attrType",h))}),(()=>p(!1)),(()=>g("")),(()=>f([]))),onSearch:g,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:O},c().createElement(Gr,{getItemSize:E,renderItem:I,items:v,height:S,containerWidth:320,focusIndex:C})))};Jr.propTypes={label:U().string,popupTitle:U().string,data:U().array,dense:U().bool,onApply:U().func};const en=Jr;var tn=r(95038),rn=r.n(tn);const nn={get CreationTime(){return x().text("Creation Time")},get CreationDate(){return x().text("Creation Date")},get Dimensions(){return x().text("Dimensions")},get MimeType(){return x().text("Mime Type")},get Size(){return x().text("Size")},get Url(){return x().text("Full image URL (S3)")},get UrlPreview(){return x().text("Preview image URL (S3)")},get UrlThumbnail(){return x().text("Small image URL (S3)")},get CdnUrl(){return x().text("Full image URL (CDN)")},get CdnUrlPreview(){return x().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return x().text("Small image URL (CDN)")}},an=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,N.path)([t,0,"value"],e):"CreationDate"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?rn()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?rn()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,N.path)(["Height",0,"value"],e)&&(0,N.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${x().text("pixels")}`:"Size"===t&&(0,N.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},ln=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},on=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,l=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?l:l.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},sn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=ln(t.attributes);return on(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},cn=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),un=(0,T.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},canAdd:{}}),pn=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=un(),l=ln(t.attributes),o=Boolean(r);return c().createElement(v.Z,null,c().createElement(E.Z,{className:b()(a.title,{[a.canAdd]:o})},x().text("Meta info")),o&&c().createElement(s.Fragment,null,c().createElement(en,{label:x().text("Attributes"),data:l,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),c().createElement(Zr.Z,{className:a.divider})))},dn=(0,T.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),mn=e=>{let{title:t,content:r,isLink:n,children:a}=e;const l=dn();return c().createElement("div",{className:l.root},c().createElement("span",{className:l.title},t),n?c().createElement("a",{className:l.link,href:r},x().text("link")):c().createElement("span",{className:l.content},r||a))},gn=(0,T.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),hn=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=gn(),l=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),o=(i=t,s=n,on(Object.keys(nn),s).map((e=>an(i,e)?{title:nn[e],value:an(i,e),isLink:cn(e)}:null)).filter(Boolean));var i,s;const u=sn(t,r,n);return c().createElement(v.Z,{className:a.root},o.map((e=>{let{title:t,value:r,isLink:n}=e;return c().createElement(mn,{key:t,isLink:n,title:t,content:r})})),l&&u.map((e=>{let{attrType:r,values:n}=e;return c().createElement(ri,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))};var fn=r(94438),bn=r(52669),yn=r(81556);const xn=(0,T.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),vn=e=>{let{checked:t,className:r,onClick:n}=e;const a=xn(),l=t?yn.Z:bn.Z;return c().createElement(l,{className:b()(a.root,r),onClick:n})};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 wn=e=>c().createElement("svg",En({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),c().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Download_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Download_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var Cn=r(79573);const On=(0,T.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),Tn=(0,s.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:l=Cn.ZT,onSelect:o=Cn.ZT,onShareLink:i,onSetAsDefault:u,onDelete:p,onDownload:d=Cn.ZT,onClick:m}=e,g=On(),[h,f]=(0,s.useState)(!1),y=(0,s.useMemo)((()=>[{text:x().text("Share link"),onClick:i},{text:x().text("Set as default"),onClick:u},{text:x().text("Delete"),onClick:p}].filter((0,N.prop)("onClick"))),[i,u,p]),v=e=>()=>(0,N.ifElse)((0,N.equals)(!0),l,o)(e),E=r&&(n||h||a),w=!a&&!n&&h,C=r&&n;return c().createElement("div",{className:b()(g.overlay,{[g.selected]:n,[g.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?v(n):e=>{e.currentTarget===e.target&&m()}},E&&c().createElement(vn,{className:g.checkedIcon,checked:n,onClick:v(n)}),w&&c().createElement("div",{className:g.actions},c().createElement(_t.Z,{onClick:d,className:g.actionButton,icon:wn}),c().createElement(be.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,className:b()(g.actionButton,g.dropDownMenuButton)},menuItems:y})),C&&c().createElement(Le.Z,{className:g.button,variant:"outlined",onClick:l},x().text("Deselect")))}));var Sn=r(13896),kn=r(58651),Nn=r(8629),In=r(67358);const Pn=(0,T.Z)({loadingOverlay:{position:"absolute",width:"100%",height:"100%",top:0,left:0,opacity:.37,zIndex:10,backgroundColor:"#fff"},transparent:{backgroundColor:"transparent"},relativePosition:{"&$loadingOverlay":{position:"relative"}}}),Dn=e=>{let{transparent:t=!1,relativePosition:r=!1}=e;const n=Pn();return c().createElement(c().Fragment,null,c().createElement("div",{className:b()(n.loadingOverlay,{[n.transparent]:t,[n.relativePosition]:r})},c().createElement(In.Z,{color:"secondary"})))};var An=r(74603);const Rn=(0,T.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),jn=e=>0===e.trim().length,Zn=e=>{let{onSend:t}=e;const r=Rn(),[n,a]=(0,s.useState)(""),[l,o]=(0,s.useState)(null);return c().createElement(v.Z,{className:r.root},c().createElement(Ge.Z,{className:r.paper},c().createElement(An.Z,{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||jn(t)?o(null):o(x().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:x().text("Paste an image URL here")}),c().createElement(Le.Z,{disabled:Boolean(l)||jn(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},x().text("Send"))),l&&c().createElement(E.Z,{className:r.errorMessage},l))};var Ln=r(83997);const _n=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Mn=e=>{let{className:t,onAppendFile:r}=e;return c().createElement(c().Fragment,null,c().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:_n.join(","),id:"upload-image-button",type:"file"}),c().createElement("label",{htmlFor:"upload-image-button"},c().createElement(Le.Z,{className:t,variant:"contained",color:"primary",component:"span"},x().text("Select image"))))};function Vn(){return Vn=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},Vn.apply(this,arguments)}const Bn=e=>c().createElement("svg",Vn({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),c().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},c().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),c().createElement("stop",{stopColor:"#000",offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},c().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),c().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),c().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),c().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),c().createElement("g",{mask:"url(#UploadIcon_svg__b)"},c().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},c().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),c().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),c().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),c().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),c().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),Un=(0,T.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),zn=e=>{let{onAppendFile:t,className:r}=e;const n=Un(),[{canDrop:a,isOver:l},o]=(0,Sn.useDrop)({accept:[Ln.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),i=a&&l;return c().createElement("div",{ref:o,className:b()(n.root,{[n.isActive]:i},r)},c().createElement(Bn,{className:n.icon}),c().createElement(E.Z,{className:n.title},x().text("Drag an image here")),c().createElement(E.Z,{className:n.description},x().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),c().createElement(Mn,{onAppendFile:t}))},Fn=(0,T.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Hn=e=>{let{children:t,className:r}=e;const n=Fn();return c().createElement(v.Z,{className:b()(n.root,r)},c().createElement(v.Z,{className:n.border}),c().createElement(E.Z,{className:n.text},t),c().createElement(v.Z,{className:n.border}))};var Wn=r(87685),qn=r(37265);const Gn=(0,T.Z)({closeIcon:{color:"#fff"}}),$n=e=>{let{error:t,onClose:r}=e;const n=Gn();return c().createElement(qn.Z,{open:Boolean(t),onClose:r,message:t,action:c().createElement(ye.k,{className:n.closeIcon,tooltipTitle:x().text("Close"),icon:Wn.default,onClick:r})})},Yn=(0,T.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}}))),Kn=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=Yn(),l=(0,g.useSelector)(h.ZP.selectors.getImageServicePath),o=(0,g.useSelector)(h.ZP.selectors.getEnvironment),i=(0,g.useSelector)(h.ZP.selectors.getTenant),[p,d]=(0,s.useState)(!1),[m,f]=(0,s.useState)(null),b=e=>{d(!0),(0,u.Ixr)({image:e,imageServicePath:l,environment:o,tenant:i}).then((e=>{n(e),r()})).catch((e=>f(e.errorMessage))).finally((()=>d(!1)))};return c().createElement(Sn.DndProvider,{backend:kn.default},c().createElement(Nn.Z,{open:t,onClose:r,classes:{paper:a.dialogPaper}},c().createElement(E.Z,{className:a.title},x().text("Add new image")),c().createElement(v.Z,{className:a.body},c().createElement(zn,{className:a.targetBox,onAppendFile:e=>{const t=Number((e.size/1024/1024).toFixed(2)),r=_n.includes(e.type);t>20?f(x().text("File size exceeds configured max file size.")):r?b(e):f(x().text("File format is not supported."))}}),c().createElement(Hn,{className:a.divider},x().text("or")),c().createElement(Zn,{onSend:e=>{b(e)}})),p&&c().createElement(Dn,null),c().createElement($n,{error:m,onClose:()=>f(null)})))},Xn={imageMargin:4,imageWidth:vr.SMALL.imageWidth,imageHeight:vr.SMALL.imageHeight},Qn=(0,T.Z)((()=>({root:{width:"100%",marginBottom:"10px"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Jn=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:l,parentUri:o,paging:i,showNonOv:p,imageSize:d=Xn}=e;const m=Qn(d),f=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},b=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntityDefaultProfilePic(e,f.uri))),y=(0,g.useDispatch)(),[x,v]=(0,s.useState)(!1),E=(0,s.useCallback)((()=>{v((e=>!e))}),[]),w=(0,s.useCallback)((e=>{const r=(0,u.hm5)(o,t.name),n={};for(const a in e){const l=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));l&&(n[a]=[{uri:(0,u.hm5)(r,l.name),ov:!0,value:e[a],type:l.uri}])}a({attributeType:t,uri:r,value:n})}),[a,o,t]),C=(0,s.useCallback)((e=>{if(n(e),b===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];y(h.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:f.uri,value:n||{}}))}}),[n,f,b,r]),O=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:l,onSetAsDefault:o}=e,i=(0,u.Q5d)(r),{uri:s}=r;return c().createElement(Tn,{id:s,onShareLink:()=>l(i),onSetAsDefault:()=>o(r),onDelete:()=>C({uri:s,attributeType:t}),onDownload:()=>a([i]),onClick:()=>n(s)})};return c().createElement("div",{className:m.root},c().createElement(_o,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,u.efz)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return c().createElement("div",{className:m.image,key:n},c().createElement(Er,{src:r,overlay:O(e,t),onClick:()=>a(n),size:{imageWidth:d.imageWidth,imageHeight:d.imageHeight}}))},overlay:!0,countFixedItems:1,onUpload:E,onDeleteAttribute:C,imageSize:d,requestNextPageOfAttributeValues:l,paging:i,parentUri:o,showNonOv:p},c().createElement("div",{className:m.uploadContainer,onClick:E},c().createElement(_t.Z,{className:m.uploadButton,iconClassName:m.uploadIcon,icon:fn.Z}))),c().createElement(Kn,{open:x,onUpload:w,onClose:E}))},ea=(0,T.Z)((e=>({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"},caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),ta=e=>{let{className:t,message:r}=e;const n=ea();return r?c().createElement(E.Z,{variant:"caption",className:b()(n.caption,t)},r):null};var ra=r(22983),na=r(65314),aa=r(42494),la=r(74828);function oa(){return oa=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},oa.apply(this,arguments)}const ia=(0,s.memo)((e=>{let{errorMessage:t,children:r,className:n,classes: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,["errorMessage","children","className","classes"]);const o=ea(),i=!!t;return c().createElement(aa.Z,oa({className:b()(o.wrapper,n,null==a?void 0:a.root),error:!0},l),r,i&&c().createElement(la.Z,{className:b()(o.helperText,null==a?void 0:a.helperText)},c().createElement(ta,{message:t})))})),sa=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t}=arguments.length>1?arguments[1]:void 0;const{value:r,lookupCode:n}=e;switch(t){case u.oS0.TYPE_BOOLEAN:case u.oS0.TYPE_BOOLEAN_RADIO:case u.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,u.gxP)(r);case u.oS0.TYPE_DATE:return r&&u.P6Y.dates.toLocalDate(r)||null;case u.oS0.TYPE_LOCAL_DATE:case u.oS0.TYPE_TIMESTAMP:case u.oS0.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case u.oS0.TYPE_DEPENDENT_LOOKUP:case u.oS0.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}},ca=(e,t)=>{const{type:r}=(0,u.PFL)(e);switch(r){case u.oS0.TYPE_BOOLEAN:case u.oS0.TYPE_BOOLEAN_RADIO:case u.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case u.oS0.TYPE_DATE:return t&&rn()(t).format("YYYY-MM-DD")||"";case u.oS0.TYPE_TIMESTAMP:return t&&rn()(t).format()||"";case u.oS0.TYPE_ACTIVENESS_DATE:case u.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},ua=(0,N.curry)(((e,t,r)=>({value:ca(t,r),uri:e.uri,attributeType:t}))),pa=c().createContext({enabled:!1,queueSizeThreshold:0});pa.Provider.propTypes={value:U().shape({enabled:U().bool,queueSizeThreshold:U().number})},pa.displayName="AsyncMountContext";let da=0;const ma=()=>{const e=(0,s.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,s.useContext)(pa),[n,a]=(0,s.useState)(!t||t&&da<r);e.current&&da++;const l=(0,s.useRef)();return(0,s.useEffect)((()=>{if(da--,!n)return l.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(l.current)}),[]),e.current=!1,n};function ga(){return ga=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},ga.apply(this,arguments)}const ha=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,s.forwardRef)(((r,n)=>ma()?c().createElement(e,ga({},r,{ref:n})):t&&c().createElement(t,ga({},r,{ref:n}))));return r.displayName="WithAsyncMount",r};function fa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ba(e,t,r[t])}))}return e}function ba(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ya={},xa=(0,T.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function va(){return va=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},va.apply(this,arguments)}const Ea=e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:l,mode:o,onAddOneMore:i,onDeleteAttribute:s,onChangeAttribute:p,onDeactivateError:d,additionalControlsRenderer:m,state:f}=e,y=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","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state"]);const v=xa(),w="deleted"===f,C="edited"===f,O=(0,u.KIu)(o),T=(0,u.PFL)(n),S=sa(r,T),k=(0,u.Vg3)({attributeType:n,mode:o}),I=(0,u.yv0)({attributeType:n,attributeValue:r,mode:o,isReltioCrosswalk:a}),P=(0,u.xv5)({attributeType:n,attributeValue:r,mode:o,isReltioCrosswalk:a}),D=I&&O,A=(0,u.e$p)(l),R=(0,g.useSelector)((e=>(0,u.QEi)(n)?((e,t,r)=>{const n=h.ZP.selectors.getDependentLookupsStructureNode(e,r);if(n){const o=t.uri,{parents:i,missedParentsAttributeTypes:s}=((e,t,r)=>{const n=r.parents.flatMap((t=>{const r=h.ZP.selectors.getDependentLookupsStructureNode(e,t);return r.values.map((e=>fa({},e,{type:t,dependentLookupCode:r.attrType.dependentLookupCode})))})),a=h.ZP.selectors.getModifiedEntities(e),l=h.ZP.selectors.getEntityUri(e),o=h.ZP.selectors.getAllRelationsToAddAndEdit(e),i=(0,u.vUy)({parentValues:n,valueUri:t,entityUri:l,modifiedEntities:a,connections:o}),s=r.parents.map((t=>h.ZP.selectors.getDependentLookupsStructureNode(e,t).attrType)).filter((e=>!i.some((t=>{let{type:r,value:n}=t;return n&&r===e.uri}))));return{parents:Object.values(i.reduce(((e,t)=>{var r;return fa({},e,{[t.dependentLookupCode]:{type:t.dependentLookupCode,codeValues:(0,N.uniq)([t.value,...(null===(r=e[t.dependentLookupCode])||void 0===r?void 0:r.codeValues)||[]]).filter(Boolean).sort()}})}),{})),missedParentsAttributeTypes:s}})(e,o,n),{isBlocked:c=!1}=h.ZP.selectors.getDependentLookupEditorState(e,o)||{},p=(a=s).length?x().text("Please select value for ${labels} ${attributes}.",{labels:(l=a.map((0,N.pipe)((0,N.prop)("label"),(e=>`'${e}'`))),l.reduce(((e,t,r)=>[e,t].join(r===l.length-1?` ${x().text("and")} `:", ")))),attributes:1===a.length?x().text("attribute"):x().text("attributes")}):"",d=h.ZP.selectors.getLookupAutocomplete(e),m=(0,u.Vmh)(d,r),g=!(null!=t&&t.lookupCode||null!=t&&t.value)&&c&&x().text("Populating values...")||p||"",f={parents:i,disabled:!!p||c,placeholder:g,autopopulationId:m?o:null};return g&&(f.value=null),((e,t)=>{const r=ya[e];return(0,N.equals)(t,r)?r:((0,N.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),ya[e]=t,t)})(o,f)}var a,l})(e,r,null==n?void 0:n.uri):null)),j=()=>{l&&d((0,u.iFp)(l))},Z=!!i&&k&&!n.singleValue,L=!w&&!!s&&P,_=!!A,M=w?{disabled:!0}:{};return c().createElement("div",{className:b()(v.editor,t)},c().createElement(ia,{errorMessage:A,className:v.errorWrapper},c().createElement("div",{className:b()(v["editor-value"],{[v.deleted]:w},{[v["editor-read-only-value"]]:!D})},D?c().createElement(na.Z,va({fieldName:(0,u.Tde)(n.uri),value:S,dataTypeDefinition:T,error:_,onChange:(0,N.pipe)(ua(r,n),p,j),fullWidth:!0},R,y,M)):c().createElement(at.Z,{value:(0,u.kDl)(r),dataTypeDefinition:T}))),c().createElement("div",{className:v["editor-actions"]},C&&c().createElement(E.Z,{variant:"caption",className:v.editedLabel},"(",x().text("edited"),")"),Z&&c().createElement(_t.Z,{icon:Yr.Z,onClick:i,size:"L",className:b()(v.addButton,v.button)}),m&&m({attributeType:n,attributeValue:r}),L&&c().createElement(_t.Z,{className:v.button,icon:ra.Z,onClick:()=>{s({uri:r.uri,attributeType:n}),(0,u.PcX)(l)!==u.NIO.missed&&j()},size:"L"})))};Ea.propTypes={className:U().string,attributeValue:u.cNQ,attributeType:u.EMD,ownError:u.wfT,isReltioCrosswalk:U().bool,state:U().oneOf(["deleted","edited"]),mode:u.XGc,onAddOneMore:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func,onDeactivateError:U().func,additionalControlsRenderer:U().func};const wa=(0,s.memo)(ha(Ea,(()=>{const e=xa();return c().createElement("div",{className:e.placeholder})}))),Ca=(0,T.Z)((e=>({editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}}))),Oa=[u.xPW.roles.uri,u.xPW.tags.uri],Ta=(e,t,r,n)=>{const a=(0,N.pipe)(u.nt9,(0,N.defaultTo)({}),(0,N.props)(["attributes","analyticsAttributes"]),(0,N.reject)(N.isNil),N.flatten,(0,N.concat)(N.__,(0,N.pipe)(N.values,(0,N.reject)((0,N.propEq)("uri",u.xPW.id.uri)))(u.xPW)))(e,t);return r.length?a.filter((e=>{let{uri:t}=e;return r.includes(t)})):a.filter((e=>{let{uri:t}=e;return!n.includes(t)}))},Sa=(e,t)=>(0,N.partition)((0,N.pipe)((0,N.path)(["attrType","uri"]),(0,N.includes)(N.__,e)),t),ka=c().createContext(null);function Na(){return Na=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},Na.apply(this,arguments)}const Ia=e=>{let{attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,drawLines:i,children:p,className:d,alwaysVisibleTypeUris:m=Oa,onAddAttributes:g,onChangeAttribute:h,onDeleteAttribute:f,additionalControlsRenderer:b,showNonOv:y}=e;const{attributes:v={}}=r,E=(0,s.useMemo)((()=>(0,u._kX)(l,t)),[t,l]),w=((e,t)=>e.filter((e=>{const r=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,N.cond)([[u.kqr,(0,N.always)(t)],[(0,N.both)(u.kQw,(0,N.always)(n)),(0,N.always)(n)],[N.T,(0,N.always)(r)]])(e)})(e,t),n=(e=>(0,u.kqr)(e)?"uri":"name")(e);return!((e.singleValue||(0,u.ian)(e)||(0,u.VFZ)(e))&&(0,N.has)(e[n])(r))})))(E,r),C=(0,s.useContext)(ka),O=(0,s.useMemo)((()=>(0,u.Gtj)(t,l,r,a,y,C)),[t,l,r,a,y,C]),[T,S]=(0,s.useMemo)((()=>Sa(m,O)),[O,m]),k=(0,s.useCallback)((e=>{g(e.map((e=>({attributeType:e,parentUri:n}))))}),[g,n]),I={enabled:i};return c().createElement("div",{className:d},p&&c().createElement(D,I,p),c().createElement(D,Na({},I,{plain:!0}),E.length>0&&c().createElement(en,{label:x().text("More attributes"),onApply:k,dense:i,data:w})),S.concat(T).map((e=>{let{attrType:t,values:r}=e;return c().createElement(ro,{key:t.uri,attributeType:t,drawLines:i,values:r,paging:(0,N.path)(["paging",t.uri],v),parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,onAddAttributes:g,onChangeAttribute:h,onDeleteAttribute:f,additionalControlsRenderer:b,showNonOv:y})})))};Ia.propTypes={attrTypes:U().array,entity:U().object,parentUri:U().string,children:U().node,showEmptyEditors:U().bool,mode:u.XGc,crosswalks:U().array,drawLines:U().bool,showNonOv:U().bool,className:U().string,alwaysVisibleTypeUris:U().array,onAddAttributes:U().func,onChangeAttribute:U().func,onDeleteAttribute:U().func,additionalControlsRenderer:U().func};const Pa=(0,s.memo)(Ia);function Da(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Aa=e=>{let{label:t,attributeTypesList:r,attributeType:n,attributeValue:a,children:l,errors:o,ownError:i,mode:p,metadata:d,crosswalks:m,lazy:g,showEmptyEditors:h,onAddOneMore:f,onAddAttributes:y,onDeleteAttribute:v,onChangeAttribute:w,additionalControlsRenderer:C,hideDeleteButton:O,state:T,showNonOv:S}=e;const k=Ca(),N="deleted"===T,I="edited"===T,P=a.uri,D=(0,u.ZiX)(P),[A,R]=(0,s.useState)(D),j=(0,s.useMemo)((()=>(0,u.xv5)({attributeType:n,attributeValue:a,mode:p,metadata:d,isReltioCrosswalk:(0,u.KVV)(m,a)})),[n,a,p,d,m]),Z=!N&&!O&&!!v&&j,L=(0,s.useMemo)((()=>(0,u.J6q)(a,o)),[o,a]);(0,s.useEffect)((()=>{L&&R(!0)}),[o,L]),(0,s.useEffect)((()=>{N&&R(!1)}),[N]);const _=(r||[]).some((e=>(0,u.kQw)(e))),M=(0,s.useMemo)((()=>({attributes:_?null:a.value,analyticsAttributes:_?a.value:null})),[a,_]),V=(0,u.e$p)(i)||L&&x().text("Has an incorrect value")||"";return g?c().createElement(Le.Z,{variant:"text",color:"primary",onClick:f},"Create attribute"):c().createElement(c().Fragment,null,c().createElement("div",{className:k.editor},c().createElement("div",{className:k.titleContainer},c().createElement(Ut,{onClick:()=>R((e=>!e)),expanded:A,className:k.expandButton,disabled:N}),c().createElement(ia,{errorMessage:V,classes:{helperText:k.errorWrapperHelperText}},c().createElement("div",{className:b()(k.label,{[k.deleted]:N})},t))),c().createElement("div",{className:k.actions},I&&c().createElement(E.Z,{variant:"caption",className:k.editedLabel},"(",x().text("edited"),")"),C&&C({attributeType:n,attributeValue:a}),Z&&c().createElement(_t.Z,{icon:ra.Z,onClick:()=>v({uri:P,attributeType:n,attributeValue:a}),size:"L"}))),A&&c().createElement(Pa,{attrTypes:r,entity:M,showEmptyEditors:h||D,drawLines:!0,parentUri:P,mode:p,crosswalks:m,onAddAttributes:y,onChangeAttribute:w,onDeleteAttribute:v,additionalControlsRenderer:C,showNonOv:S},l))};Aa.propTypes=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){Da(e,t,r[t])}))}return e}({label:U().string,children:U().node,attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp])},u.KVe);const Ra=Aa;function ja(){return ja=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},ja.apply(this,arguments)}const Za=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(Ra,ja({label:(0,u.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};Za.propTypes=u.j2V;const La=(0,s.memo)(Za);var _a=r(84425),Ma=r(42662),Va=r(12231);const Ba=(0,T.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}}),Ua=(0,T.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none"}}))),za=(0,T.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),Fa=(0,T.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function Ha(){return Ha=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},Ha.apply(this,arguments)}const Wa=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=Ba(),{uri:o,entityType:i,label:s,secondaryLabel:u}=a;return""!==o?c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:i})},r),c().createElement(Ma.Z,{className:l.entityAvatar,entityType:i}),c().createElement("span",{className:l.entityLabel},s,u&&c().createElement("span",{className:l.entitySecondaryLabel},", ",u))):c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o},r,{disabled:!0}),c().createElement("span",{className:l.emptyEntityLabel},x().text("No results found")))};Wa.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({uri:U().string.isRequired,label:U().string.isRequired,entityType:u.pyR.isRequired})};const qa=Wa;var Ga=r(12212);const $a=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:l}=e,o=Ua(),i=(0,g.useDispatch)(),p=(0,s.useContext)(Ga.m),d=(0,g.useSelector)(h.ZP.selectors.getUIPath),m=(0,u.ZiX)(l.entityUri)?{className:o.singleValue,component:"span"}:{className:b()(o.singleValue,o.linkValue),onMouseDown:e=>{e.stopPropagation(),n||(0,N.pipe)((0,N.always)({uri:l.entityUri,viewId:p}),h.ui.actions.openEntity,i)()},onClick:e=>e.preventDefault(),href:(0,u.ChB)({uiPath:d,uri:l.entityUri}),component:"a"};return!r&&c().createElement(E.Z,m,(0,u.ZiX)(l.entityUri)?x().text(`New ${t.label} will be created`):(0,u.idV)(a))};$a.propTypes={children:U().string,data:U().object.isRequired,selectProps:U().object.isRequired};const Ya=$a;var Ka=r(33375),Xa=r(61837);const Qa=e=>{const{selectProps:{onClear:t}}=e,r=Fa();return c().createElement(Xa.Z,{onClick:t},c().createElement(Ka.Z,{className:r.clearIcon}))};Qa.propTypes={selectProps:U().object.isRequired};const Ja=Qa,el=e=>e&&e.attributes,tl=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=el,mode:a,onAddAttributes:l,onDeleteAttribute:o,onChangeAttribute:i}=e;const u=(0,s.useMemo)((()=>n(r)),[n,r]);return t?c().createElement(Pa,{key:t.uri,attrTypes:u,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:l,onChangeAttribute:i,onDeleteAttribute:o}):null};tl.propTypes={entityUri:U().string,parentUri:U().string,entity:U().object,entityType:U().object,attributeTypesSelectionStrategy:U().func,mode:u.XGc,onAddAttributes:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func};const rl=tl,nl={onAddAttributes:h.N5.actions.addAttributes,onDeleteAttribute:h.N5.actions.removeAttribute,onChangeAttribute:h.N5.actions.modifyAttribute},al=(0,g.connect)(((e,t)=>({entity:t.entityUri&&h.ZP.selectors.getModifiedEntity(e,t.entityUri)})),nl)(rl);var ll=r(92391);const{Group:ol}=ll.F,il=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,l=za();return c().createElement(ol,e,c().createElement("div",{className:l.groupHeading},c().createElement("span",null,n.label),r&&c().createElement("span",{onClick:()=>r(t,n.entityType),className:l.addLabel},c().createElement(Yr.Z,{className:l.addIcon}),x().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};il.propTypes={selectProps:U().object.isRequired,data:U().object,children:U().array};const sl=il,cl=(0,T.Z)({creatorWrapper:{marginTop:"20px"}});function ul(){return ul=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},ul.apply(this,arguments)}function pl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dl(e,t,r[t])}))}return e}function dl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ml=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a,onChange:l,onCreate:o,metadata:i,globalSearchRequestOptions:p,attributeTypesSelectionStrategy:d,disableLinkClick:m}=e,g=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,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const h=cl(),[f,b]=(0,s.useState)(""),y=(0,s.useMemo)((()=>r.map((e=>(0,u.nt9)(i,e)))),[r,i]),v=[{filter:"equals",fieldName:"type",values:r.map(u.nIW)}],E=pl({},p,{max:a}),w=o?(e,t)=>{o(t||r[0],e),b("")}:void 0,C=e=>{null!==e&&(b(""),l(e))},O=(0,s.useMemo)((()=>1!==y.length),[y]),T=((0,N.isEmpty)(t)?y[0]:(0,u.nt9)(i,t.entityType))||{},S=o&&x().text(`Create ${f?`"${f}" as `:""}new ${T.label}`),k=x().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),I=!(0,N.isEmpty)(t)&&(0,u.ZiX)(t.entityUri),P=O?{Group:sl,GroupHeading:Cn.Vd}:{},D=I?{ClearIndicator:Ja}:{};return c().createElement(c().Fragment,null,c().createElement(_a.Z,ul({value:(0,N.isEmpty)(t)?void 0:t,inputValue:f,onInputChange:e=>{b(e)},getOptions:e=>(0,u.ZOr)(v,E,e).then((e=>t=>{const r=t.map((t=>pl({},t,{label:(0,u.idV)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),n=e=>(0,N.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e;return e.length>1?e.map((e=>({label:e.label,entityType:e.uri,options:n(r.filter((t=>t.type===e.uri)))}))):n(r)})(y)),getOptionLabel:(0,N.prop)("entityLabel"),onChange:C,onCreate:w,onClear:()=>{C({})},label:k,createLabel:S,components:pl({Option:qa,SingleValue:Ya},P,D),currentEntityType:T,isClearable:!0,disableLinkClick:m},g)),I&&c().createElement("div",{className:h.creatorWrapper},c().createElement(al,{mode:n,attributeTypesSelectionStrategy:d,entityType:T,entityUri:t.entityUri})))};ml.propTypes={entity:u.oZZ,entityTypesUris:U().arrayOf(U().string),max:U().number,mode:u.XGc,dispatch:U().func,metadata:u.pGS,onChange:U().func.isRequired,onCreate:U().func,attributeTypesSelectionStrategy:U().func,globalSearchRequestOptions:U().object,disableLinkClick:U().bool};const gl=ml,hl=(0,T.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function fl(){return fl=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},fl.apply(this,arguments)}function bl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yl(e,t,r[t])}))}return e}function yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xl=e=>{const t=hl(),{modifiedEntity:r,metadata:n,globalSearchRequestOptions:a,onDeleteModifiedEntity:l,onUpdateModifiedEntity:o,onDeactivateError:i}=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,["modifiedEntity","metadata","globalSearchRequestOptions","onDeleteModifiedEntity","onUpdateModifiedEntity","onDeactivateError"]),{attributeValue:d,attributeType:m,mode:g,crosswalks:h,errors:f,onChangeAttribute:y}=p,x=(0,s.useRef)(d),v=(0,u.CZ8)(d),E=(0,u.o96)(d),w=(0,u.Poc)(m),C=(0,u.nt9)(n,w),O=r?(0,u.Kxm)(r,C.dataLabelPattern):d.label,T=(0,s.useMemo)((()=>[w]),[w]),S=(0,s.useMemo)((()=>(0,u.EtK)(h,E)),[h,E]),k=(0,s.useMemo)((()=>(0,u.mbo)(d,f)),[d,f]),I=(0,s.useMemo)((()=>v&&{entityUri:(0,u.ZTM)(v),entityType:(0,u.uGi)(v),entityLabel:d.label}),[v,d.label]),P=(0,s.useMemo)((()=>(0,u.tF$)(m).map((e=>(0,u.zeJ)(n,e))).filter(N.identity)),[m,n]),D=(0,s.useCallback)((e=>(0,u.ct9)(m,e)),[m]),A=(0,s.useCallback)((e=>{r&&l(r.uri);const t=x.current,n=!(0,N.isEmpty)(e)&&e.uri===(0,u.bwT)(t),a=bl({},d,{label:e.label,refEntity:n?t.refEntity:(0,u.fmQ)(e),refRelation:n?t.refRelation:(0,u.NBq)(d)});y({value:a,attributeType:m,uri:d.uri}),k&&i((0,u.iFp)(k))}),[d,m,r,y,l,i,k]),R=(0,s.useCallback)(((e,t)=>{const r=(0,N.pipe)(D,(0,u._kX)(g))(C),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:n,mode:g});A(a),o(a)}),[D,g,C,n,A,o]),j=(0,s.useMemo)((()=>(0,u.yv0)({attributeType:m,attributeValue:d,mode:g,isReltioCrosswalk:(0,u.KVV)(h,d)})),[m,d,g,h]),Z=(0,s.useMemo)((()=>(0,u.d89)(g,C)),[g,C]),L=(0,u.e$p)(k);return c().createElement(Ra,fl({},p,{label:(0,u.idV)(O),attributeTypesList:P,crosswalks:S,metadata:n}),c().createElement(ia,{errorMessage:L},c().createElement(gl,{className:b()(t.item,{[t.dense]:L||I&&(0,u.ZiX)(I.entityUri)}),entity:I||{},entityTypesUris:T,max:20,globalSearchRequestOptions:a,mode:g,onChange:j?A:void 0,onCreate:Z?R:void 0,metadata:n,attributeTypesSelectionStrategy:D})))};xl.propTypes=bl({},u.NkU,{modifiedEntity:u.pyR,metadata:u.pGS,globalSearchRequestOptions:U().object,onDeleteModifiedEntity:U().func,onUpdateModifiedEntity:U().func,onDeactivateError:U().func});const vl=(0,s.memo)(xl),El={onDeleteModifiedEntity:h.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:h.N5.modifiedEntities.actions.entityCreated,onDeactivateError:h.N5.errors.actions.errorDeactivated},wl=(0,g.connect)(((e,t)=>{const r=(0,u.bwT)(t.attributeValue);return{modifiedEntity:(0,u.ZiX)(r)?h.ZP.selectors.getModifiedEntity(e,r):null,metadata:h.ZP.selectors.getMetadata(e),globalSearchRequestOptions:h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"])}}),El)(vl);function Cl(){return Cl=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},Cl.apply(this,arguments)}const Ol=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showEmptyEditors:r,onAddAttributes:n,lazy:a,errors:l,crosswalks:o,showNonOv:i}=t,s=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}(t,["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv"]);switch(e.type){case u.oS0.TYPE_NESTED:return c().createElement(La,t);case u.oS0.TYPE_REFERENCE:return c().createElement(wl,t);default:return c().createElement(wa,Cl({isReltioCrosswalk:(0,u.KVV)(o,t.attributeValue)},s))}}}.build(t,e)},Tl=(0,T.Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},attributesWrapper:{width:"100%",marginBottom:"10px"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",marginTop:"-1px",textIndent:0},titleWrapper:{flex:1,paddingBottom:"3px"}}))),Sl=e=>x().text("${value}",{value:1===e?x().text("value"):x().text("values")}),kl=(0,N.has)("minValue"),Nl=(0,N.has)("maxValue"),Il=(0,N.pipe)(Nl,N.not),Pl=(0,N.propSatisfies)((e=>1===e),"minValue"),Dl=e=>{let{minValue:t}=e;return x().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Sl(t)})},Al=e=>{let{maxValue:t}=e;return x().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:x().number(t,"0"),maxValueCaption:Sl(t)})},Rl=(0,N.cond)([[N.isNil,(0,N.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return x().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Sl(t)})}],[(0,N.allPass)([Pl,Nl]),Al],[(0,N.allPass)([Pl,Il]),(0,N.always)("")],[(0,N.allPass)([kl,Nl]),e=>{let{minValue:t,maxValue:r}=e;return x().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:Dl({minValue:t}),maxValue:x().number(r,"0"),maxValueCaption:Sl(r)})}],[Nl,Al],[kl,Dl],[N.T,(0,N.always)("")]]),jl=e=>{let{cardinality:t}=e;const r=Tl();return c().createElement(E.Z,{variant:"caption",className:r.caption},Rl(t))};jl.propTypes={cardinality:u.oA3};const Zl=jl,Ll=(0,N.filter)((0,N.propSatisfies)(u.ZiX,"uri")),_l=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:l,drawLines:o,showEmptyEditors:i,errorMessage:p,errors:d,paging:m,crosswalks:g,showNonOv:h,nonVisibleValues:f,onAddAttributes:b,onDeleteAttribute:y,onChangeAttribute:x,onDeactivateError:v,additionalControlsRenderer:E,requestNextPageOfAttributeValues:w}=e;const C=Tl(),[O,T]=(0,s.useState)(t),[S,k]=(0,s.useState)(!1),{label:I,required:P,cardinality:A,name:R,uri:j}=n,Z=(0,u.KIu)(l),L=(0,s.useContext)(ka),_=(0,s.useMemo)((()=>null==L?void 0:L.includes(j)),[j,L]),M=(0,u.O27)(r),V=(!S&&i||P||_)&&M,B=(0,s.useRef)((0,u.gjI)({parentUri:a,attributeType:n})),U=(0,s.useCallback)((()=>{T(O+1);const e={parentUri:a,index:O,attributeType:n};return b(V&&!(0,u.YkM)(n.type)?[e,e]:[e])}),[O,b,a,n,V]),z=(0,s.useCallback)((0,N.pipe)(y,N.T,k),[y,k]);if(M&&!V)return null;if(V&&M&&(r=[B.current]),(0,u.O27)(r))return null;const F=(Ll(r)||[]).length,H=h?"totalValues":"totalOvValues",W=(0,N.ifElse)((0,N.has)(H),(0,N.pipe)((0,N.prop)(H),(0,N.add)(F)),(0,N.always)(r.length))(m),q=null!=m&&m.totalValues?m.totalValues-W:null==f?void 0:f.length,G=t<W,$=G&&O<W,Y=G&&O>=W,K=r.slice(0,O),X=K?K.length-1:0,J=W-O;return c().createElement(D,{enabled:o},c().createElement("div",{className:C.wrapper},c().createElement("div",{className:C.titleWrapper},c().createElement(Q,{label:I,isRequired:P,className:C.title,attributeType:n}),c().createElement(st,{nonOvValues:f,attributeType:n,className:C.ovIcon,nonOvTotal:q})),Z&&c().createElement(Zl,{cardinality:A}),Z&&c().createElement(ta,{message:p,className:C.typeError}),c().createElement("div",{className:C.attributesWrapper},K.map(((e,t)=>c().createElement(Ol,{key:e.uri,attributeValue:e,attributeType:n,lazy:V&&!P,showEmptyEditors:i,errors:d,ownError:(0,u.ADq)(e,t,n.uri,d),mode:l,crosswalks:g,onAddOneMore:X===t?U:null,onAddAttributes:b,onDeleteAttribute:z,onChangeAttribute:x,onDeactivateError:v,additionalControlsRenderer:E}))),$&&c().createElement(sr,{moreNumber:(0,N.min)(t,J),valueNumber:J,onClick:()=>{r.length<W&&w({parentUri:a,attributeTypeUri:j,attributeTypeName:R,values:r,defaultMaxValues:t}),T(O+t)}}),Y&&c().createElement(ur,{onClick:()=>{T(t)}}))))};var Ml=r(90590),Vl=r(92145);const Bl=(0,T.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),Ul={MultiValue:Vl.Z},zl=e=>{let{values:t,onChange:r,onDelete:n}=e;const a=Bl(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,g.useSelector)(h.ZP.selectors.getEntity),i=o.uri,p=(0,u.JvE)(l,o.type).map((e=>({value:e.uri,label:e.label}))),d=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=p.find((0,N.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,u.nIW)(e)}})),m=(0,s.useCallback)((e=>{const t=(null==e?void 0:e.map((0,N.prop)("value")))||[];r({value:t,attributeType:u.xPW.roles,uri:i})}),[i,r]),f=(0,s.useCallback)((()=>{n({uri:i,attributeType:u.xPW.roles})}),[i,n]);return c().createElement("div",{className:a.container},c().createElement(Ml.Z,{label:"",height:40,isMulti:!0,options:p,value:d,onChange:m,components:Ul,classes:a,className:a.roleContainer}),!!n&&c().createElement(_t.Z,{className:a.deleteButton,icon:ra.Z,onClick:f,size:"L"}))};var Fl=r(7766);const Hl=(0,T.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}}),Wl=e=>e?`?filter=${(0,u.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",ql=[{fieldName:"tags",orderType:"reversedCount"}],Gl=e=>(0,u.FK9)({query:Wl(e),body:ql}).then((e=>Object.keys(e.tags))),$l=e=>{let{className:t,values:r,onChange:n,onDelete:a}=e;const l=Hl(),o=(0,g.useSelector)(h.ZP.selectors.getEntityUri),i=(0,s.useCallback)((e=>{n({value:e,attributeType:u.xPW.tags,uri:o})}),[n,o]),p=(0,s.useCallback)((()=>{a({uri:o,attributeType:u.xPW.tags})}),[o,a]);return c().createElement("div",{className:l.container},c().createElement(Fl.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:i,getSuggestions:Gl}),!!a&&c().createElement(_t.Z,{className:l.deleteButton,icon:ra.Z,onClick:p,size:"L"}))};function Yl(){return Yl=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},Yl.apply(this,arguments)}function Kl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xl=e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:l,onDeleteAttribute:o,onChangeAttribute:i,showEmptyEditors:p}=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,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors"]);const m=Tl(),{label:g,required:h,cardinality:f}=r,b=(0,u.KIu)(a),[y,x]=(0,s.useState)(!1),E=(0,s.useCallback)((0,N.pipe)(o,N.T,x),[o,x]),w=(0,u.O27)(t),C=!y&&p&&w,O=(0,s.useRef)((0,u.gjI)({parentUri:n,attributeType:r}));return(0,u.j2U)(r)&&w&&!C?null:c().createElement(v.Z,{className:m.wrapper},c().createElement(Q,{label:g,isRequired:h,className:m.title,attributeType:r}),b&&c().createElement(Zl,{cardinality:f}),b&&c().createElement(ta,{message:l}),c().createElement(v.Z,{className:m.attributesWrapper},(()=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement($l,{values:t,onDelete:E,onChange:i});case u.xPW.roles.uri:return c().createElement(zl,{values:t,onDelete:E,onChange:i});default:{const 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){Kl(e,t,r[t])}))}return e}({},O.current,{value:t[0]||""});return c().createElement(Ol,Yl({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:E,onChangeAttribute:i},d))}}})()))};function Ql(){return Ql=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},Ql.apply(this,arguments)}var Jl;!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Jl||(Jl={}));const eo=(0,s.memo)((e=>{let{values:t,attributeType:r,mode:n=u.ARY.Viewing,crosswalks:a,drawLines:l,paging:o={},parentUri:i,errors:s,errorMessage:p,max:d=1/0,showEmptyEditors:m,showNonOv:g,onAddAttributes:h,onDeleteAttribute:f,onChangeAttribute:b,onDeactivateError:y,additionalControlsRenderer:x,requestNextPageOfAttributeValues:v}=e;const E=Tl(),w=(0,N.partition)(u.OXP),[C,O]=w(t),T=g?t:C,S=g?[]:O,k={errorMessage:p,errors:s,mode:n,parentUri:i,onAddAttributes:h,onDeleteAttribute:f,onChangeAttribute:b,onDeactivateError:y,additionalControlsRenderer:x,showEmptyEditors:m};return(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Jl.special)],[u.Or$,(0,N.always)(Jl.imageLine)],[N.T,(0,N.always)(Jl.default)]])(r)){case Jl.special:return c().createElement(D,{enabled:l},c().createElement(Xl,Ql({values:T,attributeType:r},k)));case Jl.imageLine:return c().createElement(D,{enabled:l},c().createElement("div",{className:E.wrapper},c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(Jn,{attributeValues:T,attributeType:r,paging:o,onDeleteAttribute:f,parentUri:i,onChangeAttribute:b,requestNextPageOfAttributeValues:v,showNonOv:g})));default:return c().createElement(_l,Ql({values:T,attributeType:r,max:d,paging:o,crosswalks:a,drawLines:l,requestNextPageOfAttributeValues:v,showNonOv:g,nonVisibleValues:S},k))}})()})),to={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:h.N5.errors.actions.errorDeactivated},ro=(0,g.connect)(((e,t)=>{let{parentUri:r,attributeType:n,max:a}=t;return{errors:h.ZP.selectors.getActiveErrorsForAttributesPager(e,r,n),errorMessage:(0,u.tQX)(r,n,h.ZP.selectors.getProfileErrors(e)),max:a||h.ZP.selectors.getDefaultMaxValues(e)}}),to)(eo),no=(0,T.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),ao=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:a,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:p,mode:d}=e;const m=no(),g=sn(n,t,r),h=0!==g.length||0===g.length&&a;return c().createElement(v.Z,{className:m.root},c().createElement(v.Z,{className:m.form},g.map((e=>{let{attrType:t,values:r}=e;return c().createElement(ro,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,u.ZiX)(n.uri),mode:d,drawLines:!1,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i})}))),h&&c().createElement(c().Fragment,null,c().createElement(Zr.Z,{className:m.divider}),c().createElement(v.Z,{className:m.actions},c().createElement(Le.Z,{disabled:!a,onClick:s,className:m.cancelButton},x().text("Cancel")),c().createElement(Le.Z,{disabled:!a,onClick:p,color:"primary"},x().text("Apply")))))},lo={palette:{type:"dark",primary:u.rSc.palette.primary,secondary:u.rSc.palette.secondary}},oo=(0,Rr.Z)(lo),io=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const{addAttributes:a,changeAttribute:l,deleteAttribute:o,clearLocalChanges:i,applyLocalChanges:p,attributeValue:d,hasChanges:m}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const n=(0,g.useDispatch)(),a=(0,s.useContext)(Ga.m),[l,o]=(0,s.useState)(t);(0,s.useEffect)((()=>{o(t)}),[t]);const i=!(0,N.equals)(l,t),c=(0,s.useCallback)((e=>{o((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,u.tPT)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),p=(0,s.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;o((e=>(0,u.ww$)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),d=(0,s.useCallback)((e=>{let{attributeType:t,uri:r}=e;o((e=>(0,u.d$I)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:c,changeAttribute:p,deleteAttribute:d,clearLocalChanges:(0,s.useCallback)((()=>{o(t)}),[t]),applyLocalChanges:(0,s.useCallback)((()=>{n(h.N5.actions.modifyAttribute({value:l,attributeType:r,uri:l.uri,viewId:a}))}),[l,r,a,n]),attributeValue:l,hasChanges:i}})({attributeType:r,initialAttributeValue:n}),f=(0,g.useSelector)(h.ZP.selectors.getMode),b=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode);return c().createElement(jr.ThemeProvider,{theme:oo},c().createElement(v.Z,null,c().createElement(pn,{attributeType:r,uri:null==d?void 0:d.uri,onAddAttributes:b?a:void 0}),c().createElement(hn,{attributeType:r,attributeValue:d,imageAttributeFieldsOrder:t}),b&&c().createElement(ao,{mode:f,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:d,hasChanges:m,onDeleteAttribute:o,onChangeAttribute:l,onAddAttributes:a,onCancel:i,onApply:p})))},so=(0,T.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),co=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const l=so(),o=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},i=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntity(e,null==o?void 0:o.uri)))||{},u=(0,g.useSelector)(h.ZP.selectors.getIsViewMode)?o:i,p=(0,g.useSelector)(h.ZP.selectors.getImageAttributesFieldsOrder)||{},d=p[null==o?void 0:o.type]||(null==p?void 0:p.default)||{},[m,f]=(0,s.useState)(!1);(0,s.useEffect)((()=>{f((null==u?void 0:u.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,u]);const y=(0,s.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return c().createElement(v.Z,{className:b()(l.root,t)},c().createElement(v.Z,{className:l.header},c().createElement(E.Z,{className:l.headerTitle},x().text("Details"))),c().createElement(v.Z,{className:l.bodyWrapper},c().createElement(v.Z,{className:l.body},c().createElement(Ar.Z,{classes:{root:l.formControlLabel,label:l.checkboxLabel},control:c().createElement(Dr.Z,{className:l.checkbox,checked:m,onChange:y,color:"default"}),label:x().text("Set as default")}),c().createElement(io,{attributeType:a,imageAttributeFieldsOrder:d,attributeValue:r}))))},uo=(0,T.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),po=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:l}=e;const[o,i]=(0,s.useState)(0);(0,s.useEffect)((()=>{u(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const u=(0,s.useCallback)((e=>{var r;i(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),p=uo();return c().createElement(v.Z,{className:p.root},c().createElement(Pr,{attributeValueIndex:o,setAttributeValueIndex:u,attributeValues:t,className:p.main}),c().createElement(co,{handleSetAsDefault:a,attributeValue:t[o],className:p.details,attributeType:l}))};var mo=r(38724),go=r(70331),ho=r(15223),fo=r(73115);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 yo=e=>c().createElement("svg",bo({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:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},c().createElement("mask",{id:"Details_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Details_svg__a"})),c().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"})));var xo=r(38592);const vo=(0,T.Z)((e=>({button:{minWidth:"30px",padding:"8px 8px",justifyContent:"start",fill:"rgba(0,0,0,0.54)",textTransform:"none",borderColor:"rgba(0,0,0,0.12)"},icon:{color:"rgba(0,0,0,0.54)",width:"20px",height:"20px",marginRight:"8px"},title:{fontSize:"13px",lineHeight:"15px",letterSpacing:0},current:{"& $icon":{color:e.palette.primary.main},backgroundColor:(0,rt.U1)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,rt.U1)(e.palette.primary.main,.24)}}}))),Eo=(0,lt.Z)(Le.Z),wo=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:l}=e;const o=vo();return c().createElement(xo.Z,{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:i,Icon:s}=e;return c().createElement(Eo,{key:String(t),className:b()(o.button,{[o.current]:a===t},r.button),tooltipTitle:i,onClick:(u=t,()=>l(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&c().createElement(s,{className:o.icon}),n&&c().createElement("div",{className:o.title},n));var u})))},Co=(0,T.Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let Oo;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(Oo||(Oo={}));const To=e=>{let{open:t,mode:r,children:n,header:a,onClose:l,onChangeMode:o}=e;const i=Co(),u=(0,s.useMemo)((()=>[{id:Oo.GALLERY_MODE,title:x().text("Gallery"),Icon:fo.Z},{id:Oo.DETAILS_MODE,title:x().text("Details"),Icon:yo}]),[]);return c().createElement(Nn.Z,{classes:{paper:i.paper},open:t,BackdropProps:{className:i.backdrop},fullScreen:!0},c().createElement(go.Z,{classes:{colorPrimary:i.appBar}},c().createElement(ho.Z,{className:i.toolbar},c().createElement(v.Z,{className:i.headerLeft},c().createElement(ye.k,{tooltipTitle:x().text("Close"),onClick:l,className:i.closeButton,iconClassName:i.closeIcon,icon:Wn.default}),null==a?void 0:a.left),c().createElement(v.Z,{className:i.headerCenter},c().createElement(wo,{modes:u,modeId:r,onChange:o,className:i.modeSwitcher})),c().createElement(v.Z,{className:i.headerRight},null==a?void 0:a.right))),c().createElement(mo.Z,{className:i.content},n))},So=(0,T.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),ko=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:l,onSetAsDefault:o,onDownload:i,onClickImage:s,onDelete:u}=e;const p=So(),d=e=>c().createElement(Tn,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>a(e),onShareLink:()=>l(e),onSetAsDefault:()=>o(e),onDownload:()=>i(e),onClick:()=>s(e),onDelete:u?()=>u(e):void 0,canBeSelected:!0});return c().createElement(v.Z,{className:p.root},c().createElement(kr.Z,{container:!0},t.map((e=>{let{id:t,src:r}=e;return c().createElement(kr.Z,{key:t,classes:{item:p.item},item:!0},c().createElement(Er,{size:vr.LARGE,onClick:()=>s(t),src:r,overlay:d(t)}))}))))},No=(0,T.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),Io=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const l=No(),o=t.length===r.length;return c().createElement(he.Z,{component:"button",underline:"none",classes:{button:l.selectButton},onClick:o?a:n},o?x().text("Clear selection"):x().text("Select all images"))};var Po=r(35292);const Do=(0,T.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),Ao=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const l=Do();return c().createElement(c().Fragment,null,n&&c().createElement(Le.Z,{variant:"contained",color:"primary",onClick:n,startIcon:c().createElement(fn.Z,null)},x().text("Upload")),t&&n&&c().createElement("div",{className:l.divider}),t&&c().createElement(ye.k,{className:l.downloadButton,tooltipTitle:x().text("Download selected items"),icon:wn,onClick:t}),r&&c().createElement(ye.k,{className:l.shareButton,tooltipTitle:x().text("Copy link"),icon:Po.Z,onClick:r}),a&&c().createElement(ye.k,{className:l.deleteButton,tooltipTitle:x().text("Delete selected items"),icon:ra.Z,onClick:a}))},Ro=e=>{let{attributeValues:t,open:r,onClose:n,currentAttributeValueUri:a,setCurrentAttributeValueUri:l,attributeType:o,onDownload:i,onShareLink:p,onSetAsDefault:d,onUpload:m,onDeleteAttribute:f}=e;const[b,y]=(0,s.useState)([]),[x,v]=(0,s.useState)(Oo.GALLERY_MODE),E=(0,g.useSelector)(h.ZP.selectors.getIsViewMode);(0,s.useEffect)((()=>{v(a?Oo.DETAILS_MODE:Oo.GALLERY_MODE)}),[a]);const w=t.map((e=>({src:(0,u.efz)(e),downloadURL:(0,u.Q5d)(e),id:e.uri}))),C=e=>{p(w.find((0,N.propEq)("id",e)).downloadURL)},O=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));d(r)},T=e=>{f({uri:e,attributeType:o})},S=x===Oo.GALLERY_MODE,k=x===Oo.DETAILS_MODE,I=b.length>0,P=k||S&&I,D=!E&&P,A=!E&&(k||S&&!I),R=S&&I&&c().createElement(Io,{items:w,selectedItems:b,onClearAll:()=>{y([])},onSelectAll:()=>{y((0,N.pluck)("id",w))}}),j=c().createElement(Ao,{onDelete:D?()=>{(S?b:[a]).forEach((e=>{T(e)})),b.length&&y([])}:void 0,onDownload:P?()=>{const e=S?(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return b.includes(t)})),(0,N.pluck)("downloadURL"))(w):[w.find((0,N.propEq)("id",a)).downloadURL];i(e)}:void 0,onShare:k?()=>{C(a)}:void 0,onUpload:A?m:void 0});return c().createElement(To,{mode:x,open:r,onChangeMode:v,header:{left:R,right:j},onClose:n},S&&c().createElement(ko,{items:w,selectedItems:b,onSelectImage:e=>{y((t=>[...t,e]))},onDeselectImage:e=>{y((t=>t.filter((t=>t!==e))))},onShareLink:C,onSetAsDefault:O,onDownload:e=>{i([w.find((0,N.propEq)("id",e)).downloadURL])},onClickImage:e=>{l(e),v(Oo.DETAILS_MODE)},onDelete:E?void 0:T}),k&&c().createElement(po,{handleSetAsDefault:O,setCurrentAttributeValueUri:l,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))};var jo=r(94079);const Zo=(0,T.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,jo.fade)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function Lo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _o=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:l=0,children:o,onUpload:i,onDeleteAttribute:p,imageSize:d=Xn,paging:m,parentUri:f,showNonOv:b,requestNextPageOfAttributeValues:y}=e;const x=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},v=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),w=(0,g.useDispatch)(),C=Zo(d);(0,s.useEffect)((()=>{if(m&&y){const e=b?m.totalOvValues:m.totalValues;e>r.length&&y({parentUri:f,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[m,y,t,f,r.length,b]);const O=(0,s.useRef)(),[T,S]=(0,s.useState)(0),[k,N]=(0,s.useState)(0),I=(0,s.useContext)(Cr),[P,D]=(0,s.useState)(!1),[A,R]=(0,s.useState)(),j=(0,s.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=d,a=Math.floor((e+t)/(n+t))-l,o=e+t-(a+l)*(n+t)<8;S(a),r.length>a?N(r.length-a+(o?1:0)):N(0)}),[r.length,l,d]),Z=(0,s.useCallback)((e=>{j(e),O.current=e}),[j]);(0,s.useEffect)((()=>{O.current&&j(O.current)}),[r.length,j]);const L=(0,s.useCallback)((e=>{I||(R(e),D(!0))}),[I]),_=(0,s.useCallback)((()=>{D(!1)}),[]),M=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),V=e=>navigator.clipboard.writeText(e),B=(0,s.useCallback)((e=>{v?(0,u.YL3)(x.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&w(h.N5.entity.actions.setDefaultProfilePic(e))})):w(h.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:x.uri,value:e}))}),[v,x.uri,w]),U=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){Lo(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:M,onShareLink:V,onSetAsDefault:B});return c().createElement(c().Fragment,null,c().createElement(wr.Z,{handleWidth:!0,onResize:Z}),c().createElement(Ro,{attributeValues:r,open:P,onClose:_,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:M,onShareLink:V,onSetAsDefault:B,onUpload:i,onDeleteAttribute:p}),c().createElement("div",{className:C.imageBox},o,r.slice(0,T).map(n(U)),k>0&&c().createElement("div",{className:C.moreButtonContainer},c().createElement("div",{className:C.moreButton,onClick:()=>L()},c().createElement(E.Z,{className:C.number},`+${k}`)))))},Mo=(0,T.Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,u.m5F)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:Ot[Ct.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:Ot[Ct.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[Ct.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[Ct.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[Ct.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),Vo=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:l,showNonOv:o,imageSize:i=Xn}=e;const p=Mo(i),{appearance:d}=(0,s.useContext)(ct);return c().createElement(_o,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,u.efz)(e),{uri:n}=e,a=Dt(n,d),l=Tt(a);return c().createElement("div",{className:b()(p.image,{[p[l+"Image"]]:l}),key:n},c().createElement(Er,{onClick:()=>t(n),className:p[l],src:r,size:{imageWidth:i.imageWidth,imageHeight:i.imageHeight}}))}},imageSize:i,requestNextPageOfAttributeValues:l,paging:n,parentUri:a,showNonOv:o})};var Bo=r(20404);const Uo=e=>{let{className:t,values:r,Component:n}=e;return c().createElement("div",{className:t},r.map(((e,t)=>c().createElement(s.Fragment,{key:e},c().createElement(n,{value:e}),t<r.length-1&&", "))))};function zo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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 Ho=(0,T.Z)({insertAttribute:zo({width:"fit-content"},Ot[Ct.insertAttribute]),deleteAttribute:zo({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},Ot[Ct.deleteAttribute])}),Wo=e=>{let{value:t}=e;const r=Ho(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{appearance:a}=(0,s.useContext)(ct),l=At("roles",t,a),o=Tt(l);return c().createElement("span",{className:r[o]},(0,u.xqc)(n,t))},qo=e=>{let{className:t,values:r}=e;return c().createElement(Uo,{values:r,className:t,Component:Wo})},Go=e=>{let{value:t}=e;const r=Ho(),n=(0,g.useSelector)(h.ZP.selectors.getUIPath),a=(0,g.useSelector)(h.ZP.selectors.getEntity),{appearance:l}=(0,s.useContext)(ct),o=At("tags",t,l),i=Tt(o);return c().createElement(he.Z,{underline:"none",className:r[i],href:(0,u.hgZ)({uiPath:n,tag:t,entityUri:a.uri})},t)},$o=e=>{let{className:t,values:r}=e;return c().createElement(Uo,{values:r,className:t,Component:Go})},Yo=e=>{let{values:t,attributeType:r}=e;const n=M(),{label:a}=r;return c().createElement("div",{className:b()(n.titleRow,n.wrapper)},(l=n.titleIcon,r.uri===u.xPW.tags.uri?c().createElement(Bo.Z,{className:l}):null),c().createElement(Q,{label:a,className:n.title,attributeType:r}),(e=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement($o,{className:e,values:t});case u.xPW.roles.uri:return c().createElement(qo,{className:e,values:t});default:return c().createElement(ar,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(n.attribute));var l},Ko="oneLine",Xo="multiLine",Qo="imageLine",Jo="special",ei=(0,s.memo)((e=>{let{values:t,attributeType:r,drawLines:n,paging:a={},parentUri:l,max:o=1/0,requestNextPageOfAttributeValues:i,titleClassName:s,contentClassName:p,showNonOv:d}=e;const m=_(),g=(0,N.partition)(u.OXP);if(!t||!t.length)return null;const[h,f]=g(t),y=d?t:h,x=d?[]:f,v=d?"totalValues":"totalOvValues",E=(0,N.ifElse)((0,N.has)(v),(0,N.prop)(v),(0,N.always)(y.length))(a),w=null!=a&&a.totalValues?a.totalValues-E:x.length,C=1===E&&!(0,u.YkM)(r);return c().createElement(D,{enabled:n,className:b()({[m.paddingWrapperWithLines]:n})},c().createElement("div",{className:b()({[m.paddingWrapper]:!n})},(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Jo)],[u.Or$,(0,N.always)(Qo)],[(0,N.always)(C),(0,N.always)(Ko)],[N.T,(0,N.always)(Xo)]])(r)){case Ko:return c().createElement(lr,{value:y[0],nonVisibleValues:x,totalNonVisibleValues:w,attributeType:r,titleClassName:s,contentClassName:p,showNonOv:d});case Xo:return c().createElement(pr,{values:y,nonVisibleValues:x,totalVisibleValues:E,totalNonVisibleValues:w,attributeType:r,parentUri:l,max:o,requestNextPageOfAttributeValues:i,titleClassName:s,contentClassName:p,showNonOv:d});case Qo:return c().createElement(c().Fragment,null,c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(Vo,{attributeValues:y,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:i,showNonOv:d}));case Jo:return c().createElement(Yo,{values:y,attributeType:r})}})()))})),ti={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues},ri=(0,g.connect)(((e,t)=>{let{max:r}=t;return{max:r||h.ZP.selectors.getDefaultMaxValues(e)}}),ti)(ei),ni=(0,s.memo)((e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:l,className:o,max:i,alwaysVisibleTypeUris:p=Oa,showNonOv:d}=e;const[m,g]=(0,s.useState)(i||1/0),h=(0,s.useMemo)((()=>(0,u.fyF)(t,r,d)),[t,r,d]),[f,b]=(0,s.useMemo)((()=>Sa(p,h)),[h,p]),y=b.slice(0,m),x=i&&y.length<b.length,v=i&&y.length>=b.length&&i<y.length,E={enabled:a};return c().createElement("div",{className:o},l&&c().createElement(D,E,l),y.concat(f).map((e=>{let{attrType:t,values:l}=e;return c().createElement(ri,{key:t.uri,attributeType:t,drawLines:a,values:l,paging:(0,N.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:d})})),x&&c().createElement(sr,{onClick:()=>{g(1/0)}}),v&&c().createElement(ur,{onClick:()=>{g(i)}}))})),ai=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),li=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:r={},metadata:n,caption:a="",excludeUris:l=[],includeUris:o=[],attributesCount:i=16}=e;const p=ai(),d=(0,g.useSelector)(h.ZP.selectors.getPivotingAttributes),m=(0,s.useMemo)((()=>Ta(n,r.type,o,l)),[l,o,n,r.type]),f=(0,u.fyF)(m,r).filter((e=>{let{values:t}=e;return!(0,u.O27)(t)})).length>0;return f||!(0,u.O27)(a)?c().createElement(w.Provider,{value:d},c().createElement(C.Z,{className:t},a&&c().createElement(k,{className:p.header,title:a}),c().createElement(v.Z,{className:b()(p.attributesContainer,{[p.noCaption]:!a})},f?c().createElement(ni,{entity:r,attrTypes:m,parentUri:r.uri,drawLines:!1,max:i}):c().createElement(E.Z,{className:p.noData},x().text("No data found"))))):null})),oi=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function ii(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){si(e,t,r[t])}))}return e}function si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ci=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:r={},mode:n,metadata:a,caption:l="",excludeUris:o=[],includeUris:i=[],pinnedAttributes:p}=e;const d=oi(),m=(0,g.useDispatch)(),f=(0,s.useContext)(Ga.m),y=(0,g.useSelector)(h.ZP.selectors.getUserRoles),x=(0,s.useMemo)((()=>(0,u.mC3)(p,y)),[p,y]),E=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntity(e,r.uri)||{})),w=(0,s.useMemo)((()=>Ta(a,E.type,i,o)),[o,i,a,E.type]),O=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,m)(e.map((e=>ii({},e,{viewId:f}))))),[f,m]),T=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,m)(ii({},e,{viewId:f}))),[f,m]),S=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,m)(ii({},e,{viewId:f}))),[f,m]);return c().createElement(C.Z,{className:t},l&&c().createElement(k,{className:d.header,title:l}),c().createElement(v.Z,{className:b()(d.attributesContainer,{[d.noCaption]:!l})},c().createElement(ka.Provider,{value:x},c().createElement(Pa,{entity:E,attrTypes:w,parentUri:E.uri,drawLines:!1,mode:n,showEmptyEditors:(0,u.ZiX)(E.uri),crosswalks:E.crosswalks,onAddAttributes:O,onChangeAttribute:T,onDeleteAttribute:S}))))}));function ui(){return ui=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},ui.apply(this,arguments)}const pi=(0,g.connect)(((e,t)=>({entity:t.entity||h.ZP.selectors.getEntityWithDiff(e),mode:t.mode||h.ZP.selectors.getMode(e)})))((e=>{let{mode:t=u.ARY.Viewing,attributesCount:r,pinnedAttributes:n}=e,a=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,["mode","attributesCount","pinnedAttributes"]);return(0,u.uzs)(t)?c().createElement(li,ui({attributesCount:r},a)):c().createElement(ci,ui({mode:t,pinnedAttributes:n},a))})),di=(0,T.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 mi=r(83088);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 hi=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=di(),{value:o,label:i,startObject:s,endObject:u}=a,p=s.objectType.label+" ↔ "+u.objectType.label;return c().createElement(Va.Z,gi({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(Ma.Z,{className:l.iconTop,entityType:s.objectType}),c().createElement(Ma.Z,{className:l.iconBottom,entityType:u.objectType})),c().createElement("div",{className:l.text},c().createElement(mi.C,{value:i},c().createElement(E.Z,{className:b()(l.textItem,l.primaryTextItem)},i)),c().createElement(mi.C,{value:p},c().createElement(E.Z,{color:"textSecondary",className:b()(l.textItem,l.secondaryTextItem)},p))))};hi.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({value:U().string.isRequired,label:U().string.isRequired,startObject:U().object,endObject:U().object})};const fi=hi;function bi(){return bi=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},bi.apply(this,arguments)}function yi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xi=e=>{let{value:t={},options:r=[],onChange:n=N.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){yi(e,t,r[t])}))}return e}({},(0,N.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return c().createElement(_a.Z,bi({value:t,options:r,onChange:n,label:x().text("Select relationship type "),components:{Option:fi},TextFieldProps:o},l))},vi=U().shape({label:U().string.isRequired,value:U().string.isRequired,startObject:U().object,endObject:U().object});xi.propTypes={value:vi,options:U().arrayOf(vi),onChange:U().func};const Ei=xi;function wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ci(e,t,r[t])}))}return e}function Ci(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oi(){return Oi=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},Oi.apply(this,arguments)}function Ti(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 Si=e=>{let{values:t,valueContainerClassName:r}=e,n=Ti(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(ar,Oi({attributeValue:e},n))))))},ki=(0,s.memo)((e=>{let{expanded:t}=e,r=Ti(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:l}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return Si(wi({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:l},c().createElement(Vo,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return Si(wi({},r))}}));var Ni=r(44938),Ii=r(42639),Pi=r(45108),Di=r(30488),Ai=r(38748),Ri=r(25843),ji=r(53862);function Zi(){return Zi=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},Zi.apply(this,arguments)}const Li=e=>c().createElement("svg",Zi({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 _i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mi(e,t,r[t])}))}return e}function Mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vi=e=>e.id===e.groupId,Bi=(0,N.curry)(((e,t)=>{let{id:r,groupId:n}=e;return t.groupId===n&&(r===t.id||r.startsWith(`${t.id}.`))})),Ui=(0,N.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),zi=(0,N.propOr)(!0,"hideable"),Fi=(e,t)=>{const r=((e,t)=>e.find((0,N.either)(Ui(t),Bi(t))))(e,t);return r?(r.children=Fi(r.children||[],t),e):e.concat(t)},Hi=(0,N.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(Hi(e)))),Wi=(0,N.reduce)(((e,t)=>Fi(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),qi=(0,N.curry)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,N.pipe)((0,N.filter)(Hi(e)),(0,N.chain)((t=>[{item:_i({},t,{filterText:e}),level:r},...t.children?qi(e,t.children,r+1):[]])))(t)})),Gi=(0,N.has)("columns"),$i=e=>{let{id:t,label:r,columns:n}=e;return[{id:t,groupId:t,label:r},...n.map((0,N.assoc)("groupId",t))]},Yi=e=>e.children?(0,N.chain)(Yi,e.children):[e],Ki=(e,t)=>{const r=Yi(t),n=t=>e.includes(t.id);return Vi(t)?r.every(n):r.some(n)},Xi=(0,T.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Qi=e=>{let{item:t,onClick:r,checked:n,level:a,style:l,isFocused:o,isGroupItem:i}=e;const s=Xi();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(Xr,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:l,isFocused:o,hideIcon:i,className:b()({[s.groupItem]:i})})};Qi.propTypes={item:U().shape({label:U().string,filterText:U().string}),level:U().number,onClick:U().func,checked:U().bool,style:U().object,isGroupItem:U().bool,isFocused:U().bool};const Ji=Qi,es=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:l}=e;const o=Xi(),[i,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(""),g=(0,s.useMemo)((()=>((e,t)=>(0,N.pipe)((0,N.chain)((0,N.when)(Gi,$i)),(0,N.filter)((0,N.either)(Vi,zi)),Wi,qi(t))(e))(t,d)),[t,d]),h=(0,u.fW1)("label")(g)||308,f=(0,s.useMemo)((()=>zr(g)),[g]),b=(0,s.useCallback)((e=>{const t=(0,N.pipe)(Yi,(0,N.pluck)("id"))(e),a=Ki(r,e);n(a?(0,N.difference)(r,t):(0,N.uniq)((0,N.concat)(r,t)))}),[r,n]),y=(0,s.useCallback)((e=>{let{item:t}=e;return b(t)}),[b]),{focusIndex:v,handleKeyDown:E}=$r({items:f,open,onSelectFocusedItem:y,selectedItems:r}),w=Math.min(300,32*f.length),C=Math.max(140,w+108);return c().createElement(c().Fragment,null,c().createElement(ye.k,{tooltipTitle:l||x().text("Show/hide columns"),size:"L",icon:Li,onClick:e=>p(e.currentTarget)}),c().createElement(Ur,{className:o.popup,open:!!i,anchorEl:i,onClose:(0,N.pipe)((()=>p(null)),(()=>m(""))),onSearch:m,title:a||x().text("Show/hide columns"),containerWidth:h,containerHeight:C,searchInputOnKeyDown:E},c().createElement(Gr,{fixedTitle:!1,height:w,renderItem:(e,t,n)=>{let{item:a,level:l=0}=t;return c().createElement(Ji,{style:e,item:a,level:l,isFocused:v===n,checked:Ki(r,a),isGroupItem:Vi(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:h,focusIndex:v})))};es.propTypes={columnsData:ji.uz,selectedColumns:U().arrayOf(U().string),onChangeColumns:U().func,title:U().string,tooltipTitle:U().string};const ts=es;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=e=>c().createElement("svg",rs({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})),as=(0,T.Z)((e=>({"filterIcon--enabled":{color:e.palette.primary.main},closeIcon:{position:"absolute",right:"3px",bottom:"3px",transform:"scale(0.5)"},button:{padding:"11px"}}))),ls=e=>{let{enabled:t,onClick:r}=e;const n=as();return c().createElement(le.ZP,{title:t?x().text("Clear all filters"):x().text("Filter")},c().createElement(Xa.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(ns,{className:n["filterIcon--enabled"]}),c().createElement(Wn.default,{color:"primary",className:n.closeIcon})):c().createElement(ns,null)))};ls.propTypes={enabled:U().bool,onClick:U().func};const os=ls;var is=r(42011),ss=r(46728),cs=r(85103),us=r(1928),ps=r(9377);function ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ms(e,t,r[t])}))}return e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gs="CHANGE_COLUMNS",hs="TOGGLE_FILTERS",fs="CHANGE_FILTER",bs="TOGGLE_SORT",ys="CHANGE_PAGE",xs="CHANGE_ROWS_PER_PAGE",vs={changeColumns:(0,Cn.zD)(gs),toggleFilters:(0,Cn.zD)(hs),changeFilter:(0,Cn.zD)(fs),toggleSort:(0,Cn.zD)(bs),changePage:(0,Cn.zD)(ys),changeRowsPerPage:(0,Cn.zD)(xs)},Es=(e,t)=>{const r=(0,N.difference)(e.visibleColumns,t),n=e=>r.includes(e);return(0,N.evolve)({visibleColumns:(0,N.always)(t),sorting:(0,N.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,N.keys)(e).reduce(((e,t)=>n(t)?(0,N.dissoc)(t,e):e),e)},e)},ws={reducer:(e,t)=>{switch(t.type){case gs:{const r=t.payload;return Es(e,r)}case hs:{const t=!e.filters;return ds({},e,{filters:t?{}:null,page:t?e.page:0})}case fs:{const{columnId:r,filter:n}=t.payload;return(0,N.evolve)({filters:n?(0,N.assoc)(r,n):(0,N.dissoc)(r),page:(0,N.always)(0)},e)}case bs:{const r=t.payload,n=(0,N.path)(["sorting","field"],e),a=(0,N.path)(["sorting","order"],e);return ds({},e,{sorting:{field:r,order:(0,Cn.Dh)(r===n?a:null)},page:0})}case ys:return ds({},e,{page:t.payload});case xs:return ds({},e,{rowsPerPage:t.payload});default:return e}},actions:vs,changeVisibleColumns:Es};var Cs=r(76625);const Os=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,p=t({rowIndex:o,cellIndex:u,columnData:i}),d=()=>a.current&&p(a.current.clientHeight);return(0,te.D)(d,[l.rawValue]),c().createElement("div",null,c().createElement(wr.Z,{handleHeight:!0,onResize:d}),c().createElement(Cs.Z,{rootRef:a},r))};Os.propTypes={onChangeHeight:U().func,children:U().node};const Ts=Os;var Ss=r(3073),ks=r(28831);const Ns=(0,T.Z)((()=>({hidden:{visibility:"hidden"}}))),Is=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Ns(),{toggleRowCollapse:l,getIsRowCollapsible:o,getIsRowCollapsed:i}=(0,s.useContext)(Ss.x),u=o(r),p=i(t);return c().createElement(ks.Z,{className:b()(n,{[a.hidden]:!u}),isOpen:!p,onClick:e=>{l(t),e.stopPropagation()}})};Is.propTypes={rowIndex:U().number,rowValue:U().object,className:U().string};const Ps=Is;function Ds(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const As=e=>{let{rowIndex:t,columnData:{id:r},cellIndex:n}=e;return`${r}[${t}][${n}]`},Rs=()=>{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){Ds(e,t,r[t])}))}return e}({},r.current))})),[]),a=(0,s.useCallback)((()=>{r.current={}}),[]);return{getDynamicRowCellHeight:(0,s.useCallback)((0,N.pipe)(As,(0,N.prop)(N.__,e)),[e]),changeRowCellHeight:(0,s.useCallback)((0,N.curry)((0,N.useWith)((0,N.pipe)(((e,t)=>{r.current[e]=t}),n),[As,N.identity])),[]),clearHeightsCache:a}};var js=r(21697),Zs=r(8233);function Ls(){return Ls=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},Ls.apply(this,arguments)}const _s=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=us.Z,getRowCellHeight:a=cs.Z,defaultRowHeight:l=48,maxRowValuesCount:o=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,Zs.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,js.calculateRowHeight)(n,l),e}),{}),t=(t,r,n)=>{const a=[t,"subRowHeight",r,n,"height"];return(0,N.pathOr)(0,a,e)},n=t=>(0,N.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(Ss.x.Provider,{value:u},c().createElement("div",Ls({},o,{style:{height:n(l)}}),i.length>0&&(0,js.getCellContentFromRowsData)({columnIndex:r.findIndex((0,N.propEq)("id",a)),headData:r,rowsData:i,rowIndex:l,getHeightForSubRow:t})))};return a.propTypes={columnId:U().string,rowIndex:U().number},{getRowHeight:n,CellRenderer:a}}),[i,l,u,r])};var Ms=r(67766),Vs=r(42767);const Bs=(0,T.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),Us=(0,lt.Z)(he.Z),zs=e=>{let{total:t=0,onPrev:r,onNext:n,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:o}=e;const i=Bs();return c().createElement("div",{className:i.container},c().createElement(Us,{className:i.link,component:"button",variant:"caption",onClick:a,underline:"none",tooltipTitle:x().text("Go to search results")},(0,u.k7L)(t,1e6)," ",1===t?x().text("Search result"):x().text("Search results")),c().createElement(ye.k,{size:"L",icon:Ms.Z,tooltipTitle:x().text("Go to previous profile"),onClick:r,disabled:l,showForDisabled:!0}),c().createElement(ye.k,{size:"L",icon:Vs.Z,tooltipTitle:x().text("Go to next profile"),onClick:n,disabled:o,showForDisabled:!0}))};function Fs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hs(e,t,r[t])}))}return e}function Hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ws{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=Fs({},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 qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gs(e,t,r[t])}))}return e}function Gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $s{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:qs({},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 Ys=(e,t)=>(0,N.pipe)((0,N.map)((0,N.prop)("uri")),(0,N.reject)((e=>t.includes(e))))(e),Ks=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,ze._)(),t=(0,ze._)(),r=(0,ze._)(),{uri:n,index:a,total:l,tenant:o,cache:i}=(0,g.useSelector)(h.ZP.selectors.getSearchNavigationData)||{},{type:c,data:p}=(0,g.useSelector)(h.ZP.selectors.getSearchProviderData)||{},d=(0,g.useSelector)(h.ZP.selectors.getTenant),m=(0,g.useSelector)(h.ZP.selectors.getApiPath),f=(0,g.useSelector)(h.ZP.selectors.getDtssPath),b=(0,g.useSelector)((e=>h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),y=(0,s.useContext)(Ga.m),x=(0,g.useDispatch)(),[v,E]=(0,s.useState)(!1),w=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new Ws(t);case"graphsearch":return new $s(t)}})(c,{data:p,tenant:d,searchTenant:o,apiPath:m,dtssPath:f,globalSearchRequestOptions:b})),[c,p,d,o,m,f,b]),C=(0,s.useCallback)((e=>{x(h.yC.actions.updateSearchNavigationDataFields(e))}),[x]),O=(0,s.useCallback)((e=>{const t=d!==o?(0,u.wwR)({uri:e,dataTenant:o}):e;x(h.ui.actions.openEntity({uri:t,viewId:y,source:"navigation"}))}),[x,y,d,o]),T=(0,s.useCallback)((()=>{x(h.ui.actions.openPerspective({perspectiveId:c,viewId:y}))}),[x,c,y]);(0,s.useEffect)((()=>{a>=l?C({index:l-1}):a<0&&C({index:0})}),[l,a,C]);const S=(0,s.useCallback)(((e,n,a)=>{E(!0),t(w.requestTotal()).then((e=>C({total:e})));const l=a+1;return r(w.requestEntities(15,l)).then((t=>{if(t){if(t.length){const r=Ys(t,e);if(r.length>0)return C({cache:e.concat(r),uri:r[0],index:l+t.length-r.length}),void O(r[0]);if(a+t.length<n-1)return S(e,n-t.length,a+t.length)}C({index:l})}})).finally((()=>{E(!1)}))}),[w,C,O]),k=(0,s.useCallback)(((e,n)=>{E(!0),t(w.requestTotal()).then((e=>C({total:e})));const a=n-1,l=Math.max(0,n-15),o=15+Math.min(0,n-15);return r(w.requestEntities(o,l)).then((t=>{if(t){if(t.length){const r=Ys(t,e);if(r.length>0)return C({cache:r.concat(e),uri:r[r.length-1],index:a-(t.length-r.length)}),void O(r[r.length-1]);if(n-t.length>0)return k(e,n-t.length)}C({index:0})}})).finally((()=>{E(!1)}))}),[w,C,O]),N=(0,s.useCallback)(((t,r,n,a)=>{if(r<t.length){const l=t[r];return E(!0),e(w.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),N(e,r,n-1,a)}C({index:a+1,uri:l,cache:t,total:n}),O(l)})).finally((()=>{E(!1)}))}if(!(a>=n-1))return S(t,n,a);C({cache:t,total:n,index:n-1})}),[w,C,O,S]),I=(0,s.useCallback)(((t,r,n,a)=>{if(r>-1){const l=t[r];return E(!0),e(w.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),I(e,r-1,n-1,a-1)}C({index:a-1,uri:l,cache:t,total:n}),O(l)})).finally((()=>{E(!1)}))}if(!(a<=0))return k(t,a);C({index:0,cache:t,total:n})}),[w,C,O,k]),P=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)-1;I(i,e,l,a)}}),[I,i,n,l,a]),D=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)+1;N(i,e,l,a)}}),[N,i,n,l,a]);return{total:l,onPrev:P,onNext:D,onSearchResultsClick:T,isPrevDisabled:v||a<=0,isNextDisabled:v||a>=l-1}})();return(()=>{const{cache:e}=(0,g.useSelector)(h.ZP.selectors.getSearchNavigationData)||{},t=(0,g.useSelector)(h.ZP.selectors.getMode),r=(0,g.useSelector)(h.ZP.selectors.getEntity);return(0,u.uzs)(t)&&(null==e?void 0:e.includes(null==r?void 0:r.uri))})()?c().createElement(zs,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}):null};var Xs=r(82068),Qs=r(72668),Js=r(38037),ec=r(62321),tc=r(56215),rc=r(12960),nc=r(39878),ac=r(59383);function lc(){return lc=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},lc.apply(this,arguments)}const oc=e=>c().createElement($e.Z,lc({mouseEvent:"onMouseDown"},e));var ic=r(89902),sc=r(78501),cc=r(59952),uc=r(51556);const pc=(0,T.Z)((()=>({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}})));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)}function mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gc(e,t,r[t])}))}return e}function gc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hc=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:l,titleText:o,filterText:i,onListItemClick:p,selected:d,hideCheckBox:g,renderGroupTitle:h}=e,f=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,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const y=(0,s.useCallback)((e=>e.label.toLowerCase().includes(i.toLowerCase())),[i]),x=(0,s.useCallback)((e=>y(e)||(e.children||[]).some(x)),[y]),v=(0,s.useMemo)((()=>{const e=(0,N.curry)(((e,r,n,a)=>[{item:mc({},r,{filterText:i}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const l=t=>e(a,t,r,n),o=t.filter(x);return(h?N.map:N.chain)(l,o)};return t}),[i,h,x]),E=(0,s.useCallback)((e=>e.map((e=>({item:e,items:v(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[v]),w=(0,s.useCallback)((e=>{let{item:t}=e;p(t,!d.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[p,d]),C=(0,s.useMemo)((()=>(h?E:v)(n)),[n,h,E,v]),O=(0,s.useMemo)((()=>zr(C)),[C]),{focusIndex:T,handleKeyDown:S}=$r({items:O,open:t,onSelectFocusedItem:w,selectedItems:d}),k=(0,s.useRef)(null);k.current=T;const I=(0,s.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const l=!!d.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),o=k.current===r;return c().createElement(m.Z,{key:n.id,onClick:p,checked:l,level:a,data:n,label:c().createElement(Xr,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:g,isFocused:o,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[g,p,d]),P=(0,u.fW1)("label")(C)||308,D=pc();return c().createElement(Ur,dc({open:t,className:b()(D.container,D.popupContainer),anchorEl:r,onClose:l,onSearch:a,title:o,containerWidth:P,searchInputOnKeyDown:S},f),c().createElement(Gr,{height:300,renderItem:I,items:O,hideSubtitles:!0,getItemSize:()=>32,containerWidth:P,focusIndex:T,renderGroupTitle:h}))};hc.propTypes={open:U().bool,hideCheckBox:U().bool,anchorEl:U().any,selected:U().array,data:U().array,filterText:U().string,titleText:U().string,onClose:U().func,onListItemClick:U().func,onSearch:U().func,renderGroupTitle:U().func},hc.defaultProps={data:[],selected:[],titleText:x().text("Show/hide columns"),filterText:""};const fc=hc,bc=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,s.useCallback)(((e,r)=>{const n={},a=(0,N.pipe)(u.PjQ,(0,N.tap)((e=>n[e]=(0,N.propOr)(0,e,n)+1))),l=(0,N.ascend)((0,N.prop)("label")),o=(0,N.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,N.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,N.propEq)("uri",n)),direction:a}}),[]),toEditorValue:(0,s.useCallback)(((e,t)=>t.find((0,N.propEq)("value",`${e.relationType},${e.direction}`))),[])}};function yc(){return yc=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},yc.apply(this,arguments)}const xc=e=>{let{relation:t={},inRelationTypes:r=[],outRelationTypes:n=[],onChange:a=N.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:p,toEditorValue:d}=bc({reversedContextLabels:o}),m=(0,s.useMemo)((()=>u(r,n)),[u,r,n]),g=(0,s.useCallback)((0,N.pipe)(p(r,n),a),[p,r,n,a]);return(0,s.useEffect)((()=>{l&&m.length&&g(m[0])}),[m,l,g]),c().createElement(Ei,yc({value:d(t,m),options:m,onChange:g},i))};xc.propTypes={className:U().string,relation:u.bNA,inRelationTypes:U().arrayOf(u.IYE),outRelationTypes:U().arrayOf(u.IYE),applyFirstByDefault:U().bool,reversedContextLabels:U().bool,onChange:U().func};const vc=xc;var Ec=r(4190),wc=r(60364);function Cc(){return Cc=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},Cc.apply(this,arguments)}const Oc=e=>{let{open:t=!0,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,["open","children"]);const[a,l]=(0,s.useState)(t),o=(0,wc.Z)().transitions.duration.leavingScreen;return(0,s.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{l(!1)}),o);return()=>clearTimeout(e)}l(!0)}}),[t,o,a]),c().createElement(Ec.ZP,Cc({open:t},n),a&&r)};Oc.displayName="Drawer";const Tc=Oc;var Sc=r(1128),kc=r(43371),Nc=r(15299),Ic=r(19855),Pc=r(72466),Dc=r(39600),Ac=r(91785),Rc=r(51594),jc=r(7522);function Zc(){return Zc=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},Zc.apply(this,arguments)}const Lc=e=>c().createElement(jc.Z,Zc({message:x().text("No data available")},e));var _c=r(6216),Mc=r(79002);const Vc=(0,T.Z)({"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",display:"inline-flex",marginRight:"12px",borderRadius:"2px"},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",display:"inline-flex",marginRight:"16px"}}),Bc=e=>{let{entity:t,className:r,size:n="small"}=e;const a=Vc(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=t.type,i=(0,u.nt9)(l,o)||{},s=(0,u.VD3)(l,i,"typeColor")||u.rSc.palette.primary.main;return c().createElement(E.Z,{style:{backgroundColor:s,color:u.P6Y.Colors.getColor(s)?"#FFFFFF":"#212121"},className:b()(a[`entityType-${n}`],r),component:"div"},(0,u.jFi)(l,t))};var Uc=r(45767),zc=r(86619);const Fc=(0,T.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function Hc(){return Hc=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},Hc.apply(this,arguments)}const Wc=(0,N.always)(32),qc=e=>{let{selectedEntityTypes:t,onItemClick:r,focusIndex:n}=e,a=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,["selectedEntityTypes","onItemClick","focusIndex"]);return c().createElement(Gr,Hc({getItemSize:Wc,renderItem:(e,a,l)=>{let{item:o}=a;const i=!!t.find((e=>o.uri===e)),s=l===n;return c().createElement(m.Z,{key:o.uri,onClick:r,checked:i,data:o,label:c().createElement(Xr,{text:o.label,highlight:o.filterText}),labelInText:o.label,style:e,isFocused:s,hideIcon:!0,LogoIcon:o.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0},a))};qc.propTypes={selectedEntityTypes:U().array,onItemClick:U().func,focusIndex:U().number};const Gc=(0,s.memo)(qc),$c=(0,T.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),Yc=(e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=r,l=document.createRange();l.setStart(t,0);for(let r=0;r<e.length;r++){l.setEnd(t,l.endOffset+e[r].length);const{width:o}=l.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&l.setEnd(t,l.endOffset+", ".length)}}return-1},Kc=e=>e.join(", "),Xc=e=>`calc(${(0,N.isNil)(e)?"100%":`${e}px`} - 35px)`,Qc=e=>{let{list:t,maxWidth:r}=e;const n=$c(),a=(0,s.useRef)(),[l,o]=(0,s.useState)(0);(0,s.useEffect)((()=>{o(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=Yc(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(t,a.current))}),[t]);const i=Kc(t),u=l>0,p=u?Kc(t.slice(0,-l)):i;return c().createElement(le.ZP,{title:u?i:""},c().createElement("div",{className:n.listLabelContainer},c().createElement("div",{style:{width:Xc(r)},className:n.listLabel,ref:a},i),c().createElement("div",{className:n.visibleItemsLabel},p),u&&c().createElement("div",{className:n.hiddenCount},`+${l}`)))};Qc.propTypes={list:U().arrayOf(U().string).isRequired,maxWidth:U().number};const Jc=Qc;function eu(){return eu=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},eu.apply(this,arguments)}function tu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ru(e,t,r[t])}))}return e}function ru(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nu=e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:l,onChange:o,classes:i={},ListLabelProps:p={},disabled:d=!1}=e;const m=Fc(),[g,h]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>h(!0)),[]),y=(0,s.useCallback)((()=>h(!1)),[]),[v,E]=(0,s.useState)(""),w=(0,s.useCallback)((()=>E("")),[]),C=(0,s.useCallback)((0,N.pipe)(w,y),[y,w]),O=(0,s.useMemo)((()=>t.filter(u.oDv).filter((e=>{let{label:t}=e;return u.P6Y.strings.search(t,v)})).map(((e,t)=>({item:{item:tu({},e,{filterText:v})},index:t})))),[t,v]),T=(0,s.useMemo)((()=>r.map((e=>t.find((0,N.propEq)("uri",e)))).map((0,N.prop)("label"))),[r,t]),S=(0,s.useCallback)(((e,t)=>{n?(o(t?[e.uri]:[]),C()):o(t?r.concat(e.uri):r.filter((t=>t!==e.uri)))}),[r,o,n,C]),k=(0,s.useCallback)((e=>{let{item:t}=e;const n=!r.includes(t.uri);S(t,n)}),[r,S]),{focusIndex:I,handleKeyDown:P}=$r({items:O,open:g,onSelectFocusedItem:k,selectedItems:r,onClose:C}),D=(0,s.useRef)(),A=D.current?D.current.getBoundingClientRect().width:0,R=Math.max(A,255),j=0===r.length;return c().createElement(c().Fragment,null,c().createElement(zc.Z,{label:x().text("Entity type"),ref:D,InputProps:{startAdornment:j&&!a?null:c().createElement("div",{className:b()(m.inputText,i.inputText)},j?c().createElement("div",null,a):c().createElement(Jc,eu({},p,{list:T}))),classes:{root:m.inputRoot,input:b()(m.input,i.input,{[m.emptyInput]:j&&!a}),disabled:b()(m.disabledInput,{[m.disabledPointer]:d}),underline:m.disabledUnderline},endAdornment:c().createElement(_t.Z,{size:"L",icon:Uc.Z,iconClassName:b()(m.icon,{[m["popup-opened-icon"]]:g}),disabled:d}),readOnly:!0,disabled:!0,disableUnderline:j&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:b()(m.inputLabel,i.label)}},value:"",onClick:d?void 0:f,classes:{root:b()(m.root,i.root)},margin:"dense",variant:"filled",disabled:d,"data-reltio-id":"entity-type-selector"}),c().createElement(Ur,{open:g,anchorEl:D.current,onClose:C,onSearch:E,title:x().text("Select entity types"),containerWidth:R,containerHeight:355,searchInputOnKeyDown:P,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":"entity-type-selector-popup"}},c().createElement(Gc,{items:O,onItemClick:S,selectedEntityTypes:r,width:R,height:245,focusIndex:I})))};nu.propTypes={entityTypes:U().arrayOf(u.p8l),selectedEntityTypes:U().arrayOf(U().string).isRequired,onChange:U().func.isRequired,single:U().bool,enableEmptyValueUnderline:U().bool,placeholder:U().string,classes:U().shape({root:U().string,label:U().string,inputText:U().string,input:U().string}),ListLabelProps:U().shape({maxWidth:U().number}),disabled:U().bool};const au=(0,s.memo)(nu);var lu=r(7882),ou=r(97333);const iu=e=>`rotateY(${e?180:0}deg)`,su=e=>`rotateX(${e?180:0}deg)`,cu=e=>`rotateY(${e?0:-180}deg)`,uu=e=>`rotateX(${e?0:-180}deg)`,pu=(0,T.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?cu(t):uu(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?iu(t):su(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),du=(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),p=pu({cardZIndex:r,direction:n,isFlipped:i});return(0,s.useEffect)((()=>{a!==i&&u(a)}),[a,i]),c().createElement("div",{className:b()(p.flipper,o),ref:t},c().createElement("div",{"data-id":"front",className:p.front},l[0]),c().createElement("div",{"data-id":"back",className:p.back},l[1]))})),mu=()=>c().createElement("div",{style:{display:"none"}}),gu=e=>{let{widthToHide:t,children:r}=e;return c().createElement(wr.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(mu,null)}})};gu.propTypes={children:U().node,widthToHide:U().number.isRequired};const hu=gu;function fu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bu(e,t,r[t])}))}return e}function bu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yu=(0,N.range)(2,10).reduce(((e,t)=>fu({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),xu=(0,T.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":fu({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},yu,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function vu(){return vu=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},vu.apply(this,arguments)}const Eu=e=>{let{pathToTitle: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,["pathToTitle","children"]);const a=xu(),l=t&&t.length?c().createElement("div",{className:a.tooltipContent},c().createElement("p",null,(0,N.last)(t)),t.length>2&&c().createElement("ul",null,t.map((e=>c().createElement("li",{key:e},e))))):"";return c().createElement(le.ZP,vu({title:l,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};Eu.propTypes={pathToTitle:U().arrayOf(U().string).isRequired,children:U().node};const wu=Eu;var Cu=r(4614),Ou=r(61932);const Tu=(0,T.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let Su;!function(e){e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE"}(Su||(Su={}));const ku=e=>{let{classes:t={},tooltip:r="",onClick:n=Cn.ZT,mode:a=Su.INIT}=e;const l=Tu();return c().createElement("div",{className:b()(l.root,t.root)},(()=>{switch(a){case Su.INIT:return c().createElement(ye.k,{className:t.button,size:"M",tooltipTitle:r,icon:Ou.Z,onClick:n});case Su.PROGRESS:return c().createElement(Cu.Z,{className:t.spinner,size:24});case Su.SUCCESS:return c().createElement(ge.Z,{className:b()(l.check,t.check)});default:return null}})())},Nu=(0,T.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),Iu=e=>{let{to:t,children:r,onClick:n}=e;const a=Nu();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},Pu=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==")})},Du=e=>{let{isMlMatch:t=!1}=e;return c().createElement(c().Fragment,null,t?x().text("Match IQ"):x().text("Match rules"))},Au=(0,T.Z)({title:{fontWeight:500,marginBottom:"9px"},body:{fontWeight:"normal",marginLeft:"16px"},container:{padding:"8px",fontSize:"12px",lineHeight:"14px"}}),Ru=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=Au();return c().createElement("div",{className:n.container},c().createElement("div",{className:n.title},c().createElement(Du,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},ju=(0,T.Z)((e=>({container:{fontSize:"13px",lineHeight:"15px"},title:{color:e.palette.text.secondary,marginBottom:"7px"},labelsContainer:{color:e.palette.text.primary,marginBottom:"8px"}}))),Zu=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=ju();return c().createElement("div",{className:b()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(Du,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},Lu=(0,T.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 _u(){return _u=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},_u.apply(this,arguments)}const Mu=(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=Lu();return c().createElement("div",_u({onClick:a,ref:t,className:b()(i.container,l)},o),c().createElement(Ut,{expanded:n}),c().createElement("div",{className:i.label},r))}));Mu.displayName="MatchRuleBadge";const Vu=Mu,Bu=(0,T.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function Uu(){return Uu=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},Uu.apply(this,arguments)}const zu=e=>c().createElement("svg",Uu({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}))),Fu=(0,lt.Z)(Vu),Hu=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=Bu(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement(Fu,{tooltipTitle:c().createElement(Ru,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(zu,{className:n.icon}),x().text("Match IQ")):x().text("Rules")),a?c().createElement(Zu,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function Wu(){return Wu=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},Wu.apply(this,arguments)}const qu=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,N.isEmpty)(l)?null:c().createElement(r,Wu({matchRules:l},n)),(0,N.isEmpty)(a)?null:c().createElement(r,Wu({isMlMatch:!0,matchRules:a},n)))};qu.propTypes={matchRules:u.p3$,Component:U().func};const Gu=qu,$u=(0,T.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"}}))),Yu=e=>{let{label:t,matchRules:r}=e;const n=$u(),[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(Ut,{expanded:a}),c().createElement("div",{className:n.label},t)),a?c().createElement(Gu,{Component:Zu,matchRules:r,className:n.matchLabels}):null)},Ku=(0,T.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),Xu=(0,T.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),Qu=e=>{let{transitiveMatchRules:t}=e;const r=Xu();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(Ru,{matchRules:a}))})))};function Ju(){return Ju=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},Ju.apply(this,arguments)}const ep=(0,lt.Z)(Vu),tp=e=>{let{transitiveMatchRules:t}=e;const r=Ku(),[n,a]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(ep,{tooltipTitle:c().createElement(Qu,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:n},x().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(Yu,Ju({key:t},e)))):null)},rp=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(tp,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement(Gu,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:Hu})};var np=r(73698);const ap=(0,T.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 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)}const op=e=>"onClick"in e,ip=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:l=!1}=e;const o=ap();return c().createElement(np.Z,{classes:{root:o.root,icon:o.arrowIcon,outlined:o.outlined},value:n,onChange:e=>{const{value:r}=e.target;t.some((0,N.propEq)("value",r))&&a(r)},variant:"outlined",renderValue:e=>{const{icon:r,label:n=e}=t.find((0,N.propEq)("value",e))||{};return c().createElement(v.Z,{className:o.currentValue},r&&c().createElement(r,{className:o.currentValueIcon}),c().createElement(le.ZP,{title:n},c().createElement(E.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(op);return e.map(((e,r)=>{const{value:n,description:a,icon:l}=e,i={value:n,className:o.menuItem};return op(e)&&(i.onClick=()=>e.onClick(n),i.className=b()(i.className,{[o.firstMenuItemButton]:r===t})),c().createElement(Va.Z,lp({key:n},i,{"data-reltio-id":`reltio-profile-select-mode-${n}`}),c().createElement(v.Z,{className:o.menuItemInner},c().createElement(l,{className:o.menuItemIcon}),c().createElement(v.Z,null,c().createElement(E.Z,{className:o.menuItemLabel},n),c().createElement(E.Z,{className:o.menuItemDescription},a))))}))})([...t,...r]))};var sp=r(16482),cp=r(73272);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 pp=e=>c().createElement("svg",up({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"})),dp=(0,T.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}}))),mp=e=>{let{date:t,type:r,createdBy:n,step:a,children:l,Actions:o}=e;const i=dp(),[u,p]=(0,s.useState)(!1);return c().createElement("div",{className:i.pmReviewCard},c().createElement("div",{className:b()(i.header,{[i.expanded]:u})},c().createElement(pp,{className:i.icon}),c().createElement("div",{className:i.mainInfo},c().createElement("div",{className:i.title},c().createElement("div",{className:b()(i.caption,i.flex)},x().text("Match review")),c().createElement(cp.Z,{className:i.flag}),c().createElement("span",{className:i.date},x().date(t,"L")),c().createElement(ks.Z,{isOpen:u,onClick:()=>{p(!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},x().text("Created by ${createdBy}",{createdBy:n})),c().createElement("div",{className:i.info},x().text("Step: ${step}",{step:a}))),o))),u?l:null)};mp.propTypes={date:U().number,createdBy:U().string,type:U().string,step:U().string,children:U().oneOfType([U().node,U().arrayOf(U().node)]),Actions:U().node};const gp=mp,hp=e=>{let{label:t,value:r,uri:n,rangeColorsConfig:a,className:l}=e;const o=H();return c().createElement("div",{className:b()(o.container,l),key:n},c().createElement(K,{attrTypeUri:n,label:t}),c().createElement("span",{className:o.value,style:{color:(0,u.Uz2)(n,r,a)}},r))};hp.propTypes={label:U().string,value:U().oneOfType([U().string,U().number]),uri:U().string,rangeColorsConfig:U().object,className:U().string};const fp=hp,bp=(0,T.Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"inset 0 -1px 0 0 rgba(0,114,206,0.06), inset 0 1px 0 0 rgba(0,114,206,0.06);","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}},scores:{display:"flex",flexGrow:1,justifyContent:"flex-end",paddingRight:"20px"}})));function yp(){return yp=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},yp.apply(this,arguments)}const xp=e=>{let{className:t,entity:r,scoresToShow:n,rangeColorsConfig:a,children:l,classes:o}=e;const i=bp({classes:o}),p=(0,g.useSelector)(h.ZP.selectors.getMetadata),d=(0,s.useCallback)((()=>{navigator.clipboard.writeText((0,u.BTI)(r))}),[r]);if((0,N.isNil)(r))return null;const m=(0,u.idV)(r.label),f=r.secondaryLabel,y=(0,u.ptG)(p,r),v=(0,u.Fn9)(r),w=(0,u.AET)(p,r,n),C=r.uri,O=(0,u.BTI)(r);return c().createElement("div",{className:b()(i.profileBandWrapper,t)},c().createElement("div",{className:b()(i.profileBand,{[i.inactive]:!v}),"data-entity-uri":C},c().createElement(bt,{key:r.uri,entity:r,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),c().createElement("div",{className:i.profileInfo},c().createElement("div",null,c().createElement(E.Z,{variant:"h6",className:i.label},m),f&&c().createElement(E.Z,{variant:"subtitle2",className:i.secondaryLabel},f),y&&c().createElement(E.Z,{variant:"subtitle1",className:i.businessCard},y)),c().createElement("div",{className:i.specialInfo},c().createElement("div",{className:i.entityType},c().createElement(Bc,{entity:r,size:"medium",className:i.badge}),w.length>0&&c().createElement("div",{className:i.scores},w.map((e=>c().createElement(fp,yp({key:e.uri},e,{rangeColorsConfig:a}))))),!(0,u.ZiX)(C)&&c().createElement(le.ZP,{title:x().text("Copy to clipboard")},c().createElement(E.Z,{display:"inline",variant:"body2",className:i.entityId,onClick:d},x().text("Entity ID"),": ",O))))),l&&c().createElement("div",null,l)))};xp.propTypes={className:U().string,entity:U().object,scoresToShow:U().arrayOf(U().string),rangeColorsConfig:U().object,children:U().node,classes:U().object};const vp=xp,Ep=(0,T.Z)((e=>({container:{position:"relative",display:"flex",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,padding:"8px 8px 8px 0",overflow:"hidden"},colorBox:{position:"absolute",opacity:.12,top:0,left:0,bottom:0,width:"32px"},image:{width:"32px",height:"32px"},avatar:{marginRight:"8px",marginLeft:"16px",marginTop:"2px"},info:{overflow:"hidden",display:"flex",flexDirection:"column"},firstRow:{width:"100%"},label:{display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:500,color:e.palette.primary.main},link:{textDecoration:"none"},secondRow:{wordWrap:"break-word",marginTop:"4px",lineHeight:"13px",fontSize:"11px"},thirdRow:{display:"flex",alignItems:"center",fontSize:"12px",color:e.palette.text.secondary,marginTop:"auto"}})));function wp(){return wp=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},wp.apply(this,arguments)}const Cp=(0,s.memo)((e=>{let{entity:t,classes:r={},disableEntityTypeColor:n}=e,a=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,["entity","classes","disableEntityTypeColor"]);const l=Ep(),{secondaryLabel:o,label:i,container:s}=r,p=(0,g.useSelector)(h.ZP.selectors.getMetadata),d=(0,u.idV)(t.label),{secondaryLabel:m,type:f}=t,y=(0,u.nt9)(p,f)||{},x=(0,u.VD3)(p,y,"typeColor")||u.rSc.palette.primary.main;return c().createElement("div",wp({className:b()(l.container,s)},a),c().createElement("div",{className:l.colorBox,style:n?void 0:{backgroundColor:x}}),c().createElement(bt,{entity:t,avatarClassName:l.avatar,imageClassName:l.image}),c().createElement("div",{className:l.info},c().createElement("div",{className:l.firstRow},c().createElement(ve.Z,{value:(0,u.wwR)(t),className:l.link},c().createElement(mi.C,{value:d,placement:"top",showOnExceededHeight:!0},c().createElement("span",{className:b()(l.label,i)},d)))),c().createElement("div",{className:l.secondRow},m&&c().createElement(mi.C,{value:m,placement:"top",showOnExceededHeight:!0},c().createElement("span",{className:o},m))),c().createElement("div",{className:l.thirdRow},c().createElement(Bc,{entity:t}),c().createElement("div",null,(0,u.BTI)(t)))))})),Op=(0,T.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));var Tp=r(6782);const Sp="46px",kp=(0,T.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:Sp},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:Sp}}))),Np=e=>{let{className:t,rowData:r}=e;const n=kp();return c().createElement("div",{className:b()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,Tp.Z)(r.operator):x().text("Where"))};Np.propTypes={className:U().string,rowData:U().object};const Ip=Np,Pp=e=>{let{className:t,rowData:r}=e;const n=kp();return c().createElement("div",{className:b()(n.readOnlyFilter,t)},r&&r.filter?(0,u.XS2)(r.filter):x().text("equals"))};Pp.propTypes={className:U().string,rowData:U().object};const Dp=Pp;const Ap=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=Ip,AttributeSelectorComponent:l,FilterSelectorComponent:o=Dp,ValuesEditorComponent:i,ActionsComponent:s,filterSelectorRef:u,attributeSelectorProps:p={}}=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,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const m=Op();return c().createElement("div",{className:b()(m.row,t.root)},c().createElement(a,{className:t.logicOperatorContainer,rowContext:d,rowData:n}),c().createElement("div",{className:b()(m.rowItem,t.attributeSelectorContainer)},c().createElement(l,{attributeSelectorProps:p,rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,t.filterSelectorContainer)},c().createElement(o,{textFieldInputRef:u,rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,m.fullWidth,t.valuesEditorContainer)},c().createElement(i,{rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,t.actionsContainer,{[m.hidden]:!r})},c().createElement(s,{rowContext:d,rowData:r})))};Ap.propTypes={classes:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowData:ji.Xw,previousRowData:ji.Xw,LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,attributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const Rp=(0,s.memo)(Ap);function jp(){return jp=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},jp.apply(this,arguments)}const Zp=e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:l,filterSelectorRefIndex: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","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,N.path)([t-1],n):null,u=t===n.length?{attributeSelectorProps:a}:{};return c().createElement(Rp,jp({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?l:void 0},i,u))};return c().createElement("div",{className:t},n.map(s),s(null,n.length,n))};Zp.propTypes={className:U().string,rowClasses:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowsData:U().arrayOf(ji.Xw),LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,filterSelectorRefIndex:U().number,lastRowAttributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const Lp=(0,s.memo)(Zp);var _p=r(15793);const Mp={BY_LABEL:(0,r(54573).c)({stringify:(0,N.prop)("label")})};var Vp=r(81521),Bp=r(8978),Up=r(46847),zp=r(15459);function Fp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const Hp=(0,T.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 Wp(){return Wp=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},Wp.apply(this,arguments)}const qp=e=>{let{children:t,listIndex:r,swapFrom:n,swapLength:a,swapDepth:l,scaffoldBlockPxWidth:o,lowerSiblingCounts:i,connectDropTarget:u,isOver:p,draggedNode:d,canDrop:m,treeIndex:g,treeId:h,getPrevRow:f,node:b,path:y,rowDirection:x}=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"]);Hp();const E="rtl"===x?"rst__rtl":null,w=i.length,C=[];let O;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"),C.push(c().createElement("div",{key:`pre_${1+t}`,style:{width:o},className:Fp("rst__lineBlock",i,E)})),g!==r&&t===l){let e,l="";l=r===n+a-1?"rst__highlightBottomLeftCorner":g===n?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===x?{width:o,right:o*t}:{width:o,left:o*t},C.push(c().createElement("div",{key:t,style:e,className:Fp("rst__absoluteLineBlock",l,E)}))}})),O="rtl"===x?{right:o*w}:{left:o*w},u(c().createElement("div",Wp({},v,{className:Fp("rst__node",E)}),C,c().createElement("div",{className:"rst__nodeContent",style:O},s.Children.map(t,(e=>(0,s.cloneElement)(e,{isOver:p,canDrop:m,draggedNode:d}))))))};qp.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},qp.propTypes={treeIndex:U().number.isRequired,treeId:U().string.isRequired,swapFrom:U().number,swapDepth:U().number,swapLength:U().number,scaffoldBlockPxWidth:U().number.isRequired,lowerSiblingCounts:U().arrayOf(U().number).isRequired,listIndex:U().number.isRequired,children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),getPrevRow:U().func.isRequired,node:U().shape({}).isRequired,path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,rowDirection:U().string};const Gp=qp;function $p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yp(e,t,r[t])}))}return e}function Yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kp(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 p=r.children.length;for(let e=0;e<p;e+=1){const n=Kp({ignoreCollapsed:i,getNodeKey:a,targetIndex:t,node:r.children[e],currentIndex:u,lowerSiblingCounts:[...o,p-e-1],path:c});if(n.node)return n;u=n.nextIndex}return{nextIndex:u}}function Xp(e){let{node:t,ignoreCollapsed:r=!0}=e;return Kp({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}function Qp(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 p=i;const d=l.children.length;if("function"!=typeof l.children)for(let e=0;e<d;e+=1)if(p=Qp({callback:t,getNodeKey:r,ignoreCollapsed:n,node:l.children[e],parentNode:a?null:l,currentIndex:p+1,lowerSiblingCounts:[...c,d-e-1],path:u}),!1===p)return!1;return p}function Jp(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=$p({},l),p=a?[]:[...s,r({node:u,treeIndex:i})],d={node:u,parentNode:o,path:p,lowerSiblingCounts:c,treeIndex:i};if(!u.children||!0!==u.expanded&&n&&!a)return{treeIndex:i,node:t(d)};let m=i;const g=u.children.length;return"function"!=typeof u.children&&(u.children=u.children.map(((e,l)=>{const o=Jp({callback:t,getNodeKey:r,ignoreCollapsed:n,node:e,parentNode:a?null:u,currentIndex:m+1,lowerSiblingCounts:[...c,g-l-1],path:p});return m=o.treeIndex,o.node}))),{node:t(d),treeIndex:m}}function ed(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||Qp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function td(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:Jp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function rd(e){let{treeData:t,expanded:r=!0}=e;return td({treeData:t,callback:e=>{let{node:t}=e;return $p({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function nd(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 p=c+1;for(let e=0;e<s.children.length;e+=1){const t=i({node:s.children[e],currentTreeIndex:p,pathIndex:u+1});if(t!==o)return $p({},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)]});p+=1+Xp({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 ad(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null,o=null;return{treeData:nd({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 ld(e){let{targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isPseudoRoot:o=!1,isLastChild:i,node:s,currentIndex:c,currentDepth:u,getNodeKey:p,path:d=[]}=e;const m=e=>o?[]:[...d,p({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=$p({},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+Xp({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=$p({},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 g=null,h=null,f=null,b=c+1,y=s.children;"function"!=typeof y&&(y=y.map(((e,o)=>{if(null!==g)return e;const s=ld({targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isLastChild:i&&o===y.length-1,node:e,currentIndex:b,currentDepth:u+1,getNodeKey:p,path:[]});return"insertedTreeIndex"in s&&({insertedTreeIndex:g,parentNode:f,parentPath:h}=s),b=s.nextIndex,s.node})));const x=$p({},s,{children:y}),v={node:x,nextIndex:b};return null!==g&&(v.insertedTreeIndex=g,v.parentPath=[...m(x),...h],v.parentNode=f),v}function od(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=ld({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 id(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return ed({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function sd(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||sd(e,t)))}function cd(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,cd(r,t+1))),t):t}function ud(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:p,path:d=[]}=e,m=[],g=!1,h=!1;const f=r?[]:[...d,t({node:u,treeIndex:p})],b=r?null:{path:f,treeIndex:p},y=u.children&&"function"!=typeof u.children&&u.children.length>0;!r&&a($p({},b,{node:u,searchQuery:n}))&&(s===l&&(h=!0),s+=1,g=!0);let x=p;const v=$p({},u);return y&&(v.children=v.children.map((e=>{const t=c({node:e,currentIndex:x+1,path:f});return t.node.expanded?x=t.treeIndex:x+=1,(t.matches.length>0||t.hasFocusMatch)&&(m=[...m,...t.matches],t.hasFocusMatch&&(h=!0),(o&&t.matches.length>0||(o||i)&&t.hasFocusMatch)&&(v.expanded=!0)),t.node}))),r||v.expanded||(m=m.map((e=>$p({},e,{treeIndex:null})))),g&&(m=[$p({},b,{node:v}),...m]),{node:m.length>0?v:u,matches:m,hasFocusMatch:h,treeIndex:x}},u=c({node:{children:r},isPseudoRoot:!0,currentIndex:-1});return{matches:u.matches,treeData:u.node.children}}const pd={find:ud,getDepth:cd,isDescendant:sd,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?$p({},e,{children:l[t].map((e=>o(e)))}):$p({},e)};return l[a].map((e=>o(e)))},getFlatDataFromTree:id,insertNode:od,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=td({treeData:t,getNodeKey:a,ignoreCollapsed:l,callback:e=>{let{node:t,treeIndex:a,path:u}=e;const p=u?u[u.length-1]:null;if(c||p!==n)return t;c=!0;const d=$p({},t);if(o&&(d.expanded=!0),!d.children)return s=a+1,$p({},d,{children:[r]});if("function"==typeof d.children)throw new Error("Cannot add to children defined by a function");let m=a+1;for(let e=0;e<d.children.length;e+=1)m+=1+Xp({node:d.children[e],ignoreCollapsed:l});return s=m,$p({},d,{children:i?[r,...d.children]:[...d.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{nd({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:ad,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return nd({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:nd,toggleExpandedForAll:rd,map:td,walk:ed,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=Kp({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:Xp};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)}function md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gd(e,t,r[t])}))}return e}function gd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hd=e=>{let{scaffoldBlockPxWidth:t,toggleChildrenVisibility:r,connectDragPreview:n,connectDragSource:a,isDragging:l,canDrop:o,canDrag:i,node:s,title:u,subtitle:p,draggedNode:d,path:m,treeIndex:g,isSearchMatch:h,isSearchFocus:f,buttons:b,className:y,style:x,didDrop:v,treeId:E,isOver:w,parentNode:C,rowDirection:O}=e,T=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 S=u||s.title,k=p||s.subtitle,N="rtl"===O?"rst__rtl":null;let I;i&&(I="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:Fp("rst__loadingCirclePoint",N)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const P=d&&sd(d,s),D=!v&&l;let A={left:-.5*t};return"rtl"===O&&(A={right:-.5*t}),c().createElement("div",dd({style:{height:"100%"}},T),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:Fp(s.expanded?"rst__collapseButton":"rst__expandButton",N),style:A,onClick:()=>r({node:s,path:m,treeIndex:g})}),s.expanded&&!l&&c().createElement("div",{style:{width:t},className:Fp("rst__lineChildren",N)})),c().createElement("div",{className:Fp("rst__rowWrapper",N)},n(c().createElement("div",{className:Fp("rst__row",D&&"rst__rowLandingPad",D&&!o&&"rst__rowCancelPad",h&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",N,y),style:md({opacity:P?.5:1},x)},I,c().createElement("div",{className:Fp("rst__rowContents",!i&&"rst__rowContentsDragDisabled",N)},c().createElement("div",{className:Fp("rst__rowLabel",N)},c().createElement("span",{className:Fp("rst__rowTitle",s.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof S?S({node:s,path:m,treeIndex:g}):S),k&&c().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof k?k({node:s,path:m,treeIndex:g}):k)),c().createElement("div",{className:"rst__rowToolbar"},b.map(((e,t)=>c().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))))))};hd.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},hd.propTypes={node:U().shape({}).isRequired,title:U().oneOfType([U().func,U().node]),subtitle:U().oneOfType([U().func,U().node]),path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,treeIndex:U().number.isRequired,treeId:U().string.isRequired,isSearchMatch:U().bool,isSearchFocus:U().bool,canDrag:U().bool,scaffoldBlockPxWidth:U().number.isRequired,toggleChildrenVisibility:U().func,buttons:U().arrayOf(U().node),className:U().string,style:U().shape({}),connectDragPreview:U().func.isRequired,connectDragSource:U().func.isRequired,parentNode:U().shape({}),isDragging:U().bool.isRequired,didDrop:U().bool.isRequired,draggedNode:U().shape({}),isOver:U().bool.isRequired,canDrop:U().bool,rowDirection:U().string};const fd=hd;function bd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class yd 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){bd(e,t,r[t])}))}return e}({},l))))))}}yd.defaultProps={canDrop:!1,draggedNode:null},yd.propTypes={children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),treeId:U().string.isRequired,drop:U().func.isRequired};const xd=yd,vd=(0,T.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"}}))),Ed=e=>{let{isOver:t,canDrop:r}=e;return vd(),c().createElement("div",{className:Fp("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};Ed.defaultProps={isOver:!1,canDrop:!1},Ed.propTypes={isOver:U().bool,canDrop:U().bool};const wd=Ed,Cd=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}},Od=Cd(od),Td=Cd(id),Sd=Cd(Xp);function kd(e){let{treeIndex:t}=e;return t}function Nd(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=>Nd(e))).join("")}function Id(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]?Nd(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Pd(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return Id("title",a,t,r,n)||Id("subtitle",a,t,r,n)}const Dd={defaultSearchMethod:Pd,defaultGetNodeKey:kd};var Ad=r(75047);class Rd{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,Ad.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=cd(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,N.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=Od({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,Sn.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,Sn.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,Sn.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 jd(){return jd=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},jd.apply(this,arguments)}function Zd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ld(e,t,r[t])}))}return e}function Ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let _d=1;const Md=e=>{const t=Zd({},e,{style:Zd({},e.theme.style,e.style),innerStyle:Zd({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Zd({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:fd,placeholderRenderer:wd,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:Gp};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class Vd extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:l}=Md(e);this.dndManager=new Rd(this),this.treeId=`rst__${_d}`,_d+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(xd),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(Bp._t||Bp.ZP)(Vp.aV),this.vStrength=(0,Bp.Kx)(l),this.hStrength=(0,Bp.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(){Vd.loadLazyChildren(this.props);const e=Vd.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,N.equals)(r.searchQuery,e.searchQuery)?r.searchFocusOffset!==e.searchFocusOffset&&Object.assign(n,Vd.search(e,t,!0,!0,!0)):Object.assign(n,Vd.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,N.equals)(this.props.treeData,e.treeData))this.state.draggingTreeData&&t.draggingTreeData!==this.state.draggingTreeData&&ed({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}=ad({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=nd({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Zd({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey})}catch(t){r=e}return r}),e)}}))}else if(this.props.treeData!==e.treeData){const t=(0,N.equals)(this.props.treeData,e.treeData),{ignoreOneTreeUpdate:r,instanceProps:n}=this.state,a={};t||(r?a.ignoreOneTreeUpdate=!1:(a.searchFocusTreeIndex=null,Vd.loadLazyChildren(this.props),Object.assign(a,Vd.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=Zd({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Td({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=nd({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Zd({},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}=od({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:p}=e,{instanceProps:d}=t;if(!s&&!c)return i&&i([]),{searchMatches:[]};const m={},{treeData:g,matches:h}=ud({getNodeKey:o,treeData:p?rd({treeData:d.treeData,expanded:!1}):d.treeData,searchQuery:s,searchMethod:c||Pd,searchFocusOffset:u,expandAllMatchPaths:n&&!a,expandFocusMatchPaths:!!n});n&&(m.ignoreOneTreeUpdate=!0,l(g)),i&&i(h);let f=null;return r&&null!==u&&u<h.length&&(f=h[u].treeIndex),m.searchMatches=h,m.searchFocusTreeIndex=f,m}startDrag(e){let{path:t}=e;this.setState((e=>{const{treeData:r,node:n,treeIndex:a}=ad({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=Od({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,N.pipe)((0,N.when)((0,N.always)((0,N.gt)(c.length,0)),(0,N.append)(c)),(0,N.uniqWith)((0,N.eqBy)(String)))(o);return{draggedNode:t,draggedDepth:r,draggedMinimumTreeIndex:n,draggingTreeData:nd({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Zd({},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=nd({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Zd({},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){ed({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(nd({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Zd({},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:p,path:d,lowerSiblingCounts:m,treeIndex:g}=e,{canDrag:h,generateNodeProps:f,scaffoldBlockPxWidth:b,searchFocusOffset:y,rowDirection:x}=Md(this.props),v=this.treeNodeRenderer,E=this.nodeContentRenderer,w=d[d.length-1],C=w in l,O=C&&l[w]===y,T={node:u,parentNode:p,path:d,lowerSiblingCounts:m,treeIndex:g,isSearchMatch:C,isSearchFocus:O},S=f?f(T):{},k="function"!=typeof h?h:h(T),N={treeIndex:g,scaffoldBlockPxWidth:b,node:u,path:d,treeId:this.treeId,rowDirection:x};return c().createElement(v,jd({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:o,swapLength:s,swapDepth:i},N),c().createElement(E,jd({parentNode:p,isSearchMatch:C,isSearchFocus:O,canDrag:k,toggleChildrenVisibility:this.toggleChildrenVisibility},N,S)))}render(){const{dragDropManager:e,style:t,className:r,innerStyle:n,rowHeight:a,isVirtualized:l,placeholderRenderer:o,reactVirtualizedListProps:i,getNodeKey:s,rowDirection:u}=Md(this.props),{searchMatches:p,searchFocusTreeIndex:d,draggedNode:m,draggedDepth:g,draggedMinimumTreeIndex:h}=this.state,f=this.state.draggingTreeData||this.props.treeData,b="rtl"===u?"rst__rtl":null;let y,x=null,v=null;if(m&&null!==h){const e=Od({treeData:f,newNode:m,depth:g,minimumTreeIndex:h,expandParent:!0,getNodeKey:s}),t=h;x=e.treeIndex,v=1+Sd({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),x,t,v)}else y=this.getRows(f);const E={};p.forEach(((e,t)=>{let{path:r}=e;E[r[r.length-1]]=t}));const w=null!==d?{scrollToIndex:d}:{};let C,O=t;if(y.length<1){const e=this.treePlaceholderRenderer,t=o;C=c().createElement(e,{treeId:this.treeId,drop:this.drop},c().createElement(t,null))}else if(l){O=Zd({height:"100%"},O);const t=this.scrollZoneVirtualList;C=c().createElement(Vp.qj,null,(r=>{let{height:l,width:o}=r;return c().createElement(t,jd({},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:E,swapFrom:x,swapDepth:g,swapLength:v})}},i))}))}else C=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:E,swapFrom:x,swapDepth:g,swapLength:v})));return c().createElement("div",{className:Fp("rst__tree",r,b),style:O},C)}}Vd.propTypes={classes:U().object,dragDropManager:U().shape({getMonitor:U().func}).isRequired,treeData:U().arrayOf(U().object).isRequired,style:U().shape({}),className:U().string,innerStyle:U().shape({}),rowHeight:U().oneOfType([U().number,U().func]),slideRegionSize:U().number,reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,maxDepth:U().number,searchMethod:U().func,searchQuery:U().any,searchFocusOffset:U().number,searchFinishCallback:U().func,generateNodeProps:U().func,isVirtualized:U().bool,treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func,theme:U().shape({style:U().shape({}),innerStyle:U().shape({}),reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,slideRegionSize:U().number,rowHeight:U().oneOfType([U().number,U().func]),treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func}),getNodeKey:U().func,onChange:U().func.isRequired,onMoveNode:U().func,canDrag:U().oneOfType([U().func,U().bool]),canDrop:U().func,canNodeHaveChildren:U().func,shouldCopyOnOutsideDrop:U().oneOfType([U().func,U().bool]),onVisibilityToggle:U().func,dndType:U().string,onDragStateChanged:U().func,onlyExpandSearchedNodes:U().bool,rowDirection:U().string,onLazyLoadChildren:U().func,ignoreTreeChanges:U().bool},Vd.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:kd,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,Up.polyfill)(Vd);const Bd=(0,zp.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"}})))(Vd),Ud=e=>c().createElement(Sn.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(Bd,jd({},e,{dragDropManager:r}))})),zd=e=>c().createElement(Sn.DndProvider,{backend:kn.default},c().createElement(Ud,e));var Fd=r(17822),Hd=r(31396);const Wd=(0,T.Z)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),qd=e=>"horizontal"===e,Gd=e=>{let{className:t,children:r,orientation:n,defaultSize:a,size:l,minSize:o,maxSize:i,allowResize:p,onChange:d}=e;const m=Wd(),g=(0,wc.Z)(),[h,f]=(0,s.useState)(),[y,x]=(0,s.useState)(!0),v=(0,s.useCallback)((()=>x(!0)),[]),E=(0,s.useCallback)((()=>x(!1)),[]),w=()=>qd(n)?null==h?void 0:h.clientHeight:null==h?void 0:h.clientWidth,C=(0,s.useCallback)((0,u.DsO)((e=>{const t=w();d({percentageSize:e/t*100+"%",isMaxSize:i>0?e===i:e===t+i,isMinSize:e===o})}),250),[d,n,i,h]),O=(0,s.useMemo)((()=>({transition:g.transitions.create(qd(n)?"height":"width",{easing:g.transitions.easing.sharp,duration:g.transitions.duration.leavingScreen})})),[n,g]);return"number"==typeof l&&l<0&&(l=(w()||0)+l),c().createElement("div",{ref:f,className:b()(m.container,t)},c().createElement(Hd.Z,{split:n,size:l,allowResize:p,onChange:C,defaultSize:a,minSize:o,maxSize:i,onDragStarted:E,onDragFinished:v,pane1Style:y?O:void 0},r))},$d=U().oneOfType([U().number,U().string]);Gd.propTypes={className:U().string,children:U().arrayOf(U().node).isRequired,orientation:U().oneOf(["horizontal","vertical"]).isRequired,defaultSize:$d,size:$d,minSize:$d,maxSize:$d,allowResize:U().bool,onChange:U().func};const Yd=Gd;var Kd=r(15311);function Xd(){return Xd=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},Xd.apply(this,arguments)}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 em=e=>{let{classes: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,["classes"]);const n=(0,Kd.y)({});return c().createElement(Vr.Z,Xd({classes:Qd({},t,{focused:n.white})},r))};var tm=r(72654);function rm(){return rm=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},rm.apply(this,arguments)}const nm=e=>{let{open:t,anchorEl:r,className:n,onClose:a,containerWidth:l,containerHeight:o,paperProps:i,listContent:s,externalInputField:u,classes:p={}}=e;const d=Mr({containerWidth:l,containerHeight:o});return c().createElement("div",{className:p.root},u,c().createElement(Ye.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(tm.Z,t,c().createElement(Ge.Z,rm({elevation:2},i),c().createElement("div",{className:b()(d.container,n),style:{width:l}},c().createElement("div",{className:d.list},s))))})))};nm.propTypes={open:U().bool,anchorEl:U().object,className:U().string,onClose:U().func,containerWidth:U().number,containerHeight:U().number,paperProps:U().object,listContent:U().element,externalInputField:U().element,classes:U().shape({root:U().string})},nm.defaultProps={popoverAnchorOrigin:{vertical:"top",horizontal:"right"}};const am=nm,lm=(0,T.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%"}}),om=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:l}=e;const o=lm(),[i,...u]=n,p=0===u.length;(0,s.useEffect)((()=>{p&&t!==i.value&&r(i.value)}),[i.value]);const d=!!l;return c().createElement("div",{className:a.root},p?c().createElement(E.Z,{className:a.onlyValue||o.onlyValue,variant:"h6"},i.label):c().createElement(Sc.Z,{displayEmpty:d,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:d?[{value:"",label:l},...n]:n,onChange:e=>r(e||null)}))};om.propTypes={value:U().string,onChange:U().func,options:U().arrayOf(U().shape({value:U().string,label:U().string})),classes:U().shape({root:U().string,onlyValue:U().string,select:U().string,selectMenu:U().string,textField:U().string}),emptyLabel:U().string};const im=om,sm=(0,T.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,rt.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 cm(){return cm=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},cm.apply(this,arguments)}const um=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:a}=e;const l=sm();return c().createElement("div",{className:b()(l.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 c().createElement(ye.k,cm({},n,{size:"S",key:t,className:b()({[l.active]:r===t},l.buttonWrapper),onClick:()=>a(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))};function pm(){return pm=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},pm.apply(this,arguments)}const dm=e=>c().createElement("svg",pm({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})))),mm=(0,T.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"}}))),gm=e=>{let{IconRenderer:t=dm,text:r,secondaryText:n}=e;const a=mm();return c().createElement("div",{className:a.root},c().createElement(t,{className:a.logo}),c().createElement("div",{className:a.textBox},c().createElement(E.Z,{className:a.text},r),n&&c().createElement(E.Z,{className:a.secondaryText},n)))},hm=(0,T.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})}}))),fm=e=>{let{width:t,open:r,children:n}=e;const a=hm();return c().createElement("div",{className:a.contentWrapper,style:{width:`${r?t:0}px`}},r&&c().createElement(c().Fragment,null,n))},bm=(0,T.Z)({container:{display:"flex",flexShrink:0,height:"63px",alignItems:"center",borderBottom:"1px solid rgba(0,0,0,0.12)"},icon:{margin:"0 20px"},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"19px 17px"},secondTitle:{fontSize:"14px"}}),ym=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:a,rightContent:l}=e;const o=bm();return c().createElement("div",{className:o.container},c().createElement(ye.k,{size:"S",icon:Wn.default,onClick:t,className:o.icon,tooltipTitle:x().text("Close")}),a||c().createElement(c().Fragment,null,c().createElement(E.Z,{variant:"h6"},r),c().createElement(Zr.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),c().createElement(E.Z,{variant:"body1",color:"textSecondary",className:o.secondTitle},n),l))};var xm=r(21210),vm=r(79935);const Em=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"}})};Em.propTypes={height:U().number,margin:U().number};const wm=Em,Cm=e=>{let{label:t}=e;return t||null},Om=e=>{let{value:t}=e;return t||null},Tm=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const l=e=>{const t=e.cellRenderer||Om,r=e.headCellRenderer||Cm;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)))};Tm.propTypes={rowsData:U().arrayOf(U().shape({id:U().string,label:U().string,headCellRenderer:U().func,cellRenderer:U().func})),columnsData:U().arrayOf(U().object),theadRowsNumber:U().number,className:U().string};const Sm=(0,s.memo)(Tm);var km=r(83543);const Nm=(0,T.Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}}))),Im=e=>{let{active:t,onClick:r,className:n}=e;const a=Nm();return c().createElement(he.Z,{className:b()(a.viewMoreLessLink,n),onClick:r,underline:"none"},c().createElement(km.Z,{className:b()(a.arrow,{[a.rotated]:t})}),t?x().text("View less"):x().text("View more"))};Im.propTypes={active:U().bool,onClick:U().func,className:U().string};const Pm=Im;var Dm=r(29611),Am=r(50581),Rm=r(21853);const jm=(0,T.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"}}),Zm=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=jm(),u=n&&n.length;return l?c().createElement(Dm.Z,{className:i.input,value:n,autoFocus:!0,placeholder:x().text("Search"),disableUnderline:!0,onChange:(0,N.pipe)(Cn.NA,a),startAdornment:c().createElement(Am.Z,{position:"start"},c().createElement(Rm.Z,{className:i.startAdornment})),endAdornment:c().createElement(Am.Z,{position:"end"},u&&c().createElement(_t.Z,{size:"S",icon:Wn.default,onClick:(0,N.pipe)(N.F,o,(0,N.always)(""),(0,N.tap)(r),a)})),onKeyPress:(0,N.when)((0,N.propEq)("key","Enter"),(0,N.pipe)((0,N.always)(n),N.trim,r))}):c().createElement(Xa.Z,{className:i.searchButton,onClick:(0,N.pipe)(N.T,o)},c().createElement(Rm.Z,null))};var Lm,_m=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(Lm||(Lm={}));const Mm=()=>{const[e,t]=(0,s.useState)(null),r=e===Lm.READING,n=e===Lm.EDITING,a=e===Lm.HOVERED;(0,s.useEffect)((()=>{t(Lm.READING)}),[]);const l=(0,s.useCallback)((0,u.DsO)(t,50),[]),o=(0,s.useCallback)((()=>{n||l(Lm.HOVERED)}),[l,n]),i=(0,s.useCallback)((()=>{n||l(Lm.READING)}),[l,n]);return{setReadingMode:(0,s.useCallback)((()=>t(Lm.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(Lm.EDITING)),[t]),onMouseLeave:i,onMouseEnter:o,isReadingMode:r,isEditingMode:n,isHovered:a}};const Vm=(0,s.createContext)(null),Bm=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(Vm.Provider,{value:r},t)},Um=e=>{const{getCrosswalkColor:t=(0,N.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(Vm)||{};return e?t(e):""},zm=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(Vm)||{};return e},Fm=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=Cn.ZT}=(0,s.useContext)(Vm)||{},n=!!e&&!!t.find((0,N.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])}},Hm=e=>{const{toggleCrosswalkFocus:t=Cn.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(Vm)||{};return{isFocused:!!e&&r.some((0,N.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var Wm=r(72753);const qm=(0,T.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"}}}),Gm=(0,T.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),$m=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:l,isFocused:o}=Hm(t),i=qm({color:r,isFocused:o}),s=(0,g.useSelector)(h.ZP.selectors.getMetadata),{label:p}=(0,u.PWK)(s,t.type);return c().createElement("div",{className:b()(i.sourceItem,n)},c().createElement(xm.Z,{className:i.sourceIcon,sourceType:t.type}),c().createElement("div",{className:i.sourceInfo},c().createElement("div",null,c().createElement("span",{className:i.label},p),a&&c().createElement(ye.k,{icon:Wm.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:x().text("Focus"),onClick:()=>l()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},Ym=(0,T.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 Km(){return Km=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},Km.apply(this,arguments)}const Xm=e=>{const t=Ym();return c().createElement(le.ZP,Km({},e,{classes:t,arrow:!0}))},Qm=e=>{let{crosswalk:t,className:r}=e;const n=Um(t),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Fm(t),i=qm({isOpaque:!a,color:n});return c().createElement(Xm,{title:c().createElement($m,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:b()(i.crosswalkIcon,r),onMouseEnter:()=>l(),onMouseLeave:()=>o()}))};var Jm=r(27604);const eg=(0,T.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 tg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rg=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],ng=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:l,onEdit:o}=e;const i=eg({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),p=(0,u.PFL)(t),d=sa(r,p),[m,g]=(0,s.useState)(d),h={className:i.textField,InputProps:{disableUnderline:!0,classes:{root:i.input,multiline:i.inputMultiline}}},f=()=>{const e=ca(t,m);if(!(0,N.isNil)(m)&&!(0,N.equals)(m,d)){const n=(0,u.CwH)(t)?{value:e.value,lookupCode:e.lookupCode}:{value:""===m&&(0,u.FVt)(p.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){tg(e,t,r[t])}))}return e}({},r,n))}l()};return c().createElement(_r.ZP,{open:!!a,anchorEl:a.current,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},classes:{paper:b()(i.paper,{[i.booleanEditor]:(0,u.T6Y)(p.type),[i.timestampEditor]:(0,u.j5n)(p.type)}),root:i.popoverRoot},onKeyUp:e=>{"Enter"!==e.key||rg.includes(p.type)?"Escape"===e.key&&l():f()},onBackdropClick:f},c().createElement(na.Z,{autoFocus:!0,dataTypeDefinition:p,fieldName:(0,u.Tde)(t.uri),onChange:g,TextFieldProps:h,value:m,fullWidth:!0}))};function ag(){return ag=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},ag.apply(this,arguments)}const lg=e=>c().createElement("svg",ag({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 og(){return og=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},og.apply(this,arguments)}const ig=e=>c().createElement("svg",og({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})),sg=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,icon:t?lg:ig,tooltipTitle:n?x().text("You don't have permissions to ignore"):x().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};function cg(){return cg=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},cg.apply(this,arguments)}const ug=e=>c().createElement("svg",cg({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 pg(){return pg=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},pg.apply(this,arguments)}const dg=e=>c().createElement("svg",pg({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})),mg=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?ug:dg,tooltipTitle:n?"You don't have permissions to pin":x().text("Pin"),size:"XS",disableRipple:!0})},gg=(0,T.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"}}))),hg=(0,lt.Z)(Va.Z),fg=e=>{let{styles:t,icon:r,text:n}=e;return c().createElement(c().Fragment,null,r,c().createElement(E.Z,{classes:{root:t.menuText}},n))},bg=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=gg(),{disabled:l,text:o,tooltip:i,onClick:s,id:u="",icon:p,crosswalk:d,color:m}=r;return d?c().createElement($m,{className:a.sourceItem,color:m,crosswalk:d,focusable:!0}):c().createElement(hg,{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(fg,{icon:p,text:o,styles:a}))}));bg.displayName="CrosswalkMenuItem";const yg=bg;function xg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vg=(0,T.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){xg(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"}}))),Eg=e=>{let{className:t,dataReltioId:r,attributeType:n=null,attributeValue:a,crosswalk:l,disableEdit:o,disableDelete:i,onIgnore:p,onEdit:d,onPin:m,onDelete:g}=e;const{isReadingMode:h,isEditingMode:f,isHovered:y,onMouseEnter:v,onMouseLeave:E,setReadingMode:w,setEditingMode:C}=Mm(),O=(0,s.useRef)(),T=(0,u.nIW)(a.uri),S=(0,u.x_)(l),k=!n.system&&!S,N=k&&!o&&(0,u.Z5t)(u.fO_.EDITING,n),I=k&&!i&&(0,u.Edd)(u.fO_.EDITING,n),P=(0,u.ZiX)(a.uri),D=!P&&(!h&&N||a.pin),A=!P&&(!h&&N||a.ignored),R=Um(l),{isHighlighted:j,isDimmed:Z,highlightCrosswalk:L,removeHighlight:_}=Fm(l),M=vg({variant:S?"outlined":"filled",opaque:!Z,fullyColored:j,color:R}),V=[{crosswalk:l,color:R},{disabled:!N,text:x().text("Edit"),icon:c().createElement(Jm.Z,null),tooltip:N?null:x().text("You don't have permissions to edit"),onClick:()=>C(),id:"edit"},{disabled:!I,text:x().text("Delete"),icon:c().createElement(ra.Z,null),tooltip:I?null:x().text("You don't have permissions to delete"),onClick:()=>g({attributeType:n,attributeValue:a,crosswalks:[l]}),id:"delete"}],B=()=>{_(),w()};return c().createElement("div",{ref:O,className:b()(t,M.root),onMouseEnter:()=>{L(),v()},onMouseLeave:()=>{_(),E()},"data-reltio-id":r},c().createElement("div",{className:M.attributeValue},c().createElement(at.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:M.actions},D&&c().createElement(mg,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!N}),A&&c().createElement(sg,{isIgnored:a.ignored,onClick:()=>p({attributeValue:a}),disabled:!N}),y&&c().createElement(be.Z,{MenuItemRenderer:yg,menuId:`simple-attribute-additional-actions-${T}`,buttonComponent:ye.k,buttonProps:{icon:fe.Z,size:"XS",tooltipTitle:x().text("More actions")},onMenuClose:B,menuItems:V})),f&&c().createElement(ng,{attributeType:n,attributeValue:a,color:R,onClose:B,onEdit:e=>d({attributeType:n,attributeValue:e,crosswalk:l}),containerRef:O}))},wg=(0,T.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 Cg(){return Cg=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},Cg.apply(this,arguments)}const Og=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=wg(),[{isDragItemOver:p},d]=(0,Sn.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:d,className:s.simpleAttributesWrapper},t.map((e=>{var t;return null===(t=l[e.uri])||void 0===t?void 0:t.map((t=>c().createElement(Eg,Cg({key:e.uri+t.uri,attributeType:r,attributeValue:e,crosswalk:t,disableEdit:a,dataReltioId:"value-index-"+m++},i))))})),p&&c().createElement("div",{className:s.dropIndicator},x().text("Drop here")))};function Tg(){return Tg=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},Tg.apply(this,arguments)}const Sg=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(Le.Z,{variant:"text",color:"primary",onClick:()=>a({parentUri:l,attributeType:n,index:0})},x().text("Create attribute")):c().createElement("div",{className:t},r.map((e=>c().createElement(Jg,Tg({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:o},i)))))},kg=e=>{let{children:t}=e;const r=Gm();return c().createElement(E.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},Ng=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));function Ig(){return Ig=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},Ig.apply(this,arguments)}const Pg=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=Ng(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,g.useSelector)(h.ZP.selectors.getUIPath),i=c().createElement(kg,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,N.pipe)(u.tF$,(0,N.map)((e=>(0,u.zeJ)(l,e))),(0,N.reject)(N.isNil))(r);return c().createElement(Xg,Ig({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},n))};function Dg(){return Dg=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},Dg.apply(this,arguments)}const Ag=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(Pg,Dg({key:e.uri,attributeValue:e},n)))))},Rg=(0,T.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function jg(){return jg=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},jg.apply(this,arguments)}const Zg={imageWidth:55,imageHeight:45},Lg=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=Rg();return c().createElement(Xg,jg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(Er,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Zg})},n))};function _g(){return _g=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},_g.apply(this,arguments)}const Mg=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(Lg,_g({key:e.uri,attributeValue:e},n)))))},Vg=(0,T.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));function Bg(){return Bg=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},Bg.apply(this,arguments)}function Ug(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 zg=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:l}=e,o=Ug(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=Vg(),[p,d]=(0,s.useState)(a),m=(0,N.propOr)(r.length,"totalValues",n),g=a<m,h=g&&p<m,f=g&&p>=m,b=r.slice(0,p),y=m-p;return c().createElement("div",{className:i.wrapper},(e=>{switch(t.type){case u.oS0.TYPE_NESTED:return c().createElement(Sg,Bg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=o,n=Ug(o,["crosswalksMap"]);return c().createElement(Ag,Bg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(Mg,Bg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));default:return c().createElement(Og,Bg({attributeValues:e,attributeType:t},o))}})(b),h&&c().createElement(sr,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&l(),d(p+a)}}),f&&c().createElement(ur,{onClick:()=>{d(a)}}))},Fg=(0,T.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function Hg(){return Hg=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},Hg.apply(this,arguments)}const Wg=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=Fg();return c().createElement(c().Fragment,null,t.filter(u.Uty).map((e=>c().createElement(D,{key:e.uri,enabled:!0},c().createElement(Q,{className:a.title,label:e.label,attributeType:e}),c().createElement(zg,Hg({attributeType:e,attributeValues:r[e.name],paging:(0,N.path)(["paging",e.uri],r)},n))))))},qg=e=>{let{onClick:t}=e;return c().createElement(ye.k,{icon:ra.Z,tooltipTitle:x().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},Gg=(0,s.createContext)(null),$g=e=>{let{children:t,attributeUris:r}=e;return c().createElement(Gg.Provider,{value:r},t)},Yg=e=>((0,s.useContext)(Gg)||[]).some((t=>(0,u.sOy)(t,e))),Kg=(0,T.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"}}}))),Xg=e=>{let{attributeType:t,attributeValue:r,attributeTypesList:n,label:a,crosswalksMap:l,disableEdit:o,disableDelete:i,onPin:p,onIgnore:d,onDelete:m,onEdit:g,onAdd:h}=e;const f=Kg(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:x}=Mm(),v=!o&&(0,u.Z5t)(u.fO_.EDITING,t),E=!i&&(0,u.Edd)(u.fO_.EDITING,t),w=(0,u.ZiX)(r.uri),C=!w&&(!b&&v||r.pin),O=!w&&(!b&&v||r.ignored),T=!b&&E,S=Yg(r.uri),[k,I]=(0,s.useState)(S||w);(0,te.D)((()=>{S&&I(S)}),[S]);const P=(0,N.pipe)((0,N.pickBy)(((e,t)=>(0,u.sOy)(t,null==r?void 0:r.uri))),N.values,N.flatten,(0,N.uniqBy)((0,N.prop)("uri")))(l);return c().createElement(c().Fragment,null,c().createElement("div",{className:f.root,onMouseEnter:y,onMouseLeave:x},c().createElement(Ut,{onClick:()=>I((e=>!e)),expanded:k}),c().createElement("span",null,a,P.map((e=>c().createElement(Qm,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(vm.Z,null),c().createElement("div",{className:f.actions},C&&c().createElement(mg,{disabled:!v,isPinned:r.pin,onClick:()=>p({attributeValue:r})}),O&&c().createElement(sg,{disabled:!v,isIgnored:r.ignored,onClick:()=>d({attributeValue:r})}),T&&c().createElement(qg,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:l[r.uri]})}))),k&&c().createElement(Wg,{attributeTypes:n,attributes:r.value,parentUri:r.uri,crosswalksMap:l,disableEdit:!v,disableDelete:!E,onPin:p,onIgnore:d,onDelete:m,onEdit:g,onAdd:h}))};function Qg(){return Qg=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},Qg.apply(this,arguments)}const Jg=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(kg,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(Xg,Qg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var eh=r(33286),th=r(49429),rh=r(55999),nh=r(79249);const ah=(0,T.Z)({paper:{minHeight:"180px"},title:{padding:"16px 16px 10px 16px",fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px"},content:{padding:"0 16px"},contentText:{marginBottom:0,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px"},actionButtons:{display:"flex",paddingTop:"4px",fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px","& > div":{marginLeft:"auto"}},discardButton:{marginRight:"8px"}}),lh=e=>{let{open:t,title:r,content:n,onCancel:a,cancelCaption:l=x().text("Cancel"),onDiscard:o,discardCaption:i="",onSave:s,saveCaption:u=x().text("Save"),disabledSave:p=!1}=e;const d=ah();return c().createElement(Nn.Z,{open:t,onClose:a,classes:{paperScrollPaper:d.paper}},c().createElement(nh.Z,{classes:{root:d.title}},r),c().createElement(mo.Z,{classes:{root:d.content}},c().createElement(rh.Z,{classes:{root:d.contentText}},n)),c().createElement(th.Z,{className:d.actionButtons,disableSpacing:!0},a&&c().createElement(Le.Z,{onClick:a},l),c().createElement("div",null,o&&c().createElement(Le.Z,{onClick:o,classes:{root:d.discardButton}},i),c().createElement(Le.Z,{onClick:s,color:"primary",disabled:p,autoFocus:!0},u))))},oh=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(Nn.Z,{open:t},c().createElement(mo.Z,null,c().createElement(rh.Z,null,x().text("Are you sure you want to delete this?"))),c().createElement(th.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("No")),c().createElement(Le.Z,{onClick:()=>{n(),r()},color:"primary"},x().text("Yes"))))};var ih=r(92332);const sh=(0,T.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}}))),ch=e=>{const t=sh();return c().createElement("div",{className:b()(t.headCell,t.coloredCell)},c().createElement(ih.default,e),e.children)},uh=(0,T.Z)({root:{marginBottom:"-6px"}}),ph=(0,Di.Z)((0,N.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:l}=e;const o=uh(),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),s=[...i.entityTypes,...i.relationTypes||[]].find((0,N.propEq)("uri",t)),p=e=>!(null!=n&&n.find((0,N.propEq)("uri",e.uri))),d=(0,N.pipe)((0,N.propOr)([],"attributes"),(0,N.reject)((0,N.either)(u.YkG,u.Or$)),(0,N.filter)((0,N.either)(u.QZu,p)),(0,N.filter)((0,N.both)(u.Uty,(e=>(0,u.Vg3)({attributeType:e,mode:u.fO_.EDITING})))))(s);return c().createElement("div",{className:o.root},c().createElement(en,{label:x().text("Attribute"),popupTitle:x().text("Add attributes"),data:d,onApply:e=>{const t=e.filter(p);t.length>0&&a([...t,...n]),e.filter(u.QZu).forEach((e=>{l({attributeType:e,parentUri:r})}))}}))}));const dh=(0,Di.Z)((0,N.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(ch,r):c().createElement(ch,r,c().createElement(vm.Z,null),c().createElement(ph,null))})),mh=e=>{let{value:t}=e;const r=sh();return c().createElement("div",{className:r.cellValueWrapper},t)},gh=(0,T.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function hh(){return hh=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},hh.apply(this,arguments)}const fh=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=gh();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(zg,hh({attributeValues:t},r)))};function bh(){return bh=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},bh.apply(this,arguments)}const yh=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=gh(),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(Jg,bh({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function xh(){return xh=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},xh.apply(this,arguments)}const vh=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=gh(),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(Pg,xh({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,l)};function Eh(){return Eh=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},Eh.apply(this,arguments)}const wh=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=gh();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(Lg,Eh({attributeValue:e},r))))))};function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oh=(0,Di.Z)((0,N.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(yh,t);case u.oS0.TYPE_REFERENCE:return c().createElement(vh,t);case u.oS0.TYPE_IMAGE:return c().createElement(wh,t);default:return c().createElement(fh,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){Ch(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,disableEdit:s,disableDelete:s}))})),Th=e=>{let{value:{values:t,attributeType:r}}=e;const n=sh();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(Q,{className:n.attributeTitle,label:r.label,attributeType:r}),c().createElement(ki,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},Sh=e=>{let{value:t}=e;const r=sh();return c().createElement("div",{className:b()(r.cellValueWrapper,r.count)},t)};var kh=r(11776),Nh=r(38402),Ih=r(49378),Ph=r(99144);const Dh=e=>{let{sourcesUriOrder:t}=e;const r=sh(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Nh.Z,{key:e,className:r.popupItem},c().createElement(xm.Z,{className:r.sourceIcon,sourceType:e}),c().createElement(Ih.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Ah=e=>{let{attributeUri:t}=e;const r=sh(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Nh.Z,{key:a.uri,className:r.popupItem},c().createElement(Ih.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},Rh=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),()=>x().text("Source sequence")],[(0,N.prop)("primaryAttributeUri"),()=>x().text("Attribute winner")],[(0,N.prop)("comparisonAttributeUri"),()=>x().text("Comparison attribute")]]),jh=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(Dh,{sourcesUriOrder:t})}],[(0,N.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}],[(0,N.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}]]),Zh=e=>{let{info:t}=e;const r=sh(),[n,a]=(0,s.useState)(null),l=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(ye.k,{icon:Ph.Z,tooltipTitle:x().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(_r.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(Xa.Z,{className:r.closeButton,onClick:l},c().createElement(Wn.default,null)),c().createElement(E.Z,{variant:"subtitle1",className:r.popupTitle},Rh(t))),c().createElement(kh.Z,{component:"div",className:r.popupItemsWrapper},jh(t))))},Lh=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const l=sh(),o=r||n||a;return c().createElement("div",{className:b()(l.cellValueWrapper,l.ruleType)},c().createElement("div",{className:l.ruleTypeLabel},t.label),o&&c().createElement(Zh,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function _h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mh=(0,T.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){_h(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 Vh(){return Vh=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},Vh.apply(this,arguments)}const Bh=(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=Mh({color:r,opacity:n,variant:a});return c().createElement("div",Vh({ref:t,className:b()(s.item,o)},i),l)})),Uh=e=>{let{crosswalk:t}=e;const r=sh(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Fm(t);return c().createElement(Bh,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>l(),onMouseLeave:()=>o()},c().createElement(xm.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(Ih.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},zh=e=>{let{value:{crosswalks:t}}=e;const r=sh();return c().createElement(kh.Z,{component:"div"},t.map((e=>c().createElement(Nh.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(Uh,{crosswalk:e})))))},Fh=[{id:"ovValues",get label(){return x().text("Attributes & OV")},hideable:!1,initialWidth:360,minWidth:250},{id:"winnerSources",get label(){return x().text("Winner source systems")},initialWidth:220},{id:"ruleType",get label(){return x().text("Rule type")},initialWidth:200},{id:"count",get label(){return x().text("Count")},initialWidth:80,minWidth:80},{id:"values",get label(){return x().text("Attribute values")},hideable:!1}],Hh=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),Wh=["ovValues","ruleType","values"],qh=e=>{switch(e){case"ovValues":return Th;case"values":return Oh;case"count":return Sh;case"ruleType":return Lh;case"winnerSources":return zh;default:return mh}},Gh=(0,N.pipe)(u.cwx,(0,N.sortWith)([(0,N.descend)((0,N.propOr)(-1,"priority"))]),(0,N.map)((0,N.prop)("uri"))),$h=(0,N.curry)(((e,t)=>(0,u.YkG)(e)&&t&&(0,N.pipe)(u.c31,(0,N.find)((r=>r.slice((0,u.u5q)(r).length)===t.slice(e.uri.length))))(e)||t)),Yh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return(0,N.pipe)((0,N.filter)(Hh),(0,N.chain)((e=>(0,N.pipe)((0,N.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||Hh(l))})),N.values,N.flatten)(t))),(0,N.uniqBy)((0,N.prop)("uri")))(e)},Kh=(0,N.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?dh:ch,rowCellValueRenderer:qh(t)}})),Xh=(e,t,r,n,a,l)=>{switch(e){case"ovValues":return{attributeType:n,values:null==l?void 0:l.filter(Hh)};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,N.propEq)("uri",r)),o=null==l||null===(n=l.survivorshipGroups)||void 0===n?void 0:n.find((0,N.propEq)("default",!0)),i=null==o||null===(a=o.mapping)||void 0===a?void 0:a.find((0,N.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,N.uniq)([...(null==i?void 0:i.sourcesUriOrder)||[],...(null==o?void 0:o.sourcesUriOrder)||[],...Gh(e)]):void 0,p=$h(t),d=(e=>"configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk"===(null==e?void 0:e.uri))(s)?p(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)?p(null==i?void 0:i.comparisonAttributeUri):void 0;return{ruleType:s,sourcesUriOrder:c,primaryAttributeUri:d,comparisonAttributeUri:m}})(t,n,r);case"winnerSources":return{crosswalks:Yh(l,a)};default:return null}};function Qh(){return Qh=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},Qh.apply(this,arguments)}const Jh=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=sh(),i=0===n;return c().createElement("div",{className:b()(o.rowCell,i&&o.coloredCell),"data-reltio-id":`column-name-${a.id}`},t.values.map(((e,t)=>c().createElement(r,Qh({key:t,value:e},l)))))};var ef=r(44962),tf=r(2682),rf=r(84899);const nf=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[l,o]=(0,s.useState)("without");return c().createElement(Nn.Z,{open:t,onEnter:()=>o("without")},c().createElement(mo.Z,null,c().createElement(rh.Z,null,x().text("You are attempting to change a value that is presently ignored.")),c().createElement(aa.Z,{component:"fieldset"},c().createElement(rf.Z,{component:"legend"},x().text("Please choose an option:")),c().createElement(tf.Z,{value:l,onChange:(0,N.pipe)(Cn.NA,o)},c().createElement(Ar.Z,{value:"without",control:c().createElement(ef.Z,null),label:x().text("Save without Ignore")}),c().createElement(Ar.Z,{value:"with",control:c().createElement(ef.Z,null),label:x().text("Save and apply Ignore to new value")})))),c().createElement(th.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("Cancel")),c().createElement(Le.Z,{onClick:()=>{"with"===l?a():n(),r()},color:"primary"},x().text("Ok"))))},af=(0,T.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 lf(){return lf=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},lf.apply(this,arguments)}const of=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=Wh,onChangeVisibleColumns:l,readOnly:o,onDelete:i=Cn.ZT,onPin:p=Cn.ZT,onIgnore:d=Cn.ZT,onEdit:m=Cn.ZT,onAdd:f=Cn.ZT,selectedAttributeTypes:b,onSelectAttributeTypes:y=Cn.ZT}=e;const v=af(),E=(0,s.useMemo)((()=>(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return a.includes(t)})),Kh)(Fh)),[a]),{type:w,uri:C,attributes:T={}}=t||{},S=(0,g.useSelector)(h.ZP.selectors.getMetadata);(0,s.useEffect)((()=>{if(t&&(0,N.isNil)(b)){const e=(0,N.pipe)(N.keys,(0,N.without)(["paging"]),(0,N.map)((0,u.tCm)(w)),(0,N.map)((e=>(0,u.zeJ)(S,e,w))),(0,N.filter)(u.Uty))(T);y(e)}}),[t,b]);const k=(0,s.useMemo)((()=>w?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,N.pipe)((0,N.reduce)(((r,n)=>(0,N.assoc)(n,Xh(n,e,t,l,s,i),r)),{}),(0,N.assoc)("rawValue",i))(r)}))}(S,w,b,a,n,T):[]),[S,w,b,a,T,n]),{getDynamicRowCellHeight:I,changeRowCellHeight:P}=Rs(),D=(0,s.useCallback)((e=>c().createElement(Ts,lf({onChangeHeight:P},e),c().createElement(Jh,e))),[P]),A=(0,s.useCallback)((0,N.either)(I,(0,N.always)(68)),[I]),[R,j]=(0,s.useState)(null),[Z,L]=(0,s.useState)(null),_=(0,s.useCallback)((e=>{e.attributeValue.ignored?L(e):m(e)}),[m,L]),M=(0,s.useMemo)((()=>({onDelete:j,onPin:p,onIgnore:d,onEdit:_,onAdd:f,parentUri:C,parentTypeUri:w,selectedAttributeTypes:b,onSelectAttributeTypes:y,readOnly:o})),[j,p,d,_,f,C,w,b,y,o]);return c().createElement("div",{className:v.tableContainer},c().createElement(O.Z,{classes:{root:v.tableHeader},title:x().text("Sources")},c().createElement(ts,{columnsData:Fh,selectedColumns:a,onChangeColumns:l})),c().createElement("div",{className:v.tableContent},r&&c().createElement(Dn,null),c().createElement(Pi.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:E,rowsData:k,renderRowCell:D,getRowCellHeight:A,context:M})),c().createElement(oh,{open:!!R,onClose:()=>j(null),onConfirm:()=>i(R)}),c().createElement(nf,{open:!!Z,onClose:()=>L(null),onConfirmEditWithIgnore:()=>m(Z),onConfirmEditWithoutIgnore:()=>{d({attributeValue:Z.attributeValue}),m(Z)}}))}));function sf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cf(e,t,r[t])}))}return e}function cf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uf=[],pf=e=>{let{entity:t,onLoad:r=Cn.ZT,onModify:n=Cn.ZT,onError:a=Cn.ZT}=e;const[l,o]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),p=(0,s.useRef)([]),d=(0,s.useRef)(null),m=(0,s.useCallback)((()=>{d.current=null}),[]),[g,h]=(0,s.useState)(uf),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,N.pipe)(u.HQx,f)(t)};if((null==l?void 0:l.uri)===(null==t?void 0:t.uri)&&d.current){const{ownerType:t}=d.current,r=Object.keys(e[t]),n=Object.keys(i[t]);h((0,N.difference)(r,n))}else h(uf);m(),o(t),c(e),p.current=[]}),[t]);const b=(0,s.useCallback)((0,N.pipe)(a,m),[a,m]),{deleteAttribute:y,ignoreAttribute:x,pinAttribute:v,createAttribute:E,updateAttribute:w}=(e=>{let{onSuccess:t=Cn.ZT,onError:r=Cn.ZT,onLoad:n=Cn.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,N.pipe)(u.o96,(0,N.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,N.pipe)(u.xkv,l,a)({attributeUri:t.uri,value:!t.pin})}),[a,l]),ignoreAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,N.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,N.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,N.pipe)(u.JV_,(0,N.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}),C=(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=>sf({},t,{[e]:sf({},t[e],{[i]:[n]})})))}o((e=>{var n;return(0,N.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})})),p.current.some((e=>(0,u.sOy)(i,e)))||p.current.push(i)}),[]),O=(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,N.evolve)({entity:(0,N.dissoc)(t),relation:(0,N.dissoc)(t)})),p.current=(0,N.without)([t],p.current)):y(e)}),[y]),T=(0,s.useCallback)((e=>{if((0,u.ZiX)(e.attributeValue.uri)){const{attributeValue:t,attributeType:r,crosswalk:n}=e;if(!(0,N.isNil)(t.value)){const{uri:e}=t,a=p.current.find((t=>(0,u.sOy)(e,t))),o=(0,u.ww$)({entity:l,attributeType:r,uri:e,value:(0,u.kDl)(t)});E({attributeValue:(0,u.dLR)(o,a),crosswalk:n}),d.current=n}}else w(e)}),[E,w,l]);return{modifiedEntity:l,crosswalksMap:i,onAddAttribute:C,onDeleteAttribute:O,onPinAttribute:v,onIgnoreAttribute:x,onEditAttribute:T,newlyCreatedAttributes:g}},df=e=>{let{onLoad:t=Cn.ZT,onSuccess:r=Cn.ZT,onError:n=Cn.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,N.pipe)((0,N.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,N.pipe)((0,N.ifElse)((e=>{let{value:t}=e;return(0,N.isNil)(t)}),u.K$w,u.WVU),(0,N.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,N.pipe)(u.Gmt,a)({entityUri:t,crosswalkId:r})}),[a])}},mf=(0,T.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"}}),gf=e=>{let{crosswalk:t}=e;const r=mf(),n=Um(t),a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,u.tH7)(a,t.type);return c().createElement(Bh,{color:n,className:r.crosswalkPreview},c().createElement(xm.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(E.Z,{className:r.sourceLabel,variant:"body2"},l))},hf=(0,s.memo)((()=>{var e;const t=mf(),{isDragging:r,clientOffset:n,item:a}=(0,Sn.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(gf,{crosswalk:a.crosswalk})))}));let ff;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(ff||(ff={}));const bf=(0,T.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"}}))),yf=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Fm(),a=bf({isOpaque:!n}),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,u.tH7)(l,t);return c().createElement("div",{className:a.root},c().createElement(_t.Z,{size:"XXS",className:a.focusedIcon,icon:r&&Wm.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(xm.Z,{className:a.sourceIcon,sourceType:t}),c().createElement(E.Z,{variant:"body2"},o)))}));var xf=r(19540),vf=r(42484);function Ef(){return Ef=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},Ef.apply(this,arguments)}const wf=e=>c().createElement("svg",Ef({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"}))),Cf=(0,T.Z)((()=>({root:{display:"flex",justifyContent:"space-between",alignItems:"center",overflowWrap:"anywhere"},text:{fontSize:13},button:{flexShrink:0,marginLeft:8,padding:0,textTransform:"none"}}))),Of=e=>{let{value:t}=e;const r=Cf();return c().createElement("div",{className:r.root},c().createElement(E.Z,{className:r.text,variant:"body2"},t),c().createElement(_t.Z,{size:"XXS",icon:wf,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},Tf=(0,T.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),Sf=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const l=Tf(),[o,i]=(0,s.useState)(!1),u=e=>a(e.valueOf());return c().createElement(Ac.Z,{variant:"filled",value:t?new Date(t):null,disabled:n,onChange:(0,N.unless)((0,N.always)(o),u),onAccept:u,onOpen:()=>i(!0),onClose:()=>i(!1),InputProps:{disableUnderline:!0,classes:{input:l.timestampEditorInput,root:b()(l.timestampEditor,r.root)}}})},kf=(0,T.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"}}))),Nf=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const l=kf(),o=!("uri"in t),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(null),b=(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"}]),[]),y=(0,N.pipe)((0,N.filter)((0,N.propEq)("canBeAdded",!0)),(0,N.filter)((e=>!(0,N.has)(e.uri,t))),(0,N.filter)((e=>!p.includes(e.uri))))(b);return c().createElement(c().Fragment,null,y.length>0&&r&&c().createElement(en,{label:x().text("Add attributes"),onApply:e=>{e.length>0&&d((t=>t.concat((0,N.map)((0,N.prop)("uri"),e))))},data:y}),b.map((e=>e.uri in t||p.includes(e.uri)?c().createElement("div",{key:e.uri,className:l.attributeWrapper},c().createElement(E.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(Ml.Z,{label:"",placeholder:t,className:l.editor,value:{value:t,label:r},options:(0,u.cwx)(i).sort((0,N.ascend)((0,N.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(xm.Z,{className:l.sourceIcon,sourceType:t}),c().createElement(E.Z,{className:l.text,variant:"body2"},r))}case"sourceTable":return o?c().createElement(kc.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(E.Z,{className:l.text,variant:"body2"},t);case"value":return o?c().createElement(kc.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(Of,{value:t});case"deleteDate":return c().createElement(Sf,{value:t&&rn().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(E.Z,{className:l.text,variant:"body2"},(0,u.o0x)(t));default:return null}})(e.uri,t[e.uri]),e.canBeDeleted&&c().createElement(ye.k,{icon:ra.Z,disabled:!r,onClick:()=>f(e.uri),size:"XS",tooltipTitle:x().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(oh,{open:!!m,onClose:()=>f(null),onConfirm:()=>{return e=m,d((t=>(0,N.without)([e],t))),void((0,N.isNil)(t[e])||a(e));var e}}))},If=(0,T.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}}),Pf=(0,s.memo)((e=>{let{crosswalk:t,isDependent:r,isEmpty:n=!1,isColored:a=!0,focusable:l=!0,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d}=e;const m=(0,s.useRef)(null),f=Um(t),{toggleCrosswalkFocus:b,isFocused:y}=Hm(t),v=n?"#FFF":a?f:"#CACCD1",{isDimmed:w,highlightCrosswalk:C,removeHighlight:O}=Fm(t),[T]=zm(),S=If({color:v,isOpaque:!w,isFocused:y}),[k,N]=(0,s.useState)(!1),[I,P]=(0,s.useState)(!1),D=(0,g.useSelector)(h.ZP.selectors.getMetadata),A=(0,u.tH7)(D,t.type),R=(0,u.nIW)(t.uri),j=(0,u.x_)(t),[,Z,L]=(0,Sn.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!j}),_=!j&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{L((0,vf.r)(),{captureDraggingState:!0})}),[]),(0,s.useEffect)((()=>{var e;l&&T&&(0,u.aFF)(T,t)&&T!==t&&(null==m||null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[T]),c().createElement("div",{className:S.root,ref:m},c().createElement(ye.k,{size:"XXS",className:S.focusedIcon,icon:l&&Wm.Z,onClick:()=>b(),disabled:!l,tooltipTitle:l&&x().text("Focus")}),c().createElement("div",{className:S.crosswalkWrapper},c().createElement(Bh,{ref:Z,className:S.header,color:v,variant:j?"outlined":"filled",onMouseEnter:()=>C(),onMouseLeave:()=>O()},r&&c().createElement(xf.Z,{className:S.dependentIcon}),c().createElement(Ut,{onClick:()=>N((e=>!e)),expanded:k}),c().createElement(xm.Z,{className:S.sourceIcon,sourceType:t.type}),c().createElement(mi.C,{value:A},c().createElement(E.Z,{variant:"body2",noWrap:!0},A)),c().createElement(vm.Z,null),c().createElement(mi.C,{value:t.value},c().createElement(E.Z,{variant:"body2",className:S.labelValue,noWrap:!0},t.value))),k&&c().createElement("div",{className:S.attributesWrapper},_&&c().createElement("div",{className:S.deleteCrosswalkButton},c().createElement(ye.k,{icon:ra.Z,disabled:i,onClick:()=>P(!0),size:"XS",tooltipTitle:i?x().text("You don't have permissions to delete"):x().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(oh,{open:I,onConfirm:()=>{y&&b(),p(R)},onClose:()=>P(!1)})),c().createElement(Nf,{crosswalk:t,canEditAttribute:!o,onEditAttribute:(e,t)=>{d({crosswalkId:R,attributeName:e,value:t})},onDeleteAttribute:e=>{d({crosswalkId:R,attributeName:e})}}))))})),Df=(0,T.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Af=e=>{let{showMore:t,onClick:r}=e;const n=Df();return c().createElement(he.Z,{className:n.root,component:"button",variant:"caption",underline:"none",onClick:r},c().createElement("span",null,t?x().text("View dependent crosswalks"):x().text("Hide dependent crosswalks")))},Rf=e=>{let{source:t,crosswalksByTypes:r,showCrosswalkColors:n=!0,crosswalksFocusEnabled:a=!0,expanded:l,disableEditCrosswalk:o,disableDeleteCrosswalk:i,onEdit:p,onDelete:d,onToggleExpanded:m}=e;const g=zm();return(0,s.useEffect)((()=>{!l&&a&&r[ff.Dependent].some((e=>g.some((0,u.aFF)(e))))&&m()}),[g]),c().createElement(c().Fragment,null,0===r[ff.Simple].length&&0===r[ff.Empty].length&&c().createElement(yf,{crosswalkType:t,focusable:a}),r[ff.Simple].map((e=>c().createElement(Pf,{key:e.uri,crosswalk:e,focusable:a,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),r[ff.Empty].map((e=>c().createElement(Pf,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),l&&r[ff.Dependent].map((e=>c().createElement(Pf,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,focusable:a,isColored:n}))),r[ff.Dependent].length>0&&c().createElement(Af,{showMore:!l,onClick:()=>m()}))},jf=(0,T.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),Zf=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=jf(),[l,o]=(0,s.useState)({type:"",value:""});return c().createElement("div",{className:t},c().createElement(E.Z,{variant:"body1",className:a.caption},x().text("Add crosswalk")),c().createElement(Nf,{crosswalk:l,onDeleteAttribute:e=>{o((0,N.dissoc)(e))},onEditAttribute:(e,t)=>{o((0,N.assoc)(e,t))}}),c().createElement("div",{className:a.controlButtons},c().createElement(Le.Z,{className:a.cancelButton,onClick:n},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{r(l),n()},disabled:!l.type||!l.value},x().text("Add"))))},Lf=e=>e[ff.Simple].length>0?1:e[ff.Dependent].length>0?e[ff.Empty].length>0?2:3:4,_f=(0,N.evolve)({[ff.Dependent]:(0,N.sort)(((e,t)=>{const r=e.sourceTable||"",n=t.sourceTable||"";return r===n?0:r?n?r<n?-1:1:-1:1}))}),Mf=(0,N.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[ff.Simple]:[],[ff.Empty]:[],[ff.Dependent]:[]}),"relation"===n.ownerType?r[n.type][ff.Dependent].push(n):((e,t,r)=>0===(0,u.sJj)(r).filter((r=>{const n=(0,u.AFK)(r,e);return t.some((0,N.propEq)("uri",n))})).length)(e,t,n)?r[n.type][ff.Empty].push(n):((e,t,r)=>!(0,u.sJj)(r).some((r=>{const n=(0,u.AFK)(r,e),a=t.find((0,N.propEq)("uri",n));return a&&!(0,u.YkM)(a)})))(e,t,n)?r[n.type][ff.Dependent].push(n):r[n.type][ff.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>Lf(n[e])-Lf(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:_f(n[e])})))}));var Vf=r(17871);const Bf=e=>{let{children:t,className:r,position:n,map:a}=e;const[l,o]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=document.createElement("div"),t=a.controls[n].length;return a.controls[n].push(e),o(e),()=>{a.controls[n].removeAt(t)}}),[a,n]),(0,s.useEffect)((()=>{l&&r&&l.classList.add(r)}),[r,l]),l?(0,Ad.createPortal)(t,l):null};var Uf=r(41039);const zf="circle",Ff="polygon",Hf=.001;function Wf(){return Wf=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},Wf.apply(this,arguments)}const qf=e=>c().createElement("svg",Wf({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function Gf(){return Gf=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},Gf.apply(this,arguments)}const $f=e=>c().createElement("svg",Gf({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:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Draw_svg__a"})),c().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},c().createElement("path",{d:"M0 0h24v24H0z"})))),Yf=(0,T.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),Kf=(0,lt.Z)(Le.Z),Xf=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:l}=e;const o=Yf(),i=e=>()=>{a(e)};return c().createElement("div",{className:o.container},t||n?c().createElement(Kf,{tooltipTitle:x().text("Clear area"),className:o.button,onClick:n?l:i(null)},c().createElement(Uf.Z,{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case zf:return qf;case Ff:return $f;default:return null}})(e);return c().createElement(Kf,{tooltipTitle:x().text("Draw area"),key:e,className:o.button,onClick:i(e)},c().createElement(t,{className:o.icon}))})))},Qf=(0,T.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",padding:"5px","& svg":{width:"16px",height:"16px"}}}),Jf=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=Qf();return c().createElement(Ar.Z,{classes:{root:n.container,label:n.label},control:c().createElement(Dr.Z,{checked:t,onChange:e=>{r(e.target.checked)},color:"primary",className:n.checkbox}),label:x().text("Search as I move the map")})},eb=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),l=r.lng(),o=n.lat(),i=n.lng(),s=[],c=[];if(!(180===l&&-180===i||-180===l&&180===i)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,l],...s,[a,i],[o,i],...c,[o,l]]},tb=e=>{switch(e){case zf:return window.google.maps.drawing.OverlayType.CIRCLE;case Ff:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},rb=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}},nb=c().createContext({});nb.displayName="EntityMarkerContext";const ab=(0,T.Z)({popper:{maxWidth:"263px",minWidth:"150px",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)",backgroundColor:"white",borderRadius:"2px"}});function lb(){return lb=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},lb.apply(this,arguments)}const ob=(0,u.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),ib=(0,u.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),sb=(0,s.memo)((e=>{let{marker:t,onClick: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,["marker","onClick"]);const a=ab(),l=(0,s.useRef)(),[o,i]=(0,s.useState)(!1),{activeEntityUri:p}=(0,s.useContext)(nb),d=(0,N.pathEq)(["entity","uri"],p,t),m={lat:t.point.lat,lng:t.point.lng},g=(0,s.useCallback)((0,u.DsO)(i,50),[]),h=(0,s.useCallback)((()=>g(!0)),[g]),f=(0,s.useCallback)((()=>g(!1)),[g]),b=(0,s.useCallback)((()=>r(t)),[r,t]);return c().createElement(c().Fragment,null,c().createElement(Ye.Z,{anchorEl:l.current,open:o,className:a.popper,modal:!1,placement:"top"},c().createElement(Cp,{entity:t.entity,onMouseOver:h,onMouseOut:f})),c().createElement(Vf.Jx,lb({icon:{url:o||d?ob:ib,scaledSize:new google.maps.Size(22,32)},position:m,onClick:b,visible:!1!==t.visible,onMouseOver:h,onMouseOut:f},n)),c().createElement(Vf.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:m},c().createElement("span",{ref:l})))})),cb={CIRCLE:"circle",POLYGON:"polygon"},ub={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},pb=.001,db=(0,T.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});var mb=r(90690);function gb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hb=["drawing"],fb=e=>{let{markers:t=[],mapKey:r,defaultZoom:n,defaultCenter:a,loadingElement:l,isSearchOnMapMove:o,isSearchEnabled:i,activeOverlay:u,overlayOptions:p,drawingModes:d=[],markerClusterer:m,markerClustererOptions:g,mapContainerClassName:h,onMapBoundsChanged:f,onOverlayUpdated:b,onMarkerClicked:y}=e;const x=db(),{isLoaded:v,loadError:E}=(0,Vf.Ji)({googleMapsApiKey:r,libraries:hb}),w=(0,s.useRef)(null),[C,O]=(0,s.useState)(null),[T,S]=(0,s.useState)(null),[k,I]=(0,s.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const l=(0,mb.D)(t),o=(0,mb.D)(r),i=a&&window.google;(0,s.useEffect)((()=>{i&&!n&&t.length&&t!==l?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const e=n.getCenter();n.extend(new window.google.maps.LatLng(e.lat()+Hf,e.lng()+Hf)),n.extend(new window.google.maps.LatLng(e.lat()-Hf,e.lng()-Hf))}t.fitBounds(n),r&&rb(t,r,n)})(t,a,r):i&&r&&r!==o&&rb(a,r)}),[a,t,r])})({markers:t,activeOverlay:u,map:C,isSearchOnMapMove:o});const P=(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){gb(e,t,r[t])}))}return e}({},ub,p||{})),[p]),D=(0,s.useCallback)((e=>{f(e?eb(C):null),I(null),clearTimeout(w.current)}),[C,f]),A=(0,s.useCallback)((()=>{clearTimeout(w.current)}),[]),R=(0,s.useCallback)((()=>{o&&f(eb(C))}),[o,C,f]),j=(0,s.useCallback)((()=>{o&&(clearTimeout(w.current),w.current=setTimeout(R,1e3))}),[R,o]),Z=(0,s.useCallback)(((e,t)=>{const r=t||T&&{type:cb.POLYGON,overlay:T};if(!(0,N.isEmpty)(r)&&"function"==typeof b){const{overlay:e,type:t}=r,n={[cb.POLYGON]:()=>e.getPath().getArray().map((e=>[e.lat(),e.lng()])),[cb.CIRCLE]:()=>({radius:e.getRadius()/1e3,center:e.getCenter()})},a=n[t]&&n[t]();a&&b({data:a,type:t})}}),[b,T]),L=(0,s.useCallback)((e=>t=>{Z(null,{type:e,overlay:t}),t.setMap(null),I(null)}),[Z]),_=(0,s.useCallback)((()=>{b(null)}),[b]),M=e=>t.filter((0,N.prop)("point")).map((t=>c().createElement(sb,{key:t.id,marker:t,clusterer:e,onClick:y})));return E?null:v?c().createElement(Vf.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:{mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},onLoad:O,zoom:n,center:a,onZoomChanged:A,onDragStart:A,onIdle:j,mapContainerClassName:h},C&&i&&Boolean(d.length)&&c().createElement(Bf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:C},c().createElement(Xf,{hasActiveOverlay:!!u,drawingModes:d,drawingMode:k,onDrawingModeChanged:I,onClearOverlay:_})),C&&i&&c().createElement(Bf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:C},c().createElement(Jf,{onChangeIsSearchOnMapMove:D,isSearchOnMapMove:o})),m?(V=g,c().createElement(Vf.XL,{options:V},M)):M(),!tb(k)&&u&&(0,N.propEq)("type",cb.POLYGON,u)&&c().createElement(Vf.mg,{onLoad:S,path:u.path,editable:!0,options:P,onMouseUp:Z,onDragEnd:Z}),i&&Boolean(d.length)&&c().createElement(Vf.j_,{onPolygonComplete:L(cb.POLYGON),onCircleComplete:L(cb.CIRCLE),drawingMode:tb(k),options:{drawingControl:!1,circleOptions:P,polygonOptions:P}})):l;var V},bb=e=>{let{entity:t,historyEvent:r}=e;const[n,a]=(0,s.useState)(!1),l=(0,g.useSelector)(h.ZP.selectors.getHistorySlice),o=(0,g.useDispatch)(),i=(0,ze._)(),{aStamp:c,bStamp:p,overrideUri:d}=r||{},m=d||(null==t?void 0:t.uri);return(0,s.useEffect)((()=>{r&&m&&(a(!0),i(Promise.all([(0,u.lrH)(m,c),p&&1!==p?(0,u.lrH)(m,p):Promise.resolve(null)])).then((e=>{let[t,r]=e;o(h.N5.history.actions.setHistorySlice({aEntity:t,bEntity:r}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{a(!1)})))}),[c,p,m]),{isLoading:n,historySlice:l}};let yb;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(yb||(yb={}));var xb=r(39034);const vb=e=>(0,N.pipe)((0,N.map)(e),(0,N.join)(" or ")),Eb=e=>{const[t,r]=e;return rn()().subtract(t,r).valueOf()},wb=(0,N.chain)((0,N.cond)([[(0,N.equals)(yb.MERGE),()=>[l.I.ENTITIES_MERGED,l.I.ENTITIES_MERGED_MANUALLY,l.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,N.equals)(yb.UNMERGE),()=>[l.I.ENTITIES_SPLITTED]],[(0,N.equals)(yb.UPDATE),()=>[l.I.ENTITY_CHANGED]]])),Cb=(0,N.pipe)((0,N.defaultTo)([]),wb,(0,N.concat)([l.I.ENTITY_CREATED,l.I.ENTITY_REMOVED,l.I.ENTITY_LOST_MERGE]),vb((e=>`equals(type, '${e}')`))),Ob=(0,N.pipe)((0,N.defaultTo)({}),(0,N.reject)(u.O27),(0,N.evolve)({users:vb((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:vb((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case xb.K.WITHIN:return`gte(timestamp, ${Eb(r)})`;case xb.K.AGO:return`lte(timestamp, ${Eb(r)})`;case xb.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${rn()(t).endOf("date").valueOf()})`}default:return""}}}),(0,N.over)((0,N.lensProp)("activities"),Cb),N.values,(0,N.reject)(u.O27),(0,N.append)("not equals(user, 'collaboration-service')"),(0,N.map)((e=>`(${e})`)),(0,N.join)(" and "));function Tb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sb(e,t,r[t])}))}return e}function Sb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kb={activities:[yb.MERGE,yb.UNMERGE,yb.UPDATE]},Nb=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)(kb),[l,o]=(0,s.useState)(0),i=(0,s.useMemo)((()=>Ob(n)),[n]),[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),[g,h]=(0,s.useState)(!1),f=(0,ze._)(),b=null==t?void 0:t.uri,y={max:32,order:"desc"},x=(0,u.O27)(null==n?void 0:n.attributes)||void 0;(0,s.useEffect)((()=>{b&&r&&(h(!0),f((0,u.kgP)(Tb({entityUri:b,historicUris:c,filter:i,showAll:x},y))).then(m).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{h(!1)})))}),[i,x,c]),(0,s.useEffect)((()=>{b&&r&&(h(!0),f((0,u.wdF)({entityUri:b})).then((e=>{p(e)})).catch((e=>{console.warn("Failed to load history data",e),p(null)})).finally((()=>{h(!1)})),o(0))}),[b,null==t?void 0:t.updatedTime,r]);const v=(0,s.useCallback)((e=>{b&&c&&r&&(h(!0),f((0,u.kgP)(Tb({entityUri:b,historicUris:c,filter:i,showAll:x,offset:e},y))).then((e=>{m((t=>Tb({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{h(!1)})))}),[c,i,r]),E=(0,s.useMemo)((()=>32*(l+1)<(null==d?void 0:d.total)),[d,l]),w=(0,s.useCallback)((e=>{o(0),a(e)}),[]),C=(0,s.useCallback)((()=>{w(Tb({},kb))}),[]),O=(0,s.useCallback)((()=>{E&&(v(32*(l+1)),o(l+1))}),[v,l,E]);return{isLoading:g,canLoadMore:E,onLoadMore:O,onApplyFilter:w,onClearFilter:C,historicUris:c,historyWithTotal:d,historyFilter:n}},Ib={appearance:{},attributes:{},roles:[],tags:[]},Pb=(0,N.evolve)({refEntity:u.VGB,refRelation:u.VGB}),Db=e=>e?(0,N.evolve)({attributes:(0,N.map)((0,N.map)(Pb))})(e):e,Ab=()=>{const e=(0,g.useDispatch)(),t=(0,g.useSelector)(h.ZP.selectors.getHistorySlice),r=(0,g.useSelector)(h.ZP.selectors.getHistoryDiff),n=(0,g.useSelector)(h.ZP.selectors.getHistoryMode),a=(0,g.useSelector)(h.ZP.selectors.getEntity);return(0,s.useEffect)((()=>{if(t){const{aEntity:r,bEntity:l}=t,o=u.nwO.HistoryManager.createHistoryManager(u.nwO.AttributesDiff).computeEntityHistoryDiff(Db(n===h.Z9.Current?a:l),Db(r));e(h.N5.history.actions.setHistoryDiff(o))}}),[t,n,e,a]),r||Ib};var Rb=r(57312);const jb=(0,T.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"}}))),Zb=e=>{let{change:t,isCurrent:r,isSelected:n,onClick:a}=e;const{uri:l,type:o,matchGroups:i,user:s,timestamp:p}=t,d=(0,u.GtP)(l),m=jb({color:d});return c().createElement("div",{className:b()(m.historyRow,{[m.selected]:n}),onClick:a},c().createElement("div",{className:m.rowHeader},c().createElement("div",{className:m.badge}),c().createElement(E.Z,{className:b()(m.title,{bold:r})},r?x().text("Current view"):(0,Rb.Xr)(o)),!r&&c().createElement(E.Z,{className:m.date},x().date(p,"L LT"))),i&&c().createElement(E.Z,{className:m.title},x().text("Match rule:")," ",i.join(", ")),c().createElement(E.Z,{className:m.user},s))};function Lb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _b;!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"}(_b||(_b={}));const Mb=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){Lb(e,t,r[t])}))}return e}({},l.I,_b),Vb=e=>e===Mb.FAKE_FILTERED_INCOMING||e===Mb.FAKE_FILTERED_OUTGOING,Bb=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})},Ub=e=>{let{x:t,y:r,color:n,isDashed:a,isCollapsed:l,showCollapseIcon:o,showLine:i}=e;const s=o?6:3;return c().createElement("g",null,i&&c().createElement("rect",{id:"line",x:t-s-4,y:r-s-4,width:2*s+8,height:2,fill:n}),c().createElement("circle",{cx:t,cy:r,r:s,fill:a?"#fff":n,stroke:n,strokeDasharray:a?"1,1":void 0,strokeWidth:2}),o&&c().createElement("g",{id:"icon"},c().createElement("rect",{x:t-4,y:r-1,width:8,height:2,fill:"#fff"}),l&&c().createElement("rect",{x:t-1,y:r-4,width:2,height:8,fill:"#fff"})))},zb=(0,s.memo)((e=>{let{graphData:t}=e;const{historyLanes:r,rows:n}=t,a=[16],{links:l,rowLines:o,circles:i}=n.reduce(((e,t,l)=>{let{uri:o,height:i,uris:s,type:p,index:d}=t;const m=16*r[o].index+24,g=a[l];a.push(g+i);const h=Vb(p),f=h?s[0]:o,b=!(null!=s&&s.some((e=>r[e])));e.circles.push(c().createElement(Ub,{key:`circle-${f}-${l}`,x:m,y:g,color:(0,u.GtP)(f),isDashed:h,isCollapsed:b,showCollapseIcon:!!s,showLine:p===Mb.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(c().createElement("rect",{key:`${f}-${d}`,x:m,y:g-8,width:"100%",height:16,fill:(0,u.GtP)(f),opacity:.06}));const y=p===Mb.ENTITIES_SPLITTED;return null==s||s.forEach((t=>{const a=r[t];if(!a)return;const o=n[l].height,i=16*a.index+24,s=y?g-o:g+o;m!==i&&e.links.push(c().createElement(Bb,{key:`link-${t}-${d}`,x:m,y:g,toX:i,toY:s,isDashed:Vb(p),color:(0,u.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),s=16*Object.keys(r).length+24,p=a[a.length-1]-16;return Object.entries(r).forEach((e=>{let[t,r]=e;const o=16*r.index+24;r.lifeTime.forEach(((e,s)=>{var d;let{start:m,end:g}=e;if((null===(d=n[null==g?void 0:g.index])||void 0===d?void 0:d.type)===Mb.ENTITIES_SPLITTED)return;const h=a[null==m?void 0:m.index]||p,f=a[(null==g?void 0:g.index)+1]||16,b=(0,u.GtP)(t);!g&&r.index>0&&i.push(c().createElement(Ub,{key:`initCircle-${t}-${s}`,x:o,y:f,color:b,showLine:!0})),l.push(c().createElement("path",{key:`line-${t}-${s}`,d:`M${o} ${h} L${o} ${f}`,stroke:b,strokeWidth:2}))}))})),c().createElement("svg",{className:"chart",width:s,height:p},c().createElement("g",{id:"rowLines"},o),c().createElement("g",{id:"links"},l),c().createElement("g",{id:"circles"},i))})),Fb=(0,T.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 Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wb=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:l,historyEvent:o,findPreviousChange:i}=e;const p=Fb(),d=(0,g.useDispatch)(),m=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode),[f,y]=(0,s.useState)({historyLanes:{},rows:[]}),[v,E]=(0,s.useState)(!1),[w,C]=(0,s.useState)(-1);(0,s.useEffect)((()=>{if((0,N.isNil)(o))return void C(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!==w?t.rows[w]:null,n=t.rows.findIndex((t=>e(t)));C(e(r)?w:n)}),[t.rows,o]);const O=(0,s.useRef)(null),T=(0,s.useCallback)((e=>{if(!(0,N.isNil)(e)){var r;const n=null===(r=t.rows)||void 0===r?void 0:r.map(((t,r)=>{var n;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){Hb(e,t,r[t])}))}return e}({},t,{height:null===(n=e.childNodes[r])||void 0===n?void 0:n.clientHeight})}));y({historyLanes:t.historyLanes,rows:n})}}),[t]),S=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:r}=(null==O?void 0:O.current)||{};E(r<e-t)};return c().createElement("div",{className:p.historyTree},r&&c().createElement(Dn,null),c().createElement("div",{className:b()(p.graph,{[p.shadow]:v}),onScroll:S,ref:O},c().createElement(zb,{graphData:f}),c().createElement(wr.Z,{handleWidth:!0,onResize:S})),c().createElement("div",{ref:T,className:p.history},t.rows.map(((e,t)=>{const r=t===w,n=0===t;return c().createElement(Zb,{key:`row-${t}`,change:e,isCurrent:n,isSelected:r,onClick:()=>((e,t,r,n)=>{if(m){if(!window.confirm(x().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;d(h.N5.mode.actions.modeUpdated(u.ARY.Viewing))}if(n&&!r||!n&&r)d(h.N5.history.actions.clearHistoryEvent()),C(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;d(h.N5.history.actions.setHistoryEvent({aStamp:a,bStamp:o,overrideUri:s})),C(e)}})(t,e,r,n)})}))),n&&c().createElement("div",{className:p.buttonContainer},c().createElement(Le.Z,{color:"primary",onClick:()=>a()},x().text("Show more"))))},qb=(0,T.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),Gb=(0,T.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"}}),$b=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),l=Gb({color:a});return c().createElement("div",{className:b()(l.icon,{[l.inactive]:!r,[l.active]:r,[l.clickable]:!!n}),onClick:n})},Yb=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:l}=e;const o=qb();return c().createElement("div",{className:b()(o.root,l)},c().createElement($b,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement($b,{key:e,value:e,isSelected:null==r?void 0:r.includes(e),onClick:()=>(e=>{null!=r&&r.includes(e)?a((0,N.without)([e],r)):a([...r||[],e])})(e)}))))};function Kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xb=(e,t)=>e.reduce(((e,r,n)=>{let{start:a,end:l}=r;if(a){const r=t-a.timestamp;((0,N.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,N.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}),Qb=(0,T.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),Jb=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:l,onLoadMore:o,historyEvent:i}=e;const u=Qb(),[p,d]=(0,s.useState)(null);(0,s.useEffect)((()=>{d(n)}),[n]);const{historyData:m,findPreviousChange:g}=(e=>{let{entityUri:t,historyChanges:r,selectedUris:n}=e;return(0,s.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},a=[{type:Mb.FAKE_UPDATE,user:"",timestamp:0,uri:t}],l=(0,N.curry)(((e,r)=>{const n=r.uri||t;if(Array.isArray(e)){if(r.type!==Mb.ENTITY_LOST_MERGE)return null;if(e.includes(n))return r;if(r.uris)return e.some((e=>r.uris.includes(e)))?r:null}else{var a;if(n===e||null!==(a=r.uris)&&void 0!==a&&a.includes(e))return r}return null})),o=(e,t)=>(0,N.pipe)((0,N.slice)(0,e-1),N.reverse,(0,N.find)(l(t)))(r),i=t=>{const r=e[t];return r||n&&!n.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),r},s=(e,t)=>{const r=e[e.length-1];!r||r.start&&(r.start.type!==Mb.ENTITY_CREATED||t.type!==Mb.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})},p=[];return null==r||r.forEach(((r,n)=>{var l;switch(r.type){case Mb.ENTITIES_SPLITTED:if(!o(n,r.uri||t))return;{const e=r.uri,t=r.uris?[r.uris,e]:[e],a=o(n,t);if(a&&(!e||e===a.uri))return}break;case Mb.ENTITY_LOST_MERGE:case Mb.RELATIONSHIP_CREATED:case Mb.RELATIONSHIP_REMOVED:case Mb.RELATIONSHIP_CHANGED:return}let d=!1;null===(l=r.uris)||void 0===l||l.forEach((e=>{i(e)||(d=!0)}));const m=i(r.uri||t);if(!m)return;const g=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){Kb(e,t,r[t])}))}return e}({},r);((t,r)=>{var n,l;switch(r.type){case Mb.ENTITY_CREATED:s(t,r);break;case Mb.ENTITIES_MERGED_ON_THE_FLY:case Mb.ENTITY_CHANGED:c(t,r);break;case Mb.ENTITY_LOST_MERGE:case Mb.ENTITY_REMOVED:u(t,r);break;case Mb.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({type:l?Mb.FAKE_UPDATE:Mb.FAKE_NAVIGATE_PROFILE,uri:t,user:r.user,timestamp:r.timestamp})}));break;case Mb.ENTITIES_MERGED:case Mb.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,g),d&&p.push(g),a.push(g)})),p.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 Mb.ENTITIES_MERGED:case Mb.ENTITIES_MERGED_MANUALLY:l=Mb.FAKE_FILTERED_INCOMING;break;case Mb.ENTITIES_SPLITTED:l=Mb.FAKE_FILTERED_OUTGOING;break;default:return}const o={type:l,uri:t.uri,uris:[r],user:s,timestamp:i},u=Xb(n.lifeTime,t.timestamp);l===Mb.FAKE_FILTERED_INCOMING?(0,N.isNil)(u.endIndex)||(n.lifeTime[u.endIndex].end=o):(0,N.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,N.pipe)((0,N.slice)(e+1,1/0),(0,N.find)(l(t)))(a)}}),[t,r,n])})({entityUri:a,historyChanges:null==r?void 0:r.changes,selectedUris:p});return c().createElement("div",{className:u.root},c().createElement(Yb,{values:n,selectedValues:p,onSelectValues:d,entityUri:a,className:u.borderBottom}),c().createElement(Wb,{historyData:m,isLoading:t,onLoadMore:o,canLoadMore:l,entityUri:a,historyEvent:i,findPreviousChange:g}))}));var ey=r(36444),ty=r(15791),ry=r(55234);const ny=[xb.K.WITHIN,xb.K.AGO,xb.K.BETWEEN],ay=e=>({[xb.K.WITHIN]:x().text("Within the last"),[xb.K.AGO]:x().text("More than"),[xb.K.BETWEEN]:x().text("Date range")}[e]||"");var ly=r(77875),oy=r(27446);const iy=(0,T.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),sy=[null,null],cy=[null,"hours"],uy=e=>{let{value:t,onChange:r,className:n}=e;const a=iy(),l=e=>e===xb.K.WITHIN||e===xb.K.AGO,o=e=>e===xb.K.BETWEEN,i=o(null==t?void 0:t.type)?t.period:sy,u=l(null==t?void 0:t.type)?t.period:cy,[p,d]=(0,s.useState)(i),[m,g]=(0,s.useState)(u),h=(null==t?void 0:t.type)||xb.K.WITHIN,f=e=>l(e)?m:o(e)?p:void 0,y=e=>{r({type:h,period:e})};return(0,te.D)((()=>{t?l(t.type)?g(t.period):o(t.type)&&d(t.period):(d(sy),g(cy))}),[t]),c().createElement("div",{className:b()(a.root,n)},c().createElement(E.Z,{className:a.title,variant:"subtitle1"},x().text("Date")),c().createElement("div",{className:a.intervalContainer},c().createElement(Ml.Z,{label:"",className:a.typeInput,value:{value:h,label:ay(h)},options:ny.map((e=>({value:e,label:ay(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),l(h)?c().createElement(ly.Z,{interval:m,onChange:y}):c().createElement(oy.Z,{values:p,onChange:y})))},py=[yb.UPDATE,yb.MERGE,yb.UNMERGE];function dy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){my(e,t,r[t])}))}return e}function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gy={input:e=>dy({},e,{fontSize:"14px"}),menuPortal:e=>dy({},e,{zIndex:1300})},hy=(0,T.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"}}),fy=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=hy(),l=e=>{return{value:e,label:(t=e,{[yb.UPDATE]:x().text("Update"),[yb.MERGE]:x().text("Merge"),[yb.UNMERGE]:x().text("Unmerge")}[t]||"")};var t},o=e=>e.map(l),i=o(py);return c().createElement("div",{className:b()(a.root,n)},c().createElement(E.Z,{className:a.title,variant:"subtitle1"},x().text("Activity")),c().createElement(_p.Z,{value:o(t),onChange:(0,N.pipe)((0,N.defaultTo)([]),(0,N.pluck)("value"),r),options:i,TextFieldProps:{classes:{root:a.dropDownInput}},components:{DropdownIndicator:cc.Z},styles:gy,classes:a,menuPlacement:"bottom",menuPortalTarget:document.body}))},by=(0,T.Z)({icon:{margin:5},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 yy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy=e=>{let{filter:t,onApplyFilter:r,onClearFilter:n,entityType:a}=e;const l=by(),[o,i]=(0,s.useState)(null),u=()=>i(null),[p,d]=(0,s.useState)(t);(0,s.useEffect)((()=>{d(t)}),[t]);const m=(0,N.curry)(((e,t)=>{d((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){yy(e,t,r[t])}))}return e}({},r,{[e]:t})))})),{activities:g=[],attributes:h=[],dateRange:f=null,users:b=[]}=p||{};return c().createElement(c().Fragment,null,c().createElement(_t.Z,{icon:ey.Z,size:"XS",onClick:e=>i(e.currentTarget),className:l.icon}),c().createElement(_r.ZP,{classes:{paper:l.popup},open:!!o,anchorEl:o,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:l.filterContainer},c().createElement(E.Z,{variant:"h6"},x().text("Filter")),c().createElement("div",{className:l.filterContainerScrollable},c().createElement(uy,{value:f,onChange:m("dateRange"),className:l.filterItem}),c().createElement(ty.Z,{selectedUsers:b,onChange:m("users"),className:l.filterItem}),c().createElement(fy,{selectedHistoryActivityTypes:g,onChange:m("activities"),className:l.filterItem}),c().createElement(ry.Z,{selectedAttributes:h,entityType:a,onChange:m("attributes"),className:l.filterItem,title:x().text("Attribute updated")}))),c().createElement("div",{className:l.filterControls},c().createElement(Le.Z,{onClick:n,className:l.clearButton},x().text("Clear all")),c().createElement(Le.Z,{onClick:u},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{f&&(e=>{if(e.type===xb.K.AGO||e.type===xb.K.WITHIN){const[t,r]=e.period;return"Number"===(0,N.type)(t)&&"String"===(0,N.type)(r)&&t>0}if(e.type===xb.K.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}})(f)?r(p):r((0,N.dissoc)("dateRange",p)),u()}},x().text("Apply")))))};var vy=r(98281);const Ey=(0,T.Z)({icon:{margin:5},menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),wy=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=Cn.ZT}=e;const a=Ey(),{text:l,selected:o,onClick:i}=r;return c().createElement(Va.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},o&&c().createElement(vy.Z,{className:a.checkIcon}),c().createElement(E.Z,{classes:{root:a.menuText}},l))}));wy.displayName="MenuItemRenderer";const Cy=wy,Oy=()=>{const e=Ey(),t=(0,g.useSelector)(h.ZP.selectors.getHistoryMode),r=(0,g.useDispatch)(),n=e=>{r(h.N5.history.actions.setHistoryMode(e))},a=[{text:x().text("Compare to Current view"),selected:t===h.Z9.Current,onClick:()=>n(h.Z9.Current)},{text:x().text("Compare to Previous view"),selected:t===h.Z9.Previous,onClick:()=>n(h.Z9.Previous)}];return c().createElement(be.Z,{MenuItemRenderer:Cy,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",className:e.icon},menuId:"history-menu",menuItems:a})},Ty=(0,T.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}}),Sy=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}=e;const o=Ty();return c().createElement("div",{className:o.root},c().createElement(E.Z,{variant:"h6"},x().text("History")),c().createElement(Zr.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),!(0,N.isNil)(t)&&c().createElement(E.Z,{variant:"body1",color:"textSecondary",className:o.count},1===t?x().text("${count} contributing profile",{count:t}):x().text("${count} contributing profiles",{count:t})),c().createElement(vm.Z,null),c().createElement(xy,{entityType:r,filter:n,onApplyFilter:a,onClearFilter:l}),c().createElement(Oy,null))},ky=(0,T.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),Ny=()=>{const e=ky(),t=(0,g.useSelector)(h.ZP.selectors.getHistoryEvent),r=(0,g.useDispatch)(),n=(0,N.pipe)(h.N5.history.actions.clearHistoryEvent,r);return t?c().createElement("div",{className:e.root},c().createElement(E.Z,{component:"div"},x().text("You are viewing a historic slice:")," ",c().createElement("span",{className:e.slice},x().date(t.aStamp,"llll"))),c().createElement(Le.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},x().text("Cancel"))):null},Iy=()=>c().createElement(gm,{text:x().text("History in the making"),secondaryText:x().text("When you create an event or perform an activity, it will show up here.")}),Py=(0,T.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 Dy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ay(e,t,r[t])}))}return e}function Ay(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ry=e=>{let{connection:t,modifiedEntity:r,allModifiedEntities:n,dispatch:a,config:l,mode:o,metadata:i,globalSearchRequestOptions:p,error:d}=e;const{relationUri:m,relationType:g,direction:f}=t.relation,y=t.isNew,v=Py(),{inRelations:w=[],outRelations:C=[]}=(0,s.useMemo)((()=>(0,u.ocC)({config:l,direction:f,relationType:g,mode:o,metadata:i})),[l,f,g,o,i]),O=(0,s.useMemo)((()=>(0,u.xF8)(i,g)),[g,i]),T=(0,s.useMemo)((()=>Dy({attributes:Dy({},h.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,u.p2l)(t.relation))),[t]),S=(0,s.useRef)(t),k=(0,s.useRef)(r),I=(0,s.useMemo)((()=>(0,u.SAs)(n,r)),[n,r]),P=(0,s.useRef)([]);(0,s.useEffect)((()=>{P.current=(0,N.pipe)((0,N.concat)(I.map((0,N.prop)("uri"))),N.uniq)(P.current)}),[I]);const D=(0,s.useRef)(I),A=(0,u.z7d)(w,C),R=S.current!==t||k.current!==r||(j=D.current,Z=I,j.length!==Z.length||j.some(((e,t)=>j[t]!==Z[t])))||t.isNew&&!(0,u.O27)((0,N.path)(["relation","object","attributes"],t));var j,Z;const L=y?h.N5.relations.actions.addRelation:h.N5.relations.actions.editRelation,_=(0,s.useCallback)((0,N.pipe)(h.N5.relations.actions.setRelationType(l.id,m),a),[l,m,a]),M=(0,s.useCallback)((()=>(0,N.pipe)(h.N5.relations.actions.closeRelationEditor,a)(l.id,m)),[l,m,a]),V=(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(h.N5.modifiedEntities.actions.entityCreated(e))),[a]),U=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityDeleted(e))),[a]),z=(0,s.useCallback)((e=>{r&&U(r.uri),a(h.N5.relations.actions.setRelationEntity(l.id,m,e)),d&&a(h.N5.errors.actions.errorDeactivated((0,u.iFp)(d)))}),[l.id,m,a,r,U,d]),F=(0,s.useCallback)((()=>{const e=(0,u.Bd_)(i,n,t);return a(h.N5.errors.actions.errorsSet(e)),0===e.length}),[t,i,n,a]),H=(0,s.useCallback)((()=>a(h.N5.errors.actions.errorsSet([]))),[a]),W=(0,s.useCallback)((0,N.pipe)((0,N.always)(t),(0,N.when)(F,(0,N.pipe)(u.zhn,V,L(l.id),a,(0,N.always)((0,N.differenceWith)(N.equals,P.current,I.map((0,N.prop)("uri")))),(0,N.forEach)(U),M))),[t,l,a,V,F,I]),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=D.current;(0,N.differenceWith)(N.equals,P.current,t.map((0,N.prop)("uri"))).forEach(U),t.forEach(B),H(),M()}),[M,B,U,H,r]),G=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,a)(e.map((e=>Dy({},e,{viewId:l.id}))))),[l.id,a]),$=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),Y=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),K=(0,s.useCallback)(((e,t)=>{const r=(0,u.nt9)(i,e),n=(0,N.pipe)(u.wcJ,(0,u._kX)(o))(r),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:o});z(a),B(a)}),[B,z,o,i]),X=(0,u.e$p)(d);return c().createElement(c().Fragment,null,c().createElement("div",{className:v.editor},c().createElement(E.Z,{className:v.title},y?x().text("Add new item"):x().text("Edit item")),null===A&&c().createElement(vc,{className:v.item,relation:t.relation,inRelationTypes:w,outRelationTypes:C,onChange:_}),Boolean(g)&&c().createElement(c().Fragment,null,c().createElement(ia,{errorMessage:X},c().createElement(gl,{className:b()(v.item,{[v.dense]:X||t.entity&&(0,u.ZiX)(t.entity.entityUri)}),entity:t.entity||{},entityTypesUris:l.content.entityTypes||[],max:l.max||20,globalSearchRequestOptions:p,mode:o,onChange:z,onCreate:K,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(Pa,{className:v.item,attrTypes:O,entity:T,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:o,parentUri:m,onAddAttributes:G,onChangeAttribute:$,onDeleteAttribute:Y}))),c().createElement("div",{className:v.actionButtons},c().createElement(Le.Z,{onClick:q},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",disabled:!R,onClick:W},x().text("Apply"))),c().createElement(Zr.Z,null))};Ry.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:U().object,dispatch:U().func,config:u.PiC,mode:U().string,metadata:u.pGS,globalSearchRequestOptions:U().object,error:u.wfT};const jy=Ry,Zy=(0,g.connect)(((e,t)=>{const r=(n=t,h.N5.relations.selectors.getEntityUriFromConnection(n.connection));var n;const a=(0,u.ZiX)(r);return{modifiedEntity:a?h.ZP.selectors.getModifiedEntity(e,r):null,allModifiedEntities:a?h.ZP.selectors.getModifiedEntities(e):null,globalSearchRequestOptions:h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]),error:(0,u.ATu)(t.connection,h.ZP.selectors.getProfileErrors(e))}}))(jy),Ly=(0,T.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"}}))),_y=c().createContext(null);_y.displayName="WorkflowTasksContext";const My=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),ou.Z.addError({title:x().text("Error"),message:t||x().text("Something went wrong...")}))},Vy=()=>{const e=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),t=(0,g.useSelector)(h.ZP.selectors.getCanUserStartProcessFromQuery),r=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowJobs),n=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowEnvironmentConfigJar),a=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowDefinition),l=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowConfigJar),o=(0,g.useSelector)(h.ZP.selectors.getCanUserViewProcessInstanceSearchQuery),i=(0,g.useSelector)(h.ZP.selectors.getCanUserUpdateWorkflowDataTask),s=(0,g.useSelector)(h.ZP.selectors.getCanUserUpdateProcessInstance),c=(0,g.useSelector)(h.ZP.selectors.getCanUserReadWorkflowDataTask),u=(0,g.useSelector)(h.ZP.selectors.getCanUserManageWorkflowEnvironmentDefinition),p=(0,g.useSelector)(h.ZP.selectors.getCanUserManageWorkflowDefinition),d=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsValidateTasks),m=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsUpdateTasks),f=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsTerminateProcessInstance),b=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsSyncBusinessProcessData),y=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobs),x=(0,g.useSelector)(h.ZP.selectors.getCanUserCreateWorkflowEnvironmentConfigJar),v=(0,g.useSelector)(h.ZP.selectors.getCanUserRegisterConfigEnvironments),E=(0,g.useSelector)(h.ZP.selectors.getCanUserCreateWorkflowConfigJar);return g=>{if(!e)return!1;switch(g){case"VIEW_PROCESS_DEFINITIONS":return a;case"DEPLOY_GENERIC_PROCESS_DEFINITION":return u;case"VIEW_JOBS":return r;case"START_JOB":return y||b&&f&&m&&d;case"VIEW_CUSTOM_JARS":return l||n;case"UPDATE_PROCESS_INSTANCE":return s;case"VIEW_TASKS":return c;case"REGISTER_TENANT":return v;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 p;case"DEPLOY_CUSTOM_JAR":return E&&x}return!1}},By=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,N.startsWith)("changeRequests/"))},Uy=e=>void 0===e||!0===e,zy=e=>({label:e,value:e}),Fy=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),p=(0,ze._)(),[d,m]=(0,s.useState)(null),[f,b]=(0,s.useState)(),[y,x]=(0,s.useState)(!1),v=Vy()("UPDATE_TASK")&&Uy(n);(0,s.useEffect)((()=>{m(zy(t))}),[t]);const E=(0,s.useCallback)((e=>{if(l&&v&&r){const t=(0,N.filter)((t=>t.value.toLowerCase().includes(e)));return f?Promise.resolve(t(f)):p((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(zy);return b(n),t(n)})).catch(My)}}),[l,r,o,i,f,b,v]),w=(0,s.useCallback)((e=>{if(l&&v&&r){const{value:t}=e;x(!0),c((0,u._C4)({taskId:r,workflowPath:l,environment:o,tenant:i,assignee:t})).then((()=>{m(zy(t)),null==a||a(r,{assignee:t})})).catch(My).finally((()=>{x(!1)}))}}),[l,r,o,i,v]);return{assignee:d,getAssignees:E,updateAssignee:w,updateRequestIsInProgress:y,readOnly:!v}},Hy=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:l,updateAssignee:o,updateRequestIsInProgress:i,readOnly:s}=Fy({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(_a.Z,{isDisabled:u,getOptions:l,onChange:o,hideSelectedOptions:!1,label:x().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},Wy=(0,T.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),qy=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const l=Wy(),{updateDueDate:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(n);return{updateDueDate:(0,s.useCallback)((e=>{l&&m&&r&&e&&t!==e&&(d(!0),c((0,u.KF3)({taskId:r,workflowPath:l,environment:o,tenant:i,dueDate:e})).then((()=>{null==a||a(r,{dueDate:e})})).catch(My).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]),updateRequestIsInProgress:p,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(Dc.Z,{className:b()(l.dueDate,a),disabled:i||p,value:r,label:x().text("Due date"),onChange:(0,N.pipe)((e=>e&&e.getTime()),o),margin:"dense",InputProps:{className:l.dueDateInput},InputLabelProps:{classes:{root:l.inputLabel}}})},Gy=e=>{let{taskId:t,priority:r,isTaskOpen:n,className:a}=e;const{priorities:l,updatePriority:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{priority:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(n),f=(0,s.useCallback)((e=>{const{value:n}=e;l&&m&&r&&t!==n&&(d(!0),c((0,u.ax9)({taskId:r,workflowPath:l,environment:o,tenant:i,priority:n})).then((()=>{null==a||a(r,{priority:n})})).catch(My).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]);return{priorities:(0,s.useMemo)((()=>[{label:x().text("Low"),value:u.NVC.low},{label:x().text("Medium"),value:u.NVC.medium},{label:x().text("High"),value:u.NVC.high},{label:x().text("Urgent"),value:u.NVC.urgent}]),[]),updatePriority:f,updateRequestIsInProgress:p,readOnly:!m}})({taskId:t,priority:r,isOpen:n}),d=i||p;return c().createElement(_a.Z,{className:a,isDisabled:d,options:l,onChange:o,hideSelectedOptions:!1,label:x().text("Priority"),value:l.find((0,N.propEq)("value",r)),TextFieldProps:{disabled:d},height:40})};var $y=r(94842),Yy=r(98685);const Ky=(0,T.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"}}))),Xy=(0,T.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"}}))),Qy=(0,T.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)"}}}))),Jy=(0,T.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),ex=e=>{let{author:t,classes:r,message:n,time:a}=e;const l=Ky();return c().createElement("div",{className:l.comment},c().createElement(Ne.Z,{className:l.avatar},c().createElement(Yy.Z,{className:l.icon})),c().createElement("div",{className:b()(l.info,r.messageContainer)},c().createElement("div",{className:l.firstLine},c().createElement("div",{className:l.author},t),c().createElement("span",{className:l.date},x().date(a,"L LT"))),c().createElement("div",{className:l.text},n)))};ex.defaultProps={classes:{}},ex.propTypes={classes:U().object,author:U().string,id:U().string,message:U().string,time:U().number};const tx=e=>{let{comments:t,onClick:r}=e;const n=Xy();return c().createElement(c().Fragment,null,c().createElement(ex,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Xa.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement(ex,t[t.length-1]))};tx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),onClick:U().func};const rx=e=>{let{comments:t}=e;const r=Jy();return t.map((e=>{let{author:t,id:n,message:a,time:l}=e;return c().createElement(ex,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:l})}))};rx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number}))};const nx=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,ze._)(),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),b=Vy()("UPDATE_TASK")&&Uy(n);(0,s.useEffect)((()=>{d(t||[])}),[t]);const y=(0,s.useCallback)((e=>{b&&(f(!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;d(t||[]),null==a||a(r,{processInstanceComments:t})})).catch(My).finally((()=>f(!1))))}),[o,r,i,l,c,a,b]);return{comments:p,requestIsInProgress:m,writeComment:y,readOnly:!b}},ax=e=>e.target.value,lx=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Qy(),[l,o]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:p,writeComment:d,readOnly:m}=nx({processInstanceComments:t,taskId:r,isOpen:n}),g=(0,s.useCallback)((()=>{d(i),u("")}),[i,d]),h=(0,N.pipe)(ax,u);return c().createElement("div",{className:a.container},c().createElement("div",{className:a.title}," ",x().text("Comments")," "),c().createElement("div",{className:a.commentsContainer},l||p.length<3?c().createElement(rx,{comments:p}):c().createElement(tx,{onClick:()=>o(!0),comments:p})),!m&&c().createElement(Dm.Z,{endAdornment:c().createElement(Am.Z,{position:"end"},c().createElement(_t.Z,{icon:$y.Z,disabled:0===i.length,onClick:g})),classes:{root:a.filledInputRoot},placeholder:x().text("Write a comment"),value:i,onKeyPress:(0,N.when)((0,N.propEq)("key","Enter"),g),onChange:h,disableUnderline:!0}))};lx.propTypes={processInstanceComments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),taskId:U().string};const ox=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)(_y)||{},o=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),i=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),c=(0,g.useSelector)(h.ZP.selectors.getTenant),p=(0,g.useSelector)(h.ZP.selectors.getUserName),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),[m,f]=(0,s.useState)(!1),b=(0,s.useContext)(Ga.m),y=(0,g.useDispatch)(),x=(0,s.useCallback)((e=>()=>{o&&n&&(f(!0),(0,u.TZ_)({taskId:n,workflowPath:o,environment:i,tenant:c,action:e}).then((()=>{"Delete"===e?y(h.ui.actions.entityDeletionFinished()):(y(h.N5.entity.actions.loadEntity({viewId:b,uri:d})),null==l||l())})).catch(My).finally((()=>{f(!1)})))}),[o,n,i,c,y,d,b,l]);return{actions:(0,s.useMemo)((()=>p===r&&Uy(a)?(t||[]).map((e=>{let{action:t,label:r}=e;return{text:r,onClick:x(t)}})):[]),[t,x,p,r,a]),actionRequestIsInProgress:m}})({taskId:t,possibleActions:r,assignee:n,isOpen:a});return l.length>0?c().createElement(be.Z,{buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",disabled:o},menuId:"workflow-actions",menuItems:l}):null},ix=(0,T.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}}),sx=e=>{let{className:t,children:r,plain:n,first:a,last:l,transparent:o,divider:i}=e;const s=ix();return c().createElement("div",{className:b()(t,s.decorator)},c().createElement("div",{className:b()(s.lineBlock,{[s.withLinePadding]:a})},!o&&c().createElement(c().Fragment,null,c().createElement("div",{className:s.noLine}),c().createElement("div",{className:b()(s.line,{[s.plain]:n},{[s.last]:l})}))),c().createElement("div",{className:s.content},r,i&&c().createElement(Zr.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let cx={};const ux=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let px=0;function dx(){return dx=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},dx.apply(this,arguments)}const mx=e=>c().createElement("svg",dx({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"}))),gx=e=>{let{task:t,children:r,actions:n,Icon:a}=e;const{taskId:l,dueDate:o,priority:i,assignee:u,createdBy:p,createTime:d,displayName:m,processDefinitionDisplayName:g,objectURIs:h,processInstanceComments:f,possibleActions:y,isOpen:v}=t,E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,N.pipe)(By,(0,N.unless)(N.isNil,(0,N.pipe)((0,N.split)("/"),(0,N.nth)(1))))(e)}(h),w=(e=>{let{processDefinitionDisplayName:t}=e;const r=t;return cx[r]||(cx[r]=ux[px],px++,px>ux.length-1&&(px=0)),cx[r]})({processDefinitionDisplayName:g}),C=Ly({color:w}),[O,T]=(0,s.useState)(!1),S=Vy()("VIEW_PROCESS_INSTANCE_COMMENTS");return c().createElement("div",{className:C.card},c().createElement("div",{className:b()({[C.withBackground]:O})},c().createElement("div",{className:C.lineWrapper},c().createElement("div",{className:C.line}),a&&c().createElement(a,{className:C.icon}),c().createElement(sx,{plain:!0,first:!0,transparent:!O},c().createElement("div",{className:C.mainInfo},c().createElement("div",{className:C.title},c().createElement("div",{className:b()(C.caption,C.flex)},g),c().createElement(cp.Z,{className:C.flag}),c().createElement(le.ZP,{title:x().text("Due date")},c().createElement("span",{className:C.date},x().date(o,"L"))),c().createElement(ks.Z,{isOpen:O,size:"L",onClick:()=>{T(!O)}})),c().createElement("div",{className:C.infoBlock},c().createElement("div",{className:C.flex},E&&c().createElement("div",{className:C.info},x().text("DCR ID"),": ",c().createElement("span",{className:C.infoValue},E)),c().createElement("div",{className:C.info},x().text("Created by"),": ",c().createElement("span",{className:C.infoValue},p)," ",x().text("on")," ",c().createElement("span",{className:C.infoValue},x().date(d,"L"))),c().createElement("div",{className:C.info},x().text("Step"),": ",c().createElement("span",{className:C.infoValue},m)),S&&(null==f?void 0:f.length)>0&&c().createElement("div",{className:C.commentsInfo},c().createElement(mx,{className:C.commentsIcon}),c().createElement("div",{className:C.infoValue},f.length))),n||c().createElement(ox,{taskId:l,possibleActions:y,assignee:u,isTaskOpen:v}))))),O&&c().createElement(sx,{plain:!0},c().createElement("div",{className:C.controlsBox},c().createElement("div",{className:C.controlsInRow},c().createElement(qy,{taskId:l,dueDate:o,isTaskOpen:v}),c().createElement(Gy,{taskId:l,priority:i,className:C.priority,isTaskOpen:v})),c().createElement(Hy,{taskId:l,assignee:u,isTaskOpen:v})))),O&&c().createElement(c().Fragment,null,r,S&&c().createElement("div",{className:C.comments},c().createElement(lx,{taskId:l,processInstanceComments:f,isTaskOpen:v}))))};function hx(){return hx=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},hx.apply(this,arguments)}const fx=e=>c().createElement("svg",hx({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 bx,yx;!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"}(bx||(bx={})),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"}(yx||(yx={}));const xx=(e,t)=>{switch(e){case yx.CREATE_RELATIONSHIP:case yx.INSERT_ATTRIBUTE:return bx.ADDED;case yx.UPDATE_TAGS:case yx.UPDATE_ROLES:case yx.UPDATE_ATTRIBUTE:return bx.EDITED;case yx.DELETE_ATTRIBUTE:case yx.DELETE_RELATIONSHIP:return bx.DELETED;case yx.PIN_ATTRIBUTE:return null!=t&&t.pin?bx.PIN_DELETED:bx.PINNED;case yx.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?bx.IGNORE_DELETED:bx.IGNORED}},vx=e=>({[bx.ADDED]:x().text("added"),[bx.EDITED]:x().text("edited"),[bx.DELETED]:x().text("deleted"),[bx.PINNED]:x().text("pinned"),[bx.PIN_DELETED]:x().text("pin deleted"),[bx.IGNORED]:x().text("ignored"),[bx.IGNORE_DELETED]:x().text("ignore deleted")}[e]||""),Ex=(e,t)=>(0,N.when)((0,N.allPass)([(0,N.pipe)((0,N.prop)("type"),(0,N.equals)(u.oS0.TYPE_STRING)),()=>(0,u.CBv)(t)]),(0,N.evolve)({type:(0,N.always)(u.oS0.TYPE_URL)}))((0,u.PFL)(e));function wx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cx(e,t,r[t])}))}return e}function Cx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ox=(e,t)=>{if("newValue"in e||"oldValue"in e){const{newValue:r,oldValue:n,type:a}=e,l=(0,N.pathOr)([],["value",t.name])(r),o=(0,N.pathOr)([],["value",t.name])(n),i=Math.max(l.length,o.length);return(0,N.times)((e=>[{value:{newValue:l[e],oldValue:o[e],type:a}}]),i)}const r=e[t.name];return r?[r]:[]},Tx=(0,N.curry)(((e,t,r)=>{const n=Ta(e,t.type,[],[]);return kx(e,n,r)})),Sx=(0,N.curry)(((e,t,r,n)=>{const a=(0,u.V3K)(e,t.type),l=(0,u.xF8)(e,t.type);return(0,N.flatten)([wx({level:1,label:(0,N.propOr)("","label",a),attributeType:a,attributeValue:wx({},t,r)},((e,t)=>{if(t===yx.CREATE_RELATIONSHIP||(0,u.O27)(e)){const e=xx(t);return e?{operation:e}:{}}return{}})(r,n)),kx(e,l,r,2)])})),kx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,N.flatten)(t.map((t=>Ox(r,t).map((r=>r.map((r=>Nx(e,t,r,n))))))).filter((0,N.complement)(N.isEmpty)))},Nx=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return Ix(e,t,r,n);case u.oS0.TYPE_REFERENCE:return Px(e,t,r,n);default:{const e=((e,t)=>{const r=(0,u.kqr)(e)?t:t.value;return(0,N.is)(Object,r)?r:{newValue:t,type:yx.INSERT_ATTRIBUTE}})(t,r);return Dx(t,e,n)}}},Ix=(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},kx(e,a,r.value,n+1)]},Px=(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},kx(e,a,r.value,n+1)]},Dx=(e,t,r)=>{const{newValue:n,oldValue:a,type:l}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===yx.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t);return{attributeType:e,newValue:n,oldValue:a,operation:xx(l,a),label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function Ax(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rx(e,t,r[t])}))}return e}function Rx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jx=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],Zx=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:yx.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:l?[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:o?[{type:yx.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},Lx=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,l=a===yx.UPDATE_ROLES?(0,u.xqc)(e):N.identity,o=(0,N.difference)(r,n),i=(0,N.difference)(n,r),s=[];return o.length&&s.push({type:yx.INSERT_ATTRIBUTE,newValue:{value:o.map(l).join(", ")}}),i.length&&s.push({type:yx.DELETE_ATTRIBUTE,oldValue:{value:i.map(l).join(", ")}}),s},_x=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,l=t===yx.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,N.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,N.isNil)(i)&&(a[r]=(a[r]||[]).concat(c)),a=c.value}return e},Mx=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:l,tags:o,defaultProfilePicValue:i}=t,s=Ax({},r);return i&&(s.defaultProfilePicValue=[i]),l&&(s[u.xPW.roles.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:l.map((0,u.xqc)(e)).join(", ")}}]),o&&(s[u.xPW.tags.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:o.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},Vx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case yx.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case yx.UPDATE_TAGS:n[u.xPW.tags.name]=Lx(e,r);break;case yx.UPDATE_ROLES:n[u.xPW.roles.name]=Lx(e,r);break;case yx.UPDATE_START_DATE:n[u.xPW.startDate.name]=Zx(r);break;case yx.UPDATE_END_DATE:n[u.xPW.endDate.name]=Zx(r);break;case yx.CREATE_RELATIONSHIP:case yx.CREATE_ENTITY:return Ax({},n,Mx(e,r.newValue));case yx.INSERT_ATTRIBUTE:case yx.UPDATE_ATTRIBUTE:case yx.DELETE_ATTRIBUTE:case yx.PIN_ATTRIBUTE:case yx.IGNORE_ATTRIBUTE:_x(n,r)}return n},Bx=(0,T.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Ux=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const l=Bx();return c().createElement(he.Z,{component:"button",variant:"caption",underline:"none",onClick:n,className:a},c().createElement("span",{className:l.linkLabel},r?x().text("View less suggestions"):x().text("View ${suggestionsCount} more suggestions",{suggestionsCount:t})))};var zx=r(43525);const Fx=(0,T.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"}}}))),Hx=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:l}=e;const o=Fx(),i=r||n;return c().createElement("div",{className:b()(o.field,l)},c().createElement("span",{className:o.fieldName},t,":"),!(0,N.isNil)(i)&&c().createElement("span",{className:o.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(zx.Z,{className:o.arrow}),n)),a&&c().createElement(tt.Z,{variant:"outlined",label:vx(a),className:b()(o.chip,a)}))},Wx=c().createContext(null);Wx.displayName="AttributesChangesContext";const qx=(0,T.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"}}}))),Gx=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:l,newValue:o,operation:i}=e;const p=qx({level:r}),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),m=(0,s.useContext)(Wx),f=(0,s.useCallback)((()=>{if((0,u.YkG)(n)){const e=(0,N.when)((0,N.anyPass)([(0,N.hasPath)(["value","newValue"]),(0,N.hasPath)(["value","oldValue"])]),(0,N.ifElse)((0,N.hasPath)(["value","newValue"]),(0,N.path)(["value","newValue"]),(0,N.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,d,m)}if("endObject"in n){const{endObjectUri:e,endObjectLabel:t}=a;return{objectUri:e,objectLabel:t}}}),[n,a,d,m]),y=(0,s.useCallback)((()=>{const{objectUri:e,objectLabel:t}=f()||{};if(!(0,N.isNil)(e)&&!(0,N.isNil)(t)){var r;const n=!1===(null===(r=m[e])||void 0===r?void 0:r.isExist);return c().createElement(ve.Z,{value:e,className:b()(p.linkContainer,{[p.disabledLink]:n})},c().createElement("span",{className:b()(p.linkLabel,{[p.label]:n})},(0,u.idV)(t)))}return null}),[f,m,p]),x=(0,s.useMemo)((()=>c().createElement("span",null,t,y())),[t,y]),v=(0,s.useCallback)((e=>{const t=(0,u.kDl)(e);return c().createElement(at.Z,{value:t,dataTypeDefinition:Ex(n,t)})}),[n]);return c().createElement(Hx,{className:p.change,label:x,oldValue:l&&v(l),newValue:o&&v(o),operation:i})},$x=(0,T.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function Yx(){return Yx=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},Yx.apply(this,arguments)}const Kx=e=>{let{changes:t}=e;const r=$x();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,N.has)("level",e)?c().createElement(Gx,Yx({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Xx=(0,N.pipe)((0,N.filter)((0,N.has)("operation")),N.length),Qx=(0,T.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"}}))),Jx=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:l}=e;const o=Qx(),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),[p,d]=(0,s.useMemo)((()=>((e,t,r,n)=>{const a=t=>(0,N.pipe)((0,N.pick)([t]),Tx(e,r)),l=(0,N.curry)(((e,t)=>(0,N.reduce)(((e,r)=>(0,N.concat)(e,r(t))),[],e))),o=(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Vx(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Vx(e,r,n,t)),{}))(e,t,r)));return[l([(0,N.pipe)((0,N.omit)(jx),Tx(e,r)),a(u.xPW.roles.name),a(u.xPW.tags.name),a(u.xPW.startDate.name),a(u.xPW.endDate.name)],o),(0,N.flatten)(n.map(((r,n)=>{const a=(0,N.path)([r.uri,0,"type"],t);return Sx(e,r,i[n],a)})))]})(i,t,n,a)),[i,t,n,a]),m=(0,s.useMemo)((()=>{const e={label:x().text("Relationships")};return d.length>0?(0,N.flatten)([p,e,d]):p}),[p,d]),{isExpanded:f,onToggle:b,itemsToShow:y,collapsedSuggestionsCount:v}=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)((()=>Xx(e)),[e]),i=(0,s.useMemo)((()=>Xx(l)),[l]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:l,collapsedSuggestionsCount:o-i}}(m,l);return c().createElement(Wx.Provider,{value:r},c().createElement("div",{className:o.container},c().createElement(ve.Z,{className:o.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:o.label},(0,u.idV)(n.label))),c().createElement(Kx,{changes:y}),v>0&&c().createElement(Ux,{onClick:b,suggestionsCount:v,isExpanded:f,className:o.showMoreLink})))};function ev(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tv(e,t,r[t])}))}return e}function tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.WgC)),nv=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.bC9)),av=(e,t)=>(0,N.filter)((0,N.allPass)([(0,N.pipe)((0,N.prop)("uri"),u.bC9),(0,N.pipe)((0,N.prop)("startObjectUri"),(0,N.equals)(t))]))(e),lv=(0,N.curry)(((e,t)=>({entity:t,relations:av(e,t.uri)}))),ov=(0,N.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:ev({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),iv=(e,t)=>{const{entity:r,relations:n}=t,{uri:a}=r,l=(0,N.pipe)((0,N.pathOr)([],[a,"relations"]),(0,N.concat)(n),N.uniq)(e);return e[a]={entity:r,relations:l},e};function sv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cv=e=>{let{task:t}=e;const{objectURIs:r}=t,n=By(r),{dcr:a,groupedObjects:l}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),l=(0,ze._)(),o=(0,s.useCallback)((e=>(0,N.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,N.pipe)(N.keys,(0,N.filter)((t=>(0,N.prop)([t],e))),(0,N.map)((e=>ev({},t[e],{uri:e}))))(t))(t,n),i=(0,N.pipe)(rv,(0,N.map)(lv(l)))(l),s=(0,N.pipe)(nv,(0,N.map)(ov(n)))(l),[c,u]=(0,N.partition)((0,N.has)("entity"),s),p=u.map((0,N.path)(["relations",0,"startObjectUri"]));o(p).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){sv(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,N.pipe)(N.flatten,(0,N.reduce)(iv,{}),N.values,r)([i,c,t])})).catch(My),a(e)})).catch(My)}),[e,o]),{dcr:n,groupedObjects:t}})(n);return c().createElement(gx,{task:t,Icon:fx},a&&l.map(((e,t)=>c().createElement(sx,{key:t,last:t===l.length-1,divider:!0},c().createElement(Jx,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},uv=(0,T.Z)({pmCard:{marginLeft:"-15px"}});function pv(){return pv=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},pv.apply(this,arguments)}const dv=e=>c().createElement("svg",pv({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 mv=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,N.equals)(Object.keys(i),c),!s)for(const e of c)s=s||!(0,N.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]),gv=e=>{let{enabled:t,entity:r,filter:n,onFinishLoading:a,onStartLoading:l,options:o,page:i,rowsPerPage:c,sorting:p}=e;const{order:d,field:m}=p||{},[f,b]=(0,s.useState)(0),[y,x]=(0,s.useState)([]),[v,E]=(0,s.useState)({}),w=(0,g.useSelector)(h.ZP.selectors.getTenant),C=(0,g.useSelector)(h.ZP.selectors.getDtssPath),O=(0,g.useSelector)(h.ZP.selectors.getDataTenants),T=(0,s.useMemo)((()=>({dtssPath:C,dataTenants:O,entity:r,customerTenant:w,dtssRequest:u.Rgl})),[C,O,r,w]),S=(0,s.useCallback)((0,u.U_T)(T,u.SP6),[T]),k=mv(S),I=mv(u.bFH),P=(0,N.prop)("uri",r),D=(0,ze._)(),A=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t||(0,u.ZiX)(P))return b(0),x([]),void E({});null==l||l(),D((0,u.biM)(r)?I({dtssPath:C,entity:r,customerTenant:w,offset:i*c,max:c,force:e}):k({entityUri:P,offset:i*c,max:c,filter:n,sort:m,order:d,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;b(r),x(t),(0,u.B1H)(n).length>0&&E((0,u.SvV)(n))})).finally((()=>{null==a||a()}))}),[C,t,P,m,n,I,k,a,l,o,d,i,c,D,w]);return(0,s.useEffect)((()=>{A()}),[A]),{total:f,matches:y,entitiesMap:v,loadMatches:(0,s.useCallback)((()=>{A(!0)}),[A])}},hv=(0,T.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"}}),fv=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:l,className:o}=e;const i=hv();return c().createElement("div",{className:b()(i.root,o)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Cp,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(rp,{match:a,metadata:l,entitiesMap:r,entity:n})))},bv={showTransitiveMatches:!0,showInactiveEntities:!1},yv=e=>{let{task:t}=e;const r=uv(),{objectURIs:n}=t,a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),{matches:o,entitiesMap:i}=gv({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:bv}),s=null==o?void 0:o.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(gx,{task:t,Icon:dv},s&&c().createElement(sx,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(fv,{metadata:l,entity:a,match:s,entitiesMap:i}))))};function xv(){return xv=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},xv.apply(this,arguments)}const vv=e=>c().createElement("svg",xv({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 Ev(){return Ev=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},Ev.apply(this,arguments)}const wv=e=>c().createElement("svg",Ev({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 Cv{}Cv.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement(cv,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(yv,{task:t});case u.Yj_.recommendForDelete:return c().createElement(gx,{task:t,Icon:wv});default:return c().createElement(gx,{task:t,Icon:vv})}};const Ov=Cv,Tv=e=>{let{task:t}=e;return Ov.build({task:t})};var Sv=r(8560);const kv=(0,T.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"}}))),Nv=e=>{let{anchorEl:t,onClose:r}=e;const n=kv(),[a,l]=(0,s.useState)(""),[o,i]=(0,s.useState)(null),[p,d]=(0,s.useState)(!1),{definitions:m}=(()=>{const[e,t]=(0,s.useState)([]),r=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),n=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,g.useSelector)(h.ZP.selectors.getTenant),l=(0,g.useSelector)(h.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:f,loading:b}=(()=>{const{loadWorkflowTasks:e}=(0,s.useContext)(_y),t=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),r=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),n=(0,g.useSelector)(h.ZP.selectors.getTenant),a=(0,g.useSelector)(h.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 My(e),e})).finally((()=>{o(!1)})))),[a,r,e,n,t]),loading:l}})(),y=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(_r.ZP,{open:y,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(E.Z,{className:n.title},x().text("Add new workflow")),c().createElement(Ml.Z,{className:n.simpleDropDownSelector,variant:"filled",height:40,TextFieldProps:{InputProps:{disableUnderline:!0}},placeholder:x().text("Select task type"),value:o,onChange:e=>{i(e)},label:"",options:m.map((e=>({value:e.type,label:e.displayName})))}),c().createElement(zc.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(Le.Z,{disabled:b,className:n.cancelButton,onClick:r},x().text("Cancel")),c().createElement(Le.Z,{disabled:b,color:"primary",onClick:()=>{f(a,null==o?void 0:o.value).then((()=>{d(!0),l(""),i(null)})).catch((()=>{}))}},x().text("Start")))),c().createElement(Sv.Z,{container:document.body},c().createElement(qn.Z,{open:p,autoHideDuration:5e3,onClose:()=>{d(!1)},message:x().text("A new workflow has started")})))},Iv=(0,T.Z)({button:{padding:"9px 16px 9px 12px",marginLeft:"auto",marginRight:"8px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),Pv=()=>{const e=Iv(),[t,r]=(0,s.useState)(null),n=Vy(),a=n("START_PROCESS_INSTANCE"),l=n("VIEW_PROCESS_DEFINITIONS");return a&&l?c().createElement(c().Fragment,null,c().createElement(Le.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement(Yr.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},x().text("Add"))),c().createElement(Nv,{anchorEl:t,onClose:()=>r(null)})):null};function Dv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Av=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,ze._)(),l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.isWorkflowEnabled),c=(0,g.useSelector)(h.ZP.selectors.getTenant),p=(0,g.useSelector)(h.ZP.selectors.getEntityUri),d=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode),m=Vy()("VIEW_TASKS"),f=!(!l||!o)&&i&&m,[b,y]=(0,s.useState)(null),[x,v]=(0,s.useState)(0),[E,w]=(0,s.useState)(!1),C=(0,s.useCallback)((()=>{w(!0);const e=!Array.isArray(t)||t.includes("*")?null:t,i=(e||[null]).map((e=>(0,u.uT0)({entityUri:p,workflowPath:l,environment:o,tenant:c,filter:{assignee:r,processType:e},includeClosed:!!n})));a(Promise.all(i)).then((t=>{const n=(0,N.pipe)((0,N.map)((0,N.prop)("data")),(0,N.reject)(N.isNil),N.flatten,(0,N.uniqBy)((0,N.prop)("taskId")),(0,N.filter)(Rv(e,r)))(t);y(n),v(n.length)})).catch((e=>{console.warn("Workflow error",e)})).finally((()=>{w(!1)}))}),[p,o,a,c,l,r,n,t]);(0,s.useEffect)((()=>{p&&f&&!(0,u.ZiX)(p)?C():(y(null),v(0))}),[f,p,C,d]);const O=(0,s.useCallback)(((e,t)=>{y((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){Dv(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:b,total:x,loading:E,updateTaskState:O,loadWorkflowTasks:C}},Rv=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function jv(){return jv=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},jv.apply(this,arguments)}const Zv=e=>c().createElement("svg",jv({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"}))),Lv=(0,T.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 _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)}let Mv;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(Mv||(Mv={}));const Vv=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Mv.iconButton,label:a,disabled:l,icon:o,onClick:i=Cn.ZT,onMenuClose:s=Cn.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 p=Lv();return(()=>{switch(n){case"iconButton":return c().createElement(ye.k,_v({disabled:l,className:b()(p.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:o},u));case"button":return c().createElement(Le.Z,_v({className:b()(p.button,r),disabled:l,startIcon:c().createElement(o,null),onClick:i,color:"primary",classes:{startIcon:p.startIcon,label:p.label}},u),c().createElement(mi.C,{value:a},c().createElement("div",{className:p.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(Va.Z,_v({classes:{root:p.menuItem},onClick:e,disabled:l,ref:t},u),c().createElement(c().Fragment,null,c().createElement(o,{className:p.menuIcon}),c().createElement(E.Z,{classes:{root:p.menuText}},a)))}}})()}));Vv.displayName="ActionButton";const Bv=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:l=Cn.ZT}=e;const o=(0,g.useSelector)(h.ZP.selectors.getTenant),i=(0,g.useSelector)(h.ZP.selectors.getDtssPath),[c,p]=(0,s.useState)(!1);return{isPending:c,sendMergeAllRequest:(0,s.useCallback)((()=>{null==a||a(),p(!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(),p(!1)}))}),[i,t,r,n,a,o])}};function Uv(){return Uv=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},Uv.apply(this,arguments)}const zv=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Mv.iconButton,onMenuClose:a=Cn.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p}=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","onError"]);const{sendMergeAllRequest:m}=Bv({entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p});return c().createElement(Vv,Uv({className:r,disabled:l,mode:n,label:x().text("Merge"),icon:Zv,onClick:m,onMenuClose:a,ref:t},d))}));function Fv(){return Fv=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},Fv.apply(this,arguments)}zv.displayName="mergeButton";const Hv=e=>c().createElement("svg",Fv({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"}))),Wv=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a}=e;const l=(0,g.useSelector)(h.ZP.selectors.getTenant),o=(0,g.useSelector)(h.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 qv(){return qv=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},qv.apply(this,arguments)}const Gv=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Mv.iconButton,onMenuClose:a=Cn.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u}=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"]);const{sendMarkAsNotMatchRequest:d}=Wv({entity:o,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(Vv,qv({className:r,disabled:l,mode:n,label:x().text("Not a match"),icon:Hv,onClick:d,onMenuClose:a,ref:t},p))}));function $v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Gv.displayName="notMatchButton";const Yv=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){$v(e,t,r[t])}))}return e}({},e,{[n]:(0,N.pipe)(a,r)})}),{})),[r,t])};function Kv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xv(e,t,r[t])}))}return e}function Xv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qv=[],Jv=e=>console.error("Collaboration error",e),eE=e=>{let{objectIds:t=Qv,objectTypes:r,enabled:n=!0}=e;const a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getTenant),o=(0,g.useSelector)(h.ZP.selectors.getCollaborationPath),i=(0,g.useSelector)(h.ZP.selectors.isCollaborationEnabled)&&n,[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)([]),[f,b]=(0,s.useState)(null),[y,x]=(0,s.useState)(null),[v,E]=(0,s.useState)(!1),[w,C]=(0,s.useState)(!1),O=(0,s.useCallback)((e=>{b((t=>Kv({},t,e)))}),[]),T=null==a?void 0:a.uri,S=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&T&&!(0,u.ZiX)(T)){const r=e=>{console.warn("Collaboration error",e),b(null)};(0,N.pipe)(u.$oF,(0,N.andThen)((0,N.map)((0,N.props)(["objectId","comments"]))),(0,N.andThen)(N.fromPairs),(0,N.andThen)(t?b:O),(0,N.otherwise)(r))({uris:e,tenant:l,collaborationPath:o})}else b(null)}),[O,o,T,i,l]);(0,s.useEffect)((()=>{S(t,!0)}),[t,S]);const k=(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,N.uniqBy)((0,N.prop)("commentId"),[...e,...r]):r)),p(n)})).catch(Jv)}),[o,l]),I=(0,s.useCallback)((e=>{C(!0),(0,u.d7q)({collaborationPath:o,tenant:l,commentId:e}).then(x).catch(Jv).finally((()=>C(!1)))}),[o,l]),P=(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)=>{x(e),b((r=>Kv({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),m((t=>[e,...t]))})(t,a)})).catch(Jv).finally((()=>E(!1)))}),[o,l]),D=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i,commentId:s,replies:c}=e;E(!0);const p={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:p}).then((e=>(e=>{x(e),m((0,N.map)((0,N.when)((0,N.propEq)("commentId",e.commentId),(0,N.always)(e))))})(Kv({},e,{replies:c})))).catch(Jv).finally((()=>E(!1)))}),[o,l]),A=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;E(!0),(0,u.YFy)({collaborationPath:o,tenant:l,commentId:r}).then((()=>((e,t)=>{x(null),b((r=>{const n=r[t]||[];return Kv({},r,{[t]:n.filter((t=>t.commentId!==e))})})),m((t=>t.filter((t=>t.commentId!==e))))})(r,t))).catch(Jv).finally((()=>E(!1)))}),[o,l]),R=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";x("resolved"===n?e=>{if(e)return null}:t=>{if(t)return Kv({},t,{replies:[...t.replies,e]})}),b((e=>Kv({},e,{[t]:e[t].map((e=>e.commentId===r?Kv({},e,{status:n,replies:e.replies+1}):e))}))),m((t=>t.map((t=>t.commentId===r?Kv({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),j=(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 R(t,i,n)})).catch(Jv).finally((()=>E(!1)))}),[o,l,R]),Z=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[j]),L=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[j]);return{clearCurrentComment:(0,s.useCallback)((()=>{x(null)}),[]),comments:d,commentsMap:f,createComment:P,createReply:j,currentComment:y,deleteComment:A,editComment:D,getComment:I,getComments:k,getCommentsCount:S,loading:w,objectTypes:r,pageToken:c,reOpenThread:L,resolveThread:Z,sending:v}};function tE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rE=e=>{let{sorting:t,filter:r,page:n,rowsPerPage:a,config:l,entity:o,relationActivityFilter:i,mode:c}=e;const[p,d]=(0,s.useState)(!1),m=(0,g.useDispatch)(),f=(0,g.useSelector)(h.ZP.selectors.getTenant),b=(0,g.useSelector)(h.ZP.selectors.getDtssPath),{activityFilter:y,globalFilter:x}=(0,g.useSelector)(h.ZP.selectors.getGlobalSearchRequestOptions)||{},v=(0,ze._)(),E=(0,s.useCallback)((()=>{if(null!=o&&o.uri){const 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){tE(e,t,r[t])}))}return e}({},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:y},max:a,offset:n*a,filter:(0,u.vyX)(x,r)||void 0}),s=(0,N.cond)([[(0,N.pipe)((0,N.prop)("uri"),u.ZiX),()=>Promise.resolve([{total:0}])],[u.biM,t=>(0,u.n_1)({entityUri:t.uri,configs:[e],customerTenant:f,dataTenant:t.dataTenant,dtssPath:b})],[N.T,t=>(0,u.N6e)(t.uri,[e])]]);d(!0),v(s(o)).then((e=>{let[{connections:t,total:r}]=e;m(h.N5.relations.actions.relationsLoaded({id:l.id,connections:t,total:r}))})).finally((()=>{d(!1)}))}}),[y,l,m,b,null==o?void 0:o.uri,null==o?void 0:o.dataTenant,r,x,n,i,a,v,t,f]),w=(0,s.useRef)(!1);w.current=!1,(0,s.useEffect)((()=>{w.current=!0,E()}),[E]);const C=(0,mb.D)(c);return(0,s.useEffect)((()=>{c!==u.ARY.Viewing||w.current||C===c||(w.current=!0,E())}),[E,c,C]),{isLoading:p,reload:E}},nE=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var aE=r(11326);const lE=()=>{const[e,t]=(0,s.useState)([]),r=(0,g.useSelector)(h.ZP.selectors.getTenant),n=(0,g.useSelector)(h.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 oE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iE=(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){oE(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 sE=r(47081),cE=r(8007);const uE=c().createContext(!1);uE.displayName="ProfilePerspectiveViewContext";const pE=c().createContext("");pE.displayName="IdContext"}}]);