@reltio/remotes 1.4.1065 → 1.4.1066

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 (2) hide show
  1. package/1962.js +1 -1
  2. package/package.json +1 -1
package/1962.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[1962],{70595:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");t.Z=o},91131:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M24 24H0V0h24v24z",opacity:".87"}),a.default.createElement("path",{d:"M7.38 21.01c.49.49 1.28.49 1.77 0l8.31-8.31c.39-.39.39-1.02 0-1.41L9.15 2.98c-.49-.49-1.28-.49-1.77 0s-.49 1.28 0 1.77L14.62 12l-7.25 7.25c-.48.48-.48 1.28.01 1.76z"})),"ArrowForwardIosRounded");t.Z=o},90324:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");t.Z=o},43576:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Create");t.Z=o},16715:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");t.Z=o},80147:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"History");t.Z=o},76569:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"}),"Inbox");t.Z=o},82726:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");t.Z=o},86680:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 15c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm1-8h-2V7h2v2z"}),"InfoRounded");t.Z=o},16208:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"}),"ThumbDown");t.Z=o},52691:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"}),"ThumbUp");t.Z=o},39781:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");t.Z=o},61962:(e,t,n)=>{n.d(t,{_:()=>To,t:()=>Go});var r=n(24328),a=n.n(r),o=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(12212),d=n(97333),m=n(22241);const g=a().createContext({getCurrentPerspectiveId:()=>"",setEntityUri:()=>{},showPerspective:()=>{}});var f=n(87918),h=n.n(f),b=n(3096),y=n.n(b),v=n(35674),E=n(11326),x=n(36852),w=n(58142),S=n(10),C=n(27938),P=n(35722),O=n(589),Z=n(80231),N=n(89575),k=n(14834),T=n(62228),R=n(87378),I=n(79002),j=n(17822),L=n(71153),D=n.n(L),M=n(15177);const A=a().createContext(null);A.displayName="SingleAttributeContext";var U=n(80687),z=n(1730),H=n(42011),V=n(95544),F=n(90436),W=n(52194),_=n(10742),B=n(55310),G=n(37457),q=n(46804),$=n(79784),Q=n(77277),X=n(36444),Y=n(5806),K=n(21324),J=n(79692);const ee=(0,J.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"}}))),te=e=>{let{className:t}=e;const n=ee(),o=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(A),u=()=>i((e=>!e));return a().createElement(a().Fragment,null,a().createElement(Q.Z,{ref:o,classes:{root:D()(n.triggerButton,t)},onClick:u},a().createElement(X.Z,null)),a().createElement($.ZP,{open:l,classes:{paper:n.popupContent},anchorEl:o.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(Y.Z,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:a().createElement(K.Z,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:h().text("Show inactive values")})))},ne=(0,J.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"}}))),re=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:o}=e;const l=ne(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(A);return a().createElement(W.Z,{title:h().text(t),className:l.root},a().createElement(_.Z,{widthToHide:500},a().createElement(B.Z,{height:24,margin:16}),a().createElement(F.Z,{className:l.totalCaption,variant:"caption"},h().number(n)," ",1===n?h().text("item"):h().text("items"))),a().createElement(G.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),a().createElement(q.i,{query:i,onChange:e=>{s(e),c(0)}}),o&&a().createElement(te,null))};var ae=n(65549),oe=n(85256),le=n(63928),ie=n(55401),se=n(30410);const ce=(0,J.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}))),ue=m.nIW,pe=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return pe(n,t)})))):m.P6Y.strings.search(String(e),t),de=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:a=1/0,offset:o=0,searchQuery:l=""}=e;const s=(0,i.pipe)(m.XtP,(0,i.filter)((e=>{let{value:t}=e;return pe(t,l)})))(t,n,r),c=(0,i.filter)(m.OXP,s);return{[(0,m.xy8)(r)]:{[ue(r)]:c.slice(o,o+a),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function me(){return me=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},me.apply(this,arguments)}function ge(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){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he=[],be=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s}=e;const c=ce(),{uri:u,required:d,cardinality:g,name:f}=n,b=(0,o.useDispatch)(),y=(0,r.useContext)(p.m),E=(0,o.useSelector)(v.ZP.selectors.getEntity),x=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,E.uri)||{})),w=(0,o.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),S=(0,o.useSelector)((e=>(0,m.tQX)(l,n,v.ZP.selectors.getProfileErrors(e)))),C=(0,o.useSelector)(v.ZP.selectors.getMode),P=(0,m.xy8)(n),O=(0,i.pipe)((0,i.pathOr)(he,[P,f]),(0,i.map)((0,i.prop)("uri")))(E),Z=(0,i.pathOr)(he,[P,f],x),N=Z.map((0,i.prop)("uri")),k=(0,m.ZiX)(E.uri),T=(0,r.useRef)((0,m.gjI)({parentUri:l,attributeType:n})),R=(0,m.O27)(Z),I=d&&R,j=I?[T.current]:Z.filter((0,i.pipe)((0,i.prop)("uri"),m.ZiX)),L=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,b)(e.map((e=>ge({},e,{viewId:y}))))),[y,b]),M=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.modifyAttribute,b)(ge({},e,{viewId:y}))),[y,b]),A=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,b)(ge({},e,{viewId:y}))),[y,b]),U=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,b),[b]),z=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return L(I&&!(0,m.YkM)(n.type)?[e,e]:[e])}),[L,l,n,I]),H=(0,m.Vg3)({attributeType:n,mode:C}),V={attributeType:n,errors:w,crosswalks:x.crosswalks,mode:C,onAddAttributes:L,onChangeAttribute:M,onDeactivateError:U,showNonOv:s};return a().createElement("div",null,a().createElement(le.Z,{cardinality:g}),a().createElement(ie.Z,{message:S}),H&&a().createElement(Q.Z,{color:"primary",onClick:z,className:c.moreButton},a().createElement(ae.Z,{classes:{root:c.icon}}),a().createElement("div",{className:c.buttonLabel},h().text("Add"))),j.map(((e,t)=>a().createElement(se.Z,me({key:e.uri},V,{attributeValue:e,lazy:I&&!d,showEmptyEditors:k,ownError:(0,m.ADq)(e,t,u,w),onDeleteAttribute:A})))),j.length>0&&t.length>0&&a().createElement(oe.Z,{className:c.divider}),t.map((e=>{const t=Z.find((0,i.propEq)("uri",e.uri)),n=t||e,r=O.includes(n.uri)&&!N.includes(n.uri),o=!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,m.vKJ)({valueTransformer:(0,i.unless)(m.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)(o),(0,i.always)("edited")]])();return a().createElement("div",{key:n.uri,className:D()({[c.ovFalse]:!(0,m.OXP)(n)})},a().createElement(se.Z,me({},V,{attributeValue:n,ownError:(0,m.ADq)(n,null,u,w),onDeleteAttribute:A,state:l})))})))};var ye=n(11013);const ve=(0,J.Z)((e=>({ovFalse:e.inactive}))),Ee=e=>{let{values:t,attributeType:n,showInactive:r}=e;const o=ve();return a().createElement(a().Fragment,null,t.map((e=>a().createElement("div",{key:e.uri,className:D()({[o.ovFalse]:!(0,m.OXP)(e)})},a().createElement(ye.Z,{attributeValue:e,attributeType:n,showNonOv:r})))))},xe=(0,J.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}}))),we=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=xe(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:y}=(0,r.useContext)(A),E=(0,o.useSelector)(v.ZP.selectors.getEntityUri),x=(0,o.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,o.useSelector)(v.ZP.selectors.getIsEditableMode),S=(0,o.useSelector)(v.ZP.selectors.getPivotingAttributes),C=0!==u.length;return a().createElement(U.J.Provider,{value:S},a().createElement(z.Z,{className:D()(c.root,n)},a().createElement(re,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),a().createElement(V.Z,{className:c.content},(()=>{if(g)return a().createElement(R.Z,null);if(b){if(x&&C){const e={values:u,attributeType:b,showInactive:y};return a().createElement(Ee,e)}if(w){const e={values:u,attributeType:b,parentUri:E,showInactive:y};return a().createElement(be,e)}}return a().createElement(F.Z,{className:c.noData},h().text("No data"))})()),f&&a().createElement(H.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var Se=n(29627),Ce=n(55962);function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Oe=(e,t,n)=>{const{attributeUri:a,max:l=15}=e,s=(0,o.useSelector)(v.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[g,f]=(0,r.useState)(!1),h=(0,Se._)(),b=(0,r.useRef)(null),y=(0,o.useDispatch)(),E=(0,o.useSelector)(v.ZP.selectors.getApiPath),x=(0,o.useSelector)(v.ZP.selectors.getTenant),w=n?v.ZP.selectors.getEntityWithDiff:v.ZP.selectors.getEntityWithoutDiff,S=(0,o.useSelector)(w),C=(0,o.useSelector)(v.ZP.selectors.getIsViewMode),P=(0,o.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),O=(0,o.useSelector)(v.ZP.selectors.getHistoryDiff),Z=S.uri,N=ue(a),k=(0,m.xy8)(a);b.current=(0,m.JQy)(S,Z,N);const T=(0,r.useMemo)((()=>(0,m.zeJ)(s,a)),[s,a]),{globalFilter:R}=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:I}=t,j=(0,r.useCallback)((()=>{if(T&&(0,m.Uty)(T)&&!(0,m.ZiX)(Z)&&(0,m.YOQ)(a)){f(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["page","showInactive"]),o=(0,m.biM)(S)||P?de:m.KbL;h(o(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){Pe(e,t,n[t])}))}return e}({metadata:s,entity:S,apiPath:E,tenant:x,parentUri:Z,defaultMaxValues:l,attributeTypeUri:a,offset:l*e,globalFilter:R,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([k],e),n=(0,i.pathOr)([],[N],t);P||y(v.N5.actions.processNextPageOfAttributeValues({parentUri:Z,attributeTypeUri:a,attributeTypeName:N,values:n})),u(n.map((e=>{var t;return(null===(t=b.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",a],t))})).finally((()=>{f(!1)}))}else u([]),d(null)}),[E,Z,x,a,l,s,t,R,T,P,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,Ce.D)((()=>{C&&j()}),[C]);const L=(0,i.partition)(m.OXP),[,D]=L(b.current||[]),M=I?[]:D,A=I?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(A),(0,i.prop)(A),(0,i.always)(c.length))(p),z=l<U,H=null!=p&&p.totalValues?p.totalValues-U:M.length;return{values:c,isLoading:g,hasPaging:z,totalVisibleValues:U,attributeType:T,totalNonVisibleValues:H,nonVisibleValues:M}};function Ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ne=n(80225),ke=n(63929),Te=n(1128),Re=n(39475),Ie=n(90324),je=n(70595);const Le=a().createContext(null);Le.displayName="RelationsViewStateContext";const De=(0,J.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"}}))),Me=e=>{let{className:t}=e;const n=De(),o=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(Le),[g,f]=(0,r.useState)(!1),b=()=>f((e=>!e)),y=!(0,m.O27)(d),v="asc"===s;return a().createElement(a().Fragment,null,a().createElement(Q.Z,{ref:o,classes:{root:D()(n.button,t)},onClick:b},a().createElement(X.Z,null)),a().createElement($.ZP,{open:g,classes:{paper:n.popupContent},anchorEl:o.current,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(Y.Z,{classes:{label:n.checkboxControlLabel},control:a().createElement(K.Z,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:h().text("Show inactive Relationships")}),y&&a().createElement(a().Fragment,null,a().createElement(oe.Z,{className:n.divider}),a().createElement(F.Z,{className:n.title,variant:"h6"},h().text("Sort by")),a().createElement("div",{className:n.sortControls},a().createElement(Te.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"}}}),a().createElement(Re.k,{tooltipTitle:v?h().text("Ascending"):h().text("Descending"),icon:v?Ie.Z:je.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Me.displayName="FilterButton";const Ae=Me,Ue=(0,J.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 ze=n(61932),He=n(98538);const Ve=a().createContext(null);function Fe(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}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 _e=Math.pow(2,31)-1,Be=(0,J.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 Ge=n(22118),qe=n(26739);const $e=e=>{let{label:t}=e;const n=Be();return a().createElement(qe.Z,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},a().createElement(ze.Z,null))},Qe=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,o.useSelector)(v.ZP.selectors.getDataTenants),n=(0,o.useDispatch)(),{config:a,reloadRelations:l}=(0,r.useContext)(Ve),i=(0,o.useSelector)(v.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,o.useSelector)(v.ZP.selectors.getDtssPath),g=(0,o.useSelector)(v.ZP.selectors.getTenant),f=[Fe({},a.content,{offset:0,max:null!==(e=a.maxDtssImport)&&void 0!==e?e:_e})],b=(0,r.useCallback)((()=>{c([]),a.importFromDT&&!(0,m.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,m.QXb)({entityUri:i,content:f,dtssPath:d,customerTenant:g,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Fe({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,g,a,t]),y=(0,r.useCallback)((()=>{(0,m.MOC)({entityUri:i,content:f,dtssPath:d,customerTenant:g,dataTenant:u.id}).then((()=>{l(),b()})).catch((e=>n(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong")))))),p(null)}),[i,d,g,a,b,l,u,p]);(0,r.useEffect)((()=>{b()}),[b]);const E=(0,r.useCallback)((()=>p(null)),[]),x=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:y,onCancelConfirmation:E,onImportClick:x}})(),s=Be(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return a().createElement(a().Fragment,null,!!e.length&&a().createElement(a().Fragment,null,c?a().createElement("div",{className:s.button},a().createElement(Re.k,{size:"L",icon:ze.Z,tooltipTitle:h().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),a().createElement("div",{className:D()(s.tenant)},u)):a().createElement(He.Z,{menuId:"importDT-table-actions",buttonComponent:Re.k,buttonProps:{tooltipTitle:h().text("Import connections"),size:"L",icon:()=>a().createElement($e,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),a().createElement(Ge.Z,{open:!!t,title:h().text("Confirmation"),content:h().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:h().text("Cancel"),saveCaption:h().text("Import"),onDiscard:l,onSave:n})))},Xe=e=>{let{title:t,total:n}=e;const o=Ue(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Le);return a().createElement(W.Z,{title:t||"",className:o.header},n>0&&a().createElement(_.Z,{widthToHide:400},a().createElement(B.Z,{height:24,margin:16}),a().createElement(F.Z,{className:o.totalCaption,variant:"caption"},n>1?h().text("${count} items",{count:n}):h().text("${count} item",{count:n}))),a().createElement(q.i,{query:l,onChange:i}),a().createElement(Qe,null),a().createElement(Ae,null))};var Ye=n(821),Ke=n(27604),Je=n(22983),et=n(42662),tt=n(18527),nt=n(4614),rt=n(80030);const at=(0,J.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 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 lt=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["label","entity","children"]);const c=at(),u=(0,Se._)(),p=(0,o.useSelector)(v.ZP.selectors.getTenant),d=(0,o.useSelector)(v.ZP.selectors.getDtssPath),[g,f]=(0,r.useState)(!1),[h,b]=(0,r.useState)(null);(0,r.useEffect)((()=>{b(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(h)){const e=(0,i.ifElse)(m.biM,(e=>(0,m.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,m.XkT)(e.entityUri)));f(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;b(t)})).finally((()=>{f(!1)}))}}),[d,n,p,u,h]),E=a().createElement("div",{className:c.tooltipContent},a().createElement("div",{className:c.label},t),g&&a().createElement(nt.Z,{size:16,classes:{colorPrimary:c.progress}}),h&&a().createElement("div",{className:c.secondaryLabel},h));return a().createElement(rt.ZP,ot({onOpen:y,title:E,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},it=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,m.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,m.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,m.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,m.Lmx)(t,null==r?void 0:r.relationType)}},st=(0,J.Z)((()=>({container:{display:"flex"}})));function ct(){return ct=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},ct.apply(this,arguments)}const ut=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["acceptRelation","ignoreRelation"]);const o=st();return a().createElement("div",{className:o.container},a().createElement(Q.Z,ct({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),h().text("Accept")),a().createElement(Q.Z,ct({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),h().text("Ignore")))},pt=(0,J.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"}}))),dt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:o,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=pt(),{entity:d,relation:g}=t,f=(0,m.$qe)(t),b=(0,m.xr3)(t),y=(0,m.iJH)(t),{entityType:v,entityLabel:E,preparedUri:x,relationLabel:w}=it(t,n),S=(0,m.Fn9)(g)&&(0,m.Fn9)(d),{canRemove:C,canUpdate:P}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:a,onEditRelation:o}=e;if((n===m.ARY.Editing||n===m.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,m.$qe)(r),i=(0,m.V3K)(t,e);return{canRemove:a&&!l&&(0,m.Edd)(n,i),canUpdate:o&&!l&&(0,m.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:m.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),O=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),Z=(0,r.useCallback)((()=>i(t)),[i,t]),N=(0,r.useCallback)((()=>{s(t)}),[s,t]),k=(0,r.useCallback)((()=>c(t)),[c,t]),T=(C||P)&&o&&!t.suggested?a().createElement(a().Fragment,null,P&&a().createElement(Re.k,{icon:Ke.Z,size:"XS",onClick:Z,tooltipTitle:h().text("Edit")}),C&&a().createElement(Re.k,{icon:Je.Z,size:"XS",onClick:O,tooltipTitle:h().text("Remove")})):void 0,R=t.suggested?a().createElement(ut,{acceptRelation:N,ignoreRelation:k,size:"small",disabled:y}):void 0,I=y?h().text("ignored"):h().text("edited");return a().createElement("div",{className:D()(p.container,{[p.rowInactive]:!S},{[p.removed]:f||y})},a().createElement("div",{className:p.row},u&&u(),a().createElement(et.Z,{className:p.entityAvatar,entityType:v}),a().createElement(tt.Z,{value:x,className:p.entityLabelContainer},a().createElement(lt,{label:E,entity:d},a().createElement("span",{className:p.entityLabel},E)),(b||y)&&a().createElement(F.Z,{variant:"caption",className:p.editedLabel},"(",I,")"),w&&a().createElement("span",{className:p.relationLabel},`, ${w}`)),a().createElement("div",{className:p.editButtonsContent},T),R))})),mt=(e,t)=>{const n=(e,t)=>(t?(0,m.VGB)(t):[]).map((t=>({type:t,direction:e===m.Nsj.IN?m.Nsj.IN:m.Nsj.OUT})));return n(m.Nsj.IN,e).concat(n(m.Nsj.OUT,t))[0]};function gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ft=n(98989),ht=n(83543);const bt=(0,J.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),yt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:o}=e;const l=bt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,m.xvW)(n)?null:o?a().createElement(ht.Z,c):a().createElement(ft.Z,c)},vt=(0,J.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),Et=e=>{let{config:t,connection:n,children:l}=e;const i=vt(),{showInactive:s}=(0,r.useContext)(Le),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:g,total:f}=(e=>{let{config:t,connection:n,relationActivityFilter:a}=e;const l=(0,o.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),[p,d]=(0,r.useState)(0),{contentSecondLevel:g}=t,{entity:f}=n,h=(0,o.useSelector)((e=>v.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,f.entityUri)))||[],{activityFilter:b}=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(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){gt(e,t,n[t])}))}return e}({},g,{returnObjects:!0,returnDates:!0,activeness:{relation:a||m.Ng6.ALL,entity:b}});u(!0),(0,m.N6e)(f.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(v.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:f.entityUri,id:t.id})),d(r),u(!1)}))}),[t.id,g,l,f.entityUri,b,a]),E=(0,r.useCallback)((()=>{i||n.connections||y(),s((e=>!e))}),[y,n.connections,i]);return{connections:h,showSecondLevel:i,toggleShowSecondLevel:E,loadRelations:y,loading:c,total:p}})({config:t,connection:n,relationActivityFilter:s?m.Ng6.ALL:m.Ng6.ACTIVE_ONLY}),h=(0,r.useMemo)((()=>(0,m.Px$)(c)),[c]);return a().createElement(a().Fragment,null,l((()=>a().createElement(yt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&a().createElement(ke.X.Provider,{value:h},a().createElement("div",{className:i.secondLevelContent},a().createElement(Yt,{isLoading:g,config:t,loadRelations:d,connections:c,total:f,parentEntityUri:n.entity.entityUri}))))},xt=(0,J.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"}}))),wt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,o.useSelector)(v.ZP.selectors.getMetadata),d=(0,o.useSelector)((e=>v.ZP.selectors.getRelationToAddByViewId(e,l.id))),g=(0,o.useSelector)((e=>v.ZP.selectors.getRelationsToEditByViewId(e,l.id))),f=(0,o.useSelector)(v.ZP.selectors.getEntity),b=(0,o.useSelector)((e=>v.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),y=(0,o.useDispatch)(),E=xt(),x=(0,r.useCallback)((()=>{const e=(0,m.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y)(e)}),[l,s,p,y,u]),w=(0,r.useCallback)((e=>{y(v.N5.relations.actions.closeRelationEditor(l.id,e)),y(v.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>v.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=v.N5.relations.selectors.getEntityUriFromConnection(t);(0,m.ZiX)(r)&&y(v.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,y]),S=l.content,C=mt(S.inRelations,S.outRelations),P=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(C.type),object:(0,i.evolve)({type:(0,i.always)(C.type),attributes:(0,i.always)(null)})}}))(e);y(v.N5.relations.actions.addRelation(l.id,t))}),[y,l,C]),O=(0,r.useCallback)((e=>{y(v.N5.relations.actions.ignoreRelation(l.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[y,l,C]),[Z,N]=(0,i.partition)(m.xvW,n),k=f&&b,T=0===Z.length&&0===N.length,R=e=>{var t,n;const r=g.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)})),o=!l.allowOnlyCreateNew||(0,m.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 a().createElement(Et,{config:l,connection:e,key:c},(t=>r?a().createElement(Ye.Z,{connection:r,config:l,mode:s,metadata:p}):a().createElement(dt,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:o,onRemoveRelation:w,onEditRelation:(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y),onAcceptRelation:P,onIgnoreRelation:O})))},I=k&&(!d||d&&d.parentEntityUri===u),j=d&&d.parentEntityUri===u;return a().createElement("div",{className:t},I&&a().createElement(Q.Z,{color:"primary",onClick:x,className:E.moreButton},a().createElement(ae.Z,{classes:{root:E.icon}}),a().createElement("div",{className:E.buttonLabel},h().text("Add"))),j&&a().createElement(Ye.Z,{connection:d,config:l,mode:s,metadata:p}),Z.map(R),Z.length>0&&N.length>0&&a().createElement(oe.Z,{className:E.divider}),N.map(R),T&&a().createElement(F.Z,{className:E.noData},c))};var St=n(62901),Ct=n(72316),Pt=n(38309),Ot=n(89978);const Zt=(0,J.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Nt(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){kt(e,t,n[t])}))}return e}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tt=e=>{let{connection:t,className:n}=e;const l=Zt(),{relation:s}=t,c=(0,o.useSelector)(v.ZP.selectors.getEntityUri),u=(0,o.useSelector)(v.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,m.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>Nt({attributes:Nt({},v.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,m.p2l)((null==t?void 0:t.relation)||{}))),[t]),g=(0,r.useMemo)((()=>(0,m.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,m.O27)(t)})).length>0,f=(0,r.useMemo)((()=>(0,m.R$r)(d.attributes)),[d]),{getCommentsCount:b}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(f)&&b(f)}),[b,f]);const y=(0,r.useMemo)((()=>(0,m.wp9)(m.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return g?a().createElement(Pt.A.Provider,{value:y},a().createElement(Ot.Z,{className:D()(l.attributesList,n),entity:d,attrTypes:p})):a().createElement("div",{className:D()(l.attributesList,n)},h().text("No attributes"))};var Rt=n(86680),It=n(82726);const jt=e=>{let{show:t,onToggle:n,className:r}=e;return a().createElement(Re.k,{className:r,tooltipTitle:t?h().text("Hide attributes of the relationship"):h().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Rt.Z:It.Z,onClick:n})},Lt=(0,J.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"flex-start",flexDirection:"row",minHeight:"16px",padding:"3px 16px 0 "},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"},showDetails:{marginLeft:"auto"},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"},suggestedLabelWrapper:{marginTop:"6px"},labelWrapper:{display:"flex"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=Lt(),u=t.suggested,{entity:p,relation:d}=t,[g,f]=(0,r.useState)(!1),h=(0,o.useSelector)(v.ZP.selectors.getMetadata),{entityType:b,entityLabel:y,preparedUri:E,relationLabel:x}=it(t,h),w=(0,m.Fn9)(d)&&(0,m.Fn9)(p),S=(0,o.useSelector)(v.ZP.selectors.getEntityUri),C=p&&d&&(0,m.wp9)(m.q7e.RELATION,{entityUri:S,connection:t})||[];return a().createElement("div",{className:D()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},a().createElement("div",{className:D()(c.row,St.U)},n&&n(),a().createElement("div",{className:D()(c.labelWrapper,{[c.suggestedLabelWrapper]:u})},a().createElement(et.Z,{className:c.entityAvatar,entityType:b}),a().createElement(tt.Z,{value:E,className:c.entityLabelContainer},a().createElement(lt,{label:y,entity:p},a().createElement("span",{className:c.entityLabel},y)),x&&a().createElement("span",{className:c.relationLabel},`, ${x}`))),a().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&a().createElement(Ct.Z,{className:c.commentsContainer,uri:null==d?void 0:d.relationUri,relatedObjectUris:C,objectType:m.q7e.RELATION,allowOnlyOneComment:!0}),u&&a().createElement(ut,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&a().createElement(jt,{show:g,onToggle:()=>{f((e=>!e))},className:c.showDetails}))),g&&a().createElement(Tt,{connection:t}))}));var Mt=n(52691),At=n(16208);const Ut=e=>e.filter((e=>5===e.value)).length,zt=e=>e.filter((e=>1===e.value)).length,Ht=e=>0===e.length?"0%":Ut(e)/e.length*100+"%",Vt=e=>0===e.length?"0%":zt(e)/e.length*100+"%",Ft=(0,J.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)"}}))),Wt=e=>{let{ratings:t,className:n}=e;const r=Ft();return a().createElement("div",{className:D()(r.wrapper,n)},a().createElement(F.Z,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),a().createElement("div",{className:r.scale},a().createElement("div",{className:r.likesScale,style:{width:Ht(t)}}),a().createElement("div",{className:r.dislikesScale,style:{width:Vt(t)}})),a().createElement("div",{className:r.counts},a().createElement("div",{className:D()(r.likesCount,r.count)},a().createElement(Mt.Z,{className:r.icon}),Ut(t)),a().createElement("div",{className:r.count},a().createElement(At.Z,{className:r.icon}),zt(t))))},_t=(0,J.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}}))),Bt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=_t(),i=(0,o.useSelector)(v.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:h().text("Has left the practice"),onClick:()=>r(h().text("Has left the practice"))},{text:h().text("Has moved away"),onClick:()=>r(h().text("Has moved away"))},{text:h().text("Has passed away"),onClick:()=>r(h().text("Has passed away"))},{text:h().text("Has retired"),onClick:()=>r(h().text("Has retired"))},{text:h().text("Other"),onClick:()=>r(h().text("Other"))}];return a().createElement("div",{className:l.wrapper},a().createElement(Q.Z,{onClick:n,variant:"text",size:"small",className:D()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),a().createElement(He.Z,{buttonProps:{endIcon:a().createElement(ht.Z,null),variant:"text",size:"small",className:D()(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"}))},Gt=(0,J.Z)((e=>({wrapper:{padding:"6px 16px 3px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{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 16px 3px",backgroundColor:e.suggested},commentsContainer:{marginTop:"21px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),qt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Gt(),p=t.suggested,[d,g]=(0,r.useState)(!1),{entity:f,relation:h}=t,b=(0,o.useSelector)(v.ZP.selectors.getMetadata),{entityLabel:y,entityType:E,preparedUri:x,relationLabel:w}=it(t,b),S=(null==h?void 0:h.ratings)||[],C=(0,o.useSelector)(v.ZP.selectors.getEntityUri),P=f&&h&&(0,m.wp9)(m.q7e.RELATION,{entityUri:C,connection:t})||[];return a().createElement("div",{className:D()(u.wrapper,{[u.suggestedWrapper]:p})},a().createElement(V.Z,{display:"flex",minHeight:"62px",className:St.U},a().createElement(V.Z,{display:"flex",alignItems:"flex-start"},a().createElement(V.Z,{display:"flex",alignItems:"center"},l&&l(),a().createElement(et.Z,{entityType:E,className:u.entityTypeIcon})),a().createElement(V.Z,{display:"flex",flexDirection:"column"},a().createElement(tt.Z,{value:x,className:u.entityLabelContainer},a().createElement(lt,{label:y,entity:f},a().createElement("span",{className:u.entityLabel},y))),w&&a().createElement("span",{className:u.relationLabel},w),!p&&a().createElement(Bt,{ratings:S,onAgree:()=>{(0,m.Buf)(null==h?void 0:h.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,m.Buf)(null==h?void 0:h.relationUri,{comment:e,value:1}).then(n)}}))),a().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(P)&&a().createElement(Ct.Z,{className:u.commentsContainer,uri:null==h?void 0:h.relationUri,relatedObjectUris:P,objectType:m.q7e.RELATION,allowOnlyOneComment:!0}),p&&a().createElement(ut,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&a().createElement(a().Fragment,null,a().createElement(Wt,{ratings:S,className:u.ratings}),a().createElement(jt,{show:d,onToggle:()=>{g((e=>!e))},className:u.showDetailsButton})))),d&&a().createElement(Tt,{connection:t,className:u.relationAttributes}))},$t=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=mt(e.inRelations,e.outRelations),a=(0,o.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:o}=e;(0,m.iiD)(n,{relatedEntityUri:o.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:o,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===m.Nsj.IN,u=c?o.entityUri:n,p=c?n:o.entityUri;(0,m.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong"))))}))}}})(u,l,s),g=(0,r.useMemo)((()=>(0,m.w3p)(n)),[n]),{getCommentsCount:f}=(0,r.useContext)(w.h);return(0,r.useEffect)((()=>{f(g)}),[f,g]),a().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 a().createElement(Et,{config:i,connection:e,key:r},(t=>c?a().createElement(qt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):a().createElement(Dt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};$t.displayName="RelationsList";const Qt=$t,Xt=(0,J.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=Xt(),{selectors:u}=v.ZP,p=(0,o.useSelector)(u.getEntity),d=(0,o.useSelector)(u.getMode),g=n["text-empty"]||h().text("No data found");return t?a().createElement(R.Z,null):(0,m.KIu)(d)?a().createElement(wt,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:g,parentEntityUri:s}):i>0?a().createElement(Qt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):a().createElement(F.Z,{className:c.noData},g)},Kt=(0,J.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}}),Jt=e=>{let{config:t,className:n}=e;const l=Kt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:g,searchQuery:f,changeSearchQuery:h}=(0,r.useContext)(Le),{selectors:b}=v.ZP,y=(0,o.useSelector)((e=>b.getConnectionsWithDraftsByViewId(e,t.id))),E=(0,o.useSelector)(b.getEntity),x=(0,o.useSelector)((e=>b.getTotalByViewId(e,t.id))),w=(0,o.useSelector)(b.getMode),S=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{h("")}),[null==E?void 0:E.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=m.wSh.fromFalsy(e).map(m.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new m.MEy).addClause(t).build()})(f)),[f]),{isLoading:P,reload:O}=(0,Ne.a)({sorting:S,filter:C,page:s,rowsPerPage:u,config:t,entity:E,relationActivityFilter:g?m.Ng6.ALL:m.Ng6.ACTIVE_ONLY,mode:w}),Z=(0,r.useMemo)((()=>(0,m.Px$)(y)),[y]),N=(0,r.useMemo)((()=>({reloadRelations:O,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[O,t]);return a().createElement(ke.X.Provider,{value:Z},a().createElement(z.Z,{className:n},a().createElement("div",{className:l.container},a().createElement(Ve.Provider,{value:N},a().createElement(Xe,{title:t.caption,total:x})),a().createElement("div",{className:l.content},a().createElement(Yt,{isLoading:P,config:t,loadRelations:O,connections:y,total:x}),x>u&&a().createElement(H.Z,{classes:{root:l.pagination},count:x,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};Jt.displayName="RelationsView";const en=a().createContext(null);en.displayName="SingleAttributeContext";var tn=n(17569),nn=n(75975),rn=n(79573);function an(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){on(e,t,n[t])}))}return e}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ln="CHANGE_SEARCH_QUERY",sn=an({},nn.ZP.actions,{changeSearchQuery:(0,rn.zD)(ln)}),cn=(e,t)=>t.type===ln?an({},e,{searchQuery:t.payload,page:0}):nn.ZP.reducer(e,t);var un=n(92332),pn=n(25843);const dn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},mn=(0,J.Z)((()=>({tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},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":dn}}))),gn=(0,pn.Z)((e=>{const t=mn();return a().createElement("div",{className:t.headCell},a().createElement(un.default,e))}));var fn=n(46728);function hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bn=(0,i.pipe)((0,i.map)((e=>({id:(0,m.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,m.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),yn=(0,i.pipe)(m.DK$,bn),vn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),En=e=>{if((0,m.vZp)(e)){const t=vn(e);return t.length>1?t.slice(0,-1):null}return null},xn=(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){hn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:En(e.id),headCellRenderer:gn,rowCellValueRenderer:fn.Z})));var wn=n(9377);function Sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cn=n(47081),Pn=n(33903),On=n(54238);const Zn=(0,J.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Nn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:o,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=Zn();return a().createElement(W.Z,{title:t,className:u.header},a().createElement(q.i,{query:n,onChange:r}),a().createElement(Pn.Z,{enabled:o,onClick:l}),a().createElement(B.Z,{height:24,margin:4}),a().createElement(On.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};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 Tn=(0,n(30488).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:o}=e,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=mn();return a().createElement("div",{className:D()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,kn({key:t,value:e},l)))))}));var Rn=n(45108);const In=e=>{let{onEdit:t,onRemove:n}=e;return a().createElement(a().Fragment,null,t&&a().createElement(Re.k,{tooltipTitle:h().text("Edit"),icon:Ke.Z,size:"L",onClick:t}),n&&a().createElement(Re.k,{tooltipTitle:h().text("Remove"),icon:Je.Z,size:"L",onClick:n}))};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)}const Ln=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:g,deletedUris:f}=e;const h=(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,m.tT_)(e))(t))(vn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),b=(0,r.useMemo)((()=>xn(t)),[t]),y=mn(),E=(0,o.useSelector)(v.ZP.selectors.getMode),x=(0,m.KIu)(E),w=(0,o.useSelector)(v.ZP.selectors.getMetadata),S=(0,o.useSelector)(v.ZP.selectors.getEntityUri),C=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:P}=(0,r.useContext)(en),O=(0,r.useCallback)((e=>a().createElement(Tn,jn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[Z,N]=(0,r.useState)(null),{canUpdate:k,canDelete:T}=(0,Cn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof Z||!x||f.includes((0,i.pipe)((0,i.path)([Z]),(0,i.prop)("uri"))(n))),[Z,f,n]),I="number"==typeof Z&&(j=(0,i.path)([Z],n),T(p)&&(0,m.xv5)({attributeType:P,mode:E,attributeValue:j,metadata:w,isReltioCrosswalk:(0,m.KVV)(C.crosswalks,j)}));var j;const L="number"==typeof Z&&(e=>k(p)&&(0,m.yv0)({attributeType:P,mode:E,attributeValue:e,isReltioCrosswalk:(0,m.KVV)(C.crosswalks,e)}))((0,i.path)([Z],n)),D=(0,r.useCallback)((()=>{const e=(0,i.path)([Z],n);L&&d(e)}),[d,Z,n,L]),M=(0,r.useCallback)((()=>{const e=(0,i.path)([Z],n);if(!I)return;const t={parentUri:S,attributeType:P,uri:e.uri,value:e};g(t)}),[Z,n,g,I]),A=R||!I&&!L?void 0:a().createElement(In,{onEdit:L?D:void 0,onRemove:I?M:void 0}),U=(0,r.useMemo)((()=>({deletedUris:f})),[f]);return a().createElement("div",{className:y.tableContainer},a().createElement(Rn.Z,{columnsData:b,rowsData:h,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:O,onRowHover:N,hoverRowIndex:Z,hoveredRowRightContent:A,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Dn=(0,J.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 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 An=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const d=Dn(),g=(0,o.useSelector)(v.ZP.selectors.getEntityUri),{attributeType:f}=(0,r.useContext)(en),b=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,g)||{})),y=(0,o.useSelector)(v.ZP.selectors.getMode),E=(0,o.useDispatch)(),x=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(v.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){Mn(e,t,n[t])}))}return e}({},e,{viewId:x}))))),[x,E]),S=(0,m.ZiX)(g),C=(0,o.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,g,f))),P=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,E),[E]);return a().createElement(a().Fragment,null,a().createElement(se.Z,{attributeValue:u,showEmptyEditors:S,onDeleteAttribute:s,onDeactivateError:P,onChangeAttribute:t,onAddAttributes:w,mode:y,crosswalks:b.crosswalks,errors:C,attributeType:f,ownError:(0,m.ADq)(u,null,f.uri,C)}),a().createElement("div",{className:d.actionButtons},a().createElement(Q.Z,{onClick:()=>{n(u)}},h().text("Cancel")),a().createElement(Q.Z,{color:"primary",disabled:!c,onClick:()=>{l(u)}},h().text("Apply"))))},Un=(0,J.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 zn(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){Hn(e,t,n[t])}))}return e}function Hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vn=[],Fn=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=Un(),{values:u,page:d,setPage:g,isLoading:f,searchQuery:b,setSearchQuery:y,visibleColumns:E,onFilter:x,onSort:w,onToggleFilters:S,onChangeColumns:C,filters:P,sorting:O,totalVisibleValues:Z,hasPaging:N,attributeType:k,showTable:T}=(0,r.useContext)(en),I=(0,r.useMemo)((()=>yn(k)),[k]),{checkHasChanges:j,onChangeAttribute:L,onDeleteAttribute:M,onAdd:A,onCancel:U,onApply:V,onStartEditing:_,modifiedValues:B,editingValues:G,deletedUris:q}=(()=>{const[e,t]=(0,r.useState)(),[n,a]=(0,r.useState)([]),l=(0,o.useSelector)(v.ZP.selectors.getMode);(0,r.useEffect)((()=>{a([]),t(null)}),[l]);const s=(0,o.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:d}=(0,r.useContext)(en),g=(0,o.useSelector)(v.ZP.selectors.getEntityUri),f=(0,o.useSelector)(v.ZP.selectors.getMetadata),h=(0,r.useCallback)((e=>{(0,i.pipe)(v.N5.actions.modifyAttribute,s)(zn({},e,{viewId:c}))}),[c,s]),b=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(zn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,m.gjI)({parentUri:g,attributeType:u});t(e.uri),h(zn({},e,{value:(0,m.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:f}),attributeType:u}))}),[g,u]),E=(0,r.useCallback)((e=>{a((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[a]),x=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=zn({},e,{value:r,attributeType:u,uri:e.uri});a((e=>(0,i.without)([r],e))),h(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),b(n)}}),[b,h,a,n]),w=(0,r.useCallback)((e=>{t(null),a((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[a,t]),S=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,g)||{})),C=(0,m.KIu)(l),P=(0,m.xy8)(u),O=(0,i.pathOr)(Vn,[P,null==u?void 0:u.name],S),Z=(0,r.useMemo)((()=>[...O.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(m.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>O.find((0,i.propEq)("uri",e.uri))||e))(d)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[O,n,e,d]),N=(0,r.useMemo)((()=>C?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!O.find((0,i.propEq)("uri",e)))))(d):[]),[O,d]),k=O.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:h,onDeleteAttribute:b,onAdd:y,onCancel:x,onApply:w,onStartEditing:E,modifiedValues:Z,editingValues:k,deletedUris:N}})(),$=(0,o.useSelector)(v.ZP.selectors.getMode),X=(0,m.KIu)($),Y=X?B:u,{canCreate:K}=(0,Cn.l)(),J=K(t)&&k&&(0,m.Vg3)({attributeType:k,mode:$})&&!G.length,ee=(0,r.useMemo)((()=>E.map((e=>I.find((0,i.propEq)("id",e))))),[E,I]);return a().createElement(z.Z,{className:D()(c.root,n)},T?a().createElement(a().Fragment,null,a().createElement(Nn,{title:l,total:Z,columnsData:I,selectedColumns:E,onChangeColumns:C,searchQuery:b,onChangeSearchQuery:y,filtersEnabled:!!P,onToggleFilters:S}),a().createElement("div",{style:{position:"relative"}},X&&a().createElement("div",{className:c.editor},J&&a().createElement(Q.Z,{color:"primary",onClick:A,className:c.addButton},a().createElement(ae.Z,{classes:{root:c.icon}}),a().createElement("div",{className:c.buttonLabel},h().text("Add"))),G.map((e=>a().createElement(An,{key:e.uri,attributeValue:e,onChangeAttribute:L,onDeleteAttribute:M,onCancel:U,onApply:V,hasChanges:j(e)})))),a().createElement(Ln,{columnsData:ee,config:t,values:Y,filters:P,onFilter:x,sorting:O,onSort:w,onEdit:_,onDeleteAttribute:M,deletedUris:q}),N&&a().createElement(H.Z,{count:Z,rowsPerPageOptions:[],rowsPerPage:s,page:d,onChangePage:g}),f&&a().createElement(R.Z,null))):a().createElement(a().Fragment,null,a().createElement(W.Z,{title:l,className:c.header}),a().createElement(F.Z,{className:c.noData},h().text("No data"))))};var Wn=n(37163);let _n=0;const Bn=()=>_n++,Gn=e=>{const t={children:[],nodeId:Bn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let a=t;for(let t=r.length-1;t>=0;t--){const o=r[t],l=e.entities[o.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Bn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),a.children.push(s),a=s}}return t.children};var qn=n(43434);const $n=(0,J.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 Qn=n(1242);const Xn=a().createContext(null);var Yn=n(48685);const Kn=e=>{e.target.src=Qn},Jn=e=>{let{node:t}=e;const n=$n(),l=(0,o.useDispatch)(),i=t.entity.uri,s=(0,o.useSelector)(v.ZP.selectors.getAbsoluteImagePath),c=(0,o.useSelector)(v.ZP.selectors.getMetadata),u=(0,r.useContext)(Xn),p=(0,o.useSelector)(v.ZP.selectors.getUIPath),{uri:d}=(0,o.useSelector)(v.ZP.selectors.getEntity),g=(0,m.ChB)({uiPath:p,uri:i}),f=i===d,h=(0,r.useCallback)((()=>{l(v.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:b},nodeId:y}=t,E=(0,m.nt9)(c,t.entity.type)||{},x=(0,m.VD3)(c,E,"typeGraphIcon"),w=x&&(0,m.vPL)(s,x);return a().createElement("div",{className:n.wrapper,"data-node-id":y},a().createElement("div",{className:n.container},a().createElement(qn.Z,{className:D()(n.avatar),src:w||Qn,onError:Kn}),a().createElement("span",{className:D()(n.link,{[n.selected]:f})},a().createElement(Yn.Z,{to:g,onClick:h},b))))},er=((0,r.memo)(Jn),e=>{let{node:t}=e;return t.nodeId}),tr=(0,J.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 nr(){return nr=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},nr.apply(this,arguments)}function rr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ar(){return ar=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},ar.apply(this,arguments)}const or={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:o,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!o.root&&o.children&&o.children.length>0,g=tr();return a().createElement("div",ar({style:{height:"100%"}},p,{key:o.nodeId}),m&&o.expanded&&a().createElement("div",{style:{width:n-2},className:g.lineChildren}),a().createElement("div",{className:g.row,style:u},a().createElement("div",{className:g.rowContents},m&&a().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:o,path:s,treeIndex:c})}},a().createElement("div",{"aria-label":o.expanded?"Collapse":"Expand",className:D()(g.button,o.expanded?g.expandedButton:g.collapsedButton)})),a().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:o,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:o,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=tr(),u=o.length,p=[];o.forEach(((e,t)=>{p.push(a().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&a().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&a().createElement(a().Fragment,null,a().createElement("div",{className:c.verticalLine}),a().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`,h=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){rr(e,t,n[t])}))}return e}({},s.style,{width:f});return a().createElement("div",nr({},s,{className:c.node,style:h}),p,a().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function lr(){return lr=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},lr.apply(this,arguments)}const ir=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",lr({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},a().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"})))},sr=e=>{let{title:t,onGraphOpen:n}=e;const r=$n();return a().createElement(W.Z,{title:t,className:r.header},a().createElement("div",{className:r.buttonsContainer},a().createElement(Re.k,{className:r.button,tooltipTitle:h().text("Show Graph"),icon:ir,onClick:n,size:"L"})))};var cr=n(80233);const ur=(0,J.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));let pr,dr;function mr(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){gr(e,t,n[t])}))}return e}function gr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission"}(pr||(pr={})),function(e){e.SET_HTML="setHtml",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request"}(dr||(dr={}));const fr=(e,t)=>{const{url:n}=e;return n?(!(null==t?void 0:t.some((e=>{const t=e.match(/^(?:([^:?#]+):)?(?:\/\/((?:(([^:@?]*)(?::([^:@?]*))?)?@)?((?:\[[0-9A-Fa-f:]+)|(?:[^:?#]*))(?::(\d*))?))?((((?:[^?#]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/),r=t[1],a=t[6],o=`${r}://${a}`,l=new RegExp("^"+e+"$"),i=e.replace(/\/*$/,"");return i===n||a&&a===i||a&&o===i||i&&0===i.indexOf("/")&&n&&0===n.indexOf(i)||i&&l.test(n)})))||0===((null==t?void 0:t.length)||0))&&{errorMessage:"Not enough permissions"}:{errorMessage:"URL is empty"}};var hr=n(36571);function br(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){yr(e,t,n[t])}))}return e}function yr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vr=(e,t)=>{let{files:n,permissions:a}=e;const[l,i]=(0,r.useState)(),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(!0),[d,f]=(0,r.useState)(null),[h,b]=(0,r.useState)(null),[y,E]=(0,r.useState)(""),x=(0,o.useDispatch)(),w=(0,o.useSelector)(v.ZP.selectors.getMetadata),S=(0,o.useSelector)(v.ZP.selectors.getEntity)||{},C=`${(0,o.useSelector)(v.ZP.selectors.getUIPath)}worker_api.js`,P=(0,o.useSelector)(v.ZP.selectors.getTenant),O=(0,o.useSelector)(v.ZP.selectors.getApiPath),Z=(0,o.useSelector)(v.ZP.selectors.getWorkflowPath),N=(0,o.useSelector)(v.ZP.selectors.getUser),k=(0,o.useSelector)(v.ZP.selectors.getEntityUri),T=(0,o.useSelector)(v.ZP.selectors.getWorkflowEnvironmentUrl),R=(0,r.useContext)(g),I=(0,hr.Z)(),{type:j,data:L}=(0,o.useSelector)(v.ZP.selectors.getSearchProviderData)||{},D=e=>x(v.ui.actions.openSearch(e)),M=(e,n,r)=>{if(e){const o=[],l=e=>{const t=e.getAttribute("ui-actions"),r=e.getAttribute("ui-tooltip"),a=e.getAttribute("id")||e.getAttribute("name");t&&(t.split(",").forEach((t=>{const r=()=>{const e={action:"event",type:"uiAction",data:{type:t,id:a}};n.postMessage(e)};e.addEventListener(t,r),o.push((()=>{e.removeEventListener(t,r)}))})),e.removeAttribute("ui-actions")),r&&f(r),e.childNodes.forEach((e=>{1===e.nodeType&&l(e)}))},s=e=>{const t=document.createElement("div");t.innerHTML=e||r,l(t),c(o),i(t)};switch(e.action===dr.SET_HTML&&r!==e.params.html&&s(e.params.html),e.action){case dr.LOG:console.log(e.params);break;case dr.SET_VISIBILITY:"visible"===e.params?(p(!0),s()):p(!1);break;case dr.SET_TOOLTIP:f(e.params),s();break;case dr.SET_HEIGHT:b((t=>br({},t||{},{height:e.params})));break;case dr.SET_WIDTH:b((t=>br({},t||{},{width:e.params})));break;case dr.SET_ENABLED:b((t=>{const n=br({},t||{});return e.params?delete n["pointer-events"]:n["pointer-events"]="none",n}));break;case dr.MESSAGE:E(e.params);break;case dr.REQUEST:(e=>{let{name:t,paramObject:n,permissions:r,worker:a,metadata:o,config:l,apiPath:i,user:s,workflowPath:c,entity:u,tenant:p,entityUri:d,query:g,openSearch:f,environment:h,getCurrentPerspectiveId:b,showPerspective:y,workflowCheckPermission:v,setEntityUri:E}=e;const x=e=>{e.then((e=>{a.postMessage(mr({action:"response",result:{data:e}},n.params))})).catch((()=>{a.postMessage(mr({action:"response",result:{data:{},headers:"",status:0}},n.params))}))};switch(t){case pr.API:{const e=((e,t)=>{const n=fr(e,t);return n?new Promise((e=>e(n))):(0,m.SL_)({url:e.url,method:e.method,data:e.data,headers:e.headers})})(n.params,r);x(e);break}case pr.WORKFLOW:{const e=((e,t,n,r)=>{const{url:a}=e,o=fr(e,t);if(o)return new Promise((e=>e(o)));const l=a.includes("http:")||a.includes("https:");return n||l?(0,m.oUH)({url:a,method:e.method||"GET",data:e.data,tenant:r,headers:e.headers,workflowPath:n}):new Promise((e=>e({errorMessage:"Workflow path is not defined"})))})(n.params,r,c,p);x(e);break}case pr.WORKFLOW_START_PROCESS_FROM_QUERY:{const e=((e,t,n,r,a)=>{if(!e.processDefinitionId)return new Promise((e=>e({errorMessage:"processDefinitionId is empty"})));if(!e.searchString)return new Promise((e=>e({errorMessage:"searchString is empty"})));if(!n)return new Promise((e=>e({errorMessage:"Workflow path is not defined"})));const o=fr(mr({url:"/processInstances/_generateFromQuery"},e),t);return o?new Promise((e=>e(o))):(0,m.FuV)({workflowPath:n,processType:e.processDefinitionId,searchString:e.searchString,tenant:r,environment:a})})(n.params,r,c,p,h);x(e);break}case pr.GET_CONFIGURATION:a.postMessage(mr({action:"response",result:o},n.params));break;case pr.GET_UI_CONFIGURATION:{const e=mr({},l,{action:mr({},l.action)});e.action.permissions&&delete e.action.permissions,a.postMessage(mr({action:"response",result:e},n.params));break}case pr.SET_ENTITY_URI:E(d,(()=>a.postMessage(mr({action:"response",result:u},n.params))));break;case pr.SET_PERSPECTIVE:y(n.params.perspective),a.postMessage(mr({action:"response",result:b()},n.params));break;case pr.GET_PERSPECTIVE:b&&a.postMessage(mr({action:"response",result:b()},n.params));break;case pr.WORKFLOW_CHECK_PERMISSION:a.postMessage(mr({action:"response",result:v(n.params.permission)},n.params));break;case pr.GET_SEARCH_QUERY:a.postMessage(mr({action:"response",result:g},n.params));break;case pr.OPEN_SEARCH:f({viewId:l.id,searchState:n.params.searchState});break;case pr.GET_ENTITY_URI:a.postMessage(mr({action:"response",result:d},n.params));break;case pr.GET_ENTITY:a.postMessage(mr({action:"response",result:u},n.params));break;case pr.GET_API_PATH:a.postMessage(mr({action:"response",result:i},n.params));break;case pr.WORKFLOW_GET_WORKFLOW_PATH:a.postMessage(mr({action:"response",result:c},n.params));break;case pr.GET_TENANT:a.postMessage(mr({action:"response",result:p},n.params));break;case pr.GET_USER:a.postMessage(mr({action:"response",result:s},n.params));break;case pr.ALERT:window.alert(n.params.text);break;case pr.CONFIRM:window.confirm(n.params.text);break;case pr.PROMPT:window.prompt(n.params.text,n.params.defaultText||"");break;case pr.OPEN_WINDOW:window.open(n.params.url,"_blank")}})(br({name:e.params.name,paramObject:e,permissions:a,worker:n,metadata:w,config:t,user:N,apiPath:O,tenant:P,workflowPath:Z,entity:S,entityUri:k,environment:T,query:"search"===j?null==L?void 0:L.query:null,openSearch:D,workflowCheckPermission:I},R))}}};return(0,r.useEffect)((()=>{const e=((e,t,n)=>{const r=`\n importScripts("${e}");\n importScripts("${t.join('","')}");\n postMessage({action:'loaded'});`;let a;try{const e=window.webkitURL||window.URL;a=new Worker(e.createObjectURL(new Blob([r],{type:"application/javascript"})))}catch(e){a=new Worker("data:application/javascript,"+encodeURIComponent(r))}if(a){let e="";a.addEventListener("message",(t=>{if("loaded"!==t.data.action){const r=JSON.parse(t.data);n(r,a,e),"setHtml"===r.action&&(e=r.params.html)}}))}return a})(C,n,M);return()=>{e.terminate()}}),[]),(0,r.useEffect)((()=>()=>{s.forEach((e=>e()))}),[s]),{html:l,visible:u,tooltip:d,customStyles:h,message:y,onClosePopup:()=>E("")}};function Er(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){xr(e,t,n[t])}))}return e}function xr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wr=n(14940);const Sr=(0,J.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)"}}),Cr=e=>{const t=t=>{const n=Sr();return a().createElement("div",{className:n.resizableHandleContainer},a().createElement("div",{className:n.resizableHandleVisibilityArea},a().createElement("div",{className:D()("viewDraggableHandle",n.resizableHandle)},a().createElement(wr.Z,{className:n.dragIcon}))),a().createElement(e,t))};return t.displayName="WithResizableHandle",t},Pr=(0,J.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Or=n(29103),Zr=n(83911),Nr=n(62116),kr=n(40435);const Tr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Rr=(0,J.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Ir=n(61347),jr=n(66078);const Lr=(0,J.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Dr=Lr,Mr=e=>{let{totalImages:t}=e;const n=Dr(),r=t>1?h().text("photos"):h().text("photo");return a().createElement(F.Z,{variant:"caption",className:n.caption},`${t} ${r}`)};function Ar(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){Ur(e,t,n[t])}))}return e}function Ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,o.useDispatch)(),c=(0,o.useSelector)(v.ZP.selectors.getEntity),u=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return a().createElement(a().Fragment,null,a().createElement(jr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(Ar({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(v.N5.actions.modifyAttribute,s)(Ar({},e,{viewId:d})),imageSize:Fr,paging:r,requestNextPageOfAttributeValues:l}),a().createElement(Mr,{totalImages:p.length}))},Hr=(0,J.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Vr=Hr,Fr={imageMargin:4,imageWidth:162,imageHeight:162};var Wr=n(86689),_r=n(23044);const Br=(0,J.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 Gr=n(20200),qr=n(25601),$r=n(84236),Qr=n(48376);function Xr(){return Xr=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},Xr.apply(this,arguments)}const Yr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,o.useDispatch)(),c=(0,o.useSelector)(v.ZP.selectors.getMetadata),u=(0,o.useSelector)(v.ZP.selectors.getEntity),{canMerge:d,canMark:g}=(0,m.hXd)(c,t,n.object,u,n.matchRules),f=(0,r.useMemo)((()=>[n.object]),[n.object]),h={entity:u,entities:f,mode:qr.N.iconButton,onStartRequest:l},b=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(v.N5.entity.actions.loadEntity({viewId:b,uri:u.uri}))}),[s,u.uri,i,b]);return a().createElement(a().Fragment,null,d&&a().createElement($r.H,Xr({},h,{onFinishRequest:y})),g&&a().createElement(Qr.i,Xr({},h,{onFinishRequest:i})))},Kr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,o.useSelector)(v.ZP.selectors.getMetadata),c=(0,o.useSelector)(v.ZP.selectors.getEntity);return a().createElement(Gr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:St.U},a().createElement(Ct.Z,{uri:(0,m.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:m.q7e.POTENTIAL_MATCH}),a().createElement(Yr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Jr={showTransitiveMatches:!0,showInactiveEntities:!1},ea={order:"asc",field:"score"};var ta;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(ta||(ta={}));const na=Cr((e=>{let{className:t}=e;const n=Pr();return a().createElement(z.Z,{className:D()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),ra=Cr((e=>{let{className:t,config:n}=e;return a().createElement(M.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),aa=Cr((e=>{let{className:t,config:n}=e;const o=(e=>{const[t,n]=(0,r.useState)(""),[a,o]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:a,searchQuery:t,showInactive:l})),[a,t,l]),c=Oe(e,s,!0),u=(0,r.useCallback)((()=>{o(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){Ze(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:o,page:a,toggleShowInactive:u,showInactive:l},c)})(n);return a().createElement(A.Provider,{value:o},a().createElement(we,{config:n,className:t}))})),oa=Cr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,a=(0,o.useSelector)(v.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,m.zeJ)(a,n)),[a,n]),s=(0,r.useMemo)((()=>yn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),m.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(cn,c),{searchQuery:d,filters:g,sorting:f,page:h}=u,b=(0,r.useMemo)((()=>{const e=((e,t)=>m.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const a=e.find((0,i.propEq)("id",n));return(0,wn.su)(a,r)})))).orSome([]))(s,g);return e.length?e:null}),[g,s]),y=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:b,page:h,sorting:f,searchQuery:d})),[b,h,f,d]),{changeSearchQuery:E,changePage:x,toggleSort:w,changeFilter:S,toggleFilters:C,changeColumns:P}=(0,tn.o)({actions:sn,dispatch:p}),O=Oe(e,y,!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){Sn(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:x,onSort:w,onFilter:S,onToggleFilters:C,onChangeColumns:P,showTable:Boolean(((null==O||null===(t=O.values)||void 0===t?void 0:t.length)||b||d)&&l&&!l.hidden)},O)})(t);return a().createElement(en.Provider,{value:l},t&&a().createElement(Fn,{config:t,className:n}))})),la=Cr((e=>{let{config:t,className:n}=e;const o=(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]),a=e.max||15,[o,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))}),[]),h=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),b=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:h,sortOption:c,changeSortOption:b,sortOptions:n,page:o,setPage:l,rowsPerPage:a,showInactive:m,toggleShowInactive:f}})(t);return a().createElement(Le.Provider,{value:o},a().createElement(Jt,{config:t,className:n}))})),ia=Cr((e=>{let{config:t,className:n}=e;const o=(0,r.useRef)(),[l,s]=(0,r.useState)(null),{height:c,width:u,tooltip:p}=t,{html:d,visible:m,tooltip:g,customStyles:f,onClosePopup:h,message:b}=vr(t.action,t),y=ur(),v=g||p;if((0,r.useEffect)((()=>{o.current&&d&&(o.current.innerHTML="",d.childNodes.forEach((e=>{o.current.appendChild(e)})),s(o.current))}),[d]),!m)return null;const E=(0,i.reject)(i.isNil,{width:u,height:c}),x=a().createElement("div",{ref:o,style:Er({},E,f),className:D()(y.root,n)});return a().createElement("div",{className:y.bodyWrapper},v?a().createElement(rt.ZP,{title:v},x):x,a().createElement(cr.Z,{placement:"bottom",anchorEl:l,open:!!b,onClose:h},b))})),sa=Cr((e=>{let{config:t,className:n}=e;const l=(0,o.useSelector)(v.ZP.selectors.getEntityUri),{treeData:i,setTreeData:s}=((e,t)=>{const n=(0,Se._)(),[a,o]=(0,r.useState)([]);return(0,r.useEffect)((()=>((0,m.ZiX)(e)||n((0,m.RFJ)({uri:e,graphUri:t})).then(Gn).then(o).catch((e=>{console.warn(e)})),()=>{o([])})),[e,t,n]),{treeData:a,setTreeData:o}})(l,t.graph.type),c=$n(),u=(0,o.useDispatch)(),{id:p,graph:d}=t,g=(0,r.useCallback)((()=>{u(v.ui.actions.openGraph({viewId:p,graphType:d.type}))}),[u,p,d]),f=(0,r.useCallback)((e=>({title:a().createElement(Jn,{node:e.node})})),[]);return a().createElement(z.Z,{className:n},a().createElement(sr,{onGraphOpen:g,title:t.caption}),a().createElement(Xn.Provider,{value:t},a().createElement("div",{className:c.treeContainer},a().createElement("div",{className:c.tree},a().createElement(Wn.ZP,{isVirtualized:!1,treeData:i,canDrag:!1,theme:or,generateNodeProps:f,onChange:s,getNodeKey:er})))))})),ca=Cr((e=>{let{config:t,className:n}=e;const l=Br(),s=(0,o.useSelector)(v.ZP.selectors.getEntity),c=null==s?void 0:s.uri,[u,d]=(0,r.useState)(!1),g=(0,r.useCallback)((()=>{d(!0)}),[]),f=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:b,entitiesMap:y,loadMatches:E,total:x}=(0,_r.s)({enabled:!!c,entity:s,options:Jr,filter:"",page:0,sorting:ea,rowsPerPage:3,onStartLoading:g,onFinishLoading:f}),S=(0,r.useCallback)((()=>{E()}),[E]),C=(0,o.useDispatch)(),P=(0,r.useContext)(p.m),O=(0,r.useCallback)((()=>{C(v.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:P}))}),[C,P]),Z=(0,r.useMemo)((()=>(0,m.NVY)(c,(0,i.map)(m.ev7,b))),[c,b]),{getCommentsCount:N}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{N(Z)}),[N,Z]);const k=x>3&&!(0,i.isEmpty)(b),T=u?ta.Loading:(0,i.isEmpty)(b)?ta.NoData:ta.Loaded;return a().createElement(ke.X.Provider,{value:y},a().createElement(z.Z,{className:D()(l.root,n)},a().createElement(W.Z,{title:t.caption}),a().createElement("div",{className:l.matchesContainer},T===ta.Loading&&a().createElement(R.Z,null),T===ta.NoData&&a().createElement(F.Z,{className:l.noData},h().text("No matches found")),T===ta.Loaded&&b.map((e=>a().createElement(Kr,{config:t,entitiesMap:y,match:e,onFinishRequest:S,onStartRequest:g,key:e.object.uri})))),k&&a().createElement(a().Fragment,null,a().createElement("div",{className:l.footer},a().createElement(Wr.Z,{component:"button",variant:"caption",onClick:O,underline:"none"},h().text("See all"))))))})),ua=(0,r.lazy)((()=>n.e(590).then(n.bind(n,10590)).then((e=>({default:Cr(e.HierarchyTreeView)}))))),pa=(0,r.lazy)((()=>n.e(3431).then(n.bind(n,83431)).then((e=>({default:Cr(e.RelationshipsTableView)}))))),da=Cr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=Rr(),c=(0,o.useSelector)(v.ZP.selectors.getMetadata),u=(0,o.useSelector)(v.ZP.selectors.getEntity),p=(0,o.useSelector)(v.ZP.selectors.getGoogleMapKey),{markers:d,loading:g}=((e,t,n)=>{const[a,o]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Se._)();return(0,r.useEffect)((()=>{i(!0),s((0,m.DBr)(t,[e],n)).then((e=>{o(e.filter(Tr))})).catch((()=>{o([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:a,loading:l}})(u,c,p),f=(0,r.useMemo)((()=>a().createElement("div",{className:s.fullHeight},a().createElement(R.Z,null))),[s]),h=(0,r.useMemo)((()=>({lat:0,lng:0})),[]);return p&&a().createElement(z.Z,{className:D()(s.root,i)},g&&a().createElement(R.Z,null),a().createElement(kr.Z,{size:"S",icon:n?Zr.Z:Or.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),a().createElement(Nr.Z,{loadingElement:f,defaultZoom:1,defaultCenter:h,markers:d,mapContainerClassName:s.fullHeight,mapKey:p}))})),ma=Cr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Vr(),c=(0,o.useDispatch)(),u=(0,o.useSelector)(v.ZP.selectors.getMode),p=(0,o.useSelector)(v.ZP.selectors.getEntityWithDiff),d=(0,o.useSelector)(v.ZP.selectors.getMetadata),g=(0,m.zeJ)(d,l),f=(0,i.pathOr)([],["attributes",null==g?void 0:g.name],p),b=(0,i.path)(["attributes","paging",l],p),y=f.length,E=t["text-empty"]||h().text("No data found"),x=(0,r.useCallback)((e=>c(v.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return a().createElement(z.Z,{className:n},a().createElement(W.Z,{title:t.caption}),a().createElement("div",{className:s.container},(()=>{if(g){if((0,m.KIu)(u)){const e={attributeType:g,config:t,paging:b,requestNextPageOfAttributeValues:x};return a().createElement(zr,e)}if(y>0){const e={attributeValues:f,attributeType:g,imageSize:Fr,paging:b,parentUri:p.uri,requestNextPageOfAttributeValues:x};return a().createElement(a().Fragment,null,a().createElement(Ir.Z,e),a().createElement(Mr,{totalImages:y}))}}return a().createElement(F.Z,{className:s.noData},E)})()))}));class ga{}ga.ViewTypes=m.ZIY,ga.getComponentBy=(e,t)=>{let{store:n,config:r,className:o,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case ga.ViewTypes.HierarchyTree:return a().createElement(ua,{config:r,store:n,className:o});case ga.ViewTypes.HierarchyPaths:return a().createElement(sa,{config:r,className:o});case ga.ViewTypes.RelationsTable:return a().createElement(pa,{config:r,store:n,className:o});case ga.ViewTypes.Relations:return a().createElement(la,{config:r,className:o});case ga.ViewTypes.Attributes:return a().createElement(ra,{className:o,config:r});case ga.ViewTypes.SingleAttributeView:return a().createElement(aa,{config:r,className:o});case ga.ViewTypes.TableAttributeView:return a().createElement(oa,{config:r,className:o});case ga.ViewTypes.MapView:return a().createElement(da,{config:r,isFullscreen:l,onToggleFullscreen:i,className:o});case ga.ViewTypes.CustomView:return a().createElement(ia,{config:r,className:o});case ga.ViewTypes.ImageAttributeView:return a().createElement(ma,{config:r,className:o});case ga.ViewTypes.PotentialMatchesView:return a().createElement(ca,{config:r,className:o})}},ga.getComponent=e=>ga.getComponentBy("class",e)||ga.getComponentBy("react-class",e)||a().createElement(na,{className:e.className});const fa=ga,ha=()=>null,ba=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:o,isAutosize:l,onToggleFullscreen:i}=e;const s=Pr();return a().createElement(r.Suspense,{fallback:a().createElement(ha,null)},fa.getComponent({config:t,store:n,className:D()(s.component,{[s.fullHeight]:!l}),isFullscreen:o,onToggleFullscreen:i}))}));ba.displayName="ViewComponent";const ya=(0,J.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function va(){return va=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},va.apply(this,arguments)}const Ea=["onConfigChanged","onRemove"],xa=e=>{let{layoutItemConfig:t,views:n,className:l,children:s,style:c,isFullscreen:u,onToggleFullscreen:p,AutosizeComponent:d}=e,m=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const g=n.find((e=>{let{id:n}=e;return t.i===n})),f=ya(),{store:h}=(0,r.useContext)(o.ReactReduxContext);if(!g)return null;const b=g.class===fa.ViewTypes.CustomView;return a().createElement("div",va({},(0,i.omit)(Ea,m),{style:c,className:D()(l,{[f.item]:!b})}),a().createElement("div",{className:D()({[f.fixedSizeContainer]:!d})},d,a().createElement(ba,{store:h,config:g,isFullscreen:u,onToggleFullscreen:p,isAutosize:Boolean(d)})),s)},wa=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:o}=e;return a().createElement(j.Z,{LayoutItem:xa,views:t,layout:n,layoutOptions:r,onLayoutChanged:o,draggableHandle:".viewDraggableHandle"})};var Sa=n(33109),Ca=n(75647),Pa=n(76368),Oa=n(36777),Za=n(72379),Na=n(72753),ka=n(43576);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)}const Ra=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",Ta({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),a().createElement("defs",null,a().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"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("g",{transform:"translate(-4 -2.5)"},a().createElement("mask",{id:"svg1467685497b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg1467685497a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))},Ia=(0,J.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"}}),ja=e=>a().createElement(Za.Z,e,a().createElement(Ra,null)),La=(e,t,n,r,a)=>e.filter((e=>{let{value:o,permission:l}=e;return!(n&&!(0,m.KIu)(o))&&!!(r&&a||!(0,m.fnZ)(o))&&(0,m.uGe)(l,t)})),Da=e=>{let{className:t}=e;const n=Ia(),l=(0,o.useDispatch)(),i=(0,o.useSelector)(v.ZP.selectors.getCanUserStartProcessFromQuery),s=(0,o.useSelector)(v.ZP.selectors.getEntityWithoutDiff),c=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s.uri))),u=(0,o.useSelector)(v.ZP.selectors.getMetadata),p=(0,o.useSelector)(v.ZP.selectors.isWorkflowEnabled),d=(0,o.useSelector)(v.ZP.selectors.getMode),g=(0,o.useSelector)(v.ZP.selectors.getIsEditableMode),f=(0,o.useSelector)(v.ZP.selectors.getIsViewMode),b=(0,o.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),y=(0,o.useSelector)(v.ZP.selectors.getProfileOperation)===m.OXy.Saving,E=null==s?void 0:s.type,x=(0,r.useMemo)((()=>[{label:h().text("Editing"),value:m.fO_.EDITING,description:h().text("Edit profile directly"),icon:ka.Z,permission:"UPDATE"},{label:h().text("Suggesting"),value:m.fO_.SUGGESTING,description:h().text("Suggest changes and initiate a workflow review"),icon:ja,permission:"INITIATE_CHANGE_REQUEST"},{label:h().text("Viewing"),value:m.fO_.VIEWING,description:h().text("Suggest changes and initiate a workflow review"),icon:Na.Z,permission:"READ"}]),[]),w=(0,r.useMemo)((()=>[{label:h().text("Delete"),value:"Delete",description:h().text("Permanently delete profile"),icon:Je.Z,onClick:()=>{window.confirm(h().text("Are you sure you want to delete this?"))&&l(v.N5.entity.actions.entityRemoveRequested({entityUri:s.uri}))},permission:"DELETE"}]),[l,s.uri]),S=(0,r.useMemo)((()=>(0,m.nt9)(u,E)||{}),[u,E]),C=!b&&!(0,m.biM)(s)&&!(e=>(0,m.uGe)(m.BDP.READ,e)&&!(0,m.uGe)(m.BDP.UPDATE,e)&&!(0,m.uGe)(m.BDP.DELETE,e)&&!(0,m.uGe)(m.BDP.INITIATE_CHANGE_REQUEST,e))(S),P=(0,m.ZiX)(null==s?void 0:s.uri),O=(0,r.useMemo)((()=>La(x,S,P,p,i)),[x,S,p,i,P]),Z=(0,r.useMemo)((()=>La(w,S,P,p,i)),[w,S,p,i,P]),N=(0,r.useCallback)((e=>{l(v.N5.mode.actions.modeUpdated(e))}),[l]),k=(0,r.useCallback)((()=>{l(v.N5.mode.actions.modeCancelEditing())}),[l]),T=(0,r.useCallback)((()=>{l(v.N5.actions.saveProfile())}),[l]);return a().createElement(Sa.Z,{className:D()(t,St.U),entity:g&&c?c:s},a().createElement(V.Z,{display:"flex",alignItems:"center"},a().createElement(V.Z,{mr:3},g&&a().createElement(V.Z,{className:n.editingButtons},a().createElement(Q.Z,{variant:"outlined",onClick:k,"data-reltio-id":"reltio-profile-cancel-editing",disabled:y},h().text("Cancel")),a().createElement(Q.Z,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:T,disabled:y},(0,m.fnZ)(d)?h().text("Suggest"):h().text("Save"))),b&&f?a().createElement(Ca.Z,null):f&&a().createElement(Pa.a,null)),C&&a().createElement(Oa.T,{optionsGroup:O,buttonsGroup:Z,value:d,onChange:N,disabled:y})),a().createElement(V.Z,{className:n.comments},a().createElement(Ct.Z,{uri:s.uri,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:s.uri}),objectType:m.q7e.ENTITY})))};var Ma=n(69409),Aa=n(85457),Ua=n(37778),za=n(32158),Ha=n(95085),Va=n(70675),Fa=n(11821),Wa=n(98273),_a=n(28101),Ba=n(80147),Ga=n(76569);const qa=(0,J.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),$a=()=>{const{total:e}=(0,r.useContext)(k.O),t=qa();return a().createElement(qe.Z,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},a().createElement(Ga.Z,null))};var Qa=n(89925),Xa=n(4426);const Ya=(0,J.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Ka=()=>{const e=Ya(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,o.useSelector)(v.ZP.selectors.getEntityUri);return(0,r.useEffect)((()=>{t(i)}),[t,i]),a().createElement(V.Z,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:o}=e;return a().createElement(Qa.J,{key:o,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&a().createElement(Wr.Z,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},a().createElement(Xa.Z,{className:e.showMoreIcon}),h().text("Show more")))};var Ja=n(37193);const eo=(0,J.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),to=()=>{const e=eo(),{tasks:t,loading:n}=(0,r.useContext)(k.O);return a().createElement("div",{className:e.wrapper},n&&a().createElement(R.Z,null),t&&t.map((e=>a().createElement(Ja.s,{key:e.taskId,task:e}))))};function no(){return no=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},no.apply(this,arguments)}const ro=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",no({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),a().createElement("defs",null,a().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"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("g",null,a().createElement("g",{transform:"translate(-2 -2)"},a().createElement("mask",{id:"svg2697213709b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg2697213709a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},ao=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=qa();return a().createElement(qe.Z,{badgeContent:(0,m.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},a().createElement(ro,null))};var oo=n(15422);const lo=()=>a().createElement(oo.Z,{text:h().text("Ready to go with the flow?"),secondaryText:h().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),io=()=>a().createElement(oo.Z,{text:h().text("Care to join the conversation?"),secondaryText:h().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function so(){return so=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},so.apply(this,arguments)}let co;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(co||(co={}));const uo=e=>{if(e)return 1===e?h().text("${total} item",{total:e}):h().text("${total} items",{total:e})},po=()=>{var e,t,n;const l=qa(),s=(0,o.useSelector)(v.ZP.selectors.isWorkflowSideViewEnabled),c=(0,o.useSelector)(v.ZP.selectors.isWorkflowEnabled),u=(0,o.useSelector)(v.ZP.selectors.isCollaborationSideViewEnabled),p=(0,o.useSelector)(v.ZP.selectors.isCollaborationEnabled),d=(0,o.useSelector)(v.ZP.selectors.getHistoryEvent),g=(0,o.useSelector)(v.ZP.selectors.getMetadata),f=(0,o.useSelector)(v.ZP.selectors.getEntity),b=(0,r.useContext)(k.O),y=(0,r.useContext)(w.h),[E,x]=(0,r.useState)(null),S=(0,r.useCallback)((e=>{x((t=>t===e?null:e))}),[]),C=(0,r.useCallback)((()=>{x(null)}),[]),P=null!==E,O=E===co.History,{isHistoryEnabled:Z,isProfilePersisted:N}=(0,Ma.C)({isHistoryTabActive:O,entity:f}),{historyFilter:T,onApplyFilter:R,onClearFilter:I,isLoading:j,historicUris:L,historyWithTotal:D,canLoadMore:M,onLoadMore:A}=(0,Aa.k)({entity:f,enabled:Z}),U=s&&c&&!(0,m.ZiX)(null==f?void 0:f.uri),z=u&&p,H=(0,m.mdt)(null==y?void 0:y.commentsMap),V=[{buttonProps:{id:co.Workflow,icon:$a,tooltipTitle:h().text("Workflow")},content:null!=b&&b.total?a().createElement(to,null):a().createElement(lo,null),headerProps:{mainTitle:h().text("Workflow"),secondTitle:uo(null==b?void 0:b.total),rightContent:a().createElement(Ua.G,null)},hidden:!U},{buttonProps:{id:co.Collaboration,icon:ao,tooltipTitle:h().text("Collaboration")},content:H?a().createElement(Ka,null):a().createElement(io,null),headerProps:{mainTitle:h().text("Collaboration"),secondTitle:uo(H)},hidden:!z},{buttonProps:{id:co.History,icon:Ba.Z,tooltipTitle:h().text("History")},content:N?a().createElement(za.Z,{isLoading:j,historyWithTotal:D,contributorsUris:L,entityUri:null==f?void 0:f.uri,historyEvent:d,onLoadMore:A,canLoadMore:M}):a().createElement(Ha.Z,null),headerProps:{content:a().createElement(Va.Z,{total:N?((null==L?void 0:L.length)||0)+1:void 0,entityType:(0,m.nt9)(g,null==f?void 0:f.type),filter:T,onApplyFilter:R,onClearFilter:I})}}],F=(0,i.reject)((0,i.propEq)("hidden",!0))(V);return(0,r.useEffect)((()=>{var e;null!==(e=V[E])&&void 0!==e&&e.hidden&&C()}),[E,V,C,F]),a().createElement("div",{className:l.wrapper},a().createElement(Fa.h,{open:P,width:480},!(null!==(e=V[E])&&void 0!==e&&e.hidden)&&a().createElement(a().Fragment,null,a().createElement(Wa.P,so({},null===(t=V[E])||void 0===t?void 0:t.headerProps,{onClose:C})),null===(n=V[E])||void 0===n?void 0:n.content)),a().createElement(_a.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(V),onButtonClick:S,activeIndexId:E}))};var mo=n(39781),go=n(16715);const fo="48px",ho="1px solid rgba(0, 0, 0, .125)",bo=(0,J.Z)((e=>({accordion:{borderTop:ho,borderBottom:ho,boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:fo,minHeight:fo,"&$accordionSummaryExpanded":{height:fo,minHeight:fo}},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"}}))),yo=bo;var vo=n(27616),Eo=n(8284),xo=n(70660),wo=n(38016);const So=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:o}=e;const l=yo();return t.length>0?a().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return a().createElement(vo.Z,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},a().createElement(Eo.Z,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:a().createElement(wo.Z,null)},i,a().createElement(F.Z,{className:l.accordionSummaryHeading},s)),a().createElement(xo.Z,{className:D()(l.accordionDetails,p)},a().createElement("ul",null,c.map(((e,t)=>a().createElement(o,{key:t,error:e}))))))}))):null}));So.displayName="ErrorsPanel";const Co=(0,i.omit)(["deactivated","path"]),Po=(0,r.memo)((e=>{let{error:t}=e;const n=yo(),r=((e,t)=>{let{type:n,source:r,message:a,attributeTypeUri:o="",attributeType:l}=t;if(n===m.NIO.missed&&r===m.zHr.local){const t=l||(0,m.zeJ)(e,o);return t?h().text("${attribute} is required",{attribute:t.label}):a}return a})((0,o.useSelector)(v.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[m.HAc.attributeValue,m.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return a().createElement("li",null,a().createElement("span",null,r),l&&a().createElement(a().Fragment,null,a().createElement("br",null),a().createElement("span",{className:n.parents},l)))}));Po.displayName="Error";const Oo=()=>{const e=yo(),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(Co),t.map(Co))}(e,t.current)||(t.current=e),t.current})((0,o.useSelector)(v.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(m.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:h().text("${number} ${errors}",{number:n.length,errors:1===n.length?h().text("error"):h().text("errors")}),icon:a().createElement(mo.Z,{className:D()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:h().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?h().text("warning"):h().text("warnings")}),icon:a().createElement(go.Z,{className:D()(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?a().createElement(So,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:Po}):null},Zo=(0,J.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"}}))),No=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=Zo({maxWidth:null==t?void 0:t.maxWidth}),s=(0,o.useDispatch)(),c=(0,r.useRef)(),u=(0,r.useCallback)((0,m.DsO)(n,5e3),[n]),{isLoaded:p,savedState:d}=(0,E.a)(l),[g,f]=(0,r.useState)([]),[b,j]=(0,r.useState)([]),L=(0,r.useMemo)((()=>y()(t)),[t]),D=(0,o.useSelector)(v.ZP.selectors.getEntity),M=(0,o.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),A=(0,r.useMemo)((()=>(0,m.dvH)(D)),[D]),U=(0,x.C)({objectIds:A}),z=(0,r.useContext)(w.h),H=(0,S.U)(),V=(0,C.v)(null==t?void 0:t.workflow),F=(0,o.useSelector)(v.ZP.selectors.getHistoryEvent);(0,P.a)({entity:D,historyEvent:F});const W=(0,O.u)();(0,r.useEffect)((()=>{if(p){const e=L!==d.configHash,{views:n,layout:r}=(0,m.Mfk)({views:e||!d.views?t.views:d.views,layout:e?t.layout:d.layout});j(n),f(r)}}),[p]),(0,r.useEffect)((()=>{s(v.N5.views.actions.profileViewsSet(b))}),[s,b]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[null==D?void 0:D.uri]),(()=>{const e=(0,o.useDispatch)(),t=(0,o.useSelector)(v.ZP.selectors.getValidateReadMode),n=(0,o.useSelector)(v.ZP.selectors.getEntity)||{},{uri:a,updatedTime:l}=n,i=(0,m.biM)(n),s=(0,o.useSelector)(v.ZP.selectors.getMode),c=(0,o.useSelector)(v.ZP.selectors.getProfileViews),u=c&&c.length>0;(0,r.useEffect)((()=>{t&&!i&&a&&!(0,m.ZiX)(a)&&s===m.ARY.Viewing&&u&&e(v.N5.actions.validateProfile())}),[e,i,t,l,a,s,u])})();const _=(0,r.useCallback)((e=>{u({layout:e,views:b,configHash:L}),f(e)}),[u,L,b]);return a().createElement(Z.j.Provider,{value:!0},a().createElement(N.s.Provider,{value:H},a().createElement(w.h.Provider,{value:M?z:U},a().createElement(k.O.Provider,{value:V},a().createElement(T.m.Provider,{value:W},a().createElement("div",{className:i.perspectiveView},(!p||!(null!=D&&D.uri))&&a().createElement(R.Z,null),p&&null!=D&&D.uri?a().createElement("div",{className:i.profileContainer},a().createElement("div",{className:i.profileWrapper},a().createElement(Da,null),!M&&a().createElement(Oo,null),a().createElement("div",{ref:c,className:i.scrollWrapper},a().createElement(wa,{layout:g,onLayoutChanged:_,views:b}))),a().createElement(po,null)):a().createElement("div",{className:i.emptyState},a().createElement(I.ZP,{LogoRenderer:I.B9.NO_DATA,text:h().text("No data to display."),variant:I.tC.embedded}))))))))}));No.displayName="ProfilePerspectiveView";const ko=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),To=e=>{let{config:t,store:n,onResize:f=i.identity,saveState:h,getSavedState:b,qxSandboxApi:y}=e;const v=(0,r.useCallback)((0,m.aYu)(b),[b]),E=(0,r.useMemo)((()=>(0,m.Vr9)(t)),[t]);return a().createElement(o.Provider,{store:n},a().createElement(p.m.Provider,{value:E.id},a().createElement(g.Provider,{value:y},a().createElement(s.StylesProvider,{generateClassName:ko},a().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>f(Math.floor(e),Math.floor(t))}),E&&a().createElement(No,{config:E,saveState:h,getSavedState:v}),a().createElement(d.Z,{showErrorFromStore:!0}))))))};var Ro=n(66072),Io=n(79935),jo=n(91131);const Lo=(0,J.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}}))),Do=e=>{let{total:t=0}=e;const n=Lo(),l=(0,o.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(v.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return a().createElement(W.Z,{title:""},a().createElement("div",{className:n.titleContainer},a().createElement(Wr.Z,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},h().text("Profile")),a().createElement(jo.Z,{className:n.icon}),h().text("Tags")),a().createElement(Io.Z,null),a().createElement(F.Z,{className:n.totalCaption,variant:"caption"},a().createElement("span",{className:n.totalNumber},h().number(t,"0,0")),h().text("total profiles")))};var Mo=n(20404),Ao=n(15223);const Uo=(0,J.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"}}))),zo=e=>{let{label:t}=e;const n=Uo();return a().createElement(Ao.Z,{className:n.toolbar},a().createElement(Mo.Z,{className:n.avatar}),a().createElement(F.Z,{variant:"h6",className:n.label},t))};function Ho(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){Vo(e,t,n[t])}))}return e}function Vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fo=(0,J.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}}))),Wo=[25,50,100],_o=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Fo(),[s,c]=(0,r.useState)(Wo[0]),[u,p]=(0,r.useState)(0),d=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:g,total:f,entities:b}=(e=>{let{tag:t,entityUri:n,page:a=0,rowsPerPage:l=50}=e;const s=(0,o.useDispatch)(),c=(0,Se._)(),u=(0,Se._)(),[p,d]=(0,r.useState)(!1),[g,f]=(0,r.useState)(0),[b,y]=(0,r.useState)([]),{requestEntities:E,requestTotal:x}=(e=>{let{entityUri:t,tag:n}=e;const a=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),l=(0,o.useSelector)(v.ZP.selectors.getTenant),s=(0,o.useSelector)(v.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,m.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=Ho({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,m.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,m.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Ho({offset:t,max:e},a))),[u,a,d]),requestTotal:(0,r.useCallback)((()=>{const e=a;return(p?(0,m.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,m.j_Q)(u,e)).then((e=>e.total))}),[u,a,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong")))),f(0)}),[s]);return(0,r.useEffect)((()=>{c(x()).then(f).catch(w)}),[x,c,w]),(0,r.useEffect)((()=>{d(!0),u(E(l,a*l)).then(y).catch(w).finally((()=>d(!1)))}),[a,l,E,u,w]),{isLoading:p,total:g,entities:b}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),y=(0,r.useRef)(null);(0,r.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[b]);const E=f>Wo[0];return a().createElement("div",{className:l.perspectiveView},a().createElement(zo,{label:t}),a().createElement("div",{className:D()(l.tagsContainer,{[l.fullHeight]:E})},a().createElement(z.Z,{className:l.tagsView},a().createElement(Do,{total:f}),a().createElement("div",{className:l.listContainer},g&&a().createElement(R.Z,null),f>0&&a().createElement("div",{className:l.entitiesList,ref:y},a().createElement(Ro.Z,{entities:b})),E&&a().createElement("div",{className:l.pagination},a().createElement(H.Z,{count:f,rowsPerPageOptions:Wo,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));_o.displayName="TagPerspectiveView";const Bo=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Go=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return a().createElement(o.Provider,{store:l},a().createElement(p.m.Provider,{value:t.id},a().createElement(s.StylesProvider,{generateClassName:Bo},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&a().createElement(_o,{tag:n,entityUri:r}),a().createElement(d.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([[1962],{70595:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");t.Z=o},91131:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M24 24H0V0h24v24z",opacity:".87"}),a.default.createElement("path",{d:"M7.38 21.01c.49.49 1.28.49 1.77 0l8.31-8.31c.39-.39.39-1.02 0-1.41L9.15 2.98c-.49-.49-1.28-.49-1.77 0s-.49 1.28 0 1.77L14.62 12l-7.25 7.25c-.48.48-.48 1.28.01 1.76z"})),"ArrowForwardIosRounded");t.Z=o},90324:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");t.Z=o},43576:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Create");t.Z=o},16715:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");t.Z=o},80147:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"History");t.Z=o},76569:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"}),"Inbox");t.Z=o},82726:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");t.Z=o},86680:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 15c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm1-8h-2V7h2v2z"}),"InfoRounded");t.Z=o},16208:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"}),"ThumbDown");t.Z=o},52691:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"}),"ThumbUp");t.Z=o},39781:(e,t,n)=>{var r=n(14859);t.Z=void 0;var a=r(n(24328)),o=(0,r(n(50175)).default)(a.default.createElement("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");t.Z=o},61962:(e,t,n)=>{n.d(t,{_:()=>To,t:()=>Go});var r=n(24328),a=n.n(r),o=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(12212),d=n(97333),m=n(22241);const g=a().createContext({getCurrentPerspectiveId:()=>"",setEntityUri:()=>{},showPerspective:()=>{}});var f=n(87918),h=n.n(f),b=n(3096),y=n.n(b),v=n(35674),E=n(11326),x=n(36852),w=n(58142),S=n(10),P=n(27938),C=n(35722),O=n(589),Z=n(80231),N=n(89575),k=n(14834),T=n(62228),R=n(87378),I=n(79002),j=n(17822),L=n(71153),D=n.n(L),M=n(15177);const A=a().createContext(null);A.displayName="SingleAttributeContext";var U=n(80687),z=n(1730),H=n(42011),V=n(95544),F=n(90436),W=n(52194),_=n(10742),B=n(55310),G=n(37457),q=n(46804),$=n(79784),Q=n(77277),X=n(36444),Y=n(5806),K=n(21324),J=n(79692);const ee=(0,J.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"}}))),te=e=>{let{className:t}=e;const n=ee(),o=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(A),u=()=>i((e=>!e));return a().createElement(a().Fragment,null,a().createElement(Q.Z,{ref:o,classes:{root:D()(n.triggerButton,t)},onClick:u},a().createElement(X.Z,null)),a().createElement($.ZP,{open:l,classes:{paper:n.popupContent},anchorEl:o.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(Y.Z,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:a().createElement(K.Z,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:h().text("Show inactive values")})))},ne=(0,J.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"}}))),re=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:o}=e;const l=ne(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(A);return a().createElement(W.Z,{title:h().text(t),className:l.root},a().createElement(_.Z,{widthToHide:500},a().createElement(B.Z,{height:24,margin:16}),a().createElement(F.Z,{className:l.totalCaption,variant:"caption"},h().number(n)," ",1===n?h().text("item"):h().text("items"))),a().createElement(G.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),a().createElement(q.i,{query:i,onChange:e=>{s(e),c(0)}}),o&&a().createElement(te,null))};var ae=n(65549),oe=n(85256),le=n(63928),ie=n(55401),se=n(30410);const ce=(0,J.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}))),ue=m.nIW,pe=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return pe(n,t)})))):m.P6Y.strings.search(String(e),t),de=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:a=1/0,offset:o=0,searchQuery:l=""}=e;const s=(0,i.pipe)(m.XtP,(0,i.filter)((e=>{let{value:t}=e;return pe(t,l)})))(t,n,r),c=(0,i.filter)(m.OXP,s);return{[(0,m.xy8)(r)]:{[ue(r)]:c.slice(o,o+a),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function me(){return me=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},me.apply(this,arguments)}function ge(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){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he=[],be=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s}=e;const c=ce(),{uri:u,required:d,cardinality:g,name:f}=n,b=(0,o.useDispatch)(),y=(0,r.useContext)(p.m),E=(0,o.useSelector)(v.ZP.selectors.getEntity),x=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,E.uri)||{})),w=(0,o.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),S=(0,o.useSelector)((e=>(0,m.tQX)(l,n,v.ZP.selectors.getProfileErrors(e)))),P=(0,o.useSelector)(v.ZP.selectors.getMode),C=(0,m.xy8)(n),O=(0,i.pipe)((0,i.pathOr)(he,[C,f]),(0,i.map)((0,i.prop)("uri")))(E),Z=(0,i.pathOr)(he,[C,f],x),N=Z.map((0,i.prop)("uri")),k=(0,m.ZiX)(E.uri),T=(0,r.useRef)((0,m.gjI)({parentUri:l,attributeType:n})),R=(0,m.O27)(Z),I=d&&R,j=I?[T.current]:Z.filter((0,i.pipe)((0,i.prop)("uri"),m.ZiX)),L=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,b)(e.map((e=>ge({},e,{viewId:y}))))),[y,b]),M=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.modifyAttribute,b)(ge({},e,{viewId:y}))),[y,b]),A=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,b)(ge({},e,{viewId:y}))),[y,b]),U=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,b),[b]),z=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return L(I&&!(0,m.YkM)(n.type)?[e,e]:[e])}),[L,l,n,I]),H=(0,m.Vg3)({attributeType:n,mode:P}),V={attributeType:n,errors:w,crosswalks:x.crosswalks,mode:P,onAddAttributes:L,onChangeAttribute:M,onDeactivateError:U,showNonOv:s};return a().createElement("div",null,a().createElement(le.Z,{cardinality:g}),a().createElement(ie.Z,{message:S}),H&&a().createElement(Q.Z,{color:"primary",onClick:z,className:c.moreButton},a().createElement(ae.Z,{classes:{root:c.icon}}),a().createElement("div",{className:c.buttonLabel},h().text("Add"))),j.map(((e,t)=>a().createElement(se.Z,me({key:e.uri},V,{attributeValue:e,lazy:I&&!d,showEmptyEditors:k,ownError:(0,m.ADq)(e,t,u,w),onDeleteAttribute:A})))),j.length>0&&t.length>0&&a().createElement(oe.Z,{className:c.divider}),t.map((e=>{const t=Z.find((0,i.propEq)("uri",e.uri)),n=t||e,r=O.includes(n.uri)&&!N.includes(n.uri),o=!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,m.vKJ)({valueTransformer:(0,i.unless)(m.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)(o),(0,i.always)("edited")]])();return a().createElement("div",{key:n.uri,className:D()({[c.ovFalse]:!(0,m.OXP)(n)})},a().createElement(se.Z,me({},V,{attributeValue:n,ownError:(0,m.ADq)(n,null,u,w),onDeleteAttribute:A,state:l})))})))};var ye=n(11013);const ve=(0,J.Z)((e=>({ovFalse:e.inactive}))),Ee=e=>{let{values:t,attributeType:n,showInactive:r}=e;const o=ve();return a().createElement(a().Fragment,null,t.map((e=>a().createElement("div",{key:e.uri,className:D()({[o.ovFalse]:!(0,m.OXP)(e)})},a().createElement(ye.Z,{attributeValue:e,attributeType:n,showNonOv:r})))))},xe=(0,J.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}}))),we=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=xe(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:y}=(0,r.useContext)(A),E=(0,o.useSelector)(v.ZP.selectors.getEntityUri),x=(0,o.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,o.useSelector)(v.ZP.selectors.getIsEditableMode),S=(0,o.useSelector)(v.ZP.selectors.getPivotingAttributes),P=0!==u.length;return a().createElement(U.J.Provider,{value:S},a().createElement(z.Z,{className:D()(c.root,n)},a().createElement(re,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),a().createElement(V.Z,{className:c.content},(()=>{if(g)return a().createElement(R.Z,null);if(b){if(x&&P){const e={values:u,attributeType:b,showInactive:y};return a().createElement(Ee,e)}if(w){const e={values:u,attributeType:b,parentUri:E,showInactive:y};return a().createElement(be,e)}}return a().createElement(F.Z,{className:c.noData},h().text("No data"))})()),f&&a().createElement(H.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var Se=n(29627),Pe=n(55962);function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Oe=(e,t,n)=>{const{attributeUri:a,max:l=15}=e,s=(0,o.useSelector)(v.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[g,f]=(0,r.useState)(!1),h=(0,Se._)(),b=(0,r.useRef)(null),y=(0,o.useDispatch)(),E=(0,o.useSelector)(v.ZP.selectors.getApiPath),x=(0,o.useSelector)(v.ZP.selectors.getTenant),w=n?v.ZP.selectors.getEntityWithDiff:v.ZP.selectors.getEntityWithoutDiff,S=(0,o.useSelector)(w),P=(0,o.useSelector)(v.ZP.selectors.getIsViewMode),C=(0,o.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),O=(0,o.useSelector)(v.ZP.selectors.getHistoryDiff),Z=S.uri,N=ue(a),k=(0,m.xy8)(a);b.current=(0,m.JQy)(S,Z,N);const T=(0,r.useMemo)((()=>(0,m.zeJ)(s,a)),[s,a]),{globalFilter:R}=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:I}=t,j=(0,r.useCallback)((()=>{if(T&&(0,m.Uty)(T)&&!(0,m.ZiX)(Z)&&(0,m.YOQ)(a)){f(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["page","showInactive"]),o=(0,m.biM)(S)||C?de:m.KbL;h(o(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){Ce(e,t,n[t])}))}return e}({metadata:s,entity:S,apiPath:E,tenant:x,parentUri:Z,defaultMaxValues:l,attributeTypeUri:a,offset:l*e,globalFilter:R,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([k],e),n=(0,i.pathOr)([],[N],t);C||y(v.N5.actions.processNextPageOfAttributeValues({parentUri:Z,attributeTypeUri:a,attributeTypeName:N,values:n})),u(n.map((e=>{var t;return(null===(t=b.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",a],t))})).finally((()=>{f(!1)}))}else u([]),d(null)}),[E,Z,x,a,l,s,t,R,T,C,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,Pe.D)((()=>{P&&j()}),[P]);const L=(0,i.partition)(m.OXP),[,D]=L(b.current||[]),M=I?[]:D,A=I?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(A),(0,i.prop)(A),(0,i.always)(c.length))(p),z=l<U,H=null!=p&&p.totalValues?p.totalValues-U:M.length;return{values:c,isLoading:g,hasPaging:z,totalVisibleValues:U,attributeType:T,totalNonVisibleValues:H,nonVisibleValues:M}};function Ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ne=n(80225),ke=n(63929),Te=n(1128),Re=n(39475),Ie=n(90324),je=n(70595);const Le=a().createContext(null);Le.displayName="RelationsViewStateContext";const De=(0,J.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"}}))),Me=e=>{let{className:t}=e;const n=De(),o=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(Le),[g,f]=(0,r.useState)(!1),b=()=>f((e=>!e)),y=!(0,m.O27)(d),v="asc"===s;return a().createElement(a().Fragment,null,a().createElement(Q.Z,{ref:o,classes:{root:D()(n.button,t)},onClick:b},a().createElement(X.Z,null)),a().createElement($.ZP,{open:g,classes:{paper:n.popupContent},anchorEl:o.current,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(Y.Z,{classes:{label:n.checkboxControlLabel},control:a().createElement(K.Z,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:h().text("Show inactive Relationships")}),y&&a().createElement(a().Fragment,null,a().createElement(oe.Z,{className:n.divider}),a().createElement(F.Z,{className:n.title,variant:"h6"},h().text("Sort by")),a().createElement("div",{className:n.sortControls},a().createElement(Te.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"}}}),a().createElement(Re.k,{tooltipTitle:v?h().text("Ascending"):h().text("Descending"),icon:v?Ie.Z:je.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Me.displayName="FilterButton";const Ae=Me,Ue=(0,J.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 ze=n(61932),He=n(98538);const Ve=a().createContext(null);function Fe(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}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 _e=Math.pow(2,31)-1,Be=(0,J.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 Ge=n(22118),qe=n(26739);const $e=e=>{let{label:t}=e;const n=Be();return a().createElement(qe.Z,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},a().createElement(ze.Z,null))},Qe=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,o.useSelector)(v.ZP.selectors.getDataTenants),n=(0,o.useDispatch)(),{config:a,reloadRelations:l}=(0,r.useContext)(Ve),i=(0,o.useSelector)(v.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,o.useSelector)(v.ZP.selectors.getDtssPath),g=(0,o.useSelector)(v.ZP.selectors.getTenant),f=[Fe({},a.content,{offset:0,max:null!==(e=a.maxDtssImport)&&void 0!==e?e:_e})],b=(0,r.useCallback)((()=>{c([]),a.importFromDT&&!(0,m.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,m.QXb)({entityUri:i,content:f,dtssPath:d,customerTenant:g,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Fe({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,g,a,t]),y=(0,r.useCallback)((()=>{(0,m.MOC)({entityUri:i,content:f,dtssPath:d,customerTenant:g,dataTenant:u.id}).then((()=>{l(),b()})).catch((e=>n(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong")))))),p(null)}),[i,d,g,a,b,l,u,p]);(0,r.useEffect)((()=>{b()}),[b]);const E=(0,r.useCallback)((()=>p(null)),[]),x=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:y,onCancelConfirmation:E,onImportClick:x}})(),s=Be(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return a().createElement(a().Fragment,null,!!e.length&&a().createElement(a().Fragment,null,c?a().createElement("div",{className:s.button},a().createElement(Re.k,{size:"L",icon:ze.Z,tooltipTitle:h().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),a().createElement("div",{className:D()(s.tenant)},u)):a().createElement(He.Z,{menuId:"importDT-table-actions",buttonComponent:Re.k,buttonProps:{tooltipTitle:h().text("Import connections"),size:"L",icon:()=>a().createElement($e,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),a().createElement(Ge.Z,{open:!!t,title:h().text("Confirmation"),content:h().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:h().text("Cancel"),saveCaption:h().text("Import"),onDiscard:l,onSave:n})))},Xe=e=>{let{title:t,total:n}=e;const o=Ue(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Le);return a().createElement(W.Z,{title:t||"",className:o.header},n>0&&a().createElement(_.Z,{widthToHide:400},a().createElement(B.Z,{height:24,margin:16}),a().createElement(F.Z,{className:o.totalCaption,variant:"caption"},n>1?h().text("${count} items",{count:n}):h().text("${count} item",{count:n}))),a().createElement(q.i,{query:l,onChange:i}),a().createElement(Qe,null),a().createElement(Ae,null))};var Ye=n(821),Ke=n(27604),Je=n(22983),et=n(42662),tt=n(18527),nt=n(4614),rt=n(80030);const at=(0,J.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 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 lt=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["label","entity","children"]);const c=at(),u=(0,Se._)(),p=(0,o.useSelector)(v.ZP.selectors.getTenant),d=(0,o.useSelector)(v.ZP.selectors.getDtssPath),[g,f]=(0,r.useState)(!1),[h,b]=(0,r.useState)(null);(0,r.useEffect)((()=>{b(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(h)){const e=(0,i.ifElse)(m.biM,(e=>(0,m.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,m.XkT)(e.entityUri)));f(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;b(t)})).finally((()=>{f(!1)}))}}),[d,n,p,u,h]),E=a().createElement("div",{className:c.tooltipContent},a().createElement("div",{className:c.label},t),g&&a().createElement(nt.Z,{size:16,classes:{colorPrimary:c.progress}}),h&&a().createElement("div",{className:c.secondaryLabel},h));return a().createElement(rt.ZP,ot({onOpen:y,title:E,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},it=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,m.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,m.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,m.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,m.Lmx)(t,null==r?void 0:r.relationType)}},st=(0,J.Z)((()=>({container:{display:"flex"}})));function ct(){return ct=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},ct.apply(this,arguments)}const ut=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["acceptRelation","ignoreRelation"]);const o=st();return a().createElement("div",{className:o.container},a().createElement(Q.Z,ct({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),h().text("Accept")),a().createElement(Q.Z,ct({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),h().text("Ignore")))},pt=(0,J.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"}}))),dt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:o,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=pt(),{entity:d,relation:g}=t,f=(0,m.$qe)(t),b=(0,m.xr3)(t),y=(0,m.iJH)(t),{entityType:v,entityLabel:E,preparedUri:x,relationLabel:w}=it(t,n),S=(0,m.Fn9)(g)&&(0,m.Fn9)(d),{canRemove:P,canUpdate:C}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:a,onEditRelation:o}=e;if((n===m.ARY.Editing||n===m.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,m.$qe)(r),i=(0,m.V3K)(t,e);return{canRemove:a&&!l&&(0,m.Edd)(n,i),canUpdate:o&&!l&&(0,m.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:m.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),O=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),Z=(0,r.useCallback)((()=>i(t)),[i,t]),N=(0,r.useCallback)((()=>{s(t)}),[s,t]),k=(0,r.useCallback)((()=>c(t)),[c,t]),T=(P||C)&&o&&!t.suggested?a().createElement(a().Fragment,null,C&&a().createElement(Re.k,{icon:Ke.Z,size:"XS",onClick:Z,tooltipTitle:h().text("Edit")}),P&&a().createElement(Re.k,{icon:Je.Z,size:"XS",onClick:O,tooltipTitle:h().text("Remove")})):void 0,R=t.suggested?a().createElement(ut,{acceptRelation:N,ignoreRelation:k,size:"small",disabled:y}):void 0,I=y?h().text("ignored"):h().text("edited");return a().createElement("div",{className:D()(p.container,{[p.rowInactive]:!S},{[p.removed]:f||y})},a().createElement("div",{className:p.row},u&&u(),a().createElement(et.Z,{className:p.entityAvatar,entityType:v}),a().createElement(tt.Z,{value:x,className:p.entityLabelContainer},a().createElement(lt,{label:E,entity:d},a().createElement("span",{className:p.entityLabel},E)),(b||y)&&a().createElement(F.Z,{variant:"caption",className:p.editedLabel},"(",I,")"),w&&a().createElement("span",{className:p.relationLabel},`, ${w}`)),a().createElement("div",{className:p.editButtonsContent},T),R))})),mt=(e,t)=>{const n=(e,t)=>(t?(0,m.VGB)(t):[]).map((t=>({type:t,direction:e===m.Nsj.IN?m.Nsj.IN:m.Nsj.OUT})));return n(m.Nsj.IN,e).concat(n(m.Nsj.OUT,t))[0]};function gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ft=n(98989),ht=n(83543);const bt=(0,J.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),yt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:o}=e;const l=bt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,m.xvW)(n)?null:o?a().createElement(ht.Z,c):a().createElement(ft.Z,c)},vt=(0,J.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),Et=e=>{let{config:t,connection:n,children:l}=e;const i=vt(),{showInactive:s}=(0,r.useContext)(Le),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:g,total:f}=(e=>{let{config:t,connection:n,relationActivityFilter:a}=e;const l=(0,o.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),[p,d]=(0,r.useState)(0),{contentSecondLevel:g}=t,{entity:f}=n,h=(0,o.useSelector)((e=>v.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,f.entityUri)))||[],{activityFilter:b}=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(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){gt(e,t,n[t])}))}return e}({},g,{returnObjects:!0,returnDates:!0,activeness:{relation:a||m.Ng6.ALL,entity:b}});u(!0),(0,m.N6e)(f.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(v.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:f.entityUri,id:t.id})),d(r),u(!1)}))}),[t.id,g,l,f.entityUri,b,a]),E=(0,r.useCallback)((()=>{i||n.connections||y(),s((e=>!e))}),[y,n.connections,i]);return{connections:h,showSecondLevel:i,toggleShowSecondLevel:E,loadRelations:y,loading:c,total:p}})({config:t,connection:n,relationActivityFilter:s?m.Ng6.ALL:m.Ng6.ACTIVE_ONLY}),h=(0,r.useMemo)((()=>(0,m.Px$)(c)),[c]);return a().createElement(a().Fragment,null,l((()=>a().createElement(yt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&a().createElement(ke.X.Provider,{value:h},a().createElement("div",{className:i.secondLevelContent},a().createElement(Yt,{isLoading:g,config:t,loadRelations:d,connections:c,total:f,parentEntityUri:n.entity.entityUri}))))},xt=(0,J.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"}}))),wt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,o.useSelector)(v.ZP.selectors.getMetadata),d=(0,o.useSelector)((e=>v.ZP.selectors.getRelationToAddByViewId(e,l.id))),g=(0,o.useSelector)((e=>v.ZP.selectors.getRelationsToEditByViewId(e,l.id))),f=(0,o.useSelector)(v.ZP.selectors.getEntity),b=(0,o.useSelector)((e=>v.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),y=(0,o.useDispatch)(),E=xt(),x=(0,r.useCallback)((()=>{const e=(0,m.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y)(e)}),[l,s,p,y,u]),w=(0,r.useCallback)((e=>{y(v.N5.relations.actions.closeRelationEditor(l.id,e)),y(v.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>v.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=v.N5.relations.selectors.getEntityUriFromConnection(t);(0,m.ZiX)(r)&&y(v.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,y]),S=l.content,P=mt(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)(P.type),object:(0,i.evolve)({type:(0,i.always)(P.type),attributes:(0,i.always)(null)})}}))(e);y(v.N5.relations.actions.addRelation(l.id,t))}),[y,l,P]),O=(0,r.useCallback)((e=>{y(v.N5.relations.actions.ignoreRelation(l.id,{relationType:P.type,relationDirection:P.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[y,l,P]),[Z,N]=(0,i.partition)(m.xvW,n),k=f&&b,T=0===Z.length&&0===N.length,R=e=>{var t,n;const r=g.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)})),o=!l.allowOnlyCreateNew||(0,m.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 a().createElement(Et,{config:l,connection:e,key:c},(t=>r?a().createElement(Ye.Z,{connection:r,config:l,mode:s,metadata:p}):a().createElement(dt,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:o,onRemoveRelation:w,onEditRelation:(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y),onAcceptRelation:C,onIgnoreRelation:O})))},I=k&&(!d||d&&d.parentEntityUri===u),j=d&&d.parentEntityUri===u;return a().createElement("div",{className:t},I&&a().createElement(Q.Z,{color:"primary",onClick:x,className:E.moreButton},a().createElement(ae.Z,{classes:{root:E.icon}}),a().createElement("div",{className:E.buttonLabel},h().text("Add"))),j&&a().createElement(Ye.Z,{connection:d,config:l,mode:s,metadata:p}),Z.map(R),Z.length>0&&N.length>0&&a().createElement(oe.Z,{className:E.divider}),N.map(R),T&&a().createElement(F.Z,{className:E.noData},c))};var St=n(62901),Pt=n(72316),Ct=n(38309),Ot=n(89978);const Zt=(0,J.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Nt(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){kt(e,t,n[t])}))}return e}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tt=e=>{let{connection:t,className:n}=e;const l=Zt(),{relation:s}=t,c=(0,o.useSelector)(v.ZP.selectors.getEntityUri),u=(0,o.useSelector)(v.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,m.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>Nt({attributes:Nt({},v.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,m.p2l)((null==t?void 0:t.relation)||{}))),[t]),g=(0,r.useMemo)((()=>(0,m.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,m.O27)(t)})).length>0,f=(0,r.useMemo)((()=>(0,m.R$r)(d.attributes)),[d]),{getCommentsCount:b}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(f)&&b(f)}),[b,f]);const y=(0,r.useMemo)((()=>(0,m.wp9)(m.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return g?a().createElement(Ct.A.Provider,{value:y},a().createElement(Ot.Z,{className:D()(l.attributesList,n),entity:d,attrTypes:p})):a().createElement("div",{className:D()(l.attributesList,n)},h().text("No attributes"))};var Rt=n(86680),It=n(82726);const jt=e=>{let{show:t,onToggle:n,className:r}=e;return a().createElement(Re.k,{className:r,tooltipTitle:t?h().text("Hide attributes of the relationship"):h().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Rt.Z:It.Z,onClick:n})},Lt=(0,J.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"flex-start",flexDirection:"row",minHeight:"16px",padding:"3px 16px 0 "},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"},showDetails:{marginLeft:"auto"},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"},suggestedLabelWrapper:{marginTop:"6px"},labelWrapper:{display:"flex"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=Lt(),u=t.suggested,{entity:p,relation:d}=t,[g,f]=(0,r.useState)(!1),h=(0,o.useSelector)(v.ZP.selectors.getMetadata),{entityType:b,entityLabel:y,preparedUri:E,relationLabel:x}=it(t,h),w=(0,m.Fn9)(d)&&(0,m.Fn9)(p),S=(0,o.useSelector)(v.ZP.selectors.getEntityUri),P=p&&d&&(0,m.wp9)(m.q7e.RELATION,{entityUri:S,connection:t})||[];return a().createElement("div",{className:D()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},a().createElement("div",{className:D()(c.row,St.U)},n&&n(),a().createElement("div",{className:D()(c.labelWrapper,{[c.suggestedLabelWrapper]:u})},a().createElement(et.Z,{className:c.entityAvatar,entityType:b}),a().createElement(tt.Z,{value:E,className:c.entityLabelContainer},a().createElement(lt,{label:y,entity:p},a().createElement("span",{className:c.entityLabel},y)),x&&a().createElement("span",{className:c.relationLabel},`, ${x}`))),a().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(P)&&a().createElement(Pt.Z,{className:c.commentsContainer,uri:null==d?void 0:d.relationUri,relatedObjectUris:P,objectType:m.q7e.RELATION,allowOnlyOneComment:!0}),u&&a().createElement(ut,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&a().createElement(jt,{show:g,onToggle:()=>{f((e=>!e))},className:c.showDetails}))),g&&a().createElement(Tt,{connection:t}))}));var Mt=n(52691),At=n(16208);const Ut=e=>e.filter((e=>5===e.value)).length,zt=e=>e.filter((e=>1===e.value)).length,Ht=e=>0===e.length?"0%":Ut(e)/e.length*100+"%",Vt=e=>0===e.length?"0%":zt(e)/e.length*100+"%",Ft=(0,J.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)"}}))),Wt=e=>{let{ratings:t,className:n}=e;const r=Ft();return a().createElement("div",{className:D()(r.wrapper,n)},a().createElement(F.Z,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),a().createElement("div",{className:r.scale},a().createElement("div",{className:r.likesScale,style:{width:Ht(t)}}),a().createElement("div",{className:r.dislikesScale,style:{width:Vt(t)}})),a().createElement("div",{className:r.counts},a().createElement("div",{className:D()(r.likesCount,r.count)},a().createElement(Mt.Z,{className:r.icon}),Ut(t)),a().createElement("div",{className:r.count},a().createElement(At.Z,{className:r.icon}),zt(t))))},_t=(0,J.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}}))),Bt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=_t(),i=(0,o.useSelector)(v.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:h().text("Has left the practice"),onClick:()=>r(h().text("Has left the practice"))},{text:h().text("Has moved away"),onClick:()=>r(h().text("Has moved away"))},{text:h().text("Has passed away"),onClick:()=>r(h().text("Has passed away"))},{text:h().text("Has retired"),onClick:()=>r(h().text("Has retired"))},{text:h().text("Other"),onClick:()=>r(h().text("Other"))}];return a().createElement("div",{className:l.wrapper},a().createElement(Q.Z,{onClick:n,variant:"text",size:"small",className:D()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),a().createElement(He.Z,{buttonProps:{endIcon:a().createElement(ht.Z,null),variant:"text",size:"small",className:D()(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"}))},Gt=(0,J.Z)((e=>({wrapper:{padding:"6px 16px 3px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{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 16px 3px",backgroundColor:e.suggested},commentsContainer:{marginTop:"21px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),qt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Gt(),p=t.suggested,[d,g]=(0,r.useState)(!1),{entity:f,relation:h}=t,b=(0,o.useSelector)(v.ZP.selectors.getMetadata),{entityLabel:y,entityType:E,preparedUri:x,relationLabel:w}=it(t,b),S=(null==h?void 0:h.ratings)||[],P=(0,o.useSelector)(v.ZP.selectors.getEntityUri),C=f&&h&&(0,m.wp9)(m.q7e.RELATION,{entityUri:P,connection:t})||[];return a().createElement("div",{className:D()(u.wrapper,{[u.suggestedWrapper]:p})},a().createElement(V.Z,{display:"flex",minHeight:"62px",className:St.U},a().createElement(V.Z,{display:"flex",alignItems:"flex-start"},a().createElement(V.Z,{display:"flex",alignItems:"center"},l&&l(),a().createElement(et.Z,{entityType:E,className:u.entityTypeIcon})),a().createElement(V.Z,{display:"flex",flexDirection:"column"},a().createElement(tt.Z,{value:x,className:u.entityLabelContainer},a().createElement(lt,{label:y,entity:f},a().createElement("span",{className:u.entityLabel},y))),w&&a().createElement("span",{className:u.relationLabel},w),!p&&a().createElement(Bt,{ratings:S,onAgree:()=>{(0,m.Buf)(null==h?void 0:h.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,m.Buf)(null==h?void 0:h.relationUri,{comment:e,value:1}).then(n)}}))),a().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&a().createElement(Pt.Z,{className:u.commentsContainer,uri:null==h?void 0:h.relationUri,relatedObjectUris:C,objectType:m.q7e.RELATION,allowOnlyOneComment:!0}),p&&a().createElement(ut,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&a().createElement(a().Fragment,null,a().createElement(Wt,{ratings:S,className:u.ratings}),a().createElement(jt,{show:d,onToggle:()=>{g((e=>!e))},className:u.showDetailsButton})))),d&&a().createElement(Tt,{connection:t,className:u.relationAttributes}))},$t=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=mt(e.inRelations,e.outRelations),a=(0,o.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:o}=e;(0,m.iiD)(n,{relatedEntityUri:o.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:o,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===m.Nsj.IN,u=c?o.entityUri:n,p=c?n:o.entityUri;(0,m.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong"))))}))}}})(u,l,s),g=(0,r.useMemo)((()=>(0,m.w3p)(n)),[n]),{getCommentsCount:f}=(0,r.useContext)(w.h);return(0,r.useEffect)((()=>{f(g)}),[f,g]),a().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 a().createElement(Et,{config:i,connection:e,key:r},(t=>c?a().createElement(qt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):a().createElement(Dt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};$t.displayName="RelationsList";const Qt=$t,Xt=(0,J.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=Xt(),{selectors:u}=v.ZP,p=(0,o.useSelector)(u.getEntity),d=(0,o.useSelector)(u.getMode),g=n["text-empty"]||h().text("No data found");return t?a().createElement(R.Z,null):(0,m.KIu)(d)?a().createElement(wt,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:g,parentEntityUri:s}):i>0?a().createElement(Qt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):a().createElement(F.Z,{className:c.noData},g)},Kt=(0,J.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}}),Jt=e=>{let{config:t,className:n}=e;const l=Kt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:g,searchQuery:f,changeSearchQuery:h}=(0,r.useContext)(Le),{selectors:b}=v.ZP,y=(0,o.useSelector)((e=>b.getConnectionsWithDraftsByViewId(e,t.id))),E=(0,o.useSelector)(b.getEntity),x=(0,o.useSelector)((e=>b.getTotalByViewId(e,t.id))),w=(0,o.useSelector)(b.getMode),S=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{h("")}),[null==E?void 0:E.uri]);const P=(0,r.useMemo)((()=>(e=>{const t=m.wSh.fromFalsy(e).map(m.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new m.MEy).addClause(t).build()})(f)),[f]),{isLoading:C,reload:O}=(0,Ne.a)({sorting:S,filter:P,page:s,rowsPerPage:u,config:t,entity:E,relationActivityFilter:g?m.Ng6.ALL:m.Ng6.ACTIVE_ONLY,mode:w}),Z=(0,r.useMemo)((()=>(0,m.Px$)(y)),[y]),N=(0,r.useMemo)((()=>({reloadRelations:O,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[O,t]);return a().createElement(ke.X.Provider,{value:Z},a().createElement(z.Z,{className:n},a().createElement("div",{className:l.container},a().createElement(Ve.Provider,{value:N},a().createElement(Xe,{title:t.caption,total:x})),a().createElement("div",{className:l.content},a().createElement(Yt,{isLoading:C,config:t,loadRelations:O,connections:y,total:x}),x>u&&a().createElement(H.Z,{classes:{root:l.pagination},count:x,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};Jt.displayName="RelationsView";const en=a().createContext(null);en.displayName="SingleAttributeContext";var tn=n(17569),nn=n(75975),rn=n(79573);function an(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){on(e,t,n[t])}))}return e}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ln="CHANGE_SEARCH_QUERY",sn=an({},nn.ZP.actions,{changeSearchQuery:(0,rn.zD)(ln)}),cn=(e,t)=>t.type===ln?an({},e,{searchQuery:t.payload,page:0}):nn.ZP.reducer(e,t);var un=n(92332),pn=n(25843);const dn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},mn=(0,J.Z)((()=>({tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},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":dn}}))),gn=(0,pn.Z)((e=>{const t=mn();return a().createElement("div",{className:t.headCell},a().createElement(un.default,e))}));var fn=n(46728);function hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bn=(0,i.pipe)((0,i.map)((e=>({id:(0,m.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,m.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),yn=(0,i.pipe)(m.DK$,bn),vn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),En=e=>{if((0,m.vZp)(e)){const t=vn(e);return t.length>1?t.slice(0,-1):null}return null},xn=(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){hn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:En(e.id),headCellRenderer:gn,rowCellValueRenderer:fn.Z})));var wn=n(9377);function Sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pn=n(47081),Cn=n(33903),On=n(54238);const Zn=(0,J.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Nn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:o,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=Zn();return a().createElement(W.Z,{title:t,className:u.header},a().createElement(q.i,{query:n,onChange:r}),a().createElement(Cn.Z,{enabled:o,onClick:l}),a().createElement(B.Z,{height:24,margin:4}),a().createElement(On.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};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 Tn=(0,n(30488).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:o}=e,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=mn();return a().createElement("div",{className:D()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,kn({key:t,value:e},l)))))}));var Rn=n(45108);const In=e=>{let{onEdit:t,onRemove:n}=e;return a().createElement(a().Fragment,null,t&&a().createElement(Re.k,{tooltipTitle:h().text("Edit"),icon:Ke.Z,size:"L",onClick:t}),n&&a().createElement(Re.k,{tooltipTitle:h().text("Remove"),icon:Je.Z,size:"L",onClick:n}))};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)}const Ln=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:g,deletedUris:f}=e;const h=(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,m.tT_)(e))(t))(vn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),b=(0,r.useMemo)((()=>xn(t)),[t]),y=mn(),E=(0,o.useSelector)(v.ZP.selectors.getMode),x=(0,m.KIu)(E),w=(0,o.useSelector)(v.ZP.selectors.getMetadata),S=(0,o.useSelector)(v.ZP.selectors.getEntityUri),P=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:C}=(0,r.useContext)(en),O=(0,r.useCallback)((e=>a().createElement(Tn,jn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[Z,N]=(0,r.useState)(null),{canUpdate:k,canDelete:T}=(0,Pn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof Z||!x||f.includes((0,i.pipe)((0,i.path)([Z]),(0,i.prop)("uri"))(n))),[Z,f,n,x]),I="number"==typeof Z&&(j=(0,i.path)([Z],n),T(p)&&(0,m.xv5)({attributeType:C,mode:E,attributeValue:j,metadata:w,isReltioCrosswalk:(0,m.KVV)(P.crosswalks,j)}));var j;const L="number"==typeof Z&&(e=>k(p)&&(0,m.yv0)({attributeType:C,mode:E,attributeValue:e,isReltioCrosswalk:(0,m.KVV)(P.crosswalks,e)}))((0,i.path)([Z],n)),D=(0,r.useCallback)((()=>{const e=(0,i.path)([Z],n);L&&d(e)}),[d,Z,n,L]),M=(0,r.useCallback)((()=>{const e=(0,i.path)([Z],n);if(!I)return;const t={parentUri:S,attributeType:C,uri:e.uri,value:e};g(t),N(null)}),[Z,n,g,I,C,S]),A=R||!I&&!L?void 0:a().createElement(In,{onEdit:L?D:void 0,onRemove:I?M:void 0}),U=(0,r.useMemo)((()=>({deletedUris:f})),[f]);return a().createElement("div",{className:y.tableContainer},a().createElement(Rn.Z,{columnsData:b,rowsData:h,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:O,onRowHover:N,hoverRowIndex:Z,hoveredRowRightContent:A,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Dn=(0,J.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 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 An=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const d=Dn(),g=(0,o.useSelector)(v.ZP.selectors.getEntityUri),{attributeType:f}=(0,r.useContext)(en),b=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,g)||{})),y=(0,o.useSelector)(v.ZP.selectors.getMode),E=(0,o.useDispatch)(),x=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(v.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){Mn(e,t,n[t])}))}return e}({},e,{viewId:x}))))),[x,E]),S=(0,m.ZiX)(g),P=(0,o.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,g,f))),C=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,E),[E]);return a().createElement(a().Fragment,null,a().createElement(se.Z,{attributeValue:u,showEmptyEditors:S,onDeleteAttribute:s,onDeactivateError:C,onChangeAttribute:t,onAddAttributes:w,mode:y,crosswalks:b.crosswalks,errors:P,attributeType:f,ownError:(0,m.ADq)(u,null,f.uri,P)}),a().createElement("div",{className:d.actionButtons},a().createElement(Q.Z,{onClick:()=>{n(u)}},h().text("Cancel")),a().createElement(Q.Z,{color:"primary",disabled:!c,onClick:()=>{l(u)}},h().text("Apply"))))},Un=(0,J.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 zn(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){Hn(e,t,n[t])}))}return e}function Hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vn=[],Fn=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=Un(),{values:u,page:d,setPage:g,isLoading:f,searchQuery:b,setSearchQuery:y,visibleColumns:E,onFilter:x,onSort:w,onToggleFilters:S,onChangeColumns:P,filters:C,sorting:O,totalVisibleValues:Z,hasPaging:N,attributeType:k,showTable:T}=(0,r.useContext)(en),I=(0,r.useMemo)((()=>yn(k)),[k]),{checkHasChanges:j,onChangeAttribute:L,onDeleteAttribute:M,onAdd:A,onCancel:U,onApply:V,onStartEditing:_,modifiedValues:B,editingValues:G,deletedUris:q}=(()=>{const[e,t]=(0,r.useState)(),[n,a]=(0,r.useState)([]),l=(0,o.useSelector)(v.ZP.selectors.getMode);(0,r.useEffect)((()=>{a([]),t(null)}),[l]);const s=(0,o.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:d}=(0,r.useContext)(en),g=(0,o.useSelector)(v.ZP.selectors.getEntityUri),f=(0,o.useSelector)(v.ZP.selectors.getMetadata),h=(0,r.useCallback)((e=>{(0,i.pipe)(v.N5.actions.modifyAttribute,s)(zn({},e,{viewId:c}))}),[c,s]),b=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(zn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,m.gjI)({parentUri:g,attributeType:u});t(e.uri),h(zn({},e,{value:(0,m.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:f}),attributeType:u}))}),[g,u]),E=(0,r.useCallback)((e=>{a((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[a]),x=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=zn({},e,{value:r,attributeType:u,uri:e.uri});a((e=>(0,i.without)([r],e))),h(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),b(n)}}),[b,h,a,n]),w=(0,r.useCallback)((e=>{t(null),a((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[a,t]),S=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,g)||{})),P=(0,m.KIu)(l),C=(0,m.xy8)(u),O=(0,i.pathOr)(Vn,[C,null==u?void 0:u.name],S),Z=(0,r.useMemo)((()=>[...O.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(m.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>O.find((0,i.propEq)("uri",e.uri))||e))(d)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[O,n,e,d]),N=(0,r.useMemo)((()=>P?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!O.find((0,i.propEq)("uri",e)))))(d):[]),[O,d]),k=O.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:h,onDeleteAttribute:b,onAdd:y,onCancel:x,onApply:w,onStartEditing:E,modifiedValues:Z,editingValues:k,deletedUris:N}})(),$=(0,o.useSelector)(v.ZP.selectors.getMode),X=(0,m.KIu)($),Y=X?B:u,{canCreate:K}=(0,Pn.l)(),J=K(t)&&k&&(0,m.Vg3)({attributeType:k,mode:$})&&!G.length,ee=(0,r.useMemo)((()=>E.map((e=>I.find((0,i.propEq)("id",e))))),[E,I]);return a().createElement(z.Z,{className:D()(c.root,n)},T?a().createElement(a().Fragment,null,a().createElement(Nn,{title:l,total:Z,columnsData:I,selectedColumns:E,onChangeColumns:P,searchQuery:b,onChangeSearchQuery:y,filtersEnabled:!!C,onToggleFilters:S}),a().createElement("div",{style:{position:"relative"}},X&&a().createElement("div",{className:c.editor},J&&a().createElement(Q.Z,{color:"primary",onClick:A,className:c.addButton},a().createElement(ae.Z,{classes:{root:c.icon}}),a().createElement("div",{className:c.buttonLabel},h().text("Add"))),G.map((e=>a().createElement(An,{key:e.uri,attributeValue:e,onChangeAttribute:L,onDeleteAttribute:M,onCancel:U,onApply:V,hasChanges:j(e)})))),a().createElement(Ln,{columnsData:ee,config:t,values:Y,filters:C,onFilter:x,sorting:O,onSort:w,onEdit:_,onDeleteAttribute:M,deletedUris:q}),N&&a().createElement(H.Z,{count:Z,rowsPerPageOptions:[],rowsPerPage:s,page:d,onChangePage:g}),f&&a().createElement(R.Z,null))):a().createElement(a().Fragment,null,a().createElement(W.Z,{title:l,className:c.header}),a().createElement(F.Z,{className:c.noData},h().text("No data"))))};var Wn=n(37163);let _n=0;const Bn=()=>_n++,Gn=e=>{const t={children:[],nodeId:Bn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let a=t;for(let t=r.length-1;t>=0;t--){const o=r[t],l=e.entities[o.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Bn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),a.children.push(s),a=s}}return t.children};var qn=n(43434);const $n=(0,J.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 Qn=n(1242);const Xn=a().createContext(null);var Yn=n(48685);const Kn=e=>{e.target.src=Qn},Jn=e=>{let{node:t}=e;const n=$n(),l=(0,o.useDispatch)(),i=t.entity.uri,s=(0,o.useSelector)(v.ZP.selectors.getAbsoluteImagePath),c=(0,o.useSelector)(v.ZP.selectors.getMetadata),u=(0,r.useContext)(Xn),p=(0,o.useSelector)(v.ZP.selectors.getUIPath),{uri:d}=(0,o.useSelector)(v.ZP.selectors.getEntity),g=(0,m.ChB)({uiPath:p,uri:i}),f=i===d,h=(0,r.useCallback)((()=>{l(v.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:b},nodeId:y}=t,E=(0,m.nt9)(c,t.entity.type)||{},x=(0,m.VD3)(c,E,"typeGraphIcon"),w=x&&(0,m.vPL)(s,x);return a().createElement("div",{className:n.wrapper,"data-node-id":y},a().createElement("div",{className:n.container},a().createElement(qn.Z,{className:D()(n.avatar),src:w||Qn,onError:Kn}),a().createElement("span",{className:D()(n.link,{[n.selected]:f})},a().createElement(Yn.Z,{to:g,onClick:h},b))))},er=((0,r.memo)(Jn),e=>{let{node:t}=e;return t.nodeId}),tr=(0,J.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 nr(){return nr=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},nr.apply(this,arguments)}function rr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ar(){return ar=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},ar.apply(this,arguments)}const or={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:o,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!o.root&&o.children&&o.children.length>0,g=tr();return a().createElement("div",ar({style:{height:"100%"}},p,{key:o.nodeId}),m&&o.expanded&&a().createElement("div",{style:{width:n-2},className:g.lineChildren}),a().createElement("div",{className:g.row,style:u},a().createElement("div",{className:g.rowContents},m&&a().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:o,path:s,treeIndex:c})}},a().createElement("div",{"aria-label":o.expanded?"Collapse":"Expand",className:D()(g.button,o.expanded?g.expandedButton:g.collapsedButton)})),a().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:o,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:o,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=tr(),u=o.length,p=[];o.forEach(((e,t)=>{p.push(a().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&a().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&a().createElement(a().Fragment,null,a().createElement("div",{className:c.verticalLine}),a().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`,h=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){rr(e,t,n[t])}))}return e}({},s.style,{width:f});return a().createElement("div",nr({},s,{className:c.node,style:h}),p,a().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function lr(){return lr=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},lr.apply(this,arguments)}const ir=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",lr({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},a().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"})))},sr=e=>{let{title:t,onGraphOpen:n}=e;const r=$n();return a().createElement(W.Z,{title:t,className:r.header},a().createElement("div",{className:r.buttonsContainer},a().createElement(Re.k,{className:r.button,tooltipTitle:h().text("Show Graph"),icon:ir,onClick:n,size:"L"})))};var cr=n(80233);const ur=(0,J.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));let pr,dr;function mr(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){gr(e,t,n[t])}))}return e}function gr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission"}(pr||(pr={})),function(e){e.SET_HTML="setHtml",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request"}(dr||(dr={}));const fr=(e,t)=>{const{url:n}=e;return n?(!(null==t?void 0:t.some((e=>{const t=e.match(/^(?:([^:?#]+):)?(?:\/\/((?:(([^:@?]*)(?::([^:@?]*))?)?@)?((?:\[[0-9A-Fa-f:]+)|(?:[^:?#]*))(?::(\d*))?))?((((?:[^?#]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/),r=t[1],a=t[6],o=`${r}://${a}`,l=new RegExp("^"+e+"$"),i=e.replace(/\/*$/,"");return i===n||a&&a===i||a&&o===i||i&&0===i.indexOf("/")&&n&&0===n.indexOf(i)||i&&l.test(n)})))||0===((null==t?void 0:t.length)||0))&&{errorMessage:"Not enough permissions"}:{errorMessage:"URL is empty"}};var hr=n(36571);function br(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){yr(e,t,n[t])}))}return e}function yr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vr=(e,t)=>{let{files:n,permissions:a}=e;const[l,i]=(0,r.useState)(),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(!0),[d,f]=(0,r.useState)(null),[h,b]=(0,r.useState)(null),[y,E]=(0,r.useState)(""),x=(0,o.useDispatch)(),w=(0,o.useSelector)(v.ZP.selectors.getMetadata),S=(0,o.useSelector)(v.ZP.selectors.getEntity)||{},P=`${(0,o.useSelector)(v.ZP.selectors.getUIPath)}worker_api.js`,C=(0,o.useSelector)(v.ZP.selectors.getTenant),O=(0,o.useSelector)(v.ZP.selectors.getApiPath),Z=(0,o.useSelector)(v.ZP.selectors.getWorkflowPath),N=(0,o.useSelector)(v.ZP.selectors.getUser),k=(0,o.useSelector)(v.ZP.selectors.getEntityUri),T=(0,o.useSelector)(v.ZP.selectors.getWorkflowEnvironmentUrl),R=(0,r.useContext)(g),I=(0,hr.Z)(),{type:j,data:L}=(0,o.useSelector)(v.ZP.selectors.getSearchProviderData)||{},D=e=>x(v.ui.actions.openSearch(e)),M=(e,n,r)=>{if(e){const o=[],l=e=>{const t=e.getAttribute("ui-actions"),r=e.getAttribute("ui-tooltip"),a=e.getAttribute("id")||e.getAttribute("name");t&&(t.split(",").forEach((t=>{const r=()=>{const e={action:"event",type:"uiAction",data:{type:t,id:a}};n.postMessage(e)};e.addEventListener(t,r),o.push((()=>{e.removeEventListener(t,r)}))})),e.removeAttribute("ui-actions")),r&&f(r),e.childNodes.forEach((e=>{1===e.nodeType&&l(e)}))},s=e=>{const t=document.createElement("div");t.innerHTML=e||r,l(t),c(o),i(t)};switch(e.action===dr.SET_HTML&&r!==e.params.html&&s(e.params.html),e.action){case dr.LOG:console.log(e.params);break;case dr.SET_VISIBILITY:"visible"===e.params?(p(!0),s()):p(!1);break;case dr.SET_TOOLTIP:f(e.params),s();break;case dr.SET_HEIGHT:b((t=>br({},t||{},{height:e.params})));break;case dr.SET_WIDTH:b((t=>br({},t||{},{width:e.params})));break;case dr.SET_ENABLED:b((t=>{const n=br({},t||{});return e.params?delete n["pointer-events"]:n["pointer-events"]="none",n}));break;case dr.MESSAGE:E(e.params);break;case dr.REQUEST:(e=>{let{name:t,paramObject:n,permissions:r,worker:a,metadata:o,config:l,apiPath:i,user:s,workflowPath:c,entity:u,tenant:p,entityUri:d,query:g,openSearch:f,environment:h,getCurrentPerspectiveId:b,showPerspective:y,workflowCheckPermission:v,setEntityUri:E}=e;const x=e=>{e.then((e=>{a.postMessage(mr({action:"response",result:{data:e}},n.params))})).catch((()=>{a.postMessage(mr({action:"response",result:{data:{},headers:"",status:0}},n.params))}))};switch(t){case pr.API:{const e=((e,t)=>{const n=fr(e,t);return n?new Promise((e=>e(n))):(0,m.SL_)({url:e.url,method:e.method,data:e.data,headers:e.headers})})(n.params,r);x(e);break}case pr.WORKFLOW:{const e=((e,t,n,r)=>{const{url:a}=e,o=fr(e,t);if(o)return new Promise((e=>e(o)));const l=a.includes("http:")||a.includes("https:");return n||l?(0,m.oUH)({url:a,method:e.method||"GET",data:e.data,tenant:r,headers:e.headers,workflowPath:n}):new Promise((e=>e({errorMessage:"Workflow path is not defined"})))})(n.params,r,c,p);x(e);break}case pr.WORKFLOW_START_PROCESS_FROM_QUERY:{const e=((e,t,n,r,a)=>{if(!e.processDefinitionId)return new Promise((e=>e({errorMessage:"processDefinitionId is empty"})));if(!e.searchString)return new Promise((e=>e({errorMessage:"searchString is empty"})));if(!n)return new Promise((e=>e({errorMessage:"Workflow path is not defined"})));const o=fr(mr({url:"/processInstances/_generateFromQuery"},e),t);return o?new Promise((e=>e(o))):(0,m.FuV)({workflowPath:n,processType:e.processDefinitionId,searchString:e.searchString,tenant:r,environment:a})})(n.params,r,c,p,h);x(e);break}case pr.GET_CONFIGURATION:a.postMessage(mr({action:"response",result:o},n.params));break;case pr.GET_UI_CONFIGURATION:{const e=mr({},l,{action:mr({},l.action)});e.action.permissions&&delete e.action.permissions,a.postMessage(mr({action:"response",result:e},n.params));break}case pr.SET_ENTITY_URI:E(d,(()=>a.postMessage(mr({action:"response",result:u},n.params))));break;case pr.SET_PERSPECTIVE:y(n.params.perspective),a.postMessage(mr({action:"response",result:b()},n.params));break;case pr.GET_PERSPECTIVE:b&&a.postMessage(mr({action:"response",result:b()},n.params));break;case pr.WORKFLOW_CHECK_PERMISSION:a.postMessage(mr({action:"response",result:v(n.params.permission)},n.params));break;case pr.GET_SEARCH_QUERY:a.postMessage(mr({action:"response",result:g},n.params));break;case pr.OPEN_SEARCH:f({viewId:l.id,searchState:n.params.searchState});break;case pr.GET_ENTITY_URI:a.postMessage(mr({action:"response",result:d},n.params));break;case pr.GET_ENTITY:a.postMessage(mr({action:"response",result:u},n.params));break;case pr.GET_API_PATH:a.postMessage(mr({action:"response",result:i},n.params));break;case pr.WORKFLOW_GET_WORKFLOW_PATH:a.postMessage(mr({action:"response",result:c},n.params));break;case pr.GET_TENANT:a.postMessage(mr({action:"response",result:p},n.params));break;case pr.GET_USER:a.postMessage(mr({action:"response",result:s},n.params));break;case pr.ALERT:window.alert(n.params.text);break;case pr.CONFIRM:window.confirm(n.params.text);break;case pr.PROMPT:window.prompt(n.params.text,n.params.defaultText||"");break;case pr.OPEN_WINDOW:window.open(n.params.url,"_blank")}})(br({name:e.params.name,paramObject:e,permissions:a,worker:n,metadata:w,config:t,user:N,apiPath:O,tenant:C,workflowPath:Z,entity:S,entityUri:k,environment:T,query:"search"===j?null==L?void 0:L.query:null,openSearch:D,workflowCheckPermission:I},R))}}};return(0,r.useEffect)((()=>{const e=((e,t,n)=>{const r=`\n importScripts("${e}");\n importScripts("${t.join('","')}");\n postMessage({action:'loaded'});`;let a;try{const e=window.webkitURL||window.URL;a=new Worker(e.createObjectURL(new Blob([r],{type:"application/javascript"})))}catch(e){a=new Worker("data:application/javascript,"+encodeURIComponent(r))}if(a){let e="";a.addEventListener("message",(t=>{if("loaded"!==t.data.action){const r=JSON.parse(t.data);n(r,a,e),"setHtml"===r.action&&(e=r.params.html)}}))}return a})(P,n,M);return()=>{e.terminate()}}),[]),(0,r.useEffect)((()=>()=>{s.forEach((e=>e()))}),[s]),{html:l,visible:u,tooltip:d,customStyles:h,message:y,onClosePopup:()=>E("")}};function Er(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){xr(e,t,n[t])}))}return e}function xr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wr=n(14940);const Sr=(0,J.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)"}}),Pr=e=>{const t=t=>{const n=Sr();return a().createElement("div",{className:n.resizableHandleContainer},a().createElement("div",{className:n.resizableHandleVisibilityArea},a().createElement("div",{className:D()("viewDraggableHandle",n.resizableHandle)},a().createElement(wr.Z,{className:n.dragIcon}))),a().createElement(e,t))};return t.displayName="WithResizableHandle",t},Cr=(0,J.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Or=n(29103),Zr=n(83911),Nr=n(62116),kr=n(40435);const Tr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Rr=(0,J.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Ir=n(61347),jr=n(66078);const Lr=(0,J.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Dr=Lr,Mr=e=>{let{totalImages:t}=e;const n=Dr(),r=t>1?h().text("photos"):h().text("photo");return a().createElement(F.Z,{variant:"caption",className:n.caption},`${t} ${r}`)};function Ar(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){Ur(e,t,n[t])}))}return e}function Ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,o.useDispatch)(),c=(0,o.useSelector)(v.ZP.selectors.getEntity),u=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return a().createElement(a().Fragment,null,a().createElement(jr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(Ar({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(v.N5.actions.modifyAttribute,s)(Ar({},e,{viewId:d})),imageSize:Fr,paging:r,requestNextPageOfAttributeValues:l}),a().createElement(Mr,{totalImages:p.length}))},Hr=(0,J.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Vr=Hr,Fr={imageMargin:4,imageWidth:162,imageHeight:162};var Wr=n(86689),_r=n(23044);const Br=(0,J.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 Gr=n(20200),qr=n(25601),$r=n(84236),Qr=n(48376);function Xr(){return Xr=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},Xr.apply(this,arguments)}const Yr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,o.useDispatch)(),c=(0,o.useSelector)(v.ZP.selectors.getMetadata),u=(0,o.useSelector)(v.ZP.selectors.getEntity),{canMerge:d,canMark:g}=(0,m.hXd)(c,t,n.object,u,n.matchRules),f=(0,r.useMemo)((()=>[n.object]),[n.object]),h={entity:u,entities:f,mode:qr.N.iconButton,onStartRequest:l},b=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(v.N5.entity.actions.loadEntity({viewId:b,uri:u.uri}))}),[s,u.uri,i,b]);return a().createElement(a().Fragment,null,d&&a().createElement($r.H,Xr({},h,{onFinishRequest:y})),g&&a().createElement(Qr.i,Xr({},h,{onFinishRequest:i})))},Kr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,o.useSelector)(v.ZP.selectors.getMetadata),c=(0,o.useSelector)(v.ZP.selectors.getEntity);return a().createElement(Gr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:St.U},a().createElement(Pt.Z,{uri:(0,m.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:m.q7e.POTENTIAL_MATCH}),a().createElement(Yr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Jr={showTransitiveMatches:!0,showInactiveEntities:!1},ea={order:"asc",field:"score"};var ta;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(ta||(ta={}));const na=Pr((e=>{let{className:t}=e;const n=Cr();return a().createElement(z.Z,{className:D()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),ra=Pr((e=>{let{className:t,config:n}=e;return a().createElement(M.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),aa=Pr((e=>{let{className:t,config:n}=e;const o=(e=>{const[t,n]=(0,r.useState)(""),[a,o]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:a,searchQuery:t,showInactive:l})),[a,t,l]),c=Oe(e,s,!0),u=(0,r.useCallback)((()=>{o(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){Ze(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:o,page:a,toggleShowInactive:u,showInactive:l},c)})(n);return a().createElement(A.Provider,{value:o},a().createElement(we,{config:n,className:t}))})),oa=Pr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,a=(0,o.useSelector)(v.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,m.zeJ)(a,n)),[a,n]),s=(0,r.useMemo)((()=>yn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),m.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(cn,c),{searchQuery:d,filters:g,sorting:f,page:h}=u,b=(0,o.useSelector)(v.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>m.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const a=e.find((0,i.propEq)("id",n));return(0,wn.su)(a,r)})))).orSome([]))(s,g);return e.length?e:null}),[g,s]),E=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:h,sorting:f,searchQuery:d})),[y,h,f,d]),{changeSearchQuery:x,changePage:w,toggleSort:S,changeFilter:P,toggleFilters:C,changeColumns:O}=(0,tn.o)({actions:sn,dispatch:p}),Z=Oe(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){Sn(e,t,n[t])}))}return e}({},u,{setSearchQuery:x,setPage:w,onSort:S,onFilter:P,onToggleFilters:C,onChangeColumns:O,showTable:Boolean(((null==Z||null===(t=Z.values)||void 0===t?void 0:t.length)||y||d||b)&&l&&!l.hidden)},Z)})(t);return a().createElement(en.Provider,{value:l},t&&a().createElement(Fn,{config:t,className:n}))})),la=Pr((e=>{let{config:t,className:n}=e;const o=(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]),a=e.max||15,[o,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))}),[]),h=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),b=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:h,sortOption:c,changeSortOption:b,sortOptions:n,page:o,setPage:l,rowsPerPage:a,showInactive:m,toggleShowInactive:f}})(t);return a().createElement(Le.Provider,{value:o},a().createElement(Jt,{config:t,className:n}))})),ia=Pr((e=>{let{config:t,className:n}=e;const o=(0,r.useRef)(),[l,s]=(0,r.useState)(null),{height:c,width:u,tooltip:p}=t,{html:d,visible:m,tooltip:g,customStyles:f,onClosePopup:h,message:b}=vr(t.action,t),y=ur(),v=g||p;if((0,r.useEffect)((()=>{o.current&&d&&(o.current.innerHTML="",d.childNodes.forEach((e=>{o.current.appendChild(e)})),s(o.current))}),[d]),!m)return null;const E=(0,i.reject)(i.isNil,{width:u,height:c}),x=a().createElement("div",{ref:o,style:Er({},E,f),className:D()(y.root,n)});return a().createElement("div",{className:y.bodyWrapper},v?a().createElement(rt.ZP,{title:v},x):x,a().createElement(cr.Z,{placement:"bottom",anchorEl:l,open:!!b,onClose:h},b))})),sa=Pr((e=>{let{config:t,className:n}=e;const l=(0,o.useSelector)(v.ZP.selectors.getEntityUri),{treeData:i,setTreeData:s}=((e,t)=>{const n=(0,Se._)(),[a,o]=(0,r.useState)([]);return(0,r.useEffect)((()=>((0,m.ZiX)(e)||n((0,m.RFJ)({uri:e,graphUri:t})).then(Gn).then(o).catch((e=>{console.warn(e)})),()=>{o([])})),[e,t,n]),{treeData:a,setTreeData:o}})(l,t.graph.type),c=$n(),u=(0,o.useDispatch)(),{id:p,graph:d}=t,g=(0,r.useCallback)((()=>{u(v.ui.actions.openGraph({viewId:p,graphType:d.type}))}),[u,p,d]),f=(0,r.useCallback)((e=>({title:a().createElement(Jn,{node:e.node})})),[]);return a().createElement(z.Z,{className:n},a().createElement(sr,{onGraphOpen:g,title:t.caption}),a().createElement(Xn.Provider,{value:t},a().createElement("div",{className:c.treeContainer},a().createElement("div",{className:c.tree},a().createElement(Wn.ZP,{isVirtualized:!1,treeData:i,canDrag:!1,theme:or,generateNodeProps:f,onChange:s,getNodeKey:er})))))})),ca=Pr((e=>{let{config:t,className:n}=e;const l=Br(),s=(0,o.useSelector)(v.ZP.selectors.getEntity),c=null==s?void 0:s.uri,[u,d]=(0,r.useState)(!1),g=(0,r.useCallback)((()=>{d(!0)}),[]),f=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:b,entitiesMap:y,loadMatches:E,total:x}=(0,_r.s)({enabled:!!c,entity:s,options:Jr,filter:"",page:0,sorting:ea,rowsPerPage:3,onStartLoading:g,onFinishLoading:f}),S=(0,r.useCallback)((()=>{E()}),[E]),P=(0,o.useDispatch)(),C=(0,r.useContext)(p.m),O=(0,r.useCallback)((()=>{P(v.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:C}))}),[P,C]),Z=(0,r.useMemo)((()=>(0,m.NVY)(c,(0,i.map)(m.ev7,b))),[c,b]),{getCommentsCount:N}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{N(Z)}),[N,Z]);const k=x>3&&!(0,i.isEmpty)(b),T=u?ta.Loading:(0,i.isEmpty)(b)?ta.NoData:ta.Loaded;return a().createElement(ke.X.Provider,{value:y},a().createElement(z.Z,{className:D()(l.root,n)},a().createElement(W.Z,{title:t.caption}),a().createElement("div",{className:l.matchesContainer},T===ta.Loading&&a().createElement(R.Z,null),T===ta.NoData&&a().createElement(F.Z,{className:l.noData},h().text("No matches found")),T===ta.Loaded&&b.map((e=>a().createElement(Kr,{config:t,entitiesMap:y,match:e,onFinishRequest:S,onStartRequest:g,key:e.object.uri})))),k&&a().createElement(a().Fragment,null,a().createElement("div",{className:l.footer},a().createElement(Wr.Z,{component:"button",variant:"caption",onClick:O,underline:"none"},h().text("See all"))))))})),ua=(0,r.lazy)((()=>n.e(590).then(n.bind(n,10590)).then((e=>({default:Pr(e.HierarchyTreeView)}))))),pa=(0,r.lazy)((()=>n.e(3431).then(n.bind(n,83431)).then((e=>({default:Pr(e.RelationshipsTableView)}))))),da=Pr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=Rr(),c=(0,o.useSelector)(v.ZP.selectors.getMetadata),u=(0,o.useSelector)(v.ZP.selectors.getEntity),p=(0,o.useSelector)(v.ZP.selectors.getGoogleMapKey),{markers:d,loading:g}=((e,t,n)=>{const[a,o]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Se._)();return(0,r.useEffect)((()=>{i(!0),s((0,m.DBr)(t,[e],n)).then((e=>{o(e.filter(Tr))})).catch((()=>{o([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:a,loading:l}})(u,c,p),f=(0,r.useMemo)((()=>a().createElement("div",{className:s.fullHeight},a().createElement(R.Z,null))),[s]),h=(0,r.useMemo)((()=>({lat:0,lng:0})),[]);return p&&a().createElement(z.Z,{className:D()(s.root,i)},g&&a().createElement(R.Z,null),a().createElement(kr.Z,{size:"S",icon:n?Zr.Z:Or.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),a().createElement(Nr.Z,{loadingElement:f,defaultZoom:1,defaultCenter:h,markers:d,mapContainerClassName:s.fullHeight,mapKey:p}))})),ma=Pr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Vr(),c=(0,o.useDispatch)(),u=(0,o.useSelector)(v.ZP.selectors.getMode),p=(0,o.useSelector)(v.ZP.selectors.getEntityWithDiff),d=(0,o.useSelector)(v.ZP.selectors.getMetadata),g=(0,m.zeJ)(d,l),f=(0,i.pathOr)([],["attributes",null==g?void 0:g.name],p),b=(0,i.path)(["attributes","paging",l],p),y=f.length,E=t["text-empty"]||h().text("No data found"),x=(0,r.useCallback)((e=>c(v.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return a().createElement(z.Z,{className:n},a().createElement(W.Z,{title:t.caption}),a().createElement("div",{className:s.container},(()=>{if(g){if((0,m.KIu)(u)){const e={attributeType:g,config:t,paging:b,requestNextPageOfAttributeValues:x};return a().createElement(zr,e)}if(y>0){const e={attributeValues:f,attributeType:g,imageSize:Fr,paging:b,parentUri:p.uri,requestNextPageOfAttributeValues:x};return a().createElement(a().Fragment,null,a().createElement(Ir.Z,e),a().createElement(Mr,{totalImages:y}))}}return a().createElement(F.Z,{className:s.noData},E)})()))}));class ga{}ga.ViewTypes=m.ZIY,ga.getComponentBy=(e,t)=>{let{store:n,config:r,className:o,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case ga.ViewTypes.HierarchyTree:return a().createElement(ua,{config:r,store:n,className:o});case ga.ViewTypes.HierarchyPaths:return a().createElement(sa,{config:r,className:o});case ga.ViewTypes.RelationsTable:return a().createElement(pa,{config:r,store:n,className:o});case ga.ViewTypes.Relations:return a().createElement(la,{config:r,className:o});case ga.ViewTypes.Attributes:return a().createElement(ra,{className:o,config:r});case ga.ViewTypes.SingleAttributeView:return a().createElement(aa,{config:r,className:o});case ga.ViewTypes.TableAttributeView:return a().createElement(oa,{config:r,className:o});case ga.ViewTypes.MapView:return a().createElement(da,{config:r,isFullscreen:l,onToggleFullscreen:i,className:o});case ga.ViewTypes.CustomView:return a().createElement(ia,{config:r,className:o});case ga.ViewTypes.ImageAttributeView:return a().createElement(ma,{config:r,className:o});case ga.ViewTypes.PotentialMatchesView:return a().createElement(ca,{config:r,className:o})}},ga.getComponent=e=>ga.getComponentBy("class",e)||ga.getComponentBy("react-class",e)||a().createElement(na,{className:e.className});const fa=ga,ha=()=>null,ba=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:o,isAutosize:l,onToggleFullscreen:i}=e;const s=Cr();return a().createElement(r.Suspense,{fallback:a().createElement(ha,null)},fa.getComponent({config:t,store:n,className:D()(s.component,{[s.fullHeight]:!l}),isFullscreen:o,onToggleFullscreen:i}))}));ba.displayName="ViewComponent";const ya=(0,J.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function va(){return va=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},va.apply(this,arguments)}const Ea=["onConfigChanged","onRemove"],xa=e=>{let{layoutItemConfig:t,views:n,className:l,children:s,style:c,isFullscreen:u,onToggleFullscreen:p,AutosizeComponent:d}=e,m=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const g=n.find((e=>{let{id:n}=e;return t.i===n})),f=ya(),{store:h}=(0,r.useContext)(o.ReactReduxContext);if(!g)return null;const b=g.class===fa.ViewTypes.CustomView;return a().createElement("div",va({},(0,i.omit)(Ea,m),{style:c,className:D()(l,{[f.item]:!b})}),a().createElement("div",{className:D()({[f.fixedSizeContainer]:!d})},d,a().createElement(ba,{store:h,config:g,isFullscreen:u,onToggleFullscreen:p,isAutosize:Boolean(d)})),s)},wa=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:o}=e;return a().createElement(j.Z,{LayoutItem:xa,views:t,layout:n,layoutOptions:r,onLayoutChanged:o,draggableHandle:".viewDraggableHandle"})};var Sa=n(33109),Pa=n(75647),Ca=n(76368),Oa=n(36777),Za=n(72379),Na=n(72753),ka=n(43576);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)}const Ra=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",Ta({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),a().createElement("defs",null,a().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"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("g",{transform:"translate(-4 -2.5)"},a().createElement("mask",{id:"svg1467685497b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg1467685497a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))},Ia=(0,J.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"}}),ja=e=>a().createElement(Za.Z,e,a().createElement(Ra,null)),La=(e,t,n,r,a)=>e.filter((e=>{let{value:o,permission:l}=e;return!(n&&!(0,m.KIu)(o))&&!!(r&&a||!(0,m.fnZ)(o))&&(0,m.uGe)(l,t)})),Da=e=>{let{className:t}=e;const n=Ia(),l=(0,o.useDispatch)(),i=(0,o.useSelector)(v.ZP.selectors.getCanUserStartProcessFromQuery),s=(0,o.useSelector)(v.ZP.selectors.getEntityWithoutDiff),c=(0,o.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s.uri))),u=(0,o.useSelector)(v.ZP.selectors.getMetadata),p=(0,o.useSelector)(v.ZP.selectors.isWorkflowEnabled),d=(0,o.useSelector)(v.ZP.selectors.getMode),g=(0,o.useSelector)(v.ZP.selectors.getIsEditableMode),f=(0,o.useSelector)(v.ZP.selectors.getIsViewMode),b=(0,o.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),y=(0,o.useSelector)(v.ZP.selectors.getProfileOperation)===m.OXy.Saving,E=null==s?void 0:s.type,x=(0,r.useMemo)((()=>[{label:h().text("Editing"),value:m.fO_.EDITING,description:h().text("Edit profile directly"),icon:ka.Z,permission:"UPDATE"},{label:h().text("Suggesting"),value:m.fO_.SUGGESTING,description:h().text("Suggest changes and initiate a workflow review"),icon:ja,permission:"INITIATE_CHANGE_REQUEST"},{label:h().text("Viewing"),value:m.fO_.VIEWING,description:h().text("Suggest changes and initiate a workflow review"),icon:Na.Z,permission:"READ"}]),[]),w=(0,r.useMemo)((()=>[{label:h().text("Delete"),value:"Delete",description:h().text("Permanently delete profile"),icon:Je.Z,onClick:()=>{window.confirm(h().text("Are you sure you want to delete this?"))&&l(v.N5.entity.actions.entityRemoveRequested({entityUri:s.uri}))},permission:"DELETE"}]),[l,s.uri]),S=(0,r.useMemo)((()=>(0,m.nt9)(u,E)||{}),[u,E]),P=!b&&!(0,m.biM)(s)&&!(e=>(0,m.uGe)(m.BDP.READ,e)&&!(0,m.uGe)(m.BDP.UPDATE,e)&&!(0,m.uGe)(m.BDP.DELETE,e)&&!(0,m.uGe)(m.BDP.INITIATE_CHANGE_REQUEST,e))(S),C=(0,m.ZiX)(null==s?void 0:s.uri),O=(0,r.useMemo)((()=>La(x,S,C,p,i)),[x,S,p,i,C]),Z=(0,r.useMemo)((()=>La(w,S,C,p,i)),[w,S,p,i,C]),N=(0,r.useCallback)((e=>{l(v.N5.mode.actions.modeUpdated(e))}),[l]),k=(0,r.useCallback)((()=>{l(v.N5.mode.actions.modeCancelEditing())}),[l]),T=(0,r.useCallback)((()=>{l(v.N5.actions.saveProfile())}),[l]);return a().createElement(Sa.Z,{className:D()(t,St.U),entity:g&&c?c:s},a().createElement(V.Z,{display:"flex",alignItems:"center"},a().createElement(V.Z,{mr:3},g&&a().createElement(V.Z,{className:n.editingButtons},a().createElement(Q.Z,{variant:"outlined",onClick:k,"data-reltio-id":"reltio-profile-cancel-editing",disabled:y},h().text("Cancel")),a().createElement(Q.Z,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:T,disabled:y},(0,m.fnZ)(d)?h().text("Suggest"):h().text("Save"))),b&&f?a().createElement(Pa.Z,null):f&&a().createElement(Ca.a,null)),P&&a().createElement(Oa.T,{optionsGroup:O,buttonsGroup:Z,value:d,onChange:N,disabled:y})),a().createElement(V.Z,{className:n.comments},a().createElement(Pt.Z,{uri:s.uri,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:s.uri}),objectType:m.q7e.ENTITY})))};var Ma=n(69409),Aa=n(85457),Ua=n(37778),za=n(32158),Ha=n(95085),Va=n(70675),Fa=n(11821),Wa=n(98273),_a=n(28101),Ba=n(80147),Ga=n(76569);const qa=(0,J.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),$a=()=>{const{total:e}=(0,r.useContext)(k.O),t=qa();return a().createElement(qe.Z,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},a().createElement(Ga.Z,null))};var Qa=n(89925),Xa=n(4426);const Ya=(0,J.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Ka=()=>{const e=Ya(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,o.useSelector)(v.ZP.selectors.getEntityUri);return(0,r.useEffect)((()=>{t(i)}),[t,i]),a().createElement(V.Z,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:o}=e;return a().createElement(Qa.J,{key:o,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&a().createElement(Wr.Z,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},a().createElement(Xa.Z,{className:e.showMoreIcon}),h().text("Show more")))};var Ja=n(37193);const eo=(0,J.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),to=()=>{const e=eo(),{tasks:t,loading:n}=(0,r.useContext)(k.O);return a().createElement("div",{className:e.wrapper},n&&a().createElement(R.Z,null),t&&t.map((e=>a().createElement(Ja.s,{key:e.taskId,task:e}))))};function no(){return no=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},no.apply(this,arguments)}const ro=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",no({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),a().createElement("defs",null,a().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"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("g",null,a().createElement("g",{transform:"translate(-2 -2)"},a().createElement("mask",{id:"svg2697213709b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg2697213709a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},ao=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=qa();return a().createElement(qe.Z,{badgeContent:(0,m.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},a().createElement(ro,null))};var oo=n(15422);const lo=()=>a().createElement(oo.Z,{text:h().text("Ready to go with the flow?"),secondaryText:h().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),io=()=>a().createElement(oo.Z,{text:h().text("Care to join the conversation?"),secondaryText:h().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function so(){return so=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},so.apply(this,arguments)}let co;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(co||(co={}));const uo=e=>{if(e)return 1===e?h().text("${total} item",{total:e}):h().text("${total} items",{total:e})},po=()=>{var e,t,n;const l=qa(),s=(0,o.useSelector)(v.ZP.selectors.isWorkflowSideViewEnabled),c=(0,o.useSelector)(v.ZP.selectors.isWorkflowEnabled),u=(0,o.useSelector)(v.ZP.selectors.isCollaborationSideViewEnabled),p=(0,o.useSelector)(v.ZP.selectors.isCollaborationEnabled),d=(0,o.useSelector)(v.ZP.selectors.getHistoryEvent),g=(0,o.useSelector)(v.ZP.selectors.getMetadata),f=(0,o.useSelector)(v.ZP.selectors.getEntity),b=(0,r.useContext)(k.O),y=(0,r.useContext)(w.h),[E,x]=(0,r.useState)(null),S=(0,r.useCallback)((e=>{x((t=>t===e?null:e))}),[]),P=(0,r.useCallback)((()=>{x(null)}),[]),C=null!==E,O=E===co.History,{isHistoryEnabled:Z,isProfilePersisted:N}=(0,Ma.C)({isHistoryTabActive:O,entity:f}),{historyFilter:T,onApplyFilter:R,onClearFilter:I,isLoading:j,historicUris:L,historyWithTotal:D,canLoadMore:M,onLoadMore:A}=(0,Aa.k)({entity:f,enabled:Z}),U=s&&c&&!(0,m.ZiX)(null==f?void 0:f.uri),z=u&&p,H=(0,m.mdt)(null==y?void 0:y.commentsMap),V=[{buttonProps:{id:co.Workflow,icon:$a,tooltipTitle:h().text("Workflow")},content:null!=b&&b.total?a().createElement(to,null):a().createElement(lo,null),headerProps:{mainTitle:h().text("Workflow"),secondTitle:uo(null==b?void 0:b.total),rightContent:a().createElement(Ua.G,null)},hidden:!U},{buttonProps:{id:co.Collaboration,icon:ao,tooltipTitle:h().text("Collaboration")},content:H?a().createElement(Ka,null):a().createElement(io,null),headerProps:{mainTitle:h().text("Collaboration"),secondTitle:uo(H)},hidden:!z},{buttonProps:{id:co.History,icon:Ba.Z,tooltipTitle:h().text("History")},content:N?a().createElement(za.Z,{isLoading:j,historyWithTotal:D,contributorsUris:L,entityUri:null==f?void 0:f.uri,historyEvent:d,onLoadMore:A,canLoadMore:M}):a().createElement(Ha.Z,null),headerProps:{content:a().createElement(Va.Z,{total:N?((null==L?void 0:L.length)||0)+1:void 0,entityType:(0,m.nt9)(g,null==f?void 0:f.type),filter:T,onApplyFilter:R,onClearFilter:I})}}],F=(0,i.reject)((0,i.propEq)("hidden",!0))(V);return(0,r.useEffect)((()=>{var e;null!==(e=V[E])&&void 0!==e&&e.hidden&&P()}),[E,V,P,F]),a().createElement("div",{className:l.wrapper},a().createElement(Fa.h,{open:C,width:480},!(null!==(e=V[E])&&void 0!==e&&e.hidden)&&a().createElement(a().Fragment,null,a().createElement(Wa.P,so({},null===(t=V[E])||void 0===t?void 0:t.headerProps,{onClose:P})),null===(n=V[E])||void 0===n?void 0:n.content)),a().createElement(_a.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(V),onButtonClick:S,activeIndexId:E}))};var mo=n(39781),go=n(16715);const fo="48px",ho="1px solid rgba(0, 0, 0, .125)",bo=(0,J.Z)((e=>({accordion:{borderTop:ho,borderBottom:ho,boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:fo,minHeight:fo,"&$accordionSummaryExpanded":{height:fo,minHeight:fo}},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"}}))),yo=bo;var vo=n(27616),Eo=n(8284),xo=n(70660),wo=n(38016);const So=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:o}=e;const l=yo();return t.length>0?a().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return a().createElement(vo.Z,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},a().createElement(Eo.Z,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:a().createElement(wo.Z,null)},i,a().createElement(F.Z,{className:l.accordionSummaryHeading},s)),a().createElement(xo.Z,{className:D()(l.accordionDetails,p)},a().createElement("ul",null,c.map(((e,t)=>a().createElement(o,{key:t,error:e}))))))}))):null}));So.displayName="ErrorsPanel";const Po=(0,i.omit)(["deactivated","path"]),Co=(0,r.memo)((e=>{let{error:t}=e;const n=yo(),r=((e,t)=>{let{type:n,source:r,message:a,attributeTypeUri:o="",attributeType:l}=t;if(n===m.NIO.missed&&r===m.zHr.local){const t=l||(0,m.zeJ)(e,o);return t?h().text("${attribute} is required",{attribute:t.label}):a}return a})((0,o.useSelector)(v.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[m.HAc.attributeValue,m.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return a().createElement("li",null,a().createElement("span",null,r),l&&a().createElement(a().Fragment,null,a().createElement("br",null),a().createElement("span",{className:n.parents},l)))}));Co.displayName="Error";const Oo=()=>{const e=yo(),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(Po),t.map(Po))}(e,t.current)||(t.current=e),t.current})((0,o.useSelector)(v.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(m.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:h().text("${number} ${errors}",{number:n.length,errors:1===n.length?h().text("error"):h().text("errors")}),icon:a().createElement(mo.Z,{className:D()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:h().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?h().text("warning"):h().text("warnings")}),icon:a().createElement(go.Z,{className:D()(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?a().createElement(So,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:Co}):null},Zo=(0,J.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"}}))),No=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=Zo({maxWidth:null==t?void 0:t.maxWidth}),s=(0,o.useDispatch)(),c=(0,r.useRef)(),u=(0,r.useCallback)((0,m.DsO)(n,5e3),[n]),{isLoaded:p,savedState:d}=(0,E.a)(l),[g,f]=(0,r.useState)([]),[b,j]=(0,r.useState)([]),L=(0,r.useMemo)((()=>y()(t)),[t]),D=(0,o.useSelector)(v.ZP.selectors.getEntity),M=(0,o.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),A=(0,r.useMemo)((()=>(0,m.dvH)(D)),[D]),U=(0,x.C)({objectIds:A}),z=(0,r.useContext)(w.h),H=(0,S.U)(),V=(0,P.v)(null==t?void 0:t.workflow),F=(0,o.useSelector)(v.ZP.selectors.getHistoryEvent);(0,C.a)({entity:D,historyEvent:F});const W=(0,O.u)();(0,r.useEffect)((()=>{if(p){const e=L!==d.configHash,{views:n,layout:r}=(0,m.Mfk)({views:e||!d.views?t.views:d.views,layout:e?t.layout:d.layout});j(n),f(r)}}),[p]),(0,r.useEffect)((()=>{s(v.N5.views.actions.profileViewsSet(b))}),[s,b]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[null==D?void 0:D.uri]),(()=>{const e=(0,o.useDispatch)(),t=(0,o.useSelector)(v.ZP.selectors.getValidateReadMode),n=(0,o.useSelector)(v.ZP.selectors.getEntity)||{},{uri:a,updatedTime:l}=n,i=(0,m.biM)(n),s=(0,o.useSelector)(v.ZP.selectors.getMode),c=(0,o.useSelector)(v.ZP.selectors.getProfileViews),u=c&&c.length>0;(0,r.useEffect)((()=>{t&&!i&&a&&!(0,m.ZiX)(a)&&s===m.ARY.Viewing&&u&&e(v.N5.actions.validateProfile())}),[e,i,t,l,a,s,u])})();const _=(0,r.useCallback)((e=>{u({layout:e,views:b,configHash:L}),f(e)}),[u,L,b]);return a().createElement(Z.j.Provider,{value:!0},a().createElement(N.s.Provider,{value:H},a().createElement(w.h.Provider,{value:M?z:U},a().createElement(k.O.Provider,{value:V},a().createElement(T.m.Provider,{value:W},a().createElement("div",{className:i.perspectiveView},(!p||!(null!=D&&D.uri))&&a().createElement(R.Z,null),p&&null!=D&&D.uri?a().createElement("div",{className:i.profileContainer},a().createElement("div",{className:i.profileWrapper},a().createElement(Da,null),!M&&a().createElement(Oo,null),a().createElement("div",{ref:c,className:i.scrollWrapper},a().createElement(wa,{layout:g,onLayoutChanged:_,views:b}))),a().createElement(po,null)):a().createElement("div",{className:i.emptyState},a().createElement(I.ZP,{LogoRenderer:I.B9.NO_DATA,text:h().text("No data to display."),variant:I.tC.embedded}))))))))}));No.displayName="ProfilePerspectiveView";const ko=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),To=e=>{let{config:t,store:n,onResize:f=i.identity,saveState:h,getSavedState:b,qxSandboxApi:y}=e;const v=(0,r.useCallback)((0,m.aYu)(b),[b]),E=(0,r.useMemo)((()=>(0,m.Vr9)(t)),[t]);return a().createElement(o.Provider,{store:n},a().createElement(p.m.Provider,{value:E.id},a().createElement(g.Provider,{value:y},a().createElement(s.StylesProvider,{generateClassName:ko},a().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>f(Math.floor(e),Math.floor(t))}),E&&a().createElement(No,{config:E,saveState:h,getSavedState:v}),a().createElement(d.Z,{showErrorFromStore:!0}))))))};var Ro=n(66072),Io=n(79935),jo=n(91131);const Lo=(0,J.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}}))),Do=e=>{let{total:t=0}=e;const n=Lo(),l=(0,o.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(v.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return a().createElement(W.Z,{title:""},a().createElement("div",{className:n.titleContainer},a().createElement(Wr.Z,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},h().text("Profile")),a().createElement(jo.Z,{className:n.icon}),h().text("Tags")),a().createElement(Io.Z,null),a().createElement(F.Z,{className:n.totalCaption,variant:"caption"},a().createElement("span",{className:n.totalNumber},h().number(t,"0,0")),h().text("total profiles")))};var Mo=n(20404),Ao=n(15223);const Uo=(0,J.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"}}))),zo=e=>{let{label:t}=e;const n=Uo();return a().createElement(Ao.Z,{className:n.toolbar},a().createElement(Mo.Z,{className:n.avatar}),a().createElement(F.Z,{variant:"h6",className:n.label},t))};function Ho(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){Vo(e,t,n[t])}))}return e}function Vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fo=(0,J.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}}))),Wo=[25,50,100],_o=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Fo(),[s,c]=(0,r.useState)(Wo[0]),[u,p]=(0,r.useState)(0),d=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:g,total:f,entities:b}=(e=>{let{tag:t,entityUri:n,page:a=0,rowsPerPage:l=50}=e;const s=(0,o.useDispatch)(),c=(0,Se._)(),u=(0,Se._)(),[p,d]=(0,r.useState)(!1),[g,f]=(0,r.useState)(0),[b,y]=(0,r.useState)([]),{requestEntities:E,requestTotal:x}=(e=>{let{entityUri:t,tag:n}=e;const a=(0,o.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),l=(0,o.useSelector)(v.ZP.selectors.getTenant),s=(0,o.useSelector)(v.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,m.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=Ho({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,m.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,m.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Ho({offset:t,max:e},a))),[u,a,d]),requestTotal:(0,r.useCallback)((()=>{const e=a;return(p?(0,m.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,m.j_Q)(u,e)).then((e=>e.total))}),[u,a,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(v.ui.actions.errorSet((0,m.xU7)(e,h().text("Something went wrong")))),f(0)}),[s]);return(0,r.useEffect)((()=>{c(x()).then(f).catch(w)}),[x,c,w]),(0,r.useEffect)((()=>{d(!0),u(E(l,a*l)).then(y).catch(w).finally((()=>d(!1)))}),[a,l,E,u,w]),{isLoading:p,total:g,entities:b}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),y=(0,r.useRef)(null);(0,r.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[b]);const E=f>Wo[0];return a().createElement("div",{className:l.perspectiveView},a().createElement(zo,{label:t}),a().createElement("div",{className:D()(l.tagsContainer,{[l.fullHeight]:E})},a().createElement(z.Z,{className:l.tagsView},a().createElement(Do,{total:f}),a().createElement("div",{className:l.listContainer},g&&a().createElement(R.Z,null),f>0&&a().createElement("div",{className:l.entitiesList,ref:y},a().createElement(Ro.Z,{entities:b})),E&&a().createElement("div",{className:l.pagination},a().createElement(H.Z,{count:f,rowsPerPageOptions:Wo,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));_o.displayName="TagPerspectiveView";const Bo=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Go=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return a().createElement(o.Provider,{store:l},a().createElement(p.m.Provider,{value:t.id},a().createElement(s.StylesProvider,{generateClassName:Bo},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&a().createElement(_o,{tag:n,entityUri:r}),a().createElement(d.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/remotes",
3
- "version": "1.4.1065",
3
+ "version": "1.4.1066",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "main.js",
6
6
  "publishConfig": {