@reltio/remotes 1.4.1102 → 1.4.1105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1394.js +1 -0
- package/1920.js +1 -1
- package/2864.js +1 -0
- package/2890.js +1 -1
- package/2953.js +1 -1
- package/3405.js +1 -1
- package/350.js +1 -1
- package/{5211.js → 4355.js} +1 -1
- package/4361.js +1 -1
- package/4689.js +1 -1
- package/4765.js +1 -1
- package/4843.js +1 -1
- package/4950.js +1 -0
- package/5400.js +1 -1
- package/5580.js +1 -1
- package/5709.js +1 -1
- package/5720.js +1 -1
- package/5818.js +1 -1
- package/5884.js +1 -1
- package/6222.js +1 -1
- package/6248.js +1 -1
- package/{7854.css → 633.css} +0 -0
- package/633.js +1 -0
- package/6596.js +1 -1
- package/6685.js +1 -1
- package/6940.js +1 -0
- package/6974.js +1 -1
- package/7215.js +1 -1
- package/7638.js +1 -1
- package/7721.js +1 -1
- package/8387.js +1 -1
- package/8421.js +1 -1
- package/9123.js +1 -1
- package/9497.js +1 -1
- package/9551.js +1 -1
- package/9678.js +1 -1
- package/9819.js +1 -1
- package/package.json +1 -1
- package/remoteEntry.js +1 -1
- package/1083.js +0 -1
- package/4279.js +0 -1
- package/6976.js +0 -1
- package/7854.js +0 -1
- package/845.js +0 -1
package/6940.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6940],{16940:(e,t,n)=>{n.d(t,{_:()=>sa,t:()=>Ca});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(39450),d=n(60115),m=n(585),g=n(99493),f=n(87918),b=n.n(f),h=n(3096),y=n.n(h),v=n(87638),x=n(2804),E=n(7718),w=n(3515),C=n(17554),S=n(61756),P=n(57730),O=n(76536),N=n(26481),k=n(49759),Z=n(94150),T=n(26005),R=n(99136),j=n(21077),I=n(67268),D=n(71153),L=n.n(D),A=n(8962);const M=o().createContext(null);M.displayName="SingleAttributeContext";var U=n(60995),z=n(10237),V=n(58662),F=n(94079),H=n(93416),B=n(75512),W=n(30553),q=n(91181),G=n(32152),$=n(36444),_=n(79692);const Q=(0,_.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"}}))),X=e=>{let{className:t}=e;const n=Q(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(M),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:L()(n.triggerButton,t)},onClick:u},o().createElement($.Z,null)),o().createElement(F.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(F.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(F.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:b().text("Show inactive values")})))},Y=(0,_.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"}}))),K=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=Y(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(M);return o().createElement(H.Z,{title:b().text(t),className:l.root},o().createElement(B.Z,{widthToHide:500},o().createElement(W.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:l.totalCaption,variant:"caption"},b().number(n)," ",1===n?b().text("item"):b().text("items"))),o().createElement(q.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(G.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(X,null))};var J=n(65549),ee=n(93140),te=n(76134),ne=n(96698);const re=(0,_.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}))),oe=g.nIW,ae=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ae(n,t)})))):g.P6Y.strings.search(String(e),t),le=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(g.XtP,(0,i.filter)((e=>{let{value:t}=e;return ae(t,l)})))(t,n,r),c=(0,i.filter)(g.OXP,s);return{[(0,g.xy8)(r)]:{[oe(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function ie(){return ie=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},ie.apply(this,arguments)}function se(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}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 ue=[],pe=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s}=e;const c=re(),{uri:u,required:d,cardinality:m,name:f}=n,h=(0,a.useDispatch)(),y=(0,r.useContext)(p.m),x=(0,a.useSelector)(v.ZP.selectors.getEntity),E=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,x.uri)||{})),w=(0,a.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),C=(0,a.useSelector)((e=>(0,g.tQX)(l,n,v.ZP.selectors.getProfileErrors(e)))),S=(0,a.useSelector)(v.ZP.selectors.getMode),P=(0,g.xy8)(n),O=(0,i.pipe)((0,i.pathOr)(ue,[P,f]),(0,i.map)((0,i.prop)("uri")))(x),N=(0,i.pathOr)(ue,[P,f],E),k=N.map((0,i.prop)("uri")),Z=(0,g.ZiX)(x.uri),T=(0,r.useRef)((0,g.gjI)({parentUri:l,attributeType:n})),R=(0,g.O27)(N),j=d&&R,I=j?[T.current]:N.filter((0,i.pipe)((0,i.prop)("uri"),g.ZiX)),D=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,h)(e.map((e=>se({},e,{viewId:y}))))),[y,h]),A=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.modifyAttribute,h)(se({},e,{viewId:y}))),[y,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,h)(se({},e,{viewId:y}))),[y,h]),U=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,h),[h]),z=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return D(j&&!(0,g.YkM)(n.type)?[e,e]:[e])}),[D,l,n,j]),V=(0,g.Vg3)({attributeType:n,mode:S}),H={attributeType:n,errors:w,crosswalks:E.crosswalks,mode:S,onAddAttributes:D,onChangeAttribute:A,onDeactivateError:U,showNonOv:s};return o().createElement("div",null,o().createElement(ee.Z,{cardinality:m}),o().createElement(te.Z,{message:C}),V&&o().createElement(F.Button,{color:"primary",onClick:z,className:c.moreButton},o().createElement(J.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),I.map(((e,t)=>o().createElement(ne.Z,ie({key:e.uri},H,{attributeValue:e,lazy:j&&!d,showEmptyEditors:Z,ownError:(0,g.ADq)(e,t,u,w),onDeleteAttribute:M})))),I.length>0&&t.length>0&&o().createElement(F.Divider,{className:c.divider}),t.map((e=>{const t=N.find((0,i.propEq)("uri",e.uri)),n=t||e,r=O.includes(n.uri)&&!k.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,g.vKJ)({valueTransformer:(0,i.unless)(g.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:L()({[c.ovFalse]:!(0,g.OXP)(n)})},o().createElement(ne.Z,ie({},H,{attributeValue:n,ownError:(0,g.ADq)(n,null,u,w),onDeleteAttribute:M,state:l})))})))};var de=n(81303);const me=(0,_.Z)((e=>({ovFalse:e.inactive}))),ge=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=me();return o().createElement(o().Fragment,null,t.map((e=>o().createElement("div",{key:e.uri,className:L()({[a.ovFalse]:!(0,g.OXP)(e)})},o().createElement(de.Z,{attributeValue:e,attributeType:n,showNonOv:r})))))},fe=(0,_.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}}))),be=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=fe(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:y}=(0,r.useContext)(M),x=(0,a.useSelector)(v.ZP.selectors.getEntityUri),E=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(v.ZP.selectors.getPivotingAttributes),S=0!==u.length;return o().createElement(U.J.Provider,{value:C},o().createElement(z.Z,{className:L()(c.root,n)},o().createElement(K,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(F.Box,{className:c.content},(()=>{if(g)return o().createElement(R.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:y};return o().createElement(ge,e)}if(w){const e={values:u,attributeType:h,parentUri:x,showInactive:y};return o().createElement(pe,e)}}return o().createElement(F.Typography,{className:c.noData},b().text("No data"))})()),f&&o().createElement(V.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var he=n(67218),ye=n(20562);function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xe=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(v.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[m,f]=(0,r.useState)(!1),b=(0,he._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),x=(0,a.useSelector)(v.ZP.selectors.getApiPath),E=(0,a.useSelector)(v.ZP.selectors.getTenant),w=n?v.ZP.selectors.getEntityWithDiff:v.ZP.selectors.getEntityWithoutDiff,C=(0,a.useSelector)(w),S=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),P=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(v.ZP.selectors.getHistoryDiff),N=C.uri,k=oe(o),Z=(0,g.xy8)(o);h.current=(0,g.JQy)(C,N,k);const T=(0,r.useMemo)((()=>(0,g.zeJ)(s,o)),[s,o]),{globalFilter:R}=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:j}=t,I=(0,r.useCallback)((()=>{if(T&&(0,g.Uty)(T)&&!(0,g.ZiX)(N)&&(0,g.YOQ)(o)){f(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,g.biM)(C)||P?le:g.KbL;b(a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ve(e,t,n[t])}))}return e}({metadata:s,entity:C,apiPath:x,tenant:E,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:R,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([Z],e),n=(0,i.pathOr)([],[k],t);P||y(v.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:k,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",o],t))})).finally((()=>{f(!1)}))}else u([]),d(null)}),[x,N,E,o,l,s,t,R,T,P,O]);(0,r.useEffect)((()=>{I()}),[I]),(0,ye.D)((()=>{S&&I()}),[S]);const D=(0,i.partition)(g.OXP),[,L]=D(h.current||[]),A=j?[]:L,M=j?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),z=l<U,V=null!=p&&p.totalValues?p.totalValues-U:A.length;return{values:c,isLoading:m,hasPaging:z,totalVisibleValues:U,attributeType:T,totalNonVisibleValues:V,nonVisibleValues:A}};function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var we=n(37152),Ce=n(31274),Se=n(79026),Pe=n(8818),Oe=n(90324),Ne=n(70595);const ke=o().createContext(null);ke.displayName="RelationsViewStateContext";const Ze=(0,_.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"}}))),Te=e=>{let{className:t}=e;const n=Ze(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(ke),[m,f]=(0,r.useState)(!1),h=()=>f((e=>!e)),y=!(0,g.O27)(d),v="asc"===s;return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:L()(n.button,t)},onClick:h},o().createElement($.Z,null)),o().createElement(F.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(F.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(F.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:b().text("Show inactive Relationships")}),y&&o().createElement(o().Fragment,null,o().createElement(F.Divider,{className:n.divider}),o().createElement(F.Typography,{className:n.title,variant:"h6"},b().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Se.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Pe.k,{tooltipTitle:v?b().text("Ascending"):b().text("Descending"),icon:v?Oe.Z:Ne.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Te.displayName="FilterButton";const Re=Te,je=(0,_.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 Ie=n(61932),De=n(55847);const Le=o().createContext(null);function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Me(e,t,n[t])}))}return e}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=Math.pow(2,31)-1,ze=(0,_.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var Ve=n(81137);const Fe=e=>{let{label:t}=e;const n=ze();return o().createElement(F.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ie.Z,null))},He=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(v.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Le),i=(0,a.useSelector)(v.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(v.ZP.selectors.getDtssPath),m=(0,a.useSelector)(v.ZP.selectors.getTenant),f=[Ae({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Ue})],h=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,g.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,g.QXb)({entityUri:i,content:f,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ae({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),y=(0,r.useCallback)((()=>{(0,g.MOC)({entityUri:i,content:f,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),h()})).catch((e=>n(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong")))))),p(null)}),[i,d,m,o,h,l,u,p]);(0,r.useEffect)((()=>{h()}),[h]);const x=(0,r.useCallback)((()=>p(null)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:y,onCancelConfirmation:x,onImportClick:E}})(),s=ze(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(Pe.k,{size:"L",icon:Ie.Z,tooltipTitle:b().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:L()(s.tenant)},u)):o().createElement(De.Z,{menuId:"importDT-table-actions",buttonComponent:Pe.k,buttonProps:{tooltipTitle:b().text("Import connections"),size:"L",icon:()=>o().createElement(Fe,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Ve.Z,{open:!!t,title:b().text("Confirmation"),content:b().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:b().text("Cancel"),saveCaption:b().text("Import"),onDiscard:l,onSave:n})))},Be=e=>{let{title:t,total:n}=e;const a=je(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(ke);return o().createElement(H.Z,{title:t||"",className:a.header},n>0&&o().createElement(B.Z,{widthToHide:400},o().createElement(W.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:a.totalCaption,variant:"caption"},n>1?b().text("${count} items",{count:n}):b().text("${count} item",{count:n}))),o().createElement(G.i,{query:l,onChange:i}),o().createElement(He,null),o().createElement(Re,null))};var We=n(11013),qe=n(27604),Ge=n(22983),$e=n(31254),_e=n(31039);const Qe=(0,_.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 Xe(){return Xe=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},Xe.apply(this,arguments)}const Ye=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Qe(),u=(0,he._)(),p=(0,a.useSelector)(v.ZP.selectors.getTenant),d=(0,a.useSelector)(v.ZP.selectors.getDtssPath),[m,f]=(0,r.useState)(!1),[b,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(b)){const e=(0,i.ifElse)(g.biM,(e=>(0,g.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,g.XkT)(e.entityUri)));f(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{f(!1)}))}}),[d,n,p,u,b]),x=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(F.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),b&&o().createElement("div",{className:c.secondaryLabel},b));return o().createElement(F.Tooltip,Xe({onOpen:y,title:x,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},Ke=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,g.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,g.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,g.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,g.Lmx)(t,null==r?void 0:r.relationType)}};var Je=n(77277);const et=(0,_.Z)((()=>({container:{display:"flex"}})));function tt(){return tt=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},tt.apply(this,arguments)}const nt=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=et();return o().createElement("div",{className:a.container},o().createElement(Je.Z,tt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Accept")),o().createElement(Je.Z,tt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Ignore")))},rt=(0,_.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"}}))),ot=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=rt(),{entity:d,relation:m}=t,f=(0,g.$qe)(t),h=(0,g.xr3)(t),y=(0,g.iJH)(t),{entityType:v,entityLabel:x,preparedUri:E,relationLabel:w}=Ke(t,n),C=(0,g.Fn9)(m)&&(0,g.Fn9)(d),{canRemove:S,canUpdate:P}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===g.ARY.Editing||n===g.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,g.$qe)(r),i=(0,g.V3K)(t,e);return{canRemove:o&&!l&&(0,g.Edd)(n,i),canUpdate:a&&!l&&(0,g.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:g.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),O=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),k=(0,r.useCallback)((()=>{s(t)}),[s,t]),Z=(0,r.useCallback)((()=>c(t)),[c,t]),T=(S||P)&&a&&!t.suggested?o().createElement(o().Fragment,null,P&&o().createElement(Pe.k,{icon:qe.Z,size:"XS",onClick:N,tooltipTitle:b().text("Edit")}),S&&o().createElement(Pe.k,{icon:Ge.Z,size:"XS",onClick:O,tooltipTitle:b().text("Remove")})):void 0,R=t.suggested?o().createElement(nt,{acceptRelation:k,ignoreRelation:Z,size:"small",disabled:y}):void 0,j=y?b().text("ignored"):b().text("edited");return o().createElement("div",{className:L()(p.container,{[p.rowInactive]:!C},{[p.removed]:f||y})},o().createElement("div",{className:p.row},u&&u(),o().createElement($e.Z,{className:p.entityAvatar,entityType:v}),o().createElement(_e.Z,{value:E,className:p.entityLabelContainer},o().createElement(Ye,{label:x,entity:d},o().createElement("span",{className:p.entityLabel},x)),(h||y)&&o().createElement(F.Typography,{variant:"caption",className:p.editedLabel},"(",j,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},T),R))})),at=(e,t)=>{const n=(e,t)=>(t?(0,g.VGB)(t):[]).map((t=>({type:t,direction:e===g.Nsj.IN?g.Nsj.IN:g.Nsj.OUT})));return n(g.Nsj.IN,e).concat(n(g.Nsj.OUT,t))[0]};function lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var it=n(98989),st=n(83543);const ct=(0,_.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ut=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=ct(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,g.xvW)(n)?null:a?o().createElement(st.Z,c):o().createElement(it.Z,c)},pt=(0,_.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),dt=e=>{let{config:t,connection:n,children:l}=e;const i=pt(),{showInactive:s}=(0,r.useContext)(ke),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:f}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),[p,d]=(0,r.useState)(0),{contentSecondLevel:m}=t,{entity:f}=n,b=(0,a.useSelector)((e=>v.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,f.entityUri)))||[],{activityFilter:h}=(0,a.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){lt(e,t,n[t])}))}return e}({},m,{returnObjects:!0,returnDates:!0,activeness:{relation:o||g.Ng6.ALL,entity:h}});u(!0),(0,g.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,m,l,f.entityUri,h,o]),x=(0,r.useCallback)((()=>{i||n.connections||y(),s((e=>!e))}),[y,n.connections,i]);return{connections:b,showSecondLevel:i,toggleShowSecondLevel:x,loadRelations:y,loading:c,total:p}})({config:t,connection:n,relationActivityFilter:s?g.Ng6.ALL:g.Ng6.ACTIVE_ONLY}),b=(0,r.useMemo)((()=>(0,g.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(ut,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ce.X.Provider,{value:b},o().createElement("div",{className:i.secondLevelContent},o().createElement(Bt,{isLoading:m,config:t,loadRelations:d,connections:c,total:f,parentEntityUri:n.entity.entityUri}))))},mt=(0,_.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"}}))),gt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(v.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>v.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>v.ZP.selectors.getRelationsToEditByViewId(e,l.id))),f=(0,a.useSelector)(v.ZP.selectors.getEntity),h=(0,a.useSelector)((e=>v.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),y=(0,a.useDispatch)(),x=mt(),E=(0,r.useCallback)((()=>{const e=(0,g.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,g.ZiX)(r)&&y(v.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,y]),C=l.content,S=at(C.inRelations,C.outRelations),P=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(S.type),object:(0,i.evolve)({type:(0,i.always)(S.type),attributes:(0,i.always)(null)})}}))(e);y(v.N5.relations.actions.addRelation(l.id,t))}),[y,l,S]),O=(0,r.useCallback)((e=>{y(v.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[y,l,S]),[N,k]=(0,i.partition)(g.xvW,n),Z=f&&h,T=0===N.length&&0===k.length,R=e=>{var t,n;const r=m.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,g.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(dt,{config:l,connection:e,key:c},(t=>r?o().createElement(We.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(ot,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y),onAcceptRelation:P,onIgnoreRelation:O})))},j=Z&&(!d||d&&d.parentEntityUri===u),I=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},j&&o().createElement(F.Button,{color:"primary",onClick:E,className:x.moreButton},o().createElement(J.Z,{classes:{root:x.icon}}),o().createElement("div",{className:x.buttonLabel},b().text("Add"))),I&&o().createElement(We.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(F.Divider,{className:x.divider}),k.map(R),T&&o().createElement(F.Typography,{className:x.noData},c))};var ft=n(19603),bt=n(94646),ht=n(78101),yt=n(80931);const vt=(0,_.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function xt(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){Et(e,t,n[t])}))}return e}function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wt=e=>{let{connection:t,className:n}=e;const l=vt(),{relation:s}=t,c=(0,a.useSelector)(v.ZP.selectors.getEntityUri),u=(0,a.useSelector)(v.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,g.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>xt({attributes:xt({},v.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,g.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,g.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,g.O27)(t)})).length>0,f=(0,r.useMemo)((()=>(0,g.R$r)(d.attributes)),[d]),{getCommentsCount:h}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(f)&&h(f)}),[h,f]);const y=(0,r.useMemo)((()=>(0,g.wp9)(g.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(ht.A.Provider,{value:y},o().createElement(yt.Z,{className:L()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:L()(l.attributesList,n)},b().text("No attributes"))};var Ct=n(86602),St=n(82726);const Pt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Pe.k,{className:r,tooltipTitle:t?b().text("Hide attributes of the relationship"):b().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Ct.Z:St.Z,onClick:n})},Ot=(0,_.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"}}))),Nt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=Ot(),u=t.suggested,{entity:p,relation:d}=t,[m,f]=(0,r.useState)(!1),b=(0,a.useSelector)(v.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:x,relationLabel:E}=Ke(t,b),w=(0,g.Fn9)(d)&&(0,g.Fn9)(p),C=(0,a.useSelector)(v.ZP.selectors.getEntityUri),S=p&&d&&(0,g.wp9)(g.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:L()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:L()(c.row,ft.U)},n&&n(),o().createElement("div",{className:L()(c.labelWrapper,{[c.suggestedLabelWrapper]:u})},o().createElement($e.Z,{className:c.entityAvatar,entityType:h}),o().createElement(_e.Z,{value:x,className:c.entityLabelContainer},o().createElement(Ye,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),E&&o().createElement("span",{className:c.relationLabel},`, ${E}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(bt.Z,{className:c.commentsContainer,uri:null==d?void 0:d.relationUri,relatedObjectUris:S,objectType:g.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(nt,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Pt,{show:m,onToggle:()=>{f((e=>!e))},className:c.showDetails}))),m&&o().createElement(wt,{connection:t}))}));var kt=n(52691),Zt=n(16208);const Tt=e=>e.filter((e=>5===e.value)).length,Rt=e=>e.filter((e=>1===e.value)).length,jt=e=>0===e.length?"0%":Tt(e)/e.length*100+"%",It=e=>0===e.length?"0%":Rt(e)/e.length*100+"%",Dt=(0,_.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)"}}))),Lt=e=>{let{ratings:t,className:n}=e;const r=Dt();return o().createElement("div",{className:L()(r.wrapper,n)},o().createElement(F.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:jt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:It(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:L()(r.likesCount,r.count)},o().createElement(kt.Z,{className:r.icon}),Tt(t)),o().createElement("div",{className:r.count},o().createElement(Zt.Z,{className:r.icon}),Rt(t))))},At=(0,_.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}}))),Mt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=At(),i=(0,a.useSelector)(v.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:b().text("Has left the practice"),onClick:()=>r(b().text("Has left the practice"))},{text:b().text("Has moved away"),onClick:()=>r(b().text("Has moved away"))},{text:b().text("Has passed away"),onClick:()=>r(b().text("Has passed away"))},{text:b().text("Has retired"),onClick:()=>r(b().text("Has retired"))},{text:b().text("Other"),onClick:()=>r(b().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(F.Button,{onClick:n,variant:"text",size:"small",className:L()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(De.Z,{buttonProps:{endIcon:o().createElement(st.Z,null),variant:"text",size:"small",className:L()(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"}))},Ut=(0,_.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"}}))),zt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Ut(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:f,relation:b}=t,h=(0,a.useSelector)(v.ZP.selectors.getMetadata),{entityLabel:y,entityType:x,preparedUri:E,relationLabel:w}=Ke(t,h),C=(null==b?void 0:b.ratings)||[],S=(0,a.useSelector)(v.ZP.selectors.getEntityUri),P=f&&b&&(0,g.wp9)(g.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:L()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(F.Box,{display:"flex",minHeight:"62px",className:ft.U},o().createElement(F.Box,{display:"flex",alignItems:"flex-start"},o().createElement(F.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement($e.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(F.Box,{display:"flex",flexDirection:"column"},o().createElement(_e.Z,{value:E,className:u.entityLabelContainer},o().createElement(Ye,{label:y,entity:f},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Mt,{ratings:C,onAgree:()=>{(0,g.Buf)(null==b?void 0:b.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,g.Buf)(null==b?void 0:b.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(P)&&o().createElement(bt.Z,{className:u.commentsContainer,uri:null==b?void 0:b.relationUri,relatedObjectUris:P,objectType:g.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(nt,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Lt,{ratings:C,className:u.ratings}),o().createElement(Pt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(wt,{connection:t,className:u.relationAttributes}))},Vt=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=at(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,g.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===g.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,g.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,g.w3p)(n)),[n]),{getCommentsCount:f}=(0,r.useContext)(w.h);return(0,r.useEffect)((()=>{f(m)}),[f,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(dt,{config:i,connection:e,key:r},(t=>c?o().createElement(zt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Nt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Vt.displayName="RelationsList";const Ft=Vt,Ht=(0,_.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Bt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=Ht(),{selectors:u}=v.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||b().text("No data found");return t?o().createElement(R.Z,null):(0,g.KIu)(d)?o().createElement(gt,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(Ft,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(F.Typography,{className:c.noData},m)},Wt=(0,_.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}}),qt=e=>{let{config:t,className:n}=e;const l=Wt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:f,changeSearchQuery:b}=(0,r.useContext)(ke),{selectors:h}=v.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),x=(0,a.useSelector)(h.getEntity),E=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),C=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{b("")}),[null==x?void 0:x.uri]);const S=(0,r.useMemo)((()=>(e=>{const t=g.wSh.fromFalsy(e).map(g.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new g.MEy).addClause(t).build()})(f)),[f]),{isLoading:P,reload:O}=(0,we.a)({sorting:C,filter:S,page:s,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?g.Ng6.ALL:g.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,g.Px$)(y)),[y]),k=(0,r.useMemo)((()=>({reloadRelations:O,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[O,t]);return o().createElement(Ce.X.Provider,{value:N},o().createElement(z.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Le.Provider,{value:k},o().createElement(Be,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Bt,{isLoading:P,config:t,loadRelations:O,connections:y,total:E}),E>u&&o().createElement(V.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};qt.displayName="RelationsView";const Gt=o().createContext(null);Gt.displayName="SingleAttributeContext";var $t=n(86361),_t=n(26180),Qt=n(31276);function Xt(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){Yt(e,t,n[t])}))}return e}function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kt="CHANGE_SEARCH_QUERY",Jt=Xt({},_t.ZP.actions,{changeSearchQuery:(0,Qt.zD)(Kt)}),en=(e,t)=>t.type===Kt?Xt({},e,{searchQuery:t.payload,page:0}):_t.ZP.reducer(e,t);var tn=n(92332),nn=n(67353);const rn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},on=(0,_.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":rn}}))),an=(0,nn.Z)((e=>{const t=on();return o().createElement("div",{className:t.headCell},o().createElement(tn.default,e))}));var ln=n(64091);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}const cn=(0,i.pipe)((0,i.map)((e=>({id:(0,g.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,g.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),un=(0,i.pipe)(g.DK$,cn),pn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),dn=e=>{if((0,g.vZp)(e)){const t=pn(e);return t.length>1?t.slice(0,-1):null}return null},mn=(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){sn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:dn(e.id),headCellRenderer:an,rowCellValueRenderer:ln.Z})));var gn=n(99341);function fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bn=n(52016),hn=n(1876),yn=n(60894);const vn=(0,_.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),xn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=vn();return o().createElement(H.Z,{title:t,className:u.header},o().createElement(G.i,{query:n,onChange:r}),o().createElement(hn.Z,{enabled:a,onClick:l}),o().createElement(W.Z,{height:24,margin:4}),o().createElement(yn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function En(){return En=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},En.apply(this,arguments)}const wn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=on();return o().createElement("div",{className:L()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,En({key:t,value:e},l)))))}));var Cn=n(85709);const Sn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Pe.k,{tooltipTitle:b().text("Edit"),icon:qe.Z,size:"L",onClick:t}),n&&o().createElement(Pe.k,{tooltipTitle:b().text("Remove"),icon:Ge.Z,size:"L",onClick:n}))};function Pn(){return Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}const On=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:f}=e;const b=(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,g.tT_)(e))(t))(pn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>mn(t)),[t]),y=on(),x=(0,a.useSelector)(v.ZP.selectors.getMode),E=(0,g.KIu)(x),w=(0,a.useSelector)(v.ZP.selectors.getMetadata),C=(0,a.useSelector)(v.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:P}=(0,r.useContext)(Gt),O=(0,r.useCallback)((e=>o().createElement(wn,Pn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,bn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||f.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,f,n,E]),j="number"==typeof N&&(I=(0,i.path)([N],n),T(p)&&(0,g.xv5)({attributeType:P,mode:x,attributeValue:I,metadata:w,isReltioCrosswalk:(0,g.KVV)(S.crosswalks,I)}));var I;const D="number"==typeof N&&(e=>Z(p)&&(0,g.yv0)({attributeType:P,mode:x,attributeValue:e,isReltioCrosswalk:(0,g.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);D&&d(e)}),[d,N,n,D]),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:P,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,P,C]),M=R||!j&&!D?void 0:o().createElement(Sn,{onEdit:D?L:void 0,onRemove:j?A:void 0}),U=(0,r.useMemo)((()=>({deletedUris:f})),[f]);return o().createElement("div",{className:y.tableContainer},o().createElement(Cn.Z,{columnsData:h,rowsData:b,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:O,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Nn=(0,_.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 kn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const d=Nn(),m=(0,a.useSelector)(v.ZP.selectors.getEntityUri),{attributeType:f}=(0,r.useContext)(Gt),h=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,m)||{})),y=(0,a.useSelector)(v.ZP.selectors.getMode),x=(0,a.useDispatch)(),E=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,x)(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){kn(e,t,n[t])}))}return e}({},e,{viewId:E}))))),[E,x]),C=(0,g.ZiX)(m),S=(0,a.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,m,f))),P=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,x),[x]);return o().createElement(o().Fragment,null,o().createElement(ne.Z,{attributeValue:u,showEmptyEditors:C,onDeleteAttribute:s,onDeactivateError:P,onChangeAttribute:t,onAddAttributes:w,mode:y,crosswalks:h.crosswalks,errors:S,attributeType:f,ownError:(0,g.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:d.actionButtons},o().createElement(F.Button,{onClick:()=>{n(u)}},b().text("Cancel")),o().createElement(F.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},b().text("Apply"))))},Tn=(0,_.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 Rn(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){jn(e,t,n[t])}))}return e}function jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const In=[],Dn=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=Tn(),{values:u,page:d,setPage:m,isLoading:f,searchQuery:h,setSearchQuery:y,visibleColumns:x,onFilter:E,onSort:w,onToggleFilters:C,onChangeColumns:S,filters:P,sorting:O,totalVisibleValues:N,hasPaging:k,attributeType:Z,showTable:T}=(0,r.useContext)(Gt),j=(0,r.useMemo)((()=>un(Z)),[Z]),{checkHasChanges:I,onChangeAttribute:D,onDeleteAttribute:A,onAdd:M,onCancel:U,onApply:B,onStartEditing:W,modifiedValues:q,editingValues:G,deletedUris:$}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(v.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:d}=(0,r.useContext)(Gt),m=(0,a.useSelector)(v.ZP.selectors.getEntityUri),f=(0,a.useSelector)(v.ZP.selectors.getMetadata),b=(0,r.useCallback)((e=>{(0,i.pipe)(v.N5.actions.modifyAttribute,s)(Rn({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(Rn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,g.gjI)({parentUri:m,attributeType:u});t(e.uri),b(Rn({},e,{value:(0,g.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:f}),attributeType:u}))}),[m,u]),x=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),E=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Rn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),b(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,b,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),C=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,m)||{})),S=(0,g.KIu)(l),P=(0,g.xy8)(u),O=(0,i.pathOr)(In,[P,null==u?void 0:u.name],C),N=(0,r.useMemo)((()=>[...O.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(g.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]),k=(0,r.useMemo)((()=>S?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!O.find((0,i.propEq)("uri",e)))))(d):[]),[O,d]),Z=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:b,onDeleteAttribute:h,onAdd:y,onCancel:E,onApply:w,onStartEditing:x,modifiedValues:N,editingValues:Z,deletedUris:k}})(),_=(0,a.useSelector)(v.ZP.selectors.getMode),Q=(0,g.KIu)(_),X=Q?q:u,{canCreate:Y}=(0,bn.l)(),K=Y(t)&&Z&&(0,g.Vg3)({attributeType:Z,mode:_})&&!G.length,ee=(0,r.useMemo)((()=>x.map((e=>j.find((0,i.propEq)("id",e))))),[x,j]);return o().createElement(z.Z,{className:L()(c.root,n)},T?o().createElement(o().Fragment,null,o().createElement(xn,{title:l,total:N,columnsData:j,selectedColumns:x,onChangeColumns:S,searchQuery:h,onChangeSearchQuery:y,filtersEnabled:!!P,onToggleFilters:C}),o().createElement("div",{style:{position:"relative"}},Q&&o().createElement("div",{className:c.editor},K&&o().createElement(F.Button,{color:"primary",onClick:M,className:c.addButton},o().createElement(J.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),G.map((e=>o().createElement(Zn,{key:e.uri,attributeValue:e,onChangeAttribute:D,onDeleteAttribute:A,onCancel:U,onApply:B,hasChanges:I(e)})))),o().createElement(On,{columnsData:ee,config:t,values:X,filters:P,onFilter:E,sorting:O,onSort:w,onEdit:W,onDeleteAttribute:A,deletedUris:$}),k&&o().createElement(V.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:d,onChangePage:m}),f&&o().createElement(R.Z,null))):o().createElement(o().Fragment,null,o().createElement(H.Z,{title:l,className:c.header}),o().createElement(F.Typography,{className:c.noData},b().text("No data"))))};var Ln=n(58600);let An=0;const Mn=()=>An++,Un=e=>{const t={children:[],nodeId:Mn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Mn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},zn=(0,_.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 Vn=n(1242);const Fn=o().createContext(null);var Hn=n(55400);const Bn=e=>{e.target.src=Vn},Wn=e=>{let{node:t}=e;const n=zn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(v.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,r.useContext)(Fn),p=(0,a.useSelector)(v.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(v.ZP.selectors.getEntity),m=(0,g.ChB)({uiPath:p,uri:i}),f=i===d,b=(0,r.useCallback)((()=>{l(v.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,x=(0,g.nt9)(c,t.entity.type)||{},E=(0,g.VD3)(c,x,"typeGraphIcon"),w=E&&(0,g.vPL)(s,E);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(F.Avatar,{className:L()(n.avatar),src:w||Vn,onError:Bn}),o().createElement("span",{className:L()(n.link,{[n.selected]:f})},o().createElement(Hn.Z,{to:m,onClick:b},h))))},qn=((0,r.memo)(Wn),e=>{let{node:t}=e;return t.nodeId}),Gn=(0,_.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 $n(){return $n=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},$n.apply(this,arguments)}function _n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qn(){return Qn=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},Qn.apply(this,arguments)}const Xn={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Gn();return o().createElement("div",Qn({style:{height:"100%"}},p,{key:a.nodeId}),m&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},m&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:L()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Gn(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){_n(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",$n({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function Yn(){return Yn=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},Yn.apply(this,arguments)}const Kn=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Yn({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},Jn=e=>{let{title:t,onGraphOpen:n}=e;const r=zn();return o().createElement(H.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Pe.k,{className:r.button,tooltipTitle:b().text("Show Graph"),icon:Kn,onClick:n,size:"L"})))};var er=n(33165),tr=n(59601);const nr=(0,_.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function rr(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){or(e,t,n[t])}))}return e}function or(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ar=n(14940);const lr=(0,_.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)"}}),ir=e=>{const t=t=>{const n=lr();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:L()("viewDraggableHandle",n.resizableHandle)},o().createElement(ar.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},sr=(0,_.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var cr=n(29103),ur=n(83911),pr=n(79485),dr=n(22385);const mr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),gr=(0,_.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var fr=n(13074),br=n(24338);const hr=(0,_.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),yr=hr,vr=e=>{let{totalImages:t}=e;const n=yr(),r=t>1?b().text("photos"):b().text("photo");return o().createElement(F.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function xr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Er(e,t,n[t])}))}return e}function Er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(v.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(br.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(xr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(v.N5.actions.modifyAttribute,s)(xr({},e,{viewId:d})),imageSize:Pr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(vr,{totalImages:p.length}))},Cr=(0,_.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Sr=Cr,Pr={imageMargin:4,imageWidth:162,imageHeight:162};var Or=n(28741);const Nr=(0,_.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 kr=n(49734),Zr=n(98808),Tr=n(93428),Rr=n(30885);function jr(){return jr=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},jr.apply(this,arguments)}const Ir=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,a.useSelector)(v.ZP.selectors.getEntity),{canMerge:d,canMark:m}=(0,g.hXd)(c,t,n.object,u,n.matchRules),f=(0,r.useMemo)((()=>[n.object]),[n.object]),b={entity:u,entities:f,mode:Zr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(v.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,d&&o().createElement(Tr.H,jr({},b,{onFinishRequest:y})),m&&o().createElement(Rr.i,jr({},b,{onFinishRequest:i})))},Dr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(v.ZP.selectors.getMetadata),c=(0,a.useSelector)(v.ZP.selectors.getEntity);return o().createElement(kr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:ft.U},o().createElement(bt.Z,{uri:(0,g.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,g.wp9)(g.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:g.q7e.POTENTIAL_MATCH}),o().createElement(Ir,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Lr={showTransitiveMatches:!0,showInactiveEntities:!1},Ar={order:"asc",field:"score"};var Mr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Mr||(Mr={}));const Ur=ir((e=>{let{className:t}=e;const n=sr();return o().createElement(z.Z,{className:L()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),zr=ir((e=>{let{className:t,config:n}=e;return o().createElement(A.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Vr=ir((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=xe(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ee(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(M.Provider,{value:a},o().createElement(be,{config:n,className:t}))})),Fr=ir((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(v.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,g.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>un(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),g.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(en,c),{searchQuery:d,filters:m,sorting:f,page:b}=u,h=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>g.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,gn.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:b,sorting:f,searchQuery:d})),[y,b,f,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:P,changeColumns:O}=(0,$t.o)({actions:Jt,dispatch:p}),N=xe(e,x,!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){fn(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:C,onFilter:S,onToggleFilters:P,onChangeColumns:O,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden)},N)})(t);return o().createElement(Gt.Provider,{value:l},t&&o().createElement(Dn,{config:t,className:n}))})),Hr=ir((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=e.max||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[p,d]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(ke.Provider,{value:a},o().createElement(qt,{config:t,className:n}))})),Br=ir((e=>{let{config:t,className:n}=e;const a=(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:b,message:h}=(0,er.E)(t),y=nr(),v=g||p;if((0,r.useEffect)((()=>{a.current&&d&&(a.current.innerHTML="",d.childNodes.forEach((e=>{a.current.appendChild(e)})),s(a.current))}),[d]),!m)return null;const x=(0,i.reject)(i.isNil,{width:u,height:c}),E=o().createElement("div",{ref:a,style:rr({},x,f),className:L()(y.root,n)});return o().createElement("div",{className:y.bodyWrapper},v?o().createElement(F.Tooltip,{title:v},E):E,o().createElement(tr.Z,{placement:"bottom",anchorEl:l,open:!!h,onClose:b},h))})),Wr=ir((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(v.ZP.selectors.getEntityUri),{treeData:i,setTreeData:s}=((e,t)=>{const n=(0,he._)(),[o,a]=(0,r.useState)([]);return(0,r.useEffect)((()=>((0,g.ZiX)(e)||n((0,g.RFJ)({uri:e,graphUri:t})).then(Un).then(a).catch((e=>{console.warn(e)})),()=>{a([])})),[e,t,n]),{treeData:o,setTreeData:a}})(l,t.graph.type),c=zn(),u=(0,a.useDispatch)(),{id:p,graph:d}=t,m=(0,r.useCallback)((()=>{u(v.ui.actions.openGraph({viewId:p,graphType:d.type}))}),[u,p,d]),f=(0,r.useCallback)((e=>({title:o().createElement(Wn,{node:e.node})})),[]);return o().createElement(z.Z,{className:n},o().createElement(Jn,{onGraphOpen:m,title:t.caption}),o().createElement(Fn.Provider,{value:t},o().createElement("div",{className:c.treeContainer},o().createElement("div",{className:c.tree},o().createElement(Ln.ZP,{isVirtualized:!1,treeData:i,canDrag:!1,theme:Xn,generateNodeProps:f,onChange:s,getNodeKey:qn})))))})),qr=ir((e=>{let{config:t,className:n}=e;const l=Nr(),s=(0,a.useSelector)(v.ZP.selectors.getEntity),c=null==s?void 0:s.uri,[u,d]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{d(!0)}),[]),f=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:h,entitiesMap:y,loadMatches:x,total:E}=(0,Or.s)({enabled:!!c,entity:s,options:Lr,filter:"",page:0,sorting:Ar,rowsPerPage:3,onStartLoading:m,onFinishLoading:f}),C=(0,r.useCallback)((()=>{x()}),[x]),S=(0,a.useDispatch)(),P=(0,r.useContext)(p.m),O=(0,r.useCallback)((()=>{S(v.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:P}))}),[S,P]),N=(0,r.useMemo)((()=>(0,g.NVY)(c,(0,i.map)(g.ev7,h))),[c,h]),{getCommentsCount:k}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{k(N)}),[k,N]);const Z=E>3&&!(0,i.isEmpty)(h),T=u?Mr.Loading:(0,i.isEmpty)(h)?Mr.NoData:Mr.Loaded;return o().createElement(Ce.X.Provider,{value:y},o().createElement(z.Z,{className:L()(l.root,n)},o().createElement(H.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},T===Mr.Loading&&o().createElement(R.Z,null),T===Mr.NoData&&o().createElement(F.Typography,{className:l.noData},b().text("No matches found")),T===Mr.Loaded&&h.map((e=>o().createElement(Dr,{config:t,entitiesMap:y,match:e,onFinishRequest:C,onStartRequest:m,key:e.object.uri})))),Z&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(F.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},b().text("See all"))))))})),Gr=(0,r.lazy)((()=>n.e(6596).then(n.bind(n,46596)).then((e=>({default:ir(e.HierarchyTreeView)}))))),$r=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:ir(e.RelationshipsTableView)}))))),_r=ir((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=gr(),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,a.useSelector)(v.ZP.selectors.getEntity),p=(0,a.useSelector)(v.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,he._)();return(0,r.useEffect)((()=>{i(!0),s((0,g.DBr)(t,[e],n)).then((e=>{a(e.filter(mr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),f=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(R.Z,null))),[s]),b=(0,r.useMemo)((()=>({lat:0,lng:0})),[]);return p&&o().createElement(z.Z,{className:L()(s.root,i)},m&&o().createElement(R.Z,null),o().createElement(dr.Z,{size:"S",icon:n?ur.Z:cr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(pr.Z,{loadingElement:f,defaultZoom:1,defaultCenter:b,markers:d,mapContainerClassName:s.fullHeight,mapKey:p}))})),Qr=ir((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Sr(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(v.ZP.selectors.getMode),p=(0,a.useSelector)(v.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(v.ZP.selectors.getMetadata),m=(0,g.zeJ)(d,l),f=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),h=(0,i.path)(["attributes","paging",l],p),y=f.length,x=t["text-empty"]||b().text("No data found"),E=(0,r.useCallback)((e=>c(v.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(z.Z,{className:n},o().createElement(H.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,g.KIu)(u)){const e={attributeType:m,config:t,paging:h,requestNextPageOfAttributeValues:E};return o().createElement(wr,e)}if(y>0){const e={attributeValues:f,attributeType:m,imageSize:Pr,paging:h,parentUri:p.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(fr.Z,e),o().createElement(vr,{totalImages:y}))}}return o().createElement(F.Typography,{className:s.noData},x)})()))}));class Xr{}Xr.ViewTypes=g.ZIY,Xr.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case Xr.ViewTypes.HierarchyTree:return o().createElement(Gr,{config:r,store:n,className:a});case Xr.ViewTypes.HierarchyPaths:return o().createElement(Wr,{config:r,className:a});case Xr.ViewTypes.RelationsTable:return o().createElement($r,{config:r,store:n,className:a});case Xr.ViewTypes.Relations:return o().createElement(Hr,{config:r,className:a});case Xr.ViewTypes.Attributes:return o().createElement(zr,{className:a,config:r});case Xr.ViewTypes.SingleAttributeView:return o().createElement(Vr,{config:r,className:a});case Xr.ViewTypes.TableAttributeView:return o().createElement(Fr,{config:r,className:a});case Xr.ViewTypes.MapView:return o().createElement(_r,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case Xr.ViewTypes.CustomView:return o().createElement(Br,{config:r,className:a});case Xr.ViewTypes.ImageAttributeView:return o().createElement(Qr,{config:r,className:a});case Xr.ViewTypes.PotentialMatchesView:return o().createElement(qr,{config:r,className:a})}},Xr.getComponent=e=>Xr.getComponentBy("class",e)||Xr.getComponentBy("react-class",e)||o().createElement(Ur,{className:e.className});const Yr=Xr,Kr=()=>null,Jr=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=sr();return o().createElement(r.Suspense,{fallback:o().createElement(Kr,null)},Yr.getComponent({config:t,store:n,className:L()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));Jr.displayName="ViewComponent";const eo=(0,_.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function to(){return to=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},to.apply(this,arguments)}const no=["onConfigChanged","onRemove"],ro=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,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const g=n.find((e=>{let{id:n}=e;return t.i===n})),f=eo(),{store:b}=(0,r.useContext)(a.ReactReduxContext);if(!g)return null;const h=g.class===Yr.ViewTypes.CustomView;return o().createElement("div",to({},(0,i.omit)(no,m),{style:c,className:L()(l,{[f.item]:!h})}),o().createElement("div",{className:L()({[f.fixedSizeContainer]:!d})},d,o().createElement(Jr,{store:b,config:g,isFullscreen:u,onToggleFullscreen:p,isAutosize:Boolean(d)})),s)},oo=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(I.Z,{LayoutItem:ro,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var ao=n(57304),lo=n(3409),io=n(93873),so=n(22860),co=n(72753),uo=n(43576);function po(){return po=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},po.apply(this,arguments)}const mo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",po({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))},go=(0,_.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"}}),fo=e=>o().createElement(F.SvgIcon,e,o().createElement(mo,null)),bo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,g.KIu)(a))&&!!(r&&o||!(0,g.fnZ)(a))&&(0,g.uGe)(l,t)})),ho=e=>{let{className:t}=e;const n=go(),l=(0,a.useDispatch)(),i=(0,a.useSelector)(v.ZP.selectors.getCanUserStartProcessFromQuery),s=(0,a.useSelector)(v.ZP.selectors.getEntityWithoutDiff),c=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s.uri))),u=(0,a.useSelector)(v.ZP.selectors.getMetadata),p=(0,a.useSelector)(v.ZP.selectors.isWorkflowEnabled),d=(0,a.useSelector)(v.ZP.selectors.getMode),m=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),f=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),h=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),y=(0,a.useSelector)(v.ZP.selectors.getProfileOperation)===g.OXy.Saving,x=null==s?void 0:s.type,E=(0,r.useMemo)((()=>[{label:b().text("Editing"),value:g.fO_.EDITING,description:b().text("Edit profile directly"),icon:uo.Z,permission:"UPDATE"},{label:b().text("Suggesting"),value:g.fO_.SUGGESTING,description:b().text("Suggest changes and initiate a workflow review"),icon:fo,permission:"INITIATE_CHANGE_REQUEST"},{label:b().text("Viewing"),value:g.fO_.VIEWING,description:b().text("Suggest changes and initiate a workflow review"),icon:co.Z,permission:"READ"}]),[]),w=(0,r.useMemo)((()=>[{label:b().text("Delete"),value:"Delete",description:b().text("Permanently delete profile"),icon:Ge.Z,onClick:()=>{window.confirm(b().text("Are you sure you want to delete this?"))&&l(v.N5.entity.actions.entityRemoveRequested({entityUri:s.uri}))},permission:"DELETE"}]),[l,s.uri]),C=(0,r.useMemo)((()=>(0,g.nt9)(u,x)||{}),[u,x]),S=!h&&!(0,g.biM)(s)&&!(e=>(0,g.uGe)(g.BDP.READ,e)&&!(0,g.uGe)(g.BDP.UPDATE,e)&&!(0,g.uGe)(g.BDP.DELETE,e)&&!(0,g.uGe)(g.BDP.INITIATE_CHANGE_REQUEST,e))(C),P=(0,g.ZiX)(null==s?void 0:s.uri),O=(0,r.useMemo)((()=>bo(E,C,P,p,i)),[E,C,p,i,P]),N=(0,r.useMemo)((()=>bo(w,C,P,p,i)),[w,C,p,i,P]),k=(0,r.useCallback)((e=>{l(v.N5.mode.actions.modeUpdated(e))}),[l]),Z=(0,r.useCallback)((()=>{l(v.N5.mode.actions.modeCancelEditing())}),[l]),T=(0,r.useCallback)((()=>{l(v.N5.actions.saveProfile())}),[l]);return o().createElement(ao.Z,{className:L()(t,ft.U),entity:m&&c?c:s},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{mr:3},m&&o().createElement(F.Box,{className:n.editingButtons},o().createElement(F.Button,{variant:"outlined",onClick:Z,"data-reltio-id":"reltio-profile-cancel-editing",disabled:y},b().text("Cancel")),o().createElement(F.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:T,disabled:y},(0,g.fnZ)(d)?b().text("Suggest"):b().text("Save"))),h&&f?o().createElement(lo.Z,null):f&&o().createElement(io.a,null)),S&&o().createElement(so.T,{optionsGroup:O,buttonsGroup:N,value:d,onChange:k,disabled:y})),o().createElement(F.Box,{className:n.comments},o().createElement(bt.Z,{uri:s.uri,relatedObjectUris:(0,g.wp9)(g.q7e.ENTITY,{entityUri:s.uri}),objectType:g.q7e.ENTITY})))};var yo=n(71820),vo=n(85890),xo=n(26789),Eo=n(54362),wo=n(6674),Co=n(91515),So=n(52043),Po=n(17308),Oo=n(39827),No=n(80147),ko=n(76569);const Zo=(0,_.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),To=()=>{const{total:e}=(0,r.useContext)(Z.O),t=Zo();return o().createElement(F.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(ko.Z,null))};var Ro=n(9371),jo=n(4426);const Io=(0,_.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Do=()=>{const e=Io(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,a.useSelector)(v.ZP.selectors.getEntityUri);return(0,r.useEffect)((()=>{t(i)}),[t,i]),o().createElement(F.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Ro.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(F.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(jo.Z,{className:e.showMoreIcon}),b().text("Show more")))};var Lo=n(34120);const Ao=(0,_.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Mo=()=>{const e=Ao(),{tasks:t,loading:n}=(0,r.useContext)(Z.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(R.Z,null),t&&t.map((e=>o().createElement(Lo.s,{key:e.taskId,task:e}))))};function Uo(){return Uo=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},Uo.apply(this,arguments)}const zo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Uo({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},Vo=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=Zo();return o().createElement(F.Badge,{badgeContent:(0,g.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(zo,null))};var Fo=n(10159);const Ho=()=>o().createElement(Fo.Z,{text:b().text("Ready to go with the flow?"),secondaryText:b().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),Bo=()=>o().createElement(Fo.Z,{text:b().text("Care to join the conversation?"),secondaryText:b().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function Wo(){return Wo=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},Wo.apply(this,arguments)}let qo;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(qo||(qo={}));const Go=e=>{if(e)return 1===e?b().text("${total} item",{total:e}):b().text("${total} items",{total:e})},$o=()=>{var e,t,n;const l=Zo(),s=(0,a.useSelector)(v.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(v.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(v.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(v.ZP.selectors.isCollaborationEnabled),d=(0,a.useSelector)(v.ZP.selectors.getHistoryEvent),m=(0,a.useSelector)(v.ZP.selectors.getMetadata),f=(0,a.useSelector)(v.ZP.selectors.getEntity),h=(0,r.useContext)(Z.O),y=(0,r.useContext)(w.h),[x,E]=(0,r.useState)(null),C=(0,r.useCallback)((e=>{E((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{E(null)}),[]),P=null!==x,O=x===qo.History,{isHistoryEnabled:N,isProfilePersisted:k}=(0,yo.C)({isHistoryTabActive:O,entity:f}),{historyFilter:T,onApplyFilter:R,onClearFilter:j,isLoading:I,historicUris:D,historyWithTotal:L,canLoadMore:A,onLoadMore:M}=(0,vo.k)({entity:f,enabled:N}),U=s&&c&&!(0,g.ZiX)(null==f?void 0:f.uri),z=u&&p,V=(0,g.mdt)(null==y?void 0:y.commentsMap),F=[{buttonProps:{id:qo.Workflow,icon:To,tooltipTitle:b().text("Workflow")},content:null!=h&&h.total?o().createElement(Mo,null):o().createElement(Ho,null),headerProps:{mainTitle:b().text("Workflow"),secondTitle:Go(null==h?void 0:h.total),rightContent:o().createElement(xo.G,null)},hidden:!U},{buttonProps:{id:qo.Collaboration,icon:Vo,tooltipTitle:b().text("Collaboration")},content:V?o().createElement(Do,null):o().createElement(Bo,null),headerProps:{mainTitle:b().text("Collaboration"),secondTitle:Go(V)},hidden:!z},{buttonProps:{id:qo.History,icon:No.Z,tooltipTitle:b().text("History")},content:k?o().createElement(Eo.Z,{isLoading:I,historyWithTotal:L,contributorsUris:D,entityUri:null==f?void 0:f.uri,historyEvent:d,onLoadMore:M,canLoadMore:A}):o().createElement(wo.Z,null),headerProps:{content:o().createElement(Co.Z,{total:k?((null==D?void 0:D.length)||0)+1:void 0,entityType:(0,g.nt9)(m,null==f?void 0:f.type),filter:T,onApplyFilter:R,onClearFilter:j})}}],H=(0,i.reject)((0,i.propEq)("hidden",!0))(F);return(0,r.useEffect)((()=>{var e;null!==(e=F[x])&&void 0!==e&&e.hidden&&S()}),[x,F,S,H]),o().createElement("div",{className:l.wrapper},o().createElement(So.h,{open:P,width:480},!(null!==(e=F[x])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(Po.P,Wo({},null===(t=F[x])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=F[x])||void 0===n?void 0:n.content)),o().createElement(Oo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(F),onButtonClick:C,activeIndexId:x}))};var _o=n(39781),Qo=n(16715);const Xo="48px",Yo="1px solid rgba(0, 0, 0, .125)",Ko=(0,_.Z)((e=>({accordion:{borderTop:Yo,borderBottom:Yo,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Xo,minHeight:Xo,"&$accordionSummaryExpanded":{height:Xo,minHeight:Xo}},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"}}))),Jo=Ko;var ea=n(38016);const ta=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Jo();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(F.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(F.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(ea.Z,null)},i,o().createElement(F.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(F.AccordionDetails,{className:L()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));ta.displayName="ErrorsPanel";const na=(0,i.omit)(["deactivated","path"]),ra=(0,r.memo)((e=>{let{error:t}=e;const n=Jo(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===g.NIO.missed&&r===g.zHr.local){const t=l||(0,g.zeJ)(e,a);return t?b().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.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[g.HAc.attributeValue,g.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));ra.displayName="Error";const oa=()=>{const e=Jo(),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(na),t.map(na))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(v.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(g.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:b().text("${number} ${errors}",{number:n.length,errors:1===n.length?b().text("error"):b().text("errors")}),icon:o().createElement(_o.Z,{className:L()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:b().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?b().text("warning"):b().text("warnings")}),icon:o().createElement(Qo.Z,{className:L()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(ta,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ra}):null},aa=(0,_.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"}}))),la=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=aa({maxWidth:null==t?void 0:t.maxWidth}),s=(0,a.useDispatch)(),c=(0,r.useRef)(),u=(0,r.useCallback)((0,g.DsO)(n,5e3),[n]),{isLoaded:p,savedState:d}=(0,x.a)(l),[m,f]=(0,r.useState)([]),[h,I]=(0,r.useState)([]),D=(0,r.useMemo)((()=>y()(t)),[t]),L=(0,a.useSelector)(v.ZP.selectors.getEntity),A=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),M=(0,r.useMemo)((()=>(0,g.dvH)(L)),[L]),U=(0,E.C)({objectIds:M}),z=(0,r.useContext)(w.h),V=(0,C.U)(),F=(0,S.v)(null==t?void 0:t.workflow),H=(0,a.useSelector)(v.ZP.selectors.getHistoryEvent);(0,P.a)({entity:L,historyEvent:H});const B=(0,O.u)();(0,r.useEffect)((()=>{if(p){const e=D!==d.configHash,{views:n,layout:r}=(0,g.Mfk)({views:e||!d.views?t.views:d.views,layout:e?t.layout:d.layout});I(n),f(r)}}),[p]),(0,r.useEffect)((()=>{s(v.N5.views.actions.profileViewsSet(h))}),[s,h]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[null==L?void 0:L.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(v.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(v.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,g.biM)(n),s=(0,a.useSelector)(v.ZP.selectors.getMode),c=(0,a.useSelector)(v.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,g.DsO)((t=>{t&&e(v.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,g.ZiX)(o)&&s===g.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const W=(0,r.useCallback)((e=>{u({layout:e,views:h,configHash:D}),f(e)}),[u,D,h]);return o().createElement(N.j.Provider,{value:!0},o().createElement(k.s.Provider,{value:V},o().createElement(w.h.Provider,{value:A?z:U},o().createElement(Z.O.Provider,{value:F},o().createElement(T.m.Provider,{value:B},o().createElement("div",{className:i.perspectiveView},(!p||!(null!=L&&L.uri))&&o().createElement(R.Z,null),p&&null!=L&&L.uri?o().createElement("div",{className:i.profileContainer},o().createElement("div",{className:i.profileWrapper},o().createElement(ho,null),!A&&o().createElement(oa,null),o().createElement("div",{ref:c,className:i.scrollWrapper},o().createElement(oo,{layout:m,onLayoutChanged:W,views:h}))),o().createElement($o,null)):o().createElement("div",{className:i.emptyState},o().createElement(j.ZP,{LogoRenderer:j.B9.NO_DATA,text:b().text("No data to display."),variant:j.tC.embedded}))))))))}));la.displayName="ProfilePerspectiveView";const ia=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),sa=e=>{let{config:t,store:n,onResize:f=i.identity,saveState:b,getSavedState:h,qxSandboxApi:y}=e;const v=(0,r.useCallback)((0,g.aYu)(h),[h]),x=(0,r.useMemo)((()=>(0,g.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(p.m.Provider,{value:x.id},o().createElement(d.Y.Provider,{value:y},o().createElement(s.StylesProvider,{generateClassName:ia},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>f(Math.floor(e),Math.floor(t))}),x&&o().createElement(la,{config:x,saveState:b,getSavedState:v}),o().createElement(m.Z,{showErrorFromStore:!0}))))))};var ca=n(82842),ua=n(51229),pa=n(91131);const da=(0,_.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}}))),ma=e=>{let{total:t=0}=e;const n=da(),l=(0,a.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(v.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(H.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(F.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},b().text("Profile")),o().createElement(pa.Z,{className:n.icon}),b().text("Tags")),o().createElement(ua.Z,null),o().createElement(F.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},b().number(t,"0,0")),b().text("total profiles")))};var ga=n(20404);const fa=(0,_.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"}}))),ba=e=>{let{label:t}=e;const n=fa();return o().createElement(F.Toolbar,{className:n.toolbar},o().createElement(ga.Z,{className:n.avatar}),o().createElement(F.Typography,{variant:"h6",className:n.label},t))};function ha(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){ya(e,t,n[t])}))}return e}function ya(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const va=(0,_.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}}))),xa=[25,50,100],Ea=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=va(),[s,c]=(0,r.useState)(xa[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:f,entities:h}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,he._)(),u=(0,he._)(),[p,d]=(0,r.useState)(!1),[m,f]=(0,r.useState)(0),[h,y]=(0,r.useState)([]),{requestEntities:x,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(v.ZP.selectors.getTenant),s=(0,a.useSelector)(v.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,g.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=ha({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,g.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,g.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,ha({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,g.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,g.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong")))),f(0)}),[s]);return(0,r.useEffect)((()=>{c(E()).then(f).catch(w)}),[E,c,w]),(0,r.useEffect)((()=>{d(!0),u(x(l,o*l)).then(y).catch(w).finally((()=>d(!1)))}),[o,l,x,u,w]),{isLoading:p,total:m,entities:h}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),y=(0,r.useRef)(null);(0,r.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[h]);const x=f>xa[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(ba,{label:t}),o().createElement("div",{className:L()(l.tagsContainer,{[l.fullHeight]:x})},o().createElement(z.Z,{className:l.tagsView},o().createElement(ma,{total:f}),o().createElement("div",{className:l.listContainer},m&&o().createElement(R.Z,null),f>0&&o().createElement("div",{className:l.entitiesList,ref:y},o().createElement(ca.Z,{entities:h})),x&&o().createElement("div",{className:l.pagination},o().createElement(V.Z,{count:f,rowsPerPageOptions:xa,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));Ea.displayName="TagPerspectiveView";const wa=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ca=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(p.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:wa},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Ea,{tag:n,entityUri:r}),o().createElement(m.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|