@reltio/remotes 1.4.1413 → 1.4.1415
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/3575.js +1 -1
- package/3575.js.map +1 -1
- package/461.js +1 -1
- package/461.js.map +1 -1
- package/4843.js +1 -1
- package/5706.js +1 -1
- package/5706.js.map +1 -1
- package/5937.js +1 -1
- package/5937.js.map +1 -1
- package/6103.js +1 -1
- package/6103.js.map +1 -1
- package/6138.js +1 -1
- package/6138.js.map +1 -1
- package/6617.js +1 -1
- package/6617.js.map +1 -1
- package/8183.js +1 -1
- package/8183.js.map +1 -1
- package/8225.js +1 -1
- package/8225.js.map +1 -1
- package/9258.js +1 -1
- package/9258.js.map +1 -1
- package/package.json +1 -1
package/6138.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6138],{6138:(e,t,n)=>{n.d(t,{vC:()=>gl,_n:()=>Wa,tM:()=>al});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),c=n(36138),s=n(44443),u=n(22664),p=n(24605),d=n(39450),m=n(97094),g=n(60115),f=n(585),b=n(57014),h=n(87918),y=n.n(h),v=n(3096),x=n.n(v),E=n(49885),w=n(60641),C=n(7718),S=n(3515),O=n(17554),P=n(57730),N=n(76536),k=n(26481),Z=n(49759),T=n(94150),R=n(26005),j=n(72249),D=n(47137),I=n(99136),L=n(30268),A=n(21077),M=n(67268),z=n(71153),F=n.n(z),V=n(8962);const U=o().createContext(null);U.displayName="SingleAttributeContext";var H=n(60995),B=n(10237),W=n(58662),q=n(94079),G=n(93416),_=n(75512),$=n(30553),Q=n(81149),X=n(32152),Y=n(36444),K=n(79692);const J=(0,K.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ee=e=>{let{className:t}=e;const n=J(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:c,toggleShowInactive:s}=(0,r.useContext)(U),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(q.Button,{ref:a,classes:{root:F()(n.triggerButton,t)},onClick:u},o().createElement(Y.Z,null)),o().createElement(q.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(q.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(q.Checkbox,{className:n.checkboxControlCheckbox,checked:c,onChange:e=>s(e.target.checked)}),label:y().text("Show inactive values")})))},te=(0,K.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),ne=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=te(),{searchQuery:i,setSearchQuery:c,setPage:s,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(U);return o().createElement(G.Z,{title:t,className:l.root},o().createElement(_.Z,{widthToHide:500},o().createElement($.Z,{height:24,margin:16}),o().createElement(q.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement(Q.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(X.i,{query:i,onChange:e=>{c(e),s(0)}}),a&&o().createElement(ee,null))};var re=n(65549),oe=n(93140),ae=n(76134),le=n(96698);const ie=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}}))),ce=b.nIW,se=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return se(n,t)})))):b.P6Y.strings.search(String(e),t),ue=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const c=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return se(t,l)})))(t,n,r),s=(0,i.filter)(b.OXP,c);return{[(0,b.xy8)(r)]:{[ce(r)]:s.slice(a,a+o),paging:{[r]:{totalOvValues:s.length,totalValues:c.length}}}}};function pe(){return pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){me(e,t,n[t])}))}return e}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ge=[],fe=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:c,noDataText:s}=e;const u=ie(),{uri:p,required:m,cardinality:g,name:f}=n,h=(0,a.useDispatch)(),v=(0,r.useContext)(d.m),x=(0,a.useSelector)(E.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,x.uri)||{})),C=(0,a.useSelector)((e=>E.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),S=(0,a.useSelector)((e=>(0,b.tQX)(l,n,E.ZP.selectors.getProfileErrors(e)))),O=(0,a.useSelector)(E.ZP.selectors.getMode),P=(0,b.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(ge,[P,f]),(0,i.map)((0,i.prop)("uri")))(x),k=(0,i.pathOr)(ge,[P,f],w),Z=k.map((0,i.prop)("uri")),T=(0,b.ZiX)(x.uri),R=(0,r.useRef)((0,b.gjI)({parentUri:l,attributeType:n})),j=(0,b.O27)(k),D=m&&j,I=D?[R.current]:k.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),L=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.addAttributes,h)(e.map((e=>de({},e,{viewId:v}))))),[v,h]),A=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.modifyAttribute,h)(de({},e,{viewId:v}))),[v,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.removeAttribute,h)(de({},e,{viewId:v}))),[v,h]),z=(0,r.useCallback)((0,i.pipe)(E.N5.errors.actions.errorDeactivated,h),[h]),V=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return L(D&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[L,l,n,D]),U=(0,b.Vg3)({attributeType:n,mode:O}),H={attributeType:n,errors:C,crosswalks:w.crosswalks,mode:O,onAddAttributes:L,onChangeAttribute:A,onDeactivateError:z,showNonOv:c},B=0===I.length&&0===t.length;return o().createElement("div",null,o().createElement(oe.Z,{cardinality:g}),o().createElement(ae.Z,{message:S}),U&&o().createElement(q.Button,{color:"primary",onClick:V,className:u.moreButton},o().createElement(re.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),I.map(((e,t)=>o().createElement(le.Z,pe({key:e.uri},H,{attributeValue:e,lazy:D&&!m,showEmptyEditors:T,ownError:(0,b.ADq)(e,t,p,C),onDeleteAttribute:M})))),I.length>0&&t.length>0&&o().createElement(q.Divider,{className:u.divider}),t.map((e=>{const t=k.find((0,i.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!Z.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,b.vKJ)({valueTransformer:(0,i.unless)(b.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:F()({[u.ovFalse]:!(0,b.OXP)(n)})},o().createElement(le.Z,pe({},H,{attributeValue:n,ownError:(0,b.ADq)(n,null,p,C),onDeleteAttribute:M,state:l})))})),B&&o().createElement(q.Typography,{className:u.noData},s))};var be=n(81303);const he=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},ye=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),ve=15,xe=e=>{let{config:t,className:n}=e;const{caption:l,max:i=ve,showInactiveValuesMenu:c}=t,s=ye(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:h}=(0,r.useContext)(U),v=(0,a.useSelector)(E.ZP.selectors.getEntityUri),x=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(E.ZP.selectors.getPivotingAttributes),S=0!==u.length,O=t["text-empty"]||y().text("No data found");return o().createElement(H.J.Provider,{value:C},o().createElement(B.Z,{className:F()(s.root,n)},o().createElement(ne,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:c}),o().createElement(q.Box,{className:s.content},(()=>{if(g)return o().createElement(I.Z,null);if(b){if(x&&S){const e={values:u,attributeType:b,showInactive:h};return o().createElement(he,e)}if(w){const e={values:u,attributeType:b,parentUri:v,showInactive:h,noDataText:O};return o().createElement(fe,e)}}return o().createElement(q.Typography,{className:s.noData},O)})()),f&&o().createElement(W.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:s.pagination}})))};var Ee=n(85229),we=n(20562);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 Se=(e,t)=>{const{attributeUri:n,max:o=15}=e,l=(0,a.useSelector)(E.ZP.selectors.getMetadata),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=(0,Ee._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),y=(0,a.useSelector)(E.ZP.selectors.getApiPath),v=(0,a.useSelector)(E.ZP.selectors.getTenant),x=(0,a.useSelector)(E.ZP.selectors.getEntityWithDiff),w=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),C=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),S=(0,a.useSelector)(E.ZP.selectors.getHistoryDiff),O=x.uri,P=ce(n),N=(0,b.xy8)(n);f.current=(0,b.JQy)(x,O,P);const k=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:Z}=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:T}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(O)&&(0,b.YOQ)(n)){m(!0);const{page:e,showInactive:r}=t,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),c=(0,b.biM)(x)||C?ue:b.KbL;g(c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ce(e,t,n[t])}))}return e}({metadata:l,entity:x,apiPath:y,tenant:v,parentUri:O,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:Z,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([N],e),r=(0,i.pathOr)([],[P],t);C||h(E.N5.actions.processNextPageOfAttributeValues({parentUri:O,attributeTypeUri:n,attributeTypeName:P,values:r})),s(r.map((e=>{var t;return(null===(t=f.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),p((0,i.path)(["paging",n],t))})).finally((()=>{m(!1)}))}else s([]),p(null)}),[y,O,v,n,o,l,t,Z,k,C,S]);(0,r.useEffect)((()=>{R()}),[R]),(0,we.D)((()=>{w&&R()}),[w]);const j=(0,i.partition)(b.OXP),[,D]=j(f.current||[]),I=T?[]:D,L=T?"totalValues":"totalOvValues",A=(0,i.ifElse)((0,i.has)(L),(0,i.prop)(L),(0,i.always)(c.length))(u),M=o<A,z=null!=u&&u.totalValues?u.totalValues-A:I.length;return{values:c,isLoading:d,hasPaging:M,totalVisibleValues:A,attributeType:k,totalNonVisibleValues:z,nonVisibleValues:I}};function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pe=n(37152),Ne=n(31274),ke=n(79026),Ze=n(8818),Te=n(90324),Re=n(70595);const je=o().createContext(null);je.displayName="RelationsViewStateContext";const De=(0,K.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Ie=e=>{let{className:t}=e;const n=De(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:s,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(je),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),v="asc"===c;return o().createElement(o().Fragment,null,o().createElement(q.Button,{ref:a,classes:{root:F()(n.button,t)},onClick:f},o().createElement(Y.Z,null)),o().createElement(q.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(q.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(q.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(q.Divider,{className:n.divider}),o().createElement(q.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(ke.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(Ze.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?Te.Z:Re.Z,onClick:s,className:n.sortOrderButton,size:"L"})))))};Ie.displayName="FilterButton";const Le=Ie,Ae=(0,K.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var Me=n(61932),ze=n(55847);const Fe=o().createContext(null);function Ve(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){Ue(e,t,n[t])}))}return e}function Ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const He=Math.pow(2,31)-1,Be=(0,K.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var We=n(81137);const qe=e=>{let{label:t}=e;const n=Be();return o().createElement(q.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Me.Z,null))},Ge=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(E.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Fe),i=(0,a.useSelector)(E.ZP.selectors.getEntityUri),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(E.ZP.selectors.getDtssPath),m=(0,a.useSelector)(E.ZP.selectors.getTenant),g=[Ve({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:He})],f=(0,r.useCallback)((()=>{s([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ve({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(s)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const v=(0,r.useCallback)((()=>p(null)),[]),x=(0,r.useCallback)((e=>p(e)),[]);return{tenants:c,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:v,onImportClick:x}})(),c=Be(),s=1===e.length,u=s?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,s?o().createElement("div",{className:c.button},o().createElement(Ze.k,{size:"L",icon:Me.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:F()(c.tenant)},u)):o().createElement(ze.Z,{menuId:"importDT-table-actions",buttonComponent:Ze.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(qe,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(We.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:l,onSave:n})))},_e=e=>{let{title:t,total:n}=e;const a=Ae(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(je);return o().createElement(G.Z,{title:t||"",className:a.header},n>0&&o().createElement(_.Z,{widthToHide:400},o().createElement($.Z,{height:24,margin:16}),o().createElement(q.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(Ge,null),o().createElement(Le,null))};var $e=n(11013),Qe=n(27604),Xe=n(22983),Ye=n(31254),Ke=n(31039);const Je=(0,K.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function et(){return et=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},et.apply(this,arguments)}const tt=e=>{let{label:t,entity:n,children:l}=e,c=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 s=Je(),u=(0,Ee._)(),p=(0,a.useSelector)(E.ZP.selectors.getTenant),d=(0,a.useSelector)(E.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,b.ZiX)(null==n?void 0:n.entityUri)&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),v=o().createElement("div",{className:s.tooltipContent},o().createElement("div",{className:s.label},t),m&&o().createElement(q.CircularProgress,{size:16,classes:{colorPrimary:s.progress}}),f&&o().createElement("div",{className:s.secondaryLabel},f));return o().createElement(q.Tooltip,et({onOpen:y,title:v,disableFocusListener:!0,classes:{tooltip:s.tooltip}},c),l)},nt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var rt=n(77277);const ot=(0,K.Z)((()=>({container:{display:"flex"}})));function at(){return at=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},at.apply(this,arguments)}const lt=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=ot();return o().createElement("div",{className:a.container},o().createElement(rt.Z,at({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(rt.Z,at({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},it=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),ct=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:c,onAcceptRelation:s,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=it(),{entity:m,relation:g}=t,f=(0,b.$qe)(t),h=(0,b.xr3)(t),v=(0,b.iJH)(t),{entityType:x,entityLabel:w,preparedUri:C,relationLabel:S}=nt(t,n),O=(0,b.Fn9)(g)&&(0,b.Fn9)(m),P=(0,a.useSelector)(E.ZP.selectors.getMode),{canRemove:N,canUpdate:k}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:i,onEditRelation:c,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),T=(0,r.useCallback)((()=>c(t)),[c,t]),R=(0,r.useCallback)((()=>{s(t)}),[s,t]),j=(0,r.useCallback)((()=>u(t)),[u,t]),D=(N||k)&&l&&!t.suggested?o().createElement(o().Fragment,null,k&&o().createElement(Ze.k,{icon:Qe.Z,size:"XS",onClick:T,tooltipTitle:y().text("Edit")}),N&&o().createElement(Ze.k,{icon:Xe.Z,size:"XS",onClick:Z,tooltipTitle:y().text("Remove")})):void 0,I=t.suggested?o().createElement(lt,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,L=v?y().text("ignored"):y().text("edited");return o().createElement("div",{className:F()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(Ye.Z,{className:d.entityAvatar,entityType:x}),o().createElement(Ke.Z,{value:C,className:d.entityLabelContainer},o().createElement(tt,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(q.Typography,{variant:"caption",className:d.editedLabel},"(",L,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));ct.displayName="EditableRelationItem";const st=ct,ut=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:t,direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dt=n(98989),mt=n(83543);const gt=(0,K.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ft=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=gt(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,s={onClick:t,className:l.arrowIcon};return i||!c||(0,b.xvW)(n)?null:a?o().createElement(mt.Z,s):o().createElement(dt.Z,s)},bt=(0,K.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),ht=e=>{let{config:t,connection:n,children:l}=e;const i=bt(),{showInactive:c}=(0,r.useContext)(je),{connections:s,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,c]=(0,r.useState)(!1),[s,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>E.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>E.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pt(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(E.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||h(),c((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:h,loading:s,total:g}})({config:t,connection:n,relationActivityFilter:c?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(s)),[s]);return o().createElement(o().Fragment,null,l((()=>o().createElement(ft,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ne.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Qt,{isLoading:m,config:t,loadRelations:d,connections:s,total:g,parentEntityUri:n.entity.entityUri}))))},yt=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),vt=e=>{let{className:t,connections:n=[],config:l,mode:c,noDataText:s,parentEntityUri:u}=e;const p=(0,a.useSelector)(E.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>E.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>E.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(E.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>E.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),v=yt(),x=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:c,metadata:p,parentEntityUri:u});(0,i.pipe)(E.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,c,p,h,u]),w=(0,r.useCallback)((e=>{h(E.N5.relations.actions.closeRelationEditor(l.id,e)),h(E.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>E.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=E.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(E.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),C=l.content,S=ut(C.inRelations,C.outRelations),O=(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);h(E.N5.relations.actions.addRelation(l.id,t))}),[h,l,S]),P=(0,r.useCallback)((e=>{h(E.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,S]),[N,k]=(0,i.partition)(b.xvW,n),Z=g&&f,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,b.xvW)(e),s=`${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(ht,{config:l,connection:e,key:s},(t=>r?o().createElement($e.Z,{connection:r,config:l,mode:c,metadata:p}):o().createElement(st,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(E.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:O,onIgnoreRelation:P})))},j=Z&&(!d||d&&d.parentEntityUri===u),D=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},j&&o().createElement(q.Button,{color:"primary",onClick:x,className:v.moreButton},o().createElement(re.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},y().text("Add"))),D&&o().createElement($e.Z,{connection:d,config:l,mode:c,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(q.Divider,{className:v.divider}),k.map(R),T&&o().createElement(q.Typography,{className:v.noData},s))};var xt=n(19603),Et=n(94646),wt=n(78101),Ct=n(80931);const St=(0,K.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pt(e,t,n[t])}))}return e}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Nt=e=>{let{connection:t,className:n}=e;const l=St(),{relation:c}=t,s=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(E.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==c?void 0:c.relationType)),[null==c?void 0:c.relationType,u]),d=(0,r.useMemo)((()=>Ot({attributes:Ot({},E.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:s,connection:t})),[t,s]);return m?o().createElement(wt.A.Provider,{value:h},o().createElement(Ct.Z,{className:F()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:F()(l.attributesList,n)},y().text("No attributes"))};var kt=n(86602),Zt=n(82726);const Tt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Ze.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?kt.Z:Zt.Z,onClick:n})},Rt=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),jt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:c}=e;const s=Rt(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(E.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:v,relationLabel:x}=nt(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),C=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:F()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:u})},o().createElement("div",{className:F()(s.row,xt.U)},n&&n(),o().createElement("div",{className:s.labelWrapper},o().createElement(Ye.Z,{className:s.entityAvatar,entityType:h}),o().createElement(Ke.Z,{value:v,className:s.entityLabelContainer},o().createElement(tt,{label:y,entity:p},o().createElement("span",{className:s.entityLabel},y)),x&&o().createElement("span",{className:s.relationLabel},`, ${x}`))),o().createElement("div",{className:s.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(Et.Z,{className:s.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(lt,{size:"small",acceptRelation:l(t),ignoreRelation:c(t)}),!u&&o().createElement(Tt,{show:m,onToggle:()=>{g((e=>!e))},className:s.showDetails}))),m&&o().createElement(Nt,{connection:t}))}));jt.displayName="RelationItem";const Dt=jt;var It=n(52691),Lt=n(16208);const At=e=>e.filter((e=>5===e.value)).length,Mt=e=>e.filter((e=>1===e.value)).length,zt=e=>0===e.length?"0%":At(e)/e.length*100+"%",Ft=e=>0===e.length?"0%":Mt(e)/e.length*100+"%",Vt=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),Ut=e=>{let{ratings:t,className:n}=e;const r=Vt();return o().createElement("div",{className:F()(r.wrapper,n)},o().createElement(q.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:zt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ft(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:F()(r.likesCount,r.count)},o().createElement(It.Z,{className:r.icon}),At(t)),o().createElement("div",{className:r.count},o().createElement(Lt.Z,{className:r.icon}),Mt(t))))},Ht=(0,K.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Bt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Ht(),i=(0,a.useSelector)(E.ZP.selectors.getUserName),c=t.find((e=>{let{user:t}=e;return t===i})),s=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(q.Button,{onClick:n,variant:"text",size:"small",className:F()(l.button,l.likeButton,{[l.isActive]:5===(null==c?void 0:c.value)})},"Agree"),o().createElement(ze.Z,{buttonProps:{endIcon:o().createElement(mt.Z,null),variant:"text",size:"small",className:F()(l.button,{[l.isActive]:1===(null==c?void 0:c.value)})},buttonContent:1===(null==c?void 0:c.value)?c.comment:"Disagree",menuItems:s,menuId:"disagree-dropdown-menu-button"}))},Wt=(0,K.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),qt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:c,ignoreRelation:s}=e;const u=Wt(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(E.ZP.selectors.getMetadata),{entityLabel:y,entityType:v,preparedUri:x,relationLabel:w}=nt(t,h),C=(null==f?void 0:f.ratings)||[],S=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant),O=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:F()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(q.Box,{display:"flex",minHeight:"44px",className:xt.U},o().createElement(q.Box,{display:"flex",alignItems:"center"},o().createElement(q.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Ye.Z,{entityType:v,className:u.entityTypeIcon})),o().createElement(q.Box,{display:"flex",flexDirection:"column"},o().createElement(Ke.Z,{value:x,className:u.entityLabelContainer},o().createElement(tt,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Bt,{ratings:C,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(Et.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(lt,{acceptRelation:c(t),ignoreRelation:s(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Ut,{ratings:C,className:u.ratings}),o().createElement(Tt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Nt,{connection:t,className:u.relationAttributes}))},Gt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:c}=e;const{isComplex:s,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=ut(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:c}=l,s=r.direction===b.Nsj.IN,u=s?a.entityUri:n,p=s?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:c}).then(t).catch((e=>{o(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,c),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(S.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(ht,{config:i,connection:e,key:r},(t=>s?o().createElement(qt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Dt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Gt.displayName="RelationsList";const _t=Gt,$t=(0,K.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Qt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const s=$t(),{selectors:u}=E.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(I.Z,null):(0,b.KIu)(d)?o().createElement(vt,{connections:l,className:s.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:c}):i>0?o().createElement(_t,{config:n,loadRelations:r,connections:l,className:s.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(q.Typography,{className:s.noData},m)},Xt=(0,K.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),Yt=e=>{let{config:t,className:n}=e;const l=Xt(),{page:c,setPage:s,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(je),{selectors:h}=E.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),v=(0,a.useSelector)(h.getEntity),x=(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)((()=>{f("")}),[null==v?void 0:v.uri]);const S=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:O,reload:P}=(0,Pe.a)({sorting:C,filter:S,page:c,rowsPerPage:u,config:t,entity:v,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(y)),[y]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Ne.X.Provider,{value:N},o().createElement(B.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Fe.Provider,{value:k},o().createElement(_e,{title:t.caption,total:x})),o().createElement("div",{className:l.content},o().createElement(Qt,{isLoading:O,config:t,loadRelations:P,connections:y,total:x}),x>u&&o().createElement(W.Z,{classes:{root:l.pagination},count:x,rowsPerPageOptions:[],rowsPerPage:u,page:c,onChangePage:s})))))};Yt.displayName="RelationsView";const Kt=o().createContext(null);Kt.displayName="TableAttributeContext";var Jt=n(86361),en=n(26180),tn=n(31276);function nn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){rn(e,t,n[t])}))}return e}function rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const on="CHANGE_SEARCH_QUERY",an=nn({},en.ZP.actions,{changeSearchQuery:(0,tn.zD)(on)}),ln=(e,t)=>t.type===on?nn({},e,{searchQuery:t.payload,page:0}):en.ZP.reducer(e,t);var cn=n(92332),sn=n(67353);function un(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){pn(e,t,n[t])}))}return e}function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},mn=(0,K.Z)((()=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},rowCell:{fontSize:"13px",overflow:"hidden"},blobWrapper:{position:"relative",overflowY:"auto",overflowX:"hidden",whiteSpace:"pre",maxHeight:"100px",boxSizing:"border-box",padding:"15px 25px 0 25px"},defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"15px 25px 0 25px"},updateAttribute:un({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:un({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:un({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},b.zXF[b.Y1q.deleteAttribute]),"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":dn}}))),gn=(0,sn.Z)((e=>{const t=mn();return o().createElement("div",{className:t.headCell},o().createElement(cn.default,e))}));var fn=n(72768),bn=n(95613);const hn=e=>{let{value:t,historyClassName:n}=e;const r=mn();return o().createElement("div",{className:r.blobWrapper,onScroll:tn.UW},o().createElement("span",{className:r[n]},t))},yn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=mn(),{value:l,uri:c}=t,{appearance:s}=(0,r.useContext)(R.m),u=(0,i.pipe)(b.IFm,b.o_F)(c,s);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(hn,{value:l,historyClassName:u});{const e=o().createElement(fn.Z,{value:l,dataTypeDefinition:n});return o().createElement(bn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xn=(e,t)=>{const{uri:n,label:r,children:o,name:a}=e;return(0,i.reject)(i.isNil,{id:(0,b.Tde)(n,t),label:r,dataTypeDefinition:(0,b.PFL)(e),children:null==o?void 0:o.map((e=>xn(e,t.concat({name:a}))))})},En=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),wn=e=>{if((0,b.vZp)(e)){const t=En(e);return t.length>1?t.slice(0,-1):null}return null},Cn=(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){vn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:wn(e.id),headCellRenderer:gn,rowCellValueRenderer:yn})));var Sn=n(99341);function On(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pn=n(52016),Nn=n(1876),kn=n(60894);const Zn=(0,K.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Tn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:c,onChangeColumns:s}=e;const u=Zn();return o().createElement(G.Z,{title:t,className:u.header},o().createElement(X.i,{query:n,onChange:r}),o().createElement(Nn.Z,{enabled:a,onClick:l}),o().createElement($.Z,{height:24,margin:4}),o().createElement(kn.Z,{columnsData:i,selectedColumns:c,onChangeColumns:s}))};function Rn(){return Rn=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},Rn.apply(this,arguments)}const jn=(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=mn();return o().createElement("div",{className:F()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Rn({key:t,value:e},l)))))}));var Dn=n(85709);const In=(0,K.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}}))),Ln=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Ze.k,{tooltipTitle:y().text("Edit"),icon:Qe.Z,size:"L",onClick:t}),n&&o().createElement(Ze.k,{tooltipTitle:y().text("Remove"),icon:Xe.Z,size:"L",onClick:n}))};function An(){return An=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},An.apply(this,arguments)}const Mn=e=>{let{columnsData:t,values:n,sorting:l,onSort:c,filters:s,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,b.xIV)(e))(t))(En(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Cn(t)),[t]),y=In(),v=(0,a.useSelector)(E.ZP.selectors.getMode),x=(0,b.KIu)(v),w=(0,a.useSelector)(E.ZP.selectors.getMetadata),C=(0,a.useSelector)(E.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:O}=(0,r.useContext)(Kt),P=(0,r.useCallback)((e=>o().createElement(jn,An({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Pn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!x||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,x]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,b.xv5)({attributeType:O,mode:v,attributeValue:D,metadata:w,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,D)}));var D;const I="number"==typeof N&&(e=>Z(p)&&(0,b.yv0)({attributeType:O,mode:v,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:O,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,O,C]),M=R||!j&&!I?void 0:o().createElement(Ln,{onEdit:I?L:void 0,onRemove:j?A:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Dn.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:c,filters:s,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:M,context:z,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},zn=(0,K.Z)((()=>({actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}})));function Fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:c,hasChanges:s,attributeValue:u}=e;const p=zn(),m=(0,a.useSelector)(E.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Kt),f=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,m)||{})),h=(0,a.useSelector)(E.ZP.selectors.getMode),v=(0,a.useDispatch)(),x=(0,r.useContext)(d.m),w=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.addAttributes,v)(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){Fn(e,t,n[t])}))}return e}({},e,{viewId:x}))))),[x,v]),C=(0,b.ZiX)(m),S=(0,a.useSelector)((e=>E.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),O=(0,r.useCallback)((0,i.pipe)(E.N5.errors.actions.errorDeactivated,v),[v]);return o().createElement(o().Fragment,null,o().createElement(le.Z,{expanded:!0,attributeValue:u,showEmptyEditors:C,onDeleteAttribute:c,onDeactivateError:O,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:S,attributeType:g,ownError:(0,b.ADq)(u,null,g.uri,S)}),o().createElement("div",{className:p.actionButtons},o().createElement(q.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(q.Button,{color:"primary",disabled:!s,onClick:()=>{l(u)}},y().text("Apply"))))},Un=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Hn(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){Bn(e,t,n[t])}))}return e}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wn=[],qn=15,Gn=e=>{let{config:t,className:n}=e;const{caption:l,max:c=qn}=t,s=Un(),{values:u,page:p,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:v,onFilter:x,onSort:w,onToggleFilters:C,onChangeColumns:S,filters:O,sorting:P,totalVisibleValues:N,hasPaging:k,attributeType:Z,showTable:T,allColumnsData:R}=(0,r.useContext)(Kt),{checkHasChanges:j,onChangeAttribute:D,onDeleteAttribute:L,onAdd:A,onCancel:M,onApply:z,onStartEditing:V,modifiedValues:U,editingValues:H,deletedUris:_}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(E.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const c=(0,a.useDispatch)(),s=(0,r.useContext)(d.m),{attributeType:u,values:p}=(0,r.useContext)(Kt),m=(0,a.useSelector)(E.ZP.selectors.getEntityUri),g=(0,a.useSelector)(E.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(E.N5.actions.modifyAttribute,c)(Hn({},e,{viewId:s}))}),[s,c]),h=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.removeAttribute,c)(Hn({},e,{viewId:s}))),[s,c]),y=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:m,attributeType:u});t(e.uri),f(Hn({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),v=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),x=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Hn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),C=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,m)||{})),S=(0,b.KIu)(l),O=(0,b.xy8)(u),P=(0,i.pathOr)(Wn,[O,null==u?void 0:u.name],C),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),k=(0,r.useMemo)((()=>S?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(p):[]),[P,p]),Z=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:h,onAdd:y,onCancel:x,onApply:w,onStartEditing:v,modifiedValues:N,editingValues:Z,deletedUris:k}})(),$=(0,a.useSelector)(E.ZP.selectors.getMode),Q=(0,b.KIu)($),X=Q?U:u,{canCreate:Y}=(0,Pn.l)(),K=Y(t)&&Z&&(0,b.Vg3)({attributeType:Z,mode:$})&&!H.length,J=(0,r.useMemo)((()=>v.map((e=>R.find((0,i.propEq)("id",e))))),[v,R]);return o().createElement(B.Z,{className:F()(s.root,n)},T?o().createElement(o().Fragment,null,o().createElement(Tn,{title:l,total:N,columnsData:R,selectedColumns:v,onChangeColumns:S,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!O,onToggleFilters:C}),o().createElement("div",{style:{position:"relative"}},Q&&o().createElement("div",{className:s.editor},K&&o().createElement(q.Button,{color:"primary",onClick:A,className:s.addButton},o().createElement(re.Z,{classes:{root:s.icon}}),o().createElement("div",{className:s.buttonLabel},y().text("Add"))),H.map((e=>o().createElement(Vn,{key:e.uri,attributeValue:e,onChangeAttribute:D,onDeleteAttribute:L,onCancel:M,onApply:z,hasChanges:j(e)})))),J.length>0&&o().createElement(Mn,{columnsData:J,config:t,values:X,filters:O,onFilter:x,sorting:P,onSort:w,onEdit:V,onDeleteAttribute:L,deletedUris:_}),k&&o().createElement(W.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:c,page:p,onChangePage:m}),g&&o().createElement(I.Z,null))):o().createElement(o().Fragment,null,o().createElement(G.Z,{title:l,className:s.header}),o().createElement(q.Typography,{className:s.noData},y().text("No data"))))};var _n=n(58600);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}let Qn=0;const Xn=()=>Qn++,Yn=e=>{const t={children:[],nodeId:Xn()};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,c={entity:l,children:[],nodeId:Xn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(c.root=i),o.children.push(c),o=c}}return t.children},Kn=(0,K.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.primary.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 Jn=n(1242);const er=o().createContext(null);var tr=n(55400);const nr=e=>{e.target.src=Jn},rr=e=>{let{node:t}=e;const n=Kn(),l=(0,a.useDispatch)(),i=t.entity.uri,c=(0,a.useSelector)(E.ZP.selectors.getAbsoluteImagePath),s=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,r.useContext)(er),p=(0,a.useSelector)(E.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(E.ZP.selectors.getEntity),m=(0,b.ChB)({uiPath:p,uri:i}),g=i===d,f=(0,r.useCallback)((()=>{l(E.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,v=(0,b.nt9)(s,t.entity.type)||{},x=(0,b.VD3)(s,v,"typeGraphIcon"),w=x&&(0,b.vPL)(c,x);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(q.Avatar,{className:F()(n.avatar),src:w||Jn,onError:nr}),o().createElement("span",{className:F()(n.link,{[n.selected]:g})},o().createElement(tr.Z,{to:m,onClick:f},h))))},or=((0,r.memo)(rr),e=>{let{node:t}=e;return t.nodeId}),ar=(0,K.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function lr(){return lr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(this,arguments)}function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cr(){return cr=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},cr.apply(this,arguments)}const sr={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:c,treeIndex:s,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=ar();return o().createElement("div",cr({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:c,treeIndex:s})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:F()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:c,treeIndex:s}):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,c=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"]),s=ar(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:s.lineBlock},l.root&&o().createElement("div",{className:s.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:s.verticalLine}),o().createElement("div",{className:s.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){ir(e,t,n[t])}))}return e}({},c.style,{width:f});return o().createElement("div",lr({},c,{className:s.node,style:b}),p,o().createElement("div",{className:s.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function ur(){return ur=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},ur.apply(this,arguments)}const pr=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",ur({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"})))},dr=e=>{let{title:t,onGraphOpen:n}=e;const r=Kn();return o().createElement(G.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Ze.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:pr,onClick:n,size:"L"})))};var mr=n(9757);const gr=(0,K.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function fr(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){br(e,t,n[t])}))}return e}function br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hr=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[c,s]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:b,popup:h}=(0,mr.E)(t),y=gr(),v=f||d;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{s(!!h)}),[h]),(0,r.useEffect)((()=>{c&&l.current&&(l.current.innerHTML="",h&&Array.from(h.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[c,h]);const x=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(q.Dialog,{ref:l,open:!!h}),o().createElement(q.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:fr({},x,b),className:F()(y.root,n)}))):null};var yr=n(14940);const vr=(0,K.Z)({dragHandleContainer:{position:"relative",width:"100%",height:"inherit"},dragHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $dragHandle":{visibility:"visible"},".react-grid-item.static &:hover $dragHandle":{visibility:"hidden"}},dragHandle:{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)"}}),xr=e=>{const t=t=>{const n=vr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:F()("viewDraggableHandle",n.dragHandle)},o().createElement(yr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Er=n(2256);const wr=e=>{const t=t=>o().createElement(Er.Z,{error:o().createElement(A.ZP,{LogoRenderer:A.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:A.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Cr=(0,K.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Sr=n(29103),Or=n(83911),Pr=n(48747),Nr=n(22385);const kr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Zr=(0,K.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Tr=n(13074),Rr=n(24338);const jr=(0,K.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Dr=jr,Ir=e=>{let{totalImages:t}=e;const n=Dr(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(q.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Lr(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){Ar(e,t,n[t])}))}return e}function Ar(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(E.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,s.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(Rr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(E.N5.actions.removeAttribute,c)(Lr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(E.N5.actions.modifyAttribute,c)(Lr({},e,{viewId:d})),imageSize:Vr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Ir,{totalImages:p.length}))},zr=(0,K.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Fr=zr,Vr={imageMargin:4,imageWidth:162,imageHeight:162};var Ur=n(28741);const Hr=(0,K.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Br=n(49734),Wr=n(98808),qr=n(93428),Gr=n(30885);function _r(){return _r=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},_r.apply(this,arguments)}const $r=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,a.useSelector)(E.ZP.selectors.getEntity),{canMerge:p,canMark:m}=(0,b.hXd)(s,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Wr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(d.m),y=(0,r.useCallback)((()=>{i(),c(E.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[c,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(qr.H,_r({},f,{onFinishRequest:y})),m&&o().createElement(Gr.i,_r({},f,{onFinishRequest:i})))},Qr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const c=(0,a.useSelector)(E.ZP.selectors.getMetadata),s=(0,a.useSelector)(E.ZP.selectors.getEntity);return o().createElement(Br.M,{match:r,entity:s,entitiesMap:n,metadata:c,className:xt.U},o().createElement(Et.Z,{uri:(0,b.E_P)(s.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:s.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement($r,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Xr={showTransitiveMatches:!0,showInactiveEntities:!1},Yr={order:b.KM9.asc,field:"score"};var Kr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Kr||(Kr={}));const Jr=e=>(0,i.pipe)(wr,xr)(e),eo=Jr((e=>{let{className:t}=e;const n=Cr();return o().createElement(B.Z,{className:F()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),to=Jr((e=>{let{className:t,config:n}=e;return o().createElement(V.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),no=Jr((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),c=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),s=Se(e,c),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Oe(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},s)})(n);return o().createElement(U.Provider,{value:a},o().createElement(xe,{config:n,className:t}))})),ro=Jr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(E.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),c=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,b.WN0)(e,t)),(0,i.map)((e=>xn(e,[t]))),(0,i.chain)(b.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),s=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:c.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[c]),[u,p]=(0,r.useReducer)(ln,s),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>b.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,Sn.su)(o,r)})))).orSome([]))(c,m);return e.length?e:null}),[m,c]),v=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:d})),[y,f,g,d]),{changeSearchQuery:x,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:O,changeColumns:P}=(0,Jt.o)({actions:an,dispatch:p}),N=Se(e,v);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){On(e,t,n[t])}))}return e}({},u,{setSearchQuery:x,setPage:w,onSort:C,onFilter:S,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden),allColumnsData:c},N)})(t);return o().createElement(Kt.Provider,{value:l},t&&o().createElement(Gn,{config:t,className:n}))})),oo=Jr((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[i,c]=(0,r.useState)(e.sortOrder||"asc"),[s,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),c((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:s,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(je.Provider,{value:a},o().createElement(Yt,{config:t,className:n}))})),ao=Jr(hr),lo=Jr((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(E.ZP.selectors.getEntityUri),{treeData:c,setTreeData:s}=((e,t)=>{const n=(0,Ee._)(),[o,l]=(0,r.useState)([]),c=(0,a.useSelector)(E.ZP.selectors.getEntity);return(0,we.D)((()=>{const e=o.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$n(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],c),e);l(t.map((0,i.prop)("root")))}),[null==c?void 0:c.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||n((0,b.RFJ)({uri:e,graphUri:t})).then(Yn).then(l).catch((e=>{console.warn(e)})),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l}})(l,t.graph.type),u=Kn(),p=(0,a.useDispatch)(),{id:d,graph:m}=t,g=(0,r.useCallback)((()=>{p(E.ui.actions.openGraph({viewId:d,graphType:m.type,entityUri:l}))}),[p,d,m,l]),f=(0,r.useCallback)((e=>({title:o().createElement(rr,{node:e.node})})),[]);return o().createElement(B.Z,{className:n},o().createElement(dr,{onGraphOpen:g,title:t.caption}),o().createElement(er.Provider,{value:t},o().createElement("div",{className:u.treeContainer},o().createElement("div",{className:u.tree},o().createElement(_n.ZP,{isVirtualized:!1,treeData:c,canDrag:!1,theme:sr,generateNodeProps:f,onChange:s,getNodeKey:or})))))})),io=Jr((e=>{let{config:t,className:n}=e;const l=Hr(),c=(0,a.useSelector)(E.ZP.selectors.getEntity),s=(0,b.wwR)(c),[u,p]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:v,total:x}=(0,Ur.s)({enabled:!!s,entity:c,options:Xr,filter:"",page:0,sorting:Yr,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{v()}),[v]),C=(0,a.useDispatch)(),O=(0,r.useContext)(d.m),P=(0,r.useCallback)((()=>{C(E.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:O}))}),[C,O]),N=(0,r.useMemo)((()=>(0,b.NVY)(s,(0,i.map)(b.ev7,f))),[s,f]),{getCommentsCount:k}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{k(N)}),[k,N]);const Z=x>3&&!(0,i.isEmpty)(f),T=u?Kr.Loading:(0,i.isEmpty)(f)?Kr.NoData:Kr.Loaded;return o().createElement(Ne.X.Provider,{value:h},o().createElement(B.Z,{className:F()(l.root,n)},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},T===Kr.Loading&&o().createElement(I.Z,null),T===Kr.NoData&&o().createElement(q.Typography,{className:l.noData},y().text("No matches found")),T===Kr.Loaded&&f.map((e=>o().createElement(Qr,{config:t,entitiesMap:h,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),Z&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(q.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),co=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,96617)).then((e=>({default:Jr(e.HierarchyTreeView)}))))),so=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:Jr(e.RelationshipsTableView)}))))),uo=Jr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=Zr(),s=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,a.useSelector)(E.ZP.selectors.getEntity),p=(0,a.useSelector)(E.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),c=(0,Ee._)();return(0,r.useEffect)((()=>{i(!0),c((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(kr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,c]),{markers:o,loading:l}})(u,s,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:c.fullHeight},o().createElement(I.Z,null))),[c]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(B.Z,{className:F()(c.root,i)},m&&o().createElement(I.Z,null),o().createElement(Nr.Z,{size:"S",icon:n?Or.Z:Sr.Z,onClick:()=>l(t.id),className:c.fullscreenBtn}),o().createElement(Pr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:c.fullHeight,mapKey:p,mapOptions:h}))})),po=Jr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,c=Fr(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(E.ZP.selectors.getMode),p=(0,a.useSelector)(E.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(E.ZP.selectors.getMetadata),m=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,v=t["text-empty"]||y().text("No data found"),x=(0,r.useCallback)((e=>s(E.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return o().createElement(B.Z,{className:n},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:c.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:x};return o().createElement(Mr,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:Vr,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:x};return o().createElement(o().Fragment,null,o().createElement(Tr.Z,e),o().createElement(Ir,{totalImages:h}))}}return o().createElement(q.Typography,{className:c.noData},v)})()))}));class mo{}mo.ViewTypes=b.ZIY,mo.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case mo.ViewTypes.HierarchyTree:return o().createElement(co,{config:r,store:n,className:a});case mo.ViewTypes.HierarchyPaths:return o().createElement(lo,{config:r,className:a});case mo.ViewTypes.RelationsTable:return o().createElement(so,{config:r,store:n,className:a});case mo.ViewTypes.Relations:return o().createElement(oo,{config:r,className:a});case mo.ViewTypes.Attributes:return o().createElement(to,{className:a,config:r});case mo.ViewTypes.SingleAttribute:return o().createElement(no,{config:r,className:a});case mo.ViewTypes.AttributeTable:return o().createElement(ro,{config:r,className:a});case mo.ViewTypes.Map:return o().createElement(uo,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case mo.ViewTypes.Custom:return o().createElement(ao,{config:r,className:a});case mo.ViewTypes.ImageAttribute:return o().createElement(po,{config:r,className:a});case mo.ViewTypes.PotentialMatches:return o().createElement(io,{config:r,className:a})}},mo.getComponent=e=>mo.getComponentBy("class",e)||mo.getComponentBy("react-class",e)||o().createElement(eo,{className:e.className});const go=mo,fo=()=>null,bo=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const c=Cr();return o().createElement(r.Suspense,{fallback:o().createElement(fo,null)},go.getComponent({config:t,store:n,className:F()(c.component,{[c.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));bo.displayName="ViewComponent";const ho=(0,K.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function yo(){return yo=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},yo.apply(this,arguments)}const vo=["onConfigChanged","onRemove"],xo=e=>{var t;let{layoutItemConfig:n,views:l,className:c,children:s,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),h=ho(),y=(0,a.useSelector)(E.ZP.selectors.getGoogleMapKey),{store:v}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const x=f.class===go.ViewTypes.Custom;if(x&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC)return null;if(f.class===go.ViewTypes.Map&&!y)return null;const w=(e=>{var t;return null===(t=Object.entries(b.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(f.class);return o().createElement("div",yo({},(0,i.omit)(vo,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:F()(c,{[h.item]:!x})}),o().createElement("div",{className:F()({[h.fixedSizeContainer]:!m})},m,o().createElement(bo,{store:v,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),s)},Eo=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(M.Z,{LayoutItem:xo,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var wo=n(87685);const Co=(0,K.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),So=e=>{let{notification:t}=e;const n=Co({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(E.ZP.selectors.getAutoCloseInterval),c=t.autoHideDuration||i&&1e3*i||5e3,[s,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(E.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{s.cancelAction&&l(s.cancelAction),u(void 0)}),[s]),f=(0,r.useCallback)((()=>{l(s.applyAction),u(void 0),l(E.ui.actions.closeNotification(t.id))}),[s,t]),b=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(q.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),h=o().createElement(o().Fragment,null,o().createElement(Nr.Z,{className:n.closeIcon,size:"S",icon:wo.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(q.Portal,{container:document.body},o().createElement(q.Snackbar,{autoHideDuration:c,open:p,classes:{root:n.snackbar},action:b,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),o().createElement(We.Z,{open:!!s,title:null==s?void 0:s.confirmationText,content:null==s?void 0:s.confirmationDescription,onSave:f,onDiscard:g,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},Oo=()=>{const e=(0,a.useSelector)(E.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(So,{key:e.id,notification:e})))):null};var Po=n(72753),No=n(43576),ko=n(64459),Zo=n(3409),To=n(93873),Ro=n(22860);function jo(){return jo=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},jo.apply(this,arguments)}const Do=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",jo({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))};function Io(){return Io=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},Io.apply(this,arguments)}const Lo=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",Io({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},Ao=(0,K.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function Mo(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){zo(e,t,n[t])}))}return e}function zo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fo=e=>o().createElement(q.SvgIcon,e,o().createElement(Do,null)),Vo=e=>o().createElement(q.SvgIcon,e,o().createElement(Lo,null)),Uo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),Ho=e=>{let{className:t,profileBandConfig:n}=e;const l=Ao(),c=(0,a.useDispatch)(),s=(0,a.useSelector)(E.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(E.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,u.uri))),d=(0,a.useSelector)(E.ZP.selectors.getMetadata),m=(0,a.useSelector)(E.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(E.ZP.selectors.getMode),f=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),h=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),v=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),x=(0,a.useSelector)(E.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,C=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),S=x===b.OXy.Saving,O=x===b.OXy.Cloning||S,[P,N]=(0,r.useState)(!1),k=(0,r.useCallback)((()=>{N(!1)}),[]),Z=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(E.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(E.ZP.selectors.getMetadata),c=(0,a.useDispatch)(),s=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,s),[l,s]),d=(0,b.nt9)(l,s),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(s),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,s]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);c(E.N5.entity.actions.entityCloneRequested({data:Mo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:k}),T=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:b.fO_.EDITING,description:y().text("Edit profile directly"),icon:No.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:b.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Fo,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:b.fO_.VIEWING,description:y().text("Read or print profile"),icon:Po.Z,permission:"READ"}]),[]),R=(0,r.useMemo)((()=>[...Z?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Vo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:Xe.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&c(E.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[c,u.uri,Z]),j=!v&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(C),D=(0,b.ZiX)(null==u?void 0:u.uri),I=(0,r.useMemo)((()=>Uo(T,C,D,m,s)),[T,C,m,s,D]),L=(0,r.useMemo)((()=>Uo(R,C,D,m,s)),[R,C,m,s,D]),A=(0,r.useCallback)((e=>{c(E.N5.mode.actions.modeUpdated(e))}),[c]),M=(0,r.useCallback)((()=>{c(E.N5.mode.actions.modeCancelEditing())}),[c]),z=(0,r.useCallback)((()=>{c(E.N5.actions.saveProfile())}),[c]);return o().createElement(o().Fragment,null,o().createElement(ko.Z,{className:F()(t,xt.U),entity:f&&p?p:u},o().createElement(q.Box,{display:"flex",alignItems:"center"},o().createElement(q.Box,{mr:3},f&&o().createElement(q.Box,{className:l.editingButtons},o().createElement(q.Button,{variant:"outlined",onClick:M,"data-reltio-id":"reltio-profile-cancel-editing",disabled:O},y().text("Cancel")),o().createElement(q.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:z,disabled:O},(0,b.fnZ)(g)?y().text("Suggest"):y().text("Save"))),v&&h?o().createElement(Zo.Z,null):h&&o().createElement(To.a,null)),j&&o().createElement(Ro.T,{optionsGroup:I,buttonsGroup:L,value:g,onChange:A,disabled:O})),o().createElement(q.Box,{className:l.comments},o().createElement(Et.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!Z&&o().createElement(We.Z,{open:P,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:Z,onDiscard:k,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var Bo=n(71820),Wo=n(85890),qo=n(26789),Go=n(54362),_o=n(6674),$o=n(91515),Qo=n(52043),Xo=n(17308),Yo=n(39827),Ko=n(80147),Jo=n(76569);const ea=(0,K.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),ta=()=>{const{total:e}=(0,r.useContext)(T.O),t=ea();return o().createElement(q.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Jo.Z,null))};var na=n(26313),ra=n(9371),oa=n(4426);const aa=(0,K.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),la=()=>{const e=aa(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(S.h),i=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const c=(0,na.Q)(n);return o().createElement(Ne.X.Provider,{value:c},o().createElement(q.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(ra.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(q.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(oa.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var ia=n(46626);const ca=(0,K.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),sa=()=>{const e=ca(),{tasks:t,loading:n}=(0,r.useContext)(T.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(I.Z,null),t&&t.map((e=>o().createElement(ia.s,{key:e.taskId,task:e}))))};function ua(){return ua=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},ua.apply(this,arguments)}const pa=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",ua({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"})))))},da=()=>{const{commentsMap:e}=(0,r.useContext)(S.h),t=ea();return o().createElement(q.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(pa,null))};var ma=n(10159);const ga=()=>o().createElement(ma.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),fa=()=>o().createElement(ma.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function ba(){return ba=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},ba.apply(this,arguments)}const ha=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",ba({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))},ya=(0,K.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),va=()=>{const e=ya(),t=(0,a.useSelector)(E.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(hr,{key:t.id,config:t,className:e.itemWrapper}))))};function xa(){return xa=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},xa.apply(this,arguments)}let Ea;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(Ea||(Ea={}));const wa=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},Ca=()=>{var e,t,n;const l=ea(),c=(0,a.useSelector)(E.ZP.selectors.isWorkflowSideViewEnabled),s=(0,a.useSelector)(E.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(E.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(E.ZP.selectors.isDBConnectorSideViewEnabled),d=(0,a.useSelector)(E.ZP.selectors.isCollaborationEnabled),m=(0,a.useSelector)(E.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(E.ZP.selectors.getMetadata),f=(0,a.useSelector)(E.ZP.selectors.getEntity),h=(0,r.useContext)(T.O),v=(0,r.useContext)(S.h),[x,w]=(0,r.useState)(null),C=(0,r.useCallback)((e=>{w((t=>t===e?null:e))}),[]),O=(0,r.useCallback)((()=>{w(null)}),[]),P=null!==x,N=x===Ea.History,{isHistoryEnabled:k,isProfilePersisted:Z}=(0,Bo.C)({isHistoryTabActive:N,entity:f}),{historyFilter:R,onApplyFilter:j,isLoading:D,historicUris:I,historyWithTotal:L,canLoadMore:A,onLoadMore:M}=(0,Wo.k6)({entity:f,enabled:k}),z=c&&s&&!(0,b.ZiX)(null==f?void 0:f.uri),F=u&&d,V=(0,b.mdt)(null==v?void 0:v.commentsMap),U=[{buttonProps:{id:Ea.Workflow,icon:ta,tooltipTitle:y().text("Workflow")},content:null!=h&&h.total?o().createElement(sa,null):o().createElement(ga,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:wa(null==h?void 0:h.total),rightContent:o().createElement(qo.G,null)},hidden:!z},{buttonProps:{id:Ea.Collaboration,icon:da,tooltipTitle:y().text("Collaboration")},content:V?o().createElement(la,null):o().createElement(fa,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:wa(V)},hidden:!F},{buttonProps:{id:Ea.History,icon:Ko.Z,tooltipTitle:y().text("History")},content:Z?o().createElement(Go.Z,{isLoading:D,historyWithTotal:L,contributorsUris:I,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:M,canLoadMore:A}):o().createElement(_o.Z,null),headerProps:{content:o().createElement($o.Z,{total:Z?((null==I?void 0:I.length)||0)+1:void 0,entityType:(0,b.nt9)(g,null==f?void 0:f.type),filter:R,onApplyFilter:j})}},{buttonProps:{id:Ea.DBConnector,icon:ha,tooltipTitle:y().text("D&B Connector")},content:o().createElement(va,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!p}],H=(0,i.reject)((0,i.propEq)("hidden",!0))(U);return(0,r.useEffect)((()=>{var e;null!==(e=U[x])&&void 0!==e&&e.hidden&&O()}),[x,U,O,H]),o().createElement("div",{className:l.wrapper},o().createElement(Qo.h,{open:P,width:480},!(null!==(e=U[x])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(Xo.P,xa({},null===(t=U[x])||void 0===t?void 0:t.headerProps,{onClose:O})),null===(n=U[x])||void 0===n?void 0:n.content)),o().createElement(Yo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(U),onButtonClick:C,activeIndexId:x}))};var Sa=n(39781),Oa=n(16715);const Pa="48px",Na="1px solid rgba(0, 0, 0, .125)",ka=(0,K.Z)((e=>({accordion:{borderTop:Na,borderBottom:Na,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Pa,minHeight:Pa,"&$accordionSummaryExpanded":{height:Pa,minHeight:Pa}},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},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},goToIcon:{marginLeft:"4px"},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"}}))),Za=ka;var Ta=n(38016);const Ra=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Za();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:c,items:s,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(q.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(q.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(Ta.Z,null)},i,o().createElement(q.Typography,{className:l.accordionSummaryHeading},c)),o().createElement(q.AccordionDetails,{className:F()(l.accordionDetails,p)},o().createElement("ul",null,s.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function ja(){return ja=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},ja.apply(this,arguments)}Ra.displayName="ErrorsPanel";const Da=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",ja({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Ia=(0,i.omit)(["deactivated","path"]),La=(0,r.memo)((e=>{let{error:t}=e;const n=Za(),l=(0,a.useSelector)(E.ZP.selectors.getMetadata),c=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),s=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})(l,t),u=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t),{highlightError:p}=(0,r.useContext)(D.M),d=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},o().createElement("span",{className:n.errorTitle},s,d&&c&&o().createElement(Ze.k,{icon:Da,size:"XXS",onClick:()=>p(t),tooltipTitle:y().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));La.displayName="Error";const Aa=()=>{const e=Za(),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(Ia),t.map(Ia))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(E.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[c,s]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:o().createElement(Sa.Z,{className:F()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?y().text("warning"):y().text("warnings")}),icon:o().createElement(Oa.Z,{className:F()(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)((()=>{s("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return u.length>0?o().createElement(Ra,{panels:u,expandedPanelId:c,onToggle:p,ErrorComponent:La}):null},Ma=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));var za=n(61756),Fa=n(4109);function Va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ua={},Ha=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i}=e;const c=Ma({maxWidth:null==n?void 0:n.maxWidth}),s=(0,a.useDispatch)(),u=(0,r.useCallback)((()=>i().then((e=>e.layout?{}:e))),[i]),p=(0,r.useRef)(),d=(0,r.useCallback)((0,b.DsO)(l,1e3),[l]),m=(0,a.useSelector)(E.ZP.selectors.getEntity),g=null!=n&&n.nestedRoute?`/${n.nestedRoute}`:"",f=m?m.type:null,h=f&&n?f+g:null,{isLoaded:v,savedState:M=Ua,updateSavedState:z}=(0,w.w)({getSavedState:u,saveState:d,entityTypeUri:h}),[F,V]=(0,r.useState)([]),[U,H]=(0,r.useState)([]),B=(0,r.useMemo)((()=>x()(n)),[n]),W=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),q=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),G=(0,C.C)({objectIds:q}),_=(0,r.useContext)(S.h),$=(0,O.U)(),Q=(e=>{const t=(0,za.v)(e),n=(0,Fa.b)();return(0,r.useMemo)((()=>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){Va(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(null==n?void 0:n.workflow),X=(0,a.useSelector)(E.ZP.selectors.getHistoryEvent);(0,P.a)({entity:m,historyEvent:X});const Y=(0,N.u)(),K=(null===(t=(0,a.useSelector)(E.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"";(0,r.useEffect)((()=>{if(v){const e=B!==M.configHash,{views:t,layout:r}=(0,b.Mfk)({views:e||!M.views?n.views:M.views,layout:e?n.layout:M.layout});H(t),V(r)}}),[v,M,h]),(0,r.useEffect)((()=>{s(E.N5.views.actions.profileViewsSet(U))}),[s,U]),(0,r.useEffect)((()=>{n.sidePanelViews&&s(E.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>{p.current&&(p.current.scrollTop=0)}),[null==m?void 0:m.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(E.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(E.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),c=(0,a.useSelector)(E.ZP.selectors.getMode),s=(0,a.useSelector)(E.ZP.selectors.getProfileViews),u=s&&s.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(E.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&c===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,c,u])})();const J=(0,r.useCallback)((e=>{z({layout:e,views:U,configHash:B}),V(e)}),[z,B,U]),ee=p.current,te=(0,r.useMemo)((()=>({element:ee,priority:["top","bottom"]})),[ee]);return o().createElement(k.j.Provider,{value:!0},o().createElement(Z.s.Provider,{value:$},o().createElement(S.h.Provider,{value:W?_:G},o().createElement(T.O.Provider,{value:Q},o().createElement(R.m.Provider,{value:Y},o().createElement(j.l.Provider,{value:K},o().createElement(D.R,null,o().createElement("div",{className:c.perspectiveView},(!v||!(null!=m&&m.uri))&&o().createElement(I.Z,null),v&&null!=m&&m.uri?o().createElement("div",{className:c.profileContainer},o().createElement("div",{className:c.profileWrapper},o().createElement(Ho,{profileBandConfig:n.profileBand}),!W&&o().createElement(Aa,null),o().createElement("div",{ref:p,className:c.scrollWrapper},o().createElement(L.p.Provider,{value:te},o().createElement(Eo,{layout:F,onLayoutChanged:J,views:U})))),o().createElement(Ca,null)):o().createElement("div",{className:c.emptyState},o().createElement(A.ZP,{LogoRenderer:A.B9.NO_DATA,text:y().text("No data to display."),variant:A.tC.embedded})),o().createElement(Oo,null)))))))))}));Ha.displayName="ProfilePerspectiveView";const Ba=(0,c.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),Wa=e=>{let{config:t,store:n,onResize:h=i.identity,saveState:y,getSavedState:v,qxSandboxApi:x}=e;const E=(0,r.useCallback)((0,b.aYu)(v),[v]),{SnackbarRenderer:w,showSnackbarMessage:C}=(0,p.D)(),S=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:null==S?void 0:S.id},o().createElement(m.S.Provider,{value:C},o().createElement(g.Y.Provider,{value:x},o().createElement(c.StylesProvider,{generateClassName:Ba},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>h(Math.floor(e),Math.floor(t))}),S&&o().createElement(Ha,{config:S,saveState:y,getSavedState:E}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var qa=n(82842),Ga=n(51229),_a=n(91131);const $a=(0,K.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),Qa=e=>{let{total:t=0}=e;const n=$a(),l=(0,a.useDispatch)(),i=(0,r.useContext)(d.m),c=(0,r.useCallback)((()=>{l(E.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(G.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(q.Link,{component:"button",variant:"caption",className:n.link,onClick:c,underline:"none"},y().text("Profile")),o().createElement(_a.Z,{className:n.icon}),y().text("Tags")),o().createElement(Ga.Z,null),o().createElement(q.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Xa=n(20404);const Ya=(0,K.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),Ka=e=>{let{label:t}=e;const n=Ya();return o().createElement(q.Toolbar,{className:n.toolbar},o().createElement(Xa.Z,{className:n.avatar}),o().createElement(q.Typography,{variant:"h6",className:n.label},t))};function Ja(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){el(e,t,n[t])}))}return e}function el(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tl=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),nl=[25,50,100],rl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=tl(),[c,s]=(0,r.useState)(nl[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const c=(0,a.useDispatch)(),s=(0,Ee._)(),u=(0,Ee._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:v,requestTotal:x}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(E.ZP.selectors.getTenant),c=(0,a.useSelector)(E.ZP.selectors.getDtssPath),s=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!s,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Ja({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:s,dtssPath:c}).then((0,i.map)((0,b.E7G)(s))):(0,b.ZOr)(e,t)}),[p,s,l,c]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Ja({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:s,dtssPath:c}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,s,l,c])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{c(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))),g(0)}),[c]);return(0,r.useEffect)((()=>{s(x()).then(g).catch(w)}),[x,s,w]),(0,r.useEffect)((()=>{d(!0),u(v(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,v,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:c}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const v=g>nl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Ka,{label:t}),o().createElement("div",{className:F()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(B.Z,{className:l.tagsView},o().createElement(Qa,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(I.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(qa.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(W.Z,{count:g,rowsPerPageOptions:nl,rowsPerPage:c,page:u,onChangePage:p,onChangeRowsPerPage:s}))))))}));rl.displayName="TagPerspectiveView";const ol=(0,c.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),al=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(d.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:ol},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(rl,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))};var ll=n(65321);const il=(0,K.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),cl=()=>{const e=il(),t=(0,a.useSelector)(E.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(T.O),l=(0,r.useMemo)((()=>null==n?void 0:n.find((e=>e.objectURIs.includes((0,b.$Rg)(t.uri))))),[t.uri,n]);return o().createElement(ko.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(ll.o,{task:l})))},sl=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},perspectiveContainer:{display:"flex",flexGrow:1,overflow:"hidden"},attributesWrapper:{margin:"15px",flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},contentWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1}})));function ul(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pl={processTypes:["dataChangeRequestReview"]},dl=(0,r.memo)((()=>{const e=sl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(E.ZP.selectors.getEntityUri),o=(0,za.v)(e),l=(0,r.useCallback)((e=>{"Reject"===e&&t(E.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(E.ui.actions.openEntity({uri:(0,b.$Rg)(n),viewId:null}))}),[t,n]);return(0,r.useMemo)((()=>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){ul(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(pl),l=(0,a.useSelector)(E.ZP.selectors.getEntity);(0,r.useEffect)((()=>{t(E.N5.sidePanelViews.actions.sidePanelViewsLoaded([{id:"common",views:[{point:"com.reltio.plugins.ui.view",id:"com.reltio.plugins.entity.side.WorkflowsView",class:"com.reltio.plugins.entity.side.WorkflowsView"}]}]))}),[t]);const i=!n.loading&&!!l.uri;return o().createElement(T.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(I.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(o().Fragment,null,o().createElement("div",{className:e.contentWrapper},o().createElement(cl,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(V.Z,null))),o().createElement(Ca,null)):o().createElement(A.ZP,{LogoRenderer:A.B9.NO_DATA,text:y().text("No data to display."),variant:A.tC.embedded}))))}));dl.displayName="DCRReviewPerspectiveView";const ml=(0,c.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),gl=e=>{let{config:t,store:n,onResize:r=i.identity}=e;return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:ml},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>r(Math.floor(e),Math.floor(t))}),o().createElement(dl,null),o().createElement(f.Z,{showErrorFromStore:!0}))))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>Xe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(17440),c=n(52730),s=n(49885),u=n(65549),p=n(94079),d=n(13980),m=n.n(d),g=n(87918),f=n.n(g),b=n(79692);const h=(0,b.Z)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),y=e=>{let{onClick:t}=e;const n=h();return a().createElement(p.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(u.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},f().text("Add")))};y.propTypes={onClick:m().func};const v=y;var x=n(71153),E=n.n(x),w=n(57014);const C={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},S={color:"rgba(0,0,0,.54)"},O=(0,b.Z)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":C,"$row-cell--inactive &":S},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":C},"row-cell--inactive":S})));function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}const N=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:o}=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","rowValue","isSorted"]);const i=O(),c=(0,w.$qe)(r),s=(0,w.Fn9)(r.relation)&&(0,w.Fn9)(r.entity);return a().createElement("div",{className:E()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:c,[i["row-cell--inactive"]]:!s},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:m().object,cell:m().object,CellValueRenderer:m().elementType,isSorted:m().bool};const k=N;var Z=n(85709),T=n(94656),R=n(39450),j=n(31254),D=n(95613);const I=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,c.useDispatch)(),l=(0,o.useContext)(R.m),u=O(),p=(0,w.idV)(n.entityLabel),d=(0,w.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:u.entityCell},a().createElement(j.Z,{className:u.entityAvatar,entityType:t}),a().createElement(D.Z,{value:p},a().createElement("span",{className:u.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:d,viewId:l}),s.ui.actions.openEntity,r)},p)))};I.propTypes={value:m().shape({entity:m().shape({entityUri:m().string,entityLabel:m().string}),entityType:w.p8l})};const L=I;var A=n(92332);const M=(0,n(67353).Z)((e=>{const t=O();return a().createElement("div",{className:t.headCell},a().createElement(A.default,e))}));var z=n(64091);const F=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const U=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),H=e=>{if(e.startsWith("relation.attributes")){const t=U(e);return t.length>1?t.slice(0,-1):null}return null},B=(0,i.map)((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){V(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:H(e.id),headCellRenderer:M,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:z.Z)});var t})),W=(0,b.Z)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var q=n(27604),G=n(22983);const _=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(p.Tooltip,{title:f().text("Edit")},a().createElement(p.IconButton,{onClick:r},a().createElement(q.Z,null))),n&&a().createElement(p.Tooltip,{title:f().text("Remove")},a().createElement(p.IconButton,{onClick:o},a().createElement(G.Z,null))))};_.propTypes={canUpdate:m().bool,canRemove:m().bool,handleEditRelation:m().func,handleRemoveRelation:m().func};const $=_;function Q(){return Q=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},Q.apply(this,arguments)}const X=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:c,onSort:u,filters:p,onFilter:d,onEditRelation:m,onRemoveRelation:g,basicTableRef:f,allowOnlyCreateNew:b}=e;const h=(0,o.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:o}=r;return(0,i.assoc)(o,((e,t,n)=>{let{entity:r,relation:o}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,w.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,w.Lmx)(n,o.relationType);case"relation.activeness.startDate":return o.startDate;case"relation.activeness.endDate":return o.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,w.tT_)(e))(t))(U(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),y=(0,o.useMemo)((()=>B(n)),[n]),v=W(),x=(0,o.useCallback)((e=>a().createElement(k,Q({},e,{isSorted:!!c&&c.field===e.columnData.id}))),[c]),[E,C]=(0,o.useState)(null),{canRemove:S,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a,allowOnlyCreateNew:l}=e;const i=(0,w.xvW)(r);if(s.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,w.$qe)(r),i=(0,w.V3K)(t,e);return{canRemove:o&&!l&&(0,w.Edd)(n,i),canUpdate:a&&!l&&(0,w.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:g,onEditRelation:m,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([E,"connection"],h)}),P=(0,o.useCallback)((e=>C(e)),[]),N=(0,o.useCallback)((()=>m((0,i.path)([E,"connection"],h))),[E,m,h]),T=(0,o.useCallback)((()=>g((0,i.path)([E,"connection","relation","relationUri"],h))),[E,g,h]),R=S||O?a().createElement($,{handleEditRelation:N,handleRemoveRelation:T,canRemove:S,canUpdate:O}):void 0;return a().createElement("div",{className:v.tableContainer},a().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:y,rowsData:h,sorting:c,onSort:u,filters:p,onFilter:d,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:x,onRowHover:P,hoverRowIndex:E,hoveredRowRightContent:R,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]},ref:f,resizeDebounceDelay:150}))};X.propTypes={mode:m().string,columnsData:T.uz,connections:m().arrayOf(w.Rjq),metadata:w.pGS,filters:m().objectOf(T.Dq),onFilter:m().func,sorting:T.nI,onSort:m().func,onEditRelation:m().func,onRemoveRelation:m().func,basicTableRef:m().shape({current:m().object}),allowOnlyCreateNew:m().bool};const Y=X;var K=n(93416),J=n(75512),ee=n(30553),te=n(32152),ne=n(1876),re=n(60894),oe=n(43054),ae=n(8818);const le=(0,b.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ie=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=le(),i=(0,o.useRef)(),[c,s]=(0,o.useState)(!1),u=()=>s((e=>!e));return a().createElement(a().Fragment,null,a().createElement(ae.k,{className:t,ref:i,tooltipTitle:f().text("More"),icon:oe.Z,onClick:u,size:"L"}),a().createElement(p.Popover,{open:c,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(p.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(p.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:f().text("Show inactive Relationships")})))},ce=(0,b.Z)({header:{padding:"0 4px 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"},moreButton:{marginLeft:"-6px"}}),se=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:c,selectedColumns:s,onChangeColumns:u,showInactive:d,onChangeShowInactive:m}=e;const g=ce();return a().createElement(K.Z,{title:t,className:g.header},a().createElement(J.Z,{widthToHide:500},a().createElement(ee.Z,{height:24,margin:16}),a().createElement(p.Typography,{className:g.totalCaption,variant:"caption"},n>1?f().text("${count} entities",{count:n}):f().text("${count} entity",{count:n}))),a().createElement(te.i,{query:r,onChange:o}),a().createElement(ne.Z,{enabled:l,onClick:i}),a().createElement(ee.Z,{height:24,margin:4}),a().createElement(re.Z,{columnsData:c,selectedColumns:s,onChangeColumns:u}),a().createElement(ie,{className:g.moreButton,showInactive:d,onShowInactiveChange:m}))};se.propTypes={title:m().string,total:m().number,columnsData:T.uz,selectedColumns:m().arrayOf(m().string),onChangeColumns:m().func,searchQuery:m().string,onChangeSearchQuery:m().func,filtersEnabled:m().bool,onToggleFilters:m().func,showInactive:m().bool,onChangeShowInactive:m().func};const ue=se;var pe=n(26180),de=n(31276);function me(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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe="CHANGE_SEARCH_QUERY",be="CHANGE_SHOW_INACTIVE",he=me({},pe.ZP.actions,{changeSearchQuery:(0,de.zD)(fe),changeShowInactive:(0,de.zD)(be)}),ye=(e,t)=>{switch(t.type){case fe:return me({},e,{searchQuery:t.payload,page:0});case be:return me({},e,{showInactive:t.payload});default:return pe.ZP.reducer(e,t)}};var ve=n(26481),xe=n(37152),Ee=n(52016),we=n(10237),Ce=n(11013),Se=n(58662),Oe=n(99136);const Pe=[10,25,50,100],Ne=[{id:"entity.label",get label(){return f().text("Entity label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return f().text("Directional label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return f().text("Start date")},dataTypeDefinition:w.PY2.startDate},{id:"relation.activeness.endDate",get label(){return f().text("End date")},dataTypeDefinition:w.PY2.endDate}],ke=(0,i.pipe)(w.Tde,(0,i.concat)("relation.")),Ze=(0,i.pipe)((0,i.map)((e=>({id:ke(e.uri),label:e.label,dataTypeDefinition:(0,w.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),Te=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(F,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),w.DK$)(o))))([...n,...r])}),Ze,(0,i.concat)(Ne));var Re=n(99341);function je(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){De(e,t,n[t])}))}return e}function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ie=e=>e.uri||e,Le=e=>t=>Ie(t)===e,Ae=(0,i.curry)(((e,t)=>{const n=(t,r)=>{let o=Ie(r),a=!1;o.startsWith("!")&&(o=o.slice(1),a=!0);const l=e[o]&&(0,w.uGe)(w.BDP.READ,e[o]),c=t.find(Le(o))||!l?t:t.concat(r.uri?je({},r,{uri:o}):o);return a?c:(0,i.keys)(e).reduce(((t,r)=>e[r].extendsTypeURI!==o||t.find(Le(r))?t:n(t,r)),c)};return t.reduce(n,[])})),Me=(0,i.curry)(((e,t)=>{const n=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.reduce(((n,r)=>{const o=Ie(r),a=(0,i.path)([o,t,"objectTypeUri"],e);return!a||n.find(Le(a))?n:n.concat(a)}),[])};return je({},t,{entityTypes:[...n("startObject",t.inRelations),...n("endObject",t.outRelations)]})})),ze=(0,i.indexBy)((0,i.prop)("uri")),Fe=(0,i.curry)(((e,t)=>{const n=ze(e.relationTypes),r=ze(e.entityTypes),o=e=>(0,i.evolve)({inRelations:Ae(n),outRelations:Ae(n),entityTypes:Ae(r),nextEntry:o},e);return(0,i.pipe)((0,i.unless)((0,i.either)((0,i.prop)("nextEntry"),(0,i.prop)("entityTypes")),Me(n)),o)(t)})),Ve=(0,b.Z)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}}),Ue=(0,i.pluck)("id",Ne),[He]=Ue;function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const We=(0,i.memoizeWith)(((e,t)=>t.id),((e,t)=>(0,i.evolve)({content:Fe(e)},t))),qe=(0,c.connect)(((e,t)=>{const{config:n}=t;return{connections:s.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:s.ZP.selectors.getTotalByViewId(e,n.id),entity:s.ZP.selectors.getEntity(e),metadata:s.ZP.selectors.getMetadata(e),mode:s.ZP.selectors.getMode(e),relationToAdd:s.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:s.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:s.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,n)=>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){Be(e,t,n[t])}))}return e}({},e,t,n,{config:We(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:c=[],total:u=0,mode:d,relationToAdd:m,relationsToEdit:g=[],checkIfCanAddRelations:b,dispatch:h,readOnlyMode:y}=e;const x={searchQuery:"",filters:null,visibleColumns:Ue,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||He},page:0,rowsPerPage:n.max||15,showInactive:!1},E=Ve(),C=(0,o.useContext)(ve.j)?d:w.fO_.VIEWING,[S,O]=(0,o.useReducer)(ye,x),P=(0,i.pipe)(he.changeSearchQuery,O),N=(0,i.pipe)(he.changeShowInactive,O);(0,o.useEffect)((()=>{P("")}),[null==r?void 0:r.uri]);const{visibleColumns:k,searchQuery:Z,filters:T,sorting:R,page:j,rowsPerPage:D,showInactive:I}=S,L=(0,o.useMemo)((()=>Te(n,l)),[n,l]),A=(0,o.useMemo)((()=>k.map((e=>L.find((0,i.propEq)("id",e))))),[k,L]),M=(0,o.useMemo)((()=>((e,t,n)=>{const r=w.wSh.fromFalsy(e).map(w.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,Re.Tz)(n,t);return(new w.MEy).addClause(r).addClause(o).build()})(Z,T,A)),[T,Z]),{isLoading:z}=(0,xe.a)({sorting:R,filter:M,page:j,rowsPerPage:D,config:n,entity:r,relationActivityFilter:I?w.Ng6.ALL:w.Ng6.ACTIVE_ONLY,mode:d}),F=(0,o.useMemo)((()=>{return e=x.rowsPerPage,Pe.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:V,handlePageChange:U}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(he.changeRowsPerPage,O),handlePageChange:(0,i.pipe)(he.changePage,O)})),[]),H=(0,o.useCallback)((()=>{const e=(0,w.vlo)({config:n,mode:C,metadata:l,parentEntityUri:void 0});(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),h)(e)}),[n,C,l,h]),B=(0,o.useCallback)((e=>{h(s.N5.relations.actions.closeRelationEditor(n.id,e)),h(s.N5.relations.actions.removeRelation(n.id,e));const t=c.find((t=>s.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=s.N5.relations.selectors.getEntityUriFromConnection(t);(0,w.ZiX)(r)&&h(s.N5.modifiedEntities.actions.entityDeleted(r))}),[n,c,h]),W=r&&b&&!y,q=m?[m,...g]:g,{canUpdate:G,canDelete:_}=(0,Ee.l)(),$=G(n)&&!y,Q=_(n)&&!y,X=(0,o.useRef)(null);return a().createElement(we.Z,{className:t},a().createElement(ue,{title:n.caption,total:u,columnsData:L,selectedColumns:k,onChangeColumns:(0,i.pipe)(he.changeColumns,O),searchQuery:Z,onChangeSearchQuery:P,filtersEnabled:!!T,onToggleFilters:(0,i.pipe)(he.toggleFilters,O),showInactive:I,onChangeShowInactive:N}),W&&a().createElement("div",{className:E.addArea},a().createElement(v,{onClick:H})),q.map((e=>a().createElement(Ce.Z,{key:s.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:C,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(Y,{mode:C,columnsData:A,connections:c,metadata:l,filters:T,onFilter:(0,i.pipe)(he.changeFilter,O),sorting:R,onSort:(0,i.pipe)(he.toggleSort,O),onEditRelation:$?(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),h):null,onRemoveRelation:Q?B:null,basicTableRef:X,allowOnlyCreateNew:n.allowOnlyCreateNew}),c.length?a().createElement(Se.Z,{count:u,rowsPerPageOptions:F,rowsPerPage:D,onChangeRowsPerPage:V,page:j,onChangePage:U,basicTableRef:X}):a().createElement(p.Typography,{className:E.noData},f().text("No data found")),z&&a().createElement(Oe.Z,null)))}));var Ge=n(36138),_e=n(22664),$e=n(585);const Qe=(0,Ge.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),Xe=e=>{let{config:t,store:n,onResize:o=i.identity,className:s,readOnlyMode:u}=e;return a().createElement(c.Provider,{store:n},a().createElement(R.m.Provider,{value:t.id},a().createElement(Ge.StylesProvider,{generateClassName:Qe},a().createElement(_e.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(qe,{config:t,className:s,readOnlyMode:u}),a().createElement($e.Z,null)))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6138],{6138:(e,t,n)=>{n.d(t,{vC:()=>fl,_n:()=>qa,tM:()=>ll});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),c=n(36138),s=n(44443),u=n(22664),p=n(24605),d=n(39450),m=n(97094),g=n(60115),f=n(585),b=n(57014),h=n(87918),y=n.n(h),v=n(3096),x=n.n(v),E=n(49885),w=n(60641),C=n(7718),S=n(3515),O=n(17554),P=n(57730),N=n(76536),k=n(26481),Z=n(49759),T=n(94150),R=n(26005),j=n(72249),D=n(47137),I=n(99136),L=n(30268),A=n(21077),M=n(67268),z=n(71153),F=n.n(z),U=n(8962);const V=o().createContext(null);V.displayName="SingleAttributeContext";var H=n(60995),B=n(10237),W=n(58662),q=n(94079),G=n(93416),_=n(75512),$=n(30553),Q=n(81149),X=n(32152),Y=n(36444),K=n(79692);const J=(0,K.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ee=e=>{let{className:t}=e;const n=J(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:c,toggleShowInactive:s}=(0,r.useContext)(V),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(q.Button,{ref:a,classes:{root:F()(n.triggerButton,t)},onClick:u},o().createElement(Y.Z,null)),o().createElement(q.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(q.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(q.Checkbox,{className:n.checkboxControlCheckbox,checked:c,onChange:e=>s(e.target.checked)}),label:y().text("Show inactive values")})))},te=(0,K.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),ne=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=te(),{searchQuery:i,setSearchQuery:c,setPage:s,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(V);return o().createElement(G.Z,{title:t,className:l.root},o().createElement(_.Z,{widthToHide:500},o().createElement($.Z,{height:24,margin:16}),o().createElement(q.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement(Q.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(X.i,{query:i,onChange:e=>{c(e),s(0)}}),a&&o().createElement(ee,null))};var re=n(65549),oe=n(93140),ae=n(76134),le=n(96698);const ie=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}}))),ce=b.nIW,se=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return se(n,t)})))):b.P6Y.strings.search(String(e),t),ue=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const c=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return se(t,l)})))(t,n,r),s=(0,i.filter)(b.OXP,c);return{[(0,b.xy8)(r)]:{[ce(r)]:s.slice(a,a+o),paging:{[r]:{totalOvValues:s.length,totalValues:c.length}}}}};function pe(){return pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){me(e,t,n[t])}))}return e}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ge=[],fe=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:c,noDataText:s}=e;const u=ie(),{uri:p,required:m,cardinality:g,name:f}=n,h=(0,a.useDispatch)(),v=(0,r.useContext)(d.m),x=(0,a.useSelector)(E.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,x.uri)||{})),C=(0,a.useSelector)((e=>E.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),S=(0,a.useSelector)((e=>(0,b.tQX)(l,n,E.ZP.selectors.getProfileErrors(e)))),O=(0,a.useSelector)(E.ZP.selectors.getMode),P=(0,b.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(ge,[P,f]),(0,i.map)((0,i.prop)("uri")))(x),k=(0,i.pathOr)(ge,[P,f],w),Z=k.map((0,i.prop)("uri")),T=(0,b.ZiX)(x.uri),R=(0,r.useRef)((0,b.gjI)({parentUri:l,attributeType:n})),j=(0,b.O27)(k),D=m&&j,I=D?[R.current]:k.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),L=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.addAttributes,h)(e.map((e=>de({},e,{viewId:v}))))),[v,h]),A=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.modifyAttribute,h)(de({},e,{viewId:v}))),[v,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.removeAttribute,h)(de({},e,{viewId:v}))),[v,h]),z=(0,r.useCallback)((0,i.pipe)(E.N5.errors.actions.errorDeactivated,h),[h]),U=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return L(D&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[L,l,n,D]),V=(0,b.Vg3)({attributeType:n,mode:O}),H={attributeType:n,errors:C,crosswalks:w.crosswalks,mode:O,onAddAttributes:L,onChangeAttribute:A,onDeactivateError:z,showNonOv:c},B=0===I.length&&0===t.length;return o().createElement("div",null,o().createElement(oe.Z,{cardinality:g}),o().createElement(ae.Z,{message:S}),V&&o().createElement(q.Button,{color:"primary",onClick:U,className:u.moreButton},o().createElement(re.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),I.map(((e,t)=>o().createElement(le.Z,pe({key:e.uri},H,{attributeValue:e,lazy:D&&!m,showEmptyEditors:T,ownError:(0,b.ADq)(e,t,p,C),onDeleteAttribute:M})))),I.length>0&&t.length>0&&o().createElement(q.Divider,{className:u.divider}),t.map((e=>{const t=k.find((0,i.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!Z.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,b.vKJ)({valueTransformer:(0,i.unless)(b.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:F()({[u.ovFalse]:!(0,b.OXP)(n)})},o().createElement(le.Z,pe({},H,{attributeValue:n,ownError:(0,b.ADq)(n,null,p,C),onDeleteAttribute:M,state:l})))})),B&&o().createElement(q.Typography,{className:u.noData},s))};var be=n(81303);const he=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},ye=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),ve=15,xe=e=>{let{config:t,className:n}=e;const{caption:l,max:i=ve,showInactiveValuesMenu:c}=t,s=ye(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:h}=(0,r.useContext)(V),v=(0,a.useSelector)(E.ZP.selectors.getEntityUri),x=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(E.ZP.selectors.getPivotingAttributes),S=0!==u.length,O=t["text-empty"]||y().text("No data found");return o().createElement(H.J.Provider,{value:C},o().createElement(B.Z,{className:F()(s.root,n)},o().createElement(ne,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:c}),o().createElement(q.Box,{className:s.content},(()=>{if(g)return o().createElement(I.Z,null);if(b){if(x&&S){const e={values:u,attributeType:b,showInactive:h};return o().createElement(he,e)}if(w){const e={values:u,attributeType:b,parentUri:v,showInactive:h,noDataText:O};return o().createElement(fe,e)}}return o().createElement(q.Typography,{className:s.noData},O)})()),f&&o().createElement(W.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:s.pagination}})))};var Ee=n(85229),we=n(20562);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 Se=(e,t)=>{const{attributeUri:n,max:o=15}=e,l=(0,a.useSelector)(E.ZP.selectors.getMetadata),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=(0,Ee._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),y=(0,a.useSelector)(E.ZP.selectors.getApiPath),v=(0,a.useSelector)(E.ZP.selectors.getTenant),x=(0,a.useSelector)(E.ZP.selectors.getEntityWithDiff),w=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),C=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),S=(0,a.useSelector)(E.ZP.selectors.getHistoryDiff),O=x.uri,P=ce(n),N=(0,b.xy8)(n);f.current=(0,b.JQy)(x,O,P);const k=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:Z}=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:T}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(O)&&(0,b.YOQ)(n)){m(!0);const{page:e,showInactive:r}=t,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),c=(0,b.biM)(x)||C?ue:b.KbL;g(c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ce(e,t,n[t])}))}return e}({metadata:l,entity:x,apiPath:y,tenant:v,parentUri:O,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:Z,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([N],e),r=(0,i.pathOr)([],[P],t);C||h(E.N5.actions.processNextPageOfAttributeValues({parentUri:O,attributeTypeUri:n,attributeTypeName:P,values:r})),s(r.map((e=>{var t;return(null===(t=f.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),p((0,i.path)(["paging",n],t))})).finally((()=>{m(!1)}))}else s([]),p(null)}),[y,O,v,n,o,l,t,Z,k,C,S]);(0,r.useEffect)((()=>{R()}),[R]),(0,we.D)((()=>{w&&R()}),[w]);const j=(0,i.partition)(b.OXP),[,D]=j(f.current||[]),I=T?[]:D,L=T?"totalValues":"totalOvValues",A=(0,i.ifElse)((0,i.has)(L),(0,i.prop)(L),(0,i.always)(c.length))(u),M=o<A,z=null!=u&&u.totalValues?u.totalValues-A:I.length;return{values:c,isLoading:d,hasPaging:M,totalVisibleValues:A,attributeType:k,totalNonVisibleValues:z,nonVisibleValues:I}};function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pe=n(37152),Ne=n(31274),ke=n(79026),Ze=n(8818),Te=n(90324),Re=n(70595);const je=o().createContext(null);je.displayName="RelationsViewStateContext";const De=(0,K.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Ie=e=>{let{className:t}=e;const n=De(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:s,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(je),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),v="asc"===c;return o().createElement(o().Fragment,null,o().createElement(q.Button,{ref:a,classes:{root:F()(n.button,t)},onClick:f},o().createElement(Y.Z,null)),o().createElement(q.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(q.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(q.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(q.Divider,{className:n.divider}),o().createElement(q.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(ke.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(Ze.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?Te.Z:Re.Z,onClick:s,className:n.sortOrderButton,size:"L"})))))};Ie.displayName="FilterButton";const Le=Ie,Ae=(0,K.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var Me=n(61932),ze=n(55847);const Fe=o().createContext(null);function Ue(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}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 He=Math.pow(2,31)-1,Be=(0,K.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var We=n(81137);const qe=e=>{let{label:t}=e;const n=Be();return o().createElement(q.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Me.Z,null))},Ge=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(E.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Fe),i=(0,a.useSelector)(E.ZP.selectors.getEntityUri),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(E.ZP.selectors.getDtssPath),m=(0,a.useSelector)(E.ZP.selectors.getTenant),g=[Ue({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:He})],f=(0,r.useCallback)((()=>{s([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ue({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(s)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const v=(0,r.useCallback)((()=>p(null)),[]),x=(0,r.useCallback)((e=>p(e)),[]);return{tenants:c,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:v,onImportClick:x}})(),c=Be(),s=1===e.length,u=s?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,s?o().createElement("div",{className:c.button},o().createElement(Ze.k,{size:"L",icon:Me.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:F()(c.tenant)},u)):o().createElement(ze.Z,{menuId:"importDT-table-actions",buttonComponent:Ze.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(qe,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(We.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:l,onSave:n})))},_e=e=>{let{title:t,total:n}=e;const a=Ae(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(je);return o().createElement(G.Z,{title:t||"",className:a.header},n>0&&o().createElement(_.Z,{widthToHide:400},o().createElement($.Z,{height:24,margin:16}),o().createElement(q.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(Ge,null),o().createElement(Le,null))};var $e=n(11013),Qe=n(27604),Xe=n(22983),Ye=n(31254),Ke=n(31039);const Je=(0,K.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function et(){return et=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},et.apply(this,arguments)}const tt=e=>{let{label:t,entity:n,children:l}=e,c=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 s=Je(),u=(0,Ee._)(),p=(0,a.useSelector)(E.ZP.selectors.getTenant),d=(0,a.useSelector)(E.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,b.ZiX)(null==n?void 0:n.entityUri)&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),v=o().createElement("div",{className:s.tooltipContent},o().createElement("div",{className:s.label},t),m&&o().createElement(q.CircularProgress,{size:16,classes:{colorPrimary:s.progress}}),f&&o().createElement("div",{className:s.secondaryLabel},f));return o().createElement(q.Tooltip,et({onOpen:y,title:v,disableFocusListener:!0,classes:{tooltip:s.tooltip}},c),l)},nt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var rt=n(77277);const ot=(0,K.Z)((()=>({container:{display:"flex"}})));function at(){return at=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},at.apply(this,arguments)}const lt=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=ot();return o().createElement("div",{className:a.container},o().createElement(rt.Z,at({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(rt.Z,at({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},it=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),ct=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:c,onAcceptRelation:s,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=it(),{entity:m,relation:g}=t,f=(0,b.$qe)(t),h=(0,b.xr3)(t),v=(0,b.iJH)(t),{entityType:x,entityLabel:w,preparedUri:C,relationLabel:S}=nt(t,n),O=(0,b.Fn9)(g)&&(0,b.Fn9)(m),P=(0,a.useSelector)(E.ZP.selectors.getMode),{canRemove:N,canUpdate:k}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:i,onEditRelation:c,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),T=(0,r.useCallback)((()=>c(t)),[c,t]),R=(0,r.useCallback)((()=>{s(t)}),[s,t]),j=(0,r.useCallback)((()=>u(t)),[u,t]),D=(N||k)&&l&&!t.suggested?o().createElement(o().Fragment,null,k&&o().createElement(Ze.k,{icon:Qe.Z,size:"XS",onClick:T,tooltipTitle:y().text("Edit")}),N&&o().createElement(Ze.k,{icon:Xe.Z,size:"XS",onClick:Z,tooltipTitle:y().text("Remove")})):void 0,I=t.suggested?o().createElement(lt,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,L=v?y().text("ignored"):y().text("edited");return o().createElement("div",{className:F()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(Ye.Z,{className:d.entityAvatar,entityType:x}),o().createElement(Ke.Z,{value:C,className:d.entityLabelContainer},o().createElement(tt,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(q.Typography,{variant:"caption",className:d.editedLabel},"(",L,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));ct.displayName="EditableRelationItem";const st=ct,ut=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:t,direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dt=n(98989),mt=n(83543);const gt=(0,K.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ft=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=gt(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,s={onClick:t,className:l.arrowIcon};return i||!c||(0,b.xvW)(n)?null:a?o().createElement(mt.Z,s):o().createElement(dt.Z,s)},bt=(0,K.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),ht=e=>{let{config:t,connection:n,children:l}=e;const i=bt(),{showInactive:c}=(0,r.useContext)(je),{connections:s,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,c]=(0,r.useState)(!1),[s,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>E.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>E.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pt(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(E.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||h(),c((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:h,loading:s,total:g}})({config:t,connection:n,relationActivityFilter:c?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(s)),[s]);return o().createElement(o().Fragment,null,l((()=>o().createElement(ft,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ne.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Qt,{isLoading:m,config:t,loadRelations:d,connections:s,total:g,parentEntityUri:n.entity.entityUri}))))},yt=(0,K.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),vt=e=>{let{className:t,connections:n=[],config:l,mode:c,noDataText:s,parentEntityUri:u}=e;const p=(0,a.useSelector)(E.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>E.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>E.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(E.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>E.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),v=yt(),x=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:c,metadata:p,parentEntityUri:u});(0,i.pipe)(E.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,c,p,h,u]),w=(0,r.useCallback)((e=>{h(E.N5.relations.actions.closeRelationEditor(l.id,e)),h(E.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>E.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=E.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(E.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),C=l.content,S=ut(C.inRelations,C.outRelations),O=(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);h(E.N5.relations.actions.addRelation(l.id,t))}),[h,l,S]),P=(0,r.useCallback)((e=>{h(E.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,S]),[N,k]=(0,i.partition)(b.xvW,n),Z=g&&f,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,b.xvW)(e),s=`${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(ht,{config:l,connection:e,key:s},(t=>r?o().createElement($e.Z,{connection:r,config:l,mode:c,metadata:p}):o().createElement(st,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(E.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:O,onIgnoreRelation:P})))},j=Z&&(!d||d&&d.parentEntityUri===u),D=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},j&&o().createElement(q.Button,{color:"primary",onClick:x,className:v.moreButton},o().createElement(re.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},y().text("Add"))),D&&o().createElement($e.Z,{connection:d,config:l,mode:c,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(q.Divider,{className:v.divider}),k.map(R),T&&o().createElement(q.Typography,{className:v.noData},s))};var xt=n(19603),Et=n(94646),wt=n(78101),Ct=n(80931);const St=(0,K.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pt(e,t,n[t])}))}return e}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Nt=e=>{let{connection:t,className:n}=e;const l=St(),{relation:c}=t,s=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(E.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==c?void 0:c.relationType)),[null==c?void 0:c.relationType,u]),d=(0,r.useMemo)((()=>Ot({attributes:Ot({},E.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:s,connection:t})),[t,s]);return m?o().createElement(wt.A.Provider,{value:h},o().createElement(Ct.Z,{className:F()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:F()(l.attributesList,n)},y().text("No attributes"))};var kt=n(86602),Zt=n(82726);const Tt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Ze.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?kt.Z:Zt.Z,onClick:n})},Rt=(0,K.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),jt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:c}=e;const s=Rt(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(E.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:v,relationLabel:x}=nt(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),C=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:F()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:u})},o().createElement("div",{className:F()(s.row,xt.U)},n&&n(),o().createElement("div",{className:s.labelWrapper},o().createElement(Ye.Z,{className:s.entityAvatar,entityType:h}),o().createElement(Ke.Z,{value:v,className:s.entityLabelContainer},o().createElement(tt,{label:y,entity:p},o().createElement("span",{className:s.entityLabel},y)),x&&o().createElement("span",{className:s.relationLabel},`, ${x}`))),o().createElement("div",{className:s.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(Et.Z,{className:s.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(lt,{size:"small",acceptRelation:l(t),ignoreRelation:c(t)}),!u&&o().createElement(Tt,{show:m,onToggle:()=>{g((e=>!e))},className:s.showDetails}))),m&&o().createElement(Nt,{connection:t}))}));jt.displayName="RelationItem";const Dt=jt;var It=n(52691),Lt=n(16208);const At=e=>e.filter((e=>5===e.value)).length,Mt=e=>e.filter((e=>1===e.value)).length,zt=e=>0===e.length?"0%":At(e)/e.length*100+"%",Ft=e=>0===e.length?"0%":Mt(e)/e.length*100+"%",Ut=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),Vt=e=>{let{ratings:t,className:n}=e;const r=Ut();return o().createElement("div",{className:F()(r.wrapper,n)},o().createElement(q.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:zt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ft(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:F()(r.likesCount,r.count)},o().createElement(It.Z,{className:r.icon}),At(t)),o().createElement("div",{className:r.count},o().createElement(Lt.Z,{className:r.icon}),Mt(t))))},Ht=(0,K.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Bt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Ht(),i=(0,a.useSelector)(E.ZP.selectors.getUserName),c=t.find((e=>{let{user:t}=e;return t===i})),s=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(q.Button,{onClick:n,variant:"text",size:"small",className:F()(l.button,l.likeButton,{[l.isActive]:5===(null==c?void 0:c.value)})},"Agree"),o().createElement(ze.Z,{buttonProps:{endIcon:o().createElement(mt.Z,null),variant:"text",size:"small",className:F()(l.button,{[l.isActive]:1===(null==c?void 0:c.value)})},buttonContent:1===(null==c?void 0:c.value)?c.comment:"Disagree",menuItems:s,menuId:"disagree-dropdown-menu-button"}))},Wt=(0,K.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),qt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:c,ignoreRelation:s}=e;const u=Wt(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(E.ZP.selectors.getMetadata),{entityLabel:y,entityType:v,preparedUri:x,relationLabel:w}=nt(t,h),C=(null==f?void 0:f.ratings)||[],S=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant),O=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:F()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(q.Box,{display:"flex",minHeight:"44px",className:xt.U},o().createElement(q.Box,{display:"flex",alignItems:"center"},o().createElement(q.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Ye.Z,{entityType:v,className:u.entityTypeIcon})),o().createElement(q.Box,{display:"flex",flexDirection:"column"},o().createElement(Ke.Z,{value:x,className:u.entityLabelContainer},o().createElement(tt,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Bt,{ratings:C,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(Et.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(lt,{acceptRelation:c(t),ignoreRelation:s(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Vt,{ratings:C,className:u.ratings}),o().createElement(Tt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Nt,{connection:t,className:u.relationAttributes}))},Gt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:c}=e;const{isComplex:s,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=ut(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:c}=l,s=r.direction===b.Nsj.IN,u=s?a.entityUri:n,p=s?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:c}).then(t).catch((e=>{o(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,c),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(S.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(ht,{config:i,connection:e,key:r},(t=>s?o().createElement(qt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Dt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Gt.displayName="RelationsList";const _t=Gt,$t=(0,K.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Qt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const s=$t(),{selectors:u}=E.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(I.Z,null):(0,b.KIu)(d)?o().createElement(vt,{connections:l,className:s.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:c}):i>0?o().createElement(_t,{config:n,loadRelations:r,connections:l,className:s.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(q.Typography,{className:s.noData},m)},Xt=(0,K.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),Yt=e=>{let{config:t,className:n}=e;const l=Xt(),{page:c,setPage:s,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(je),{selectors:h}=E.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),v=(0,a.useSelector)(h.getEntity),x=(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)((()=>{f("")}),[null==v?void 0:v.uri]);const S=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:O,reload:P}=(0,Pe.a)({sorting:C,filter:S,page:c,rowsPerPage:u,config:t,entity:v,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(y)),[y]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Ne.X.Provider,{value:N},o().createElement(B.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Fe.Provider,{value:k},o().createElement(_e,{title:t.caption,total:x})),o().createElement("div",{className:l.content},o().createElement(Qt,{isLoading:O,config:t,loadRelations:P,connections:y,total:x}),x>u&&o().createElement(W.Z,{classes:{root:l.pagination},count:x,rowsPerPageOptions:[],rowsPerPage:u,page:c,onChangePage:s})))))};Yt.displayName="RelationsView";const Kt=o().createContext(null);Kt.displayName="TableAttributeContext";var Jt=n(86361),en=n(26180),tn=n(31276);function nn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){rn(e,t,n[t])}))}return e}function rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const on="CHANGE_SEARCH_QUERY",an=nn({},en.ZP.actions,{changeSearchQuery:(0,tn.zD)(on)}),ln=(e,t)=>t.type===on?nn({},e,{searchQuery:t.payload,page:0}):en.ZP.reducer(e,t);var cn=n(92332),sn=n(67353);function un(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){pn(e,t,n[t])}))}return e}function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},mn=(0,K.Z)((()=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},rowCell:{fontSize:"13px",overflow:"hidden"},blobWrapper:{position:"relative",overflowY:"auto",overflowX:"hidden",whiteSpace:"pre",maxHeight:"100px",boxSizing:"border-box",padding:"15px 25px 0 25px"},defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"15px 25px 0 25px"},updateAttribute:un({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:un({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:un({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},b.zXF[b.Y1q.deleteAttribute]),"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":dn}}))),gn=(0,sn.Z)((e=>{const t=mn();return o().createElement("div",{className:t.headCell},o().createElement(cn.default,e))}));var fn=n(72768),bn=n(95613);const hn=e=>{let{value:t,historyClassName:n}=e;const r=mn();return o().createElement("div",{className:r.blobWrapper,onScroll:tn.UW},o().createElement("span",{className:r[n]},t))},yn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=mn(),{value:l,uri:c}=t,{appearance:s}=(0,r.useContext)(R.m),u=(0,i.pipe)(b.IFm,b.o_F)(c,s);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(hn,{value:l,historyClassName:u});{const e=o().createElement(fn.Z,{value:l,dataTypeDefinition:n});return o().createElement(bn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xn=(e,t)=>{const{uri:n,label:r,children:o,name:a}=e;return(0,i.reject)(i.isNil,{id:(0,b.Tde)(n,t),label:r,dataTypeDefinition:(0,b.PFL)(e),children:null==o?void 0:o.map((e=>xn(e,t.concat({name:a}))))})},En=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),wn=e=>{if((0,b.vZp)(e)){const t=En(e);return t.length>1?t.slice(0,-1):null}return null},Cn=(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){vn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:wn(e.id),headCellRenderer:gn,rowCellValueRenderer:yn})));var Sn=n(99341);function On(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pn=n(52016),Nn=n(1876),kn=n(60894);const Zn=(0,K.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Tn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:c,onChangeColumns:s}=e;const u=Zn();return o().createElement(G.Z,{title:t,className:u.header},o().createElement(X.i,{query:n,onChange:r}),o().createElement(Nn.Z,{enabled:a,onClick:l}),o().createElement($.Z,{height:24,margin:4}),o().createElement(kn.Z,{columnsData:i,selectedColumns:c,onChangeColumns:s}))};function Rn(){return Rn=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},Rn.apply(this,arguments)}const jn=(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=mn();return o().createElement("div",{className:F()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Rn({key:t,value:e},l)))))}));var Dn=n(85709);const In=(0,K.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}}))),Ln=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Ze.k,{tooltipTitle:y().text("Edit"),icon:Qe.Z,size:"L",onClick:t}),n&&o().createElement(Ze.k,{tooltipTitle:y().text("Remove"),icon:Xe.Z,size:"L",onClick:n}))};function An(){return An=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},An.apply(this,arguments)}const Mn=e=>{let{columnsData:t,values:n,sorting:l,onSort:c,filters:s,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,b.xIV)(e))(t))(En(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Cn(t)),[t]),y=In(),v=(0,a.useSelector)(E.ZP.selectors.getMode),x=(0,b.KIu)(v),w=(0,a.useSelector)(E.ZP.selectors.getMetadata),C=(0,a.useSelector)(E.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:O}=(0,r.useContext)(Kt),P=(0,r.useCallback)((e=>o().createElement(jn,An({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Pn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!x||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,x]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,b.xv5)({attributeType:O,mode:v,attributeValue:D,metadata:w,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,D)}));var D;const I="number"==typeof N&&(e=>Z(p)&&(0,b.yv0)({attributeType:O,mode:v,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:O,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,O,C]),M=R||!j&&!I?void 0:o().createElement(Ln,{onEdit:I?L:void 0,onRemove:j?A:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Dn.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:c,filters:s,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:M,context:z,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},zn=(0,K.Z)((()=>({actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}})));function Fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Un=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:c,hasChanges:s,attributeValue:u}=e;const p=zn(),m=(0,a.useSelector)(E.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Kt),f=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,m)||{})),h=(0,a.useSelector)(E.ZP.selectors.getMode),v=(0,a.useDispatch)(),x=(0,r.useContext)(d.m),w=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.addAttributes,v)(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){Fn(e,t,n[t])}))}return e}({},e,{viewId:x}))))),[x,v]),C=(0,b.ZiX)(m),S=(0,a.useSelector)((e=>E.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),O=(0,r.useCallback)((0,i.pipe)(E.N5.errors.actions.errorDeactivated,v),[v]);return o().createElement(o().Fragment,null,o().createElement(le.Z,{expanded:!0,attributeValue:u,showEmptyEditors:C,onDeleteAttribute:c,onDeactivateError:O,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:S,attributeType:g,ownError:(0,b.ADq)(u,null,g.uri,S)}),o().createElement("div",{className:p.actionButtons},o().createElement(q.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(q.Button,{color:"primary",disabled:!s,onClick:()=>{l(u)}},y().text("Apply"))))},Vn=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Hn(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){Bn(e,t,n[t])}))}return e}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wn=[],qn=15,Gn=e=>{let{config:t,className:n}=e;const{caption:l,max:c=qn}=t,s=Vn(),{values:u,page:p,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:v,onFilter:x,onSort:w,onToggleFilters:C,onChangeColumns:S,filters:O,sorting:P,totalVisibleValues:N,hasPaging:k,attributeType:Z,showTable:T,allColumnsData:R}=(0,r.useContext)(Kt),{checkHasChanges:j,onChangeAttribute:D,onDeleteAttribute:L,onAdd:A,onCancel:M,onApply:z,onStartEditing:U,modifiedValues:V,editingValues:H,deletedUris:_}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(E.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const c=(0,a.useDispatch)(),s=(0,r.useContext)(d.m),{attributeType:u,values:p}=(0,r.useContext)(Kt),m=(0,a.useSelector)(E.ZP.selectors.getEntityUri),g=(0,a.useSelector)(E.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(E.N5.actions.modifyAttribute,c)(Hn({},e,{viewId:s}))}),[s,c]),h=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.removeAttribute,c)(Hn({},e,{viewId:s}))),[s,c]),y=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:m,attributeType:u});t(e.uri),f(Hn({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),v=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),x=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Hn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),C=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,m)||{})),S=(0,b.KIu)(l),O=(0,b.xy8)(u),P=(0,i.pathOr)(Wn,[O,null==u?void 0:u.name],C),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),k=(0,r.useMemo)((()=>S?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(p):[]),[P,p]),Z=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:h,onAdd:y,onCancel:x,onApply:w,onStartEditing:v,modifiedValues:N,editingValues:Z,deletedUris:k}})(),$=(0,a.useSelector)(E.ZP.selectors.getMode),Q=(0,b.KIu)($),X=Q?V:u,{canCreate:Y}=(0,Pn.l)(),K=Y(t)&&Z&&(0,b.Vg3)({attributeType:Z,mode:$})&&!H.length,J=(0,r.useMemo)((()=>v.map((e=>R.find((0,i.propEq)("id",e))))),[v,R]);return o().createElement(B.Z,{className:F()(s.root,n)},T?o().createElement(o().Fragment,null,o().createElement(Tn,{title:l,total:N,columnsData:R,selectedColumns:v,onChangeColumns:S,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!O,onToggleFilters:C}),o().createElement("div",{style:{position:"relative"}},Q&&o().createElement("div",{className:s.editor},K&&o().createElement(q.Button,{color:"primary",onClick:A,className:s.addButton},o().createElement(re.Z,{classes:{root:s.icon}}),o().createElement("div",{className:s.buttonLabel},y().text("Add"))),H.map((e=>o().createElement(Un,{key:e.uri,attributeValue:e,onChangeAttribute:D,onDeleteAttribute:L,onCancel:M,onApply:z,hasChanges:j(e)})))),J.length>0&&o().createElement(Mn,{columnsData:J,config:t,values:X,filters:O,onFilter:x,sorting:P,onSort:w,onEdit:U,onDeleteAttribute:L,deletedUris:_}),k&&o().createElement(W.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:c,page:p,onChangePage:m}),g&&o().createElement(I.Z,null))):o().createElement(o().Fragment,null,o().createElement(G.Z,{title:l,className:s.header}),o().createElement(q.Typography,{className:s.noData},y().text("No data"))))};var _n=n(58600);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}let Qn=0;const Xn=()=>Qn++,Yn=e=>{const t={children:[],nodeId:Xn()};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,c={entity:l,children:[],nodeId:Xn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(c.root=i),o.children.push(c),o=c}}return t.children},Kn=(0,K.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.primary.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 Jn=n(1242);const er=o().createContext(null);var tr=n(72383),nr=n(55400);const rr=e=>{e.target.src=Jn},or=e=>{let{node:t}=e;const{entity:{label:n,uri:l},nodeId:i}=t,c=Kn(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(E.ZP.selectors.getAbsoluteImagePath),p=(0,a.useSelector)(E.ZP.selectors.getMetadata),d=(0,a.useSelector)(E.ZP.selectors.getUIPath),{uri:m}=(0,a.useSelector)(E.ZP.selectors.getEntity),g=(0,r.useContext)(er),{generateEntityUrl:f}=(0,r.useContext)(tr.v),h=f({uiPath:d,uri:l}),y=l===m,v=(0,b.nt9)(p,t.entity.type)||{},x=(0,b.VD3)(p,v,"typeGraphIcon"),w=x&&(0,b.vPL)(u,x),C=(0,r.useCallback)((()=>{s(E.ui.actions.openEntity({uri:l,viewId:g.id}))}),[s,g,l]);return o().createElement("div",{className:c.wrapper,"data-node-id":i},o().createElement("div",{className:c.container},o().createElement(q.Avatar,{className:F()(c.avatar),src:w||Jn,onError:rr}),o().createElement("span",{className:F()(c.link,{[c.selected]:y})},o().createElement(nr.Z,{to:h,onClick:C},n))))},ar=((0,r.memo)(or),e=>{let{node:t}=e;return t.nodeId}),lr=(0,K.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function ir(){return ir=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},ir.apply(this,arguments)}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sr(){return sr=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},sr.apply(this,arguments)}const ur={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:c,treeIndex:s,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=lr();return o().createElement("div",sr({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:c,treeIndex:s})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:F()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:c,treeIndex:s}):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,c=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"]),s=lr(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:s.lineBlock},l.root&&o().createElement("div",{className:s.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:s.verticalLine}),o().createElement("div",{className:s.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){cr(e,t,n[t])}))}return e}({},c.style,{width:f});return o().createElement("div",ir({},c,{className:s.node,style:b}),p,o().createElement("div",{className:s.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function pr(){return pr=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},pr.apply(this,arguments)}const dr=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",pr({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"})))},mr=e=>{let{title:t,onGraphOpen:n}=e;const r=Kn();return o().createElement(G.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Ze.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:dr,onClick:n,size:"L"})))};var gr=n(9757);const fr=(0,K.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function br(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){hr(e,t,n[t])}))}return e}function hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const yr=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[c,s]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:b,popup:h}=(0,gr.E)(t),y=fr(),v=f||d;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{s(!!h)}),[h]),(0,r.useEffect)((()=>{c&&l.current&&(l.current.innerHTML="",h&&Array.from(h.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[c,h]);const x=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(q.Dialog,{ref:l,open:!!h}),o().createElement(q.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:br({},x,b),className:F()(y.root,n)}))):null};var vr=n(14940);const xr=(0,K.Z)({dragHandleContainer:{position:"relative",width:"100%",height:"inherit"},dragHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $dragHandle":{visibility:"visible"},".react-grid-item.static &:hover $dragHandle":{visibility:"hidden"}},dragHandle:{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)"}}),Er=e=>{const t=t=>{const n=xr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:F()("viewDraggableHandle",n.dragHandle)},o().createElement(vr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var wr=n(2256);const Cr=e=>{const t=t=>o().createElement(wr.Z,{error:o().createElement(A.ZP,{LogoRenderer:A.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:A.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Sr=(0,K.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Or=n(29103),Pr=n(83911),Nr=n(48747),kr=n(22385);const Zr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Tr=(0,K.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Rr=n(13074),jr=n(24338);const Dr=(0,K.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Ir=Dr,Lr=e=>{let{totalImages:t}=e;const n=Ir(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(q.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Mr(e,t,n[t])}))}return e}function Mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(E.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,s.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(jr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(E.N5.actions.removeAttribute,c)(Ar({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(E.N5.actions.modifyAttribute,c)(Ar({},e,{viewId:d})),imageSize:Vr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Lr,{totalImages:p.length}))},Fr=(0,K.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Ur=Fr,Vr={imageMargin:4,imageWidth:162,imageHeight:162};var Hr=n(28741);const Br=(0,K.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Wr=n(49734),qr=n(98808),Gr=n(93428),_r=n(30885);function $r(){return $r=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},$r.apply(this,arguments)}const Qr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,a.useSelector)(E.ZP.selectors.getEntity),{canMerge:p,canMark:m}=(0,b.hXd)(s,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:qr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(d.m),y=(0,r.useCallback)((()=>{i(),c(E.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[c,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(Gr.H,$r({},f,{onFinishRequest:y})),m&&o().createElement(_r.i,$r({},f,{onFinishRequest:i})))},Xr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const c=(0,a.useSelector)(E.ZP.selectors.getMetadata),s=(0,a.useSelector)(E.ZP.selectors.getEntity);return o().createElement(Wr.M,{match:r,entity:s,entitiesMap:n,metadata:c,className:xt.U},o().createElement(Et.Z,{uri:(0,b.E_P)(s.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:s.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(Qr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Yr={showTransitiveMatches:!0,showInactiveEntities:!1},Kr={order:b.KM9.asc,field:"score"};var Jr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Jr||(Jr={}));const eo=e=>(0,i.pipe)(Cr,Er)(e),to=eo((e=>{let{className:t}=e;const n=Sr();return o().createElement(B.Z,{className:F()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),no=eo((e=>{let{className:t,config:n}=e;return o().createElement(U.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),ro=eo((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),c=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),s=Se(e,c),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Oe(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},s)})(n);return o().createElement(V.Provider,{value:a},o().createElement(xe,{config:n,className:t}))})),oo=eo((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(E.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),c=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,b.WN0)(e,t)),(0,i.map)((e=>xn(e,[t]))),(0,i.chain)(b.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),s=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:c.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[c]),[u,p]=(0,r.useReducer)(ln,s),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>b.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,Sn.su)(o,r)})))).orSome([]))(c,m);return e.length?e:null}),[m,c]),v=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:d})),[y,f,g,d]),{changeSearchQuery:x,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:O,changeColumns:P}=(0,Jt.o)({actions:an,dispatch:p}),N=Se(e,v);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){On(e,t,n[t])}))}return e}({},u,{setSearchQuery:x,setPage:w,onSort:C,onFilter:S,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden),allColumnsData:c},N)})(t);return o().createElement(Kt.Provider,{value:l},t&&o().createElement(Gn,{config:t,className:n}))})),ao=eo((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[i,c]=(0,r.useState)(e.sortOrder||"asc"),[s,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),c((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:s,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(je.Provider,{value:a},o().createElement(Yt,{config:t,className:n}))})),lo=eo(yr),io=eo((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(E.ZP.selectors.getEntityUri),{treeData:c,setTreeData:s}=((e,t)=>{const n=(0,Ee._)(),[o,l]=(0,r.useState)([]),c=(0,a.useSelector)(E.ZP.selectors.getEntity);return(0,we.D)((()=>{const e=o.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$n(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],c),e);l(t.map((0,i.prop)("root")))}),[null==c?void 0:c.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||n((0,b.RFJ)({uri:e,graphUri:t})).then(Yn).then(l).catch((e=>{console.warn(e)})),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l}})(l,t.graph.type),u=Kn(),p=(0,a.useDispatch)(),{id:d,graph:m}=t,g=(0,r.useCallback)((()=>{p(E.ui.actions.openGraph({viewId:d,graphType:m.type,entityUri:l}))}),[p,d,m,l]),f=(0,r.useCallback)((e=>({title:o().createElement(or,{node:e.node})})),[]);return o().createElement(B.Z,{className:n},o().createElement(mr,{onGraphOpen:g,title:t.caption}),o().createElement(er.Provider,{value:t},o().createElement("div",{className:u.treeContainer},o().createElement("div",{className:u.tree},o().createElement(_n.ZP,{isVirtualized:!1,treeData:c,canDrag:!1,theme:ur,generateNodeProps:f,onChange:s,getNodeKey:ar})))))})),co=eo((e=>{let{config:t,className:n}=e;const l=Br(),c=(0,a.useSelector)(E.ZP.selectors.getEntity),s=(0,b.wwR)(c),[u,p]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:v,total:x}=(0,Hr.s)({enabled:!!s,entity:c,options:Yr,filter:"",page:0,sorting:Kr,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{v()}),[v]),C=(0,a.useDispatch)(),O=(0,r.useContext)(d.m),P=(0,r.useCallback)((()=>{C(E.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:O}))}),[C,O]),N=(0,r.useMemo)((()=>(0,b.NVY)(s,(0,i.map)(b.ev7,f))),[s,f]),{getCommentsCount:k}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{k(N)}),[k,N]);const Z=x>3&&!(0,i.isEmpty)(f),T=u?Jr.Loading:(0,i.isEmpty)(f)?Jr.NoData:Jr.Loaded;return o().createElement(Ne.X.Provider,{value:h},o().createElement(B.Z,{className:F()(l.root,n)},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},T===Jr.Loading&&o().createElement(I.Z,null),T===Jr.NoData&&o().createElement(q.Typography,{className:l.noData},y().text("No matches found")),T===Jr.Loaded&&f.map((e=>o().createElement(Xr,{config:t,entitiesMap:h,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),Z&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(q.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),so=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,96617)).then((e=>({default:eo(e.HierarchyTreeView)}))))),uo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:eo(e.RelationshipsTableView)}))))),po=eo((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=Tr(),s=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,a.useSelector)(E.ZP.selectors.getEntity),p=(0,a.useSelector)(E.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),c=(0,Ee._)();return(0,r.useEffect)((()=>{i(!0),c((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Zr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,c]),{markers:o,loading:l}})(u,s,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:c.fullHeight},o().createElement(I.Z,null))),[c]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(B.Z,{className:F()(c.root,i)},m&&o().createElement(I.Z,null),o().createElement(kr.Z,{size:"S",icon:n?Pr.Z:Or.Z,onClick:()=>l(t.id),className:c.fullscreenBtn}),o().createElement(Nr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:c.fullHeight,mapKey:p,mapOptions:h}))})),mo=eo((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,c=Ur(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(E.ZP.selectors.getMode),p=(0,a.useSelector)(E.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(E.ZP.selectors.getMetadata),m=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,v=t["text-empty"]||y().text("No data found"),x=(0,r.useCallback)((e=>s(E.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return o().createElement(B.Z,{className:n},o().createElement(G.Z,{title:t.caption}),o().createElement("div",{className:c.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:x};return o().createElement(zr,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:Vr,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:x};return o().createElement(o().Fragment,null,o().createElement(Rr.Z,e),o().createElement(Lr,{totalImages:h}))}}return o().createElement(q.Typography,{className:c.noData},v)})()))}));class go{}go.ViewTypes=b.ZIY,go.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case go.ViewTypes.HierarchyTree:return o().createElement(so,{config:r,store:n,className:a});case go.ViewTypes.HierarchyPaths:return o().createElement(io,{config:r,className:a});case go.ViewTypes.RelationsTable:return o().createElement(uo,{config:r,store:n,className:a});case go.ViewTypes.Relations:return o().createElement(ao,{config:r,className:a});case go.ViewTypes.Attributes:return o().createElement(no,{className:a,config:r});case go.ViewTypes.SingleAttribute:return o().createElement(ro,{config:r,className:a});case go.ViewTypes.AttributeTable:return o().createElement(oo,{config:r,className:a});case go.ViewTypes.Map:return o().createElement(po,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case go.ViewTypes.Custom:return o().createElement(lo,{config:r,className:a});case go.ViewTypes.ImageAttribute:return o().createElement(mo,{config:r,className:a});case go.ViewTypes.PotentialMatches:return o().createElement(co,{config:r,className:a})}},go.getComponent=e=>go.getComponentBy("class",e)||go.getComponentBy("react-class",e)||o().createElement(to,{className:e.className});const fo=go,bo=()=>null,ho=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const c=Sr();return o().createElement(r.Suspense,{fallback:o().createElement(bo,null)},fo.getComponent({config:t,store:n,className:F()(c.component,{[c.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));ho.displayName="ViewComponent";const yo=(0,K.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function vo(){return vo=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},vo.apply(this,arguments)}const xo=["onConfigChanged","onRemove"],Eo=e=>{var t;let{layoutItemConfig:n,views:l,className:c,children:s,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),h=yo(),y=(0,a.useSelector)(E.ZP.selectors.getGoogleMapKey),{store:v}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const x=f.class===fo.ViewTypes.Custom;if(x&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC)return null;if(f.class===fo.ViewTypes.Map&&!y)return null;const w=(e=>{var t;return null===(t=Object.entries(b.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(f.class);return o().createElement("div",vo({},(0,i.omit)(xo,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:F()(c,{[h.item]:!x})}),o().createElement("div",{className:F()({[h.fixedSizeContainer]:!m})},m,o().createElement(ho,{store:v,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),s)},wo=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(M.Z,{LayoutItem:Eo,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var Co=n(87685);const So=(0,K.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Oo=e=>{let{notification:t}=e;const n=So({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(E.ZP.selectors.getAutoCloseInterval),c=t.autoHideDuration||i&&1e3*i||5e3,[s,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(E.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{s.cancelAction&&l(s.cancelAction),u(void 0)}),[s]),f=(0,r.useCallback)((()=>{l(s.applyAction),u(void 0),l(E.ui.actions.closeNotification(t.id))}),[s,t]),b=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(q.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),h=o().createElement(o().Fragment,null,o().createElement(kr.Z,{className:n.closeIcon,size:"S",icon:Co.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(q.Portal,{container:document.body},o().createElement(q.Snackbar,{autoHideDuration:c,open:p,classes:{root:n.snackbar},action:b,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),o().createElement(We.Z,{open:!!s,title:null==s?void 0:s.confirmationText,content:null==s?void 0:s.confirmationDescription,onSave:f,onDiscard:g,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},Po=()=>{const e=(0,a.useSelector)(E.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Oo,{key:e.id,notification:e})))):null};var No=n(72753),ko=n(43576),Zo=n(64459),To=n(3409),Ro=n(93873),jo=n(22860);function Do(){return Do=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},Do.apply(this,arguments)}const Io=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",Do({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))};function Lo(){return Lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lo.apply(this,arguments)}const Ao=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",Lo({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},Mo=(0,K.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function zo(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){Fo(e,t,n[t])}))}return e}function Fo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Uo=e=>o().createElement(q.SvgIcon,e,o().createElement(Io,null)),Vo=e=>o().createElement(q.SvgIcon,e,o().createElement(Ao,null)),Ho=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),Bo=e=>{let{className:t,profileBandConfig:n}=e;const l=Mo(),c=(0,a.useDispatch)(),s=(0,a.useSelector)(E.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(E.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,u.uri))),d=(0,a.useSelector)(E.ZP.selectors.getMetadata),m=(0,a.useSelector)(E.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(E.ZP.selectors.getMode),f=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),h=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),v=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),x=(0,a.useSelector)(E.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,C=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),S=x===b.OXy.Saving,O=x===b.OXy.Cloning||S,[P,N]=(0,r.useState)(!1),k=(0,r.useCallback)((()=>{N(!1)}),[]),Z=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(E.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(E.ZP.selectors.getMetadata),c=(0,a.useDispatch)(),s=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,s),[l,s]),d=(0,b.nt9)(l,s),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(s),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,s]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);c(E.N5.entity.actions.entityCloneRequested({data:zo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:k}),T=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:b.fO_.EDITING,description:y().text("Edit profile directly"),icon:ko.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:b.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Uo,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:b.fO_.VIEWING,description:y().text("Read or print profile"),icon:No.Z,permission:"READ"}]),[]),R=(0,r.useMemo)((()=>[...Z?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Vo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:Xe.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&c(E.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[c,u.uri,Z]),j=!v&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(C),D=(0,b.ZiX)(null==u?void 0:u.uri),I=(0,r.useMemo)((()=>Ho(T,C,D,m,s)),[T,C,m,s,D]),L=(0,r.useMemo)((()=>Ho(R,C,D,m,s)),[R,C,m,s,D]),A=(0,r.useCallback)((e=>{c(E.N5.mode.actions.modeUpdated(e))}),[c]),M=(0,r.useCallback)((()=>{c(E.N5.mode.actions.modeCancelEditing())}),[c]),z=(0,r.useCallback)((()=>{c(E.N5.actions.saveProfile())}),[c]);return o().createElement(o().Fragment,null,o().createElement(Zo.Z,{className:F()(t,xt.U),entity:f&&p?p:u},o().createElement(q.Box,{display:"flex",alignItems:"center"},o().createElement(q.Box,{mr:3},f&&o().createElement(q.Box,{className:l.editingButtons},o().createElement(q.Button,{variant:"outlined",onClick:M,"data-reltio-id":"reltio-profile-cancel-editing",disabled:O},y().text("Cancel")),o().createElement(q.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:z,disabled:O},(0,b.fnZ)(g)?y().text("Suggest"):y().text("Save"))),v&&h?o().createElement(To.Z,null):h&&o().createElement(Ro.a,null)),j&&o().createElement(jo.T,{optionsGroup:I,buttonsGroup:L,value:g,onChange:A,disabled:O})),o().createElement(q.Box,{className:l.comments},o().createElement(Et.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!Z&&o().createElement(We.Z,{open:P,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:Z,onDiscard:k,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var Wo=n(71820),qo=n(85890),Go=n(26789),_o=n(54362),$o=n(6674),Qo=n(91515),Xo=n(52043),Yo=n(17308),Ko=n(39827),Jo=n(80147),ea=n(76569);const ta=(0,K.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),na=()=>{const{total:e}=(0,r.useContext)(T.O),t=ta();return o().createElement(q.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(ea.Z,null))};var ra=n(26313),oa=n(9371),aa=n(4426);const la=(0,K.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ia=()=>{const e=la(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(S.h),i=(0,a.useSelector)(E.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const c=(0,ra.Q)(n);return o().createElement(Ne.X.Provider,{value:c},o().createElement(q.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(oa.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(q.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(aa.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var ca=n(46626);const sa=(0,K.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),ua=()=>{const e=sa(),{tasks:t,loading:n}=(0,r.useContext)(T.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(I.Z,null),t&&t.map((e=>o().createElement(ca.s,{key:e.taskId,task:e}))))};function pa(){return pa=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},pa.apply(this,arguments)}const da=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",pa({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"})))))},ma=()=>{const{commentsMap:e}=(0,r.useContext)(S.h),t=ta();return o().createElement(q.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(da,null))};var ga=n(10159);const fa=()=>o().createElement(ga.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),ba=()=>o().createElement(ga.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function ha(){return ha=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},ha.apply(this,arguments)}const ya=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",ha({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))},va=(0,K.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),xa=()=>{const e=va(),t=(0,a.useSelector)(E.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(yr,{key:t.id,config:t,className:e.itemWrapper}))))};function Ea(){return Ea=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},Ea.apply(this,arguments)}let wa;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(wa||(wa={}));const Ca=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},Sa=()=>{var e,t,n;const l=ta(),c=(0,a.useSelector)(E.ZP.selectors.isWorkflowSideViewEnabled),s=(0,a.useSelector)(E.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(E.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(E.ZP.selectors.isDBConnectorSideViewEnabled),d=(0,a.useSelector)(E.ZP.selectors.isCollaborationEnabled),m=(0,a.useSelector)(E.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(E.ZP.selectors.getMetadata),f=(0,a.useSelector)(E.ZP.selectors.getEntity),h=(0,r.useContext)(T.O),v=(0,r.useContext)(S.h),[x,w]=(0,r.useState)(null),C=(0,r.useCallback)((e=>{w((t=>t===e?null:e))}),[]),O=(0,r.useCallback)((()=>{w(null)}),[]),P=null!==x,N=x===wa.History,{isHistoryEnabled:k,isProfilePersisted:Z}=(0,Wo.C)({isHistoryTabActive:N,entity:f}),{historyFilter:R,onApplyFilter:j,isLoading:D,historicUris:I,historyWithTotal:L,canLoadMore:A,onLoadMore:M}=(0,qo.k6)({entity:f,enabled:k}),z=c&&s&&!(0,b.ZiX)(null==f?void 0:f.uri),F=u&&d,U=(0,b.mdt)(null==v?void 0:v.commentsMap),V=[{buttonProps:{id:wa.Workflow,icon:na,tooltipTitle:y().text("Workflow")},content:null!=h&&h.total?o().createElement(ua,null):o().createElement(fa,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:Ca(null==h?void 0:h.total),rightContent:o().createElement(Go.G,null)},hidden:!z},{buttonProps:{id:wa.Collaboration,icon:ma,tooltipTitle:y().text("Collaboration")},content:U?o().createElement(ia,null):o().createElement(ba,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:Ca(U)},hidden:!F},{buttonProps:{id:wa.History,icon:Jo.Z,tooltipTitle:y().text("History")},content:Z?o().createElement(_o.Z,{isLoading:D,historyWithTotal:L,contributorsUris:I,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:M,canLoadMore:A}):o().createElement($o.Z,null),headerProps:{content:o().createElement(Qo.Z,{total:Z?((null==I?void 0:I.length)||0)+1:void 0,entityType:(0,b.nt9)(g,null==f?void 0:f.type),filter:R,onApplyFilter:j})}},{buttonProps:{id:wa.DBConnector,icon:ya,tooltipTitle:y().text("D&B Connector")},content:o().createElement(xa,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!p}],H=(0,i.reject)((0,i.propEq)("hidden",!0))(V);return(0,r.useEffect)((()=>{var e;null!==(e=V[x])&&void 0!==e&&e.hidden&&O()}),[x,V,O,H]),o().createElement("div",{className:l.wrapper},o().createElement(Xo.h,{open:P,width:480},!(null!==(e=V[x])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(Yo.P,Ea({},null===(t=V[x])||void 0===t?void 0:t.headerProps,{onClose:O})),null===(n=V[x])||void 0===n?void 0:n.content)),o().createElement(Ko.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(V),onButtonClick:C,activeIndexId:x}))};var Oa=n(39781),Pa=n(16715);const Na="48px",ka="1px solid rgba(0, 0, 0, .125)",Za=(0,K.Z)((e=>({accordion:{borderTop:ka,borderBottom:ka,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Na,minHeight:Na,"&$accordionSummaryExpanded":{height:Na,minHeight:Na}},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},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},goToIcon:{marginLeft:"4px"},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"}}))),Ta=Za;var Ra=n(38016);const ja=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Ta();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:c,items:s,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(q.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(q.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(Ra.Z,null)},i,o().createElement(q.Typography,{className:l.accordionSummaryHeading},c)),o().createElement(q.AccordionDetails,{className:F()(l.accordionDetails,p)},o().createElement("ul",null,s.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function Da(){return Da=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},Da.apply(this,arguments)}ja.displayName="ErrorsPanel";const Ia=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",Da({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},La=(0,i.omit)(["deactivated","path"]),Aa=(0,r.memo)((e=>{let{error:t}=e;const n=Ta(),l=(0,a.useSelector)(E.ZP.selectors.getMetadata),c=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),s=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})(l,t),u=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t),{highlightError:p}=(0,r.useContext)(D.M),d=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},o().createElement("span",{className:n.errorTitle},s,d&&c&&o().createElement(Ze.k,{icon:Ia,size:"XXS",onClick:()=>p(t),tooltipTitle:y().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));Aa.displayName="Error";const Ma=()=>{const e=Ta(),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(La),t.map(La))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(E.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[c,s]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:o().createElement(Oa.Z,{className:F()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?y().text("warning"):y().text("warnings")}),icon:o().createElement(Pa.Z,{className:F()(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)((()=>{s("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return u.length>0?o().createElement(ja,{panels:u,expandedPanelId:c,onToggle:p,ErrorComponent:Aa}):null},za=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));var Fa=n(61756),Ua=n(4109);function Va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ha={},Ba=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i}=e;const c=za({maxWidth:null==n?void 0:n.maxWidth}),s=(0,a.useDispatch)(),u=(0,r.useCallback)((()=>i().then((e=>e.layout?{}:e))),[i]),p=(0,r.useRef)(),d=(0,r.useCallback)((0,b.DsO)(l,1e3),[l]),m=(0,a.useSelector)(E.ZP.selectors.getEntity),g=null!=n&&n.nestedRoute?`/${n.nestedRoute}`:"",f=m?m.type:null,h=f&&n?f+g:null,{isLoaded:v,savedState:M=Ha,updateSavedState:z}=(0,w.w)({getSavedState:u,saveState:d,entityTypeUri:h}),[F,U]=(0,r.useState)([]),[V,H]=(0,r.useState)([]),B=(0,r.useMemo)((()=>x()(n)),[n]),W=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),q=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),G=(0,C.C)({objectIds:q}),_=(0,r.useContext)(S.h),$=(0,O.U)(),Q=(e=>{const t=(0,Fa.v)(e),n=(0,Ua.b)();return(0,r.useMemo)((()=>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){Va(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(null==n?void 0:n.workflow),X=(0,a.useSelector)(E.ZP.selectors.getHistoryEvent);(0,P.a)({entity:m,historyEvent:X});const Y=(0,N.u)(),K=(null===(t=(0,a.useSelector)(E.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"";(0,r.useEffect)((()=>{if(v){const e=B!==M.configHash,{views:t,layout:r}=(0,b.Mfk)({views:e||!M.views?n.views:M.views,layout:e?n.layout:M.layout});H(t),U(r)}}),[v,M,h]),(0,r.useEffect)((()=>{s(E.N5.views.actions.profileViewsSet(V))}),[s,V]),(0,r.useEffect)((()=>{n.sidePanelViews&&s(E.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>{p.current&&(p.current.scrollTop=0)}),[null==m?void 0:m.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(E.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(E.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),c=(0,a.useSelector)(E.ZP.selectors.getMode),s=(0,a.useSelector)(E.ZP.selectors.getProfileViews),u=s&&s.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(E.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&c===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,c,u])})();const J=(0,r.useCallback)((e=>{z({layout:e,views:V,configHash:B}),U(e)}),[z,B,V]),ee=p.current,te=(0,r.useMemo)((()=>({element:ee,priority:["top","bottom"]})),[ee]);return o().createElement(k.j.Provider,{value:!0},o().createElement(Z.s.Provider,{value:$},o().createElement(S.h.Provider,{value:W?_:G},o().createElement(T.O.Provider,{value:Q},o().createElement(R.m.Provider,{value:Y},o().createElement(j.l.Provider,{value:K},o().createElement(D.R,null,o().createElement("div",{className:c.perspectiveView},(!v||!(null!=m&&m.uri))&&o().createElement(I.Z,null),v&&null!=m&&m.uri?o().createElement("div",{className:c.profileContainer},o().createElement("div",{className:c.profileWrapper},o().createElement(Bo,{profileBandConfig:n.profileBand}),!W&&o().createElement(Ma,null),o().createElement("div",{ref:p,className:c.scrollWrapper},o().createElement(L.p.Provider,{value:te},o().createElement(wo,{layout:F,onLayoutChanged:J,views:V})))),o().createElement(Sa,null)):o().createElement("div",{className:c.emptyState},o().createElement(A.ZP,{LogoRenderer:A.B9.NO_DATA,text:y().text("No data to display."),variant:A.tC.embedded})),o().createElement(Po,null)))))))))}));Ba.displayName="ProfilePerspectiveView";const Wa=(0,c.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),qa=e=>{let{config:t,store:n,onResize:h=i.identity,saveState:y,getSavedState:v,qxSandboxApi:x}=e;const E=(0,r.useCallback)((0,b.aYu)(v),[v]),{SnackbarRenderer:w,showSnackbarMessage:C}=(0,p.D)(),S=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:null==S?void 0:S.id},o().createElement(m.S.Provider,{value:C},o().createElement(g.Y.Provider,{value:x},o().createElement(c.StylesProvider,{generateClassName:Wa},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>h(Math.floor(e),Math.floor(t))}),S&&o().createElement(Ba,{config:S,saveState:y,getSavedState:E}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var Ga=n(82842),_a=n(51229),$a=n(91131);const Qa=(0,K.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),Xa=e=>{let{total:t=0}=e;const n=Qa(),l=(0,a.useDispatch)(),i=(0,r.useContext)(d.m),c=(0,r.useCallback)((()=>{l(E.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(G.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(q.Link,{component:"button",variant:"caption",className:n.link,onClick:c,underline:"none"},y().text("Profile")),o().createElement($a.Z,{className:n.icon}),y().text("Tags")),o().createElement(_a.Z,null),o().createElement(q.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Ya=n(20404);const Ka=(0,K.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),Ja=e=>{let{label:t}=e;const n=Ka();return o().createElement(q.Toolbar,{className:n.toolbar},o().createElement(Ya.Z,{className:n.avatar}),o().createElement(q.Typography,{variant:"h6",className:n.label},t))};function el(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){tl(e,t,n[t])}))}return e}function tl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nl=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),rl=[25,50,100],ol=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=nl(),[c,s]=(0,r.useState)(rl[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const c=(0,a.useDispatch)(),s=(0,Ee._)(),u=(0,Ee._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:v,requestTotal:x}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(E.ZP.selectors.getTenant),c=(0,a.useSelector)(E.ZP.selectors.getDtssPath),s=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!s,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=el({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:s,dtssPath:c}).then((0,i.map)((0,b.E7G)(s))):(0,b.ZOr)(e,t)}),[p,s,l,c]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,el({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:s,dtssPath:c}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,s,l,c])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{c(E.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))),g(0)}),[c]);return(0,r.useEffect)((()=>{s(x()).then(g).catch(w)}),[x,s,w]),(0,r.useEffect)((()=>{d(!0),u(v(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,v,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:c}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const v=g>rl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Ja,{label:t}),o().createElement("div",{className:F()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(B.Z,{className:l.tagsView},o().createElement(Xa,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(I.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(Ga.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(W.Z,{count:g,rowsPerPageOptions:rl,rowsPerPage:c,page:u,onChangePage:p,onChangeRowsPerPage:s}))))))}));ol.displayName="TagPerspectiveView";const al=(0,c.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),ll=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(d.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:al},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(ol,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))};var il=n(65321);const cl=(0,K.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),sl=()=>{const e=cl(),t=(0,a.useSelector)(E.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(T.O),l=(0,r.useMemo)((()=>null==n?void 0:n.find((e=>e.objectURIs.includes((0,b.$Rg)(t.uri))))),[t.uri,n]);return o().createElement(Zo.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(il.o,{task:l})))},ul=(0,K.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},perspectiveContainer:{display:"flex",flexGrow:1,overflow:"hidden"},attributesWrapper:{margin:"15px",flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},contentWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1}})));function pl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dl={processTypes:["dataChangeRequestReview"]},ml=(0,r.memo)((()=>{const e=ul(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(E.ZP.selectors.getEntityUri),o=(0,Fa.v)(e),l=(0,r.useCallback)((e=>{"Reject"===e&&t(E.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(E.ui.actions.openEntity({uri:(0,b.$Rg)(n),viewId:null}))}),[t,n]);return(0,r.useMemo)((()=>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){pl(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(dl),l=(0,a.useSelector)(E.ZP.selectors.getEntity);(0,r.useEffect)((()=>{t(E.N5.sidePanelViews.actions.sidePanelViewsLoaded([{id:"common",views:[{point:"com.reltio.plugins.ui.view",id:"com.reltio.plugins.entity.side.WorkflowsView",class:"com.reltio.plugins.entity.side.WorkflowsView"}]}]))}),[t]);const i=!n.loading&&!!l.uri;return o().createElement(T.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(I.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(o().Fragment,null,o().createElement("div",{className:e.contentWrapper},o().createElement(sl,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(U.Z,null))),o().createElement(Sa,null)):o().createElement(A.ZP,{LogoRenderer:A.B9.NO_DATA,text:y().text("No data to display."),variant:A.tC.embedded}))))}));ml.displayName="DCRReviewPerspectiveView";const gl=(0,c.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),fl=e=>{let{config:t,store:n,onResize:r=i.identity}=e;return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:gl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>r(Math.floor(e),Math.floor(t))}),o().createElement(ml,null),o().createElement(f.Z,{showErrorFromStore:!0}))))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>Xe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(17440),c=n(52730),s=n(49885),u=n(65549),p=n(94079),d=n(13980),m=n.n(d),g=n(87918),f=n.n(g),b=n(79692);const h=(0,b.Z)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),y=e=>{let{onClick:t}=e;const n=h();return a().createElement(p.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(u.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},f().text("Add")))};y.propTypes={onClick:m().func};const v=y;var x=n(71153),E=n.n(x),w=n(57014);const C={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},S={color:"rgba(0,0,0,.54)"},O=(0,b.Z)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":C,"$row-cell--inactive &":S},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":C},"row-cell--inactive":S})));function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}const N=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:o}=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","rowValue","isSorted"]);const i=O(),c=(0,w.$qe)(r),s=(0,w.Fn9)(r.relation)&&(0,w.Fn9)(r.entity);return a().createElement("div",{className:E()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:c,[i["row-cell--inactive"]]:!s},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:m().object,cell:m().object,CellValueRenderer:m().elementType,isSorted:m().bool};const k=N;var Z=n(85709),T=n(94656),R=n(39450),j=n(31254),D=n(95613);const I=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,c.useDispatch)(),l=(0,o.useContext)(R.m),u=O(),p=(0,w.idV)(n.entityLabel),d=(0,w.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:u.entityCell},a().createElement(j.Z,{className:u.entityAvatar,entityType:t}),a().createElement(D.Z,{value:p},a().createElement("span",{className:u.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:d,viewId:l}),s.ui.actions.openEntity,r)},p)))};I.propTypes={value:m().shape({entity:m().shape({entityUri:m().string,entityLabel:m().string}),entityType:w.p8l})};const L=I;var A=n(92332);const M=(0,n(67353).Z)((e=>{const t=O();return a().createElement("div",{className:t.headCell},a().createElement(A.default,e))}));var z=n(64091);const F=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const V=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),H=e=>{if(e.startsWith("relation.attributes")){const t=V(e);return t.length>1?t.slice(0,-1):null}return null},B=(0,i.map)((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){U(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:H(e.id),headCellRenderer:M,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:z.Z)});var t})),W=(0,b.Z)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var q=n(27604),G=n(22983);const _=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(p.Tooltip,{title:f().text("Edit")},a().createElement(p.IconButton,{onClick:r},a().createElement(q.Z,null))),n&&a().createElement(p.Tooltip,{title:f().text("Remove")},a().createElement(p.IconButton,{onClick:o},a().createElement(G.Z,null))))};_.propTypes={canUpdate:m().bool,canRemove:m().bool,handleEditRelation:m().func,handleRemoveRelation:m().func};const $=_;function Q(){return Q=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},Q.apply(this,arguments)}const X=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:c,onSort:u,filters:p,onFilter:d,onEditRelation:m,onRemoveRelation:g,basicTableRef:f,allowOnlyCreateNew:b}=e;const h=(0,o.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:o}=r;return(0,i.assoc)(o,((e,t,n)=>{let{entity:r,relation:o}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,w.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,w.Lmx)(n,o.relationType);case"relation.activeness.startDate":return o.startDate;case"relation.activeness.endDate":return o.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,w.tT_)(e))(t))(V(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),y=(0,o.useMemo)((()=>B(n)),[n]),v=W(),x=(0,o.useCallback)((e=>a().createElement(k,Q({},e,{isSorted:!!c&&c.field===e.columnData.id}))),[c]),[E,C]=(0,o.useState)(null),{canRemove:S,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a,allowOnlyCreateNew:l}=e;const i=(0,w.xvW)(r);if(s.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,w.$qe)(r),i=(0,w.V3K)(t,e);return{canRemove:o&&!l&&(0,w.Edd)(n,i),canUpdate:a&&!l&&(0,w.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:g,onEditRelation:m,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([E,"connection"],h)}),P=(0,o.useCallback)((e=>C(e)),[]),N=(0,o.useCallback)((()=>m((0,i.path)([E,"connection"],h))),[E,m,h]),T=(0,o.useCallback)((()=>g((0,i.path)([E,"connection","relation","relationUri"],h))),[E,g,h]),R=S||O?a().createElement($,{handleEditRelation:N,handleRemoveRelation:T,canRemove:S,canUpdate:O}):void 0;return a().createElement("div",{className:v.tableContainer},a().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:y,rowsData:h,sorting:c,onSort:u,filters:p,onFilter:d,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:x,onRowHover:P,hoverRowIndex:E,hoveredRowRightContent:R,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]},ref:f,resizeDebounceDelay:150}))};X.propTypes={mode:m().string,columnsData:T.uz,connections:m().arrayOf(w.Rjq),metadata:w.pGS,filters:m().objectOf(T.Dq),onFilter:m().func,sorting:T.nI,onSort:m().func,onEditRelation:m().func,onRemoveRelation:m().func,basicTableRef:m().shape({current:m().object}),allowOnlyCreateNew:m().bool};const Y=X;var K=n(93416),J=n(75512),ee=n(30553),te=n(32152),ne=n(1876),re=n(60894),oe=n(43054),ae=n(8818);const le=(0,b.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ie=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=le(),i=(0,o.useRef)(),[c,s]=(0,o.useState)(!1),u=()=>s((e=>!e));return a().createElement(a().Fragment,null,a().createElement(ae.k,{className:t,ref:i,tooltipTitle:f().text("More"),icon:oe.Z,onClick:u,size:"L"}),a().createElement(p.Popover,{open:c,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(p.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(p.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:f().text("Show inactive Relationships")})))},ce=(0,b.Z)({header:{padding:"0 4px 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"},moreButton:{marginLeft:"-6px"}}),se=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:c,selectedColumns:s,onChangeColumns:u,showInactive:d,onChangeShowInactive:m}=e;const g=ce();return a().createElement(K.Z,{title:t,className:g.header},a().createElement(J.Z,{widthToHide:500},a().createElement(ee.Z,{height:24,margin:16}),a().createElement(p.Typography,{className:g.totalCaption,variant:"caption"},n>1?f().text("${count} entities",{count:n}):f().text("${count} entity",{count:n}))),a().createElement(te.i,{query:r,onChange:o}),a().createElement(ne.Z,{enabled:l,onClick:i}),a().createElement(ee.Z,{height:24,margin:4}),a().createElement(re.Z,{columnsData:c,selectedColumns:s,onChangeColumns:u}),a().createElement(ie,{className:g.moreButton,showInactive:d,onShowInactiveChange:m}))};se.propTypes={title:m().string,total:m().number,columnsData:T.uz,selectedColumns:m().arrayOf(m().string),onChangeColumns:m().func,searchQuery:m().string,onChangeSearchQuery:m().func,filtersEnabled:m().bool,onToggleFilters:m().func,showInactive:m().bool,onChangeShowInactive:m().func};const ue=se;var pe=n(26180),de=n(31276);function me(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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe="CHANGE_SEARCH_QUERY",be="CHANGE_SHOW_INACTIVE",he=me({},pe.ZP.actions,{changeSearchQuery:(0,de.zD)(fe),changeShowInactive:(0,de.zD)(be)}),ye=(e,t)=>{switch(t.type){case fe:return me({},e,{searchQuery:t.payload,page:0});case be:return me({},e,{showInactive:t.payload});default:return pe.ZP.reducer(e,t)}};var ve=n(26481),xe=n(37152),Ee=n(52016),we=n(10237),Ce=n(11013),Se=n(58662),Oe=n(99136);const Pe=[10,25,50,100],Ne=[{id:"entity.label",get label(){return f().text("Entity label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return f().text("Directional label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return f().text("Start date")},dataTypeDefinition:w.PY2.startDate},{id:"relation.activeness.endDate",get label(){return f().text("End date")},dataTypeDefinition:w.PY2.endDate}],ke=(0,i.pipe)(w.Tde,(0,i.concat)("relation.")),Ze=(0,i.pipe)((0,i.map)((e=>({id:ke(e.uri),label:e.label,dataTypeDefinition:(0,w.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),Te=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(F,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),w.DK$)(o))))([...n,...r])}),Ze,(0,i.concat)(Ne));var Re=n(99341);function je(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){De(e,t,n[t])}))}return e}function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ie=e=>e.uri||e,Le=e=>t=>Ie(t)===e,Ae=(0,i.curry)(((e,t)=>{const n=(t,r)=>{let o=Ie(r),a=!1;o.startsWith("!")&&(o=o.slice(1),a=!0);const l=e[o]&&(0,w.uGe)(w.BDP.READ,e[o]),c=t.find(Le(o))||!l?t:t.concat(r.uri?je({},r,{uri:o}):o);return a?c:(0,i.keys)(e).reduce(((t,r)=>e[r].extendsTypeURI!==o||t.find(Le(r))?t:n(t,r)),c)};return t.reduce(n,[])})),Me=(0,i.curry)(((e,t)=>{const n=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.reduce(((n,r)=>{const o=Ie(r),a=(0,i.path)([o,t,"objectTypeUri"],e);return!a||n.find(Le(a))?n:n.concat(a)}),[])};return je({},t,{entityTypes:[...n("startObject",t.inRelations),...n("endObject",t.outRelations)]})})),ze=(0,i.indexBy)((0,i.prop)("uri")),Fe=(0,i.curry)(((e,t)=>{const n=ze(e.relationTypes),r=ze(e.entityTypes),o=e=>(0,i.evolve)({inRelations:Ae(n),outRelations:Ae(n),entityTypes:Ae(r),nextEntry:o},e);return(0,i.pipe)((0,i.unless)((0,i.either)((0,i.prop)("nextEntry"),(0,i.prop)("entityTypes")),Me(n)),o)(t)})),Ue=(0,b.Z)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}}),Ve=(0,i.pluck)("id",Ne),[He]=Ve;function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const We=(0,i.memoizeWith)(((e,t)=>t.id),((e,t)=>(0,i.evolve)({content:Fe(e)},t))),qe=(0,c.connect)(((e,t)=>{const{config:n}=t;return{connections:s.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:s.ZP.selectors.getTotalByViewId(e,n.id),entity:s.ZP.selectors.getEntity(e),metadata:s.ZP.selectors.getMetadata(e),mode:s.ZP.selectors.getMode(e),relationToAdd:s.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:s.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:s.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,n)=>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){Be(e,t,n[t])}))}return e}({},e,t,n,{config:We(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:c=[],total:u=0,mode:d,relationToAdd:m,relationsToEdit:g=[],checkIfCanAddRelations:b,dispatch:h,readOnlyMode:y}=e;const x={searchQuery:"",filters:null,visibleColumns:Ve,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||He},page:0,rowsPerPage:n.max||15,showInactive:!1},E=Ue(),C=(0,o.useContext)(ve.j)?d:w.fO_.VIEWING,[S,O]=(0,o.useReducer)(ye,x),P=(0,i.pipe)(he.changeSearchQuery,O),N=(0,i.pipe)(he.changeShowInactive,O);(0,o.useEffect)((()=>{P("")}),[null==r?void 0:r.uri]);const{visibleColumns:k,searchQuery:Z,filters:T,sorting:R,page:j,rowsPerPage:D,showInactive:I}=S,L=(0,o.useMemo)((()=>Te(n,l)),[n,l]),A=(0,o.useMemo)((()=>k.map((e=>L.find((0,i.propEq)("id",e))))),[k,L]),M=(0,o.useMemo)((()=>((e,t,n)=>{const r=w.wSh.fromFalsy(e).map(w.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,Re.Tz)(n,t);return(new w.MEy).addClause(r).addClause(o).build()})(Z,T,A)),[T,Z]),{isLoading:z}=(0,xe.a)({sorting:R,filter:M,page:j,rowsPerPage:D,config:n,entity:r,relationActivityFilter:I?w.Ng6.ALL:w.Ng6.ACTIVE_ONLY,mode:d}),F=(0,o.useMemo)((()=>{return e=x.rowsPerPage,Pe.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:U,handlePageChange:V}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(he.changeRowsPerPage,O),handlePageChange:(0,i.pipe)(he.changePage,O)})),[]),H=(0,o.useCallback)((()=>{const e=(0,w.vlo)({config:n,mode:C,metadata:l,parentEntityUri:void 0});(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),h)(e)}),[n,C,l,h]),B=(0,o.useCallback)((e=>{h(s.N5.relations.actions.closeRelationEditor(n.id,e)),h(s.N5.relations.actions.removeRelation(n.id,e));const t=c.find((t=>s.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=s.N5.relations.selectors.getEntityUriFromConnection(t);(0,w.ZiX)(r)&&h(s.N5.modifiedEntities.actions.entityDeleted(r))}),[n,c,h]),W=r&&b&&!y,q=m?[m,...g]:g,{canUpdate:G,canDelete:_}=(0,Ee.l)(),$=G(n)&&!y,Q=_(n)&&!y,X=(0,o.useRef)(null);return a().createElement(we.Z,{className:t},a().createElement(ue,{title:n.caption,total:u,columnsData:L,selectedColumns:k,onChangeColumns:(0,i.pipe)(he.changeColumns,O),searchQuery:Z,onChangeSearchQuery:P,filtersEnabled:!!T,onToggleFilters:(0,i.pipe)(he.toggleFilters,O),showInactive:I,onChangeShowInactive:N}),W&&a().createElement("div",{className:E.addArea},a().createElement(v,{onClick:H})),q.map((e=>a().createElement(Ce.Z,{key:s.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:C,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(Y,{mode:C,columnsData:A,connections:c,metadata:l,filters:T,onFilter:(0,i.pipe)(he.changeFilter,O),sorting:R,onSort:(0,i.pipe)(he.toggleSort,O),onEditRelation:$?(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),h):null,onRemoveRelation:Q?B:null,basicTableRef:X,allowOnlyCreateNew:n.allowOnlyCreateNew}),c.length?a().createElement(Se.Z,{count:u,rowsPerPageOptions:F,rowsPerPage:D,onChangeRowsPerPage:U,page:j,onChangePage:V,basicTableRef:X}):a().createElement(p.Typography,{className:E.noData},f().text("No data found")),z&&a().createElement(Oe.Z,null)))}));var Ge=n(36138),_e=n(22664),$e=n(585);const Qe=(0,Ge.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),Xe=e=>{let{config:t,store:n,onResize:o=i.identity,className:s,readOnlyMode:u}=e;return a().createElement(c.Provider,{store:n},a().createElement(R.m.Provider,{value:t.id},a().createElement(Ge.StylesProvider,{generateClassName:Qe},a().createElement(_e.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(qe,{config:t,className:s,readOnlyMode:u}),a().createElement($e.Z,null)))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
2
2
|
//# sourceMappingURL=6138.js.map
|