@reltio/remotes 1.4.1066 → 1.4.1067
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/525.js +1 -1
- package/package.json +1 -1
package/525.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[525],{50548:(e,t,n)=>{n.d(t,{l:()=>i});var r=n(24328),a=n.n(r);function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}const i=(e,t,n)=>{if(e&&t){const i=(0,r.memo)(n);return n=>a().createElement(e.Consumer,null,(e=>a().createElement(i,o({},n,t(e,n)))))}return n}},44938:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),a=n.n(r),o=n(50166),i=n(44443),l=n(22241);const s=(0,n(79692).Z)({item:{overflow:"hidden"}});function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,r.memo)((e=>{let{width:t=0,height:n=0,defaultItemSize:u,data:d,children:p,itemKey:m,showNotMeasuredItems:h,listRef:g}=e;const f=s(),b=(0,r.useRef)({}),[y,v]=(0,r.useState)({}),x=(0,r.useCallback)((0,l.DsO)((()=>{v(c({},b.current))})),[]),E=(0,r.useCallback)(((e,t)=>m?m(t,e):t),[m]),w=(0,r.useRef)(),C=g||w;C.current&&C.current.resetAfterIndex(0,!1);const O=(0,r.useMemo)((()=>e=>{let{data:t,index:n,style:r}=e;const o=E(t,n);return a().createElement("div",{style:r,className:f.item},a().createElement("div",{style:h?void 0:{visibility:o in y?void 0:"hidden"}},a().createElement(i.Z,{handleHeight:!0,onResize:(e,t)=>{b.current[o]!==t&&(((e,t)=>{b.current=c({},b.current,{[e]:t})})(o,t),x())}}),p({data:t,index:n})))}),[p,h,E,x,!h&&y]);return a().createElement(o.VariableSizeList,{ref:C,width:t,height:n,itemCount:d.length,itemData:d,itemSize:e=>y[(e=>E(d,e))(e)]||u,itemKey:m},O)}))},42011:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(13980),a=n.n(r),o=n(24328),i=n.n(o),l=n(71153),s=n.n(l),c=n(28899),u=n(87918),d=n.n(u),p=n(79573),m=n(17440);const h=(0,n(79692).Z)({pagination:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"56px",borderTop:"1px solid rgba(0,0,0,0.12)",boxShadow:"none"},caption:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px"},selectRoot:{marginLeft:"5px",marginRight:"36px"},select:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right"},actions:{marginLeft:"32px"}});function g(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){f(e,t,n[t])}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b=e=>{let{classes:t={},count:n,rowsPerPageOptions:r,page:a,onChangePage:l,rowsPerPage:u,onChangeRowsPerPage:f,basicTableRef:b,labelRowsPerPage:y}=e;const v=h(),x=(0,o.useCallback)((()=>{(0,m.pathOr)(m.identity,["current","resetScrollbarPosition"],b)()}),[b]),E=(0,o.useCallback)((e=>{l(e),x()}),[l,x]),w=(0,o.useCallback)((e=>{l(0),f(e),x()}),[l,f,x]);return i().createElement(c.Z,{classes:g({},t,{root:s()(v.pagination,t.root),select:s()(v.select,t.select),caption:v.caption,selectRoot:v.selectRoot,actions:v.actions}),component:"div",labelRowsPerPage:y||d().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:r}=e;return d().text("${fromRow}-${toRow} of ${countRows}",{fromRow:d().number(t,"0,0"),toRow:d().number(n,"0,0"),countRows:d().number(r,"0,0")})},count:n,rowsPerPageOptions:r,page:a,onChangePage:(0,m.pipe)((0,m.nthArg)(1),E),rowsPerPage:u,onChangeRowsPerPage:(0,m.pipe)(p.NA,w)})};b.propTypes={classes:a().object,rowsPerPageOptions:a().arrayOf(a().number),count:a().number,page:a().number,onChangePage:a().func,rowsPerPage:a().number,onChangeRowsPerPage:a().func,basicTableRef:a().shape({current:a().object}),labelRowsPerPage:a().string};const y=i().memo(b)},1730:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),a=n(13980),o=n.n(a),i=n(24328),l=n.n(i);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function d(){return d=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},d.apply(this,arguments)}const p=(0,i.forwardRef)(((e,t)=>{let{children:n,className:a}=e,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["children","className"]);const i=u();return l().createElement(r.Z,d({ref:t,className:a,classes:{root:i["basic-view__paper"]}},o),n)}));p.displayName="BasicView",p.propTypes={children:o().node,className:o().string};const m=p},22118:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),a=n.n(r),o=n(87918),i=n.n(o),l=n(77277),s=n(8629),c=n(49429),u=n(38724),d=n(55999),p=n(79249);const m=(0,n(79692).Z)({paper:{minHeight:"180px"},title:{padding:"16px 16px 10px 16px",fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px"},content:{padding:"0 16px"},contentText:{marginBottom:0,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px"},actionButtons:{display:"flex",paddingTop:"4px",fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px","& > div":{marginLeft:"auto"}},discardButton:{marginRight:"8px"}}),h=e=>{let{open:t,title:n,content:r,onCancel:o,cancelCaption:h=i().text("Cancel"),onDiscard:g,discardCaption:f="",onSave:b,saveCaption:y=i().text("Save"),disabledSave:v=!1}=e;const x=m();return a().createElement(s.Z,{open:t,onClose:o,classes:{paperScrollPaper:x.paper}},a().createElement(p.Z,{classes:{root:x.title}},n),a().createElement(u.Z,{classes:{root:x.content}},a().createElement(d.Z,{classes:{root:x.contentText}},r)),a().createElement(c.Z,{className:x.actionButtons,disableSpacing:!0},o&&a().createElement(l.Z,{onClick:o},h),a().createElement("div",null,g&&a().createElement(l.Z,{onClick:g,classes:{root:x.discardButton}},f),a().createElement(l.Z,{onClick:b,color:"primary",disabled:v,autoFocus:!0},y))))}},17906:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(24328),a=n.n(r),o=n(52730),i=n(35674),l=n(22241),s=n(76141);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=e=>{let{connection:t,onChangeAttribute:n,onRemoveAttribute:u,onAddAttributes:d,showEmptyEditors:p}=e;const{relation:m}=t,{attributes:h,uri:g,type:f=""}=m,b=(0,o.useSelector)(i.ZP.selectors.getMetadata),y=(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){c(e,t,n[t])}))}return e}({attributes:h},(0,l.p2l)(m))),[m,h]),v=(0,r.useMemo)((()=>(0,l.xF8)(b,f)),[f,b]);return a().createElement(s.Z,{attrTypes:v,entity:y,showEmptyEditors:p,mode:l.fO_.EDITING,parentUri:g,onAddAttributes:d,onChangeAttribute:n,onDeleteAttribute:u})}},20146:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),a=n.n(r),o=n(52730),i=n(71153),l=n.n(i),s=n(90436),c=n(22241),u=n(35674);const d=(0,n(79692).Z)({"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",display:"inline-flex",marginRight:"12px",borderRadius:"2px"},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",display:"inline-flex",marginRight:"16px"}}),p=e=>{let{entity:t,className:n,size:r="small"}=e;const i=d(),p=(0,o.useSelector)(u.ZP.selectors.getMetadata),m=t.type,h=(0,c.nt9)(p,m)||{},g=(0,c.VD3)(p,h,"typeColor")||c.rSc.palette.primary.main;return a().createElement(s.Z,{style:{backgroundColor:g,color:c.P6Y.Colors.getColor(g)?"#FFFFFF":"#212121"},className:l()(i[`entityType-${r}`],n),component:"div"},(0,c.jFi)(p,t))}},92934:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),a=n.n(r),o=n(87918),i=n.n(o),l=n(22241),s=n(72108);const c=(0,r.memo)((e=>{let{entityTypes:t,selectedEntityTypes:n,single:o,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:m={},disabled:h=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.oDv)),[t]);return a().createElement(s.S,{items:g,selectedItemsUris:n,single:o,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:i().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:i().text("Select entity types")})}));c.displayName="EntityTypesSelector"},52194:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),a=n.n(r),o=n(71153),i=n.n(o),l=n(17998);const s=(0,n(79692).Z)({container:{padding:"0 16px",minHeight:"48px"},title:{fontSize:"16px",lineHeight:"19px",paddingTop:"16px",paddingBottom:"13px",justifyContent:"flex-start"}}),c=e=>{let{className:t,title:n,children:r}=e;const o=s();return a().createElement(l.Z,{title:n,classes:{root:i()(o.container,t),title:o.title}},r)}},72108:(e,t,n)=>{n.d(t,{S:()=>N});var r=n(24328),a=n.n(r),o=n(71153),i=n.n(o),l=n(17440),s=n(22241),c=n(86619),u=n(83543),d=n(80030),p=n(79692);const m=(0,p.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),h=(e,t)=>{const{childNodes:n,clientLeft:r,clientWidth:a}=t;if(n.length>0){const[t]=Array.from(n),o=document.createRange();o.setStart(t,0);for(let n=0;n<e.length;n++){o.setEnd(t,o.endOffset+e[n].length);const{width:i}=o.getBoundingClientRect();if(r+i>a)return n;n!==e.length-1&&o.setEnd(t,o.endOffset+", ".length)}}return-1},g=e=>e.join(", "),f=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,b=e=>{let{list:t,maxWidth:n}=e;const o=m(),i=(0,r.useRef)(),[l,s]=(0,r.useState)(0);(0,r.useEffect)((()=>{s(((e,t)=>{const n=e.length,r=((e,t)=>{if(t){const n=h(e,t);return-1===n?0:e.length-n}return 0})(e,t);return n-Math.max(1,n-r)})(t,i.current))}),[t]);const c=g(t),u=l>0,p=u?g(t.slice(0,-l)):c;return a().createElement(d.ZP,{title:u?c:""},a().createElement("div",{className:o.listLabelContainer},a().createElement("div",{style:{width:f(n)},className:o.listLabel,ref:i},c),a().createElement("div",{className:o.visibleItemsLabel},p),u&&a().createElement("div",{className:o.hiddenCount},`+${l}`)))};var y=n(40435),v=n(22311),x=n(26638),E=n(33117),w=n(94792),C=n(63485);function O(){return O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}const S=(0,l.always)(32),P=(0,r.memo)((e=>{let{selectedItems:t,onItemClick:n,focusIndex:r,width:o,height:i}=e,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return a().createElement(C.Z,O({getItemSize:S,renderItem:(e,o,i)=>{let{item:l}=o;const s=!!t.find((e=>l.uri===e)),c=i===r;return a().createElement(E.Z,{key:l.uri,onClick:n,checked:s,data:l,label:a().createElement(w.Z,{text:l.label,highlight:l.filterText}),labelInText:l.label,style:e,isFocused:c,hideIcon:!0,LogoIcon:l.LogoIcon})},focusIndex:r,fixedTitle:!1,disableHorizontalScrollbar:!0,width:o,height:i},l))}));P.displayName="SelectMetadataTypesList";const T=(0,p.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function R(){return R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}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}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 N=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:o,selectedItemsUris:d,onChange:p,ListLabelProps:m={},disabled:h,enableEmptyValueUnderline:g,single:f,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const O=T(),[S,L]=(0,r.useState)(!1),N=(0,r.useCallback)((()=>L(!0)),[]),k=(0,r.useCallback)((()=>L(!1)),[]),[I,j]=(0,r.useState)(""),Z=(0,r.useCallback)((()=>j("")),[]),A=(0,r.useCallback)((0,l.pipe)(Z,k),[k,Z]),z=o.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,I)})).map(((e,t)=>({item:{item:_({},e,{filterText:I})},index:t}))),D=(0,r.useMemo)((()=>d.map((e=>o.find((0,l.propEq)("uri",e)))).map((0,l.prop)("label"))),[d,o]),U=(0,r.useCallback)(((e,t)=>{f?(p(t?[e.uri]:[]),A()):p(t?d.concat(e.uri):d.filter((t=>t!==e.uri)))}),[d,p,f,A]),M=(0,r.useCallback)((e=>{let{item:t}=e;const n=!d.includes(t.uri);U(t,n)}),[d,U]),{focusIndex:B,handleKeyDown:F}=(0,x.t)({items:z,open:S,onSelectFocusedItem:M,selectedItems:d,onClose:A}),G=(0,r.useRef)(),H=G.current?G.current.getBoundingClientRect().width:0,V=Math.max(H,255),W=0===d.length;return a().createElement(a().Fragment,null,a().createElement(c.Z,{label:E,ref:G,InputProps:{startAdornment:W&&!t?null:a().createElement("div",{className:i()(O.inputText,n.inputText)},W?a().createElement("div",null,t):a().createElement(b,R({},m,{list:D}))),classes:{root:O.inputRoot,input:i()(O.input,n.input,{[O.emptyInput]:W&&!t}),disabled:i()(O.disabledInput,{[O.disabledPointer]:h}),underline:O.disabledUnderline},endAdornment:a().createElement(y.Z,{size:"L",icon:u.Z,iconClassName:i()(O.icon,{[O["popup-opened-icon"]]:S}),disabled:h}),readOnly:!0,disabled:!0,disableUnderline:W&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:i()(O.inputLabel,n.label)}},value:"",onClick:h?void 0:N,classes:{root:i()(O.root,n.root)},margin:"dense",variant:"filled",disabled:h,"data-reltio-id":w}),a().createElement(v.Z,{open:S,anchorEl:G.current,onClose:A,onSearch:j,title:C,containerWidth:V,containerHeight:355,searchInputOnKeyDown:F,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},a().createElement(P,{items:z,onItemClick:U,selectedItems:d,width:V,height:245,focusIndex:B})))}));N.displayName="MetadataTypesSelector"},33109:(e,t,n)=>{n.d(t,{Z:()=>E});var r=n(24328),a=n.n(r),o=n(13980),i=n.n(o),l=n(71153),s=n.n(l),c=n(52730),u=n(17440),d=n(90436),p=n(80030),m=n(87918),h=n.n(m),g=n(22241),f=n(35674),b=n(37573),y=n(20146);const v=(0,n(79692).Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"inset 0 -1px 0 0 rgba(0,114,206,0.06), inset 0 1px 0 0 rgba(0,114,206,0.06);","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}}}))),x=e=>{let{className:t,entity:n,children:o,classes:i}=e;const l=v({classes:i}),m=(0,c.useSelector)(f.ZP.selectors.getMetadata),x=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,g.BTI)(n))}),[n]);if((0,u.isNil)(n))return null;const E=(0,g.idV)(n.label),w=n.secondaryLabel,C=(0,g.ptG)(m,n),O=(0,g.Fn9)(n),S=n.uri,P=(0,g.BTI)(n);return a().createElement("div",{className:s()(l.profileBandWrapper,t)},a().createElement("div",{className:s()(l.profileBand,{[l.inactive]:!O}),"data-entity-uri":S},a().createElement(b.Z,{key:n.uri,entity:n,avatarClassName:l.profileIcon,imageClassName:l.imageProfileIcon}),a().createElement("div",{className:l.profileInfo},a().createElement("div",null,a().createElement(d.Z,{variant:"h6",className:l.label},E),w&&a().createElement(d.Z,{variant:"subtitle2",className:l.secondaryLabel},w),C&&a().createElement(d.Z,{variant:"subtitle1",className:l.businessCard},C)),a().createElement("div",{className:l.specialInfo},a().createElement("div",{className:l.entityType},a().createElement(y.Z,{entity:n,size:"medium",className:l.badge}),!(0,g.ZiX)(S)&&a().createElement(p.ZP,{title:h().text("Copy to clipboard")},a().createElement(d.Z,{display:"inline",variant:"body2",className:l.entityId,onClick:x},h().text("Entity ID"),": ",P))))),o&&a().createElement("div",null,o)))};x.propTypes={className:i().string,entity:i().object,children:i().node,classes:i().object};const E=x},68977:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),a=n.n(r),o=n(87918),i=n.n(o),l=n(22241),s=n(72108);const c=(0,r.memo)((e=>{let{relationTypes:t,selectedRelationTypes:n,single:o,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:m={},disabled:h=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.Tt2)),[t]);return a().createElement(s.S,{items:g,selectedItemsUris:n,single:o,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:i().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:i().text("Select relation types")})}));c.displayName="RelationTypesSelector"},28101:(e,t,n)=>{n.d(t,{G:()=>m});var r=n(24328),a=n.n(r),o=n(71153),i=n.n(o),l=n(39475),s=n(79692),c=n(41128);const u=(0,s.Z)((e=>({container:{display:"flex",flexDirection:"column",flexShrink:0,width:"64px",paddingTop:"8px",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)"},active:{backgroundColor:(0,c.U1)(e.palette.primary.main,.12),color:e.palette.primary.main,"&:after":{content:'""',position:"absolute",height:"42px",width:"3px",backgroundColor:e.palette.primary.main,left:"-8px",borderRadius:"0 6px 6px 0"}},buttonWrapper:{position:"relative",width:"48px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",margin:"2px 8px",color:e.palette.text.secondary}})));function d(){return d=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},d.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const m=e=>{let{buttonsProps:t,activeIndexId:n,className:r,onButtonClick:o,classes:s={}}=e;const c=u(),{active:m,buttonWrapper:h}=s,g=p(s,["active","buttonWrapper"]);return a().createElement("div",{className:i()(c.container,r)},t.map((e=>{let{id:t}=e,r=p(e,["id"]);return a().createElement(l.k,d({},r,{classes:g,size:"S",key:t,className:i()({[i()(c.active,m)]:n===t},c.buttonWrapper,h),onClick:()=>o(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},11821:(e,t,n)=>{n.d(t,{h:()=>i});var r=n(24328),a=n.n(r);const o=(0,n(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),i=e=>{let{width:t,open:n,children:r}=e;const i=o();return a().createElement("div",{className:i.contentWrapper,style:{width:`${n?t:0}px`}},n&&a().createElement(a().Fragment,null,r))}},15177:(e,t,n)=>{n.d(t,{Z:()=>k});var r=n(52730),a=n(35674),o=n(24328),i=n.n(o),l=n(22241),s=n(71153),c=n.n(s),u=n(87918),d=n.n(u),p=n(95544),m=n(90436),h=n(80687),g=n(1730),f=n(52194),b=n(89978),y=n(26978),v=n(79692);const x=(0,v.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),E=(0,r.connect)((e=>({metadata:a.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},metadata:s,caption:u="",excludeUris:v=[],includeUris:E=[],attributesCount:w=16}=e;const C=x(),O=(0,r.useSelector)(a.ZP.selectors.getPivotingAttributes),S=(0,o.useMemo)((()=>(0,y.U)(s,n.type,E,v)),[v,E,s,n.type]),P=(0,l.fyF)(S,n).filter((e=>{let{values:t}=e;return!(0,l.O27)(t)})).length>0;return P||!(0,l.O27)(u)?i().createElement(h.J.Provider,{value:O},i().createElement(g.Z,{className:t},u&&i().createElement(f.Z,{className:C.header,title:u}),i().createElement(p.Z,{className:c()(C.attributesContainer,{[C.noCaption]:!u})},P?i().createElement(b.Z,{entity:n,attrTypes:S,parentUri:n.uri,drawLines:!1,max:w}):i().createElement(m.Z,{className:C.noData},d().text("No data found"))))):null}));var w=n(17440),C=n(76141),O=n(12212),S=n(1108);const P=(0,v.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function T(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){R(e,t,n[t])}))}return e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _=(0,r.connect)((e=>({metadata:a.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},mode:s,metadata:u,caption:d="",excludeUris:m=[],includeUris:h=[],pinnedAttributes:b}=e;const v=P(),x=(0,r.useDispatch)(),E=(0,o.useContext)(O.m),R=(0,r.useSelector)(a.ZP.selectors.getUserRoles),_=(0,o.useMemo)((()=>(0,l.mC3)(b,R)),[b,R]),L=(0,r.useSelector)((e=>a.ZP.selectors.getModifiedEntity(e,n.uri)||{})),N=(0,o.useMemo)((()=>(0,y.U)(u,L.type,h,m)),[m,h,u,L.type]),k=(0,o.useCallback)((e=>(0,w.pipe)(a.N5.actions.addAttributes,x)(e.map((e=>T({},e,{viewId:E}))))),[E,x]),I=(0,o.useCallback)((e=>(0,w.pipe)(a.N5.actions.modifyAttribute,x)(T({},e,{viewId:E}))),[E,x]),j=(0,o.useCallback)((e=>(0,w.pipe)(a.N5.actions.removeAttribute,x)(T({},e,{viewId:E}))),[E,x]);return i().createElement(g.Z,{className:t},d&&i().createElement(f.Z,{className:v.header,title:d}),i().createElement(p.Z,{className:c()(v.attributesContainer,{[v.noCaption]:!d})},i().createElement(S.c.Provider,{value:_},i().createElement(C.Z,{entity:L,attrTypes:N,parentUri:L.uri,drawLines:!1,mode:s,showEmptyEditors:(0,l.ZiX)(L.uri),crosswalks:L.crosswalks,onAddAttributes:k,onChangeAttribute:I,onDeleteAttribute:j}))))}));var L=n(10609);function N(){return N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N.apply(this,arguments)}const k=(0,r.connect)(((e,t)=>({entity:t.entity||a.ZP.selectors.getEntityWithDiff(e),mode:t.mode||a.ZP.selectors.getMode(e)})))((e=>{let{mode:t=l.ARY.Viewing,attributesCount:n,pinnedAttributes:r,entity:a}=e,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["mode","attributesCount","pinnedAttributes","entity"]);return i().createElement(L.u.Provider,{value:a},(0,l.uzs)(t)?i().createElement(E,N({attributesCount:n,entity:a},o)):i().createElement(_,N({mode:t,pinnedAttributes:r,entity:a},o)))}))},32794:(e,t,n)=>{n.d(t,{R:()=>l});var r=n(24328),a=n(17440),o=n(22241);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const l=e=>{let{connection:t,onConnectionChange:n}=e;const l=(0,r.useCallback)((e=>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){i(e,t,n[t])}))}return e}({},t,{relation:e}))),[t,n]);return{onAddAttributes:(0,r.useCallback)((0,a.pipe)((0,o.zE1)(t.relation),l),[t.relation,l]),onChangeAttribute:(0,r.useCallback)((0,a.pipe)((0,o.lIv)(t.relation),l),[t.relation,l]),onRemoveAttribute:(0,r.useCallback)((0,a.pipe)((0,o.Ilm)(t.relation),l),[t.relation,l])}}},80525:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Qt});var r=n(24328),a=n.n(r),o=n(52730),i=n(36138),l=n(97333),s=n(22664),c=n(52844),u=n(35674),d=n(87378),p=n(98996),m=n(22241),h=n(87918),g=n.n(h),f=n(17440),b=n(60715),y=n(35174);const v=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.relations.filter((e=>!n.includes(e))).filter((0,f.either)((0,f.pipe)(m.nqN,(0,f.equals)(e)),(0,f.pipe)(m.j5q,(0,f.equals)(e))));n.push(...r);const a=(0,f.pipe)(x,(0,f.without)([e]))(r);return a.forEach((e=>v(e,t,n))),n},x=e=>(0,f.pipe)((0,f.chain)((e=>[(0,m.nqN)(e),(0,m.j5q)(e)])),f.uniq)(e),E=e=>{const[t,n]=(0,r.useState)(null),[a,i]=(0,r.useState)(null),l=(0,o.useDispatch)(),[s,c]=(0,r.useState)(null),[d,h]=(0,r.useState)(!1),E=null==e?void 0:e.uri,w=(0,m.biM)(e);(0,r.useEffect)((()=>(!E||(0,m.ZiX)(E)||w||(h(!0),(0,m.ZYI)({uri:E,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,m.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}).then((e=>{const t=new p.MultiGraph;((e,t)=>{const n=(e=>{var t;const n=new Set,r=new Set;e.entities.forEach((e=>n.add(e.uri))),((null===(t=e.relations)||void 0===t?void 0:t.filter((e=>n.has(e.startObject.objectURI)&&n.has(e.endObject.objectURI))))||[]).forEach((e=>{r.add(`${e.startObject.objectURI}--${e.endObject.objectURI}--${e.uri}`)}));const a=e.entities.map((e=>({id:e.uri,name:e.label,entityTypeUri:e.type,traversedRelationsCount:e.traversedRelations,untraversedRelationsCount:e.untraversedRelations}))),o=[];return r.forEach((e=>{const[t,n,r]=e.split("--");o.push({from:t,to:n,key:r})})),{nodes:a,edges:o}})(t);n.nodes.forEach((t=>{e.hasNode(t.id)||e.addNode(t.id,{label:(0,m.idV)(t.name),entityTypeUri:t.entityTypeUri,traversedRelationsCount:t.traversedRelationsCount,untraversedRelationsCount:t.untraversedRelationsCount,x:1,y:1})})),n.edges.forEach((t=>{const n=t.from===t.to;e.hasEdge(t.key)||e.addEdgeWithKey(t.key,t.from,t.to,{size:1,color:"rgba(0, 0, 0, 0.2)",forceLabel:n,loop:n})}))})(t,e),i(t),c(e)})).catch((e=>{console.error(e),c(null),l(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Something went wrong"))))})).finally((()=>{h(!1)}))),()=>{i(null),c(null),h(!1)})),[E,w,l,t]);const C=(0,r.useCallback)((e=>{h(!0),(0,m.VGk)(e).then((()=>{a.dropEdge(e);const{updatedData:t,removedEntitiesUris:n}=((e,t,n,r)=>{const a=r.relations.find((0,f.propEq)("uri",t)),o=(0,m.nqN)(a),i=(0,m.j5q)(a),l=(0,y.toUndirected)(n),s=(0,f.cond)([[()=>!(0,b.Ar)(l,e,o),(0,f.always)(o)],[()=>!(0,b.Ar)(l,e,i),(0,f.always)(i)],[f.T,(0,f.always)(null)]])(),c=(0,f.evolve)({relations:(0,f.reject)((0,f.propEq)("uri",t))})(r),{updatedData:u,removedEntitiesUris:d}=s?((e,t)=>{const n=v(e,t),r=(0,f.pipe)(x,(0,f.append)(e),f.uniq)(n);return{updatedData:(0,f.evolve)({relations:(0,f.reject)((e=>n.includes(e))),entities:(0,f.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:u,removedEntitiesUris:d}})(E,e,a,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(a,n),c(t)})).catch((e=>{l(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Something went wrong"))))})).finally((()=>{h(!1)}))}),[l,a,E,s]);return{graphLoading:d,data:s,graphologyGraph:a,graphTypeUri:t,setGraphTypeUri:n,onDeleteRelation:C}};var w=n(29627);function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const O=(e,t)=>{const 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){C(e,t,n[t])}))}return e}({},e,{[null==t?void 0:t.uri]:t}),r=Object.keys(n);return r.length>50&&delete n[r[0]],n},S=[25,50,100];function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const T=(e,t,n)=>{const{startObject:r,endObject:a,type:o}=t,{directionalLabel:i}=(0,m.nqN)(t)===n?r:a;return i||(0,m.Lmx)(e,o)},R=(e,t,n)=>{const[a,i]=(0,r.useState)({field:"",order:"asc"}),[l,s]=(0,r.useState)(0),[c,d]=(0,r.useState)(S[0]),[p,h]=(0,r.useState)([]),[b,y]=(0,r.useState)(!1),v=(0,o.useDispatch)(),x=(0,o.useSelector)(u.ZP.selectors.getMetadata),E=(0,r.useMemo)((()=>{const t=(null==e?void 0:e.entities)||[];return(0,f.zipObj)(t.map((0,f.prop)("uri")),t)}),[null==e?void 0:e.entities]),w=(0,r.useMemo)((()=>(0,f.pipe)((0,f.filter)((0,f.either)((0,f.pipe)(m.nqN,(0,f.equals)(t)),(0,f.pipe)(m.j5q,(0,f.equals)(t)))),(0,f.uniqBy)((0,f.prop)("uri")),(0,f.map)((e=>{const n=E[((e,t)=>{const n=(0,m.nqN)(t),r=(0,m.j5q)(t);return n===e?r:n})(t,e)];return{relation:e,entity:n,entityLabel:(0,m.idV)(n.label),entityTypeLabel:(0,m.jFi)(x,n),relationTypeLabel:T(x,e,n.uri)}})))((null==e?void 0:e.relations)||[])),[e,t,E,x]),{searchText:C,onChangeSearchText:O,filters:R,onFilter:_,relationTypesOptions:L,entityTypesOptions:N}=(e=>{const[t,n]=(0,r.useState)(""),[a,i]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,o.useSelector)(u.ZP.selectors.getMetadata);return{searchText:t,onChangeSearchText:n,filters:a,onFilter:i,entityTypesOptions:(0,r.useMemo)((()=>(0,f.pipe)((0,f.map)((e=>{let{entity:t}=e;return t.type})),f.uniq,(0,f.map)((0,m.nt9)(l)))(e)),[e,l]),relationTypesOptions:(0,r.useMemo)((()=>(0,f.pipe)((0,f.map)((e=>{let{relation:t}=e;return t.type})),f.uniq,(0,f.map)((0,m.V3K)(l)))(e)),[e,l])}})(w),k=(0,r.useMemo)((()=>(0,f.pipe)((0,f.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:a,relationTypesUris:o}=R;return t.toLowerCase().includes(C)&&(0,f.ifElse)((0,f.prop)("length"),(0,f.includes)(r.type),f.T)(o)&&(0,f.ifElse)((0,f.prop)("length"),(0,f.includes)(n.type),f.T)(a)})),a.field?(0,f.sort)(((e,t)=>m.P6Y.strings.sort(a.order,e[a.field],t[a.field]))):f.identity)(w)),[w,a,C,R]),I=(0,r.useMemo)((()=>k.slice(l*c,l*c+c)),[k,l,c]),j=(0,r.useCallback)((e=>{y(!0),(0,m._vs)(e).then((e=>{h((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{v(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Can't load relationship's attributes"))))})).finally((()=>y(!1)))}),[v]),Z=(0,r.useCallback)((e=>{h((t=>t.map((t=>t.relation.uri===e.uri?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){P(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{s(0),O(""),_({entityTypesUris:[],relationTypesUris:[]})}),[t,n,O,_]),(0,r.useEffect)((()=>{s(0)}),[a,C,R]);const A=(0,r.useCallback)((e=>{h((t=>t.filter((t=>t.relation.uri!==e))))}),[]),z=(0,r.useCallback)(((e,t)=>{y(!0),(0,m.HH7)({oldRelation:e,newRelation:t}).then((()=>{A(t.uri)})).catch((e=>{v(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Can't edit relationship"))))})).finally((()=>y(!1)))}),[A,v]);return{rowsData:I,onSort:i,sorting:a,searchText:C,onChangeSearchText:O,filters:R,onFilter:_,entityTypesOptions:N,relationTypesOptions:L,editingRelations:p,onStartRelationEditing:j,onCancelRelationEditing:A,onUpdateEditingRelation:Z,total:k.length,page:l,rowsPerPage:c,onPageChange:s,onRowsPerPageChange:d,onSaveEditingRelation:z,loading:b}},_=a().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{}});_.displayName="GraphStateContext";var L=n(71153),N=n.n(L),k=n(33109),I=n(62901),j=n(72316),Z=n(95544),A=n(79692);const z=(0,A.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),D=(0,r.memo)((e=>{let{className:t}=e;const n=z(),r=(0,o.useSelector)(u.ZP.selectors.getEntity);return a().createElement(k.Z,{className:N()(t,I.U),entity:r},a().createElement(Z.Z,{className:n.comments},a().createElement(j.Z,{uri:r.uri,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:r.uri}),objectType:m.q7e.ENTITY})))}));D.displayName="GraphProfileBand";const U=D;var M=n(11821),B=n(28101),F=n(82726);const G=(0,A.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function H(){return H=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},H.apply(this,arguments)}const V=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",H({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7v2h2V7H6zm0 4v2h2v-2H6zm0 4v2h2v-2H6zm4-8v2h8V7h-8zm10-2v5.02a6.52 6.52 0 012 2.01V3H2v18h11.028a6.52 6.52 0 01-2.009-2H4V5h16zm-9.503 8a6.497 6.497 0 011.31-2H10v2h.497zM10 15.5c0-.168.006-.335.019-.5H10v.5zm0 0c0 .516.06 1.018.173 1.5H10v-1.5zm10.3 2.39L23.42 21 22 22.42l-3.12-3.12c-.69.44-1.51.7-2.39.7-2.48 0-4.49-2.01-4.49-4.5s2.01-4.5 4.5-4.5 4.5 2.01 4.5 4.5c0 .88-.26 1.69-.7 2.39zm-3.8.11a2.5 2.5 0 000-5 2.5 2.5 0 000 5z",fill:"currentColor"}))};var W=n(50548);const q=(0,W.l)(_,(0,f.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;return a().createElement(k.Z,{entity:t})}));var $=n(15177);const X=(0,A.Z)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),Y=(0,W.l)(_,(0,f.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=X();return a().createElement("div",{className:r.wrapper},n&&a().createElement(d.Z,null),a().createElement($.Z,{entity:t,caption:g().text("Entity details"),className:r.noShadowBlock}))}));var K=n(90436),Q=n(42011),J=n(44443),ee=n(44938),te=n(79573);const ne="1px solid rgba(0, 0, 0, 0.05)",re=(0,A.Z)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:ne},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px"},headRow:{borderBottom:ne}});function ae(){return ae=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},ae.apply(this,arguments)}const oe=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const o=re();return a().createElement("div",{className:N()(o.tableRow,o.headRow)},t.map((e=>{const{id:t,sortable:o,headCellRenderer:i,columnClassName:l}=e,s=i,c=o?{sortField:n.field,sortOrder:n.order,sortHandler:()=>{r({field:t,order:n.field===t?(0,te.Dh)(n.order):"asc"})}}:{};return a().createElement("div",{key:t,className:l},a().createElement(s,ae({headCellData:e},c)))})))})),ie=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:o,rowsData:i,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:u,defaultRowHeight:d}=e;const p=re(),[m,h]=(0,r.useState)({width:0,height:0}),g=(0,r.useCallback)((e=>{let{data:t,index:r}=e;const i=t[r];return a().createElement("div",{className:N()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},a().createElement("div",{className:N()(p.tableRow,null==n?void 0:n.tableRow,{[p.editingRow]:i.expanded})},o.map((e=>{let{id:t,rowCellValueRenderer:n,columnClassName:r}=e;const o=n;return a().createElement("div",{key:t,className:r},a().createElement(o,{value:i[t],rowValue:i}))}))),i.expanded&&u&&a().createElement(u,{open:i.expanded,rowValue:i}))}),[o,u]),f=(0,r.useCallback)(((e,t)=>{h({width:e,height:t})}),[]),b=(0,r.useRef)(null);return(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{var e;null===(e=b.current)||void 0===e||e.scrollTo(0)}}))),a().createElement("div",{className:p.table},a().createElement(oe,{columnsData:o,sorting:l,onSort:s}),a().createElement("div",{className:p.tableBodyWrapper},a().createElement(J.Z,{handleHeight:!0,handleWidth:!0,onResize:f}),a().createElement("div",{className:p.tableBody},a().createElement(ee.Z,{listRef:b,width:m.width,height:m.height,data:i,defaultItemSize:d,itemKey:c,showNotMeasuredItems:!0},g))))})),le=(0,r.memo)(ie);var se=n(92332),ce=n(83088);const ue="rgba(238, 238, 238, 1)",de=(0,A.Z)({tableWithPagination:{flex:1,overflow:"hidden",paddingRight:"1px",display:"flex",flexDirection:"column"},tableContainer:{flex:1,overflow:"hidden"},profileColumn:{width:"200px"},relationshipTypeColumn:{width:"130px"},entityTypeColumn:{width:"140px"},row:{position:"relative","&:hover":{background:ue}}});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 me={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},he=".collapsibleTableRow:hover &",ge=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}({},me,{[he]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${ue} 100%)`}}),fe=(0,A.Z)((e=>({headCell:{position:"relative",display:"flex",alignItems:"center",height:"33px",padding:"6px 0 6px 16px","&>div":{flexDirection:"row"},"&>div>span[role=button]":{width:"calc(100% + 49px)"}},headLabel:{color:e.palette.text.primary,fontSize:"12px",fontWeight:500,lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden","&:after":me},defaultCell:{position:"relative",color:e.palette.text.primary,fontSize:"13px",fontWeight:"normal",lineHeight:"15px",whiteSpace:"nowrap",overflow:"hidden",display:"flex",alignItems:"center",height:"100%",padding:"6px 16px","&:after":ge},clickable:{cursor:"pointer"},profileCell:{paddingTop:"3px",paddingBottom:"4px"},controlsCell:{position:"absolute",display:"flex",alignItems:"center",height:"100%",flexShrink:0,top:0,right:"9px",visibility:"hidden",[he]:{visibility:"visible",background:ue}},editingMode:{visibility:"visible"},hidden:{visibility:"hidden"},editButton:{marginRight:"7px"},entityAvatar:{width:"20px",height:"20px",marginRight:"8px"},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)"}},expandedRow:{padding:"6px 16px",fontSize:"13px"}})));function be(){return be=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},be.apply(this,arguments)}function ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ve(e,t,n[t])}))}return e}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xe=e=>{let{className:t,headCellData:n}=e,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["className","headCellData"]);const o=fe();return a().createElement("div",{className:N()(o.headCell,t)},a().createElement(se.default,be({},r,{headCellData:ye({},n,{label:a().createElement(ce.C,{value:n.label},a().createElement("div",{className:o.headLabel},n.label))})})))},Ee=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:o}=e;const i=fe();return n=n||t,a().createElement(ce.C,{value:n},a().createElement("div",{className:N()(i.defaultCell,o,{[i.clickable]:!!r}),onClick:r},t))}));var we=n(37573);const Ce=(0,W.l)(_,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:o}=e;const i=fe(),l=a().createElement(a().Fragment,null,a().createElement(we.Z,{entity:n,avatarClassName:i.entityAvatar}),t);return a().createElement(Ee,{value:l,tooltip:t,className:N()(i.profileCell,r),onClick:()=>o(n.uri)})}));var Oe=n(77277),Se=n(32794),Pe=n(17906);const Te=(0,W.l)(_,((e,t)=>{let{relationshipTable:n}=e;return{editingRelationObject:n.editingRelations.find((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)})),onUpdateEditingRelation:n.onUpdateEditingRelation,onCancelRelationEditing:n.onCancelRelationEditing,onSaveEditingRelation:n.onSaveEditingRelation}}),(e=>{let{open:t,editingRelationObject:n,onUpdateEditingRelation:i,onCancelRelationEditing:l,onSaveEditingRelation:s}=e;const c=(0,o.useDispatch)(),d=(0,o.useSelector)(u.ZP.selectors.getMetadata),{relation:p,initialRelation:h}=n,b=(0,r.useMemo)((()=>!(0,f.equals)(h,p)),[p,h]),y=fe(),v=(0,r.useCallback)((e=>{let{relation:t}=e;return i(t)}),[i]),x=(0,r.useCallback)((()=>l(p.uri)),[l,p.uri]),E=(0,r.useMemo)((()=>({relation:p})),[p]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:O}=(0,Se.R)({connection:E,onConnectionChange:v});return t?a().createElement("div",{className:y.expandedRow},a().createElement(Pe.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:O}),a().createElement("div",{className:y.actionButtons},a().createElement(Oe.Z,{onClick:x},g().text("Cancel")),a().createElement(Oe.Z,{color:"primary",disabled:!b,onClick:()=>{(e=>{const t=(0,m.xkB)(d,{relation:{object:e}});return c(u.N5.errors.actions.errorsSet(t)),0===t.length})(p)&&s(h,p)}},g().text("Save")))):null}));var Re=n(39475),_e=n(27604),Le=n(22983),Ne=n(22118);const ke=(0,W.l)(_,(0,f.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:o}=e;return a().createElement(Ne.Z,{open:n,title:g().text("Do you want to make a clean break?"),content:g().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:g().text("Delete relationship"),discardCaption:g().text("Cancel"),onDiscard:r,onSave:()=>{o(t),r()}})})),Ie=(0,r.memo)((e=>{let{uri:t}=e;const[n,o]=(0,r.useState)(!1),i=(0,r.useCallback)((()=>o(!0)),[]),l=(0,r.useCallback)((()=>o(!1)),[]);return a().createElement(a().Fragment,null,a().createElement(Re.k,{icon:Le.Z,size:"XXS",tooltipTitle:g().text("Delete"),onClick:i}),a().createElement(ke,{open:n,onClose:l,uri:t}))}));Ie.displayName="DeleteRelationButton";const je=Ie,Ze=(0,W.l)(_,((e,t)=>{let{relationshipTable:{onStartRelationEditing:n,editingRelations:r}}=e;return{onEdit:n,isEditing:r.some((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)}))}}),(e=>{let{rowValue:{relation:{uri:t}},className:n,onEdit:r,isEditing:o}=e;const i=fe();return a().createElement("div",{className:N()(i.controlsCell,n,{[i.editingMode]:o})},a().createElement(Re.k,{className:N()(i.editButton,{[i.hidden]:o}),icon:_e.Z,size:"XXS",tooltipTitle:g().text("Edit"),onClick:()=>r(t)}),a().createElement(je,{uri:t}))}));function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ze(e,t,n[t])}))}return e}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 De=(e,t)=>t[e].relation.uri||`${e}`,Ue=(0,W.l)(_,(e=>{let{relationshipTable:t}=e;return Ae({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:o,total:i,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:u,editingRelations:p,loading:m}=e;const h=de(),f=(0,r.useMemo)((()=>[{id:"entityLabel",label:g().text("Profile"),headCellRenderer:xe,rowCellValueRenderer:Ce,sortable:!0,columnClassName:h.profileColumn},{id:"relationTypeLabel",label:g().text("Relationship type"),headCellRenderer:xe,rowCellValueRenderer:Ee,sortable:!0,columnClassName:h.relationshipTypeColumn},{id:"entityTypeLabel",label:g().text("Entity Type"),headCellRenderer:xe,rowCellValueRenderer:Ee,sortable:!0,columnClassName:h.entityTypeColumn},{id:"controls",label:"",headCellRenderer:xe,rowCellValueRenderer:Ze}]),[h]),b=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=b.current)||void 0===e||e.resetScrollbarPosition()}),[t]);const y=(0,r.useMemo)((()=>t.map((e=>null!=p&&p.some((t=>{var n;return t.initialRelation.uri===(null==e||null===(n=e.relation)||void 0===n?void 0:n.uri)}))?Ae({},e,{expanded:!0}):e))),[t,p]),v=(0,r.useMemo)((()=>({tableRow:N()(h.row,"collapsibleTableRow")})),[h]);return a().createElement("div",{className:h.tableWithPagination},a().createElement("div",{className:h.tableContainer},a().createElement(le,{ref:b,columnsData:f,rowsData:y,sorting:n,onSort:o,getRowKey:De,ExpandedRowRenderer:Te,defaultRowHeight:28,classes:v})),i>S[0]&&a().createElement(Q.Z,{count:i,rowsPerPageOptions:S,rowsPerPage:s,onChangeRowsPerPage:u,page:l,onChangePage:c,basicTableRef:b}),m&&a().createElement(d.Z,null))}));var Me=n(36444),Be=n(61837),Fe=n(33662);const Ge=(0,A.Z)((e=>({inactiveSearchIcon:{color:e.palette.text.secondary},activeSearchIcon:{color:e.palette.text.primary},input:{fontSize:"14px","&::placeholder":{color:`${e.palette.text.secondary} !important`,opacity:1}}}))),He=(0,W.l)(_,(0,f.pipe)((0,f.prop)("relationshipTable"),(0,f.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=Ge();return a().createElement(Fe.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:g().text("Search profiles"),classes:{input:r.input}})}));var Ve=n(92934),We=n(68977),qe=n(8629);const $e=(0,A.Z)((e=>({dialogPaper:{display:"flex",flexDirection:"column",padding:"12px 16px 8px"},title:{marginBottom:"21px",fontWeight:500,fontSize:"20px",lineHeight:"23px",letterSpacing:"0.25px",color:e.palette.text.primary},entityTypesSelector:{width:"468px",marginBottom:"20px"},relationTypesSelector:{width:"468px",marginBottom:"32px"},footer:{display:"flex"},clearAllButton:{marginRight:"auto"},cancelButton:{marginRight:"8px"}}))),Xe=(0,W.l)(_,(0,f.pipe)((0,f.prop)("relationshipTable"),(0,f.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:o,onFilter:i,entityTypesOptions:l,relationTypesOptions:s}=e;const c=$e(),[u,d]=(0,r.useState)([]),[p,m]=(0,r.useState)([]),h=()=>{d(o.entityTypesUris),m(o.relationTypesUris),n()};return(0,r.useEffect)((()=>{d(o.entityTypesUris),m(o.relationTypesUris)}),[o.entityTypesUris,o.relationTypesUris]),a().createElement(qe.Z,{classes:{paper:c.dialogPaper},onClose:h,open:t},a().createElement(K.Z,{className:c.title},g().text("Filter")),a().createElement(Ve.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:u,enableEmptyValueUnderline:!0,onChange:d}),a().createElement(We.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:m}),a().createElement("div",{className:c.footer},a().createElement(Oe.Z,{className:c.clearAllButton,onClick:()=>{d([]),m([])}},g().text("Clear All")),a().createElement(Oe.Z,{className:c.cancelButton,onClick:h},g().text("Cancel")),a().createElement(Oe.Z,{onClick:()=>{i({entityTypesUris:u,relationTypesUris:p}),n()},color:"primary"},g().text("Apply"))))})),Ye=(0,A.Z)((e=>({wrapper:{display:"flex",alignItems:"center",paddingLeft:"16px",paddingRight:"2px"},iconButton:{marginLeft:"4px"},activeFiltersIcon:{color:e.palette.primary.main},inactiveFiltersIcon:{color:e.palette.text.secondary}}))),Ke=(0,W.l)(_,(0,f.pipe)((0,f.prop)("relationshipTable"),(0,f.pick)(["filters"])),(e=>{let{filters:t}=e;const n=Ye(),[o,i]=(0,r.useState)(!1),{entityTypesUris:l,relationTypesUris:s}=t,c=l.length||s.length;return a().createElement("div",{className:n.wrapper},a().createElement(He,null),a().createElement(Be.Z,{className:n.iconButton,onClick:()=>i(!0)},a().createElement(Me.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),a().createElement(Xe,{open:o,onClose:()=>i(!1)}))})),Qe=(0,A.Z)({caption:{marginLeft:"16px",marginTop:"12px",marginBottom:"14px",fontSize:"16px",lineHeight:"24px"},wrapper:{flex:1,display:"flex",flexDirection:"column",height:0}}),Je=()=>{const e=Qe();return a().createElement("div",{className:e.wrapper},a().createElement(K.Z,{className:e.caption,variant:"subtitle1"},g().text("Relationships")),a().createElement(Ke,null),a().createElement(Ue,null))};let et;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(et||(et={}));const tt=(0,r.memo)((()=>{var e;const t=G(),[n,o]=(0,r.useState)(null),i=(0,r.useCallback)((e=>{o((t=>t===e?null:e))}),[]),l=null!==n,s=(0,r.useMemo)((()=>[{buttonProps:{id:et.Relationship,icon:V,tooltipTitle:g().text("Relationship")},content:a().createElement(Je,null)},{buttonProps:{id:et.EntityDetails,icon:F.Z,tooltipTitle:g().text("Entity Details")},content:a().createElement(Y,null)}]),[]);return a().createElement("div",{className:t.wrapper},a().createElement(M.h,{open:l,width:480},a().createElement(q,null),null===(e=s[n])||void 0===e?void 0:e.content),a().createElement(B.G,{buttonsProps:(0,f.pluck)("buttonProps",s),onButtonClick:i,activeIndexId:n}))}));tt.displayName="GraphRightSidePanel";const nt=tt;var rt=n(46339),at=n(23304);const ot=(e,t,n)=>{var r;if(!t.label)return;const a=n.labelSize,o=n.labelFont,i=n.labelWeight;e.fillStyle=null!==(r=n.labelColor)&&void 0!==r&&r.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color,e.font=`${i} ${a}px ${o}`,e.fillText(t.label,t.x+t.size+11,t.y+a/3)},it=(e,t,n)=>{const r=n.labelSize,a=n.labelFont,o=n.labelWeight;if(e.font=`${o} ${r}px ${a}`,e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=2,e.shadowBlur=3,e.shadowColor="rgba(0,0,0,0.2)","string"==typeof t.label){const n=e.measureText(t.label).width,a=Math.round(n+16),o=Math.round(r+2+4),i=Math.max(t.size,r/2)+2,l=Math.asin(o/2/i),s=Math.sqrt(Math.abs(Math.pow(i,2)-Math.pow(o/2,2)));e.beginPath(),e.moveTo(t.x+s,t.y+o/2),e.lineTo(t.x+i+a,t.y+o/2),e.lineTo(t.x+i+a,t.y-o/2),e.lineTo(t.x+s,t.y-o/2),e.arc(t.x,t.y,i,l,-l),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+2,0,2*Math.PI),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,ot(e,t,n)};var lt=n(88586);class st extends at.AbstractNodeProgram{constructor(e){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_borderSize;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\nvarying float v_borderRadius;\n\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n \n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n v_borderRadius = radius - (radius * a_borderSize / a_size); // border radius in node's size (full size is 1)\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}","\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\n\nvoid main(void) {\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(v_color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = v_color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, v_color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n}\n",1,5),this.borderSize=void 0,this.borderSize=e.getAttribLocation(this.program,"a_borderSize"),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.borderSize),e.vertexAttribPointer(this.borderSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16)}process(e,t,n){const r=this.array;let a=1*n*5;if(t||!e.inPath)return r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,void(r[a++]=0);r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a]=e.highlighted?4:2}render(e){const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.drawArrays(t.POINTS,0,this.array.length/5)}}class ct{constructor(){this.rebindTextureFns=[],this.images={},this.textureImage=void 0,this.hasReceivedImages=!1,this.pendingImagesFrameID=void 0,this.loadImage=(e,t)=>{if(this.images[e])return;const n=new Image;var r;n.addEventListener("load",(()=>{this.images[e]={status:"pending",image:n},"number"!=typeof this.pendingImagesFrameID&&(this.pendingImagesFrameID=requestAnimationFrame((()=>this.finalizePendingImages())))})),n.addEventListener("error",(()=>{this.images[e]={status:"error"}})),this.images[e]={status:"loading"},r=n,new URL(t,window.location.href).origin!==window.location.origin&&(r.crossOrigin=""),n.src=t},this.finalizePendingImages=()=>{this.pendingImagesFrameID=void 0;const e=[];for(const t in this.images){const n=this.images[t];"pending"===n.status&&e.push({id:t,image:n.image,size:Math.min(n.image.width,n.image.height)||1})}const t=document.createElement("canvas"),n=t.getContext("2d");t.width=e.reduce(((e,t)=>{let{size:n}=t;return e+n}),this.hasReceivedImages?this.textureImage.width:0),t.height=Math.max(this.hasReceivedImages?this.textureImage.height:0,...e.map((e=>{let{size:t}=e;return t})));let r=0;this.hasReceivedImages&&(n.putImageData(this.textureImage,0,0),r=this.textureImage.width),e.forEach((e=>{let{id:t,image:a,size:o}=e;const i=Math.min(128,o);let l=0,s=0;(a.width||0)>(a.height||0)?l=(a.width-a.height)/2:s=(a.height-a.width)/2,n.drawImage(a,l,s,o,o,r,0,i,i),this.images[t]={status:"ready",x:r,y:0,width:i,height:i},r+=i})),this.textureImage=n.getImageData(0,0,t.width,t.height),this.hasReceivedImages=!0,this.rebindTextureFns.forEach((e=>e()))}}}const ut={id:"defaultImage",path:(0,m.m5F)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};class dt extends at.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_texture;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float radius = 0.5;\n\n// convert color to gray\nvec4 toGrayscale(in vec4 color)\n{\n float average = (color.r + color.g + color.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}\n\nvoid main(void) {\n vec4 color;\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(v_color, texel, texel.a).rgb, max(texel.a, v_color.a));\n } else {\n color = v_color;\n }\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toGrayscale(color);\n }\n\n // distance from point to center of node\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n\n if (dist < radius - v_border) // points inside node\n gl_FragColor = color;\n else if (dist < radius) // border of node\n gl_FragColor = mix(transparent, color, (radius - dist) / v_border);\n else // points outside node\n gl_FragColor = transparent;\n}",1,9),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.inactive=void 0,this.imageLoader=new ct,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.inactive=e.getAttribLocation(this.program,"a_inactive");const n=e.getUniformLocation(this.program,"u_atlas");if(null===n)throw new Error("NodeProgramImage: error while getting atlasLocation");this.atlasLocation=n,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),this.imageLoader.loadImage(ut.id,ut.path),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.textureLocation),e.enableVertexAttribArray(this.inactive),e.vertexAttribPointer(this.inactive,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20)}process(e,t,n){const r=this.array;let a=1*n*9;const o=e.image;let i=o&&this.imageLoader.images[o];if("string"!=typeof o||i||this.imageLoader.loadImage(o,o),t)return r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,void(r[a++]=0);if(r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a++]=e.inactive?1:0,i&&"ready"===i.status||(i=this.imageLoader.images[ut.id]),i&&"ready"===i.status){const{width:e,height:t}=this.imageLoader.textureImage;r[a++]=i.x/e,r[a++]=i.y/t,r[a++]=i.width/e,r[a++]=i.height/t}else r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1i(this.atlasLocation,0),t.drawArrays(t.POINTS,0,this.array.length/9)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}const pt=[{id:"expandIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.80013 7.20003V4H7.20013L7.20013 7.20003H4V8.80003H7.20013L7.20013 12H8.80013V8.80003H12V7.20003H8.80013Z" fill="black" fill-opacity="0.541176"/>\n</svg>')},{id:"collapseIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path d="M4 7.20004H12V8.80004H4V7.20004Z" fill="black" fill-opacity="0.541176"/>\n</svg>\n')}];class mt extends at.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_buttonSize;\nattribute vec2 a_normals;\nattribute vec4 a_texture;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying float v_border;\nvarying vec4 v_texture;\nvarying vec4 v_color;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normals);\n vec2 unitNormal = (a_normals) / normalLength;\n\n float pixelsThickness = max(normalLength, 1.0 * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Move the point\n float adaptedWebGLNodeRadius = a_size * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n vec2 compensationVector = vec2(-unitNormal.y, unitNormal.x) * (adaptedWebGLNodeRadius);\n\n // Set position\n gl_Position = vec4((u_matrix * vec3(a_position + compensationVector, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_buttonSize * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main(void) {\n vec4 color;\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5));\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(black, texel, texel.a).rgb, max(texel.a, bias));\n } else {\n color = black;\n }\n\n if (distToCenter < radius - v_border) // points inside button\n gl_FragColor = color;\n else if (distToCenter < radius) // border of button\n gl_FragColor = mix(transparent, color, (0.5 - distToCenter) / v_border);\n else // points outside button\n gl_FragColor = transparent;\n}",2,11),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.buttonSize=void 0,this.normals=void 0,this.correctionRatioLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.imageLoader=new ct,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.buttonSize=e.getAttribLocation(this.program,"a_buttonSize"),this.normals=e.getAttribLocation(this.program,"a_normals");const n=e.getUniformLocation(this.program,"u_correctionRatio");if(null===n)throw new Error("NodeButtonsProgram: error while getting correctionRatioLocation");this.correctionRatioLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("NodeButtonsProgram: error while getting sqrtZoomRatioLocation");this.sqrtZoomRatioLocation=r;const a=e.getUniformLocation(this.program,"u_atlas");if(null===a)throw new Error("NodeButtonsProgram: error while getting atlasLocation");this.atlasLocation=a,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),pt.map((e=>this.imageLoader.loadImage(e.id,e.path))),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.buttonSize),e.enableVertexAttribArray(this.normals),e.enableVertexAttribArray(this.textureLocation),e.vertexAttribPointer(this.buttonSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.normals,2,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,28)}process(e,t,n){const r=this.array;let a=2*n*11;const o=t||e.inactive&&!e.highlighted,[i,l]=e.buttonOffset||[0,0];let s=i*i+l*l,c=0,u=0;if(s&&(s=1/Math.sqrt(s),c=l*s,u=i*s),o||0===e.untraversedRelationsCount)r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0;else{const t=this.imageLoader.images.expandIcon;if(r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a++]=e.buttonSize||0,r[a++]=c,r[a++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[a++]=t.x/e,r[a++]=t.y/n,r[a++]=t.width/e,r[a++]=t.height/n}else r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0}if(o||0===e.traversedRelationsCount)r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0;else{const t=this.imageLoader.images.collapseIcon;if(r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a++]=e.buttonSize||0,r[a++]=-c,r[a++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[a++]=t.x/e,r[a++]=t.y/n,r[a++]=t.width/e,r[a++]=t.height/n}else r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0}}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.uniform1i(this.atlasLocation,1),t.drawArrays(t.POINTS,0,this.array.length/11)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}const ht=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:it,labelRenderer:ot,nodeProgramClasses:{image:(0,at.createNodeCompoundProgram)([dt,st,mt])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return a().createElement(rt.C6,{graph:p.MultiGraph,style:{background:"transparent"},initialSettings:n},t)};var gt=n(28833),ft=n.n(gt),bt=n(3660),yt=n.n(bt),vt=n(28301),xt=n.n(vt),Et=n(31181),wt=n(30284);const Ct=.6,Ot=(e,t,n,r,a)=>{if(t.loop){const{size:r,color:a}=t,o=n.x,i=n.y,l=n.size,s=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x1:e-7*(n+r),y1:t,x2:e,y2:t+7*(n+r)}}(o,i,.6*l);if(e.strokeStyle=a,e.lineWidth=r,"arrow"===t.type){const{aX:t,aY:n,vX:r,vY:c}=((e,t,n,r)=>{const a=Math.max(.5*r,5),o=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return{aX:e.x1+(t-e.x1)*(o-a-r)/o,aY:e.y1+(n-e.y1)*(o-a-r)/o,vX:(t-e.x1)*a/o,vY:(n-e.y1)*a/o}})(s,o,i,l);e.beginPath(),e.moveTo(o,i),e.bezierCurveTo(s.x2,s.y2,s.x1,s.y1,t,n),e.stroke(),e.fillStyle=a,e.beginPath(),e.moveTo(t+r,n+c),e.lineTo(t+c*Ct,n-r*Ct),e.lineTo(t-c*Ct,n+r*Ct),e.lineTo(t+r,n+c),e.closePath(),e.fill()}else e.beginPath(),e.moveTo(o,i),e.bezierCurveTo(s.x1,s.y1,s.x2,s.y2,o,i),e.stroke()}(0,wt.default)(e,t,n,r,a)};function St(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pt(e,t,n[t])}))}return e}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tt=(0,f.memoizeWith)(((e,t,n)=>n.type),m.uie),Rt={size:24,buttonSize:8,buttonOffset:[19,19]},_t={size:12,buttonSize:6,buttonOffset:[8,13]},Lt=e=>{let{data:t,graph:n,syncLayout:a,workerLayout:i,layoutSettings:l,selectedNode:s,onNodeClick:c}=e;const d=(0,rt.Ys)(),p=(0,rt.sG)(),m=(0,rt.$j)(),h=(0,rt.eP)(),g=(0,o.useSelector)(u.ZP.selectors.getEntity),f=(0,o.useSelector)(u.ZP.selectors.getMetadata),v=(0,o.useSelector)(u.ZP.selectors.getAbsoluteImagePath)||"",[x,E]=(0,r.useState)(void 0),[w,C]=(0,r.useState)(null),[O,S]=(0,r.useState)({});(0,r.useEffect)((()=>{d.getCamera().setState({ratio:1.2})}),[n,d]),(0,r.useEffect)((()=>{if(C((0,y.toUndirected)(n)),p(n),a){const e=a(d.getGraph(),l);(0,Et.animateNodes)(d.getGraph(),e,{duration:1e3})}if(i){const e=new i(d.getGraph(),l);e.start();const t=setTimeout((()=>{e.stop()}),5e3);return()=>{clearTimeout(t),e.kill()}}}),[t,n,a,i,d,l,p]);const P=(0,r.useCallback)((e=>{const t=d.getGraph(),n=null==g?void 0:g.uri;if(t&&w&&n&&e&&n!==e){const r=(0,b.Ar)(w,n,e),a=((e,t)=>{const n=[];return t&&t.reduce(((t,r)=>(n.push(e.findEdge(t,r,(e=>!!e))||e.findEdge(r,t,(e=>!!e))),r))),n})(t,r);return{edges:a,nodes:r}}return{}}),[d,null==g?void 0:g.uri,w]);(0,r.useEffect)((()=>{S(P(s))}),[s,P]),(0,r.useEffect)((()=>{m({enterNode:e=>{let{node:t}=e;E(t)},leaveNode:()=>{E(void 0)},clickNode:e=>{let{node:t}=e;c(t)}})}),[d,m,c]),(0,r.useEffect)((()=>{const e=d.getGraph(),t=e.neighbors(s);h({nodeReducer:(e,n)=>{const r=Tt(f,v,{type:n.entityTypeUri}),a=St({},n,e===s?Rt:_t,{color:"#0072CE",image:r}),o=(O.nodes||[]).includes(e),i=x===e;return o||e===s?a.inPath=!0:!t||t.includes(e)||s===e||s===(null==g?void 0:g.uri)||o||(i||(a.label=""),a.inactive=!0),i&&(a.highlighted=!0),a},edgeReducer:(t,n)=>{const r=St({},n,{hidden:!1}),a=(O.edges||[]).includes(t);return!s||s===(null==g?void 0:g.uri)||e.hasExtremity(t,s)||a||(r.hidden=!0),a&&(r.color="#0072CE",r.size=4),r},renderEdgeLabels:!0,edgeLabelRenderer:Ot})}),[d,h,x,s,O,null==g?void 0:g.uri,f,v])};function Nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){kt(e,t,n[t])}))}return e}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const It=e=>{let{data:t,graph:n,selectedNode:a,onNodeClick:o}=e;const i=(0,r.useMemo)((()=>(ft().assign(n),{settings:Nt({},yt().inferSettings(n),{gravity:1})})),[n]);return Lt({workerLayout:xt(),layoutSettings:i,data:t,graph:n,selectedNode:a,onNodeClick:o}),null};var jt=n(36039);let Zt;!function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy"}(Zt||(Zt={}));const At=(e,t,n,r)=>{const a=new Set;return t.length||t.push(Array.from(e)),e.forEach((t=>{n.add(t),r.forEach((r=>{r.from!==t||e.has(r.to)||n.has(r.to)||a.add(r.to)}))})),a.size&&t.push(Array.from(a)),((e,t,n)=>{const r=new Set;return e.forEach((e=>{t.forEach((t=>{t.from!==e||n.has(t.to)||r.add(t.to)}))})),!!r.size})(a,r,n)?At(a,t,n,r):t},zt=(e,t,n,r)=>{if(e.length<10&&(t[r]=[...e]),e.length>10){const a=e.slice(10),o=e.slice(0,10);t[r]=o,t[r+1]=n[r+1]?[...n[r+1],...a]:a}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return zt(e,t,n,r)}return t};function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ut=e=>{let{data:t,graph:n,selectedNode:a,layout:o,onNodeClick:i}=e;const l=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case Zt.VERTICAL_TB:return 180;case Zt.HORIZONTAL_LR:return 270}})(o),r=((e,t)=>{const n=e.nodes,r=e.edges.filter((e=>e.from!==e.to)),a=((e,t,n)=>{const r=new Set;return t.forEach((t=>{e.some((e=>e.to===t.id))||r.add(t.id)})),r.size||r.add(n),r})(r,n,t),o=At(a,[],new Set,r);return zt(o[0],[],o,0)})((e=>({nodes:e.nodes().map((e=>({id:e,name:""}))),edges:e.mapEdges(((e,t,n,r)=>({from:n,to:r,key:e})))}))(t),a),i=(e=>{const t=e.map((e=>e.length));return Math.max(...t)})(r);for(let e=0;e<r.length;++e)for(let n=0;n<r[e].length;++n)t.setNodeAttribute(r[e][n],"x",(s=n,(l=r[e].length)===(c=i)?5*s:1===l?5*(c-1)/2:5*(c-1)/(l+1)*(s+1))),t.setNodeAttribute(r[e][n],"y",10*e);var l,s,c;return jt.rotation.assign(t,n,{degrees:!0}),t.reduceNodes(((e,t,n)=>{let{x:r,y:a}=n;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){Dt(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:a}})}),{})}),[o,a]);return Lt({syncLayout:l,data:t,graph:n,selectedNode:a,onNodeClick:i}),null};var Mt=n(84425);const Bt=(0,A.Z)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),Ft=(0,W.l)(_,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const i=Bt(),l=(0,o.useSelector)(u.ZP.selectors.getMetadata),s=(0,o.useSelector)(u.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:g().text("All"),value:null},...(0,m.mmY)(l,s.type).map((e=>{let{uri:t,label:n}=e;return{value:t,label:n}}))]),[s,l]),d=(0,r.useMemo)((()=>c.find((e=>e.value===t))),[c,t]);return a().createElement(Mt.Z,{classes:{valueContainer:i.valueContainer},className:i.graphTypeSelector,height:42,label:g().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:i.filledInputRoot}}}})})),Gt=(0,A.Z)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),Ht=(0,r.memo)((e=>{let{value:t,onChangeHandler:n}=e;const r=Gt(),o=[{label:g().text("Simple network"),value:Zt.SIMPLE_NETWORK},{label:g().text("Vertical hierarchy"),value:Zt.VERTICAL_TB},{label:g().text("Horizontal hierarchy"),value:Zt.HORIZONTAL_LR}];return a().createElement(Mt.Z,{className:r.graphLayoutSelector,label:g().text("Graph layout"),value:o.find((0,f.propEq)("value",t)),options:o,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:r.filledInputRoot}}}})})),Vt=(0,A.Z)({wrapper:{height:"100%",position:"relative"},selectors:{display:"flex",position:"absolute",top:"12px",right:"16px",zIndex:2},graph:{height:"calc(100% - 5px)"}});function Wt(){return Wt=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},Wt.apply(this,arguments)}const qt=(0,W.l)(_,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:a}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:a}}),(e=>{let{data:t,graph:n,selectedNode:o,onNodeSelect:i}=e;const[l,s]=(0,r.useState)(Zt.SIMPLE_NETWORK),c=Vt(),u={data:t,graph:n,selectedNode:o,onNodeClick:i};return a().createElement("div",{className:c.wrapper},a().createElement("div",{className:c.selectors},a().createElement(Ft,null),a().createElement(Ht,{value:l,onChangeHandler:s})),a().createElement("div",{className:c.graph},n&&a().createElement(ht,null,l===Zt.SIMPLE_NETWORK?a().createElement(It,u):a().createElement(Ut,Wt({},u,{layout:l})))))})),$t=(0,A.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},graphWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1},graphContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Xt=(0,r.memo)((()=>{const e=$t(),t=(0,o.useSelector)(u.ZP.selectors.getEntity),n=(e=>{const{graphLoading:t,data:n,graphologyGraph:a,graphTypeUri:i,setGraphTypeUri:l,onDeleteRelation:s}=E(e),{selectedEntity:c,onEntitySelect:d,selectedEntityLoading:p}=((e,t)=>{const n=(0,w._)(),a=(0,o.useDispatch)(),[i,l]=(0,r.useState)(null),s=(0,r.useRef)({}),[c,d]=(0,r.useState)(!1),p=(0,r.useCallback)((e=>{const t=s.current[e];return t?Promise.resolve(t):(0,m.HvW)(e).then((e=>(s.current=O(s.current,e),e)))}),[]),h=(0,r.useCallback)((e=>{var r;const o=null==t||null===(r=t.entities)||void 0===r?void 0:r.find((0,f.propEq)("uri",e));o&&l(o),d(!0),n(p(e)).then(l).catch((e=>{a(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[a,t,n,p]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=O({},e),h(e.uri))}),[null==e?void 0:e.uri]),(0,r.useEffect)((()=>{const n=null==t?void 0:t.entities.find((e=>(null==i?void 0:i.uri)===e.uri));n||(null!=e&&e.uri?(s.current=O({},e),h(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:i,onEntitySelect:h}})(e,n);return{graphLoading:t,data:n,graphologyGraph:a,onDeleteRelation:s,selectedEntity:c,onEntitySelect:d,selectedEntityLoading:p,graphTypeUri:i,setGraphTypeUri:l,relationshipTable:R(n,null==c?void 0:c.uri,i)}})(t),{graphLoading:i}=n;return a().createElement(_.Provider,{value:n},a().createElement("div",{className:e.perspectiveView},i&&a().createElement(d.Z,null),(null==t?void 0:t.uri)&&a().createElement("div",{className:e.graphContainer},a().createElement("div",{className:e.graphWrapper},a().createElement(U,null),a().createElement(qt,null)),a().createElement(nt,null))))}));Xt.displayName="GraphPerspectiveView";const Yt=Xt,Kt=(0,i.createGenerateClassName)({productionPrefix:"graph",disableGlobal:!0}),Qt=e=>{let{store:t}=e;return a().createElement(o.Provider,{store:t},a().createElement(i.StylesProvider,{generateClassName:Kt},a().createElement(s.MuiPickersUtilsProvider,{utils:c.Z},a().createElement(Yt,null),a().createElement(l.Z,{showErrorFromStore:!0}))))}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[525],{50548:(e,t,n)=>{n.d(t,{l:()=>o});var r=n(24328),a=n.n(r);function i(){return i=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},i.apply(this,arguments)}const o=(e,t,n)=>{if(e&&t){const o=(0,r.memo)(n);return n=>a().createElement(e.Consumer,null,(e=>a().createElement(o,i({},n,t(e,n)))))}return n}},44938:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),a=n.n(r),i=n(50166),o=n(44443),l=n(22241);const s=(0,n(79692).Z)({item:{overflow:"hidden"}});function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,r.memo)((e=>{let{width:t=0,height:n=0,defaultItemSize:u,data:d,children:p,itemKey:m,showNotMeasuredItems:h,listRef:g}=e;const f=s(),b=(0,r.useRef)({}),[y,v]=(0,r.useState)({}),x=(0,r.useCallback)((0,l.DsO)((()=>{v(c({},b.current))})),[]),E=(0,r.useCallback)(((e,t)=>m?m(t,e):t),[m]),w=(0,r.useRef)(),C=g||w;C.current&&C.current.resetAfterIndex(0,!1);const T=(0,r.useMemo)((()=>e=>{let{data:t,index:n,style:r}=e;const i=E(t,n);return a().createElement("div",{style:r,className:f.item},a().createElement("div",{style:h?void 0:{visibility:i in y?void 0:"hidden"}},a().createElement(o.Z,{handleHeight:!0,onResize:(e,t)=>{b.current[i]!==t&&(((e,t)=>{b.current=c({},b.current,{[e]:t})})(i,t),x())}}),p({data:t,index:n})))}),[p,h,E,x,!h&&y]);return a().createElement(i.VariableSizeList,{ref:C,width:t,height:n,itemCount:d.length,itemData:d,itemSize:e=>y[(e=>E(d,e))(e)]||u,itemKey:m},T)}))},42011:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(13980),a=n.n(r),i=n(24328),o=n.n(i),l=n(71153),s=n.n(l),c=n(28899),u=n(87918),d=n.n(u),p=n(79573),m=n(17440);const h=(0,n(79692).Z)({pagination:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"56px",borderTop:"1px solid rgba(0,0,0,0.12)",boxShadow:"none"},caption:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px"},selectRoot:{marginLeft:"5px",marginRight:"36px"},select:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right"},actions:{marginLeft:"32px"}});function g(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){f(e,t,n[t])}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b=e=>{let{classes:t={},count:n,rowsPerPageOptions:r,page:a,onChangePage:l,rowsPerPage:u,onChangeRowsPerPage:f,basicTableRef:b,labelRowsPerPage:y}=e;const v=h(),x=(0,i.useCallback)((()=>{(0,m.pathOr)(m.identity,["current","resetScrollbarPosition"],b)()}),[b]),E=(0,i.useCallback)((e=>{l(e),x()}),[l,x]),w=(0,i.useCallback)((e=>{l(0),f(e),x()}),[l,f,x]);return o().createElement(c.Z,{classes:g({},t,{root:s()(v.pagination,t.root),select:s()(v.select,t.select),caption:v.caption,selectRoot:v.selectRoot,actions:v.actions}),component:"div",labelRowsPerPage:y||d().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:r}=e;return d().text("${fromRow}-${toRow} of ${countRows}",{fromRow:d().number(t,"0,0"),toRow:d().number(n,"0,0"),countRows:d().number(r,"0,0")})},count:n,rowsPerPageOptions:r,page:a,onChangePage:(0,m.pipe)((0,m.nthArg)(1),E),rowsPerPage:u,onChangeRowsPerPage:(0,m.pipe)(p.NA,w)})};b.propTypes={classes:a().object,rowsPerPageOptions:a().arrayOf(a().number),count:a().number,page:a().number,onChangePage:a().func,rowsPerPage:a().number,onChangeRowsPerPage:a().func,basicTableRef:a().shape({current:a().object}),labelRowsPerPage:a().string};const y=o().memo(b)},1730:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),a=n(13980),i=n.n(a),o=n(24328),l=n.n(o);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function d(){return d=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},d.apply(this,arguments)}const p=(0,o.forwardRef)(((e,t)=>{let{children:n,className:a}=e,i=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["children","className"]);const o=u();return l().createElement(r.Z,d({ref:t,className:a,classes:{root:o["basic-view__paper"]}},i),n)}));p.displayName="BasicView",p.propTypes={children:i().node,className:i().string};const m=p},22118:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),a=n.n(r),i=n(87918),o=n.n(i),l=n(77277),s=n(8629),c=n(49429),u=n(38724),d=n(55999),p=n(79249);const m=(0,n(79692).Z)({paper:{minHeight:"180px"},title:{padding:"16px 16px 10px 16px",fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px"},content:{padding:"0 16px"},contentText:{marginBottom:0,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px"},actionButtons:{display:"flex",paddingTop:"4px",fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px","& > div":{marginLeft:"auto"}},discardButton:{marginRight:"8px"}}),h=e=>{let{open:t,title:n,content:r,onCancel:i,cancelCaption:h=o().text("Cancel"),onDiscard:g,discardCaption:f="",onSave:b,saveCaption:y=o().text("Save"),disabledSave:v=!1}=e;const x=m();return a().createElement(s.Z,{open:t,onClose:i,classes:{paperScrollPaper:x.paper}},a().createElement(p.Z,{classes:{root:x.title}},n),a().createElement(u.Z,{classes:{root:x.content}},a().createElement(d.Z,{classes:{root:x.contentText}},r)),a().createElement(c.Z,{className:x.actionButtons,disableSpacing:!0},i&&a().createElement(l.Z,{onClick:i},h),a().createElement("div",null,g&&a().createElement(l.Z,{onClick:g,classes:{root:x.discardButton}},f),a().createElement(l.Z,{onClick:b,color:"primary",disabled:v,autoFocus:!0},y))))}},17906:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(24328),a=n.n(r),i=n(52730),o=n(35674),l=n(22241),s=n(76141);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=e=>{let{connection:t,onChangeAttribute:n,onRemoveAttribute:u,onAddAttributes:d,showEmptyEditors:p}=e;const{relation:m}=t,{attributes:h,uri:g,type:f=""}=m,b=(0,i.useSelector)(o.ZP.selectors.getMetadata),y=(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){c(e,t,n[t])}))}return e}({attributes:h},(0,l.p2l)(m))),[m,h]),v=(0,r.useMemo)((()=>(0,l.xF8)(b,f)),[f,b]);return a().createElement(s.Z,{attrTypes:v,entity:y,showEmptyEditors:p,mode:l.fO_.EDITING,parentUri:g,onAddAttributes:d,onChangeAttribute:n,onDeleteAttribute:u})}},20146:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),a=n.n(r),i=n(52730),o=n(71153),l=n.n(o),s=n(90436),c=n(22241),u=n(35674);const d=(0,n(79692).Z)({"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",display:"inline-flex",marginRight:"12px",borderRadius:"2px"},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",display:"inline-flex",marginRight:"16px"}}),p=e=>{let{entity:t,className:n,size:r="small"}=e;const o=d(),p=(0,i.useSelector)(u.ZP.selectors.getMetadata),m=t.type,h=(0,c.nt9)(p,m)||{},g=(0,c.VD3)(p,h,"typeColor")||c.rSc.palette.primary.main;return a().createElement(s.Z,{style:{backgroundColor:g,color:c.P6Y.Colors.getColor(g)?"#FFFFFF":"#212121"},className:l()(o[`entityType-${r}`],n),component:"div"},(0,c.jFi)(p,t))}},92934:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),a=n.n(r),i=n(87918),o=n.n(i),l=n(22241),s=n(72108);const c=(0,r.memo)((e=>{let{entityTypes:t,selectedEntityTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:m={},disabled:h=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.oDv)),[t]);return a().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:o().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:o().text("Select entity types")})}));c.displayName="EntityTypesSelector"},52194:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),a=n.n(r),i=n(71153),o=n.n(i),l=n(17998);const s=(0,n(79692).Z)({container:{padding:"0 16px",minHeight:"48px"},title:{fontSize:"16px",lineHeight:"19px",paddingTop:"16px",paddingBottom:"13px",justifyContent:"flex-start"}}),c=e=>{let{className:t,title:n,children:r}=e;const i=s();return a().createElement(l.Z,{title:n,classes:{root:o()(i.container,t),title:i.title}},r)}},72108:(e,t,n)=>{n.d(t,{S:()=>N});var r=n(24328),a=n.n(r),i=n(71153),o=n.n(i),l=n(17440),s=n(22241),c=n(86619),u=n(83543),d=n(80030),p=n(79692);const m=(0,p.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),h=(e,t)=>{const{childNodes:n,clientLeft:r,clientWidth:a}=t;if(n.length>0){const[t]=Array.from(n),i=document.createRange();i.setStart(t,0);for(let n=0;n<e.length;n++){i.setEnd(t,i.endOffset+e[n].length);const{width:o}=i.getBoundingClientRect();if(r+o>a)return n;n!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1},g=e=>e.join(", "),f=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,b=e=>{let{list:t,maxWidth:n}=e;const i=m(),o=(0,r.useRef)(),[l,s]=(0,r.useState)(0);(0,r.useEffect)((()=>{s(((e,t)=>{const n=e.length,r=((e,t)=>{if(t){const n=h(e,t);return-1===n?0:e.length-n}return 0})(e,t);return n-Math.max(1,n-r)})(t,o.current))}),[t]);const c=g(t),u=l>0,p=u?g(t.slice(0,-l)):c;return a().createElement(d.ZP,{title:u?c:""},a().createElement("div",{className:i.listLabelContainer},a().createElement("div",{style:{width:f(n)},className:i.listLabel,ref:o},c),a().createElement("div",{className:i.visibleItemsLabel},p),u&&a().createElement("div",{className:i.hiddenCount},`+${l}`)))};var y=n(40435),v=n(22311),x=n(26638),E=n(33117),w=n(94792),C=n(63485);function T(){return T=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},T.apply(this,arguments)}const O=(0,l.always)(32),S=(0,r.memo)((e=>{let{selectedItems:t,onItemClick:n,focusIndex:r,width:i,height:o}=e,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return a().createElement(C.Z,T({getItemSize:O,renderItem:(e,i,o)=>{let{item:l}=i;const s=!!t.find((e=>l.uri===e)),c=o===r;return a().createElement(E.Z,{key:l.uri,onClick:n,checked:s,data:l,label:a().createElement(w.Z,{text:l.label,highlight:l.filterText}),labelInText:l.label,style:e,isFocused:c,hideIcon:!0,LogoIcon:l.LogoIcon})},focusIndex:r,fixedTitle:!1,disableHorizontalScrollbar:!0,width:i,height:o},l))}));S.displayName="SelectMetadataTypesList";const P=(0,p.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function R(){return R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}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}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 N=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:i,selectedItemsUris:d,onChange:p,ListLabelProps:m={},disabled:h,enableEmptyValueUnderline:g,single:f,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const T=P(),[O,L]=(0,r.useState)(!1),N=(0,r.useCallback)((()=>L(!0)),[]),k=(0,r.useCallback)((()=>L(!1)),[]),[I,j]=(0,r.useState)(""),Z=(0,r.useCallback)((()=>j("")),[]),A=(0,r.useCallback)((0,l.pipe)(Z,k),[k,Z]),U=i.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,I)})).map(((e,t)=>({item:{item:_({},e,{filterText:I})},index:t}))),z=(0,r.useMemo)((()=>d.map((e=>i.find((0,l.propEq)("uri",e)))).map((0,l.prop)("label"))),[d,i]),D=(0,r.useCallback)(((e,t)=>{f?(p(t?[e.uri]:[]),A()):p(t?d.concat(e.uri):d.filter((t=>t!==e.uri)))}),[d,p,f,A]),M=(0,r.useCallback)((e=>{let{item:t}=e;const n=!d.includes(t.uri);D(t,n)}),[d,D]),{focusIndex:B,handleKeyDown:F}=(0,x.t)({items:U,open:O,onSelectFocusedItem:M,selectedItems:d,onClose:A}),G=(0,r.useRef)(),H=G.current?G.current.getBoundingClientRect().width:0,V=Math.max(H,255),W=0===d.length;return a().createElement(a().Fragment,null,a().createElement(c.Z,{label:E,ref:G,InputProps:{startAdornment:W&&!t?null:a().createElement("div",{className:o()(T.inputText,n.inputText)},W?a().createElement("div",null,t):a().createElement(b,R({},m,{list:z}))),classes:{root:T.inputRoot,input:o()(T.input,n.input,{[T.emptyInput]:W&&!t}),disabled:o()(T.disabledInput,{[T.disabledPointer]:h}),underline:T.disabledUnderline},endAdornment:a().createElement(y.Z,{size:"L",icon:u.Z,iconClassName:o()(T.icon,{[T["popup-opened-icon"]]:O}),disabled:h}),readOnly:!0,disabled:!0,disableUnderline:W&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:o()(T.inputLabel,n.label)}},value:"",onClick:h?void 0:N,classes:{root:o()(T.root,n.root)},margin:"dense",variant:"filled",disabled:h,"data-reltio-id":w}),a().createElement(v.Z,{open:O,anchorEl:G.current,onClose:A,onSearch:j,title:C,containerWidth:V,containerHeight:355,searchInputOnKeyDown:F,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},a().createElement(S,{items:U,onItemClick:D,selectedItems:d,width:V,height:245,focusIndex:B})))}));N.displayName="MetadataTypesSelector"},33109:(e,t,n)=>{n.d(t,{Z:()=>E});var r=n(24328),a=n.n(r),i=n(13980),o=n.n(i),l=n(71153),s=n.n(l),c=n(52730),u=n(17440),d=n(90436),p=n(80030),m=n(87918),h=n.n(m),g=n(22241),f=n(35674),b=n(37573),y=n(20146);const v=(0,n(79692).Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"inset 0 -1px 0 0 rgba(0,114,206,0.06), inset 0 1px 0 0 rgba(0,114,206,0.06);","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}}}))),x=e=>{let{className:t,entity:n,children:i,classes:o}=e;const l=v({classes:o}),m=(0,c.useSelector)(f.ZP.selectors.getMetadata),x=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,g.BTI)(n))}),[n]);if((0,u.isNil)(n))return null;const E=(0,g.idV)(n.label),w=n.secondaryLabel,C=(0,g.ptG)(m,n),T=(0,g.Fn9)(n),O=n.uri,S=(0,g.BTI)(n);return a().createElement("div",{className:s()(l.profileBandWrapper,t)},a().createElement("div",{className:s()(l.profileBand,{[l.inactive]:!T}),"data-entity-uri":O},a().createElement(b.Z,{key:n.uri,entity:n,avatarClassName:l.profileIcon,imageClassName:l.imageProfileIcon}),a().createElement("div",{className:l.profileInfo},a().createElement("div",null,a().createElement(d.Z,{variant:"h6",className:l.label},E),w&&a().createElement(d.Z,{variant:"subtitle2",className:l.secondaryLabel},w),C&&a().createElement(d.Z,{variant:"subtitle1",className:l.businessCard},C)),a().createElement("div",{className:l.specialInfo},a().createElement("div",{className:l.entityType},a().createElement(y.Z,{entity:n,size:"medium",className:l.badge}),!(0,g.ZiX)(O)&&a().createElement(p.ZP,{title:h().text("Copy to clipboard")},a().createElement(d.Z,{display:"inline",variant:"body2",className:l.entityId,onClick:x},h().text("Entity ID"),": ",S))))),i&&a().createElement("div",null,i)))};x.propTypes={className:o().string,entity:o().object,children:o().node,classes:o().object};const E=x},68977:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),a=n.n(r),i=n(87918),o=n.n(i),l=n(22241),s=n(72108);const c=(0,r.memo)((e=>{let{relationTypes:t,selectedRelationTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:m={},disabled:h=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.Tt2)),[t]);return a().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:o().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:o().text("Select relation types")})}));c.displayName="RelationTypesSelector"},28101:(e,t,n)=>{n.d(t,{G:()=>m});var r=n(24328),a=n.n(r),i=n(71153),o=n.n(i),l=n(39475),s=n(79692),c=n(41128);const u=(0,s.Z)((e=>({container:{display:"flex",flexDirection:"column",flexShrink:0,width:"64px",paddingTop:"8px",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)"},active:{backgroundColor:(0,c.U1)(e.palette.primary.main,.12),color:e.palette.primary.main,"&:after":{content:'""',position:"absolute",height:"42px",width:"3px",backgroundColor:e.palette.primary.main,left:"-8px",borderRadius:"0 6px 6px 0"}},buttonWrapper:{position:"relative",width:"48px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",margin:"2px 8px",color:e.palette.text.secondary}})));function d(){return d=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},d.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const m=e=>{let{buttonsProps:t,activeIndexId:n,className:r,onButtonClick:i,classes:s={}}=e;const c=u(),{active:m,buttonWrapper:h}=s,g=p(s,["active","buttonWrapper"]);return a().createElement("div",{className:o()(c.container,r)},t.map((e=>{let{id:t}=e,r=p(e,["id"]);return a().createElement(l.k,d({},r,{classes:g,size:"S",key:t,className:o()({[o()(c.active,m)]:n===t},c.buttonWrapper,h),onClick:()=>i(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},11821:(e,t,n)=>{n.d(t,{h:()=>o});var r=n(24328),a=n.n(r);const i=(0,n(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),o=e=>{let{width:t,open:n,children:r}=e;const o=i();return a().createElement("div",{className:o.contentWrapper,style:{width:`${n?t:0}px`}},n&&a().createElement(a().Fragment,null,r))}},15177:(e,t,n)=>{n.d(t,{Z:()=>k});var r=n(52730),a=n(35674),i=n(24328),o=n.n(i),l=n(22241),s=n(71153),c=n.n(s),u=n(87918),d=n.n(u),p=n(95544),m=n(90436),h=n(80687),g=n(1730),f=n(52194),b=n(89978),y=n(26978),v=n(79692);const x=(0,v.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),E=(0,r.connect)((e=>({metadata:a.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},metadata:s,caption:u="",excludeUris:v=[],includeUris:E=[],attributesCount:w=16}=e;const C=x(),T=(0,r.useSelector)(a.ZP.selectors.getPivotingAttributes),O=(0,i.useMemo)((()=>(0,y.U)(s,n.type,E,v)),[v,E,s,n.type]),S=(0,l.fyF)(O,n).filter((e=>{let{values:t}=e;return!(0,l.O27)(t)})).length>0;return S||!(0,l.O27)(u)?o().createElement(h.J.Provider,{value:T},o().createElement(g.Z,{className:t},u&&o().createElement(f.Z,{className:C.header,title:u}),o().createElement(p.Z,{className:c()(C.attributesContainer,{[C.noCaption]:!u})},S?o().createElement(b.Z,{entity:n,attrTypes:O,parentUri:n.uri,drawLines:!1,max:w}):o().createElement(m.Z,{className:C.noData},d().text("No data found"))))):null}));var w=n(17440),C=n(76141),T=n(12212),O=n(1108);const S=(0,v.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function P(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){R(e,t,n[t])}))}return e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _=(0,r.connect)((e=>({metadata:a.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},mode:s,metadata:u,caption:d="",excludeUris:m=[],includeUris:h=[],pinnedAttributes:b}=e;const v=S(),x=(0,r.useDispatch)(),E=(0,i.useContext)(T.m),R=(0,r.useSelector)(a.ZP.selectors.getUserRoles),_=(0,i.useMemo)((()=>(0,l.mC3)(b,R)),[b,R]),L=(0,r.useSelector)((e=>a.ZP.selectors.getModifiedEntity(e,n.uri)||{})),N=(0,i.useMemo)((()=>(0,y.U)(u,L.type,h,m)),[m,h,u,L.type]),k=(0,i.useCallback)((e=>(0,w.pipe)(a.N5.actions.addAttributes,x)(e.map((e=>P({},e,{viewId:E}))))),[E,x]),I=(0,i.useCallback)((e=>(0,w.pipe)(a.N5.actions.modifyAttribute,x)(P({},e,{viewId:E}))),[E,x]),j=(0,i.useCallback)((e=>(0,w.pipe)(a.N5.actions.removeAttribute,x)(P({},e,{viewId:E}))),[E,x]);return o().createElement(g.Z,{className:t},d&&o().createElement(f.Z,{className:v.header,title:d}),o().createElement(p.Z,{className:c()(v.attributesContainer,{[v.noCaption]:!d})},o().createElement(O.c.Provider,{value:_},o().createElement(C.Z,{entity:L,attrTypes:N,parentUri:L.uri,drawLines:!1,mode:s,showEmptyEditors:(0,l.ZiX)(L.uri),crosswalks:L.crosswalks,onAddAttributes:k,onChangeAttribute:I,onDeleteAttribute:j}))))}));var L=n(10609);function N(){return N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N.apply(this,arguments)}const k=(0,r.connect)(((e,t)=>({entity:t.entity||a.ZP.selectors.getEntityWithDiff(e),mode:t.mode||a.ZP.selectors.getMode(e)})))((e=>{let{mode:t=l.ARY.Viewing,attributesCount:n,pinnedAttributes:r,entity:a}=e,i=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["mode","attributesCount","pinnedAttributes","entity"]);return o().createElement(L.u.Provider,{value:a},(0,l.uzs)(t)?o().createElement(E,N({attributesCount:n,entity:a},i)):o().createElement(_,N({mode:t,pinnedAttributes:r,entity:a},i)))}))},32794:(e,t,n)=>{n.d(t,{R:()=>l});var r=n(24328),a=n(17440),i=n(22241);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const l=e=>{let{connection:t,onConnectionChange:n}=e;const l=(0,r.useCallback)((e=>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){o(e,t,n[t])}))}return e}({},t,{relation:e}))),[t,n]);return{onAddAttributes:(0,r.useCallback)((0,a.pipe)((0,i.zE1)(t.relation),l),[t.relation,l]),onChangeAttribute:(0,r.useCallback)((0,a.pipe)((0,i.lIv)(t.relation),l),[t.relation,l]),onRemoveAttribute:(0,r.useCallback)((0,a.pipe)((0,i.Ilm)(t.relation),l),[t.relation,l])}}},80525:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Qt});var r=n(24328),a=n.n(r),i=n(52730),o=n(36138),l=n(97333),s=n(22664),c=n(52844),u=n(35674),d=n(87378),p=n(98996),m=n(22241),h=n(87918),g=n.n(h),f=n(17440),b=n(60715),y=n(35174);const v=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.relations.filter((e=>!n.includes(e))).filter((0,f.either)((0,f.pipe)(m.nqN,(0,f.equals)(e)),(0,f.pipe)(m.j5q,(0,f.equals)(e))));n.push(...r);const a=(0,f.pipe)(x,(0,f.without)([e]))(r);return a.forEach((e=>v(e,t,n))),n},x=e=>(0,f.pipe)((0,f.chain)((e=>[(0,m.nqN)(e),(0,m.j5q)(e)])),f.uniq)(e),E=e=>{const[t,n]=(0,r.useState)(null),[a,o]=(0,r.useState)(null),l=(0,i.useDispatch)(),[s,c]=(0,r.useState)(null),[d,h]=(0,r.useState)(!1),E=null==e?void 0:e.uri,w=(0,m.biM)(e);(0,r.useEffect)((()=>(!E||(0,m.ZiX)(E)||w||(h(!0),(0,m.ZYI)({uri:E,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,m.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}).then((e=>{const t=new p.MultiGraph;((e,t)=>{const n=(e=>{var t;const n=new Set,r=new Set;e.entities.forEach((e=>n.add(e.uri))),((null===(t=e.relations)||void 0===t?void 0:t.filter((e=>n.has(e.startObject.objectURI)&&n.has(e.endObject.objectURI))))||[]).forEach((e=>{r.add(`${e.startObject.objectURI}--${e.endObject.objectURI}--${e.uri}--${e.type}`)}));const a=e.entities.map((e=>({id:e.uri,name:e.label,entityTypeUri:e.type,traversedRelationsCount:e.traversedRelations,untraversedRelationsCount:e.untraversedRelations}))),i=[];return r.forEach((e=>{const[t,n,r,a]=e.split("--");i.push({from:t,to:n,key:r,relationTypeUri:a})})),{nodes:a,edges:i}})(t);n.nodes.forEach((t=>{e.hasNode(t.id)||e.addNode(t.id,{label:(0,m.idV)(t.name),entityTypeUri:t.entityTypeUri,traversedRelationsCount:t.traversedRelationsCount,untraversedRelationsCount:t.untraversedRelationsCount,x:1,y:1})})),n.edges.forEach((t=>{const n=t.from===t.to;e.hasEdge(t.key)||e.addEdgeWithKey(t.key,t.from,t.to,{size:1,color:"rgba(0, 0, 0, 0.2)",forceLabel:n,loop:n,relationTypeUri:t.relationTypeUri})}))})(t,e),o(t),c(e)})).catch((e=>{console.error(e),c(null),l(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Something went wrong"))))})).finally((()=>{h(!1)}))),()=>{o(null),c(null),h(!1)})),[E,w,l,t]);const C=(0,r.useCallback)((e=>{h(!0),(0,m.VGk)(e).then((()=>{a.dropEdge(e);const{updatedData:t,removedEntitiesUris:n}=((e,t,n,r)=>{const a=r.relations.find((0,f.propEq)("uri",t)),i=(0,m.nqN)(a),o=(0,m.j5q)(a),l=(0,y.toUndirected)(n),s=(0,f.cond)([[()=>!(0,b.Ar)(l,e,i),(0,f.always)(i)],[()=>!(0,b.Ar)(l,e,o),(0,f.always)(o)],[f.T,(0,f.always)(null)]])(),c=(0,f.evolve)({relations:(0,f.reject)((0,f.propEq)("uri",t))})(r),{updatedData:u,removedEntitiesUris:d}=s?((e,t)=>{const n=v(e,t),r=(0,f.pipe)(x,(0,f.append)(e),f.uniq)(n);return{updatedData:(0,f.evolve)({relations:(0,f.reject)((e=>n.includes(e))),entities:(0,f.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:u,removedEntitiesUris:d}})(E,e,a,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(a,n),c(t)})).catch((e=>{l(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Something went wrong"))))})).finally((()=>{h(!1)}))}),[l,a,E,s]);return{graphLoading:d,data:s,graphologyGraph:a,graphTypeUri:t,setGraphTypeUri:n,onDeleteRelation:C}};var w=n(29627);function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const T=(e,t)=>{const 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){C(e,t,n[t])}))}return e}({},e,{[null==t?void 0:t.uri]:t}),r=Object.keys(n);return r.length>50&&delete n[r[0]],n},O=[25,50,100];function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const P=(e,t,n)=>{const{startObject:r,endObject:a,type:i}=t,{directionalLabel:o}=(0,m.nqN)(t)===n?r:a;return o||(0,m.Lmx)(e,i)},R=e=>{let{data:t,selectedEntityUri:n,mainEntityUri:a,graphTypeUri:o}=e;const[l,s]=(0,r.useState)({field:"",order:"asc"}),[c,d]=(0,r.useState)(0),[p,h]=(0,r.useState)(O[0]),[b,y]=(0,r.useState)([]),[v,x]=(0,r.useState)(!1),E=(0,i.useDispatch)(),w=(0,i.useSelector)(u.ZP.selectors.getMetadata),C=(0,r.useMemo)((()=>{const e=(null==t?void 0:t.entities)||[];return(0,f.zipObj)(e.map((0,f.prop)("uri")),e)}),[null==t?void 0:t.entities]),T=(0,r.useMemo)((()=>(0,f.pipe)((0,f.filter)((0,f.either)((0,f.pipe)(m.nqN,(0,f.equals)(n)),(0,f.pipe)(m.j5q,(0,f.equals)(n)))),(0,f.uniqBy)((0,f.prop)("uri")),(0,f.map)((e=>{const t=C[((e,t)=>{const n=(0,m.nqN)(t),r=(0,m.j5q)(t);return n===e?r:n})(n,e)];return{relation:e,entity:t,entityLabel:(0,m.idV)(t.label),entityTypeLabel:(0,m.jFi)(w,t),relationTypeLabel:P(w,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,C,w]),{searchText:R,onChangeSearchText:_,filters:L,onFilter:N,relationTypesOptions:k,entityTypesOptions:I}=(e=>{const[t,n]=(0,r.useState)(""),[a,o]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,f.pipe)((0,f.map)((e=>{let{entity:t}=e;return t.type})),(0,f.concat)(f.__,a.entityTypesUris),f.uniq,(0,f.map)((0,m.nt9)(l)))(e)),[e,l,a.entityTypesUris]),c=(0,r.useMemo)((()=>(0,f.pipe)((0,f.map)((e=>{let{relation:t}=e;return t.type})),(0,f.concat)(f.__,a.relationTypesUris),f.uniq,(0,f.map)((0,m.V3K)(l)))(e)),[e,l,a.relationTypesUris]);return{searchText:t,onChangeSearchText:n,filters:a,onFilter:o,entityTypesOptions:s,relationTypesOptions:c}})(T),j=(0,r.useMemo)((()=>(0,f.pipe)((0,f.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:a,relationTypesUris:i}=L;return t.toLowerCase().includes(R)&&(0,f.ifElse)((0,f.prop)("length"),(0,f.includes)(r.type),f.T)(i)&&(0,f.ifElse)((0,f.prop)("length"),(0,f.includes)(n.type),f.T)(a)})),l.field?(0,f.sort)(((e,t)=>m.P6Y.strings.sort(l.order,e[l.field],t[l.field]))):f.identity)(T)),[T,l,R,L]),Z=(0,r.useMemo)((()=>j.slice(c*p,c*p+p)),[j,c,p]),A=(0,r.useCallback)((e=>{x(!0),(0,m._vs)(e).then((e=>{y((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{E(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Can't load relationship's attributes"))))})).finally((()=>x(!1)))}),[E]),U=(0,r.useCallback)((e=>{y((t=>t.map((t=>t.relation.uri===e.uri?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){S(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{d(0),_("")}),[n,o,_,N]),(0,r.useEffect)((()=>{N({entityTypesUris:[],relationTypesUris:[]})}),[o,a,N]),(0,r.useEffect)((()=>{d(0)}),[l,R,L]);const z=(0,r.useCallback)((e=>{y((t=>t.filter((t=>t.relation.uri!==e))))}),[]),D=(0,r.useCallback)(((e,t)=>{x(!0),(0,m.HH7)({oldRelation:e,newRelation:t}).then((()=>{z(t.uri)})).catch((e=>{E(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Can't edit relationship"))))})).finally((()=>x(!1)))}),[z,E]);return{rowsData:Z,onSort:s,sorting:l,searchText:R,onChangeSearchText:_,filters:L,onFilter:N,entityTypesOptions:I,relationTypesOptions:k,editingRelations:b,onStartRelationEditing:A,onCancelRelationEditing:z,onUpdateEditingRelation:U,total:j.length,page:c,rowsPerPage:p,onPageChange:d,onRowsPerPageChange:h,onSaveEditingRelation:D,loading:v}},_=a().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{}});_.displayName="GraphStateContext";var L=n(71153),N=n.n(L),k=n(33109),I=n(62901),j=n(72316),Z=n(95544),A=n(79692);const U=(0,A.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),z=(0,r.memo)((e=>{let{className:t}=e;const n=U(),r=(0,i.useSelector)(u.ZP.selectors.getEntity);return a().createElement(k.Z,{className:N()(t,I.U),entity:r},a().createElement(Z.Z,{className:n.comments},a().createElement(j.Z,{uri:r.uri,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:r.uri}),objectType:m.q7e.ENTITY})))}));z.displayName="GraphProfileBand";const D=z;var M=n(11821),B=n(28101),F=n(82726);const G=(0,A.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function H(){return H=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},H.apply(this,arguments)}const V=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",H({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7v2h2V7H6zm0 4v2h2v-2H6zm0 4v2h2v-2H6zm4-8v2h8V7h-8zm10-2v5.02a6.52 6.52 0 012 2.01V3H2v18h11.028a6.52 6.52 0 01-2.009-2H4V5h16zm-9.503 8a6.497 6.497 0 011.31-2H10v2h.497zM10 15.5c0-.168.006-.335.019-.5H10v.5zm0 0c0 .516.06 1.018.173 1.5H10v-1.5zm10.3 2.39L23.42 21 22 22.42l-3.12-3.12c-.69.44-1.51.7-2.39.7-2.48 0-4.49-2.01-4.49-4.5s2.01-4.5 4.5-4.5 4.5 2.01 4.5 4.5c0 .88-.26 1.69-.7 2.39zm-3.8.11a2.5 2.5 0 000-5 2.5 2.5 0 000 5z",fill:"currentColor"}))};var W=n(50548);const q=(0,W.l)(_,(0,f.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;return a().createElement(k.Z,{entity:t})}));var $=n(15177);const X=(0,A.Z)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),Y=(0,W.l)(_,(0,f.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=X();return a().createElement("div",{className:r.wrapper},n&&a().createElement(d.Z,null),a().createElement($.Z,{entity:t,caption:g().text("Entity details"),className:r.noShadowBlock}))}));var K=n(90436),Q=n(42011),J=n(44443),ee=n(44938),te=n(79573);const ne="1px solid rgba(0, 0, 0, 0.05)",re=(0,A.Z)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:ne},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px"},headRow:{borderBottom:ne}});function ae(){return ae=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},ae.apply(this,arguments)}const ie=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const i=re();return a().createElement("div",{className:N()(i.tableRow,i.headRow)},t.map((e=>{const{id:t,sortable:i,headCellRenderer:o,columnClassName:l}=e,s=o,c=i?{sortField:n.field,sortOrder:n.order,sortHandler:()=>{r({field:t,order:n.field===t?(0,te.Dh)(n.order):"asc"})}}:{};return a().createElement("div",{key:t,className:l},a().createElement(s,ae({headCellData:e},c)))})))})),oe=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:i,rowsData:o,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:u,defaultRowHeight:d}=e;const p=re(),[m,h]=(0,r.useState)({width:0,height:0}),g=(0,r.useCallback)((e=>{let{data:t,index:r}=e;const o=t[r];return a().createElement("div",{className:N()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},a().createElement("div",{className:N()(p.tableRow,null==n?void 0:n.tableRow,{[p.editingRow]:o.expanded})},i.map((e=>{let{id:t,rowCellValueRenderer:n,columnClassName:r}=e;const i=n;return a().createElement("div",{key:t,className:r},a().createElement(i,{value:o[t],rowValue:o}))}))),o.expanded&&u&&a().createElement(u,{open:o.expanded,rowValue:o}))}),[i,u]),f=(0,r.useCallback)(((e,t)=>{h({width:e,height:t})}),[]),b=(0,r.useRef)(null);return(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{var e;null===(e=b.current)||void 0===e||e.scrollTo(0)}}))),a().createElement("div",{className:p.table},a().createElement(ie,{columnsData:i,sorting:l,onSort:s}),a().createElement("div",{className:p.tableBodyWrapper},a().createElement(J.Z,{handleHeight:!0,handleWidth:!0,onResize:f}),a().createElement("div",{className:p.tableBody},a().createElement(ee.Z,{listRef:b,width:m.width,height:m.height,data:o,defaultItemSize:d,itemKey:c,showNotMeasuredItems:!0},g))))})),le=(0,r.memo)(oe);var se=n(92332),ce=n(83088);const ue="rgba(238, 238, 238, 1)",de=(0,A.Z)({tableWithPagination:{flex:1,overflow:"hidden",paddingRight:"1px",display:"flex",flexDirection:"column"},tableContainer:{flex:1,overflow:"hidden"},profileColumn:{width:"200px"},relationshipTypeColumn:{width:"130px"},entityTypeColumn:{width:"140px"},row:{position:"relative","&:hover":{background:ue}}});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 me={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},he=".collapsibleTableRow:hover &",ge=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}({},me,{[he]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${ue} 100%)`}}),fe=(0,A.Z)((e=>({headCell:{position:"relative",display:"flex",alignItems:"center",height:"33px",padding:"6px 0 6px 16px","&>div":{flexDirection:"row"},"&>div>span[role=button]":{width:"calc(100% + 49px)"}},headLabel:{color:e.palette.text.primary,fontSize:"12px",fontWeight:500,lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden","&:after":me},defaultCell:{position:"relative",color:e.palette.text.primary,fontSize:"13px",fontWeight:"normal",lineHeight:"15px",whiteSpace:"nowrap",overflow:"hidden",display:"flex",alignItems:"center",height:"100%",padding:"6px 16px","&:after":ge},clickable:{cursor:"pointer"},profileCell:{paddingTop:"3px",paddingBottom:"4px"},controlsCell:{position:"absolute",display:"flex",alignItems:"center",height:"100%",flexShrink:0,top:0,right:"9px",visibility:"hidden",[he]:{visibility:"visible",background:ue}},editingMode:{visibility:"visible"},hidden:{visibility:"hidden"},editButton:{marginRight:"7px"},entityAvatar:{width:"20px",height:"20px",marginRight:"8px"},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)"}},expandedRow:{padding:"6px 16px",fontSize:"13px"}})));function be(){return be=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},be.apply(this,arguments)}function ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ve(e,t,n[t])}))}return e}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xe=e=>{let{className:t,headCellData:n}=e,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["className","headCellData"]);const i=fe();return a().createElement("div",{className:N()(i.headCell,t)},a().createElement(se.default,be({},r,{headCellData:ye({},n,{label:a().createElement(ce.C,{value:n.label},a().createElement("div",{className:i.headLabel},n.label))})})))},Ee=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:i}=e;const o=fe();return n=n||t,a().createElement(ce.C,{value:n},a().createElement("div",{className:N()(o.defaultCell,i,{[o.clickable]:!!r}),onClick:r},t))}));var we=n(37573);const Ce=(0,W.l)(_,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:i}=e;const o=fe(),l=a().createElement(a().Fragment,null,a().createElement(we.Z,{entity:n,avatarClassName:o.entityAvatar}),t);return a().createElement(Ee,{value:l,tooltip:t,className:N()(o.profileCell,r),onClick:()=>i(n.uri)})}));var Te=n(77277),Oe=n(32794),Se=n(17906);const Pe=(0,W.l)(_,((e,t)=>{let{relationshipTable:n}=e;return{editingRelationObject:n.editingRelations.find((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)})),onUpdateEditingRelation:n.onUpdateEditingRelation,onCancelRelationEditing:n.onCancelRelationEditing,onSaveEditingRelation:n.onSaveEditingRelation}}),(e=>{let{open:t,editingRelationObject:n,onUpdateEditingRelation:o,onCancelRelationEditing:l,onSaveEditingRelation:s}=e;const c=(0,i.useDispatch)(),d=(0,i.useSelector)(u.ZP.selectors.getMetadata),{relation:p,initialRelation:h}=n,b=(0,r.useMemo)((()=>!(0,f.equals)(h,p)),[p,h]),y=fe(),v=(0,r.useCallback)((e=>{let{relation:t}=e;return o(t)}),[o]),x=(0,r.useCallback)((()=>l(p.uri)),[l,p.uri]),E=(0,r.useMemo)((()=>({relation:p})),[p]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}=(0,Oe.R)({connection:E,onConnectionChange:v});return t?a().createElement("div",{className:y.expandedRow},a().createElement(Se.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}),a().createElement("div",{className:y.actionButtons},a().createElement(Te.Z,{onClick:x},g().text("Cancel")),a().createElement(Te.Z,{color:"primary",disabled:!b,onClick:()=>{(e=>{const t=(0,m.xkB)(d,{relation:{object:e}});return c(u.N5.errors.actions.errorsSet(t)),0===t.length})(p)&&s(h,p)}},g().text("Save")))):null}));var Re=n(39475),_e=n(27604),Le=n(22983),Ne=n(22118);const ke=(0,W.l)(_,(0,f.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:i}=e;return a().createElement(Ne.Z,{open:n,title:g().text("Do you want to make a clean break?"),content:g().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:g().text("Delete relationship"),discardCaption:g().text("Cancel"),onDiscard:r,onSave:()=>{i(t),r()}})})),Ie=(0,r.memo)((e=>{let{uri:t}=e;const[n,i]=(0,r.useState)(!1),o=(0,r.useCallback)((()=>i(!0)),[]),l=(0,r.useCallback)((()=>i(!1)),[]);return a().createElement(a().Fragment,null,a().createElement(Re.k,{icon:Le.Z,size:"XXS",tooltipTitle:g().text("Delete"),onClick:o}),a().createElement(ke,{open:n,onClose:l,uri:t}))}));Ie.displayName="DeleteRelationButton";const je=Ie,Ze=(0,W.l)(_,((e,t)=>{let{relationshipTable:{onStartRelationEditing:n,editingRelations:r}}=e;return{onEdit:n,isEditing:r.some((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)}))}}),(e=>{let{rowValue:{relation:{uri:t}},className:n,onEdit:r,isEditing:i}=e;const o=fe();return a().createElement("div",{className:N()(o.controlsCell,n,{[o.editingMode]:i})},a().createElement(Re.k,{className:N()(o.editButton,{[o.hidden]:i}),icon:_e.Z,size:"XXS",tooltipTitle:g().text("Edit"),onClick:()=>r(t)}),a().createElement(je,{uri:t}))}));function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ue(e,t,n[t])}))}return e}function Ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ze=(e,t)=>t[e].relation.uri||`${e}`,De=(0,W.l)(_,(e=>{let{relationshipTable:t}=e;return Ae({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:i,total:o,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:u,editingRelations:p,loading:m}=e;const h=de(),f=(0,r.useMemo)((()=>[{id:"entityLabel",label:g().text("Profile"),headCellRenderer:xe,rowCellValueRenderer:Ce,sortable:!0,columnClassName:h.profileColumn},{id:"relationTypeLabel",label:g().text("Relationship type"),headCellRenderer:xe,rowCellValueRenderer:Ee,sortable:!0,columnClassName:h.relationshipTypeColumn},{id:"entityTypeLabel",label:g().text("Entity Type"),headCellRenderer:xe,rowCellValueRenderer:Ee,sortable:!0,columnClassName:h.entityTypeColumn},{id:"controls",label:"",headCellRenderer:xe,rowCellValueRenderer:Ze}]),[h]),b=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=b.current)||void 0===e||e.resetScrollbarPosition()}),[t]);const y=(0,r.useMemo)((()=>t.map((e=>null!=p&&p.some((t=>{var n;return t.initialRelation.uri===(null==e||null===(n=e.relation)||void 0===n?void 0:n.uri)}))?Ae({},e,{expanded:!0}):e))),[t,p]),v=(0,r.useMemo)((()=>({tableRow:N()(h.row,"collapsibleTableRow")})),[h]);return a().createElement("div",{className:h.tableWithPagination},a().createElement("div",{className:h.tableContainer},a().createElement(le,{ref:b,columnsData:f,rowsData:y,sorting:n,onSort:i,getRowKey:ze,ExpandedRowRenderer:Pe,defaultRowHeight:28,classes:v})),o>O[0]&&a().createElement(Q.Z,{count:o,rowsPerPageOptions:O,rowsPerPage:s,onChangeRowsPerPage:u,page:l,onChangePage:c,basicTableRef:b}),m&&a().createElement(d.Z,null))}));var Me=n(36444),Be=n(61837),Fe=n(33662);const Ge=(0,A.Z)((e=>({inactiveSearchIcon:{color:e.palette.text.secondary},activeSearchIcon:{color:e.palette.text.primary},input:{fontSize:"14px","&::placeholder":{color:`${e.palette.text.secondary} !important`,opacity:1}}}))),He=(0,W.l)(_,(0,f.pipe)((0,f.prop)("relationshipTable"),(0,f.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=Ge();return a().createElement(Fe.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:g().text("Search profiles"),classes:{input:r.input}})}));var Ve=n(92934),We=n(68977),qe=n(8629);const $e=(0,A.Z)((e=>({dialogPaper:{display:"flex",flexDirection:"column",padding:"12px 16px 8px"},title:{marginBottom:"21px",fontWeight:500,fontSize:"20px",lineHeight:"23px",letterSpacing:"0.25px",color:e.palette.text.primary},entityTypesSelector:{width:"468px",marginBottom:"20px"},relationTypesSelector:{width:"468px",marginBottom:"32px"},footer:{display:"flex"},clearAllButton:{marginRight:"auto"},cancelButton:{marginRight:"8px"}}))),Xe=(0,W.l)(_,(0,f.pipe)((0,f.prop)("relationshipTable"),(0,f.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:i,onFilter:o,entityTypesOptions:l,relationTypesOptions:s}=e;const c=$e(),[u,d]=(0,r.useState)([]),[p,m]=(0,r.useState)([]),h=()=>{d(i.entityTypesUris),m(i.relationTypesUris),n()};return(0,r.useEffect)((()=>{d(i.entityTypesUris),m(i.relationTypesUris)}),[i.entityTypesUris,i.relationTypesUris]),a().createElement(qe.Z,{classes:{paper:c.dialogPaper},onClose:h,open:t},a().createElement(K.Z,{className:c.title},g().text("Filter")),a().createElement(Ve.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:u,enableEmptyValueUnderline:!0,onChange:d}),a().createElement(We.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:m}),a().createElement("div",{className:c.footer},a().createElement(Te.Z,{className:c.clearAllButton,onClick:()=>{d([]),m([])}},g().text("Clear All")),a().createElement(Te.Z,{className:c.cancelButton,onClick:h},g().text("Cancel")),a().createElement(Te.Z,{onClick:()=>{o({entityTypesUris:u,relationTypesUris:p}),n()},color:"primary"},g().text("Apply"))))})),Ye=(0,A.Z)((e=>({wrapper:{display:"flex",alignItems:"center",paddingLeft:"16px",paddingRight:"2px"},iconButton:{marginLeft:"4px"},activeFiltersIcon:{color:e.palette.primary.main},inactiveFiltersIcon:{color:e.palette.text.secondary}}))),Ke=(0,W.l)(_,(0,f.pipe)((0,f.prop)("relationshipTable"),(0,f.pick)(["filters"])),(e=>{let{filters:t}=e;const n=Ye(),[i,o]=(0,r.useState)(!1),{entityTypesUris:l,relationTypesUris:s}=t,c=l.length||s.length;return a().createElement("div",{className:n.wrapper},a().createElement(He,null),a().createElement(Be.Z,{className:n.iconButton,onClick:()=>o(!0)},a().createElement(Me.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),a().createElement(Xe,{open:i,onClose:()=>o(!1)}))})),Qe=(0,A.Z)({caption:{marginLeft:"16px",marginTop:"12px",marginBottom:"14px",fontSize:"16px",lineHeight:"24px"},wrapper:{flex:1,display:"flex",flexDirection:"column",height:0}}),Je=()=>{const e=Qe();return a().createElement("div",{className:e.wrapper},a().createElement(K.Z,{className:e.caption,variant:"subtitle1"},g().text("Relationships")),a().createElement(Ke,null),a().createElement(De,null))};let et;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(et||(et={}));const tt=(0,r.memo)((()=>{var e;const t=G(),[n,i]=(0,r.useState)(null),o=(0,r.useCallback)((e=>{i((t=>t===e?null:e))}),[]),l=null!==n,s=(0,r.useMemo)((()=>[{buttonProps:{id:et.Relationship,icon:V,tooltipTitle:g().text("Relationship")},content:a().createElement(Je,null)},{buttonProps:{id:et.EntityDetails,icon:F.Z,tooltipTitle:g().text("Entity Details")},content:a().createElement(Y,null)}]),[]);return a().createElement("div",{className:t.wrapper},a().createElement(M.h,{open:l,width:480},a().createElement(q,null),null===(e=s[n])||void 0===e?void 0:e.content),a().createElement(B.G,{buttonsProps:(0,f.pluck)("buttonProps",s),onButtonClick:o,activeIndexId:n}))}));tt.displayName="GraphRightSidePanel";const nt=tt;var rt=n(46339),at=n(23304);const it=(e,t,n)=>{var r;if(!t.label)return;const a=n.labelSize,i=n.labelFont,o=n.labelWeight;e.fillStyle=null!==(r=n.labelColor)&&void 0!==r&&r.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color,e.font=`${o} ${a}px ${i}`,e.fillText(t.label,t.x+t.size+11,t.y+a/3)},ot=(e,t,n)=>{const r=n.labelSize,a=n.labelFont,i=n.labelWeight;if(e.font=`${i} ${r}px ${a}`,e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=2,e.shadowBlur=3,e.shadowColor="rgba(0,0,0,0.2)","string"==typeof t.label){const n=e.measureText(t.label).width,a=Math.round(n+16),i=Math.round(r+2+4),o=Math.max(t.size,r/2)+2,l=Math.asin(i/2/o),s=Math.sqrt(Math.abs(Math.pow(o,2)-Math.pow(i/2,2)));e.beginPath(),e.moveTo(t.x+s,t.y+i/2),e.lineTo(t.x+o+a,t.y+i/2),e.lineTo(t.x+o+a,t.y-i/2),e.lineTo(t.x+s,t.y-i/2),e.arc(t.x,t.y,o,l,-l),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+2,0,2*Math.PI),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,it(e,t,n)};var lt=n(88586);class st extends at.AbstractNodeProgram{constructor(e){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_borderSize;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\nvarying float v_borderRadius;\n\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n \n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n v_borderRadius = radius - (radius * a_borderSize / a_size); // border radius in node's size (full size is 1)\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}","\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\n\nvoid main(void) {\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(v_color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = v_color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, v_color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n}\n",1,5),this.borderSize=void 0,this.borderSize=e.getAttribLocation(this.program,"a_borderSize"),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.borderSize),e.vertexAttribPointer(this.borderSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16)}process(e,t,n){const r=this.array;let a=1*n*5;if(t||!e.inPath)return r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,void(r[a++]=0);r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a]=e.highlighted?4:2}render(e){const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.drawArrays(t.POINTS,0,this.array.length/5)}}class ct{constructor(){this.rebindTextureFns=[],this.images={},this.textureImage=void 0,this.hasReceivedImages=!1,this.pendingImagesFrameID=void 0,this.loadImage=(e,t)=>{if(this.images[e])return;const n=new Image;var r;n.addEventListener("load",(()=>{this.images[e]={status:"pending",image:n},"number"!=typeof this.pendingImagesFrameID&&(this.pendingImagesFrameID=requestAnimationFrame((()=>this.finalizePendingImages())))})),n.addEventListener("error",(()=>{this.images[e]={status:"error"}})),this.images[e]={status:"loading"},r=n,new URL(t,window.location.href).origin!==window.location.origin&&(r.crossOrigin=""),n.src=t},this.finalizePendingImages=()=>{this.pendingImagesFrameID=void 0;const e=[];for(const t in this.images){const n=this.images[t];"pending"===n.status&&e.push({id:t,image:n.image,size:Math.min(n.image.width,n.image.height)||1})}const t=document.createElement("canvas"),n=t.getContext("2d");t.width=e.reduce(((e,t)=>{let{size:n}=t;return e+n}),this.hasReceivedImages?this.textureImage.width:0),t.height=Math.max(this.hasReceivedImages?this.textureImage.height:0,...e.map((e=>{let{size:t}=e;return t})));let r=0;this.hasReceivedImages&&(n.putImageData(this.textureImage,0,0),r=this.textureImage.width),e.forEach((e=>{let{id:t,image:a,size:i}=e;const o=Math.min(128,i);let l=0,s=0;(a.width||0)>(a.height||0)?l=(a.width-a.height)/2:s=(a.height-a.width)/2,n.drawImage(a,l,s,i,i,r,0,o,o),this.images[t]={status:"ready",x:r,y:0,width:o,height:o},r+=o})),this.textureImage=n.getImageData(0,0,t.width,t.height),this.hasReceivedImages=!0,this.rebindTextureFns.forEach((e=>e()))}}}const ut={id:"defaultImage",path:(0,m.m5F)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};class dt extends at.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_texture;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float radius = 0.5;\n\n// convert color to gray\nvec4 toGrayscale(in vec4 color)\n{\n float average = (color.r + color.g + color.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}\n\nvoid main(void) {\n vec4 color;\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(v_color, texel, texel.a).rgb, max(texel.a, v_color.a));\n } else {\n color = v_color;\n }\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toGrayscale(color);\n }\n\n // distance from point to center of node\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n\n if (dist < radius - v_border) // points inside node\n gl_FragColor = color;\n else if (dist < radius) // border of node\n gl_FragColor = mix(transparent, color, (radius - dist) / v_border);\n else // points outside node\n gl_FragColor = transparent;\n}",1,9),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.inactive=void 0,this.imageLoader=new ct,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.inactive=e.getAttribLocation(this.program,"a_inactive");const n=e.getUniformLocation(this.program,"u_atlas");if(null===n)throw new Error("NodeProgramImage: error while getting atlasLocation");this.atlasLocation=n,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),this.imageLoader.loadImage(ut.id,ut.path),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.textureLocation),e.enableVertexAttribArray(this.inactive),e.vertexAttribPointer(this.inactive,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20)}process(e,t,n){const r=this.array;let a=1*n*9;const i=e.image;let o=i&&this.imageLoader.images[i];if("string"!=typeof i||o||this.imageLoader.loadImage(i,i),t)return r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,void(r[a++]=0);if(r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a++]=e.inactive?1:0,o&&"ready"===o.status||(o=this.imageLoader.images[ut.id]),o&&"ready"===o.status){const{width:e,height:t}=this.imageLoader.textureImage;r[a++]=o.x/e,r[a++]=o.y/t,r[a++]=o.width/e,r[a++]=o.height/t}else r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1i(this.atlasLocation,0),t.drawArrays(t.POINTS,0,this.array.length/9)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}const pt=[{id:"expandIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.80013 7.20003V4H7.20013L7.20013 7.20003H4V8.80003H7.20013L7.20013 12H8.80013V8.80003H12V7.20003H8.80013Z" fill="black" fill-opacity="0.541176"/>\n</svg>')},{id:"collapseIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path d="M4 7.20004H12V8.80004H4V7.20004Z" fill="black" fill-opacity="0.541176"/>\n</svg>\n')}];class mt extends at.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_buttonSize;\nattribute vec2 a_normals;\nattribute vec4 a_texture;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying float v_border;\nvarying vec4 v_texture;\nvarying vec4 v_color;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normals);\n vec2 unitNormal = (a_normals) / normalLength;\n\n float pixelsThickness = max(normalLength, 1.0 * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Move the point\n float adaptedWebGLNodeRadius = a_size * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n vec2 compensationVector = vec2(-unitNormal.y, unitNormal.x) * (adaptedWebGLNodeRadius);\n\n // Set position\n gl_Position = vec4((u_matrix * vec3(a_position + compensationVector, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_buttonSize * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main(void) {\n vec4 color;\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5));\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(black, texel, texel.a).rgb, max(texel.a, bias));\n } else {\n color = black;\n }\n\n if (distToCenter < radius - v_border) // points inside button\n gl_FragColor = color;\n else if (distToCenter < radius) // border of button\n gl_FragColor = mix(transparent, color, (0.5 - distToCenter) / v_border);\n else // points outside button\n gl_FragColor = transparent;\n}",2,11),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.buttonSize=void 0,this.normals=void 0,this.correctionRatioLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.imageLoader=new ct,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.buttonSize=e.getAttribLocation(this.program,"a_buttonSize"),this.normals=e.getAttribLocation(this.program,"a_normals");const n=e.getUniformLocation(this.program,"u_correctionRatio");if(null===n)throw new Error("NodeButtonsProgram: error while getting correctionRatioLocation");this.correctionRatioLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("NodeButtonsProgram: error while getting sqrtZoomRatioLocation");this.sqrtZoomRatioLocation=r;const a=e.getUniformLocation(this.program,"u_atlas");if(null===a)throw new Error("NodeButtonsProgram: error while getting atlasLocation");this.atlasLocation=a,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),pt.map((e=>this.imageLoader.loadImage(e.id,e.path))),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.buttonSize),e.enableVertexAttribArray(this.normals),e.enableVertexAttribArray(this.textureLocation),e.vertexAttribPointer(this.buttonSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.normals,2,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,28)}process(e,t,n){const r=this.array;let a=2*n*11;const i=t||e.inactive&&!e.highlighted,[o,l]=e.buttonOffset||[0,0];let s=o*o+l*l,c=0,u=0;if(s&&(s=1/Math.sqrt(s),c=l*s,u=o*s),i||0===e.untraversedRelationsCount)r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0;else{const t=this.imageLoader.images.expandIcon;if(r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a++]=e.buttonSize||0,r[a++]=c,r[a++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[a++]=t.x/e,r[a++]=t.y/n,r[a++]=t.width/e,r[a++]=t.height/n}else r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0}if(i||0===e.traversedRelationsCount)r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0;else{const t=this.imageLoader.images.collapseIcon;if(r[a++]=e.x,r[a++]=e.y,r[a++]=e.size,r[a++]=(0,lt.floatColor)(e.color),r[a++]=e.buttonSize||0,r[a++]=-c,r[a++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[a++]=t.x/e,r[a++]=t.y/n,r[a++]=t.width/e,r[a++]=t.height/n}else r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0}}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.uniform1i(this.atlasLocation,1),t.drawArrays(t.POINTS,0,this.array.length/11)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}const ht=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:ot,labelRenderer:it,nodeProgramClasses:{image:(0,at.createNodeCompoundProgram)([dt,st,mt])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return a().createElement(rt.C6,{graph:p.MultiGraph,style:{background:"transparent"},initialSettings:n},t)};var gt=n(28833),ft=n.n(gt),bt=n(3660),yt=n.n(bt),vt=n(28301),xt=n.n(vt),Et=n(31181),wt=n(30284);const Ct=.6,Tt=(e,t,n,r,a)=>{if(t.loop){const{size:r,color:a}=t,i=n.x,o=n.y,l=n.size,s=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x1:e-7*(n+r),y1:t,x2:e,y2:t+7*(n+r)}}(i,o,.6*l);if(e.strokeStyle=a,e.lineWidth=r,"arrow"===t.type){const{aX:t,aY:n,vX:r,vY:c}=((e,t,n,r)=>{const a=Math.max(.5*r,5),i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return{aX:e.x1+(t-e.x1)*(i-a-r)/i,aY:e.y1+(n-e.y1)*(i-a-r)/i,vX:(t-e.x1)*a/i,vY:(n-e.y1)*a/i}})(s,i,o,l);e.beginPath(),e.moveTo(i,o),e.bezierCurveTo(s.x2,s.y2,s.x1,s.y1,t,n),e.stroke(),e.fillStyle=a,e.beginPath(),e.moveTo(t+r,n+c),e.lineTo(t+c*Ct,n-r*Ct),e.lineTo(t-c*Ct,n+r*Ct),e.lineTo(t+r,n+c),e.closePath(),e.fill()}else e.beginPath(),e.moveTo(i,o),e.bezierCurveTo(s.x1,s.y1,s.x2,s.y2,i,o),e.stroke()}(0,wt.default)(e,t,n,r,a)};function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){St(e,t,n[t])}))}return e}function St(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pt=(0,f.memoizeWith)(((e,t,n)=>n.type),m.uie),Rt={size:24,buttonSize:8,buttonOffset:[19,19]},_t={size:12,buttonSize:6,buttonOffset:[8,13]},Lt=e=>{let{data:t,graph:n,syncLayout:a,workerLayout:o,layoutSettings:l,selectedNode:s,onNodeClick:c,filters:d}=e;const p=(0,rt.Ys)(),m=(0,rt.sG)(),h=(0,rt.$j)(),g=(0,rt.eP)(),f=(0,i.useSelector)(u.ZP.selectors.getEntity),v=(0,i.useSelector)(u.ZP.selectors.getMetadata),x=(0,i.useSelector)(u.ZP.selectors.getAbsoluteImagePath)||"",[E,w]=(0,r.useState)(void 0),[C,T]=(0,r.useState)(null),[O,S]=(0,r.useState)({});(0,r.useEffect)((()=>{p.getCamera().setState({ratio:1.2})}),[n,p]),(0,r.useEffect)((()=>{if(T((0,y.toUndirected)(n)),m(n),a){const e=a(p.getGraph(),l);(0,Et.animateNodes)(p.getGraph(),e,{duration:1e3})}if(o){const e=new o(p.getGraph(),l);e.start();const t=setTimeout((()=>{e.stop()}),5e3);return()=>{clearTimeout(t),e.kill()}}}),[t,n,a,o,p,l,m]);const P=(0,r.useCallback)((e=>{const t=p.getGraph(),n=null==f?void 0:f.uri;if(t&&C&&n&&e&&n!==e){const r=(0,b.Ar)(C,n,e),a=((e,t)=>{const n=[];return t&&t.reduce(((t,r)=>(n.push(e.findEdge(t,r,(e=>!!e))||e.findEdge(r,t,(e=>!!e))),r))),n})(t,r);return{edges:a,nodes:r}}return{}}),[p,null==f?void 0:f.uri,C]);(0,r.useEffect)((()=>{S(P(s))}),[s,P]),(0,r.useEffect)((()=>{h({enterNode:e=>{let{node:t}=e;w(t)},leaveNode:()=>{w(void 0)},clickNode:e=>{let{node:t}=e;c(t)}})}),[p,h,c]),(0,r.useEffect)((()=>{const e=p.getGraph(),t=e.neighbors(s);g({nodeReducer:(e,n)=>{const{entityTypesUris:r=[]}=d||{},a=Pt(v,x,{type:n.entityTypeUri}),i=Ot({},n,e===s?Rt:_t,{color:"#0072CE",image:a}),o=(O.nodes||[]).includes(e),l=E===e;return o||e===s?i.inPath=!0:!t||t.includes(e)||s===e||s===(null==f?void 0:f.uri)||o||(l||(i.label=""),i.inactive=!0),l&&(i.highlighted=!0),![s,null==f?void 0:f.uri].includes(e)&&r.length>0&&!r.includes(n.entityTypeUri)&&(i.hidden=!0),i},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=d||{},a=Ot({},n,{hidden:!1}),i=(O.edges||[]).includes(t);return(s&&s!==(null==f?void 0:f.uri)&&!e.hasExtremity(t,s)&&!i||r.length>0&&!r.includes(n.relationTypeUri))&&(a.hidden=!0),i&&(a.color="#0072CE",a.size=4),a},renderEdgeLabels:!0,edgeLabelRenderer:Tt})}),[p,g,E,s,O,null==f?void 0:f.uri,v,x,d])};function Nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){kt(e,t,n[t])}))}return e}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const It=e=>{let{data:t,graph:n,selectedNode:a,onNodeClick:i,filters:o}=e;const l=(0,r.useMemo)((()=>(ft().assign(n),{settings:Nt({},yt().inferSettings(n),{gravity:1})})),[n]);return Lt({workerLayout:xt(),layoutSettings:l,data:t,graph:n,selectedNode:a,onNodeClick:i,filters:o}),null};var jt=n(36039);let Zt;!function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy"}(Zt||(Zt={}));const At=(e,t,n,r)=>{const a=new Set;return t.length||t.push(Array.from(e)),e.forEach((t=>{n.add(t),r.forEach((r=>{r.from!==t||e.has(r.to)||n.has(r.to)||a.add(r.to)}))})),a.size&&t.push(Array.from(a)),((e,t,n)=>{const r=new Set;return e.forEach((e=>{t.forEach((t=>{t.from!==e||n.has(t.to)||r.add(t.to)}))})),!!r.size})(a,r,n)?At(a,t,n,r):t},Ut=(e,t,n,r)=>{if(e.length<10&&(t[r]=[...e]),e.length>10){const a=e.slice(10),i=e.slice(0,10);t[r]=i,t[r+1]=n[r+1]?[...n[r+1],...a]:a}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return Ut(e,t,n,r)}return t};function zt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dt=e=>{let{data:t,graph:n,selectedNode:a,layout:i,onNodeClick:o,filters:l}=e;const s=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case Zt.VERTICAL_TB:return 180;case Zt.HORIZONTAL_LR:return 270}})(i),r=((e,t)=>{const n=e.nodes,r=e.edges.filter((e=>e.from!==e.to)),a=((e,t,n)=>{const r=new Set;return t.forEach((t=>{e.some((e=>e.to===t.id))||r.add(t.id)})),r.size||r.add(n),r})(r,n,t),i=At(a,[],new Set,r);return Ut(i[0],[],i,0)})((e=>({nodes:e.nodes().map((e=>({id:e,name:""}))),edges:e.mapEdges(((e,t,n,r)=>({from:n,to:r,key:e,relationTypeUri:""})))}))(t),a),o=(e=>{const t=e.map((e=>e.length));return Math.max(...t)})(r);for(let e=0;e<r.length;++e)for(let n=0;n<r[e].length;++n)t.setNodeAttribute(r[e][n],"x",(s=n,(l=r[e].length)===(c=o)?5*s:1===l?5*(c-1)/2:5*(c-1)/(l+1)*(s+1))),t.setNodeAttribute(r[e][n],"y",10*e);var l,s,c;return jt.rotation.assign(t,n,{degrees:!0}),t.reduceNodes(((e,t,n)=>{let{x:r,y:a}=n;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){zt(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:a}})}),{})}),[i,a]);return Lt({syncLayout:s,data:t,graph:n,selectedNode:a,onNodeClick:o,filters:l}),null};var Mt=n(84425);const Bt=(0,A.Z)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),Ft=(0,W.l)(_,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const o=Bt(),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,i.useSelector)(u.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:g().text("All"),value:null},...(0,m.mmY)(l,s.type).map((e=>{let{uri:t,label:n}=e;return{value:t,label:n}}))]),[s,l]),d=(0,r.useMemo)((()=>c.find((e=>e.value===t))),[c,t]);return a().createElement(Mt.Z,{classes:{valueContainer:o.valueContainer},className:o.graphTypeSelector,height:42,label:g().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:o.filledInputRoot}}}})})),Gt=(0,A.Z)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),Ht=(0,r.memo)((e=>{let{value:t,onChangeHandler:n}=e;const r=Gt(),i=[{label:g().text("Simple network"),value:Zt.SIMPLE_NETWORK},{label:g().text("Vertical hierarchy"),value:Zt.VERTICAL_TB},{label:g().text("Horizontal hierarchy"),value:Zt.HORIZONTAL_LR}];return a().createElement(Mt.Z,{className:r.graphLayoutSelector,label:g().text("Graph layout"),value:i.find((0,f.propEq)("value",t)),options:i,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:r.filledInputRoot}}}})})),Vt=(0,A.Z)({wrapper:{height:"100%",position:"relative"},selectors:{display:"flex",position:"absolute",top:"12px",right:"16px",zIndex:2},graph:{height:"calc(100% - 5px)"}});function Wt(){return Wt=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},Wt.apply(this,arguments)}const qt=(0,W.l)(_,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:a,relationshipTable:{filters:i}}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:a,filters:i}}),(e=>{let{data:t,graph:n,selectedNode:i,onNodeSelect:o,filters:l}=e;const[s,c]=(0,r.useState)(Zt.SIMPLE_NETWORK),u=Vt(),d={data:t,graph:n,selectedNode:i,onNodeClick:o,filters:l};return a().createElement("div",{className:u.wrapper},a().createElement("div",{className:u.selectors},a().createElement(Ft,null),a().createElement(Ht,{value:s,onChangeHandler:c})),a().createElement("div",{className:u.graph},n&&a().createElement(ht,null,s===Zt.SIMPLE_NETWORK?a().createElement(It,d):a().createElement(Dt,Wt({},d,{layout:s})))))})),$t=(0,A.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},graphWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1},graphContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Xt=(0,r.memo)((()=>{const e=$t(),t=(0,i.useSelector)(u.ZP.selectors.getEntity),n=(e=>{const{graphLoading:t,data:n,graphologyGraph:a,graphTypeUri:o,setGraphTypeUri:l,onDeleteRelation:s}=E(e),{selectedEntity:c,onEntitySelect:d,selectedEntityLoading:p}=((e,t)=>{const n=(0,w._)(),a=(0,i.useDispatch)(),[o,l]=(0,r.useState)(null),s=(0,r.useRef)({}),[c,d]=(0,r.useState)(!1),p=(0,r.useCallback)((e=>{const t=s.current[e];return t?Promise.resolve(t):(0,m.HvW)(e).then((e=>(s.current=T(s.current,e),e)))}),[]),h=(0,r.useCallback)((e=>{var r;const i=null==t||null===(r=t.entities)||void 0===r?void 0:r.find((0,f.propEq)("uri",e));i&&l(i),d(!0),n(p(e)).then(l).catch((e=>{a(u.ui.actions.errorSet((0,m.xU7)(e,g().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[a,t,n,p]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=T({},e),h(e.uri))}),[null==e?void 0:e.uri]),(0,r.useEffect)((()=>{const n=null==t?void 0:t.entities.find((e=>(null==o?void 0:o.uri)===e.uri));n||(null!=e&&e.uri?(s.current=T({},e),h(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:o,onEntitySelect:h}})(e,n);return{graphLoading:t,data:n,graphologyGraph:a,onDeleteRelation:s,selectedEntity:c,onEntitySelect:d,selectedEntityLoading:p,graphTypeUri:o,setGraphTypeUri:l,relationshipTable:R({data:n,selectedEntityUri:null==c?void 0:c.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:o})}})(t),{graphLoading:o}=n;return a().createElement(_.Provider,{value:n},a().createElement("div",{className:e.perspectiveView},o&&a().createElement(d.Z,null),(null==t?void 0:t.uri)&&a().createElement("div",{className:e.graphContainer},a().createElement("div",{className:e.graphWrapper},a().createElement(D,null),a().createElement(qt,null)),a().createElement(nt,null))))}));Xt.displayName="GraphPerspectiveView";const Yt=Xt,Kt=(0,o.createGenerateClassName)({productionPrefix:"graph",disableGlobal:!0}),Qt=e=>{let{store:t}=e;return a().createElement(i.Provider,{store:t},a().createElement(o.StylesProvider,{generateClassName:Kt},a().createElement(s.MuiPickersUtilsProvider,{utils:c.Z},a().createElement(Yt,null),a().createElement(l.Z,{showErrorFromStore:!0}))))}}}]);
|