@reltio/remotes 1.4.1574 → 1.4.1576
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/122.js +1 -1
- package/122.js.map +1 -1
- package/2125.js +1 -1
- package/{1032.js → 2298.js} +2 -2
- package/2298.js.map +1 -0
- package/2890.js +1 -1
- package/2982.js +1 -1
- package/3094.js +1 -1
- package/3118.js +1 -1
- package/3346.js +1 -1
- package/3468.js +1 -1
- package/3469.js +1 -1
- package/3515.js +1 -1
- package/3515.js.map +1 -1
- package/3540.js +1 -1
- package/3540.js.map +1 -1
- package/3726.js +1 -1
- package/3726.js.map +1 -1
- package/4112.js +1 -1
- package/4112.js.map +1 -1
- package/4183.js +1 -1
- package/4701.js +1 -1
- package/4748.js +1 -1
- package/4843.js +1 -1
- package/4957.js +1 -1
- package/5400.js +1 -1
- package/5605.js +1 -1
- package/5622.js +1 -1
- package/5706.js +1 -1
- package/5709.js +1 -1
- package/5756.js +1 -1
- package/6051.js +1 -1
- package/6051.js.map +1 -1
- package/6856.js +2 -0
- package/6856.js.map +1 -0
- package/705.js +1 -1
- package/769.js +1 -1
- package/769.js.map +1 -1
- package/7762.js +1 -1
- package/7762.js.map +1 -1
- package/7818.js +1 -1
- package/8723.js +1 -1
- package/8723.js.map +1 -1
- package/9216.js +1 -1
- package/962.js +1 -1
- package/{4469.js → 9730.js} +2 -2
- package/9730.js.map +1 -0
- package/package.json +1 -1
- package/remoteEntry.js +1 -1
- package/remoteEntry.js.map +1 -1
- package/1032.js.map +0 -1
- package/4469.js.map +0 -1
- package/638.js +0 -2
- package/638.js.map +0 -1
package/8723.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[8723],{18723:(e,t,n)=>{n.d(t,{vC:()=>ei,_n:()=>Zl,tM:()=>Wl});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(50914),s=n(36138),c=n(44443),u=n(22664),p=n(24605),d=n(87451),m=n(47898),g=n(97094),f=n(60115),h=n(585),b=n(81559),y=n(86051),v=n(2507),x=n.n(v),E=n(76536),w=n(94622),C=n(41564),S=n(7718),O=n(57730),P=n(21077),N=n(85547),k=n(26481),Z=n(94150),T=n(26005),R=n(72249),j=n(94773),D=n(99136),I=n(30268),L=n(63291),A=n(71153),M=n.n(A),z=n(8962);const U=o().createContext(null);U.displayName="SingleAttributeContext";var H=n(60995),V=n(10237),F=n(58662),B=n(94079),W=n(93416),q=n(55299),G=n(98448),_=n(75512),$=n(30553),Y=n(66410),X=n(32152),Q=n(36444),K=n(79692);const J=(0,K.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ee=e=>{let{className:t}=e;const n=J(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(U),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:M()(n.triggerButton,t)},onClick:u},o().createElement(Q.Z,null)),o().createElement(B.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:x().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,isEditableMode:l}=e;const i=te(),{searchQuery:s,setSearchQuery:c,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(U),g=l&&(null==m?void 0:m.required);return o().createElement(W.Z,{title:t,className:i.root},g&&o().createElement(q.Z,null),o().createElement(G.Z,{description:null==m?void 0:m.description}),o().createElement(_.Z,{widthToHide:500},o().createElement($.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:i.totalCaption,variant:"caption"},x().number(n)," ",1===n?x().text("item"):x().text("items"))),o().createElement(Y.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),o().createElement(X.i,{query:s,onChange:e=>{c(e),u(0)}}),a&&o().createElement(ee,null))};var re=n(65549),oe=n(11564),ae=n(93140),le=n(76134),ie=n(96811),se=n(48852);const ce=b.nIW,ue=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ue(n,t)})))):b.P6Y.strings.search(String(e),t),pe=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return ue(t,l)})))(t,n,r),c=(0,i.filter)(b.OXP,s);return{[(0,b.xy8)(r)]:{[ce(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}},de=(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"}})));function me(){return me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},me.apply(this,arguments)}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he=[],be=(0,se.l)(j.NY,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{element:o,type:a}=e||{};return{highlightedError:(0,j.Ie)(a)&&(0,b.Wah)(o,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c,highlightedError:u}=e;const p=de(),{uri:d,required:g,cardinality:f,name:h}=n,v=(0,a.useDispatch)(),E=(0,r.useContext)(m.m),w=(0,a.useSelector)(y.ZP.selectors.getEntity),C=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,w.uri)||{})),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),O=(0,a.useSelector)((e=>(0,b.tQX)(l,n,y.ZP.selectors.getProfileErrors(e)))),P=(0,a.useSelector)(y.ZP.selectors.getMode),N=(0,b.xy8)(n),k=(0,i.pipe)((0,i.pathOr)(he,[N,h]),(0,i.map)((0,i.prop)("uri")))(w),Z=(0,i.pathOr)(he,[N,h],C),T=Z.map((0,i.prop)("uri")),R=(0,b.ZiX)(w.uri),j=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:l,attributeType:n})),[l,n]),{ref:D,errorClassName:I}=(0,oe.B)({highlightedError:u,isSimple:!0}),L=(0,b.O27)(Z),A=g&&L,z=A?[j]:Z.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),U=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,v)(e.map((e=>ge({},e,{viewId:E}))))),[E,v]),H=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,v)(ge({},e,{viewId:E}))),[E,v]),V=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,v)(ge({},e,{viewId:E}))),[E,v]),F=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,v),[v]),W=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return U(A&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[U,l,n,A]),q=(0,b.Vg3)({attributeType:n,mode:P}),G={attributeType:n,errors:S,crosswalks:C.crosswalks,mode:P,onAddAttributes:U,onChangeAttribute:H,onDeactivateError:F,showNonOv:s},_=0===z.length&&0===t.length;return!(0,i.isEmpty)(C)&&o().createElement("div",{ref:D,className:I},o().createElement(ae.Z,{cardinality:f}),o().createElement(le.Z,{message:O}),q&&o().createElement(B.Button,{color:"primary",onClick:W,className:p.moreButton},o().createElement(re.Z,{classes:{root:p.icon}}),o().createElement("div",{className:p.buttonLabel},x().text("Add"))),z.map(((e,t)=>o().createElement(ie.Z,me({key:e.uri},G,{attributeValue:e,lazy:A&&!g,showEmptyEditors:R,ownError:(0,b.ADq)(e,t,d,S),onDeleteAttribute:V,isEmptyEditor:A})))),z.length>0&&t.length>0&&o().createElement(B.Divider,{className:p.divider}),t.map((e=>{const t=Z.find((0,i.propEq)("uri",e.uri)),n=t||e,r=k.includes(n.uri)&&!T.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:M()({[p.ovFalse]:!(0,b.OXP)(n)})},o().createElement(ie.Z,me({},G,{attributeValue:n,ownError:(0,b.ADq)(n,null,d,S),onDeleteAttribute:V,state:l})))})),_&&o().createElement(B.Typography,{className:p.noData},c))}));var ye=n(81303);const ve=(0,K.Z)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),xe=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=ve(),l=!(0,b.YkM)(n);return o().createElement(o().Fragment,null,t.map((e=>o().createElement(ye.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:M()({[a.simpleAttribute]:l})}))))},Ee=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"hidden",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),we=15,Ce=e=>{let{config:t,className:n}=e;const{caption:l,max:i=we,showInactiveValuesMenu:s}=t,c=Ee(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(U),v=(0,a.useSelector)(y.ZP.selectors.getEntityUri),E=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(y.ZP.selectors.getPivotingAttributes),S=0!==u.length,O=t["text-empty"]||x().text("No data found");return o().createElement(H.J.Provider,{value:C},o().createElement(V.Z,{className:M()(c.root,n)},o().createElement(ne,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s,isEditableMode:w}),o().createElement(B.Box,{className:c.content},(()=>{if(g)return o().createElement(D.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:b};return o().createElement(xe,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:O};return o().createElement(be,e)}}return o().createElement(B.Typography,{className:c.noData},O)})()),f&&o().createElement(F.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var Se=n(85229),Oe=n(20562);function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ne=(e,t)=>{const{attributeUri:n,max:o=15}=e,l=(0,a.useSelector)(y.ZP.selectors.getMetadata),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=(0,Se._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),v=(0,a.useSelector)(y.ZP.selectors.getApiPath),E=(0,a.useSelector)(y.ZP.selectors.getTenant),w=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),C=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),S=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(y.ZP.selectors.getHistoryDiff),P=w.uri,N=ce(n),k=(0,b.xy8)(n);f.current=(0,b.JQy)(w,P,N);const Z=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:T}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:R}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,b.Uty)(Z)&&!(0,b.ZiX)(P)&&(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"]),s=(0,b.biM)(w)||S?pe:b.KbL;g(s(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pe(e,t,n[t])}))}return e}({metadata:l,entity:w,apiPath:v,tenant:E,parentUri:P,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:T,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([k],e),r=(0,i.pathOr)([],[N],t);S||h(y.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:N,values:r})),c(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))})).catch((e=>{console.error(e),c([]),h(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))})).finally((()=>{m(!1)}))}else c([]),p(null)}),[v,P,E,n,o,l,t,T,Z,S,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,Oe.D)((()=>{C&&j()}),[C]);const D=(0,i.partition)(b.OXP),[,I]=D(f.current||[]),L=R?[]:I,A=R?"totalValues":"totalOvValues",M=(0,i.ifElse)((0,i.has)(A),(0,i.prop)(A),(0,i.always)(s.length))(u),z=o<M,U=null!=u&&u.totalValues?u.totalValues-M:L.length;return{values:s,isLoading:d,hasPaging:z,totalVisibleValues:M,attributeType:Z,totalNonVisibleValues:U,nonVisibleValues:L}};function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ze=n(37152),Te=n(3185),Re=n(31274),je=n(79026),De=n(8818),Ie=n(90324),Le=n(70595);const Ae=o().createContext(null);Ae.displayName="RelationsViewStateContext";const Me=(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"}}))),ze=e=>{let{className:t}=e;const n=Me(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(Ae),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),y="asc"===s;return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:M()(n.button,t)},onClick:f},o().createElement(Q.Z,null)),o().createElement(B.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:x().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(B.Divider,{className:n.divider}),o().createElement(B.Typography,{className:n.title,variant:"h6"},x().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(je.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(De.k,{tooltipTitle:y?x().text("Ascending"):x().text("Descending"),icon:y?Ie.Z:Le.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};ze.displayName="FilterButton";const Ue=ze,He=(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 Ve=n(61932),Fe=n(55847);const Be=o().createContext(null);function We(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){qe(e,t,n[t])}))}return e}function qe(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=Math.pow(2,31)-1,_e=(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 $e=n(81137);const Ye=e=>{let{label:t}=e;const n=_e();return o().createElement(B.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ve.Z,null))},Xe=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(y.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Be),i=(0,a.useSelector)(y.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),m=(0,a.useSelector)(y.ZP.selectors.getTenant),g=[We({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Ge})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return We({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(y.ui.actions.errorSet((0,b.xU7)(e,x().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)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:v,onImportClick:E}})(),s=_e(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(De.k,{size:"L",icon:Ve.Z,tooltipTitle:x().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:M()(s.tenant)},u)):o().createElement(Fe.Z,{menuId:"importDT-table-actions",buttonComponent:De.k,buttonProps:{tooltipTitle:x().text("Import connections"),size:"L",icon:()=>o().createElement(Ye,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement($e.Z,{open:!!t,title:x().text("Confirmation"),content:x().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:x().text("Cancel"),saveCaption:x().text("Import"),onDiscard:l,onSave:n})))},Qe=e=>{let{title:t,total:n}=e;const a=He(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Ae);return o().createElement(W.Z,{title:t||"",className:a.header},n>0&&o().createElement(_.Z,{widthToHide:400},o().createElement($.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:a.totalCaption,variant:"caption"},n>1?x().text("${count} items",{count:n}):x().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(Xe,null),o().createElement(Ue,null))};var Ke=n(11013),Je=n(27604),et=n(22983),tt=n(34e3),nt=n(31039);const rt=(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 ot(){return ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const at=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=rt(),u=(0,Se._)(),p=(0,a.useSelector)(y.ZP.selectors.getTenant),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const v=(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]),x=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(B.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(B.Tooltip,ot({onOpen:v,title:x,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},lt=(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 it=n(77277);const st=(0,K.Z)((()=>({container:{display:"flex"}})));function ct(){return ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ct.apply(this,arguments)}const ut=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,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=st();return o().createElement("div",{className:a.container},o().createElement(it.Z,ct({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Accept")),o().createElement(it.Z,ct({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Ignore")))},pt=(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"}}))),dt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:s,onAcceptRelation:c,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=pt(),{entity:m,relation:g}=t,f=(0,b.$qe)(t),h=(0,b.xr3)(t),v=(0,b.iJH)(t),{entityType:E,entityLabel:w,preparedUri:C,relationLabel:S}=lt(t,n),O=(0,b.Fn9)(g)&&(0,b.Fn9)(m),P=(0,a.useSelector)(y.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:s,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),T=(0,r.useCallback)((()=>s(t)),[s,t]),R=(0,r.useCallback)((()=>{c(t)}),[c,t]),j=(0,r.useCallback)((()=>u(t)),[u,t]),D=(N||k)&&l&&!t.suggested?o().createElement(o().Fragment,null,k&&o().createElement(De.k,{icon:Je.Z,size:"XS",onClick:T,tooltipTitle:x().text("Edit")}),N&&o().createElement(De.k,{icon:et.Z,size:"XS",onClick:Z,tooltipTitle:x().text("Remove")})):void 0,I=t.suggested?o().createElement(ut,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,L=v?x().text("ignored"):x().text("edited");return o().createElement("div",{className:M()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(tt.Z,{className:d.entityAvatar,entityType:E}),o().createElement(nt.Z,{value:C,className:d.entityLabelContainer},o().createElement(at,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(B.Typography,{variant:"caption",className:d.editedLabel},"(",L,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));dt.displayName="EditableRelationItem";const mt=dt,gt=(0,i.when)(b.Kn2,(0,i.prop)("uri")),ft=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:gt(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 ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bt=n(98989),yt=n(83543);const vt=(0,K.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),xt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=vt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,b.xvW)(n)?null:a?o().createElement(yt.Z,c):o().createElement(bt.Z,c)},Et=(0,K.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),wt=e=>{let{config:t,connection:n,children:l}=e;const i=Et(),{showInactive:s}=(0,r.useContext)(Ae),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>y.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>y.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(y.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){ht(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(y.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),v=(0,r.useCallback)((()=>{i||n.connections||h(),s((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:v,loadRelations:h,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(xt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Re.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(an,{isLoading:m,config:t,loadRelations:d,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},Ct=(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"}}))),St=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(y.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>y.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>y.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(y.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>y.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),v=Ct(),E=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,s,p,h,u]),w=(0,r.useCallback)((e=>{h(y.N5.relations.actions.closeRelationEditor(l.id,e)),h(y.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>y.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=y.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(y.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),C=l.content,S=ft(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(y.N5.relations.actions.addRelation(l.id,t))}),[h,l,S]),P=(0,r.useCallback)((e=>{h(y.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),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(wt,{config:l,connection:e,key:c},(t=>r?o().createElement(Ke.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(mt,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(y.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(B.Button,{color:"primary",onClick:E,className:v.moreButton},o().createElement(re.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},x().text("Add"))),D&&o().createElement(Ke.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(B.Divider,{className:v.divider}),k.map(R),T&&o().createElement(B.Typography,{className:v.noData},c))};var Ot=n(19603),Pt=n(94646),Nt=n(78101),kt=n(80931);const Zt=(0,K.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Tt(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){Rt(e,t,n[t])}))}return e}function Rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jt=e=>{let{connection:t,className:n}=e;const l=Zt(),{relation:s}=t,c=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>Tt({attributes:Tt({},y.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)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(Nt.A.Provider,{value:h},o().createElement(kt.Z,{className:M()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:M()(l.attributesList,n)},x().text("No attributes"))};var Dt=n(86602),It=n(82726);const Lt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(De.k,{className:r,tooltipTitle:t?x().text("Hide attributes of the relationship"):x().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Dt.Z:It.Z,onClick:n})},At=(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"}}))),Mt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=At(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityType:h,entityLabel:v,preparedUri:x,relationLabel:E}=lt(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),C=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:M()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:M()(c.row,Ot.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement(tt.Z,{className:c.entityAvatar,entityType:h}),o().createElement(nt.Z,{value:x,className:c.entityLabelContainer},o().createElement(at,{label:v,entity:p},o().createElement("span",{className:c.entityLabel},v)),E&&o().createElement("span",{className:c.relationLabel},`, ${E}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(Pt.Z,{className:c.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(ut,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Lt,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(jt,{connection:t}))}));Mt.displayName="RelationItem";const zt=Mt;var Ut=n(52691),Ht=n(16208),Vt=n(59601),Ft=n(58355),Bt=n(98685);const Wt=e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e).toFixed(1),qt=e=>e.filter((e=>5===e.value)).length,Gt=e=>e.filter((e=>1===e.value)).length,_t=e=>{if(0===e.length)return{percentOfLikes:0,percentOfDislikes:0};const t=qt(e)/e.length*100,n=parseFloat(Number(t).toFixed(1));return{percentOfLikes:n,percentOfDislikes:parseFloat(Number(100-n).toFixed(1))}},$t=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",padding:12,width:355,gap:12},info:{background:"rgba(0, 0, 0, 0.05)",display:"flex",padding:"6px 12px",fontSize:13,gap:16},axis:{position:"relative",display:"flex",justifyContent:"space-between",fontSize:12,color:e.palette.text.secondary,paddingTop:4,"&::before":{content:'""',position:"absolute",top:0,left:0,background:e.palette.divider,width:"1px",height:"4px"},"&::after":{content:'""',position:"absolute",top:0,right:0,background:e.palette.divider,width:"1px",height:"4px"}},scaleHistory:{display:"flex",justifyContent:"space-between"},title:{fontSize:13,display:"flex",alignItems:"center",color:e.palette.text.secondary,gap:8,"& .value":{color:e.palette.text.primary},"& .boldValue":{color:e.palette.text.primary,fontWeight:700}},greenBadge:{width:12,height:12,background:"rgb(151, 192, 97)"},redBadge:{width:12,height:12,background:"rgb(255, 112, 112)"},scale:{width:"100%",height:16,background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"},icon:{width:"14px",height:"14px",color:"rgba(0,0,0,0.54)"},ratingsList:{borderTop:"1px solid #ccc",borderBottom:"1px solid #ccc",padding:"12px 0",maxHeight:140,boxSizing:"border-box",overflow:"auto"},rating:{display:"flex",padding:"4px 0px",alignItems:"center"},avatar:{width:24,height:24,marginRight:12,"& .icon":{fontSize:18}},userInfo:{overflow:"hidden"},user:{fontSize:13,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis"},ratingDateWrapper:{display:"flex",alignSelf:"start",marginLeft:"auto"},ratingDate:{fontSize:10,color:e.palette.text.secondary,marginRight:4},sourcesWrapper:{display:"flex",alignItems:"center",gap:4}}))),Yt=e=>{let{ratings:t,crosswalks:n,open:r,anchorEl:a,onClose:l}=e;const i=$t(),s=(e=>[...e].sort(((e,t)=>{const n=new Date(e.timestamp).getTime();return new Date(t.timestamp).getTime()-n})))(t),{percentOfLikes:c,percentOfDislikes:u}=_t(t),p=`${qt(t)} (${c}%)`,d=`${Gt(t)} (${u}%)`;return o().createElement(Vt.Z,{open:r,anchorEl:a,onClose:l,placement:"top-start",transition:!0},o().createElement("div",{className:i.wrapper},o().createElement("div",{className:i.info},o().createElement("span",{className:i.title},x().text("Score:"),o().createElement("span",{className:"boldValue"},Wt(t))),o().createElement("span",{className:i.title},x().text("No. of responses:"),o().createElement("span",{className:"value"},t.length))),o().createElement("div",null,o().createElement(B.LinearProgress,{variant:"determinate",value:c,classes:{bar:i.scaleBar},className:M()(i.scale,{empty:!t.length})}),o().createElement("div",{className:i.axis},o().createElement("span",null,"0"),o().createElement("span",null,"100%"))),o().createElement("div",{className:i.scaleHistory},o().createElement("span",{className:i.title},o().createElement("div",{className:i.greenBadge}),o().createElement(Ut.Z,{className:i.icon}),x().text("Agree:"),o().createElement("span",{className:"value"},p)),o().createElement("span",{className:i.title},o().createElement("div",{className:i.redBadge}),o().createElement(Ht.Z,{className:i.icon}),x().text("Disagree:"),o().createElement("span",{className:"value"},d))),!!s.length&&o().createElement("div",{className:i.ratingsList,"data-reltio-id":"reltio-ratings-list"},s.map(((e,t)=>{let{user:n,comment:r,timestamp:a,value:l}=e;return o().createElement("div",{key:t,className:i.rating,"data-reltio-id":"reltio-rating-item"},o().createElement(B.Avatar,{className:i.avatar},o().createElement(Bt.Z,{className:"icon"})),o().createElement("div",{className:i.userInfo},o().createElement("div",{className:i.user},n),o().createElement("div",{className:i.title},r||x().text("No comment"))),o().createElement("div",{className:i.ratingDateWrapper},o().createElement("span",{className:i.ratingDate},x().date(a,"L LT")),1===l?o().createElement(Ht.Z,{className:i.icon,"data-reltio-id":"reltio-dislike-icon"}):o().createElement(Ut.Z,{className:i.icon,"data-reltio-id":"reltio-like-icon"})))}))),o().createElement("div",{className:i.sourcesWrapper},o().createElement("span",{className:i.title},x().text("Sources:")),n.map(((e,t)=>o().createElement(Ft.Z,{key:t,crosswalk:e}))))))},Xt=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:128,cursor:"pointer"},averageRating:{marginBottom:4,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",color:e.palette.text.primary},counts:{display:"flex",marginTop:4,gap:32},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:e.palette.text.secondary},scale:{height:3,width:"100%",background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"}}))),Qt=e=>{let{ratings:t,crosswalks:n,className:a}=e;const l=Xt(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{percentOfLikes:u}=_t(t);return o().createElement(o().Fragment,null,o().createElement("div",{"data-reltio-id":"reltio-ratings",className:M()(l.wrapper,a),ref:i,onClick:()=>c(!0)},o().createElement(B.Typography,{className:l.averageRating},Wt(t)),o().createElement(B.LinearProgress,{variant:"determinate",value:u,classes:{bar:l.scaleBar},className:M()(l.scale,{empty:!t.length})}),o().createElement("div",{className:l.counts},o().createElement("div",{className:l.count},o().createElement(Ut.Z,{className:l.icon}),qt(t)),o().createElement("div",{className:l.count},o().createElement(Ht.Z,{className:l.icon}),Gt(t)))),o().createElement(Yt,{ratings:t,open:s,crosswalks:n,anchorEl:i.current,onClose:()=>c(!1)}))},Kt=(0,K.Z)((e=>({wrapper:{display:"flex",marginLeft:-8,gap:8},button:{minWidth:0,padding:8,fontSize:"14px",lineHeight:"16px",textTransform:"none",color:e.palette.text.secondary},isActive:{color:e.palette.text.primary}}))),Jt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Kt(),i=(0,a.useSelector)(y.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:x().text("Has left the practice"),onClick:()=>r(x().text("Has left the practice"))},{text:x().text("Has moved away"),onClick:()=>r(x().text("Has moved away"))},{text:x().text("Has passed away"),onClick:()=>r(x().text("Has passed away"))},{text:x().text("Has retired"),onClick:()=>r(x().text("Has retired"))},{text:x().text("Other"),onClick:()=>r(x().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(B.Button,{onClick:n,variant:"text",size:"small",className:M()(l.button,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Fe.Z,{buttonProps:{endIcon:o().createElement(yt.Z,null),variant:"text",size:"small",className:M()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},en=(0,K.Z)((e=>({wrapper:{padding:"3px 16px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",lineHeight:"16px"},entityLabelContainer:{display:"flex",wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"8px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center",marginTop:"8px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex",alignItems:"center"}}))),tn=e=>{var t;let{connection:n,loadRelations:l,renderRelationArrowButton:s,acceptRelation:c,ignoreRelation:u}=e;const p=en(),d=n.suggested,[m,g]=(0,r.useState)(!1),{entity:f,relation:h}=n,v=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityLabel:x,entityType:E,preparedUri:w,relationLabel:C}=lt(n,v),S=(null==h?void 0:h.ratings)||[],O=(null==h||null===(t=h.object)||void 0===t?void 0:t.crosswalks)||[],P=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),N=f&&h&&(0,b.wp9)(b.q7e.RELATION,{entityUri:P,connection:n})||[];return o().createElement("div",{className:M()(p.wrapper,{[p.suggestedWrapper]:d})},o().createElement(B.Box,{display:"flex",minHeight:"44px",className:Ot.U},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{display:"flex",alignItems:"center"},s&&s(),o().createElement(tt.Z,{entityType:E,className:p.entityTypeIcon})),o().createElement(B.Box,{display:"flex",flexDirection:"column"},o().createElement(nt.Z,{value:w,className:p.entityLabelContainer},o().createElement(at,{label:x,entity:f},o().createElement("span",{className:p.entityLabel},x))),C&&o().createElement("span",{className:p.relationLabel},C),!d&&o().createElement(Jt,{ratings:S,onAgree:()=>{(0,b.Buf)(null==h?void 0:h.relationUri,{comment:"",value:5}).then(l)},onDisagree:e=>{(0,b.Buf)(null==h?void 0:h.relationUri,{comment:e,value:1}).then(l)}}))),o().createElement("div",{className:p.additionalButtonsWrapper},!(0,i.isEmpty)(N)&&o().createElement(Pt.Z,{className:p.commentsContainer,uri:(0,b.gjS)(h),relatedObjectUris:N,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),d&&o().createElement(ut,{acceptRelation:c(n),ignoreRelation:u(n)}),!d&&o().createElement(o().Fragment,null,o().createElement(Qt,{ratings:S,crosswalks:O,className:p.ratings}),o().createElement(Lt,{show:m,onToggle:()=>{g((e=>!e))},className:p.showDetailsButton})))),m&&o().createElement(jt,{connection:n,className:p.relationAttributes}))},nn=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=ft(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(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===b.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(C.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(wt,{config:i,connection:e,key:r},(t=>c?o().createElement(tn,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(zt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};nn.displayName="RelationsList";const rn=nn,on=(0,K.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),an=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=on(),{selectors:u}=y.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||x().text("No data found");return t?o().createElement(D.Z,null):(0,b.KIu)(d)?o().createElement(St,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(rn,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(B.Typography,{className:c.noData},m)},ln=(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}}),sn=e=>{let{config:t,className:n}=e;const l=ln(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(Ae),{selectors:h}=y.ZP,v=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),x=(0,a.useSelector)(h.getEntity),E=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),C=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{f("")}),[null==x?void 0:x.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,Ze.a)({sorting:C,filter:S,page:s,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(v)),[v]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Te.u.Provider,{value:x},o().createElement(Re.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Be.Provider,{value:k},o().createElement(Qe,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(an,{isLoading:O,config:t,loadRelations:P,connections:v,total:E}),E>u&&o().createElement(F.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c}))))))};sn.displayName="RelationsView";const cn=o().createContext(null);cn.displayName="TableAttributeContext";var un=n(86361),pn=n(26180),dn=n(31276);function mn(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){gn(e,t,n[t])}))}return e}function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fn="CHANGE_SEARCH_QUERY",hn=mn({},pn.ZP.actions,{changeSearchQuery:(0,dn.zD)(fn)}),bn=(e,t)=>t.type===fn?mn({},e,{searchQuery:t.payload,page:0}):pn.ZP.reducer(e,t);var yn=n(92332),vn=n(67353);function xn(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){En(e,t,n[t])}))}return e}function En(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={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},Cn=(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:xn({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:xn({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:xn({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},b.zXF[b.Y1q.deleteAttribute]),description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":wn}}))),Sn=(0,vn.Z)((e=>{const t=Cn(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(yn.default,e),o().createElement(G.Z,{description:n,className:t.description}))}));var On=n(72768),Pn=n(95613);const Nn=e=>{let{value:t,historyClassName:n}=e;const r=Cn();return o().createElement("div",{className:r.blobWrapper,onScroll:dn.UW},o().createElement("span",{className:r[n]},t))},kn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=Cn(),{value:l,uri:s}=t,{appearance:c}=(0,r.useContext)(T.m),u=(0,i.pipe)(b.IFm,b.o_F)(s,c);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(Nn,{value:l,historyClassName:u});{const e=o().createElement(On.Z,{value:l,dataTypeDefinition:n});return o().createElement(Pn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tn=(e,t)=>{const{uri:n,label:r,children:o,name:a,description:l}=e;return(0,i.reject)(i.isNil,{id:(0,b.Tde)(n,t),label:r,description:l,dataTypeDefinition:(0,b.PFL)(e),children:null==o?void 0:o.map((e=>Tn(e,t.concat({name:a}))))})},Rn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),jn=e=>{if((0,b.vZp)(e)){const t=Rn(e);return t.length>1?t.slice(0,-1):null}return null},Dn=(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){Zn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:jn(e.id),headCellRenderer:Sn,rowCellValueRenderer:kn})));var In=n(37754);function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var An=n(1876),Mn=n(60894);const zn=(0,K.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Un=e=>{let{title:t}=e;const n=zn(),l=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{attributeType:i,searchQuery:s,setSearchQuery:c,filters:u,onToggleFilters:p,allColumnsData:d,visibleColumns:m,onChangeColumns:g}=(0,r.useContext)(cn),f=l&&(null==i?void 0:i.required);return o().createElement(W.Z,{title:t,className:n.header},f&&o().createElement(q.Z,null),o().createElement(G.Z,{description:null==i?void 0:i.description}),o().createElement(X.i,{query:s,onChange:c}),o().createElement(An.Z,{enabled:!!u,onClick:p}),o().createElement($.Z,{height:24,margin:4}),o().createElement(Mn.Z,{columnsData:d,selectedColumns:m,onChangeColumns:g}))};function Hn(){return Hn=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},Hn.apply(this,arguments)}const Vn=(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=Cn();return o().createElement("div",{className:M()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Hn({key:t,value:e},l)))))}));var Fn=n(52016),Bn=n(85709);const Wn=(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)"}}}))),qn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(De.k,{tooltipTitle:x().text("Edit"),icon:Je.Z,size:"L",onClick:t}),n&&o().createElement(De.k,{tooltipTitle:x().text("Remove"),icon:et.Z,size:"L",onClick:n}))};function Gn(){return Gn=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},Gn.apply(this,arguments)}const _n=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,b.xIV)(e))(t))(Rn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Dn(t)),[t]),v=Wn(),x=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,b.KIu)(x),w=(0,a.useSelector)(y.ZP.selectors.getMetadata),C=(0,a.useSelector)(y.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:O}=(0,r.useContext)(cn),P=(0,r.useCallback)((e=>o().createElement(Vn,Gn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Fn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,E]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,b.xv5)({attributeType:O,mode:x,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:x,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(qn,{onEdit:I?L:void 0,onRemove:j?A:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:v.tableContainer},o().createElement(Bn.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:M,context:z,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]}}))};function $n(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){Yn(e,t,n[t])}))}return e}function Yn(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=[],Qn=(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 Kn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Jn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const p=Qn(),d=(0,a.useDispatch)(),g=(0,r.useContext)(m.m),{attributeType:f}=(0,r.useContext)(cn),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),v=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,h)||{})),w=(0,b.YkG)(f)&&(0,b.ZiX)((0,b.bwT)(u)),C=(0,a.useSelector)((e=>w?y.ZP.selectors.getModifiedEntities(e):void 0)),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,h,f))),O=(0,b.ZiX)(h),P=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,d)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Kn(e,t,n[t])}))}return e}({},e,{viewId:g}))))),[g,d]),N=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,d),[d]);return o().createElement(o().Fragment,null,o().createElement(ie.Z,{expanded:!0,attributeValue:u,showEmptyEditors:O,onDeleteAttribute:s,onDeactivateError:N,onChangeAttribute:t,onAddAttributes:P,mode:v,crosswalks:E.crosswalks,errors:S,attributeType:f,ownError:(0,b.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:p.actionButtons},o().createElement(B.Button,{onClick:()=>n(u)},x().text("Cancel")),o().createElement(B.Button,{color:"primary",disabled:!c,onClick:()=>l(u,C),"data-reltio-id":"table-attribute-view-apply-button"},x().text("Apply"))))};var er=n(54198);const tr=e=>(null==e?void 0:e.type)===b.NIO.missed,nr=(0,i.curry)(((e,t)=>e.find((0,i.pipe)((0,i.prop)("uri"),(0,i.either)((0,b.sOy)(t.parentUri),(0,i.equals)(t.uri)))))),rr=(0,K.Z)((()=>({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"}}))),or=e=>{let{config:t,editingValues:n,modifiedValues:l,onChangeAttribute:s,onDeleteAttribute:c,onAdd:u,onCancel:p,onApply:d,onStartEditing:m,onReset:g,checkHasChanges:f,highlightedError:h,highlightedAttributeError:v}=e;const E=rr(),{attributeType:w}=(0,r.useContext)(cn),C=(0,a.useSelector)(y.ZP.selectors.getMode),{canCreate:S}=(0,Fn.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:o,highlightedAttributeError:l}=e;const{attributeType:s}=(0,r.useContext)(cn),c=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,c,s))),p=(0,r.useRef)(!0),d=(0,er.u)(),m=(0,r.useMemo)((()=>u.find((0,i.both)(tr,(e=>(0,b.Wah)(e,c,s.uri))))),[u,c,s.uri]);(0,r.useEffect)((()=>{m&&1===n.length&&t(n[0])}),[m]),(0,r.useEffect)((()=>{p.current&&u.length&&((0,i.pipe)((0,i.map)(nr(n)),(0,i.reject)(i.isNil),(0,i.forEach)(t))(u),p.current=!1)}),[u]),(0,r.useEffect)((()=>{tr(o)&&1===n.length&&t(n[0])}),[o]),(0,r.useEffect)((()=>{if(l){const e=nr(n,l);e&&t(e)}}),[l]),(0,r.useEffect)((()=>{const e=d((e=>{e.type===y.N5.constants.ProfileActions.SAVE_PROFILE&&(p.current=!0)}));return()=>e()}),[d])})({onStartEditing:m,modifiedValues:l,highlightedError:h,highlightedAttributeError:v});const O=S(t)&&w&&(0,b.Vg3)({attributeType:w,mode:C})&&!n.length;return(0,r.useEffect)((()=>()=>g()),[g]),o().createElement("div",{className:E.editor},O&&o().createElement(B.Button,{color:"primary",onClick:u,className:E.addButton,"data-reltio-id":"table-attribute-view-add-button"},o().createElement(re.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},x().text("Add"))),n.map((e=>o().createElement(Jn,{key:e.uri,attributeValue:e,onChangeAttribute:s,onDeleteAttribute:c,onCancel:p,onApply:d,hasChanges:f(e)}))))},ar=(0,se.l)(j.NY,((e,t)=>{let{entityUri:n,attributeType:r}=t;const{element:o,type:a}=e||{},l=(0,j.Ie)(a),i=l&&(0,b.Wah)(o,n,r.uri);return{highlightedError:i?e:null,highlightedAttributeError:o&&l&&!i&&(0,b.nsY)(r,o)&&(0,b.vyG)(n,o)?e:null}}),(e=>{let{config:t,entityUri:n,highlightedError:l,highlightedAttributeError:s}=e;const c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),u=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,n)||{})),{values:p,visibleColumns:d,onFilter:g,onSort:f,filters:h,sorting:v,allColumnsData:x}=(0,r.useContext)(cn),{onDeleteAttribute:E,onStartEditing:w,onChangeAttribute:C,onAdd:S,onCancel:O,onApply:P,onReset:N,checkHasChanges:k,modifiedValues:Z,editingValues:T,deletedUris:R}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getMode),c=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,c)||{})),d=(0,r.useContext)(m.m),{attributeType:g,values:f}=(0,r.useContext)(cn),h=(0,b.KIu)(s),v=(0,b.xy8)(g),x=(0,i.pathOr)(Xn,[v,null==g?void 0:g.name],p),E=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:c,attributeType:g})),[c,g]),w=(0,b.O27)(x),C=g.required&&w,S=(0,r.useMemo)((()=>C?[E]:x),[E,x,C]),O=(0,r.useMemo)((()=>[...S.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=>S.find((0,i.propEq)("uri",e.uri))||e))(f)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[S,n,e,f]),P=(0,r.useMemo)((()=>(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!S.find((0,i.propEq)("uri",e)))))(h?f:[])),[S,f,h]),N=S.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))})),k=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,l)($n({},e,{viewId:d}))),[d,l]),Z=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,l)($n({},e,{viewId:d}))),[d,l]),T=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:c,attributeType:g});t(e.uri),k({value:$n({},e,{value:(0,b.GPx)({attributeTypes:(0,b.BoX)(u,g),parentUri:e.uri,mode:s,metadata:u})}),uri:e.uri,attributeType:g})}),[c,g,u,s,k]),R=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),j=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t={attributeType:g,value:r,uri:e.uri};o((e=>(0,i.without)([r],e))),w||k(t)}else{const n={value:e,attributeType:g,uri:e.uri};t(null),Z(n)}l(y.N5.errors.actions.errorsSet([]))}),[Z,k,o,w,n,g,l]),D=(0,r.useCallback)(((e,t)=>{const n=(0,b.q5j)(u,g,e,t).map((n=>$n({},n,{path:(0,b.Z9i)({entityUri:c,metadata:u,entitiesMap:t||{[c]:(0,b.PeS)(g,e)}},n.uri||n.parentUri)})));return l(y.N5.errors.actions.errorsSet(n)),0===n.length}),[l,c,g,u]),I=(0,r.useCallback)(((e,n)=>{D(e,n)&&(t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t})))}),[o,t,D]),L=(0,r.useCallback)((()=>{o([]),t(null)}),[]);return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:k,onDeleteAttribute:Z,onAdd:T,onCancel:j,onApply:I,onStartEditing:R,onReset:L,modifiedValues:O,editingValues:N,deletedUris:P}})(),{ref:j,errorClassName:D}=(0,oe.B)({highlightedError:l,isSimple:!0}),I=c?Z:p,L=(0,r.useMemo)((()=>d.map((e=>x.find((0,i.propEq)("id",e))))),[d,x]);return o().createElement("div",{ref:j,className:D},c&&!(0,i.isEmpty)(u)&&o().createElement(or,{config:t,editingValues:T,modifiedValues:Z,onChangeAttribute:C,onDeleteAttribute:E,onAdd:S,onReset:N,onCancel:O,onApply:P,onStartEditing:w,checkHasChanges:k,highlightedError:null==l?void 0:l.element,highlightedAttributeError:null==s?void 0:s.element}),L.length>0&&o().createElement(_n,{columnsData:L,config:t,values:I,filters:h,onFilter:g,sorting:v,onSort:f,onEdit:w,onDeleteAttribute:E,deletedUris:R}))})),lr=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",overflow:"hidden"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"}}))),ir=15,sr=e=>{let{config:t,className:n}=e;const{caption:l,max:i=ir}=t,s=lr(),c=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{totalVisibleValues:u,attributeType:p,showTable:d,hasPaging:m,isLoading:g,page:f,setPage:h}=(0,r.useContext)(cn);return o().createElement(V.Z,{className:M()(s.root,n)},d?o().createElement(o().Fragment,null,o().createElement(Un,{title:l}),o().createElement("div",{className:s.content},o().createElement(ar,{config:t,attributeType:p,entityUri:c}),m&&o().createElement(F.Z,{count:u,rowsPerPageOptions:[],rowsPerPage:i,page:f,onChangePage:h}),g&&o().createElement(D.Z,null))):o().createElement(o().Fragment,null,o().createElement(W.Z,{title:l,className:s.header},o().createElement(G.Z,{description:null==p?void 0:p.description})),o().createElement(B.Typography,{className:s.noData},x().text("No data"))))};var cr=n(58600);function ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let pr=0;const dr=()=>pr++,mr=e=>{const t={children:[],nodeId:dr()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:dr(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children};var gr=n(5598);const fr=(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"},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"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary},linearIndicator:{top:"42px"}})));var hr=n(1242);const br=o().createContext(null),yr=e=>{e.target.src=hr},vr=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:l}=t,i=(0,b.idV)(t.entity.label),s=fr(),c=(0,a.useSelector)(y.ZP.selectors.getAbsoluteImagePath),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),{uri:p}=(0,a.useSelector)(y.ZP.selectors.getEntity),[d,m]=(0,r.useState)(),g=(0,r.useContext)(br),f=n===p,h=(0,b.nt9)(u,t.entity.type)||{},v=(0,b.VD3)(u,h,"typeGraphIcon"),x=v&&(0,b.vPL)(c,v);return o().createElement("div",{className:s.wrapper,"data-node-id":l},o().createElement("div",{ref:m,className:s.container},o().createElement(B.Avatar,{alt:"Node icon",className:M()(s.avatar),src:x||hr,onError:yr}),o().createElement(gr.Z,{isSelected:f,title:i,entityUri:n,viewId:g.id,anchorEl:d})))},xr=((0,r.memo)(vr),e=>{let{node:t}=e;return t.nodeId}),Er=(0,K.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block","&:after":{content:"''",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)",width:"1px",left:"50%",bottom:"0",height:`calc(100% - ${Or.rowHeight}px)`}},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"calc(50% - 1px)",top:0,height:Or.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:Or.rowHeight/2+"px",left:"calc(50% - 1px)",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 wr(){return wr=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},wr.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 Or={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Er();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:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:M()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Er(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Cr(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",wr({},s,{className:c.node,style:h}),p,o().createElement("div",{className:c.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 Nr=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"})))},kr=e=>{let{title:t,onGraphOpen:n}=e;const a=fr(),{showNavigateToGraph:l}=(0,r.useContext)(d.Y);return o().createElement(W.Z,{title:t,className:a.header},l&&o().createElement("div",{className:a.buttonsContainer},o().createElement(De.k,{className:a.button,tooltipTitle:x().text("Show Graph"),icon:Nr,onClick:n,size:"L"})))},Zr=e=>xr({node:e});function Tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rr=n(9757);const jr=(0,K.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function Dr(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}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}const Lr=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,Rr.E)(t),y=jr(),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)((()=>{c(!!b)}),[b]),(0,r.useEffect)((()=>{s&&l.current&&(l.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[s,b]);const x=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(B.Dialog,{ref:l,open:!!b}),o().createElement(B.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:Dr({},x,h),className:M()(y.root,n)}))):null};var Ar=n(14940);const Mr=(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)"}}),zr=e=>{const t=t=>{const n=Mr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:M()("viewDraggableHandle",n.dragHandle)},o().createElement(Ar.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Ur=n(2256);const Hr=e=>{const t=t=>o().createElement(Ur.Z,{error:o().createElement(P.ZP,{LogoRenderer:P.B9.ERROR,text:"",secondaryText:x().text("Something went wrong"),variant:P.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Vr=(0,K.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Fr=n(29103),Br=n(83911),Wr=n(95299),qr=n(22385);const Gr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),_r=(0,K.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var $r=n(13074),Yr=n(24338);const Xr=(0,K.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Qr=Xr,Kr=e=>{let{totalImages:t}=e;const n=Qr(),r=t>1?x().text("photos"):x().text("photo");return o().createElement(B.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Jr(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){eo(e,t,n[t])}))}return e}function eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const to=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(y.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(Yr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(y.N5.actions.removeAttribute,s)(Jr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(y.N5.actions.modifyAttribute,s)(Jr({},e,{viewId:d})),imageSize:oo,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Kr,{totalImages:p.length}))},no=(0,K.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),ro=no,oo={imageMargin:4,imageWidth:162,imageHeight:162};var ao=n(28741),lo=n(49734),io=n(98808),so=n(93428),co=n(30885);function uo(){return uo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uo.apply(this,arguments)}const po=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),{canMerge:p,canMark:d}=(0,b.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:io.N.iconButton,onStartRequest:l},h=(0,r.useContext)(m.m),v=(0,r.useCallback)((()=>{i(),s(y.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(so.H,uo({},f,{onFinishRequest:v})),d&&o().createElement(co.i,uo({},f,{onFinishRequest:i})))},mo=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useSelector)(y.ZP.selectors.getEntity);return o().createElement(lo.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:Ot.U},o().createElement(Pt.Z,{uri:(0,b.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(po,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},go=(0,K.Z)((e=>({root:{display:"flex",flexDirection:"column",minHeight:"52px"},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)"}}))),fo={showTransitiveMatches:!0,showInactiveEntities:!1},ho={order:b.KM9.asc,field:"score"};var bo;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(bo||(bo={}));const yo=e=>(0,i.pipe)(Hr,zr)(e),vo=yo((e=>{let{className:t}=e;const n=Vr();return o().createElement(V.Z,{className:M()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),xo=yo((e=>{let{className:t,config:n}=e;return o().createElement(z.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Eo=yo((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=Ne(e,s),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){ke(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(U.Provider,{value:a},o().createElement(Ce,{config:n,className:t}))})),wo=yo((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(y.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,b.WN0)(e,t)),(0,i.map)((e=>Tn(e,[t]))),(0,i.chain)(b.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(bn,c),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),v=(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,In.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:v,page:f,sorting:g,searchQuery:d})),[v,f,g,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:O,changeColumns:P}=(0,un.o)({actions:hn,dispatch:p}),N=Ne(e,x);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){Ln(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,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)||v||d||h)&&l&&!l.hidden),allColumnsData:s},N)})(t);return o().createElement(cn.Provider,{value:l},t&&o().createElement(sr,{config:t,className:n}))})),Co=yo((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,b.fS6)(l,t)),[l,t]),c=(e=>{var t;const n=(0,r.useMemo)((()=>(0,i.pipe)(Object.entries,(0,i.map)((e=>{let[t,n]=e;return{value:t,label:n}})),(0,i.unless)((e=>(0,b.O27)(e)||e.some((0,i.propEq)("value","name"))),(0,i.append)({label:x().text("Name"),value:"name"})))(e.sortOptions||{})),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[s,c]=(0,r.useState)(e.sortOrder||"asc"),[u,p]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),h=(0,r.useCallback)((()=>{l(0),f((e=>!e))}),[]),y=(0,r.useCallback)((()=>{l(0),c((e=>"asc"===e?"desc":"asc"))}),[]),v=(0,r.useCallback)((e=>{l(0),p(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{l(0),m(e)}),[]),sortOrder:s,toggleSortOrder:y,sortOption:u,changeSortOption:v,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:g,toggleShowInactive:h}})(s);return o().createElement(Ae.Provider,{value:c},o().createElement(sn,{config:s,className:n}))})),So=yo(Lr),Oo=yo((e=>{let{config:t,className:n}=e;const{id:l,caption:s,graph:u,_showNavigateToGraph:p}=t,m=null==u?void 0:u.type,g=fr(),f=(0,a.useDispatch)(),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{treeData:v,setTreeData:E,errorMessage:w,isLoading:C}=((e,t)=>{const n=(0,Se._)(),[o,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getEntity);return(0,Oe.D)((()=>{const e=s.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){ur(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],d),e);c(t.map((0,i.prop)("root")))}),[null==d?void 0:d.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||(p(null),l(!0),n((0,b.RFJ)({uri:e,graphUri:t})).then(mr).then(c).catch((e=>{console.warn(e),p((0,b.xU7)(e,x().text("Something went wrong")))})).finally((()=>{l(!1)}))),()=>{c([])})),[e,t,n]),{isLoading:o,treeData:s,setTreeData:c,errorMessage:u}})(h,m),{onResize:S,getRowHeight:O,clearHeightsCache:P}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[Zr(e)]!==r?(0,i.assoc)(Zr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Zr(n)]?Math.max(e[Zr(n)],Or.rowHeight):Or.rowHeight}),[e]),clearHeightsCache:n}})(),N=(0,r.useContext)(d.Y),k=void 0!==p?p:N.showNavigateToGraph,Z=(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){Tr(e,t,n[t])}))}return e}({},N,{showNavigateToGraph:k})),[k,N]),T=(0,r.useCallback)((()=>{f(y.ui.actions.openGraph({viewId:l,graphType:m,entityUri:h}))}),[f,l,m,h]),R=(0,r.useCallback)((e=>({title:o().createElement(c.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:S(e.node)},o().createElement(vr,{node:e.node}))})),[S]);return(0,r.useEffect)((()=>{P()}),[P,h]),o().createElement(d.Y.Provider,{value:Z},o().createElement(V.Z,{className:n},o().createElement(kr,{onGraphOpen:T,title:s}),C&&o().createElement(D.Z,{className:g.linearIndicator}),o().createElement(br.Provider,{value:t},o().createElement("div",{className:g.treeContainer},o().createElement("div",{className:g.tree},w?o().createElement(B.Typography,{className:g.errorMessage},w):o().createElement(cr.ZP,{isVirtualized:!1,treeData:v,canDrag:!1,theme:Or,generateNodeProps:R,onChange:E,getNodeKey:xr,rowHeight:O}))))))})),Po=yo((e=>{let{config:t,className:n}=e;const l=go(),s=(0,a.useSelector)(y.ZP.selectors.getEntity),c=(0,b.wwR)(s),[u,p]=(0,r.useState)(!1),d=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:v}=(0,ao.s)({enabled:!!c,entity:s,options:fo,filter:"",page:0,sorting:ho,rowsPerPage:3,onStartLoading:d,onFinishLoading:g}),E=(0,r.useCallback)((()=>{v()}),[v]),w=(0,a.useDispatch)(),S=(0,r.useContext)(m.m),O=(0,r.useCallback)((()=>{w(y.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[w,S]),P=(0,r.useMemo)((()=>(0,b.NVY)(c,(0,i.map)(b.ev7,f))),[c,f]),{getCommentsCount:N}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,i.isEmpty)(f),Z=u?bo.Loading:(0,i.isEmpty)(f)?bo.NoData:bo.Loaded;return o().createElement(Re.X.Provider,{value:h},o().createElement(V.Z,{className:M()(l.root,n)},o().createElement(W.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===bo.Loading&&o().createElement(D.Z,null),Z===bo.NoData&&o().createElement(B.Typography,{className:l.noData},x().text("No matches found")),Z===bo.Loaded&&f.map((e=>o().createElement(mo,{config:t,entitiesMap:h,match:e,onFinishRequest:E,onStartRequest:d,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(B.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},x().text("See all"))))))})),No=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91032)).then((e=>({default:yo(e.HierarchyTreeView)}))))),ko=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:yo(e.RelationshipsTableView)}))))),Zo=yo((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=_r(),c=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),p=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Se._)();return(0,r.useEffect)((()=>{i(!0),s((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Gr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(D.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(V.Z,{className:M()(s.root,i)},m&&o().createElement(D.Z,null),o().createElement(qr.Z,{size:"S",icon:n?Br.Z:Fr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(Wr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:s.fullHeight,mapKey:p,mapOptions:h}))})),To=yo((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=ro(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(y.ZP.selectors.getMode),p=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(y.ZP.selectors.getMetadata),m=l?(0,b.zeJ)(d,l):null,g=t["text-empty"]||x().text("No data found"),f=(0,r.useCallback)((e=>c(y.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(W.Z,{title:t.caption},o().createElement(G.Z,{description:null==m?void 0:m.description})),o().createElement("div",{className:s.container},(()=>{if(m){const e=(0,i.pathOr)([],["attributes",m.name],p),n=(0,i.path)(["attributes","paging",l],p),r=e.length;if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:n,requestNextPageOfAttributeValues:f};return o().createElement(to,e)}if(r>0){const t={attributeValues:e,attributeType:m,imageSize:oo,paging:n,parentUri:p.uri,requestNextPageOfAttributeValues:f};return o().createElement(o().Fragment,null,o().createElement($r.Z,t),o().createElement(Kr,{totalImages:r}))}}return o().createElement(B.Typography,{className:s.noData},g)})()))}));class Ro{}Ro.ViewTypes=b.ZIY,Ro.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case Ro.ViewTypes.HierarchyTree:return o().createElement(No,{config:r,store:n,className:a});case Ro.ViewTypes.HierarchyPaths:return o().createElement(Oo,{config:r,className:a});case Ro.ViewTypes.RelationsTable:return o().createElement(ko,{config:r,store:n,className:a});case Ro.ViewTypes.Relations:return o().createElement(Co,{config:r,className:a});case Ro.ViewTypes.Attributes:return o().createElement(xo,{className:a,config:r});case Ro.ViewTypes.SingleAttribute:return o().createElement(Eo,{config:r,className:a});case Ro.ViewTypes.AttributeTable:return o().createElement(wo,{config:r,className:a});case Ro.ViewTypes.Map:return o().createElement(Zo,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case Ro.ViewTypes.Custom:return o().createElement(So,{config:r,className:a});case Ro.ViewTypes.ImageAttribute:return o().createElement(To,{config:r,className:a});case Ro.ViewTypes.PotentialMatches:return o().createElement(Po,{config:r,className:a})}},Ro.getComponent=e=>Ro.getComponentBy("class",e)||Ro.getComponentBy("react-class",e)||o().createElement(vo,{className:e.className});const jo=Ro,Do=()=>null,Io=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=Vr();return o().createElement(r.Suspense,{fallback:o().createElement(Do,null)},jo.getComponent({config:t,store:n,className:M()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));Io.displayName="ViewComponent";const Lo=(0,K.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"},overflowContainer:{width:"100%",height:"100%",overflow:"hidden"}})));function Ao(){return Ao=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},Ao.apply(this,arguments)}const Mo=["onConfigChanged","onRemove"],zo=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),h=Lo(),v=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{store:x}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===jo.ViewTypes.Custom;if(E&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC)return null;if(f.class===jo.ViewTypes.Map&&!v)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",Ao({},(0,i.omit)(Mo,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:M()(s,{[h.item]:!E,customView:E})}),o().createElement("div",{className:h.overflowContainer},o().createElement("div",{"data-reltio-id":"profile-view-container",className:M()({[h.fixedSizeContainer]:!m})},m,o().createElement(Io,{store:x,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),c))},Uo=(0,K.Z)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,scrollbarWidth:n}=e;return{minWidth:t&&t<1024?t-n:1024,height:"100%"}}}),Ho=e=>{let{views:t,layout:n,frozen:a,entityUri:l,maxWidth:i,onLayoutChanged:s}=e;const c=(0,r.useRef)(),u=(p=c.current)?p.offsetWidth-p.clientWidth:0;var p;const d=c.current,m=Uo({maxWidth:i,scrollbarWidth:u}),g=(0,r.useMemo)((()=>({element:d,priority:["left","right","top","bottom"]})),[d]);return(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[l]),o().createElement("div",{ref:c,className:m.scrollWrapper},o().createElement("div",{className:m.scrollableContent,"data-reltio-id":"reltio-profile-grid"},o().createElement(I.p.Provider,{value:g},o().createElement(L.Z,{LayoutItem:zo,views:t,layout:n,onLayoutChanged:s,draggableHandle:".viewDraggableHandle",isStatic:a}))))};var Vo=n(87685);const Fo=(0,K.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Bo=e=>{let{notification:t}=e;const n=Fo({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(y.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(y.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{c.cancelAction&&l(c.cancelAction),u(void 0)}),[c]),f=(0,r.useCallback)((()=>{l(c.applyAction),u(void 0),l(y.ui.actions.closeNotification(t.id))}),[c,t]),h=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(B.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),b=o().createElement(o().Fragment,null,o().createElement(qr.Z,{className:n.closeIcon,size:"S",icon:Vo.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(B.Portal,{container:document.body},o().createElement(B.Snackbar,{autoHideDuration:s,open:p,classes:{root:n.snackbar},action:h,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:b})),o().createElement($e.Z,{open:!!c,title:null==c?void 0:c.confirmationText,content:null==c?void 0:c.confirmationDescription,onSave:f,onDiscard:g,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))},Wo=()=>{const e=(0,a.useSelector)(y.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Bo,{key:e.id,notification:e})))):null};var qo=n(72753),Go=n(43576),_o=n(43054),$o=n(64459),Yo=n(3409),Xo=n(79618),Qo=n(22860),Ko=n(46534);function Jo(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){ea(e,t,n[t])}))}return e}function ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ta(){return ta=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}const na=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",ta({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),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 ra(){return ra=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},ra.apply(this,arguments)}const oa=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",ra({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"})))},aa=(0,K.Z)({editingButtons:{display:"flex","& button + button":{minWidth:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"},menuButton:{marginLeft:8}}),la=e=>o().createElement(B.SvgIcon,e,o().createElement(na,null)),ia=e=>o().createElement(B.SvgIcon,e,o().createElement(oa,null)),sa=(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)})),ca=e=>{let{className:t,profileBandConfig:n,menuItems:l,showMenu:s=!0}=e;const c=aa(),u=(0,a.useDispatch)(),p=(0,a.useSelector)(y.ZP.selectors.getCanUserStartProcessFromQuery),d=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),m=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,d.uri))),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),h=(0,a.useSelector)(y.ZP.selectors.getMode),v=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),E=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),C=(0,a.useSelector)(y.ZP.selectors.getProfileOperation),S=null==d?void 0:d.type,O=(0,r.useMemo)((()=>(0,b.nt9)(g,S)),[S,g]),P=C===b.OXy.Saving,N=C===b.OXy.Cloning||P,[k,Z]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{Z(!1)}),[]),R=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,a.useDispatch)(),c=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,c),[l,c]),d=(0,b.nt9)(l,c),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(c),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,c]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);s(y.N5.entity.actions.entityCloneRequested({data:Jo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),j=(0,r.useMemo)((()=>[{label:x().text("Editing"),value:b.fO_.EDITING,description:x().text("Edit profile directly"),icon:Go.Z,permission:"UPDATE"},{label:x().text("Suggesting"),value:b.fO_.SUGGESTING,description:x().text("Suggest changes and initiate a workflow review"),icon:la,permission:"INITIATE_CHANGE_REQUEST"},{label:x().text("Viewing"),value:b.fO_.VIEWING,description:x().text("Read or print profile"),icon:qo.Z,permission:"READ"}]),[]),D=(0,r.useMemo)((()=>[...R?[{label:x().text("Clone"),value:"Clone",description:x().text("Create a copy of the profile"),icon:ia,onClick:()=>Z(!0),permission:"CREATE"}]:[],{label:x().text("Delete"),value:"Delete",description:x().text("Permanently delete profile"),icon:et.Z,onClick:()=>{window.confirm(x().text("Are you sure you want to delete this?"))&&u(y.N5.entity.actions.entityRemoveRequested({entityUri:d.uri}))},permission:"DELETE"}]),[u,d.uri,R]),I=!w&&!(0,b.biM)(d)&&!(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))(O),L=(0,b.ZiX)(null==d?void 0:d.uri),A=(0,r.useMemo)((()=>sa(j,O,L,f,p)),[j,O,f,p,L]),z=(0,r.useMemo)((()=>sa(D,O,L,f,p)),[D,O,f,p,L]),U=(0,r.useCallback)((e=>{u(y.N5.mode.actions.modeUpdated(e))}),[u]),H=(0,r.useCallback)((()=>{u(y.N5.mode.actions.modeCancelEditing())}),[u]),V=(0,r.useCallback)((()=>{u(y.N5.actions.saveProfile())}),[u]);return o().createElement(o().Fragment,null,o().createElement($o.Z,{className:M()(t,Ot.U),entity:v&&m?m:d},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{mr:3},v&&o().createElement(B.Box,{className:c.editingButtons},o().createElement(B.Button,{variant:"outlined",onClick:H,"data-reltio-id":"reltio-profile-cancel-editing",disabled:N},x().text("Cancel")),o().createElement(B.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:V,disabled:N},(0,b.fnZ)(h)?x().text("Suggest"):x().text("Save"))),w&&E?o().createElement(Yo.Z,null):E&&o().createElement(Xo.a,null)),I&&o().createElement(Qo.T,{optionsGroup:A,buttonsGroup:z,value:h,onChange:U,disabled:N}),s&&o().createElement(Fe.Z,{menuId:"profile-header-menu",buttonComponent:qr.Z,buttonProps:{icon:_o.Z,size:"L","data-reltio-id":"reltio-profile-header-menu",className:c.menuButton},menuItems:l,MenuItemRenderer:Ko.Z})),o().createElement(B.Box,{className:c.comments},o().createElement(Pt.Z,{uri:d.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:d.uri}),objectType:b.q7e.ENTITY}))),!!R&&o().createElement($e.Z,{open:k,title:x().text("Do you want to create a clone of the profile?"),content:x().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:R,onDiscard:T,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))};var ua=n(97499),pa=n(52043),da=n(17308);const ma=(0,K.Z)({wrapper:{display:"flex",overflow:"hidden",flexShrink:0,marginLeft:"3px",height:"100%"},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}});function ga(){return ga=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},ga.apply(this,arguments)}let fa;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(fa||(fa={}));const ha=e=>{let{active:t,tabs:n,onClose:a}=e;const l=ma(),s=!(0,i.isNil)(t),{content:c,headerProps:u,hidden:p}=n[t]||{};return(0,r.useEffect)((()=>{p&&a()}),[t,p,a]),o().createElement("div",{className:l.wrapper},o().createElement(pa.h,{open:s},!p&&o().createElement(o().Fragment,null,o().createElement(da.P,ga({},u,{onClose:a})),c)))};var ba=n(71820),ya=n(44021),va=n(26789),xa=n(54362),Ea=n(6674),wa=n(91515),Ca=n(80147);const Sa=(0,K.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Oa=()=>{const e=Sa(),t=(0,a.useSelector)(y.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(Lr,{key:t.id,config:t,className:e.itemWrapper}))))};var Pa=n(76569);const Na=()=>{const{total:e}=(0,r.useContext)(Z.O),t=ma();return o().createElement(B.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Pa.Z,null))};function ka(){return ka=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},ka.apply(this,arguments)}const Za=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",ka({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"})))))},Ta=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=ma();return o().createElement(B.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Za,null))};function Ra(){return Ra=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},Ra.apply(this,arguments)}const ja=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",Ra({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"}))};var Da=n(46626);const Ia=(0,K.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),La=()=>{const e=Ia(),{tasks:t,loading:n}=(0,r.useContext)(Z.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(D.Z,null),t&&t.map((e=>o().createElement(Da.s,{key:e.taskId,task:e}))))};var Aa=n(10159);const Ma=()=>o().createElement(Aa.Z,{text:x().text("Ready to go with the flow?"),secondaryText:x().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")});var za=n(26313),Ua=n(9371),Ha=n(4426);const Va=(0,K.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Fa=()=>{const e=Va(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(C.h),i=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,za.Q)(n);return o().createElement(Re.X.Provider,{value:s},o().createElement(B.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Ua.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(B.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Ha.Z,{className:e.showMoreIcon}),x().text("Show more"))))},Ba=()=>o().createElement(Aa.Z,{text:x().text("Care to join the conversation?"),secondaryText:x().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")}),Wa=e=>{if(e)return 1===e?x().text("${total} item",{total:e}):x().text("${total} items",{total:e})},qa=(0,K.Z)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),Ga=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:l,children:s}=e;const c=qa(),{defaultTab:u,tabs:p}=(e=>{let{commentId:t,hideHistory:n,perspectiveId:l}=e;const i=(0,a.useSelector)(y.ZP.selectors.isWorkflowSideViewEnabled),s=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),c=(0,a.useSelector)(y.ZP.selectors.isCollaborationSideViewEnabled),u=(0,a.useSelector)(y.ZP.selectors.isDBConnectorSideViewEnabled),p=(0,a.useSelector)(y.ZP.selectors.isCollaborationEnabled),d=t?fa.Collaboration:void 0,m=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,a.useSelector)(y.ZP.selectors.getEntity),h=(0,r.useContext)(Z.O),v=(0,r.useContext)(C.h),{isHistoryEnabled:E,isProfilePersisted:w}=(0,ba.C)({perspectiveId:l,entity:f,historyButtonId:fa.History}),{historyFilter:S,onApplyFilter:O,isLoading:P,historicUris:N,historyWithTotal:k,canLoadMore:T,onLoadMore:R}=(0,ya.k6)({entity:f,enabled:E}),j=i&&s&&!(0,b.ZiX)(null==f?void 0:f.uri),D=c&&p,I=(0,b.mdt)(null==v?void 0:v.commentsMap);return{tabs:(0,r.useMemo)((()=>[{buttonProps:{id:fa.Workflow,icon:Na,tooltipTitle:x().text("Workflow")},content:null!=h&&h.total?o().createElement(La,null):o().createElement(Ma,null),headerProps:{mainTitle:x().text("Workflow"),secondTitle:Wa(null==h?void 0:h.total),rightContent:o().createElement(va.G,null)},hidden:!j},{buttonProps:{id:fa.Collaboration,icon:Ta,tooltipTitle:x().text("Collaboration")},content:I?o().createElement(Fa,null):o().createElement(Ba,null),headerProps:{mainTitle:x().text("Collaboration"),secondTitle:Wa(I)},hidden:!D},{buttonProps:{id:fa.History,icon:Ca.Z,tooltipTitle:x().text("History")},content:w?o().createElement(xa.Z,{isLoading:P,historyWithTotal:k,contributorsUris:N,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:R,canLoadMore:T}):o().createElement(Ea.Z,null),headerProps:{content:o().createElement(wa.Z,{total:w?((null==N?void 0:N.length)||0)+1:void 0,entityType:(0,b.nt9)(g,null==f?void 0:f.type),filter:S,onApplyFilter:O})},hidden:n},{buttonProps:{id:fa.DBConnector,icon:ja,tooltipTitle:x().text("D&B Connector")},content:o().createElement(Oa,null),headerProps:{mainTitle:x().text("D&B Connector")},hidden:!u}]),[null==h?void 0:h.total,j,I,D,w,P,k,N,null==f?void 0:f.uri,null==f?void 0:f.type,m,R,T,g,S,O,u]),defaultTab:d}})({commentId:n,hideHistory:l,perspectiveId:t});return o().createElement("div",{className:c.profileContainer},o().createElement(ua.n,{defaultTab:u,perspectiveId:t,buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(p)},s,o().createElement(ha,{tabs:p})))}));Ga.displayName="ProfilePerspectiveView";var _a=n(39781),$a=n(16715);const Ya="48px",Xa="1px solid rgba(0, 0, 0, .125)",Qa=(0,K.Z)((e=>({accordion:{borderTop:Xa,borderBottom:Xa,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Ya,minHeight:Ya,"&$accordionSummaryExpanded":{height:Ya,minHeight:Ya}},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"},attributeTypesPath:{color:e.palette.text.secondary},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"}}))),Ka=Qa;var Ja=n(38016);const el=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Ka();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(B.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(B.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(Ja.Z,null)},i,o().createElement(B.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(B.AccordionDetails,{className:M()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function tl(){return tl=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},tl.apply(this,arguments)}el.displayName="ErrorsPanel";const nl=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",tl({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"}))},rl=(0,i.omit)(["deactivated","path"]),ol=(0,r.memo)((e=>{let{error:t}=e;const n=Ka(),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),c=((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?x().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),p=(e=>{let{path:t}=e;return null==t?void 0:t.filter((e=>{let{type:t}=e;return t===b.HAc.attributeValue})).map((0,i.either)((0,i.path)(["valueType","label"]),(0,i.path)(["valueType","name"]))).filter(i.identity).join(" > ")})(t),{highlightError:d}=(0,r.useContext)(j.NY),m=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},p&&o().createElement("span",{className:n.attributeTypesPath},p),o().createElement("span",{className:n.errorTitle},c,m&&s&&o().createElement(De.k,{icon:nl,size:"XXS",onClick:()=>d(t),tooltipTitle:x().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));ol.displayName="Error";const al=()=>{const e=Ka(),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(rl),t.map(rl))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(y.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:x().text("${number} ${errors}",{number:n.length,errors:1===n.length?x().text("error"):x().text("errors")}),icon:o().createElement(_a.Z,{className:M()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:x().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?x().text("warning"):x().text("warnings")}),icon:o().createElement($a.Z,{className:M()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(el,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ol}):null};var ll=n(3096),il=n.n(ll),sl=n(60641);function cl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ul={};var pl=n(61756),dl=n(4109);function ml(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gl=n(81556),fl=n(10341);const hl=(0,K.Z)((e=>({wrapper:{alignItems:"center",display:"flex",padding:"12px 16px",fontSize:"13px",lineHeight:"15px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.secondary},loadingWrapper:{display:"flex",backgroundColor:"rgba(238, 238, 238, 1)",color:e.palette.text.secondary,boxShadow:"inset 0px -1px 0px rgba(0, 0, 0, 0.12)"},errorWrapper:{display:"flex",backgroundColor:"rgba(255, 235, 238, 1)",color:e.palette.error.main},successWrapper:{display:"flex",backgroundColor:"rgba(239, 253, 227, 1)",color:e.palette.success.main,"& span, & b":{paddingRight:"4px"}},closeIcon:{color:e.palette.text.secondary,cursor:"pointer","&:hover":{background:"none"}},indicatorIcon:{padding:"0 14px"},link:{color:e.palette.primary.main,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular,cursor:"pointer"}}))),bl=hl;let yl;!function(e){e.loading="loading",e.success="success",e.error="error"}(yl||(yl={}));const vl=e=>{let{onClose:t}=e;const n=bl();return o().createElement(De.k,{tooltipTitle:x().text("Close"),onClick:t,size:"S",className:n.closeIcon,icon:Vo.default})},xl=e=>{let{onClose:t}=e;const n=bl();return o().createElement("div",{className:M()(n.wrapper,n.loadingWrapper)},o().createElement(vl,{onClose:t}),o().createElement(Dt.Z,{className:M()(n.indicatorIcon)}),o().createElement(B.Typography,null,x().text("Loading background process...")))},El=e=>{let{label:t,onClose:n,onRefresh:r}=e;const a=bl();return o().createElement("div",{className:M()(a.wrapper,a.successWrapper)},o().createElement(vl,{onClose:n}),o().createElement(gl.Z,{className:M()(a.indicatorIcon)}),o().createElement("div",{"data-reltio-id":"background-update-success"},o().createElement("span",null,x().text("This Profile")),o().createElement("b",null,(0,b.idV)(t)),o().createElement("span",null,x().text("has been updated.")),o().createElement("span",{onClick:r,className:a.link},x().text("Click Here to Refresh the page")),o().createElement("span",null,x().text(" to retrieve the latest profile data."))))},wl=e=>{let{onClose:t}=e;const n=bl();return o().createElement("div",{className:M()(n.wrapper,n.errorWrapper)},o().createElement(vl,{onClose:t}),o().createElement(fl.Z,{className:M()(n.indicatorIcon)}),o().createElement(B.Typography,null,x().text("UI attempted to check for updates but no update received in the last 30 seconds. Try refreshing the page manually.")))},Cl=e=>{let{label:t,onClose:n,onRefresh:r,status:a}=e;switch(a){case yl.loading:return o().createElement(xl,{onClose:n});case yl.success:return o().createElement(El,{label:t,onClose:n,onRefresh:r});case yl.error:return o().createElement(wl,{onClose:n});default:return null}},Sl=(e,t)=>((e,t)=>"*"===(null==e?void 0:e[0])||!(0,i.isNil)(e)&&e.includes(t))(e,t),Ol=(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},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%"}},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Pl=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i,commentId:s}=e;const{maxWidth:c,profileBand:u,workflow:p,frozen:d}=n||{},g=Ol({maxWidth:c}),f=(0,a.useSelector)(y.ZP.selectors.getEntity),h=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),v=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),I=(null===(t=(0,a.useSelector)(y.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",L=(0,a.useSelector)(y.ZP.selectors.getMode),A=(0,a.useDispatch)(),M=(0,E.u)(),z=(e=>{const t=(0,pl.v)(e),n=(0,dl.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){ml(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(p),{isLoading:U}=(0,w.M)(),{type:H,uri:V,updatedTime:F}=f||{},{onRefreshProfile:B,onCloseBackgroundProcessIndicator:W,cancelUpdateProcess:q,isOpenBackgroundProcessIndicator:G,backgroundUpdateStatus:_}=(e=>{let{entityUri:t,entityTypeUri:n,entityUpdatedTime:o}=e;const l=(0,a.useDispatch)(),{autoUpdateInReadMode:i,entityTypes:s}=(0,a.useSelector)(y.ZP.selectors.getProfileCheckUpdate)||{},c=Sl(s,n),u=Sl(i,n),p=(0,r.useRef)(null),d=(0,Se._)(),g=(0,er.u)(),f=(0,r.useContext)(m.m),[h,v]=(0,r.useState)(!1),[x,E]=(0,r.useState)(yl.loading),w=6e3;const C=(0,r.useCallback)((()=>{l(y.N5.entity.actions.loadEntity({viewId:f,uri:t})),v(!1)}),[l,t,f]),S=(0,r.useCallback)((()=>{v(!1)}),[]),O=(0,r.useCallback)((()=>{clearTimeout(p.current),v(!1),d(Promise.resolve())}),[d]),P=(0,r.useCallback)((e=>{d((0,b.GBJ)(t)).then((t=>{t.updatedTime>o&&(E(yl.success),u?C():v(!0),e=-1)})).catch((()=>{})).finally((()=>{e<0||(e?(e-=1,p.current=setTimeout(P,w,e)):(E(yl.error),v(!0)))}))}),[o,t,u,C,d,w]),N=(0,r.useCallback)((()=>{c&&(E(yl.loading),v(!0),p.current=setTimeout(P,w,4))}),[P,c]);return(0,r.useEffect)((()=>{const e=g((e=>{e.type===y.N5.constants.ProfileActions.PROFILE_SAVED&&N()}));return()=>{e()}}),[g,d,N]),{onRefreshProfile:C,onCloseBackgroundProcessIndicator:S,cancelUpdateProcess:O,isOpenBackgroundProcessIndicator:h,backgroundUpdateStatus:x}})({entityUri:V,entityTypeUri:H,entityUpdatedTime:F}),$=(0,r.useMemo)((()=>(0,b.dvH)(f)),[f]),Y=(0,r.useContext)(C.h),X=(0,S.C)({objectIds:$}),{views:Q,layout:K,isLoaded:J,onLayoutReset:ee,onResetUndo:te,handleLayoutChange:ne}=(e=>{let{config:t,entityTypeUri:n,saveState:o,getSavedState:a}=e;const[l,i]=(0,r.useState)([]),[s,c]=(0,r.useState)([]),{canRead:u}=(0,Fn.l)(),p=(0,r.useMemo)((()=>{const e=t.views.filter(u),n=(0,b.sFD)(t.layout,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){cl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>il()(p)),[p]),m=null!=p&&p.nestedRoute?`/${p.nestedRoute}`:"",g=n&&p?n+m:null,f=(0,r.useCallback)((()=>a().then((e=>e.layout?{}:e))),[a]),h=(0,r.useCallback)((0,b.DsO)(o,1e3),[o]),{isLoaded:y,savedState:v=ul,updateSavedState:x}=(0,sl.w)({getSavedState:f,saveState:h,entityTypeUri:g}),E=(0,r.useCallback)((e=>{x({layout:e,views:s,configHash:d}),i(e)}),[x,d,s]),w=(0,r.useRef)(),C=(0,r.useCallback)((()=>{c(w.current.views),E(w.current.layout)}),[E]),S=(0,r.useCallback)((()=>{w.current={views:s,layout:l};const{views:e,layout:t}=(0,b.Mfk)({views:p.views,layout:p.layout});c(e),E(t)}),[p,l,s,E]);return(0,r.useEffect)((()=>{if(y){const e=d!==v.configHash,{views:t,layout:n}=(0,b.Mfk)({views:e||!v.views?p.views:v.views,layout:e?p.layout:v.layout});c(t),i(n)}}),[y,v,g]),{views:s,layout:l,isLoaded:y,onLayoutReset:S,onResetUndo:C,handleLayoutChange:E}})({config:n,entityTypeUri:H,saveState:l,getSavedState:i});(0,O.a)({entity:f,historyEvent:h}),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(y.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(y.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),s=(0,a.useSelector)(y.ZP.selectors.getMode),c=(0,a.useSelector)(y.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(y.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&s===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})(),(0,r.useEffect)((()=>{A(y.N5.views.actions.profileViewsSet(Q))}),[A,Q]),(0,r.useEffect)((()=>{n.sidePanelViews&&A(y.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>()=>q()),[V,L]);const re=L===b.ARY.Viewing&&(0,b.ZiX)(V),oe=e=>o().createElement("div",{className:g.emptyState},o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:e,variant:P.tC.embedded})),{SnackbarRenderer:ae,resetLayout:le}=(0,N.w)({onLayoutReset:ee,onResetUndo:te}),ie=(0,r.useMemo)((()=>[{primary:x().text("Reset layout"),secondary:x().text("Restore the default layout without saving any changes"),onClick:le}]),[le]);return o().createElement(k.j.Provider,{value:!0},o().createElement(C.e,{collaboration:v?Y:X},o().createElement(Z.O.Provider,{value:z},o().createElement(T.m.Provider,{value:M},o().createElement(R.l.Provider,{value:I},o().createElement(j.fy,null,o().createElement("div",{className:g.perspectiveView},J&&V?o().createElement(Ga,{commentId:s,perspectiveId:"profile"},o().createElement("div",{className:g.profileWrapper},o().createElement(ca,{profileBandConfig:u,showMenu:!d,menuItems:ie}),U?oe(x().text("Loading")):o().createElement(o().Fragment,null,G&&o().createElement(Cl,{label:f.label,onClose:W,onRefresh:B,status:_}),!v&&o().createElement(al,null),!re&&o().createElement(Ho,{maxWidth:c,views:Q,layout:K,frozen:d,entityUri:V,onLayoutChanged:ne})))):o().createElement(o().Fragment,null,o().createElement(D.Z,null),oe(x().text("No data to display."))),o().createElement(Wo,null),o().createElement(ae,null))))))))}));function Nl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Pl.displayName="ProfilePerspectiveView";const kl=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0});b.oss.register("profile",((e,t)=>{const n=e=>(0,i.sort)(((e,t)=>e.x>t.x||e.x===t.x&&e.y>t.y?1:-1),e),r=(0,i.map)((e=>(0,i.evolve)({layout:(0,i.pipe)(n,(0,i.map)((0,i.ifElse)((0,i.propEq)("autosizing",!0),(0,i.omit)(["y","height","minHeight","maxHeight"]),(0,i.omit)(["y","minHeight","maxHeight"]))))},e)));return(0,b.l22)(r(e),r(t))}));const Zl=e=>{let{config:t,store:n,onResize:v=i.identity,saveState:x,getSavedState:E,qxSandboxApi:w,commentId:C}=e;const S=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:O,showSnackbarMessage:P}=(0,p.D)(),N=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]),k=(0,r.useContext)(d.Y),Z=y.ZP.selectors.getShowAttributeDescription(n.getState()),T=(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){Nl(e,t,n[t])}))}return e}({},k,{showDescription:Z})),[k,Z]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:null==N?void 0:N.id},o().createElement(g.S.Provider,{value:P},o().createElement(f.Y.Provider,{value:w},o().createElement(s.StylesProvider,{generateClassName:kl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:T},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>v(Math.floor(e),Math.floor(t))}),N&&o().createElement(Pl,{config:N,saveState:x,getSavedState:S,commentId:C}),o().createElement(h.Z,{showErrorFromStore:!0}),o().createElement(O,null)))))))))};var Tl=n(82842),Rl=n(51229),jl=n(91131);const Dl=(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}}))),Il=e=>{let{total:t=0}=e;const n=Dl(),l=(0,a.useDispatch)(),i=(0,r.useContext)(m.m),s=(0,r.useCallback)((()=>{l(y.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(W.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(B.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},x().text("Profile")),o().createElement(jl.Z,{className:n.icon}),x().text("Tags")),o().createElement(Rl.Z,null),o().createElement(B.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},x().number(t,"0,0")),x().text("total profiles")))};var Ll=n(20404);const Al=(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"}}))),Ml=e=>{let{label:t}=e;const n=Al();return o().createElement(B.Toolbar,{className:n.toolbar},o().createElement(Ll.Z,{className:n.avatar}),o().createElement(B.Typography,{variant:"h6",className:n.label},t))};function zl(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}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 Hl=(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}}))),Vl=[25,50,100],Fl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Hl(),[s,c]=(0,r.useState)(Vl[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,Se._)(),u=(0,Se._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:v,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(y.ZP.selectors.getTenant),s=(0,a.useSelector)(y.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=zl({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,b.E7G)(c))):(0,b.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,zl({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(E()).then(g).catch(w)}),[E,c,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:s}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const v=g>Vl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Ml,{label:t}),o().createElement("div",{className:M()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(V.Z,{className:l.tagsView},o().createElement(Il,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(D.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(Tl.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(F.Z,{count:g,rowsPerPageOptions:Vl,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));Fl.displayName="TagPerspectiveView";const Bl=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Wl=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(m.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Bl},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Fl,{tag:n,entityUri:r}),o().createElement(h.Z,{showErrorFromStore:!0}))))};var ql=n(65321);const Gl=(0,K.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),_l=()=>{const e=Gl(),t=(0,a.useSelector)(y.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(Z.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($o.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(ql.o,{task:l})))};function $l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yl=(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}}))),Xl={processTypes:["dataChangeRequestReview"]},Ql=(0,r.memo)((()=>{const e=Yl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(y.ZP.selectors.getEntityUri),o=(0,pl.v)(e),l=(0,r.useCallback)((e=>{"Reject"===e&&t(y.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(y.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){$l(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(Xl),l=(0,a.useSelector)(y.ZP.selectors.getEntity);(0,r.useEffect)((()=>{t(y.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(Z.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(D.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(Ga,{hideHistory:!0,perspectiveId:"dcrCard"},o().createElement("div",{className:e.contentWrapper},o().createElement(_l,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(z.Z,null)))):o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:x().text("No data to display."),variant:P.tC.embedded}))))}));function Kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Ql.displayName="DCRReviewPerspectiveView";const Jl=(0,s.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),ei=e=>{let{config:t,store:n,onResize:p=i.identity}=e;const g=(0,r.useContext)(d.Y),f=y.ZP.selectors.getShowAttributeDescription(n.getState()),b=(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){Kl(e,t,n[t])}))}return e}({},g,{showDescription:f})),[g,f]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Jl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:b},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>p(Math.floor(e),Math.floor(t))}),o().createElement(Ql,null),o().createElement(h.Z,{showErrorFromStore:!0}))))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>qe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(50914),s=n(52730),c=n(86051),u=n(81559),p=n(65549),d=n(94079),m=n(13980),g=n.n(m),f=n(2507),h=n.n(f),b=n(79692);const y=(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"}}),v=e=>{let{onClick:t}=e;const n=y();return a().createElement(d.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(p.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},h().text("Add")))};v.propTypes={onClick:g().func};const x=v;var E=n(71153),w=n.n(E);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"},description:{marginLeft:"-22px"},"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(),s=(0,u.$qe)(r),c=(0,u.Fn9)(r.relation)&&(0,u.Fn9)(r.entity);return a().createElement("div",{className:w()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:s,[i["row-cell--inactive"]]:!c},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const k=N;var Z=n(85709),T=n(94656),R=n(47898),j=n(34e3),D=n(95613);const I=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,s.useDispatch)(),l=(0,o.useContext)(R.m),p=O(),d=(0,u.idV)(n.entityLabel),m=(0,u.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:p.entityCell},a().createElement(j.Z,{className:p.entityAvatar,entityType:t}),a().createElement(D.Z,{value:d},a().createElement("span",{className:p.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:m,viewId:l}),c.ui.actions.openEntity,r)},d)))};I.propTypes={value:g().shape({entity:g().shape({entityUri:g().string,entityLabel:g().string}),entityType:u.p8l})};const L=I;var A=n(92332),M=n(98448);const z=(0,n(67353).Z)((e=>{const t=O(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(A.default,e),a().createElement(M.Z,{description:n,className:t.description}))}));var U=n(64091);const H=(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 F=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=F(e);return t.length>1?t.slice(0,-1):null}return null},W=(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:B(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:U.Z)});var t})),q=(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 G=n(27604),_=n(22983);const $=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(d.Tooltip,{title:h().text("Edit")},a().createElement(d.IconButton,{onClick:r},a().createElement(G.Z,null))),n&&a().createElement(d.Tooltip,{title:h().text("Remove")},a().createElement(d.IconButton,{onClick:o},a().createElement(_.Z,null))))};$.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const Y=$;function X(){return X=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},X.apply(this,arguments)}const Q=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:s,onSort:p,filters:d,onFilter:m,onEditRelation:g,onRemoveRelation:f,basicTableRef:h,allowOnlyCreateNew:b}=e;const y=(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,u.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,u.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,u.tT_)(e))(t))(F(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),v=(0,o.useMemo)((()=>W(n)),[n]),x=q(),E=(0,o.useCallback)((e=>a().createElement(k,X({},e,{isSorted:!!s&&s.field===e.columnData.id}))),[s]),[w,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,u.xvW)(r);if(c.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,u.$qe)(r),i=(0,u.V3K)(t,e);return{canRemove:o&&!l&&(0,u.Edd)(n,i),canUpdate:a&&!l&&(0,u.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:f,onEditRelation:g,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([w,"connection"],y)}),P=(0,o.useCallback)((e=>C(e)),[]),N=(0,o.useCallback)((()=>g((0,i.path)([w,"connection"],y))),[w,g,y]),T=(0,o.useCallback)((()=>f((0,i.path)([w,"connection","relation","relationUri"],y))),[w,f,y]),R=S||O?a().createElement(Y,{handleEditRelation:N,handleRemoveRelation:T,canRemove:S,canUpdate:O}):void 0;return a().createElement("div",{className:x.tableContainer},a().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:v,rowsData:y,sorting:s,onSort:p,filters:d,onFilter:m,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:w,hoveredRowRightContent:R,classes:{hoveredRowRightContentWrapper:x["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:x["row-cell__buttons-container"]},ref:h,resizeDebounceDelay:150}))};Q.propTypes={mode:g().string,columnsData:T.uz,connections:g().arrayOf(u.Rjq),metadata:u.pGS,filters:g().objectOf(T.Dq),onFilter:g().func,sorting:T.nI,onSort:g().func,onEditRelation:g().func,onRemoveRelation:g().func,basicTableRef:g().shape({current:g().object}),allowOnlyCreateNew:g().bool};const K=Q;var J=n(93416),ee=n(75512),te=n(30553),ne=n(32152),re=n(1876),oe=n(60894),ae=n(43054),le=n(8818);const ie=(0,b.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),se=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=ie(),i=(0,o.useRef)(),[s,c]=(0,o.useState)(!1),u=()=>c((e=>!e));return a().createElement(a().Fragment,null,a().createElement(le.k,{className:t,ref:i,tooltipTitle:h().text("More"),icon:ae.Z,onClick:u,size:"L"}),a().createElement(d.Popover,{open:s,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(d.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(d.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:h().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"}}),ue=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:s,selectedColumns:c,onChangeColumns:u,showInactive:p,onChangeShowInactive:m}=e;const g=ce();return a().createElement(J.Z,{title:t,className:g.header},a().createElement(ee.Z,{widthToHide:500},a().createElement(te.Z,{height:24,margin:16}),a().createElement(d.Typography,{className:g.totalCaption,variant:"caption"},n>1?h().text("${count} entities",{count:n}):h().text("${count} entity",{count:n}))),a().createElement(ne.i,{query:r,onChange:o}),a().createElement(re.Z,{enabled:l,onClick:i}),a().createElement(te.Z,{height:24,margin:4}),a().createElement(oe.Z,{columnsData:s,selectedColumns:c,onChangeColumns:u}),a().createElement(se,{className:g.moreButton,showInactive:p,onShowInactiveChange:m}))};ue.propTypes={title:g().string,total:g().number,columnsData:T.uz,selectedColumns:g().arrayOf(g().string),onChangeColumns:g().func,searchQuery:g().string,onChangeSearchQuery:g().func,filtersEnabled:g().bool,onToggleFilters:g().func,showInactive:g().bool,onChangeShowInactive:g().func};const pe=ue;var de=n(26180),me=n(31276);function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he="CHANGE_SEARCH_QUERY",be="CHANGE_SHOW_INACTIVE",ye=ge({},de.ZP.actions,{changeSearchQuery:(0,me.zD)(he),changeShowInactive:(0,me.zD)(be)}),ve=(e,t)=>{switch(t.type){case he:return ge({},e,{searchQuery:t.payload,page:0});case be:return ge({},e,{showInactive:t.payload});default:return de.ZP.reducer(e,t)}};var xe=n(26481),Ee=n(87451),we=n(37152),Ce=n(52016),Se=n(10237),Oe=n(11013),Pe=n(58662),Ne=n(99136);const ke=[10,25,50,100],Ze=[{id:"entity.label",get label(){return h().text("Entity label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return h().text("Directional label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return h().text("Start date")},dataTypeDefinition:u.PY2.startDate},{id:"relation.activeness.endDate",get label(){return h().text("End date")},dataTypeDefinition:u.PY2.endDate}],Te=(0,i.pipe)(u.Tde,(0,i.concat)("relation.")),Re=(0,i.pipe)((0,i.map)((e=>({id:Te(e.uri),label:e.label,description:e.description,dataTypeDefinition:(0,u.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),je=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(H,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),u.DK$)(o))))([...n,...r])}),Re,(0,i.concat)(Ze));var De=n(37754);const Ie=(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)"}});function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ae=(0,i.pluck)("id",Ze),[Me]=Ae;function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=(0,i.memoizeWith)(((e,t)=>t.id),u.fS6),He=(0,s.connect)(((e,t)=>{const{config:n}=t;return{connections:c.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:c.ZP.selectors.getTotalByViewId(e,n.id),entity:c.ZP.selectors.getEntity(e),metadata:c.ZP.selectors.getMetadata(e),mode:c.ZP.selectors.getMode(e),relationToAdd:c.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:c.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:c.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){ze(e,t,n[t])}))}return e}({},e,t,n,{config:Ue(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:p=[],total:m=0,mode:g,relationToAdd:f,relationsToEdit:b=[],checkIfCanAddRelations:y,dispatch:v,readOnlyMode:E}=e;const w={searchQuery:"",filters:null,visibleColumns:Ae,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Me},page:0,rowsPerPage:n.max||15,showInactive:!1},C=Ie(),S=(0,o.useContext)(xe.j)?g:u.fO_.VIEWING,[O,P]=(0,o.useReducer)(ve,w),N=(0,i.pipe)(ye.changeSearchQuery,P),k=(0,i.pipe)(ye.changeShowInactive,P),Z=(0,o.useContext)(Ee.Y),T=(0,s.useSelector)(c.ZP.selectors.getShowAttributeDescription),R=(0,o.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){Le(e,t,n[t])}))}return e}({},Z,{showDescription:T})),[Z,T]);(0,o.useEffect)((()=>{N("")}),[null==r?void 0:r.uri]);const{visibleColumns:j,searchQuery:D,filters:I,sorting:L,page:A,rowsPerPage:M,showInactive:z}=O,U=(0,o.useMemo)((()=>je(n,l)),[n,l]),H=(0,o.useMemo)((()=>j.map((e=>U.find((0,i.propEq)("id",e))))),[j,U]),V=(0,o.useMemo)((()=>((e,t,n)=>{const r=u.wSh.fromFalsy(e).map(u.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,De.Tz)(n,t);return(new u.MEy).addClause(r).addClause(o).build()})(D,I,H)),[I,D]),{isLoading:F}=(0,we.a)({sorting:L,filter:V,page:A,rowsPerPage:M,config:n,entity:r,relationActivityFilter:z?u.Ng6.ALL:u.Ng6.ACTIVE_ONLY,mode:g}),B=(0,o.useMemo)((()=>{return e=w.rowsPerPage,ke.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:W,handlePageChange:q}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(ye.changeRowsPerPage,P),handlePageChange:(0,i.pipe)(ye.changePage,P)})),[]),G=(0,o.useCallback)((()=>{const e=(0,u.vlo)({config:n,mode:S,metadata:l,parentEntityUri:void 0});(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),v)(e)}),[n,S,l,v]),_=(0,o.useCallback)((e=>{v(c.N5.relations.actions.closeRelationEditor(n.id,e)),v(c.N5.relations.actions.removeRelation(n.id,e));const t=p.find((t=>c.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=c.N5.relations.selectors.getEntityUriFromConnection(t);(0,u.ZiX)(r)&&v(c.N5.modifiedEntities.actions.entityDeleted(r))}),[n,p,v]),$=r&&y&&!E,Y=f?[f,...b]:b,{canUpdate:X,canDelete:Q}=(0,Ce.l)(),J=X(n)&&!E,ee=Q(n)&&!E,te=(0,o.useRef)(null);return a().createElement(Ee.Y.Provider,{value:R},a().createElement(Se.Z,{className:t},a().createElement(pe,{title:n.caption,total:m,columnsData:U,selectedColumns:j,onChangeColumns:(0,i.pipe)(ye.changeColumns,P),searchQuery:D,onChangeSearchQuery:N,filtersEnabled:!!I,onToggleFilters:(0,i.pipe)(ye.toggleFilters,P),showInactive:z,onChangeShowInactive:k}),$&&a().createElement("div",{className:C.addArea},a().createElement(x,{onClick:G})),Y.map((e=>a().createElement(Oe.Z,{key:c.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:S,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(K,{mode:S,columnsData:H,connections:p,metadata:l,filters:I,onFilter:(0,i.pipe)(ye.changeFilter,P),sorting:L,onSort:(0,i.pipe)(ye.toggleSort,P),onEditRelation:J?(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),v):null,onRemoveRelation:ee?_:null,basicTableRef:te,allowOnlyCreateNew:n.allowOnlyCreateNew}),p.length?a().createElement(Pe.Z,{count:m,rowsPerPageOptions:B,rowsPerPage:M,onChangeRowsPerPage:W,page:A,onChangePage:q,basicTableRef:te}):a().createElement(d.Typography,{className:C.noData},h().text("No data found")),F&&a().createElement(Ne.Z,null))))}));var Ve=n(36138),Fe=n(22664),Be=n(585);const We=(0,Ve.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),qe=e=>{let{config:t,store:n,onResize:o=i.identity,className:c,readOnlyMode:u}=e;return a().createElement(s.Provider,{store:n},a().createElement(R.m.Provider,{value:t.id},a().createElement(Ve.StylesProvider,{generateClassName:We},a().createElement(Fe.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(He,{config:t,className:c,readOnlyMode:u}),a().createElement(Be.Z,null)))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[8723],{18723:(e,t,n)=>{n.d(t,{vC:()=>ei,_n:()=>Zl,tM:()=>Wl});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(50914),s=n(36138),c=n(44443),u=n(22664),p=n(24605),d=n(87451),m=n(47898),g=n(97094),f=n(60115),h=n(585),b=n(88832),y=n(86051),v=n(2507),x=n.n(v),E=n(76536),w=n(94622),C=n(41564),S=n(7718),O=n(57730),P=n(21077),N=n(85547),k=n(26481),Z=n(94150),T=n(26005),R=n(72249),j=n(94773),D=n(99136),I=n(30268),L=n(63291),A=n(71153),M=n.n(A),z=n(8962);const U=o().createContext(null);U.displayName="SingleAttributeContext";var H=n(60995),V=n(10237),F=n(58662),B=n(94079),W=n(93416),q=n(55299),G=n(98448),_=n(75512),$=n(30553),Y=n(66410),X=n(32152),Q=n(36444),K=n(79692);const J=(0,K.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ee=e=>{let{className:t}=e;const n=J(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(U),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:M()(n.triggerButton,t)},onClick:u},o().createElement(Q.Z,null)),o().createElement(B.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:x().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,isEditableMode:l}=e;const i=te(),{searchQuery:s,setSearchQuery:c,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(U),g=l&&(null==m?void 0:m.required);return o().createElement(W.Z,{title:t,className:i.root},g&&o().createElement(q.Z,null),o().createElement(G.Z,{description:null==m?void 0:m.description}),o().createElement(_.Z,{widthToHide:500},o().createElement($.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:i.totalCaption,variant:"caption"},x().number(n)," ",1===n?x().text("item"):x().text("items"))),o().createElement(Y.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),o().createElement(X.i,{query:s,onChange:e=>{c(e),u(0)}}),a&&o().createElement(ee,null))};var re=n(65549),oe=n(11564),ae=n(93140),le=n(76134),ie=n(96811),se=n(48852);const ce=b.nIW,ue=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ue(n,t)})))):b.P6Y.strings.search(String(e),t),pe=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return ue(t,l)})))(t,n,r),c=(0,i.filter)(b.OXP,s);return{[(0,b.xy8)(r)]:{[ce(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}},de=(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"}})));function me(){return me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},me.apply(this,arguments)}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he=[],be=(0,se.l)(j.NY,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{element:o,type:a}=e||{};return{highlightedError:(0,j.Ie)(a)&&(0,b.Wah)(o,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c,highlightedError:u}=e;const p=de(),{uri:d,required:g,cardinality:f,name:h}=n,v=(0,a.useDispatch)(),E=(0,r.useContext)(m.m),w=(0,a.useSelector)(y.ZP.selectors.getEntity),C=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,w.uri)||{})),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),O=(0,a.useSelector)((e=>(0,b.tQX)(l,n,y.ZP.selectors.getProfileErrors(e)))),P=(0,a.useSelector)(y.ZP.selectors.getMode),N=(0,b.xy8)(n),k=(0,i.pipe)((0,i.pathOr)(he,[N,h]),(0,i.map)((0,i.prop)("uri")))(w),Z=(0,i.pathOr)(he,[N,h],C),T=Z.map((0,i.prop)("uri")),R=(0,b.ZiX)(w.uri),j=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:l,attributeType:n})),[l,n]),{ref:D,errorClassName:I}=(0,oe.B)({highlightedError:u,isSimple:!0}),L=(0,b.O27)(Z),A=g&&L,z=A?[j]:Z.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),U=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,v)(e.map((e=>ge({},e,{viewId:E}))))),[E,v]),H=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,v)(ge({},e,{viewId:E}))),[E,v]),V=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,v)(ge({},e,{viewId:E}))),[E,v]),F=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,v),[v]),W=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return U(A&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[U,l,n,A]),q=(0,b.Vg3)({attributeType:n,mode:P}),G={attributeType:n,errors:S,crosswalks:C.crosswalks,mode:P,onAddAttributes:U,onChangeAttribute:H,onDeactivateError:F,showNonOv:s},_=0===z.length&&0===t.length;return!(0,i.isEmpty)(C)&&o().createElement("div",{ref:D,className:I},o().createElement(ae.Z,{cardinality:f}),o().createElement(le.Z,{message:O}),q&&o().createElement(B.Button,{color:"primary",onClick:W,className:p.moreButton},o().createElement(re.Z,{classes:{root:p.icon}}),o().createElement("div",{className:p.buttonLabel},x().text("Add"))),z.map(((e,t)=>o().createElement(ie.Z,me({key:e.uri},G,{attributeValue:e,lazy:A&&!g,showEmptyEditors:R,ownError:(0,b.ADq)(e,t,d,S),onDeleteAttribute:V,isEmptyEditor:A})))),z.length>0&&t.length>0&&o().createElement(B.Divider,{className:p.divider}),t.map((e=>{const t=Z.find((0,i.propEq)("uri",e.uri)),n=t||e,r=k.includes(n.uri)&&!T.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:M()({[p.ovFalse]:!(0,b.OXP)(n)})},o().createElement(ie.Z,me({},G,{attributeValue:n,ownError:(0,b.ADq)(n,null,d,S),onDeleteAttribute:V,state:l})))})),_&&o().createElement(B.Typography,{className:p.noData},c))}));var ye=n(81303);const ve=(0,K.Z)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),xe=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=ve(),l=!(0,b.YkM)(n);return o().createElement(o().Fragment,null,t.map((e=>o().createElement(ye.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:M()({[a.simpleAttribute]:l})}))))},Ee=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"hidden",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),we=15,Ce=e=>{let{config:t,className:n}=e;const{caption:l,max:i=we,showInactiveValuesMenu:s}=t,c=Ee(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(U),v=(0,a.useSelector)(y.ZP.selectors.getEntityUri),E=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(y.ZP.selectors.getPivotingAttributes),S=0!==u.length,O=t["text-empty"]||x().text("No data found");return o().createElement(H.J.Provider,{value:C},o().createElement(V.Z,{className:M()(c.root,n)},o().createElement(ne,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s,isEditableMode:w}),o().createElement(B.Box,{className:c.content},(()=>{if(g)return o().createElement(D.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:b};return o().createElement(xe,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:O};return o().createElement(be,e)}}return o().createElement(B.Typography,{className:c.noData},O)})()),f&&o().createElement(F.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var Se=n(85229),Oe=n(20562);function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ne=(e,t)=>{const{attributeUri:n,max:o=15}=e,l=(0,a.useSelector)(y.ZP.selectors.getMetadata),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=(0,Se._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),v=(0,a.useSelector)(y.ZP.selectors.getApiPath),E=(0,a.useSelector)(y.ZP.selectors.getTenant),w=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),C=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),S=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(y.ZP.selectors.getHistoryDiff),P=w.uri,N=ce(n),k=(0,b.xy8)(n);f.current=(0,b.JQy)(w,P,N);const Z=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:T}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:R}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,b.Uty)(Z)&&!(0,b.ZiX)(P)&&(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"]),s=(0,b.biM)(w)||S?pe:b.KbL;g(s(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pe(e,t,n[t])}))}return e}({metadata:l,entity:w,apiPath:v,tenant:E,parentUri:P,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:T,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([k],e),r=(0,i.pathOr)([],[N],t);S||h(y.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:N,values:r})),c(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))})).catch((e=>{console.error(e),c([]),h(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))})).finally((()=>{m(!1)}))}else c([]),p(null)}),[v,P,E,n,o,l,t,T,Z,S,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,Oe.D)((()=>{C&&j()}),[C]);const D=(0,i.partition)(b.OXP),[,I]=D(f.current||[]),L=R?[]:I,A=R?"totalValues":"totalOvValues",M=(0,i.ifElse)((0,i.has)(A),(0,i.prop)(A),(0,i.always)(s.length))(u),z=o<M,U=null!=u&&u.totalValues?u.totalValues-M:L.length;return{values:s,isLoading:d,hasPaging:z,totalVisibleValues:M,attributeType:Z,totalNonVisibleValues:U,nonVisibleValues:L}};function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ze=n(37152),Te=n(3185),Re=n(31274),je=n(79026),De=n(8818),Ie=n(90324),Le=n(70595);const Ae=o().createContext(null);Ae.displayName="RelationsViewStateContext";const Me=(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"}}))),ze=e=>{let{className:t}=e;const n=Me(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(Ae),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),y="asc"===s;return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:M()(n.button,t)},onClick:f},o().createElement(Q.Z,null)),o().createElement(B.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:x().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(B.Divider,{className:n.divider}),o().createElement(B.Typography,{className:n.title,variant:"h6"},x().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(je.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(De.k,{tooltipTitle:y?x().text("Ascending"):x().text("Descending"),icon:y?Ie.Z:Le.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};ze.displayName="FilterButton";const Ue=ze,He=(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 Ve=n(61932),Fe=n(55847);const Be=o().createContext(null);function We(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){qe(e,t,n[t])}))}return e}function qe(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=Math.pow(2,31)-1,_e=(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 $e=n(81137);const Ye=e=>{let{label:t}=e;const n=_e();return o().createElement(B.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ve.Z,null))},Xe=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(y.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Be),i=(0,a.useSelector)(y.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),m=(0,a.useSelector)(y.ZP.selectors.getTenant),g=[We({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Ge})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return We({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(y.ui.actions.errorSet((0,b.xU7)(e,x().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)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:v,onImportClick:E}})(),s=_e(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(De.k,{size:"L",icon:Ve.Z,tooltipTitle:x().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:M()(s.tenant)},u)):o().createElement(Fe.Z,{menuId:"importDT-table-actions",buttonComponent:De.k,buttonProps:{tooltipTitle:x().text("Import connections"),size:"L",icon:()=>o().createElement(Ye,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement($e.Z,{open:!!t,title:x().text("Confirmation"),content:x().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:x().text("Cancel"),saveCaption:x().text("Import"),onDiscard:l,onSave:n})))},Qe=e=>{let{title:t,total:n}=e;const a=He(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Ae);return o().createElement(W.Z,{title:t||"",className:a.header},n>0&&o().createElement(_.Z,{widthToHide:400},o().createElement($.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:a.totalCaption,variant:"caption"},n>1?x().text("${count} items",{count:n}):x().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(Xe,null),o().createElement(Ue,null))};var Ke=n(11013),Je=n(27604),et=n(22983),tt=n(34e3),nt=n(31039);const rt=(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 ot(){return ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const at=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=rt(),u=(0,Se._)(),p=(0,a.useSelector)(y.ZP.selectors.getTenant),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const v=(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]),x=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(B.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(B.Tooltip,ot({onOpen:v,title:x,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},lt=(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 it=n(77277);const st=(0,K.Z)((()=>({container:{display:"flex"}})));function ct(){return ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ct.apply(this,arguments)}const ut=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,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=st();return o().createElement("div",{className:a.container},o().createElement(it.Z,ct({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Accept")),o().createElement(it.Z,ct({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Ignore")))},pt=(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"}}))),dt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:s,onAcceptRelation:c,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=pt(),{entity:m,relation:g}=t,f=(0,b.$qe)(t),h=(0,b.xr3)(t),v=(0,b.iJH)(t),{entityType:E,entityLabel:w,preparedUri:C,relationLabel:S}=lt(t,n),O=(0,b.Fn9)(g)&&(0,b.Fn9)(m),P=(0,a.useSelector)(y.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:s,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),T=(0,r.useCallback)((()=>s(t)),[s,t]),R=(0,r.useCallback)((()=>{c(t)}),[c,t]),j=(0,r.useCallback)((()=>u(t)),[u,t]),D=(N||k)&&l&&!t.suggested?o().createElement(o().Fragment,null,k&&o().createElement(De.k,{icon:Je.Z,size:"XS",onClick:T,tooltipTitle:x().text("Edit")}),N&&o().createElement(De.k,{icon:et.Z,size:"XS",onClick:Z,tooltipTitle:x().text("Remove")})):void 0,I=t.suggested?o().createElement(ut,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,L=v?x().text("ignored"):x().text("edited");return o().createElement("div",{className:M()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(tt.Z,{className:d.entityAvatar,entityType:E}),o().createElement(nt.Z,{value:C,className:d.entityLabelContainer},o().createElement(at,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(B.Typography,{variant:"caption",className:d.editedLabel},"(",L,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));dt.displayName="EditableRelationItem";const mt=dt,gt=(0,i.when)(b.Kn2,(0,i.prop)("uri")),ft=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:gt(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 ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bt=n(98989),yt=n(83543);const vt=(0,K.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),xt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=vt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,b.xvW)(n)?null:a?o().createElement(yt.Z,c):o().createElement(bt.Z,c)},Et=(0,K.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),wt=e=>{let{config:t,connection:n,children:l}=e;const i=Et(),{showInactive:s}=(0,r.useContext)(Ae),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>y.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>y.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(y.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){ht(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(y.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),v=(0,r.useCallback)((()=>{i||n.connections||h(),s((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:v,loadRelations:h,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(xt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Re.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(an,{isLoading:m,config:t,loadRelations:d,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},Ct=(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"}}))),St=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(y.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>y.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>y.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(y.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>y.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),v=Ct(),E=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,s,p,h,u]),w=(0,r.useCallback)((e=>{h(y.N5.relations.actions.closeRelationEditor(l.id,e)),h(y.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>y.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=y.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(y.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),C=l.content,S=ft(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(y.N5.relations.actions.addRelation(l.id,t))}),[h,l,S]),P=(0,r.useCallback)((e=>{h(y.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),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(wt,{config:l,connection:e,key:c},(t=>r?o().createElement(Ke.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(mt,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(y.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(B.Button,{color:"primary",onClick:E,className:v.moreButton},o().createElement(re.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},x().text("Add"))),D&&o().createElement(Ke.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(B.Divider,{className:v.divider}),k.map(R),T&&o().createElement(B.Typography,{className:v.noData},c))};var Ot=n(19603),Pt=n(94646),Nt=n(78101),kt=n(80931);const Zt=(0,K.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Tt(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){Rt(e,t,n[t])}))}return e}function Rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jt=e=>{let{connection:t,className:n}=e;const l=Zt(),{relation:s}=t,c=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>Tt({attributes:Tt({},y.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)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(Nt.A.Provider,{value:h},o().createElement(kt.Z,{className:M()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:M()(l.attributesList,n)},x().text("No attributes"))};var Dt=n(86602),It=n(82726);const Lt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(De.k,{className:r,tooltipTitle:t?x().text("Hide attributes of the relationship"):x().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Dt.Z:It.Z,onClick:n})},At=(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"}}))),Mt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=At(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityType:h,entityLabel:v,preparedUri:x,relationLabel:E}=lt(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),C=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:M()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:M()(c.row,Ot.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement(tt.Z,{className:c.entityAvatar,entityType:h}),o().createElement(nt.Z,{value:x,className:c.entityLabelContainer},o().createElement(at,{label:v,entity:p},o().createElement("span",{className:c.entityLabel},v)),E&&o().createElement("span",{className:c.relationLabel},`, ${E}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(Pt.Z,{className:c.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(ut,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Lt,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(jt,{connection:t}))}));Mt.displayName="RelationItem";const zt=Mt;var Ut=n(52691),Ht=n(16208),Vt=n(59601),Ft=n(58355),Bt=n(98685);const Wt=e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e).toFixed(1),qt=e=>e.filter((e=>5===e.value)).length,Gt=e=>e.filter((e=>1===e.value)).length,_t=e=>{if(0===e.length)return{percentOfLikes:0,percentOfDislikes:0};const t=qt(e)/e.length*100,n=parseFloat(Number(t).toFixed(1));return{percentOfLikes:n,percentOfDislikes:parseFloat(Number(100-n).toFixed(1))}},$t=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",padding:12,width:355,gap:12},info:{background:"rgba(0, 0, 0, 0.05)",display:"flex",padding:"6px 12px",fontSize:13,gap:16},axis:{position:"relative",display:"flex",justifyContent:"space-between",fontSize:12,color:e.palette.text.secondary,paddingTop:4,"&::before":{content:'""',position:"absolute",top:0,left:0,background:e.palette.divider,width:"1px",height:"4px"},"&::after":{content:'""',position:"absolute",top:0,right:0,background:e.palette.divider,width:"1px",height:"4px"}},scaleHistory:{display:"flex",justifyContent:"space-between"},title:{fontSize:13,display:"flex",alignItems:"center",color:e.palette.text.secondary,gap:8,"& .value":{color:e.palette.text.primary},"& .boldValue":{color:e.palette.text.primary,fontWeight:700}},greenBadge:{width:12,height:12,background:"rgb(151, 192, 97)"},redBadge:{width:12,height:12,background:"rgb(255, 112, 112)"},scale:{width:"100%",height:16,background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"},icon:{width:"14px",height:"14px",color:"rgba(0,0,0,0.54)"},ratingsList:{borderTop:"1px solid #ccc",borderBottom:"1px solid #ccc",padding:"12px 0",maxHeight:140,boxSizing:"border-box",overflow:"auto"},rating:{display:"flex",padding:"4px 0px",alignItems:"center"},avatar:{width:24,height:24,marginRight:12,"& .icon":{fontSize:18}},userInfo:{overflow:"hidden"},user:{fontSize:13,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis"},ratingDateWrapper:{display:"flex",alignSelf:"start",marginLeft:"auto"},ratingDate:{fontSize:10,color:e.palette.text.secondary,marginRight:4},sourcesWrapper:{display:"flex",alignItems:"center",gap:4}}))),Yt=e=>{let{ratings:t,crosswalks:n,open:r,anchorEl:a,onClose:l}=e;const i=$t(),s=(e=>[...e].sort(((e,t)=>{const n=new Date(e.timestamp).getTime();return new Date(t.timestamp).getTime()-n})))(t),{percentOfLikes:c,percentOfDislikes:u}=_t(t),p=`${qt(t)} (${c}%)`,d=`${Gt(t)} (${u}%)`;return o().createElement(Vt.Z,{open:r,anchorEl:a,onClose:l,placement:"top-start",transition:!0},o().createElement("div",{className:i.wrapper},o().createElement("div",{className:i.info},o().createElement("span",{className:i.title},x().text("Score:"),o().createElement("span",{className:"boldValue"},Wt(t))),o().createElement("span",{className:i.title},x().text("No. of responses:"),o().createElement("span",{className:"value"},t.length))),o().createElement("div",null,o().createElement(B.LinearProgress,{variant:"determinate",value:c,classes:{bar:i.scaleBar},className:M()(i.scale,{empty:!t.length})}),o().createElement("div",{className:i.axis},o().createElement("span",null,"0"),o().createElement("span",null,"100%"))),o().createElement("div",{className:i.scaleHistory},o().createElement("span",{className:i.title},o().createElement("div",{className:i.greenBadge}),o().createElement(Ut.Z,{className:i.icon}),x().text("Agree:"),o().createElement("span",{className:"value"},p)),o().createElement("span",{className:i.title},o().createElement("div",{className:i.redBadge}),o().createElement(Ht.Z,{className:i.icon}),x().text("Disagree:"),o().createElement("span",{className:"value"},d))),!!s.length&&o().createElement("div",{className:i.ratingsList,"data-reltio-id":"reltio-ratings-list"},s.map(((e,t)=>{let{user:n,comment:r,timestamp:a,value:l}=e;return o().createElement("div",{key:t,className:i.rating,"data-reltio-id":"reltio-rating-item"},o().createElement(B.Avatar,{className:i.avatar},o().createElement(Bt.Z,{className:"icon"})),o().createElement("div",{className:i.userInfo},o().createElement("div",{className:i.user},n),o().createElement("div",{className:i.title},r||x().text("No comment"))),o().createElement("div",{className:i.ratingDateWrapper},o().createElement("span",{className:i.ratingDate},x().date(a,"L LT")),1===l?o().createElement(Ht.Z,{className:i.icon,"data-reltio-id":"reltio-dislike-icon"}):o().createElement(Ut.Z,{className:i.icon,"data-reltio-id":"reltio-like-icon"})))}))),o().createElement("div",{className:i.sourcesWrapper},o().createElement("span",{className:i.title},x().text("Sources:")),n.map(((e,t)=>o().createElement(Ft.Z,{key:t,crosswalk:e}))))))},Xt=(0,K.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:128,cursor:"pointer"},averageRating:{marginBottom:4,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",color:e.palette.text.primary},counts:{display:"flex",marginTop:4,gap:32},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:e.palette.text.secondary},scale:{height:3,width:"100%",background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"}}))),Qt=e=>{let{ratings:t,crosswalks:n,className:a}=e;const l=Xt(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{percentOfLikes:u}=_t(t);return o().createElement(o().Fragment,null,o().createElement("div",{"data-reltio-id":"reltio-ratings",className:M()(l.wrapper,a),ref:i,onClick:()=>c(!0)},o().createElement(B.Typography,{className:l.averageRating},Wt(t)),o().createElement(B.LinearProgress,{variant:"determinate",value:u,classes:{bar:l.scaleBar},className:M()(l.scale,{empty:!t.length})}),o().createElement("div",{className:l.counts},o().createElement("div",{className:l.count},o().createElement(Ut.Z,{className:l.icon}),qt(t)),o().createElement("div",{className:l.count},o().createElement(Ht.Z,{className:l.icon}),Gt(t)))),o().createElement(Yt,{ratings:t,open:s,crosswalks:n,anchorEl:i.current,onClose:()=>c(!1)}))},Kt=(0,K.Z)((e=>({wrapper:{display:"flex",marginLeft:-8,gap:8},button:{minWidth:0,padding:8,fontSize:"14px",lineHeight:"16px",textTransform:"none",color:e.palette.text.secondary},isActive:{color:e.palette.text.primary}}))),Jt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Kt(),i=(0,a.useSelector)(y.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:x().text("Has left the practice"),onClick:()=>r(x().text("Has left the practice"))},{text:x().text("Has moved away"),onClick:()=>r(x().text("Has moved away"))},{text:x().text("Has passed away"),onClick:()=>r(x().text("Has passed away"))},{text:x().text("Has retired"),onClick:()=>r(x().text("Has retired"))},{text:x().text("Other"),onClick:()=>r(x().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(B.Button,{onClick:n,variant:"text",size:"small",className:M()(l.button,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Fe.Z,{buttonProps:{endIcon:o().createElement(yt.Z,null),variant:"text",size:"small",className:M()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},en=(0,K.Z)((e=>({wrapper:{padding:"3px 16px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",lineHeight:"16px"},entityLabelContainer:{display:"flex",wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"8px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center",marginTop:"8px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex",alignItems:"center"}}))),tn=e=>{var t;let{connection:n,loadRelations:l,renderRelationArrowButton:s,acceptRelation:c,ignoreRelation:u}=e;const p=en(),d=n.suggested,[m,g]=(0,r.useState)(!1),{entity:f,relation:h}=n,v=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityLabel:x,entityType:E,preparedUri:w,relationLabel:C}=lt(n,v),S=(null==h?void 0:h.ratings)||[],O=(null==h||null===(t=h.object)||void 0===t?void 0:t.crosswalks)||[],P=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),N=f&&h&&(0,b.wp9)(b.q7e.RELATION,{entityUri:P,connection:n})||[];return o().createElement("div",{className:M()(p.wrapper,{[p.suggestedWrapper]:d})},o().createElement(B.Box,{display:"flex",minHeight:"44px",className:Ot.U},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{display:"flex",alignItems:"center"},s&&s(),o().createElement(tt.Z,{entityType:E,className:p.entityTypeIcon})),o().createElement(B.Box,{display:"flex",flexDirection:"column"},o().createElement(nt.Z,{value:w,className:p.entityLabelContainer},o().createElement(at,{label:x,entity:f},o().createElement("span",{className:p.entityLabel},x))),C&&o().createElement("span",{className:p.relationLabel},C),!d&&o().createElement(Jt,{ratings:S,onAgree:()=>{(0,b.Buf)(null==h?void 0:h.relationUri,{comment:"",value:5}).then(l)},onDisagree:e=>{(0,b.Buf)(null==h?void 0:h.relationUri,{comment:e,value:1}).then(l)}}))),o().createElement("div",{className:p.additionalButtonsWrapper},!(0,i.isEmpty)(N)&&o().createElement(Pt.Z,{className:p.commentsContainer,uri:(0,b.gjS)(h),relatedObjectUris:N,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),d&&o().createElement(ut,{acceptRelation:c(n),ignoreRelation:u(n)}),!d&&o().createElement(o().Fragment,null,o().createElement(Qt,{ratings:S,crosswalks:O,className:p.ratings}),o().createElement(Lt,{show:m,onToggle:()=>{g((e=>!e))},className:p.showDetailsButton})))),m&&o().createElement(jt,{connection:n,className:p.relationAttributes}))},nn=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=ft(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(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===b.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(C.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(wt,{config:i,connection:e,key:r},(t=>c?o().createElement(tn,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(zt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};nn.displayName="RelationsList";const rn=nn,on=(0,K.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),an=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=on(),{selectors:u}=y.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||x().text("No data found");return t?o().createElement(D.Z,null):(0,b.KIu)(d)?o().createElement(St,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(rn,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(B.Typography,{className:c.noData},m)},ln=(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}}),sn=e=>{let{config:t,className:n}=e;const l=ln(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(Ae),{selectors:h}=y.ZP,v=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),x=(0,a.useSelector)(h.getEntity),E=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),C=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{f("")}),[null==x?void 0:x.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,Ze.a)({sorting:C,filter:S,page:s,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(v)),[v]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Te.u.Provider,{value:x},o().createElement(Re.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Be.Provider,{value:k},o().createElement(Qe,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(an,{isLoading:O,config:t,loadRelations:P,connections:v,total:E}),E>u&&o().createElement(F.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c}))))))};sn.displayName="RelationsView";const cn=o().createContext(null);cn.displayName="TableAttributeContext";var un=n(86361),pn=n(26180),dn=n(31276);function mn(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){gn(e,t,n[t])}))}return e}function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fn="CHANGE_SEARCH_QUERY",hn=mn({},pn.ZP.actions,{changeSearchQuery:(0,dn.zD)(fn)}),bn=(e,t)=>t.type===fn?mn({},e,{searchQuery:t.payload,page:0}):pn.ZP.reducer(e,t);var yn=n(92332),vn=n(67353);function xn(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){En(e,t,n[t])}))}return e}function En(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={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},Cn=(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:xn({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:xn({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:xn({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},b.zXF[b.Y1q.deleteAttribute]),description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":wn}}))),Sn=(0,vn.Z)((e=>{const t=Cn(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(yn.default,e),o().createElement(G.Z,{description:n,className:t.description}))}));var On=n(72768),Pn=n(95613);const Nn=e=>{let{value:t,historyClassName:n}=e;const r=Cn();return o().createElement("div",{className:r.blobWrapper,onScroll:dn.UW},o().createElement("span",{className:r[n]},t))},kn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=Cn(),{value:l,uri:s}=t,{appearance:c}=(0,r.useContext)(T.m),u=(0,i.pipe)(b.IFm,b.o_F)(s,c);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(Nn,{value:l,historyClassName:u});{const e=o().createElement(On.Z,{value:l,dataTypeDefinition:n});return o().createElement(Pn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tn=(e,t)=>{const{uri:n,label:r,children:o,name:a,description:l}=e;return(0,i.reject)(i.isNil,{id:(0,b.Tde)(n,t),label:r,description:l,dataTypeDefinition:(0,b.PFL)(e),children:null==o?void 0:o.map((e=>Tn(e,t.concat({name:a}))))})},Rn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),jn=e=>{if((0,b.vZp)(e)){const t=Rn(e);return t.length>1?t.slice(0,-1):null}return null},Dn=(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){Zn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:jn(e.id),headCellRenderer:Sn,rowCellValueRenderer:kn})));var In=n(37754);function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var An=n(1876),Mn=n(60894);const zn=(0,K.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Un=e=>{let{title:t}=e;const n=zn(),l=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{attributeType:i,searchQuery:s,setSearchQuery:c,filters:u,onToggleFilters:p,allColumnsData:d,visibleColumns:m,onChangeColumns:g}=(0,r.useContext)(cn),f=l&&(null==i?void 0:i.required);return o().createElement(W.Z,{title:t,className:n.header},f&&o().createElement(q.Z,null),o().createElement(G.Z,{description:null==i?void 0:i.description}),o().createElement(X.i,{query:s,onChange:c}),o().createElement(An.Z,{enabled:!!u,onClick:p}),o().createElement($.Z,{height:24,margin:4}),o().createElement(Mn.Z,{columnsData:d,selectedColumns:m,onChangeColumns:g}))};function Hn(){return Hn=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},Hn.apply(this,arguments)}const Vn=(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=Cn();return o().createElement("div",{className:M()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Hn({key:t,value:e},l)))))}));var Fn=n(52016),Bn=n(85709);const Wn=(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)"}}}))),qn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(De.k,{tooltipTitle:x().text("Edit"),icon:Je.Z,size:"L",onClick:t}),n&&o().createElement(De.k,{tooltipTitle:x().text("Remove"),icon:et.Z,size:"L",onClick:n}))};function Gn(){return Gn=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},Gn.apply(this,arguments)}const _n=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,b.xIV)(e))(t))(Rn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Dn(t)),[t]),v=Wn(),x=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,b.KIu)(x),w=(0,a.useSelector)(y.ZP.selectors.getMetadata),C=(0,a.useSelector)(y.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:O}=(0,r.useContext)(cn),P=(0,r.useCallback)((e=>o().createElement(Vn,Gn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Fn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,E]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,b.xv5)({attributeType:O,mode:x,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:x,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(qn,{onEdit:I?L:void 0,onRemove:j?A:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:v.tableContainer},o().createElement(Bn.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:M,context:z,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]}}))};function $n(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){Yn(e,t,n[t])}))}return e}function Yn(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=[],Qn=(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 Kn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Jn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const p=Qn(),d=(0,a.useDispatch)(),g=(0,r.useContext)(m.m),{attributeType:f}=(0,r.useContext)(cn),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),v=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,h)||{})),w=(0,b.YkG)(f)&&(0,b.ZiX)((0,b.bwT)(u)),C=(0,a.useSelector)((e=>w?y.ZP.selectors.getModifiedEntities(e):void 0)),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,h,f))),O=(0,b.ZiX)(h),P=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,d)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Kn(e,t,n[t])}))}return e}({},e,{viewId:g}))))),[g,d]),N=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,d),[d]);return o().createElement(o().Fragment,null,o().createElement(ie.Z,{expanded:!0,attributeValue:u,showEmptyEditors:O,onDeleteAttribute:s,onDeactivateError:N,onChangeAttribute:t,onAddAttributes:P,mode:v,crosswalks:E.crosswalks,errors:S,attributeType:f,ownError:(0,b.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:p.actionButtons},o().createElement(B.Button,{onClick:()=>n(u)},x().text("Cancel")),o().createElement(B.Button,{color:"primary",disabled:!c,onClick:()=>l(u,C),"data-reltio-id":"table-attribute-view-apply-button"},x().text("Apply"))))};var er=n(54198);const tr=e=>(null==e?void 0:e.type)===b.NIO.missed,nr=(0,i.curry)(((e,t)=>e.find((0,i.pipe)((0,i.prop)("uri"),(0,i.either)((0,b.sOy)(t.parentUri),(0,i.equals)(t.uri)))))),rr=(0,K.Z)((()=>({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"}}))),or=e=>{let{config:t,editingValues:n,modifiedValues:l,onChangeAttribute:s,onDeleteAttribute:c,onAdd:u,onCancel:p,onApply:d,onStartEditing:m,onReset:g,checkHasChanges:f,highlightedError:h,highlightedAttributeError:v}=e;const E=rr(),{attributeType:w}=(0,r.useContext)(cn),C=(0,a.useSelector)(y.ZP.selectors.getMode),{canCreate:S}=(0,Fn.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:o,highlightedAttributeError:l}=e;const{attributeType:s}=(0,r.useContext)(cn),c=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,c,s))),p=(0,r.useRef)(!0),d=(0,er.u)(),m=(0,r.useMemo)((()=>u.find((0,i.both)(tr,(e=>(0,b.Wah)(e,c,s.uri))))),[u,c,s.uri]);(0,r.useEffect)((()=>{m&&1===n.length&&t(n[0])}),[m]),(0,r.useEffect)((()=>{p.current&&u.length&&((0,i.pipe)((0,i.map)(nr(n)),(0,i.reject)(i.isNil),(0,i.forEach)(t))(u),p.current=!1)}),[u]),(0,r.useEffect)((()=>{tr(o)&&1===n.length&&t(n[0])}),[o]),(0,r.useEffect)((()=>{if(l){const e=nr(n,l);e&&t(e)}}),[l]),(0,r.useEffect)((()=>{const e=d((e=>{e.type===y.N5.constants.ProfileActions.SAVE_PROFILE&&(p.current=!0)}));return()=>e()}),[d])})({onStartEditing:m,modifiedValues:l,highlightedError:h,highlightedAttributeError:v});const O=S(t)&&w&&(0,b.Vg3)({attributeType:w,mode:C})&&!n.length;return(0,r.useEffect)((()=>()=>g()),[g]),o().createElement("div",{className:E.editor},O&&o().createElement(B.Button,{color:"primary",onClick:u,className:E.addButton,"data-reltio-id":"table-attribute-view-add-button"},o().createElement(re.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},x().text("Add"))),n.map((e=>o().createElement(Jn,{key:e.uri,attributeValue:e,onChangeAttribute:s,onDeleteAttribute:c,onCancel:p,onApply:d,hasChanges:f(e)}))))},ar=(0,se.l)(j.NY,((e,t)=>{let{entityUri:n,attributeType:r}=t;const{element:o,type:a}=e||{},l=(0,j.Ie)(a),i=l&&(0,b.Wah)(o,n,r.uri);return{highlightedError:i?e:null,highlightedAttributeError:o&&l&&!i&&(0,b.nsY)(r,o)&&(0,b.vyG)(n,o)?e:null}}),(e=>{let{config:t,entityUri:n,highlightedError:l,highlightedAttributeError:s}=e;const c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),u=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,n)||{})),{values:p,visibleColumns:d,onFilter:g,onSort:f,filters:h,sorting:v,allColumnsData:x}=(0,r.useContext)(cn),{onDeleteAttribute:E,onStartEditing:w,onChangeAttribute:C,onAdd:S,onCancel:O,onApply:P,onReset:N,checkHasChanges:k,modifiedValues:Z,editingValues:T,deletedUris:R}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getMode),c=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,c)||{})),d=(0,r.useContext)(m.m),{attributeType:g,values:f}=(0,r.useContext)(cn),h=(0,b.KIu)(s),v=(0,b.xy8)(g),x=(0,i.pathOr)(Xn,[v,null==g?void 0:g.name],p),E=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:c,attributeType:g})),[c,g]),w=(0,b.O27)(x),C=g.required&&w,S=(0,r.useMemo)((()=>C?[E]:x),[E,x,C]),O=(0,r.useMemo)((()=>[...S.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=>S.find((0,i.propEq)("uri",e.uri))||e))(f)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[S,n,e,f]),P=(0,r.useMemo)((()=>(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!S.find((0,i.propEq)("uri",e)))))(h?f:[])),[S,f,h]),N=S.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))})),k=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,l)($n({},e,{viewId:d}))),[d,l]),Z=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,l)($n({},e,{viewId:d}))),[d,l]),T=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:c,attributeType:g});t(e.uri),k({value:$n({},e,{value:(0,b.GPx)({attributeTypes:(0,b.BoX)(u,g),parentUri:e.uri,mode:s,metadata:u})}),uri:e.uri,attributeType:g})}),[c,g,u,s,k]),R=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),j=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t={attributeType:g,value:r,uri:e.uri};o((e=>(0,i.without)([r],e))),w||k(t)}else{const n={value:e,attributeType:g,uri:e.uri};t(null),Z(n)}l(y.N5.errors.actions.errorsSet([]))}),[Z,k,o,w,n,g,l]),D=(0,r.useCallback)(((e,t)=>{const n=(0,b.q5j)(u,g,e,t).map((n=>$n({},n,{path:(0,b.Z9i)({entityUri:c,metadata:u,entitiesMap:t||{[c]:(0,b.PeS)(g,e)}},n.uri||n.parentUri)})));return l(y.N5.errors.actions.errorsSet(n)),0===n.length}),[l,c,g,u]),I=(0,r.useCallback)(((e,n)=>{D(e,n)&&(t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t})))}),[o,t,D]),L=(0,r.useCallback)((()=>{o([]),t(null)}),[]);return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:k,onDeleteAttribute:Z,onAdd:T,onCancel:j,onApply:I,onStartEditing:R,onReset:L,modifiedValues:O,editingValues:N,deletedUris:P}})(),{ref:j,errorClassName:D}=(0,oe.B)({highlightedError:l,isSimple:!0}),I=c?Z:p,L=(0,r.useMemo)((()=>d.map((e=>x.find((0,i.propEq)("id",e))))),[d,x]);return o().createElement("div",{ref:j,className:D},c&&!(0,i.isEmpty)(u)&&o().createElement(or,{config:t,editingValues:T,modifiedValues:Z,onChangeAttribute:C,onDeleteAttribute:E,onAdd:S,onReset:N,onCancel:O,onApply:P,onStartEditing:w,checkHasChanges:k,highlightedError:null==l?void 0:l.element,highlightedAttributeError:null==s?void 0:s.element}),L.length>0&&o().createElement(_n,{columnsData:L,config:t,values:I,filters:h,onFilter:g,sorting:v,onSort:f,onEdit:w,onDeleteAttribute:E,deletedUris:R}))})),lr=(0,K.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",overflow:"hidden"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"}}))),ir=15,sr=e=>{let{config:t,className:n}=e;const{caption:l,max:i=ir}=t,s=lr(),c=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{totalVisibleValues:u,attributeType:p,showTable:d,hasPaging:m,isLoading:g,page:f,setPage:h}=(0,r.useContext)(cn);return o().createElement(V.Z,{className:M()(s.root,n)},d?o().createElement(o().Fragment,null,o().createElement(Un,{title:l}),o().createElement("div",{className:s.content},o().createElement(ar,{config:t,attributeType:p,entityUri:c}),m&&o().createElement(F.Z,{count:u,rowsPerPageOptions:[],rowsPerPage:i,page:f,onChangePage:h}),g&&o().createElement(D.Z,null))):o().createElement(o().Fragment,null,o().createElement(W.Z,{title:l,className:s.header},o().createElement(G.Z,{description:null==p?void 0:p.description})),o().createElement(B.Typography,{className:s.noData},x().text("No data"))))};var cr=n(58600);function ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let pr=0;const dr=()=>pr++,mr=e=>{const t={children:[],nodeId:dr()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:dr(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children};var gr=n(5598);const fr=(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"},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"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary},linearIndicator:{top:"42px"}})));var hr=n(1242);const br=o().createContext(null),yr=e=>{e.target.src=hr},vr=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:l}=t,i=(0,b.idV)(t.entity.label),s=fr(),c=(0,a.useSelector)(y.ZP.selectors.getAbsoluteImagePath),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),{uri:p}=(0,a.useSelector)(y.ZP.selectors.getEntity),[d,m]=(0,r.useState)(),g=(0,r.useContext)(br),f=n===p,h=(0,b.nt9)(u,t.entity.type),v=h?(0,b.VD3)(u,h,"typeGraphIcon"):null,x=v&&(0,b.vPL)(c,v);return o().createElement("div",{className:s.wrapper,"data-node-id":l},o().createElement("div",{ref:m,className:s.container},o().createElement(B.Avatar,{alt:"Node icon",className:M()(s.avatar),src:x||hr,onError:yr}),o().createElement(gr.Z,{isSelected:f,title:i,entityUri:n,viewId:g.id,anchorEl:d})))},xr=((0,r.memo)(vr),e=>{let{node:t}=e;return t.nodeId}),Er=(0,K.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block","&:after":{content:"''",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)",width:"1px",left:"50%",bottom:"0",height:`calc(100% - ${Or.rowHeight}px)`}},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"calc(50% - 1px)",top:0,height:Or.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:Or.rowHeight/2+"px",left:"calc(50% - 1px)",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 wr(){return wr=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},wr.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 Or={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Er();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:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:M()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Er(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Cr(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",wr({},s,{className:c.node,style:h}),p,o().createElement("div",{className:c.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 Nr=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"})))},kr=e=>{let{title:t,onGraphOpen:n}=e;const a=fr(),{showNavigateToGraph:l}=(0,r.useContext)(d.Y);return o().createElement(W.Z,{title:t,className:a.header},l&&o().createElement("div",{className:a.buttonsContainer},o().createElement(De.k,{className:a.button,tooltipTitle:x().text("Show Graph"),icon:Nr,onClick:n,size:"L"})))},Zr=e=>xr({node:e});function Tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rr=n(9757);const jr=(0,K.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function Dr(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}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}const Lr=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,Rr.E)(t),y=jr(),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)((()=>{c(!!b)}),[b]),(0,r.useEffect)((()=>{s&&l.current&&(l.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[s,b]);const x=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(B.Dialog,{ref:l,open:!!b}),o().createElement(B.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:Dr({},x,h),className:M()(y.root,n)}))):null};var Ar=n(14940);const Mr=(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)"}}),zr=e=>{const t=t=>{const n=Mr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:M()("viewDraggableHandle",n.dragHandle)},o().createElement(Ar.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Ur=n(2256);const Hr=e=>{const t=t=>o().createElement(Ur.Z,{error:o().createElement(P.ZP,{LogoRenderer:P.B9.ERROR,text:"",secondaryText:x().text("Something went wrong"),variant:P.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Vr=(0,K.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Fr=n(29103),Br=n(83911),Wr=n(95299),qr=n(22385);const Gr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),_r=(0,K.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var $r=n(13074),Yr=n(24338);const Xr=(0,K.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Qr=Xr,Kr=e=>{let{totalImages:t}=e;const n=Qr(),r=t>1?x().text("photos"):x().text("photo");return o().createElement(B.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Jr(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){eo(e,t,n[t])}))}return e}function eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const to=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(y.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(Yr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(y.N5.actions.removeAttribute,s)(Jr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(y.N5.actions.modifyAttribute,s)(Jr({},e,{viewId:d})),imageSize:oo,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Kr,{totalImages:p.length}))},no=(0,K.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),ro=no,oo={imageMargin:4,imageWidth:162,imageHeight:162};var ao=n(28741),lo=n(49734),io=n(98808),so=n(93428),co=n(30885);function uo(){return uo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uo.apply(this,arguments)}const po=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),{canMerge:p,canMark:d}=(0,b.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:io.N.iconButton,onStartRequest:l},h=(0,r.useContext)(m.m),v=(0,r.useCallback)((()=>{i(),s(y.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(so.H,uo({},f,{onFinishRequest:v})),d&&o().createElement(co.i,uo({},f,{onFinishRequest:i})))},mo=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useSelector)(y.ZP.selectors.getEntity);return o().createElement(lo.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:Ot.U},o().createElement(Pt.Z,{uri:(0,b.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(po,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},go=(0,K.Z)((e=>({root:{display:"flex",flexDirection:"column",minHeight:"52px"},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)"}}))),fo={showTransitiveMatches:!0,showInactiveEntities:!1},ho={order:b.KM9.asc,field:"score"};var bo;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(bo||(bo={}));const yo=e=>(0,i.pipe)(Hr,zr)(e),vo=yo((e=>{let{className:t}=e;const n=Vr();return o().createElement(V.Z,{className:M()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),xo=yo((e=>{let{className:t,config:n}=e;return o().createElement(z.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Eo=yo((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=Ne(e,s),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){ke(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(U.Provider,{value:a},o().createElement(Ce,{config:n,className:t}))})),wo=yo((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(y.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,b.WN0)(e,t)),(0,i.map)((e=>Tn(e,[t]))),(0,i.chain)(b.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(bn,c),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),v=(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,In.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:v,page:f,sorting:g,searchQuery:d})),[v,f,g,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:O,changeColumns:P}=(0,un.o)({actions:hn,dispatch:p}),N=Ne(e,x);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){Ln(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,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)||v||d||h)&&l&&!l.hidden),allColumnsData:s},N)})(t);return o().createElement(cn.Provider,{value:l},t&&o().createElement(sr,{config:t,className:n}))})),Co=yo((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,b.fS6)(l,t)),[l,t]),c=(e=>{var t;const n=(0,r.useMemo)((()=>(0,i.pipe)(Object.entries,(0,i.map)((e=>{let[t,n]=e;return{value:t,label:n}})),(0,i.unless)((e=>(0,b.O27)(e)||e.some((0,i.propEq)("value","name"))),(0,i.append)({label:x().text("Name"),value:"name"})))(e.sortOptions||{})),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[s,c]=(0,r.useState)(e.sortOrder||"asc"),[u,p]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),h=(0,r.useCallback)((()=>{l(0),f((e=>!e))}),[]),y=(0,r.useCallback)((()=>{l(0),c((e=>"asc"===e?"desc":"asc"))}),[]),v=(0,r.useCallback)((e=>{l(0),p(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{l(0),m(e)}),[]),sortOrder:s,toggleSortOrder:y,sortOption:u,changeSortOption:v,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:g,toggleShowInactive:h}})(s);return o().createElement(Ae.Provider,{value:c},o().createElement(sn,{config:s,className:n}))})),So=yo(Lr),Oo=yo((e=>{let{config:t,className:n}=e;const{id:l,caption:s,graph:u,_showNavigateToGraph:p}=t,m=null==u?void 0:u.type,g=fr(),f=(0,a.useDispatch)(),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{treeData:v,setTreeData:E,errorMessage:w,isLoading:C}=((e,t)=>{const n=(0,Se._)(),[o,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getEntity);return(0,Oe.D)((()=>{const e=s.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){ur(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],d),e);c(t.map((0,i.prop)("root")))}),[null==d?void 0:d.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||(p(null),l(!0),n((0,b.RFJ)({uri:e,graphUri:t})).then(mr).then(c).catch((e=>{console.warn(e),p((0,b.xU7)(e,x().text("Something went wrong")))})).finally((()=>{l(!1)}))),()=>{c([])})),[e,t,n]),{isLoading:o,treeData:s,setTreeData:c,errorMessage:u}})(h,m),{onResize:S,getRowHeight:O,clearHeightsCache:P}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[Zr(e)]!==r?(0,i.assoc)(Zr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Zr(n)]?Math.max(e[Zr(n)],Or.rowHeight):Or.rowHeight}),[e]),clearHeightsCache:n}})(),N=(0,r.useContext)(d.Y),k=void 0!==p?p:N.showNavigateToGraph,Z=(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){Tr(e,t,n[t])}))}return e}({},N,{showNavigateToGraph:k})),[k,N]),T=(0,r.useCallback)((()=>{f(y.ui.actions.openGraph({viewId:l,graphType:m,entityUri:h}))}),[f,l,m,h]),R=(0,r.useCallback)((e=>({title:o().createElement(c.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:S(e.node)},o().createElement(vr,{node:e.node}))})),[S]);return(0,r.useEffect)((()=>{P()}),[P,h]),o().createElement(d.Y.Provider,{value:Z},o().createElement(V.Z,{className:n},o().createElement(kr,{onGraphOpen:T,title:s}),C&&o().createElement(D.Z,{className:g.linearIndicator}),o().createElement(br.Provider,{value:t},o().createElement("div",{className:g.treeContainer},o().createElement("div",{className:g.tree},w?o().createElement(B.Typography,{className:g.errorMessage},w):o().createElement(cr.ZP,{isVirtualized:!1,treeData:v,canDrag:!1,theme:Or,generateNodeProps:R,onChange:E,getNodeKey:xr,rowHeight:O}))))))})),Po=yo((e=>{let{config:t,className:n}=e;const l=go(),s=(0,a.useSelector)(y.ZP.selectors.getEntity),c=(0,b.wwR)(s),[u,p]=(0,r.useState)(!1),d=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:v}=(0,ao.s)({enabled:!!c,entity:s,options:fo,filter:"",page:0,sorting:ho,rowsPerPage:3,onStartLoading:d,onFinishLoading:g}),E=(0,r.useCallback)((()=>{v()}),[v]),w=(0,a.useDispatch)(),S=(0,r.useContext)(m.m),O=(0,r.useCallback)((()=>{w(y.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[w,S]),P=(0,r.useMemo)((()=>(0,b.NVY)(c,(0,i.map)(b.ev7,f))),[c,f]),{getCommentsCount:N}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,i.isEmpty)(f),Z=u?bo.Loading:(0,i.isEmpty)(f)?bo.NoData:bo.Loaded;return o().createElement(Re.X.Provider,{value:h},o().createElement(V.Z,{className:M()(l.root,n)},o().createElement(W.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===bo.Loading&&o().createElement(D.Z,null),Z===bo.NoData&&o().createElement(B.Typography,{className:l.noData},x().text("No matches found")),Z===bo.Loaded&&f.map((e=>o().createElement(mo,{config:t,entitiesMap:h,match:e,onFinishRequest:E,onStartRequest:d,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(B.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},x().text("See all"))))))})),No=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,52298)).then((e=>({default:yo(e.HierarchyTreeView)}))))),ko=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:yo(e.RelationshipsTableView)}))))),Zo=yo((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=_r(),c=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),p=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Se._)();return(0,r.useEffect)((()=>{i(!0),s((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Gr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(D.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(V.Z,{className:M()(s.root,i)},m&&o().createElement(D.Z,null),o().createElement(qr.Z,{size:"S",icon:n?Br.Z:Fr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(Wr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:s.fullHeight,mapKey:p,mapOptions:h}))})),To=yo((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=ro(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(y.ZP.selectors.getMode),p=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(y.ZP.selectors.getMetadata),m=l?(0,b.zeJ)(d,l):null,g=t["text-empty"]||x().text("No data found"),f=(0,r.useCallback)((e=>c(y.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(W.Z,{title:t.caption},o().createElement(G.Z,{description:null==m?void 0:m.description})),o().createElement("div",{className:s.container},(()=>{if(m){const e=(0,i.pathOr)([],["attributes",m.name],p),n=(0,i.path)(["attributes","paging",l],p),r=e.length;if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:n,requestNextPageOfAttributeValues:f};return o().createElement(to,e)}if(r>0){const t={attributeValues:e,attributeType:m,imageSize:oo,paging:n,parentUri:p.uri,requestNextPageOfAttributeValues:f};return o().createElement(o().Fragment,null,o().createElement($r.Z,t),o().createElement(Kr,{totalImages:r}))}}return o().createElement(B.Typography,{className:s.noData},g)})()))}));class Ro{}Ro.ViewTypes=b.ZIY,Ro.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case Ro.ViewTypes.HierarchyTree:return o().createElement(No,{config:r,store:n,className:a});case Ro.ViewTypes.HierarchyPaths:return o().createElement(Oo,{config:r,className:a});case Ro.ViewTypes.RelationsTable:return o().createElement(ko,{config:r,store:n,className:a});case Ro.ViewTypes.Relations:return o().createElement(Co,{config:r,className:a});case Ro.ViewTypes.Attributes:return o().createElement(xo,{className:a,config:r});case Ro.ViewTypes.SingleAttribute:return o().createElement(Eo,{config:r,className:a});case Ro.ViewTypes.AttributeTable:return o().createElement(wo,{config:r,className:a});case Ro.ViewTypes.Map:return o().createElement(Zo,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case Ro.ViewTypes.Custom:return o().createElement(So,{config:r,className:a});case Ro.ViewTypes.ImageAttribute:return o().createElement(To,{config:r,className:a});case Ro.ViewTypes.PotentialMatches:return o().createElement(Po,{config:r,className:a})}},Ro.getComponent=e=>Ro.getComponentBy("class",e)||Ro.getComponentBy("react-class",e)||o().createElement(vo,{className:e.className});const jo=Ro,Do=()=>null,Io=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=Vr();return o().createElement(r.Suspense,{fallback:o().createElement(Do,null)},jo.getComponent({config:t,store:n,className:M()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));Io.displayName="ViewComponent";const Lo=(0,K.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"},overflowContainer:{width:"100%",height:"100%",overflow:"hidden"}})));function Ao(){return Ao=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},Ao.apply(this,arguments)}const Mo=["onConfigChanged","onRemove"],zo=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),h=Lo(),v=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{store:x}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===jo.ViewTypes.Custom;if(E&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC)return null;if(f.class===jo.ViewTypes.Map&&!v)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",Ao({},(0,i.omit)(Mo,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:M()(s,{[h.item]:!E,customView:E})}),o().createElement("div",{className:h.overflowContainer},o().createElement("div",{"data-reltio-id":"profile-view-container",className:M()({[h.fixedSizeContainer]:!m})},m,o().createElement(Io,{store:x,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),c))},Uo=(0,K.Z)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,scrollbarWidth:n}=e;return{minWidth:t&&t<1024?t-n:1024,height:"100%"}}}),Ho=e=>{let{views:t,layout:n,frozen:a,entityUri:l,maxWidth:i,onLayoutChanged:s}=e;const c=(0,r.useRef)(),u=(p=c.current)?p.offsetWidth-p.clientWidth:0;var p;const d=c.current,m=Uo({maxWidth:i,scrollbarWidth:u}),g=(0,r.useMemo)((()=>({element:d,priority:["left","right","top","bottom"]})),[d]);return(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[l]),o().createElement("div",{ref:c,className:m.scrollWrapper},o().createElement("div",{className:m.scrollableContent,"data-reltio-id":"reltio-profile-grid"},o().createElement(I.p.Provider,{value:g},o().createElement(L.Z,{LayoutItem:zo,views:t,layout:n,onLayoutChanged:s,draggableHandle:".viewDraggableHandle",isStatic:a}))))};var Vo=n(87685);const Fo=(0,K.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Bo=e=>{let{notification:t}=e;const n=Fo({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(y.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(y.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{c.cancelAction&&l(c.cancelAction),u(void 0)}),[c]),f=(0,r.useCallback)((()=>{l(c.applyAction),u(void 0),l(y.ui.actions.closeNotification(t.id))}),[c,t]),h=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(B.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),b=o().createElement(o().Fragment,null,o().createElement(qr.Z,{className:n.closeIcon,size:"S",icon:Vo.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(B.Portal,{container:document.body},o().createElement(B.Snackbar,{autoHideDuration:s,open:p,classes:{root:n.snackbar},action:h,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:b})),o().createElement($e.Z,{open:!!c,title:null==c?void 0:c.confirmationText,content:null==c?void 0:c.confirmationDescription,onSave:f,onDiscard:g,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))},Wo=()=>{const e=(0,a.useSelector)(y.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Bo,{key:e.id,notification:e})))):null};var qo=n(72753),Go=n(43576),_o=n(43054),$o=n(64459),Yo=n(3409),Xo=n(79618),Qo=n(22860),Ko=n(46534);function Jo(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){ea(e,t,n[t])}))}return e}function ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ta(){return ta=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}const na=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",ta({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),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 ra(){return ra=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},ra.apply(this,arguments)}const oa=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",ra({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"})))},aa=(0,K.Z)({editingButtons:{display:"flex","& button + button":{minWidth:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"},menuButton:{marginLeft:8}}),la=e=>o().createElement(B.SvgIcon,e,o().createElement(na,null)),ia=e=>o().createElement(B.SvgIcon,e,o().createElement(oa,null)),sa=(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)})),ca=e=>{let{className:t,profileBandConfig:n,menuItems:l,showMenu:s=!0}=e;const c=aa(),u=(0,a.useDispatch)(),p=(0,a.useSelector)(y.ZP.selectors.getCanUserStartProcessFromQuery),d=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),m=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,d.uri))),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),h=(0,a.useSelector)(y.ZP.selectors.getMode),v=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),E=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),C=(0,a.useSelector)(y.ZP.selectors.getProfileOperation),S=null==d?void 0:d.type,O=(0,r.useMemo)((()=>(0,b.nt9)(g,S)),[S,g]),P=C===b.OXy.Saving,N=C===b.OXy.Cloning||P,[k,Z]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{Z(!1)}),[]),R=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,a.useDispatch)(),c=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,c),[l,c]),d=(0,b.nt9)(l,c),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(c),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,c]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);s(y.N5.entity.actions.entityCloneRequested({data:Jo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),j=(0,r.useMemo)((()=>[{label:x().text("Editing"),value:b.fO_.EDITING,description:x().text("Edit profile directly"),icon:Go.Z,permission:"UPDATE"},{label:x().text("Suggesting"),value:b.fO_.SUGGESTING,description:x().text("Suggest changes and initiate a workflow review"),icon:la,permission:"INITIATE_CHANGE_REQUEST"},{label:x().text("Viewing"),value:b.fO_.VIEWING,description:x().text("Read or print profile"),icon:qo.Z,permission:"READ"}]),[]),D=(0,r.useMemo)((()=>[...R?[{label:x().text("Clone"),value:"Clone",description:x().text("Create a copy of the profile"),icon:ia,onClick:()=>Z(!0),permission:"CREATE"}]:[],{label:x().text("Delete"),value:"Delete",description:x().text("Permanently delete profile"),icon:et.Z,onClick:()=>{window.confirm(x().text("Are you sure you want to delete this?"))&&u(y.N5.entity.actions.entityRemoveRequested({entityUri:d.uri}))},permission:"DELETE"}]),[u,d.uri,R]),I=!w&&!(0,b.biM)(d)&&!(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))(O),L=(0,b.ZiX)(null==d?void 0:d.uri),A=(0,r.useMemo)((()=>sa(j,O,L,f,p)),[j,O,f,p,L]),z=(0,r.useMemo)((()=>sa(D,O,L,f,p)),[D,O,f,p,L]),U=(0,r.useCallback)((e=>{u(y.N5.mode.actions.modeUpdated(e))}),[u]),H=(0,r.useCallback)((()=>{u(y.N5.mode.actions.modeCancelEditing())}),[u]),V=(0,r.useCallback)((()=>{u(y.N5.actions.saveProfile())}),[u]);return o().createElement(o().Fragment,null,o().createElement($o.Z,{className:M()(t,Ot.U),entity:v&&m?m:d},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{mr:3},v&&o().createElement(B.Box,{className:c.editingButtons},o().createElement(B.Button,{variant:"outlined",onClick:H,"data-reltio-id":"reltio-profile-cancel-editing",disabled:N},x().text("Cancel")),o().createElement(B.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:V,disabled:N},(0,b.fnZ)(h)?x().text("Suggest"):x().text("Save"))),w&&E?o().createElement(Yo.Z,null):E&&o().createElement(Xo.a,null)),I&&o().createElement(Qo.T,{optionsGroup:A,buttonsGroup:z,value:h,onChange:U,disabled:N}),s&&o().createElement(Fe.Z,{menuId:"profile-header-menu",buttonComponent:qr.Z,buttonProps:{icon:_o.Z,size:"L","data-reltio-id":"reltio-profile-header-menu",className:c.menuButton},menuItems:l,MenuItemRenderer:Ko.Z})),o().createElement(B.Box,{className:c.comments},o().createElement(Pt.Z,{uri:d.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:d.uri}),objectType:b.q7e.ENTITY}))),!!R&&o().createElement($e.Z,{open:k,title:x().text("Do you want to create a clone of the profile?"),content:x().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:R,onDiscard:T,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))};var ua=n(97499),pa=n(52043),da=n(17308);const ma=(0,K.Z)({wrapper:{display:"flex",overflow:"hidden",flexShrink:0,marginLeft:"3px",height:"100%"},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}});function ga(){return ga=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},ga.apply(this,arguments)}let fa;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(fa||(fa={}));const ha=e=>{let{active:t,tabs:n,onClose:a}=e;const l=ma(),s=!(0,i.isNil)(t),{content:c,headerProps:u,hidden:p}=n[t]||{};return(0,r.useEffect)((()=>{p&&a()}),[t,p,a]),o().createElement("div",{className:l.wrapper},o().createElement(pa.h,{open:s},!p&&o().createElement(o().Fragment,null,o().createElement(da.P,ga({},u,{onClose:a})),c)))};var ba=n(71820),ya=n(44021),va=n(26789),xa=n(54362),Ea=n(6674),wa=n(91515),Ca=n(80147);const Sa=(0,K.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Oa=()=>{const e=Sa(),t=(0,a.useSelector)(y.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(Lr,{key:t.id,config:t,className:e.itemWrapper}))))};var Pa=n(76569);const Na=()=>{const{total:e}=(0,r.useContext)(Z.O),t=ma();return o().createElement(B.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Pa.Z,null))};function ka(){return ka=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},ka.apply(this,arguments)}const Za=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",ka({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"})))))},Ta=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=ma();return o().createElement(B.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Za,null))};function Ra(){return Ra=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},Ra.apply(this,arguments)}const ja=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",Ra({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"}))};var Da=n(46626);const Ia=(0,K.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),La=()=>{const e=Ia(),{tasks:t,loading:n}=(0,r.useContext)(Z.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(D.Z,null),t&&t.map((e=>o().createElement(Da.s,{key:e.taskId,task:e}))))};var Aa=n(10159);const Ma=()=>o().createElement(Aa.Z,{text:x().text("Ready to go with the flow?"),secondaryText:x().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")});var za=n(26313),Ua=n(9371),Ha=n(4426);const Va=(0,K.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Fa=()=>{const e=Va(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(C.h),i=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,za.Q)(n);return o().createElement(Re.X.Provider,{value:s},o().createElement(B.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Ua.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(B.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Ha.Z,{className:e.showMoreIcon}),x().text("Show more"))))},Ba=()=>o().createElement(Aa.Z,{text:x().text("Care to join the conversation?"),secondaryText:x().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")}),Wa=e=>{if(e)return 1===e?x().text("${total} item",{total:e}):x().text("${total} items",{total:e})},qa=(0,K.Z)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),Ga=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:l,children:s}=e;const c=qa(),{defaultTab:u,tabs:p}=(e=>{let{commentId:t,hideHistory:n,perspectiveId:l}=e;const i=(0,a.useSelector)(y.ZP.selectors.isWorkflowSideViewEnabled),s=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),c=(0,a.useSelector)(y.ZP.selectors.isCollaborationSideViewEnabled),u=(0,a.useSelector)(y.ZP.selectors.isDBConnectorSideViewEnabled),p=(0,a.useSelector)(y.ZP.selectors.isCollaborationEnabled),d=t?fa.Collaboration:void 0,m=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,a.useSelector)(y.ZP.selectors.getEntity),h=(0,r.useContext)(Z.O),v=(0,r.useContext)(C.h),{isHistoryEnabled:E,isProfilePersisted:w}=(0,ba.C)({perspectiveId:l,entity:f,historyButtonId:fa.History}),{historyFilter:S,onApplyFilter:O,isLoading:P,historicUris:N,historyWithTotal:k,canLoadMore:T,onLoadMore:R}=(0,ya.k6)({entity:f,enabled:E}),j=i&&s&&!(0,b.ZiX)(null==f?void 0:f.uri),D=c&&p,I=(0,b.mdt)(null==v?void 0:v.commentsMap);return{tabs:(0,r.useMemo)((()=>[{buttonProps:{id:fa.Workflow,icon:Na,tooltipTitle:x().text("Workflow")},content:null!=h&&h.total?o().createElement(La,null):o().createElement(Ma,null),headerProps:{mainTitle:x().text("Workflow"),secondTitle:Wa(null==h?void 0:h.total),rightContent:o().createElement(va.G,null)},hidden:!j},{buttonProps:{id:fa.Collaboration,icon:Ta,tooltipTitle:x().text("Collaboration")},content:I?o().createElement(Fa,null):o().createElement(Ba,null),headerProps:{mainTitle:x().text("Collaboration"),secondTitle:Wa(I)},hidden:!D},{buttonProps:{id:fa.History,icon:Ca.Z,tooltipTitle:x().text("History")},content:w?o().createElement(xa.Z,{isLoading:P,historyWithTotal:k,contributorsUris:N,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:R,canLoadMore:T}):o().createElement(Ea.Z,null),headerProps:{content:o().createElement(wa.Z,{total:w?((null==N?void 0:N.length)||0)+1:void 0,entityType:(0,b.nt9)(g,null==f?void 0:f.type),filter:S,onApplyFilter:O})},hidden:n},{buttonProps:{id:fa.DBConnector,icon:ja,tooltipTitle:x().text("D&B Connector")},content:o().createElement(Oa,null),headerProps:{mainTitle:x().text("D&B Connector")},hidden:!u}]),[null==h?void 0:h.total,j,I,D,w,P,k,N,null==f?void 0:f.uri,null==f?void 0:f.type,m,R,T,g,S,O,u]),defaultTab:d}})({commentId:n,hideHistory:l,perspectiveId:t});return o().createElement("div",{className:c.profileContainer},o().createElement(ua.n,{defaultTab:u,perspectiveId:t,buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(p)},s,o().createElement(ha,{tabs:p})))}));Ga.displayName="ProfilePerspectiveView";var _a=n(39781),$a=n(16715);const Ya="48px",Xa="1px solid rgba(0, 0, 0, .125)",Qa=(0,K.Z)((e=>({accordion:{borderTop:Xa,borderBottom:Xa,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Ya,minHeight:Ya,"&$accordionSummaryExpanded":{height:Ya,minHeight:Ya}},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"},attributeTypesPath:{color:e.palette.text.secondary},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"}}))),Ka=Qa;var Ja=n(38016);const el=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Ka();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(B.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(B.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(Ja.Z,null)},i,o().createElement(B.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(B.AccordionDetails,{className:M()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function tl(){return tl=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},tl.apply(this,arguments)}el.displayName="ErrorsPanel";const nl=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",tl({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"}))},rl=(0,i.omit)(["deactivated","path"]),ol=(0,r.memo)((e=>{let{error:t}=e;const n=Ka(),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),c=((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?x().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),p=(e=>{let{path:t}=e;return null==t?void 0:t.filter((e=>{let{type:t}=e;return t===b.HAc.attributeValue})).map((0,i.either)((0,i.path)(["valueType","label"]),(0,i.path)(["valueType","name"]))).filter(i.identity).join(" > ")})(t),{highlightError:d}=(0,r.useContext)(j.NY),m=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},p&&o().createElement("span",{className:n.attributeTypesPath},p),o().createElement("span",{className:n.errorTitle},c,m&&s&&o().createElement(De.k,{icon:nl,size:"XXS",onClick:()=>d(t),tooltipTitle:x().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));ol.displayName="Error";const al=()=>{const e=Ka(),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(rl),t.map(rl))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(y.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:x().text("${number} ${errors}",{number:n.length,errors:1===n.length?x().text("error"):x().text("errors")}),icon:o().createElement(_a.Z,{className:M()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:x().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?x().text("warning"):x().text("warnings")}),icon:o().createElement($a.Z,{className:M()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(el,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ol}):null};var ll=n(3096),il=n.n(ll),sl=n(60641);function cl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ul={};var pl=n(61756),dl=n(4109);function ml(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gl=n(81556),fl=n(10341);const hl=(0,K.Z)((e=>({wrapper:{alignItems:"center",display:"flex",padding:"12px 16px",fontSize:"13px",lineHeight:"15px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.secondary},loadingWrapper:{display:"flex",backgroundColor:"rgba(238, 238, 238, 1)",color:e.palette.text.secondary,boxShadow:"inset 0px -1px 0px rgba(0, 0, 0, 0.12)"},errorWrapper:{display:"flex",backgroundColor:"rgba(255, 235, 238, 1)",color:e.palette.error.main},successWrapper:{display:"flex",backgroundColor:"rgba(239, 253, 227, 1)",color:e.palette.success.main,"& span, & b":{paddingRight:"4px"}},closeIcon:{color:e.palette.text.secondary,cursor:"pointer","&:hover":{background:"none"}},indicatorIcon:{padding:"0 14px"},link:{color:e.palette.primary.main,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular,cursor:"pointer"}}))),bl=hl;let yl;!function(e){e.loading="loading",e.success="success",e.error="error"}(yl||(yl={}));const vl=e=>{let{onClose:t}=e;const n=bl();return o().createElement(De.k,{tooltipTitle:x().text("Close"),onClick:t,size:"S",className:n.closeIcon,icon:Vo.default})},xl=e=>{let{onClose:t}=e;const n=bl();return o().createElement("div",{className:M()(n.wrapper,n.loadingWrapper)},o().createElement(vl,{onClose:t}),o().createElement(Dt.Z,{className:M()(n.indicatorIcon)}),o().createElement(B.Typography,null,x().text("Loading background process...")))},El=e=>{let{label:t,onClose:n,onRefresh:r}=e;const a=bl();return o().createElement("div",{className:M()(a.wrapper,a.successWrapper)},o().createElement(vl,{onClose:n}),o().createElement(gl.Z,{className:M()(a.indicatorIcon)}),o().createElement("div",{"data-reltio-id":"background-update-success"},o().createElement("span",null,x().text("This Profile")),o().createElement("b",null,(0,b.idV)(t)),o().createElement("span",null,x().text("has been updated.")),o().createElement("span",{onClick:r,className:a.link},x().text("Click Here to Refresh the page")),o().createElement("span",null,x().text(" to retrieve the latest profile data."))))},wl=e=>{let{onClose:t}=e;const n=bl();return o().createElement("div",{className:M()(n.wrapper,n.errorWrapper)},o().createElement(vl,{onClose:t}),o().createElement(fl.Z,{className:M()(n.indicatorIcon)}),o().createElement(B.Typography,null,x().text("UI attempted to check for updates but no update received in the last 30 seconds. Try refreshing the page manually.")))},Cl=e=>{let{label:t,onClose:n,onRefresh:r,status:a}=e;switch(a){case yl.loading:return o().createElement(xl,{onClose:n});case yl.success:return o().createElement(El,{label:t,onClose:n,onRefresh:r});case yl.error:return o().createElement(wl,{onClose:n});default:return null}},Sl=(e,t)=>((e,t)=>"*"===(null==e?void 0:e[0])||!(0,i.isNil)(e)&&e.includes(t))(e,t),Ol=(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},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%"}},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Pl=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i,commentId:s}=e;const{maxWidth:c,profileBand:u,workflow:p,frozen:d}=n||{},g=Ol({maxWidth:c}),f=(0,a.useSelector)(y.ZP.selectors.getEntity),h=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),v=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),I=(null===(t=(0,a.useSelector)(y.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",L=(0,a.useSelector)(y.ZP.selectors.getMode),A=(0,a.useDispatch)(),M=(0,E.u)(),z=(e=>{const t=(0,pl.v)(e),n=(0,dl.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){ml(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(p),{isLoading:U}=(0,w.M)(),{type:H,uri:V,updatedTime:F}=f||{},{onRefreshProfile:B,onCloseBackgroundProcessIndicator:W,cancelUpdateProcess:q,isOpenBackgroundProcessIndicator:G,backgroundUpdateStatus:_}=(e=>{let{entityUri:t,entityTypeUri:n,entityUpdatedTime:o}=e;const l=(0,a.useDispatch)(),{autoUpdateInReadMode:i,entityTypes:s}=(0,a.useSelector)(y.ZP.selectors.getProfileCheckUpdate)||{},c=Sl(s,n),u=Sl(i,n),p=(0,r.useRef)(null),d=(0,Se._)(),g=(0,er.u)(),f=(0,r.useContext)(m.m),[h,v]=(0,r.useState)(!1),[x,E]=(0,r.useState)(yl.loading),w=6e3;const C=(0,r.useCallback)((()=>{l(y.N5.entity.actions.loadEntity({viewId:f,uri:t})),v(!1)}),[l,t,f]),S=(0,r.useCallback)((()=>{v(!1)}),[]),O=(0,r.useCallback)((()=>{clearTimeout(p.current),v(!1),d(Promise.resolve())}),[d]),P=(0,r.useCallback)((e=>{d((0,b.GBJ)(t)).then((t=>{t.updatedTime>o&&(E(yl.success),u?C():v(!0),e=-1)})).catch((()=>{})).finally((()=>{e<0||(e?(e-=1,p.current=setTimeout(P,w,e)):(E(yl.error),v(!0)))}))}),[o,t,u,C,d,w]),N=(0,r.useCallback)((()=>{c&&(E(yl.loading),v(!0),p.current=setTimeout(P,w,4))}),[P,c]);return(0,r.useEffect)((()=>{const e=g((e=>{e.type===y.N5.constants.ProfileActions.PROFILE_SAVED&&N()}));return()=>{e()}}),[g,d,N]),{onRefreshProfile:C,onCloseBackgroundProcessIndicator:S,cancelUpdateProcess:O,isOpenBackgroundProcessIndicator:h,backgroundUpdateStatus:x}})({entityUri:V,entityTypeUri:H,entityUpdatedTime:F}),$=(0,r.useMemo)((()=>(0,b.dvH)(f)),[f]),Y=(0,r.useContext)(C.h),X=(0,S.C)({objectIds:$}),{views:Q,layout:K,isLoaded:J,onLayoutReset:ee,onResetUndo:te,handleLayoutChange:ne}=(e=>{let{config:t,entityTypeUri:n,saveState:o,getSavedState:a}=e;const[l,i]=(0,r.useState)([]),[s,c]=(0,r.useState)([]),{canRead:u}=(0,Fn.l)(),p=(0,r.useMemo)((()=>{const e=t.views.filter(u),n=(0,b.sFD)(t.layout,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){cl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>il()(p)),[p]),m=null!=p&&p.nestedRoute?`/${p.nestedRoute}`:"",g=n&&p?n+m:null,f=(0,r.useCallback)((()=>a().then((e=>e.layout?{}:e))),[a]),h=(0,r.useCallback)((0,b.DsO)(o,1e3),[o]),{isLoaded:y,savedState:v=ul,updateSavedState:x}=(0,sl.w)({getSavedState:f,saveState:h,entityTypeUri:g}),E=(0,r.useCallback)((e=>{x({layout:e,views:s,configHash:d}),i(e)}),[x,d,s]),w=(0,r.useRef)(),C=(0,r.useCallback)((()=>{c(w.current.views),E(w.current.layout)}),[E]),S=(0,r.useCallback)((()=>{w.current={views:s,layout:l};const{views:e,layout:t}=(0,b.Mfk)({views:p.views,layout:p.layout});c(e),E(t)}),[p,l,s,E]);return(0,r.useEffect)((()=>{if(y){const e=d!==v.configHash,{views:t,layout:n}=(0,b.Mfk)({views:e||!v.views?p.views:v.views,layout:e?p.layout:v.layout});c(t),i(n)}}),[y,v,g]),{views:s,layout:l,isLoaded:y,onLayoutReset:S,onResetUndo:C,handleLayoutChange:E}})({config:n,entityTypeUri:H,saveState:l,getSavedState:i});(0,O.a)({entity:f,historyEvent:h}),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(y.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(y.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),s=(0,a.useSelector)(y.ZP.selectors.getMode),c=(0,a.useSelector)(y.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(y.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&s===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})(),(0,r.useEffect)((()=>{A(y.N5.views.actions.profileViewsSet(Q))}),[A,Q]),(0,r.useEffect)((()=>{n.sidePanelViews&&A(y.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>()=>q()),[V,L]);const re=L===b.ARY.Viewing&&(0,b.ZiX)(V),oe=e=>o().createElement("div",{className:g.emptyState},o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:e,variant:P.tC.embedded})),{SnackbarRenderer:ae,resetLayout:le}=(0,N.w)({onLayoutReset:ee,onResetUndo:te}),ie=(0,r.useMemo)((()=>[{primary:x().text("Reset layout"),secondary:x().text("Restore the default layout without saving any changes"),onClick:le}]),[le]);return o().createElement(k.j.Provider,{value:!0},o().createElement(C.e,{collaboration:v?Y:X},o().createElement(Z.O.Provider,{value:z},o().createElement(T.m.Provider,{value:M},o().createElement(R.l.Provider,{value:I},o().createElement(j.fy,null,o().createElement("div",{className:g.perspectiveView},J&&V?o().createElement(Ga,{commentId:s,perspectiveId:"profile"},o().createElement("div",{className:g.profileWrapper},o().createElement(ca,{profileBandConfig:u,showMenu:!d,menuItems:ie}),U?oe(x().text("Loading")):o().createElement(o().Fragment,null,G&&o().createElement(Cl,{label:f.label,onClose:W,onRefresh:B,status:_}),!v&&o().createElement(al,null),!re&&o().createElement(Ho,{maxWidth:c,views:Q,layout:K,frozen:d,entityUri:V,onLayoutChanged:ne})))):o().createElement(o().Fragment,null,o().createElement(D.Z,null),oe(x().text("No data to display."))),o().createElement(Wo,null),o().createElement(ae,null))))))))}));function Nl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Pl.displayName="ProfilePerspectiveView";const kl=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0});b.oss.register("profile",((e,t)=>{const n=e=>(0,i.sort)(((e,t)=>e.x>t.x||e.x===t.x&&e.y>t.y?1:-1),e),r=(0,i.map)((e=>(0,i.evolve)({layout:(0,i.pipe)(n,(0,i.map)((0,i.ifElse)((0,i.propEq)("autosizing",!0),(0,i.omit)(["y","height","minHeight","maxHeight"]),(0,i.omit)(["y","minHeight","maxHeight"]))))},e)));return(0,b.l22)(r(e),r(t))}));const Zl=e=>{let{config:t,store:n,onResize:v=i.identity,saveState:x,getSavedState:E,qxSandboxApi:w,commentId:C}=e;const S=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:O,showSnackbarMessage:P}=(0,p.D)(),N=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]),k=(0,r.useContext)(d.Y),Z=y.ZP.selectors.getShowAttributeDescription(n.getState()),T=(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){Nl(e,t,n[t])}))}return e}({},k,{showDescription:Z})),[k,Z]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:null==N?void 0:N.id},o().createElement(g.S.Provider,{value:P},o().createElement(f.Y.Provider,{value:w},o().createElement(s.StylesProvider,{generateClassName:kl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:T},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>v(Math.floor(e),Math.floor(t))}),N&&o().createElement(Pl,{config:N,saveState:x,getSavedState:S,commentId:C}),o().createElement(h.Z,{showErrorFromStore:!0}),o().createElement(O,null)))))))))};var Tl=n(82842),Rl=n(51229),jl=n(91131);const Dl=(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}}))),Il=e=>{let{total:t=0}=e;const n=Dl(),l=(0,a.useDispatch)(),i=(0,r.useContext)(m.m),s=(0,r.useCallback)((()=>{l(y.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(W.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(B.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},x().text("Profile")),o().createElement(jl.Z,{className:n.icon}),x().text("Tags")),o().createElement(Rl.Z,null),o().createElement(B.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},x().number(t,"0,0")),x().text("total profiles")))};var Ll=n(20404);const Al=(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"}}))),Ml=e=>{let{label:t}=e;const n=Al();return o().createElement(B.Toolbar,{className:n.toolbar},o().createElement(Ll.Z,{className:n.avatar}),o().createElement(B.Typography,{variant:"h6",className:n.label},t))};function zl(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}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 Hl=(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}}))),Vl=[25,50,100],Fl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Hl(),[s,c]=(0,r.useState)(Vl[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,Se._)(),u=(0,Se._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:v,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(y.ZP.selectors.getTenant),s=(0,a.useSelector)(y.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=zl({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,b.E7G)(c))):(0,b.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,zl({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(E()).then(g).catch(w)}),[E,c,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:s}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const v=g>Vl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Ml,{label:t}),o().createElement("div",{className:M()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(V.Z,{className:l.tagsView},o().createElement(Il,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(D.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(Tl.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(F.Z,{count:g,rowsPerPageOptions:Vl,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));Fl.displayName="TagPerspectiveView";const Bl=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Wl=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(m.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Bl},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Fl,{tag:n,entityUri:r}),o().createElement(h.Z,{showErrorFromStore:!0}))))};var ql=n(65321);const Gl=(0,K.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),_l=()=>{const e=Gl(),t=(0,a.useSelector)(y.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(Z.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($o.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(ql.o,{task:l})))};function $l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yl=(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}}))),Xl={processTypes:["dataChangeRequestReview"]},Ql=(0,r.memo)((()=>{const e=Yl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(y.ZP.selectors.getEntityUri),o=(0,pl.v)(e),l=(0,r.useCallback)((e=>{"Reject"===e&&t(y.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(y.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){$l(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(Xl),l=(0,a.useSelector)(y.ZP.selectors.getEntity);(0,r.useEffect)((()=>{t(y.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(Z.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(D.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(Ga,{hideHistory:!0,perspectiveId:"dcrCard"},o().createElement("div",{className:e.contentWrapper},o().createElement(_l,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(z.Z,null)))):o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:x().text("No data to display."),variant:P.tC.embedded}))))}));function Kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Ql.displayName="DCRReviewPerspectiveView";const Jl=(0,s.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),ei=e=>{let{config:t,store:n,onResize:p=i.identity}=e;const g=(0,r.useContext)(d.Y),f=y.ZP.selectors.getShowAttributeDescription(n.getState()),b=(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){Kl(e,t,n[t])}))}return e}({},g,{showDescription:f})),[g,f]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Jl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:b},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>p(Math.floor(e),Math.floor(t))}),o().createElement(Ql,null),o().createElement(h.Z,{showErrorFromStore:!0}))))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>qe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(50914),s=n(52730),c=n(86051),u=n(88832),p=n(65549),d=n(94079),m=n(13980),g=n.n(m),f=n(2507),h=n.n(f),b=n(79692);const y=(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"}}),v=e=>{let{onClick:t}=e;const n=y();return a().createElement(d.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(p.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},h().text("Add")))};v.propTypes={onClick:g().func};const x=v;var E=n(71153),w=n.n(E);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"},description:{marginLeft:"-22px"},"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(),s=(0,u.$qe)(r),c=(0,u.Fn9)(r.relation)&&(0,u.Fn9)(r.entity);return a().createElement("div",{className:w()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:s,[i["row-cell--inactive"]]:!c},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const k=N;var Z=n(85709),T=n(94656),R=n(47898),j=n(34e3),D=n(95613);const I=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,s.useDispatch)(),l=(0,o.useContext)(R.m),p=O(),d=(0,u.idV)(n.entityLabel),m=(0,u.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:p.entityCell},a().createElement(j.Z,{className:p.entityAvatar,entityType:t}),a().createElement(D.Z,{value:d},a().createElement("span",{className:p.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:m,viewId:l}),c.ui.actions.openEntity,r)},d)))};I.propTypes={value:g().shape({entity:g().shape({entityUri:g().string,entityLabel:g().string}),entityType:u.p8l})};const L=I;var A=n(92332),M=n(98448);const z=(0,n(67353).Z)((e=>{const t=O(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(A.default,e),a().createElement(M.Z,{description:n,className:t.description}))}));var U=n(64091);const H=(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 F=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=F(e);return t.length>1?t.slice(0,-1):null}return null},W=(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:B(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:U.Z)});var t})),q=(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 G=n(27604),_=n(22983);const $=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(d.Tooltip,{title:h().text("Edit")},a().createElement(d.IconButton,{onClick:r},a().createElement(G.Z,null))),n&&a().createElement(d.Tooltip,{title:h().text("Remove")},a().createElement(d.IconButton,{onClick:o},a().createElement(_.Z,null))))};$.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const Y=$;function X(){return X=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},X.apply(this,arguments)}const Q=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:s,onSort:p,filters:d,onFilter:m,onEditRelation:g,onRemoveRelation:f,basicTableRef:h,allowOnlyCreateNew:b}=e;const y=(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,u.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,u.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,u.tT_)(e))(t))(F(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),v=(0,o.useMemo)((()=>W(n)),[n]),x=q(),E=(0,o.useCallback)((e=>a().createElement(k,X({},e,{isSorted:!!s&&s.field===e.columnData.id}))),[s]),[w,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,u.xvW)(r);if(c.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,u.$qe)(r),i=(0,u.V3K)(t,e);return{canRemove:o&&!l&&(0,u.Edd)(n,i),canUpdate:a&&!l&&(0,u.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:f,onEditRelation:g,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([w,"connection"],y)}),P=(0,o.useCallback)((e=>C(e)),[]),N=(0,o.useCallback)((()=>g((0,i.path)([w,"connection"],y))),[w,g,y]),T=(0,o.useCallback)((()=>f((0,i.path)([w,"connection","relation","relationUri"],y))),[w,f,y]),R=S||O?a().createElement(Y,{handleEditRelation:N,handleRemoveRelation:T,canRemove:S,canUpdate:O}):void 0;return a().createElement("div",{className:x.tableContainer},a().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:v,rowsData:y,sorting:s,onSort:p,filters:d,onFilter:m,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:w,hoveredRowRightContent:R,classes:{hoveredRowRightContentWrapper:x["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:x["row-cell__buttons-container"]},ref:h,resizeDebounceDelay:150}))};Q.propTypes={mode:g().string,columnsData:T.uz,connections:g().arrayOf(u.Rjq),metadata:u.pGS,filters:g().objectOf(T.Dq),onFilter:g().func,sorting:T.nI,onSort:g().func,onEditRelation:g().func,onRemoveRelation:g().func,basicTableRef:g().shape({current:g().object}),allowOnlyCreateNew:g().bool};const K=Q;var J=n(93416),ee=n(75512),te=n(30553),ne=n(32152),re=n(1876),oe=n(60894),ae=n(43054),le=n(8818);const ie=(0,b.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),se=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=ie(),i=(0,o.useRef)(),[s,c]=(0,o.useState)(!1),u=()=>c((e=>!e));return a().createElement(a().Fragment,null,a().createElement(le.k,{className:t,ref:i,tooltipTitle:h().text("More"),icon:ae.Z,onClick:u,size:"L"}),a().createElement(d.Popover,{open:s,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(d.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(d.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:h().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"}}),ue=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:s,selectedColumns:c,onChangeColumns:u,showInactive:p,onChangeShowInactive:m}=e;const g=ce();return a().createElement(J.Z,{title:t,className:g.header},a().createElement(ee.Z,{widthToHide:500},a().createElement(te.Z,{height:24,margin:16}),a().createElement(d.Typography,{className:g.totalCaption,variant:"caption"},n>1?h().text("${count} entities",{count:n}):h().text("${count} entity",{count:n}))),a().createElement(ne.i,{query:r,onChange:o}),a().createElement(re.Z,{enabled:l,onClick:i}),a().createElement(te.Z,{height:24,margin:4}),a().createElement(oe.Z,{columnsData:s,selectedColumns:c,onChangeColumns:u}),a().createElement(se,{className:g.moreButton,showInactive:p,onShowInactiveChange:m}))};ue.propTypes={title:g().string,total:g().number,columnsData:T.uz,selectedColumns:g().arrayOf(g().string),onChangeColumns:g().func,searchQuery:g().string,onChangeSearchQuery:g().func,filtersEnabled:g().bool,onToggleFilters:g().func,showInactive:g().bool,onChangeShowInactive:g().func};const pe=ue;var de=n(26180),me=n(31276);function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he="CHANGE_SEARCH_QUERY",be="CHANGE_SHOW_INACTIVE",ye=ge({},de.ZP.actions,{changeSearchQuery:(0,me.zD)(he),changeShowInactive:(0,me.zD)(be)}),ve=(e,t)=>{switch(t.type){case he:return ge({},e,{searchQuery:t.payload,page:0});case be:return ge({},e,{showInactive:t.payload});default:return de.ZP.reducer(e,t)}};var xe=n(26481),Ee=n(87451),we=n(37152),Ce=n(52016),Se=n(10237),Oe=n(11013),Pe=n(58662),Ne=n(99136);const ke=[10,25,50,100],Ze=[{id:"entity.label",get label(){return h().text("Entity label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return h().text("Directional label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return h().text("Start date")},dataTypeDefinition:u.PY2.startDate},{id:"relation.activeness.endDate",get label(){return h().text("End date")},dataTypeDefinition:u.PY2.endDate}],Te=(0,i.pipe)(u.Tde,(0,i.concat)("relation.")),Re=(0,i.pipe)((0,i.map)((e=>({id:Te(e.uri),label:e.label,description:e.description,dataTypeDefinition:(0,u.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),je=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(H,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),u.DK$)(o))))([...n,...r])}),Re,(0,i.concat)(Ze));var De=n(37754);const Ie=(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)"}});function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ae=(0,i.pluck)("id",Ze),[Me]=Ae;function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=(0,i.memoizeWith)(((e,t)=>t.id),u.fS6),He=(0,s.connect)(((e,t)=>{const{config:n}=t;return{connections:c.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:c.ZP.selectors.getTotalByViewId(e,n.id),entity:c.ZP.selectors.getEntity(e),metadata:c.ZP.selectors.getMetadata(e),mode:c.ZP.selectors.getMode(e),relationToAdd:c.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:c.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:c.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){ze(e,t,n[t])}))}return e}({},e,t,n,{config:Ue(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:p=[],total:m=0,mode:g,relationToAdd:f,relationsToEdit:b=[],checkIfCanAddRelations:y,dispatch:v,readOnlyMode:E}=e;const w={searchQuery:"",filters:null,visibleColumns:Ae,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Me},page:0,rowsPerPage:n.max||15,showInactive:!1},C=Ie(),S=(0,o.useContext)(xe.j)?g:u.fO_.VIEWING,[O,P]=(0,o.useReducer)(ve,w),N=(0,i.pipe)(ye.changeSearchQuery,P),k=(0,i.pipe)(ye.changeShowInactive,P),Z=(0,o.useContext)(Ee.Y),T=(0,s.useSelector)(c.ZP.selectors.getShowAttributeDescription),R=(0,o.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){Le(e,t,n[t])}))}return e}({},Z,{showDescription:T})),[Z,T]);(0,o.useEffect)((()=>{N("")}),[null==r?void 0:r.uri]);const{visibleColumns:j,searchQuery:D,filters:I,sorting:L,page:A,rowsPerPage:M,showInactive:z}=O,U=(0,o.useMemo)((()=>je(n,l)),[n,l]),H=(0,o.useMemo)((()=>j.map((e=>U.find((0,i.propEq)("id",e))))),[j,U]),V=(0,o.useMemo)((()=>((e,t,n)=>{const r=u.wSh.fromFalsy(e).map(u.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,De.Tz)(n,t);return(new u.MEy).addClause(r).addClause(o).build()})(D,I,H)),[I,D]),{isLoading:F}=(0,we.a)({sorting:L,filter:V,page:A,rowsPerPage:M,config:n,entity:r,relationActivityFilter:z?u.Ng6.ALL:u.Ng6.ACTIVE_ONLY,mode:g}),B=(0,o.useMemo)((()=>{return e=w.rowsPerPage,ke.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:W,handlePageChange:q}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(ye.changeRowsPerPage,P),handlePageChange:(0,i.pipe)(ye.changePage,P)})),[]),G=(0,o.useCallback)((()=>{const e=(0,u.vlo)({config:n,mode:S,metadata:l,parentEntityUri:void 0});(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),v)(e)}),[n,S,l,v]),_=(0,o.useCallback)((e=>{v(c.N5.relations.actions.closeRelationEditor(n.id,e)),v(c.N5.relations.actions.removeRelation(n.id,e));const t=p.find((t=>c.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=c.N5.relations.selectors.getEntityUriFromConnection(t);(0,u.ZiX)(r)&&v(c.N5.modifiedEntities.actions.entityDeleted(r))}),[n,p,v]),$=r&&y&&!E,Y=f?[f,...b]:b,{canUpdate:X,canDelete:Q}=(0,Ce.l)(),J=X(n)&&!E,ee=Q(n)&&!E,te=(0,o.useRef)(null);return a().createElement(Ee.Y.Provider,{value:R},a().createElement(Se.Z,{className:t},a().createElement(pe,{title:n.caption,total:m,columnsData:U,selectedColumns:j,onChangeColumns:(0,i.pipe)(ye.changeColumns,P),searchQuery:D,onChangeSearchQuery:N,filtersEnabled:!!I,onToggleFilters:(0,i.pipe)(ye.toggleFilters,P),showInactive:z,onChangeShowInactive:k}),$&&a().createElement("div",{className:C.addArea},a().createElement(x,{onClick:G})),Y.map((e=>a().createElement(Oe.Z,{key:c.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:S,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(K,{mode:S,columnsData:H,connections:p,metadata:l,filters:I,onFilter:(0,i.pipe)(ye.changeFilter,P),sorting:L,onSort:(0,i.pipe)(ye.toggleSort,P),onEditRelation:J?(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),v):null,onRemoveRelation:ee?_:null,basicTableRef:te,allowOnlyCreateNew:n.allowOnlyCreateNew}),p.length?a().createElement(Pe.Z,{count:m,rowsPerPageOptions:B,rowsPerPage:M,onChangeRowsPerPage:W,page:A,onChangePage:q,basicTableRef:te}):a().createElement(d.Typography,{className:C.noData},h().text("No data found")),F&&a().createElement(Ne.Z,null))))}));var Ve=n(36138),Fe=n(22664),Be=n(585);const We=(0,Ve.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),qe=e=>{let{config:t,store:n,onResize:o=i.identity,className:c,readOnlyMode:u}=e;return a().createElement(s.Provider,{store:n},a().createElement(R.m.Provider,{value:t.id},a().createElement(Ve.StylesProvider,{generateClassName:We},a().createElement(Fe.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(He,{config:t,className:c,readOnlyMode:u}),a().createElement(Be.Z,null)))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
2
2
|
//# sourceMappingURL=8723.js.map
|