@reltio/remotes 1.4.1304 → 1.4.1305

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/6217.js +1 -1
  2. package/6217.js.map +1 -1
  3. package/package.json +1 -1
package/6217.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6217],{27815:(e,t,n)=>{n.d(t,{Z:()=>S});var r=n(24328),o=n.n(r),a=n(87918),l=n.n(a),i=n(71153),s=n.n(i),c=n(17440),u=n(52730),p=n(59431),d=n(82389),m=n(94079),g=n(92575),f=n(37285),b=n(96808),h=n(7785),y=n(79692);function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){v(e,t,n[t])}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x={input:e=>E({},e,{fontSize:"14px"}),menuPortal:e=>E({},e,{zIndex:1300})},w=(0,y.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"},option:{fontSize:"14px",height:"32px"},noOptionsMessage:{fontSize:"14px"}});const S=e=>{let{entityType:t,selectedAttributes:n,className:a,onChange:i,title:y,disableUnderline:E,menuPlacement:v="bottom"}=e;const S=(0,u.useSelector)(p.ZP.selectors.getMetadata),O=w(),C=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.reduce(((e,r)=>{if(r.hidden)return e;const o=`${n&&n+" / "}${r.label}`;e.push({label:r.label,value:r.uri,attrType:r,chipLabel:o,level:t});const a=(0,d.EUG)(S,r);return e.concat(a?C(a,t+1,o):[])}),[])}),[S]),P=(0,r.useMemo)((()=>C((null==t?void 0:t.attributes)||[])),[t,C]);return o().createElement("div",{className:s()(O.root,a)},o().createElement(m.Typography,{className:O.title,variant:"subtitle1"},y||l().text("Attribute")),o().createElement(g.Z,{value:n,options:P,TextFieldProps:{InputProps:{disableUnderline:E},classes:{root:O.dropDownInput}},components:{DropdownIndicator:b.Z,MultiValue:e=>{let{data:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["data"]);return o().createElement(f.Z,n,t.chipLabel)},Option:e=>{let{isFocused:t,isSelected:n,data:r,label:a,innerProps:l}=e;return o().createElement("div",l,o().createElement(h.Z,{checked:n,level:r.level,data:r,label:a,labelInText:a,isFocused:t}))}},onChange:(0,c.pipe)((0,c.defaultTo)([]),i),styles:x,classes:O,menuPlacement:v,menuPortalTarget:document.body}))}},10237:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),o=n(13980),a=n.n(o),l=n(24328),i=n.n(l);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const d=(0,l.forwardRef)(((e,t)=>{let{children:n,className:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","className"]);const l=u();return i().createElement(r.Z,p({ref:t,className:o,classes:{root:l["basic-view__paper"]}},a),n)}));d.displayName="BasicView",d.propTypes={children:a().node,className:a().string};const m=d},39621:(e,t,n)=>{n.d(t,{Z:()=>g});var r=n(24328),o=n.n(r),a=n(17440),l=n(87918),i=n.n(l),s=n(6782),c=n(94079),u=n(31517),p=n(31276);const d=(0,n(79692).Z)({root:{display:"flex",flex:1},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px",fontSize:"14px"},inputNumber:{minWidth:"60px",marginRight:10,height:"100%",backgroundColor:"rgba(0, 0, 0, 0.03)"},inputUnit:{width:"100%"}}),m=[i().text("minutes"),i().text("hours"),i().text("days"),i().text("weeks"),i().text("months"),i().text("years")],g=e=>{let{interval:[t,n],onChange:r,onFocus:l}=e;const i=d(),g=(0,a.pipe)(p.NA,parseInt,(e=>[e,n]),r),f=(0,a.pipe)((e=>{let{value:n}=e;return[t,n]}),r);return o().createElement("div",{className:i.root},o().createElement(c.TextField,{type:"number",value:t||"",onChange:g,inputProps:{min:1,onFocus:l},InputProps:{classes:{root:i.input}},className:i.inputNumber}),o().createElement(u.Z,{label:"",placeholder:(0,s.Z)(n),className:i.inputUnit,value:{value:n,label:(0,s.Z)(n)},options:m.map((e=>({value:e,label:(0,s.Z)(e)}))),onChange:f,TextFieldProps:{inputProps:{onFocus:l},InputProps:{classes:{root:i.input}}}}))}},85451:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),a=n(52730),l=n(87918),i=n.n(l),s=n(17440),c=n(71153),u=n.n(c),p=n(94079),d=n(92575),m=n(96808),g=n(82389),f=n(59431),b=n(79692);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){y(e,t,n[t])}))}return e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E={input:e=>h({},e,{fontSize:"14px"}),loadingMessage:e=>h({},e,{fontSize:"14px"}),menuPortal:e=>h({},e,{zIndex:1300})},v=(0,b.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"},option:{fontSize:"14px",height:"32px"}}),x=e=>{let{selectedUsers:t,onChange:n,className:l,disableUnderline:c}=e;const b=v(),h=e=>({value:e,label:e}),y=e=>e.map(h),x=(0,a.useSelector)(f.ZP.selectors.getTenant),w=(0,a.useSelector)(f.ZP.selectors.getServicesPath),S=(0,r.useRef)();return o().createElement("div",{className:u()(b.root,l)},o().createElement(p.Typography,{className:b.title,variant:"subtitle1"},i().text("User")),o().createElement(d.Z,{value:y(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),defaultOptions:!0,getOptions:e=>(S.current||(S.current=(0,g.kz_)({tenant:x,servicesPath:w})),S.current.then((0,s.pipe)((0,s.prop)("array"),(0,s.pluck)("username"),(e=>t=>e?t.filter((t=>g.P6Y.strings.search(t,e))):t)(e),y))),TextFieldProps:{InputProps:{disableUnderline:c},className:b.dropDownInput},components:{DropdownIndicator:m.Z},styles:E,classes:b,menuPortalTarget:document.body}))}},31537:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e.MODEL_UPDATED="MODEL_UPDATED",e.ENTITY_REMOVED="ENTITY_REMOVED",e.ENTITY_CREATED="ENTITY_CREATED",e.ENTITY_CHANGED="ENTITY_CHANGED",e.ENTITIES_MERGED="ENTITIES_MERGED",e.ENTITIES_SPLITTED="ENTITIES_SPLITTED",e.ENTITY_LOST_MERGE="ENTITY_LOST_MERGE",e.RELATIONSHIP_CREATED="RELATIONSHIP_CREATED",e.RELATIONSHIP_REMOVED="RELATIONSHIP_REMOVED",e.RELATIONSHIP_CHANGED="RELATIONSHIP_CHANGED",e.POTENTIAL_MATCHES_FOUND="POTENTIAL_MATCHES_FOUND",e.NOT_MATCHES_SET="NOT_MATCHES_SET",e.NOT_MATCHES_RESET="NOT_MATCHES_RESET",e.PERIODIC_TASK_SCHEDULED="PERIODIC_TASK_SCHEDULED",e.ENTITIES_MERGED_MANUALLY="ENTITIES_MERGED_MANUALLY",e.POTENTIAL_MATCHES_REMOVED="POTENTIAL_MATCHES_REMOVED",e.ENTITIES_MERGED_ON_THE_FLY="ENTITIES_MERGED_ON_THE_FLY",e.USER_LOGIN="USER_LOGIN",e.USER_LOGOUT="USER_LOGOUT",e.USER_SEARCH="USER_SEARCH",e.USER_PROFILE_VIEW="USER_PROFILE_VIEW",e.COMMENT_ADDED="COMMENT_ADDED",e.COMMENT_UPDATED="COMMENT_UPDATED",e.COMMENT_DELETED="COMMENT_DELETED",e.ANALYTICS_ATTRIBUTES_CHANGED="ANALYTICS_ATTRIBUTES_CHANGED",e.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE="SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE",e.GROUP_CREATED="GROUP_CREATED",e.GROUP_REMOVED="GROUP_REMOVED",e.GROUP_CHANGED="GROUP_CHANGED"}(r||(r={}))},34606:(e,t,n)=>{n.d(t,{te:()=>u,Io:()=>p,rx:()=>d,_V:()=>m,Xr:()=>g});var r=n(17440),o=n(87918),a=n.n(o),l=n(31537);function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){s(e,t,n[t])}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=(0,r.path)(["data","type"]),u=e=>{const{items:t,label:n}=e,[r]=t||[];return c(r)||n},p=e=>{const{items:t,label:n}=e,o=e=>{return t=c(e)||n,(0,r.pipe)(r.values,(0,r.includes)(t))(l.I);var t},a=(0,r.filter)(o)(t);return t.length!==a.length&&console.error("Activities not implemented:",(0,r.reject)(o)(t)),i({},e,{items:a,itemsTotal:a.length})},d=e=>(0,r.pipe)((0,r.propOr)([],"items"),(0,r.groupBy)(c),r.values,(0,r.ifElse)((e=>{let{length:t}=e;return t>1}),(0,r.map)((t=>i({},e,{items:t,itemsTotal:t.length}))),(()=>[e])))(e),m=e=>(0,r.isNil)(e)?"":"string"==typeof e?e:Array.isArray(e)?e.map(m).join(", "):(0,r.is)(Object,e)?m("value"in e?e.value:Object.values(e)):e.toString(),g=e=>({[l.I.COMMENT_ADDED]:a().text("Comment added"),[l.I.COMMENT_DELETED]:a().text("Comment deleted"),[l.I.COMMENT_UPDATED]:a().text("Comment updated"),[l.I.ENTITIES_MERGED]:a().text("Profile merged"),[l.I.ENTITIES_MERGED_MANUALLY]:a().text("Profile merged manually"),[l.I.ENTITIES_MERGED_ON_THE_FLY]:a().text("Profile merged on the fly"),[l.I.ENTITIES_SPLITTED]:a().text("Profile un-merged"),[l.I.ENTITY_CHANGED]:a().text("Profile updated"),[l.I.ENTITY_CREATED]:a().text("Profile created"),[l.I.ENTITY_LOST_MERGE]:a().text("Profile lost merge"),[l.I.ENTITY_REMOVED]:a().text("Profile removed"),[l.I.GROUP_CHANGED]:a().text("Group updated"),[l.I.GROUP_CREATED]:a().text("Group created"),[l.I.GROUP_REMOVED]:a().text("Group removed"),[l.I.MODEL_UPDATED]:a().text("Model was updated"),[l.I.NOT_MATCHES_RESET]:a().text("Not matches reset"),[l.I.NOT_MATCHES_SET]:a().text("Not matches set"),[l.I.PERIODIC_TASK_SCHEDULED]:a().text("Periodic task was scheduled"),[l.I.POTENTIAL_MATCHES_FOUND]:a().text("Potential matches found"),[l.I.POTENTIAL_MATCHES_REMOVED]:a().text("Potential matches removed"),[l.I.RELATIONSHIP_CHANGED]:a().text("Relationship updated"),[l.I.RELATIONSHIP_CREATED]:a().text("Relationship created"),[l.I.RELATIONSHIP_REMOVED]:a().text("Relationship removed"),[l.I.USER_LOGIN]:a().text("Logged in"),[l.I.USER_LOGOUT]:a().text("Logged out"),[l.I.USER_PROFILE_VIEW]:a().text("Profile viewed"),[l.I.USER_SEARCH]:a().text("Searched"),[l.I.ANALYTICS_ATTRIBUTES_CHANGED]:a().text("Analytics attribute changed"),[l.I.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE]:a().text("SFDC connector synchronization issue")}[e]||"")},51843:(e,t,n)=>{n.d(t,{Z:()=>b});var r=n(24328),o=n.n(r),a=n(95038),l=n.n(a),i=n(87918),s=n.n(i),c=n(17440),u=n(82389),p=n(94079),d=n(96808),m=n(37699);const g=(0,n(79692).Z)({root:{flex:1},dropdownIndicator:{transition:"transform .15s ease"},inputRoot:{fontSize:"14px",height:46},input:{padding:"0 12px 0"},dateOptionLabel:{minWidth:"100px"},paper:{minWidth:"112px"}}),f=l().localeData().longDateFormat("L"),b=e=>{let{values:t,onChange:n,onFocus:a}=e;const l=f,i=(0,r.useRef)(null),[b,h]=(0,r.useState)(!1),y=g(),E=(0,r.useCallback)((()=>{h((e=>!e)),a()}),[a]),v=()=>{h(!1)};return o().createElement("div",{className:y.root},o().createElement(p.TextField,{fullWidth:!0,value:t.map((e=>((e,t)=>(0,c.isNil)(e)?`${t}`:`${(0,u.mB6)({dataTypeDefinition:{type:u.oS0.TYPE_ACTIVENESS_DATE}},e)}`)(e,l))).join(" — "),onClick:E,variant:"filled",ref:i,InputProps:{endAdornment:o().createElement(d.Z,{selectProps:{classes:y,menuIsOpen:b},innerProps:{}}),disableUnderline:(0,c.isNil)(t),readOnly:!0,classes:{root:y.inputRoot,input:y.input}},InputLabelProps:{shrink:!1},placeholder:s().text(`${l} — ${l}`)}),o().createElement(p.Menu,{variant:"menu",open:b,autoFocus:!1,classes:{paper:y.paper},anchorEl:i.current,onClose:v,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:b,style:{width:"100%"}}},o().createElement(m.Z,{values:t,onCancel:v,onApply:e=>{n(e),h(!1)},type:u.oS0.TYPE_ACTIVENESS_DATE})))}},67885:(e,t,n)=>{let r,o;n.d(t,{K:()=>r,o:()=>o}),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(r||(r={})),function(e){e.INIT="init",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(o||(o={}))},35198:(e,t,n)=>{n.d(t,{_:()=>Oa,t:()=>Ha});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(24605),d=n(39450),m=n(97094),g=n(60115),f=n(585),b=n(82389),h=n(87918),y=n.n(h),E=n(3096),v=n.n(E),x=n(59431),w=n(60641),S=n(7718),O=n(3515),C=n(17554),P=n(61756),N=n(57730),T=n(76536),I=n(26481),k=n(49759),D=n(94150),Z=n(26005),R=n(72249),A=n(99136),j=n(30268),L=n(21077),M=n(67268),U=n(71153),H=n.n(U),_=n(8962);const z=o().createContext(null);z.displayName="SingleAttributeContext";var F=n(60995),V=n(10237),B=n(58662),W=n(94079),G=n(93416),q=n(75512),Y=n(30553),$=n(91181),X=n(32152),Q=n(36444),K=n(79692);const J=(0,K.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ee=e=>{let{className:t}=e;const n=J(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(z),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(W.Button,{ref:a,classes:{root:H()(n.triggerButton,t)},onClick:u},o().createElement(Q.Z,null)),o().createElement(W.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(W.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(W.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},te=(0,K.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),ne=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=te(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(z);return o().createElement(G.Z,{title:t,className:l.root},o().createElement(q.Z,{widthToHide:500},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(W.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement($.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(X.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(ee,null))};var re=n(65549),oe=n(93140),ae=n(76134),le=n(96698);const ie=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}}))),se=b.nIW,ce=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ce(n,t)})))):b.P6Y.strings.search(String(e),t),ue=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return ce(t,l)})))(t,n,r),c=(0,i.filter)(b.OXP,s);return{[(0,b.xy8)(r)]:{[se(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function pe(){return pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){me(e,t,n[t])}))}return e}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ge=[],fe=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c}=e;const u=ie(),{uri:p,required:m,cardinality:g,name:f}=n,h=(0,a.useDispatch)(),E=(0,r.useContext)(d.m),v=(0,a.useSelector)(x.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,v.uri)||{})),S=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),O=(0,a.useSelector)((e=>(0,b.tQX)(l,n,x.ZP.selectors.getProfileErrors(e)))),C=(0,a.useSelector)(x.ZP.selectors.getMode),P=(0,b.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(ge,[P,f]),(0,i.map)((0,i.prop)("uri")))(v),T=(0,i.pathOr)(ge,[P,f],w),I=T.map((0,i.prop)("uri")),k=(0,b.ZiX)(v.uri),D=(0,r.useRef)((0,b.gjI)({parentUri:l,attributeType:n})),Z=(0,b.O27)(T),R=m&&Z,A=R?[D.current]:T.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),j=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,h)(e.map((e=>de({},e,{viewId:E}))))),[E,h]),L=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.modifyAttribute,h)(de({},e,{viewId:E}))),[E,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,h)(de({},e,{viewId:E}))),[E,h]),U=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,h),[h]),_=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return j(R&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[j,l,n,R]),z=(0,b.Vg3)({attributeType:n,mode:C}),F={attributeType:n,errors:S,crosswalks:w.crosswalks,mode:C,onAddAttributes:j,onChangeAttribute:L,onDeactivateError:U,showNonOv:s},V=0===A.length&&0===t.length;return o().createElement("div",null,o().createElement(oe.Z,{cardinality:g}),o().createElement(ae.Z,{message:O}),z&&o().createElement(W.Button,{color:"primary",onClick:_,className:u.moreButton},o().createElement(re.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>o().createElement(le.Z,pe({key:e.uri},F,{attributeValue:e,lazy:R&&!m,showEmptyEditors:k,ownError:(0,b.ADq)(e,t,p,S),onDeleteAttribute:M})))),A.length>0&&t.length>0&&o().createElement(W.Divider,{className:u.divider}),t.map((e=>{const t=T.find((0,i.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!I.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,b.vKJ)({valueTransformer:(0,i.unless)(b.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:H()({[u.ovFalse]:!(0,b.OXP)(n)})},o().createElement(le.Z,pe({},F,{attributeValue:n,ownError:(0,b.ADq)(n,null,p,S),onDeleteAttribute:M,state:l})))})),V&&o().createElement(W.Typography,{className:u.noData},c))};var be=n(81303);const he=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},ye=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Ee=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=ye(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:h}=(0,r.useContext)(z),E=(0,a.useSelector)(x.ZP.selectors.getEntityUri),v=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),S=(0,a.useSelector)(x.ZP.selectors.getPivotingAttributes),O=0!==u.length,C=t["text-empty"]||y().text("No data found");return o().createElement(F.J.Provider,{value:S},o().createElement(V.Z,{className:H()(c.root,n)},o().createElement(ne,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(W.Box,{className:c.content},(()=>{if(g)return o().createElement(A.Z,null);if(b){if(v&&O){const e={values:u,attributeType:b,showInactive:h};return o().createElement(he,e)}if(w){const e={values:u,attributeType:b,parentUri:E,showInactive:h,noDataText:C};return o().createElement(fe,e)}}return o().createElement(W.Typography,{className:c.noData},C)})()),f&&o().createElement(B.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var ve=n(85229),xe=n(20562);function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Se=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(x.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[m,g]=(0,r.useState)(!1),f=(0,ve._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),E=(0,a.useSelector)(x.ZP.selectors.getApiPath),v=(0,a.useSelector)(x.ZP.selectors.getTenant),w=n?x.ZP.selectors.getEntityWithDiff:x.ZP.selectors.getEntityWithoutDiff,S=(0,a.useSelector)(w),O=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),C=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),P=(0,a.useSelector)(x.ZP.selectors.getHistoryDiff),N=S.uri,T=se(o),I=(0,b.xy8)(o);h.current=(0,b.JQy)(S,N,T);const k=(0,r.useMemo)((()=>(0,b.zeJ)(s,o)),[s,o]),{globalFilter:D}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:Z}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(N)&&(0,b.YOQ)(o)){g(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,b.biM)(S)||C?ue:b.KbL;f(a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){we(e,t,n[t])}))}return e}({metadata:s,entity:S,apiPath:E,tenant:v,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:D,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([I],e),n=(0,i.pathOr)([],[T],t);C||y(x.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:T,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",o],t))})).finally((()=>{g(!1)}))}else u([]),d(null)}),[E,N,v,o,l,s,t,D,k,C,P]);(0,r.useEffect)((()=>{R()}),[R]),(0,xe.D)((()=>{O&&R()}),[O]);const A=(0,i.partition)(b.OXP),[,j]=A(h.current||[]),L=Z?[]:j,M=Z?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),H=l<U,_=null!=p&&p.totalValues?p.totalValues-U:L.length;return{values:c,isLoading:m,hasPaging:H,totalVisibleValues:U,attributeType:k,totalNonVisibleValues:_,nonVisibleValues:L}};function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ce=n(37152),Pe=n(31274),Ne=n(79026),Te=n(8818),Ie=n(90324),ke=n(70595);const De=o().createContext(null);De.displayName="RelationsViewStateContext";const Ze=(0,K.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Re=e=>{let{className:t}=e;const n=Ze(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(De),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),E="asc"===s;return o().createElement(o().Fragment,null,o().createElement(W.Button,{ref:a,classes:{root:H()(n.button,t)},onClick:f},o().createElement(Q.Z,null)),o().createElement(W.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(W.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(W.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(W.Divider,{className:n.divider}),o().createElement(W.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Ne.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Te.k,{tooltipTitle:E?y().text("Ascending"):y().text("Descending"),icon:E?Ie.Z:ke.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Re.displayName="FilterButton";const Ae=Re,je=(0,K.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var Le=n(61932),Me=n(55847);const Ue=o().createContext(null);function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){_e(e,t,n[t])}))}return e}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ze=Math.pow(2,31)-1,Fe=(0,K.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var Ve=n(81137);const Be=e=>{let{label:t}=e;const n=Fe();return o().createElement(W.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Le.Z,null))},We=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(x.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Ue),i=(0,a.useSelector)(x.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),m=(0,a.useSelector)(x.ZP.selectors.getTenant),g=[He({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:ze})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return He({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const E=(0,r.useCallback)((()=>p(null)),[]),v=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:E,onImportClick:v}})(),s=Fe(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(Te.k,{size:"L",icon:Le.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:H()(s.tenant)},u)):o().createElement(Me.Z,{menuId:"importDT-table-actions",buttonComponent:Te.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(Be,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Ve.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:l,onSave:n})))},Ge=e=>{let{title:t,total:n}=e;const a=je(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(De);return o().createElement(G.Z,{title:t||"",className:a.header},n>0&&o().createElement(q.Z,{widthToHide:400},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(W.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(We,null),o().createElement(Ae,null))};var qe=n(11013),Ye=n(27604),$e=n(22983),Xe=n(31254),Qe=n(31039);const Ke=(0,K.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function Je(){return Je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Je.apply(this,arguments)}const et=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Ke(),u=(0,ve._)(),p=(0,a.useSelector)(x.ZP.selectors.getTenant),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),E=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(W.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(W.Tooltip,Je({onOpen:y,title:E,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},tt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var nt=n(77277);const rt=(0,K.Z)((()=>({container:{display:"flex"}})));function ot(){return ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const at=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=rt();return o().createElement("div",{className:a.container},o().createElement(nt.Z,ot({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(nt.Z,ot({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},lt=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),it=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=lt(),{entity:d,relation:m}=t,g=(0,b.$qe)(t),f=(0,b.xr3)(t),h=(0,b.iJH)(t),{entityType:E,entityLabel:v,preparedUri:x,relationLabel:w}=tt(t,n),S=(0,b.Fn9)(m)&&(0,b.Fn9)(d),{canRemove:O,canUpdate:C}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:b.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),P=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),T=(0,r.useCallback)((()=>{s(t)}),[s,t]),I=(0,r.useCallback)((()=>c(t)),[c,t]),k=(O||C)&&a&&!t.suggested?o().createElement(o().Fragment,null,C&&o().createElement(Te.k,{icon:Ye.Z,size:"XS",onClick:N,tooltipTitle:y().text("Edit")}),O&&o().createElement(Te.k,{icon:$e.Z,size:"XS",onClick:P,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?o().createElement(at,{acceptRelation:T,ignoreRelation:I,size:"small",disabled:h}):void 0,Z=h?y().text("ignored"):y().text("edited");return o().createElement("div",{className:H()(p.container,{[p.rowInactive]:!S},{[p.removed]:g||h})},o().createElement("div",{className:p.row},u&&u(),o().createElement(Xe.Z,{className:p.entityAvatar,entityType:E}),o().createElement(Qe.Z,{value:x,className:p.entityLabelContainer},o().createElement(et,{label:v,entity:d},o().createElement("span",{className:p.entityLabel},v)),(f||h)&&o().createElement(W.Typography,{variant:"caption",className:p.editedLabel},"(",Z,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},k),D))}));it.displayName="EditableRelationItem";const st=it,ct=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:t,direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=n(98989),dt=n(83543);const mt=(0,K.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),gt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=mt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,b.xvW)(n)?null:a?o().createElement(dt.Z,c):o().createElement(pt.Z,c)},ft=(0,K.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),bt=e=>{let{config:t,connection:n,children:l}=e;const i=ft(),{showInactive:s}=(0,r.useContext)(De),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>x.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>x.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ut(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(x.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||h(),s((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:h,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(gt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Pe.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Yt,{isLoading:m,config:t,loadRelations:d,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},ht=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),yt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(x.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>x.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>x.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>x.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),E=ht(),v=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,s,p,h,u]),w=(0,r.useCallback)((e=>{h(x.N5.relations.actions.closeRelationEditor(l.id,e)),h(x.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>x.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=x.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(x.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),S=l.content,O=ct(S.inRelations,S.outRelations),C=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(O.type),object:(0,i.evolve)({type:(0,i.always)(O.type),attributes:(0,i.always)(null)})}}))(e);h(x.N5.relations.actions.addRelation(l.id,t))}),[h,l,O]),P=(0,r.useCallback)((e=>{h(x.N5.relations.actions.ignoreRelation(l.id,{relationType:O.type,relationDirection:O.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,O]),[N,T]=(0,i.partition)(b.xvW,n),I=g&&f,k=0===N.length&&0===T.length,D=e=>{var t,n;const r=m.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,b.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:l,connection:e,key:c},(t=>r?o().createElement(qe.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(st,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:C,onIgnoreRelation:P})))},Z=I&&(!d||d&&d.parentEntityUri===u),R=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},Z&&o().createElement(W.Button,{color:"primary",onClick:v,className:E.moreButton},o().createElement(re.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},y().text("Add"))),R&&o().createElement(qe.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(D),N.length>0&&T.length>0&&o().createElement(W.Divider,{className:E.divider}),T.map(D),k&&o().createElement(W.Typography,{className:E.noData},c))};var Et=n(19603),vt=n(94646),xt=n(78101),wt=n(80931);const St=(0,K.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ct(e,t,n[t])}))}return e}function Ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pt=e=>{let{connection:t,className:n}=e;const l=St(),{relation:s}=t,c=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(x.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>Ot({attributes:Ot({},x.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(O.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(xt.A.Provider,{value:h},o().createElement(wt.Z,{className:H()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:H()(l.attributesList,n)},y().text("No attributes"))};var Nt=n(86602),Tt=n(82726);const It=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Te.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Nt.Z:Tt.Z,onClick:n})},kt=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=kt(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:E,relationLabel:v}=tt(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),S=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),O=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:H()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:H()(c.row,Et.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement(Xe.Z,{className:c.entityAvatar,entityType:h}),o().createElement(Qe.Z,{value:E,className:c.entityLabelContainer},o().createElement(et,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),v&&o().createElement("span",{className:c.relationLabel},`, ${v}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(vt.Z,{className:c.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(at,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(It,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(Pt,{connection:t}))}));Dt.displayName="RelationItem";const Zt=Dt;var Rt=n(52691),At=n(16208);const jt=e=>e.filter((e=>5===e.value)).length,Lt=e=>e.filter((e=>1===e.value)).length,Mt=e=>0===e.length?"0%":jt(e)/e.length*100+"%",Ut=e=>0===e.length?"0%":Lt(e)/e.length*100+"%",Ht=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),_t=e=>{let{ratings:t,className:n}=e;const r=Ht();return o().createElement("div",{className:H()(r.wrapper,n)},o().createElement(W.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:Mt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ut(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:H()(r.likesCount,r.count)},o().createElement(Rt.Z,{className:r.icon}),jt(t)),o().createElement("div",{className:r.count},o().createElement(At.Z,{className:r.icon}),Lt(t))))},zt=(0,K.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Ft=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=zt(),i=(0,a.useSelector)(x.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(W.Button,{onClick:n,variant:"text",size:"small",className:H()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Me.Z,{buttonProps:{endIcon:o().createElement(dt.Z,null),variant:"text",size:"small",className:H()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},Vt=(0,K.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Bt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Vt(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityLabel:y,entityType:E,preparedUri:v,relationLabel:w}=tt(t,h),S=(null==f?void 0:f.ratings)||[],O=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),C=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:O,connection:t})||[];return o().createElement("div",{className:H()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(W.Box,{display:"flex",minHeight:"44px",className:Et.U},o().createElement(W.Box,{display:"flex",alignItems:"center"},o().createElement(W.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Xe.Z,{entityType:E,className:u.entityTypeIcon})),o().createElement(W.Box,{display:"flex",flexDirection:"column"},o().createElement(Qe.Z,{value:v,className:u.entityLabelContainer},o().createElement(et,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Ft,{ratings:S,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&o().createElement(vt.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:C,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(at,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(_t,{ratings:S,className:u.ratings}),o().createElement(It,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Pt,{connection:t,className:u.relationAttributes}))},Wt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=ct(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===b.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(O.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:i,connection:e,key:r},(t=>c?o().createElement(Bt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Zt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Wt.displayName="RelationsList";const Gt=Wt,qt=(0,K.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Yt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=qt(),{selectors:u}=x.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(A.Z,null):(0,b.KIu)(d)?o().createElement(yt,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(Gt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(W.Typography,{className:c.noData},m)},$t=(0,K.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),Xt=e=>{let{config:t,className:n}=e;const l=$t(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(De),{selectors:h}=x.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),E=(0,a.useSelector)(h.getEntity),v=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),S=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{f("")}),[null==E?void 0:E.uri]);const O=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:C,reload:P}=(0,Ce.a)({sorting:S,filter:O,page:s,rowsPerPage:u,config:t,entity:E,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(y)),[y]),T=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Pe.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Ue.Provider,{value:T},o().createElement(Ge,{title:t.caption,total:v})),o().createElement("div",{className:l.content},o().createElement(Yt,{isLoading:C,config:t,loadRelations:P,connections:y,total:v}),v>u&&o().createElement(B.Z,{classes:{root:l.pagination},count:v,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};Xt.displayName="RelationsView";const Qt=o().createContext(null);Qt.displayName="SingleAttributeContext";var Kt=n(86361),Jt=n(26180),en=n(31276);function tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nn(e,t,n[t])}))}return e}function nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rn="CHANGE_SEARCH_QUERY",on=tn({},Jt.ZP.actions,{changeSearchQuery:(0,en.zD)(rn)}),an=(e,t)=>t.type===rn?tn({},e,{searchQuery:t.payload,page:0}):Jt.ZP.reducer(e,t);var ln=n(92332),sn=n(67353);const cn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},un=(0,K.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":cn}}))),pn=(0,sn.Z)((e=>{const t=un();return o().createElement("div",{className:t.headCell},o().createElement(ln.default,e))}));var dn=n(64091);function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gn=(0,i.pipe)((0,i.map)((e=>({id:(0,b.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,b.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),fn=(0,i.pipe)(b.DK$,gn),bn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),hn=e=>{if((0,b.vZp)(e)){const t=bn(e);return t.length>1?t.slice(0,-1):null}return null},yn=(0,i.map)((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){mn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:hn(e.id),headCellRenderer:pn,rowCellValueRenderer:dn.Z})));var En=n(99341);function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xn=n(52016),wn=n(1876),Sn=n(60894);const On=(0,K.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Cn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=On();return o().createElement(G.Z,{title:t,className:u.header},o().createElement(X.i,{query:n,onChange:r}),o().createElement(wn.Z,{enabled:a,onClick:l}),o().createElement(Y.Z,{height:24,margin:4}),o().createElement(Sn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function Pn(){return Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}const Nn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=un();return o().createElement("div",{className:H()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Pn({key:t,value:e},l)))))}));var Tn=n(85709);const In=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Te.k,{tooltipTitle:y().text("Edit"),icon:Ye.Z,size:"L",onClick:t}),n&&o().createElement(Te.k,{tooltipTitle:y().text("Remove"),icon:$e.Z,size:"L",onClick:n}))};function kn(){return kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kn.apply(this,arguments)}const Dn=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,b.tT_)(e))(t))(bn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>yn(t)),[t]),y=un(),E=(0,a.useSelector)(x.ZP.selectors.getMode),v=(0,b.KIu)(E),w=(0,a.useSelector)(x.ZP.selectors.getMetadata),S=(0,a.useSelector)(x.ZP.selectors.getEntityUri),O=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:C}=(0,r.useContext)(Qt),P=(0,r.useCallback)((e=>o().createElement(Nn,kn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,T]=(0,r.useState)(null),{canUpdate:I,canDelete:k}=(0,xn.l)(),D=(0,r.useMemo)((()=>"number"!=typeof N||!v||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,v]),Z="number"==typeof N&&(R=(0,i.path)([N],n),k(p)&&(0,b.xv5)({attributeType:C,mode:E,attributeValue:R,metadata:w,isReltioCrosswalk:(0,b.KVV)(O.crosswalks,R)}));var R;const A="number"==typeof N&&(e=>I(p)&&(0,b.yv0)({attributeType:C,mode:E,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(O.crosswalks,e)}))((0,i.path)([N],n)),j=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);A&&d(e)}),[d,N,n,A]),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!Z)return;const t={parentUri:S,attributeType:C,uri:e.uri,value:e};m(t),T(null)}),[N,n,m,Z,C,S]),M=D||!Z&&!A?void 0:o().createElement(In,{onEdit:A?j:void 0,onRemove:Z?L:void 0}),U=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Tn.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:T,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Zn=(0,K.Z)((()=>({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 Rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const An=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const p=Zn(),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Qt),f=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),h=(0,a.useSelector)(x.ZP.selectors.getMode),E=(0,a.useDispatch)(),v=(0,r.useContext)(d.m),w=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,E)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Rn(e,t,n[t])}))}return e}({},e,{viewId:v}))))),[v,E]),S=(0,b.ZiX)(m),O=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),C=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,E),[E]);return o().createElement(o().Fragment,null,o().createElement(le.Z,{expanded:!0,attributeValue:u,showEmptyEditors:S,onDeleteAttribute:s,onDeactivateError:C,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:O,attributeType:g,ownError:(0,b.ADq)(u,null,g.uri,O)}),o().createElement("div",{className:p.actionButtons},o().createElement(W.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(W.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},y().text("Apply"))))},jn=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Mn(e,t,n[t])}))}return e}function Mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Un=[],Hn=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=jn(),{values:u,page:p,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:E,onFilter:v,onSort:w,onToggleFilters:S,onChangeColumns:O,filters:C,sorting:P,totalVisibleValues:N,hasPaging:T,attributeType:I,showTable:k}=(0,r.useContext)(Qt),D=(0,r.useMemo)((()=>fn(I)),[I]),{checkHasChanges:Z,onChangeAttribute:R,onDeleteAttribute:j,onAdd:L,onCancel:M,onApply:U,onStartEditing:_,modifiedValues:z,editingValues:F,deletedUris:q}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(x.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(d.m),{attributeType:u,values:p}=(0,r.useContext)(Qt),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),g=(0,a.useSelector)(x.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Ln({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Ln({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:m,attributeType:u});t(e.uri),f(Ln({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),E=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),v=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Ln({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),S=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),O=(0,b.KIu)(l),C=(0,b.xy8)(u),P=(0,i.pathOr)(Un,[C,null==u?void 0:u.name],S),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),T=(0,r.useMemo)((()=>O?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(p):[]),[P,p]),I=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:h,onAdd:y,onCancel:v,onApply:w,onStartEditing:E,modifiedValues:N,editingValues:I,deletedUris:T}})(),Y=(0,a.useSelector)(x.ZP.selectors.getMode),$=(0,b.KIu)(Y),X=$?z:u,{canCreate:Q}=(0,xn.l)(),K=Q(t)&&I&&(0,b.Vg3)({attributeType:I,mode:Y})&&!F.length,J=(0,r.useMemo)((()=>E.map((e=>D.find((0,i.propEq)("id",e))))),[E,D]);return o().createElement(V.Z,{className:H()(c.root,n)},k?o().createElement(o().Fragment,null,o().createElement(Cn,{title:l,total:N,columnsData:D,selectedColumns:E,onChangeColumns:O,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!C,onToggleFilters:S}),o().createElement("div",{style:{position:"relative"}},$&&o().createElement("div",{className:c.editor},K&&o().createElement(W.Button,{color:"primary",onClick:L,className:c.addButton},o().createElement(re.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},y().text("Add"))),F.map((e=>o().createElement(An,{key:e.uri,attributeValue:e,onChangeAttribute:R,onDeleteAttribute:j,onCancel:M,onApply:U,hasChanges:Z(e)})))),o().createElement(Dn,{columnsData:J,config:t,values:X,filters:C,onFilter:v,sorting:P,onSort:w,onEdit:_,onDeleteAttribute:j,deletedUris:q}),T&&o().createElement(B.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:p,onChangePage:m}),g&&o().createElement(A.Z,null))):o().createElement(o().Fragment,null,o().createElement(G.Z,{title:l,className:c.header}),o().createElement(W.Typography,{className:c.noData},y().text("No data"))))};var _n=n(58600);function zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Fn=0;const Vn=()=>Fn++,Bn=e=>{const t={children:[],nodeId:Vn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Vn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Wn=(0,K.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Gn=n(1242);const qn=o().createContext(null);var Yn=n(55400);const $n=e=>{e.target.src=Gn},Xn=e=>{let{node:t}=e;const n=Wn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(x.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,r.useContext)(qn),p=(0,a.useSelector)(x.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(x.ZP.selectors.getEntity),m=(0,b.ChB)({uiPath:p,uri:i}),g=i===d,f=(0,r.useCallback)((()=>{l(x.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,E=(0,b.nt9)(c,t.entity.type)||{},v=(0,b.VD3)(c,E,"typeGraphIcon"),w=v&&(0,b.vPL)(s,v);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(W.Avatar,{className:H()(n.avatar),src:w||Gn,onError:$n}),o().createElement("span",{className:H()(n.link,{[n.selected]:g})},o().createElement(Yn.Z,{to:m,onClick:f},h))))},Qn=((0,r.memo)(Xn),e=>{let{node:t}=e;return t.nodeId}),Kn=(0,K.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(){return tr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tr.apply(this,arguments)}const nr={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Kn();return o().createElement("div",tr({style:{height:"100%"}},p,{key:a.nodeId}),m&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},m&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:H()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Kn(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){er(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",Jn({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function rr(){return rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rr.apply(this,arguments)}const or=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",rr({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},ar=e=>{let{title:t,onGraphOpen:n}=e;const r=Wn();return o().createElement(G.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Te.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:or,onClick:n,size:"L"})))};var lr=n(9757);const ir=(0,K.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){cr(e,t,n[t])}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ur=n(14940);const pr=(0,K.Z)({resizableHandleContainer:{position:"relative",width:"100%",height:"inherit"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),dr=e=>{const t=t=>{const n=pr();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:H()("viewDraggableHandle",n.resizableHandle)},o().createElement(ur.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},mr=(0,K.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var gr=n(29103),fr=n(83911),br=n(48747),hr=n(22385);const yr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Er=(0,K.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var vr=n(13074),xr=n(24338);const wr=(0,K.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Sr=wr,Or=e=>{let{totalImages:t}=e;const n=Sr(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(W.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pr(e,t,n[t])}))}return e}function Pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Nr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(xr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Cr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Cr({},e,{viewId:d})),imageSize:kr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Or,{totalImages:p.length}))},Tr=(0,K.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Ir=Tr,kr={imageMargin:4,imageWidth:162,imageHeight:162};var Dr=n(28741);const Zr=(0,K.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Rr=n(49734),Ar=n(98808),jr=n(93428),Lr=n(30885);function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}const Ur=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),{canMerge:p,canMark:m}=(0,b.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Ar.N.iconButton,onStartRequest:l},h=(0,r.useContext)(d.m),y=(0,r.useCallback)((()=>{i(),s(x.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(jr.H,Mr({},f,{onFinishRequest:y})),m&&o().createElement(Lr.i,Mr({},f,{onFinishRequest:i})))},Hr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(x.ZP.selectors.getMetadata),c=(0,a.useSelector)(x.ZP.selectors.getEntity);return o().createElement(Rr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:Et.U},o().createElement(vt.Z,{uri:(0,b.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(Ur,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},_r={showTransitiveMatches:!0,showInactiveEntities:!1},zr={order:"asc",field:"score"};var Fr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Fr||(Fr={}));const Vr=dr((e=>{let{className:t}=e;const n=mr();return o().createElement(V.Z,{className:H()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Br=dr((e=>{let{className:t,config:n}=e;return o().createElement(_.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Wr=dr((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=Se(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Oe(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(z.Provider,{value:a},o().createElement(Ee,{config:n,className:t}))})),Gr=dr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(x.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>fn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(an,c),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>b.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,En.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),E=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:d})),[y,f,g,d]),{changeSearchQuery:v,changePage:w,toggleSort:S,changeFilter:O,toggleFilters:C,changeColumns:P}=(0,Kt.o)({actions:on,dispatch:p}),N=Se(e,E,!1);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){vn(e,t,n[t])}))}return e}({},u,{setSearchQuery:v,setPage:w,onSort:S,onFilter:O,onToggleFilters:C,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden)},N)})(t);return o().createElement(Qt.Provider,{value:l},t&&o().createElement(Hn,{config:t,className:n}))})),qr=dr((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[p,d]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(De.Provider,{value:a},o().createElement(Xt,{config:t,className:n}))})),Yr=dr((e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:b,popup:h}=(0,lr.E)(t),y=ir(),E=f||d;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{c(!!h)}),[h]),(0,r.useEffect)((()=>{s&&l.current&&(l.current.innerHTML="",h&&Array.from(h.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[s,h]);const v=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(W.Dialog,{ref:l,open:!!h}),o().createElement(W.Tooltip,{title:E||""},o().createElement("div",{ref:a,style:sr({},v,b),className:H()(y.root,n)}))):null})),$r=dr((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{treeData:s,setTreeData:c}=((e,t)=>{const n=(0,ve._)(),[o,l]=(0,r.useState)([]),s=(0,a.useSelector)(x.ZP.selectors.getEntity);return(0,xe.D)((()=>{const e=o.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){zn(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],s),e);l(t.map((0,i.prop)("root")))}),[null==s?void 0:s.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||n((0,b.RFJ)({uri:e,graphUri:t})).then(Bn).then(l).catch((e=>{console.warn(e)})),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l}})(l,t.graph.type),u=Wn(),p=(0,a.useDispatch)(),{id:d,graph:m}=t,g=(0,r.useCallback)((()=>{p(x.ui.actions.openGraph({viewId:d,graphType:m.type}))}),[p,d,m]),f=(0,r.useCallback)((e=>({title:o().createElement(Xn,{node:e.node})})),[]);return o().createElement(V.Z,{className:n},o().createElement(ar,{onGraphOpen:g,title:t.caption}),o().createElement(qn.Provider,{value:t},o().createElement("div",{className:u.treeContainer},o().createElement("div",{className:u.tree},o().createElement(_n.ZP,{isVirtualized:!1,treeData:s,canDrag:!1,theme:nr,generateNodeProps:f,onChange:c,getNodeKey:Qn})))))})),Xr=dr((e=>{let{config:t,className:n}=e;const l=Zr(),s=(0,a.useSelector)(x.ZP.selectors.getEntity),c=(0,b.wwR)(s),[u,p]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:E,total:v}=(0,Dr.s)({enabled:!!c,entity:s,options:_r,filter:"",page:0,sorting:zr,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{E()}),[E]),S=(0,a.useDispatch)(),C=(0,r.useContext)(d.m),P=(0,r.useCallback)((()=>{S(x.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:C}))}),[S,C]),N=(0,r.useMemo)((()=>(0,b.NVY)(c,(0,i.map)(b.ev7,f))),[c,f]),{getCommentsCount:T}=(0,r.useContext)(O.h);(0,r.useEffect)((()=>{T(N)}),[T,N]);const I=v>3&&!(0,i.isEmpty)(f),k=u?Fr.Loading:(0,i.isEmpty)(f)?Fr.NoData:Fr.Loaded;return o().createElement(Pe.X.Provider,{value:h},o().createElement(V.Z,{className:H()(l.root,n)},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},k===Fr.Loading&&o().createElement(A.Z,null),k===Fr.NoData&&o().createElement(W.Typography,{className:l.noData},y().text("No matches found")),k===Fr.Loaded&&f.map((e=>o().createElement(Hr,{config:t,entitiesMap:h,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),I&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(W.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),Qr=(0,r.lazy)((()=>n.e(2493).then(n.bind(n,52493)).then((e=>({default:dr(e.HierarchyTreeView)}))))),Kr=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:dr(e.RelationshipsTableView)}))))),Jr=dr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=Er(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),p=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,ve._)();return(0,r.useEffect)((()=>{i(!0),s((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(yr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(A.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(V.Z,{className:H()(s.root,i)},m&&o().createElement(A.Z,null),o().createElement(hr.Z,{size:"S",icon:n?fr.Z:gr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(br.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:s.fullHeight,mapKey:p,mapOptions:h}))})),eo=dr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Ir(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(x.ZP.selectors.getMode),p=(0,a.useSelector)(x.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,E=t["text-empty"]||y().text("No data found"),v=(0,r.useCallback)((e=>c(x.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:v};return o().createElement(Nr,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:kr,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:v};return o().createElement(o().Fragment,null,o().createElement(vr.Z,e),o().createElement(Or,{totalImages:h}))}}return o().createElement(W.Typography,{className:s.noData},E)})()))}));class to{}to.ViewTypes=b.ZIY,to.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case to.ViewTypes.HierarchyTree:return o().createElement(Qr,{config:r,store:n,className:a});case to.ViewTypes.HierarchyPaths:return o().createElement($r,{config:r,className:a});case to.ViewTypes.RelationsTable:return o().createElement(Kr,{config:r,store:n,className:a});case to.ViewTypes.Relations:return o().createElement(qr,{config:r,className:a});case to.ViewTypes.Attributes:return o().createElement(Br,{className:a,config:r});case to.ViewTypes.SingleAttributeView:return o().createElement(Wr,{config:r,className:a});case to.ViewTypes.TableAttributeView:return o().createElement(Gr,{config:r,className:a});case to.ViewTypes.MapView:return o().createElement(Jr,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case to.ViewTypes.CustomView:return o().createElement(Yr,{config:r,className:a});case to.ViewTypes.ImageAttributeView:return o().createElement(eo,{config:r,className:a});case to.ViewTypes.PotentialMatchesView:return o().createElement(Xr,{config:r,className:a})}},to.getComponent=e=>to.getComponentBy("class",e)||to.getComponentBy("react-class",e)||o().createElement(Vr,{className:e.className});const no=to,ro=()=>null,oo=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=mr();return o().createElement(r.Suspense,{fallback:o().createElement(ro,null)},no.getComponent({config:t,store:n,className:H()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));oo.displayName="ViewComponent";const ao=(0,K.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function lo(){return lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}const io=["onConfigChanged","onRemove"],so=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),h=ao(),y=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{store:E}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const v=f.class===no.ViewTypes.CustomView;return v&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC?null:f.class!==no.ViewTypes.MapView||y?o().createElement("div",lo({},(0,i.omit)(io,g),{style:u,className:H()(s,{[h.item]:!v})}),o().createElement("div",{className:H()({[h.fixedSizeContainer]:!m})},m,o().createElement(oo,{store:E,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),c):null},co=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(M.Z,{LayoutItem:so,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var uo=n(72753),po=n(43576),mo=n(64459),go=n(3409),fo=n(93873),bo=n(22860);function ho(){return ho=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ho.apply(this,arguments)}const yo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",ho({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))};function Eo(){return Eo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eo.apply(this,arguments)}const vo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Eo({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().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:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},xo=(0,K.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function wo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){So(e,t,n[t])}))}return e}function So(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Oo=e=>o().createElement(W.SvgIcon,e,o().createElement(yo,null)),Co=e=>o().createElement(W.SvgIcon,e,o().createElement(vo,null)),Po=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),No=e=>{let{className:t,profileBandConfig:n}=e;const l=xo(),s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,u.uri))),d=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(x.ZP.selectors.getMode),f=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),h=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),E=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),v=(0,a.useSelector)(x.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,S=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),O=v===b.OXy.Saving,C=v===b.OXy.Cloning||O,[P,N]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{N(!1)}),[]),I=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(x.ZP.selectors.getMetadata),s=(0,a.useDispatch)(),c=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,c),[l,c]),d=(0,b.nt9)(l,c),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(c),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,c]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);s(x.N5.entity.actions.entityCloneRequested({data:wo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),k=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:b.fO_.EDITING,description:y().text("Edit profile directly"),icon:po.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:b.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Oo,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:b.fO_.VIEWING,description:y().text("Suggest changes and initiate a workflow review"),icon:uo.Z,permission:"READ"}]),[]),D=(0,r.useMemo)((()=>[...I?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Co,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:$e.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&s(x.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[s,u.uri,I]),Z=!E&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(S),R=(0,b.ZiX)(null==u?void 0:u.uri),A=(0,r.useMemo)((()=>Po(k,S,R,m,c)),[k,S,m,c,R]),j=(0,r.useMemo)((()=>Po(D,S,R,m,c)),[D,S,m,c,R]),L=(0,r.useCallback)((e=>{s(x.N5.mode.actions.modeUpdated(e))}),[s]),M=(0,r.useCallback)((()=>{s(x.N5.mode.actions.modeCancelEditing())}),[s]),U=(0,r.useCallback)((()=>{s(x.N5.actions.saveProfile())}),[s]);return o().createElement(o().Fragment,null,o().createElement(mo.Z,{className:H()(t,Et.U),entity:f&&p?p:u},o().createElement(W.Box,{display:"flex",alignItems:"center"},o().createElement(W.Box,{mr:3},f&&o().createElement(W.Box,{className:l.editingButtons},o().createElement(W.Button,{variant:"outlined",onClick:M,"data-reltio-id":"reltio-profile-cancel-editing",disabled:C},y().text("Cancel")),o().createElement(W.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:U,disabled:C},(0,b.fnZ)(g)?y().text("Suggest"):y().text("Save"))),E&&h?o().createElement(go.Z,null):h&&o().createElement(fo.a,null)),Z&&o().createElement(bo.T,{optionsGroup:A,buttonsGroup:j,value:g,onChange:L,disabled:C})),o().createElement(W.Box,{className:l.comments},o().createElement(vt.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!I&&o().createElement(Ve.Z,{open:P,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:I,onDiscard:T,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var To=n(71820),Io=n(85890),ko=n(26789),Do=n(54362),Zo=n(6674),Ro=n(91515),Ao=n(52043),jo=n(17308),Lo=n(39827),Mo=n(80147),Uo=n(76569);const Ho=(0,K.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),_o=()=>{const{total:e}=(0,r.useContext)(D.O),t=Ho();return o().createElement(W.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Uo.Z,null))};var zo=n(26313),Fo=n(9371),Vo=n(4426);const Bo=(0,K.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Wo=()=>{const e=Bo(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(O.h),i=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,zo.Q)(n);return o().createElement(Pe.X.Provider,{value:s},o().createElement(W.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Fo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(W.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Vo.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var Go=n(34120);const qo=(0,K.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Yo=()=>{const e=qo(),{tasks:t,loading:n}=(0,r.useContext)(D.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(A.Z,null),t&&t.map((e=>o().createElement(Go.s,{key:e.taskId,task:e}))))};function $o(){return $o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(this,arguments)}const Xo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",$o({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().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:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},Qo=()=>{const{commentsMap:e}=(0,r.useContext)(O.h),t=Ho();return o().createElement(W.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Xo,null))};var Ko=n(10159);const Jo=()=>o().createElement(Ko.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),ea=()=>o().createElement(Ko.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function ta(){return ta=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}let na;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(na||(na={}));const ra=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},oa=()=>{var e,t,n;const l=Ho(),s=(0,a.useSelector)(x.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(x.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(x.ZP.selectors.isCollaborationEnabled),d=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent),m=(0,a.useSelector)(x.ZP.selectors.getMetadata),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,r.useContext)(D.O),h=(0,r.useContext)(O.h),[E,v]=(0,r.useState)(null),w=(0,r.useCallback)((e=>{v((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{v(null)}),[]),C=null!==E,P=E===na.History,{isHistoryEnabled:N,isProfilePersisted:T}=(0,To.C)({isHistoryTabActive:P,entity:g}),{historyFilter:I,onApplyFilter:k,isLoading:Z,historicUris:R,historyWithTotal:A,canLoadMore:j,onLoadMore:L}=(0,Io.k6)({entity:g,enabled:N}),M=s&&c&&!(0,b.ZiX)(null==g?void 0:g.uri),U=u&&p,H=(0,b.mdt)(null==h?void 0:h.commentsMap),_=[{buttonProps:{id:na.Workflow,icon:_o,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?o().createElement(Yo,null):o().createElement(Jo,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:ra(null==f?void 0:f.total),rightContent:o().createElement(ko.G,null)},hidden:!M},{buttonProps:{id:na.Collaboration,icon:Qo,tooltipTitle:y().text("Collaboration")},content:H?o().createElement(Wo,null):o().createElement(ea,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:ra(H)},hidden:!U},{buttonProps:{id:na.History,icon:Mo.Z,tooltipTitle:y().text("History")},content:T?o().createElement(Do.Z,{isLoading:Z,historyWithTotal:A,contributorsUris:R,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:L,canLoadMore:j}):o().createElement(Zo.Z,null),headerProps:{content:o().createElement(Ro.Z,{total:T?((null==R?void 0:R.length)||0)+1:void 0,entityType:(0,b.nt9)(m,null==g?void 0:g.type),filter:I,onApplyFilter:k})}}],z=(0,i.reject)((0,i.propEq)("hidden",!0))(_);return(0,r.useEffect)((()=>{var e;null!==(e=_[E])&&void 0!==e&&e.hidden&&S()}),[E,_,S,z]),o().createElement("div",{className:l.wrapper},o().createElement(Ao.h,{open:C,width:480},!(null!==(e=_[E])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(jo.P,ta({},null===(t=_[E])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=_[E])||void 0===n?void 0:n.content)),o().createElement(Lo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(_),onButtonClick:w,activeIndexId:E}))};var aa=n(39781),la=n(16715);const ia="48px",sa="1px solid rgba(0, 0, 0, .125)",ca=(0,K.Z)((e=>({accordion:{borderTop:sa,borderBottom:sa,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:ia,minHeight:ia,"&$accordionSummaryExpanded":{height:ia,minHeight:ia}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),ua=ca;var pa=n(38016);const da=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=ua();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(W.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(W.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(pa.Z,null)},i,o().createElement(W.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(W.AccordionDetails,{className:H()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));da.displayName="ErrorsPanel";const ma=(0,i.omit)(["deactivated","path"]),ga=(0,r.memo)((e=>{let{error:t}=e;const n=ua(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.useSelector)(x.ZP.selectors.getMetadata),t),l=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));ga.displayName="Error";const fa=()=>{const e=ua(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,i.equals)(e.map(ma),t.map(ma))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(x.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:o().createElement(aa.Z,{className:H()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?y().text("warning"):y().text("warnings")}),icon:o().createElement(la.Z,{className:H()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(da,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ga}):null},ba=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));var ha=n(87685);const ya=(0,K.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Ea=e=>{let{notification:t}=e;const n=ya({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(x.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(x.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{c.cancelAction&&l(c.cancelAction),u(void 0)}),[c]),f=(0,r.useCallback)((()=>{l(c.applyAction),u(void 0),l(x.ui.actions.closeNotification(t.id))}),[c,t]),b=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(W.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),h=o().createElement(o().Fragment,null,o().createElement(hr.Z,{className:n.closeIcon,size:"S",icon:ha.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(W.Portal,{container:document.body},o().createElement(W.Snackbar,{autoHideDuration:s,open:p,classes:{root:n.snackbar},action:b,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),o().createElement(Ve.Z,{open:!!c,title:null==c?void 0:c.confirmationText,content:null==c?void 0:c.confirmationDescription,onSave:f,onDiscard:g,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},va=()=>{const e=(0,a.useSelector)(x.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Ea,{key:e.id,notification:e})))):null},xa={},wa=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i}=e;const s=ba({maxWidth:null==n?void 0:n.maxWidth}),c=(0,a.useDispatch)(),u=(0,r.useCallback)((()=>i().then((e=>e.layout?{}:e))),[i]),p=(0,r.useRef)(),d=(0,r.useCallback)((0,b.DsO)(l,1e3),[l]),m=(0,a.useSelector)(x.ZP.selectors.getEntity),g=null!=n&&n.nestedRoute?`/${n.nestedRoute}`:"",f=m?m.type:null,h=f&&n?f+g:null,{isLoaded:E,savedState:M=xa,updateSavedState:U}=(0,w.w)({getSavedState:u,saveState:d,entityTypeUri:h}),[H,_]=(0,r.useState)([]),[z,F]=(0,r.useState)([]),V=(0,r.useMemo)((()=>v()(n)),[n]),B=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),W=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),G=(0,S.C)({objectIds:W}),q=(0,r.useContext)(O.h),Y=(0,C.U)(),$=(0,P.v)(null==n?void 0:n.workflow),X=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent);(0,N.a)({entity:m,historyEvent:X});const Q=(0,T.u)(),K=(null===(t=(0,a.useSelector)(x.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"";(0,r.useEffect)((()=>{if(E){const e=V!==M.configHash,{views:t,layout:r}=(0,b.Mfk)({views:e||!M.views?n.views:M.views,layout:e?n.layout:M.layout});F(t),_(r)}}),[E,M,h]),(0,r.useEffect)((()=>{c(x.N5.views.actions.profileViewsSet(z))}),[c,z]),(0,r.useEffect)((()=>{n.sidePanelViews&&c(x.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>{p.current&&(p.current.scrollTop=0)}),[null==m?void 0:m.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(x.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(x.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),s=(0,a.useSelector)(x.ZP.selectors.getMode),c=(0,a.useSelector)(x.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(x.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&s===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const J=(0,r.useCallback)((e=>{U({layout:e,views:z,configHash:V}),_(e)}),[U,V,z]),ee=p.current,te=(0,r.useMemo)((()=>({element:ee,priority:["top","bottom"]})),[ee]);return o().createElement(I.j.Provider,{value:!0},o().createElement(k.s.Provider,{value:Y},o().createElement(O.h.Provider,{value:B?q:G},o().createElement(D.O.Provider,{value:$},o().createElement(Z.m.Provider,{value:Q},o().createElement(R.l.Provider,{value:K},o().createElement("div",{className:s.perspectiveView},(!E||!(null!=m&&m.uri))&&o().createElement(A.Z,null),E&&null!=m&&m.uri?o().createElement("div",{className:s.profileContainer},o().createElement("div",{className:s.profileWrapper},o().createElement(No,{profileBandConfig:n.profileBand}),!B&&o().createElement(fa,null),o().createElement("div",{ref:p,className:s.scrollWrapper},o().createElement(j.p.Provider,{value:te},o().createElement(co,{layout:H,onLayoutChanged:J,views:z})))),o().createElement(oa,null)):o().createElement("div",{className:s.emptyState},o().createElement(L.ZP,{LogoRenderer:L.B9.NO_DATA,text:y().text("No data to display."),variant:L.tC.embedded})),o().createElement(va,null))))))))}));wa.displayName="ProfilePerspectiveView";const Sa=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),Oa=e=>{let{config:t,store:n,onResize:h=i.identity,saveState:y,getSavedState:E,qxSandboxApi:v}=e;const x=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:w,showSnackbarMessage:S}=(0,p.D)(),O=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:null==O?void 0:O.id},o().createElement(m.S.Provider,{value:S},o().createElement(g.Y.Provider,{value:v},o().createElement(s.StylesProvider,{generateClassName:Sa},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>h(Math.floor(e),Math.floor(t))}),O&&o().createElement(wa,{config:O,saveState:y,getSavedState:x}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var Ca=n(82842),Pa=n(51229),Na=n(91131);const Ta=(0,K.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),Ia=e=>{let{total:t=0}=e;const n=Ta(),l=(0,a.useDispatch)(),i=(0,r.useContext)(d.m),s=(0,r.useCallback)((()=>{l(x.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(G.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(W.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},y().text("Profile")),o().createElement(Na.Z,{className:n.icon}),y().text("Tags")),o().createElement(Pa.Z,null),o().createElement(W.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var ka=n(20404);const Da=(0,K.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),Za=e=>{let{label:t}=e;const n=Da();return o().createElement(W.Toolbar,{className:n.toolbar},o().createElement(ka.Z,{className:n.avatar}),o().createElement(W.Typography,{variant:"h6",className:n.label},t))};function Ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Aa(e,t,n[t])}))}return e}function Aa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ja=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),La=[25,50,100],Ma=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=ja(),[s,c]=(0,r.useState)(La[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,ve._)(),u=(0,ve._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:E,requestTotal:v}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(x.ZP.selectors.getTenant),s=(0,a.useSelector)(x.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Ra({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,b.E7G)(c))):(0,b.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Ra({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(v()).then(g).catch(w)}),[v,c,w]),(0,r.useEffect)((()=>{d(!0),u(E(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,E,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const E=g>La[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Za,{label:t}),o().createElement("div",{className:H()(l.tagsContainer,{[l.fullHeight]:E})},o().createElement(V.Z,{className:l.tagsView},o().createElement(Ia,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(A.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(Ca.Z,{entities:f})),E&&o().createElement("div",{className:l.pagination},o().createElement(B.Z,{count:g,rowsPerPageOptions:La,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));Ma.displayName="TagPerspectiveView";const Ua=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ha=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(d.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Ua},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Ma,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6217],{27815:(e,t,n)=>{n.d(t,{Z:()=>S});var r=n(24328),o=n.n(r),a=n(87918),l=n.n(a),i=n(71153),s=n.n(i),c=n(17440),u=n(52730),p=n(59431),d=n(82389),m=n(94079),g=n(92575),f=n(37285),b=n(96808),h=n(7785),y=n(79692);function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){v(e,t,n[t])}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x={input:e=>E({},e,{fontSize:"14px"}),menuPortal:e=>E({},e,{zIndex:1300})},w=(0,y.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"},option:{fontSize:"14px",height:"32px"},noOptionsMessage:{fontSize:"14px"}});const S=e=>{let{entityType:t,selectedAttributes:n,className:a,onChange:i,title:y,disableUnderline:E,menuPlacement:v="bottom"}=e;const S=(0,u.useSelector)(p.ZP.selectors.getMetadata),O=w(),C=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.reduce(((e,r)=>{if(r.hidden)return e;const o=`${n&&n+" / "}${r.label}`;e.push({label:r.label,value:r.uri,attrType:r,chipLabel:o,level:t});const a=(0,d.EUG)(S,r);return e.concat(a?C(a,t+1,o):[])}),[])}),[S]),P=(0,r.useMemo)((()=>C((null==t?void 0:t.attributes)||[])),[t,C]);return o().createElement("div",{className:s()(O.root,a)},o().createElement(m.Typography,{className:O.title,variant:"subtitle1"},y||l().text("Attribute")),o().createElement(g.Z,{value:n,options:P,TextFieldProps:{InputProps:{disableUnderline:E},classes:{root:O.dropDownInput}},components:{DropdownIndicator:b.Z,MultiValue:e=>{let{data:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["data"]);return o().createElement(f.Z,n,t.chipLabel)},Option:e=>{let{isFocused:t,isSelected:n,data:r,label:a,innerProps:l}=e;return o().createElement("div",l,o().createElement(h.Z,{checked:n,level:r.level,data:r,label:a,labelInText:a,isFocused:t}))}},onChange:(0,c.pipe)((0,c.defaultTo)([]),i),styles:x,classes:O,menuPlacement:v,menuPortalTarget:document.body}))}},10237:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),o=n(13980),a=n.n(o),l=n(24328),i=n.n(l);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const d=(0,l.forwardRef)(((e,t)=>{let{children:n,className:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","className"]);const l=u();return i().createElement(r.Z,p({ref:t,className:o,classes:{root:l["basic-view__paper"]}},a),n)}));d.displayName="BasicView",d.propTypes={children:a().node,className:a().string};const m=d},39621:(e,t,n)=>{n.d(t,{Z:()=>g});var r=n(24328),o=n.n(r),a=n(17440),l=n(87918),i=n.n(l),s=n(6782),c=n(94079),u=n(31517),p=n(31276);const d=(0,n(79692).Z)({root:{display:"flex",flex:1},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px",fontSize:"14px"},inputNumber:{minWidth:"60px",marginRight:10,height:"100%",backgroundColor:"rgba(0, 0, 0, 0.03)"},inputUnit:{width:"100%"}}),m=[i().text("minutes"),i().text("hours"),i().text("days"),i().text("weeks"),i().text("months"),i().text("years")],g=e=>{let{interval:[t,n],onChange:r,onFocus:l}=e;const i=d(),g=(0,a.pipe)(p.NA,parseInt,(e=>[e,n]),r),f=(0,a.pipe)((e=>{let{value:n}=e;return[t,n]}),r);return o().createElement("div",{className:i.root},o().createElement(c.TextField,{type:"number",value:t||"",onChange:g,inputProps:{min:1,onFocus:l},InputProps:{classes:{root:i.input}},className:i.inputNumber}),o().createElement(u.Z,{label:"",placeholder:(0,s.Z)(n),className:i.inputUnit,value:{value:n,label:(0,s.Z)(n)},options:m.map((e=>({value:e,label:(0,s.Z)(e)}))),onChange:f,TextFieldProps:{inputProps:{onFocus:l},InputProps:{classes:{root:i.input}}}}))}},85451:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),a=n(52730),l=n(87918),i=n.n(l),s=n(17440),c=n(71153),u=n.n(c),p=n(94079),d=n(92575),m=n(96808),g=n(82389),f=n(59431),b=n(79692);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){y(e,t,n[t])}))}return e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E={input:e=>h({},e,{fontSize:"14px"}),loadingMessage:e=>h({},e,{fontSize:"14px"}),menuPortal:e=>h({},e,{zIndex:1300})},v=(0,b.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"},option:{fontSize:"14px",height:"32px"}}),x=e=>{let{selectedUsers:t,onChange:n,className:l,disableUnderline:c}=e;const b=v(),h=e=>({value:e,label:e}),y=e=>e.map(h),x=(0,a.useSelector)(f.ZP.selectors.getTenant),w=(0,a.useSelector)(f.ZP.selectors.getServicesPath),S=(0,r.useRef)();return o().createElement("div",{className:u()(b.root,l)},o().createElement(p.Typography,{className:b.title,variant:"subtitle1"},i().text("User")),o().createElement(d.Z,{value:y(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),defaultOptions:!0,getOptions:e=>(S.current||(S.current=(0,g.kz_)({tenant:x,servicesPath:w})),S.current.then((0,s.pipe)((0,s.prop)("array"),(0,s.pluck)("username"),(e=>t=>e?t.filter((t=>g.P6Y.strings.search(t,e))):t)(e),y))),TextFieldProps:{InputProps:{disableUnderline:c},className:b.dropDownInput},components:{DropdownIndicator:m.Z},styles:E,classes:b,menuPortalTarget:document.body}))}},31537:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e.MODEL_UPDATED="MODEL_UPDATED",e.ENTITY_REMOVED="ENTITY_REMOVED",e.ENTITY_CREATED="ENTITY_CREATED",e.ENTITY_CHANGED="ENTITY_CHANGED",e.ENTITIES_MERGED="ENTITIES_MERGED",e.ENTITIES_SPLITTED="ENTITIES_SPLITTED",e.ENTITY_LOST_MERGE="ENTITY_LOST_MERGE",e.RELATIONSHIP_CREATED="RELATIONSHIP_CREATED",e.RELATIONSHIP_REMOVED="RELATIONSHIP_REMOVED",e.RELATIONSHIP_CHANGED="RELATIONSHIP_CHANGED",e.POTENTIAL_MATCHES_FOUND="POTENTIAL_MATCHES_FOUND",e.NOT_MATCHES_SET="NOT_MATCHES_SET",e.NOT_MATCHES_RESET="NOT_MATCHES_RESET",e.PERIODIC_TASK_SCHEDULED="PERIODIC_TASK_SCHEDULED",e.ENTITIES_MERGED_MANUALLY="ENTITIES_MERGED_MANUALLY",e.POTENTIAL_MATCHES_REMOVED="POTENTIAL_MATCHES_REMOVED",e.ENTITIES_MERGED_ON_THE_FLY="ENTITIES_MERGED_ON_THE_FLY",e.USER_LOGIN="USER_LOGIN",e.USER_LOGOUT="USER_LOGOUT",e.USER_SEARCH="USER_SEARCH",e.USER_PROFILE_VIEW="USER_PROFILE_VIEW",e.COMMENT_ADDED="COMMENT_ADDED",e.COMMENT_UPDATED="COMMENT_UPDATED",e.COMMENT_DELETED="COMMENT_DELETED",e.ANALYTICS_ATTRIBUTES_CHANGED="ANALYTICS_ATTRIBUTES_CHANGED",e.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE="SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE",e.GROUP_CREATED="GROUP_CREATED",e.GROUP_REMOVED="GROUP_REMOVED",e.GROUP_CHANGED="GROUP_CHANGED"}(r||(r={}))},34606:(e,t,n)=>{n.d(t,{te:()=>u,Io:()=>p,rx:()=>d,_V:()=>m,Xr:()=>g});var r=n(17440),o=n(87918),a=n.n(o),l=n(31537);function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){s(e,t,n[t])}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=(0,r.path)(["data","type"]),u=e=>{const{items:t,label:n}=e,[r]=t||[];return c(r)||n},p=e=>{const{items:t,label:n}=e,o=e=>{return t=c(e)||n,(0,r.pipe)(r.values,(0,r.includes)(t))(l.I);var t},a=(0,r.filter)(o)(t);return t.length!==a.length&&console.error("Activities not implemented:",(0,r.reject)(o)(t)),i({},e,{items:a,itemsTotal:a.length})},d=e=>(0,r.pipe)((0,r.propOr)([],"items"),(0,r.groupBy)(c),r.values,(0,r.ifElse)((e=>{let{length:t}=e;return t>1}),(0,r.map)((t=>i({},e,{items:t,itemsTotal:t.length}))),(()=>[e])))(e),m=e=>(0,r.isNil)(e)?"":"string"==typeof e?e:Array.isArray(e)?e.map(m).join(", "):(0,r.is)(Object,e)?m("value"in e?e.value:Object.values(e)):e.toString(),g=e=>({[l.I.COMMENT_ADDED]:a().text("Comment added"),[l.I.COMMENT_DELETED]:a().text("Comment deleted"),[l.I.COMMENT_UPDATED]:a().text("Comment updated"),[l.I.ENTITIES_MERGED]:a().text("Profile merged"),[l.I.ENTITIES_MERGED_MANUALLY]:a().text("Profile merged manually"),[l.I.ENTITIES_MERGED_ON_THE_FLY]:a().text("Profile merged on the fly"),[l.I.ENTITIES_SPLITTED]:a().text("Profile un-merged"),[l.I.ENTITY_CHANGED]:a().text("Profile updated"),[l.I.ENTITY_CREATED]:a().text("Profile created"),[l.I.ENTITY_LOST_MERGE]:a().text("Profile lost merge"),[l.I.ENTITY_REMOVED]:a().text("Profile removed"),[l.I.GROUP_CHANGED]:a().text("Group updated"),[l.I.GROUP_CREATED]:a().text("Group created"),[l.I.GROUP_REMOVED]:a().text("Group removed"),[l.I.MODEL_UPDATED]:a().text("Model was updated"),[l.I.NOT_MATCHES_RESET]:a().text("Not matches reset"),[l.I.NOT_MATCHES_SET]:a().text("Not matches set"),[l.I.PERIODIC_TASK_SCHEDULED]:a().text("Periodic task was scheduled"),[l.I.POTENTIAL_MATCHES_FOUND]:a().text("Potential matches found"),[l.I.POTENTIAL_MATCHES_REMOVED]:a().text("Potential matches removed"),[l.I.RELATIONSHIP_CHANGED]:a().text("Relationship updated"),[l.I.RELATIONSHIP_CREATED]:a().text("Relationship created"),[l.I.RELATIONSHIP_REMOVED]:a().text("Relationship removed"),[l.I.USER_LOGIN]:a().text("Logged in"),[l.I.USER_LOGOUT]:a().text("Logged out"),[l.I.USER_PROFILE_VIEW]:a().text("Profile viewed"),[l.I.USER_SEARCH]:a().text("Searched"),[l.I.ANALYTICS_ATTRIBUTES_CHANGED]:a().text("Analytics attribute changed"),[l.I.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE]:a().text("SFDC connector synchronization issue")}[e]||"")},51843:(e,t,n)=>{n.d(t,{Z:()=>b});var r=n(24328),o=n.n(r),a=n(95038),l=n.n(a),i=n(87918),s=n.n(i),c=n(17440),u=n(82389),p=n(94079),d=n(96808),m=n(37699);const g=(0,n(79692).Z)({root:{flex:1},dropdownIndicator:{transition:"transform .15s ease"},inputRoot:{fontSize:"14px",height:46},input:{padding:"0 12px 0"},dateOptionLabel:{minWidth:"100px"},paper:{minWidth:"112px"}}),f=l().localeData().longDateFormat("L"),b=e=>{let{values:t,onChange:n,onFocus:a}=e;const l=f,i=(0,r.useRef)(null),[b,h]=(0,r.useState)(!1),y=g(),E=(0,r.useCallback)((()=>{h((e=>!e)),a()}),[a]),v=()=>{h(!1)};return o().createElement("div",{className:y.root},o().createElement(p.TextField,{fullWidth:!0,value:t.map((e=>((e,t)=>(0,c.isNil)(e)?`${t}`:`${(0,u.mB6)({dataTypeDefinition:{type:u.oS0.TYPE_ACTIVENESS_DATE}},e)}`)(e,l))).join(" — "),onClick:E,variant:"filled",ref:i,InputProps:{endAdornment:o().createElement(d.Z,{selectProps:{classes:y,menuIsOpen:b},innerProps:{}}),disableUnderline:(0,c.isNil)(t),readOnly:!0,classes:{root:y.inputRoot,input:y.input}},InputLabelProps:{shrink:!1},placeholder:s().text(`${l} — ${l}`)}),o().createElement(p.Menu,{variant:"menu",open:b,autoFocus:!1,classes:{paper:y.paper},anchorEl:i.current,onClose:v,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:b,style:{width:"100%"}}},o().createElement(m.Z,{values:t,onCancel:v,onApply:e=>{n(e),h(!1)},type:u.oS0.TYPE_ACTIVENESS_DATE})))}},67885:(e,t,n)=>{let r,o;n.d(t,{K:()=>r,o:()=>o}),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(r||(r={})),function(e){e.INIT="init",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(o||(o={}))},35198:(e,t,n)=>{n.d(t,{_:()=>Oa,t:()=>Ha});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(24605),d=n(39450),m=n(97094),g=n(60115),f=n(585),b=n(82389),h=n(87918),y=n.n(h),E=n(3096),v=n.n(E),x=n(59431),w=n(60641),S=n(7718),O=n(3515),C=n(17554),P=n(61756),N=n(57730),T=n(76536),I=n(26481),k=n(49759),D=n(94150),Z=n(26005),R=n(72249),A=n(99136),j=n(30268),L=n(21077),M=n(67268),U=n(71153),H=n.n(U),_=n(8962);const z=o().createContext(null);z.displayName="SingleAttributeContext";var F=n(60995),V=n(10237),B=n(58662),W=n(94079),G=n(93416),q=n(75512),Y=n(30553),$=n(91181),X=n(32152),Q=n(36444),K=n(79692);const J=(0,K.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ee=e=>{let{className:t}=e;const n=J(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(z),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(W.Button,{ref:a,classes:{root:H()(n.triggerButton,t)},onClick:u},o().createElement(Q.Z,null)),o().createElement(W.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(W.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(W.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},te=(0,K.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),ne=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=te(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(z);return o().createElement(G.Z,{title:t,className:l.root},o().createElement(q.Z,{widthToHide:500},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(W.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement($.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(X.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(ee,null))};var re=n(65549),oe=n(93140),ae=n(76134),le=n(96698);const ie=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}}))),se=b.nIW,ce=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ce(n,t)})))):b.P6Y.strings.search(String(e),t),ue=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return ce(t,l)})))(t,n,r),c=(0,i.filter)(b.OXP,s);return{[(0,b.xy8)(r)]:{[se(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function pe(){return pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){me(e,t,n[t])}))}return e}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ge=[],fe=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c}=e;const u=ie(),{uri:p,required:m,cardinality:g,name:f}=n,h=(0,a.useDispatch)(),E=(0,r.useContext)(d.m),v=(0,a.useSelector)(x.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,v.uri)||{})),S=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),O=(0,a.useSelector)((e=>(0,b.tQX)(l,n,x.ZP.selectors.getProfileErrors(e)))),C=(0,a.useSelector)(x.ZP.selectors.getMode),P=(0,b.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(ge,[P,f]),(0,i.map)((0,i.prop)("uri")))(v),T=(0,i.pathOr)(ge,[P,f],w),I=T.map((0,i.prop)("uri")),k=(0,b.ZiX)(v.uri),D=(0,r.useRef)((0,b.gjI)({parentUri:l,attributeType:n})),Z=(0,b.O27)(T),R=m&&Z,A=R?[D.current]:T.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),j=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,h)(e.map((e=>de({},e,{viewId:E}))))),[E,h]),L=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.modifyAttribute,h)(de({},e,{viewId:E}))),[E,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,h)(de({},e,{viewId:E}))),[E,h]),U=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,h),[h]),_=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return j(R&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[j,l,n,R]),z=(0,b.Vg3)({attributeType:n,mode:C}),F={attributeType:n,errors:S,crosswalks:w.crosswalks,mode:C,onAddAttributes:j,onChangeAttribute:L,onDeactivateError:U,showNonOv:s},V=0===A.length&&0===t.length;return o().createElement("div",null,o().createElement(oe.Z,{cardinality:g}),o().createElement(ae.Z,{message:O}),z&&o().createElement(W.Button,{color:"primary",onClick:_,className:u.moreButton},o().createElement(re.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>o().createElement(le.Z,pe({key:e.uri},F,{attributeValue:e,lazy:R&&!m,showEmptyEditors:k,ownError:(0,b.ADq)(e,t,p,S),onDeleteAttribute:M})))),A.length>0&&t.length>0&&o().createElement(W.Divider,{className:u.divider}),t.map((e=>{const t=T.find((0,i.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!I.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,b.vKJ)({valueTransformer:(0,i.unless)(b.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:H()({[u.ovFalse]:!(0,b.OXP)(n)})},o().createElement(le.Z,pe({},F,{attributeValue:n,ownError:(0,b.ADq)(n,null,p,S),onDeleteAttribute:M,state:l})))})),V&&o().createElement(W.Typography,{className:u.noData},c))};var be=n(81303);const he=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},ye=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Ee=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=ye(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:h}=(0,r.useContext)(z),E=(0,a.useSelector)(x.ZP.selectors.getEntityUri),v=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),S=(0,a.useSelector)(x.ZP.selectors.getPivotingAttributes),O=0!==u.length,C=t["text-empty"]||y().text("No data found");return o().createElement(F.J.Provider,{value:S},o().createElement(V.Z,{className:H()(c.root,n)},o().createElement(ne,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(W.Box,{className:c.content},(()=>{if(g)return o().createElement(A.Z,null);if(b){if(v&&O){const e={values:u,attributeType:b,showInactive:h};return o().createElement(he,e)}if(w){const e={values:u,attributeType:b,parentUri:E,showInactive:h,noDataText:C};return o().createElement(fe,e)}}return o().createElement(W.Typography,{className:c.noData},C)})()),f&&o().createElement(B.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var ve=n(85229),xe=n(20562);function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Se=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(x.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[m,g]=(0,r.useState)(!1),f=(0,ve._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),E=(0,a.useSelector)(x.ZP.selectors.getApiPath),v=(0,a.useSelector)(x.ZP.selectors.getTenant),w=n?x.ZP.selectors.getEntityWithDiff:x.ZP.selectors.getEntityWithoutDiff,S=(0,a.useSelector)(w),O=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),C=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),P=(0,a.useSelector)(x.ZP.selectors.getHistoryDiff),N=S.uri,T=se(o),I=(0,b.xy8)(o);h.current=(0,b.JQy)(S,N,T);const k=(0,r.useMemo)((()=>(0,b.zeJ)(s,o)),[s,o]),{globalFilter:D}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:Z}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(N)&&(0,b.YOQ)(o)){g(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,b.biM)(S)||C?ue:b.KbL;f(a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){we(e,t,n[t])}))}return e}({metadata:s,entity:S,apiPath:E,tenant:v,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:D,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([I],e),n=(0,i.pathOr)([],[T],t);C||y(x.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:T,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",o],t))})).finally((()=>{g(!1)}))}else u([]),d(null)}),[E,N,v,o,l,s,t,D,k,C,P]);(0,r.useEffect)((()=>{R()}),[R]),(0,xe.D)((()=>{O&&R()}),[O]);const A=(0,i.partition)(b.OXP),[,j]=A(h.current||[]),L=Z?[]:j,M=Z?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),H=l<U,_=null!=p&&p.totalValues?p.totalValues-U:L.length;return{values:c,isLoading:m,hasPaging:H,totalVisibleValues:U,attributeType:k,totalNonVisibleValues:_,nonVisibleValues:L}};function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ce=n(37152),Pe=n(31274),Ne=n(79026),Te=n(8818),Ie=n(90324),ke=n(70595);const De=o().createContext(null);De.displayName="RelationsViewStateContext";const Ze=(0,K.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Re=e=>{let{className:t}=e;const n=Ze(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(De),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),E="asc"===s;return o().createElement(o().Fragment,null,o().createElement(W.Button,{ref:a,classes:{root:H()(n.button,t)},onClick:f},o().createElement(Q.Z,null)),o().createElement(W.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(W.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(W.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(W.Divider,{className:n.divider}),o().createElement(W.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Ne.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Te.k,{tooltipTitle:E?y().text("Ascending"):y().text("Descending"),icon:E?Ie.Z:ke.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Re.displayName="FilterButton";const Ae=Re,je=(0,K.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var Le=n(61932),Me=n(55847);const Ue=o().createContext(null);function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){_e(e,t,n[t])}))}return e}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ze=Math.pow(2,31)-1,Fe=(0,K.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var Ve=n(81137);const Be=e=>{let{label:t}=e;const n=Fe();return o().createElement(W.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Le.Z,null))},We=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(x.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Ue),i=(0,a.useSelector)(x.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),m=(0,a.useSelector)(x.ZP.selectors.getTenant),g=[He({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:ze})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return He({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const E=(0,r.useCallback)((()=>p(null)),[]),v=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:E,onImportClick:v}})(),s=Fe(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(Te.k,{size:"L",icon:Le.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:H()(s.tenant)},u)):o().createElement(Me.Z,{menuId:"importDT-table-actions",buttonComponent:Te.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(Be,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Ve.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:l,onSave:n})))},Ge=e=>{let{title:t,total:n}=e;const a=je(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(De);return o().createElement(G.Z,{title:t||"",className:a.header},n>0&&o().createElement(q.Z,{widthToHide:400},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(W.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(We,null),o().createElement(Ae,null))};var qe=n(11013),Ye=n(27604),$e=n(22983),Xe=n(31254),Qe=n(31039);const Ke=(0,K.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function Je(){return Je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Je.apply(this,arguments)}const et=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Ke(),u=(0,ve._)(),p=(0,a.useSelector)(x.ZP.selectors.getTenant),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),E=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(W.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(W.Tooltip,Je({onOpen:y,title:E,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},tt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var nt=n(77277);const rt=(0,K.Z)((()=>({container:{display:"flex"}})));function ot(){return ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const at=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=rt();return o().createElement("div",{className:a.container},o().createElement(nt.Z,ot({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(nt.Z,ot({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},lt=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),it=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=lt(),{entity:d,relation:m}=t,g=(0,b.$qe)(t),f=(0,b.xr3)(t),h=(0,b.iJH)(t),{entityType:E,entityLabel:v,preparedUri:x,relationLabel:w}=tt(t,n),S=(0,b.Fn9)(m)&&(0,b.Fn9)(d),{canRemove:O,canUpdate:C}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:b.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),P=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),T=(0,r.useCallback)((()=>{s(t)}),[s,t]),I=(0,r.useCallback)((()=>c(t)),[c,t]),k=(O||C)&&a&&!t.suggested?o().createElement(o().Fragment,null,C&&o().createElement(Te.k,{icon:Ye.Z,size:"XS",onClick:N,tooltipTitle:y().text("Edit")}),O&&o().createElement(Te.k,{icon:$e.Z,size:"XS",onClick:P,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?o().createElement(at,{acceptRelation:T,ignoreRelation:I,size:"small",disabled:h}):void 0,Z=h?y().text("ignored"):y().text("edited");return o().createElement("div",{className:H()(p.container,{[p.rowInactive]:!S},{[p.removed]:g||h})},o().createElement("div",{className:p.row},u&&u(),o().createElement(Xe.Z,{className:p.entityAvatar,entityType:E}),o().createElement(Qe.Z,{value:x,className:p.entityLabelContainer},o().createElement(et,{label:v,entity:d},o().createElement("span",{className:p.entityLabel},v)),(f||h)&&o().createElement(W.Typography,{variant:"caption",className:p.editedLabel},"(",Z,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},k),D))}));it.displayName="EditableRelationItem";const st=it,ct=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:t,direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=n(98989),dt=n(83543);const mt=(0,K.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),gt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=mt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,b.xvW)(n)?null:a?o().createElement(dt.Z,c):o().createElement(pt.Z,c)},ft=(0,K.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),bt=e=>{let{config:t,connection:n,children:l}=e;const i=ft(),{showInactive:s}=(0,r.useContext)(De),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>x.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>x.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ut(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(x.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||h(),s((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:h,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(gt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Pe.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Yt,{isLoading:m,config:t,loadRelations:d,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},ht=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),yt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(x.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>x.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>x.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>x.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),E=ht(),v=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,s,p,h,u]),w=(0,r.useCallback)((e=>{h(x.N5.relations.actions.closeRelationEditor(l.id,e)),h(x.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>x.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=x.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(x.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),S=l.content,O=ct(S.inRelations,S.outRelations),C=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(O.type),object:(0,i.evolve)({type:(0,i.always)(O.type),attributes:(0,i.always)(null)})}}))(e);h(x.N5.relations.actions.addRelation(l.id,t))}),[h,l,O]),P=(0,r.useCallback)((e=>{h(x.N5.relations.actions.ignoreRelation(l.id,{relationType:O.type,relationDirection:O.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,O]),[N,T]=(0,i.partition)(b.xvW,n),I=g&&f,k=0===N.length&&0===T.length,D=e=>{var t,n;const r=m.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,b.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:l,connection:e,key:c},(t=>r?o().createElement(qe.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(st,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:C,onIgnoreRelation:P})))},Z=I&&(!d||d&&d.parentEntityUri===u),R=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},Z&&o().createElement(W.Button,{color:"primary",onClick:v,className:E.moreButton},o().createElement(re.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},y().text("Add"))),R&&o().createElement(qe.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(D),N.length>0&&T.length>0&&o().createElement(W.Divider,{className:E.divider}),T.map(D),k&&o().createElement(W.Typography,{className:E.noData},c))};var Et=n(19603),vt=n(94646),xt=n(78101),wt=n(80931);const St=(0,K.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ct(e,t,n[t])}))}return e}function Ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pt=e=>{let{connection:t,className:n}=e;const l=St(),{relation:s}=t,c=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(x.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>Ot({attributes:Ot({},x.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(O.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(xt.A.Provider,{value:h},o().createElement(wt.Z,{className:H()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:H()(l.attributesList,n)},y().text("No attributes"))};var Nt=n(86602),Tt=n(82726);const It=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Te.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Nt.Z:Tt.Z,onClick:n})},kt=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=kt(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:E,relationLabel:v}=tt(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),S=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),O=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:H()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:H()(c.row,Et.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement(Xe.Z,{className:c.entityAvatar,entityType:h}),o().createElement(Qe.Z,{value:E,className:c.entityLabelContainer},o().createElement(et,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),v&&o().createElement("span",{className:c.relationLabel},`, ${v}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(vt.Z,{className:c.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(at,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(It,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(Pt,{connection:t}))}));Dt.displayName="RelationItem";const Zt=Dt;var Rt=n(52691),At=n(16208);const jt=e=>e.filter((e=>5===e.value)).length,Lt=e=>e.filter((e=>1===e.value)).length,Mt=e=>0===e.length?"0%":jt(e)/e.length*100+"%",Ut=e=>0===e.length?"0%":Lt(e)/e.length*100+"%",Ht=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),_t=e=>{let{ratings:t,className:n}=e;const r=Ht();return o().createElement("div",{className:H()(r.wrapper,n)},o().createElement(W.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:Mt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ut(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:H()(r.likesCount,r.count)},o().createElement(Rt.Z,{className:r.icon}),jt(t)),o().createElement("div",{className:r.count},o().createElement(At.Z,{className:r.icon}),Lt(t))))},zt=(0,K.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Ft=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=zt(),i=(0,a.useSelector)(x.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(W.Button,{onClick:n,variant:"text",size:"small",className:H()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Me.Z,{buttonProps:{endIcon:o().createElement(dt.Z,null),variant:"text",size:"small",className:H()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},Vt=(0,K.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Bt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Vt(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityLabel:y,entityType:E,preparedUri:v,relationLabel:w}=tt(t,h),S=(null==f?void 0:f.ratings)||[],O=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),C=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:O,connection:t})||[];return o().createElement("div",{className:H()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(W.Box,{display:"flex",minHeight:"44px",className:Et.U},o().createElement(W.Box,{display:"flex",alignItems:"center"},o().createElement(W.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Xe.Z,{entityType:E,className:u.entityTypeIcon})),o().createElement(W.Box,{display:"flex",flexDirection:"column"},o().createElement(Qe.Z,{value:v,className:u.entityLabelContainer},o().createElement(et,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Ft,{ratings:S,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&o().createElement(vt.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:C,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(at,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(_t,{ratings:S,className:u.ratings}),o().createElement(It,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Pt,{connection:t,className:u.relationAttributes}))},Wt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=ct(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===b.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(O.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:i,connection:e,key:r},(t=>c?o().createElement(Bt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Zt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Wt.displayName="RelationsList";const Gt=Wt,qt=(0,K.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Yt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=qt(),{selectors:u}=x.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(A.Z,null):(0,b.KIu)(d)?o().createElement(yt,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(Gt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(W.Typography,{className:c.noData},m)},$t=(0,K.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),Xt=e=>{let{config:t,className:n}=e;const l=$t(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(De),{selectors:h}=x.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),E=(0,a.useSelector)(h.getEntity),v=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),S=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{f("")}),[null==E?void 0:E.uri]);const O=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:C,reload:P}=(0,Ce.a)({sorting:S,filter:O,page:s,rowsPerPage:u,config:t,entity:E,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(y)),[y]),T=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Pe.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Ue.Provider,{value:T},o().createElement(Ge,{title:t.caption,total:v})),o().createElement("div",{className:l.content},o().createElement(Yt,{isLoading:C,config:t,loadRelations:P,connections:y,total:v}),v>u&&o().createElement(B.Z,{classes:{root:l.pagination},count:v,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};Xt.displayName="RelationsView";const Qt=o().createContext(null);Qt.displayName="SingleAttributeContext";var Kt=n(86361),Jt=n(26180),en=n(31276);function tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nn(e,t,n[t])}))}return e}function nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rn="CHANGE_SEARCH_QUERY",on=tn({},Jt.ZP.actions,{changeSearchQuery:(0,en.zD)(rn)}),an=(e,t)=>t.type===rn?tn({},e,{searchQuery:t.payload,page:0}):Jt.ZP.reducer(e,t);var ln=n(92332),sn=n(67353);const cn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},un=(0,K.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":cn}}))),pn=(0,sn.Z)((e=>{const t=un();return o().createElement("div",{className:t.headCell},o().createElement(ln.default,e))}));var dn=n(64091);function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gn=(0,i.pipe)((0,i.map)((e=>({id:(0,b.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,b.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),fn=(0,i.pipe)(b.DK$,gn),bn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),hn=e=>{if((0,b.vZp)(e)){const t=bn(e);return t.length>1?t.slice(0,-1):null}return null},yn=(0,i.map)((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){mn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:hn(e.id),headCellRenderer:pn,rowCellValueRenderer:dn.Z})));var En=n(99341);function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xn=n(52016),wn=n(1876),Sn=n(60894);const On=(0,K.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Cn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=On();return o().createElement(G.Z,{title:t,className:u.header},o().createElement(X.i,{query:n,onChange:r}),o().createElement(wn.Z,{enabled:a,onClick:l}),o().createElement(Y.Z,{height:24,margin:4}),o().createElement(Sn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function Pn(){return Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}const Nn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=un();return o().createElement("div",{className:H()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Pn({key:t,value:e},l)))))}));var Tn=n(85709);const In=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Te.k,{tooltipTitle:y().text("Edit"),icon:Ye.Z,size:"L",onClick:t}),n&&o().createElement(Te.k,{tooltipTitle:y().text("Remove"),icon:$e.Z,size:"L",onClick:n}))};function kn(){return kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kn.apply(this,arguments)}const Dn=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,b.tT_)(e))(t))(bn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>yn(t)),[t]),y=un(),E=(0,a.useSelector)(x.ZP.selectors.getMode),v=(0,b.KIu)(E),w=(0,a.useSelector)(x.ZP.selectors.getMetadata),S=(0,a.useSelector)(x.ZP.selectors.getEntityUri),O=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:C}=(0,r.useContext)(Qt),P=(0,r.useCallback)((e=>o().createElement(Nn,kn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,T]=(0,r.useState)(null),{canUpdate:I,canDelete:k}=(0,xn.l)(),D=(0,r.useMemo)((()=>"number"!=typeof N||!v||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,v]),Z="number"==typeof N&&(R=(0,i.path)([N],n),k(p)&&(0,b.xv5)({attributeType:C,mode:E,attributeValue:R,metadata:w,isReltioCrosswalk:(0,b.KVV)(O.crosswalks,R)}));var R;const A="number"==typeof N&&(e=>I(p)&&(0,b.yv0)({attributeType:C,mode:E,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(O.crosswalks,e)}))((0,i.path)([N],n)),j=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);A&&d(e)}),[d,N,n,A]),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!Z)return;const t={parentUri:S,attributeType:C,uri:e.uri,value:e};m(t),T(null)}),[N,n,m,Z,C,S]),M=D||!Z&&!A?void 0:o().createElement(In,{onEdit:A?j:void 0,onRemove:Z?L:void 0}),U=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Tn.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:T,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Zn=(0,K.Z)((()=>({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 Rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const An=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const p=Zn(),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Qt),f=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),h=(0,a.useSelector)(x.ZP.selectors.getMode),E=(0,a.useDispatch)(),v=(0,r.useContext)(d.m),w=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,E)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Rn(e,t,n[t])}))}return e}({},e,{viewId:v}))))),[v,E]),S=(0,b.ZiX)(m),O=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),C=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,E),[E]);return o().createElement(o().Fragment,null,o().createElement(le.Z,{expanded:!0,attributeValue:u,showEmptyEditors:S,onDeleteAttribute:s,onDeactivateError:C,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:O,attributeType:g,ownError:(0,b.ADq)(u,null,g.uri,O)}),o().createElement("div",{className:p.actionButtons},o().createElement(W.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(W.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},y().text("Apply"))))},jn=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Mn(e,t,n[t])}))}return e}function Mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Un=[],Hn=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=jn(),{values:u,page:p,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:E,onFilter:v,onSort:w,onToggleFilters:S,onChangeColumns:O,filters:C,sorting:P,totalVisibleValues:N,hasPaging:T,attributeType:I,showTable:k}=(0,r.useContext)(Qt),D=(0,r.useMemo)((()=>fn(I)),[I]),{checkHasChanges:Z,onChangeAttribute:R,onDeleteAttribute:j,onAdd:L,onCancel:M,onApply:U,onStartEditing:_,modifiedValues:z,editingValues:F,deletedUris:q}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(x.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(d.m),{attributeType:u,values:p}=(0,r.useContext)(Qt),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),g=(0,a.useSelector)(x.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Ln({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Ln({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:m,attributeType:u});t(e.uri),f(Ln({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),E=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),v=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Ln({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),S=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),O=(0,b.KIu)(l),C=(0,b.xy8)(u),P=(0,i.pathOr)(Un,[C,null==u?void 0:u.name],S),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),T=(0,r.useMemo)((()=>O?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(p):[]),[P,p]),I=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:h,onAdd:y,onCancel:v,onApply:w,onStartEditing:E,modifiedValues:N,editingValues:I,deletedUris:T}})(),Y=(0,a.useSelector)(x.ZP.selectors.getMode),$=(0,b.KIu)(Y),X=$?z:u,{canCreate:Q}=(0,xn.l)(),K=Q(t)&&I&&(0,b.Vg3)({attributeType:I,mode:Y})&&!F.length,J=(0,r.useMemo)((()=>E.map((e=>D.find((0,i.propEq)("id",e))))),[E,D]);return o().createElement(V.Z,{className:H()(c.root,n)},k?o().createElement(o().Fragment,null,o().createElement(Cn,{title:l,total:N,columnsData:D,selectedColumns:E,onChangeColumns:O,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!C,onToggleFilters:S}),o().createElement("div",{style:{position:"relative"}},$&&o().createElement("div",{className:c.editor},K&&o().createElement(W.Button,{color:"primary",onClick:L,className:c.addButton},o().createElement(re.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},y().text("Add"))),F.map((e=>o().createElement(An,{key:e.uri,attributeValue:e,onChangeAttribute:R,onDeleteAttribute:j,onCancel:M,onApply:U,hasChanges:Z(e)})))),o().createElement(Dn,{columnsData:J,config:t,values:X,filters:C,onFilter:v,sorting:P,onSort:w,onEdit:_,onDeleteAttribute:j,deletedUris:q}),T&&o().createElement(B.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:p,onChangePage:m}),g&&o().createElement(A.Z,null))):o().createElement(o().Fragment,null,o().createElement(G.Z,{title:l,className:c.header}),o().createElement(W.Typography,{className:c.noData},y().text("No data"))))};var _n=n(58600);function zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Fn=0;const Vn=()=>Fn++,Bn=e=>{const t={children:[],nodeId:Vn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Vn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Wn=(0,K.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Gn=n(1242);const qn=o().createContext(null);var Yn=n(55400);const $n=e=>{e.target.src=Gn},Xn=e=>{let{node:t}=e;const n=Wn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(x.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,r.useContext)(qn),p=(0,a.useSelector)(x.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(x.ZP.selectors.getEntity),m=(0,b.ChB)({uiPath:p,uri:i}),g=i===d,f=(0,r.useCallback)((()=>{l(x.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,E=(0,b.nt9)(c,t.entity.type)||{},v=(0,b.VD3)(c,E,"typeGraphIcon"),w=v&&(0,b.vPL)(s,v);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(W.Avatar,{className:H()(n.avatar),src:w||Gn,onError:$n}),o().createElement("span",{className:H()(n.link,{[n.selected]:g})},o().createElement(Yn.Z,{to:m,onClick:f},h))))},Qn=((0,r.memo)(Xn),e=>{let{node:t}=e;return t.nodeId}),Kn=(0,K.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(){return tr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tr.apply(this,arguments)}const nr={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Kn();return o().createElement("div",tr({style:{height:"100%"}},p,{key:a.nodeId}),m&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},m&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:H()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Kn(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){er(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",Jn({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function rr(){return rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rr.apply(this,arguments)}const or=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",rr({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},ar=e=>{let{title:t,onGraphOpen:n}=e;const r=Wn();return o().createElement(G.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Te.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:or,onClick:n,size:"L"})))};var lr=n(9757);const ir=(0,K.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){cr(e,t,n[t])}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ur=n(14940);const pr=(0,K.Z)({resizableHandleContainer:{position:"relative",width:"100%",height:"inherit"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),dr=e=>{const t=t=>{const n=pr();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:H()("viewDraggableHandle",n.resizableHandle)},o().createElement(ur.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},mr=(0,K.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var gr=n(29103),fr=n(83911),br=n(48747),hr=n(22385);const yr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Er=(0,K.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var vr=n(13074),xr=n(24338);const wr=(0,K.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Sr=wr,Or=e=>{let{totalImages:t}=e;const n=Sr(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(W.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pr(e,t,n[t])}))}return e}function Pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Nr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(xr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Cr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Cr({},e,{viewId:d})),imageSize:kr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Or,{totalImages:p.length}))},Tr=(0,K.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Ir=Tr,kr={imageMargin:4,imageWidth:162,imageHeight:162};var Dr=n(28741);const Zr=(0,K.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Rr=n(49734),Ar=n(98808),jr=n(93428),Lr=n(30885);function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}const Ur=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),{canMerge:p,canMark:m}=(0,b.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Ar.N.iconButton,onStartRequest:l},h=(0,r.useContext)(d.m),y=(0,r.useCallback)((()=>{i(),s(x.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(jr.H,Mr({},f,{onFinishRequest:y})),m&&o().createElement(Lr.i,Mr({},f,{onFinishRequest:i})))},Hr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(x.ZP.selectors.getMetadata),c=(0,a.useSelector)(x.ZP.selectors.getEntity);return o().createElement(Rr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:Et.U},o().createElement(vt.Z,{uri:(0,b.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(Ur,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},_r={showTransitiveMatches:!0,showInactiveEntities:!1},zr={order:"asc",field:"score"};var Fr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Fr||(Fr={}));const Vr=dr((e=>{let{className:t}=e;const n=mr();return o().createElement(V.Z,{className:H()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Br=dr((e=>{let{className:t,config:n}=e;return o().createElement(_.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Wr=dr((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=Se(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Oe(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(z.Provider,{value:a},o().createElement(Ee,{config:n,className:t}))})),Gr=dr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(x.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>fn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(an,c),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>b.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,En.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),E=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:d})),[y,f,g,d]),{changeSearchQuery:v,changePage:w,toggleSort:S,changeFilter:O,toggleFilters:C,changeColumns:P}=(0,Kt.o)({actions:on,dispatch:p}),N=Se(e,E,!1);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){vn(e,t,n[t])}))}return e}({},u,{setSearchQuery:v,setPage:w,onSort:S,onFilter:O,onToggleFilters:C,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden)},N)})(t);return o().createElement(Qt.Provider,{value:l},t&&o().createElement(Hn,{config:t,className:n}))})),qr=dr((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[p,d]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(De.Provider,{value:a},o().createElement(Xt,{config:t,className:n}))})),Yr=dr((e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:b,popup:h}=(0,lr.E)(t),y=ir(),E=f||d;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{c(!!h)}),[h]),(0,r.useEffect)((()=>{s&&l.current&&(l.current.innerHTML="",h&&Array.from(h.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[s,h]);const v=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(W.Dialog,{ref:l,open:!!h}),o().createElement(W.Tooltip,{title:E||""},o().createElement("div",{ref:a,style:sr({},v,b),className:H()(y.root,n)}))):null})),$r=dr((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{treeData:s,setTreeData:c}=((e,t)=>{const n=(0,ve._)(),[o,l]=(0,r.useState)([]),s=(0,a.useSelector)(x.ZP.selectors.getEntity);return(0,xe.D)((()=>{const e=o.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){zn(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],s),e);l(t.map((0,i.prop)("root")))}),[null==s?void 0:s.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||n((0,b.RFJ)({uri:e,graphUri:t})).then(Bn).then(l).catch((e=>{console.warn(e)})),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l}})(l,t.graph.type),u=Wn(),p=(0,a.useDispatch)(),{id:d,graph:m}=t,g=(0,r.useCallback)((()=>{p(x.ui.actions.openGraph({viewId:d,graphType:m.type,entityUri:l}))}),[p,d,m,l]),f=(0,r.useCallback)((e=>({title:o().createElement(Xn,{node:e.node})})),[]);return o().createElement(V.Z,{className:n},o().createElement(ar,{onGraphOpen:g,title:t.caption}),o().createElement(qn.Provider,{value:t},o().createElement("div",{className:u.treeContainer},o().createElement("div",{className:u.tree},o().createElement(_n.ZP,{isVirtualized:!1,treeData:s,canDrag:!1,theme:nr,generateNodeProps:f,onChange:c,getNodeKey:Qn})))))})),Xr=dr((e=>{let{config:t,className:n}=e;const l=Zr(),s=(0,a.useSelector)(x.ZP.selectors.getEntity),c=(0,b.wwR)(s),[u,p]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:E,total:v}=(0,Dr.s)({enabled:!!c,entity:s,options:_r,filter:"",page:0,sorting:zr,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{E()}),[E]),S=(0,a.useDispatch)(),C=(0,r.useContext)(d.m),P=(0,r.useCallback)((()=>{S(x.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:C}))}),[S,C]),N=(0,r.useMemo)((()=>(0,b.NVY)(c,(0,i.map)(b.ev7,f))),[c,f]),{getCommentsCount:T}=(0,r.useContext)(O.h);(0,r.useEffect)((()=>{T(N)}),[T,N]);const I=v>3&&!(0,i.isEmpty)(f),k=u?Fr.Loading:(0,i.isEmpty)(f)?Fr.NoData:Fr.Loaded;return o().createElement(Pe.X.Provider,{value:h},o().createElement(V.Z,{className:H()(l.root,n)},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},k===Fr.Loading&&o().createElement(A.Z,null),k===Fr.NoData&&o().createElement(W.Typography,{className:l.noData},y().text("No matches found")),k===Fr.Loaded&&f.map((e=>o().createElement(Hr,{config:t,entitiesMap:h,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),I&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(W.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),Qr=(0,r.lazy)((()=>n.e(2493).then(n.bind(n,52493)).then((e=>({default:dr(e.HierarchyTreeView)}))))),Kr=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:dr(e.RelationshipsTableView)}))))),Jr=dr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=Er(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),p=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,ve._)();return(0,r.useEffect)((()=>{i(!0),s((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(yr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(A.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(V.Z,{className:H()(s.root,i)},m&&o().createElement(A.Z,null),o().createElement(hr.Z,{size:"S",icon:n?fr.Z:gr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(br.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:s.fullHeight,mapKey:p,mapOptions:h}))})),eo=dr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Ir(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(x.ZP.selectors.getMode),p=(0,a.useSelector)(x.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,E=t["text-empty"]||y().text("No data found"),v=(0,r.useCallback)((e=>c(x.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:v};return o().createElement(Nr,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:kr,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:v};return o().createElement(o().Fragment,null,o().createElement(vr.Z,e),o().createElement(Or,{totalImages:h}))}}return o().createElement(W.Typography,{className:s.noData},E)})()))}));class to{}to.ViewTypes=b.ZIY,to.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case to.ViewTypes.HierarchyTree:return o().createElement(Qr,{config:r,store:n,className:a});case to.ViewTypes.HierarchyPaths:return o().createElement($r,{config:r,className:a});case to.ViewTypes.RelationsTable:return o().createElement(Kr,{config:r,store:n,className:a});case to.ViewTypes.Relations:return o().createElement(qr,{config:r,className:a});case to.ViewTypes.Attributes:return o().createElement(Br,{className:a,config:r});case to.ViewTypes.SingleAttributeView:return o().createElement(Wr,{config:r,className:a});case to.ViewTypes.TableAttributeView:return o().createElement(Gr,{config:r,className:a});case to.ViewTypes.MapView:return o().createElement(Jr,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case to.ViewTypes.CustomView:return o().createElement(Yr,{config:r,className:a});case to.ViewTypes.ImageAttributeView:return o().createElement(eo,{config:r,className:a});case to.ViewTypes.PotentialMatchesView:return o().createElement(Xr,{config:r,className:a})}},to.getComponent=e=>to.getComponentBy("class",e)||to.getComponentBy("react-class",e)||o().createElement(Vr,{className:e.className});const no=to,ro=()=>null,oo=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=mr();return o().createElement(r.Suspense,{fallback:o().createElement(ro,null)},no.getComponent({config:t,store:n,className:H()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));oo.displayName="ViewComponent";const ao=(0,K.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function lo(){return lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}const io=["onConfigChanged","onRemove"],so=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),h=ao(),y=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{store:E}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const v=f.class===no.ViewTypes.CustomView;return v&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC?null:f.class!==no.ViewTypes.MapView||y?o().createElement("div",lo({},(0,i.omit)(io,g),{style:u,className:H()(s,{[h.item]:!v})}),o().createElement("div",{className:H()({[h.fixedSizeContainer]:!m})},m,o().createElement(oo,{store:E,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),c):null},co=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(M.Z,{LayoutItem:so,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var uo=n(72753),po=n(43576),mo=n(64459),go=n(3409),fo=n(93873),bo=n(22860);function ho(){return ho=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ho.apply(this,arguments)}const yo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",ho({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))};function Eo(){return Eo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eo.apply(this,arguments)}const vo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Eo({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().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:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},xo=(0,K.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function wo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){So(e,t,n[t])}))}return e}function So(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Oo=e=>o().createElement(W.SvgIcon,e,o().createElement(yo,null)),Co=e=>o().createElement(W.SvgIcon,e,o().createElement(vo,null)),Po=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),No=e=>{let{className:t,profileBandConfig:n}=e;const l=xo(),s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,u.uri))),d=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(x.ZP.selectors.getMode),f=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),h=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),E=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),v=(0,a.useSelector)(x.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,S=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),O=v===b.OXy.Saving,C=v===b.OXy.Cloning||O,[P,N]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{N(!1)}),[]),I=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(x.ZP.selectors.getMetadata),s=(0,a.useDispatch)(),c=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,c),[l,c]),d=(0,b.nt9)(l,c),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(c),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,c]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);s(x.N5.entity.actions.entityCloneRequested({data:wo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),k=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:b.fO_.EDITING,description:y().text("Edit profile directly"),icon:po.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:b.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Oo,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:b.fO_.VIEWING,description:y().text("Suggest changes and initiate a workflow review"),icon:uo.Z,permission:"READ"}]),[]),D=(0,r.useMemo)((()=>[...I?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Co,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:$e.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&s(x.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[s,u.uri,I]),Z=!E&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(S),R=(0,b.ZiX)(null==u?void 0:u.uri),A=(0,r.useMemo)((()=>Po(k,S,R,m,c)),[k,S,m,c,R]),j=(0,r.useMemo)((()=>Po(D,S,R,m,c)),[D,S,m,c,R]),L=(0,r.useCallback)((e=>{s(x.N5.mode.actions.modeUpdated(e))}),[s]),M=(0,r.useCallback)((()=>{s(x.N5.mode.actions.modeCancelEditing())}),[s]),U=(0,r.useCallback)((()=>{s(x.N5.actions.saveProfile())}),[s]);return o().createElement(o().Fragment,null,o().createElement(mo.Z,{className:H()(t,Et.U),entity:f&&p?p:u},o().createElement(W.Box,{display:"flex",alignItems:"center"},o().createElement(W.Box,{mr:3},f&&o().createElement(W.Box,{className:l.editingButtons},o().createElement(W.Button,{variant:"outlined",onClick:M,"data-reltio-id":"reltio-profile-cancel-editing",disabled:C},y().text("Cancel")),o().createElement(W.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:U,disabled:C},(0,b.fnZ)(g)?y().text("Suggest"):y().text("Save"))),E&&h?o().createElement(go.Z,null):h&&o().createElement(fo.a,null)),Z&&o().createElement(bo.T,{optionsGroup:A,buttonsGroup:j,value:g,onChange:L,disabled:C})),o().createElement(W.Box,{className:l.comments},o().createElement(vt.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!I&&o().createElement(Ve.Z,{open:P,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:I,onDiscard:T,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var To=n(71820),Io=n(85890),ko=n(26789),Do=n(54362),Zo=n(6674),Ro=n(91515),Ao=n(52043),jo=n(17308),Lo=n(39827),Mo=n(80147),Uo=n(76569);const Ho=(0,K.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),_o=()=>{const{total:e}=(0,r.useContext)(D.O),t=Ho();return o().createElement(W.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Uo.Z,null))};var zo=n(26313),Fo=n(9371),Vo=n(4426);const Bo=(0,K.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Wo=()=>{const e=Bo(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(O.h),i=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,zo.Q)(n);return o().createElement(Pe.X.Provider,{value:s},o().createElement(W.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Fo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(W.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Vo.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var Go=n(34120);const qo=(0,K.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Yo=()=>{const e=qo(),{tasks:t,loading:n}=(0,r.useContext)(D.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(A.Z,null),t&&t.map((e=>o().createElement(Go.s,{key:e.taskId,task:e}))))};function $o(){return $o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(this,arguments)}const Xo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",$o({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().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:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},Qo=()=>{const{commentsMap:e}=(0,r.useContext)(O.h),t=Ho();return o().createElement(W.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Xo,null))};var Ko=n(10159);const Jo=()=>o().createElement(Ko.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),ea=()=>o().createElement(Ko.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function ta(){return ta=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}let na;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(na||(na={}));const ra=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},oa=()=>{var e,t,n;const l=Ho(),s=(0,a.useSelector)(x.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(x.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(x.ZP.selectors.isCollaborationEnabled),d=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent),m=(0,a.useSelector)(x.ZP.selectors.getMetadata),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,r.useContext)(D.O),h=(0,r.useContext)(O.h),[E,v]=(0,r.useState)(null),w=(0,r.useCallback)((e=>{v((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{v(null)}),[]),C=null!==E,P=E===na.History,{isHistoryEnabled:N,isProfilePersisted:T}=(0,To.C)({isHistoryTabActive:P,entity:g}),{historyFilter:I,onApplyFilter:k,isLoading:Z,historicUris:R,historyWithTotal:A,canLoadMore:j,onLoadMore:L}=(0,Io.k6)({entity:g,enabled:N}),M=s&&c&&!(0,b.ZiX)(null==g?void 0:g.uri),U=u&&p,H=(0,b.mdt)(null==h?void 0:h.commentsMap),_=[{buttonProps:{id:na.Workflow,icon:_o,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?o().createElement(Yo,null):o().createElement(Jo,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:ra(null==f?void 0:f.total),rightContent:o().createElement(ko.G,null)},hidden:!M},{buttonProps:{id:na.Collaboration,icon:Qo,tooltipTitle:y().text("Collaboration")},content:H?o().createElement(Wo,null):o().createElement(ea,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:ra(H)},hidden:!U},{buttonProps:{id:na.History,icon:Mo.Z,tooltipTitle:y().text("History")},content:T?o().createElement(Do.Z,{isLoading:Z,historyWithTotal:A,contributorsUris:R,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:L,canLoadMore:j}):o().createElement(Zo.Z,null),headerProps:{content:o().createElement(Ro.Z,{total:T?((null==R?void 0:R.length)||0)+1:void 0,entityType:(0,b.nt9)(m,null==g?void 0:g.type),filter:I,onApplyFilter:k})}}],z=(0,i.reject)((0,i.propEq)("hidden",!0))(_);return(0,r.useEffect)((()=>{var e;null!==(e=_[E])&&void 0!==e&&e.hidden&&S()}),[E,_,S,z]),o().createElement("div",{className:l.wrapper},o().createElement(Ao.h,{open:C,width:480},!(null!==(e=_[E])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(jo.P,ta({},null===(t=_[E])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=_[E])||void 0===n?void 0:n.content)),o().createElement(Lo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(_),onButtonClick:w,activeIndexId:E}))};var aa=n(39781),la=n(16715);const ia="48px",sa="1px solid rgba(0, 0, 0, .125)",ca=(0,K.Z)((e=>({accordion:{borderTop:sa,borderBottom:sa,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:ia,minHeight:ia,"&$accordionSummaryExpanded":{height:ia,minHeight:ia}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),ua=ca;var pa=n(38016);const da=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=ua();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(W.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(W.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(pa.Z,null)},i,o().createElement(W.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(W.AccordionDetails,{className:H()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));da.displayName="ErrorsPanel";const ma=(0,i.omit)(["deactivated","path"]),ga=(0,r.memo)((e=>{let{error:t}=e;const n=ua(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.useSelector)(x.ZP.selectors.getMetadata),t),l=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));ga.displayName="Error";const fa=()=>{const e=ua(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,i.equals)(e.map(ma),t.map(ma))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(x.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:o().createElement(aa.Z,{className:H()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?y().text("warning"):y().text("warnings")}),icon:o().createElement(la.Z,{className:H()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(da,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ga}):null},ba=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));var ha=n(87685);const ya=(0,K.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Ea=e=>{let{notification:t}=e;const n=ya({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(x.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(x.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{c.cancelAction&&l(c.cancelAction),u(void 0)}),[c]),f=(0,r.useCallback)((()=>{l(c.applyAction),u(void 0),l(x.ui.actions.closeNotification(t.id))}),[c,t]),b=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(W.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),h=o().createElement(o().Fragment,null,o().createElement(hr.Z,{className:n.closeIcon,size:"S",icon:ha.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(W.Portal,{container:document.body},o().createElement(W.Snackbar,{autoHideDuration:s,open:p,classes:{root:n.snackbar},action:b,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),o().createElement(Ve.Z,{open:!!c,title:null==c?void 0:c.confirmationText,content:null==c?void 0:c.confirmationDescription,onSave:f,onDiscard:g,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},va=()=>{const e=(0,a.useSelector)(x.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Ea,{key:e.id,notification:e})))):null},xa={},wa=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i}=e;const s=ba({maxWidth:null==n?void 0:n.maxWidth}),c=(0,a.useDispatch)(),u=(0,r.useCallback)((()=>i().then((e=>e.layout?{}:e))),[i]),p=(0,r.useRef)(),d=(0,r.useCallback)((0,b.DsO)(l,1e3),[l]),m=(0,a.useSelector)(x.ZP.selectors.getEntity),g=null!=n&&n.nestedRoute?`/${n.nestedRoute}`:"",f=m?m.type:null,h=f&&n?f+g:null,{isLoaded:E,savedState:M=xa,updateSavedState:U}=(0,w.w)({getSavedState:u,saveState:d,entityTypeUri:h}),[H,_]=(0,r.useState)([]),[z,F]=(0,r.useState)([]),V=(0,r.useMemo)((()=>v()(n)),[n]),B=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),W=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),G=(0,S.C)({objectIds:W}),q=(0,r.useContext)(O.h),Y=(0,C.U)(),$=(0,P.v)(null==n?void 0:n.workflow),X=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent);(0,N.a)({entity:m,historyEvent:X});const Q=(0,T.u)(),K=(null===(t=(0,a.useSelector)(x.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"";(0,r.useEffect)((()=>{if(E){const e=V!==M.configHash,{views:t,layout:r}=(0,b.Mfk)({views:e||!M.views?n.views:M.views,layout:e?n.layout:M.layout});F(t),_(r)}}),[E,M,h]),(0,r.useEffect)((()=>{c(x.N5.views.actions.profileViewsSet(z))}),[c,z]),(0,r.useEffect)((()=>{n.sidePanelViews&&c(x.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>{p.current&&(p.current.scrollTop=0)}),[null==m?void 0:m.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(x.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(x.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),s=(0,a.useSelector)(x.ZP.selectors.getMode),c=(0,a.useSelector)(x.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(x.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&s===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const J=(0,r.useCallback)((e=>{U({layout:e,views:z,configHash:V}),_(e)}),[U,V,z]),ee=p.current,te=(0,r.useMemo)((()=>({element:ee,priority:["top","bottom"]})),[ee]);return o().createElement(I.j.Provider,{value:!0},o().createElement(k.s.Provider,{value:Y},o().createElement(O.h.Provider,{value:B?q:G},o().createElement(D.O.Provider,{value:$},o().createElement(Z.m.Provider,{value:Q},o().createElement(R.l.Provider,{value:K},o().createElement("div",{className:s.perspectiveView},(!E||!(null!=m&&m.uri))&&o().createElement(A.Z,null),E&&null!=m&&m.uri?o().createElement("div",{className:s.profileContainer},o().createElement("div",{className:s.profileWrapper},o().createElement(No,{profileBandConfig:n.profileBand}),!B&&o().createElement(fa,null),o().createElement("div",{ref:p,className:s.scrollWrapper},o().createElement(j.p.Provider,{value:te},o().createElement(co,{layout:H,onLayoutChanged:J,views:z})))),o().createElement(oa,null)):o().createElement("div",{className:s.emptyState},o().createElement(L.ZP,{LogoRenderer:L.B9.NO_DATA,text:y().text("No data to display."),variant:L.tC.embedded})),o().createElement(va,null))))))))}));wa.displayName="ProfilePerspectiveView";const Sa=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),Oa=e=>{let{config:t,store:n,onResize:h=i.identity,saveState:y,getSavedState:E,qxSandboxApi:v}=e;const x=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:w,showSnackbarMessage:S}=(0,p.D)(),O=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:null==O?void 0:O.id},o().createElement(m.S.Provider,{value:S},o().createElement(g.Y.Provider,{value:v},o().createElement(s.StylesProvider,{generateClassName:Sa},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>h(Math.floor(e),Math.floor(t))}),O&&o().createElement(wa,{config:O,saveState:y,getSavedState:x}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var Ca=n(82842),Pa=n(51229),Na=n(91131);const Ta=(0,K.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),Ia=e=>{let{total:t=0}=e;const n=Ta(),l=(0,a.useDispatch)(),i=(0,r.useContext)(d.m),s=(0,r.useCallback)((()=>{l(x.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(G.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(W.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},y().text("Profile")),o().createElement(Na.Z,{className:n.icon}),y().text("Tags")),o().createElement(Pa.Z,null),o().createElement(W.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var ka=n(20404);const Da=(0,K.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),Za=e=>{let{label:t}=e;const n=Da();return o().createElement(W.Toolbar,{className:n.toolbar},o().createElement(ka.Z,{className:n.avatar}),o().createElement(W.Typography,{variant:"h6",className:n.label},t))};function Ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Aa(e,t,n[t])}))}return e}function Aa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ja=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),La=[25,50,100],Ma=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=ja(),[s,c]=(0,r.useState)(La[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,ve._)(),u=(0,ve._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:E,requestTotal:v}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(x.ZP.selectors.getTenant),s=(0,a.useSelector)(x.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Ra({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,b.E7G)(c))):(0,b.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Ra({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(v()).then(g).catch(w)}),[v,c,w]),(0,r.useEffect)((()=>{d(!0),u(E(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,E,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const E=g>La[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Za,{label:t}),o().createElement("div",{className:H()(l.tagsContainer,{[l.fullHeight]:E})},o().createElement(V.Z,{className:l.tagsView},o().createElement(Ia,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(A.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(Ca.Z,{entities:f})),E&&o().createElement("div",{className:l.pagination},o().createElement(B.Z,{count:g,rowsPerPageOptions:La,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));Ma.displayName="TagPerspectiveView";const Ua=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ha=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(d.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Ua},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Ma,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
2
2
  //# sourceMappingURL=6217.js.map